From 5eabe8e939dcf6398aa1be2b3a9f159b2d4d6b0c Mon Sep 17 00:00:00 2001 From: Caio Pizzol <97641911+caio-pizzol@users.noreply.github.com> Date: Fri, 12 Jun 2026 16:11:55 -0300 Subject: [PATCH 01/14] Merge pull request #75 from superdoc/caio-pizzol/fix-release-sdk-catalog fix(release): generate SDK tool catalog before building the Python SDK Ported-From-Source-Repo: superdoc/orbit Ported-From-Source-Commit: 558fe805108b7998818ce83e019c3e048d622906 Ported-Public-Prefix: superdoc/public --- .github/workflows/release-stable.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release-stable.yml b/.github/workflows/release-stable.yml index 61175611f9..14c4d154d4 100644 --- a/.github/workflows/release-stable.yml +++ b/.github/workflows/release-stable.yml @@ -182,6 +182,13 @@ jobs: packages-dir: ${{ steps.stage_recovered_python.outputs.main_dir }} skip-existing: true + # build-python-sdk.mjs requires packages/sdk/tools/catalog.json, a + # generated (gitignored) artifact. `pnpm run build` does not produce it, + # so generate the SDK tool catalog/clients before the Python build. + - name: Generate SDK artifacts (tool catalog) + if: steps.stable_release.outputs.sdk_release_present == 'true' + run: pnpm run generate:all + - name: Build and verify Python SDK if: steps.stable_release.outputs.sdk_release_present == 'true' run: node packages/sdk/scripts/build-python-sdk.mjs From a9a582ae4cacec6587dbd97c4c2f82ec731e08ce Mon Sep 17 00:00:00 2001 From: "superdoc-bot[bot]" <235763992+superdoc-bot[bot]@users.noreply.github.com> Date: Fri, 12 Jun 2026 19:01:12 +0000 Subject: [PATCH 02/14] =?UTF-8?q?=F0=9F=94=84=20Sync=20stable=20=E2=86=92?= =?UTF-8?q?=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Merges latest stable patches into main with a real merge commit so stable release tags remain reachable from main. This keeps `@next` prerelease version calculation ahead of the latest published stable release. ## Merge requirement This PR must be merged with GitHub's merge-commit option. Squash or rebase merging will discard stable ancestry and break `@next` version calculation again. ## Conflict handling Merge status: `clean`. Version-only release artifact conflicts are auto-resolved to keep stable's already-published versions. Non-version conflicts fail this workflow instead of committing conflict markers. --- _Auto-created by sync-patches workflow._ Co-authored-by: semantic-release-bot Source-PR: https://github.com/superdoc-dev/superdoc/pull/3727 Closes superdoc-dev/superdoc#3727 Ported-From-Source-Repo: superdoc/orbit Ported-From-Source-Commit: 973f3938470982a8f9539a33a562388c65b219e2 Ported-Public-Prefix: superdoc/public --- apps/cli/package.json | 2 +- apps/cli/platforms/cli-darwin-arm64/package.json | 2 +- apps/cli/platforms/cli-darwin-x64/package.json | 2 +- apps/cli/platforms/cli-linux-arm64/package.json | 2 +- apps/cli/platforms/cli-linux-x64/package.json | 2 +- apps/cli/platforms/cli-windows-x64/package.json | 2 +- apps/mcp/package.json | 2 +- apps/vscode-ext/package.json | 2 +- packages/esign/package.json | 2 +- packages/react/package.json | 2 +- packages/sdk/langs/node/package.json | 2 +- .../node/platforms/sdk-darwin-arm64/package.json | 2 +- .../langs/node/platforms/sdk-darwin-x64/package.json | 2 +- .../node/platforms/sdk-linux-arm64/package.json | 2 +- .../langs/node/platforms/sdk-linux-x64/package.json | 2 +- .../node/platforms/sdk-windows-x64/package.json | 2 +- .../superdoc-sdk-cli-darwin-arm64/pyproject.toml | 2 +- .../superdoc-sdk-cli-darwin-x64/pyproject.toml | 2 +- .../superdoc-sdk-cli-linux-arm64/pyproject.toml | 2 +- .../superdoc-sdk-cli-linux-x64/pyproject.toml | 2 +- .../superdoc-sdk-cli-windows-x64/pyproject.toml | 2 +- packages/sdk/langs/python/pyproject.toml | 12 ++++++------ packages/sdk/package.json | 2 +- packages/sdk/version.json | 2 +- packages/superdoc/package.json | 2 +- 25 files changed, 30 insertions(+), 30 deletions(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index fa5b6c5847..995be5f378 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/cli", - "version": "0.16.0", + "version": "0.17.0", "type": "module", "bin": { "superdoc": "./dist/index.js" diff --git a/apps/cli/platforms/cli-darwin-arm64/package.json b/apps/cli/platforms/cli-darwin-arm64/package.json index 454186b9ab..80dfc38363 100644 --- a/apps/cli/platforms/cli-darwin-arm64/package.json +++ b/apps/cli/platforms/cli-darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/cli-darwin-arm64", - "version": "0.16.0", + "version": "0.17.0", "os": [ "darwin" ], diff --git a/apps/cli/platforms/cli-darwin-x64/package.json b/apps/cli/platforms/cli-darwin-x64/package.json index e73012fe24..da36337445 100644 --- a/apps/cli/platforms/cli-darwin-x64/package.json +++ b/apps/cli/platforms/cli-darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/cli-darwin-x64", - "version": "0.16.0", + "version": "0.17.0", "os": [ "darwin" ], diff --git a/apps/cli/platforms/cli-linux-arm64/package.json b/apps/cli/platforms/cli-linux-arm64/package.json index f99a13af25..5924526d3b 100644 --- a/apps/cli/platforms/cli-linux-arm64/package.json +++ b/apps/cli/platforms/cli-linux-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/cli-linux-arm64", - "version": "0.16.0", + "version": "0.17.0", "os": [ "linux" ], diff --git a/apps/cli/platforms/cli-linux-x64/package.json b/apps/cli/platforms/cli-linux-x64/package.json index b96157e6dc..6073f0162d 100644 --- a/apps/cli/platforms/cli-linux-x64/package.json +++ b/apps/cli/platforms/cli-linux-x64/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/cli-linux-x64", - "version": "0.16.0", + "version": "0.17.0", "os": [ "linux" ], diff --git a/apps/cli/platforms/cli-windows-x64/package.json b/apps/cli/platforms/cli-windows-x64/package.json index 8507e93fd4..8da2323f0e 100644 --- a/apps/cli/platforms/cli-windows-x64/package.json +++ b/apps/cli/platforms/cli-windows-x64/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/cli-windows-x64", - "version": "0.16.0", + "version": "0.17.0", "os": [ "win32" ], diff --git a/apps/mcp/package.json b/apps/mcp/package.json index 197785da20..a91cf6cdd1 100644 --- a/apps/mcp/package.json +++ b/apps/mcp/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/mcp", - "version": "0.11.0", + "version": "0.12.0", "type": "module", "engines": { "node": ">=20" diff --git a/apps/vscode-ext/package.json b/apps/vscode-ext/package.json index 89d5bac910..089952001a 100644 --- a/apps/vscode-ext/package.json +++ b/apps/vscode-ext/package.json @@ -2,7 +2,7 @@ "name": "superdoc-vscode-ext", "displayName": "SuperDoc - Word Document Editor", "description": "Open and edit Word documents (.docx) directly in VS Code using SuperDoc", - "version": "2.11.0", + "version": "2.12.0", "publisher": "superdoc-dev", "icon": "logo.png", "homepage": "https://superdoc.dev", diff --git a/packages/esign/package.json b/packages/esign/package.json index 2e402e9d2e..bd97389649 100644 --- a/packages/esign/package.json +++ b/packages/esign/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/esign", - "version": "2.7.1", + "version": "2.7.2", "description": "React eSignature component for SuperDoc", "type": "module", "main": "./dist/index.js", diff --git a/packages/react/package.json b/packages/react/package.json index 49ec4c81cf..62aec5c54e 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/react", - "version": "1.10.0", + "version": "1.11.0", "description": "Official React wrapper for the SuperDoc document editor", "type": "module", "main": "./dist/index.cjs", diff --git a/packages/sdk/langs/node/package.json b/packages/sdk/langs/node/package.json index 6ca098bd20..45afda8812 100644 --- a/packages/sdk/langs/node/package.json +++ b/packages/sdk/langs/node/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/sdk", - "version": "1.15.0", + "version": "1.16.0", "private": false, "type": "module", "main": "./dist/index.cjs", diff --git a/packages/sdk/langs/node/platforms/sdk-darwin-arm64/package.json b/packages/sdk/langs/node/platforms/sdk-darwin-arm64/package.json index 54a61cd289..e34a2b4565 100644 --- a/packages/sdk/langs/node/platforms/sdk-darwin-arm64/package.json +++ b/packages/sdk/langs/node/platforms/sdk-darwin-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/sdk-darwin-arm64", - "version": "1.15.0", + "version": "1.16.0", "os": [ "darwin" ], diff --git a/packages/sdk/langs/node/platforms/sdk-darwin-x64/package.json b/packages/sdk/langs/node/platforms/sdk-darwin-x64/package.json index b8cf6d87f5..0330ba2d77 100644 --- a/packages/sdk/langs/node/platforms/sdk-darwin-x64/package.json +++ b/packages/sdk/langs/node/platforms/sdk-darwin-x64/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/sdk-darwin-x64", - "version": "1.15.0", + "version": "1.16.0", "os": [ "darwin" ], diff --git a/packages/sdk/langs/node/platforms/sdk-linux-arm64/package.json b/packages/sdk/langs/node/platforms/sdk-linux-arm64/package.json index d4edc3e642..f08b8a4adf 100644 --- a/packages/sdk/langs/node/platforms/sdk-linux-arm64/package.json +++ b/packages/sdk/langs/node/platforms/sdk-linux-arm64/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/sdk-linux-arm64", - "version": "1.15.0", + "version": "1.16.0", "os": [ "linux" ], diff --git a/packages/sdk/langs/node/platforms/sdk-linux-x64/package.json b/packages/sdk/langs/node/platforms/sdk-linux-x64/package.json index f75e2f7f58..9814f3d95a 100644 --- a/packages/sdk/langs/node/platforms/sdk-linux-x64/package.json +++ b/packages/sdk/langs/node/platforms/sdk-linux-x64/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/sdk-linux-x64", - "version": "1.15.0", + "version": "1.16.0", "os": [ "linux" ], diff --git a/packages/sdk/langs/node/platforms/sdk-windows-x64/package.json b/packages/sdk/langs/node/platforms/sdk-windows-x64/package.json index c4caf40b3f..55287528c3 100644 --- a/packages/sdk/langs/node/platforms/sdk-windows-x64/package.json +++ b/packages/sdk/langs/node/platforms/sdk-windows-x64/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/sdk-windows-x64", - "version": "1.15.0", + "version": "1.16.0", "os": [ "win32" ], diff --git a/packages/sdk/langs/python/platforms/superdoc-sdk-cli-darwin-arm64/pyproject.toml b/packages/sdk/langs/python/platforms/superdoc-sdk-cli-darwin-arm64/pyproject.toml index ef28e2e688..d0fa17d630 100644 --- a/packages/sdk/langs/python/platforms/superdoc-sdk-cli-darwin-arm64/pyproject.toml +++ b/packages/sdk/langs/python/platforms/superdoc-sdk-cli-darwin-arm64/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "superdoc-sdk-cli-darwin-arm64" -version = "1.15.0" +version = "1.16.0" description = "SuperDoc CLI binary for macOS ARM64 (Apple Silicon)" readme = "README.md" requires-python = ">=3.9" diff --git a/packages/sdk/langs/python/platforms/superdoc-sdk-cli-darwin-x64/pyproject.toml b/packages/sdk/langs/python/platforms/superdoc-sdk-cli-darwin-x64/pyproject.toml index 9cdf270eec..f72b3a4b7b 100644 --- a/packages/sdk/langs/python/platforms/superdoc-sdk-cli-darwin-x64/pyproject.toml +++ b/packages/sdk/langs/python/platforms/superdoc-sdk-cli-darwin-x64/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "superdoc-sdk-cli-darwin-x64" -version = "1.15.0" +version = "1.16.0" description = "SuperDoc CLI binary for macOS x64 (Intel)" readme = "README.md" requires-python = ">=3.9" diff --git a/packages/sdk/langs/python/platforms/superdoc-sdk-cli-linux-arm64/pyproject.toml b/packages/sdk/langs/python/platforms/superdoc-sdk-cli-linux-arm64/pyproject.toml index c1f4b54499..697f980161 100644 --- a/packages/sdk/langs/python/platforms/superdoc-sdk-cli-linux-arm64/pyproject.toml +++ b/packages/sdk/langs/python/platforms/superdoc-sdk-cli-linux-arm64/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "superdoc-sdk-cli-linux-arm64" -version = "1.15.0" +version = "1.16.0" description = "SuperDoc CLI binary for Linux ARM64" readme = "README.md" requires-python = ">=3.9" diff --git a/packages/sdk/langs/python/platforms/superdoc-sdk-cli-linux-x64/pyproject.toml b/packages/sdk/langs/python/platforms/superdoc-sdk-cli-linux-x64/pyproject.toml index ae3d95a3e5..9936dc6a89 100644 --- a/packages/sdk/langs/python/platforms/superdoc-sdk-cli-linux-x64/pyproject.toml +++ b/packages/sdk/langs/python/platforms/superdoc-sdk-cli-linux-x64/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "superdoc-sdk-cli-linux-x64" -version = "1.15.0" +version = "1.16.0" description = "SuperDoc CLI binary for Linux x64" readme = "README.md" requires-python = ">=3.9" diff --git a/packages/sdk/langs/python/platforms/superdoc-sdk-cli-windows-x64/pyproject.toml b/packages/sdk/langs/python/platforms/superdoc-sdk-cli-windows-x64/pyproject.toml index 88b0e3015b..c4417fcc19 100644 --- a/packages/sdk/langs/python/platforms/superdoc-sdk-cli-windows-x64/pyproject.toml +++ b/packages/sdk/langs/python/platforms/superdoc-sdk-cli-windows-x64/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "superdoc-sdk-cli-windows-x64" -version = "1.15.0" +version = "1.16.0" description = "SuperDoc CLI binary for Windows x64" readme = "README.md" requires-python = ">=3.9" diff --git a/packages/sdk/langs/python/pyproject.toml b/packages/sdk/langs/python/pyproject.toml index e929aaf68c..c308c6c350 100644 --- a/packages/sdk/langs/python/pyproject.toml +++ b/packages/sdk/langs/python/pyproject.toml @@ -4,18 +4,18 @@ build-backend = "setuptools.build_meta" [project] name = "superdoc-sdk" -version = "1.15.0" +version = "1.16.0" description = "SuperDoc SDK (CLI-backed)" readme = "README.md" requires-python = ">=3.9" license = "AGPL-3.0" authors = [{ name = "SuperDoc" }] dependencies = [ - "superdoc-sdk-cli-darwin-arm64==1.15.0; platform_system == 'Darwin' and (platform_machine == 'arm64' or platform_machine == 'aarch64' or platform_machine == 'ARM64')", - "superdoc-sdk-cli-darwin-x64==1.15.0; platform_system == 'Darwin' and (platform_machine == 'x86_64' or platform_machine == 'AMD64' or platform_machine == 'amd64')", - "superdoc-sdk-cli-linux-x64==1.15.0; platform_system == 'Linux' and (platform_machine == 'x86_64' or platform_machine == 'AMD64' or platform_machine == 'amd64')", - "superdoc-sdk-cli-linux-arm64==1.15.0; platform_system == 'Linux' and (platform_machine == 'arm64' or platform_machine == 'aarch64' or platform_machine == 'ARM64')", - "superdoc-sdk-cli-windows-x64==1.15.0; platform_system == 'Windows' and (platform_machine == 'x86_64' or platform_machine == 'AMD64' or platform_machine == 'amd64')", + "superdoc-sdk-cli-darwin-arm64==1.16.0; platform_system == 'Darwin' and (platform_machine == 'arm64' or platform_machine == 'aarch64' or platform_machine == 'ARM64')", + "superdoc-sdk-cli-darwin-x64==1.16.0; platform_system == 'Darwin' and (platform_machine == 'x86_64' or platform_machine == 'AMD64' or platform_machine == 'amd64')", + "superdoc-sdk-cli-linux-x64==1.16.0; platform_system == 'Linux' and (platform_machine == 'x86_64' or platform_machine == 'AMD64' or platform_machine == 'amd64')", + "superdoc-sdk-cli-linux-arm64==1.16.0; platform_system == 'Linux' and (platform_machine == 'arm64' or platform_machine == 'aarch64' or platform_machine == 'ARM64')", + "superdoc-sdk-cli-windows-x64==1.16.0; platform_system == 'Windows' and (platform_machine == 'x86_64' or platform_machine == 'AMD64' or platform_machine == 'amd64')", ] [tool.setuptools] diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 6d430269be..4c4449bcc4 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@superdoc-dev/sdk-workspace", - "version": "1.15.0", + "version": "1.16.0", "private": true, "type": "module", "scripts": { diff --git a/packages/sdk/version.json b/packages/sdk/version.json index 107ebf79c4..f774c59589 100644 --- a/packages/sdk/version.json +++ b/packages/sdk/version.json @@ -1,3 +1,3 @@ { - "sdkVersion": "1.15.0" + "sdkVersion": "1.16.0" } diff --git a/packages/superdoc/package.json b/packages/superdoc/package.json index 5c2648d27f..3674e29d6c 100644 --- a/packages/superdoc/package.json +++ b/packages/superdoc/package.json @@ -1,7 +1,7 @@ { "name": "superdoc", "type": "module", - "version": "1.39.0", + "version": "1.40.0", "license": "AGPL-3.0", "repository": { "type": "git", From bcd15a5c987ef450855c0837fd34d264e37b4d8b Mon Sep 17 00:00:00 2001 From: Caio Pizzol <97641911+caio-pizzol@users.noreply.github.com> Date: Sat, 13 Jun 2026 12:39:54 -0300 Subject: [PATCH 03/14] Merge pull request #81 from superdoc/feat/superdoc-fonts-package feat(fonts): @superdoc/fonts package for bundled fonts (SD-3441) Ported-From-Source-Repo: superdoc/orbit Ported-From-Source-Commit: 45a456f29763f301ab5c336dd26c6f08124c5288 Ported-Public-Prefix: superdoc/public --- apps/docs/getting-started/fonts.mdx | 57 ++++++++++++-- .../getting-started/frameworks/angular.mdx | 4 +- .../getting-started/frameworks/laravel.mdx | 4 +- .../getting-started/frameworks/nextjs.mdx | 4 +- apps/docs/getting-started/frameworks/nuxt.mdx | 4 +- .../docs/getting-started/frameworks/react.mdx | 4 +- .../docs/getting-started/frameworks/solid.mdx | 4 +- .../getting-started/frameworks/vanilla-js.mdx | 4 +- apps/docs/getting-started/frameworks/vue.mdx | 6 +- apps/docs/getting-started/quickstart.mdx | 13 +++- apps/docs/scripts/validate-code-imports.ts | 1 + examples/getting-started/README.md | 2 + examples/getting-started/angular/package.json | 1 + .../angular/src/app/app.component.ts | 2 + examples/getting-started/cdn/README.md | 4 + examples/getting-started/laravel/README.md | 4 + examples/getting-started/nextjs/package.json | 1 + .../getting-started/nextjs/src/app/page.tsx | 2 + .../getting-started/nuxt/app/pages/index.vue | 2 + examples/getting-started/nuxt/package.json | 1 + examples/getting-started/react/package.json | 1 + examples/getting-started/react/src/App.tsx | 2 + examples/getting-started/solid/package.json | 1 + examples/getting-started/solid/src/App.tsx | 2 + examples/getting-started/vanilla/package.json | 1 + examples/getting-started/vanilla/src/main.js | 5 ++ examples/getting-started/vue/package.json | 1 + examples/getting-started/vue/src/App.vue | 2 + packages/fonts/.gitignore | 7 ++ packages/fonts/README.md | 59 ++++++++++++++ packages/fonts/RELEASING.md | 44 +++++++++++ packages/fonts/package.json | 39 ++++++++++ .../fonts/scripts/generate-asset-urls.mjs | 59 ++++++++++++++ packages/fonts/scripts/sync-assets.mjs | 34 +++++++++ packages/fonts/src/asset-urls.ts | 76 +++++++++++++++++++ packages/fonts/src/index.ts | 72 ++++++++++++++++++ packages/fonts/tsconfig.json | 17 +++++ pnpm-lock.yaml | 55 ++++++++------ shared/font-system/src/registry.test.ts | 57 +++++++++++++- shared/font-system/src/registry.ts | 46 +++++++++++ 40 files changed, 664 insertions(+), 40 deletions(-) create mode 100644 packages/fonts/.gitignore create mode 100644 packages/fonts/README.md create mode 100644 packages/fonts/RELEASING.md create mode 100644 packages/fonts/package.json create mode 100644 packages/fonts/scripts/generate-asset-urls.mjs create mode 100644 packages/fonts/scripts/sync-assets.mjs create mode 100644 packages/fonts/src/asset-urls.ts create mode 100644 packages/fonts/src/index.ts create mode 100644 packages/fonts/tsconfig.json diff --git a/apps/docs/getting-started/fonts.mdx b/apps/docs/getting-started/fonts.mdx index c0008cad91..523e9a65cf 100644 --- a/apps/docs/getting-started/fonts.mdx +++ b/apps/docs/getting-started/fonts.mdx @@ -6,19 +6,66 @@ keywords: 'fonts, font loading, calibri, cambria, aptos, font fallback, custom f SuperDoc keeps the font name from the Word document. When SuperDoc ships an approved fallback for that font, it renders with the fallback but keeps the original name for export. When no fallback is available, load the real font in your app. -## Load fonts in your app +## Bundled fallback fonts -Fonts are your host page's responsibility. `@font-face`, a hosted stylesheet, or a font CDN: anything the browser can resolve. +A Word document asks for fonts like Calibri, Cambria, and Times New Roman. Most are proprietary, or not installed on every machine. SuperDoc renders them with reviewed open substitutes that match the metrics: Carlito for Calibri, Liberation Serif for Times New Roman, and more. The original name is kept for export. + +These substitutes are real `.woff2` files. The browser fetches them from a URL. Installing SuperDoc from npm puts them in `node_modules`, which does not serve them to the browser. So you tell your app where they live. Pick one path. + +### Recommended: the `@superdoc/fonts` package + +Install the optional pack and pass it. Your bundler (Vite, Webpack, Next, Nuxt) emits the files and rewrites the URLs. No copy step. No path config. + +```bash +npm install @superdoc/fonts +``` + +```js +import { SuperDoc } from 'superdoc'; +import { superdocFonts } from '@superdoc/fonts'; + +new SuperDoc({ + selector: '#editor', + document: 'contract.docx', + fonts: superdocFonts, +}); +``` + +### Alternative: host the files yourself + +Serve the `.woff2` from your own path or a CDN, then point SuperDoc at them. The files ship in the package at `node_modules/superdoc/dist/fonts/`. + +```js +new SuperDoc({ + selector: '#editor', + document: 'contract.docx', + fonts: { assetBaseUrl: '/fonts/' }, +}); +``` + +Use `fonts.resolveAssetUrl` instead for signed or versioned URLs. + +### CDN script build + +The CDN build loads the fonts from a path relative to the script. Loading from a public CDN (jsDelivr or unpkg) needs no setup: the fonts resolve to `superdoc@/dist/fonts/...` automatically. If you self-host `superdoc.min.js`, serve its `dist/fonts/` folder beside it. + +### Skipping the pack + +The pack is optional. Skip it if you load your own fonts for every family, or only need fonts the user's OS already has. When the bundled `.woff2` cannot be fetched, SuperDoc logs a one-time warning and falls back to the original font name. On a machine without that font, the text renders in a system fallback, so it can look unchanged. + +## Load your own fonts + +For a brand font, a licensed font, or any family SuperDoc does not ship a fallback for, load the real file yourself. Use `@font-face`, a hosted stylesheet, or a font CDN. Anything the browser can resolve. ```css @font-face { - font-family: 'Calibri'; - src: url('/fonts/Carlito-Regular.woff2') format('woff2'); + font-family: 'Inter'; + src: url('/fonts/Inter-Regular.woff2') format('woff2'); font-display: swap; } ``` -For custom or licensed fonts, load the real file yourself. SuperDoc's built-in fallbacks cover only the fonts it ships and verifies. +SuperDoc's built-in fallbacks cover only the fonts it ships and verifies. For everything else, the real file is yours to provide. To register it through SuperDoc instead of CSS, pass it in `fonts.families` (which composes with `@superdoc/fonts`). ## Toolbar font list diff --git a/apps/docs/getting-started/frameworks/angular.mdx b/apps/docs/getting-started/frameworks/angular.mdx index 6a0f232b43..057ed02a64 100644 --- a/apps/docs/getting-started/frameworks/angular.mdx +++ b/apps/docs/getting-started/frameworks/angular.mdx @@ -11,7 +11,7 @@ Requires Angular 17.2+. `viewChild()` and `input()` are stable from Angular 19; ## Install ```bash -npm install superdoc +npm install superdoc @superdoc/fonts ``` ## Basic setup @@ -19,6 +19,7 @@ npm install superdoc ```typescript import { Component, ElementRef, viewChild, AfterViewInit, inject, DestroyRef } from '@angular/core'; import { SuperDoc } from 'superdoc'; +import { superdocFonts } from '@superdoc/fonts'; import 'superdoc/style.css'; @Component({ @@ -38,6 +39,7 @@ export class EditorComponent implements AfterViewInit { selector: this.editorRef().nativeElement, document: 'contract.docx', documentMode: 'editing', + fonts: superdocFonts, }); } } diff --git a/apps/docs/getting-started/frameworks/laravel.mdx b/apps/docs/getting-started/frameworks/laravel.mdx index 47e824ca5e..9c156f3815 100644 --- a/apps/docs/getting-started/frameworks/laravel.mdx +++ b/apps/docs/getting-started/frameworks/laravel.mdx @@ -11,6 +11,7 @@ SuperDoc works with Laravel + Blade + Vite. Laravel serves the Blade template wi ```bash composer install npm install +npm install superdoc @superdoc/fonts ``` ## Vite config @@ -55,9 +56,10 @@ Create a Blade view that loads the Vite-bundled script and mounts the editor: ```js resources/js/app.js import { SuperDoc } from 'superdoc'; +import { superdocFonts } from '@superdoc/fonts'; import 'superdoc/style.css'; -let superdoc = new SuperDoc({ selector: '#editor' }); +let superdoc = new SuperDoc({ selector: '#editor', fonts: superdocFonts }); document.getElementById('file-input').addEventListener('change', (e) => { const file = e.target.files[0]; diff --git a/apps/docs/getting-started/frameworks/nextjs.mdx b/apps/docs/getting-started/frameworks/nextjs.mdx index d2d6431961..0ffa56c9d5 100644 --- a/apps/docs/getting-started/frameworks/nextjs.mdx +++ b/apps/docs/getting-started/frameworks/nextjs.mdx @@ -10,7 +10,7 @@ SuperDoc works seamlessly with Next.js. The recommended approach is using `@supe The React wrapper is the simplest way to integrate SuperDoc with Next.js: ```bash -npm install @superdoc-dev/react +npm install @superdoc-dev/react @superdoc/fonts ``` ### App Router (Next.js 13+) @@ -20,12 +20,14 @@ npm install @superdoc-dev/react 'use client'; import { SuperDocEditor } from '@superdoc-dev/react'; +import { superdocFonts } from '@superdoc/fonts'; import '@superdoc-dev/react/style.css'; export default function EditorPage() { return ( console.log('Editor ready!')} style={{ height: '100vh' }} diff --git a/apps/docs/getting-started/frameworks/nuxt.mdx b/apps/docs/getting-started/frameworks/nuxt.mdx index 404989f5db..66b22a3c26 100644 --- a/apps/docs/getting-started/frameworks/nuxt.mdx +++ b/apps/docs/getting-started/frameworks/nuxt.mdx @@ -9,7 +9,7 @@ SuperDoc works with Nuxt 4+ as a client-side Vue component. Set `ssr: false` in ## Install ```bash -npm install superdoc +npm install superdoc @superdoc/fonts ``` ## Configure Nuxt @@ -33,6 +33,7 @@ Nuxt auto-imports Vue's `ref`, `watch`, and lifecycle hooks: no manual imports n ```vue app/pages/index.vue ``` @@ -51,10 +57,11 @@ By the end of this page you'll have a working DOCX editor in your app: load a Wo ```jsx import { SuperDocEditor } from '@superdoc-dev/react'; + import { superdocFonts } from '@superdoc/fonts'; import '@superdoc-dev/react/style.css'; export default function App() { - return ; + return ; } ``` diff --git a/apps/docs/scripts/validate-code-imports.ts b/apps/docs/scripts/validate-code-imports.ts index f5d0a9c93b..2642bfc7a8 100644 --- a/apps/docs/scripts/validate-code-imports.ts +++ b/apps/docs/scripts/validate-code-imports.ts @@ -36,6 +36,7 @@ const EXACT_SUPERDOC_IMPORTS = new Set([ '@superdoc-dev/template-builder/defaults', '@superdoc-dev/template-builder/field-types.css', '@superdoc-dev/superdoc-yjs-collaboration', + '@superdoc/fonts', ]); const EXACT_EXTERNAL_IMPORTS = new Set([ diff --git a/examples/getting-started/README.md b/examples/getting-started/README.md index f80c9e25cb..546c29f240 100644 --- a/examples/getting-started/README.md +++ b/examples/getting-started/README.md @@ -11,6 +11,8 @@ Minimal examples for integrating SuperDoc into your project. Each example loads | [vanilla](./vanilla) | Plain JavaScript with Vite | [Guide](https://docs.superdoc.dev/getting-started/quickstart) | | [cdn](./cdn) | Zero build tools — just an HTML file | [Guide](https://docs.superdoc.dev/getting-started/quickstart) | +The bundler examples pass [`@superdoc/fonts`](https://docs.superdoc.dev/getting-started/fonts), so SuperDoc's bundled fallback fonts (Carlito for Calibri, and more) render without copying any assets. The CDN example loads them from the script's path; the Laravel example copies them into `public/fonts/`. + ## Running ```bash diff --git a/examples/getting-started/angular/package.json b/examples/getting-started/angular/package.json index c29ff8b8b1..98acdebd68 100644 --- a/examples/getting-started/angular/package.json +++ b/examples/getting-started/angular/package.json @@ -11,6 +11,7 @@ "@angular/core": "^21.1.4", "@angular/platform-browser": "^21.1.4", "@angular/platform-browser-dynamic": "^21.1.4", + "@superdoc/fonts": "workspace:*", "rxjs": "~7.8.2", "superdoc": "latest", "tslib": "^2.8.1", diff --git a/examples/getting-started/angular/src/app/app.component.ts b/examples/getting-started/angular/src/app/app.component.ts index 105196b5b0..aed39b9e3b 100644 --- a/examples/getting-started/angular/src/app/app.component.ts +++ b/examples/getting-started/angular/src/app/app.component.ts @@ -1,5 +1,6 @@ import { Component, ElementRef, ViewChild, OnDestroy } from '@angular/core'; import { SuperDoc } from 'superdoc'; +import { superdocFonts } from '@superdoc/fonts'; @Component({ selector: 'app-root', @@ -24,6 +25,7 @@ export class AppComponent implements OnDestroy { selector: this.editorRef.nativeElement, documentMode: 'editing', document: file, + fonts: superdocFonts, }); } diff --git a/examples/getting-started/cdn/README.md b/examples/getting-started/cdn/README.md index 8cd8fd27b0..3f6ecb8050 100644 --- a/examples/getting-started/cdn/README.md +++ b/examples/getting-started/cdn/README.md @@ -23,6 +23,10 @@ Replace the local ` + + +``` + +From a public CDN (jsDelivr or unpkg) the faces resolve automatically, relative to `superdoc-fonts.min.js`. If you self-host it, keep the package's `dist/` and `assets/` folders in their relative layout. ### Skipping the pack diff --git a/demos/nextjs-ssr/copy-fonts.mjs b/demos/nextjs-ssr/copy-fonts.mjs index 7131366e61..fd12b5cdfc 100644 --- a/demos/nextjs-ssr/copy-fonts.mjs +++ b/demos/nextjs-ssr/copy-fonts.mjs @@ -1,21 +1,21 @@ -// Copy SuperDoc's bundled metric-compatible font substitutes into public/fonts/ so they -// are served at /fonts/ (the default asset base). Without this, the bundled .woff2 404 -// and SuperDoc paginates against a browser fallback. Runs as `predev`/`prebuild`. +// Copy the bundled metric-compatible font substitutes into public/fonts/ so they are served at +// /fonts/ (the asset base set on the editor). Without this, the bundled .woff2 404 and SuperDoc +// paginates against a browser fallback. Runs as `predev`/`prebuild`. // -// A real Next.js consumer would copy from `node_modules/@superdoc/font-system/assets/` -// (or set `fonts.assetBaseUrl` to wherever they serve them); this example copies from the -// workspace build for a self-contained demo. +// A real Next.js consumer would copy from `node_modules/@superdoc-dev/fonts/assets/` (or set +// `fonts.assetBaseUrl` to wherever they serve them); this example copies from the workspace package +// for a self-contained demo. import { cpSync, existsSync } from 'node:fs'; import { dirname, resolve } from 'node:path'; import { fileURLToPath } from 'node:url'; const here = dirname(fileURLToPath(import.meta.url)); -const src = resolve(here, '../../packages/superdoc/dist/fonts'); +const src = resolve(here, '../../packages/fonts/assets'); const dst = resolve(here, 'public/fonts'); if (existsSync(src)) { cpSync(src, dst, { recursive: true }); console.log('[nextjs-ssr] copied bundled fonts -> public/fonts/'); } else { - console.warn(`[nextjs-ssr] bundled fonts not found at ${src}; run \`pnpm build:superdoc\` first`); + console.warn(`[nextjs-ssr] bundled fonts not found at ${src}; run \`pnpm --filter @superdoc-dev/fonts sync\` first`); } diff --git a/demos/nextjs-ssr/src/app/SuperDoc/superdoc.js b/demos/nextjs-ssr/src/app/SuperDoc/superdoc.js index 0eba0da867..585e5b2c65 100644 --- a/demos/nextjs-ssr/src/app/SuperDoc/superdoc.js +++ b/demos/nextjs-ssr/src/app/SuperDoc/superdoc.js @@ -19,6 +19,8 @@ export default function SuperDocEditor() { const { SuperDoc } = await import('superdoc'); const config = { selector: superdocContainerRef.current, + // Self-hosted bundled fallback fonts (copied to public/fonts/ by copy-fonts.mjs). + fonts: { assetBaseUrl: '/fonts/' }, modules: { toolbar: { selector: '#toolbar', diff --git a/examples/getting-started/cdn/.gitignore b/examples/getting-started/cdn/.gitignore index 66a264a5fc..867f62031b 100644 --- a/examples/getting-started/cdn/.gitignore +++ b/examples/getting-started/cdn/.gitignore @@ -1,3 +1,6 @@ superdoc.min.js +superdoc-fonts.min.js style.css test_file.docx +assets/ +fonts/ diff --git a/examples/getting-started/cdn/README.md b/examples/getting-started/cdn/README.md index 3f6ecb8050..f04f6bbaf0 100644 --- a/examples/getting-started/cdn/README.md +++ b/examples/getting-started/cdn/README.md @@ -5,12 +5,13 @@ Zero build tools. A single HTML file plus the SuperDoc global bundle. ## Run locally ```bash -pnpm --filter superdoc build # one-time, builds the CDN bundle -pnpm setup # copies the bundle + sample DOCX in +pnpm --filter superdoc build # builds superdoc.min.js +pnpm --filter @superdoc-dev/fonts build # builds superdoc-fonts.min.js + the font faces +pnpm setup # copies both bundles + fonts + sample DOCX in npx serve . ``` -`pnpm setup` copies the built `superdoc.min.js`, `style.css`, and a sample `test_file.docx` into this directory so the example is self-contained. +`pnpm setup` copies the built `superdoc.min.js`, `superdoc-fonts.min.js`, `style.css`, the font `assets/`, and a sample `test_file.docx` into this directory so the example is self-contained. ## Use from the public CDN @@ -19,13 +20,20 @@ Replace the local ` + ``` Pin to a specific version (e.g. `superdoc@1.26.0`) in production and add [SRI hashes](https://developer.mozilla.org/docs/Web/Security/Subresource_Integrity) for integrity. ## Fonts -SuperDoc's bundled fallback fonts load from `dist/fonts/` next to the script. From the public CDN they resolve automatically (`superdoc@/dist/fonts/...`), so there's nothing to configure. When you self-host the bundle, serve a `fonts/` folder beside `superdoc.min.js`. The `pnpm setup` step above copies it in for you. +The `superdoc` CDN build ships no fonts: by default the toolbar shows the baseline (one font per CSS generic) and documents render with system fonts. The reviewed fallback pack comes from the optional `@superdoc-dev/fonts` browser build, loaded as a second ` + +