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

@ -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
&nbsp;
<div className="lambdaInner">
<EnvContext value={innerEnv}>
<Editor
<ExprBlock
state={state.expr}
setState={setExpr}
onCancel={() => setState(state => state.expr)}