Skip to content

Commit

Permalink
not broken
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Oct 19, 2024
1 parent 0b8800a commit 500a3f6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 9 additions & 2 deletions apps/repl/app/components/limber/layout/index.gts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ const containerDirection = (state) => {
return isHorizontalSplit(state.snapshot);
};

function updateOrientation(isVertical: boolean) {
return {
type: 'ORIENTATION',
isVertical,
};
}

export const Layout: TOC<{
Blocks: {
editor: [];
Expand All @@ -67,7 +74,7 @@ export const Layout: TOC<{
But XState is an *evented* system, so we have to send events.
}}
{{effect (fn state.send "ORIENTATION" (hash isVertical=isVertical))}}
{{effect (fn state.send (updateOrientation isVertical))}}

<div
{{! row = left to right, col = top to bottom }}
Expand All @@ -79,7 +86,7 @@ export const Layout: TOC<{
<Controls
@isMinimized={{state.matches "hasContainer.minimized"}}
@isMaximized={{state.matches "hasContainer.maximized"}}
@needsControls={{toBoolean state.context.container}}
@needsControls={{toBoolean state.snapshot.context.container}}
@splitHorizontally={{horizontallySplit}}
@send={{state.send}}
/>
Expand Down
8 changes: 4 additions & 4 deletions apps/repl/app/components/limber/layout/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ export const LayoutState = setup({
target: '.hasContainer',
actions: assign({
handle: ({ event }) => event.container.nextElementSibling,
container: ({ event }) => event.container.container,
observer: ({ event }) => event.container.observer,
maximize: ({ event }) => event.container.maximize,
minimize: ({ event }) => event.container.minimize,
container: ({ event }) => event.container,
observer: ({ event }) => event.observer,
maximize: ({ event }) => event.maximize,
minimize: ({ event }) => event.minimize,
}),
},
CONTAINER_REMOVED: {
Expand Down

0 comments on commit 500a3f6

Please sign in to comment.