diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e7b5fdd..658260d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,7 +10,7 @@ importers: dependencies: dope2: specifier: git+https://deemz.org/git/joeri/dope2.git - version: git+https://deemz.org/git/joeri/dope2.git#443a13998dc3eccab26c27bee4fa056cdbc8f994 + version: git+https://deemz.org/git/joeri/dope2.git#e631f11aa52b2adda8809c1b0b41cc991fbe8890 react: specifier: ^19.1.0 version: 19.1.0 @@ -633,8 +633,8 @@ packages: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} - dope2@git+https://deemz.org/git/joeri/dope2.git#443a13998dc3eccab26c27bee4fa056cdbc8f994: - resolution: {commit: 443a13998dc3eccab26c27bee4fa056cdbc8f994, repo: https://deemz.org/git/joeri/dope2.git, type: git} + dope2@git+https://deemz.org/git/joeri/dope2.git#e631f11aa52b2adda8809c1b0b41cc991fbe8890: + resolution: {commit: e631f11aa52b2adda8809c1b0b41cc991fbe8890, repo: https://deemz.org/git/joeri/dope2.git, type: git} version: 0.0.1 dunder-proto@1.0.1: @@ -1762,7 +1762,7 @@ snapshots: depd@2.0.0: {} - dope2@git+https://deemz.org/git/joeri/dope2.git#443a13998dc3eccab26c27bee4fa056cdbc8f994: + dope2@git+https://deemz.org/git/joeri/dope2.git#e631f11aa52b2adda8809c1b0b41cc991fbe8890: dependencies: functional-red-black-tree: 1.0.1 diff --git a/src/App.tsx b/src/App.tsx index 05505d0..42d9d1a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -6,15 +6,14 @@ import { CommandContext } from './CommandContext'; import { EnvContext } from './EnvContext'; export function App() { - // const [history, setHistory] = useState([initialEditorState]); + const [history, setHistory] = useState([initialEditorState]); // const [history, setHistory] = useState([nonEmptyEditorState]); - const [history, setHistory] = useState([tripleFunctionCallEditorState]); + // const [history, setHistory] = useState([tripleFunctionCallEditorState]); const [future, setFuture] = useState([]); - const pushHistory = (callback: (p: EditorState) => EditorState) => { - const newState = callback(history.at(-1)!); - setHistory(history.concat([newState])); + const pushHistory = (s: EditorState) => { + setHistory(history.concat([s])); setFuture([]); }; @@ -51,11 +50,11 @@ export function App() { window.onkeydown = onKeyDown; }, []); - const commands: [string, string[], string][] = [ - ["call" , ['c' ], "call" ], - ["eval" , ['e','Tab','Enter' ], "eval" ], - ["transform", ['t', '.' ], "transform" ], - ["let" , ['l', '=', 'a' ], "let ... in ..."], + const commands = [ + ["call" , "[c] call" ], + ["eval" , "[e] [Tab] [Enter] eval"], + ["transform", "[t] [.] transform" ], + ["let" , "[l] [=] let ... in ..." ], ]; const [highlighted, setHighlighted] = useState( @@ -75,9 +74,8 @@ export function App() { Commands: { - commands.map(([_, keys, descr], i) => + commands.map(([_, descr], i) => - {keys.map((key, j) => {key})} {descr} ) } @@ -88,12 +86,11 @@ export function App() { {}} onCancel={() => {}} filter={() => true} /> - -