Skip to content

Commit

Permalink
yay
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Oct 19, 2024
1 parent 500a3f6 commit 239b90c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions apps/repl/app/components/limber/layout/index.gts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// need to Fix something in ember-statechart-component
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
import { assert } from '@ember/debug';
import { fn, hash } from '@ember/helper';
import { fn } from '@ember/helper';

import { modifier } from 'ember-modifier';

Expand All @@ -14,12 +11,16 @@ import { ResizeHandle } from './resize-handle';
import { isHorizontalSplit, LayoutState, setupResizeObserver } from './state';

import type { TOC } from '@ember/component/template-only';
import type { ReactiveActorFrom } from 'ember-statechart-component';

type ReactiveActor = ReactiveActorFrom<typeof LayoutState>;

const setupState = modifier((element: Element, [send]: [(event: string) => void]) => {
assert(`Element is not resizable`, element instanceof HTMLElement);

let observer = setupResizeObserver(() => send('RESIZE'));

// @ts-expect-error need to fix the type of this for ember-statechart-component
send({
type: 'CONTAINER_FOUND',
container: element,
Expand All @@ -37,15 +38,15 @@ const effect = (fn: (...args: unknown[]) => void) => {
fn();
};

const isResizable = (state) => {
const isResizable = (state: ReactiveActor) => {
return !(state.matches('hasContainer.minimized') || state.matches('hasContainer.maximized'));
};

/**
* true for horizontally split
* false for vertically split
*/
const containerDirection = (state) => {
const containerDirection = (state: ReactiveActor) => {
if (state.matches('hasContainer.default.horizontallySplit')) {
return true;
}
Expand Down

0 comments on commit 239b90c

Please sign in to comment.