MiniRepl: add punchcard flag for implicit vis

+ reintroduce editPattern
+ add punchcards to mini-notation.mdx
This commit is contained in:
Felix Roos 2023-01-13 15:13:39 +01:00
parent e4f538b674
commit b2c6d87633
10 changed files with 323 additions and 310 deletions

View file

@ -22,7 +22,7 @@ if (typeof window !== 'undefined') {
prebake();
}
export function MiniRepl({ tune, drawTime }) {
export function MiniRepl({ tune, drawTime, punchcard, canvasHeight = 100 }) {
const [Repl, setRepl] = useState();
useEffect(() => {
// we have to load this package on the client
@ -31,5 +31,11 @@ export function MiniRepl({ tune, drawTime }) {
setRepl(() => res.MiniRepl);
});
}, []);
return Repl ? <Repl tune={tune} hideOutsideView={true} drawTime={drawTime} /> : <pre>{tune}</pre>;
return Repl ? (
<div className="mb-4">
<Repl tune={tune} hideOutsideView={true} drawTime={drawTime} punchcard={punchcard} canvasHeight={canvasHeight} />
</div>
) : (
<pre>{tune}</pre>
);
}