remove SquiggleEditorWithImportedBindings

This commit is contained in:
Vyacheslav Matyukhin 2022-09-01 14:40:56 +04:00
parent 48fb634140
commit 4a3c982c57
No known key found for this signature in database
GPG Key ID: 3D2A774C5489F96C
2 changed files with 0 additions and 54 deletions

View File

@ -1,53 +0,0 @@
import React from "react";
// import { SquiggleEditor } from "./SquiggleEditor";
import type { SquiggleEditorProps } from "./SquiggleEditor";
// import { runPartial, defaultBindings } from "@quri/squiggle-lang";
// import type {
// result,
// errorValue,
// bindings as bindingsType,
// } from "@quri/squiggle-lang";
// function resultDefault(x: result<bindingsType, errorValue>): bindingsType {
// switch (x.tag) {
// case "Ok":
// return x.value;
// case "Error":
// return defaultBindings;
// }
// }
export type SquiggleEditorWithImportedBindingsProps = SquiggleEditorProps & {
bindingsImportUrl: string;
};
export const SquiggleEditorWithImportedBindings: React.FC<
SquiggleEditorWithImportedBindingsProps
> = (props) => {
return <div>NOT IMPLEMENTED IN 0.4 YET</div>;
// const { bindingsImportUrl, ...editorProps } = props;
// const [bindingsResult, setBindingsResult] = React.useState({
// tag: "Ok",
// value: defaultBindings,
// } as result<bindingsType, errorValue>);
// React.useEffect(() => {
// async function retrieveBindings(fileName: string) {
// let contents = await fetch(fileName).then((response) => {
// return response.text();
// });
// setBindingsResult(
// runPartial(
// contents,
// editorProps.bindings,
// editorProps.environment,
// editorProps.jsImports
// )
// );
// }
// retrieveBindings(bindingsImportUrl);
// }, [bindingsImportUrl]);
// const deliveredBindings = resultDefault(bindingsResult);
// return (
// <SquiggleEditor {...{ ...editorProps, bindings: deliveredBindings }} />
// );
};

View File

@ -2,4 +2,3 @@ export { SquiggleChart } from "./components/SquiggleChart";
export { SquiggleEditor } from "./components/SquiggleEditor"; export { SquiggleEditor } from "./components/SquiggleEditor";
export { SquigglePlayground } from "./components/SquigglePlayground"; export { SquigglePlayground } from "./components/SquigglePlayground";
export { SquiggleContainer } from "./components/SquiggleContainer"; export { SquiggleContainer } from "./components/SquiggleContainer";
export { SquiggleEditorWithImportedBindings } from "./components/SquiggleEditorWithImportedBindings";