rename Editor -> ExprBlock
This commit is contained in:
parent
fe83532261
commit
93f665ba8f
9 changed files with 55 additions and 56 deletions
|
|
@ -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">
|
||||
𝑓𝑛
|
||||
<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>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue