diff --git a/core/src/engine/noop.ts b/core/src/engine/noop.ts index d59b7e6..0cf2979 100644 --- a/core/src/engine/noop.ts +++ b/core/src/engine/noop.ts @@ -8,7 +8,7 @@ export async function generate( _: unknown ): Promise<{ debug: D; message: string }> { await new Promise((resolve) => { - setTimeout(() => resolve(), 750); + setTimeout(() => resolve(), 7500); }); return { message: diff --git a/web/src/app/ailly.ts b/web/src/app/ailly.ts index 2852abc..cee716c 100644 --- a/web/src/app/ailly.ts +++ b/web/src/app/ailly.ts @@ -5,7 +5,7 @@ import { Ailly, types } from "@ailly/core"; export async function generateOne(content: types.Content) { const settings = await Ailly.makePipelineSettings({ root: "/ailly", - engine: "noop", + // engine: "noop", }); const manager = await Ailly.GenerateManager.from( [content.path], diff --git a/web/src/app/editor.module.css b/web/src/app/editor.module.css index 864b8af..b65236c 100644 --- a/web/src/app/editor.module.css +++ b/web/src/app/editor.module.css @@ -11,4 +11,5 @@ border: none; border-radius: var(--size-base); box-shadow: lightgrey 0 0 2px 4px; + margin-top: calc(var(--size-base) * 5); } diff --git a/web/src/app/editor.tsx b/web/src/app/editor.tsx index cd06866..8d6c8d0 100644 --- a/web/src/app/editor.tsx +++ b/web/src/app/editor.tsx @@ -3,34 +3,27 @@ import { useAillyPageStore } from "./store"; import styles from "./editor.module.css"; +import { ChangeEvent, useMemo } from "react"; +const INPUT_DELAY = 900; export const Editor = (store: ReturnType) => { - const { state, actions } = store; + const { actions } = store; + + const onChange = useMemo(() => { + let timer: ReturnType; + return (e: ChangeEvent) => { + clearTimeout(timer); + timer = setTimeout(() => actions.prompt(e.target.value), INPUT_DELAY); + }; + }, []); return ( -
-
    - {state.selections - .map((selections, block) => - selections.map((opt) => ( -
  1. -
    -

    {state.story[block].options[opt].content}

    -
    -
  2. - )) - ) - .flat()} -
  3. -