rename Editor -> ExprBlock
This commit is contained in:
parent
fe83532261
commit
93f665ba8f
9 changed files with 55 additions and 56 deletions
|
|
@ -2,25 +2,23 @@ import { useContext, useEffect, useRef } from "react";
|
|||
|
||||
import { growEnv } from "dope2";
|
||||
|
||||
import { Editor, type EditorState, type State2Props } from "./Editor";
|
||||
import { ExprBlock, type ExprBlockState, type State2Props } from "./ExprBlock";
|
||||
import { EnvContext } from "./EnvContext";
|
||||
import { evalEditorBlock, getUnusedTypeVar, type ResolvedType } from "./eval";
|
||||
import { getUnusedTypeVar } from "./eval";
|
||||
import { autoInputWidth } from "./util/dom_trickery";
|
||||
|
||||
import "./LambdaBlock.css";
|
||||
|
||||
|
||||
|
||||
export interface LambdaBlockState {
|
||||
kind: "lambda";
|
||||
paramName: string;
|
||||
expr: EditorState;
|
||||
expr: ExprBlockState;
|
||||
}
|
||||
|
||||
interface LambdaBlockProps<
|
||||
FnState=EditorState,
|
||||
InputState=EditorState,
|
||||
> extends State2Props<LambdaBlockState,EditorState> {}
|
||||
FnState=ExprBlockState,
|
||||
InputState=ExprBlockState,
|
||||
> extends State2Props<LambdaBlockState,ExprBlockState> {}
|
||||
|
||||
|
||||
export function LambdaBlock({state, setState, suggestionPriority}: LambdaBlockProps) {
|
||||
|
|
@ -73,7 +71,7 @@ export function LambdaBlock({state, setState, suggestionPriority}: LambdaBlockPr
|
|||
|
||||
<div className="lambdaInner">
|
||||
<EnvContext value={innerEnv}>
|
||||
<Editor
|
||||
<ExprBlock
|
||||
state={state.expr}
|
||||
setState={setExpr}
|
||||
onCancel={() => setState(state => state.expr)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue