Visualize Your Ideas With Code
fix(docs): fix the showcase editor (#589)
Jacob4964e7742dea
diff --git a/packages/docs/blog/2023-03-28-version-3.4.0.mdx b/packages/docs/blog/2023-03-28-version-3.4.0.mdxindex aaa6b1e3..dc1f2912 100644--- a/packages/docs/blog/2023-03-28-version-3.4.0.mdx+++ b/packages/docs/blog/2023-03-28-version-3.4.0.mdx@@ -22,7 +22,7 @@ import CodeBlock from '@theme/CodeBlock';<CodeBlock language={'tsx'} className="margin-top--sm margin-bottom--sm">{`<Spline lineWidth={6} stroke={'lightseagreen'}><Knot position={[-100, 30]} />- <Knot ref={knot} position={[0, -50]} startHandle={[-70, 0]} />+ <Knot position={[0, -50]} startHandle={[-70, 0]} /><Knot position={[100, 30]} /></Spline>`}</CodeBlock>diff --git a/packages/docs/editor.js b/packages/docs/editor.jsindex 8dd34bcd..a00256f8 100644--- a/packages/docs/editor.js+++ b/packages/docs/editor.js@@ -10,8 +10,8 @@ module.exports = (context, options) => ({.replace('{{source}}', './project.js');const examples = options.examples ?? [];- for (const {name} of examples) {- const dir = `./static/editor/${name}`;+ for (const {fileName} of examples) {+ const dir = `./static/editor/${fileName}`;if (!fs.existsSync(dir)) {fs.mkdirSync(dir, {recursive: true});}@@ -19,7 +19,7 @@ module.exports = (context, options) => ({await fs.promises.writeFile(`${dir}/index.html`, html);await fs.promises.writeFile(`${dir}/project.js`,- `import project from '/examples/${name}.js';` ++ `import project from '/examples/${fileName}.js';` +`import {editor} from '/editor/main.js';` +`editor(project);`,);