diff --git a/.github/workflows/ci-examples.yml b/.github/workflows/ci-examples.yml new file mode 100644 index 0000000000..8888c22ec6 --- /dev/null +++ b/.github/workflows/ci-examples.yml @@ -0,0 +1,34 @@ +name: CI Examples + +on: + pull_request: + paths: + - 'examples/**' + workflow_dispatch: + +jobs: + smoke-test: + runs-on: ubuntu-latest + strategy: + matrix: + example: [react, vue, vanilla, cdn] + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install example dependencies + if: matrix.example != 'cdn' + working-directory: examples/${{ matrix.example }} + run: npm install + + - name: Install smoke test dependencies + working-directory: examples/__tests__ + run: npm install && npx playwright install chromium + + - name: Run smoke test + working-directory: examples/__tests__ + run: EXAMPLE=${{ matrix.example }} npx playwright test diff --git a/apps/docs/getting-started/frameworks/react.mdx b/apps/docs/getting-started/frameworks/react.mdx index 91a1895701..e2e4d39dd1 100644 --- a/apps/docs/getting-started/frameworks/react.mdx +++ b/apps/docs/getting-started/frameworks/react.mdx @@ -265,4 +265,4 @@ function useSuperDoc(config) { - [Vue Integration](/getting-started/frameworks/vue) - Vue setup - [API Reference](/core/superdoc/configuration) - Configuration options -- [Examples](https://github.com/superdoc-dev/superdoc/tree/main/examples/react-example) - Working examples +- [Examples](https://github.com/superdoc-dev/superdoc/tree/main/examples/react) - Working examples diff --git a/apps/docs/getting-started/frameworks/vue.mdx b/apps/docs/getting-started/frameworks/vue.mdx index 3f16c54761..937a436ef0 100644 --- a/apps/docs/getting-started/frameworks/vue.mdx +++ b/apps/docs/getting-started/frameworks/vue.mdx @@ -204,4 +204,4 @@ defineExpose({ - [React Integration](/getting-started/frameworks/react) - React setup - [API Reference](/core/superdoc/configuration) - Configuration options -- [Examples](https://github.com/superdoc-dev/superdoc/tree/main/examples/vue-example) - Working examples \ No newline at end of file +- [Examples](https://github.com/superdoc-dev/superdoc/tree/main/examples/vue) - Working examples \ No newline at end of file diff --git a/demos/.gitignore b/demos/.gitignore new file mode 100644 index 0000000000..934668777a --- /dev/null +++ b/demos/.gitignore @@ -0,0 +1,5 @@ +# Ignore lock files +*-lock* + +# Ignore npmrc files +*.npmrc \ No newline at end of file diff --git a/demos/README.md b/demos/README.md new file mode 100644 index 0000000000..ce39947df6 --- /dev/null +++ b/demos/README.md @@ -0,0 +1,5 @@ +# SuperDoc Demos + +Feature demos used by the [SuperDoc demo gallery](https://superdoc.dev). Each demo includes a thumbnail, optional video, and is embeddable via StackBlitz. + +> **Looking for getting-started examples?** See the [`examples/`](../examples/) folder instead. diff --git a/examples/getting-started/cdn/README.md b/demos/cdn/README.md similarity index 100% rename from examples/getting-started/cdn/README.md rename to demos/cdn/README.md diff --git a/examples/getting-started/cdn/demo-config.json b/demos/cdn/demo-config.json similarity index 100% rename from examples/getting-started/cdn/demo-config.json rename to demos/cdn/demo-config.json diff --git a/examples/advanced/docx-from-html/demo-thumbnail.png b/demos/cdn/demo-thumbnail.png similarity index 100% rename from examples/advanced/docx-from-html/demo-thumbnail.png rename to demos/cdn/demo-thumbnail.png diff --git a/examples/getting-started/cdn/demo-video.mp4 b/demos/cdn/demo-video.mp4 similarity index 100% rename from examples/getting-started/cdn/demo-video.mp4 rename to demos/cdn/demo-video.mp4 diff --git a/examples/getting-started/cdn/file-upload.css b/demos/cdn/file-upload.css similarity index 100% rename from examples/getting-started/cdn/file-upload.css rename to demos/cdn/file-upload.css diff --git a/examples/getting-started/cdn/file-upload.js b/demos/cdn/file-upload.js similarity index 100% rename from examples/getting-started/cdn/file-upload.js rename to demos/cdn/file-upload.js diff --git a/examples/getting-started/cdn/index.html b/demos/cdn/index.html similarity index 100% rename from examples/getting-started/cdn/index.html rename to demos/cdn/index.html diff --git a/examples/getting-started/cdn/package.json b/demos/cdn/package.json similarity index 100% rename from examples/getting-started/cdn/package.json rename to demos/cdn/package.json diff --git a/examples/advanced/replace-content/public/sample.docx b/demos/cdn/sample.docx similarity index 100% rename from examples/advanced/replace-content/public/sample.docx rename to demos/cdn/sample.docx diff --git a/examples/integrations/chrome-extension/chrome-extension/README.md b/demos/chrome-extension/chrome-extension/README.md similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/README.md rename to demos/chrome-extension/chrome-extension/README.md diff --git a/examples/integrations/chrome-extension/chrome-extension/background.js b/demos/chrome-extension/chrome-extension/background.js similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/background.js rename to demos/chrome-extension/chrome-extension/background.js diff --git a/examples/integrations/chrome-extension/chrome-extension/content.js b/demos/chrome-extension/chrome-extension/content.js similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/content.js rename to demos/chrome-extension/chrome-extension/content.js diff --git a/examples/integrations/chrome-extension/chrome-extension/dist/docx-validator.bundle.js b/demos/chrome-extension/chrome-extension/dist/docx-validator.bundle.js similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/dist/docx-validator.bundle.js rename to demos/chrome-extension/chrome-extension/dist/docx-validator.bundle.js diff --git a/examples/integrations/chrome-extension/chrome-extension/dist/docx-validator.bundle.js.LICENSE.txt b/demos/chrome-extension/chrome-extension/dist/docx-validator.bundle.js.LICENSE.txt similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/dist/docx-validator.bundle.js.LICENSE.txt rename to demos/chrome-extension/chrome-extension/dist/docx-validator.bundle.js.LICENSE.txt diff --git a/examples/integrations/chrome-extension/chrome-extension/docx-validator.js b/demos/chrome-extension/chrome-extension/docx-validator.js similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/docx-validator.js rename to demos/chrome-extension/chrome-extension/docx-validator.js diff --git a/examples/integrations/chrome-extension/chrome-extension/icons/icon-128x128-disabled.png b/demos/chrome-extension/chrome-extension/icons/icon-128x128-disabled.png similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/icons/icon-128x128-disabled.png rename to demos/chrome-extension/chrome-extension/icons/icon-128x128-disabled.png diff --git a/examples/integrations/chrome-extension/chrome-extension/icons/icon-128x128.png b/demos/chrome-extension/chrome-extension/icons/icon-128x128.png similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/icons/icon-128x128.png rename to demos/chrome-extension/chrome-extension/icons/icon-128x128.png diff --git a/examples/integrations/chrome-extension/chrome-extension/icons/icon-16x16-disabled.png b/demos/chrome-extension/chrome-extension/icons/icon-16x16-disabled.png similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/icons/icon-16x16-disabled.png rename to demos/chrome-extension/chrome-extension/icons/icon-16x16-disabled.png diff --git a/examples/integrations/chrome-extension/chrome-extension/icons/icon-16x16.png b/demos/chrome-extension/chrome-extension/icons/icon-16x16.png similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/icons/icon-16x16.png rename to demos/chrome-extension/chrome-extension/icons/icon-16x16.png diff --git a/examples/integrations/chrome-extension/chrome-extension/icons/icon-19x19-disabled.png b/demos/chrome-extension/chrome-extension/icons/icon-19x19-disabled.png similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/icons/icon-19x19-disabled.png rename to demos/chrome-extension/chrome-extension/icons/icon-19x19-disabled.png diff --git a/examples/integrations/chrome-extension/chrome-extension/icons/icon-19x19.png b/demos/chrome-extension/chrome-extension/icons/icon-19x19.png similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/icons/icon-19x19.png rename to demos/chrome-extension/chrome-extension/icons/icon-19x19.png diff --git a/examples/integrations/chrome-extension/chrome-extension/icons/icon-48x48-disabled.png b/demos/chrome-extension/chrome-extension/icons/icon-48x48-disabled.png similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/icons/icon-48x48-disabled.png rename to demos/chrome-extension/chrome-extension/icons/icon-48x48-disabled.png diff --git a/examples/integrations/chrome-extension/chrome-extension/icons/icon-48x48.png b/demos/chrome-extension/chrome-extension/icons/icon-48x48.png similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/icons/icon-48x48.png rename to demos/chrome-extension/chrome-extension/icons/icon-48x48.png diff --git a/examples/advanced/docx-from-html/public/logo.webp b/demos/chrome-extension/chrome-extension/icons/logo.webp similarity index 100% rename from examples/advanced/docx-from-html/public/logo.webp rename to demos/chrome-extension/chrome-extension/icons/logo.webp diff --git a/examples/integrations/chrome-extension/chrome-extension/lib/style.css b/demos/chrome-extension/chrome-extension/lib/style.css similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/lib/style.css rename to demos/chrome-extension/chrome-extension/lib/style.css diff --git a/examples/integrations/chrome-extension/chrome-extension/lib/superdoc.umd.js b/demos/chrome-extension/chrome-extension/lib/superdoc.umd.js similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/lib/superdoc.umd.js rename to demos/chrome-extension/chrome-extension/lib/superdoc.umd.js diff --git a/examples/integrations/chrome-extension/chrome-extension/manifest.json b/demos/chrome-extension/chrome-extension/manifest.json similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/manifest.json rename to demos/chrome-extension/chrome-extension/manifest.json diff --git a/examples/integrations/chrome-extension/chrome-extension/modal.css b/demos/chrome-extension/chrome-extension/modal.css similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/modal.css rename to demos/chrome-extension/chrome-extension/modal.css diff --git a/examples/integrations/chrome-extension/chrome-extension/modal.html b/demos/chrome-extension/chrome-extension/modal.html similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/modal.html rename to demos/chrome-extension/chrome-extension/modal.html diff --git a/examples/integrations/chrome-extension/chrome-extension/package.json b/demos/chrome-extension/chrome-extension/package.json similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/package.json rename to demos/chrome-extension/chrome-extension/package.json diff --git a/examples/integrations/chrome-extension/chrome-extension/popup.html b/demos/chrome-extension/chrome-extension/popup.html similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/popup.html rename to demos/chrome-extension/chrome-extension/popup.html diff --git a/examples/integrations/chrome-extension/chrome-extension/popup.js b/demos/chrome-extension/chrome-extension/popup.js similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/popup.js rename to demos/chrome-extension/chrome-extension/popup.js diff --git a/examples/integrations/chrome-extension/chrome-extension/test_docs/Lunch Haiku (5).docx b/demos/chrome-extension/chrome-extension/test_docs/Lunch Haiku (5).docx similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/test_docs/Lunch Haiku (5).docx rename to demos/chrome-extension/chrome-extension/test_docs/Lunch Haiku (5).docx diff --git a/examples/integrations/chrome-extension/chrome-extension/test_docs/Mutual NDA_draft (1).docx b/demos/chrome-extension/chrome-extension/test_docs/Mutual NDA_draft (1).docx similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/test_docs/Mutual NDA_draft (1).docx rename to demos/chrome-extension/chrome-extension/test_docs/Mutual NDA_draft (1).docx diff --git a/examples/integrations/chrome-extension/chrome-extension/test_docs/Nda Formatted Doc MS WORD.docx b/demos/chrome-extension/chrome-extension/test_docs/Nda Formatted Doc MS WORD.docx similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/test_docs/Nda Formatted Doc MS WORD.docx rename to demos/chrome-extension/chrome-extension/test_docs/Nda Formatted Doc MS WORD.docx diff --git a/examples/integrations/chrome-extension/chrome-extension/test_docs/Nda Formatted Doc.docx b/demos/chrome-extension/chrome-extension/test_docs/Nda Formatted Doc.docx similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/test_docs/Nda Formatted Doc.docx rename to demos/chrome-extension/chrome-extension/test_docs/Nda Formatted Doc.docx diff --git a/examples/integrations/chrome-extension/chrome-extension/test_docs/nda_formatted_doc (1).md b/demos/chrome-extension/chrome-extension/test_docs/nda_formatted_doc (1).md similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/test_docs/nda_formatted_doc (1).md rename to demos/chrome-extension/chrome-extension/test_docs/nda_formatted_doc (1).md diff --git a/examples/integrations/chrome-extension/chrome-extension/test_docs/sdpr (23).docx b/demos/chrome-extension/chrome-extension/test_docs/sdpr (23).docx similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/test_docs/sdpr (23).docx rename to demos/chrome-extension/chrome-extension/test_docs/sdpr (23).docx diff --git a/examples/integrations/chrome-extension/chrome-extension/tester.html b/demos/chrome-extension/chrome-extension/tester.html similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/tester.html rename to demos/chrome-extension/chrome-extension/tester.html diff --git a/examples/integrations/chrome-extension/chrome-extension/webpack.config.js b/demos/chrome-extension/chrome-extension/webpack.config.js similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/webpack.config.js rename to demos/chrome-extension/chrome-extension/webpack.config.js diff --git a/examples/integrations/chrome-extension/demo-config.json b/demos/chrome-extension/demo-config.json similarity index 100% rename from examples/integrations/chrome-extension/demo-config.json rename to demos/chrome-extension/demo-config.json diff --git a/examples/integrations/chrome-extension/demo-thumbnail.png b/demos/chrome-extension/demo-thumbnail.png similarity index 100% rename from examples/integrations/chrome-extension/demo-thumbnail.png rename to demos/chrome-extension/demo-thumbnail.png diff --git a/examples/integrations/chrome-extension/demo-video.mp4 b/demos/chrome-extension/demo-video.mp4 similarity index 100% rename from examples/integrations/chrome-extension/demo-video.mp4 rename to demos/chrome-extension/demo-video.mp4 diff --git a/examples/advanced/docx-from-html/.gitignore b/demos/custom-mark/.gitignore similarity index 100% rename from examples/advanced/docx-from-html/.gitignore rename to demos/custom-mark/.gitignore diff --git a/examples/customization/custom-mark/README.md b/demos/custom-mark/README.md similarity index 100% rename from examples/customization/custom-mark/README.md rename to demos/custom-mark/README.md diff --git a/examples/advanced/docx-from-html/public/sample-document.docx b/demos/custom-mark/assets/sample-document.docx similarity index 100% rename from examples/advanced/docx-from-html/public/sample-document.docx rename to demos/custom-mark/assets/sample-document.docx diff --git a/examples/customization/custom-mark/demo-config.json b/demos/custom-mark/demo-config.json similarity index 100% rename from examples/customization/custom-mark/demo-config.json rename to demos/custom-mark/demo-config.json diff --git a/examples/customization/custom-mark/demo-thumbnail.png b/demos/custom-mark/demo-thumbnail.png similarity index 100% rename from examples/customization/custom-mark/demo-thumbnail.png rename to demos/custom-mark/demo-thumbnail.png diff --git a/examples/customization/custom-mark/demo-video.mp4 b/demos/custom-mark/demo-video.mp4 similarity index 100% rename from examples/customization/custom-mark/demo-video.mp4 rename to demos/custom-mark/demo-video.mp4 diff --git a/examples/customization/custom-mark/index.html b/demos/custom-mark/index.html similarity index 100% rename from examples/customization/custom-mark/index.html rename to demos/custom-mark/index.html diff --git a/examples/advanced/docx-from-html/package.json b/demos/custom-mark/package.json similarity index 100% rename from examples/advanced/docx-from-html/package.json rename to demos/custom-mark/package.json diff --git a/examples/customization/custom-mark/public/circle-chevron-down-solid.svg b/demos/custom-mark/public/circle-chevron-down-solid.svg similarity index 100% rename from examples/customization/custom-mark/public/circle-chevron-down-solid.svg rename to demos/custom-mark/public/circle-chevron-down-solid.svg diff --git a/examples/customization/custom-mark/public/headphones-solid.svg b/demos/custom-mark/public/headphones-solid.svg similarity index 100% rename from examples/customization/custom-mark/public/headphones-solid.svg rename to demos/custom-mark/public/headphones-solid.svg diff --git a/examples/advanced/fields/public/logo.webp b/demos/custom-mark/public/logo.webp similarity index 100% rename from examples/advanced/fields/public/logo.webp rename to demos/custom-mark/public/logo.webp diff --git a/examples/advanced/docx-from-html/public/superdoc-logo.png b/demos/custom-mark/public/superdoc-logo.png similarity index 100% rename from examples/advanced/docx-from-html/public/superdoc-logo.png rename to demos/custom-mark/public/superdoc-logo.png diff --git a/examples/customization/custom-mark/src/App.vue b/demos/custom-mark/src/App.vue similarity index 100% rename from examples/customization/custom-mark/src/App.vue rename to demos/custom-mark/src/App.vue diff --git a/examples/advanced/fields/src/UploadFile.vue b/demos/custom-mark/src/UploadFile.vue similarity index 100% rename from examples/advanced/fields/src/UploadFile.vue rename to demos/custom-mark/src/UploadFile.vue diff --git a/examples/customization/custom-mark/src/custom-mark.js b/demos/custom-mark/src/custom-mark.js similarity index 100% rename from examples/customization/custom-mark/src/custom-mark.js rename to demos/custom-mark/src/custom-mark.js diff --git a/examples/advanced/docx-from-html/src/main.js b/demos/custom-mark/src/main.js similarity index 100% rename from examples/advanced/docx-from-html/src/main.js rename to demos/custom-mark/src/main.js diff --git a/examples/advanced/fields/src/style.css b/demos/custom-mark/src/style.css similarity index 100% rename from examples/advanced/fields/src/style.css rename to demos/custom-mark/src/style.css diff --git a/examples/advanced/docx-from-html/vite.config.js b/demos/custom-mark/vite.config.js similarity index 100% rename from examples/advanced/docx-from-html/vite.config.js rename to demos/custom-mark/vite.config.js diff --git a/examples/advanced/fields/.gitignore b/demos/custom-node/.gitignore similarity index 100% rename from examples/advanced/fields/.gitignore rename to demos/custom-node/.gitignore diff --git a/examples/customization/custom-node/README.md b/demos/custom-node/README.md similarity index 100% rename from examples/customization/custom-node/README.md rename to demos/custom-node/README.md diff --git a/examples/customization/custom-node/demo-config.json b/demos/custom-node/demo-config.json similarity index 100% rename from examples/customization/custom-node/demo-config.json rename to demos/custom-node/demo-config.json diff --git a/examples/advanced/fields/demo-thumbnail.png b/demos/custom-node/demo-thumbnail.png similarity index 100% rename from examples/advanced/fields/demo-thumbnail.png rename to demos/custom-node/demo-thumbnail.png diff --git a/examples/advanced/fields/demo-video.mp4 b/demos/custom-node/demo-video.mp4 similarity index 100% rename from examples/advanced/fields/demo-video.mp4 rename to demos/custom-node/demo-video.mp4 diff --git a/examples/advanced/fields/index.html b/demos/custom-node/index.html similarity index 100% rename from examples/advanced/fields/index.html rename to demos/custom-node/index.html diff --git a/examples/advanced/fields/package.json b/demos/custom-node/package.json similarity index 100% rename from examples/advanced/fields/package.json rename to demos/custom-node/package.json diff --git a/examples/advanced/linked-sections/public/logo.webp b/demos/custom-node/public/logo.webp similarity index 100% rename from examples/advanced/linked-sections/public/logo.webp rename to demos/custom-node/public/logo.webp diff --git a/examples/advanced/fields/public/sample-document.docx b/demos/custom-node/public/sample-document.docx similarity index 100% rename from examples/advanced/fields/public/sample-document.docx rename to demos/custom-node/public/sample-document.docx diff --git a/examples/customization/custom-node/src/App.vue b/demos/custom-node/src/App.vue similarity index 100% rename from examples/customization/custom-node/src/App.vue rename to demos/custom-node/src/App.vue diff --git a/examples/advanced/linked-sections/src/UploadFile.vue b/demos/custom-node/src/UploadFile.vue similarity index 100% rename from examples/advanced/linked-sections/src/UploadFile.vue rename to demos/custom-node/src/UploadFile.vue diff --git a/examples/customization/custom-node/src/custom-node.js b/demos/custom-node/src/custom-node.js similarity index 100% rename from examples/customization/custom-node/src/custom-node.js rename to demos/custom-node/src/custom-node.js diff --git a/examples/advanced/fields/src/main.js b/demos/custom-node/src/main.js similarity index 100% rename from examples/advanced/fields/src/main.js rename to demos/custom-node/src/main.js diff --git a/examples/advanced/linked-sections/src/style.css b/demos/custom-node/src/style.css similarity index 100% rename from examples/advanced/linked-sections/src/style.css rename to demos/custom-node/src/style.css diff --git a/examples/advanced/fields/vite.config.js b/demos/custom-node/vite.config.js similarity index 100% rename from examples/advanced/fields/vite.config.js rename to demos/custom-node/vite.config.js diff --git a/examples/advanced/html-editor/.gitignore b/demos/docx-from-html/.gitignore similarity index 100% rename from examples/advanced/html-editor/.gitignore rename to demos/docx-from-html/.gitignore diff --git a/examples/advanced/docx-from-html/README.md b/demos/docx-from-html/README.md similarity index 100% rename from examples/advanced/docx-from-html/README.md rename to demos/docx-from-html/README.md diff --git a/examples/advanced/docx-from-html/demo-config.json b/demos/docx-from-html/demo-config.json similarity index 100% rename from examples/advanced/docx-from-html/demo-config.json rename to demos/docx-from-html/demo-config.json diff --git a/examples/getting-started/cdn/demo-thumbnail.png b/demos/docx-from-html/demo-thumbnail.png similarity index 100% rename from examples/getting-started/cdn/demo-thumbnail.png rename to demos/docx-from-html/demo-thumbnail.png diff --git a/examples/advanced/docx-from-html/demo-video.mp4 b/demos/docx-from-html/demo-video.mp4 similarity index 100% rename from examples/advanced/docx-from-html/demo-video.mp4 rename to demos/docx-from-html/demo-video.mp4 diff --git a/examples/advanced/docx-from-html/index.html b/demos/docx-from-html/index.html similarity index 100% rename from examples/advanced/docx-from-html/index.html rename to demos/docx-from-html/index.html diff --git a/examples/advanced/html-editor/package.json b/demos/docx-from-html/package.json similarity index 100% rename from examples/advanced/html-editor/package.json rename to demos/docx-from-html/package.json diff --git a/examples/customization/custom-mark/public/logo.webp b/demos/docx-from-html/public/logo.webp similarity index 100% rename from examples/customization/custom-mark/public/logo.webp rename to demos/docx-from-html/public/logo.webp diff --git a/examples/customization/custom-mark/assets/sample-document.docx b/demos/docx-from-html/public/sample-document.docx similarity index 100% rename from examples/customization/custom-mark/assets/sample-document.docx rename to demos/docx-from-html/public/sample-document.docx diff --git a/examples/advanced/html-editor/public/superdoc-logo.png b/demos/docx-from-html/public/superdoc-logo.png similarity index 100% rename from examples/advanced/html-editor/public/superdoc-logo.png rename to demos/docx-from-html/public/superdoc-logo.png diff --git a/examples/advanced/docx-from-html/src/App.vue b/demos/docx-from-html/src/App.vue similarity index 100% rename from examples/advanced/docx-from-html/src/App.vue rename to demos/docx-from-html/src/App.vue diff --git a/examples/advanced/html-editor/src/main.js b/demos/docx-from-html/src/main.js similarity index 100% rename from examples/advanced/html-editor/src/main.js rename to demos/docx-from-html/src/main.js diff --git a/examples/advanced/docx-from-html/src/style.css b/demos/docx-from-html/src/style.css similarity index 100% rename from examples/advanced/docx-from-html/src/style.css rename to demos/docx-from-html/src/style.css diff --git a/examples/advanced/html-editor/vite.config.js b/demos/docx-from-html/vite.config.js similarity index 100% rename from examples/advanced/html-editor/vite.config.js rename to demos/docx-from-html/vite.config.js diff --git a/examples/advanced/docxtemplater/README.md b/demos/docxtemplater/README.md similarity index 100% rename from examples/advanced/docxtemplater/README.md rename to demos/docxtemplater/README.md diff --git a/examples/advanced/docxtemplater/demo-config.json b/demos/docxtemplater/demo-config.json similarity index 100% rename from examples/advanced/docxtemplater/demo-config.json rename to demos/docxtemplater/demo-config.json diff --git a/examples/advanced/docxtemplater/demo-thumbnail.png b/demos/docxtemplater/demo-thumbnail.png similarity index 100% rename from examples/advanced/docxtemplater/demo-thumbnail.png rename to demos/docxtemplater/demo-thumbnail.png diff --git a/examples/advanced/docxtemplater/demo-video.mp4 b/demos/docxtemplater/demo-video.mp4 similarity index 100% rename from examples/advanced/docxtemplater/demo-video.mp4 rename to demos/docxtemplater/demo-video.mp4 diff --git a/examples/advanced/docxtemplater/demo.gif b/demos/docxtemplater/demo.gif similarity index 100% rename from examples/advanced/docxtemplater/demo.gif rename to demos/docxtemplater/demo.gif diff --git a/examples/advanced/docxtemplater/index.html b/demos/docxtemplater/index.html similarity index 100% rename from examples/advanced/docxtemplater/index.html rename to demos/docxtemplater/index.html diff --git a/examples/advanced/docxtemplater/jsconfig.json b/demos/docxtemplater/jsconfig.json similarity index 100% rename from examples/advanced/docxtemplater/jsconfig.json rename to demos/docxtemplater/jsconfig.json diff --git a/examples/advanced/docxtemplater/package.json b/demos/docxtemplater/package.json similarity index 100% rename from examples/advanced/docxtemplater/package.json rename to demos/docxtemplater/package.json diff --git a/examples/advanced/docxtemplater/public/favicon.ico b/demos/docxtemplater/public/favicon.ico similarity index 100% rename from examples/advanced/docxtemplater/public/favicon.ico rename to demos/docxtemplater/public/favicon.ico diff --git a/examples/advanced/docxtemplater/src/App.vue b/demos/docxtemplater/src/App.vue similarity index 100% rename from examples/advanced/docxtemplater/src/App.vue rename to demos/docxtemplater/src/App.vue diff --git a/examples/advanced/docxtemplater/src/assets/template.docx b/demos/docxtemplater/src/assets/template.docx similarity index 100% rename from examples/advanced/docxtemplater/src/assets/template.docx rename to demos/docxtemplater/src/assets/template.docx diff --git a/examples/advanced/docxtemplater/src/components/DocumentTab.vue b/demos/docxtemplater/src/components/DocumentTab.vue similarity index 100% rename from examples/advanced/docxtemplater/src/components/DocumentTab.vue rename to demos/docxtemplater/src/components/DocumentTab.vue diff --git a/examples/advanced/docxtemplater/src/fileProcessing.js b/demos/docxtemplater/src/fileProcessing.js similarity index 100% rename from examples/advanced/docxtemplater/src/fileProcessing.js rename to demos/docxtemplater/src/fileProcessing.js diff --git a/examples/advanced/docxtemplater/src/main.js b/demos/docxtemplater/src/main.js similarity index 100% rename from examples/advanced/docxtemplater/src/main.js rename to demos/docxtemplater/src/main.js diff --git a/examples/advanced/docxtemplater/src/utils.js b/demos/docxtemplater/src/utils.js similarity index 100% rename from examples/advanced/docxtemplater/src/utils.js rename to demos/docxtemplater/src/utils.js diff --git a/examples/advanced/docxtemplater/vite.config.js b/demos/docxtemplater/vite.config.js similarity index 100% rename from examples/advanced/docxtemplater/vite.config.js rename to demos/docxtemplater/vite.config.js diff --git a/examples/advanced/linked-sections/.gitignore b/demos/fields/.gitignore similarity index 100% rename from examples/advanced/linked-sections/.gitignore rename to demos/fields/.gitignore diff --git a/examples/advanced/fields/README.md b/demos/fields/README.md similarity index 100% rename from examples/advanced/fields/README.md rename to demos/fields/README.md diff --git a/examples/advanced/fields/demo-config.json b/demos/fields/demo-config.json similarity index 100% rename from examples/advanced/fields/demo-config.json rename to demos/fields/demo-config.json diff --git a/examples/customization/custom-node/demo-thumbnail.png b/demos/fields/demo-thumbnail.png similarity index 100% rename from examples/customization/custom-node/demo-thumbnail.png rename to demos/fields/demo-thumbnail.png diff --git a/examples/customization/custom-node/demo-video.mp4 b/demos/fields/demo-video.mp4 similarity index 100% rename from examples/customization/custom-node/demo-video.mp4 rename to demos/fields/demo-video.mp4 diff --git a/examples/advanced/linked-sections/index.html b/demos/fields/index.html similarity index 100% rename from examples/advanced/linked-sections/index.html rename to demos/fields/index.html diff --git a/examples/customization/custom-mark/package.json b/demos/fields/package.json similarity index 100% rename from examples/customization/custom-mark/package.json rename to demos/fields/package.json diff --git a/examples/customization/custom-node/public/logo.webp b/demos/fields/public/logo.webp similarity index 100% rename from examples/customization/custom-node/public/logo.webp rename to demos/fields/public/logo.webp diff --git a/examples/customization/custom-node/public/sample-document.docx b/demos/fields/public/sample-document.docx similarity index 100% rename from examples/customization/custom-node/public/sample-document.docx rename to demos/fields/public/sample-document.docx diff --git a/examples/advanced/fields/src/App.vue b/demos/fields/src/App.vue similarity index 100% rename from examples/advanced/fields/src/App.vue rename to demos/fields/src/App.vue diff --git a/examples/customization/custom-mark/src/UploadFile.vue b/demos/fields/src/UploadFile.vue similarity index 100% rename from examples/customization/custom-mark/src/UploadFile.vue rename to demos/fields/src/UploadFile.vue diff --git a/examples/advanced/linked-sections/src/main.js b/demos/fields/src/main.js similarity index 100% rename from examples/advanced/linked-sections/src/main.js rename to demos/fields/src/main.js diff --git a/examples/customization/custom-mark/src/style.css b/demos/fields/src/style.css similarity index 100% rename from examples/customization/custom-mark/src/style.css rename to demos/fields/src/style.css diff --git a/examples/advanced/linked-sections/vite.config.js b/demos/fields/vite.config.js similarity index 100% rename from examples/advanced/linked-sections/vite.config.js rename to demos/fields/vite.config.js diff --git a/examples/advanced/grading-papers/.gitignore b/demos/grading-papers/.gitignore similarity index 100% rename from examples/advanced/grading-papers/.gitignore rename to demos/grading-papers/.gitignore diff --git a/examples/advanced/grading-papers/README.md b/demos/grading-papers/README.md similarity index 100% rename from examples/advanced/grading-papers/README.md rename to demos/grading-papers/README.md diff --git a/examples/advanced/grading-papers/app/globals.css b/demos/grading-papers/app/globals.css similarity index 100% rename from examples/advanced/grading-papers/app/globals.css rename to demos/grading-papers/app/globals.css diff --git a/examples/advanced/grading-papers/app/grading/[id]/_doc-links.js b/demos/grading-papers/app/grading/[id]/_doc-links.js similarity index 100% rename from examples/advanced/grading-papers/app/grading/[id]/_doc-links.js rename to demos/grading-papers/app/grading/[id]/_doc-links.js diff --git a/examples/advanced/grading-papers/app/grading/[id]/loading.tsx b/demos/grading-papers/app/grading/[id]/loading.tsx similarity index 100% rename from examples/advanced/grading-papers/app/grading/[id]/loading.tsx rename to demos/grading-papers/app/grading/[id]/loading.tsx diff --git a/examples/advanced/grading-papers/app/grading/[id]/page.tsx b/demos/grading-papers/app/grading/[id]/page.tsx similarity index 100% rename from examples/advanced/grading-papers/app/grading/[id]/page.tsx rename to demos/grading-papers/app/grading/[id]/page.tsx diff --git a/examples/advanced/grading-papers/app/layout.tsx b/demos/grading-papers/app/layout.tsx similarity index 100% rename from examples/advanced/grading-papers/app/layout.tsx rename to demos/grading-papers/app/layout.tsx diff --git a/examples/advanced/grading-papers/app/loading.tsx b/demos/grading-papers/app/loading.tsx similarity index 100% rename from examples/advanced/grading-papers/app/loading.tsx rename to demos/grading-papers/app/loading.tsx diff --git a/examples/advanced/grading-papers/app/page.tsx b/demos/grading-papers/app/page.tsx similarity index 100% rename from examples/advanced/grading-papers/app/page.tsx rename to demos/grading-papers/app/page.tsx diff --git a/examples/advanced/grading-papers/assets/docs/assign-1.docx b/demos/grading-papers/assets/docs/assign-1.docx similarity index 100% rename from examples/advanced/grading-papers/assets/docs/assign-1.docx rename to demos/grading-papers/assets/docs/assign-1.docx diff --git a/examples/advanced/grading-papers/assets/docs/assign-1.js b/demos/grading-papers/assets/docs/assign-1.js similarity index 100% rename from examples/advanced/grading-papers/assets/docs/assign-1.js rename to demos/grading-papers/assets/docs/assign-1.js diff --git a/examples/advanced/grading-papers/assets/docs/assign-2.docx b/demos/grading-papers/assets/docs/assign-2.docx similarity index 100% rename from examples/advanced/grading-papers/assets/docs/assign-2.docx rename to demos/grading-papers/assets/docs/assign-2.docx diff --git a/examples/advanced/grading-papers/assets/docs/assign-2.js b/demos/grading-papers/assets/docs/assign-2.js similarity index 100% rename from examples/advanced/grading-papers/assets/docs/assign-2.js rename to demos/grading-papers/assets/docs/assign-2.js diff --git a/examples/advanced/grading-papers/assets/docs/assign-3.docx b/demos/grading-papers/assets/docs/assign-3.docx similarity index 100% rename from examples/advanced/grading-papers/assets/docs/assign-3.docx rename to demos/grading-papers/assets/docs/assign-3.docx diff --git a/examples/advanced/grading-papers/assets/docs/assign-3.js b/demos/grading-papers/assets/docs/assign-3.js similarity index 100% rename from examples/advanced/grading-papers/assets/docs/assign-3.js rename to demos/grading-papers/assets/docs/assign-3.js diff --git a/examples/advanced/grading-papers/assets/docs/assign-4.docx b/demos/grading-papers/assets/docs/assign-4.docx similarity index 100% rename from examples/advanced/grading-papers/assets/docs/assign-4.docx rename to demos/grading-papers/assets/docs/assign-4.docx diff --git a/examples/advanced/grading-papers/assets/docs/assign-4.js b/demos/grading-papers/assets/docs/assign-4.js similarity index 100% rename from examples/advanced/grading-papers/assets/docs/assign-4.js rename to demos/grading-papers/assets/docs/assign-4.js diff --git a/examples/advanced/grading-papers/assets/docs/assign-5.docx b/demos/grading-papers/assets/docs/assign-5.docx similarity index 100% rename from examples/advanced/grading-papers/assets/docs/assign-5.docx rename to demos/grading-papers/assets/docs/assign-5.docx diff --git a/examples/advanced/grading-papers/assets/docs/assign-5.js b/demos/grading-papers/assets/docs/assign-5.js similarity index 100% rename from examples/advanced/grading-papers/assets/docs/assign-5.js rename to demos/grading-papers/assets/docs/assign-5.js diff --git a/examples/advanced/grading-papers/components.json b/demos/grading-papers/components.json similarity index 100% rename from examples/advanced/grading-papers/components.json rename to demos/grading-papers/components.json diff --git a/examples/advanced/grading-papers/components/theme-provider.tsx b/demos/grading-papers/components/theme-provider.tsx similarity index 100% rename from examples/advanced/grading-papers/components/theme-provider.tsx rename to demos/grading-papers/components/theme-provider.tsx diff --git a/examples/advanced/grading-papers/components/ui/accordion.tsx b/demos/grading-papers/components/ui/accordion.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/accordion.tsx rename to demos/grading-papers/components/ui/accordion.tsx diff --git a/examples/advanced/grading-papers/components/ui/alert-dialog.tsx b/demos/grading-papers/components/ui/alert-dialog.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/alert-dialog.tsx rename to demos/grading-papers/components/ui/alert-dialog.tsx diff --git a/examples/advanced/grading-papers/components/ui/alert.tsx b/demos/grading-papers/components/ui/alert.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/alert.tsx rename to demos/grading-papers/components/ui/alert.tsx diff --git a/examples/advanced/grading-papers/components/ui/aspect-ratio.tsx b/demos/grading-papers/components/ui/aspect-ratio.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/aspect-ratio.tsx rename to demos/grading-papers/components/ui/aspect-ratio.tsx diff --git a/examples/advanced/grading-papers/components/ui/avatar.tsx b/demos/grading-papers/components/ui/avatar.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/avatar.tsx rename to demos/grading-papers/components/ui/avatar.tsx diff --git a/examples/advanced/grading-papers/components/ui/badge.tsx b/demos/grading-papers/components/ui/badge.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/badge.tsx rename to demos/grading-papers/components/ui/badge.tsx diff --git a/examples/advanced/grading-papers/components/ui/breadcrumb.tsx b/demos/grading-papers/components/ui/breadcrumb.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/breadcrumb.tsx rename to demos/grading-papers/components/ui/breadcrumb.tsx diff --git a/examples/advanced/grading-papers/components/ui/button.tsx b/demos/grading-papers/components/ui/button.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/button.tsx rename to demos/grading-papers/components/ui/button.tsx diff --git a/examples/advanced/grading-papers/components/ui/calendar.tsx b/demos/grading-papers/components/ui/calendar.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/calendar.tsx rename to demos/grading-papers/components/ui/calendar.tsx diff --git a/examples/advanced/grading-papers/components/ui/card.tsx b/demos/grading-papers/components/ui/card.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/card.tsx rename to demos/grading-papers/components/ui/card.tsx diff --git a/examples/advanced/grading-papers/components/ui/carousel.tsx b/demos/grading-papers/components/ui/carousel.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/carousel.tsx rename to demos/grading-papers/components/ui/carousel.tsx diff --git a/examples/advanced/grading-papers/components/ui/chart.tsx b/demos/grading-papers/components/ui/chart.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/chart.tsx rename to demos/grading-papers/components/ui/chart.tsx diff --git a/examples/advanced/grading-papers/components/ui/checkbox.tsx b/demos/grading-papers/components/ui/checkbox.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/checkbox.tsx rename to demos/grading-papers/components/ui/checkbox.tsx diff --git a/examples/advanced/grading-papers/components/ui/collapsible.tsx b/demos/grading-papers/components/ui/collapsible.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/collapsible.tsx rename to demos/grading-papers/components/ui/collapsible.tsx diff --git a/examples/advanced/grading-papers/components/ui/command.tsx b/demos/grading-papers/components/ui/command.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/command.tsx rename to demos/grading-papers/components/ui/command.tsx diff --git a/examples/advanced/grading-papers/components/ui/context-menu.tsx b/demos/grading-papers/components/ui/context-menu.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/context-menu.tsx rename to demos/grading-papers/components/ui/context-menu.tsx diff --git a/examples/advanced/grading-papers/components/ui/dialog.tsx b/demos/grading-papers/components/ui/dialog.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/dialog.tsx rename to demos/grading-papers/components/ui/dialog.tsx diff --git a/examples/advanced/grading-papers/components/ui/drawer.tsx b/demos/grading-papers/components/ui/drawer.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/drawer.tsx rename to demos/grading-papers/components/ui/drawer.tsx diff --git a/examples/advanced/grading-papers/components/ui/dropdown-menu.tsx b/demos/grading-papers/components/ui/dropdown-menu.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/dropdown-menu.tsx rename to demos/grading-papers/components/ui/dropdown-menu.tsx diff --git a/examples/advanced/grading-papers/components/ui/form.tsx b/demos/grading-papers/components/ui/form.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/form.tsx rename to demos/grading-papers/components/ui/form.tsx diff --git a/examples/advanced/grading-papers/components/ui/hover-card.tsx b/demos/grading-papers/components/ui/hover-card.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/hover-card.tsx rename to demos/grading-papers/components/ui/hover-card.tsx diff --git a/examples/advanced/grading-papers/components/ui/input-otp.tsx b/demos/grading-papers/components/ui/input-otp.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/input-otp.tsx rename to demos/grading-papers/components/ui/input-otp.tsx diff --git a/examples/advanced/grading-papers/components/ui/input.tsx b/demos/grading-papers/components/ui/input.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/input.tsx rename to demos/grading-papers/components/ui/input.tsx diff --git a/examples/advanced/grading-papers/components/ui/label.tsx b/demos/grading-papers/components/ui/label.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/label.tsx rename to demos/grading-papers/components/ui/label.tsx diff --git a/examples/advanced/grading-papers/components/ui/menubar.tsx b/demos/grading-papers/components/ui/menubar.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/menubar.tsx rename to demos/grading-papers/components/ui/menubar.tsx diff --git a/examples/advanced/grading-papers/components/ui/navigation-menu.tsx b/demos/grading-papers/components/ui/navigation-menu.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/navigation-menu.tsx rename to demos/grading-papers/components/ui/navigation-menu.tsx diff --git a/examples/advanced/grading-papers/components/ui/pagination.tsx b/demos/grading-papers/components/ui/pagination.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/pagination.tsx rename to demos/grading-papers/components/ui/pagination.tsx diff --git a/examples/advanced/grading-papers/components/ui/popover.tsx b/demos/grading-papers/components/ui/popover.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/popover.tsx rename to demos/grading-papers/components/ui/popover.tsx diff --git a/examples/advanced/grading-papers/components/ui/progress.tsx b/demos/grading-papers/components/ui/progress.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/progress.tsx rename to demos/grading-papers/components/ui/progress.tsx diff --git a/examples/advanced/grading-papers/components/ui/radio-group.tsx b/demos/grading-papers/components/ui/radio-group.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/radio-group.tsx rename to demos/grading-papers/components/ui/radio-group.tsx diff --git a/examples/advanced/grading-papers/components/ui/resizable.tsx b/demos/grading-papers/components/ui/resizable.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/resizable.tsx rename to demos/grading-papers/components/ui/resizable.tsx diff --git a/examples/advanced/grading-papers/components/ui/scroll-area.tsx b/demos/grading-papers/components/ui/scroll-area.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/scroll-area.tsx rename to demos/grading-papers/components/ui/scroll-area.tsx diff --git a/examples/advanced/grading-papers/components/ui/select.tsx b/demos/grading-papers/components/ui/select.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/select.tsx rename to demos/grading-papers/components/ui/select.tsx diff --git a/examples/advanced/grading-papers/components/ui/separator.tsx b/demos/grading-papers/components/ui/separator.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/separator.tsx rename to demos/grading-papers/components/ui/separator.tsx diff --git a/examples/advanced/grading-papers/components/ui/sheet.tsx b/demos/grading-papers/components/ui/sheet.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/sheet.tsx rename to demos/grading-papers/components/ui/sheet.tsx diff --git a/examples/advanced/grading-papers/components/ui/sidebar.tsx b/demos/grading-papers/components/ui/sidebar.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/sidebar.tsx rename to demos/grading-papers/components/ui/sidebar.tsx diff --git a/examples/advanced/grading-papers/components/ui/skeleton.tsx b/demos/grading-papers/components/ui/skeleton.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/skeleton.tsx rename to demos/grading-papers/components/ui/skeleton.tsx diff --git a/examples/advanced/grading-papers/components/ui/slider.tsx b/demos/grading-papers/components/ui/slider.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/slider.tsx rename to demos/grading-papers/components/ui/slider.tsx diff --git a/examples/advanced/grading-papers/components/ui/sonner.tsx b/demos/grading-papers/components/ui/sonner.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/sonner.tsx rename to demos/grading-papers/components/ui/sonner.tsx diff --git a/examples/advanced/grading-papers/components/ui/switch.tsx b/demos/grading-papers/components/ui/switch.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/switch.tsx rename to demos/grading-papers/components/ui/switch.tsx diff --git a/examples/advanced/grading-papers/components/ui/table.tsx b/demos/grading-papers/components/ui/table.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/table.tsx rename to demos/grading-papers/components/ui/table.tsx diff --git a/examples/advanced/grading-papers/components/ui/tabs.tsx b/demos/grading-papers/components/ui/tabs.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/tabs.tsx rename to demos/grading-papers/components/ui/tabs.tsx diff --git a/examples/advanced/grading-papers/components/ui/textarea.tsx b/demos/grading-papers/components/ui/textarea.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/textarea.tsx rename to demos/grading-papers/components/ui/textarea.tsx diff --git a/examples/advanced/grading-papers/components/ui/toast.tsx b/demos/grading-papers/components/ui/toast.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/toast.tsx rename to demos/grading-papers/components/ui/toast.tsx diff --git a/examples/advanced/grading-papers/components/ui/toaster.tsx b/demos/grading-papers/components/ui/toaster.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/toaster.tsx rename to demos/grading-papers/components/ui/toaster.tsx diff --git a/examples/advanced/grading-papers/components/ui/toggle-group.tsx b/demos/grading-papers/components/ui/toggle-group.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/toggle-group.tsx rename to demos/grading-papers/components/ui/toggle-group.tsx diff --git a/examples/advanced/grading-papers/components/ui/toggle.tsx b/demos/grading-papers/components/ui/toggle.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/toggle.tsx rename to demos/grading-papers/components/ui/toggle.tsx diff --git a/examples/advanced/grading-papers/components/ui/tooltip.tsx b/demos/grading-papers/components/ui/tooltip.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/tooltip.tsx rename to demos/grading-papers/components/ui/tooltip.tsx diff --git a/examples/advanced/grading-papers/components/ui/use-mobile.tsx b/demos/grading-papers/components/ui/use-mobile.tsx similarity index 100% rename from examples/advanced/grading-papers/components/ui/use-mobile.tsx rename to demos/grading-papers/components/ui/use-mobile.tsx diff --git a/examples/advanced/grading-papers/components/ui/use-toast.ts b/demos/grading-papers/components/ui/use-toast.ts similarity index 100% rename from examples/advanced/grading-papers/components/ui/use-toast.ts rename to demos/grading-papers/components/ui/use-toast.ts diff --git a/examples/advanced/grading-papers/demo-config.json b/demos/grading-papers/demo-config.json similarity index 100% rename from examples/advanced/grading-papers/demo-config.json rename to demos/grading-papers/demo-config.json diff --git a/examples/advanced/grading-papers/demo-thumbnail.png b/demos/grading-papers/demo-thumbnail.png similarity index 100% rename from examples/advanced/grading-papers/demo-thumbnail.png rename to demos/grading-papers/demo-thumbnail.png diff --git a/examples/advanced/grading-papers/hooks/use-mobile.tsx b/demos/grading-papers/hooks/use-mobile.tsx similarity index 100% rename from examples/advanced/grading-papers/hooks/use-mobile.tsx rename to demos/grading-papers/hooks/use-mobile.tsx diff --git a/examples/advanced/grading-papers/hooks/use-toast.ts b/demos/grading-papers/hooks/use-toast.ts similarity index 100% rename from examples/advanced/grading-papers/hooks/use-toast.ts rename to demos/grading-papers/hooks/use-toast.ts diff --git a/examples/advanced/grading-papers/lib/utils.ts b/demos/grading-papers/lib/utils.ts similarity index 100% rename from examples/advanced/grading-papers/lib/utils.ts rename to demos/grading-papers/lib/utils.ts diff --git a/examples/advanced/grading-papers/next.config.mjs b/demos/grading-papers/next.config.mjs similarity index 100% rename from examples/advanced/grading-papers/next.config.mjs rename to demos/grading-papers/next.config.mjs diff --git a/examples/advanced/grading-papers/package.json b/demos/grading-papers/package.json similarity index 100% rename from examples/advanced/grading-papers/package.json rename to demos/grading-papers/package.json diff --git a/examples/advanced/grading-papers/pnpm-lock.yaml b/demos/grading-papers/pnpm-lock.yaml similarity index 100% rename from examples/advanced/grading-papers/pnpm-lock.yaml rename to demos/grading-papers/pnpm-lock.yaml diff --git a/examples/advanced/grading-papers/postcss.config.mjs b/demos/grading-papers/postcss.config.mjs similarity index 100% rename from examples/advanced/grading-papers/postcss.config.mjs rename to demos/grading-papers/postcss.config.mjs diff --git a/examples/advanced/grading-papers/public/assign-1.docx b/demos/grading-papers/public/assign-1.docx similarity index 100% rename from examples/advanced/grading-papers/public/assign-1.docx rename to demos/grading-papers/public/assign-1.docx diff --git a/examples/advanced/grading-papers/public/assign-2.docx b/demos/grading-papers/public/assign-2.docx similarity index 100% rename from examples/advanced/grading-papers/public/assign-2.docx rename to demos/grading-papers/public/assign-2.docx diff --git a/examples/advanced/grading-papers/public/assign-3.docx b/demos/grading-papers/public/assign-3.docx similarity index 100% rename from examples/advanced/grading-papers/public/assign-3.docx rename to demos/grading-papers/public/assign-3.docx diff --git a/examples/advanced/grading-papers/public/assign-4.docx b/demos/grading-papers/public/assign-4.docx similarity index 100% rename from examples/advanced/grading-papers/public/assign-4.docx rename to demos/grading-papers/public/assign-4.docx diff --git a/examples/advanced/grading-papers/public/assign-5.docx b/demos/grading-papers/public/assign-5.docx similarity index 100% rename from examples/advanced/grading-papers/public/assign-5.docx rename to demos/grading-papers/public/assign-5.docx diff --git a/examples/advanced/grading-papers/public/jamie_smith_bio220_research_proposal.docx b/demos/grading-papers/public/jamie_smith_bio220_research_proposal.docx similarity index 100% rename from examples/advanced/grading-papers/public/jamie_smith_bio220_research_proposal.docx rename to demos/grading-papers/public/jamie_smith_bio220_research_proposal.docx diff --git a/examples/advanced/grading-papers/public/placeholder-logo.png b/demos/grading-papers/public/placeholder-logo.png similarity index 100% rename from examples/advanced/grading-papers/public/placeholder-logo.png rename to demos/grading-papers/public/placeholder-logo.png diff --git a/examples/advanced/grading-papers/public/placeholder-logo.svg b/demos/grading-papers/public/placeholder-logo.svg similarity index 100% rename from examples/advanced/grading-papers/public/placeholder-logo.svg rename to demos/grading-papers/public/placeholder-logo.svg diff --git a/examples/advanced/grading-papers/public/placeholder-user.jpg b/demos/grading-papers/public/placeholder-user.jpg similarity index 100% rename from examples/advanced/grading-papers/public/placeholder-user.jpg rename to demos/grading-papers/public/placeholder-user.jpg diff --git a/examples/advanced/grading-papers/public/placeholder.jpg b/demos/grading-papers/public/placeholder.jpg similarity index 100% rename from examples/advanced/grading-papers/public/placeholder.jpg rename to demos/grading-papers/public/placeholder.jpg diff --git a/examples/advanced/grading-papers/public/placeholder.svg b/demos/grading-papers/public/placeholder.svg similarity index 100% rename from examples/advanced/grading-papers/public/placeholder.svg rename to demos/grading-papers/public/placeholder.svg diff --git a/examples/advanced/grading-papers/public/~$alex.docx b/demos/grading-papers/public/~$alex.docx similarity index 100% rename from examples/advanced/grading-papers/public/~$alex.docx rename to demos/grading-papers/public/~$alex.docx diff --git a/examples/advanced/grading-papers/styles/globals.css b/demos/grading-papers/styles/globals.css similarity index 100% rename from examples/advanced/grading-papers/styles/globals.css rename to demos/grading-papers/styles/globals.css diff --git a/examples/advanced/grading-papers/tailwind.config.ts b/demos/grading-papers/tailwind.config.ts similarity index 100% rename from examples/advanced/grading-papers/tailwind.config.ts rename to demos/grading-papers/tailwind.config.ts diff --git a/examples/advanced/grading-papers/tsconfig.json b/demos/grading-papers/tsconfig.json similarity index 100% rename from examples/advanced/grading-papers/tsconfig.json rename to demos/grading-papers/tsconfig.json diff --git a/examples/customization/custom-mark/.gitignore b/demos/html-editor/.gitignore similarity index 100% rename from examples/customization/custom-mark/.gitignore rename to demos/html-editor/.gitignore diff --git a/examples/advanced/html-editor/.vscode/extensions.json b/demos/html-editor/.vscode/extensions.json similarity index 100% rename from examples/advanced/html-editor/.vscode/extensions.json rename to demos/html-editor/.vscode/extensions.json diff --git a/examples/advanced/html-editor/README.md b/demos/html-editor/README.md similarity index 100% rename from examples/advanced/html-editor/README.md rename to demos/html-editor/README.md diff --git a/examples/advanced/html-editor/demo-config.json b/demos/html-editor/demo-config.json similarity index 100% rename from examples/advanced/html-editor/demo-config.json rename to demos/html-editor/demo-config.json diff --git a/examples/advanced/html-editor/demo-thumbnail.png b/demos/html-editor/demo-thumbnail.png similarity index 100% rename from examples/advanced/html-editor/demo-thumbnail.png rename to demos/html-editor/demo-thumbnail.png diff --git a/examples/advanced/html-editor/demo-video.mp4 b/demos/html-editor/demo-video.mp4 similarity index 100% rename from examples/advanced/html-editor/demo-video.mp4 rename to demos/html-editor/demo-video.mp4 diff --git a/examples/advanced/html-editor/index.html b/demos/html-editor/index.html similarity index 100% rename from examples/advanced/html-editor/index.html rename to demos/html-editor/index.html diff --git a/examples/customization/custom-node/package.json b/demos/html-editor/package.json similarity index 100% rename from examples/customization/custom-node/package.json rename to demos/html-editor/package.json diff --git a/examples/customization/custom-mark/public/superdoc-logo.png b/demos/html-editor/public/superdoc-logo.png similarity index 100% rename from examples/customization/custom-mark/public/superdoc-logo.png rename to demos/html-editor/public/superdoc-logo.png diff --git a/examples/advanced/html-editor/src/App.vue b/demos/html-editor/src/App.vue similarity index 100% rename from examples/advanced/html-editor/src/App.vue rename to demos/html-editor/src/App.vue diff --git a/examples/customization/custom-mark/src/main.js b/demos/html-editor/src/main.js similarity index 100% rename from examples/customization/custom-mark/src/main.js rename to demos/html-editor/src/main.js diff --git a/examples/advanced/html-editor/src/style.css b/demos/html-editor/src/style.css similarity index 100% rename from examples/advanced/html-editor/src/style.css rename to demos/html-editor/src/style.css diff --git a/examples/customization/custom-mark/vite.config.js b/demos/html-editor/vite.config.js similarity index 100% rename from examples/customization/custom-mark/vite.config.js rename to demos/html-editor/vite.config.js diff --git a/examples/customization/custom-node/.gitignore b/demos/linked-sections/.gitignore similarity index 100% rename from examples/customization/custom-node/.gitignore rename to demos/linked-sections/.gitignore diff --git a/examples/advanced/linked-sections/README.md b/demos/linked-sections/README.md similarity index 100% rename from examples/advanced/linked-sections/README.md rename to demos/linked-sections/README.md diff --git a/examples/advanced/linked-sections/demo-config.json b/demos/linked-sections/demo-config.json similarity index 100% rename from examples/advanced/linked-sections/demo-config.json rename to demos/linked-sections/demo-config.json diff --git a/examples/advanced/linked-sections/demo-thumbnail.png b/demos/linked-sections/demo-thumbnail.png similarity index 100% rename from examples/advanced/linked-sections/demo-thumbnail.png rename to demos/linked-sections/demo-thumbnail.png diff --git a/examples/advanced/linked-sections/demo-video.mp4 b/demos/linked-sections/demo-video.mp4 similarity index 100% rename from examples/advanced/linked-sections/demo-video.mp4 rename to demos/linked-sections/demo-video.mp4 diff --git a/examples/customization/custom-node/index.html b/demos/linked-sections/index.html similarity index 100% rename from examples/customization/custom-node/index.html rename to demos/linked-sections/index.html diff --git a/examples/advanced/linked-sections/package.json b/demos/linked-sections/package.json similarity index 100% rename from examples/advanced/linked-sections/package.json rename to demos/linked-sections/package.json diff --git a/examples/customization/custom-plugin/public/logo.webp b/demos/linked-sections/public/logo.webp similarity index 100% rename from examples/customization/custom-plugin/public/logo.webp rename to demos/linked-sections/public/logo.webp diff --git a/examples/advanced/linked-sections/src/App.vue b/demos/linked-sections/src/App.vue similarity index 100% rename from examples/advanced/linked-sections/src/App.vue rename to demos/linked-sections/src/App.vue diff --git a/examples/customization/custom-node/src/UploadFile.vue b/demos/linked-sections/src/UploadFile.vue similarity index 100% rename from examples/customization/custom-node/src/UploadFile.vue rename to demos/linked-sections/src/UploadFile.vue diff --git a/examples/customization/custom-node/src/main.js b/demos/linked-sections/src/main.js similarity index 100% rename from examples/customization/custom-node/src/main.js rename to demos/linked-sections/src/main.js diff --git a/examples/customization/custom-node/src/style.css b/demos/linked-sections/src/style.css similarity index 100% rename from examples/customization/custom-node/src/style.css rename to demos/linked-sections/src/style.css diff --git a/examples/customization/custom-node/vite.config.js b/demos/linked-sections/vite.config.js similarity index 100% rename from examples/customization/custom-node/vite.config.js rename to demos/linked-sections/vite.config.js diff --git a/examples/advanced/loading-from-json/demo-config.json b/demos/loading-from-json/demo-config.json similarity index 100% rename from examples/advanced/loading-from-json/demo-config.json rename to demos/loading-from-json/demo-config.json diff --git a/examples/advanced/loading-from-json/demo-thumbnail.png b/demos/loading-from-json/demo-thumbnail.png similarity index 100% rename from examples/advanced/loading-from-json/demo-thumbnail.png rename to demos/loading-from-json/demo-thumbnail.png diff --git a/examples/advanced/loading-from-json/demo-video.mp4 b/demos/loading-from-json/demo-video.mp4 similarity index 100% rename from examples/advanced/loading-from-json/demo-video.mp4 rename to demos/loading-from-json/demo-video.mp4 diff --git a/examples/advanced/loading-from-json/index.html b/demos/loading-from-json/index.html similarity index 100% rename from examples/advanced/loading-from-json/index.html rename to demos/loading-from-json/index.html diff --git a/examples/advanced/loading-from-json/package.json b/demos/loading-from-json/package.json similarity index 100% rename from examples/advanced/loading-from-json/package.json rename to demos/loading-from-json/package.json diff --git a/examples/advanced/loading-from-json/src/main.js b/demos/loading-from-json/src/main.js similarity index 100% rename from examples/advanced/loading-from-json/src/main.js rename to demos/loading-from-json/src/main.js diff --git a/examples/advanced/loading-from-json/src/style.css b/demos/loading-from-json/src/style.css similarity index 100% rename from examples/advanced/loading-from-json/src/style.css rename to demos/loading-from-json/src/style.css diff --git a/examples/advanced/loading-from-json/vite.config.js b/demos/loading-from-json/vite.config.js similarity index 100% rename from examples/advanced/loading-from-json/vite.config.js rename to demos/loading-from-json/vite.config.js diff --git a/examples/integrations/nextjs-ssr/.gitignore b/demos/nextjs-ssr/.gitignore similarity index 100% rename from examples/integrations/nextjs-ssr/.gitignore rename to demos/nextjs-ssr/.gitignore diff --git a/examples/integrations/nextjs-ssr/README.md b/demos/nextjs-ssr/README.md similarity index 100% rename from examples/integrations/nextjs-ssr/README.md rename to demos/nextjs-ssr/README.md diff --git a/examples/integrations/nextjs-ssr/demo-config.json b/demos/nextjs-ssr/demo-config.json similarity index 100% rename from examples/integrations/nextjs-ssr/demo-config.json rename to demos/nextjs-ssr/demo-config.json diff --git a/examples/integrations/nextjs-ssr/demo-thumbnail.png b/demos/nextjs-ssr/demo-thumbnail.png similarity index 100% rename from examples/integrations/nextjs-ssr/demo-thumbnail.png rename to demos/nextjs-ssr/demo-thumbnail.png diff --git a/examples/integrations/nextjs-ssr/demo-video.mp4 b/demos/nextjs-ssr/demo-video.mp4 similarity index 100% rename from examples/integrations/nextjs-ssr/demo-video.mp4 rename to demos/nextjs-ssr/demo-video.mp4 diff --git a/examples/integrations/nextjs-ssr/jsconfig.json b/demos/nextjs-ssr/jsconfig.json similarity index 100% rename from examples/integrations/nextjs-ssr/jsconfig.json rename to demos/nextjs-ssr/jsconfig.json diff --git a/examples/integrations/nextjs-ssr/next.config.mjs b/demos/nextjs-ssr/next.config.mjs similarity index 100% rename from examples/integrations/nextjs-ssr/next.config.mjs rename to demos/nextjs-ssr/next.config.mjs diff --git a/examples/integrations/nextjs-ssr/package.json b/demos/nextjs-ssr/package.json similarity index 100% rename from examples/integrations/nextjs-ssr/package.json rename to demos/nextjs-ssr/package.json diff --git a/examples/integrations/nextjs-ssr/public/file.svg b/demos/nextjs-ssr/public/file.svg similarity index 100% rename from examples/integrations/nextjs-ssr/public/file.svg rename to demos/nextjs-ssr/public/file.svg diff --git a/examples/integrations/nextjs-ssr/public/globe.svg b/demos/nextjs-ssr/public/globe.svg similarity index 100% rename from examples/integrations/nextjs-ssr/public/globe.svg rename to demos/nextjs-ssr/public/globe.svg diff --git a/examples/integrations/nextjs-ssr/public/next.svg b/demos/nextjs-ssr/public/next.svg similarity index 100% rename from examples/integrations/nextjs-ssr/public/next.svg rename to demos/nextjs-ssr/public/next.svg diff --git a/examples/customization/custom-plugin/public/sample-document.docx b/demos/nextjs-ssr/public/sample-document.docx similarity index 100% rename from examples/customization/custom-plugin/public/sample-document.docx rename to demos/nextjs-ssr/public/sample-document.docx diff --git a/examples/advanced/text-selection/public/sample.docx b/demos/nextjs-ssr/public/sample.docx similarity index 100% rename from examples/advanced/text-selection/public/sample.docx rename to demos/nextjs-ssr/public/sample.docx diff --git a/examples/integrations/nextjs-ssr/public/vercel.svg b/demos/nextjs-ssr/public/vercel.svg similarity index 100% rename from examples/integrations/nextjs-ssr/public/vercel.svg rename to demos/nextjs-ssr/public/vercel.svg diff --git a/examples/integrations/nextjs-ssr/public/window.svg b/demos/nextjs-ssr/public/window.svg similarity index 100% rename from examples/integrations/nextjs-ssr/public/window.svg rename to demos/nextjs-ssr/public/window.svg diff --git a/examples/integrations/nextjs-ssr/src/app/SuperDoc/superdoc.css b/demos/nextjs-ssr/src/app/SuperDoc/superdoc.css similarity index 100% rename from examples/integrations/nextjs-ssr/src/app/SuperDoc/superdoc.css rename to demos/nextjs-ssr/src/app/SuperDoc/superdoc.css diff --git a/examples/integrations/nextjs-ssr/src/app/SuperDoc/superdoc.js b/demos/nextjs-ssr/src/app/SuperDoc/superdoc.js similarity index 100% rename from examples/integrations/nextjs-ssr/src/app/SuperDoc/superdoc.js rename to demos/nextjs-ssr/src/app/SuperDoc/superdoc.js diff --git a/examples/integrations/nextjs-ssr/src/app/favicon.ico b/demos/nextjs-ssr/src/app/favicon.ico similarity index 100% rename from examples/integrations/nextjs-ssr/src/app/favicon.ico rename to demos/nextjs-ssr/src/app/favicon.ico diff --git a/examples/integrations/nextjs-ssr/src/app/globals.css b/demos/nextjs-ssr/src/app/globals.css similarity index 100% rename from examples/integrations/nextjs-ssr/src/app/globals.css rename to demos/nextjs-ssr/src/app/globals.css diff --git a/examples/integrations/nextjs-ssr/src/app/layout.js b/demos/nextjs-ssr/src/app/layout.js similarity index 100% rename from examples/integrations/nextjs-ssr/src/app/layout.js rename to demos/nextjs-ssr/src/app/layout.js diff --git a/examples/integrations/nextjs-ssr/src/app/page.js b/demos/nextjs-ssr/src/app/page.js similarity index 100% rename from examples/integrations/nextjs-ssr/src/app/page.js rename to demos/nextjs-ssr/src/app/page.js diff --git a/examples/integrations/nextjs-ssr/src/app/page.module.css b/demos/nextjs-ssr/src/app/page.module.css similarity index 100% rename from examples/integrations/nextjs-ssr/src/app/page.module.css rename to demos/nextjs-ssr/src/app/page.module.css diff --git a/examples/integrations/nodejs/.gitignore b/demos/nodejs/.gitignore similarity index 100% rename from examples/integrations/nodejs/.gitignore rename to demos/nodejs/.gitignore diff --git a/examples/integrations/nodejs/README.md b/demos/nodejs/README.md similarity index 100% rename from examples/integrations/nodejs/README.md rename to demos/nodejs/README.md diff --git a/examples/integrations/nodejs/demo-config.json b/demos/nodejs/demo-config.json similarity index 100% rename from examples/integrations/nodejs/demo-config.json rename to demos/nodejs/demo-config.json diff --git a/examples/integrations/nodejs/demo-thumbnail.png b/demos/nodejs/demo-thumbnail.png similarity index 100% rename from examples/integrations/nodejs/demo-thumbnail.png rename to demos/nodejs/demo-thumbnail.png diff --git a/examples/integrations/nodejs/demo-video.mp4 b/demos/nodejs/demo-video.mp4 similarity index 100% rename from examples/integrations/nodejs/demo-video.mp4 rename to demos/nodejs/demo-video.mp4 diff --git a/examples/integrations/nodejs/document-b64.js b/demos/nodejs/document-b64.js similarity index 100% rename from examples/integrations/nodejs/document-b64.js rename to demos/nodejs/document-b64.js diff --git a/examples/integrations/nodejs/document.js b/demos/nodejs/document.js similarity index 100% rename from examples/integrations/nodejs/document.js rename to demos/nodejs/document.js diff --git a/examples/integrations/nodejs/file-polyfill.js b/demos/nodejs/file-polyfill.js similarity index 100% rename from examples/integrations/nodejs/file-polyfill.js rename to demos/nodejs/file-polyfill.js diff --git a/examples/integrations/nodejs/package.json b/demos/nodejs/package.json similarity index 100% rename from examples/integrations/nodejs/package.json rename to demos/nodejs/package.json diff --git a/examples/integrations/nodejs/sample-document.docx b/demos/nodejs/sample-document.docx similarity index 100% rename from examples/integrations/nodejs/sample-document.docx rename to demos/nodejs/sample-document.docx diff --git a/examples/integrations/nodejs/server.js b/demos/nodejs/server.js similarity index 100% rename from examples/integrations/nodejs/server.js rename to demos/nodejs/server.js diff --git a/examples/getting-started/react/demo-config.json b/demos/react/demo-config.json similarity index 100% rename from examples/getting-started/react/demo-config.json rename to demos/react/demo-config.json diff --git a/examples/advanced/replace-content/demo-thumbnail.png b/demos/react/demo-thumbnail.png similarity index 100% rename from examples/advanced/replace-content/demo-thumbnail.png rename to demos/react/demo-thumbnail.png diff --git a/examples/getting-started/react/demo-video.mp4 b/demos/react/demo-video.mp4 similarity index 100% rename from examples/getting-started/react/demo-video.mp4 rename to demos/react/demo-video.mp4 diff --git a/examples/advanced/replace-content/index.html b/demos/react/index.html similarity index 100% rename from examples/advanced/replace-content/index.html rename to demos/react/index.html diff --git a/examples/getting-started/react/package.json b/demos/react/package.json similarity index 100% rename from examples/getting-started/react/package.json rename to demos/react/package.json diff --git a/examples/getting-started/cdn/sample.docx b/demos/react/public/sample.docx similarity index 100% rename from examples/getting-started/cdn/sample.docx rename to demos/react/public/sample.docx diff --git a/examples/getting-started/react/src/App.jsx b/demos/react/src/App.jsx similarity index 100% rename from examples/getting-started/react/src/App.jsx rename to demos/react/src/App.jsx diff --git a/examples/advanced/text-selection/src/components/DocumentEditor.jsx b/demos/react/src/components/DocumentEditor.jsx similarity index 100% rename from examples/advanced/text-selection/src/components/DocumentEditor.jsx rename to demos/react/src/components/DocumentEditor.jsx diff --git a/examples/getting-started/react/src/main.jsx b/demos/react/src/main.jsx similarity index 100% rename from examples/getting-started/react/src/main.jsx rename to demos/react/src/main.jsx diff --git a/examples/advanced/text-selection/vite.config.js b/demos/react/vite.config.js similarity index 100% rename from examples/advanced/text-selection/vite.config.js rename to demos/react/vite.config.js diff --git a/examples/advanced/replace-content/README.md b/demos/replace-content/README.md similarity index 100% rename from examples/advanced/replace-content/README.md rename to demos/replace-content/README.md diff --git a/examples/advanced/replace-content/demo-config.json b/demos/replace-content/demo-config.json similarity index 100% rename from examples/advanced/replace-content/demo-config.json rename to demos/replace-content/demo-config.json diff --git a/examples/advanced/text-selection/demo-thumbnail.png b/demos/replace-content/demo-thumbnail.png similarity index 100% rename from examples/advanced/text-selection/demo-thumbnail.png rename to demos/replace-content/demo-thumbnail.png diff --git a/examples/advanced/replace-content/demo-video.mp4 b/demos/replace-content/demo-video.mp4 similarity index 100% rename from examples/advanced/replace-content/demo-video.mp4 rename to demos/replace-content/demo-video.mp4 diff --git a/examples/advanced/text-selection/index.html b/demos/replace-content/index.html similarity index 100% rename from examples/advanced/text-selection/index.html rename to demos/replace-content/index.html diff --git a/examples/advanced/replace-content/package.json b/demos/replace-content/package.json similarity index 100% rename from examples/advanced/replace-content/package.json rename to demos/replace-content/package.json diff --git a/examples/getting-started/react/public/sample.docx b/demos/replace-content/public/sample.docx similarity index 100% rename from examples/getting-started/react/public/sample.docx rename to demos/replace-content/public/sample.docx diff --git a/examples/advanced/replace-content/src/App.jsx b/demos/replace-content/src/App.jsx similarity index 100% rename from examples/advanced/replace-content/src/App.jsx rename to demos/replace-content/src/App.jsx diff --git a/examples/advanced/replace-content/src/components/DocumentEditor.jsx b/demos/replace-content/src/components/DocumentEditor.jsx similarity index 100% rename from examples/advanced/replace-content/src/components/DocumentEditor.jsx rename to demos/replace-content/src/components/DocumentEditor.jsx diff --git a/examples/advanced/replace-content/src/main.jsx b/demos/replace-content/src/main.jsx similarity index 100% rename from examples/advanced/replace-content/src/main.jsx rename to demos/replace-content/src/main.jsx diff --git a/examples/advanced/replace-content/vite.config.js b/demos/replace-content/vite.config.js similarity index 100% rename from examples/advanced/replace-content/vite.config.js rename to demos/replace-content/vite.config.js diff --git a/examples/shared/css/style.css b/demos/shared/css/style.css similarity index 100% rename from examples/shared/css/style.css rename to demos/shared/css/style.css diff --git a/examples/integrations/nextjs-ssr/public/sample-document.docx b/demos/shared/data/sample-document.docx similarity index 100% rename from examples/integrations/nextjs-ssr/public/sample-document.docx rename to demos/shared/data/sample-document.docx diff --git a/examples/customization/dynamic-content/public/logo.webp b/demos/shared/images/logo.webp similarity index 100% rename from examples/customization/dynamic-content/public/logo.webp rename to demos/shared/images/logo.webp diff --git a/examples/customization/dynamic-content/public/superdoc-logo.png b/demos/shared/images/superdoc-logo.png similarity index 100% rename from examples/customization/dynamic-content/public/superdoc-logo.png rename to demos/shared/images/superdoc-logo.png diff --git a/examples/shared/vue/UploadFile/UploadFile.vue b/demos/shared/vue/UploadFile/UploadFile.vue similarity index 100% rename from examples/shared/vue/UploadFile/UploadFile.vue rename to demos/shared/vue/UploadFile/UploadFile.vue diff --git a/examples/integrations/slack-redlining/README.md b/demos/slack-redlining/README.md similarity index 100% rename from examples/integrations/slack-redlining/README.md rename to demos/slack-redlining/README.md diff --git a/examples/integrations/slack-redlining/cloud-function/package.json b/demos/slack-redlining/cloud-function/package.json similarity index 100% rename from examples/integrations/slack-redlining/cloud-function/package.json rename to demos/slack-redlining/cloud-function/package.json diff --git a/examples/integrations/slack-redlining/cloud-function/server.js b/demos/slack-redlining/cloud-function/server.js similarity index 100% rename from examples/integrations/slack-redlining/cloud-function/server.js rename to demos/slack-redlining/cloud-function/server.js diff --git a/examples/integrations/slack-redlining/cloud-function/utils.js b/demos/slack-redlining/cloud-function/utils.js similarity index 100% rename from examples/integrations/slack-redlining/cloud-function/utils.js rename to demos/slack-redlining/cloud-function/utils.js diff --git a/examples/integrations/slack-redlining/demo-config.json b/demos/slack-redlining/demo-config.json similarity index 100% rename from examples/integrations/slack-redlining/demo-config.json rename to demos/slack-redlining/demo-config.json diff --git a/examples/integrations/slack-redlining/demo-thumbnail.png b/demos/slack-redlining/demo-thumbnail.png similarity index 100% rename from examples/integrations/slack-redlining/demo-thumbnail.png rename to demos/slack-redlining/demo-thumbnail.png diff --git a/examples/integrations/slack-redlining/demo-video.mp4 b/demos/slack-redlining/demo-video.mp4 similarity index 100% rename from examples/integrations/slack-redlining/demo-video.mp4 rename to demos/slack-redlining/demo-video.mp4 diff --git a/examples/integrations/slack-redlining/screenshot.png b/demos/slack-redlining/screenshot.png similarity index 100% rename from examples/integrations/slack-redlining/screenshot.png rename to demos/slack-redlining/screenshot.png diff --git a/examples/integrations/slack-redlining/zap.json b/demos/slack-redlining/zap.json similarity index 100% rename from examples/integrations/slack-redlining/zap.json rename to demos/slack-redlining/zap.json diff --git a/examples/tests/.gitignore b/demos/tests/.gitignore similarity index 100% rename from examples/tests/.gitignore rename to demos/tests/.gitignore diff --git a/examples/tests/Dockerfile b/demos/tests/Dockerfile similarity index 100% rename from examples/tests/Dockerfile rename to demos/tests/Dockerfile diff --git a/examples/tests/README.md b/demos/tests/README.md similarity index 100% rename from examples/tests/README.md rename to demos/tests/README.md diff --git a/examples/tests/package.json b/demos/tests/package.json similarity index 100% rename from examples/tests/package.json rename to demos/tests/package.json diff --git a/examples/tests/playwright.config.js b/demos/tests/playwright.config.js similarity index 100% rename from examples/tests/playwright.config.js rename to demos/tests/playwright.config.js diff --git a/examples/tests/scripts/bootstrap.js b/demos/tests/scripts/bootstrap.js similarity index 100% rename from examples/tests/scripts/bootstrap.js rename to demos/tests/scripts/bootstrap.js diff --git a/examples/tests/test-config.js b/demos/tests/test-config.js similarity index 100% rename from examples/tests/test-config.js rename to demos/tests/test-config.js diff --git a/examples/tests/tests.spec.js b/demos/tests/tests.spec.js similarity index 100% rename from examples/tests/tests.spec.js rename to demos/tests/tests.spec.js diff --git a/examples/tests/tests.spec.js-snapshots/cdn-should-open-the-main-page-1-chromium-darwin.png b/demos/tests/tests.spec.js-snapshots/cdn-should-open-the-main-page-1-chromium-darwin.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/cdn-should-open-the-main-page-1-chromium-darwin.png rename to demos/tests/tests.spec.js-snapshots/cdn-should-open-the-main-page-1-chromium-darwin.png diff --git a/examples/tests/tests.spec.js-snapshots/cdn-should-open-the-main-page-1-chromium-linux.png b/demos/tests/tests.spec.js-snapshots/cdn-should-open-the-main-page-1-chromium-linux.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/cdn-should-open-the-main-page-1-chromium-linux.png rename to demos/tests/tests.spec.js-snapshots/cdn-should-open-the-main-page-1-chromium-linux.png diff --git a/examples/tests/tests.spec.js-snapshots/custom-mark-should-open-the-main-page-1-chromium-darwin.png b/demos/tests/tests.spec.js-snapshots/custom-mark-should-open-the-main-page-1-chromium-darwin.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/custom-mark-should-open-the-main-page-1-chromium-darwin.png rename to demos/tests/tests.spec.js-snapshots/custom-mark-should-open-the-main-page-1-chromium-darwin.png diff --git a/examples/tests/tests.spec.js-snapshots/custom-mark-should-open-the-main-page-1-chromium-linux.png b/demos/tests/tests.spec.js-snapshots/custom-mark-should-open-the-main-page-1-chromium-linux.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/custom-mark-should-open-the-main-page-1-chromium-linux.png rename to demos/tests/tests.spec.js-snapshots/custom-mark-should-open-the-main-page-1-chromium-linux.png diff --git a/examples/tests/tests.spec.js-snapshots/docx-from-html-should-open-the-main-page-1-chromium-darwin.png b/demos/tests/tests.spec.js-snapshots/docx-from-html-should-open-the-main-page-1-chromium-darwin.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/docx-from-html-should-open-the-main-page-1-chromium-darwin.png rename to demos/tests/tests.spec.js-snapshots/docx-from-html-should-open-the-main-page-1-chromium-darwin.png diff --git a/examples/tests/tests.spec.js-snapshots/docx-from-html-should-open-the-main-page-1-chromium-linux.png b/demos/tests/tests.spec.js-snapshots/docx-from-html-should-open-the-main-page-1-chromium-linux.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/docx-from-html-should-open-the-main-page-1-chromium-linux.png rename to demos/tests/tests.spec.js-snapshots/docx-from-html-should-open-the-main-page-1-chromium-linux.png diff --git a/examples/tests/tests.spec.js-snapshots/dynamic-content-should-open-the-main-page-1-chromium-darwin.png b/demos/tests/tests.spec.js-snapshots/dynamic-content-should-open-the-main-page-1-chromium-darwin.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/dynamic-content-should-open-the-main-page-1-chromium-darwin.png rename to demos/tests/tests.spec.js-snapshots/dynamic-content-should-open-the-main-page-1-chromium-darwin.png diff --git a/examples/tests/tests.spec.js-snapshots/dynamic-content-should-open-the-main-page-1-chromium-linux.png b/demos/tests/tests.spec.js-snapshots/dynamic-content-should-open-the-main-page-1-chromium-linux.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/dynamic-content-should-open-the-main-page-1-chromium-linux.png rename to demos/tests/tests.spec.js-snapshots/dynamic-content-should-open-the-main-page-1-chromium-linux.png diff --git a/examples/tests/tests.spec.js-snapshots/fields-should-open-the-main-page-1-chromium-darwin.png b/demos/tests/tests.spec.js-snapshots/fields-should-open-the-main-page-1-chromium-darwin.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/fields-should-open-the-main-page-1-chromium-darwin.png rename to demos/tests/tests.spec.js-snapshots/fields-should-open-the-main-page-1-chromium-darwin.png diff --git a/examples/tests/tests.spec.js-snapshots/fields-should-open-the-main-page-1-chromium-linux.png b/demos/tests/tests.spec.js-snapshots/fields-should-open-the-main-page-1-chromium-linux.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/fields-should-open-the-main-page-1-chromium-linux.png rename to demos/tests/tests.spec.js-snapshots/fields-should-open-the-main-page-1-chromium-linux.png diff --git a/examples/tests/tests.spec.js-snapshots/linked-sections-should-open-the-main-page-1-chromium-darwin.png b/demos/tests/tests.spec.js-snapshots/linked-sections-should-open-the-main-page-1-chromium-darwin.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/linked-sections-should-open-the-main-page-1-chromium-darwin.png rename to demos/tests/tests.spec.js-snapshots/linked-sections-should-open-the-main-page-1-chromium-darwin.png diff --git a/examples/tests/tests.spec.js-snapshots/linked-sections-should-open-the-main-page-1-chromium-linux.png b/demos/tests/tests.spec.js-snapshots/linked-sections-should-open-the-main-page-1-chromium-linux.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/linked-sections-should-open-the-main-page-1-chromium-linux.png rename to demos/tests/tests.spec.js-snapshots/linked-sections-should-open-the-main-page-1-chromium-linux.png diff --git a/examples/tests/tests.spec.js-snapshots/nextjs-ssr-should-open-the-main-page-1-chromium-darwin.png b/demos/tests/tests.spec.js-snapshots/nextjs-ssr-should-open-the-main-page-1-chromium-darwin.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/nextjs-ssr-should-open-the-main-page-1-chromium-darwin.png rename to demos/tests/tests.spec.js-snapshots/nextjs-ssr-should-open-the-main-page-1-chromium-darwin.png diff --git a/examples/tests/tests.spec.js-snapshots/nextjs-ssr-should-open-the-main-page-1-chromium-linux.png b/demos/tests/tests.spec.js-snapshots/nextjs-ssr-should-open-the-main-page-1-chromium-linux.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/nextjs-ssr-should-open-the-main-page-1-chromium-linux.png rename to demos/tests/tests.spec.js-snapshots/nextjs-ssr-should-open-the-main-page-1-chromium-linux.png diff --git a/examples/tests/tests.spec.js-snapshots/react-should-open-the-main-page-1-chromium-darwin.png b/demos/tests/tests.spec.js-snapshots/react-should-open-the-main-page-1-chromium-darwin.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/react-should-open-the-main-page-1-chromium-darwin.png rename to demos/tests/tests.spec.js-snapshots/react-should-open-the-main-page-1-chromium-darwin.png diff --git a/examples/tests/tests.spec.js-snapshots/react-should-open-the-main-page-1-chromium-linux.png b/demos/tests/tests.spec.js-snapshots/react-should-open-the-main-page-1-chromium-linux.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/react-should-open-the-main-page-1-chromium-linux.png rename to demos/tests/tests.spec.js-snapshots/react-should-open-the-main-page-1-chromium-linux.png diff --git a/examples/tests/tests.spec.js-snapshots/text-selection-should-open-the-main-page-1-chromium-darwin.png b/demos/tests/tests.spec.js-snapshots/text-selection-should-open-the-main-page-1-chromium-darwin.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/text-selection-should-open-the-main-page-1-chromium-darwin.png rename to demos/tests/tests.spec.js-snapshots/text-selection-should-open-the-main-page-1-chromium-darwin.png diff --git a/examples/tests/tests.spec.js-snapshots/text-selection-should-open-the-main-page-1-chromium-linux.png b/demos/tests/tests.spec.js-snapshots/text-selection-should-open-the-main-page-1-chromium-linux.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/text-selection-should-open-the-main-page-1-chromium-linux.png rename to demos/tests/tests.spec.js-snapshots/text-selection-should-open-the-main-page-1-chromium-linux.png diff --git a/examples/tests/tests.spec.js-snapshots/typescript-should-open-the-main-page-1-chromium-darwin.png b/demos/tests/tests.spec.js-snapshots/typescript-should-open-the-main-page-1-chromium-darwin.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/typescript-should-open-the-main-page-1-chromium-darwin.png rename to demos/tests/tests.spec.js-snapshots/typescript-should-open-the-main-page-1-chromium-darwin.png diff --git a/examples/tests/tests.spec.js-snapshots/typescript-should-open-the-main-page-1-chromium-linux.png b/demos/tests/tests.spec.js-snapshots/typescript-should-open-the-main-page-1-chromium-linux.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/typescript-should-open-the-main-page-1-chromium-linux.png rename to demos/tests/tests.spec.js-snapshots/typescript-should-open-the-main-page-1-chromium-linux.png diff --git a/examples/tests/tests.spec.js-snapshots/vanilla-should-open-the-main-page-1-chromium-darwin.png b/demos/tests/tests.spec.js-snapshots/vanilla-should-open-the-main-page-1-chromium-darwin.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/vanilla-should-open-the-main-page-1-chromium-darwin.png rename to demos/tests/tests.spec.js-snapshots/vanilla-should-open-the-main-page-1-chromium-darwin.png diff --git a/examples/tests/tests.spec.js-snapshots/vanilla-should-open-the-main-page-1-chromium-linux.png b/demos/tests/tests.spec.js-snapshots/vanilla-should-open-the-main-page-1-chromium-linux.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/vanilla-should-open-the-main-page-1-chromium-linux.png rename to demos/tests/tests.spec.js-snapshots/vanilla-should-open-the-main-page-1-chromium-linux.png diff --git a/examples/tests/tests.spec.js-snapshots/vue-should-open-the-main-page-1-chromium-darwin.png b/demos/tests/tests.spec.js-snapshots/vue-should-open-the-main-page-1-chromium-darwin.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/vue-should-open-the-main-page-1-chromium-darwin.png rename to demos/tests/tests.spec.js-snapshots/vue-should-open-the-main-page-1-chromium-darwin.png diff --git a/examples/tests/tests.spec.js-snapshots/vue-should-open-the-main-page-1-chromium-linux.png b/demos/tests/tests.spec.js-snapshots/vue-should-open-the-main-page-1-chromium-linux.png similarity index 100% rename from examples/tests/tests.spec.js-snapshots/vue-should-open-the-main-page-1-chromium-linux.png rename to demos/tests/tests.spec.js-snapshots/vue-should-open-the-main-page-1-chromium-linux.png diff --git a/examples/advanced/text-selection/README.md b/demos/text-selection/README.md similarity index 100% rename from examples/advanced/text-selection/README.md rename to demos/text-selection/README.md diff --git a/examples/advanced/text-selection/demo-config.json b/demos/text-selection/demo-config.json similarity index 100% rename from examples/advanced/text-selection/demo-config.json rename to demos/text-selection/demo-config.json diff --git a/examples/getting-started/react/demo-thumbnail.png b/demos/text-selection/demo-thumbnail.png similarity index 100% rename from examples/getting-started/react/demo-thumbnail.png rename to demos/text-selection/demo-thumbnail.png diff --git a/examples/advanced/text-selection/demo-video.mp4 b/demos/text-selection/demo-video.mp4 similarity index 100% rename from examples/advanced/text-selection/demo-video.mp4 rename to demos/text-selection/demo-video.mp4 diff --git a/examples/getting-started/react/index.html b/demos/text-selection/index.html similarity index 100% rename from examples/getting-started/react/index.html rename to demos/text-selection/index.html diff --git a/examples/advanced/text-selection/package.json b/demos/text-selection/package.json similarity index 100% rename from examples/advanced/text-selection/package.json rename to demos/text-selection/package.json diff --git a/examples/integrations/nextjs-ssr/public/sample.docx b/demos/text-selection/public/sample.docx similarity index 100% rename from examples/integrations/nextjs-ssr/public/sample.docx rename to demos/text-selection/public/sample.docx diff --git a/examples/advanced/text-selection/src/App.jsx b/demos/text-selection/src/App.jsx similarity index 100% rename from examples/advanced/text-selection/src/App.jsx rename to demos/text-selection/src/App.jsx diff --git a/examples/getting-started/react/src/components/DocumentEditor.jsx b/demos/text-selection/src/components/DocumentEditor.jsx similarity index 100% rename from examples/getting-started/react/src/components/DocumentEditor.jsx rename to demos/text-selection/src/components/DocumentEditor.jsx diff --git a/examples/advanced/text-selection/src/main.jsx b/demos/text-selection/src/main.jsx similarity index 100% rename from examples/advanced/text-selection/src/main.jsx rename to demos/text-selection/src/main.jsx diff --git a/examples/getting-started/react/vite.config.js b/demos/text-selection/vite.config.js similarity index 100% rename from examples/getting-started/react/vite.config.js rename to demos/text-selection/vite.config.js diff --git a/examples/customization/toolbar/README.md b/demos/toolbar/README.md similarity index 100% rename from examples/customization/toolbar/README.md rename to demos/toolbar/README.md diff --git a/examples/customization/toolbar/demo-config.json b/demos/toolbar/demo-config.json similarity index 100% rename from examples/customization/toolbar/demo-config.json rename to demos/toolbar/demo-config.json diff --git a/examples/customization/toolbar/demo-thumbnail.png b/demos/toolbar/demo-thumbnail.png similarity index 100% rename from examples/customization/toolbar/demo-thumbnail.png rename to demos/toolbar/demo-thumbnail.png diff --git a/examples/customization/toolbar/demo-video.mp4 b/demos/toolbar/demo-video.mp4 similarity index 100% rename from examples/customization/toolbar/demo-video.mp4 rename to demos/toolbar/demo-video.mp4 diff --git a/examples/customization/toolbar/index.html b/demos/toolbar/index.html similarity index 100% rename from examples/customization/toolbar/index.html rename to demos/toolbar/index.html diff --git a/examples/customization/toolbar/package.json b/demos/toolbar/package.json similarity index 100% rename from examples/customization/toolbar/package.json rename to demos/toolbar/package.json diff --git a/examples/customization/toolbar/src/icon_cat.svg b/demos/toolbar/src/icon_cat.svg similarity index 100% rename from examples/customization/toolbar/src/icon_cat.svg rename to demos/toolbar/src/icon_cat.svg diff --git a/examples/customization/toolbar/src/main.js b/demos/toolbar/src/main.js similarity index 100% rename from examples/customization/toolbar/src/main.js rename to demos/toolbar/src/main.js diff --git a/examples/customization/toolbar/src/style.css b/demos/toolbar/src/style.css similarity index 100% rename from examples/customization/toolbar/src/style.css rename to demos/toolbar/src/style.css diff --git a/examples/customization/toolbar/vite.config.js b/demos/toolbar/vite.config.js similarity index 100% rename from examples/customization/toolbar/vite.config.js rename to demos/toolbar/vite.config.js diff --git a/examples/customization/custom-plugin/.gitignore b/demos/typescript/.gitignore similarity index 100% rename from examples/customization/custom-plugin/.gitignore rename to demos/typescript/.gitignore diff --git a/examples/getting-started/typescript/demo-config.json b/demos/typescript/demo-config.json similarity index 100% rename from examples/getting-started/typescript/demo-config.json rename to demos/typescript/demo-config.json diff --git a/examples/getting-started/typescript/demo-thumbnail.png b/demos/typescript/demo-thumbnail.png similarity index 100% rename from examples/getting-started/typescript/demo-thumbnail.png rename to demos/typescript/demo-thumbnail.png diff --git a/examples/getting-started/typescript/demo-video.mp4 b/demos/typescript/demo-video.mp4 similarity index 100% rename from examples/getting-started/typescript/demo-video.mp4 rename to demos/typescript/demo-video.mp4 diff --git a/examples/getting-started/typescript/eslint.config.js b/demos/typescript/eslint.config.js similarity index 100% rename from examples/getting-started/typescript/eslint.config.js rename to demos/typescript/eslint.config.js diff --git a/examples/getting-started/typescript/index.html b/demos/typescript/index.html similarity index 100% rename from examples/getting-started/typescript/index.html rename to demos/typescript/index.html diff --git a/examples/getting-started/typescript/package.json b/demos/typescript/package.json similarity index 100% rename from examples/getting-started/typescript/package.json rename to demos/typescript/package.json diff --git a/examples/getting-started/typescript/src/App.tsx b/demos/typescript/src/App.tsx similarity index 100% rename from examples/getting-started/typescript/src/App.tsx rename to demos/typescript/src/App.tsx diff --git a/examples/getting-started/typescript/src/components/DocumentEditor.tsx b/demos/typescript/src/components/DocumentEditor.tsx similarity index 100% rename from examples/getting-started/typescript/src/components/DocumentEditor.tsx rename to demos/typescript/src/components/DocumentEditor.tsx diff --git a/examples/getting-started/typescript/src/main.tsx b/demos/typescript/src/main.tsx similarity index 100% rename from examples/getting-started/typescript/src/main.tsx rename to demos/typescript/src/main.tsx diff --git a/examples/getting-started/typescript/src/vite-env.d.ts b/demos/typescript/src/vite-env.d.ts similarity index 100% rename from examples/getting-started/typescript/src/vite-env.d.ts rename to demos/typescript/src/vite-env.d.ts diff --git a/examples/getting-started/typescript/tsconfig.app.json b/demos/typescript/tsconfig.app.json similarity index 100% rename from examples/getting-started/typescript/tsconfig.app.json rename to demos/typescript/tsconfig.app.json diff --git a/examples/getting-started/typescript/tsconfig.json b/demos/typescript/tsconfig.json similarity index 100% rename from examples/getting-started/typescript/tsconfig.json rename to demos/typescript/tsconfig.json diff --git a/examples/getting-started/typescript/tsconfig.node.json b/demos/typescript/tsconfig.node.json similarity index 100% rename from examples/getting-started/typescript/tsconfig.node.json rename to demos/typescript/tsconfig.node.json diff --git a/examples/getting-started/typescript/vite.config.ts b/demos/typescript/vite.config.ts similarity index 100% rename from examples/getting-started/typescript/vite.config.ts rename to demos/typescript/vite.config.ts diff --git a/examples/getting-started/vanilla/demo-config.json b/demos/vanilla/demo-config.json similarity index 100% rename from examples/getting-started/vanilla/demo-config.json rename to demos/vanilla/demo-config.json diff --git a/examples/getting-started/vanilla/demo-thumbnail.png b/demos/vanilla/demo-thumbnail.png similarity index 100% rename from examples/getting-started/vanilla/demo-thumbnail.png rename to demos/vanilla/demo-thumbnail.png diff --git a/examples/getting-started/vanilla/demo-video.mp4 b/demos/vanilla/demo-video.mp4 similarity index 100% rename from examples/getting-started/vanilla/demo-video.mp4 rename to demos/vanilla/demo-video.mp4 diff --git a/examples/getting-started/vanilla/index.html b/demos/vanilla/index.html similarity index 100% rename from examples/getting-started/vanilla/index.html rename to demos/vanilla/index.html diff --git a/examples/getting-started/vanilla/package.json b/demos/vanilla/package.json similarity index 100% rename from examples/getting-started/vanilla/package.json rename to demos/vanilla/package.json diff --git a/examples/getting-started/vanilla/src/main.js b/demos/vanilla/src/main.js similarity index 100% rename from examples/getting-started/vanilla/src/main.js rename to demos/vanilla/src/main.js diff --git a/examples/getting-started/vanilla/src/style.css b/demos/vanilla/src/style.css similarity index 100% rename from examples/getting-started/vanilla/src/style.css rename to demos/vanilla/src/style.css diff --git a/examples/getting-started/vanilla/vite.config.js b/demos/vanilla/vite.config.js similarity index 100% rename from examples/getting-started/vanilla/vite.config.js rename to demos/vanilla/vite.config.js diff --git a/examples/getting-started/vue/demo-config.json b/demos/vue/demo-config.json similarity index 100% rename from examples/getting-started/vue/demo-config.json rename to demos/vue/demo-config.json diff --git a/examples/getting-started/vue/demo-thumbnail.png b/demos/vue/demo-thumbnail.png similarity index 100% rename from examples/getting-started/vue/demo-thumbnail.png rename to demos/vue/demo-thumbnail.png diff --git a/examples/getting-started/vue/demo-video.mp4 b/demos/vue/demo-video.mp4 similarity index 100% rename from examples/getting-started/vue/demo-video.mp4 rename to demos/vue/demo-video.mp4 diff --git a/examples/getting-started/vue/index.html b/demos/vue/index.html similarity index 100% rename from examples/getting-started/vue/index.html rename to demos/vue/index.html diff --git a/examples/getting-started/vue/package.json b/demos/vue/package.json similarity index 100% rename from examples/getting-started/vue/package.json rename to demos/vue/package.json diff --git a/examples/getting-started/vue/src/App.vue b/demos/vue/src/App.vue similarity index 100% rename from examples/getting-started/vue/src/App.vue rename to demos/vue/src/App.vue diff --git a/examples/getting-started/vue/src/components/DocumentEditor.vue b/demos/vue/src/components/DocumentEditor.vue similarity index 100% rename from examples/getting-started/vue/src/components/DocumentEditor.vue rename to demos/vue/src/components/DocumentEditor.vue diff --git a/examples/getting-started/vue/src/main.js b/demos/vue/src/main.js similarity index 100% rename from examples/getting-started/vue/src/main.js rename to demos/vue/src/main.js diff --git a/examples/getting-started/vue/vite.config.js b/demos/vue/vite.config.js similarity index 100% rename from examples/getting-started/vue/vite.config.js rename to demos/vue/vite.config.js diff --git a/examples/integrations/word-addin/.gitignore b/demos/word-addin/.gitignore similarity index 100% rename from examples/integrations/word-addin/.gitignore rename to demos/word-addin/.gitignore diff --git a/examples/integrations/word-addin/MS-Word-Add-in-Sample.code-workspace b/demos/word-addin/MS-Word-Add-in-Sample.code-workspace similarity index 100% rename from examples/integrations/word-addin/MS-Word-Add-in-Sample.code-workspace rename to demos/word-addin/MS-Word-Add-in-Sample.code-workspace diff --git a/examples/integrations/word-addin/README.md b/demos/word-addin/README.md similarity index 100% rename from examples/integrations/word-addin/README.md rename to demos/word-addin/README.md diff --git a/examples/integrations/word-addin/assets/icon-128.png b/demos/word-addin/assets/icon-128.png similarity index 100% rename from examples/integrations/word-addin/assets/icon-128.png rename to demos/word-addin/assets/icon-128.png diff --git a/examples/integrations/word-addin/assets/icon-128x128.png b/demos/word-addin/assets/icon-128x128.png similarity index 100% rename from examples/integrations/word-addin/assets/icon-128x128.png rename to demos/word-addin/assets/icon-128x128.png diff --git a/examples/integrations/word-addin/assets/icon-16.png b/demos/word-addin/assets/icon-16.png similarity index 100% rename from examples/integrations/word-addin/assets/icon-16.png rename to demos/word-addin/assets/icon-16.png diff --git a/examples/integrations/word-addin/assets/icon-16x16.png b/demos/word-addin/assets/icon-16x16.png similarity index 100% rename from examples/integrations/word-addin/assets/icon-16x16.png rename to demos/word-addin/assets/icon-16x16.png diff --git a/examples/integrations/word-addin/assets/icon-32.png b/demos/word-addin/assets/icon-32.png similarity index 100% rename from examples/integrations/word-addin/assets/icon-32.png rename to demos/word-addin/assets/icon-32.png diff --git a/examples/integrations/word-addin/assets/icon-32x32.png b/demos/word-addin/assets/icon-32x32.png similarity index 100% rename from examples/integrations/word-addin/assets/icon-32x32.png rename to demos/word-addin/assets/icon-32x32.png diff --git a/examples/integrations/word-addin/assets/icon-64.png b/demos/word-addin/assets/icon-64.png similarity index 100% rename from examples/integrations/word-addin/assets/icon-64.png rename to demos/word-addin/assets/icon-64.png diff --git a/examples/integrations/word-addin/assets/icon-64x64.png b/demos/word-addin/assets/icon-64x64.png similarity index 100% rename from examples/integrations/word-addin/assets/icon-64x64.png rename to demos/word-addin/assets/icon-64x64.png diff --git a/examples/integrations/word-addin/assets/icon-80.png b/demos/word-addin/assets/icon-80.png similarity index 100% rename from examples/integrations/word-addin/assets/icon-80.png rename to demos/word-addin/assets/icon-80.png diff --git a/examples/integrations/word-addin/assets/icon-80x80.png b/demos/word-addin/assets/icon-80x80.png similarity index 100% rename from examples/integrations/word-addin/assets/icon-80x80.png rename to demos/word-addin/assets/icon-80x80.png diff --git a/examples/integrations/word-addin/assets/logo-filled.png b/demos/word-addin/assets/logo-filled.png similarity index 100% rename from examples/integrations/word-addin/assets/logo-filled.png rename to demos/word-addin/assets/logo-filled.png diff --git a/examples/integrations/word-addin/assets/logo.png b/demos/word-addin/assets/logo.png similarity index 100% rename from examples/integrations/word-addin/assets/logo.png rename to demos/word-addin/assets/logo.png diff --git a/examples/integrations/word-addin/assets/sample-document.docx b/demos/word-addin/assets/sample-document.docx similarity index 100% rename from examples/integrations/word-addin/assets/sample-document.docx rename to demos/word-addin/assets/sample-document.docx diff --git a/examples/integrations/word-addin/babel.config.json b/demos/word-addin/babel.config.json similarity index 100% rename from examples/integrations/word-addin/babel.config.json rename to demos/word-addin/babel.config.json diff --git a/examples/integrations/word-addin/demo-config.json b/demos/word-addin/demo-config.json similarity index 100% rename from examples/integrations/word-addin/demo-config.json rename to demos/word-addin/demo-config.json diff --git a/examples/integrations/word-addin/demo-thumbnail.png b/demos/word-addin/demo-thumbnail.png similarity index 100% rename from examples/integrations/word-addin/demo-thumbnail.png rename to demos/word-addin/demo-thumbnail.png diff --git a/examples/integrations/word-addin/demo-video.mp4 b/demos/word-addin/demo-video.mp4 similarity index 100% rename from examples/integrations/word-addin/demo-video.mp4 rename to demos/word-addin/demo-video.mp4 diff --git a/examples/integrations/word-addin/manifest.xml b/demos/word-addin/manifest.xml similarity index 100% rename from examples/integrations/word-addin/manifest.xml rename to demos/word-addin/manifest.xml diff --git a/examples/integrations/word-addin/package.json b/demos/word-addin/package.json similarity index 100% rename from examples/integrations/word-addin/package.json rename to demos/word-addin/package.json diff --git a/examples/integrations/word-addin/server/.env.example b/demos/word-addin/server/.env.example similarity index 100% rename from examples/integrations/word-addin/server/.env.example rename to demos/word-addin/server/.env.example diff --git a/examples/integrations/word-addin/server/package.json b/demos/word-addin/server/package.json similarity index 100% rename from examples/integrations/word-addin/server/package.json rename to demos/word-addin/server/package.json diff --git a/examples/integrations/word-addin/server/public/editor.css b/demos/word-addin/server/public/editor.css similarity index 100% rename from examples/integrations/word-addin/server/public/editor.css rename to demos/word-addin/server/public/editor.css diff --git a/examples/integrations/word-addin/server/public/editor.html b/demos/word-addin/server/public/editor.html similarity index 100% rename from examples/integrations/word-addin/server/public/editor.html rename to demos/word-addin/server/public/editor.html diff --git a/examples/integrations/word-addin/server/public/editor.js b/demos/word-addin/server/public/editor.js similarity index 100% rename from examples/integrations/word-addin/server/public/editor.js rename to demos/word-addin/server/public/editor.js diff --git a/examples/integrations/word-addin/server/server.js b/demos/word-addin/server/server.js similarity index 100% rename from examples/integrations/word-addin/server/server.js rename to demos/word-addin/server/server.js diff --git a/examples/integrations/word-addin/src/auth-dialog/auth-dialog.css b/demos/word-addin/src/auth-dialog/auth-dialog.css similarity index 100% rename from examples/integrations/word-addin/src/auth-dialog/auth-dialog.css rename to demos/word-addin/src/auth-dialog/auth-dialog.css diff --git a/examples/integrations/word-addin/src/auth-dialog/auth-dialog.html b/demos/word-addin/src/auth-dialog/auth-dialog.html similarity index 100% rename from examples/integrations/word-addin/src/auth-dialog/auth-dialog.html rename to demos/word-addin/src/auth-dialog/auth-dialog.html diff --git a/examples/integrations/word-addin/src/auth-dialog/auth-dialog.js b/demos/word-addin/src/auth-dialog/auth-dialog.js similarity index 100% rename from examples/integrations/word-addin/src/auth-dialog/auth-dialog.js rename to demos/word-addin/src/auth-dialog/auth-dialog.js diff --git a/examples/integrations/word-addin/src/auth0-config.js.example b/demos/word-addin/src/auth0-config.js.example similarity index 100% rename from examples/integrations/word-addin/src/auth0-config.js.example rename to demos/word-addin/src/auth0-config.js.example diff --git a/examples/integrations/word-addin/src/server-domain.js.example b/demos/word-addin/src/server-domain.js.example similarity index 100% rename from examples/integrations/word-addin/src/server-domain.js.example rename to demos/word-addin/src/server-domain.js.example diff --git a/examples/integrations/word-addin/src/taskpane/taskpane.css b/demos/word-addin/src/taskpane/taskpane.css similarity index 100% rename from examples/integrations/word-addin/src/taskpane/taskpane.css rename to demos/word-addin/src/taskpane/taskpane.css diff --git a/examples/integrations/word-addin/src/taskpane/taskpane.html b/demos/word-addin/src/taskpane/taskpane.html similarity index 100% rename from examples/integrations/word-addin/src/taskpane/taskpane.html rename to demos/word-addin/src/taskpane/taskpane.html diff --git a/examples/integrations/word-addin/src/taskpane/taskpane.js b/demos/word-addin/src/taskpane/taskpane.js similarity index 100% rename from examples/integrations/word-addin/src/taskpane/taskpane.js rename to demos/word-addin/src/taskpane/taskpane.js diff --git a/examples/integrations/word-addin/webpack.config.js b/demos/word-addin/webpack.config.js similarity index 100% rename from examples/integrations/word-addin/webpack.config.js rename to demos/word-addin/webpack.config.js diff --git a/examples/.gitignore b/examples/.gitignore index 934668777a..2286166f02 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -1,5 +1,5 @@ -# Ignore lock files +node_modules *-lock* - -# Ignore npmrc files -*.npmrc \ No newline at end of file +*.npmrc +test-results +playwright-report \ No newline at end of file diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000000..f581a9ca98 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,36 @@ +# SuperDoc Examples + +Minimal, self-contained examples showing how to use SuperDoc. + +## Getting Started + +| Example | Description | +|---------|-------------| +| [react](./react) | React + TypeScript with Vite | +| [vue](./vue) | Vue 3 + TypeScript with Vite | +| [vanilla](./vanilla) | Plain JavaScript with Vite | +| [cdn](./cdn) | Zero build tools — just an HTML file | + +## Features + +| Example | Description | +|---------|-------------| +| [collaboration](./collaboration) | Real-time editing with various Yjs providers | +| [headless-converter](./headless-converter) | Server-side DOCX conversion with Node.js | +| [custom-plugin](./custom-plugin) | Building a custom editor plugin | +| [dynamic-content](./dynamic-content) | Dynamic content rendering | + +## Running an example + +```bash +cd +npm install +npm run dev +``` + +For the CDN example, just open `index.html` or run `npx serve .`. + +## Documentation + +- [Getting Started](https://docs.superdoc.dev/getting-started/installation) +- [Configuration](https://docs.superdoc.dev/core/superdoc/configuration) diff --git a/examples/__tests__/package.json b/examples/__tests__/package.json new file mode 100644 index 0000000000..d6265d6824 --- /dev/null +++ b/examples/__tests__/package.json @@ -0,0 +1,13 @@ +{ + "name": "superdoc-example-smoke-tests", + "private": true, + "type": "module", + "scripts": { + "test": "playwright test", + "test:install": "playwright install chromium" + }, + "devDependencies": { + "@playwright/test": "^1.50.0", + "serve": "^14.2.0" + } +} diff --git a/examples/__tests__/playwright.config.ts b/examples/__tests__/playwright.config.ts new file mode 100644 index 0000000000..57b3e2644d --- /dev/null +++ b/examples/__tests__/playwright.config.ts @@ -0,0 +1,25 @@ +import { defineConfig, devices } from '@playwright/test'; + +const example = process.env.EXAMPLE || 'react'; +const isCdn = example === 'cdn'; +const port = isCdn ? 3000 : 5173; + +export default defineConfig({ + testDir: '.', + retries: 1, + timeout: 30_000, + webServer: { + command: isCdn + ? `npx serve ../${example} -l ${port}` + : `npm run --prefix ../${example} dev -- --port ${port}`, + url: `http://localhost:${port}`, + timeout: 30_000, + reuseExistingServer: !process.env.CI, + }, + use: { + baseURL: `http://localhost:${port}`, + }, + projects: [ + { name: 'chromium', use: { ...devices['Desktop Chrome'] } }, + ], +}); diff --git a/examples/__tests__/smoke.spec.ts b/examples/__tests__/smoke.spec.ts new file mode 100644 index 0000000000..754cd95ae3 --- /dev/null +++ b/examples/__tests__/smoke.spec.ts @@ -0,0 +1,18 @@ +import { test, expect } from '@playwright/test'; + +test('example loads without errors', async ({ page }) => { + const errors: string[] = []; + + page.on('pageerror', (err) => errors.push(err.message)); + page.on('console', (msg) => { + if (msg.type() === 'error') errors.push(msg.text()); + }); + + await page.goto('/'); + await expect(page.locator('body')).toBeVisible(); + + // Give the app a moment to initialize (SuperDoc is async) + await page.waitForTimeout(2000); + + expect(errors).toEqual([]); +}); diff --git a/examples/advanced/README.md b/examples/advanced/README.md deleted file mode 100644 index daee9d73a3..0000000000 --- a/examples/advanced/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Advanced Examples - -Advanced examples demonstrating complex SuperDoc features and use cases. - -## Examples - -| Example | Description | -|---------|-------------| -| [docx-from-html](./docx-from-html) | Generate DOCX files from HTML content | -| [html-editor](./html-editor) | HTML-based editor mode | -| [linked-sections](./linked-sections) | Link editor sections across documents | -| [fields](./fields) | Work with document fields (merge fields, form fields) | -| [loading-from-json](./loading-from-json) | Load documents from JSON format | -| [replace-content](./replace-content) | Programmatically replace document content | -| [text-selection](./text-selection) | Programmatic text selection APIs | -| [docxtemplater](./docxtemplater) | Template-based document generation | -| [grading-papers](./grading-papers) | Document review and annotation use case | -| [headless-converter](./headless-converter) | Convert DOCX to HTML/JSON/text/Markdown (Node.js) | - -## Running an Example - -```bash -cd -npm install -npm run dev -``` diff --git a/examples/ai/README.md b/examples/ai/README.md deleted file mode 100644 index a55e2436e5..0000000000 --- a/examples/ai/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# AI Examples - -Examples for integrating AI capabilities with SuperDoc. - -## Examples - -| Example | Description | -|---------|-------------| -| [quickstart](./quickstart) | Quick start guide for SuperDoc AI features | -| [prompts](./prompts) | Example prompts for AI-powered document operations | - -## Running an Example - -```bash -cd -npm install -npm run dev -``` diff --git a/examples/ai/prompts/claude/prompt.txt b/examples/ai/prompts/claude/prompt.txt deleted file mode 100644 index 8e9f1c7e53..0000000000 --- a/examples/ai/prompts/claude/prompt.txt +++ /dev/null @@ -1,84 +0,0 @@ -Create a simple document editor using SuperDoc and the following code below: - - - - - - - - - - - - SuperDoc - CDN example - - - - -
SuperDoc - CDN example
-
- - - - -
- - - - - \ No newline at end of file diff --git a/examples/ai/tool-calls/.env.example b/examples/ai/tool-calls/.env.example deleted file mode 100644 index dcb1f1a747..0000000000 --- a/examples/ai/tool-calls/.env.example +++ /dev/null @@ -1,4 +0,0 @@ -# Copy this file to ".env" and fill in your API key before running the demo. -# VITE_OPENAI_API_KEY=sk-your-openai-key -# VITE_OPENAI_MODEL=gpt-4o-mini -# VITE_PROXY_URL=proxy.url diff --git a/examples/ai/tool-calls/README.md b/examples/ai/tool-calls/README.md deleted file mode 100644 index 2f90ef21e6..0000000000 --- a/examples/ai/tool-calls/README.md +++ /dev/null @@ -1,57 +0,0 @@ -# SuperDoc AI Quickstart - -Launch a live SuperDoc editor with AI helpers. This example shows how to wire up -`@superdoc-dev/ai` with a fresh SuperDoc instance, register a few buttons, and stream results back into the -document. - -## Prerequisites - -- Node.js 18+ -- An OpenAI API key (or update the provider section in `src/main.js` for another provider) - -## Run the demo - -```bash -cd examples/ai/quickstart -cp .env.example .env # add your OpenAI key + preferred model -npm install -npm run dev -``` - -Vite will print a local URL (defaults to ). Open it in your browser and use the action chips at -the top of the editor to generate, locate, or revise content while the status pill reports progress. - -## What this example covers - -- creating a SuperDoc instance with a ready-to-edit document -- initializing `AIActions` after the editor mounts -- streaming UI feedback via the built-in callbacks -- wiring multiple AI actions (`insertContent`, `insertTrackedChange`, `highlight`, `replace`, `replaceAll`, `find`, - `findAll`, `insertComment`, `insertComments`) through a shared handler -- safely handling missing API keys and error states - -## Key files - -- `src/main.js` – core integration logic -- `src/style.css` – quick styling for the layout and status panel -- `.env.example` – environment variables expected by the example - -## Switching providers - -OpenAI is used here, but you can swap in another provider by changing the `provider` block inside -`initializeAI()` in `src/main.js`. For example, to call a custom HTTP endpoint: - -```js -aiInstance = new AIActions(superdoc, { - user: { displayName: 'SuperDoc AI Assistant' }, - provider: { - type: 'http', - url: import.meta.env.VITE_AI_HTTP_URL, - headers: { - Authorization: `Bearer ${import.meta.env.VITE_AI_HTTP_TOKEN}` - } - } -}); -``` - -Restart the dev server after updating environment variables so Vite can pick them up. diff --git a/examples/ai/tool-calls/demo-config.json b/examples/ai/tool-calls/demo-config.json deleted file mode 100644 index 61e707d7e6..0000000000 --- a/examples/ai/tool-calls/demo-config.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "dirname": "superdoc-ai-tool-calls", - "tags": [ - "vue", - "agentic", - "ai" - ], - "title": "AI Actions" -} \ No newline at end of file diff --git a/examples/ai/tool-calls/demo-thumbnail.png b/examples/ai/tool-calls/demo-thumbnail.png deleted file mode 100644 index 9267c8c718..0000000000 Binary files a/examples/ai/tool-calls/demo-thumbnail.png and /dev/null differ diff --git a/examples/ai/tool-calls/demo-video.mp4 b/examples/ai/tool-calls/demo-video.mp4 deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/examples/ai/tool-calls/index.html b/examples/ai/tool-calls/index.html deleted file mode 100644 index f4e3d24431..0000000000 --- a/examples/ai/tool-calls/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - SuperDoc AI Quickstart - Vue - - - -
- - - diff --git a/examples/ai/tool-calls/package.json b/examples/ai/tool-calls/package.json deleted file mode 100644 index c98250875c..0000000000 --- a/examples/ai/tool-calls/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "superdoc-ai-quickstart", - "private": true, - "version": "0.0.1", - "type": "module", - "scripts": { - "dev": "vite", - "build": "vite build", - "preview": "vite preview" - }, - "dependencies": { - "@vitejs/plugin-vue": "^6.0.2", - "@superdoc-dev/ai": "^0.1.6", - "superdoc": "^1.0.0-next.1", - "vue": "^3.5.24" - }, - "devDependencies": { - "vite": "^6.3.5" - } -} \ No newline at end of file diff --git a/examples/ai/tool-calls/public/default.docx b/examples/ai/tool-calls/public/default.docx deleted file mode 100644 index 7082071ac4..0000000000 Binary files a/examples/ai/tool-calls/public/default.docx and /dev/null differ diff --git a/examples/ai/tool-calls/src/App.vue b/examples/ai/tool-calls/src/App.vue deleted file mode 100644 index 8daa14de99..0000000000 --- a/examples/ai/tool-calls/src/App.vue +++ /dev/null @@ -1,359 +0,0 @@ - - - \ No newline at end of file diff --git a/examples/ai/tool-calls/src/actions.js b/examples/ai/tool-calls/src/actions.js deleted file mode 100644 index 64c7b87e91..0000000000 --- a/examples/ai/tool-calls/src/actions.js +++ /dev/null @@ -1,220 +0,0 @@ - -// Available actions dictionary - matches the planner's built-in tools -const actionsDictionary = { - 'findAll': { - label: 'Find All', - description: 'Locate all occurrences of content matching the instruction', - method: (ai, prompt) => ai.action.findAll(prompt) - }, - 'highlight': { - label: 'Highlight', - description: 'Visually highlight text without changing it. Use for: drawing attention to issues, marking items for discussion, indicating areas of concern.', - method: (ai, prompt) => ai.action.highlight(prompt) - }, - 'replaceAll': { - label: 'Replace All', - description: 'DIRECT batch editing (no tracking). Use ONLY when user explicitly wants all instances changed immediately AND the user does NOT provide exact find/replace text pairs.', - method: (ai, prompt) => ai.action.replaceAll(prompt) - }, - 'literalReplace': { - label: 'Literal Replace', - description: 'PREFERRED for explicit find-and-replace operations. Use when the user provides both the exact text to find AND the exact replacement text.', - method: (ai, prompt) => { - // For literal replace, we need to parse the prompt differently - // This is a simplified version - in practice, the planner would handle this - const parts = prompt.split(/ to | with /i); - if (parts.length >= 2) { - const findText = parts[0].trim(); - const replaceText = parts.slice(1).join(' ').trim(); - return ai.action.literalReplace(findText, replaceText, { trackChanges: false }); - } - throw new Error('Literal replace requires format: "find X to replace with Y"'); - } - }, - 'insertTrackedChanges': { - label: 'Insert Tracked Changes', - description: 'PRIMARY TOOL for suggesting multiple edits. Creates tracked changes across multiple locations. Use for: batch corrections, applying consistent changes, multiple editing suggestions.', - method: (ai, prompt) => ai.action.insertTrackedChanges(prompt) - }, - 'insertComments': { - label: 'Insert Comments', - description: 'PRIMARY TOOL for providing feedback in multiple locations when location criteria are complex or require AI interpretation. Use for: comprehensive document review, multiple questions, batch feedback.', - method: (ai, prompt) => ai.action.insertComments(prompt) - }, - 'literalInsertComment': { - label: 'Literal Insert Comment', - description: 'PREFERRED for explicit find-and-add-comment operations. Use when the user provides both the exact text to find AND the exact comment text to add.', - method: (ai, prompt) => { - // Simplified version - planner would handle this better - const parts = prompt.split(/ with comment | add comment /i); - if (parts.length >= 2) { - const findText = parts[0].trim(); - const commentText = parts.slice(1).join(' ').trim(); - return ai.action.literalInsertComment(findText, commentText); - } - throw new Error('Literal insert comment requires format: "find X with comment Y"'); - } - }, - 'summarize': { - label: 'Summarize', - description: 'Generate a summary or clarification of content. Use for: creating executive summaries, explaining complex sections, condensing information.', - method: (ai, prompt) => ai.action.summarize(prompt) - }, - 'insertContent': { - label: 'Insert Content', - description: 'Draft and insert new content relative to the current selection. Use for inserting headings, lists, clauses, or replacing selected text.', - method: (ai, prompt) => ai.action.insertContent(prompt) - }, -} - -// Export the available actions list as a static array -export const availableActions = Object.keys(actionsDictionary) - .sort() - .map(key => ({ - key, - ...actionsDictionary[key] - })) - -// Action handler class to manage dependencies and reduce parameter passing -export class ActionHandler { - constructor(aiInstance, logger) { - this.availableActions = availableActions - this.aiInstance = aiInstance - this.logger = logger - } - - // Build tools array for OpenAI function calling - buildToolsArray() { - const convertToOpenAITool = action => ({ - type: "function", - function: { - name: action.key, - description: action.description, - parameters: { - type: "object", - properties: { - prompt: { - type: "string", - description: "The specific instruction or prompt for this action" - } - }, - required: ["prompt"] - } - } - }) - - return this.availableActions.map(convertToOpenAITool) - } - - // Make API request to proxy - async callOpenAI(prompt, tools) { - const proxyUrl = import.meta.env.VITE_PROXY_URL - if (!proxyUrl) { - throw new Error('VITE_PROXY_URL not configured') - } - - const response = await fetch(proxyUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ - messages: [{ role: 'user', content: prompt }], - tools: tools, - tool_choice: "auto", - temperature: 0.7, - max_tokens: 1000 - }) - }) - - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`) - } - - return await response.json() - } - - // Execute a single tool call - async executeToolCall(toolCall) { - const functionName = toolCall.function.name - const args = JSON.parse(toolCall.function.arguments) - - const action = this.availableActions.find(a => a.key === functionName) - - if (!action?.method) { - this.logger.addActionLog(functionName, args.prompt) - this.logger.updateCurrentLog({ status: 'Error', error: 'Tool not found' }) - return `✗ ${functionName}: Tool not found` - } - - try { - this.logger.addActionLog(action.label, args.prompt) - console.log(`Executing ${functionName} with prompt:`, args.prompt) - - await action.method(this.aiInstance.value, args.prompt) - - this.logger.updateCurrentLog({ status: 'Done.' }) - return `✓ ${action.label}: "${args.prompt}"` - - } catch (error) { - console.error(`Error executing ${functionName}:`, error) - this.logger.updateCurrentLog({ status: 'Error', error: error.message }) - return `✗ ${action.label}: Error - ${error.message}` - } - } - - - // Execute tool calls from open prompt response - async executeToolCallsFromPrompt(toolCalls) { - const toolResults = [] - - for (const toolCall of toolCalls) { - const result = await this.executeToolCall(toolCall) - toolResults.push(result) - } - - this.logger.updateOriginalLog(toolCalls.length) - - const result = `Function calls executed:\n${toolResults.join('\n')}` - console.log('Open prompt result:', result) - return result - } - - // Standalone function to handle open prompt AI calls - async handleOpenPrompt(prompt) { - try { - this.logger.updateCurrentLog({ status: 'Processing open prompt...' }) - - const tools = this.buildToolsArray() - const data = await this.callOpenAI(prompt, tools) - const message = data.choices?.[0]?.message - - if (message?.tool_calls?.length > 0) { - console.log('Function calls requested:', message.tool_calls) - this.logger.updateCurrentLog({ status: `Executing ${message.tool_calls.length} function call(s)...` }) - - // Return the tool calls for the application to handle - return { - type: 'tool_calls', - toolCalls: message.tool_calls, - count: message.tool_calls.length - } - - } else { - // No tools were run - const result = message?.content || data.content || JSON.stringify(data) - console.log('Open prompt result:', result) - this.logger.updateNoToolsRun(result) - - return { - type: 'text_response', - content: result - } - } - - } catch (error) { - this.logger.handleError(error) - throw error - } - } -} \ No newline at end of file diff --git a/examples/ai/tool-calls/src/components/Sidebar.vue b/examples/ai/tool-calls/src/components/Sidebar.vue deleted file mode 100644 index 9df57ce03e..0000000000 --- a/examples/ai/tool-calls/src/components/Sidebar.vue +++ /dev/null @@ -1,169 +0,0 @@ - - - \ No newline at end of file diff --git a/examples/ai/tool-calls/src/logging.js b/examples/ai/tool-calls/src/logging.js deleted file mode 100644 index c99e452245..0000000000 --- a/examples/ai/tool-calls/src/logging.js +++ /dev/null @@ -1,95 +0,0 @@ -import { ref } from 'vue' - -// Helper function for text truncation -function truncateText(text, maxLength) { - if (!text) return '' - return text.length > maxLength ? text.substring(0, maxLength) + '...' : text -} - -export class ActionLogger { - constructor() { - this.actionLogs = ref([]) - this.currentLogId = 0 - this.currentOriginalLogId = null - } - - addActionLog(action, prompt) { - const log = { - id: this.currentLogId++, - action: action, - prompt: prompt, - status: 'Starting...', - partialResult: null, - fullResult: null, - error: null - } - this.actionLogs.value.push(log) - this.currentOriginalLogId = log.id - return log - } - - updateCurrentLog(updates) { - if (this.actionLogs.value.length > 0) { - const currentLog = this.actionLogs.value[this.actionLogs.value.length - 1] - Object.assign(currentLog, updates) - } - } - - updateLogById(logId, updates) { - const logIndex = this.actionLogs.value.findIndex(log => log.id === logId) - if (logIndex !== -1) { - Object.assign(this.actionLogs.value[logIndex], updates) - } - } - - updateStreamingResult(context) { - this.updateCurrentLog({ - status: 'Streaming...', - partialResult: truncateText(context.partialResult, 100) - }) - } - - updateStreamingEnd(context) { - this.updateCurrentLog({ - status: 'Done.', - fullResult: truncateText(String(context.fullResult), 100) - }) - } - - updateError(error) { - this.updateCurrentLog({ - status: 'Error', - error: error.message - }) - } - - updateNoToolsRun(result) { - this.updateCurrentLog({ - status: 'No tools were run.', - fullResult: truncateText(String(result), 100) - }) - } - - updateOriginalLog(toolCallsCount) { - if (!this.currentOriginalLogId) return - - const originalLogIndex = this.actionLogs.value.findIndex(log => log.id === this.currentOriginalLogId) - if (originalLogIndex !== -1) { - this.actionLogs.value[originalLogIndex].status = `All ${toolCallsCount} function calls completed.` - } - } - - handleError(error) { - console.error('Open prompt error:', error) - - if (this.currentOriginalLogId) { - const originalLogIndex = this.actionLogs.value.findIndex(log => log.id === this.currentOriginalLogId) - if (originalLogIndex !== -1) { - this.actionLogs.value[originalLogIndex].status = 'Open prompt failed.' - this.actionLogs.value[originalLogIndex].error = error.message - } - } else { - this.updateCurrentLog({ status: 'Open prompt failed.', error: error.message }) - } - } -} \ No newline at end of file diff --git a/examples/ai/tool-calls/src/main.js b/examples/ai/tool-calls/src/main.js deleted file mode 100644 index 01433bca2a..0000000000 --- a/examples/ai/tool-calls/src/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import { createApp } from 'vue' -import App from './App.vue' - -createApp(App).mount('#app') diff --git a/examples/ai/tool-calls/src/style.css b/examples/ai/tool-calls/src/style.css deleted file mode 100644 index c1193abdf2..0000000000 --- a/examples/ai/tool-calls/src/style.css +++ /dev/null @@ -1,501 +0,0 @@ -* { - box-sizing: border-box; -} - -body { - margin: 0; - font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; - background: #f6f8fb; - color: #0f172a; -} - -.page { - min-height: 100vh; - display: grid; - grid-template-columns: minmax(0, 1fr); - background: linear-gradient(180deg, rgba(248, 250, 252, 0.8), rgba(241, 245, 249, 0.95)); - /* padding: 3rem 1.5rem; */ -} - -.page-shell { - padding: 1em; - display: flex; - flex-direction: column; - gap: 1.75rem; - align-items: center; -} - -.page-header { - width: 100%; - margin-bottom: 1.5rem; -} - -.page-header h1 { - margin: 0 0 0.35rem; - font-size: 1.6rem; - color: #0f172a; -} - -.page-header > div:first-child { - /* display: flex; */ - flex-direction: column; -} - -.page-header p { - margin: 0; - line-height: 1.45; - color: #475569; -} - -.main-layout { - width: 100%; -} - -.document-area { - background: rgba(255, 255, 255, 0.88); - border-radius: 1rem; - box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12); - padding: 1.5rem; -} - -.document-content { - display: flex; - gap: 1.5rem; -} - -.superdoc-section { - flex: 1; -} - -.sidebar { - width: 400px; - flex-shrink: 0; - position: relative; -} - -.sidebar.collapsed { - width: 30px; - overflow: hidden; -} - -.collapse-toggle { - position: absolute; - left: -30px; - top: 80px; - width: 30px; - height: 60px; - background: white; - border: 1px solid rgba(37, 99, 235, 0.2); - border-right: none; - border-radius: 5px 0 0 5px; - cursor: pointer; - display: flex; - align-items: center; - justify-content: center; - z-index: 10; -} - -.sidebar.collapsed .collapse-toggle { - left: 0; - border: 1px solid rgba(37, 99, 235, 0.2); - border-radius: 5px; -} - -.collapse-toggle:hover { - background-color: #f9fafb; -} - -.collapse-toggle .chevron { - color: #25282d; - font-size: 24px; - font-weight: bold; - line-height: 1; -} - -.history-section { - background: white; - border: 1px solid rgba(37, 99, 235, 0.2); - border-radius: 8px; - margin-bottom: 1rem; - height: 300px; - display: flex; - flex-direction: column; -} - -.section-header { - padding: 0.75rem 1rem; - border-bottom: 1px solid #e5e7eb; -} - -.section-header span { - font-size: 0.7rem; - letter-spacing: 0.08em; - text-transform: uppercase; - color: #3b82f6; - font-weight: 600; -} - -.history-content { - flex: 1; - padding: 0.75rem 1rem; - overflow-y: auto; - font-size: 0.875rem; -} - -.history-placeholder { - color: #9ca3af; - font-style: italic; - text-align: center; - padding: 2rem 1rem; - font-size: 0.875rem; -} - -.history-item { - color: #374151; - font-size: 0.8rem; - border-bottom: 1px solid #f3f4f6; - padding-bottom: 0.5rem; - margin-bottom: 0.5rem; -} - -.history-item:last-child { - border-bottom: none; - margin-bottom: 0; - padding-bottom: 0; -} - -.history-action { - font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace; - margin-bottom: 0.25rem; -} - -.history-status { - font-size: 0.75rem; - color: #6b7280; - font-style: italic; - display: flex; - align-items: center; - gap: 0.5rem; -} - -.spinner { - width: 0.75rem; - height: 0.75rem; - border: 1px solid #d1d5db; - border-top: 1px solid #6366f1; - border-radius: 50%; - animation: spin 1s linear infinite; - flex-shrink: 0; -} - -@keyframes spin { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } -} - -.controls-section { - background: white; - border: 1px solid rgba(37, 99, 235, 0.2); - border-radius: 8px; - padding: 1rem; -} - -.mode-toggle { - display: flex; - margin-bottom: 1rem; - border: 1px solid #d1d5db; - border-radius: 8px; - overflow: hidden; -} - -.mode-toggle-btn { - flex: 1; - padding: 0.75rem 1rem; - border: none; - background: white; - font-size: 0.875rem; - font-weight: 500; - color: #6b7280; - cursor: pointer; - transition: all 0.2s ease; -} - -.mode-toggle-btn:first-child { - border-right: 1px solid #d1d5db; -} - -.mode-toggle-btn.active { - background: #6366f1; - color: white; -} - -.mode-toggle-btn:hover:not(.active) { - background: #f3f4f6; -} - -.custom-dropdown:disabled { - opacity: 0.8; - cursor: default; -} - -.custom-dropdown small { - font-weight: 400; - opacity: 0.8; -} - - - -.control-row { - display: flex; - gap: 1rem; - align-items: flex-start; -} - -.dropdown-container { - position: relative; - flex: 1; -} - -.custom-dropdown { - width: 100%; - min-width: 200px; - padding: 0.75rem 1rem; - border: 2px solid #d1d5db; - border-radius: 8px; - background: white; - font-size: 1rem; - font-weight: 500; - color: #374151; - cursor: pointer; - display: flex; - align-items: center; - justify-content: space-between; - transition: border-color 0.2s ease, box-shadow 0.2s ease; -} - -.custom-dropdown:hover { - border-color: #9ca3af; -} - -.custom-dropdown:focus { - outline: none; - border-color: #6366f1; - box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); -} - -.custom-dropdown.is-open { - border-color: #6366f1; - box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); -} - -.dropdown-arrow { - font-size: 0.875rem; - color: #6b7280; - transition: transform 0.2s ease; -} - -.custom-dropdown.is-open .dropdown-arrow { - transform: rotate(180deg); -} - -.dropdown-menu { - position: absolute; - top: 100%; - left: 0; - right: 0; - margin-top: 0.25rem; - background: white; - border: 1px solid #e5e7eb; - border-radius: 8px; - box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1); - z-index: 50; - max-height: 300px; - overflow-y: auto; -} - -.dropdown-item { - width: 100%; - padding: 0.75rem 1rem; - border: none; - background: transparent; - font-size: 0.95rem; - color: #374151; - text-align: left; - cursor: pointer; - transition: background-color 0.15s ease; - display: block; -} - -.dropdown-item:hover { - background-color: #f3f4f6; -} - -.dropdown-item:focus { - outline: none; - background-color: #e0e7ff; -} - -.dropdown-item.is-selected { - background-color: #e0e7ff; - color: #6366f1; - font-weight: 600; -} - -.dropdown-item:first-child { - border-radius: 8px 8px 0 0; -} - -.dropdown-item:last-child { - border-radius: 0 0 8px 8px; -} - -.run-button { - padding: 0.75rem 1.5rem; - border: none; - border-radius: 8px; - background: linear-gradient(135deg, #6366f1, #8b5cf6); - color: white; - font-size: 1rem; - font-weight: 600; - cursor: pointer; - display: flex; - align-items: center; - gap: 0.5rem; - transition: all 0.2s ease; - white-space: nowrap; -} - -.run-button:hover:not(:disabled) { - background: linear-gradient(135deg, #5b5de3, #7c3aed); - transform: translateY(-1px); - box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); -} - -.run-button:focus { - outline: none; - box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3); -} - -.run-button:disabled { - opacity: 0.6; - cursor: not-allowed; - transform: none; - box-shadow: none; -} - -.prompt-container { - margin-top: 1rem; -} - -.prompt-textarea { - width: 100%; - min-height: 100px; - padding: 1rem; - border: 2px solid #d1d5db; - border-radius: 8px; - font-size: 1rem; - font-family: inherit; - line-height: 1.5; - color: #374151; - background: white; - resize: vertical; - transition: border-color 0.2s ease, box-shadow 0.2s ease; -} - -.prompt-hint { - font-size: 0.75rem; - color: #6b7280; - margin-top: 0.5rem; - text-align: right; - font-style: italic; -} - -.prompt-textarea::placeholder { - color: #9ca3af; - font-style: italic; -} - -.prompt-textarea:focus { - outline: none; - border-color: #6366f1; - box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); -} - -@media (max-width: 640px) { - .control-row { - flex-direction: column; - gap: 0.75rem; - } - - .custom-dropdown { - min-width: unset; - } -} - -#superdoc { - width: 100%; - min-height: 500px; - background: white; - border-radius: 0.75rem; - box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06); - border: 1px solid rgba(0, 0, 0, 0.05); - overflow: hidden; -} - -.superdoc { - justify-content: center; -} - -@media (max-width: 520px) { - .prompt-inline { - width: min(320px, calc(100vw - 2rem)); - } -} - -.import-export-buttons { - display: flex; - gap: 0.5rem; - justify-content: flex-end; - margin-bottom: 0.75rem; -} - -.toolbar-container { - display: flex; - align-items: flex-start; -} - -.import-btn, -.export-btn { - display: flex; - align-items: center; - gap: 0.375rem; - padding: 0.5rem 0.75rem; - border: 1px solid #d1d5db; - border-radius: 6px; - background: white; - font-size: 0.875rem; - font-weight: 500; - color: #374151; - cursor: pointer; - transition: all 0.2s ease; - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); -} - -.import-btn:hover, -.export-btn:hover { - background: #f9fafb; - border-color: #9ca3af; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -} - -.import-btn:focus, -.export-btn:focus { - outline: none; - border-color: #6366f1; - box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); -} - -.import-btn i, -.export-btn i { - font-size: 0.75rem; -} diff --git a/examples/cdn/README.md b/examples/cdn/README.md new file mode 100644 index 0000000000..fd63207b79 --- /dev/null +++ b/examples/cdn/README.md @@ -0,0 +1,14 @@ +# SuperDoc — CDN + +Zero build tools. Open `index.html` in a browser or serve with any static server. + +## Run + +```bash +npx serve . +``` + +## Learn more + +- [Vanilla JS Guide](https://docs.superdoc.dev/getting-started/frameworks/vanilla-js) +- [Configuration Reference](https://docs.superdoc.dev/core/superdoc/configuration) diff --git a/examples/cdn/index.html b/examples/cdn/index.html new file mode 100644 index 0000000000..955216acea --- /dev/null +++ b/examples/cdn/index.html @@ -0,0 +1,36 @@ + + + + + + SuperDoc — CDN + + + + +
+ +
+
+ + + + diff --git a/examples/getting-started/typescript/.gitignore b/examples/custom-plugin/.gitignore similarity index 100% rename from examples/getting-started/typescript/.gitignore rename to examples/custom-plugin/.gitignore diff --git a/examples/customization/custom-plugin/README.md b/examples/custom-plugin/README.md similarity index 100% rename from examples/customization/custom-plugin/README.md rename to examples/custom-plugin/README.md diff --git a/examples/customization/custom-plugin/custom-plugin-extension.js b/examples/custom-plugin/custom-plugin-extension.js similarity index 100% rename from examples/customization/custom-plugin/custom-plugin-extension.js rename to examples/custom-plugin/custom-plugin-extension.js diff --git a/examples/customization/custom-plugin/demo-config.json b/examples/custom-plugin/demo-config.json similarity index 100% rename from examples/customization/custom-plugin/demo-config.json rename to examples/custom-plugin/demo-config.json diff --git a/examples/customization/custom-plugin/index.html b/examples/custom-plugin/index.html similarity index 100% rename from examples/customization/custom-plugin/index.html rename to examples/custom-plugin/index.html diff --git a/examples/customization/custom-plugin/package.json b/examples/custom-plugin/package.json similarity index 100% rename from examples/customization/custom-plugin/package.json rename to examples/custom-plugin/package.json diff --git a/examples/integrations/chrome-extension/chrome-extension/icons/logo.webp b/examples/custom-plugin/public/logo.webp similarity index 100% rename from examples/integrations/chrome-extension/chrome-extension/icons/logo.webp rename to examples/custom-plugin/public/logo.webp diff --git a/examples/shared/data/sample-document.docx b/examples/custom-plugin/public/sample-document.docx similarity index 100% rename from examples/shared/data/sample-document.docx rename to examples/custom-plugin/public/sample-document.docx diff --git a/examples/customization/custom-plugin/src/App.vue b/examples/custom-plugin/src/App.vue similarity index 100% rename from examples/customization/custom-plugin/src/App.vue rename to examples/custom-plugin/src/App.vue diff --git a/examples/customization/custom-plugin/src/custom-plugin-extension.js b/examples/custom-plugin/src/custom-plugin-extension.js similarity index 100% rename from examples/customization/custom-plugin/src/custom-plugin-extension.js rename to examples/custom-plugin/src/custom-plugin-extension.js diff --git a/examples/customization/custom-plugin/src/main.js b/examples/custom-plugin/src/main.js similarity index 100% rename from examples/customization/custom-plugin/src/main.js rename to examples/custom-plugin/src/main.js diff --git a/examples/customization/custom-plugin/src/style.css b/examples/custom-plugin/src/style.css similarity index 100% rename from examples/customization/custom-plugin/src/style.css rename to examples/custom-plugin/src/style.css diff --git a/examples/customization/custom-plugin/vite.config.js b/examples/custom-plugin/vite.config.js similarity index 100% rename from examples/customization/custom-plugin/vite.config.js rename to examples/custom-plugin/vite.config.js diff --git a/examples/customization/README.md b/examples/customization/README.md deleted file mode 100644 index 9f0b55cbeb..0000000000 --- a/examples/customization/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Customization Examples - -Examples showing how to customize and extend SuperDoc's editor functionality. - -## Examples - -| Example | Description | -|---------|-------------| -| [toolbar](./toolbar) | Customize the editor toolbar | -| [custom-mark](./custom-mark) | Create custom text marks (formatting) | -| [custom-node](./custom-node) | Create custom node types | -| [custom-plugin](./custom-plugin) | Build custom editor plugins | -| [dynamic-content](./dynamic-content) | External plugin with dynamic content injection | - -## Running an Example - -```bash -cd -npm install -npm run dev -``` diff --git a/examples/customization/dynamic-content/.gitignore b/examples/dynamic-content/.gitignore similarity index 100% rename from examples/customization/dynamic-content/.gitignore rename to examples/dynamic-content/.gitignore diff --git a/examples/customization/dynamic-content/README.md b/examples/dynamic-content/README.md similarity index 100% rename from examples/customization/dynamic-content/README.md rename to examples/dynamic-content/README.md diff --git a/examples/customization/dynamic-content/index.html b/examples/dynamic-content/index.html similarity index 100% rename from examples/customization/dynamic-content/index.html rename to examples/dynamic-content/index.html diff --git a/examples/customization/dynamic-content/package.json b/examples/dynamic-content/package.json similarity index 100% rename from examples/customization/dynamic-content/package.json rename to examples/dynamic-content/package.json diff --git a/examples/customization/dynamic-content/plugins/document-map/document-map.js b/examples/dynamic-content/plugins/document-map/document-map.js similarity index 100% rename from examples/customization/dynamic-content/plugins/document-map/document-map.js rename to examples/dynamic-content/plugins/document-map/document-map.js diff --git a/examples/customization/dynamic-content/plugins/document-map/index.js b/examples/dynamic-content/plugins/document-map/index.js similarity index 100% rename from examples/customization/dynamic-content/plugins/document-map/index.js rename to examples/dynamic-content/plugins/document-map/index.js diff --git a/examples/customization/dynamic-content/public/generic-license.docx b/examples/dynamic-content/public/generic-license.docx similarity index 100% rename from examples/customization/dynamic-content/public/generic-license.docx rename to examples/dynamic-content/public/generic-license.docx diff --git a/examples/shared/images/logo.webp b/examples/dynamic-content/public/logo.webp similarity index 100% rename from examples/shared/images/logo.webp rename to examples/dynamic-content/public/logo.webp diff --git a/examples/shared/images/superdoc-logo.png b/examples/dynamic-content/public/superdoc-logo.png similarity index 100% rename from examples/shared/images/superdoc-logo.png rename to examples/dynamic-content/public/superdoc-logo.png diff --git a/examples/customization/dynamic-content/src/App.vue b/examples/dynamic-content/src/App.vue similarity index 100% rename from examples/customization/dynamic-content/src/App.vue rename to examples/dynamic-content/src/App.vue diff --git a/examples/customization/dynamic-content/src/components/DocumentMap.vue b/examples/dynamic-content/src/components/DocumentMap.vue similarity index 100% rename from examples/customization/dynamic-content/src/components/DocumentMap.vue rename to examples/dynamic-content/src/components/DocumentMap.vue diff --git a/examples/customization/dynamic-content/src/components/DocumentMapItem.vue b/examples/dynamic-content/src/components/DocumentMapItem.vue similarity index 100% rename from examples/customization/dynamic-content/src/components/DocumentMapItem.vue rename to examples/dynamic-content/src/components/DocumentMapItem.vue diff --git a/examples/customization/dynamic-content/src/main.js b/examples/dynamic-content/src/main.js similarity index 100% rename from examples/customization/dynamic-content/src/main.js rename to examples/dynamic-content/src/main.js diff --git a/examples/customization/dynamic-content/src/style.css b/examples/dynamic-content/src/style.css similarity index 100% rename from examples/customization/dynamic-content/src/style.css rename to examples/dynamic-content/src/style.css diff --git a/examples/customization/dynamic-content/vite.config.js b/examples/dynamic-content/vite.config.js similarity index 100% rename from examples/customization/dynamic-content/vite.config.js rename to examples/dynamic-content/vite.config.js diff --git a/examples/getting-started/README.md b/examples/getting-started/README.md deleted file mode 100644 index f10052469b..0000000000 --- a/examples/getting-started/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Getting Started Examples - -Quick start examples to get SuperDoc running in your preferred framework. - -## Examples - -| Example | Description | -|---------|-------------| -| [react](./react) | Basic React integration | -| [vue](./vue) | Basic Vue.js integration | -| [vanilla](./vanilla) | Plain JavaScript without frameworks | -| [typescript](./typescript) | TypeScript setup with type definitions | -| [cdn](./cdn) | Browser-based setup using CDN links | - -## Running an Example - -```bash -cd -npm install -npm run dev -``` diff --git a/examples/advanced/headless-converter/README.md b/examples/headless-converter/README.md similarity index 100% rename from examples/advanced/headless-converter/README.md rename to examples/headless-converter/README.md diff --git a/examples/advanced/headless-converter/package.json b/examples/headless-converter/package.json similarity index 100% rename from examples/advanced/headless-converter/package.json rename to examples/headless-converter/package.json diff --git a/examples/advanced/headless-converter/sample.docx b/examples/headless-converter/sample.docx similarity index 100% rename from examples/advanced/headless-converter/sample.docx rename to examples/headless-converter/sample.docx diff --git a/examples/advanced/headless-converter/src/index.ts b/examples/headless-converter/src/index.ts similarity index 100% rename from examples/advanced/headless-converter/src/index.ts rename to examples/headless-converter/src/index.ts diff --git a/examples/integrations/README.md b/examples/integrations/README.md deleted file mode 100644 index 06ff927330..0000000000 --- a/examples/integrations/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Integration Examples - -Examples showing how to integrate SuperDoc with various platforms and environments. - -## Examples - -| Example | Description | -|---------|-------------| -| [nextjs-ssr](./nextjs-ssr) | Next.js with server-side rendering | -| [nodejs](./nodejs) | Node.js backend for document processing | -| [chrome-extension](./chrome-extension) | Chrome browser extension | -| [word-addin](./word-addin) | Microsoft Word add-in | -| [slack-redlining](./slack-redlining) | Slack integration for document redlining | - -## Running an Example - -```bash -cd -npm install -npm run dev -``` - -See individual example READMEs for platform-specific setup instructions. diff --git a/examples/pnpm-workspace.yaml b/examples/pnpm-workspace.yaml deleted file mode 100644 index 1736a0e370..0000000000 --- a/examples/pnpm-workspace.yaml +++ /dev/null @@ -1,17 +0,0 @@ -packages: - - '**/*' - - '!collaboration/tiptap-cloud' - -ignoredBuiltDependencies: - - '@microsoft/teamsapp-cli' - - core-js - - keytar - - leveldown - - sharp - - vue-demi - -onlyBuiltDependencies: - - esbuild - -overrides: - superdoc: file:../packages/superdoc/superdoc.tgz diff --git a/examples/react/README.md b/examples/react/README.md new file mode 100644 index 0000000000..e9e747fc1d --- /dev/null +++ b/examples/react/README.md @@ -0,0 +1,15 @@ +# SuperDoc — React + +Minimal React + TypeScript example. + +## Run + +```bash +npm install +npm run dev +``` + +## Learn more + +- [React Integration Guide](https://docs.superdoc.dev/getting-started/frameworks/react) +- [Configuration Reference](https://docs.superdoc.dev/core/superdoc/configuration) diff --git a/examples/react/index.html b/examples/react/index.html new file mode 100644 index 0000000000..094d07e62a --- /dev/null +++ b/examples/react/index.html @@ -0,0 +1,12 @@ + + + + + + SuperDoc — React + + +
+ + + diff --git a/examples/react/package.json b/examples/react/package.json new file mode 100644 index 0000000000..af64b5c329 --- /dev/null +++ b/examples/react/package.json @@ -0,0 +1,20 @@ +{ + "name": "superdoc-react-example", + "private": true, + "type": "module", + "scripts": { + "dev": "vite" + }, + "dependencies": { + "react": "^19.0.0", + "react-dom": "^19.0.0", + "superdoc": "latest" + }, + "devDependencies": { + "@types/react": "^19.0.0", + "@types/react-dom": "^19.0.0", + "@vitejs/plugin-react": "^4.3.4", + "typescript": "^5.7.0", + "vite": "^6.2.0" + } +} diff --git a/examples/react/src/App.tsx b/examples/react/src/App.tsx new file mode 100644 index 0000000000..f0fd1f687d --- /dev/null +++ b/examples/react/src/App.tsx @@ -0,0 +1,37 @@ +import { useEffect, useRef, useState, type ChangeEvent } from 'react'; +import { SuperDoc } from 'superdoc'; +import 'superdoc/style.css'; + +export default function App() { + const [file, setFile] = useState(null); + const containerRef = useRef(null); + const superdocRef = useRef(null); + + const handleFile = (e: ChangeEvent) => { + const selected = e.target.files?.[0]; + if (selected) setFile(selected); + }; + + useEffect(() => { + if (!containerRef.current) return; + + superdocRef.current = new SuperDoc({ + selector: containerRef.current, + document: file, + }); + + return () => { + superdocRef.current?.destroy(); + superdocRef.current = null; + }; + }, [file]); + + return ( + <> +
+ +
+
+ + ); +} diff --git a/examples/react/src/main.tsx b/examples/react/src/main.tsx new file mode 100644 index 0000000000..e0138a10cc --- /dev/null +++ b/examples/react/src/main.tsx @@ -0,0 +1,4 @@ +import { createRoot } from 'react-dom/client'; +import App from './App'; + +createRoot(document.getElementById('root')!).render(); diff --git a/examples/react/tsconfig.json b/examples/react/tsconfig.json new file mode 100644 index 0000000000..4f344fd6f2 --- /dev/null +++ b/examples/react/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "bundler", + "jsx": "react-jsx", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true + }, + "include": ["src"] +} diff --git a/examples/react/vite.config.ts b/examples/react/vite.config.ts new file mode 100644 index 0000000000..0466183af6 --- /dev/null +++ b/examples/react/vite.config.ts @@ -0,0 +1,6 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; + +export default defineConfig({ + plugins: [react()], +}); diff --git a/examples/vanilla/README.md b/examples/vanilla/README.md new file mode 100644 index 0000000000..16d7950f19 --- /dev/null +++ b/examples/vanilla/README.md @@ -0,0 +1,15 @@ +# SuperDoc — Vanilla JS + +Minimal plain JavaScript example with Vite. + +## Run + +```bash +npm install +npm run dev +``` + +## Learn more + +- [Vanilla JS Guide](https://docs.superdoc.dev/getting-started/frameworks/vanilla-js) +- [Configuration Reference](https://docs.superdoc.dev/core/superdoc/configuration) diff --git a/examples/vanilla/index.html b/examples/vanilla/index.html new file mode 100644 index 0000000000..2ad2b88d97 --- /dev/null +++ b/examples/vanilla/index.html @@ -0,0 +1,15 @@ + + + + + + SuperDoc — Vanilla JS + + +
+ +
+
+ + + diff --git a/examples/vanilla/package.json b/examples/vanilla/package.json new file mode 100644 index 0000000000..cd2dae08b8 --- /dev/null +++ b/examples/vanilla/package.json @@ -0,0 +1,14 @@ +{ + "name": "superdoc-vanilla-example", + "private": true, + "type": "module", + "scripts": { + "dev": "vite" + }, + "dependencies": { + "superdoc": "latest" + }, + "devDependencies": { + "vite": "^6.2.0" + } +} diff --git a/examples/vanilla/src/main.js b/examples/vanilla/src/main.js new file mode 100644 index 0000000000..80f5b81d79 --- /dev/null +++ b/examples/vanilla/src/main.js @@ -0,0 +1,17 @@ +import { SuperDoc } from 'superdoc'; +import 'superdoc/style.css'; + +let superdoc = new SuperDoc({ + selector: '#editor', +}); + +document.getElementById('file-input').addEventListener('change', (e) => { + const file = e.target.files[0]; + if (!file) return; + + superdoc?.destroy(); + superdoc = new SuperDoc({ + selector: '#editor', + document: file, + }); +}); diff --git a/examples/vue/README.md b/examples/vue/README.md new file mode 100644 index 0000000000..52d1606ef2 --- /dev/null +++ b/examples/vue/README.md @@ -0,0 +1,15 @@ +# SuperDoc — Vue + +Minimal Vue 3 + TypeScript example. + +## Run + +```bash +npm install +npm run dev +``` + +## Learn more + +- [Vue Integration Guide](https://docs.superdoc.dev/getting-started/frameworks/vue) +- [Configuration Reference](https://docs.superdoc.dev/core/superdoc/configuration) diff --git a/examples/vue/index.html b/examples/vue/index.html new file mode 100644 index 0000000000..87dd1a6ade --- /dev/null +++ b/examples/vue/index.html @@ -0,0 +1,12 @@ + + + + + + SuperDoc — Vue + + +
+ + + diff --git a/examples/vue/package.json b/examples/vue/package.json new file mode 100644 index 0000000000..a387668737 --- /dev/null +++ b/examples/vue/package.json @@ -0,0 +1,17 @@ +{ + "name": "superdoc-vue-example", + "private": true, + "type": "module", + "scripts": { + "dev": "vite" + }, + "dependencies": { + "superdoc": "latest", + "vue": "^3.5.0" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^5.2.0", + "typescript": "^5.7.0", + "vite": "^6.2.0" + } +} diff --git a/examples/vue/src/App.vue b/examples/vue/src/App.vue new file mode 100644 index 0000000000..6c794a0a61 --- /dev/null +++ b/examples/vue/src/App.vue @@ -0,0 +1,36 @@ + + + diff --git a/examples/vue/src/main.ts b/examples/vue/src/main.ts new file mode 100644 index 0000000000..684d04215d --- /dev/null +++ b/examples/vue/src/main.ts @@ -0,0 +1,4 @@ +import { createApp } from 'vue'; +import App from './App.vue'; + +createApp(App).mount('#app'); diff --git a/examples/vue/tsconfig.json b/examples/vue/tsconfig.json new file mode 100644 index 0000000000..2cac755e47 --- /dev/null +++ b/examples/vue/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "bundler", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true + }, + "include": ["src"] +} diff --git a/examples/ai/tool-calls/vite.config.js b/examples/vue/vite.config.ts similarity index 65% rename from examples/ai/tool-calls/vite.config.js rename to examples/vue/vite.config.ts index aa447e42e5..1ebc4fc7dd 100644 --- a/examples/ai/tool-calls/vite.config.js +++ b/examples/vue/vite.config.ts @@ -3,7 +3,4 @@ import vue from '@vitejs/plugin-vue'; export default defineConfig({ plugins: [vue()], - optimizeDeps: { - include: ['superdoc', '@superdoc-dev/ai'] - } });