diff --git a/.gitignore b/.gitignore index cc239aa..b562531 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ node_modules dist .next out -.vercel \ No newline at end of file +.vercel +*.tsbuildinfo diff --git a/app/Editor.jsx b/app/Editor.jsx index e9bfe8b..99ae9eb 100644 --- a/app/Editor.jsx +++ b/app/Editor.jsx @@ -29,9 +29,11 @@ export function Editor({ onBeforeEachRun = () => {}, autoRun = true, toolBarStart = null, + toolBarEnd = null, pinToolbar = true, onDuplicate = null, onError = onDefaultError, + readonly = false, }) { const containerRef = useRef(null); const editorRef = useRef(null); @@ -40,8 +42,8 @@ export function Editor({ useEffect(() => { if (containerRef.current) { containerRef.current.innerHTML = ""; - editorRef.current = createEditor(containerRef.current, {code: initialCode, onError}); - if (autoRun) onRun(); + editorRef.current = createEditor(containerRef.current, {code: initialCode, onError, readonly}); + if (autoRun && !readonly) onRun(); } return () => { if (editorRef.current) { @@ -49,7 +51,7 @@ export function Editor({ } }; // eslint-disable-next-line react-hooks/exhaustive-deps - }, [initialCode]); + }, [initialCode, readonly]); useEffect(() => { const onInput = (code) => { @@ -95,7 +97,7 @@ export function Editor({ } return ( -
No notebooks found.
+ + New + +No notebooks found.
- - New - +function SkeletonCard() { + return ( ++ Explore code and art with instant feedback. +
+