rename Editor -> ExprBlock

This commit is contained in:
Joeri Exelmans 2025-05-18 11:10:25 +02:00
parent fe83532261
commit 93f665ba8f
9 changed files with 55 additions and 56 deletions

View file

@ -1,6 +1,6 @@
import { useContext } from "react";
import { Editor, type EditorState, type SetStateFn, type State2Props } from "./Editor";
import { ExprBlock, type ExprBlockState, type SetStateFn, type State2Props } from "./ExprBlock";
import { EnvContext } from "./EnvContext";
import { evalCallBlock2, evalEditorBlock, scoreResolved, type ResolvedType } from "./eval";
import { GlobalContext } from "./GlobalContext";
@ -10,14 +10,14 @@ import "./CallBlock.css";
export interface CallBlockState {
kind: "call";
fn: EditorState;
input: EditorState;
fn: ExprBlockState;
input: ExprBlockState;
}
interface CallBlockProps<
FnState=EditorState,
InputState=EditorState,
> extends State2Props<CallBlockState,EditorState> {}
FnState=ExprBlockState,
InputState=ExprBlockState,
> extends State2Props<CallBlockState,ExprBlockState> {}
function nestedFnProperties({state, setState, suggestionPriority}: CallBlockProps, env) {
const setFn = (callback: SetStateFn) => {
@ -91,7 +91,7 @@ function FunctionHeader(props) {
// end of recursion - draw function name
return <span className="functionName">
&nbsp;&#119891;&#119899;&nbsp;
<Editor {...nestedProperties} />
<ExprBlock {...nestedProperties} />
</span>;
}
}
@ -109,7 +109,7 @@ function InputParams({ depth, errorDepth, ...rest }) {
errorDepth={errorDepth}
/>}
{/* Our own input param */}
<Editor
<ExprBlock
{...nestedInputProperties(rest as CallBlockProps, env)}
/>
</div>;