AI-native design editor. Open-source Figma alternative.
feat(docs): rebuild the landing page around live editor stages (#846)
Danila Poyarkova97082f4ce79
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.ymlindex 0c949f3cb..c3e22d1be 100644--- a/.github/workflows/docs.yml+++ b/.github/workflows/docs.yml@@ -6,6 +6,11 @@ on:- "v*"- "!v*-*"workflow_dispatch:+ inputs:+ dry-run:+ description: Build and capture the landing posters without deploying; the stills are kept as an artifact.+ type: boolean+ default: falsejobs:deploy:@@ -24,9 +29,22 @@ jobs:- name: Build SDK packages for documentationrun: bun run build:packages+ # The production build captures stills of the landing's stages in headless Chromium.+ - name: Install Chromium for landing posters+ run: bunx playwright install --with-deps chromium+- run: bun run --filter @open-pencil/docs build:production+ - name: Keep the landing posters for review+ if: ${{ inputs.dry-run }}+ uses: actions/upload-artifact@v7+ with:+ name: landing-posters+ path: packages/docs/.vitepress/dist/landing-posters++ # A tag push has no inputs, so it always deploys.- uses: cloudflare/wrangler-action@v4+ if: ${{ !inputs.dry-run }}with:apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}diff --git a/.gitignore b/.gitignoreindex 19cbb8276..c557696fc 100644--- a/.gitignore+++ b/.gitignore@@ -61,6 +61,7 @@ storybook-static/# Generated by tools/generate/demo from its sources/.cache/demo//.cache/demo.lock/+/.cache/landing-posters//public/demo.fig/desktop/icons/diff --git a/.gitleaks.toml b/.gitleaks.tomlindex c912ff510..8c061273c 100644--- a/.gitleaks.toml+++ b/.gitleaks.toml@@ -12,6 +12,7 @@ paths = ['''(^|/)node_modules/''','''^desktop/target/''','''^packages/[^/]+/dist/''',+ '''^packages/docs/\.vitepress/cache/''','''^test-results/''','''^scratch/''']diff --git a/.storybook/preview.ts b/.storybook/preview.tsindex 19130ff07..8facf2576 100644--- a/.storybook/preview.ts+++ b/.storybook/preview.ts@@ -2,9 +2,11 @@ import { withThemeByDataAttribute } from '@storybook/addon-themes'import type { Preview, Renderer } from '@storybook/vue3-vite'import { watch } from 'vue'-import { useAppTheme } from '../src/app/shell/theme'+import { installBundledFonts } from '@/app/editor/fonts/bundled'+import { useAppTheme } from '@/app/shell/theme'+import '@/app.css'-import '../src/app.css'+installBundledFonts()const preview: Preview = {decorators: [diff --git a/AGENTS.md b/AGENTS.mdindex abcf4a0e6..f457048fe 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -24,6 +24,7 @@ This file holds the repository map and the rules that apply everywhere. Rules fo| `packages/docs` | Published VitePress site | `packages/docs/AGENTS.md` || `src` | Tauri/Vite app: services and state in `src/app/**`, views in `src/views/**`, UI in `src/components/**` | `src/AGENTS.md` || `desktop` | Tauri v2 shell, capabilities, native credentials, menus | `desktop/AGENTS.md` |+| `vite` | The app's Vite plugins, aliases, and dev server; `appSourceConfig()` lends the aliases, icons, and build constants to the docs landing | — || `tests` | Central app, integration, E2E, native, and Figma acceptance tests | `tests/AGENTS.md` || `tools`, `.github` | Private repo tooling, CI classification, releases, brand generation | `tools/AGENTS.md` || `skills/open-pencil` | Installable agent skill | `packages/core/AGENTS.md` (Tools) |diff --git a/bun.lock b/bun.lockindex 48590d312..90a38b2cb 100644--- a/bun.lock+++ b/bun.lock@@ -279,11 +279,28 @@"name": "@open-pencil/docs","version": "0.1.0","dependencies": {+ "@ai-sdk/vue": "^4.0.127","@iconify/vue": "^5.0.1",+ "@open-pencil/core": "workspace:*",+ "@open-pencil/design-jsx": "workspace:*",+ "@open-pencil/dom-css": "workspace:*",+ "@open-pencil/scene-graph": "workspace:*",+ "@vueuse/core": "^14.4.0",+ "ai": "^7.0.127",+ "canvaskit-wasm": "^0.41.1",+ "dedent": "^1.7.2",+ "es-toolkit": "^1.52.0",+ "tinykeys": "^3.1.0",+ "valibot": "^1.5.0",},"devDependencies": {+ "@iconify-json/simple-icons": "^1.2.98","@open-pencil/brand-tools": "workspace:*",+ "@open-pencil/cli": "workspace:*",+ "@open-pencil/demo-tools": "workspace:*","@open-pencil/feedback": "workspace:*",+ "@open-pencil/landing-posters-tools": "workspace:*",+ "@open-pencil/vite-config": "workspace:*","@shikijs/vitepress-twoslash": "^4.4.3","@tailwindcss/vite": "^4.3.3","vitepress": "^2.0.0-alpha.19",@@ -638,6 +655,19 @@"typescript": "~5.8.3",},},+ "tools/generate/landing-posters": {+ "name": "@open-pencil/landing-posters-tools",+ "dependencies": {+ "@open-pencil/package-artifacts-tools": "workspace:*",+ "@playwright/test": "^1.63.0",+ "sharp": "0.34.5",+ },+ "devDependencies": {+ "@types/bun": "^1.3.14",+ "@types/node": "^25.9.9",+ "typescript": "~5.8.3",+ },+ },"tools/generate/tauri-menu": {"name": "@open-pencil/tauri-menu-tools","dependencies": {@@ -680,6 +710,16 @@"nanotar": "^0.3.0",},},+ "vite": {+ "name": "@open-pencil/vite-config",+ "dependencies": {+ "@open-pencil/core": "workspace:*",+ "unplugin-icons": "^23.0.1",+ "unplugin-vue-components": "^31.1.0",+ "vite": "8.1.4",+ "vite-plugin-pwa": "^1.3.0",+ },+ },},"overrides": {"@codemirror/view": "6.43.9",@@ -1187,7 +1227,7 @@"@iconify-json/lucide": ["@iconify-json/[email protected]", "", { "dependencies": { "@iconify/types": "*" } }, "sha512-QRJrLcEC+O4cHCxd8Nzos2s6oI8+qUywJ/ww7EEEKTKNkWE5HOa89QlNk4gD3Ao0AbUh2ml1pkqcXKTg8XZgIw=="],- "@iconify-json/simple-icons": ["@iconify-json/[email protected]", "", { "dependencies": { "@iconify/types": "*" } }, "sha512-/XhANjfGYOuqvSR3TmUnkQkINvQ4GVjVuukvymRbxtVFBvIq/yiXJqCDycKcQPT401OYT9H2vIY6ihAlz1QIAw=="],+ "@iconify-json/simple-icons": ["@iconify-json/[email protected]", "", { "dependencies": { "@iconify/types": "*" } }, "sha512-536pN2RCEQyy5bYwzayrs4e9egr8cmtVcbdSHLaQl/ULUsihzn1eZ0+Hhn50zgz9cbEotiynKsKQSEjFJ7qKmw=="],"@iconify/react": ["@iconify/[email protected]", "", { "dependencies": { "@iconify/types": "^2.0.0" }, "peerDependencies": { "react": ">=16" } }, "sha512-SMmC2sactfpJD427WJEDN6PMyznTFMhByK9yLW0gOTtnjzzbsi/Ke/XqsumsavFPwNiXs8jSiYeZTmLCLwO+Fg=="],@@ -1457,6 +1497,8 @@"@open-pencil/kiwi": ["@open-pencil/kiwi@workspace:packages/kiwi"],+ "@open-pencil/landing-posters-tools": ["@open-pencil/landing-posters-tools@workspace:tools/generate/landing-posters"],+"@open-pencil/lint-tools": ["@open-pencil/lint-tools@workspace:tools/checks/lint"],"@open-pencil/mcp": ["@open-pencil/mcp@workspace:packages/mcp"],@@ -1489,6 +1531,8 @@"@open-pencil/visual-oracles-tools": ["@open-pencil/visual-oracles-tools@workspace:tools/generate/visual-oracles"],+ "@open-pencil/vite-config": ["@open-pencil/vite-config@workspace:vite"],+"@open-pencil/vue": ["@open-pencil/vue@workspace:packages/vue"],"@openrouter/ai-sdk-provider": ["@openrouter/[email protected]", "", { "peerDependencies": { "ai": "^7.0.0", "zod": "^3.25.76 || ^4.1.8" } }, "sha512-BQy1TA9fKrh47s9ivsO6FY5QimN7GUF0i8Qon3pkxQclEgShso0dClpcWn8OIyPLEZZPFaFKgI8TW4S/O0p0Dw=="],@@ -5261,6 +5305,8 @@"vite/rolldown": ["[email protected]", "", { "dependencies": { "@oxc-project/types": "=0.139.0", "@rolldown/pluginutils": "^1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm64": "1.1.5", "@rolldown/binding-darwin-arm64": "1.1.5", "@rolldown/binding-darwin-x64": "1.1.5", "@rolldown/binding-freebsd-x64": "1.1.5", "@rolldown/binding-linux-arm-gnueabihf": "1.1.5", "@rolldown/binding-linux-arm64-gnu": "1.1.5", "@rolldown/binding-linux-arm64-musl": "1.1.5", "@rolldown/binding-linux-ppc64-gnu": "1.1.5", "@rolldown/binding-linux-s390x-gnu": "1.1.5", "@rolldown/binding-linux-x64-gnu": "1.1.5", "@rolldown/binding-linux-x64-musl": "1.1.5", "@rolldown/binding-openharmony-arm64": "1.1.5", "@rolldown/binding-wasm32-wasi": "1.1.5", "@rolldown/binding-win32-arm64-msvc": "1.1.5", "@rolldown/binding-win32-x64-msvc": "1.1.5" }, "bin": { "rolldown": "./bin/cli.mjs" } }, "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA=="],+ "vitepress/@iconify-json/simple-icons": ["@iconify-json/[email protected]", "", { "dependencies": { "@iconify/types": "*" } }, "sha512-/XhANjfGYOuqvSR3TmUnkQkINvQ4GVjVuukvymRbxtVFBvIq/yiXJqCDycKcQPT401OYT9H2vIY6ihAlz1QIAw=="],+"vitepress/@vue/shared": ["@vue/[email protected]", "", {}, "sha512-IOnwSCma8j+9xJT6b8H0dEYidC80NsYmNMlZxRsukYcSoGaDBohog5hDxzeUXdFeGWFA++vWvxqOmrr96VlqMA=="],"vitepress/vite": ["[email protected]", "", { "dependencies": { "lightningcss": "^1.33.0", "picomatch": "^4.0.5", "postcss": "^8.5.25", "rolldown": "~1.2.1", "tinyglobby": "^0.2.17" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.4.0", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-EU/eS7BH3XROHh2YnBefjM6DBKA6ZeMZEYQbj7NLWg5wHYlhB8B/Mayd5XsgWq+NFYccDOTemRpdETWR6Ka/lw=="],diff --git a/changes/846/added.md b/changes/846/added.mdnew file mode 100644index 000000000..95d3d839f--- /dev/null+++ b/changes/846/added.md@@ -0,0 +1,3 @@+- openpencil.dev opens on live editor demos of design, AI, code export, the CLI, the SDK, and collaboration, in every docs language, with a short roadmap and an OpenPencil Cloud waitlist.+- A download page offers the latest release's installer for the visitor's system, lists every installer for macOS, Windows, and Linux with Homebrew and the web app, and shows a newer beta with its release notes when there is one.+- `FontManager.setBundledFontLocator()` lets an SDK host say where its bundler put the fonts from the new `@open-pencil/core/assets` export.diff --git a/knip.json b/knip.jsonindex 5b1c329db..aa2fabc0f 100644--- a/knip.json+++ b/knip.json@@ -8,6 +8,7 @@"ignoreWorkspaces": ["packages/acp", "packages/demos"],"ignoreUnresolved": ["~icons/*",+ "#app-public/*","/src/app/editor/fonts/index.ts","/packages/core/src/text/index.ts","/src/app/tabs/index.ts",diff --git a/oxlint.json b/oxlint.jsonindex 82b2e4aa0..46e091eac 100644--- a/oxlint.json+++ b/oxlint.json@@ -429,6 +429,12 @@"open-pencil/no-widen-then-assert": "error"},"overrides": [+ {+ "files": ["packages/docs/.vitepress/theme/landing/**/*.{ts,vue}"],+ "rules": {+ "open-pencil/no-app-imports-in-packages": "off"+ }+ },{"files": ["tools/ci/policy/src/**/*.ts"],"rules": {diff --git a/package.json b/package.jsonindex 6900711b7..e9075bec0 100644--- a/package.json+++ b/package.json@@ -18,6 +18,7 @@"packages/harness","packages/feedback","packages/docs",+ "vite","tools","tools/checks/architecture","tools/checks/docs",@@ -36,6 +37,7 @@"tools/generate/authoring-reference","tools/generate/brand","tools/generate/demo",+ "tools/generate/landing-posters","tools/generate/tauri-menu","tools/generate/visual-oracles","tools/release/package-artifacts",@@ -53,9 +55,9 @@"build:native-test": "bun run generate:icons --target desktop && bun run build:packages && bun tauri build --debug --no-bundle --features native-test --config desktop/tauri.native-test.conf.json","benchmark:navigation": "bun tools/dev/navigation-benchmark/src/cli.ts run","test:native": "bun run build:native-test && wdio run wdio.conf.ts",- "lint": "bun run lint:structure && oxlint -c oxlint.json --type-aware --type-check src/ packages/scene-graph/src/ packages/core/src/ packages/vue/src/ packages/cli/src/ packages/mcp/src/ packages/harness/src/ packages/feedback/src/ packages/dom-css/src/ packages/pen/src/ packages/design-jsx/src/ packages/emit/src/ packages/kiwi/src/ packages/fig/src/",- "lint:structure": "oxlint -c oxlint.json commitlint.config.ts vite.config.ts vite/ .storybook/ src/ packages/scene-graph/src/ packages/scene-graph/scripts/ packages/core/src/ packages/vue/src/ packages/cli/src/ packages/mcp/src/ packages/harness/src/ packages/harness/tests/ packages/feedback/src/ packages/feedback/tests/ packages/dom-css/src/ packages/dom-css/tests/ packages/dom-css/scripts/ packages/pen/src/ packages/pen/scripts/ packages/design-jsx/src/ packages/design-jsx/tests/ packages/design-jsx/scripts/ packages/emit/src/ packages/emit/tests/ packages/emit/scripts/ packages/kiwi/src/ packages/kiwi/tests/ packages/kiwi/scripts/ packages/fig/src/ packages/fig/tests/ packages/fig/scripts/ packages/core/tests/ packages/cli/tests/ packages/scene-graph/tests/ packages/vue/tests/ tests/ scripts/ tools/",- "format": "oxfmt --write .oxfmtrc.json commitlint.config.ts vite.config.ts vite/ .storybook/ src/ packages/scene-graph/src/ packages/scene-graph/scripts/ packages/core/src/ packages/cli/src/ packages/mcp/src/ packages/harness/src/ packages/harness/tests/ packages/feedback/src/ packages/feedback/tests/ packages/vue/src/ packages/dom-css/src/ packages/dom-css/tests/ packages/dom-css/scripts/ packages/pen/src/ packages/pen/scripts/ packages/design-jsx/src/ packages/design-jsx/tests/ packages/design-jsx/scripts/ packages/emit/src/ packages/emit/tests/ packages/emit/scripts/ packages/kiwi/src/ packages/kiwi/tests/ packages/kiwi/scripts/ packages/fig/src/ packages/fig/tests/ packages/fig/scripts/ tests scripts/ tools/",+ "lint": "bun run lint:structure && oxlint -c oxlint.json --type-aware --type-check src/ packages/scene-graph/src/ packages/core/src/ packages/vue/src/ packages/cli/src/ packages/mcp/src/ packages/harness/src/ packages/feedback/src/ packages/dom-css/src/ packages/pen/src/ packages/design-jsx/src/ packages/emit/src/ packages/kiwi/src/ packages/fig/src/ packages/docs/.vitepress/theme/landing/",+ "lint:structure": "oxlint -c oxlint.json commitlint.config.ts vite.config.ts vite/ .storybook/ src/ packages/scene-graph/src/ packages/scene-graph/scripts/ packages/core/src/ packages/vue/src/ packages/cli/src/ packages/mcp/src/ packages/harness/src/ packages/harness/tests/ packages/feedback/src/ packages/feedback/tests/ packages/dom-css/src/ packages/dom-css/tests/ packages/dom-css/scripts/ packages/pen/src/ packages/pen/scripts/ packages/design-jsx/src/ packages/design-jsx/tests/ packages/design-jsx/scripts/ packages/emit/src/ packages/emit/tests/ packages/emit/scripts/ packages/kiwi/src/ packages/kiwi/tests/ packages/kiwi/scripts/ packages/fig/src/ packages/fig/tests/ packages/fig/scripts/ packages/core/tests/ packages/cli/tests/ packages/scene-graph/tests/ packages/vue/tests/ tests/ scripts/ tools/ packages/docs/.vitepress/theme/landing/",+ "format": "oxfmt --write .oxfmtrc.json commitlint.config.ts vite.config.ts vite/ .storybook/ src/ packages/scene-graph/src/ packages/scene-graph/scripts/ packages/core/src/ packages/cli/src/ packages/mcp/src/ packages/harness/src/ packages/harness/tests/ packages/feedback/src/ packages/feedback/tests/ packages/vue/src/ packages/dom-css/src/ packages/dom-css/tests/ packages/dom-css/scripts/ packages/pen/src/ packages/pen/scripts/ packages/design-jsx/src/ packages/design-jsx/tests/ packages/design-jsx/scripts/ packages/emit/src/ packages/emit/tests/ packages/emit/scripts/ packages/kiwi/src/ packages/kiwi/tests/ packages/kiwi/scripts/ packages/fig/src/ packages/fig/tests/ packages/fig/scripts/ tests scripts/ tools/ packages/docs/.vitepress/theme/landing/","format:check": "bun run format && status=$(git status --porcelain -uall) && test -z \"$status\" || (echo \"$status\" && exit 1)","check": "bun run check:icons && bun run build:packages && bun run lint && tsgo --noEmit && bun run check:vue && bun run check:native-test && bun run check:i18n && bun run check:docs && bun run check:changelog && bun run check:packages && bun run check:deps && bun run check:audit && bun run check:secrets && bun run check:monorepo && bun run check:arch && bun run check:test-homes && bun run check:test-types && bun run test:type-shapes && bun run check:tools && bun run test:tools && bun run test:dupes","check:commits": "commitlint",@@ -99,6 +101,7 @@"docs:build:production": "bun --filter @open-pencil/docs build:production","docs:preview": "bun --filter @open-pencil/docs preview","generate:demo": "bun tools/generate/demo/src/cli.ts --force",+ "generate:landing-posters": "bun tools/generate/landing-posters/src/generate.ts --force","generate:icons": "bun tools/generate/brand/src/cli.ts generate","check:icons": "bun tools/generate/brand/src/cli.ts check","generate:tauri-menu": "bun tools/generate/tauri-menu/src/generate.ts",diff --git a/packages/cli/package.json b/packages/cli/package.jsonindex 907eed3b7..4a85da570 100644--- a/packages/cli/package.json+++ b/packages/cli/package.json@@ -11,6 +11,13 @@"openpencil": "./bin/openpencil.js"},"exports": {+ "./package.json": "./package.json",+ "./commands": {+ "types": "./dist/commands/index.d.mts",+ "bun": "./src/commands/index.ts",+ "import": "./dist/commands/index.mjs",+ "default": "./dist/commands/index.mjs"+ },"./library": {"types": "./dist/library/index.d.mts","bun": "./src/library/index.ts",diff --git a/packages/cli/src/commands/index.ts b/packages/cli/src/commands/index.tsnew file mode 100644index 000000000..81c4b4fc6--- /dev/null+++ b/packages/cli/src/commands/index.ts@@ -0,0 +1,54 @@+import analyze from './analyze'+import convert from './convert'+import diff from './diff'+import documents from './documents'+import evalCmd from './eval'+import exportCmd from './export'+import find from './find'+import fonts from './fonts'+import formats from './formats'+import { redo, undo } from './history'+import importCmd from './import'+import info from './info'+import libraries from './libraries'+import lint from './lint'+import node from './node'+import pages from './pages'+import query from './query'+import selection from './selection'+import settings from './settings'+import tokens from './tokens'+import tool from './tool'+import tree from './tree'+import variables from './variables'++/**+ * The top-level `openpencil` commands by name, as `--help` lists them. The docs site counts them+ * from here, so its numbers follow the CLI.+ */+export const COMMANDS = {+ analyze,+ convert,+ diff,+ documents,+ eval: evalCmd,+ export: exportCmd,+ import: importCmd,+ find,+ formats,+ fonts,+ info,+ lint,+ libraries,+ query,+ node,+ pages,+ redo,+ selection,+ settings,+ tool,+ tokens,+ tree,+ undo,+ variables+}diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.tsindex 6cd79f303..f1d7fca45 100755--- a/packages/cli/src/index.ts+++ b/packages/cli/src/index.ts@@ -1,29 +1,7 @@#!/usr/bin/env bunimport { defineCommand, runMain } from 'citty'-import analyze from './commands/analyze'-import convert from './commands/convert'-import diff from './commands/diff'-import documents from './commands/documents'-import evalCmd from './commands/eval'-import exportCmd from './commands/export'-import find from './commands/find'-import fonts from './commands/fonts'-import formats from './commands/formats'-import { redo, undo } from './commands/history'-import importCmd from './commands/import'-import info from './commands/info'-import libraries from './commands/libraries'-import lint from './commands/lint'-import node from './commands/node'-import pages from './commands/pages'-import query from './commands/query'-import selection from './commands/selection'-import settings from './commands/settings'-import tokens from './commands/tokens'-import tool from './commands/tool'-import tree from './commands/tree'-import variables from './commands/variables'+import { COMMANDS } from './commands'const { version } = await import('../package.json')@@ -34,32 +12,7 @@ const main = defineCommand({'OpenPencil CLI — inspect, export, and lint design documents, and drive the running app',version},- subCommands: {- analyze,- convert,- diff,- documents,- eval: evalCmd,- export: exportCmd,- import: importCmd,- find,- formats,- fonts,- info,- lint,- libraries,- query,- node,- pages,- redo,- selection,- settings,- tool,- tokens,- tree,- undo,- variables- }+ subCommands: COMMANDS})void runMain(main)diff --git a/packages/cli/tsdown.config.ts b/packages/cli/tsdown.config.tsindex 9d7105bf4..200f3c101 100644--- a/packages/cli/tsdown.config.ts+++ b/packages/cli/tsdown.config.ts@@ -3,6 +3,7 @@ import { defineConfig } from 'tsdown'export default defineConfig({entry: {index: './src/index.ts',+ 'commands/index': './src/commands/index.ts','library/index': './src/library/index.ts'},platform: 'node',diff --git a/packages/core/package.json b/packages/core/package.jsonindex d2d07456c..a893a606b 100644--- a/packages/core/package.json+++ b/packages/core/package.json@@ -22,6 +22,7 @@},"exports": {"./package.json": "./package.json",+ "./assets/*": "./assets/*",".": {"types": "./dist/index.d.ts","import": "./dist/index.js",diff --git a/packages/core/src/text/fonts.ts b/packages/core/src/text/fonts.tsindex f9b94a871..690f46140 100644--- a/packages/core/src/text/fonts.ts+++ b/packages/core/src/text/fonts.ts@@ -44,6 +44,15 @@ const BUNDLED_FONTS: Record<string, string> = {'Noto Naskh Arabic|Regular': '/NotoNaskhArabic-Regular.ttf'}+/**+ * Maps a bundled font's file name (`Inter-Regular.ttf`) to the URL a browser fetches it from.+ * Mirrors CanvasKit's `locateFile`; the default expects the host to serve+ * `@open-pencil/core/assets` at the site root.+ */+export type BundledFontLocator = (file: string) => string++const defaultBundledFontLocator: BundledFontLocator = (file) => `/${file}`+export class FontManager {private loadedFamilies = new Map<string, ArrayBuffer>()private loadedFamilySources = new Map<string, FontLoadedSource>()@@ -53,6 +62,8 @@ export class FontManager {private instanceVariations = new WeakMap<ArrayBuffer, Map<string, FontVariation[] | null>>()private blockedNodeIds = new Set<string>()private fontProvider: TypefaceFontProvider | null = null+ private bundledFontLocator: BundledFontLocator = defaultBundledFontLocator+ private readonly bundledFontRequests = new Map<string, Promise<ArrayBuffer | null>>()private fontProviders = new Set<TypefaceFontProvider>()private providerCanvasKits = new WeakMap<TypefaceFontProvider, CanvasKit>()private registrationGeneration = 0@@ -147,6 +158,11 @@ export class FontManager {this.hostFontLoader = loader}+ /** Lets a host that bundles `@open-pencil/core/assets` itself say where each file ended up. */+ setBundledFontLocator(locate: BundledFontLocator | null): void {+ this.bundledFontLocator = locate ?? defaultBundledFontLocator+ }+setOnlineFontProviders(settings: Partial<Record<WebFontProviderId, boolean>>): void {this.webFonts.setEnabled(settings)this.forgetFamilyFaces()@@ -302,10 +318,23 @@ export class FontManager {this.webFonts.preloadFamilies()}- async fetchBundledFont(url: string): Promise<ArrayBuffer | null> {+ /**+ * Reads a bundled font. Concurrent loads of one face share a request, so they get the same+ * buffer; it is forgotten once settled, so a failed request can be retried.+ */+ fetchBundledFont(url: string): Promise<ArrayBuffer | null> {+ const pending = this.bundledFontRequests.get(url)+ if (pending) return pending+ const request = this.readBundledFont(url).finally(() => this.bundledFontRequests.delete(url))+ this.bundledFontRequests.set(url, request)+ return request+ }++ private async readBundledFont(url: string): Promise<ArrayBuffer | null> {if (IS_BROWSER) {- const response = await fetch(url)- return response.arrayBuffer()+ const response = await fetch(this.bundledFontLocator(url.replace(/^\//, '')))+ // A missing file answers with an error page, which must not be read as a font.+ return response.ok ? response.arrayBuffer() : null}const { readFile } = await import(/* @vite-ignore */ 'node:fs/promises')const { resolve, dirname } = await import(/* @vite-ignore */ 'node:path')diff --git a/packages/core/tests/editor/structure/flatten.test.ts b/packages/core/tests/editor/structure/flatten.test.tsindex 3a75a95d6..fcbe5f2e3 100644--- a/packages/core/tests/editor/structure/flatten.test.ts+++ b/packages/core/tests/editor/structure/flatten.test.ts@@ -31,12 +31,12 @@ async function createEditorWithRenderer() {}async function loadInterRegular() {- const data = await Bun.file('public/Inter-Regular.ttf').arrayBuffer()+ const data = await Bun.file('packages/core/assets/Inter-Regular.ttf').arrayBuffer()fontManager.markLoaded('Inter', 'Regular', data)}async function loadInterBold() {- const data = await Bun.file('public/Inter-Bold.ttf').arrayBuffer()+ const data = await Bun.file('packages/core/assets/Inter-Bold.ttf').arrayBuffer()fontManager.markLoaded('Inter', 'Bold', data)}diff --git a/packages/docs/.vitepress/config.ts b/packages/docs/.vitepress/config.tsindex 110c7c6d9..d3611705c 100644--- a/packages/docs/.vitepress/config.ts+++ b/packages/docs/.vitepress/config.ts@@ -1,24 +1,35 @@import { dirname, resolve } from 'node:path'import { fileURLToPath } from 'node:url'-import { ensureBrandAssets } from '@open-pencil/brand-tools'import { transformerTwoslash } from '@shikijs/vitepress-twoslash'import { createFileSystemTypesCache } from '@shikijs/vitepress-twoslash/cache-fs'import tailwindcss from '@tailwindcss/vite'import { defineConfig } from 'vitepress'import llmstxt from 'vitepress-plugin-llms'+import { ensureBrandAssets } from '@open-pencil/brand-tools'+import { ensureDemoDocument } from '@open-pencil/demo-tools'+import { landingPosterFingerprint } from '@open-pencil/landing-posters-tools/fingerprint'+import { appSourceConfig } from '@open-pencil/vite-config/app-source'++import { landingPreloads } from './landing-head.ts'import { docsLocales } from './locales.ts'import { rootThemeConfig } from './root-theme.ts'import { BASE, LOCALE_PREFIXES, applyPageSeo, siteHead, withAlternateSitemapLinks } from './seo.ts'-await ensureBrandAssets(['docs'])+await Promise.all([ensureBrandAssets(['docs']), ensureDemoDocument()])const configDir = dirname(fileURLToPath(import.meta.url))const docsRoot = dirname(configDir)const packagesRoot = dirname(docsRoot)const repoRoot = dirname(packagesRoot)+// The landing page mounts the app's own components, compiled from source.+const appSource = appSourceConfig()const fastBuild = process.env.OPENPENCIL_DOCS_FAST_BUILD === '1'+// Production builds show stills of the landing's stages until they are live. The build names+// the stills by this fingerprint, and `tools/generate/landing-posters` captures them afterwards.+const posterFingerprint =+ process.env.OPENPENCIL_LANDING_POSTERS === '1' ? await landingPosterFingerprint(repoRoot) : nullconst llmsPlugin = llmstxt({domain: BASE,@@ -51,7 +62,13 @@ export default defineConfig({head: siteHead,- transformPageData: applyPageSeo,+ transformPageData(pageData) {+ applyPageSeo(pageData)+ if (posterFingerprint && pageData.frontmatter.landing === true) {+ pageData.frontmatter.posters = posterFingerprint+ }+ },+ transformHead: landingPreloads,markdown: {codeTransformers: [@@ -74,13 +91,14 @@ export default defineConfig({vite: {resolve: {- alias: {- '#docs': configDir,- '#docs-api': resolve(docsRoot, 'programmable/sdk/api'),- '#vue': resolve(packagesRoot, 'vue/src')- }+ alias: [+ { find: '#docs-api', replacement: resolve(docsRoot, 'programmable/sdk/api') },+ { find: '#docs', replacement: configDir },+ ...appSource.alias+ ]},- plugins: [tailwindcss(), llmsPlugin]+ define: appSource.define,+ plugins: [...appSource.plugins, tailwindcss(), llmsPlugin]},locales: docsLocales,diff --git a/packages/docs/.vitepress/landing-head.ts b/packages/docs/.vitepress/landing-head.tsnew file mode 100644index 000000000..bf3d7f855--- /dev/null+++ b/packages/docs/.vitepress/landing-head.ts@@ -0,0 +1,30 @@+import type { HeadConfig, TransformContext } from 'vitepress'++/**+ * The engine files a landing stage cannot render without. The page fetches them only after+ * its editor code arrives and a stage mounts, so without a hint they wait behind that code.+ * The faces are the ones the scenes use; the others load when a document asks for them.+ */+const ENGINE_ASSETS = [+ /\/canvaskit\.[\w-]+\.wasm$/,+ /\/Inter-Regular\.[\w-]+\.ttf$/,+ /\/Inter-Medium\.[\w-]+\.ttf$/,+ /\/Inter-SemiBold\.[\w-]+\.ttf$/,+ /\/Inter-Bold\.[\w-]+\.ttf$/+]++/**+ * Preloads the engine on pages that set `landing: true`, so CanvasKit and the fonts download+ * alongside the editor code instead of after it. Core and the font manager request them with+ * `fetch()`, so the hints are `as="fetch"` with CORS to share that request. Touch screens skip+ * them: there a stage starts only when the visitor asks for it.+ */+export function landingPreloads({ pageData, assets }: TransformContext): HeadConfig[] {+ if (pageData.frontmatter.landing !== true) return []+ return assets+ .filter((asset) => ENGINE_ASSETS.some((pattern) => pattern.test(asset)))+ .map((href): HeadConfig => [+ 'link',+ { rel: 'preload', href, as: 'fetch', crossorigin: '', media: '(pointer: fine)' }+ ])+}diff --git a/packages/docs/.vitepress/sdk/component-meta.ts b/packages/docs/.vitepress/sdk/component-meta.tsindex 897853221..83b02ea42 100644--- a/packages/docs/.vitepress/sdk/component-meta.ts+++ b/packages/docs/.vitepress/sdk/component-meta.ts@@ -2,8 +2,8 @@ import { existsSync, readFileSync } from 'node:fs'import { dirname, join, resolve } from 'node:path'import { fileURLToPath } from 'node:url'-import { createChecker } from 'vue-component-meta'import type { Loader } from 'vitepress'+import { createChecker } from 'vue-component-meta'export interface SdkComponentPropMeta {name: string@@ -59,7 +59,22 @@ function findWorkspaceRoot(start: string): string {}const repoRoot = findWorkspaceRoot(fileURLToPath(new URL('.', import.meta.url)))-const checker = createChecker(resolve(repoRoot, 'packages/vue/tsconfig.json'), { schema: false })++type ComponentMetaChecker = ReturnType<typeof createChecker>+const SHARED_CHECKER: unique symbol = Symbol.for('open-pencil.docs.component-meta-checker')++/**+ * One checker for the whole docs build. VitePress evaluates each data loader's imports on their+ * own, so a module-level checker was created once per loader: fourteen TypeScript programs over+ * the Vue SDK at once, about 7 GB of heap. The process-wide one is created on first use.+ */+function sharedChecker(): ComponentMetaChecker {+ const scope = globalThis as typeof globalThis & { [SHARED_CHECKER]?: ComponentMetaChecker }+ scope[SHARED_CHECKER] ??= createChecker(resolve(repoRoot, 'packages/vue/tsconfig.json'), {+ schema: false+ })+ return scope[SHARED_CHECKER]+}export interface SdkComponentData {components: SdkComponentMeta[]@@ -74,10 +89,19 @@ export function defineComponentMetaLoader(sources: string[]): Loader<SdkComponenexport function readComponentMeta(source: string): SdkComponentMeta {const absoluteSource = resolve(repoRoot, source)+ const checker = sharedChecker()+ // The checker outlives a loader's reruns in development, so it reads the edited file again.+ checker.updateFile(absoluteSource, readFileSync(absoluteSource, 'utf8'))const meta = checker.getComponentMeta(absoluteSource)return {- name: meta.name ?? source.split('/').at(-1)?.replace(/\.vue$/, '') ?? source,+ name:+ meta.name ??+ source+ .split('/')+ .at(-1)+ ?.replace(/\.vue$/, '') ??+ source,source,props: meta.props.filter((prop) => !prop.global)diff --git a/packages/docs/.vitepress/seo.ts b/packages/docs/.vitepress/seo.tsindex 9be287e03..eae57e463 100644--- a/packages/docs/.vitepress/seo.ts+++ b/packages/docs/.vitepress/seo.ts@@ -1,11 +1,49 @@-import { existsSync } from 'node:fs'+import { existsSync, readFileSync } from 'node:fs'import { resolve } from 'node:path'import { fileURLToPath } from 'node:url'+import * as v from 'valibot'+import type { HeadConfig } from 'vitepress'+export const BASE = 'https://openpencil.dev'const docsRoot = fileURLToPath(new URL('..', import.meta.url))+const RootManifestSchema = v.pipe(v.string(), v.parseJson(), v.object({ version: v.string() }))+const { version } = v.parse(+ RootManifestSchema,+ readFileSync(resolve(docsRoot, '../../package.json'), 'utf8')+)++/**+ * Search engines read the product from the English home page. It is written into the page's+ * head at build time, so it never takes part in hydration.+ */+const SOFTWARE_APPLICATION = {+ '@context': 'https://schema.org',+ '@type': 'SoftwareApplication',+ name: 'OpenPencil',+ applicationCategory: 'DesignApplication',+ operatingSystem: 'Windows, macOS, Linux, Web',+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'USD' },+ url: 'https://app.openpencil.dev',+ description:+ 'Open-source design editor that opens Figma .fig files, runs locally, and is programmable by you or your AI agent.',+ softwareVersion: version,+ license: 'https://opensource.org/licenses/MIT',+ screenshot: `${BASE}/screenshot.png`,+ downloadUrl: `${BASE}/download`,+ featureList: [+ 'Opens and saves Figma .fig files',+ 'AI agents that design on the canvas with your own provider keys',+ 'MCP server for AI coding agents',+ 'Real-time collaboration with people and agents',+ 'Headless CLI for inspection, linting, and export',+ 'Desktop app for macOS, Windows, and Linux',+ 'Vue SDK for embedding the editor'+ ]+}+export const LOCALE_PREFIXES = ['de', 'fr', 'es', 'it', 'pl', 'ru'] as constexport const LOCALES: Record<string, { hreflang: string; ogLocale: string; prefix: string }> = {@@ -24,7 +62,10 @@ export const siteHead: [string, Record<string, string>][] = [['link', { rel: 'icon', type: 'image/svg+xml', href: '/brand/favicon.svg' }],['link', { rel: 'apple-touch-icon', href: '/apple-touch-icon.png' }],['link', { rel: 'alternate', type: 'text/plain', title: 'llms.txt', href: '/llms.txt' }],- ['link', { rel: 'alternate', type: 'text/plain', title: 'llms-full.txt', href: '/llms-full.txt' }],+ [+ 'link',+ { rel: 'alternate', type: 'text/plain', title: 'llms-full.txt', href: '/llms-full.txt' }+ ],['meta', { property: 'og:type', content: 'website' }],['meta', { property: 'og:site_name', content: 'OpenPencil' }],['meta', { property: 'og:image', content: `${BASE}/screenshot.png` }],@@ -46,7 +87,7 @@ type PageDataLike = {title?: stringdescription?: stringfrontmatter: {- head?: [string, Record<string, string>][]+ head?: HeadConfig[]}}@@ -112,6 +153,9 @@ export function applyPageSeo(pageData: PageDataLike): void {head.push(['link', { rel: 'canonical', href: pageUrl }])head.push(['meta', { property: 'og:url', content: pageUrl }])head.push(['meta', { property: 'og:locale', content: locale.ogLocale }])+ if (pageData.relativePath === 'index.md') {+ head.push(['script', { type: 'application/ld+json' }, JSON.stringify(SOFTWARE_APPLICATION)])+ }for (const localeOption of availableLocalesForPage(pageData.relativePath)) {if (localeOption.prefix !== locale.prefix) {@@ -123,8 +167,8 @@ export function applyPageSeo(pageData: PageDataLike): void {{rel: 'alternate',hreflang: localeOption.hreflang,- href: localizedUrl(slug, localeOption.prefix),- },+ href: localizedUrl(slug, localeOption.prefix)+ }])}head.push(['link', { rel: 'alternate', hreflang: 'x-default', href: enSlug }])diff --git a/packages/docs/.vitepress/theme/HomeLayout.vue b/packages/docs/.vitepress/theme/HomeLayout.vuedeleted file mode 100644index 18b23b02f..000000000--- a/packages/docs/.vitepress/theme/HomeLayout.vue+++ /dev/null@@ -1,37 +0,0 @@-<script setup lang="ts">-import DefaultTheme from 'vitepress/theme'-import { useData } from 'vitepress'-import SchemaOrg from './SchemaOrg.vue'--const { Layout } = DefaultTheme-const { frontmatter } = useData()-</script>--<template>- <Layout>- <template #home-hero-after>- <div v-if="frontmatter.layout === 'home'" class="screenshot">- <img- src="/screenshot.png"- alt="OpenPencil editor with a Material 3 design file open"- />- </div>- </template>- <template #home-features-after>- <SchemaOrg />- </template>- </Layout>-</template>--<style scoped>-.screenshot {- max-width: 1152px;- margin: 0 auto;- padding: 0 24px;-}--.screenshot img {- width: 100%;- border-radius: 12px;-}-</style>diff --git a/packages/docs/.vitepress/theme/SchemaOrg.vue b/packages/docs/.vitepress/theme/SchemaOrg.vuedeleted file mode 100644index 72666428d..000000000--- a/packages/docs/.vitepress/theme/SchemaOrg.vue+++ /dev/null@@ -1,39 +0,0 @@-<script setup lang="ts">-import { useData } from 'vitepress'--const { page } = useData()--const isEnHome = page.value.relativePath === 'index.md'--const schema = JSON.stringify({- '@context': 'https://schema.org',- '@type': 'SoftwareApplication',- name: 'OpenPencil',- applicationCategory: 'DesignApplication',- operatingSystem: 'Windows, macOS, Linux, Web',- offers: {- '@type': 'Offer',- price: '0',- priceCurrency: 'USD',- },- url: 'https://app.openpencil.dev',- description:- 'Open-source, AI-native design editor. Figma-compatible with full .fig file support.',- softwareVersion: '0.8.0',- license: 'https://opensource.org/licenses/MIT',- screenshot: 'https://openpencil.dev/screenshot.png',- downloadUrl: 'https://github.com/open-pencil/open-pencil/releases/latest',- featureList: [- 'Open .fig files natively',- 'AI chat with 78 design tools',- 'MCP server for AI coding tools',- 'P2P real-time collaboration',- 'Headless CLI for automation',- 'Desktop app via Tauri',- ],-})-</script>--<template>- <component :is="'script'" v-if="isEnHome" type="application/ld+json">{{ schema }}</component>-</template>diff --git a/packages/docs/.vitepress/theme/index.ts b/packages/docs/.vitepress/theme/index.tsindex b1e293fe2..6a0ff89fd 100644--- a/packages/docs/.vitepress/theme/index.ts+++ b/packages/docs/.vitepress/theme/index.ts@@ -3,7 +3,6 @@ import DefaultTheme from 'vitepress/theme'import '@shikijs/vitepress-twoslash/style.css'-import HomeLayout from './HomeLayout.vue'import SdkCard from './components/SdkCard.vue'import SdkCardGroup from './components/SdkCardGroup.vue'import SdkComponentAPI from './components/SdkComponentAPI.vue'@@ -16,10 +15,10 @@ import SdkRelatedLinks from './components/SdkRelatedLinks.vue'import SdkSlotsTable from './components/SdkSlotsTable.vue'import './tailwind.css'+import './vars.css'export default {extends: DefaultTheme,- Layout: HomeLayout,enhanceApp({ app }) {app.use(TwoslashFloatingVue)app.component('SdkCard', SdkCard)@@ -32,5 +31,5 @@ export default {app.component('SdkPropsTable', SdkPropsTable)app.component('SdkRelatedLinks', SdkRelatedLinks)app.component('SdkSlotsTable', SdkSlotsTable)- },+ }}diff --git a/packages/docs/.vitepress/theme/landing/LandingPage.vue b/packages/docs/.vitepress/theme/landing/LandingPage.vuenew file mode 100644index 000000000..438b58bbe--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/LandingPage.vue@@ -0,0 +1,38 @@+<script setup lang="ts">+import { FEATURE_KINDS } from './content/features'+import { provideLandingMessages, type LandingMessages } from './content/messages'+import AgentList from './sections/AgentList.vue'+import ClosingSection from './sections/ClosingSection.vue'+import CloudSection from './sections/CloudSection.vue'+import CommandList from './sections/CommandList.vue'+import FeatureSection from './sections/FeatureSection.vue'+import HeroSection from './sections/HeroSection.vue'+import OwnershipSection from './sections/OwnershipSection.vue'+import RoadmapSection from './sections/RoadmapSection.vue'++import './landing.css'++/** The copy of the page's locale, imported by that locale's `index.md`. */+const { messages } = defineProps<{ messages: LandingMessages }>()+provideLandingMessages(messages)+</script>++<template>+ <div class="landing">+ <HeroSection />+ <!-- Blocks alternate sides, so the page reads as a zigzag rather than a column. -->+ <FeatureSection+ v-for="(kind, index) in FEATURE_KINDS"+ :key="kind"+ :kind="kind"+ :flipped="index % 2 === 1"+ >+ <AgentList v-if="kind === 'ai'" />+ <CommandList v-else-if="kind === 'script'" />+ </FeatureSection>+ <OwnershipSection />+ <CloudSection />+ <RoadmapSection />+ <ClosingSection />+ </div>+</template>diff --git a/packages/docs/.vitepress/theme/landing/content/features.ts b/packages/docs/.vitepress/theme/landing/content/features.tsnew file mode 100644index 000000000..9a63fbf45--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/content/features.ts@@ -0,0 +1,19 @@+/** The feature blocks, in page order. Each kind selects a stage in `stage/definitions.ts`. */+export const FEATURE_KINDS = [+ 'figma',+ 'design',+ 'interactive',+ 'tokens',+ 'shaders',+ 'linting',+ 'ai',+ 'collab',+ 'code',+ 'script',+ 'sdk'+] as const++export type FeatureKind = (typeof FEATURE_KINDS)[number]++/** Coding agents documented for the MCP server, the agent skill, or as built-in ACP agents. */+export const AGENTS = ['Claude Code', 'Cursor', 'Windsurf', 'Codex', 'Gemini CLI'] as constdiff --git a/packages/docs/.vitepress/theme/landing/content/links.ts b/packages/docs/.vitepress/theme/landing/content/links.tsnew file mode 100644index 000000000..fe28b8593--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/content/links.ts@@ -0,0 +1,10 @@+export const LINKS = {+ app: 'https://app.openpencil.dev/demo',+ /** The download page, in the visitor's locale. */+ downloadPage: '/download',+ /** Every release file on GitHub, where the download page falls back. */+ download: 'https://github.com/open-pencil/open-pencil/releases/latest',+ github: 'https://github.com/open-pencil/open-pencil',+ docs: '/getting-started',+ roadmap: '/development/roadmap'+} as constdiff --git a/packages/docs/.vitepress/theme/landing/content/messages/de.ts b/packages/docs/.vitepress/theme/landing/content/messages/de.tsnew file mode 100644index 000000000..f34325740--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/content/messages/de.ts@@ -0,0 +1,342 @@+import type { LandingMessages } from './types'++export const de: LandingMessages = {+ hero: {+ title: 'Design ohne Lock‑in.',+ lede: 'Ein Open-Source-Design-Editor, der deine Figma-Dateien öffnet, auf deinem Rechner läuft und jede Ebene von dir oder deinem KI-Agenten steuern lässt.',+ open: 'Tour starten',+ download: 'Herunterladen',+ github: 'GitHub'+ },+ loading: 'Editor wird geladen',+ features: {+ figma: {+ title: 'Öffne, was du schon hast',+ detail:+ 'OpenPencil liest .fig-Dateien direkt: Seiten, Komponenten, Instanzen, Variablen und Auto-Layout kommen als bearbeitbare Ebenen an, und du kannst wieder als .fig speichern. Füge SVG ein oder öffne HTML und CSS, und auch daraus werden Ebenen, angeordnet wie im Browser.',+ hint: 'Das ist die Tour der App selbst, eine echte .fig-Datei. Öffne ein Kapitel in den Ebenen und klick dich durch.'+ },+ design: {+ title: 'Gestalten mit echten Werkzeugen',+ detail:+ 'Auto-Layout, Constraints, Füllungen, Konturen, Effekte und Typografie, mit den Reglern dort, wo du sie erwartest. Komponenten haben Slots: Eine Instanz behält das Design und bringt ihren eigenen Inhalt mit. Alles lässt sich rückgängig machen, und nichts wartet auf einen Server.',+ hint: 'Fahre über das ausgewählte Cover und zieh an einer Ecke, um sie abzurunden. Die anderen Player bringen ihr eigenes Cover über den Artwork-Slot mit.'+ },+ interactive: {+ title: 'Komponenten, die funktionieren',+ detail:+ 'Gib einer Komponente ein Verhalten, etwa Schalter, Checkbox, Schieberegler, Tabs oder Textfeld, und die Vorschau führt sie als echtes Reka-UI-Steuerelement aus. Varianten werden zu ihren Zuständen, und dieselben Komponenten lassen sich mit klickbaren Steuerelementen nach Storybook exportieren.',+ hint: 'Diese Leinwand ist in der Vorschau: Drück auf Play, zieh den Fortschrittsbalken, schalte Zufallswiedergabe um. Verlasse die Vorschau zum Bearbeiten.'+ },+ tokens: {+ title: 'Variablen sind Design-Tokens',+ detail:+ 'Farben, Abstände und Schrift liegen in Sammlungen mit Modi und werden als Tokens bearbeitet. Exportierter Code schreibt gebundene Werte als CSS-Custom-Properties, sodass der Code dieselben Namen verwendet wie das Design.',+ hint: 'Jeder Player liest die Theme-Sammlung in seinem eigenen Modus. Ändere den Wert eines Tokens, und beide folgen.'+ },+ shaders: {+ title: 'Füllungen, die sich bewegen',+ detail:+ 'Ein Shader ist eine Füllung wie jede andere: Wähle ihn in der Füllungsauswahl, stapel Effekte, stell ihre Regler ein oder füge ein Preset von shaders.com ein. Dateien behalten ein Standbild davon, damit sie überall öffnen, und die Vorschau spielt ihn ab.',+ hint: 'Diese Leinwand ist in der Vorschau, deshalb bewegen sich die Shader. Verlasse die Vorschau, wähle ein Quadrat und öffne seine Füllung.'+ },+ linting: {+ title: 'Linting',+ detail:+ 'OpenPencil prüft das Design, während du arbeitest: Kontrast, zu kleine Schrift, Standardnamen, versteckte und leere Ebenen, überflüssige Gruppen. Probleme werden auf der Arbeitsfläche markiert, viele lassen sich mit einem Klick beheben, und dieselben Regeln laufen in der CLI und für Agenten.',+ hint: 'Klicke auf eine Markierung auf der Arbeitsfläche oder wende eine Korrektur aus der Liste an.'+ },+ ai: {+ title: 'Gestalten mit KI, mit deinen Schlüsseln',+ detail:+ 'Beschreibe in normaler Sprache, was du willst: Der Agent bearbeitet das Dokument mit denselben Werkzeugen wie du und zeigt seine Arbeit schon während des Streamings auf der Arbeitsfläche. Verbinde einen beliebigen Anbieter mit deinem eigenen Schlüssel oder nutze den Coding-Agenten, den du ohnehin verwendest.',+ hint: 'Ein aufgezeichneter Durchgang läuft durch die echte Agentenschleife. Sieh zu, wie die Arbeitsfläche beim Streamen entsteht.'+ },+ collab: {+ title: 'Gemeinsam arbeiten, mit Menschen und Agenten',+ detail:+ 'Teile einen Link, und alle bearbeiten dasselbe Dokument, Peer-to-Peer, mit Live-Cursorn, Folgemodus, an Ebenen gehefteten Kommentaren und Sprachanrufen. KI-Agenten kommen genauso dazu: Alle im Raum sehen zu, wie sie bauen, während sie streamen.',+ hint: 'Beide Bildschirme gehören dir. Zieh auf einem eine Ebene und sieh zu, wie sie sich auf dem anderen bewegt; dann frag den Agenten.'+ },+ code: {+ title: 'Vom Design zum Code',+ detail:+ 'Jede Auswahl ist eine Vue- oder React-Komponente mit Varianten als Props und Reka UI oder Radix hinter den interaktiven, oder HTML, Tailwind und Design-JSX mit Variablen als Tokens. Komponenten werden als Storybook-Stories exportiert, und Design-JSX bleibt mit der Leinwand verbunden: Bearbeite es, und die Leinwand folgt.',+ hint: 'Wechsle zu React, HTML oder Design-JSX oder wähle eine andere Ebene.'+ },+ script: {+ title: 'Alles per Skript',+ detail:+ 'Die openpencil-CLI arbeitet mit einer Datei, ohne dass die App läuft, oder steuert die geöffnete App. Untersuche ein Dokument, frage es mit XPath ab, prüfe es mit dem Linter, exportiere es oder führe mit eval Figma-Plugin-Code darauf aus. Der MCP-Server gibt Agenten dieselben Möglichkeiten über stdio oder HTTP.',+ hint: 'Führe einen Befehl aus und beobachte die Arbeitsfläche.'+ },+ sdk: {+ title: 'Bau es in dein eigenes Produkt ein',+ detail:+ 'OpenPencil ist ebenso Werkzeugkasten wie App: eine Framework-unabhängige Engine, ein Headless-Vue-SDK und eigene Pakete für Szenengraph und Dateiformate. Bette eine Arbeitsfläche in dein Produkt ein, rendere und prüfe Designs in der CI oder baue einen anderen Editor auf derselben Engine. Jede Arbeitsfläche auf dieser Seite ist dieses SDK, eingebettet in eine Dokumentationsseite.',+ hint: 'Der Code neben der Arbeitsfläche ist alles, was man zum Einbinden braucht.'+ }+ },+ agents: {+ heading: 'Funktioniert mit',+ rest: 'und jedem MCP-Client'+ },+ commands: {+ cli: '{count} Befehle',+ mcp: '{count} MCP-Tools',+ mcpDetail:+ 'Erstellen, gestalten, anordnen, untersuchen und exportieren. Jedes davon steht auch dem integrierten Agenten zur Verfügung.'+ },+ ownership: {+ title: 'Deine Dateien bleiben deine',+ items: [+ {+ title: 'Lokal zuerst',+ detail:+ 'Dokumente sind Dateien auf deiner Festplatte. Kein Konto, kein Server, kein Internet nötig.'+ },+ {+ title: 'Dein Speicher',+ detail: 'Synchronisiere bei Bedarf über deinen eigenen S3-kompatiblen Bucket.'+ },+ {+ title: 'Offene Formate',+ detail: 'Export nach .fig, PDF, PPTX, SVG, HTML und JSX. Ein Wechsel ist jederzeit möglich.'+ },+ {+ title: 'MIT-lizenziert',+ detail: 'Der Editor, die Rendering-Engine, der .fig-Codec und die CLI.'+ }+ ]+ },+ roadmap: {+ title: 'Roadmap',+ more: 'Vollständige Roadmap',+ shipped: {+ label: 'Erschienen',+ entries: [+ { title: 'Interaktive Komponenten und Vorschau' },+ { title: 'Variablen als Design-Tokens' },+ { title: 'Linting mit Korrekturen per Klick' },+ { title: 'KI-Agenten als Mitwirkende, mit Folgemodus' },+ { title: 'KI-Schritte zurücknehmen, neu erzeugen und bearbeiten' },+ { title: 'Code mit Ebenen verknüpft' },+ { title: 'Visueller Diff und Patch' },+ { title: 'Kommentare und Sprachanrufe in geteilten Räumen' },+ { title: 'Vue- und React-Komponenten im Code-Tab' },+ { title: 'SVG- und HTML-Import als bearbeitbare Ebenen' },+ { title: 'Shader-Füllungen' },+ { title: 'W3C-Design-Tokens' },+ { title: 'Eine geführte Tour durch den Editor' },+ { title: 'Listen und Stile für beliebige Textbereiche' }+ ]+ },+ now: {+ label: 'Jetzt',+ entries: [+ {+ title: 'Storybook aus echten Komponenten',+ detail: 'Stories mit Reka UI für Vue und Radix UI für React.'+ },+ {+ title: 'Komponenten erstellen',+ detail: 'Schnelleres Bearbeiten von Varianten und Auswahl innerhalb von Komponenten.'+ }+ ]+ },+ next: {+ label: 'Als Nächstes',+ lead: {+ title: 'OpenPencil selbst hosten',+ detail:+ 'Der gesamte Workspace in deinem eigenen Netzwerk: Synchronisierung, Freigabe, Kommentare und Team-Bibliotheken, ohne eine Datei an jemand anderen zu senden.',+ features: [+ {+ title: 'Dein Speicher',+ detail: 'Dokumente bleiben in deinem Bucket, in deiner Region.'+ },+ {+ title: 'Deine Identität',+ detail: 'Anmeldung über deinen OIDC- oder SSO-Anbieter, mit Rollen.'+ },+ {+ title: 'Dein Netzwerk',+ detail: 'Ein Kollaborations-Relay, das hinter deiner Firewall funktioniert.'+ },+ {+ title: 'Dein Betrieb',+ detail: 'Geführte Bereitstellung, Upgrades, Backups und Aufbewahrung.'+ }+ ]+ },+ entries: [+ {+ title: 'Versionsverlauf',+ detail: 'Automatische Snapshots, benannte Checkpoints und Wiederherstellung.'+ }+ ],+ cloud: {+ title: 'OpenPencil Cloud',+ detail:+ 'Der gehostete Arbeitsbereich für Teams: Live-Synchronisierung, Freigabe, Bibliotheken und KI, ohne eigenen Betrieb.'+ }+ },+ later: {+ label: 'Später',+ entries: [+ {+ title: 'Verwaltete Design-Systeme',+ detail: 'Vorschlagen, prüfen, veröffentlichen und migrieren.'+ },+ {+ title: 'Einbettbarer Editor',+ detail: 'Bring den Editor von dieser Seite in dein eigenes Produkt.'+ }+ ]+ }+ },+ cloud: {+ badge: 'Früher Zugang',+ title: 'OpenPencil Cloud',+ lede: 'Der Design-Arbeitsbereich deines Teams, für dich gehostet. Alle bearbeiten dieselben Dateien live, teilen sie per Link und gestalten mit KI, ohne etwas zu installieren oder zu betreiben. Deine Dateien bleiben offen: Exportiere sie jederzeit als .fig.',+ features: [+ {+ title: 'Team-Synchronisierung in Echtzeit',+ detail: 'Jede Änderung erreicht sofort alle im Team, auf jedem Gerät.'+ },+ {+ title: 'Freigabelinks und Kommentare',+ detail: 'Schick einen Link zur Durchsicht und diskutiert direkt auf der Leinwand.'+ },+ {+ title: 'Team-Bibliotheken',+ detail: 'Komponenten, Stile und Tokens einmal veröffentlichen und in jeder Datei nutzen.'+ },+ {+ title: 'Gehostete KI',+ detail: 'Agenten, die mit dir gestalten, ohne API-Schlüssel zu verwalten.'+ },+ {+ title: 'SSO und Admin-Steuerung',+ detail: 'Single Sign-on, Rollen und Kontrolle darüber, wer was sieht.'+ }+ ]+ },+ waitlist: {+ label: 'E-Mail-Adresse',+ placeholder: '[email protected]',+ submit: 'Auf die Warteliste',+ confirmHuman: 'Bestätige, dass du ein Mensch bist',+ invalid: 'Gib eine gültige E-Mail-Adresse ein.',+ joined: 'Schau in dein Postfach',+ joinedDetail: 'Öffne den Link, den wir dir geschickt haben, um deine Adresse zu bestätigen.',+ failed:+ 'Die Warteliste ist nicht erreichbar. Prüfe deine Verbindung und versuch es noch einmal.',+ privacy: 'Wir schreiben dir nur zu OpenPencil Cloud.',+ refused: 'Wir konnten nicht bestätigen, dass du kein Bot bist. Versuch es noch einmal.',+ limited: 'Zu viele Versuche. Versuch es in einer Minute noch einmal.',+ unavailable: 'Von hier aus ist die Anmeldung nicht möglich. Trag dich auf openpencil.dev ein.'+ },+ closing: {+ title: 'Nimm deine Designs mit.',+ download: 'OpenPencil herunterladen',+ docs: 'Dokumentation lesen',+ cloud: 'Auf die Cloud-Warteliste'+ },+ clipboard: {+ copy: 'Kopieren',+ copied: 'Kopiert'+ },+ stage: {+ activate: 'Live ausprobieren',+ terminal: {+ tree: 'Ebenenbaum',+ restyle: 'Akzent umfärben',+ addPlayer: 'Player hinzufügen',+ selection: 'Auswahl',+ export: 'Tailwind-Export'+ },+ ai: {+ recorded: 'Aufgezeichneter Durchgang',+ play: 'Abspielen',+ replay: 'Erneut abspielen',+ request: 'Füge neben dem Player eine Warteschlange „Up next“ hinzu.',+ reasoning:+ 'Der Player steht allein im Hero-Rahmen, der seine Kinder in einer Reihe anordnet, also landet eine dort hinzugefügte Karte direkt daneben. Ich binde Hintergrund, Radius und Textfarben der Karte an die Theme-Variablen, die auch der Player nutzt, damit sie mit ihm zwischen Dunkel und Hell wechselt, und liste drei Titel auf, jeweils mit kleinem Cover, Titel und Interpret.',+ reply:+ 'Neben dem Player gibt es jetzt eine Karte **Up next** mit drei Titeln. Farben und Radius kommen aus den Theme-Variablen, sie folgt dem Player also zwischen Dunkel und Hell.'+ },+ collab: {+ you: 'Du',+ yourScreen: 'Dein Bildschirm',+ theirScreen: 'Sams Bildschirm',+ askAgent: 'Agenten fragen'+ },+ sdk: {+ install: 'Installieren'+ }+ },+ download: {+ title: 'OpenPencil herunterladen',+ lede: 'Die Desktop-App für macOS, Windows und Linux. Kostenlos und quelloffen, ohne Anmeldung.',+ version: 'Version {version}, veröffentlicht am {date}',+ forPlatform: 'Für {platform} herunterladen',+ moreFiles: 'Weitere Downloads für {platform}',+ releaseNotes: 'Versionshinweise',+ yourSystem: 'Ihr System',+ arch: {+ appleSilicon: 'Apple Silicon',+ intel: 'Intel',+ x64: 'x64',+ arm: 'ARM'+ },+ formats: {+ dmg: 'Image-Datei',+ exe: 'Installationsprogramm',+ msi: 'Für verwaltete Installationen',+ appimage: 'Läuft auf den meisten Distributionen',+ deb: 'Debian, Ubuntu',+ rpm: 'Fedora, openSUSE'+ },+ requirements: 'Systemanforderungen',+ allTitle: 'Alle Downloads',+ checksums: 'SHA-256-Prüfsummen',+ onGitHub: 'Release auf GitHub',+ unavailable:+ 'Die Liste der Downloads konnte nicht geladen werden. Alle Dateien finden Sie auf der Release-Seite auf GitHub.',+ others: {+ title: 'Weitere Wege',+ homebrew: {+ title: 'Homebrew',+ detail:+ 'Die signierte macOS-App aus dem offiziellen Cask. Homebrew prüft jedes Update, daher kann es etwas später ankommen als hier.'+ },+ web: {+ title: 'Im Browser',+ detail: 'Derselbe Editor unter app.openpencil.dev, ohne Installation.',+ action: 'Web-App öffnen'+ },+ cli: {+ title: 'Kommandozeile',+ detail:+ '.fig-Dateien untersuchen, exportieren, prüfen und skripten, ohne die App zu öffnen.'+ },+ source: {+ title: 'Aus dem Quellcode',+ detail: 'Bauen Sie die App selbst mit Bun und Rust.',+ action: 'Build-Anleitung'+ }+ },+ beta: {+ badge: 'Beta',+ title: 'Probieren Sie, was kommt',+ lede: 'Betas bringen die Funktionen der nächsten Version früher, bevor sie alle erreichen.',+ caveats: [+ 'Eine App mit der stabilen Version aktualisiert sich nicht auf eine Beta; installieren Sie die Beta, um sie zu testen.',+ 'Entfernen Sie unter Linux eine mit .deb oder .rpm installierte Beta, bevor Sie die finale Version installieren.',+ 'Die Betas von CLI und SDK liegen auf npm unter dem Tag next.'+ ],+ notes: 'Was ist neu'+ }+ }+}diff --git a/packages/docs/.vitepress/theme/landing/content/messages/en.ts b/packages/docs/.vitepress/theme/landing/content/messages/en.tsnew file mode 100644index 000000000..9725109fd--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/content/messages/en.ts@@ -0,0 +1,330 @@+import type { LandingMessages } from './types'++export const en: LandingMessages = {+ hero: {+ title: 'Design without the lock‑in.',+ lede: 'An open-source design editor that opens your Figma files, runs on your machine, and lets you or your AI agent drive every layer.',+ open: 'Take the tour',+ download: 'Download',+ github: 'GitHub'+ },+ loading: 'Loading editor',+ features: {+ figma: {+ title: 'Open what you already have',+ detail:+ 'OpenPencil reads .fig files directly: pages, components, instances, variables, and auto layout arrive as editable layers, and you can save back to .fig. Paste SVG or open HTML and CSS, and they become layers too, laid out as a browser lays them out.',+ hint: 'This is the app’s own tour, a real .fig file. Open a chapter in the layers and click around.'+ },+ design: {+ title: 'Design with real tools',+ detail:+ 'Auto layout, constraints, fills, strokes, effects, and typography, with the controls where you expect them. Components take slots, so an instance keeps the design and brings its own content. Everything is undoable, and nothing waits on a server.',+ hint: 'Hover the selected cover and drag a corner to round it. The other players bring their own covers through the Artwork slot.'+ },+ interactive: {+ title: 'Components that work',+ detail:+ 'Give a component a behaviour, such as a switch, checkbox, slider, tabs, or text field, and preview runs it as a real Reka UI control. Variants become its states, and the same components export to Storybook with controls you can click.',+ hint: 'This canvas is in preview: press play, drag the progress bar, toggle shuffle. Leave preview to edit.'+ },+ tokens: {+ title: 'Variables are design tokens',+ detail:+ 'Colours, spacing, and type live in collections with modes and are edited as tokens. Exported code writes bound values as CSS custom properties, so the code uses the same names as the design.',+ hint: 'Each player reads the Theme collection in its own mode. Change a token’s value and both follow.'+ },+ shaders: {+ title: 'Fills that move',+ detail:+ 'A shader is a fill like any other: pick one in the fill picker, stack effects, tune their sliders, or paste a preset from shaders.com. Files keep a still of it, so they open anywhere, and preview plays it.',+ hint: 'This canvas is in preview, so the shaders move. Leave preview, select a square, and open its fill.'+ },+ linting: {+ title: 'Linting',+ detail:+ 'OpenPencil checks the design as you work: contrast, text too small to read, default names, hidden and empty layers, stray groups. Problems are marked on the canvas, many come with a fix you apply in one click, and the same rules run in the CLI and for agents.',+ hint: 'Click a marker on the canvas, or apply a fix from the list.'+ },+ ai: {+ title: 'Design with AI, on your keys',+ detail:+ 'Ask in plain language and the agent edits the document with the same tools you use, previewing its work on the canvas as it streams. Connect any provider with your own key, or bring the coding agent you already use.',+ hint: 'A recorded turn plays through the real agent loop. Watch the canvas build as it streams.'+ },+ collab: {+ title: 'Work together, with people and agents',+ detail:+ 'Share a link and everyone edits the same document, peer to peer, with live cursors, follow mode, comments pinned to layers, and voice calls. AI agents join the same way: everyone in the room watches them build as they stream.',+ hint: 'Both screens are yours to use. Drag a layer on one and watch it move on the other, then ask the agent.'+ },+ code: {+ title: 'From design to code',+ detail:+ 'Every selection is a Vue or React component, with variants as props and Reka UI or Radix behind the interactive ones, or HTML, Tailwind, and design JSX with variables written as tokens. Components export as Storybook stories, and design JSX stays linked to the canvas: edit it and the canvas follows.',+ hint: 'Switch to React, HTML, or design JSX, or select another layer.'+ },+ script: {+ title: 'Script everything',+ detail:+ 'The openpencil CLI works on a file with no app running, or drives the app you have open. Inspect a document, query it with XPath, lint it, export it, or run Figma plugin code against it with eval. The MCP server gives agents the same reach over stdio or HTTP.',+ hint: 'Run a command and watch the canvas.'+ },+ sdk: {+ title: 'Build it into your own product',+ detail:+ 'OpenPencil is a toolkit as much as an app: a framework-neutral engine, a headless Vue SDK, and separate packages for the scene graph and file formats. Embed a canvas in your product, render and check designs in CI, or build a different editor on the same engine. Every canvas on this page is that SDK running inside a documentation site.',+ hint: 'The code beside the canvas is all it takes to mount one.'+ }+ },+ agents: {+ heading: 'Works with',+ rest: 'and any MCP client'+ },+ commands: {+ cli: '{count} commands',+ mcp: '{count} MCP tools',+ mcpDetail:+ 'Create, style, lay out, inspect, and export, each one also available to the built-in agent.'+ },+ ownership: {+ title: 'Your files stay yours',+ items: [+ {+ title: 'Local first',+ detail: 'Documents are files on your disk. No account, no server, no internet required.'+ },+ {+ title: 'Your storage',+ detail: 'Sync through your own S3-compatible bucket when you want it.'+ },+ {+ title: 'Open formats',+ detail: 'Export to .fig, PDF, PPTX, SVG, HTML, and JSX. Leaving is always possible.'+ },+ {+ title: 'MIT licensed',+ detail: 'The editor, the rendering engine, the .fig codec, and the CLI.'+ }+ ]+ },+ roadmap: {+ title: 'Roadmap',+ more: 'Full roadmap',+ shipped: {+ label: 'Shipped',+ entries: [+ { title: 'Interactive components and preview' },+ { title: 'Variables as design tokens' },+ { title: 'Linting with one-click fixes' },+ { title: 'AI agents as collaborators, with follow mode' },+ { title: 'Revert, regenerate, and edit AI turns' },+ { title: 'Code linked to canvas layers' },+ { title: 'Visual diff and patch' },+ { title: 'Comments and voice calls in shared rooms' },+ { title: 'Vue and React components in the Code tab' },+ { title: 'SVG and HTML import as editable layers' },+ { title: 'Shader fills' },+ { title: 'W3C design tokens' },+ { title: 'A guided tour of the editor' },+ { title: 'Lists and styles for any range of text' }+ ]+ },+ now: {+ label: 'Now',+ entries: [+ {+ title: 'Storybook from real components',+ detail: 'Stories that render Reka UI for Vue and Radix UI for React.'+ },+ {+ title: 'Component authoring',+ detail: 'Faster variant editing and canvas selection inside components.'+ }+ ]+ },+ next: {+ label: 'Next',+ lead: {+ title: 'Self-hosted OpenPencil',+ detail:+ 'The whole workspace inside your own network: sync, sharing, comments, and team libraries without sending a file to anyone else.',+ features: [+ { title: 'Your storage', detail: 'Documents stay in your bucket, in your region.' },+ {+ title: 'Your identity',+ detail: 'Sign-in through your OIDC or SSO provider, with roles.'+ },+ {+ title: 'Your network',+ detail: 'A collaboration relay that works behind your firewall.'+ },+ {+ title: 'Your operations',+ detail: 'Guided deployment, upgrades, backups, and retention.'+ }+ ]+ },+ entries: [+ {+ title: 'Version history',+ detail: 'Automatic snapshots, named checkpoints, and restore.'+ }+ ],+ cloud: {+ title: 'OpenPencil Cloud',+ detail:+ 'The hosted workspace for teams: live sync, sharing, libraries, and AI, with nothing to run.'+ }+ },+ later: {+ label: 'Later',+ entries: [+ { title: 'Governed design systems', detail: 'Propose, review, publish, and migrate.' },+ {+ title: 'Embeddable editor',+ detail: 'Put the editor on this page into your own product.'+ }+ ]+ }+ },+ cloud: {+ badge: 'Early access',+ title: 'OpenPencil Cloud',+ lede: "Your team's design workspace, hosted for you. Everyone edits the same files live, shares them with a link, and designs with AI, with nothing to install or run. Your files stay open: export them as .fig whenever you like.",+ features: [+ {+ title: 'Real-time team sync',+ detail: 'Every change reaches every teammate as it happens, on any device.'+ },+ {+ title: 'Share links and comments',+ detail: 'Send a link to review a design and discuss it right on the canvas.'+ },+ {+ title: 'Team libraries',+ detail: 'Publish components, styles, and tokens once and use them in every file.'+ },+ { title: 'Hosted AI', detail: 'Agents that design with you, with no API keys to manage.' },+ {+ title: 'SSO and admin controls',+ detail: 'Single sign-on, roles, and control over who sees what.'+ }+ ]+ },+ waitlist: {+ label: 'Email address',+ placeholder: '[email protected]',+ submit: 'Join the waitlist',+ confirmHuman: 'Confirm you’re human',+ invalid: 'Enter a valid email address.',+ joined: 'Check your inbox',+ joinedDetail: 'Open the link we sent to confirm your address.',+ failed: 'Couldn’t reach the waitlist. Check your connection and try again.',+ privacy: 'We only email you about OpenPencil Cloud.',+ refused: 'We couldn’t confirm you’re not a bot. Try again.',+ limited: 'Too many attempts. Try again in a minute.',+ unavailable: 'You can’t join from here. Join on openpencil.dev instead.'+ },+ closing: {+ title: 'Take your designs with you.',+ download: 'Download OpenPencil',+ docs: 'Read the docs',+ cloud: 'Join the Cloud waitlist'+ },+ clipboard: {+ copy: 'Copy',+ copied: 'Copied'+ },+ stage: {+ activate: 'Try it live',+ terminal: {+ tree: 'Layer tree',+ restyle: 'Recolor the accent',+ addPlayer: 'Add a player',+ selection: 'Selection',+ export: 'Tailwind export'+ },+ ai: {+ recorded: 'Recorded turn',+ play: 'Play',+ replay: 'Replay',+ request: 'Add an Up next queue beside the player.',+ reasoning:+ 'The player sits alone in the hero frame, which lays its children out in a row, so a card added there lands right beside it. I’ll bind the card’s background, radius, and text colors to the Theme variables the player uses, so it switches between dark and light with it, and list three tracks, each with a small cover, a title, and an artist.',+ reply:+ 'Added an **Up next** card beside the player with three tracks. Its colors and radius come from the Theme variables, so it follows the player between dark and light.'+ },+ collab: {+ you: 'You',+ yourScreen: 'Your screen',+ theirScreen: 'Sam’s screen',+ askAgent: 'Ask the agent'+ },+ sdk: {+ install: 'Install'+ }+ },+ download: {+ title: 'Download OpenPencil',+ lede: 'The desktop app for macOS, Windows, and Linux. Free and open source, with nothing to sign up for.',+ version: 'Version {version}, released {date}',+ forPlatform: 'Download for {platform}',+ moreFiles: 'More downloads for {platform}',+ releaseNotes: 'Release notes',+ yourSystem: 'Your system',+ arch: {+ appleSilicon: 'Apple Silicon',+ intel: 'Intel',+ x64: 'x64',+ arm: 'ARM'+ },+ formats: {+ dmg: 'Disk image',+ exe: 'Installer',+ msi: 'For managed installs',+ appimage: 'Runs on most distributions',+ deb: 'Debian, Ubuntu',+ rpm: 'Fedora, openSUSE'+ },+ requirements: 'System requirements',+ allTitle: 'All downloads',+ checksums: 'SHA-256 checksums',+ onGitHub: 'Release on GitHub',+ unavailable:+ 'The list of downloads could not be loaded. Every file is on the releases page on GitHub.',+ others: {+ title: 'Other ways to get it',+ homebrew: {+ title: 'Homebrew',+ detail:+ 'The signed macOS app from the official cask. Homebrew reviews each update, so it can arrive a little later than here.'+ },+ web: {+ title: 'In the browser',+ detail: 'The same editor at app.openpencil.dev, with nothing to install.',+ action: 'Open the web app'+ },+ cli: {+ title: 'Command line',+ detail: 'Inspect, export, lint, and script .fig files without opening the app.'+ },+ source: {+ title: 'From source',+ detail: 'Build the app yourself with Bun and Rust.',+ action: 'Build instructions'+ }+ },+ beta: {+ badge: 'Beta',+ title: 'Try what’s next',+ lede: 'Betas bring the next version’s features early, before they reach everyone.',+ caveats: [+ 'An app on the stable release does not update to a beta; install the beta to try it.',+ 'On Linux, remove a beta installed with .deb or .rpm before installing the final release.',+ 'The CLI and SDK betas are on npm under the next tag.'+ ],+ notes: 'What’s new'+ }+ }+}diff --git a/packages/docs/.vitepress/theme/landing/content/messages/es.ts b/packages/docs/.vitepress/theme/landing/content/messages/es.tsnew file mode 100644index 000000000..5b37b6619--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/content/messages/es.ts@@ -0,0 +1,341 @@+import type { LandingMessages } from './types'++export const es: LandingMessages = {+ hero: {+ title: 'Diseña sin ataduras.',+ lede: 'Un editor de diseño de código abierto que abre tus archivos de Figma, funciona en tu equipo y permite que tú o tu agente de IA controléis cada capa.',+ open: 'Hacer el recorrido',+ download: 'Descargar',+ github: 'GitHub'+ },+ loading: 'Cargando el editor',+ features: {+ figma: {+ title: 'Abre lo que ya tienes',+ detail:+ 'OpenPencil lee archivos .fig directamente: páginas, componentes, instancias, variables y auto layout llegan como capas editables, y puedes volver a guardar en .fig. Pega SVG o abre HTML y CSS, y también se convierten en capas, dispuestas como las dispone un navegador.',+ hint: 'Este es el propio tour de la app, un archivo .fig real. Abre un capítulo en las capas y explora.'+ },+ design: {+ title: 'Diseña con herramientas de verdad',+ detail:+ 'Auto layout, restricciones, rellenos, trazos, efectos y tipografía, con los controles donde los esperas. Los componentes tienen slots: una instancia conserva el diseño y aporta su propio contenido. Todo se puede deshacer y nada espera a un servidor.',+ hint: 'Pasa el puntero por la portada seleccionada y arrastra una esquina para redondearla. Los otros reproductores traen su propia portada por el slot Artwork.'+ },+ interactive: {+ title: 'Componentes que funcionan',+ detail:+ 'Dale a un componente un comportamiento, como un interruptor, una casilla, un deslizador, pestañas o un campo de texto, y la vista previa lo ejecuta como un control real de Reka UI. Las variantes pasan a ser sus estados, y los mismos componentes se exportan a Storybook con controles en los que se puede hacer clic.',+ hint: 'Este lienzo está en vista previa: pulsa play, arrastra la barra de progreso, activa el modo aleatorio. Sal de la vista previa para editar.'+ },+ tokens: {+ title: 'Las variables son tokens de diseño',+ detail:+ 'Colores, espaciados y tipografía viven en colecciones con modos y se editan como tokens. El código exportado escribe los valores vinculados como propiedades personalizadas de CSS, así que el código usa los mismos nombres que el diseño.',+ hint: 'Cada reproductor lee la colección Theme en su propio modo. Cambia el valor de un token y ambos lo siguen.'+ },+ shaders: {+ title: 'Rellenos que se mueven',+ detail:+ 'Un shader es un relleno como cualquier otro: elígelo en el selector de relleno, apila efectos, ajusta sus controles o pega un preset de shaders.com. Los archivos guardan un fotograma fijo, así que se abren en cualquier parte, y la vista previa lo reproduce.',+ hint: 'Este lienzo está en vista previa, por eso los shaders se mueven. Sal de la vista previa, selecciona un cuadrado y abre su relleno.'+ },+ linting: {+ title: 'Linting',+ detail:+ 'OpenPencil revisa el diseño mientras trabajas: contraste, texto demasiado pequeño, nombres por defecto, capas ocultas y vacías, grupos sobrantes. Los problemas se marcan en el lienzo, muchos se corrigen con un clic, y las mismas reglas funcionan en la CLI y para los agentes.',+ hint: 'Haz clic en una marca del lienzo o aplica una corrección de la lista.'+ },+ ai: {+ title: 'Diseña con IA, con tus claves',+ detail:+ 'Pide lo que necesitas con tus propias palabras y el agente edita el documento con las mismas herramientas que tú, mostrando su trabajo en el lienzo a medida que llega. Conecta cualquier proveedor con tu propia clave o usa el agente de programación que ya utilizas.',+ hint: 'Un turno grabado se reproduce con el bucle real del agente. Mira cómo se construye el lienzo mientras llega.'+ },+ collab: {+ title: 'Trabajad juntos, personas y agentes',+ detail:+ 'Comparte un enlace y todos editan el mismo documento, de igual a igual, con cursores en vivo, modo seguir, comentarios fijados a las capas y llamadas de voz. Los agentes de IA se unen igual: todos en la sala los ven construir mientras transmiten.',+ hint: 'Las dos pantallas son tuyas. Arrastra una capa en una y mira cómo se mueve en la otra; después pregunta al agente.'+ },+ code: {+ title: 'Del diseño al código',+ detail:+ 'Cada selección es un componente de Vue o React, con las variantes como props y Reka UI o Radix detrás de los interactivos, o HTML, Tailwind y design JSX con las variables escritas como tokens. Los componentes se exportan como historias de Storybook, y el design JSX sigue vinculado al lienzo: edítalo y el lienzo lo sigue.',+ hint: 'Cambia a React, HTML o design JSX, o selecciona otra capa.'+ },+ script: {+ title: 'Automatízalo todo',+ detail:+ 'La CLI openpencil trabaja sobre un archivo sin que la aplicación esté abierta, o controla la aplicación que tienes en marcha. Inspecciona un documento, consúltalo con XPath, revísalo con el linter, expórtalo o ejecuta código de plugins de Figma con eval. El servidor MCP da a los agentes el mismo alcance por stdio o HTTP.',+ hint: 'Ejecuta un comando y observa el lienzo.'+ },+ sdk: {+ title: 'Intégralo en tu propio producto',+ detail:+ 'OpenPencil es tanto un conjunto de herramientas como una aplicación: un motor independiente del framework, un SDK de Vue sin interfaz y paquetes separados para el grafo de escena y los formatos de archivo. Incrusta un lienzo en tu producto, renderiza y revisa diseños en CI o crea otro editor sobre el mismo motor. Cada lienzo de esta página es ese SDK funcionando dentro de un sitio de documentación.',+ hint: 'El código junto al lienzo es todo lo que hace falta para montar uno.'+ }+ },+ agents: {+ heading: 'Funciona con',+ rest: 'y cualquier cliente MCP'+ },+ commands: {+ cli: '{count} comandos',+ mcp: '{count} herramientas MCP',+ mcpDetail:+ 'Crear, dar estilo, maquetar, inspeccionar y exportar. Todas están también disponibles para el agente integrado.'+ },+ ownership: {+ title: 'Tus archivos siguen siendo tuyos',+ items: [+ {+ title: 'Primero en local',+ detail:+ 'Los documentos son archivos en tu disco. Sin cuenta, sin servidor y sin necesidad de internet.'+ },+ {+ title: 'Tu almacenamiento',+ detail: 'Sincroniza mediante tu propio bucket compatible con S3 cuando lo necesites.'+ },+ {+ title: 'Formatos abiertos',+ detail: 'Exporta a .fig, PDF, PPTX, SVG, HTML y JSX. Siempre puedes irte.'+ },+ {+ title: 'Licencia MIT',+ detail: 'El editor, el motor de renderizado, el códec .fig y la CLI.'+ }+ ]+ },+ roadmap: {+ title: 'Hoja de ruta',+ more: 'Hoja de ruta completa',+ shipped: {+ label: 'Publicado',+ entries: [+ { title: 'Componentes interactivos y vista previa' },+ { title: 'Variables como tokens de diseño' },+ { title: 'Linting con correcciones en un clic' },+ { title: 'Agentes de IA como colaboradores, con modo seguir' },+ { title: 'Revertir, regenerar y editar turnos de IA' },+ { title: 'Código vinculado a las capas' },+ { title: 'Diff visual y parches' },+ { title: 'Comentarios y llamadas de voz en salas compartidas' },+ { title: 'Componentes de Vue y React en la pestaña Código' },+ { title: 'Importación de SVG y HTML como capas editables' },+ { title: 'Rellenos con shaders' },+ { title: 'Design tokens W3C' },+ { title: 'Un recorrido guiado por el editor' },+ { title: 'Listas y estilos para cualquier tramo de texto' }+ ]+ },+ now: {+ label: 'Ahora',+ entries: [+ {+ title: 'Storybook con componentes reales',+ detail: 'Historias que usan Reka UI en Vue y Radix UI en React.'+ },+ {+ title: 'Creación de componentes',+ detail: 'Edición de variantes más rápida y selección dentro de componentes.'+ }+ ]+ },+ next: {+ label: 'Después',+ lead: {+ title: 'OpenPencil autoalojado',+ detail:+ 'Todo el espacio de trabajo dentro de tu propia red: sincronización, uso compartido, comentarios y bibliotecas de equipo sin enviar un archivo a nadie más.',+ features: [+ {+ title: 'Tu almacenamiento',+ detail: 'Los documentos permanecen en tu bucket, en tu región.'+ },+ {+ title: 'Tu identidad',+ detail: 'Inicio de sesión con tu proveedor OIDC o SSO, con roles.'+ },+ {+ title: 'Tu red',+ detail: 'Un relé de colaboración que funciona detrás de tu cortafuegos.'+ },+ {+ title: 'Tu operación',+ detail: 'Despliegue guiado, actualizaciones, copias de seguridad y retención.'+ }+ ]+ },+ entries: [+ {+ title: 'Historial de versiones',+ detail: 'Instantáneas automáticas, puntos de control con nombre y restauración.'+ }+ ],+ cloud: {+ title: 'OpenPencil Cloud',+ detail:+ 'El espacio alojado para equipos: sincronización en directo, uso compartido, bibliotecas e IA, sin nada que mantener.'+ }+ },+ later: {+ label: 'Más adelante',+ entries: [+ {+ title: 'Sistemas de diseño gobernados',+ detail: 'Proponer, revisar, publicar y migrar.'+ },+ {+ title: 'Editor incrustable',+ detail: 'Lleva el editor de esta página a tu propio producto.'+ }+ ]+ }+ },+ cloud: {+ badge: 'Acceso anticipado',+ title: 'OpenPencil Cloud',+ lede: 'El espacio de diseño de tu equipo, alojado por nosotros. Todos editan los mismos archivos en directo, los comparten con un enlace y diseñan con IA, sin nada que instalar ni mantener. Tus archivos siguen abiertos: expórtalos como .fig cuando quieras.',+ features: [+ {+ title: 'Sincronización del equipo en tiempo real',+ detail: 'Cada cambio llega a todo el equipo al instante, en cualquier dispositivo.'+ },+ {+ title: 'Enlaces para compartir y comentarios',+ detail: 'Envía un enlace para revisar un diseño y coméntalo sobre el lienzo.'+ },+ {+ title: 'Bibliotecas del equipo',+ detail: 'Publica componentes, estilos y tokens una vez y úsalos en todos los archivos.'+ },+ {+ title: 'IA alojada',+ detail: 'Agentes que diseñan contigo, sin claves de API que gestionar.'+ },+ {+ title: 'SSO y controles de administración',+ detail: 'Inicio de sesión único, roles y control de quién ve qué.'+ }+ ]+ },+ waitlist: {+ label: 'Correo electrónico',+ placeholder: '[email protected]',+ submit: 'Unirme a la lista',+ confirmHuman: 'Confirma que eres humano',+ invalid: 'Introduce un correo electrónico válido.',+ joined: 'Revisa tu bandeja de entrada',+ joinedDetail: 'Abre el enlace que te enviamos para confirmar tu dirección.',+ failed:+ 'No se pudo contactar con la lista de espera. Comprueba tu conexión e inténtalo de nuevo.',+ privacy: 'Solo te escribiremos sobre OpenPencil Cloud.',+ refused: 'No pudimos confirmar que no eres un bot. Inténtalo de nuevo.',+ limited: 'Demasiados intentos. Inténtalo de nuevo en un minuto.',+ unavailable: 'No puedes unirte desde aquí. Únete en openpencil.dev.'+ },+ closing: {+ title: 'Llévate tus diseños contigo.',+ download: 'Descargar OpenPencil',+ docs: 'Leer la documentación',+ cloud: 'Unirme a la lista de Cloud'+ },+ clipboard: {+ copy: 'Copiar',+ copied: 'Copiado'+ },+ stage: {+ activate: 'Pruébalo en vivo',+ terminal: {+ tree: 'Árbol de capas',+ restyle: 'Cambiar el color de acento',+ addPlayer: 'Añadir un reproductor',+ selection: 'Selección',+ export: 'Exportar a Tailwind'+ },+ ai: {+ recorded: 'Turno grabado',+ play: 'Reproducir',+ replay: 'Repetir',+ request: 'Añade una cola «Up next» junto al reproductor.',+ reasoning:+ 'El reproductor está solo en el marco del hero, que coloca a sus hijos en fila, así que una tarjeta añadida ahí queda justo a su lado. Vincularé el fondo, el radio y los colores de texto de la tarjeta a las variables Theme que usa el reproductor, para que cambie con él entre oscuro y claro, y listaré tres pistas, cada una con una portada pequeña, un título y un artista.',+ reply:+ 'He añadido una tarjeta **Up next** junto al reproductor con tres pistas. Sus colores y su radio vienen de las variables Theme, así que sigue al reproductor entre oscuro y claro.'+ },+ collab: {+ you: 'Tú',+ yourScreen: 'Tu pantalla',+ theirScreen: 'Pantalla de Sam',+ askAgent: 'Preguntar al agente'+ },+ sdk: {+ install: 'Instalar'+ }+ },+ download: {+ title: 'Descargar OpenPencil',+ lede: 'La app de escritorio para macOS, Windows y Linux. Gratuita y de código abierto, sin registro.',+ version: 'Versión {version}, publicada el {date}',+ forPlatform: 'Descargar para {platform}',+ moreFiles: 'Más descargas para {platform}',+ releaseNotes: 'Notas de la versión',+ yourSystem: 'Tu sistema',+ arch: {+ appleSilicon: 'Apple Silicon',+ intel: 'Intel',+ x64: 'x64',+ arm: 'ARM'+ },+ formats: {+ dmg: 'Imagen de disco',+ exe: 'Instalador',+ msi: 'Para instalaciones gestionadas',+ appimage: 'Funciona en la mayoría de distribuciones',+ deb: 'Debian, Ubuntu',+ rpm: 'Fedora, openSUSE'+ },+ requirements: 'Requisitos del sistema',+ allTitle: 'Todas las descargas',+ checksums: 'Sumas de comprobación SHA-256',+ onGitHub: 'Versión en GitHub',+ unavailable:+ 'No se pudo cargar la lista de descargas. Todos los archivos están en la página de versiones en GitHub.',+ others: {+ title: 'Otras formas de obtenerlo',+ homebrew: {+ title: 'Homebrew',+ detail:+ 'La app de macOS firmada, desde el cask oficial. Homebrew revisa cada actualización, así que puede llegar un poco más tarde que aquí.'+ },+ web: {+ title: 'En el navegador',+ detail: 'El mismo editor en app.openpencil.dev, sin instalar nada.',+ action: 'Abrir la app web'+ },+ cli: {+ title: 'Línea de comandos',+ detail: 'Inspecciona, exporta, revisa y automatiza archivos .fig sin abrir la app.'+ },+ source: {+ title: 'Desde el código fuente',+ detail: 'Compila la app tú mismo con Bun y Rust.',+ action: 'Instrucciones de compilación'+ }+ },+ beta: {+ badge: 'Beta',+ title: 'Prueba lo que viene',+ lede: 'Las betas traen antes las funciones de la próxima versión, antes de que lleguen a todos.',+ caveats: [+ 'Una app con la versión estable no se actualiza a una beta; instala la beta para probarla.',+ 'En Linux, quita una beta instalada con .deb o .rpm antes de instalar la versión final.',+ 'Las betas de la CLI y el SDK están en npm con la etiqueta next.'+ ],+ notes: 'Novedades'+ }+ }+}diff --git a/packages/docs/.vitepress/theme/landing/content/messages/fill.ts b/packages/docs/.vitepress/theme/landing/content/messages/fill.tsnew file mode 100644index 000000000..610b7a7aa--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/content/messages/fill.ts@@ -0,0 +1,6 @@+/** A catalog string with each `{name}` replaced by its value, as every locale writes them. */+export function fill(template: string, values: Record<string, string | number>): string {+ return template.replace(/\{(\w+)\}/g, (match, name: string) =>+ name in values ? String(values[name]) : match+ )+}diff --git a/packages/docs/.vitepress/theme/landing/content/messages/fr.ts b/packages/docs/.vitepress/theme/landing/content/messages/fr.tsnew file mode 100644index 000000000..6880d6b7f--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/content/messages/fr.ts@@ -0,0 +1,341 @@+import type { LandingMessages } from './types'++export const fr: LandingMessages = {+ hero: {+ title: 'Le design sans verrouillage.',+ lede: 'Un éditeur de design open source qui ouvre vos fichiers Figma, tourne sur votre machine et vous laisse, vous ou votre agent AI, piloter chaque calque.',+ open: 'Faire la visite',+ download: 'Télécharger',+ github: 'GitHub'+ },+ loading: 'Chargement de l’éditeur',+ features: {+ figma: {+ title: 'Ouvrez ce que vous avez déjà',+ detail:+ 'OpenPencil lit directement les fichiers .fig : pages, composants, instances, variables et auto layout arrivent en calques modifiables, et vous pouvez réenregistrer en .fig. Collez du SVG ou ouvrez du HTML et du CSS, et ils deviennent aussi des calques, disposés comme un navigateur les dispose.',+ hint: 'Voici la visite de l’app elle-même, un vrai fichier .fig. Ouvrez un chapitre dans les calques et explorez.'+ },+ design: {+ title: 'Concevez avec de vrais outils',+ detail:+ 'Auto layout, contraintes, remplissages, contours, effets et typographie, avec les réglages là où vous les attendez. Les composants ont des slots : une instance garde le design et apporte son propre contenu. Tout s’annule, et rien n’attend un serveur.',+ hint: 'Survolez la pochette sélectionnée et faites glisser un coin pour l’arrondir. Les autres lecteurs apportent leur pochette par le slot Artwork.'+ },+ interactive: {+ title: 'Des composants qui fonctionnent',+ detail:+ 'Donnez un comportement à un composant, comme un interrupteur, une case à cocher, un curseur, des onglets ou un champ de texte, et l’aperçu l’exécute comme un vrai contrôle Reka UI. Les variantes deviennent ses états, et les mêmes composants s’exportent vers Storybook avec des contrôles cliquables.',+ hint: 'Ce canevas est en aperçu : lancez la lecture, faites glisser la barre de progression, activez la lecture aléatoire. Quittez l’aperçu pour modifier.'+ },+ tokens: {+ title: 'Les variables sont des design tokens',+ detail:+ 'Couleurs, espacements et typographie vivent dans des collections avec des modes et se modifient comme des tokens. Le code exporté écrit les valeurs liées comme propriétés personnalisées CSS, si bien que le code reprend les noms du design.',+ hint: 'Chaque lecteur lit la collection Theme dans son propre mode. Changez la valeur d’un token et les deux suivent.'+ },+ shaders: {+ title: 'Des remplissages qui bougent',+ detail:+ 'Un shader est un remplissage comme un autre : choisissez-le dans le sélecteur de remplissage, empilez des effets, réglez leurs curseurs ou collez un preset de shaders.com. Les fichiers en gardent une image fixe, pour s’ouvrir partout, et l’aperçu le joue.',+ hint: 'Ce canevas est en aperçu, c’est pourquoi les shaders bougent. Quittez l’aperçu, sélectionnez un carré et ouvrez son remplissage.'+ },+ linting: {+ title: 'Linting',+ detail:+ 'OpenPencil vérifie le design pendant que vous travaillez : contraste, texte trop petit, noms par défaut, calques masqués et vides, groupes superflus. Les problèmes sont signalés sur le canevas, beaucoup se corrigent en un clic, et les mêmes règles tournent dans la CLI et pour les agents.',+ hint: 'Cliquez sur un repère du canevas, ou appliquez une correction depuis la liste.'+ },+ ai: {+ title: 'Concevez avec l’AI, avec vos clés',+ detail:+ 'Demandez en langage courant : l’agent modifie le document avec les mêmes outils que vous et affiche son travail sur le canevas au fil de la génération. Connectez le fournisseur de votre choix avec votre propre clé, ou utilisez l’agent de code que vous employez déjà.',+ hint: 'Un échange enregistré passe par la vraie boucle de l’agent. Regardez le canevas se construire au fil du flux.'+ },+ collab: {+ title: 'Travailler ensemble, humains et agents',+ detail:+ "Partagez un lien et tout le monde modifie le même document, de pair à pair, avec curseurs en direct, mode suivi, commentaires épinglés aux calques et appels vocaux. Les agents d'IA rejoignent la salle de la même façon : tout le monde les regarde construire pendant qu'ils diffusent.",+ hint: 'Les deux écrans sont à vous. Faites glisser un calque sur l’un et regardez-le bouger sur l’autre, puis sollicitez l’agent.'+ },+ code: {+ title: 'Du design au code',+ detail:+ "Chaque sélection est un composant Vue ou React, avec les variantes en props et Reka UI ou Radix derrière les composants interactifs, ou du HTML, du Tailwind et du design JSX avec les variables écrites en tokens. Les composants s'exportent en stories Storybook, et le design JSX reste lié au canevas : modifiez-le et le canevas suit.",+ hint: 'Passez à React, HTML ou design JSX, ou sélectionnez un autre calque.'+ },+ script: {+ title: 'Tout piloter par script',+ detail:+ 'La CLI openpencil travaille sur un fichier sans que l’application soit lancée, ou pilote l’application ouverte. Inspectez un document, interrogez-le en XPath, vérifiez-le avec le linter, exportez-le ou exécutez du code de plugin Figma avec eval. Le serveur MCP donne aux agents la même portée via stdio ou HTTP.',+ hint: 'Lancez une commande et observez le canevas.'+ },+ sdk: {+ title: 'Intégrez-le à votre propre produit',+ detail:+ 'OpenPencil est autant une boîte à outils qu’une application : un moteur indépendant de tout framework, un SDK Vue sans interface et des paquets distincts pour le graphe de scène et les formats de fichier. Intégrez un canevas à votre produit, générez et vérifiez des designs en CI, ou construisez un autre éditeur sur le même moteur. Chaque canevas de cette page est ce SDK, exécuté dans un site de documentation.',+ hint: 'Le code à côté du canevas suffit pour en monter un.'+ }+ },+ agents: {+ heading: 'Compatible avec',+ rest: 'et tout client MCP'+ },+ commands: {+ cli: '{count} commandes',+ mcp: '{count} outils MCP',+ mcpDetail:+ 'Créer, styliser, mettre en page, inspecter et exporter. Chacun est aussi disponible pour l’agent intégré.'+ },+ ownership: {+ title: 'Vos fichiers restent les vôtres',+ items: [+ {+ title: 'Local d’abord',+ detail:+ 'Les documents sont des fichiers sur votre disque. Pas de compte, pas de serveur, pas besoin d’internet.'+ },+ {+ title: 'Votre stockage',+ detail: 'Synchronisez via votre propre bucket compatible S3 quand vous le souhaitez.'+ },+ {+ title: 'Formats ouverts',+ detail: 'Exportez en .fig, PDF, PPTX, SVG, HTML et JSX. Partir reste toujours possible.'+ },+ {+ title: 'Sous licence MIT',+ detail: 'L’éditeur, le moteur de rendu, le codec .fig et la CLI.'+ }+ ]+ },+ roadmap: {+ title: 'Feuille de route',+ more: 'Feuille de route complète',+ shipped: {+ label: 'Livré',+ entries: [+ { title: 'Composants interactifs et aperçu' },+ { title: 'Variables comme design tokens' },+ { title: 'Linting avec corrections en un clic' },+ { title: 'Agents AI comme collaborateurs, avec mode suivi' },+ { title: 'Annuler, régénérer et modifier les échanges avec l’AI' },+ { title: 'Code relié aux calques' },+ { title: 'Diff visuel et correctifs' },+ { title: 'Commentaires et appels vocaux dans les salles partagées' },+ { title: "Composants Vue et React dans l'onglet Code" },+ { title: 'Import SVG et HTML en calques modifiables' },+ { title: 'Remplissages par shaders' },+ { title: 'Design tokens W3C' },+ { title: 'Une visite guidée de l’éditeur' },+ { title: 'Listes et styles pour n’importe quelle portion de texte' }+ ]+ },+ now: {+ label: 'En cours',+ entries: [+ {+ title: 'Storybook à partir de vrais composants',+ detail: 'Des stories qui utilisent Reka UI pour Vue et Radix UI pour React.'+ },+ {+ title: 'Création de composants',+ detail: 'Modification des variantes plus rapide et sélection dans les composants.'+ }+ ]+ },+ next: {+ label: 'Ensuite',+ lead: {+ title: 'OpenPencil auto-hébergé',+ detail:+ 'Tout l’espace de travail dans votre propre réseau : synchronisation, partage, commentaires et bibliothèques d’équipe, sans envoyer un fichier à qui que ce soit.',+ features: [+ {+ title: 'Votre stockage',+ detail: 'Les documents restent dans votre bucket, dans votre région.'+ },+ {+ title: 'Votre identité',+ detail: 'Connexion via votre fournisseur OIDC ou SSO, avec des rôles.'+ },+ {+ title: 'Votre réseau',+ detail: 'Un relais de collaboration qui fonctionne derrière votre pare-feu.'+ },+ {+ title: 'Votre exploitation',+ detail: 'Déploiement guidé, mises à niveau, sauvegardes et rétention.'+ }+ ]+ },+ entries: [+ {+ title: 'Historique des versions',+ detail: 'Instantanés automatiques, points de contrôle nommés et restauration.'+ }+ ],+ cloud: {+ title: 'OpenPencil Cloud',+ detail:+ "L'espace hébergé pour les équipes : synchronisation en direct, partage, bibliothèques et IA, sans rien à faire tourner."+ }+ },+ later: {+ label: 'Plus tard',+ entries: [+ {+ title: 'Design systems gouvernés',+ detail: 'Proposer, relire, publier et migrer.'+ },+ {+ title: 'Éditeur intégrable',+ detail: 'Placez l’éditeur de cette page dans votre propre produit.'+ }+ ]+ }+ },+ cloud: {+ badge: 'Accès anticipé',+ title: 'OpenPencil Cloud',+ lede: "L'espace de design de votre équipe, hébergé pour vous. Tout le monde modifie les mêmes fichiers en direct, les partage par lien et conçoit avec l'IA, sans rien à installer ni à faire tourner. Vos fichiers restent ouverts : exportez-les en .fig quand vous voulez.",+ features: [+ {+ title: "Synchronisation d'équipe en temps réel",+ detail:+ 'Chaque modification parvient à toute l’équipe dès qu’elle a lieu, sur tous les appareils.'+ },+ {+ title: 'Liens de partage et commentaires',+ detail: 'Envoyez un lien pour relire un design et en discuter directement sur le canevas.'+ },+ {+ title: "Bibliothèques d'équipe",+ detail: 'Publiez composants, styles et tokens une fois et utilisez-les dans chaque fichier.'+ },+ {+ title: 'IA hébergée',+ detail: 'Des agents qui conçoivent avec vous, sans clés d’API à gérer.'+ },+ {+ title: "SSO et contrôles d'administration",+ detail: 'Authentification unique, rôles et contrôle de qui voit quoi.'+ }+ ]+ },+ waitlist: {+ label: 'Adresse e-mail',+ placeholder: '[email protected]',+ submit: "Rejoindre la liste d'attente",+ confirmHuman: 'Confirmez que vous êtes humain',+ invalid: 'Saisissez une adresse e-mail valide.',+ joined: 'Consultez votre boîte de réception',+ joinedDetail: 'Ouvrez le lien que nous vous avons envoyé pour confirmer votre adresse.',+ failed: 'Impossible de joindre la liste d’attente. Vérifiez votre connexion et réessayez.',+ privacy: "Nous ne vous écrirons qu'au sujet d'OpenPencil Cloud.",+ refused: 'Nous n’avons pas pu confirmer que vous n’êtes pas un robot. Réessayez.',+ limited: 'Trop de tentatives. Réessayez dans une minute.',+ unavailable: 'Vous ne pouvez pas vous inscrire d’ici. Inscrivez-vous sur openpencil.dev.'+ },+ closing: {+ title: 'Emportez vos designs avec vous.',+ download: 'Télécharger OpenPencil',+ docs: 'Lire la documentation',+ cloud: "Rejoindre la liste d'attente Cloud"+ },+ clipboard: {+ copy: 'Copier',+ copied: 'Copié'+ },+ stage: {+ activate: 'Essayer en direct',+ terminal: {+ tree: 'Arborescence des calques',+ restyle: 'Changer la couleur d’accent',+ addPlayer: 'Ajouter un lecteur',+ selection: 'Sélection',+ export: 'Export Tailwind'+ },+ ai: {+ recorded: 'Échange enregistré',+ play: 'Lire',+ replay: 'Rejouer',+ request: 'Ajoute une file « Up next » à côté du lecteur.',+ reasoning:+ 'Le lecteur est seul dans le cadre du hero, qui aligne ses enfants en ligne : une carte ajoutée là se place juste à côté. Je lie le fond, le rayon et les couleurs de texte de la carte aux variables Theme qu’utilise le lecteur, pour qu’elle passe du sombre au clair avec lui, et j’y liste trois morceaux, chacun avec une petite pochette, un titre et un artiste.',+ reply:+ 'J’ai ajouté une carte **Up next** à côté du lecteur, avec trois morceaux. Ses couleurs et son rayon viennent des variables Theme : elle suit le lecteur entre sombre et clair.'+ },+ collab: {+ you: 'Vous',+ yourScreen: 'Votre écran',+ theirScreen: 'L’écran de Sam',+ askAgent: 'Demander à l’agent'+ },+ sdk: {+ install: 'Installer'+ }+ },+ download: {+ title: 'Télécharger OpenPencil',+ lede: 'L’app de bureau pour macOS, Windows et Linux. Gratuite et open source, sans inscription.',+ version: 'Version {version}, publiée le {date}',+ forPlatform: 'Télécharger pour {platform}',+ moreFiles: 'Autres téléchargements pour {platform}',+ releaseNotes: 'Notes de version',+ yourSystem: 'Votre système',+ arch: {+ appleSilicon: 'Apple Silicon',+ intel: 'Intel',+ x64: 'x64',+ arm: 'ARM'+ },+ formats: {+ dmg: 'Image disque',+ exe: 'Programme d’installation',+ msi: 'Pour les installations gérées',+ appimage: 'Fonctionne sur la plupart des distributions',+ deb: 'Debian, Ubuntu',+ rpm: 'Fedora, openSUSE'+ },+ requirements: 'Configuration requise',+ allTitle: 'Tous les téléchargements',+ checksums: 'Sommes de contrôle SHA-256',+ onGitHub: 'Version sur GitHub',+ unavailable:+ 'La liste des téléchargements n’a pas pu être chargée. Tous les fichiers sont sur la page des versions sur GitHub.',+ others: {+ title: 'Autres façons de l’obtenir',+ homebrew: {+ title: 'Homebrew',+ detail:+ 'L’app macOS signée, depuis le cask officiel. Homebrew vérifie chaque mise à jour, qui peut donc arriver un peu plus tard qu’ici.'+ },+ web: {+ title: 'Dans le navigateur',+ detail: 'Le même éditeur sur app.openpencil.dev, sans rien installer.',+ action: 'Ouvrir l’app web'+ },+ cli: {+ title: 'Ligne de commande',+ detail: 'Inspectez, exportez, vérifiez et scriptez des fichiers .fig sans ouvrir l’app.'+ },+ source: {+ title: 'Depuis les sources',+ detail: 'Compilez l’app vous-même avec Bun et Rust.',+ action: 'Instructions de compilation'+ }+ },+ beta: {+ badge: 'Bêta',+ title: 'Essayez la suite',+ lede: 'Les bêtas apportent les fonctions de la prochaine version en avance, avant qu’elles n’arrivent à tous.',+ caveats: [+ 'Une app en version stable ne passe pas à une bêta ; installez la bêta pour l’essayer.',+ 'Sous Linux, supprimez une bêta installée avec .deb ou .rpm avant d’installer la version finale.',+ 'Les bêtas de la CLI et du SDK sont sur npm sous l’étiquette next.'+ ],+ notes: 'Nouveautés'+ }+ }+}diff --git a/packages/docs/.vitepress/theme/landing/content/messages/index.ts b/packages/docs/.vitepress/theme/landing/content/messages/index.tsnew file mode 100644index 000000000..384d68db4--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/content/messages/index.ts@@ -0,0 +1,35 @@+import { useData, withBase } from 'vitepress'+import { computed, inject, provide, type InjectionKey } from 'vue'++import type { LandingMessages } from './types'++export type { LandingMessages } from './types'++const LANDING_MESSAGES: InjectionKey<LandingMessages> = Symbol('landing-messages')++/**+ * Gives the landing its copy. Each locale's `index.md` imports only its own catalog and passes+ * it to `LandingPage`, so a page downloads one locale and other docs pages download none.+ */+export function provideLandingMessages(messages: LandingMessages): void {+ provide(LANDING_MESSAGES, messages)+}++/** The landing copy of the page being viewed. */+export function useLandingMessages() {+ const messages = inject(LANDING_MESSAGES)+ if (!messages) throw new Error('useLandingMessages() needs a LandingPage with its messages')+ return computed(() => messages)+}++/**+ * Resolves a site path inside the current locale. Pass `translated: false` for pages that+ * exist only in English, which link to the canonical page instead of a missing one.+ */+export function useLocalePath() {+ const { localeIndex } = useData()+ return (path: string, { translated = true } = {}) => {+ const prefix = translated && localeIndex.value !== 'root' ? `/${localeIndex.value}` : ''+ return withBase(`${prefix}${path}`)+ }+}diff --git a/packages/docs/.vitepress/theme/landing/content/messages/it.ts b/packages/docs/.vitepress/theme/landing/content/messages/it.tsnew file mode 100644index 000000000..00d541342--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/content/messages/it.ts@@ -0,0 +1,341 @@+import type { LandingMessages } from './types'++export const it: LandingMessages = {+ hero: {+ title: 'Design senza lock‑in.',+ lede: 'Un editor di design open source che apre i tuoi file Figma, gira sul tuo computer e lascia a te o al tuo agente AI il controllo di ogni livello.',+ open: 'Fai il tour',+ download: 'Scarica',+ github: 'GitHub'+ },+ loading: 'Caricamento dell’editor',+ features: {+ figma: {+ title: 'Apri quello che hai già',+ detail:+ 'OpenPencil legge direttamente i file .fig: pagine, componenti, istanze, variabili e auto layout arrivano come livelli modificabili, e puoi salvare di nuovo in .fig. Incolla SVG o apri HTML e CSS, e diventano livelli anche loro, disposti come li dispone un browser.',+ hint: 'Questo è il tour dell’app stessa, un vero file .fig. Apri un capitolo nei livelli ed esplora.'+ },+ design: {+ title: 'Progetta con strumenti veri',+ detail:+ 'Auto layout, vincoli, riempimenti, tratti, effetti e tipografia, con i controlli dove te li aspetti. I componenti hanno slot: un’istanza mantiene il design e porta il proprio contenuto. Tutto si può annullare, e niente aspetta un server.',+ hint: 'Passa sopra la copertina selezionata e trascina un angolo per arrotondarlo. Gli altri lettori portano la propria copertina tramite lo slot Artwork.'+ },+ interactive: {+ title: 'Componenti che funzionano',+ detail:+ 'Dai a un componente un comportamento, come un interruttore, una casella, uno slider, delle schede o un campo di testo, e l’anteprima lo esegue come un vero controllo Reka UI. Le varianti diventano i suoi stati, e gli stessi componenti si esportano in Storybook con controlli cliccabili.',+ hint: 'Questa tela è in anteprima: premi play, trascina la barra di avanzamento, attiva la riproduzione casuale. Esci dall’anteprima per modificare.'+ },+ tokens: {+ title: 'Le variabili sono design token',+ detail:+ 'Colori, spaziature e tipografia stanno in raccolte con modalità e si modificano come token. Il codice esportato scrive i valori collegati come proprietà personalizzate CSS, così il codice usa gli stessi nomi del design.',+ hint: 'Ogni lettore legge la collezione Theme nella propria modalità. Cambia il valore di un token ed entrambi lo seguono.'+ },+ shaders: {+ title: 'Riempimenti che si muovono',+ detail:+ 'Uno shader è un riempimento come gli altri: sceglilo nel selettore di riempimento, impila effetti, regola i cursori o incolla un preset da shaders.com. I file ne conservano un fotogramma fisso, così si aprono ovunque, e l’anteprima lo riproduce.',+ hint: 'Questa tela è in anteprima, per questo gli shader si muovono. Esci dall’anteprima, seleziona un quadrato e apri il suo riempimento.'+ },+ linting: {+ title: 'Linting',+ detail:+ 'OpenPencil controlla il design mentre lavori: contrasto, testo troppo piccolo, nomi predefiniti, livelli nascosti e vuoti, gruppi superflui. I problemi sono segnati sulla tela, molti si correggono con un clic, e le stesse regole funzionano nella CLI e per gli agenti.',+ hint: 'Fai clic su un indicatore sulla tela, oppure applica una correzione dall’elenco.'+ },+ ai: {+ title: 'Progetta con l’AI, con le tue chiavi',+ detail:+ 'Chiedi con parole tue e l’agente modifica il documento con gli stessi strumenti che usi tu, mostrando il lavoro sulla tela man mano che arriva. Collega qualsiasi provider con la tua chiave, oppure usa l’agente di programmazione che già utilizzi.',+ hint: 'Un turno registrato passa per il vero ciclo dell’agente. Guarda la tela costruirsi mentre arriva.'+ },+ collab: {+ title: 'Lavorare insieme, persone e agenti',+ detail:+ 'Condividi un link e tutti modificano lo stesso documento, peer to peer, con cursori dal vivo, modalità segui, commenti fissati ai livelli e chiamate vocali. Gli agenti di IA entrano allo stesso modo: tutti nella stanza li guardano costruire mentre trasmettono.',+ hint: 'Entrambi gli schermi sono tuoi. Trascina un livello su uno e guardalo muoversi sull’altro, poi chiedi all’agente.'+ },+ code: {+ title: 'Dal design al codice',+ detail:+ 'Ogni selezione è un componente Vue o React, con le varianti come props e Reka UI o Radix dietro quelli interattivi, oppure HTML, Tailwind e design JSX con le variabili scritte come token. I componenti si esportano come storie di Storybook, e il design JSX resta collegato alla tela: modificalo e la tela lo segue.',+ hint: 'Passa a React, HTML o design JSX, oppure seleziona un altro livello.'+ },+ script: {+ title: 'Automatizza tutto',+ detail:+ 'La CLI openpencil lavora su un file senza che l’app sia aperta, oppure controlla l’app in esecuzione. Ispeziona un documento, interrogalo con XPath, controllalo con il linter, esportalo o esegui codice dei plugin Figma con eval. Il server MCP offre agli agenti le stesse possibilità tramite stdio o HTTP.',+ hint: 'Esegui un comando e osserva la tela.'+ },+ sdk: {+ title: 'Integralo nel tuo prodotto',+ detail:+ 'OpenPencil è tanto un insieme di strumenti quanto un’app: un motore indipendente dal framework, un SDK Vue headless e pacchetti separati per il grafo di scena e i formati di file. Incorpora una tela nel tuo prodotto, genera e controlla i design in CI oppure costruisci un altro editor sullo stesso motore. Ogni tela di questa pagina è quell’SDK in esecuzione dentro un sito di documentazione.',+ hint: 'Il codice accanto alla tela è tutto ciò che serve per montarne una.'+ }+ },+ agents: {+ heading: 'Funziona con',+ rest: 'e qualsiasi client MCP'+ },+ commands: {+ cli: '{count} comandi',+ mcp: '{count} strumenti MCP',+ mcpDetail:+ 'Creare, applicare stili, impaginare, ispezionare ed esportare. Ognuno è disponibile anche per l’agente integrato.'+ },+ ownership: {+ title: 'I tuoi file restano tuoi',+ items: [+ {+ title: 'Prima in locale',+ detail:+ 'I documenti sono file sul tuo disco. Nessun account, nessun server, nessuna connessione necessaria.'+ },+ {+ title: 'Il tuo spazio di archiviazione',+ detail: 'Sincronizza tramite il tuo bucket compatibile con S3 quando ti serve.'+ },+ {+ title: 'Formati aperti',+ detail: 'Esporta in .fig, PDF, PPTX, SVG, HTML e JSX. Andarsene è sempre possibile.'+ },+ {+ title: 'Licenza MIT',+ detail: 'L’editor, il motore di rendering, il codec .fig e la CLI.'+ }+ ]+ },+ roadmap: {+ title: 'Roadmap',+ more: 'Roadmap completa',+ shipped: {+ label: 'Rilasciato',+ entries: [+ { title: 'Componenti interattivi e anteprima' },+ { title: 'Variabili come design token' },+ { title: 'Linting con correzioni in un clic' },+ { title: 'Agenti AI come collaboratori, con modalità segui' },+ { title: 'Annulla, rigenera e modifica i turni dell’AI' },+ { title: 'Codice collegato ai livelli' },+ { title: 'Diff visivo e patch' },+ { title: 'Commenti e chiamate vocali nelle stanze condivise' },+ { title: 'Componenti Vue e React nella scheda Codice' },+ { title: 'Importazione di SVG e HTML come livelli modificabili' },+ { title: 'Riempimenti con shader' },+ { title: 'Design token W3C' },+ { title: 'Un tour guidato dell’editor' },+ { title: 'Elenchi e stili per qualsiasi porzione di testo' }+ ]+ },+ now: {+ label: 'Ora',+ entries: [+ {+ title: 'Storybook da componenti reali',+ detail: 'Storie che usano Reka UI per Vue e Radix UI per React.'+ },+ {+ title: 'Creazione di componenti',+ detail: 'Modifica delle varianti più rapida e selezione dentro i componenti.'+ }+ ]+ },+ next: {+ label: 'Poi',+ lead: {+ title: 'OpenPencil self-hosted',+ detail:+ 'L’intero spazio di lavoro dentro la tua rete: sincronizzazione, condivisione, commenti e librerie di team senza inviare un file a nessun altro.',+ features: [+ {+ title: 'Il tuo spazio di archiviazione',+ detail: 'I documenti restano nel tuo bucket, nella tua regione.'+ },+ {+ title: 'La tua identità',+ detail: 'Accesso tramite il tuo provider OIDC o SSO, con ruoli.'+ },+ {+ title: 'La tua rete',+ detail: 'Un relay di collaborazione che funziona dietro il tuo firewall.'+ },+ {+ title: 'La tua gestione',+ detail: 'Distribuzione guidata, aggiornamenti, backup e conservazione.'+ }+ ]+ },+ entries: [+ {+ title: 'Cronologia delle versioni',+ detail: 'Istantanee automatiche, checkpoint con nome e ripristino.'+ }+ ],+ cloud: {+ title: 'OpenPencil Cloud',+ detail:+ 'Lo spazio ospitato per i team: sincronizzazione in diretta, condivisione, librerie e IA, senza nulla da gestire.'+ }+ },+ later: {+ label: 'Più avanti',+ entries: [+ {+ title: 'Design system governati',+ detail: 'Proporre, rivedere, pubblicare e migrare.'+ },+ {+ title: 'Editor incorporabile',+ detail: 'Porta l’editor di questa pagina nel tuo prodotto.'+ }+ ]+ }+ },+ cloud: {+ badge: 'Accesso anticipato',+ title: 'OpenPencil Cloud',+ lede: 'Lo spazio di design del tuo team, ospitato per te. Tutti modificano gli stessi file in diretta, li condividono con un link e progettano con l’IA, senza nulla da installare o gestire. I tuoi file restano aperti: esportali come .fig quando vuoi.',+ features: [+ {+ title: 'Sincronizzazione del team in tempo reale',+ detail:+ 'Ogni modifica raggiunge tutto il team nel momento in cui avviene, su qualsiasi dispositivo.'+ },+ {+ title: 'Link di condivisione e commenti',+ detail: 'Invia un link per rivedere un design e discuterne direttamente sulla tela.'+ },+ {+ title: 'Librerie del team',+ detail: 'Pubblica componenti, stili e token una volta e usali in ogni file.'+ },+ {+ title: 'IA ospitata',+ detail: 'Agenti che progettano con te, senza chiavi API da gestire.'+ },+ {+ title: 'SSO e controlli di amministrazione',+ detail: 'Single sign-on, ruoli e controllo su chi vede cosa.'+ }+ ]+ },+ waitlist: {+ label: 'Indirizzo email',+ placeholder: '[email protected]',+ submit: "Iscriviti alla lista d'attesa",+ confirmHuman: 'Conferma di essere umano',+ invalid: 'Inserisci un indirizzo email valido.',+ joined: 'Controlla la posta',+ joinedDetail: 'Apri il link che ti abbiamo inviato per confermare l’indirizzo.',+ failed: 'Impossibile raggiungere la lista d’attesa. Controlla la connessione e riprova.',+ privacy: 'Ti scriveremo solo riguardo a OpenPencil Cloud.',+ refused: 'Non siamo riusciti a confermare che non sei un bot. Riprova.',+ limited: 'Troppi tentativi. Riprova tra un minuto.',+ unavailable: 'Non puoi iscriverti da qui. Iscriviti su openpencil.dev.'+ },+ closing: {+ title: 'Porta i tuoi design con te.',+ download: 'Scarica OpenPencil',+ docs: 'Leggi la documentazione',+ cloud: "Iscriviti alla lista d'attesa di Cloud"+ },+ clipboard: {+ copy: 'Copia',+ copied: 'Copiato'+ },+ stage: {+ activate: 'Provalo dal vivo',+ terminal: {+ tree: 'Albero dei livelli',+ restyle: 'Ricolora l’accento',+ addPlayer: 'Aggiungi un lettore',+ selection: 'Selezione',+ export: 'Esporta in Tailwind'+ },+ ai: {+ recorded: 'Turno registrato',+ play: 'Riproduci',+ replay: 'Riproduci di nuovo',+ request: 'Aggiungi una coda «Up next» accanto al lettore.',+ reasoning:+ 'Il lettore è da solo nel frame dell’hero, che dispone i figli in riga, quindi una scheda aggiunta lì finisce proprio accanto. Collego sfondo, raggio e colori del testo della scheda alle variabili Theme usate dal lettore, così passa con lui da scuro a chiaro, ed elenco tre brani, ciascuno con una piccola copertina, un titolo e un artista.',+ reply:+ 'Ho aggiunto una scheda **Up next** accanto al lettore con tre brani. Colori e raggio vengono dalle variabili Theme, quindi segue il lettore tra scuro e chiaro.'+ },+ collab: {+ you: 'Tu',+ yourScreen: 'Il tuo schermo',+ theirScreen: 'Lo schermo di Sam',+ askAgent: 'Chiedi all’agente'+ },+ sdk: {+ install: 'Installa'+ }+ },+ download: {+ title: 'Scarica OpenPencil',+ lede: 'L’app desktop per macOS, Windows e Linux. Gratuita e open source, senza registrazione.',+ version: 'Versione {version}, pubblicata il {date}',+ forPlatform: 'Scarica per {platform}',+ moreFiles: 'Altri download per {platform}',+ releaseNotes: 'Note di rilascio',+ yourSystem: 'Il tuo sistema',+ arch: {+ appleSilicon: 'Apple Silicon',+ intel: 'Intel',+ x64: 'x64',+ arm: 'ARM'+ },+ formats: {+ dmg: 'Immagine disco',+ exe: 'Programma di installazione',+ msi: 'Per installazioni gestite',+ appimage: 'Funziona sulla maggior parte delle distribuzioni',+ deb: 'Debian, Ubuntu',+ rpm: 'Fedora, openSUSE'+ },+ requirements: 'Requisiti di sistema',+ allTitle: 'Tutti i download',+ checksums: 'Checksum SHA-256',+ onGitHub: 'Versione su GitHub',+ unavailable:+ 'Non è stato possibile caricare l’elenco dei download. Tutti i file sono nella pagina delle versioni su GitHub.',+ others: {+ title: 'Altri modi per averla',+ homebrew: {+ title: 'Homebrew',+ detail:+ 'L’app macOS firmata, dal cask ufficiale. Homebrew controlla ogni aggiornamento, quindi può arrivare un po’ più tardi che qui.'+ },+ web: {+ title: 'Nel browser',+ detail: 'Lo stesso editor su app.openpencil.dev, senza installare nulla.',+ action: 'Apri l’app web'+ },+ cli: {+ title: 'Riga di comando',+ detail: 'Ispeziona, esporta, controlla e automatizza file .fig senza aprire l’app.'+ },+ source: {+ title: 'Dai sorgenti',+ detail: 'Compila l’app da te con Bun e Rust.',+ action: 'Istruzioni di compilazione'+ }+ },+ beta: {+ badge: 'Beta',+ title: 'Prova quello che arriva',+ lede: 'Le beta portano in anticipo le funzioni della prossima versione, prima che arrivino a tutti.',+ caveats: [+ 'Un’app sulla versione stabile non si aggiorna a una beta; installa la beta per provarla.',+ 'Su Linux, rimuovi una beta installata con .deb o .rpm prima di installare la versione finale.',+ 'Le beta della CLI e dell’SDK sono su npm con il tag next.'+ ],+ notes: 'Novità'+ }+ }+}diff --git a/packages/docs/.vitepress/theme/landing/content/messages/pl.ts b/packages/docs/.vitepress/theme/landing/content/messages/pl.tsnew file mode 100644index 000000000..f3971027a--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/content/messages/pl.ts@@ -0,0 +1,340 @@+import type { LandingMessages } from './types'++export const pl: LandingMessages = {+ hero: {+ title: 'Projektuj bez uzależnienia od dostawcy.',+ lede: 'Edytor graficzny open source, który otwiera pliki Figmy, działa na Twoim komputerze i pozwala Tobie lub Twojemu agentowi AI sterować każdą warstwą.',+ open: 'Rozpocznij przewodnik',+ download: 'Pobierz',+ github: 'GitHub'+ },+ loading: 'Ładowanie edytora',+ features: {+ figma: {+ title: 'Otwórz to, co już masz',+ detail:+ 'OpenPencil czyta pliki .fig bezpośrednio: strony, komponenty, instancje, zmienne i auto layout trafiają jako edytowalne warstwy, a zapisać możesz znowu do .fig. Wklej SVG albo otwórz HTML i CSS, a one też stają się warstwami, ułożonymi tak, jak układa je przeglądarka.',+ hint: 'To przewodnik samej aplikacji, prawdziwy plik .fig. Otwórz rozdział w warstwach i poklikaj.'+ },+ design: {+ title: 'Projektuj prawdziwymi narzędziami',+ detail:+ 'Auto layout, ograniczenia, wypełnienia, obrysy, efekty i typografia, z kontrolkami tam, gdzie ich szukasz. Komponenty mają sloty: instancja zachowuje projekt i wnosi własną treść. Wszystko da się cofnąć i nic nie czeka na serwer.',+ hint: 'Najedź na zaznaczoną okładkę i przeciągnij róg, aby go zaokrąglić. Pozostałe odtwarzacze wnoszą własne okładki przez slot Artwork.'+ },+ interactive: {+ title: 'Komponenty, które działają',+ detail:+ 'Nadaj komponentowi zachowanie, na przykład przełącznika, pola wyboru, suwaka, kart lub pola tekstowego, a podgląd uruchomi go jako prawdziwą kontrolkę Reka UI. Warianty stają się jego stanami, a te same komponenty eksportują się do Storybooka z klikalnymi kontrolkami.',+ hint: 'To płótno jest w podglądzie: naciśnij play, przeciągnij pasek postępu, włącz losowanie. Wyjdź z podglądu, by edytować.'+ },+ tokens: {+ title: 'Zmienne to tokeny projektowe',+ detail:+ 'Kolory, odstępy i typografia żyją w kolekcjach z trybami i edytuje się je jako tokeny. Wyeksportowany kod zapisuje powiązane wartości jako niestandardowe właściwości CSS, więc kod używa tych samych nazw co projekt.',+ hint: 'Każdy odtwarzacz czyta kolekcję Theme we własnym trybie. Zmień wartość tokena, a oba podążą.'+ },+ shaders: {+ title: 'Wypełnienia, które się ruszają',+ detail:+ 'Shader to wypełnienie jak każde inne: wybierz go w selektorze wypełnień, nakładaj efekty, ustawiaj ich suwaki albo wklej preset z shaders.com. Pliki zachowują jego nieruchomą klatkę, więc otwierają się wszędzie, a podgląd go odtwarza.',+ hint: 'To płótno jest w podglądzie, dlatego shadery się ruszają. Wyjdź z podglądu, zaznacz kwadrat i otwórz jego wypełnienie.'+ },+ linting: {+ title: 'Linting',+ detail:+ 'OpenPencil sprawdza projekt w trakcie pracy: kontrast, zbyt mały tekst, domyślne nazwy, ukryte i puste warstwy, zbędne grupy. Problemy są oznaczane na obszarze roboczym, wiele z nich naprawisz jednym kliknięciem, a te same reguły działają w CLI i dla agentów.',+ hint: 'Kliknij znacznik na obszarze roboczym albo zastosuj poprawkę z listy.'+ },+ ai: {+ title: 'Projektuj z AI, na własnych kluczach',+ detail:+ 'Opisz zadanie zwykłym językiem, a agent edytuje dokument tymi samymi narzędziami co Ty i pokazuje efekty na obszarze roboczym już w trakcie generowania. Podłącz dowolnego dostawcę własnym kluczem albo użyj agenta programistycznego, z którego już korzystasz.',+ hint: 'Nagrana tura przechodzi przez prawdziwą pętlę agenta. Zobacz, jak obszar roboczy powstaje w trakcie strumieniowania.'+ },+ collab: {+ title: 'Współpraca ludzi i agentów',+ detail:+ 'Udostępnij link, a wszyscy edytują ten sam dokument, peer-to-peer, z kursorami na żywo, trybem śledzenia, komentarzami przypiętymi do warstw i rozmowami głosowymi. Agenci AI dołączają tak samo: wszyscy w pokoju widzą, jak budują, gdy strumieniują.',+ hint: 'Oba ekrany są Twoje. Przeciągnij warstwę na jednym i zobacz, jak przesuwa się na drugim, a potem poproś agenta.'+ },+ code: {+ title: 'Od projektu do kodu',+ detail:+ 'Każde zaznaczenie to komponent Vue lub React, z wariantami jako propsami i Reka UI lub Radix za tymi interaktywnymi, albo HTML, Tailwind i design JSX ze zmiennymi zapisanymi jako tokeny. Komponenty eksportują się jako historie Storybooka, a design JSX pozostaje powiązany z płótnem: edytuj go, a płótno podąży.',+ hint: 'Przełącz na React, HTML lub design JSX albo zaznacz inną warstwę.'+ },+ script: {+ title: 'Wszystko da się oskryptować',+ detail:+ 'CLI openpencil pracuje na pliku bez uruchomionej aplikacji albo steruje otwartą aplikacją. Przejrzyj dokument, odpytaj go przez XPath, sprawdź linterem, wyeksportuj albo uruchom na nim kod wtyczek Figmy przez eval. Serwer MCP daje agentom te same możliwości przez stdio lub HTTP.',+ hint: 'Uruchom polecenie i obserwuj obszar roboczy.'+ },+ sdk: {+ title: 'Wbuduj go we własny produkt',+ detail:+ 'OpenPencil to nie tylko aplikacja, ale też zestaw narzędzi: silnik niezależny od frameworka, SDK Vue bez interfejsu oraz osobne pakiety dla grafu sceny i formatów plików. Osadź obszar roboczy w swoim produkcie, renderuj i sprawdzaj projekty w CI albo zbuduj inny edytor na tym samym silniku. Każdy obszar roboczy na tej stronie to właśnie to SDK działające w witrynie z dokumentacją.',+ hint: 'Kod obok obszaru roboczego wystarczy, żeby go zamontować.'+ }+ },+ agents: {+ heading: 'Działa z',+ rest: 'i każdym klientem MCP'+ },+ commands: {+ cli: 'Polecenia CLI: {count}',+ mcp: 'Narzędzia MCP: {count}',+ mcpDetail:+ 'Tworzenie, stylowanie, układ, inspekcja i eksport. Każde z nich jest też dostępne dla wbudowanego agenta.'+ },+ ownership: {+ title: 'Twoje pliki pozostają Twoje',+ items: [+ {+ title: 'Najpierw lokalnie',+ detail:+ 'Dokumenty to pliki na Twoim dysku. Bez konta, bez serwera, bez dostępu do internetu.'+ },+ {+ title: 'Twoja pamięć masowa',+ detail: 'Synchronizuj przez własny zasobnik zgodny z S3, kiedy tego potrzebujesz.'+ },+ {+ title: 'Otwarte formaty',+ detail: 'Eksport do .fig, PDF, PPTX, SVG, HTML i JSX. Zawsze możesz odejść.'+ },+ {+ title: 'Licencja MIT',+ detail: 'Edytor, silnik renderujący, kodek .fig i CLI.'+ }+ ]+ },+ roadmap: {+ title: 'Plan rozwoju',+ more: 'Pełny plan rozwoju',+ shipped: {+ label: 'Wydane',+ entries: [+ { title: 'Interaktywne komponenty i podgląd' },+ { title: 'Zmienne jako tokeny projektowe' },+ { title: 'Linting z poprawkami jednym kliknięciem' },+ { title: 'Agenci AI jako współpracownicy, z trybem śledzenia' },+ { title: 'Cofanie, ponowne generowanie i edycja tur AI' },+ { title: 'Kod powiązany z warstwami' },+ { title: 'Wizualny diff i łatki' },+ { title: 'Komentarze i rozmowy głosowe we wspólnych pokojach' },+ { title: 'Komponenty Vue i React w karcie Kod' },+ { title: 'Import SVG i HTML jako edytowalnych warstw' },+ { title: 'Wypełnienia shaderami' },+ { title: 'Design tokeny W3C' },+ { title: 'Przewodnik po edytorze' },+ { title: 'Listy i style dla dowolnego fragmentu tekstu' }+ ]+ },+ now: {+ label: 'Teraz',+ entries: [+ {+ title: 'Storybook z prawdziwych komponentów',+ detail: 'Historie korzystające z Reka UI dla Vue i Radix UI dla React.'+ },+ {+ title: 'Tworzenie komponentów',+ detail: 'Szybsza edycja wariantów i zaznaczanie wewnątrz komponentów.'+ }+ ]+ },+ next: {+ label: 'Następnie',+ lead: {+ title: 'OpenPencil na własnym serwerze',+ detail:+ 'Cała przestrzeń robocza we własnej sieci: synchronizacja, udostępnianie, komentarze i biblioteki zespołu bez wysyłania pliku komukolwiek innemu.',+ features: [+ {+ title: 'Twoja pamięć masowa',+ detail: 'Dokumenty pozostają w Twoim zasobniku, w Twoim regionie.'+ },+ {+ title: 'Twoja tożsamość',+ detail: 'Logowanie przez Twojego dostawcę OIDC lub SSO, z rolami.'+ },+ {+ title: 'Twoja sieć',+ detail: 'Przekaźnik współpracy, który działa za Twoją zaporą.'+ },+ {+ title: 'Twoje utrzymanie',+ detail: 'Wdrożenie z przewodnikiem, aktualizacje, kopie zapasowe i retencja.'+ }+ ]+ },+ entries: [+ {+ title: 'Historia wersji',+ detail: 'Automatyczne migawki, nazwane punkty kontrolne i przywracanie.'+ }+ ],+ cloud: {+ title: 'OpenPencil Cloud',+ detail:+ 'Hostowana przestrzeń dla zespołów: synchronizacja na żywo, udostępnianie, biblioteki i AI, bez utrzymywania czegokolwiek.'+ }+ },+ later: {+ label: 'Później',+ entries: [+ {+ title: 'Zarządzane systemy projektowe',+ detail: 'Proponowanie, przegląd, publikacja i migracja.'+ },+ {+ title: 'Edytor do osadzenia',+ detail: 'Przenieś edytor z tej strony do własnego produktu.'+ }+ ]+ }+ },+ cloud: {+ badge: 'Wczesny dostęp',+ title: 'OpenPencil Cloud',+ lede: 'Przestrzeń projektowa Twojego zespołu, hostowana za Ciebie. Wszyscy edytują te same pliki na żywo, udostępniają je linkiem i projektują z AI, bez instalowania i utrzymywania czegokolwiek. Pliki pozostają otwarte: eksportuj je do .fig, kiedy chcesz.',+ features: [+ {+ title: 'Synchronizacja zespołu w czasie rzeczywistym',+ detail: 'Każda zmiana od razu trafia do całego zespołu, na każdym urządzeniu.'+ },+ {+ title: 'Linki i komentarze',+ detail: 'Wyślij link do przeglądu projektu i omawiajcie go bezpośrednio na płótnie.'+ },+ {+ title: 'Biblioteki zespołu',+ detail: 'Opublikuj komponenty, style i tokeny raz i używaj ich w każdym pliku.'+ },+ {+ title: 'Hostowane AI',+ detail: 'Agenci, którzy projektują z Tobą, bez zarządzania kluczami API.'+ },+ {+ title: 'SSO i kontrola administracyjna',+ detail: 'Logowanie jednokrotne, role i kontrola nad tym, kto co widzi.'+ }+ ]+ },+ waitlist: {+ label: 'Adres e-mail',+ placeholder: '[email protected]',+ submit: 'Zapisz się na listę',+ confirmHuman: 'Potwierdź, że jesteś człowiekiem',+ invalid: 'Wpisz poprawny adres e-mail.',+ joined: 'Sprawdź skrzynkę',+ joinedDetail: 'Otwórz link, który wysłaliśmy, aby potwierdzić adres.',+ failed: 'Nie udało się połączyć z listą oczekujących. Sprawdź połączenie i spróbuj ponownie.',+ privacy: 'Piszemy tylko w sprawie OpenPencil Cloud.',+ refused: 'Nie udało się potwierdzić, że nie jesteś botem. Spróbuj ponownie.',+ limited: 'Zbyt wiele prób. Spróbuj ponownie za minutę.',+ unavailable: 'Stąd nie można się zapisać. Zapisz się na openpencil.dev.'+ },+ closing: {+ title: 'Zabierz swoje projekty ze sobą.',+ download: 'Pobierz OpenPencil',+ docs: 'Czytaj dokumentację',+ cloud: 'Zapisz się na listę Cloud'+ },+ clipboard: {+ copy: 'Kopiuj',+ copied: 'Skopiowano'+ },+ stage: {+ activate: 'Wypróbuj na żywo',+ terminal: {+ tree: 'Drzewo warstw',+ restyle: 'Zmień kolor akcentu',+ addPlayer: 'Dodaj odtwarzacz',+ selection: 'Zaznaczenie',+ export: 'Eksport do Tailwind'+ },+ ai: {+ recorded: 'Nagrana tura',+ play: 'Odtwórz',+ replay: 'Odtwórz ponownie',+ request: 'Dodaj obok odtwarzacza kolejkę „Up next”.',+ reasoning:+ 'Odtwarzacz stoi sam w ramce hero, która układa dzieci w rzędzie, więc dodana tam karta trafi tuż obok. Powiążę tło, promień i kolory tekstu karty ze zmiennymi Theme, których używa odtwarzacz, żeby przełączała się razem z nim między ciemnym a jasnym, i wypiszę trzy utwory, każdy z małą okładką, tytułem i wykonawcą.',+ reply:+ 'Obok odtwarzacza jest teraz karta **Up next** z trzema utworami. Kolory i promień pochodzą ze zmiennych Theme, więc podąża za odtwarzaczem między ciemnym a jasnym.'+ },+ collab: {+ you: 'Ty',+ yourScreen: 'Twój ekran',+ theirScreen: 'Ekran Sama',+ askAgent: 'Poproś agenta'+ },+ sdk: {+ install: 'Instalacja'+ }+ },+ download: {+ title: 'Pobierz OpenPencil',+ lede: 'Aplikacja desktopowa na macOS, Windows i Linux. Darmowa i otwartoźródłowa, bez rejestracji.',+ version: 'Wersja {version}, wydana {date}',+ forPlatform: 'Pobierz na {platform}',+ moreFiles: 'Więcej plików dla {platform}',+ releaseNotes: 'Informacje o wydaniu',+ yourSystem: 'Twój system',+ arch: {+ appleSilicon: 'Apple Silicon',+ intel: 'Intel',+ x64: 'x64',+ arm: 'ARM'+ },+ formats: {+ dmg: 'Obraz dysku',+ exe: 'Instalator',+ msi: 'Do instalacji zarządzanych',+ appimage: 'Działa na większości dystrybucji',+ deb: 'Debian, Ubuntu',+ rpm: 'Fedora, openSUSE'+ },+ requirements: 'Wymagania systemowe',+ allTitle: 'Wszystkie pliki',+ checksums: 'Sumy kontrolne SHA-256',+ onGitHub: 'Wydanie na GitHubie',+ unavailable:+ 'Nie udało się wczytać listy plików. Wszystkie pliki są na stronie wydań na GitHubie.',+ others: {+ title: 'Inne sposoby',+ homebrew: {+ title: 'Homebrew',+ detail:+ 'Podpisana aplikacja na macOS z oficjalnego casku. Homebrew sprawdza każdą aktualizację, więc może trafić tam nieco później niż tutaj.'+ },+ web: {+ title: 'W przeglądarce',+ detail: 'Ten sam edytor na app.openpencil.dev, bez instalacji.',+ action: 'Otwórz aplikację webową'+ },+ cli: {+ title: 'Wiersz poleceń',+ detail: 'Przeglądaj, eksportuj, sprawdzaj i skryptuj pliki .fig bez otwierania aplikacji.'+ },+ source: {+ title: 'Ze źródeł',+ detail: 'Zbuduj aplikację samodzielnie z Bun i Rust.',+ action: 'Instrukcja budowania'+ }+ },+ beta: {+ badge: 'Beta',+ title: 'Wypróbuj to, co nadchodzi',+ lede: 'Bety dają wcześniej funkcje następnej wersji, zanim trafią do wszystkich.',+ caveats: [+ 'Aplikacja w wersji stabilnej nie aktualizuje się do bety; zainstaluj betę, aby ją wypróbować.',+ 'Na Linuksie usuń betę zainstalowaną z .deb lub .rpm przed instalacją wersji finalnej.',+ 'Bety CLI i SDK są w npm pod tagiem next.'+ ],+ notes: 'Co nowego'+ }+ }+}diff --git a/packages/docs/.vitepress/theme/landing/content/messages/ru.ts b/packages/docs/.vitepress/theme/landing/content/messages/ru.tsnew file mode 100644index 000000000..77ea05c41--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/content/messages/ru.ts@@ -0,0 +1,340 @@+import type { LandingMessages } from './types'++export const ru: LandingMessages = {+ hero: {+ title: 'Дизайн без привязки к вендору.',+ lede: 'Графический редактор с открытым исходным кодом: открывает файлы Figma, работает на вашем компьютере и позволяет вам или вашему ИИ-агенту управлять каждым слоем.',+ open: 'Пройти тур',+ download: 'Скачать',+ github: 'GitHub'+ },+ loading: 'Загрузка редактора',+ features: {+ figma: {+ title: 'Открывайте то, что у вас уже есть',+ detail:+ 'OpenPencil читает файлы .fig напрямую: страницы, компоненты, экземпляры, переменные и автораскладка приходят как редактируемые слои, а сохранить можно снова в .fig. Вставьте SVG или откройте HTML и CSS — они тоже станут слоями, расположенными так, как их располагает браузер.',+ hint: 'Это собственный тур приложения — настоящий файл .fig. Откройте главу в слоях и пощёлкайте.'+ },+ design: {+ title: 'Настоящие инструменты дизайна',+ detail:+ 'Автораскладка, ограничения, заливки, обводки, эффекты и типографика — с настройками там, где вы их ждёте. У компонентов есть слоты: экземпляр сохраняет дизайн и приносит своё содержимое. Всё отменяется, и ничто не ждёт сервера.',+ hint: 'Наведите курсор на выделенную обложку и потяните за угол, чтобы скруглить его. Остальные плееры приносят свои обложки через слот Artwork.'+ },+ interactive: {+ title: 'Компоненты, которые работают',+ detail:+ 'Задайте компоненту поведение — переключатель, чекбокс, слайдер, вкладки или текстовое поле, — и превью запустит его как настоящий элемент Reka UI. Варианты становятся его состояниями, а те же компоненты экспортируются в Storybook с кликабельными контролами.',+ hint: 'Этот холст в режиме просмотра: нажмите play, потяните прогресс, включите перемешивание. Выйдите из просмотра, чтобы редактировать.'+ },+ tokens: {+ title: 'Переменные — это дизайн-токены',+ detail:+ 'Цвета, отступы и шрифты хранятся в коллекциях с режимами и редактируются как токены. Экспортированный код записывает привязанные значения как CSS-переменные, поэтому в коде те же имена, что и в дизайне.',+ hint: 'Каждый плеер читает коллекцию Theme в своём режиме. Измените значение токена — и оба последуют.'+ },+ shaders: {+ title: 'Заливки, которые движутся',+ detail:+ 'Шейдер — такая же заливка, как любая другая: выберите его в палитре заливок, складывайте эффекты, крутите их ползунки или вставьте пресет с shaders.com. Файлы хранят его неподвижный кадр, поэтому открываются где угодно, а в режиме просмотра он играет.',+ hint: 'Этот холст в режиме просмотра, поэтому шейдеры движутся. Выйдите из просмотра, выделите квадрат и откройте его заливку.'+ },+ linting: {+ title: 'Линтинг',+ detail:+ 'OpenPencil проверяет макет по ходу работы: контраст, слишком мелкий текст, имена по умолчанию, скрытые и пустые слои, лишние группы. Проблемы отмечаются на холсте, многие исправляются в один клик, а те же правила работают в CLI и для агентов.',+ hint: 'Щёлкните метку на холсте или примените исправление из списка.'+ },+ ai: {+ title: 'Дизайн с ИИ на ваших ключах',+ detail:+ 'Опишите задачу обычным языком, и агент отредактирует документ теми же инструментами, что и вы, показывая результат на холсте прямо по ходу генерации. Подключите любого провайдера со своим ключом или используйте привычного агента для программирования.',+ hint: 'Записанный диалог проходит через настоящий цикл агента. Смотрите, как холст собирается по ходу генерации.'+ },+ collab: {+ title: 'Работайте вместе — с людьми и агентами',+ detail:+ 'Поделитесь ссылкой — и все редактируют один документ, напрямую между участниками, с живыми курсорами, режимом следования, комментариями, прикреплёнными к слоям, и голосовыми звонками. ИИ-агенты подключаются так же: все в комнате видят, как они строят, пока идёт поток.',+ hint: 'Оба экрана ваши. Перетащите слой на одном и посмотрите, как он движется на другом, а потом попросите агента.'+ },+ code: {+ title: 'От дизайна к коду',+ detail:+ 'Любое выделение — это компонент Vue или React, с вариантами в виде props и Reka UI или Radix за интерактивными, либо HTML, Tailwind и design JSX с переменными в виде токенов. Компоненты экспортируются как истории Storybook, а design JSX остаётся связанным с холстом: измените его — и холст последует.',+ hint: 'Переключитесь на React, HTML или design JSX либо выделите другой слой.'+ },+ script: {+ title: 'Автоматизируйте всё',+ detail:+ 'CLI openpencil работает с файлом без запущенного приложения или управляет открытым приложением. Изучайте документ, делайте запросы через XPath, проверяйте линтером, экспортируйте или выполняйте код плагинов Figma через eval. Сервер MCP даёт агентам те же возможности через stdio или HTTP.',+ hint: 'Запустите команду и следите за холстом.'+ },+ sdk: {+ title: 'Встройте в свой продукт',+ detail:+ 'OpenPencil — это не только приложение, но и набор инструментов: движок, не зависящий от фреймворка, headless Vue SDK и отдельные пакеты для графа сцены и форматов файлов. Встройте холст в свой продукт, рендерите и проверяйте макеты в CI или соберите другой редактор на том же движке. Каждый холст на этой странице — это тот самый SDK, работающий внутри сайта документации.',+ hint: 'Кода рядом с холстом достаточно, чтобы подключить такой же.'+ }+ },+ agents: {+ heading: 'Работает с',+ rest: 'и любым MCP-клиентом'+ },+ commands: {+ cli: 'Команд CLI: {count}',+ mcp: 'Инструментов MCP: {count}',+ mcpDetail:+ 'Создание, стилизация, раскладка, инспекция и экспорт. Каждый инструмент доступен и встроенному агенту.'+ },+ ownership: {+ title: 'Ваши файлы остаются вашими',+ items: [+ {+ title: 'Сначала локально',+ detail: 'Документы — это файлы на вашем диске. Без аккаунта, без сервера, без интернета.'+ },+ {+ title: 'Ваше хранилище',+ detail: 'Синхронизируйте через собственный S3-совместимый бакет, когда это нужно.'+ },+ {+ title: 'Открытые форматы',+ detail: 'Экспорт в .fig, PDF, PPTX, SVG, HTML и JSX. Уйти можно в любой момент.'+ },+ {+ title: 'Лицензия MIT',+ detail: 'Редактор, движок рендеринга, кодек .fig и CLI.'+ }+ ]+ },+ roadmap: {+ title: 'Планы',+ more: 'Полный план развития',+ shipped: {+ label: 'Выпущено',+ entries: [+ { title: 'Интерактивные компоненты и превью' },+ { title: 'Переменные как дизайн-токены' },+ { title: 'Линтинг с исправлением в один клик' },+ { title: 'ИИ-агенты как участники, с режимом следования' },+ { title: 'Отмена, повторная генерация и правка ходов ИИ' },+ { title: 'Код, связанный со слоями' },+ { title: 'Визуальный diff и патчи' },+ { title: 'Комментарии и голосовые звонки в общих комнатах' },+ { title: 'Компоненты Vue и React во вкладке «Код»' },+ { title: 'Импорт SVG и HTML как редактируемых слоёв' },+ { title: 'Заливки шейдерами' },+ { title: 'Дизайн-токены W3C' },+ { title: 'Тур по редактору' },+ { title: 'Списки и стили для любого фрагмента текста' }+ ]+ },+ now: {+ label: 'Сейчас',+ entries: [+ {+ title: 'Storybook из настоящих компонентов',+ detail: 'Истории на Reka UI для Vue и Radix UI для React.'+ },+ {+ title: 'Создание компонентов',+ detail: 'Быстрее правка вариантов и выделение внутри компонентов.'+ }+ ]+ },+ next: {+ label: 'Далее',+ lead: {+ title: 'OpenPencil на своём сервере',+ detail:+ 'Всё рабочее пространство внутри вашей сети: синхронизация, совместный доступ, комментарии и командные библиотеки без отправки файлов кому-либо ещё.',+ features: [+ {+ title: 'Ваше хранилище',+ detail: 'Документы остаются в вашем бакете, в вашем регионе.'+ },+ {+ title: 'Ваша авторизация',+ detail: 'Вход через вашего провайдера OIDC или SSO, с ролями.'+ },+ {+ title: 'Ваша сеть',+ detail: 'Ретранслятор совместной работы, который работает за вашим файрволом.'+ },+ {+ title: 'Ваше сопровождение',+ detail: 'Пошаговое развёртывание, обновления, резервные копии и сроки хранения.'+ }+ ]+ },+ entries: [+ {+ title: 'История версий',+ detail: 'Автоматические снимки, именованные контрольные точки и восстановление.'+ }+ ],+ cloud: {+ title: 'OpenPencil Cloud',+ detail:+ 'Облачное пространство для команд: синхронизация в реальном времени, общий доступ, библиотеки и ИИ без своей инфраструктуры.'+ }+ },+ later: {+ label: 'Позже',+ entries: [+ {+ title: 'Управляемые дизайн-системы',+ detail: 'Предложение, ревью, публикация и миграция.'+ },+ {+ title: 'Встраиваемый редактор',+ detail: 'Перенесите редактор с этой страницы в свой продукт.'+ }+ ]+ }+ },+ cloud: {+ badge: 'Ранний доступ',+ title: 'OpenPencil Cloud',+ lede: 'Рабочее пространство вашей команды, которое мы размещаем за вас. Все редактируют одни и те же файлы в реальном времени, делятся ими по ссылке и проектируют вместе с ИИ — ничего не нужно устанавливать и поддерживать. Файлы остаются открытыми: экспортируйте их в .fig когда угодно.',+ features: [+ {+ title: 'Синхронизация команды в реальном времени',+ detail: 'Каждое изменение сразу видят все участники, на любом устройстве.'+ },+ {+ title: 'Ссылки и комментарии',+ detail: 'Отправьте ссылку на ревью и обсуждайте макет прямо на холсте.'+ },+ {+ title: 'Командные библиотеки',+ detail: 'Публикуйте компоненты, стили и токены один раз и используйте их в любом файле.'+ },+ {+ title: 'ИИ без своих ключей',+ detail: 'Агенты проектируют вместе с вами, без управления API-ключами.'+ },+ {+ title: 'SSO и администрирование',+ detail: 'Единый вход, роли и контроль над тем, кто что видит.'+ }+ ]+ },+ waitlist: {+ label: 'Электронная почта',+ placeholder: '[email protected]',+ submit: 'Записаться',+ confirmHuman: 'Подтвердите, что вы человек',+ invalid: 'Введите корректный адрес электронной почты.',+ joined: 'Проверьте почту',+ joinedDetail: 'Откройте ссылку из письма, чтобы подтвердить адрес.',+ failed: 'Не удалось связаться с листом ожидания. Проверьте подключение и попробуйте ещё раз.',+ privacy: 'Мы пишем только об OpenPencil Cloud.',+ refused: 'Не удалось подтвердить, что вы не бот. Попробуйте ещё раз.',+ limited: 'Слишком много попыток. Попробуйте через минуту.',+ unavailable: 'Отсюда записаться нельзя. Запишитесь на openpencil.dev.'+ },+ closing: {+ title: 'Заберите свои макеты с собой.',+ download: 'Скачать OpenPencil',+ docs: 'Читать документацию',+ cloud: 'Записаться в лист ожидания Cloud'+ },+ clipboard: {+ copy: 'Копировать',+ copied: 'Скопировано'+ },+ stage: {+ activate: 'Попробовать вживую',+ terminal: {+ tree: 'Дерево слоёв',+ restyle: 'Перекрасить акцент',+ addPlayer: 'Добавить плеер',+ selection: 'Выделение',+ export: 'Экспорт в Tailwind'+ },+ ai: {+ recorded: 'Записанный диалог',+ play: 'Запустить',+ replay: 'Повторить',+ request: 'Добавь рядом с плеером очередь «Up next».',+ reasoning:+ 'Плеер стоит один во фрейме hero, который выстраивает детей в ряд, поэтому карточка, добавленная туда, окажется прямо рядом. Привяжу фон, скругление и цвета текста карточки к переменным Theme, которые использует плеер, чтобы она переключалась вместе с ним между тёмной и светлой темой, и перечислю три трека, у каждого — маленькая обложка, название и исполнитель.',+ reply:+ 'Рядом с плеером появилась карточка **Up next** с тремя треками. Цвета и скругление берутся из переменных Theme, так что она следует за плеером между тёмной и светлой темой.'+ },+ collab: {+ you: 'Вы',+ yourScreen: 'Ваш экран',+ theirScreen: 'Экран Сэма',+ askAgent: 'Попросить агента'+ },+ sdk: {+ install: 'Установка'+ }+ },+ download: {+ title: 'Скачать OpenPencil',+ lede: 'Настольное приложение для macOS, Windows и Linux. Бесплатное и с открытым кодом, без регистрации.',+ version: 'Версия {version}, вышла {date}',+ forPlatform: 'Скачать для {platform}',+ moreFiles: 'Другие загрузки для {platform}',+ releaseNotes: 'Заметки о выпуске',+ yourSystem: 'Ваша система',+ arch: {+ appleSilicon: 'Apple Silicon',+ intel: 'Intel',+ x64: 'x64',+ arm: 'ARM'+ },+ formats: {+ dmg: 'Образ диска',+ exe: 'Установщик',+ msi: 'Для управляемой установки',+ appimage: 'Работает в большинстве дистрибутивов',+ deb: 'Debian, Ubuntu',+ rpm: 'Fedora, openSUSE'+ },+ requirements: 'Системные требования',+ allTitle: 'Все загрузки',+ checksums: 'Контрольные суммы SHA-256',+ onGitHub: 'Релиз на GitHub',+ unavailable:+ 'Не удалось загрузить список файлов. Все файлы есть на странице релизов на GitHub.',+ others: {+ title: 'Другие способы',+ homebrew: {+ title: 'Homebrew',+ detail:+ 'Подписанное приложение для macOS из официального cask. Homebrew проверяет каждое обновление, поэтому оно может прийти чуть позже, чем здесь.'+ },+ web: {+ title: 'В браузере',+ detail: 'Тот же редактор на app.openpencil.dev, без установки.',+ action: 'Открыть веб-приложение'+ },+ cli: {+ title: 'Командная строка',+ detail:+ 'Просматривайте, экспортируйте, проверяйте и автоматизируйте файлы .fig, не открывая приложение.'+ },+ source: {+ title: 'Из исходников',+ detail: 'Соберите приложение сами с помощью Bun и Rust.',+ action: 'Инструкция по сборке'+ }+ },+ beta: {+ badge: 'Бета',+ title: 'Попробуйте то, что будет дальше',+ lede: 'Беты дают функции следующей версии раньше, чем они дойдут до всех.',+ caveats: [+ 'Приложение на стабильной версии не обновляется до беты; установите бету, чтобы попробовать её.',+ 'В Linux удалите бету, установленную из .deb или .rpm, перед установкой финальной версии.',+ 'Беты CLI и SDK лежат в npm под тегом next.'+ ],+ notes: 'Что нового'+ }+ }+}diff --git a/packages/docs/.vitepress/theme/landing/content/messages/types.ts b/packages/docs/.vitepress/theme/landing/content/messages/types.tsnew file mode 100644index 000000000..9c22be519--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/content/messages/types.ts@@ -0,0 +1,165 @@+import type { FileFormat } from '#docs/theme/landing/download/releases'++import type { FeatureKind } from '../features'++export interface TitledDetail {+ title: string+ detail: string+}++export interface RoadmapEntryMessages {+ title: string+ detail?: string+}++/**+ * Everything the landing page says. English (`en.ts`) is the source; every other catalog is+ * typed against this interface, so a missing or extra string fails type-checking.+ */+export interface LandingMessages {+ hero: {+ title: string+ lede: string+ open: string+ download: string+ github: string+ }+ /** Accessible label of the placeholder shown before the editor code arrives. */+ loading: string+ features: Record<FeatureKind, TitledDetail & { hint: string }>+ agents: {+ heading: string+ /** Closes the list of named agents. */+ rest: string+ }+ commands: {+ /** `{count}` is replaced with the number of CLI commands. */+ cli: string+ /** `{count}` is replaced with the number of MCP tools. */+ mcp: string+ mcpDetail: string+ }+ ownership: {+ title: string+ items: TitledDetail[]+ }+ roadmap: {+ title: string+ more: string+ shipped: { label: string; entries: RoadmapEntryMessages[] }+ now: { label: string; entries: RoadmapEntryMessages[] }+ next: {+ label: string+ /** The entry presented as a feature block of its own. */+ lead: TitledDetail & { features: TitledDetail[] }+ entries: RoadmapEntryMessages[]+ /** OpenPencil Cloud, after self-hosting, with the waitlist form under it. */+ cloud: TitledDetail+ }+ later: { label: string; entries: RoadmapEntryMessages[] }+ }+ /** The hosted product, with its waitlist. */+ cloud: {+ badge: string+ title: string+ lede: string+ features: TitledDetail[]+ }+ /** The OpenPencil Cloud waitlist form, in the Cloud section and the roadmap. */+ waitlist: {+ /** Accessible name of the email field. */+ label: string+ placeholder: string+ submit: string+ /** The button while a sign-up waits on the visitor to tick Turnstile's check. */+ confirmHuman: string+ invalid: string+ joined: string+ joinedDetail: string+ /** The service could not be reached, or failed. */+ failed: string+ privacy: string+ /** Turnstile did not confirm a person. */+ refused: string+ /** Too many sign-ups from one place in a minute. */+ limited: string+ /** Turnstile cannot run on this page, such as a preview or local build. */+ unavailable: string+ }+ closing: {+ title: string+ download: string+ docs: string+ /** Links to the Cloud section's waitlist. */+ cloud: string+ }+ /** A copy button's label, and what it says once it copied. */+ clipboard: {+ copy: string+ copied: string+ }+ /** Strings shown inside the live stages, next to the app's own translated panels. */+ stage: {+ /** Starts a stage from its still on a touch screen, where stages wait to be asked. */+ activate: string+ terminal: Record<'tree' | 'restyle' | 'addPlayer' | 'selection' | 'export', string>+ ai: {+ recorded: string+ play: string+ replay: string+ request: string+ reasoning: string+ reply: string+ }+ collab: {+ /** How the visitor appears on the other screen. */+ you: string+ yourScreen: string+ /** The other screen, belonging to the teammate named Sam. */+ theirScreen: string+ askAgent: string+ }+ sdk: {+ /** Heads the install command under the snippet. */+ install: string+ }+ }+ /** The download page, which shares the landing's look and catalog. */+ download: {+ title: string+ lede: string+ /** `{version}` and `{date}` are replaced. */+ version: string+ /** The main button for the visitor's system; `{platform}` is replaced. */+ forPlatform: string+ /** Opens the menu of every installer for the platform; `{platform}` is replaced. */+ moreFiles: string+ releaseNotes: string+ /** Marks the visitor's platform in the list of downloads. */+ yourSystem: string+ arch: Record<'appleSilicon' | 'intel' | 'x64' | 'arm', string>+ /** What each kind of file is for. */+ formats: Record<FileFormat, string>+ requirements: string+ allTitle: string+ checksums: string+ onGitHub: string+ /** Shown when the site was built without the release list. */+ unavailable: string+ others: {+ title: string+ homebrew: TitledDetail+ web: TitledDetail & { action: string }+ cli: TitledDetail+ source: TitledDetail & { action: string }+ }+ beta: {+ badge: string+ title: string+ lede: string+ /** What to know before installing a beta. */+ caveats: string[]+ notes: string+ }+ }+}diff --git a/packages/docs/.vitepress/theme/landing/content/stats.data.ts b/packages/docs/.vitepress/theme/landing/content/stats.data.tsnew file mode 100644index 000000000..876dfa0eb--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/content/stats.data.ts@@ -0,0 +1,22 @@+import { COMMANDS } from '@open-pencil/cli/commands'+import { ALL_TOOLS, isToolExposed } from '@open-pencil/core/tools'++export interface LandingStats {+ /** Top-level `openpencil` commands, in alphabetical order. */+ cliCommands: string[]+ /** Tools the MCP server exposes. */+ mcpTools: number+}++declare const data: LandingStats+export { data }++/** Counted from the source at build time, so the page cannot drift from the product. */+export default {+ load(): LandingStats {+ return {+ cliCommands: Object.keys(COMMANDS).toSorted(),+ mcpTools: ALL_TOOLS.filter((tool) => isToolExposed(tool, 'mcp')).length+ }+ }+}diff --git a/packages/docs/.vitepress/theme/landing/download/BetaSection.vue b/packages/docs/.vitepress/theme/landing/download/BetaSection.vuenew file mode 100644index 000000000..548a6ce30--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/download/BetaSection.vue@@ -0,0 +1,149 @@+<script setup lang="ts">+import { useData } from 'vitepress'++import AppCollapsible from '@/components/ui/collapsible/AppCollapsible.vue'++import { useLandingMessages } from '../content/messages'+import { versionLine } from './format'+import PlatformFiles from './PlatformFiles.vue'+import type { Platform, Release } from './releases'++/** The newest beta: what it is, what to know first, its files, and what it adds. */+const { release, current = null } = defineProps<{+ release: Release+ current?: Platform | null+}>()++const messages = useLandingMessages()+const { lang } = useData()+</script>++<template>+ <section class="landing-section">+ <div class="beta">+ <div class="about">+ <span class="landing-badge">{{ messages.download.beta.badge }}</span>+ <h2 class="landing-heading">{{ messages.download.beta.title }}</h2>+ <p class="lede">{{ messages.download.beta.lede }}</p>+ <p class="version">{{ versionLine(messages.download, release, lang) }}</p>+ <ul class="caveats">+ <li v-for="caveat in messages.download.beta.caveats" :key="caveat">{{ caveat }}</li>+ </ul>+ </div>+ <div class="files">+ <PlatformFiles :release="release" :current="current" compact />+ <AppCollapsible+ class="notes"+ :label="messages.download.beta.notes"+ :ui="{+ trigger: 'py-3 text-sm font-medium text-(--vp-c-brand-1)',+ icon: 'size-4'+ }"+ >+ <!-- The release notes, rendered from the changelog section when the site was built. -->+ <div class="notes-body vp-doc" v-html="release.notes" />+ </AppCollapsible>+ </div>+ </div>+ </section>+</template>++<style scoped>+.beta {+ display: grid;+ grid-template-columns: 320px minmax(0, 1fr);+ gap: 56px;+ align-items: start;+}++.lede {+ margin-top: 16px;+ color: var(--vp-c-text-2);+ font-size: 16px;+ line-height: 1.6;+}++.version {+ margin-top: 12px;+ color: var(--vp-c-text-2);+ font-size: 13px;+}++.caveats {+ display: grid;+ gap: 8px;+ margin-top: 20px;+ color: var(--vp-c-text-2);+ font-size: 13px;+ line-height: 1.55;+}++.caveats li {+ position: relative;+ padding-left: 14px;+}++.caveats li::before {+ position: absolute;+ top: 0.62em;+ left: 0;+ width: 5px;+ height: 5px;+ border-radius: 50%;+ background: var(--vp-c-text-3);+ content: '';+}++.notes {+ margin-top: 24px;+}++/* Inside the collapsible's animated wrapper, so its padding cannot snap while it opens. */+.notes-body {+ max-height: 480px;+ margin-top: 4px;+ padding: 4px 28px 24px;+ overflow-y: auto;+ border: 1px solid var(--vp-c-divider);+ border-radius: 14px;+ background: var(--vp-c-bg-soft);+ font-size: 14px;+ line-height: 1.65;+}++.notes-body.vp-doc :deep(h3) {+ margin: 24px 0 8px;+ padding-top: 0;+ border-top: 0;+ font-size: 15px;+ line-height: 1.4;+}++.notes-body.vp-doc :deep(p),+.notes-body.vp-doc :deep(li) {+ color: var(--vp-c-text-2);+ font-size: 14px;+ line-height: 1.65;+}++.notes-body.vp-doc :deep(p:first-child) {+ margin-top: 20px;+ color: var(--vp-c-text-2);+ font-size: 13px;+}++.notes-body.vp-doc :deep(ul) {+ margin: 8px 0;+}++.notes-body.vp-doc :deep(li + li) {+ margin-top: 6px;+}++@media (max-width: 860px) {+ .beta {+ grid-template-columns: minmax(0, 1fr);+ gap: 32px;+ }+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/download/CopyCommand.vue b/packages/docs/.vitepress/theme/landing/download/CopyCommand.vuenew file mode 100644index 000000000..d06c250b1--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/download/CopyCommand.vue@@ -0,0 +1,80 @@+<script setup lang="ts">+import { useClipboard } from '@vueuse/core'+import IconCheck from '~icons/lucide/check'+import IconCopy from '~icons/lucide/copy'++import { useLandingMessages } from '../content/messages'+import { COPIED_MS } from '../ui/copy'++/** A shell command to paste into a terminal, with a button that copies it. */+const { command } = defineProps<{ command: string }>()++const messages = useLandingMessages()+const clipboard = useClipboard({ copiedDuring: COPIED_MS })+</script>++<template>+ <div class="command">+ <code>{{ command }}</code>+ <button+ type="button"+ :aria-label="clipboard.copied.value ? messages.clipboard.copied : messages.clipboard.copy"+ :data-copied="clipboard.copied.value || undefined"+ @click="clipboard.copy(command)"+ >+ <IconCheck v-if="clipboard.copied.value" aria-hidden="true" />+ <IconCopy v-else aria-hidden="true" />+ </button>+ </div>+</template>++<style scoped>+.command {+ display: inline-flex;+ align-items: center;+ gap: 4px;+ max-width: 100%;+ padding: 4px 4px 4px 12px;+ border: 1px solid var(--vp-c-divider);+ border-radius: 10px;+ background: var(--vp-c-bg-soft);+}++code {+ min-width: 0;+ overflow-x: auto;+ color: var(--vp-c-text-1);+ font-family: var(--vp-font-family-mono);+ font-size: 13px;+ white-space: nowrap;+ scrollbar-width: none;+}++button {+ display: grid;+ flex: none;+ place-items: center;+ width: 28px;+ height: 28px;+ margin-left: auto;+ border-radius: 7px;+ color: var(--vp-c-text-2);+ transition:+ color 0.2s,+ background-color 0.2s;+}++button:hover {+ background: var(--vp-c-default-soft);+ color: var(--vp-c-text-1);+}++button[data-copied] {+ color: var(--vp-c-brand-1);+}++button svg {+ width: 14px;+ height: 14px;+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/download/DownloadHero.vue b/packages/docs/.vitepress/theme/landing/download/DownloadHero.vuenew file mode 100644index 000000000..24d056781--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/download/DownloadHero.vue@@ -0,0 +1,163 @@+<script setup lang="ts">+import { useData } from 'vitepress'+import { computed } from 'vue'+import IconArrowDown from '~icons/lucide/arrow-down'+import IconGithub from '~icons/lucide/github'++import { LINKS } from '../content/links'+import { useLandingMessages, useLocalePath } from '../content/messages'+import ActionButton from '../ui/ActionButton.vue'+import StageFrame from '../ui/StageFrame.vue'+import DownloadSplitButton from './DownloadSplitButton.vue'+import { archLabel, formatSize, versionLine } from './format'+import { filesFor, type Release, type ReleaseFile } from './releases'+import type { VisitorSystem } from './visitor'++const { release, system } = defineProps<{+ release: Release | null+ system: VisitorSystem | null+}>()++const messages = useLandingMessages()+const localePath = useLocalePath()+const { lang } = useData()++/**+ * The installer for the visitor's system, and every installer for that platform. A Mac whose+ * browser does not say gets Apple Silicon, which every Mac since late 2020 has; the menu beside+ * the button has Intel.+ */+const choice = computed<{ main: ReleaseFile; files: ReleaseFile[] } | null>(() => {+ const platform = system?.platform+ if (!release || !platform) return null+ const files = filesFor(release, platform)+ const arch = system?.arch ?? (platform === 'mac' ? 'arm64' : 'x64')+ const main = files.find((file) => file.arch === arch) ?? files[0]+ return main ? { main, files } : null+})+</script>++<template>+ <section class="download-hero">+ <div class="copy">+ <h1>{{ messages.download.title }}</h1>+ <p class="lede">{{ messages.download.lede }}</p>++ <template v-if="release">+ <!-- Keeps its height until the browser says which system it runs on. -->+ <div class="pick">+ <template v-if="choice">+ <div class="landing-actions">+ <DownloadSplitButton :main="choice.main" :files="choice.files" />+ </div>+ <p class="meta">+ {{ archLabel(messages.download, choice.main.platform, choice.main.arch) }} ·+ {{ messages.download.formats[choice.main.format] }} ·+ {{ formatSize(choice.main.size, lang) }}+ </p>+ </template>+ <!-- A phone, a tablet, or a system the browser does not name: the list has them all. -->+ <div v-else-if="system" class="landing-actions">+ <ActionButton href="#all" :icon="IconArrowDown" primary>+ {{ messages.download.allTitle }}+ </ActionButton>+ </div>+ </div>+ <p class="version">+ {{ versionLine(messages.download, release, lang) }}+ <span class="links">+ <a :href="release.url">{{ messages.download.releaseNotes }}</a>+ <a :href="localePath('/getting-started') + '#system-requirements'">{{+ messages.download.requirements+ }}</a>+ </span>+ </p>+ </template>++ <template v-else>+ <p class="version">{{ messages.download.unavailable }}</p>+ <div class="landing-actions">+ <ActionButton :href="LINKS.download" :icon="IconGithub" primary>+ {{ messages.download.onGitHub }}+ </ActionButton>+ </div>+ </template>+ </div>++ <div class="stage">+ <StageFrame kind="interactive" />+ </div>+ </section>+</template>++<style scoped>+.download-hero {+ display: grid;+ grid-template-columns: minmax(0, 420px) minmax(0, 1fr);+ gap: 56px;+ align-items: center;+ padding-top: 72px;+}++h1 {+ font-size: clamp(36px, 5vw, 56px);+ font-weight: 700;+ letter-spacing: -0.03em;+ line-height: 1.05;+}++.lede {+ margin-top: 20px;+ color: var(--vp-c-text-2);+ font-size: 17px;+ line-height: 1.6;+}++.pick {+ min-height: 98px;+}++.meta {+ margin-top: 12px;+ color: var(--vp-c-text-2);+ font-size: 13px;+}++.version {+ display: flex;+ flex-wrap: wrap;+ gap: 4px 16px;+ margin-top: 8px;+ padding-top: 20px;+ border-top: 1px solid var(--vp-c-divider);+ color: var(--vp-c-text-2);+ font-size: 13px;+}++.links {+ display: flex;+ gap: 16px;+}++a {+ color: var(--vp-c-brand-1);+ font-weight: 500;+ text-decoration: none;+}++.stage {+ height: 460px;+}++@media (max-width: 860px) {+ .download-hero {+ grid-template-columns: minmax(0, 1fr);+ gap: 32px;+ padding-top: 40px;+ }++ .stage {+ height: 520px;+ }+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/download/DownloadPage.vue b/packages/docs/.vitepress/theme/landing/download/DownloadPage.vuenew file mode 100644index 000000000..e0acbf3af--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/download/DownloadPage.vue@@ -0,0 +1,63 @@+<script setup lang="ts">+import IconGithub from '~icons/lucide/github'+import IconShieldCheck from '~icons/lucide/shield-check'++import { provideLandingMessages, type LandingMessages } from '../content/messages'+import ActionButton from '../ui/ActionButton.vue'+import BetaSection from './BetaSection.vue'+import DownloadHero from './DownloadHero.vue'+import OtherWays from './OtherWays.vue'+import PlatformFiles from './PlatformFiles.vue'+import { data as releases } from './releases.data'+import { useVisitorSystem } from './visitor'++import '../landing.css'++/** The copy of the page's locale, imported by that locale's `download.md`. */+const { messages } = defineProps<{ messages: LandingMessages }>()+provideLandingMessages(messages)+const system = useVisitorSystem()+</script>++<template>+ <div class="landing download-page">+ <DownloadHero :release="releases.stable" :system="system" />+ <section v-if="releases.stable" id="all" class="landing-section">+ <header class="section-header">+ <h2>{{ messages.download.allTitle }}</h2>+ <div class="header-actions">+ <ActionButton+ v-if="releases.stable.checksums"+ :href="releases.stable.checksums"+ :icon="IconShieldCheck"+ small+ >+ {{ messages.download.checksums }}+ </ActionButton>+ <ActionButton :href="releases.stable.url" :icon="IconGithub" small>+ {{ messages.download.onGitHub }}+ </ActionButton>+ </div>+ </header>+ <PlatformFiles :release="releases.stable" :current="system?.platform" />+ </section>+ <BetaSection v-if="releases.beta" :release="releases.beta" :current="system?.platform" />+ <OtherWays />+ </div>+</template>++<style scoped>+.section-header {+ display: flex;+ flex-wrap: wrap;+ align-items: flex-end;+ justify-content: space-between;+ gap: 16px 24px;+}++.header-actions {+ display: flex;+ flex-wrap: wrap;+ gap: 8px;+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/download/DownloadSplitButton.vue b/packages/docs/.vitepress/theme/landing/download/DownloadSplitButton.vuenew file mode 100644index 000000000..0ae6c51da--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/download/DownloadSplitButton.vue@@ -0,0 +1,120 @@+<script setup lang="ts">+import {+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuPortal,+ DropdownMenuRoot,+ DropdownMenuTrigger+} from 'reka-ui'+import { useData } from 'vitepress'+import IconCheck from '~icons/lucide/check'+import IconChevronDown from '~icons/lucide/chevron-down'+import IconDownload from '~icons/lucide/download'++import { menuItem, useMenuUI } from '@/components/ui/menu/menu'++import { useLandingMessages } from '../content/messages'+import { fill } from '../content/messages/fill'+import { archLabel, extension, formatSize, PLATFORM_NAMES } from './format'+import type { ReleaseFile } from './releases'++/**+ * One click for the likely installer, and a menu of every installer for the same platform, such+ * as the Intel disk image or the `.msi`, each a direct download.+ */+const { main, files } = defineProps<{ main: ReleaseFile; files: ReleaseFile[] }>()++const messages = useLandingMessages()+const { lang } = useData()+const menu = useMenuUI({ content: 'min-w-60' })+const item = menuItem({ justify: 'start', class: 'gap-2.5' })+</script>++<template>+ <div class="split">+ <a class="main" :href="main.url">+ <IconDownload aria-hidden="true" />+ {{ fill(messages.download.forPlatform, { platform: PLATFORM_NAMES[main.platform] }) }}+ </a>+ <DropdownMenuRoot v-if="files.length > 1">+ <DropdownMenuTrigger+ class="more"+ :aria-label="fill(messages.download.moreFiles, { platform: PLATFORM_NAMES[main.platform] })"+ >+ <IconChevronDown aria-hidden="true" />+ </DropdownMenuTrigger>+ <DropdownMenuPortal>+ <DropdownMenuContent side="bottom" align="end" :side-offset="6" :class="menu.content">+ <DropdownMenuItem v-for="file in files" :key="file.name" as-child :class="item">+ <a :href="file.url">+ <IconCheck+ :class="[menu.icon, file.name === main.name ? '' : 'invisible']"+ aria-hidden="true"+ />+ <span class="flex-1">+ {{ archLabel(messages.download, file.platform, file.arch) }}+ <span class="text-muted">{{ extension(file.format) }}</span>+ </span>+ <span :class="menu.shortcut">{{ formatSize(file.size, lang) }}</span>+ </a>+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenuPortal>+ </DropdownMenuRoot>+ </div>+</template>++<style scoped>+/* The landing's primary action, split into the download and the menu of the others. */+.split {+ display: inline-flex;+ height: 40px;+ border: 1px solid var(--vp-button-brand-border);+ border-radius: 20px;+ background-color: var(--vp-button-brand-bg);+ color: var(--vp-button-brand-text);+ overflow: hidden;+}++.main,+.more {+ display: inline-flex;+ align-items: center;+ color: inherit;+ transition: background-color 0.25s;+}++.main {+ gap: 8px;+ padding: 0 18px 0 16px;+ font-size: 14px;+ font-weight: 600;+ text-decoration: none;+ white-space: nowrap;+}++.more {+ justify-content: center;+ width: 40px;+ border-left: 1px solid rgb(255 255 255 / 0.25);+}++/* The rounded clip would cut an outside focus ring, so it is drawn inside. */+.main:focus-visible,+.more:focus-visible {+ outline: 2px solid var(--vp-button-brand-text);+ outline-offset: -4px;+}++.main:hover,+.more:hover,+.more[data-state='open'] {+ background-color: var(--vp-button-brand-hover-bg);+}++svg {+ flex: none;+ width: 16px;+ height: 16px;+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/download/OtherWays.vue b/packages/docs/.vitepress/theme/landing/download/OtherWays.vuenew file mode 100644index 000000000..01bd2d582--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/download/OtherWays.vue@@ -0,0 +1,85 @@+<script setup lang="ts">+import IconBeer from '~icons/lucide/beer'+import IconBookOpen from '~icons/lucide/book-open'+import IconCode from '~icons/lucide/code'+import IconGlobe from '~icons/lucide/globe'+import IconPenTool from '~icons/lucide/pen-tool'+import IconTerminal from '~icons/lucide/square-terminal'++import { LINKS } from '../content/links'+import { useLandingMessages, useLocalePath } from '../content/messages'+import ActionButton from '../ui/ActionButton.vue'+import CopyCommand from './CopyCommand.vue'++const messages = useLandingMessages()+const localePath = useLocalePath()+</script>++<template>+ <section class="landing-section">+ <h2>{{ messages.download.others.title }}</h2>+ <dl class="landing-facts ways">+ <div class="way">+ <IconBeer class="icon" aria-hidden="true" />+ <dt>{{ messages.download.others.homebrew.title }}</dt>+ <dd>{{ messages.download.others.homebrew.detail }}</dd>+ <dd class="action"><CopyCommand command="brew install --cask openpencil" /></dd>+ </div>+ <div class="way">+ <IconGlobe class="icon" aria-hidden="true" />+ <dt>{{ messages.download.others.web.title }}</dt>+ <dd>{{ messages.download.others.web.detail }}</dd>+ <dd class="action">+ <ActionButton :href="LINKS.app" :icon="IconPenTool" small>+ {{ messages.download.others.web.action }}+ </ActionButton>+ </dd>+ </div>+ <div class="way">+ <IconTerminal class="icon" aria-hidden="true" />+ <dt>{{ messages.download.others.cli.title }}</dt>+ <dd>{{ messages.download.others.cli.detail }}</dd>+ <dd class="action"><CopyCommand command="npm install -g @open-pencil/cli" /></dd>+ </div>+ <div class="way">+ <IconCode class="icon" aria-hidden="true" />+ <dt>{{ messages.download.others.source.title }}</dt>+ <dd>{{ messages.download.others.source.detail }}</dd>+ <dd class="action">+ <ActionButton+ :href="localePath('/getting-started') + '#building-from-source'"+ :icon="IconBookOpen"+ small+ >+ {{ messages.download.others.source.action }}+ </ActionButton>+ </dd>+ </div>+ </dl>+ </section>+</template>++<style scoped>+/* Two by two, so each command fits on its line. */+.ways {+ grid-template-columns: repeat(2, minmax(0, 1fr));+ gap: 48px 64px;+}++/* Each way ends in its action, lined up along the row whatever the text's length. */+.way {+ display: flex;+ flex-direction: column;+}++.action {+ margin-top: auto;+ padding-top: 16px;+}++@media (max-width: 860px) {+ .ways {+ grid-template-columns: minmax(0, 1fr);+ }+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/download/PlatformFiles.vue b/packages/docs/.vitepress/theme/landing/download/PlatformFiles.vuenew file mode 100644index 000000000..52895cdf5--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/download/PlatformFiles.vue@@ -0,0 +1,137 @@+<script setup lang="ts">+import { useData } from 'vitepress'+import IconApple from '~icons/simple-icons/apple'+import IconLinux from '~icons/simple-icons/linux'+import IconWindows from '~icons/simple-icons/windows'++import { useLandingMessages } from '../content/messages'+import { archLabel, extension, formatSize, PLATFORM_NAMES } from './format'+import { filesFor, PLATFORMS, type Platform, type Release } from './releases'++/**+ * Every installer of a release, a column per platform. `compact` leaves out what each format is+ * for, as the beta lists its files under the stable release's.+ */+const {+ release,+ current = null,+ compact = false+} = defineProps<{+ release: Release+ current?: Platform | null+ compact?: boolean+}>()++const messages = useLandingMessages()+const { lang } = useData()++const ICONS = { mac: IconApple, windows: IconWindows, linux: IconLinux }+</script>++<template>+ <div class="platforms" :data-compact="compact || undefined">+ <div v-for="platform in PLATFORMS" :key="platform" class="platform">+ <h3>+ <component :is="ICONS[platform]" class="mark" aria-hidden="true" />+ {{ PLATFORM_NAMES[platform] }}+ <span v-if="platform === current" class="yours">{{ messages.download.yourSystem }}</span>+ </h3>+ <ul>+ <li v-for="file in filesFor(release, platform)" :key="file.name">+ <a :href="file.url">+ <span class="name">+ {{ archLabel(messages.download, file.platform, file.arch) }}+ <span class="ext">{{ extension(file.format) }}</span>+ </span>+ <span class="size">{{ formatSize(file.size, lang) }}</span>+ <span v-if="!compact" class="purpose">{{+ messages.download.formats[file.format]+ }}</span>+ </a>+ </li>+ </ul>+ </div>+ </div>+</template>++<style scoped>+.platforms {+ display: grid;+ grid-template-columns: repeat(3, minmax(0, 1fr));+ gap: 48px;+ margin-top: 40px;+}++h3 {+ display: flex;+ align-items: center;+ gap: 10px;+ padding-bottom: 14px;+ border-bottom: 1px solid var(--vp-c-divider);+ font-size: 16px;+ font-weight: 600;+}++.mark {+ width: 16px;+ height: 16px;+ color: var(--vp-c-text-1);+}++.yours {+ margin-left: auto;+ color: var(--vp-c-brand-1);+ font-size: 12px;+ font-weight: 500;+}++a {+ display: grid;+ grid-template-columns: minmax(0, 1fr) auto;+ column-gap: 12px;+ padding: 12px 0;+ border-bottom: 1px solid var(--vp-c-divider);+ color: var(--vp-c-text-1);+ text-decoration: none;+}++.name {+ font-size: 14px;+ font-weight: 500;+ transition: color 0.2s;+}++a:hover .name {+ color: var(--vp-c-brand-1);+}++.ext {+ margin-left: 2px;+ color: var(--vp-c-text-2);+ font-weight: 400;+}++.size {+ color: var(--vp-c-text-2);+ font-size: 13px;+ font-variant-numeric: tabular-nums;+}++.purpose {+ grid-column: 1 / -1;+ margin-top: 2px;+ color: var(--vp-c-text-2);+ font-size: 13px;+}++.platforms[data-compact] {+ margin-top: 8px;+}++@media (max-width: 860px) {+ .platforms {+ grid-template-columns: minmax(0, 1fr);+ gap: 32px;+ }+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/download/format.ts b/packages/docs/.vitepress/theme/landing/download/format.tsnew file mode 100644index 000000000..5c6241ce9--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/download/format.ts@@ -0,0 +1,41 @@+import { fill } from '../content/messages/fill'+import type { LandingMessages } from '../content/messages/types'+import type { Arch, FileFormat, Platform, Release } from './releases'++type DownloadMessages = LandingMessages['download']++/** Platform names are product names, the same in every language. */+export const PLATFORM_NAMES: Record<Platform, string> = {+ mac: 'macOS',+ windows: 'Windows',+ linux: 'Linux'+}++/** Apple calls its processors Apple Silicon and Intel; elsewhere the architecture is named. */+export function archLabel(messages: DownloadMessages, platform: Platform, arch: Arch): string {+ if (platform === 'mac') return arch === 'arm64' ? messages.arch.appleSilicon : messages.arch.intel+ return arch === 'arm64' ? messages.arch.arm : messages.arch.x64+}++/** The extension as people write it, AppImage in its own capitals. */+export function extension(format: FileFormat): string {+ return format === 'appimage' ? '.AppImage' : `.${format}`+}++/** A file size in megabytes, with the unit as the visitor's language writes it. */+export function formatSize(bytes: number, lang: string): string {+ const megabytes = bytes / 1_000_000+ return new Intl.NumberFormat(lang, {+ style: 'unit',+ unit: 'megabyte',+ maximumFractionDigits: megabytes < 10 ? 1 : 0+ }).format(megabytes)+}++export function formatDate(iso: string, lang: string): string {+ return new Intl.DateTimeFormat(lang, { dateStyle: 'long', timeZone: 'UTC' }).format(new Date(iso))+}++export function versionLine(messages: DownloadMessages, release: Release, lang: string): string {+ return fill(messages.version, { version: release.version, date: formatDate(release.date, lang) })+}diff --git a/packages/docs/.vitepress/theme/landing/download/releases.data.ts b/packages/docs/.vitepress/theme/landing/download/releases.data.tsnew file mode 100644index 000000000..7d875eb54--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/download/releases.data.ts@@ -0,0 +1,92 @@+import * as v from 'valibot'+import { createMarkdownRenderer } from 'vitepress'++import { classifyAsset, latestReleases, type Release, type Releases } from './releases'++declare const data: Releases+export { data }++const RELEASES_URL = 'https://api.github.com/repos/open-pencil/open-pencil/releases?per_page=30'++const ReleaseSchema = v.object({+ tag_name: v.string(),+ html_url: v.string(),+ published_at: v.nullable(v.string()),+ draft: v.boolean(),+ prerelease: v.boolean(),+ body: v.nullable(v.string()),+ assets: v.array(+ v.object({ name: v.string(), browser_download_url: v.string(), size: v.number() })+ )+})+type GitHubRelease = v.InferOutput<typeof ReleaseSchema>++const ReleasesResponse = v.pipe(v.string(), v.parseJson(), v.array(ReleaseSchema))++/** A stalled response takes the same fallback as a failed one rather than hold up the build. */+const RELEASES_TIMEOUT_MS = 30_000++async function fetchReleases(): Promise<GitHubRelease[] | null> {+ // CI passes the workflow's token; a local build without one stays within the anonymous limit.+ const token = process.env.GITHUB_TOKEN ?? process.env.GH_TOKEN+ try {+ const response = await fetch(RELEASES_URL, {+ headers: {+ accept: 'application/vnd.github+json',+ ...(token ? { authorization: `Bearer ${token}` } : {})+ },+ signal: AbortSignal.timeout(RELEASES_TIMEOUT_MS)+ })+ if (!response.ok) throw new Error(`GitHub answered ${response.status}`)+ const parsed = v.safeParse(ReleasesResponse, await response.text())+ if (!parsed.success) throw new Error('GitHub sent releases in an unexpected shape')+ return parsed.output+ } catch (error) {+ console.warn(+ `[download] Releases unavailable, the page links to GitHub instead: ${String(error)}`+ )+ return null+ }+}++/**+ * The latest stable release and any newer beta, read from GitHub when the site is built, so the+ * download page is static: no request leaves the visitor's browser. A build that cannot reach+ * GitHub gives a page that links to the releases there instead.+ */+export default {+ async load(): Promise<Releases> {+ const releases = await fetchReleases()+ if (!releases) return { stable: null, beta: null }+ const published = releases.filter(+ (release): release is GitHubRelease & { published_at: string } =>+ !release.draft && release.published_at !== null+ )+ const { stable, beta } = latestReleases(published)+ const markdown = await createMarkdownRenderer(process.cwd())+ const toRelease = (+ release: GitHubRelease & { published_at: string },+ notes = false+ ): Release => ({+ version: release.tag_name.replace(/^v/, ''),+ date: release.published_at,+ url: release.html_url,+ files: release.assets.flatMap((asset) => {+ const file = classifyAsset({+ name: asset.name,+ url: asset.browser_download_url,+ size: asset.size+ })+ return file ? [file] : []+ }),+ checksums:+ release.assets.find((asset) => asset.name === 'SHA256SUMS')?.browser_download_url ?? null,+ // Only the beta shows its notes; the stable release links to them on GitHub.+ notes: notes ? markdown.render(release.body ?? '') : ''+ })+ return {+ stable: stable ? toRelease(stable) : null,+ beta: beta ? toRelease(beta, true) : null+ }+ }+}diff --git a/packages/docs/.vitepress/theme/landing/download/releases.ts b/packages/docs/.vitepress/theme/landing/download/releases.tsnew file mode 100644index 000000000..1e5106417--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/download/releases.ts@@ -0,0 +1,94 @@+import { maxBy, partition } from 'es-toolkit/array'++export const PLATFORMS = ['mac', 'windows', 'linux'] as const+export type Platform = (typeof PLATFORMS)[number]+export type Arch = 'arm64' | 'x64'+/** Installer formats, in the order a platform's list shows them. */+export const FILE_FORMATS = ['dmg', 'exe', 'msi', 'appimage', 'deb', 'rpm'] as const+export type FileFormat = (typeof FILE_FORMATS)[number]++/** A file someone downloads to install the app; updater payloads and signatures are left out. */+export interface ReleaseFile {+ platform: Platform+ arch: Arch+ format: FileFormat+ name: string+ url: string+ /** Bytes. */+ size: number+}++export interface Release {+ version: string+ /** ISO date the release was published. */+ date: string+ url: string+ files: ReleaseFile[]+ /** `SHA256SUMS`, when the release has it. */+ checksums: string | null+ /** The release notes, the changelog section of the version, as HTML; empty when not shown. */+ notes: string+}++export interface Releases {+ stable: Release | null+ /** The newest pre-release, when it is newer than the stable release. */+ beta: Release | null+}++/**+ * How the release workflow names each installer (`tools/release/release-packages`): the format+ * by its extension, and the architecture by the target in the name.+ */+const FILE_PATTERNS: { pattern: RegExp; platform: Platform; arch: Arch; format: FileFormat }[] = [+ { pattern: /_aarch64\.dmg$/, platform: 'mac', arch: 'arm64', format: 'dmg' },+ { pattern: /_x64\.dmg$/, platform: 'mac', arch: 'x64', format: 'dmg' },+ { pattern: /_x64-setup\.exe$/, platform: 'windows', arch: 'x64', format: 'exe' },+ { pattern: /_arm64-setup\.exe$/, platform: 'windows', arch: 'arm64', format: 'exe' },+ { pattern: /_x64_[\w-]+\.msi$/, platform: 'windows', arch: 'x64', format: 'msi' },+ { pattern: /_arm64_[\w-]+\.msi$/, platform: 'windows', arch: 'arm64', format: 'msi' },+ { pattern: /_amd64\.AppImage$/, platform: 'linux', arch: 'x64', format: 'appimage' },+ { pattern: /_aarch64\.AppImage$/, platform: 'linux', arch: 'arm64', format: 'appimage' },+ { pattern: /_amd64\.deb$/, platform: 'linux', arch: 'x64', format: 'deb' },+ { pattern: /_arm64\.deb$/, platform: 'linux', arch: 'arm64', format: 'deb' },+ { pattern: /\.x86_64\.rpm$/, platform: 'linux', arch: 'x64', format: 'rpm' },+ { pattern: /\.aarch64\.rpm$/, platform: 'linux', arch: 'arm64', format: 'rpm' }+]++/** The installer a release asset is, or null for signatures, updater payloads, and manifests. */+export function classifyAsset(asset: {+ name: string+ url: string+ size: number+}): ReleaseFile | null {+ const match = FILE_PATTERNS.find(({ pattern }) => pattern.test(asset.name))+ if (!match) return null+ const { platform, arch, format } = match+ return { platform, arch, format, ...asset }+}++/** Files of one platform, Apple Silicon and ARM first on the Mac, x64 first elsewhere. */+export function filesFor(release: Release, platform: Platform): ReleaseFile[] {+ const archFirst: Arch = platform === 'mac' ? 'arm64' : 'x64'+ return release.files+ .filter((file) => file.platform === platform)+ .toSorted(+ (a, b) =>+ Number(b.arch === archFirst) - Number(a.arch === archFirst) ||+ FILE_FORMATS.indexOf(a.format) - FILE_FORMATS.indexOf(b.format)+ )+}++/**+ * The newest stable release, and the newest pre-release when it came out after it. Releases are+ * drafted before they are published, so they are compared by when they were published.+ */+export function latestReleases<T extends { prerelease: boolean; published_at: string }>(+ published: readonly T[]+): { stable: T | null; beta: T | null } {+ const [betas, stables] = partition(published, (release) => release.prerelease)+ const stable = maxBy(stables, (release) => Date.parse(release.published_at)) ?? null+ const beta = maxBy(betas, (release) => Date.parse(release.published_at)) ?? null+ const newer = beta && (!stable || Date.parse(beta.published_at) > Date.parse(stable.published_at))+ return { stable, beta: newer ? beta : null }+}diff --git a/packages/docs/.vitepress/theme/landing/download/visitor.ts b/packages/docs/.vitepress/theme/landing/download/visitor.tsnew file mode 100644index 000000000..dccedac9d--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/download/visitor.ts@@ -0,0 +1,54 @@+import { onMounted, shallowRef, type ShallowRef } from 'vue'++import type { Arch, Platform } from './releases'++export interface VisitorSystem {+ platform: Platform | null+ /** Only what the browser reports; Safari never says which processor a Mac has. */+ arch: Arch | null+}++/** The desktop platform a browser runs on, from its user agent and how many touches it takes. */+export function platformOf(userAgent: string, touchPoints: number): Platform | null {+ // Phones and tablets get the full list rather than a desktop installer. An iPad asks for+ // desktop sites as a Mac does, but no Mac has a touch screen.+ if (/Android|iPhone|iPad/.test(userAgent)) return null+ if (/Mac OS X|Macintosh/.test(userAgent)) return touchPoints > 1 ? null : 'mac'+ if (/Windows/.test(userAgent)) return 'windows'+ if (/Linux|X11/.test(userAgent)) return 'linux'+ return null+}++/** The processor architecture from User-Agent Client Hints, which Chromium browsers offer. */+async function reportedArch(): Promise<Arch | null> {+ const hints: unknown = Reflect.get(navigator, 'userAgentData')+ const request: unknown =+ typeof hints === 'object' && hints !== null ? Reflect.get(hints, 'getHighEntropyValues') : null+ if (typeof request !== 'function') return null+ try {+ const values: unknown = await Reflect.apply(request, hints, [['architecture']])+ const architecture =+ typeof values === 'object' && values !== null ? Reflect.get(values, 'architecture') : null+ if (architecture === 'arm') return 'arm64'+ if (architecture === 'x86') return 'x64'+ } catch {+ return null+ }+ return null+}++/**+ * The visitor's system, once the page runs in the browser; null while it is rendered ahead of+ * time, which has no visitor.+ */+export function useVisitorSystem(): ShallowRef<VisitorSystem | null> {+ const system = shallowRef<VisitorSystem | null>(null)+ onMounted(async () => {+ // The platform shows at once; a processor the browser reports refines the choice later.+ const platform = platformOf(navigator.userAgent, navigator.maxTouchPoints)+ system.value = { platform, arch: null }+ const arch = await reportedArch()+ if (arch) system.value = { platform, arch }+ })+ return system+}diff --git a/packages/docs/.vitepress/theme/landing/landing.css b/packages/docs/.vitepress/theme/landing/landing.cssnew file mode 100644index 000000000..97b50543a--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/landing.css@@ -0,0 +1,112 @@+/*+ * Shared by every landing section: the page column, element resets VitePress's content+ * styles would otherwise apply, and the section rhythm. Section-specific rules live in the+ * section components.+ */++/*+ * A stage's UI uses the app's font, as `body` does in `src/app.css`. VitePress already loads+ * Inter, so panels look the same on every platform, and so do the stills captured of them.+ */+.op-app {+ font-family:+ Inter,+ system-ui,+ -apple-system,+ sans-serif;+}++.landing {+ max-width: 1200px;+ margin: 0 auto;+ padding: 0 24px 120px;+}++.landing :where(h1, h2, h3, p, ul, ol, dl, dd) {+ margin: 0;+ padding: 0;+ list-style: none;+}++.landing-section {+ padding-top: 160px;+}++/* A section's heading, also when a header puts actions beside it or a column holds it. */+.landing-section > h2,+.landing-section > header > h2,+.landing-heading {+ font-size: clamp(26px, 3.6vw, 40px);+ font-weight: 700;+ letter-spacing: -0.02em;+ line-height: 1.15;+}++/* A grid of short titled facts, used for ownership and inside the roadmap. */+.landing-facts {+ display: grid;+ grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));+ gap: 36px 48px;+ margin-top: 40px;+}++/* The icon that heads each fact. */+.landing-facts .icon {+ display: block;+ width: 24px;+ height: 24px;+ margin-bottom: 14px;+ color: var(--vp-c-brand-1);+}++.landing-facts dt {+ font-size: 16px;+ font-weight: 600;+}++.landing-facts dd {+ margin-top: 6px;+ color: var(--vp-c-text-2);+ font-size: 15px;+ line-height: 1.6;+}++/* A pill above a heading, such as Early access or Beta. */+.landing-badge {+ display: inline-block;+ margin-bottom: 16px;+ padding: 2px 10px;+ border: 1px solid var(--vp-c-brand-soft);+ border-radius: 999px;+ background: var(--vp-c-brand-soft);+ color: var(--vp-c-brand-1);+ font-size: 13px;+ font-weight: 600;+ line-height: 22px;+}++/* The download page has no stages between its sections, so they sit closer together. */+.download-page .landing-section {+ padding-top: 112px;+}++.landing-actions {+ display: flex;+ flex-wrap: wrap;+ gap: 10px;+ margin-top: 28px;+}++@media (max-width: 860px) {+ .landing {+ padding: 0 16px 80px;+ }++ .landing-section {+ padding-top: 96px;+ }++ .download-page .landing-section {+ padding-top: 72px;+ }+}diff --git a/packages/docs/.vitepress/theme/landing/posters.ts b/packages/docs/.vitepress/theme/landing/posters.tsnew file mode 100644index 000000000..7aa68213f--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/posters.ts@@ -0,0 +1,52 @@+import type { FeatureKind } from './content/features'++/**+ * Still images of each stage, captured from the built site by `tools/generate/landing-posters`+ * and shown until the live stage is ready. Kept free of Vue and the editor, so the generator+ * and server-rendered sections can import it.+ */+export const POSTER_THEMES = ['light', 'dark'] as const+export type PosterTheme = (typeof POSTER_THEMES)[number]++export const POSTER_LAYOUTS = ['desktop', 'phone'] as const+export type PosterLayout = (typeof POSTER_LAYOUTS)[number]++/**+ * A stage is captured as its canvas and its panel, because the stage's width follows the page+ * while the panel keeps its own: the canvas image scales to fit, as the live canvas fits its+ * scene, and the panel image stays as it is. The collaboration stage is two canvases, captured+ * as one frame.+ */+export type PosterPart = 'canvas' | 'panel' | 'frame'++/** Below this width a stage stacks its panel under the canvas, as Tailwind's `max-md` does. */+export const PHONE_MAX_WIDTH = 767++/** The query parameter the generator opens pages with: stages start at once and stay still. */+export const POSTER_CAPTURE_PARAM = 'poster-capture'++export function posterParts(kind: FeatureKind): PosterPart[] {+ return kind === 'collab' ? ['frame'] : ['canvas', 'panel']+}++export interface PosterTarget {+ /** Identifies the sources the posters were captured from, so a changed stage gets new URLs. */+ fingerprint: string+ /** The docs locale index: `root` for English, otherwise the locale's path prefix. */+ locale: string+ theme: PosterTheme+ layout: PosterLayout+}++/** The site path of one poster image, without the base. */+export function posterPath(target: PosterTarget, kind: FeatureKind, part: PosterPart): string {+ const { fingerprint, locale, theme, layout } = target+ return `landing-posters/${fingerprint}/${locale}/${theme}-${layout}/${kind}-${part}.webp`+}++export function isPosterCapture(): boolean {+ return (+ typeof location !== 'undefined' &&+ new URLSearchParams(location.search).has(POSTER_CAPTURE_PARAM)+ )+}diff --git a/packages/docs/.vitepress/theme/landing/sections/AgentList.vue b/packages/docs/.vitepress/theme/landing/sections/AgentList.vuenew file mode 100644index 000000000..0385b2997--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/sections/AgentList.vue@@ -0,0 +1,68 @@+<script setup lang="ts">+import type { Component } from 'vue'+import IconClaude from '~icons/simple-icons/claude'+import IconCursor from '~icons/simple-icons/cursor'+import IconGemini from '~icons/simple-icons/googlegemini'+import IconOpenAI from '~icons/simple-icons/openai'+import IconWindsurf from '~icons/simple-icons/windsurf'++import { AGENTS } from '../content/features'+import { useLandingMessages } from '../content/messages'++const messages = useLandingMessages()++const ICONS: Record<(typeof AGENTS)[number], Component> = {+ 'Claude Code': IconClaude,+ Cursor: IconCursor,+ Windsurf: IconWindsurf,+ Codex: IconOpenAI,+ 'Gemini CLI': IconGemini+}+const agents = AGENTS.map((name) => ({ name, icon: ICONS[name] }))+</script>++<template>+ <div class="agents">+ <h3>{{ messages.agents.heading }}</h3>+ <ul>+ <li v-for="agent in agents" :key="agent.name">+ <component :is="agent.icon" aria-hidden="true" />{{ agent.name }}+ </li>+ <li class="rest">{{ messages.agents.rest }}</li>+ </ul>+ </div>+</template>++<style scoped>+h3 {+ color: var(--vp-c-text-1);+ font-size: 13px;+ font-weight: 600;+}++ul {+ display: flex;+ flex-direction: column;+ gap: 10px;+ margin-top: 10px;+ color: var(--vp-c-text-1);+ font-size: 14px;+ line-height: 20px;+}++li {+ display: flex;+ align-items: center;+ gap: 10px;+}++.rest {+ color: var(--vp-c-text-2);+}++svg {+ flex: none;+ width: 18px;+ height: 18px;+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/sections/ClosingSection.vue b/packages/docs/.vitepress/theme/landing/sections/ClosingSection.vuenew file mode 100644index 000000000..c516c3c4d--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/sections/ClosingSection.vue@@ -0,0 +1,27 @@+<script setup lang="ts">+import IconBookOpen from '~icons/lucide/book-open'+import IconCloud from '~icons/lucide/cloud'+import IconDownload from '~icons/lucide/download'++import { LINKS } from '../content/links'+import { useLandingMessages, useLocalePath } from '../content/messages'+import ActionButton from '../ui/ActionButton.vue'++const messages = useLandingMessages()+const localePath = useLocalePath()+</script>++<template>+ <section class="landing-section">+ <h2>{{ messages.closing.title }}</h2>+ <div class="landing-actions">+ <ActionButton :href="localePath(LINKS.downloadPage)" :icon="IconDownload" primary>+ {{ messages.closing.download }}+ </ActionButton>+ <ActionButton :href="localePath(LINKS.docs)" :icon="IconBookOpen">+ {{ messages.closing.docs }}+ </ActionButton>+ <ActionButton href="#cloud" :icon="IconCloud">{{ messages.closing.cloud }}</ActionButton>+ </div>+ </section>+</template>diff --git a/packages/docs/.vitepress/theme/landing/sections/CloudSection.vue b/packages/docs/.vitepress/theme/landing/sections/CloudSection.vuenew file mode 100644index 000000000..2ad9cdb05--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/sections/CloudSection.vue@@ -0,0 +1,53 @@+<script setup lang="ts">+import IconLibrary from '~icons/lucide/library'+import IconMessageSquare from '~icons/lucide/message-square'+import IconRefreshCw from '~icons/lucide/refresh-cw'+import IconShieldCheck from '~icons/lucide/shield-check'+import IconSparkles from '~icons/lucide/sparkles'++import { useLandingMessages } from '../content/messages'+import WaitlistForm from '../waitlist/WaitlistForm.vue'++const messages = useLandingMessages()++/** One per feature, in the order every locale lists them: sync, sharing, libraries, AI, admin. */+const ICONS = [IconRefreshCw, IconMessageSquare, IconLibrary, IconSparkles, IconShieldCheck]+</script>++<template>+ <!-- The closing section's Cloud button links here. -->+ <section id="cloud" class="landing-section">+ <span class="landing-badge">{{ messages.cloud.badge }}</span>+ <h2>{{ messages.cloud.title }}</h2>+ <p class="lede">{{ messages.cloud.lede }}</p>+ <WaitlistForm class="form" />+ <dl class="landing-facts">+ <div v-for="(feature, index) in messages.cloud.features" :key="feature.title">+ <component :is="ICONS[index]" class="icon" aria-hidden="true" />+ <dt>{{ feature.title }}</dt>+ <dd>{{ feature.detail }}</dd>+ </div>+ </dl>+ </section>+</template>++<style scoped>+.lede {+ max-width: 640px;+ margin-top: 16px;+ color: var(--vp-c-text-2);+ font-size: 18px;+ line-height: 1.6;+}++.form {+ margin-top: 28px;+}++/* Five features fit one row on a desktop instead of leaving one alone on the next. */+.landing-facts {+ grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));+ gap: 36px 40px;+ margin-top: 56px;+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/sections/CommandList.vue b/packages/docs/.vitepress/theme/landing/sections/CommandList.vuenew file mode 100644index 000000000..ef5113e8b--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/sections/CommandList.vue@@ -0,0 +1,57 @@+<script setup lang="ts">+import { useLandingMessages } from '../content/messages'+import { fill } from '../content/messages/fill'+import { data as stats } from '../content/stats.data'++const messages = useLandingMessages()+</script>++<template>+ <div class="commands">+ <h3>{{ fill(messages.commands.cli, { count: stats.cliCommands.length }) }}</h3>+ <ul>+ <li v-for="command in stats.cliCommands" :key="command">{{ command }}</li>+ </ul>+ <h3>{{ fill(messages.commands.mcp, { count: stats.mcpTools }) }}</h3>+ <p>{{ messages.commands.mcpDetail }}</p>+ </div>+</template>++<style scoped>+.commands {+ display: flex;+ flex-direction: column;+ gap: 10px;+}++h3 {+ color: var(--vp-c-text-1);+ font-size: 13px;+ font-weight: 600;+}++h3:not(:first-child) {+ margin-top: 8px;+}++ul {+ display: flex;+ flex-wrap: wrap;+ gap: 6px;+}++li {+ padding: 2px 8px;+ border: 1px solid var(--vp-c-divider);+ border-radius: 6px;+ color: var(--vp-c-text-1);+ font-family: var(--vp-font-family-mono);+ font-size: 12px;+ line-height: 20px;+}++p {+ font-size: 14px;+ line-height: 1.55;+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/sections/FeatureSection.vue b/packages/docs/.vitepress/theme/landing/sections/FeatureSection.vuenew file mode 100644index 000000000..4389b1ede--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/sections/FeatureSection.vue@@ -0,0 +1,95 @@+<script setup lang="ts">+import { computed } from 'vue'+import IconMousePointerClick from '~icons/lucide/mouse-pointer-click'++import type { FeatureKind } from '../content/features'+import { useLandingMessages } from '../content/messages'+import StageFrame from '../ui/StageFrame.vue'++/** `flipped` puts the copy before the stage, on the left. */+const { kind, flipped = false } = defineProps<{ kind: FeatureKind; flipped?: boolean }>()++const messages = useLandingMessages()+const block = computed(() => messages.value.features[kind])+</script>++<template>+ <section class="landing-section">+ <h2>{{ block.title }}</h2>+ <div class="body" :data-flipped="flipped || undefined">+ <div class="stage">+ <StageFrame :kind="kind" />+ </div>+ <div class="copy">+ <p>{{ block.detail }}</p>+ <p class="hint"><IconMousePointerClick aria-hidden="true" />{{ block.hint }}</p>+ <!-- Supporting detail for one block, such as a list of agents or commands, comes last. -->+ <slot />+ </div>+ </div>+ </section>+</template>++<style scoped>+.body {+ display: grid;+ grid-template-columns: minmax(0, 1fr) 300px;+ gap: 48px;+ align-items: start;+ margin-top: 36px;+}++.body[data-flipped] {+ grid-template-columns: 300px minmax(0, 1fr);+}++.stage {+ height: 460px;+}++.body[data-flipped] .copy {+ order: -1;+}++.copy {+ display: flex;+ flex-direction: column;+ gap: 20px;+ padding-top: 4px;+ color: var(--vp-c-text-2);+ font-size: 16px;+ line-height: 1.65;+}++.hint {+ display: flex;+ gap: 8px;+ color: var(--vp-c-text-1);+ font-size: 14px;+ line-height: 1.5;+}++.hint svg {+ flex: none;+ margin-top: 3px;+ color: var(--vp-c-brand-1);+}++@media (max-width: 860px) {+ /* Text first on a phone: read what the block is, then meet the canvas. */+ .body,+ .body[data-flipped] {+ grid-template-columns: minmax(0, 1fr);+ gap: 24px;+ margin-top: 20px;+ }++ .copy {+ order: -1;+ }++ .stage {+ height: 560px;+ }+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/sections/HeroSection.vue b/packages/docs/.vitepress/theme/landing/sections/HeroSection.vuenew file mode 100644index 000000000..aadce0cf8--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/sections/HeroSection.vue@@ -0,0 +1,57 @@+<script setup lang="ts">+import IconDownload from '~icons/lucide/download'+import IconGithub from '~icons/lucide/github'+import IconPenTool from '~icons/lucide/pen-tool'++import { LINKS } from '../content/links'+import { useLandingMessages, useLocalePath } from '../content/messages'+import ActionButton from '../ui/ActionButton.vue'++const messages = useLandingMessages()+const localePath = useLocalePath()+</script>++<template>+ <section class="hero">+ <h1>{{ messages.hero.title }}</h1>+ <p class="lede">{{ messages.hero.lede }}</p>+ <div class="landing-actions">+ <ActionButton :href="LINKS.app" :icon="IconPenTool" primary>+ {{ messages.hero.open }}+ </ActionButton>+ <ActionButton :href="localePath(LINKS.downloadPage)" :icon="IconDownload">+ {{ messages.hero.download }}+ </ActionButton>+ <ActionButton :href="LINKS.github" :icon="IconGithub">{{+ messages.hero.github+ }}</ActionButton>+ </div>+ </section>+</template>++<style scoped>+.hero {+ padding-top: 72px;+}++h1 {+ font-size: clamp(36px, 6vw, 64px);+ font-weight: 700;+ letter-spacing: -0.03em;+ line-height: 1.05;+}++.lede {+ max-width: 640px;+ margin-top: 20px;+ color: var(--vp-c-text-2);+ font-size: clamp(16px, 2vw, 19px);+ line-height: 1.55;+}++@media (max-width: 860px) {+ .hero {+ padding-top: 40px;+ }+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/sections/OwnershipSection.vue b/packages/docs/.vitepress/theme/landing/sections/OwnershipSection.vuenew file mode 100644index 000000000..f838a7848--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/sections/OwnershipSection.vue@@ -0,0 +1,26 @@+<script setup lang="ts">+import IconCloud from '~icons/lucide/cloud'+import IconFileOutput from '~icons/lucide/file-output'+import IconHardDrive from '~icons/lucide/hard-drive'+import IconScale from '~icons/lucide/scale'++import { useLandingMessages } from '../content/messages'++const messages = useLandingMessages()++/** One per item, in the order every locale lists them: local, storage, formats, license. */+const ICONS = [IconHardDrive, IconCloud, IconFileOutput, IconScale]+</script>++<template>+ <section class="landing-section">+ <h2>{{ messages.ownership.title }}</h2>+ <dl class="landing-facts">+ <div v-for="(item, index) in messages.ownership.items" :key="item.title">+ <component :is="ICONS[index]" class="icon" aria-hidden="true" />+ <dt>{{ item.title }}</dt>+ <dd>{{ item.detail }}</dd>+ </div>+ </dl>+ </section>+</template>diff --git a/packages/docs/.vitepress/theme/landing/sections/RoadmapSection.vue b/packages/docs/.vitepress/theme/landing/sections/RoadmapSection.vuenew file mode 100644index 000000000..bef40bad5--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/sections/RoadmapSection.vue@@ -0,0 +1,227 @@+<script setup lang="ts">+import { computed } from 'vue'+import IconArrowRight from '~icons/lucide/arrow-right'++import { LINKS } from '../content/links'+import { useLandingMessages, useLocalePath } from '../content/messages'+import type { TitledDetail } from '../content/messages/types'+import WaitlistForm from '../waitlist/WaitlistForm.vue'++const messages = useLandingMessages()+const localePath = useLocalePath()++/** One row of the timeline; a lead entry is set larger, as a feature of its own. */+interface TimelineEntry {+ title: string+ detail?: string+ lead?: boolean+ features?: TitledDetail[]+ /** Shows the Cloud waitlist form under the entry. */+ waitlist?: boolean+}++interface TimelineStage {+ label: string+ state: 'done' | 'current' | 'planned'+ entries: TimelineEntry[]+}++/** The catalog keeps the stages apart so each has its own shape; the timeline wants a list. */+const stages = computed((): TimelineStage[] => {+ const { shipped, now, next, later } = messages.value.roadmap+ const planned: TimelineEntry[] = [+ { ...next.lead, lead: true },+ { ...next.cloud, lead: true, waitlist: true },+ ...next.entries+ ]+ return [+ { label: shipped.label, state: 'done', entries: shipped.entries },+ { label: now.label, state: 'current', entries: now.entries },+ { label: next.label, state: 'planned', entries: planned },+ { label: later.label, state: 'planned', entries: later.entries }+ ]+})+</script>++<template>+ <section class="landing-section">+ <h2>{{ messages.roadmap.title }}</h2>+ <ol class="timeline">+ <li v-for="stage in stages" :key="stage.label" class="stage" :data-state="stage.state">+ <span class="label">{{ stage.label }}</span>+ <ul>+ <li+ v-for="entry in stage.entries"+ :key="entry.title"+ class="entry"+ :data-lead="entry.lead || undefined"+ >+ <h3>{{ entry.title }}</h3>+ <p v-if="entry.detail">{{ entry.detail }}</p>+ <WaitlistForm v-if="entry.waitlist" class="waitlist" />+ <dl v-if="entry.features" class="landing-facts">+ <div v-for="feature in entry.features" :key="feature.title">+ <dt>{{ feature.title }}</dt>+ <dd>{{ feature.detail }}</dd>+ </div>+ </dl>+ </li>+ </ul>+ </li>+ </ol>+ <!-- The full roadmap exists only in English, so every locale links to that page. -->+ <a class="more" :href="localePath(LINKS.roadmap, { translated: false })">+ {{ messages.roadmap.more }}<IconArrowRight aria-hidden="true" />+ </a>+ </section>+</template>++<style scoped>+.timeline {+ --rail: 96px;++ position: relative;+ margin-top: 48px;+}++/* The rail: one line down the page with a marker per stage. */+.timeline::before {+ position: absolute;+ top: 8px;+ bottom: 8px;+ left: calc(var(--rail) + 5px);+ width: 1px;+ background: var(--vp-c-divider);+ content: '';+}++.stage {+ position: relative;+ padding-left: calc(var(--rail) + 40px);+}++.stage + .stage {+ margin-top: 72px;+}++.stage::before {+ position: absolute;+ top: 6px;+ left: var(--rail);+ width: 11px;+ height: 11px;+ border: 2px solid var(--vp-c-text-3);+ border-radius: 50%;+ background: var(--vp-c-bg);+ content: '';+}++.stage[data-state='current']::before {+ border-color: var(--vp-c-brand-1);+ background: var(--vp-c-brand-1);+}++.label {+ position: absolute;+ top: 0;+ left: 0;+ width: calc(var(--rail) - 20px);+ color: var(--vp-c-text-2);+ font-size: 14px;+ font-weight: 600;+ line-height: 24px;+ text-align: right;+}++.stage[data-state='current'] .label {+ color: var(--vp-c-brand-1);+}++.entry + .entry {+ margin-top: 28px;+}++/* What has shipped is a short list, not a set of plans. */+.stage[data-state='done']::before {+ border-color: var(--vp-c-text-3);+ background: var(--vp-c-text-3);+}++.stage[data-state='done'] .entry + .entry {+ margin-top: 8px;+}++.stage[data-state='done'] .entry h3 {+ color: var(--vp-c-text-2);+ font-size: 15px;+ font-weight: 500;+}++.entry h3 {+ font-size: 17px;+ font-weight: 600;+ line-height: 24px;+}++.entry > p {+ max-width: 560px;+ margin-top: 4px;+ color: var(--vp-c-text-2);+ font-size: 15px;+ line-height: 1.6;+}++/* The one entry presented as a feature block of its own. */+.entry[data-lead] {+ padding-bottom: 20px;+}++.entry[data-lead] h3 {+ font-size: clamp(22px, 3vw, 28px);+ font-weight: 700;+ letter-spacing: -0.015em;+ line-height: 1.2;+}++.entry[data-lead] > p {+ margin-top: 10px;+ font-size: 16px;+}++.entry[data-lead] .landing-facts {+ margin-top: 32px;+}++.more {+ display: inline-flex;+ align-items: center;+ gap: 6px;+ margin-top: 64px;+ color: var(--vp-c-brand-1);+ font-size: 15px;+ font-weight: 500;+ text-decoration: none;+}++.entry .waitlist {+ margin-top: 20px;+}++@media (max-width: 860px) {+ .timeline {+ --rail: 0px;+ }++ .stage {+ padding-left: 32px;+ }++ .label {+ position: static;+ display: block;+ width: auto;+ margin-bottom: 12px;+ text-align: left;+ }+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/stage/FeatureStage.vue b/packages/docs/.vitepress/theme/landing/stage/FeatureStage.vuenew file mode 100644index 000000000..efea65153--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/FeatureStage.vue@@ -0,0 +1,105 @@+<script setup lang="ts">+import { useIntersectionObserver, useMediaQuery } from '@vueuse/core'+import { MotionConfig } from 'motion-v'+import { TooltipProvider } from 'reka-ui'+import { defineAsyncComponent, ref, watch } from 'vue'++import { useI18n } from '@open-pencil/vue'++import { STAGES } from './definitions'+import { prepareEngine } from './engine-assets'+import type { SingleStageKind } from './kinds'+import StageCanvas from './StageCanvas.vue'+import { useDocsAppearance } from './useDocsAppearance'+import { useStageDocument } from './useStageDocument'+import { useWheelEngagement } from './useWheelEngagement'++// Only some stages show the toolbar or the preview pill, so the others never download them.+const Toolbar = defineAsyncComponent(() => import('@/components/toolbar/Toolbar.vue'))+const StagePreviewControls = defineAsyncComponent(() => import('./StagePreviewControls.vue'))++/** Stages mount a screen ahead of the viewport, so a block is live before it scrolls in. */+const MOUNT_MARGIN = '100% 0px'++const { kind } = defineProps<{ kind: SingleStageKind }>()+/** `start`: it begins loading as it nears the viewport. `ready`: its scene is on screen. */+const emit = defineEmits<{ start: []; ready: [] }>()+const definition = STAGES[kind]++useDocsAppearance()+const { panels } = useI18n()+const { build, focus, ready } = useStageDocument(definition.scene)+watch(ready, () => emit('ready'), { once: true })+const { engage, disengage, guardWheel } = useWheelEngagement()++// A stage mounts once, as the visitor approaches it, and then stays mounted: its canvas and+// WebGL context are created a single time and never torn down while the page is open.+const root = ref<HTMLElement | null>(null)+const mounted = ref(false)+const { stop } = useIntersectionObserver(+ root,+ async ([entry]) => {+ if (!entry?.isIntersecting) return+ stop()+ emit('start')+ await prepareEngine()+ mounted.value = true+ void build()+ },+ { rootMargin: MOUNT_MARGIN }+)++// Touch drags must scroll the page, so on touch devices the canvas is view-only.+const touch = useMediaQuery('(pointer: coarse)')+// The app's mobile toolbar is laid out for a full-screen canvas, not a card on a page.+const narrow = useMediaQuery('(max-width: 767px)')++function onPointerDown() {+ engage()+ focus()+}+</script>++<template>+ <MotionConfig reduced-motion="user">+ <TooltipProvider :delay-duration="400">+ <!-- Typography and selection behaviour the app sets on `body` in `src/app.css`. -->+ <div+ ref="root"+ class="op-app relative flex h-full overflow-hidden bg-canvas text-[13px] leading-normal text-surface select-none max-md:flex-col"+ @pointerdown.capture="onPointerDown"+ @focusin.capture="focus"+ @pointerleave="disengage"+ @wheel.capture="guardWheel"+ >+ <div+ data-poster-part="canvas"+ class="relative flex min-h-0 min-w-0 flex-1 bg-canvas"+ :class="touch && '*:pointer-events-none'"+ >+ <template v-if="mounted">+ <StageCanvas />+ <Toolbar v-if="definition.toolbar && !touch && !narrow" />+ <StagePreviewControls v-if="definition.preview" />+ </template>+ </div>++ <aside+ v-if="definition.panel"+ data-poster-part="panel"+ class="flex w-72 shrink-0 flex-col overflow-hidden border-l border-border bg-panel max-md:h-64 max-md:w-full max-md:border-t max-md:border-l-0"+ >+ <template v-if="mounted">+ <header+ v-if="definition.layersHeading"+ class="shrink-0 px-3 py-2 text-[11px] font-semibold text-surface"+ >+ {{ panels.layers }}+ </header>+ <component :is="definition.panel" v-bind="definition.panelProps" />+ </template>+ </aside>+ </div>+ </TooltipProvider>+ </MotionConfig>+</template>diff --git a/packages/docs/.vitepress/theme/landing/stage/StageCanvas.vue b/packages/docs/.vitepress/theme/landing/stage/StageCanvas.vuenew file mode 100644index 000000000..d165a31f5--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/StageCanvas.vue@@ -0,0 +1,98 @@+<script setup lang="ts">+import { computed, ref, useTemplateRef } from 'vue'++import {+ PlayIslands,+ toolCursor,+ useCanvas,+ useCanvasInput,+ useCanvasIssueMarkers,+ useTextEdit+} from '@open-pencil/vue'++import { useEditorStore } from '@/app/editor/active-store'+import { useFollowView } from '@/app/presence/follow-view'+import IssueMarkerTooltip from '@/components/design-check/IssueMarkerTooltip.vue'+import PreparationOverlay from '@/components/preparation/canvas/Overlay.vue'+import FollowFrame from '@/components/presence/FollowFrame.vue'++/**+ * One WebGL canvas per stage. The app's `EditorCanvas` splits the scene and its overlays+ * across two contexts, which is right for a full-window editor but would put a page of+ * stages past the browser's context limit. This is the SDK's single-canvas path with the+ * same input handling, preview islands, lint markers, follow frame, and loading overlay.+ */+const emit = defineEmits<{+ /** The pointer moved over the canvas, in canvas coordinates, for a room's cursor. */+ cursor: [x: number, y: number]+}>()++const store = useEditorStore()+const canvasRef = ref<HTMLCanvasElement | null>(null)++const shouldSuspendRender = () =>+ store.state.preparation !== null &&+ store.state.preparation.kind !== 'font-retry' &&+ store.state.preparation.phase !== 'preparing-render'++const { hitTestSectionTitle, hitTestComponentLabel, hitTestFrameTitle, hitTestIssueMarker } =+ useCanvas(canvasRef, store, {+ showRulers: false,+ shouldSuspendRender,+ onReady: store.markCanvasReady,+ onViewportResize: (width, height) => store.setViewportSize(width, height),+ onPresented: ({ sceneVersion }) =>+ store.preparationController.acknowledgePresentation(sceneVersion)+ })++const { cursorOverride } = useCanvasInput(+ canvasRef,+ store,+ hitTestSectionTitle,+ hitTestComponentLabel,+ hitTestFrameTitle,+ (x, y) => emit('cursor', x, y)+)+useTextEdit(canvasRef, store)++// The same marker behaviour as the app's canvas, minus switching a properties tab: a stage's+// lint panel is always the one beside it.+const { detailMarker, cursor: issueMarkerCursor } = useCanvasIssueMarkers(canvasRef, store, {+ hitTest: hitTestIssueMarker,+ onHover: (marker) => store.designCheck.highlightMarker(marker?.nodeIds ?? null),+ onActivate: (marker) => {+ const nodeIds = marker.direction ? marker.nodeIds.slice(0, 1) : marker.nodeIds+ store.designCheck.openMarker(nodeIds)+ if (marker.direction) store.revealNodes(nodeIds)+ }+})++// Following a person or an agent frames the canvas and says who, as in the app.+const followView = useFollowView(useTemplateRef<HTMLElement>('area'), store)++const cursor = computed(() =>+ toolCursor(store.state.activeTool, issueMarkerCursor.value ?? cursorOverride.value)+)+</script>++<template>+ <div ref="area" class="relative min-h-0 min-w-0 flex-1 overflow-hidden">+ <canvas+ ref="canvasRef"+ tabindex="-1"+ :style="{ cursor }"+ class="absolute inset-0 block size-full touch-none outline-none"+ />+ <PlayIslands :view="store.state" :canvas="canvasRef" />+ <IssueMarkerTooltip :marker="detailMarker" :canvas="canvasRef" />+ <FollowFrame+ v-if="followView.label.value"+ :followed="followView.label.value"+ @stop="followView.stop"+ />+ <PreparationOverlay+ v-if="store.state.preparation && store.state.preparation.kind !== 'font-retry'"+ :preparation="store.state.preparation"+ />+ </div>+</template>diff --git a/packages/docs/.vitepress/theme/landing/stage/StagePreviewControls.vue b/packages/docs/.vitepress/theme/landing/stage/StagePreviewControls.vuenew file mode 100644index 000000000..38d0e2442--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/StagePreviewControls.vue@@ -0,0 +1,54 @@+<script setup lang="ts">+import { tinykeys } from 'tinykeys'+import { onScopeDispose } from 'vue'++import { useI18n } from '@open-pencil/vue'++import { getActiveEditorStoreOrNull, useEditorStore } from '@/app/editor/active-store'+import { appMenuShortcutLabel, appMenuTinykeysShortcut } from '@/app/shell/menu/shortcut'+import WorkspacePill from '@/components/editor/WorkspacePill.vue'+import AppButton from '@/components/ui/button/AppButton.vue'++const PREVIEW_COMMAND = 'toggle-preview'++/**+ * The app's preview pill while the stage previews, and a way back into preview while it+ * edits. The app's own preview shortcut works too, for the stage the visitor last used.+ */+const store = useEditorStore()+const { menu } = useI18n()+const shortcut = appMenuShortcutLabel(PREVIEW_COMMAND) ?? ''++const keys = appMenuTinykeysShortcut(PREVIEW_COMMAND)+if (keys) {+ const unsubscribe = tinykeys(window, {+ [keys]: (event) => {+ if (getActiveEditorStoreOrNull() !== store) return+ event.preventDefault()+ store.togglePlay()+ }+ })+ onScopeDispose(unsubscribe)+}+</script>++<template>+ <WorkspacePill+ v-if="store.state.play"+ mode="preview"+ :document-name="store.state.documentName"+ :shortcut="shortcut"+ @reset="store.resetPlay()"+ @leave="store.stopPlay()"+ />+ <AppButton+ v-else+ class="absolute top-7 left-7 z-10 shadow-sm"+ variant="outline"+ size="sm"+ @click="store.startPlay()"+ >+ <template #leading><icon-lucide-play /></template>+ {{ menu.togglePreview }}+ </AppButton>+</template>diff --git a/packages/docs/.vitepress/theme/landing/stage/ai/AIChatPanel.vue b/packages/docs/.vitepress/theme/landing/stage/ai/AIChatPanel.vuenew file mode 100644index 000000000..40629e355--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/ai/AIChatPanel.vue@@ -0,0 +1,65 @@+<script setup lang="ts">+import { useLandingMessages } from '#docs/theme/landing/content/messages'+import { isPosterCapture } from '#docs/theme/landing/posters'+import { useIntersectionObserver } from '@vueuse/core'+import { ref } from 'vue'+import IconPlay from '~icons/lucide/play'+import IconRotateCcw from '~icons/lucide/rotate-ccw'++import { useEditorStore } from '@/app/editor/active-store'+import ChatTranscript from '@/components/chat/ChatTranscript.vue'+import FollowAgentsToggle from '@/components/chat/FollowAgentsToggle.vue'+import AppButton from '@/components/ui/button/AppButton.vue'++import { useRecordedChat } from './useRecordedChat'++/** How much of the panel must be on screen before the turn plays by itself. */+const AUTOPLAY_THRESHOLD = 0.6++const messages = useLandingMessages()+const store = useEditorStore()+const {+ messages: transcript,+ status,+ running,+ played,+ play+} = useRecordedChat(store, () => messages.value.stage.ai)++// Plays once when the visitor reaches the block, not while it mounts a screen ahead. A still+// of the stage shows it before the turn, so the capture never starts it.+const root = ref<HTMLElement | null>(null)+const { stop } = useIntersectionObserver(+ root,+ ([entry]) => {+ if (!entry?.isIntersecting || isPosterCapture()) return+ stop()+ void play()+ },+ { threshold: AUTOPLAY_THRESHOLD }+)+</script>++<template>+ <section ref="root" class="flex min-h-0 flex-1 flex-col bg-panel" aria-label="AI chat">+ <header+ class="flex shrink-0 items-center gap-2 border-b border-border px-3 py-2 text-[11px] font-semibold text-surface"+ >+ <icon-lucide-sparkles class="size-3.5 text-muted" aria-hidden="true" />+ AI+ <span class="ml-auto font-normal text-muted">{{ messages.stage.ai.recorded }}</span>+ <FollowAgentsToggle :store="store" />+ </header>+ <!-- The reasoning stays open: it is what explains the turn to a first-time visitor. -->+ <ChatTranscript :messages="transcript" :status="status" reasoning-display="expanded" />+ <div class="flex shrink-0 justify-end border-t border-border px-3 py-2">+ <AppButton variant="outline" size="xs" shape="pill" :disabled="running" @click="play">+ <template #leading>+ <IconRotateCcw v-if="played" />+ <IconPlay v-else />+ </template>+ {{ played ? messages.stage.ai.replay : messages.stage.ai.play }}+ </AppButton>+ </div>+ </section>+</template>diff --git a/packages/docs/.vitepress/theme/landing/stage/ai/recorded-model.ts b/packages/docs/.vitepress/theme/landing/stage/ai/recorded-model.tsnew file mode 100644index 000000000..b30b665b1--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/ai/recorded-model.ts@@ -0,0 +1,130 @@+import { promiseTimeout } from '@vueuse/core'+import { MockLanguageModelV4 } from 'ai/test'++type ModelStream = Awaited<ReturnType<MockLanguageModelV4['doStream']>>+type ModelChunk = ModelStream['stream'] extends ReadableStream<infer Chunk> ? Chunk : never++export interface RecordedTurn {+ reasoning: string+ /** Input of the one `render` tool call, streamed as the model would. */+ render: { parent_id: string; jsx: string }+ reply: string+}++/** Token usage the agent loop requires; nothing on the page reads it. */+const USAGE = {+ inputTokens: { total: 0, noCache: 0, cacheRead: undefined, cacheWrite: undefined },+ outputTokens: { total: 0, text: 0, reasoning: undefined }+}++/**+ * How long the stream waits before each kind of chunk, in milliseconds. A visitor who has never+ * seen an agent at work needs time to read the reasoning and watch the canvas fill.+ */+export interface StreamPace {+ /** Before the first chunk of each step, as a model takes a moment to start answering. */+ start: number+ /** Before each word of reasoning, which only needs to be skimmed. */+ reasoning: number+ /** Before each word of the reply. */+ word: number+ /** Between the reasoning and the tool call, and before the reply starts. */+ pause: number+ /** Before each piece of the tool call's arguments, which the canvas previews as they arrive. */+ argument: number+}++const ARGUMENT_CHUNK_LENGTH = 12+const WORD_CHUNK = /\S+\s*/g++interface PacedChunk {+ chunk: ModelChunk+ /** Which of the pace's waits comes before this chunk, if any. */+ wait?: keyof StreamPace+}++function split(text: string, length: number): string[] {+ const chunks: string[] = []+ for (let offset = 0; offset < text.length; offset += length) {+ chunks.push(text.slice(offset, offset + length))+ }+ return chunks+}++/** The first step: reasoning, then the `render` call with its arguments arriving in pieces. */+function toolStep({ reasoning, render }: RecordedTurn): PacedChunk[] {+ const input = JSON.stringify(render)+ return [+ { chunk: { type: 'stream-start', warnings: [] }, wait: 'start' },+ { chunk: { type: 'reasoning-start', id: 'reasoning' } },+ ...(reasoning.match(WORD_CHUNK) ?? []).map((delta): PacedChunk => ({+ chunk: { type: 'reasoning-delta', id: 'reasoning', delta },+ wait: 'reasoning'+ })),+ { chunk: { type: 'reasoning-end', id: 'reasoning' } },+ { chunk: { type: 'tool-input-start', id: 'render-call', toolName: 'render' }, wait: 'pause' },+ ...split(input, ARGUMENT_CHUNK_LENGTH).map((delta): PacedChunk => ({+ chunk: { type: 'tool-input-delta', id: 'render-call', delta },+ wait: 'argument'+ })),+ { chunk: { type: 'tool-input-end', id: 'render-call' } },+ { chunk: { type: 'tool-call', toolCallId: 'render-call', toolName: 'render', input } },+ {+ chunk: {+ type: 'finish',+ usage: USAGE,+ finishReason: { unified: 'tool-calls', raw: 'tool_calls' }+ }+ }+ ]+}++/** The second step, after the tool result: the closing reply. */+function replyStep({ reply }: RecordedTurn): PacedChunk[] {+ return [+ { chunk: { type: 'stream-start', warnings: [] }, wait: 'pause' },+ { chunk: { type: 'text-start', id: 'reply' } },+ ...(reply.match(WORD_CHUNK) ?? []).map((delta): PacedChunk => ({+ chunk: { type: 'text-delta', id: 'reply', delta },+ wait: 'word'+ })),+ { chunk: { type: 'text-end', id: 'reply' } },+ { chunk: { type: 'finish', usage: USAGE, finishReason: { unified: 'stop', raw: 'stop' } } }+ ]+}++/**+ * Streams the chunks, waiting before each as the pace says, or not at all without one. Pulled+ * one chunk at a time, so a stopped chat stops the playback too.+ */+function playback(chunks: PacedChunk[], pace: StreamPace | null): ReadableStream<ModelChunk> {+ let index = 0+ return new ReadableStream<ModelChunk>({+ async pull(controller) {+ if (index >= chunks.length) {+ controller.close()+ return+ }+ const next = chunks[index++]+ const wait = pace && next.wait ? pace[next.wait] : 0+ if (wait > 0) await promiseTimeout(wait)+ controller.enqueue(next.chunk)+ }+ })+}++/**+ * A language model that plays back one recorded turn, built from the AI SDK's own test+ * helpers. The agent loop, the `render` tool, its streamed canvas preview, and the undo step+ * all run for real; only the provider is replaced. Without a `pace`, it streams at once.+ */+export function createRecordedModel(turn: RecordedTurn, pace: StreamPace | null) {+ return new MockLanguageModelV4({+ async doStream({ prompt }) {+ const answered = prompt.some((message) => message.role === 'tool')+ return {+ stream: playback(answered ? replyStep(turn) : toolStep(turn), pace)+ }+ }+ })+}diff --git a/packages/docs/.vitepress/theme/landing/stage/ai/useRecordedChat.ts b/packages/docs/.vitepress/theme/landing/stage/ai/useRecordedChat.tsnew file mode 100644index 000000000..febe4fa49--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/ai/useRecordedChat.ts@@ -0,0 +1,118 @@+import { Chat } from '@ai-sdk/vue'+import { usePreferredReducedMotion } from '@vueuse/core'+import type { UIMessage } from 'ai'+import { computed, onScopeDispose, shallowRef } from 'vue'++import { CHAPTERS } from '@open-pencil/demo-tools/chapters'++import { createToolLoopTransport } from '@/app/ai/chat/transports'+import type { EditorStore } from '@/app/editor/active-store'+import { getTabForStore, switchTab } from '@/app/tabs'++import { findByName, reframeStage } from '../scenes'+import { createRecordedModel, type StreamPace } from './recorded-model'++/** The hero frame, which lays out the player and whatever the turn adds beside it in a row. */+const ARTBOARD_NAME = CHAPTERS.hello.subject+const RESULT_NAME = 'Up next'++const UP_NEXT = [+ { title: 'Side B', artist: 'The Tapes', length: '3:12' },+ { title: 'Lo-fi Hours', artist: 'Various', length: '4:05' },+ { title: 'Night Shift', artist: 'Lumen', length: '2:48' }+]++/**+ * The card the turn adds. Its colors and radius are the tour's Theme variables, as the player's+ * are, so it switches between dark and light with the player and the docs site. The hero spaces+ * its row by nothing, so the card keeps its distance from the player with padding of its own.+ */+const UP_NEXT_JSX = [+ `<Frame name="${RESULT_NAME}" w="hug" h="hug" pl={24}>`,+ ` <Frame name="Queue" w={280} h="hug" flex="col" gap={14} p={20} bg={designVar('Surface')} rounded={designVar('Radius')}>`,+ ` <Text name="Heading" size={14} weight={600} color={designVar('Text')}>${RESULT_NAME}</Text>`,+ ...UP_NEXT.flatMap(({ title, artist, length }) => [+ ' <Frame name="Track" w="fill" h="hug" flex="row" gap={12} items="center">',+ ` <Frame name="Cover" w={40} h={40} rounded={designVar('Radius/Control')} bg={designVar('Surface/Raised')} />`,+ ' <Frame name="Names" grow={1} h="hug" flex="col" gap={2}>',+ ` <Text name="Title" size={13} weight={500} color={designVar('Text')}>${title}</Text>`,+ ` <Text name="Artist" size={12} color={designVar('Text/Muted')}>${artist}</Text>`,+ ' </Frame>',+ ` <Text name="Length" size={12} color={designVar('Text/Muted')}>${length}</Text>`,+ ' </Frame>'+ ]),+ ' </Frame>',+ '</Frame>'+].join('\n')+/**+ * Slow enough to follow the first time without waiting on the agent: the reasoning streams+ * quickly enough to skim, the cards build up on the canvas over a few seconds, and the reply+ * reads at an easy pace. A whole turn takes about ten seconds.+ */+const PACE: StreamPace = { start: 500, reasoning: 35, word: 110, pause: 500, argument: 55 }+const OUTPUT_TOKEN_LIMIT = 4096++export interface RecordedChatCopy {+ request: string+ reasoning: string+ reply: string+}++/**+ * Plays a recorded turn through the app's own tool-loop transport, so the transcript, the+ * streamed canvas preview, the committed design, and its undo step all come from the real+ * agent path. Each replay starts from the scene as built, without the previous result.+ */+export function useRecordedChat(store: EditorStore, copy: () => RecordedChatCopy) {+ const reducedMotion = usePreferredReducedMotion()+ const chat = shallowRef<Chat<UIMessage> | null>(null)+ let disposed = false+ // A call rather than the flag itself, which a check before an await would narrow for good.+ const isDisposed = () => disposed+ onScopeDispose(() => {+ disposed = true+ void chat.value?.stop()+ })++ const messages = computed(() => chat.value?.messages ?? [])+ const status = computed(() => chat.value?.status ?? 'ready')+ const running = computed(() => status.value === 'submitted' || status.value === 'streaming')+ const played = computed(() => messages.value.length > 0)++ function clearPreviousResult(): void {+ const previous = findByName(store, RESULT_NAME)+ if (!previous) return+ store.graph.deleteNode(previous)+ store.requestRender()+ }++ async function play(): Promise<void> {+ const parentId = findByName(store, ARTBOARD_NAME)+ if (running.value || isDisposed() || !parentId) return+ clearPreviousResult()+ // The canvas previews streamed JSX only for the active document, as the app's chat does.+ const tab = getTabForStore(store)+ if (tab) switchTab(tab.id)+ const { request, reasoning, reply } = copy()+ const model = createRecordedModel(+ { reasoning, reply, render: { parent_id: parentId, jsx: UP_NEXT_JSX } },+ reducedMotion.value === 'reduce' ? null : PACE+ )+ chat.value = new Chat<UIMessage>({+ transport: createToolLoopTransport({+ store,+ providerID: 'openai',+ model,+ effectiveModelID: model.modelId,+ maxOutputTokens: OUTPUT_TOKEN_LIMIT,+ thinkingLevel: () => 'off'+ })+ })+ await chat.value.sendMessage({ text: request })+ // The view follows the agent while it works; afterwards it frames the hero with the new card+ // beside the player, which also ends following, as any view change of the person's own does.+ if (!isDisposed()) reframeStage(store)+ }++ return { messages, status, running, played, play }+}diff --git a/packages/docs/.vitepress/theme/landing/stage/app-plugins.ts b/packages/docs/.vitepress/theme/landing/stage/app-plugins.tsnew file mode 100644index 000000000..4e4710b4f--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/app-plugins.ts@@ -0,0 +1,20 @@+import type { App } from 'vue'+import { createMemoryHistory, createRouter } from 'vue-router'++import { createRetainedScopePlugin } from '@open-pencil/vue'++const installed = new WeakSet<App>()++/**+ * What `src/boot.ts` installs for the app. App panels read the route, and VitePress has no+ * vue-router, so the page gets a private in-memory one that never touches the URL.+ */+export function installAppPlugins(app: App): void {+ if (installed.has(app)) return+ installed.add(app)+ const router = createRouter({+ history: createMemoryHistory(),+ routes: [{ path: '/:pathMatch(.*)*', component: { render: () => null } }]+ })+ app.use(createRetainedScopePlugin()).use(router)+}diff --git a/packages/docs/.vitepress/theme/landing/stage/collab/CollabPane.vue b/packages/docs/.vitepress/theme/landing/stage/collab/CollabPane.vuenew file mode 100644index 000000000..6bd069102--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/collab/CollabPane.vue@@ -0,0 +1,125 @@+<script setup lang="ts">+import { useLandingMessages } from '#docs/theme/landing/content/messages'+import { until, useMediaQuery } from '@vueuse/core'+import { onMounted, onScopeDispose, shallowRef, watch } from 'vue'+import IconSparkles from '~icons/lucide/sparkles'++import { CHAPTERS } from '@open-pencil/demo-tools/chapters'+import { colorToCSS } from '@open-pencil/scene-graph/color'++import type { useCollabIdentity } from '@/app/collab/identity'+import { openRoomSession, type RoomSession } from '@/app/collab/session'+import type { JoinCollabRoom } from '@/app/collab/transport'+import type { EditorStore } from '@/app/editor/active-store'+import AppButton from '@/components/ui/button/AppButton.vue'++import { useRecordedChat } from '../ai/useRecordedChat'+import { chapterSubject, frameStage, SCENES } from '../scenes'+import StageCanvas from '../StageCanvas.vue'+import { useStageDocument } from '../useStageDocument'+import { useWheelEngagement } from '../useWheelEngagement'++const { role, joinRoom, roomId, identity, label } = defineProps<{+ /** The host shares its document into the room; the guest opens it from there. */+ role: 'host' | 'guest'+ joinRoom: JoinCollabRoom+ roomId: string+ identity: Pick<ReturnType<typeof useCollabIdentity>, 'name' | 'color'>+ label: string+}>()+const emit = defineEmits<{ ready: [] }>()++const messages = useLandingMessages()+const session = shallowRef<RoomSession | null>(null)++/** Nothing about a landing room should outlive the page, so its copy stays in memory. */+const memoryCopy = () => ({ whenSynced: Promise.resolve(), destroy: () => undefined })++function openRoom(store: EditorStore, origin: 'shared' | 'joined'): RoomSession {+ const opened = openRoomSession({+ roomId,+ store,+ origin,+ joinRoom,+ identity,+ openSavedCopy: memoryCopy+ })+ session.value = opened+ return opened+}++async function hostScene(store: EditorStore): Promise<void> {+ await SCENES.heroStill(store)+ openRoom(store, 'shared').shareDocument()+}++/** The guest waits for the host's document, as a teammate opening a shared link would. */+async function guestScene(store: EditorStore): Promise<void> {+ const joined = openRoom(store, 'joined')+ await until(joined.hasDocument).toBe(true)+ // The document arrives before its layers reach the page on screen; fit once they have.+ await until(() => store.graph.getChildren(store.state.currentPageId).length > 0).toBe(true)+ await new Promise((resolve) => {+ requestAnimationFrame(resolve)+ })+ frameStage(store, chapterSubject(store, CHAPTERS.hello))+}++const { store, build, focus, ready } = useStageDocument(role === 'host' ? hostScene : guestScene)+watch(ready, () => emit('ready'), { once: true })+const { engage, disengage, guardWheel } = useWheelEngagement()+const touch = useMediaQuery('(pointer: coarse)')++onMounted(() => void build())+onScopeDispose(() => session.value?.dispose())++const stopSelection = store.onEditorEvent('selection:changed', (ids) =>+ session.value?.updateSelection(ids)+)+onScopeDispose(stopSelection)++function publishCursor(x: number, y: number) {+ session.value?.updateCursor(x, y, store.state.currentPageId)+}++// The host's agent plays the recorded turn; the guest sees it work through the room.+const agent = role === 'host' ? useRecordedChat(store, () => messages.value.stage.ai) : null++function onPointerDown() {+ engage()+ focus()+}+</script>++<template>+ <section class="relative flex min-h-0 min-w-0 flex-1 flex-col" :aria-label="label">+ <header+ class="flex h-9 shrink-0 items-center gap-2 border-b border-border bg-panel px-3 text-[11px] font-semibold text-surface"+ >+ <span class="size-2 rounded-full" :style="{ background: colorToCSS(identity.color) }" />+ {{ label }}+ <AppButton+ v-if="agent"+ class="ml-auto"+ variant="outline"+ size="xs"+ shape="pill"+ :disabled="agent.running.value"+ @click="agent.play"+ >+ <template #leading><IconSparkles /></template>+ {{ messages.stage.collab.askAgent }}+ </AppButton>+ </header>+ <div+ class="relative flex min-h-0 flex-1"+ :class="touch && '*:pointer-events-none'"+ @pointerdown.capture="onPointerDown"+ @focusin.capture="focus"+ @pointerleave="disengage"+ @wheel.capture="guardWheel"+ >+ <StageCanvas @cursor="publishCursor" />+ </div>+ </section>+</template>diff --git a/packages/docs/.vitepress/theme/landing/stage/collab/CollabStage.vue b/packages/docs/.vitepress/theme/landing/stage/collab/CollabStage.vuenew file mode 100644index 000000000..2767953ce--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/collab/CollabStage.vue@@ -0,0 +1,84 @@+<script setup lang="ts">+import { useLandingMessages } from '#docs/theme/landing/content/messages'+import { useIntersectionObserver } from '@vueuse/core'+import { MotionConfig } from 'motion-v'+import { TooltipProvider } from 'reka-ui'+import { computed, ref } from 'vue'++import { BLACK, type Color } from '@open-pencil/scene-graph'++import { PEER_COLORS } from '@/constants'++import { prepareEngine } from '../engine-assets'+import CollabPane from './CollabPane.vue'+import { createLocalRoom } from './local-room'++/** Stages mount a screen ahead of the viewport, so a block is live before it scrolls in. */+const MOUNT_MARGIN = '100% 0px'+const ROOM_ID = 'landing'+/** The other person in the room. A name, so it is not translated. */+const TEAMMATE = 'Sam'++const messages = useLandingMessages()+const joinRoom = createLocalRoom()++// Both screens are the visitor's to use; each shows the other as a named person.+/** The app's peer palette: blue for the visitor, purple for the teammate. */+const peerColor = (index: number): Color => PEER_COLORS[index] ?? BLACK+const you = { name: computed(() => messages.value.stage.collab.you), color: peerColor(1) }+const teammate = { name: computed(() => TEAMMATE), color: peerColor(4) }++/** `start`: it begins loading as it nears the viewport. `ready`: both screens show the document. */+const emit = defineEmits<{ start: []; ready: [] }>()+const panesReady = ref(0)+function paneReady(): void {+ panesReady.value += 1+ if (panesReady.value === 2) emit('ready')+}++const root = ref<HTMLElement | null>(null)+const mounted = ref(false)+const { stop } = useIntersectionObserver(+ root,+ async ([entry]) => {+ if (!entry?.isIntersecting) return+ stop()+ emit('start')+ await prepareEngine()+ mounted.value = true+ },+ { rootMargin: MOUNT_MARGIN }+)+</script>++<template>+ <MotionConfig reduced-motion="user">+ <TooltipProvider :delay-duration="400">+ <!-- Typography and selection behaviour the app sets on `body` in `src/app.css`. -->+ <div+ ref="root"+ class="op-app relative flex h-full overflow-hidden bg-canvas text-[13px] leading-normal text-surface select-none max-md:flex-col"+ >+ <template v-if="mounted">+ <CollabPane+ role="host"+ :join-room="joinRoom"+ :room-id="ROOM_ID"+ :identity="you"+ :label="messages.stage.collab.yourScreen"+ @ready="paneReady"+ />+ <div class="w-px shrink-0 bg-border max-md:h-px max-md:w-full" />+ <CollabPane+ role="guest"+ :join-room="joinRoom"+ :room-id="ROOM_ID"+ :identity="teammate"+ :label="messages.stage.collab.theirScreen"+ @ready="paneReady"+ />+ </template>+ </div>+ </TooltipProvider>+ </MotionConfig>+</template>diff --git a/packages/docs/.vitepress/theme/landing/stage/collab/local-room.ts b/packages/docs/.vitepress/theme/landing/stage/collab/local-room.tsnew file mode 100644index 000000000..a3e1fce19--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/collab/local-room.ts@@ -0,0 +1,79 @@+import type {+ CollabActionReceiver,+ CollabRoomTransport,+ JoinCollabRoom+} from '@/app/collab/transport'++interface LocalPeer {+ id: string+ receivers: Map<string, CollabActionReceiver[]>+ onJoin: ((peerId: string) => void)[]+ onLeave: ((peerId: string) => void)[]+}++/** Peers learn about each other on a later task, after the session has set up its handlers. */+function later(callback: () => void): void {+ setTimeout(callback, 0)+}++/**+ * A room whose peers all live on this page. It implements the same transport the app's+ * peer-to-peer rooms use, so two editors on the landing sync through the app's real room+ * sessions, with nothing leaving the page and no signalling service involved.+ */+export function createLocalRoom(): JoinCollabRoom {+ const peers = new Map<string, LocalPeer>()+ let nextId = 0++ return () => {+ const self: LocalPeer = {+ id: `local-${++nextId}`,+ receivers: new Map(),+ onJoin: [],+ onLeave: []+ }+ const others = () => [...peers.values()].filter((peer) => peer !== self)++ later(() => {+ for (const other of others()) {+ for (const handler of other.onJoin) handler(self.id)+ for (const handler of self.onJoin) handler(other.id)+ }+ })+ peers.set(self.id, self)++ const transport: CollabRoomTransport = {+ makeAction(namespace) {+ const send = (data: Uint8Array, peerId?: string) => {+ // A copy, as a network would deliver, so no peer shares the sender's buffer.+ const payload = data.slice()+ later(() => {+ for (const other of others()) {+ if (peerId && other.id !== peerId) continue+ for (const receive of other.receivers.get(namespace) ?? []) receive(payload, self.id)+ }+ })+ }+ const receive = (handler: CollabActionReceiver) => {+ self.receivers.set(namespace, [...(self.receivers.get(namespace) ?? []), handler])+ }+ return [send, receive]+ },+ onPeerJoin(handler) {+ self.onJoin.push(handler)+ },+ onPeerLeave(handler) {+ self.onLeave.push(handler)+ },+ signalingConnected: () => true,+ discoveryMs: 0,+ // Both screens are in one page, so there is no one to hear.+ media: null,+ async leave() {+ peers.delete(self.id)+ for (const other of others()) for (const handler of other.onLeave) handler(self.id)+ }+ }+ return transport+ }+}diff --git a/packages/docs/.vitepress/theme/landing/stage/definitions.ts b/packages/docs/.vitepress/theme/landing/stage/definitions.tsnew file mode 100644index 000000000..c6417b119--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/definitions.ts@@ -0,0 +1,49 @@+import { defineAsyncComponent, type Component } from 'vue'++import type { SingleStageKind } from './kinds'+import { SCENES, type SceneBuilder } from './scenes'++// Each panel is its own chunk, so a stage downloads only the panel it shows: the AI SDK+// comes with the AI block, CodeMirror with the code blocks, and so on.+const CodePanel = defineAsyncComponent(() => import('@/components/CodePanel.vue'))+const DesignCheckPanel = defineAsyncComponent(+ () => import('@/components/design-check/DesignCheckPanel.vue')+)+const DesignPanel = defineAsyncComponent(() => import('@/components/DesignPanel.vue'))+const LayerTree = defineAsyncComponent(() => import('@/components/LayerTree/LayerTree.vue'))+const TokensPanel = defineAsyncComponent(() => import('@/components/variables/TokensPanel.vue'))+const AIChatPanel = defineAsyncComponent(() => import('./ai/AIChatPanel.vue'))+const SdkSnippetPanel = defineAsyncComponent(() => import('./panels/SdkSnippetPanel.vue'))+const TerminalPanel = defineAsyncComponent(() => import('./panels/TerminalPanel.vue'))++export interface StageDefinition {+ scene: SceneBuilder+ panel?: Component+ panelProps?: Record<string, unknown>+ /** The app nests the layer tree under a "Layers" heading; the stage supplies it. */+ layersHeading?: boolean+ toolbar?: boolean+ /** The scene starts in preview, with the app's pill to reset it or go back to editing. */+ preview?: boolean+}++export const STAGES: Record<SingleStageKind, StageDefinition> = {+ figma: { scene: SCENES.figma, panel: LayerTree, layersHeading: true },+ design: { scene: SCENES.slots, panel: DesignPanel, toolbar: true },+ interactive: { scene: SCENES.hero, panel: DesignPanel, preview: true },+ tokens: { scene: SCENES.modes, panel: TokensPanel },+ shaders: { scene: SCENES.shaders, panel: DesignPanel, preview: true },+ // The Lint tab is always open: a stage's panel is always the one on screen.+ linting: {+ scene: SCENES.lint,+ panel: DesignCheckPanel,+ panelProps: { active: true, initialScope: 'selection' }+ },+ // The recorded turn adds a card beside the player in the hero.+ ai: { scene: SCENES.heroStill, panel: AIChatPanel },+ // Opens on the selection as a Vue component; the panel switches to React, HTML, or design JSX.+ code: { scene: SCENES.code, panel: CodePanel, panelProps: { initialSource: 'vue' } },+ // The terminal's scripts recolor the players' accent and add a player to the row.+ script: { scene: SCENES.players, panel: TerminalPanel },+ sdk: { scene: SCENES.controls, panel: SdkSnippetPanel, toolbar: true }+}diff --git a/packages/docs/.vitepress/theme/landing/stage/engine-assets.ts b/packages/docs/.vitepress/theme/landing/stage/engine-assets.tsnew file mode 100644index 000000000..d60b19133--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/engine-assets.ts@@ -0,0 +1,28 @@+import canvasKitWasm from 'canvaskit-wasm/bin/canvaskit.wasm?url'++import { getCanvasKit } from '@open-pencil/core/canvaskit'++import { installBundledFonts } from '@/app/editor/fonts/bundled'++/**+ * Core expects CanvasKit's binary at the site root, which the app arranges by copying it+ * into `public/`. The landing imports it as an asset instead, and fonts come through the+ * app's own `installBundledFonts()`, so Vite serves both in development and emits them with+ * the build.+ */+let ready: Promise<void> | null = null++/** Loads CanvasKit from the emitted binary. Stages await it before mounting a canvas. */+export function prepareEngine(): Promise<void> {+ if (ready) return ready+ const request = (async () => {+ installBundledFonts()+ await getCanvasKit({ locateFile: () => canvasKitWasm })+ })()+ // A failed download is tried again by the next stage rather than shared.+ request.catch(() => {+ if (ready === request) ready = null+ })+ ready = request+ return request+}diff --git a/packages/docs/.vitepress/theme/landing/stage/kinds.ts b/packages/docs/.vitepress/theme/landing/stage/kinds.tsnew file mode 100644index 000000000..219907d19--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/kinds.ts@@ -0,0 +1,4 @@+import type { FeatureKind } from '../content/features'++/** Stages with one editor; the collaboration stage composes two of its own. */+export type SingleStageKind = Exclude<FeatureKind, 'collab'>diff --git a/packages/docs/.vitepress/theme/landing/stage/panels/SdkSnippetPanel.vue b/packages/docs/.vitepress/theme/landing/stage/panels/SdkSnippetPanel.vuenew file mode 100644index 000000000..df6cc33f3--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/panels/SdkSnippetPanel.vue@@ -0,0 +1,90 @@+<script setup lang="ts">+import { useLandingMessages } from '#docs/theme/landing/content/messages'+import { COPIED_MS } from '#docs/theme/landing/ui/copy'+import { useClipboard } from '@vueuse/core'+import dedent from 'dedent'++import CodeEditor from '@/components/code-editor/CodeEditor.vue'+import IconButton from '@/components/ui/button/IconButton.vue'++// A literal closing tag here would end this component's own script block.+const CLOSE_SCRIPT = `</${'script'}>`++/** The smallest working canvas: the same shape as `packages/vue/src/canvas/examples`. */+const SNIPPET = dedent`+ <script setup lang="ts">+ import { createEditor } from '@open-pencil/core/editor'+ import {+ CanvasRoot,+ CanvasSurface,+ provideEditor+ } from '@open-pencil/vue'++ const editor = createEditor()+ provideEditor(editor)+ ${CLOSE_SCRIPT}++ <template>+ <CanvasRoot>+ <CanvasSurface class="size-full" />+ </CanvasRoot>+ </template>+`++/** What the snippet needs installed, shown on two lines and copied as one command. */+const INSTALL_PACKAGES = ['@open-pencil/core', '@open-pencil/vue', 'canvaskit-wasm'] as const+const INSTALL = `bun add ${INSTALL_PACKAGES.join(' ')}`+const FILE_NAME = 'Canvas.vue'++const messages = useLandingMessages()+const snippetClipboard = useClipboard({ copiedDuring: COPIED_MS })+const installClipboard = useClipboard({ copiedDuring: COPIED_MS })+</script>++<template>+ <section class="flex min-h-0 flex-1 flex-col bg-panel" aria-label="SDK example">+ <header+ class="flex shrink-0 items-center gap-2 border-b border-border px-3 py-1.5 text-[11px] font-semibold text-surface"+ >+ <icon-lucide-file-code class="size-3.5 text-muted" aria-hidden="true" />+ {{ FILE_NAME }}+ <IconButton+ class="ml-auto"+ size="xs"+ :label="snippetClipboard.copied.value ? messages.clipboard.copied : messages.clipboard.copy"+ @click="snippetClipboard.copy(SNIPPET)"+ >+ <icon-lucide-check v-if="snippetClipboard.copied.value" class="size-3.5" />+ <icon-lucide-copy v-else class="size-3.5" />+ </IconButton>+ </header>+ <!-- The app's own code editor: its HTML mode highlights the script block as well. -->+ <div class="flex min-h-0 flex-1 flex-col select-text">+ <CodeEditor :model-value="SNIPPET" language="html-css" :label="FILE_NAME" read-only />+ </div>+ <footer class="shrink-0 border-t border-border">+ <header+ class="flex items-center gap-2 border-b border-border px-3 py-1.5 text-[11px] font-semibold text-surface"+ >+ <icon-lucide-terminal class="size-3.5 text-muted" aria-hidden="true" />+ {{ messages.stage.sdk.install }}+ <IconButton+ class="ml-auto"+ size="xs"+ :label="+ installClipboard.copied.value ? messages.clipboard.copied : messages.clipboard.copy+ "+ @click="installClipboard.copy(INSTALL)"+ >+ <icon-lucide-check v-if="installClipboard.copied.value" class="size-3.5" />+ <icon-lucide-copy v-else class="size-3.5" />+ </IconButton>+ </header>+ <!-- Two lines joined by the shell's line continuation, so no package name breaks. -->+ <pre+ class="m-0 overflow-x-auto px-3 py-2 font-mono text-[12px] leading-5 text-surface select-text"+ ><span class="text-muted select-none">$ </span><span class="text-accent">bun</span> add {{ INSTALL_PACKAGES[0] }} <span class="text-muted">\</span>+ {{ INSTALL_PACKAGES.slice(1).join(' ') }}</pre>+ </footer>+ </section>+</template>diff --git a/packages/docs/.vitepress/theme/landing/stage/panels/TerminalPanel.vue b/packages/docs/.vitepress/theme/landing/stage/panels/TerminalPanel.vuenew file mode 100644index 000000000..dac771087--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/panels/TerminalPanel.vue@@ -0,0 +1,68 @@+<script setup lang="ts">+import { useLandingMessages } from '#docs/theme/landing/content/messages'+import { nextTick, ref } from 'vue'++import { useEditorStore } from '@/app/editor/active-store'+import AppButton from '@/components/ui/button/AppButton.vue'++import { EDITOR_COMMANDS } from './terminal-commands'+import { useTerminalSession } from './useTerminalSession'++const messages = useLandingMessages()+const scroller = ref<HTMLElement | null>(null)++async function scrollToEnd() {+ await nextTick()+ const element = scroller.value+ if (element) element.scrollTop = element.scrollHeight+}++const { entries, busy, run } = useTerminalSession(useEditorStore(), () => void scrollToEnd())+</script>++<template>+ <section class="flex min-h-0 flex-1 flex-col bg-panel-secondary" aria-label="Terminal">+ <header+ class="flex shrink-0 items-center gap-2 border-b border-border px-3 py-2 text-[11px] font-semibold text-surface"+ >+ <icon-lucide-terminal class="size-3.5 text-muted" aria-hidden="true" />+ Terminal+ </header>++ <div+ ref="scroller"+ class="scrollbar-thin min-h-0 flex-1 overflow-auto px-3 py-2 font-mono text-[11px] leading-relaxed select-text"+ aria-live="polite"+ >+ <p v-if="entries.length === 0" class="text-muted">+ <span class="text-accent select-none">$</span> openpencil+ <span class="animate-pulse">▍</span>+ </p>+ <div v-for="entry in entries" :key="entry.id" class="mb-2 last:mb-0">+ <pre+ class="break-words whitespace-pre-wrap text-surface"+ ><span class="text-accent select-none">$ </span>{{ entry.line }}</pre>+ <pre+ v-if="entry.output"+ class="mt-1 break-words whitespace-pre-wrap text-muted data-failed:text-error"+ :data-failed="entry.failed || undefined"+ >{{ entry.output }}</pre>+ </div>+ </div>++ <div class="flex shrink-0 flex-wrap gap-1.5 border-t border-border px-3 py-2">+ <AppButton+ v-for="command in EDITOR_COMMANDS"+ :key="command.id"+ variant="outline"+ size="xs"+ shape="pill"+ :disabled="busy"+ @click="run(command)"+ >+ <template #leading><component :is="command.icon" /></template>+ {{ messages.stage.terminal[command.id] }}+ </AppButton>+ </div>+ </section>+</template>diff --git a/packages/docs/.vitepress/theme/landing/stage/panels/terminal-commands.ts b/packages/docs/.vitepress/theme/landing/stage/panels/terminal-commands.tsnew file mode 100644index 000000000..757e1ddd4--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/panels/terminal-commands.ts@@ -0,0 +1,164 @@+import type { LandingMessages } from '#docs/theme/landing/content/messages'+import type { Component } from 'vue'+import IconCode from '~icons/lucide/code'+import IconCopyPlus from '~icons/lucide/copy-plus'+import IconListTree from '~icons/lucide/list-tree'+import IconMousePointerClick from '~icons/lucide/mouse-pointer-click'+import IconWand from '~icons/lucide/wand-sparkles'++import type { TreeNodeResult, TreeResult } from '@open-pencil/core/rpc'++import { makeFigmaFromStore } from '@/app/automation/bridge/figma-factory'+import { createAutomationCommandHandlers } from '@/app/automation/bridge/handlers'+import type { EditorStore } from '@/app/editor/active-store'++import { reframeStage } from '../scenes'++/**+ * The CLI reaches a running app through `createAutomationCommandHandlers`. The landing page+ * calls that same handler in-process, so each command below does exactly what+ * `openpencil <command>` does against the desktop or web app; only the transport is skipped.+ */+const { handleRequest } = createAutomationCommandHandlers(makeFigmaFromStore)++export interface EditorCommand {+ /** Also the key of the command's label in the landing message catalogs. */+ id: keyof LandingMessages['stage']['terminal']+ icon: Component+ /** The command line as a user would type it. */+ line: string+ run: (store: EditorStore) => Promise<string>+}++interface AutomationResponse {+ ok?: boolean+ result?: unknown+ error?: string+}++async function request(store: EditorStore, command: string, args: unknown): Promise<unknown> {+ const response = (await handleRequest(store, command, args)) as AutomationResponse+ if (response.error) throw new Error(response.error)+ return response.result+}++const TYPE_LABELS: Record<string, string> = {+ CANVAS: 'page',+ RECTANGLE: 'rect',+ COMPONENT_SET: 'component-set'+}++function entity(node: { type: string; name: string; id: string }): string {+ return `[${TYPE_LABELS[node.type] ?? node.type.toLowerCase()}] "${node.name}" (${node.id})`+}++function treeLines(node: TreeNodeResult, index: number, depth: number): string[] {+ const lines = [`${' '.repeat(depth)}[${index}] ${entity(node)}`]+ node.children?.forEach((child, childIndex) => {+ lines.push(...treeLines(child, childIndex, depth + 1))+ })+ return lines+}++async function printTree(store: EditorStore, depth: number): Promise<string> {+ const page = store.graph.getNode(store.state.currentPageId)+ const data = (await request(store, 'tree', { page: page?.name, depth })) as TreeResult+ return [+ `[0] ${entity(data.page)}`,+ ...data.children.flatMap((child, index) => treeLines(child, index, 1))+ ].join('\n')+}++interface SelectionNode {+ id: string+ name: string+ type: string+ width: number+ height: number+ xpath: string | null+}++async function printSelection(store: EditorStore): Promise<string> {+ const nodes = (await request(store, 'selection', {})) as SelectionNode[]+ if (nodes.length === 0) return 'No nodes selected. Click a layer on the canvas and run it again.'+ return [+ `${nodes.length} selected node${nodes.length === 1 ? '' : 's'}`,+ '',+ ...nodes.flatMap((node) => [+ entity(node),+ ` size: ${node.width}×${node.height}`,+ ...(node.xpath ? [` xpath: ${node.xpath}`] : [])+ ])+ ].join('\n')+}++async function printTailwind(store: EditorStore): Promise<string> {+ const selected = [...store.state.selectedIds]+ if (selected.length === 0) return 'Select a layer first: the export follows the selection.'+ const result = (await request(store, 'export_jsx', { nodeIds: selected, style: 'tailwind' })) as {+ jsx: string+ }+ return result.jsx+}++// The players' colors are Theme variables, so one value changes every player in both modes.+const RECOLOR = `const theme = figma.getLocalVariableCollections().find(c => c.name === 'Theme')+const accent = figma.getLocalVariables('COLOR')+ .find(v => v.name === 'Accent' && v.collectionId === theme.id)+const coral = { r: 0.96, g: 0.33, b: 0.24, a: 1 }+for (const mode of theme.modes) figma.setVariableValue(accent.id, mode.modeId, coral)+return 'Accent is coral in ' + theme.modes.map(m => m.name).join(' and ')`++const ADD_PLAYER = `const player = figma.currentPage.findOne(n => n.type === 'COMPONENT' && n.name === 'Player')+const prop = name => Object.keys(player.componentPropertyDefinitions)+ .find(key => key.startsWith(name + '#'))+const copy = player.createInstance()+copy.setProperties({ [prop('Title')]: 'Night Shift', [prop('Artist')]: 'Lumen' })+figma.currentPage.findOne(n => n.name === 'Players').appendChild(copy)+return 'Night Shift added'`++/** The real CLI reads the script from stdin, so multi-line code needs no shell quoting. */+function evalLine(code: string): string {+ return `openpencil eval --stdin <<'JS'\n${code}\nJS`+}++async function runEval(store: EditorStore, code: string): Promise<string> {+ const result = await request(store, 'eval', { code })+ // The stage shows one chapter of the tour; fitting the page would show all of it.+ reframeStage(store)+ if (result === null || result === undefined) return ''+ return typeof result === 'string' ? result : JSON.stringify(result, null, 2)+}++export const EDITOR_COMMANDS: EditorCommand[] = [+ {+ id: 'tree',+ icon: IconListTree,+ line: 'openpencil tree --depth 2',+ run: (store) => printTree(store, 2)+ },+ {+ id: 'restyle',+ icon: IconWand,+ line: evalLine(RECOLOR),+ run: (store) => runEval(store, RECOLOR)+ },+ {+ id: 'addPlayer',+ icon: IconCopyPlus,+ line: evalLine(ADD_PLAYER),+ run: (store) => runEval(store, ADD_PLAYER)+ },+ {+ id: 'selection',+ icon: IconMousePointerClick,+ line: 'openpencil selection',+ run: printSelection+ },+ {+ id: 'export',+ icon: IconCode,+ line: 'openpencil export -f tailwind-jsx',+ run: printTailwind+ }+]diff --git a/packages/docs/.vitepress/theme/landing/stage/panels/useTerminalSession.ts b/packages/docs/.vitepress/theme/landing/stage/panels/useTerminalSession.tsnew file mode 100644index 000000000..ff44c18d7--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/panels/useTerminalSession.ts@@ -0,0 +1,67 @@+import { promiseTimeout, usePreferredReducedMotion } from '@vueuse/core'+import { onScopeDispose, reactive, ref } from 'vue'++import type { EditorStore } from '@/app/editor/active-store'++import type { EditorCommand } from './terminal-commands'++export interface TerminalEntry {+ id: number+ line: string+ output: string+ failed: boolean+}++const TYPE_TICK_MS = 14+const TYPE_CHARS_PER_TICK = 3++/**+ * Runs commands one at a time against a stage's document, typing each command line out+ * before it executes. `onProgress` fires whenever the transcript grows.+ */+export function useTerminalSession(store: EditorStore, onProgress: () => void) {+ const reducedMotion = usePreferredReducedMotion()+ const entries = reactive<TerminalEntry[]>([])+ const busy = ref(false)++ let disposed = false+ onScopeDispose(() => {+ disposed = true+ })++ async function typeLine(entry: TerminalEntry, line: string): Promise<void> {+ if (reducedMotion.value === 'reduce') return+ for (let offset = 0; offset < line.length; offset += TYPE_CHARS_PER_TICK) {+ if (disposed) return+ entry.line = line.slice(0, offset + TYPE_CHARS_PER_TICK)+ onProgress()+ await promiseTimeout(TYPE_TICK_MS)+ }+ }++ async function run(command: EditorCommand): Promise<void> {+ if (busy.value) return+ busy.value = true+ const entry = reactive<TerminalEntry>({+ id: entries.length,+ line: '',+ output: '',+ failed: false+ })+ entries.push(entry)+ try {+ await typeLine(entry, command.line)+ if (disposed) return+ entry.line = command.line+ entry.output = await command.run(store)+ } catch (error) {+ entry.failed = true+ entry.output = error instanceof Error ? error.message : String(error)+ } finally {+ busy.value = false+ onProgress()+ }+ }++ return { entries, busy, run }+}diff --git a/packages/docs/.vitepress/theme/landing/stage/scenes.ts b/packages/docs/.vitepress/theme/landing/stage/scenes.tsnew file mode 100644index 000000000..c056da43d--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/scenes.ts@@ -0,0 +1,222 @@+// The app's tour, prebuilt from `tools/generate/demo`; the docs config ensures it exists.+import demoFigURL from '#app-public/demo.fig?url'++import { CHAPTERS, sectionName, type TourChapter } from '@open-pencil/demo-tools/chapters'+import type { SceneNode } from '@open-pencil/scene-graph'++import { followAppTheme } from '@/app/demo/theme'+import type { EditorStore } from '@/app/editor/active-store'+import { resolvedAppTheme } from '@/app/shell/theme'++/** One download of the tour for every stage that shows a chapter of it. */+let tourBytes: Promise<ArrayBuffer> | null = null++function fetchTour(): Promise<ArrayBuffer> {+ if (tourBytes) return tourBytes+ const request = fetch(demoFigURL).then((response) => {+ if (!response.ok) throw new Error(`The tour is unavailable (${response.status})`)+ return response.arrayBuffer()+ })+ // A failed download is tried again by the next stage rather than shared.+ request.catch(() => {+ if (tourBytes === request) tourBytes = null+ })+ tourBytes = request+ return request+}++/** Opens the tour like any `.fig` file, in the theme the docs site shows, as `/demo` does. */+async function openTour(store: EditorStore): Promise<void> {+ // A File copies the bytes, so every stage decodes its own.+ await store.openFigFile(new File([await fetchTour()], 'Demo.fig'))+ followAppTheme(store, resolvedAppTheme)+}++function chapterSection(store: EditorStore, chapter: TourChapter): SceneNode {+ const name = sectionName(chapter)+ const section = store.graph+ .getChildren(store.state.currentPageId)+ .find((node) => node.name === name)+ if (!section) throw new Error(`The tour has no "${name}" chapter`)+ return section+}++/** The layer a chapter is about, by the name the tour gives it. */+export function chapterSubject(store: EditorStore, chapter: TourChapter): SceneNode {+ const section = chapterSection(store, chapter)+ const subject = store.graph.getChildren(section.id).find((node) => node.name === chapter.subject)+ if (!subject) throw new Error(`"${section.name}" has no "${chapter.subject}"`)+ return subject+}++// Room around a framed layer, above it for the preview's workspace pill, and below it for the+// toolbar of stages that show one.+const FRAME_MARGIN = 24+const PREVIEW_PILL_INSET = 56+const TOOLBAR_INSET = 64+/** Small subjects are enlarged to fill the canvas, up to this zoom. */+const MAX_FRAME_ZOOM = 2++/** What sits over the canvas of a stage, and so the room a framed layer leaves for it. */+interface FrameInsets {+ /** The preview's workspace pill sits above the canvas. */+ preview?: boolean+ /** The tools sit along the bottom of the canvas. */+ toolbar?: boolean+}++/**+ * Fill the canvas with `node`, past the 100% that fitting stops at, so the rest of the tour,+ * its prose and its tip cards, stays out of view; the landing says those things itself.+ */+function frameNode(store: EditorStore, node: SceneNode, insets: FrameInsets = {}): void {+ const { x, y } = store.graph.getAbsolutePosition(node.id)+ const { width, height } = store.getViewportSize()+ const top = insets.preview ? PREVIEW_PILL_INSET : 0+ const bottom = insets.toolbar ? TOOLBAR_INSET : 0+ const zoom = Math.min(+ (width - FRAME_MARGIN * 2) / node.width,+ (height - FRAME_MARGIN * 2 - top - bottom) / node.height,+ MAX_FRAME_ZOOM+ )+ store.centerOn(x + node.width / 2, y + node.height / 2 + (bottom - top) / 2 / zoom, zoom)+}++/**+ * Leave the stage only what it shows. The chapter's heading and tip card beside `subject` are+ * hidden, since the landing says those things in its own words and language, and so are the other+ * chapters, which a stage that grows its subject would otherwise bring into view. Instances draw+ * from their own layers, so hiding the chapters that hold their main components changes nothing+ * they show. Other stages drop the Lint chapter, whose planted error would otherwise put a marker+ * at their canvas edge; it holds no component the rest of the tour uses. Like the tour's theme,+ * none of this is an edit, so the stage opens with nothing to undo or save.+ */+function isolateChapter(store: EditorStore, tourChapter: TourChapter, subject: SceneNode): void {+ const { graph } = store+ const section = chapterSection(store, tourChapter)+ const around = graph.getChildren(section.id).filter((node) => node.id !== subject.id)+ const others = graph+ .getChildren(store.state.currentPageId)+ .filter((node) => node.id !== section.id)+ const lint = tourChapter === CHAPTERS.lint ? null : chapterSection(store, CHAPTERS.lint)+ graph.applyImportedStateDuring(() => {+ for (const node of [...around, ...others]) graph.updateNode(node.id, { visible: false })+ if (lint) graph.deleteNode(lint.id)+ })+}++/** The layer each stage framed, so a stage can return to it after changing the document. */+const framed = new WeakMap<EditorStore, { id: string; insets: FrameInsets }>()++/**+ * Frame `node` and remember it as what the stage shows. A stage that builds on the document,+ * such as a recorded AI turn or a terminal command, comes back here rather than fitting the+ * whole tour into view.+ */+export function frameStage(store: EditorStore, node: SceneNode, insets: FrameInsets = {}): void {+ framed.set(store, { id: node.id, insets })+ frameNode(store, node, insets)+}++/** Frame what the stage showed again, at its size now. */+export function reframeStage(store: EditorStore): void {+ const stage = framed.get(store)+ const node = stage ? store.graph.getNode(stage.id) : undefined+ if (stage && node) frameNode(store, node, stage.insets)+}++/** Opens the tour on one chapter's subject, with nothing else in view. */+async function chapter(+ store: EditorStore,+ tourChapter: TourChapter,+ options: FrameInsets & { select?: (subject: SceneNode) => string | undefined } = {}+): Promise<void> {+ await openTour(store)+ const subject = chapterSubject(store, tourChapter)+ isolateChapter(store, tourChapter, subject)+ frameStage(store, subject, { preview: options.preview, toolbar: options.toolbar })+ const selected = options.select?.(subject)+ if (selected) store.select([selected])+ if (options.preview) store.startPlay()+}++/** The first layer named `name` among `roots` and their layers, searching breadth first. */+function layerNamed(store: EditorStore, roots: readonly string[], name: string): string | null {+ const pending = [...roots]+ // The loop also reaches the layers it appends.+ for (const id of pending) {+ const node = store.graph.getNode(id)+ if (!node) continue+ if (node.name === name) return node.id+ pending.push(...node.childIds)+ }+ return null+}++/** The first layer under `node` with `name`. */+function descendant(store: EditorStore, node: SceneNode, name: string): string | undefined {+ return layerNamed(store, node.childIds, name) ?? undefined+}++/** The first layer on the current page with `name`. */+export function findByName(store: EditorStore, name: string): string | null {+ const page = store.graph.getChildren(store.state.currentPageId).map((node) => node.id)+ return layerNamed(store, page, name)+}++/**+ * Opens the layer tree down to `depth`, where 0 is the page's top-level layers. The tree opens+ * the ancestors of whatever is selected and keeps them open, so selecting the layers at that+ * depth and then nothing leaves them showing, with no selection on the canvas.+ */+function revealLayers(store: EditorStore, depth: number): void {+ let level = store.graph.getChildren(store.state.currentPageId).map((node) => node.id)+ for (let current = 0; current < depth; current++) {+ level = level.flatMap((id) => store.graph.getNode(id)?.childIds ?? [])+ }+ store.select(level)+ store.clearSelection()+}++/** The whole tour in the layer tree, its chapters open, and the first one on the canvas. */+async function figma(store: EditorStore): Promise<void> {+ await openTour(store)+ frameNode(store, chapterSection(store, CHAPTERS.hello))+ revealLayers(store, 1)+}++export type SceneBuilder = (store: EditorStore) => Promise<void>++export const SCENES = {+ figma,+ // The main player's cover selected: a rectangle large enough to show its corner handles on+ // hover, in a row of instances that each bring their own cover through the artwork slot.+ slots: (store) =>+ chapter(store, CHAPTERS.slots, {+ toolbar: true,+ select: (players) => {+ const main = store.graph.getNode(players.childIds[0] ?? '')+ return main ? descendant(store, main, 'Cover') : undefined+ }+ }),+ // The players as they are, for scripts that restyle and extend them.+ players: (store) => chapter(store, CHAPTERS.slots),+ // The hero in preview: its background moves and the player is a working control.+ hero: (store) =>+ chapter(store, CHAPTERS.hello, {+ preview: true,+ select: (s) => descendant(store, s, 'Player')+ }),+ // The hero still, beside which the recorded AI turn adds a card.+ heroStill: (store) => chapter(store, CHAPTERS.hello),+ modes: (store) => chapter(store, CHAPTERS.modes),+ controls: (store) => chapter(store, CHAPTERS.controls, { toolbar: true }),+ shaders: (store) =>+ chapter(store, CHAPTERS.shaders, {+ preview: true,+ select: (s) => descendant(store, s, 'Shader')+ }),+ // The sign-in card selected, so the Lint tab lists its planted problems alone.+ lint: (store) => chapter(store, CHAPTERS.lint, { select: (card) => card.id }),+ code: (store) => chapter(store, CHAPTERS.code, { select: (s) => s.id })+} satisfies Record<string, SceneBuilder>diff --git a/packages/docs/.vitepress/theme/landing/stage/useDocsAppearance.ts b/packages/docs/.vitepress/theme/landing/stage/useDocsAppearance.tsnew file mode 100644index 000000000..eb619227d--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/useDocsAppearance.ts@@ -0,0 +1,34 @@+import { useData } from 'vitepress'+import { effectScope, watch } from 'vue'++import { AVAILABLE_LOCALES, setLocale, type Locale } from '@open-pencil/vue'++import { useAppTheme } from '@/app/shell/theme'++let started = false++function isAppLocale(value: string): value is Locale {+ return (AVAILABLE_LOCALES as readonly string[]).includes(value)+}++/**+ * Keeps the embedded app in step with the docs site: its light or dark theme follows the+ * VitePress appearance switch, and its interface language follows the docs locale. The app+ * keeps both as page-wide state, so one detached scope serves every stage on the page.+ */+export function useDocsAppearance(): void {+ if (started) return+ started = true+ const { isDark, lang } = useData()+ effectScope(true).run(() => {+ const { setTheme } = useAppTheme()+ watch(isDark, (dark) => setTheme(dark ? 'dark' : 'light'), { immediate: true })+ watch(+ lang,+ (value) => {+ if (isAppLocale(value)) setLocale(value)+ },+ { immediate: true }+ )+ })+}diff --git a/packages/docs/.vitepress/theme/landing/stage/useStageDocument.ts b/packages/docs/.vitepress/theme/landing/stage/useStageDocument.tsnew file mode 100644index 000000000..f0dcc729a--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/useStageDocument.ts@@ -0,0 +1,66 @@+import { getCurrentInstance, provide, ref } from 'vue'++import { COLLAB_KEY, useCollab } from '@/app/collab/use'+import { provideTabEditorStore } from '@/app/editor/active-store'+import { createTab, switchTab } from '@/app/tabs'++import { installAppPlugins } from './app-plugins'+import type { SceneBuilder } from './scenes'++/**+ * Gives the calling stage its own document and pins the component subtree to it, so several+ * stages can be live at once with each panel following its own canvas. Mirrors what+ * `src/App.vue` and `WorkspaceView.vue` provide around the app's workspace.+ */+export function useStageDocument(scene: SceneBuilder) {+ const instance = getCurrentInstance()+ if (instance) installAppPlugins(instance.appContext.app)++ const tab = createTab()+ const store = tab.store+ store.state.showRulers = false+ provideTabEditorStore(store)+ provide(COLLAB_KEY, useCollab())++ // The app's loading overlay shows while a preparation is open, so the canvas is covered+ // from the moment it mounts until the scene is built, and a failed build is reported there.+ const preparation = store.preparationController.begin({+ kind: 'demo-load',+ phase: 'materializing'+ })+ let built = false+ /** The scene is built and on the canvas. */+ const ready = ref(false)++ /** Builds the scene once the canvas has a renderer to load fonts into. Runs once. */+ async function build(): Promise<void> {+ if (built) return+ built = true+ try {+ await store.canvasReady+ await scene(store)+ // As the app does when it opens a page: render, and finish once that frame is on screen,+ // so whatever stands in for the stage until now never gives way to an empty canvas.+ preparation.update({ phase: 'preparing-render' })+ await store.preparationController.waitForPresentation(+ preparation.id,+ store.state.sceneVersion+ )+ preparation.complete()+ ready.value = true+ } catch (error) {+ preparation.fail({+ code: 'layout-failed',+ message: error instanceof Error ? error.message : String(error),+ retryable: false+ })+ }+ }++ /** App services outside this subtree follow the active tab, so interaction selects it. */+ function focus(): void {+ switchTab(tab.id)+ }++ return { store, build, focus, ready }+}diff --git a/packages/docs/.vitepress/theme/landing/stage/useWheelEngagement.ts b/packages/docs/.vitepress/theme/landing/stage/useWheelEngagement.tsnew file mode 100644index 000000000..cc8d7f2b1--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/stage/useWheelEngagement.ts@@ -0,0 +1,27 @@+import { ref } from 'vue'++/**+ * A page full of canvases must not trap scrolling. The wheel reaches a canvas only once the+ * visitor has clicked into that stage, and goes back to the page when the pointer leaves.+ */+export function useWheelEngagement() {+ const engaged = ref(false)++ function engage(): void {+ engaged.value = true+ }++ function disengage(): void {+ engaged.value = false+ }++ /** Capture-phase wheel handler for the stage root. */+ function guardWheel(event: WheelEvent): void {+ if (engaged.value || event.ctrlKey || event.metaKey) return+ // Sideways swipes never scroll the page, so they can always pan.+ if (Math.abs(event.deltaX) > Math.abs(event.deltaY)) return+ event.stopPropagation()+ }++ return { engage, disengage, guardWheel }+}diff --git a/packages/docs/.vitepress/theme/landing/ui/ActionButton.vue b/packages/docs/.vitepress/theme/landing/ui/ActionButton.vuenew file mode 100644index 000000000..8c3d69a9c--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/ui/ActionButton.vue@@ -0,0 +1,110 @@+<script setup lang="ts">+import type { Component } from 'vue'++/**+ * VitePress's `VPButton` takes no icon, so this mirrors its look from the same theme variables.+ * With an `href` it is a link; without one it submits the form it sits in.+ */+const {+ href,+ icon,+ primary = false,+ small = false,+ disabled = false+} = defineProps<{+ href?: string+ icon: Component+ primary?: boolean+ /** A quieter size for actions inside a section, beside the page's main ones. */+ small?: boolean+ disabled?: boolean+}>()+</script>++<template>+ <a+ v-if="href"+ class="action"+ :href="href"+ :data-primary="primary || undefined"+ :data-small="small || undefined"+ >+ <component :is="icon" aria-hidden="true" />+ <slot />+ </a>+ <button+ v-else+ class="action"+ type="submit"+ :disabled="disabled"+ :data-primary="primary || undefined"+ :data-small="small || undefined"+ >+ <component :is="icon" aria-hidden="true" />+ <slot />+ </button>+</template>++<style scoped>+.action {+ display: inline-flex;+ align-items: center;+ gap: 8px;+ height: 40px;+ padding: 0 20px 0 16px;+ border: 1px solid var(--vp-button-alt-border);+ border-radius: 20px;+ background-color: var(--vp-button-alt-bg);+ color: var(--vp-button-alt-text);+ font-size: 14px;+ font-weight: 600;+ text-decoration: none;+ white-space: nowrap;+ transition:+ color 0.25s,+ border-color 0.25s,+ background-color 0.25s;+}++.action:hover {+ border-color: var(--vp-button-alt-hover-border);+ background-color: var(--vp-button-alt-hover-bg);+ color: var(--vp-button-alt-hover-text);+}++.action[data-primary] {+ border-color: var(--vp-button-brand-border);+ background-color: var(--vp-button-brand-bg);+ color: var(--vp-button-brand-text);+}++.action[data-primary]:hover {+ border-color: var(--vp-button-brand-hover-border);+ background-color: var(--vp-button-brand-hover-bg);+ color: var(--vp-button-brand-hover-text);+}++.action[data-small] {+ gap: 6px;+ height: 32px;+ padding: 0 14px 0 12px;+ border-radius: 16px;+ font-size: 13px;+}++.action[data-small] svg {+ width: 14px;+ height: 14px;+}++.action:disabled {+ cursor: progress;+ opacity: 0.6;+}++.action svg {+ flex: none;+ width: 16px;+ height: 16px;+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/ui/StageFrame.vue b/packages/docs/.vitepress/theme/landing/ui/StageFrame.vuenew file mode 100644index 000000000..ed0ee2f03--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/ui/StageFrame.vue@@ -0,0 +1,156 @@+<script setup lang="ts">+import { useEventListener } from '@vueuse/core'+import { defineClientComponent, useData, withBase } from 'vitepress'+import { computed, onMounted, ref } from 'vue'++import type { FeatureKind } from '../content/features'+import { useLandingMessages } from '../content/messages'+import { isPosterCapture } from '../posters'+import StagePoster from './StagePoster.vue'++/**+ * The editor needs WebGL and CanvasKit, so a stage never renders on the server. The server build+ * leaves the editor out entirely: `import.meta.env.SSR` is fixed at build time, so that branch,+ * and the whole app it would compile, is dropped there.+ */+const SERVER_ONLY = () => Promise.reject(new Error('Landing stages render only in the browser'))+const FeatureStage = defineClientComponent(() =>+ import.meta.env.SSR ? SERVER_ONLY() : import('../stage/FeatureStage.vue')+)+const CollabStage = defineClientComponent(() =>+ import.meta.env.SSR ? SERVER_ONLY() : import('../stage/collab/CollabStage.vue')+)++const { kind } = defineProps<{ kind: FeatureKind }>()++const messages = useLandingMessages()+const { frontmatter, localeIndex } = useData()++/** Set by the production build when it captured stills of the stages; absent in development. */+const fingerprint = computed((): string | null => {+ const posters: unknown = frontmatter.value.posters+ return typeof posters === 'string' ? posters : null+})++// With stills on the page, the editor waits: on a desktop until the page has loaded, and on a+// touch screen, where a stage is only watched, until the visitor asks for it. Without stills,+// or while the generator captures them, stages start as soon as they can.+const live = ref(fingerprint.value === null)+/** The stage is loading its engine and scene, which it does as it nears the viewport. */+const loading = ref(false)+const ready = ref(false)+// Decided after hydration, so the server-rendered poster and the client's first render agree.+const waiting = ref(false)++function start(): void {+ waiting.value = false+ live.value = true+}++onMounted(() => {+ if (live.value) return+ if (isPosterCapture()) start()+ else if (window.matchMedia('(pointer: coarse)').matches) waiting.value = true+ else if (document.readyState === 'complete') start()+ else useEventListener(window, 'load', start, { once: true })+})+</script>++<template>+ <div class="stage-frame" :data-kind="kind" :data-ready="ready || undefined">+ <!-- Shown until the editor code arrives. It mirrors the app's canvas loading overlay,+ which takes over once the stage mounts on top of it. -->+ <div v-if="!fingerprint" class="stage-loader" role="status" :aria-label="messages.loading">+ <img :src="withBase('/brand/app-icon.svg')" alt="" />+ <span />+ </div>+ <template v-if="live">+ <CollabStage v-if="kind === 'collab'" @start="loading = true" @ready="ready = true" />+ <FeatureStage v-else :kind="kind" @start="loading = true" @ready="ready = true" />+ </template>+ <!-- The live stage is already drawn underneath, so the still fades into it. -->+ <Transition name="stage-poster">+ <StagePoster+ v-if="fingerprint && !ready"+ :kind="kind"+ :fingerprint="fingerprint"+ :locale="localeIndex"+ :waiting="waiting"+ :loading="loading"+ @activate="start"+ />+ </Transition>+ </div>+</template>++<style scoped>+.stage-frame {+ position: relative;+ height: 100%;+ overflow: hidden;+ border: 1px solid var(--vp-c-divider);+ border-radius: 12px;+ background: var(--vp-c-bg);+}++.stage-loader {+ position: absolute;+ inset: 0;+ display: flex;+ flex-direction: column;+ align-items: center;+ justify-content: center;+ gap: 16px;+}++.stage-loader img {+ width: 48px;+ height: 48px;+}++.stage-loader span {+ position: relative;+ width: 100px;+ height: 2px;+ overflow: hidden;+ border-radius: 999px;+ background: color-mix(in srgb, var(--vp-c-text-1) 8%, transparent);+}++.stage-loader span::after {+ position: absolute;+ inset: 0 60% 0 0;+ border-radius: inherit;+ background: color-mix(in srgb, var(--vp-c-text-1) 25%, transparent);+ animation: stage-loader-slide 1s ease-in-out infinite;+ content: '';+}++@keyframes stage-loader-slide {+ from {+ transform: translateX(-100%);+ }++ to {+ transform: translateX(250%);+ }+}++.stage-poster-leave-active {+ transition: opacity 250ms ease-out;+}++.stage-poster-leave-to {+ opacity: 0;+}++@media (prefers-reduced-motion: reduce) {+ .stage-poster-leave-active {+ transition: none;+ }++ .stage-loader span::after {+ animation: none;+ }+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/ui/StagePoster.vue b/packages/docs/.vitepress/theme/landing/ui/StagePoster.vuenew file mode 100644index 000000000..70127762f--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/ui/StagePoster.vue@@ -0,0 +1,196 @@+<script setup lang="ts">+import { withBase } from 'vitepress'+import IconPlay from '~icons/lucide/play'++import type { FeatureKind } from '../content/features'+import { useLandingMessages } from '../content/messages'+import {+ PHONE_MAX_WIDTH,+ POSTER_THEMES,+ posterParts,+ posterPath,+ type PosterPart,+ type PosterTheme+} from '../posters'++/**+ * A still of the stage until the live one is ready, laid out as the stage lays out its canvas+ * and panel. Both themes are rendered and CSS shows the current one; a hidden lazy image is+ * never fetched, so a visitor downloads one theme at the layout their screen uses.+ */+const {+ kind,+ fingerprint,+ locale,+ waiting = false,+ loading = false+} = defineProps<{+ kind: FeatureKind+ fingerprint: string+ locale: string+ /** The stage starts only when asked, as on a phone; the poster offers to start it. */+ waiting?: boolean+ /** The live stage is on its way; a slow one shows a quiet progress line. */+ loading?: boolean+}>()+const emit = defineEmits<{ activate: [] }>()++const messages = useLandingMessages()+const phoneMedia = `(max-width: ${PHONE_MAX_WIDTH}px)`++function source(theme: PosterTheme, layout: 'desktop' | 'phone', part: PosterPart): string {+ return withBase(`/${posterPath({ fingerprint, locale, theme, layout }, kind, part)}`)+}+</script>++<template>+ <div class="stage-poster" :data-kind="kind">+ <div v-for="theme in POSTER_THEMES" :key="theme" class="layer" :data-theme="theme">+ <picture v-for="part in posterParts(kind)" :key="part" :class="part">+ <source :media="phoneMedia" :srcset="source(theme, 'phone', part)" />+ <img :src="source(theme, 'desktop', part)" alt="" loading="lazy" decoding="async" />+ </picture>+ </div>+ <button v-if="waiting" type="button" class="activate" @click="emit('activate')">+ <IconPlay aria-hidden="true" />{{ messages.stage.activate }}+ </button>+ <span v-else-if="loading" class="progress" role="status" :aria-label="messages.loading" />+ </div>+</template>++<style scoped>+.stage-poster {+ position: absolute;+ /* Above the app's loading overlay (z-50), which the still stands in for. */+ z-index: 60;+ inset: 0;+ background: var(--vp-c-bg);+}++/*+ * Most stages are ready within a second; only a slow one shows that it is coming, with the+ * app loader's bar along the still's bottom edge.+ */+.progress {+ position: absolute;+ right: 0;+ bottom: 0;+ left: 0;+ height: 2px;+ overflow: hidden;+ opacity: 0;+ animation: poster-progress-in 200ms ease-out 1s forwards;+}++.progress::after {+ position: absolute;+ inset: 0 70% 0 0;+ background: var(--vp-c-brand-1);+ animation: poster-progress-slide 1.2s ease-in-out infinite;+ content: '';+}++@keyframes poster-progress-in {+ to {+ opacity: 1;+ }+}++@keyframes poster-progress-slide {+ from {+ transform: translateX(-100%);+ }++ to {+ transform: translateX(340%);+ }+}++@media (prefers-reduced-motion: reduce) {+ .progress::after {+ inset: 0;+ animation: none;+ opacity: 0.4;+ }+}++.layer {+ display: flex;+ height: 100%;+}++/* Vue keeps only what is inside `:global()`, so the whole selector goes there. */+:global(html.dark .stage-poster > [data-theme='light']),+:global(html:not(.dark) .stage-poster > [data-theme='dark']) {+ display: none;+}++picture {+ display: block;+ min-width: 0;+ min-height: 0;+}++img {+ display: block;+ width: 100%;+ height: 100%;+}++/* The live canvas fits its scene to whatever room it has; the still does the same. */+.canvas,+.frame {+ flex: 1;+}++.canvas img,+.frame img {+ object-fit: contain;+}++/* The panel keeps its width, so its still is shown as captured, from the top left. */+.panel {+ flex: none;+ width: 18rem;+}++.panel img {+ object-fit: cover;+ object-position: left top;+}++.activate {+ position: absolute;+ bottom: 16px;+ left: 50%;+ display: inline-flex;+ align-items: center;+ gap: 8px;+ height: 36px;+ padding: 0 16px 0 12px;+ border: 1px solid var(--vp-button-brand-border);+ border-radius: 18px;+ background: var(--vp-button-brand-bg);+ color: var(--vp-button-brand-text);+ font-size: 14px;+ font-weight: 600;+ white-space: nowrap;+ transform: translateX(-50%);+}++.activate svg {+ width: 16px;+ height: 16px;+}++@media (max-width: 767px) {+ .layer {+ flex-direction: column;+ }++ .panel {+ width: auto;+ height: 16rem;+ }+}+</style>diff --git a/packages/docs/.vitepress/theme/landing/ui/copy.ts b/packages/docs/.vitepress/theme/landing/ui/copy.tsnew file mode 100644index 000000000..b078c5051--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/ui/copy.ts@@ -0,0 +1,2 @@+/** How long a copy button says it copied, wherever the landing offers one. */+export const COPIED_MS = 2000diff --git a/packages/docs/.vitepress/theme/landing/waitlist/WaitlistForm.vue b/packages/docs/.vitepress/theme/landing/waitlist/WaitlistForm.vuenew file mode 100644index 000000000..eaf89c16e--- /dev/null+++ b/packages/docs/.vitepress/theme/landing/waitlist/WaitlistForm.vue@@ -0,0 +1,104 @@+<script setup lang="ts">+import { computed, useId, useTemplateRef } from 'vue'+import IconMail from '~icons/lucide/mail'++import { useWaitlistSignup } from '@/app/cloud/waitlist/signup'+import AppAlert from '@/components/ui/feedback/AppAlert.vue'+import AppInput from '@/components/ui/input/AppInput.vue'++import { useLandingMessages } from '../content/messages'+import ActionButton from '../ui/ActionButton.vue'++/**+ * The OpenPencil Cloud waitlist: one email field, sized and styled like the page's actions. It+ * signs up through the app's own waitlist flow, the one Settings uses.+ */+const messages = useLandingMessages()+const turnstile = useTemplateRef<HTMLElement>('turnstile')+const { email, status, submitting, confirming, edit, submit } = useWaitlistSignup(turnstile)+const noteId = useId()++const failure = computed(() => {+ const copy = messages.value.waitlist+ if (status.value === 'refused') return copy.refused+ if (status.value === 'limited') return copy.limited+ if (status.value === 'failed') return copy.failed+ if (status.value === 'unavailable') return copy.unavailable+ return null+})+</script>++<template>+ <AppAlert+ v-if="status === 'joined'"+ class="waitlist-result"+ tone="success"+ :heading="messages.waitlist.joined"+ :description="messages.waitlist.joinedDetail"+ />+ <form v-else class="waitlist" novalidate @submit.prevent="submit">+ <div class="fields">+ <AppInput+ v-model="email"+ type="email"+ name="email"+ autocomplete="email"+ required+ :aria-label="messages.waitlist.label"+ :aria-describedby="noteId"+ :aria-invalid="status === 'invalid' || undefined"+ :placeholder="messages.waitlist.placeholder"+ :state="status === 'invalid' ? 'invalid' : 'idle'"+ :disabled="submitting"+ class="h-10 w-72 max-w-full rounded-full px-4 text-sm"+ @update:model-value="edit"+ />+ <ActionButton :icon="IconMail" primary :disabled="submitting">+ {{ confirming ? messages.waitlist.confirmHuman : messages.waitlist.submit }}+ </ActionButton>+ </div>+ <p :id="noteId" class="note" :role="status === 'invalid' ? 'alert' : undefined">+ <span v-if="status === 'invalid'" class="invalid">{{ messages.waitlist.invalid }}</span>+ <template v-else>{{ messages.waitlist.privacy }}</template>+ </p>+ <!-- Turnstile draws here only when it needs a click; the button sits beside the field, so the+ check goes under the row. -->+ <div ref="turnstile" class="turnstile" />+ <AppAlert v-if="failure" class="waitlist-result" tone="error" :heading="failure" />+ </form>+</template>++<style scoped>+.fields {+ display: flex;+ flex-wrap: wrap;+ gap: 12px;+}++.note {+ margin: 8px 0 0 16px;+ color: var(--vp-c-text-3);+ font-size: 13px;+ line-height: 20px;+}++.invalid {+ color: var(--vp-c-danger-1);+}++.turnstile:not(:empty) {+ margin-top: 12px;+}++.waitlist-result {+ max-width: 420px;+ margin-top: 12px;+}++@media (max-width: 480px) {+ .fields > * {+ width: 100%;+ justify-content: center;+ }+}+</style>diff --git a/packages/docs/.vitepress/theme/tailwind.css b/packages/docs/.vitepress/theme/tailwind.cssindex cdaa2704f..78ca3c673 100644--- a/packages/docs/.vitepress/theme/tailwind.css+++ b/packages/docs/.vitepress/theme/tailwind.css@@ -1,4 +1,9 @@@import 'tailwindcss/theme' layer(theme);-@import 'tailwindcss/utilities' layer(utilities);+/* Unlayered, so utilities on app components win over VitePress's unlayered element resets. */+@import 'tailwindcss/utilities';+@import 'tw-animate-css';+@import '../../../../src/theme/tokens.css';@source '../../../vue/src/primitives/**/*.vue';+@source '../../../../src';+@source './landing';diff --git a/packages/docs/.vitepress/theme/vars.css b/packages/docs/.vitepress/theme/vars.cssnew file mode 100644index 000000000..3d0cf8cbe--- /dev/null+++ b/packages/docs/.vitepress/theme/vars.css@@ -0,0 +1,25 @@+/*+ * The docs site takes its palette from the editor's own tokens (`src/theme/tokens.css`), so+ * the site and the app components it embeds read as one product.+ */+:root {+ --vp-c-brand-1: #2563eb;+ --vp-c-brand-2: #3b82f6;+ --vp-c-brand-3: #2563eb;+ --vp-c-brand-soft: rgb(59 130 246 / 0.14);+}++.dark {+ --vp-c-bg: var(--color-canvas);+ --vp-c-bg-alt: var(--color-panel-secondary);+ --vp-c-bg-elv: var(--color-panel);+ --vp-c-bg-soft: var(--color-panel);+ --vp-c-divider: var(--color-border);+ --vp-c-border: var(--color-border);+ --vp-c-gutter: var(--color-canvas);+ --vp-c-text-1: var(--color-surface);+ --vp-c-text-2: var(--color-muted);+ --vp-c-brand-1: var(--color-primary);+ --vp-c-brand-2: var(--color-accent);+ --vp-c-brand-3: var(--color-accent);+}diff --git a/packages/docs/AGENTS.md b/packages/docs/AGENTS.mdindex fe7331eeb..2ab47809c 100644--- a/packages/docs/AGENTS.md+++ b/packages/docs/AGENTS.md@@ -2,9 +2,24 @@Published VitePress site. `bun run docs:dev`, `bun run docs:build` for fast checks, and `bun run docs:build:production` for deployment output. `bun run check:docs` runs the integrity checks in `tools/checks/docs/` plus `check:authoring-reference`.-- Keep routes under `/getting-started`, `/overview/**`, `/user-guide/**`, `/programmable/**`, `/reference/**`, and `/development/**`; do not recreate `/guide/**`. Preserve moves in `packages/docs/public/_redirects`.+- Keep routes under `/getting-started`, `/overview/**`, `/user-guide/**`, `/programmable/**`, `/reference/**`, and `/development/**`, plus the top-level `/download`; do not recreate `/guide/**`. Preserve moves in `packages/docs/public/_redirects`.- Link untranslated locale navigation to canonical English pages rather than adding placeholders.- `packages/docs/development/roadmap.md` tracks product direction, Figma compatibility gaps, raw metadata coverage, and the code map. `packages/docs/development/testing.md` is the canonical testing architecture. Explanations that would bloat an `AGENTS.md` belong under `packages/docs/development/`.+- Component API data loaders share one `vue-component-meta` checker through `sharedChecker()` in `.vitepress/sdk/component-meta.ts`; VitePress evaluates each loader separately, so a checker per module meant one TypeScript program per page and about 7 GB of heap.- SDK pages embed the demos colocated with `packages/vue` primitives, derive API tables from source and JSDoc with `vue-component-meta`, and process examples with Twoslash so imports and types stay aligned with the public package API. The docs Tailwind entry scans those demos.- Generated authoring-reference copies under this site are checked, not edited; run `bun run generate:authoring-reference` (`packages/core/AGENTS.md`, Tools).- CI runs documentation integrity and the docs build for docs-only changes, not engine, browser, Storybook, or native suites (`tools/AGENTS.md`).++## Landing++- The landing page (`.vitepress/theme/landing/`) mounts the app's own components, so the site takes the app's aliases, icon plugins, and build constants from `appSourceConfig()` in `@open-pencil/vite-config` (`vite/`) and its design tokens from `src/theme/tokens.css`. CanvasKit and core's bundled fonts are Vite asset imports handed to core in `landing/stage/engine-assets.ts`; do not copy them into `public/`. Server-rendered sections must not import from `landing/stage/`; they reach it through the client-only `ui/StageFrame.vue`, whose imports are guarded by `import.meta.env.SSR` so the server build never compiles the editor.+- The landing (`.vitepress/theme/landing/**`) is part of the root `tsconfig.json`, `bun run lint`, and `bun run format`, so it is checked with the app; its `#docs/*` imports resolve there to `.vitepress/*`, and it alone may import the app through `@/` (`oxlint.json` overrides).+- Each landing stage is one document pinned with `provideTabEditorStore()` and one WebGL canvas that mounts once and is never unmounted. Browsers cap WebGL contexts per page, so do not use the app's two-canvas `EditorCanvas` there or mount and unmount stages on scroll (`landing/stage/StageCanvas.vue`).+- The collaboration stage (`landing/stage/collab/`) joins two stages to one room through `createLocalRoom()`, an in-page `CollabRoomTransport`, and the app's own `openRoomSession()`; it never reaches the network or IndexedDB. It is the only stage with two canvases, so the page holds one more WebGL context than it has stages.+- Counts shown on the landing page come from source at build time through `landing/content/stats.data.ts`; do not hardcode them. Its roadmap is the short view of `development/roadmap.md` and changes with it.+- The download page (`download.md` in each locale, `landing/download/`) shares the landing's look and catalog. `landing/download/releases.data.ts` reads the latest stable release and any newer beta from GitHub when the site builds, with `GITHUB_TOKEN` or `GH_TOKEN` when set, so the page stays static; a build that cannot reach GitHub links to the releases there instead.+- The OpenPencil Cloud waitlist forms (Cloud section and roadmap entry) sign up through the app's `useWaitlistSignup()` in `src/app/cloud/waitlist/signup.ts`, the flow Settings uses: the typed feedback client, Turnstile, and the same checks as the service. Turnstile runs only on the sites the feedback service lists, so dev servers and previews show the form's unavailable state.+- Landing copy lives in `landing/content/messages/`, one catalog per docs locale typed against `LandingMessages`, with `en.ts` as the source; change every catalog together. Each locale's `index.md` imports `LandingPage` and only its own catalog, so the theme never registers the landing and other docs pages download none of it. The embedded app follows the docs appearance switch and locale through `landing/stage/useDocsAppearance.ts`.+- Production builds (`build:production`, `OPENPENCIL_LANDING_POSTERS=1`) show WebP stills of each stage until it is ready: the config names them by `landingPosterFingerprint()` in each landing page's `posters` frontmatter, and `tools/generate/landing-posters` captures them from the built site afterwards. Stills are named by `landing/posters.ts`; a stage reports `ready` and marks its canvas and panel with `data-poster-part`, and capture mode (`?poster-capture`) must start stages at once and keep them still (no autoplay). Development builds have no stills.+- Landing pages set `landing: true`, which makes `.vitepress/landing-head.ts` preload CanvasKit and the scenes' fonts for fine pointers; on touch screens a stage starts only when tapped. Stage panels, the toolbar, and the preview controls are async components (`landing/stage/definitions.ts`), so a stage downloads only what it shows; keep new stage-specific code behind the same kind of import.+- Landing logic is tested where its counterpart lives: the download page against the release catalog in `tools/release/release-packages/tests/native/download-page.test.ts`, its pure helpers in `tools/checks/docs/tests/download.test.ts`, and stills in `tools/generate/landing-posters/tests`. Keep such code free of `vitepress` imports so it loads under `bun test` (`landing/content/messages/fill.ts`).diff --git a/packages/docs/de/download.md b/packages/docs/de/download.mdnew file mode 100644index 000000000..73f21a188--- /dev/null+++ b/packages/docs/de/download.md@@ -0,0 +1,15 @@+---+layout: page+landing: true+sidebar: false+aside: false+title: OpenPencil herunterladen+description: Die OpenPencil-Desktop-App für macOS, Windows und Linux herunterladen oder mit Homebrew installieren.+---++<script setup>+import DownloadPage from '#docs/theme/landing/download/DownloadPage.vue'+import { de } from '#docs/theme/landing/content/messages/de'+</script>++<DownloadPage :messages="de" />diff --git a/packages/docs/de/getting-started.md b/packages/docs/de/getting-started.mdindex 4985c1b48..a37df3518 100644--- a/packages/docs/de/getting-started.md+++ b/packages/docs/de/getting-started.md@@ -8,7 +8,7 @@ Wenn Sie ein eigenes Produkt auf OpenPencil aufbauen möchten, lesen Sie den Ber## Desktop-Anwendung-Fertige Versionen für macOS, Windows und Linux finden Sie auf der [Release-Seite](https://github.com/open-pencil/open-pencil/releases/latest).+Fertige Versionen für macOS, Windows und Linux finden Sie auf der [Download-Seite](/de/download).| Plattform | Datei || --------------------- | -------------------- |@@ -18,7 +18,7 @@ Fertige Versionen für macOS, Windows und Linux finden Sie auf der [Release-Seit| Windows (ARM) | `.msi` / `.exe` || Linux (x64) | `.AppImage` / `.deb` |-## Systemvoraussetzungen+## Systemvoraussetzungen {#system-requirements}OpenPencil rendert mit CanvasKit über WebGL und nutzt aktuelle Webplattform-Funktionen, daher ist eine neuere Browser-Engine erforderlich. Die Webversion unterstützt Chrome 111, Edge 111, Firefox 128 und Safari 16.4 oder neuer; Chromium-basierte Browser wie Brave und Opera richten sich nach ihrer Chrome-Version. Die Desktop-Anwendung rendert im WebView des Systems, daher bestimmt die Engine des Betriebssystems die Untergrenze:@@ -45,7 +45,7 @@ brew uninstall open-pencil/tap/open-pencilbrew install --cask openpencil```-## Aus dem Quellcode erstellen+## Aus dem Quellcode erstellen {#building-from-source}### Voraussetzungendiff --git a/packages/docs/de/index.md b/packages/docs/de/index.mdindex 5b505c79a..9f203ecfe 100644--- a/packages/docs/de/index.md+++ b/packages/docs/de/index.md@@ -1,43 +1,15 @@----layout: home+layout: page+landing: true+sidebar: false+aside: falsetitle: OpenPencil — Open-Source-Design-Editordescription: Open-Source-Alternative zu Figma mit .fig-Unterstützung, integrierter KI und umfassender Automatisierung.+----hero:- name: OpenPencil- text: Open-Source-Design-Editor- tagline: Öffnet Figma-Dateien. Integrierte KI. Vollständig programmierbar. Und ein Werkzeugkasten für eigene Editoren.- actions:- - theme: brand- text: Online ausprobieren- link: https://app.openpencil.dev/demo- - theme: alt- text: Herunterladen- link: https://github.com/open-pencil/open-pencil/releases/latest- - theme: alt- text: GitHub- link: https://github.com/open-pencil/open-pencil+<script setup>+import LandingPage from '#docs/theme/landing/LandingPage.vue'+import { de } from '#docs/theme/landing/content/messages/de'+</script>-features:- - icon: 📂- title: Mit Figma kompatibel- details: Öffnet .fig-Dateien direkt. Unterstützt Kopieren und Einfügen zwischen Figma und OpenPencil. Der Kiwi-Binärcodec erhält die Daten bei Import und Export.- - icon: ⚡- title: Programmierbar- details: CLI ohne grafische Oberfläche zum Untersuchen, Exportieren und Analysieren von .fig-Dateien. Figma Plugin API über eval, Tailwind-CSS-Export und JSON-Ausgabe für CI und Automatisierung.- - icon: 🧩- title: Mehr als nur eine App- details: Mit dem Vue SDK eigene Bearbeitungsoberflächen entwickeln, OpenPencil in andere Produkte einbetten oder spezialisierte Editoren auf demselben Kern aufbauen.- - icon: 🤖- title: Integrierte KI- details: Chat mit 90 Werkzeugen zum Erstellen von Formen, Ändern von Stilen, Verwalten von Anordnungen und Analysieren von Designtoken. MCP-Server für Claude Code, Cursor und Windsurf.- - icon: 📖- title: Open Source- details: MIT-Lizenz. Editor, Engine, Dateicodec und CLI lassen sich vollständig einsehen und verändern.- - icon: 🖥️- title: Kostenlos und lokal- details: Kein Konto, kein Server und keine Internetverbindung erforderlich. Desktop-App mit etwa 7 MB über Homebrew oder direkt als Web-App.- - icon: 👥- title: Zusammenarbeit in Echtzeit- details: Direkte Verbindung über WebRTC ohne zentralen Server. Link teilen und gemeinsam mit Teilnehmerzeigern und Ansichtsverfolgung bearbeiten.----+<LandingPage :messages="de" />diff --git a/packages/docs/development/roadmap.md b/packages/docs/development/roadmap.mdindex 2c95d4114..a7c59f605 100644--- a/packages/docs/development/roadmap.md+++ b/packages/docs/development/roadmap.md@@ -18,19 +18,42 @@ OpenPencil is moving toward production-grade Figma compatibility while keeping d## Recently delivered-v0.14.0 established several foundations that earlier versions of this roadmap treated as future work:+v0.15.0 and v0.15.1 shipped work that earlier versions of this roadmap listed as in development:-- A searchable Assets panel, component details, instance insertion, frame presets, richer component properties, layout grids, constraints, and deeper typography controls.-- A local-first Storage Workspace for S3-compatible providers with background synchronization and remote document previews.-- Editable PowerPoint export; editable HTML, CSS, Tailwind, JSX, SVG, and image-vectorization workflows.-- Private local MCP transport discovery, an installable OpenPencil agent skill, and stronger CLI/MCP support for large and multi-document sessions.-- Published `@open-pencil/scene-graph`, `@open-pencil/pen`, `@open-pencil/kiwi`, `@open-pencil/fig`, `@open-pencil/dom-css`, and `@open-pencil/vue` packages with documented public boundaries.+- Editable ruler guides, snapping to geometry and guides, and Option/Alt distance measurements.+- Multidimensional component variants and published component libraries with revision review and linked-instance updates.+- Local recovery of unsaved documents, saved AI conversations, and CLI font diagnostics.+- Opt-in browser WebMCP access, separate controls for the local MCP server and remote connections, and per-tool permissions.+- `openpencil://` and web links that open a document and select a layer.### Current development version-Since v0.14.0, the development branch adds editable ruler guides and snapping preferences, Option/Alt distance measurements, multidimensional variant authoring, component-library publication and revision review, local document recovery, saved AI conversations, CLI font diagnostics, and opt-in browser WebMCP access. These workflows are implemented on the development branch but are not part of v0.14.0.+Since v0.15.1, the development branch adds:-See [canvas navigation](../user-guide/canvas-navigation), [components and libraries](../user-guide/components), [document recovery](../user-guide/layers-and-pages#documents-and-recovery), [AI chat](../programmable/ai-chat), and [font diagnostics](../programmable/cli/inspecting#font-diagnostics).+- Behaviours and preview mode: components that run as Reka UI controls, with a Controls page in the demo and Storybook controls for them.+- Variables modelled as design tokens, edited as tokens, imported and exported as W3C design tokens, written as a CSS token stylesheet, and used by name in exported code.+- Live design checks: a Lint panel with canvas markers and one-click fixes.+- AI agents shown on the canvas and to collaborators, with follow mode for people and agents, per-page presence, and MCP agents in rooms.+- AI chat turns that can be reverted, regenerated, and edited, with tool calls summarised by what they changed and a thinking level per message.+- The Code tab linked to canvas layers both ways, and visual diff and patch tools, including `openpencil diff`.+- Collaboration rooms that sync layer trees as a CRDT and open in their own tab.+- Slots, progressive canvas previews while an AI provider streams JSX, Storybook export, HTML and Tailwind JSX export, and a faster occurrence-scoped `.fig` reader with wider override and variable export.+- Comments pinned to layers and voice calls in shared rooms, with collaborators watching the AI chat's streamed JSX as it builds.+- Vue and React components of the selection in the Code tab, with variants as props and Reka UI or Radix behaviour.+- SVG and HTML imported as editable layers, with HTML and CSS laid out as a browser lays them out.+- Shader fills from the open-source `shaders` library, on-canvas gradient and corner-radius handles, multi-selection editing, and accent colours with a customizable toolbar.++These changes are not part of v0.15.1; they ship with the next release.++See [AI chat](../programmable/ai-chat), [exporting](../user-guide/exporting), and [components and libraries](../user-guide/components).++### In development++Work with open pull requests. It may change before it merges:++- Storybook stories generated as Reka UI components for Vue and Radix UI components for React.+- Component authoring: variant editing and canvas selection inside components.+- The OpenPencil Cloud foundation.## Near-term workdiff --git a/packages/docs/download.md b/packages/docs/download.mdnew file mode 100644index 000000000..7299f2ed2--- /dev/null+++ b/packages/docs/download.md@@ -0,0 +1,15 @@+---+layout: page+landing: true+sidebar: false+aside: false+title: Download OpenPencil+description: Download the OpenPencil desktop app for macOS, Windows, and Linux, or install it with Homebrew.+---++<script setup>+import DownloadPage from '#docs/theme/landing/download/DownloadPage.vue'+import { en } from '#docs/theme/landing/content/messages/en'+</script>++<DownloadPage :messages="en" />diff --git a/packages/docs/es/download.md b/packages/docs/es/download.mdnew file mode 100644index 000000000..0268a587f--- /dev/null+++ b/packages/docs/es/download.md@@ -0,0 +1,15 @@+---+layout: page+landing: true+sidebar: false+aside: false+title: Descargar OpenPencil+description: Descarga la app de escritorio de OpenPencil para macOS, Windows y Linux, o instálala con Homebrew.+---++<script setup>+import DownloadPage from '#docs/theme/landing/download/DownloadPage.vue'+import { es } from '#docs/theme/landing/content/messages/es'+</script>++<DownloadPage :messages="es" />diff --git a/packages/docs/es/getting-started.md b/packages/docs/es/getting-started.mdindex 265e39a09..8ae87843f 100644--- a/packages/docs/es/getting-started.md+++ b/packages/docs/es/getting-started.md@@ -8,7 +8,7 @@ Si quieres crear un producto basado en OpenPencil en lugar de limitarte a la apl## Aplicación de escritorio-Las versiones preparadas para macOS, Windows y Linux están disponibles en la [página de versiones](https://github.com/open-pencil/open-pencil/releases/latest).+Las versiones preparadas para macOS, Windows y Linux están disponibles en la [página de descargas](/es/download).| Plataforma | Archivo || --------------------- | -------------------- |@@ -18,7 +18,7 @@ Las versiones preparadas para macOS, Windows y Linux están disponibles en la [p| Windows (ARM) | `.msi` / `.exe` || Linux (x64) | `.AppImage` / `.deb` |-## Requisitos del sistema+## Requisitos del sistema {#system-requirements}OpenPencil dibuja con CanvasKit sobre WebGL y usa funciones recientes de la plataforma web, por lo que necesita un motor de navegador actual. La versión web admite Chrome 111, Edge 111, Firefox 128 y Safari 16.4 o posteriores; los navegadores basados en Chromium, como Brave u Opera, siguen la versión de Chrome en la que se basan. La aplicación de escritorio dibuja en el WebView del sistema, así que el mínimo depende del motor del sistema operativo:@@ -45,7 +45,7 @@ brew uninstall open-pencil/tap/open-pencilbrew install --cask openpencil```-## Compilación desde el código fuente+## Compilación desde el código fuente {#building-from-source}### Requisitosdiff --git a/packages/docs/es/index.md b/packages/docs/es/index.mdindex 98da0ae28..7f01eac86 100644--- a/packages/docs/es/index.md+++ b/packages/docs/es/index.md@@ -1,43 +1,15 @@----layout: home+layout: page+landing: true+sidebar: false+aside: falsetitle: OpenPencil — Editor de diseño de código abiertodescription: Alternativa de código abierto a Figma con archivos .fig, IA integrada y automatización completa.+----hero:- name: OpenPencil- text: Editor de diseño de código abierto- tagline: Abre archivos de Figma. Integra IA. Se puede automatizar por completo. También sirve para crear editores propios.- actions:- - theme: brand- text: Probar en línea- link: https://app.openpencil.dev/demo- - theme: alt- text: Descargar- link: https://github.com/open-pencil/open-pencil/releases/latest- - theme: alt- text: GitHub- link: https://github.com/open-pencil/open-pencil+<script setup>+import LandingPage from '#docs/theme/landing/LandingPage.vue'+import { es } from '#docs/theme/landing/content/messages/es'+</script>-features:- - icon: 📂- title: Compatible con Figma- details: Abre archivos .fig directamente. Permite copiar y pegar entre Figma y OpenPencil. Usa el códec binario Kiwi para conservar los datos en cada ida y vuelta.- - icon: ⚡- title: Programable- details: CLI sin interfaz gráfica para examinar, exportar y analizar archivos .fig. Figma Plugin API mediante eval, exportación a Tailwind CSS y salida JSON para CI y automatización.- - icon: 🧩- title: Un conjunto de herramientas, no solo una aplicación- details: Crea interfaces de edición con el SDK de Vue, integra OpenPencil en otros productos o desarrolla editores especializados sobre el mismo núcleo.- - icon: 🤖- title: IA integrada- details: Chat con 90 herramientas para crear formas, modificar estilos, gestionar disposiciones y analizar variables de diseño. Servidor MCP para Claude Code, Cursor y Windsurf.- - icon: 📖- title: Código abierto- details: Licencia MIT. Puedes consultar y modificar el editor, el motor, el códec de archivos y la CLI.- - icon: 🖥️- title: Gratuito y local- details: No requiere cuenta, servidor ni conexión a internet. Aplicación de escritorio de unos 7 MB mediante Homebrew o aplicación web.- - icon: 👥- title: Colaboración en tiempo real- details: Conexión P2P mediante WebRTC, sin servidor. Comparte un enlace y edita con cursores en directo y seguimiento de vista.----+<LandingPage :messages="es" />diff --git a/packages/docs/fr/download.md b/packages/docs/fr/download.mdnew file mode 100644index 000000000..111c9a916--- /dev/null+++ b/packages/docs/fr/download.md@@ -0,0 +1,15 @@+---+layout: page+landing: true+sidebar: false+aside: false+title: Télécharger OpenPencil+description: Téléchargez l’app de bureau OpenPencil pour macOS, Windows et Linux, ou installez-la avec Homebrew.+---++<script setup>+import DownloadPage from '#docs/theme/landing/download/DownloadPage.vue'+import { fr } from '#docs/theme/landing/content/messages/fr'+</script>++<DownloadPage :messages="fr" />diff --git a/packages/docs/fr/getting-started.md b/packages/docs/fr/getting-started.mdindex d071622e8..a541c4a09 100644--- a/packages/docs/fr/getting-started.md+++ b/packages/docs/fr/getting-started.md@@ -8,7 +8,7 @@ Si vous souhaitez développer votre propre produit avec OpenPencil plutôt que v## Application de bureau-Les versions prêtes à l'emploi pour macOS, Windows et Linux sont disponibles sur la [page des versions](https://github.com/open-pencil/open-pencil/releases/latest).+Les versions prêtes à l'emploi pour macOS, Windows et Linux sont disponibles sur la [page de téléchargement](/fr/download).| Plateforme | Fichier || --------------------- | -------------------- |@@ -18,7 +18,7 @@ Les versions prêtes à l'emploi pour macOS, Windows et Linux sont disponibles s| Windows (ARM) | `.msi` / `.exe` || Linux (x64) | `.AppImage` / `.deb` |-## Configuration requise+## Configuration requise {#system-requirements}OpenPencil affiche le rendu avec CanvasKit sur WebGL et s’appuie sur des fonctionnalités récentes de la plateforme web ; il faut donc un moteur de navigateur récent. L’application web prend en charge Chrome 111, Edge 111, Firefox 128 et Safari 16.4 ou version ultérieure ; les navigateurs basés sur Chromium, comme Brave et Opera, suivent leur version de Chrome. L’application de bureau s’affiche dans la WebView du système : le minimum dépend donc du moteur du système d’exploitation.@@ -45,7 +45,7 @@ brew uninstall open-pencil/tap/open-pencilbrew install --cask openpencil```-## Compiler le code source+## Compiler le code source {#building-from-source}### Prérequisdiff --git a/packages/docs/fr/index.md b/packages/docs/fr/index.mdindex 561dbfc55..b2f816ae5 100644--- a/packages/docs/fr/index.md+++ b/packages/docs/fr/index.md@@ -1,43 +1,15 @@----layout: home+layout: page+landing: true+sidebar: false+aside: falsetitle: OpenPencil — Éditeur de design open sourcedescription: Une alternative open source à Figma, compatible avec les fichiers .fig, avec AI intégrée et automatisation complète.+----hero:- name: OpenPencil- text: Éditeur de design open source- tagline: Ouvrez des fichiers Figma. Utilisez l’AI. Automatisez chaque étape. Créez aussi vos propres éditeurs.- actions:- - theme: brand- text: Essayer en ligne- link: https://app.openpencil.dev/demo- - theme: alt- text: Télécharger- link: https://github.com/open-pencil/open-pencil/releases/latest- - theme: alt- text: GitHub- link: https://github.com/open-pencil/open-pencil+<script setup>+import LandingPage from '#docs/theme/landing/LandingPage.vue'+import { fr } from '#docs/theme/landing/content/messages/fr'+</script>-features:- - icon: 📂- title: Compatible avec Figma- details: Ouvrez directement les fichiers .fig. Copiez-collez entre Figma et OpenPencil. Le codec binaire Kiwi conserve les données lors des allers-retours.- - icon: ⚡- title: Programmable- details: Une CLI sans interface graphique permet d’examiner, d’exporter et d’analyser les fichiers .fig. Utilisez Figma Plugin API avec eval, exportez vers Tailwind CSS et produisez du JSON pour la CI.- - icon: 🧩- title: Une boîte à outils, pas seulement une application- details: Créez des interfaces d’édition avec le SDK Vue, intégrez OpenPencil à d’autres produits ou développez des éditeurs spécialisés sur le même noyau.- - icon: 🤖- title: AI intégrée- details: Le chat propose 90 outils pour créer des formes, modifier les styles, gérer les dispositions et analyser les variables de design. Serveur MCP pour Claude Code, Cursor et Windsurf.- - icon: 📖- title: Open source- details: Licence MIT. Consultez et modifiez l’éditeur, le moteur, le codec de fichiers et la CLI.- - icon: 🖥️- title: Gratuit et local- details: Aucun compte, serveur ou accès à Internet requis. Application de bureau d’environ 7 Mo via Homebrew ou application web.- - icon: 👥- title: Collaboration en temps réel- details: Connexion P2P par WebRTC, sans serveur central. Partagez un lien, modifiez ensemble et suivez la vue d’un autre participant.----+<LandingPage :messages="fr" />diff --git a/packages/docs/getting-started.md b/packages/docs/getting-started.mdindex 94dada657..6a5aff134 100644--- a/packages/docs/getting-started.md+++ b/packages/docs/getting-started.md@@ -8,7 +8,7 @@ If you want to build on top of it instead of only using the default app, see the## Download Desktop App-Pre-built binaries for macOS, Windows, and Linux are available on the [releases page](https://github.com/open-pencil/open-pencil/releases/latest).+Pre-built binaries for macOS, Windows, and Linux are available on the [download page](/download).| Platform | Download || --------------------- | -------------------- |diff --git a/packages/docs/index.md b/packages/docs/index.mdindex 8fd8fef22..c7d9b2942 100644--- a/packages/docs/index.md+++ b/packages/docs/index.md@@ -1,43 +1,15 @@----layout: home+layout: page+landing: true+sidebar: false+aside: falsetitle: OpenPencil — Open-Source Design Editor-description: Open-source Figma alternative. Opens .fig files, built-in AI, fully programmable.+description: Open-source design editor that opens Figma .fig files, runs locally, and is fully programmable by you or your AI agent.+----hero:- name: OpenPencil- text: Open-Source Design Editor- tagline: Opens Figma files. Built-in AI. Fully programmable. Also a toolkit for building custom editors.- actions:- - theme: brand- text: Try Online- link: https://app.openpencil.dev/demo- - theme: alt- text: Download- link: https://github.com/open-pencil/open-pencil/releases/latest- - theme: alt- text: GitHub- link: https://github.com/open-pencil/open-pencil+<script setup>+import LandingPage from '#docs/theme/landing/LandingPage.vue'+import { en } from '#docs/theme/landing/content/messages/en'+</script>-features:- - icon: 📂- title: Figma-Compatible- details: Opens .fig files natively. Copy & paste between Figma and OpenPencil. Kiwi binary codec with round-trip fidelity.- - icon: ⚡- title: Programmable- details: Headless CLI to inspect, export, and analyze .fig files. Figma Plugin API via eval. Tailwind CSS export. JSON output for CI and automation.- - icon: 🧩- title: Toolkit, not just app- details: Build custom editing surfaces with the Vue SDK, embed OpenPencil into other products, or assemble workflow-specific editors around the same core.- - icon: 🤖- title: AI-Native- details: Built-in chat with 90 tools — create shapes, set styles, manage layout, analyze tokens. MCP server for Claude Code, Cursor, Windsurf.- - icon: 📖- title: Open Source- details: MIT license. Read and modify everything — the editor, the engine, the file codec, the CLI.- - icon: 🖥️- title: Free & Local- details: No account, no server, no internet required. ~7 MB desktop app via Homebrew, or use the web app.- - icon: 👥- title: Real-Time Collaboration- details: P2P via WebRTC — no server. Share a link, edit together with live cursors and follow mode.----+<LandingPage :messages="en" />diff --git a/packages/docs/it/download.md b/packages/docs/it/download.mdnew file mode 100644index 000000000..a4a61f9b6--- /dev/null+++ b/packages/docs/it/download.md@@ -0,0 +1,15 @@+---+layout: page+landing: true+sidebar: false+aside: false+title: Scarica OpenPencil+description: Scarica l’app desktop di OpenPencil per macOS, Windows e Linux, o installala con Homebrew.+---++<script setup>+import DownloadPage from '#docs/theme/landing/download/DownloadPage.vue'+import { it } from '#docs/theme/landing/content/messages/it'+</script>++<DownloadPage :messages="it" />diff --git a/packages/docs/it/getting-started.md b/packages/docs/it/getting-started.mdindex f4c94c9d2..454cc055f 100644--- a/packages/docs/it/getting-started.md+++ b/packages/docs/it/getting-started.md@@ -8,7 +8,7 @@ Se vuoi creare un prodotto basato su OpenPencil invece di utilizzare soltanto l'## Applicazione desktop-Le versioni pronte per macOS, Windows e Linux sono disponibili nella [pagina delle versioni](https://github.com/open-pencil/open-pencil/releases/latest).+Le versioni pronte per macOS, Windows e Linux sono disponibili nella [pagina dei download](/it/download).| Piattaforma | File || --------------------- | -------------------- |@@ -18,7 +18,7 @@ Le versioni pronte per macOS, Windows e Linux sono disponibili nella [pagina del| Windows (ARM) | `.msi` / `.exe` || Linux (x64) | `.AppImage` / `.deb` |-## Requisiti di sistema+## Requisiti di sistema {#system-requirements}OpenPencil esegue il rendering con CanvasKit su WebGL e usa funzionalità recenti della piattaforma web, quindi richiede un motore del browser aggiornato. L’app web supporta Chrome 111, Edge 111, Firefox 128 e Safari 16.4 o versioni successive; i browser basati su Chromium, come Brave e Opera, seguono la versione di Chrome. L’app desktop usa il WebView di sistema, quindi il requisito minimo dipende dal motore del sistema operativo:@@ -45,7 +45,7 @@ brew uninstall open-pencil/tap/open-pencilbrew install --cask openpencil```-## Compilazione dal codice sorgente+## Compilazione dal codice sorgente {#building-from-source}### Requisitidiff --git a/packages/docs/it/index.md b/packages/docs/it/index.mdindex b082a1e09..c2bc41a69 100644--- a/packages/docs/it/index.md+++ b/packages/docs/it/index.md@@ -1,43 +1,15 @@----layout: home+layout: page+landing: true+sidebar: false+aside: falsetitle: OpenPencil — Editor di design open sourcedescription: Alternativa open source a Figma con file .fig, AI integrata e automazione completa.+----hero:- name: OpenPencil- text: Editor di design open source- tagline: Apri i file Figma. Usa l’AI. Automatizza ogni operazione. Crea anche editor personalizzati.- actions:- - theme: brand- text: Prova online- link: https://app.openpencil.dev/demo- - theme: alt- text: Scarica- link: https://github.com/open-pencil/open-pencil/releases/latest- - theme: alt- text: GitHub- link: https://github.com/open-pencil/open-pencil+<script setup>+import LandingPage from '#docs/theme/landing/LandingPage.vue'+import { it } from '#docs/theme/landing/content/messages/it'+</script>-features:- - icon: 📂- title: Compatibile con Figma- details: Apre direttamente i file .fig. Copia e incolla tra Figma e OpenPencil. Il codec binario Kiwi conserva i dati nei passaggi tra le due applicazioni.- - icon: ⚡- title: Programmabile- details: CLI senza interfaccia grafica per esaminare, esportare e analizzare file .fig. Figma Plugin API tramite eval, esportazione Tailwind CSS e output JSON per CI e automazione.- - icon: 🧩- title: Un insieme di strumenti, non solo un’app- details: Crea interfacce di editing con il Vue SDK, integra OpenPencil in altri prodotti o sviluppa editor specializzati sullo stesso nucleo.- - icon: 🤖- title: AI integrata- details: Chat con 90 strumenti per creare forme, modificare stili, gestire disposizioni e analizzare variabili di design. Server MCP per Claude Code, Cursor e Windsurf.- - icon: 📖- title: Open source- details: Licenza MIT. Consulta e modifica editor, motore, codec dei file e CLI.- - icon: 🖥️- title: Gratuito e locale- details: Non richiede account, server o connessione Internet. App desktop di circa 7 MB tramite Homebrew o applicazione web.- - icon: 👥- title: Collaborazione in tempo reale- details: Connessione P2P tramite WebRTC, senza server centrale. Condividi un link, modifica insieme agli altri e segui la loro vista.----+<LandingPage :messages="it" />diff --git a/packages/docs/package.json b/packages/docs/package.jsonindex ecdb2b9af..7c93e1443 100644--- a/packages/docs/package.json+++ b/packages/docs/package.json@@ -10,13 +10,18 @@"scripts": {"dev": "vitepress dev","build": "OPENPENCIL_DOCS_FAST_BUILD=1 NODE_OPTIONS=--max-old-space-size=8192 vitepress build --minify=false --buildConcurrency=8",- "build:production": "NODE_OPTIONS=--max-old-space-size=8192 vitepress build --minify=esbuild --buildConcurrency=8",+ "build:production": "OPENPENCIL_LANDING_POSTERS=1 NODE_OPTIONS=--max-old-space-size=8192 vitepress build --minify=esbuild --buildConcurrency=8 && bun ../../tools/generate/landing-posters/src/generate.ts","check": "bun ../../tools/checks/docs/src/check.ts","preview": "vitepress preview"},"devDependencies": {+ "@iconify-json/simple-icons": "^1.2.98","@open-pencil/brand-tools": "workspace:*",+ "@open-pencil/cli": "workspace:*",+ "@open-pencil/demo-tools": "workspace:*","@open-pencil/feedback": "workspace:*",+ "@open-pencil/landing-posters-tools": "workspace:*",+ "@open-pencil/vite-config": "workspace:*","@shikijs/vitepress-twoslash": "^4.4.3","@tailwindcss/vite": "^4.3.3","vitepress": "^2.0.0-alpha.19",@@ -25,6 +30,18 @@"vue-component-meta": "^3.3.10"},"dependencies": {- "@iconify/vue": "^5.0.1"+ "@ai-sdk/vue": "^4.0.127",+ "@iconify/vue": "^5.0.1",+ "@open-pencil/core": "workspace:*",+ "@open-pencil/design-jsx": "workspace:*",+ "@open-pencil/dom-css": "workspace:*",+ "@open-pencil/scene-graph": "workspace:*",+ "@vueuse/core": "^14.4.0",+ "ai": "^7.0.127",+ "canvaskit-wasm": "^0.41.1",+ "dedent": "^1.7.2",+ "es-toolkit": "^1.52.0",+ "tinykeys": "^3.1.0",+ "valibot": "^1.5.0"}}diff --git a/packages/docs/pl/download.md b/packages/docs/pl/download.mdnew file mode 100644index 000000000..bcbddb5eb--- /dev/null+++ b/packages/docs/pl/download.md@@ -0,0 +1,15 @@+---+layout: page+landing: true+sidebar: false+aside: false+title: Pobierz OpenPencil+description: Pobierz aplikację desktopową OpenPencil na macOS, Windows i Linux albo zainstaluj ją przez Homebrew.+---++<script setup>+import DownloadPage from '#docs/theme/landing/download/DownloadPage.vue'+import { pl } from '#docs/theme/landing/content/messages/pl'+</script>++<DownloadPage :messages="pl" />diff --git a/packages/docs/pl/getting-started.md b/packages/docs/pl/getting-started.mdindex 872c21756..12624d499 100644--- a/packages/docs/pl/getting-started.md+++ b/packages/docs/pl/getting-started.md@@ -8,7 +8,7 @@ Jeśli chcesz zbudować własny produkt na bazie OpenPencil, a nie tylko korzyst## Aplikacja na komputer-Gotowe wersje dla macOS, Windows i Linux są dostępne na [stronie wydań](https://github.com/open-pencil/open-pencil/releases/latest).+Gotowe wersje dla macOS, Windows i Linux są dostępne na [stronie pobierania](/pl/download).| Platforma | Plik || --------------------- | -------------------- |@@ -18,7 +18,7 @@ Gotowe wersje dla macOS, Windows i Linux są dostępne na [stronie wydań](https| Windows (ARM) | `.msi` / `.exe` || Linux (x64) | `.AppImage` / `.deb` |-## Wymagania systemowe+## Wymagania systemowe {#system-requirements}OpenPencil renderuje przez CanvasKit na WebGL i korzysta z nowoczesnych funkcji platformy webowej, dlatego wymaga aktualnego silnika przeglądarki. Wersja internetowa działa w Chrome 111, Edge 111, Firefox 128 i Safari 16.4 lub nowszych; przeglądarki oparte na Chromium, takie jak Brave i Opera, odpowiadają wersji Chrome, na której bazują. Aplikacja na komputer renderuje w systemowym WebView, więc jej minimum wyznacza silnik systemu operacyjnego:@@ -45,7 +45,7 @@ brew uninstall open-pencil/tap/open-pencilbrew install --cask openpencil```-## Budowanie ze źródeł+## Budowanie ze źródeł {#building-from-source}### Wymaganiadiff --git a/packages/docs/pl/index.md b/packages/docs/pl/index.mdindex e6240f9a1..e33583d72 100644--- a/packages/docs/pl/index.md+++ b/packages/docs/pl/index.md@@ -1,43 +1,15 @@----layout: home+layout: page+landing: true+sidebar: false+aside: falsetitle: OpenPencil — edytor graficzny open sourcedescription: Otwarta alternatywa dla Figmy z obsługą .fig, wbudowanym AI i programowym dostępem do wszystkich operacji.+----hero:- name: OpenPencil- text: Edytor graficzny open source- tagline: Otwiera pliki Figmy. Zawiera AI. Zapewnia pełny dostęp programowy. Pozwala tworzyć własne edytory.- actions:- - theme: brand- text: Otwórz w przeglądarce- link: https://app.openpencil.dev/demo- - theme: alt- text: Pobierz- link: https://github.com/open-pencil/open-pencil/releases/latest- - theme: alt- text: GitHub- link: https://github.com/open-pencil/open-pencil+<script setup>+import LandingPage from '#docs/theme/landing/LandingPage.vue'+import { pl } from '#docs/theme/landing/content/messages/pl'+</script>-features:- - icon: 📂- title: Zgodność z Figmą- details: Otwiera .fig bez wcześniejszej konwersji. Obsługuje kopiowanie między Figmą a OpenPencil. Binarny kodek Kiwi zachowuje dane podczas importu i eksportu.- - icon: ⚡- title: Automatyzacja- details: CLI bez interfejsu graficznego przegląda, eksportuje i analizuje .fig. Polecenie eval udostępnia Figma Plugin API. Dostępne są eksport Tailwind CSS i wyjście JSON dla CI oraz skryptów.- - icon: 🧩- title: Nie tylko aplikacja- details: Vue SDK pozwala tworzyć własne interfejsy edycji, osadzać OpenPencil w innych produktach i budować wyspecjalizowane edytory na wspólnym silniku.- - icon: 🤖- title: Wbudowane AI- details: Czat AI używa 90 narzędzi do tworzenia obiektów, ustawiania stylów i układu oraz analizowania tokenów. Serwer MCP łączy się z Claude Code, Cursor i Windsurf.- - icon: 📖- title: Open source- details: Licencja MIT. Można analizować i zmieniać edytor, silnik, kodek plików i CLI.- - icon: 🖥️- title: Bezpłatnie i lokalnie- details: Konto, osobny serwer i stałe połączenie z internetem nie są potrzebne. Aplikacja komputerowa zajmuje około 7 MB; dostępna jest również wersja internetowa.- - icon: 👥- title: Współpraca- details: Połączenie WebRTC bez centralnego serwera. Wyślij odnośnik i wspólnie edytuj dokument, korzystając z kursorów uczestników oraz trybu śledzenia.----+<LandingPage :messages="pl" />diff --git a/packages/docs/programmable/coding-agents.md b/packages/docs/programmable/coding-agents.mdindex 0719c09ef..b609552b1 100644--- a/packages/docs/programmable/coding-agents.md+++ b/packages/docs/programmable/coding-agents.md@@ -6,7 +6,7 @@ Coding agents need the desktop app; the browser cannot start programs on your co## What you need-1. The [OpenPencil desktop app](https://github.com/open-pencil/open-pencil/releases/latest).+1. The [OpenPencil desktop app](/download).2. The agent's ACP program, installed globally (see each agent below).3. OpenPencil's MCP server, installed globally. Use the version that matches your app:diff --git a/packages/docs/ru/download.md b/packages/docs/ru/download.mdnew file mode 100644index 000000000..b40b67107--- /dev/null+++ b/packages/docs/ru/download.md@@ -0,0 +1,15 @@+---+layout: page+landing: true+sidebar: false+aside: false+title: Скачать OpenPencil+description: Скачайте настольное приложение OpenPencil для macOS, Windows и Linux или установите его через Homebrew.+---++<script setup>+import DownloadPage from '#docs/theme/landing/download/DownloadPage.vue'+import { ru } from '#docs/theme/landing/content/messages/ru'+</script>++<DownloadPage :messages="ru" />diff --git a/packages/docs/ru/getting-started.md b/packages/docs/ru/getting-started.mdindex a3502681d..4355b6953 100644--- a/packages/docs/ru/getting-started.md+++ b/packages/docs/ru/getting-started.md@@ -8,7 +8,7 @@ OpenPencil работает прямо в браузере и не требуе## Приложение для компьютера-Готовые версии для macOS, Windows и Linux опубликованы на [странице релизов](https://github.com/open-pencil/open-pencil/releases/latest).+Готовые версии для macOS, Windows и Linux можно скачать на [странице загрузки](/ru/download).| Платформа | Файл || --------------------- | -------------------- |@@ -18,7 +18,7 @@ OpenPencil работает прямо в браузере и не требуе| Windows (ARM) | `.msi` / `.exe` || Linux (x64) | `.AppImage` / `.deb` |-## Системные требования+## Системные требования {#system-requirements}OpenPencil отрисовывает графику через CanvasKit на WebGL и использует современные возможности веб-платформы, поэтому нужен свежий движок браузера. Веб-версия работает в Chrome 111, Edge 111, Firefox 128 и Safari 16.4 или новее; браузеры на основе Chromium, например Brave и Opera, ориентируются на версию своего Chrome. Приложение для компьютера отрисовывает интерфейс в системном WebView, поэтому нижняя граница определяется движком операционной системы:@@ -45,7 +45,7 @@ brew uninstall open-pencil/tap/open-pencilbrew install --cask openpencil```-## Сборка из исходного кода+## Сборка из исходного кода {#building-from-source}### Что потребуетсяdiff --git a/packages/docs/ru/index.md b/packages/docs/ru/index.mdindex 118fe2c62..2742a4b9b 100644--- a/packages/docs/ru/index.md+++ b/packages/docs/ru/index.md@@ -1,43 +1,15 @@----layout: home+layout: page+landing: true+sidebar: false+aside: falsetitle: OpenPencil — графический редактор с открытым исходным кодомdescription: Открытая альтернатива Figma с поддержкой .fig, встроенным ИИ и программным доступом ко всем операциям.+----hero:- name: OpenPencil- text: Графический редактор с открытым исходным кодом- tagline: Открывает файлы Figma. Включает ИИ. Предоставляет полный программный доступ. Подходит для создания собственных редакторов.- actions:- - theme: brand- text: Открыть в браузере- link: https://app.openpencil.dev/demo- - theme: alt- text: Скачать- link: https://github.com/open-pencil/open-pencil/releases/latest- - theme: alt- text: GitHub- link: https://github.com/open-pencil/open-pencil+<script setup>+import LandingPage from '#docs/theme/landing/LandingPage.vue'+import { ru } from '#docs/theme/landing/content/messages/ru'+</script>-features:- - icon: 📂- title: Совместимость с Figma- details: Открывает .fig без предварительного преобразования. Поддерживает копирование между Figma и OpenPencil. Бинарный кодек Kiwi сохраняет данные при импорте и экспорте.- - icon: ⚡- title: Автоматизация- details: CLI без графического интерфейса просматривает, экспортирует и анализирует .fig. Команда eval предоставляет Figma Plugin API. Доступны экспорт Tailwind CSS и вывод JSON для CI и сценариев.- - icon: 🧩- title: Не только приложение- details: Vue SDK позволяет создавать собственные интерфейсы редактирования, встраивать OpenPencil в другие продукты и собирать специализированные редакторы на общем движке.- - icon: 🤖- title: Встроенный ИИ- details: Чат с ИИ использует 90 инструментов для создания объектов, настройки стилей и компоновки и анализа токенов. Сервер MCP подключается к Claude Code, Cursor и Windsurf.- - icon: 📖- title: Открытый исходный код- details: Лицензия MIT. Можно изучать и изменять редактор, движок, кодек файлов и CLI.- - icon: 🖥️- title: Бесплатно и локально- details: Учётная запись, отдельный сервер и постоянное соединение с интернетом не нужны. Настольное приложение занимает около 7 МБ; также доступна веб-версия.- - icon: 👥- title: Совместная работа- details: Одноранговое соединение WebRTC без центрального сервера. Отправьте ссылку и редактируйте документ вместе с указателями участников и режимом слежения.----+<LandingPage :messages="ru" />diff --git a/packages/fig/AGENTS.md b/packages/fig/AGENTS.mdindex 4bc79bdb1..a5e159476 100644--- a/packages/fig/AGENTS.md+++ b/packages/fig/AGENTS.md@@ -7,7 +7,6 @@- One reader serves every `.fig` path — parse, worker, page population, session recovery, export, and paste — through the document sessions in `packages/fig/src/document/`. Read what it could not resolve with `readerDiagnostics(graph)` from `packages/core/src/kiwi/fig/session/document-state.ts`; do not add a second import path.- Browser `.fig` export uses fflate and `@open-pencil/fig`; Tauri uses `build_fig_file` in `desktop/`.- Saving a document opened from a `.fig` writes only the fields its edits changed, merged into the archive's records, and copies the rest as bytes (`packages/core/src/io/formats/fig/patch/`, `patchFigMessage` in `packages/fig/src/record-patch/`); the full export remains for documents with no archive. A change is what the archive tracker sees outside page loads and outside `applyDerivedLayoutDuring`, which wraps layout derived from the file or its fonts; layout an edit causes counts, and the tracker keeps each edited layer as it was so the fields are found by comparing records (`packages/core/tests/io/formats/fig/patch/`).-- Vector networks use the reverse-engineered `vectorNetworkBlob`; codecs live under `packages/core/src/vector/` and types in Scene Graph.- Changes to `.fig` behavior require round-trip validation in Figma. `packages/docs/development/roadmap.md` tracks raw metadata coverage and the code map for import/export mapping and schema files.- Measure a reader change over a whole archive, not one frame: capture before and after with `visual-oracles compare digest --file F --out baseline.json` then `--baseline baseline.json`, and account for every node it reports. `compare interpreted-document` checks one frame against live Figma and will report no change while a rule breaks pages it does not cover.- A rule about Figma's override or binding semantics holds only where it was observed. Before encoding one, find a second archive or frame that exercises it and confirm the outcome in live Figma; several plausible rules here fit one file and are contradicted by the next.diff --git a/packages/scene-graph/AGENTS.md b/packages/scene-graph/AGENTS.mdindex 78f17b5ea..b064886e5 100644--- a/packages/scene-graph/AGENTS.md+++ b/packages/scene-graph/AGENTS.md@@ -18,7 +18,7 @@ Framework-neutral document model. Owns node types, primitives, geometry, matrice- Formats read auto layout keywords (stack direction, `justify-content`, `align-items`, `align-self`, padding shorthand) through `packages/scene-graph/src/layout/keywords.ts`, and an importer builds fill and hug for a node not yet in the graph with `fillSizingFields` and `autoLayoutSizingFields`. Design JSX and `.pen` pass their own spellings straight to it, and DOM/CSS parses CSS values first with `parseCSSJustifyContent` and its siblings in `@open-pencil/scene-graph/css` (`packages/scene-graph/tests/layout/keywords.test.ts`, `packages/scene-graph/tests/css/layout.test.ts`).- CSS values that become scene-graph types, such as grid track lists, are parsed in `@open-pencil/scene-graph/css` on `postcss-value-parser`; design-jsx and dom-css call it instead of splitting or matching CSS by hand (`packages/scene-graph/tests/css`).- Every plugin-data key OpenPencil writes is a field of `OPEN_PENCIL_PLUGIN_DATA` in `packages/scene-graph/src/plugin-data/fields.ts`, with the Valibot schema that reads it and its role: `content` travels with library assets and counts towards their hash (`contentPluginData`), `format` repeats a node field for files, `bookkeeping` stays behind. Read and replace entries with `readPluginData` and `withPluginData` instead of matching `pluginId` and `key` by hand. The fields test checks that keys stay unique.-- Vector network types live here; the reverse-engineered `vectorNetworkBlob` codecs live in `packages/core/src/vector/`.+- Vector network types live here; `vectorNetworkBlob` codecs live in `packages/core/src/vector/`.- `packages/scene-graph/src/checkpoint.ts` owns transaction checkpoint recovery, including hierarchy and indexes; Core's atomic tool execution relies on it.- Export named types and primitives (`Color`, `Vector`, `Rect`, `SceneNode`, `Effect`, `Fill`, `Stroke`) from the public entry; downstream packages reuse them instead of respelling shapes.- A paint's `gradientTransform` follows Figma's convention, mapping the layer's unit square onto gradient space; read, build, and invert it only through `@open-pencil/scene-graph/gradient`, which renderers, handles, exporters, importers, and tools all share (`packages/scene-graph/tests/gradient.test.ts`, `tests/engine/render/canvas/gradient.test.ts`).diff --git a/public/Inter-Bold.ttf b/public/Inter-Bold.ttfdeleted file mode 100644index ae2c2d436..000000000Binary files a/public/Inter-Bold.ttf and /dev/null differdiff --git a/public/Inter-ExtraBold.ttf b/public/Inter-ExtraBold.ttfdeleted file mode 100644index 8a9a1bcb9..000000000Binary files a/public/Inter-ExtraBold.ttf and /dev/null differdiff --git a/public/Inter-Medium.ttf b/public/Inter-Medium.ttfdeleted file mode 100644index 4a57a1a72..000000000Binary files a/public/Inter-Medium.ttf and /dev/null differdiff --git a/public/Inter-Regular.ttf b/public/Inter-Regular.ttfdeleted file mode 100644index 9a53a64e5..000000000Binary files a/public/Inter-Regular.ttf and /dev/null differdiff --git a/public/Inter-SemiBold.ttf b/public/Inter-SemiBold.ttfdeleted file mode 100644index 67fda287e..000000000Binary files a/public/Inter-SemiBold.ttf and /dev/null differdiff --git a/public/NotoNaskhArabic-Regular.ttf b/public/NotoNaskhArabic-Regular.ttfdeleted file mode 100644index 1c522ff28..000000000Binary files a/public/NotoNaskhArabic-Regular.ttf and /dev/null differdiff --git a/src/AGENTS.md b/src/AGENTS.mdindex 02816778b..c685d479d 100644--- a/src/AGENTS.md+++ b/src/AGENTS.md@@ -51,8 +51,9 @@ The supported browser baseline lives in `src/app/shell/support/baseline.ts` and### Building blocks- Use Reka UI primitives and typed Tailwind Variants themes under `src/theme/**`; merge per-instance `ui` slot overrides, expose `class` for single-root components, and do not add one-off class props. Use `UI` casing in type names. App wrappers around SDK primitives use shared UI helpers rather than scattered raw classes.+- Design tokens, custom variants, and custom utilities live in `src/theme/tokens.css`, which the docs site also imports; `src/app.css` keeps only the app's document-level rules.- Tailwind 4 and `tw-animate-css`; no static inline styling or component `<style>` blocks. Dynamic `:style` bindings are allowed for runtime geometry and CSS variables.-- Colors are the `--color-*` tokens in `src/app.css`, each defined for both themes; statuses use one family each: `error` and `warning` have a text color, a `-bg` tint, and a `-border`, `success` a text color; `error-fill` and `success-fill` are solid, and `warning-action` colors buttons on the warning tint. Name the token's utility (`text-warning`), not `[var(--color-warning)]` or a default palette color (`open-pencil/no-unknown-tailwind-classes`).+- Colors are the `--color-*` tokens in `src/theme/tokens.css`, each defined for both themes; statuses use one family each: `error` and `warning` have a text color, a `-bg` tint, and a `-border`, `success` a text color; `error-fill` and `success-fill` are solid, and `warning-action` colors buttons on the warning tint. Name the token's utility (`text-warning`), not `[var(--color-warning)]` or a default palette color (`open-pencil/no-unknown-tailwind-classes`).- Bind visual state through semantic `data-*` attributes. Steiger rejects template-time `use*UI()`, visual-state utility branches, and raw SVG app icons.- `Tip`, not native `title`; Lucide/Iconify components, not raw SVG or Unicode icons; `e.code`, not `e.key`, for modified shortcuts.- App dialogs compose the Reka-backed components under `src/components/ui/dialog/` and the typed theme in `src/theme/dialog.ts`. Do not repeat portal, overlay, content, header, or footer infrastructure in feature dialogs.diff --git a/src/app.css b/src/app.cssindex 0452785dd..1083e4d9c 100644--- a/src/app.css+++ b/src/app.css@@ -3,144 +3,7 @@@import 'vue-stream-markdown/index.css' layer(components);@import './theme/markdown/markdown.css';-@custom-variant motion-safe {- @media (prefers-reduced-motion: no-preference) {- &:where(:root:not([data-motion='off']), :root:not([data-motion='off']) *) {- @slot;- }- }-}--@custom-variant motion-reduce {- @media (prefers-reduced-motion: reduce) {- @slot;- }- &:where([data-motion='off'], [data-motion='off'] *) {- @slot;- }-}--@utility scrollbar-none {- -ms-overflow-style: none;- scrollbar-width: none;- &::-webkit-scrollbar {- display: none;- }-}--@utility scrollbar-thin {- scrollbar-width: thin;- scrollbar-color: var(--color-border) transparent;- &::-webkit-scrollbar {- width: 6px;- height: 6px;- }- &::-webkit-scrollbar-track {- background: transparent;- }- &::-webkit-scrollbar-thumb {- background: var(--color-border);- border-radius: 3px;- }- &::-webkit-scrollbar-thumb:hover {- background: var(--color-muted);- }-}--@theme {- /* The theme's colors are its own: Tailwind's default palette is left out. */- --color-*: initial;- --color-white: #ffffff;- --color-black: #000000;- --color-panel: #2a2a2a;- --color-panel-secondary: #242424;- --color-panel-field: #383838;- --color-panel-field-hover: #404040;- --color-panel-focus: #3b82f6;- --color-panel-selected: #2f6fdd;- --color-panel-selected-muted: #353b46;- --color-canvas: #1e1e1e;- --color-border: #3a3a3a;- --color-hover: #353535;- /* The accent family; src/app/shell/accent/palette.ts derives other accents from it. */- --color-accent: #2563eb;- --color-on-accent: #ffffff;- --color-on-primary: #1f2328;- --color-surface: #f0f0f0;- --color-muted: #a6a6a6;- --color-input: #1e1e1e;- --color-component: #bb8cff;- --color-slot: #f45cc4;- /*- * Status colors: each is a text and icon color. Errors and warnings also have a tint (-bg) and a- * border (-border) for panels in that status, and warnings -action for buttons on the tint.- * Errors and successes have a solid -fill that takes white text.- */- --color-warning: #ffb314;- --color-warning-bg: rgb(245 158 11 / 0.1);- --color-warning-border: rgb(245 158 11 / 0.3);- --color-warning-action: #fcd34d;- --color-success: #4ade80;- --color-primary: #60a5fa;- --color-inverted: #1f2328;- --color-error: #fa8585;- --color-error-bg: rgb(250 133 133 / 0.1);- --color-error-border: rgb(250 133 133 / 0.4);- --color-error-fill: #dc2626;- --color-success-fill: #16a34a;- /* Transparent backgrounds and the canvas rulers, which src/app/shell/theme.ts reads. */- --color-checkerboard: #3a3a3a;- --color-checkerboard-muted: #4a4a4a;- --color-ruler-bg: rgb(36, 36, 36);- --color-ruler-tick: rgb(102, 102, 102);- --color-ruler-text: rgb(140, 140, 140);- /* Syntax colors for code editors and viewers. */- --color-code-keyword: #c4a7e7;- --color-code-tag: #82aaff;- --color-code-string: #a3d9a5;- --color-code-number: #e5bc8b;- --color-code-comment: #969eaa;-}--html[data-theme='light'] {- --color-panel: #ffffff;- --color-panel-secondary: #f7f8fa;- --color-panel-field: #f0f1f3;- --color-panel-field-hover: #e4e7ea;- --color-panel-focus: #2563eb;- --color-panel-selected: #2563eb;- --color-panel-selected-muted: #e5e7eb;- --color-canvas: #f3f4f6;- --color-border: #d8dce3;- --color-hover: #eef1f5;- --color-accent: #2563eb;- --color-primary: #1d4ed8;- --color-on-primary: #ffffff;- --color-inverted: #ffffff;- --color-surface: #1f2328;- --color-muted: #5f6673;- --color-input: #ffffff;- --color-component: #7c3aed;- --color-slot: #db2777;- --color-warning: #8f5500;- --color-warning-bg: rgb(245 158 11 / 0.14);- --color-warning-border: rgb(245 158 11 / 0.32);- --color-warning-action: #78350f;- --color-success: #15803d;- --color-error: #b91c1c;- --color-error-bg: rgb(185 28 28 / 0.08);- --color-error-border: rgb(185 28 28 / 0.28);- --color-checkerboard: #d1d5db;- --color-checkerboard-muted: #e5e7eb;- --color-ruler-bg: rgb(250, 250, 251);- --color-ruler-tick: rgb(163, 171, 182);- --color-ruler-text: rgb(90, 99, 112);- --color-code-keyword: #7947a7;- --color-code-tag: #145ca4;- --color-code-string: #276b3b;- --color-code-number: #965212;- --color-code-comment: #69727f;-}+@import './theme/tokens.css';html,body,diff --git a/src/app/collab/session.ts b/src/app/collab/session.tsindex b4034b8b3..4962afd68 100644--- a/src/app/collab/session.ts+++ b/src/app/collab/session.ts@@ -62,6 +62,8 @@ export interface RoomSessionOptions {store: EditorStoreorigin: RoomOriginjoinRoom?: JoinCollabRoom+ /** Who this tab is in the room; the device's own identity unless a host stands in for one. */+ identity?: Pick<ReturnType<typeof useCollabIdentity>, 'name' | 'color'>openSavedCopy?: (roomId: string, ydoc: Y.Doc) => RoomSavedCopy/** How long the tab tries to reach the service that introduces peers before saying it cannot. */unreachableMs?: number@@ -80,11 +82,11 @@ export function openRoomSession({store,origin,joinRoom,+ identity = useCollabIdentity(),openSavedCopy = openIndexedDBCopy,unreachableMs = ROOM_UNREACHABLE_MS,tickMs = ROOM_STATUS_TICK_MS}: RoomSessionOptions): RoomSession {- const identity = useCollabIdentity()const ydoc = new Y.Doc()const awareness = new awarenessProtocol.Awareness(ydoc)const ynodes: YNodes = ydoc.getMap('nodes')diff --git a/src/app/collab/transport/index.ts b/src/app/collab/transport/index.tsindex cb240a584..f0029b24d 100644--- a/src/app/collab/transport/index.ts+++ b/src/app/collab/transport/index.ts@@ -11,4 +11,4 @@ function usesTestTransport(): boolean {export const joinCollabRoom: JoinCollabRoom = (roomId) =>usesTestTransport() ? joinTestCollabRoom(roomId) : joinTrysteroCollabRoom(roomId)-export type { CollabRoomTransport, JoinCollabRoom } from './types'+export type { CollabActionReceiver, CollabRoomTransport, JoinCollabRoom } from './types'diff --git a/src/app/document/io/browser.ts b/src/app/document/io/browser.tsindex 73e69edfe..ce5c294d1 100644--- a/src/app/document/io/browser.ts+++ b/src/app/document/io/browser.ts@@ -93,12 +93,17 @@ export function createDocumentViewportActions(editor: ViewportEditor, viewportSiviewportSize.height = height}+ /** The canvas size in screen pixels, as the canvas last reported it. */+ function getViewportSize(): ViewportSize {+ return { ...viewportSize }+ }+async function fitCurrentPageToViewport() {await yieldToUI()editor.zoomToFit()}- return { setViewportSize, fitCurrentPageToViewport }+ return { setViewportSize, getViewportSize, fitCurrentPageToViewport }}export function downloadBlob(data: Uint8Array, filename: string, mime: string) {diff --git a/src/app/document/io/create.ts b/src/app/document/io/create.tsindex 20a4b72e3..114079878 100644--- a/src/app/document/io/create.ts+++ b/src/app/document/io/create.ts@@ -40,10 +40,8 @@ export function createDocumentIOActions(void reloadFromDisk()}})- const { setViewportSize, fitCurrentPageToViewport } = createDocumentViewportActions(- editor,- viewportSize- )+ const { setViewportSize, getViewportSize, fitCurrentPageToViewport } =+ createDocumentViewportActions(editor, viewportSize)const sourceActions = createDocumentSourceActions({editor,state,@@ -70,6 +68,7 @@ export function createDocumentIOActions(return {downloadBlob,setViewportSize,+ getViewportSize,fitCurrentPageToViewport,getDocumentFilePath: sourceState.getFilePath,getSourceIdentity: sourceState.getSourceIdentity,diff --git a/src/app/editor/fonts/bundled.ts b/src/app/editor/fonts/bundled.tsnew file mode 100644index 000000000..bb047702f--- /dev/null+++ b/src/app/editor/fonts/bundled.ts@@ -0,0 +1,27 @@+import interBold from '@open-pencil/core/assets/Inter-Bold.ttf?url'+import interExtraBold from '@open-pencil/core/assets/Inter-ExtraBold.ttf?url'+import interMedium from '@open-pencil/core/assets/Inter-Medium.ttf?url'+import interRegular from '@open-pencil/core/assets/Inter-Regular.ttf?url'+import interSemiBold from '@open-pencil/core/assets/Inter-SemiBold.ttf?url'+import notoNaskhArabic from '@open-pencil/core/assets/NotoNaskhArabic-Regular.ttf?url'+import { fontManager } from '@open-pencil/core/text'++/**+ * Core ships its bundled fonts in `@open-pencil/core/assets`. Importing them as assets lets+ * Vite serve them in development and emit hashed copies with the build, so no host keeps a+ * second copy in `public/`. Kept apart from `index.ts` because `?url` imports only resolve+ * in a Vite build, not in the Bun test runner.+ */+const BUNDLED_FONT_URLS: Record<string, string> = {+ 'Inter-Regular.ttf': interRegular,+ 'Inter-Medium.ttf': interMedium,+ 'Inter-SemiBold.ttf': interSemiBold,+ 'Inter-Bold.ttf': interBold,+ 'Inter-ExtraBold.ttf': interExtraBold,+ 'NotoNaskhArabic-Regular.ttf': notoNaskhArabic+}++/** Points core at the emitted font files. Call before any font loads. */+export function installBundledFonts(): void {+ fontManager.setBundledFontLocator((file) => BUNDLED_FONT_URLS[file] ?? `/${file}`)+}diff --git a/src/app/editor/session/modules.ts b/src/app/editor/session/modules.tsindex ec532c50e..9338cab7e 100644--- a/src/app/editor/session/modules.ts+++ b/src/app/editor/session/modules.ts@@ -76,6 +76,7 @@ export function createEditorStoreModules(openDOMFile: documentIO.openDOMFile,importDOMText: documentIO.importDOMText,setViewportSize: documentIO.setViewportSize,+ getViewportSize: documentIO.getViewportSize,fitCurrentPageToViewport: documentIO.fitCurrentPageToViewport,hasUnsavedChanges: documentIO.hasUnsavedChanges,/** Takes the document as it is now as its saved state, so closing it asks nothing. */diff --git a/src/app/integrations/storage/s3/client.ts b/src/app/integrations/storage/s3/client.tsindex 2fc8cdcec..028a9f622 100644--- a/src/app/integrations/storage/s3/client.ts+++ b/src/app/integrations/storage/s3/client.ts@@ -1,6 +1,6 @@import type { S3Client } from '@aws-sdk/client-s3'-import { storageFetch } from '@/app/integrations/storage/s3/fetch'+import { asFetch, storageFetch } from '@/app/integrations/storage/s3/fetch'import type * as S3SDK from '@/app/integrations/storage/s3/sdk'import type { S3CompatibleConfig } from '@/app/integrations/storage/s3/types'import type { LibraryObjectWriteOptions } from '@/app/integrations/storage/types'@@ -36,7 +36,7 @@ export type UploadProgress = { sentBytes: number; totalBytes: number | null }* XMLHttpRequest when a progress callback is attached (uploads only).*/function xhrFetch(onUploadProgress: (progress: UploadProgress) => void): typeof fetch {- return async (input) => {+ return asFetch(async (input) => {if (!(input instanceof Request)) throw new TypeError('Expected a signed S3 request')// A Blob has a known size, so the browser sends Content-Length (required by B2).const body = await input.blob()@@ -57,7 +57,7 @@ function xhrFetch(onUploadProgress: (progress: UploadProgress) => void): typeofxhr.onerror = () => reject(new TypeError('Failed to fetch'))xhr.send(body)})- }+ })}async function send<Output>(diff --git a/src/app/integrations/storage/s3/fetch.ts b/src/app/integrations/storage/s3/fetch.tsindex 4211aff05..f9086d421 100644--- a/src/app/integrations/storage/s3/fetch.ts+++ b/src/app/integrations/storage/s3/fetch.ts@@ -16,11 +16,19 @@ function storageFetchSignal(external?: AbortSignal | null): StorageFetchSignal {}}+type FetchImplementation = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>++/**+ * The AWS SDK types a custom fetch as the global `fetch`, which some runtimes extend with+ * static members (Bun adds `preconnect`). Copying the global's own members onto a replacement+ * keeps it assignable wherever the code is compiled; in a browser there are none to copy.+ */+export function asFetch(implementation: FetchImplementation): typeof fetch {+ return Object.assign(implementation, fetch)+}+/** Prefer Tauri HTTP bridge on desktop to avoid bucket CORS requirements. */-export async function storageFetch(- input: RequestInfo | URL,- init?: RequestInit-): Promise<Response> {+async function fetchWithTimeout(input: RequestInfo | URL, init?: RequestInit): Promise<Response> {const { signal, timedOut } = storageFetchSignal(init?.signal ?? (input instanceof Request ? input.signal : null))@@ -43,3 +51,5 @@ export async function storageFetch(throw error}}++export const storageFetch = asFetch(fetchWithTimeout)diff --git a/src/app/presence/follow-view.ts b/src/app/presence/follow-view.tsindex 198d9cd57..746dd357e 100644--- a/src/app/presence/follow-view.ts+++ b/src/app/presence/follow-view.ts@@ -1,18 +1,19 @@import { useEventListener } from '@vueuse/core'import { computed, type MaybeRefOrGetter } from 'vue'-import { useActiveEditorStoreRef } from '@/app/editor/active-store'+import { useActiveEditorStoreRef, type EditorStore } from '@/app/editor/active-store'import { follow, followedLabel, presenceOf } from './registry'/*** Who the active document's view follows, for a canvas pane's frame and banner. Your own* input on the canvas — a click, scrolling or zooming — stops following; the frame also- * stops it on Escape.+ * stops it on Escape. A surface showing several documents at once passes the one it shows.*/-export function useFollowView(area: MaybeRefOrGetter<HTMLElement | null>) {+export function useFollowView(area: MaybeRefOrGetter<HTMLElement | null>, store?: EditorStore) {// Presence belongs to the store object itself, not the forwarding proxy components get.- const storeRef = useActiveEditorStoreRef()+ const activeStoreRef = useActiveEditorStoreRef()+ const storeRef = computed(() => store ?? activeStoreRef.value)const label = computed(() => (storeRef.value ? followedLabel(storeRef.value) : null))const stop = () => {diff --git a/src/boot.ts b/src/boot.tsindex 4e399c6a0..89e2826dc 100644--- a/src/boot.ts+++ b/src/boot.ts@@ -6,6 +6,7 @@ import { createRetainedScopePlugin } from '@open-pencil/vue'import './app.css'import { recordRuntimeError } from '@/app/diagnostics'import { preloadFonts } from '@/app/editor/fonts'+import { installBundledFonts } from '@/app/editor/fonts/bundled'import { observeBootErrors } from '@/app/shell/support/boot'import { reportBootFailure } from '@/app/shell/support/gate'import { IS_TAURI } from '@/constants'@@ -19,6 +20,7 @@ import router from './router'* evaluates the app bundle and can still show the gate's guidance.*/export async function boot(): Promise<void> {+ installBundledFonts()preloadFonts()const head = createHead()const app = createApp(App)diff --git a/src/components/CodePanel.vue b/src/components/CodePanel.vueindex 1894c3466..b79faacd4 100644--- a/src/components/CodePanel.vue+++ b/src/components/CodePanel.vue@@ -45,13 +45,17 @@ import statusTheme from '@/theme/feedback/status'const CodeEditor = defineAsyncComponent(() => import('@/components/code-editor/CodeEditor.vue'))-const { active = true } = defineProps<{ active?: boolean }>()+const { active = true, initialSource = 'design-jsx' } = defineProps<{+ active?: boolean+ /** The code shown first; a host that showcases components can open on Vue or React. */+ initialSource?: CodeSource+}>()const store = useEditorStore()const editorActive = computed(() => active)const { code, common } = useI18n()const { copy, copied } = useClipboard({ copiedDuring: 2000 })const { copy: copyReference, copied: copiedReference } = useClipboard({ copiedDuring: 2000 })-const source = ref<CodeSource>('design-jsx')+const source = ref<CodeSource>(initialSource)const draft = ref('')/** The person has written in the code since it was generated for the current selection. */const edited = ref(false)diff --git a/src/components/chat/ChatMessage.vue b/src/components/chat/ChatMessage.vueindex 144c9e7d8..8236c32c8 100644--- a/src/components/chat/ChatMessage.vue+++ b/src/components/chat/ChatMessage.vue@@ -9,9 +9,10 @@ import { useI18n, vTestId } from '@open-pencil/vue'import { attachmentsForMessage } from '@/app/ai/attachment/presentation/store'import type { AttachmentPresentation } from '@/app/ai/attachment/presentation/types'import { undoOf, wasStopped } from '@/app/ai/chat/metadata'-import { reasoningDisplay } from '@/app/ai/chat/preferences'+import { reasoningDisplay as preferredReasoningDisplay } from '@/app/ai/chat/preferences'import { visibleUserMessageText } from '@/app/ai/chat/presentation'import { groupMessageParts, type MessagePartGroup } from '@/app/ai/chat/tool-calls/display'+import type { ReasoningDisplay } from '@/app/settings/preferences/store'import AttachmentList from '@/components/chat/attachment/AttachmentList.vue'import ChatMarkdown from '@/components/chat/ChatMarkdown.vue'import ReasoningBlock from '@/components/chat/ReasoningBlock.vue'@@ -27,7 +28,8 @@ const {presentation,canRegenerate = false,canRetry = false,- canEdit = false+ canEdit = false,+ reasoningDisplay} = defineProps<{message: UIMessagestreaming?: boolean@@ -38,6 +40,8 @@ const {canRetry?: boolean/** The last user message without attachments, when the chat is idle. */canEdit?: boolean+ /** Overrides the reasoning display preference, for a surface that always shows it. */+ reasoningDisplay?: ReasoningDisplay}>()const emit = defineEmits<{ regenerate: []; revert: []; restore: []; edit: [text: string] }>()const editing = ref(false)@@ -128,7 +132,7 @@ function groupKey(group: MessagePartGroup): string {<ReasoningBlockv-else-if="isReasoningUIPart(group.part) && group.part.text":text="group.part.text"- :display="reasoningDisplay"+ :display="reasoningDisplay ?? preferredReasoningDisplay":streaming="streaming && group.part.state === 'streaming'":thinking-label="ai.thinking":reasoning-label="ai.reasoning"diff --git a/src/components/chat/ChatTranscript.vue b/src/components/chat/ChatTranscript.vueindex 3b5b0a879..54d109d4b 100644--- a/src/components/chat/ChatTranscript.vue+++ b/src/components/chat/ChatTranscript.vue@@ -7,6 +7,7 @@ import { useI18n } from '@open-pencil/vue'import { attachmentsForMessage } from '@/app/ai/attachment/presentation/store'import type { AttachmentPresentation } from '@/app/ai/attachment/presentation/types'+import type { ReasoningDisplay } from '@/app/settings/preferences/store'import { CHAT_NODES_LIVE } from '@/components/chat/tool/context'import AppButton from '@/components/ui/button/AppButton.vue'import IconButton from '@/components/ui/button/IconButton.vue'@@ -21,7 +22,8 @@ const {showContinue = false,presentations,interactive = false,- nodesLive = true+ nodesLive = true,+ reasoningDisplay} = defineProps<{messages: UIMessage[]status: ChatStatus@@ -31,6 +33,8 @@ const {interactive?: boolean/** False for a conversation from another document: its layer IDs are not this document's. */nodesLive?: boolean+ /** Overrides the reasoning display preference, for a surface that always shows it. */+ reasoningDisplay?: ReasoningDisplay}>()const emit = defineEmits<{continue: []@@ -100,6 +104,7 @@ const { arrivedState, resumeFollowing } = useScrollFollowing(:can-regenerate="idle && msg.id === lastMessage?.id && msg.role === 'assistant'":can-retry="idle && msg.id === lastMessage?.id && msg.role === 'user'":can-edit="idle && msg.id === editableRequestId"+ :reasoning-display="reasoningDisplay"@regenerate="emit('regenerate')"@revert="emit('revert', msg.id)"@restore="emit('restore', msg.id)"diff --git a/src/components/chat/FollowAgentsToggle.vue b/src/components/chat/FollowAgentsToggle.vueindex bfbaa3ac0..d1262d424 100644--- a/src/components/chat/FollowAgentsToggle.vue+++ b/src/components/chat/FollowAgentsToggle.vue@@ -1,19 +1,24 @@<script setup lang="ts">import { useAIMessages } from '@open-pencil/vue'-import { useActiveEditorStoreRef } from '@/app/editor/active-store'+import { useActiveEditorStoreRef, type EditorStore } from '@/app/editor/active-store'import { followWorkingAgents } from '@/app/presence/registry'import { appPreferences } from '@/app/settings/preferences/store'import IconButton from '@/components/ui/button/IconButton.vue'-/** Whether the view follows our AI agents while they work, from the chat's header. */+/**+ * Whether the view follows our AI agents while they work, from the chat's header. It acts on+ * the active tab unless a surface showing several documents names the one it belongs to.+ */+const { store } = defineProps<{ store?: EditorStore }>()const ai = useAIMessages()const tabStore = useActiveEditorStoreRef()function toggle() {const on = !appPreferences.value.chat.followAgentsappPreferences.value.chat.followAgents = on- if (on && tabStore.value) followWorkingAgents(tabStore.value)+ const target = store ?? tabStore.value+ if (on && target) followWorkingAgents(target)}</script>diff --git a/src/components/design-check/DesignCheckPanel.vue b/src/components/design-check/DesignCheckPanel.vueindex 23d3089c9..541febe5f 100644--- a/src/components/design-check/DesignCheckPanel.vue+++ b/src/components/design-check/DesignCheckPanel.vue@@ -14,7 +14,11 @@ import IssueGroup from './IssueGroup.vue'import SeverityFilters from './SeverityFilters.vue'import { useDesignCheckPanel, type DesignCheckScope } from './useDesignCheckPanel'-const { active } = defineProps<{ active: boolean }>()+const { active, initialScope = 'page' } = defineProps<{+ active: boolean+ /** The scope listed first; a host that shows one layer's problems can open on the selection. */+ initialScope?: DesignCheckScope+}>()const messages = useDesignCheckMessages()const styles = designCheck()@@ -33,7 +37,7 @@ const {setGroupOpen,clearFilters,hoverRow-} = useDesignCheckPanel({ active: () => active, list })+} = useDesignCheckPanel({ active: () => active, list, initialScope })const scopeOptions = computed(() => [{ value: 'page' satisfies DesignCheckScope, label: messages.value.scopePage },diff --git a/src/components/design-check/useDesignCheckPanel.ts b/src/components/design-check/useDesignCheckPanel.tsindex 9c02e41dd..f69b41051 100644--- a/src/components/design-check/useDesignCheckPanel.ts+++ b/src/components/design-check/useDesignCheckPanel.ts@@ -48,13 +48,14 @@ function isHidden(graph: SceneGraph, nodeId: string): boolean {export function useDesignCheckPanel(options: {active: () => booleanlist: Readonly<Ref<HTMLElement | null>>+ initialScope?: DesignCheckScope}) {const store = useEditorStore()const messages = useDesignCheckMessages()const presetLabels = usePresetLabels()const check = store.designCheck- const scope = ref<DesignCheckScope>('page')+ const scope = ref<DesignCheckScope>(options.initialScope ?? 'page')const visibleSeverities = ref<DesignIssueSeverity[]>([...DESIGN_ISSUE_SEVERITIES])/** Explicit open state per rule; suggestions start collapsed, problems start open. */const openGroups = reactive(new Map<string, boolean>())diff --git a/src/theme/tokens.css b/src/theme/tokens.cssnew file mode 100644index 000000000..eb581866a--- /dev/null+++ b/src/theme/tokens.css@@ -0,0 +1,142 @@+/*+ * Design tokens, custom variants, and utilities shared by every surface that renders app+ * components: the app itself and the docs site's landing page.+ */+@custom-variant motion-safe {+ @media (prefers-reduced-motion: no-preference) {+ &:where(:root:not([data-motion='off']), :root:not([data-motion='off']) *) {+ @slot;+ }+ }+}++@custom-variant motion-reduce {+ @media (prefers-reduced-motion: reduce) {+ @slot;+ }+ &:where([data-motion='off'], [data-motion='off'] *) {+ @slot;+ }+}++@utility scrollbar-none {+ -ms-overflow-style: none;+ scrollbar-width: none;+ &::-webkit-scrollbar {+ display: none;+ }+}++@utility scrollbar-thin {+ scrollbar-width: thin;+ scrollbar-color: var(--color-border) transparent;+ &::-webkit-scrollbar {+ width: 6px;+ height: 6px;+ }+ &::-webkit-scrollbar-track {+ background: transparent;+ }+ &::-webkit-scrollbar-thumb {+ background: var(--color-border);+ border-radius: 3px;+ }+ &::-webkit-scrollbar-thumb:hover {+ background: var(--color-muted);+ }+}++@theme {+ /* The theme's colors are its own: Tailwind's default palette is left out. */+ --color-*: initial;+ --color-white: #ffffff;+ --color-black: #000000;+ --color-panel: #2a2a2a;+ --color-panel-secondary: #242424;+ --color-panel-field: #383838;+ --color-panel-field-hover: #404040;+ --color-panel-focus: #3b82f6;+ --color-panel-selected: #2f6fdd;+ --color-panel-selected-muted: #353b46;+ --color-canvas: #1e1e1e;+ --color-border: #3a3a3a;+ --color-hover: #353535;+ /* The accent family; src/app/shell/accent/palette.ts derives other accents from it. */+ --color-accent: #2563eb;+ --color-on-accent: #ffffff;+ --color-on-primary: #1f2328;+ --color-surface: #f0f0f0;+ --color-muted: #a6a6a6;+ --color-input: #1e1e1e;+ --color-component: #bb8cff;+ --color-slot: #f45cc4;+ /*+ * Status colors: each is a text and icon color. Errors and warnings also have a tint (-bg) and a+ * border (-border) for panels in that status, and warnings -action for buttons on the tint.+ * Errors and successes have a solid -fill that takes white text.+ */+ --color-warning: #ffb314;+ --color-warning-bg: rgb(245 158 11 / 0.1);+ --color-warning-border: rgb(245 158 11 / 0.3);+ --color-warning-action: #fcd34d;+ --color-success: #4ade80;+ --color-primary: #60a5fa;+ --color-inverted: #1f2328;+ --color-error: #fa8585;+ --color-error-bg: rgb(250 133 133 / 0.1);+ --color-error-border: rgb(250 133 133 / 0.4);+ --color-error-fill: #dc2626;+ --color-success-fill: #16a34a;+ /* Transparent backgrounds and the canvas rulers, which src/app/shell/theme.ts reads. */+ --color-checkerboard: #3a3a3a;+ --color-checkerboard-muted: #4a4a4a;+ --color-ruler-bg: rgb(36, 36, 36);+ --color-ruler-tick: rgb(102, 102, 102);+ --color-ruler-text: rgb(140, 140, 140);+ /* Syntax colors for code editors and viewers. */+ --color-code-keyword: #c4a7e7;+ --color-code-tag: #82aaff;+ --color-code-string: #a3d9a5;+ --color-code-number: #e5bc8b;+ --color-code-comment: #969eaa;+}++html[data-theme='light'] {+ --color-panel: #ffffff;+ --color-panel-secondary: #f7f8fa;+ --color-panel-field: #f0f1f3;+ --color-panel-field-hover: #e4e7ea;+ --color-panel-focus: #2563eb;+ --color-panel-selected: #2563eb;+ --color-panel-selected-muted: #e5e7eb;+ --color-canvas: #f3f4f6;+ --color-border: #d8dce3;+ --color-hover: #eef1f5;+ --color-accent: #2563eb;+ --color-primary: #1d4ed8;+ --color-on-primary: #ffffff;+ --color-inverted: #ffffff;+ --color-surface: #1f2328;+ --color-muted: #5f6673;+ --color-input: #ffffff;+ --color-component: #7c3aed;+ --color-slot: #db2777;+ --color-warning: #8f5500;+ --color-warning-bg: rgb(245 158 11 / 0.14);+ --color-warning-border: rgb(245 158 11 / 0.32);+ --color-warning-action: #78350f;+ --color-success: #15803d;+ --color-error: #b91c1c;+ --color-error-bg: rgb(185 28 28 / 0.08);+ --color-error-border: rgb(185 28 28 / 0.28);+ --color-checkerboard: #d1d5db;+ --color-checkerboard-muted: #e5e7eb;+ --color-ruler-bg: rgb(250, 250, 251);+ --color-ruler-tick: rgb(163, 171, 182);+ --color-ruler-text: rgb(90, 99, 112);+ --color-code-keyword: #7947a7;+ --color-code-tag: #145ca4;+ --color-code-string: #276b3b;+ --color-code-number: #965212;+ --color-code-comment: #69727f;+}diff --git a/tests/e2e/canvas/label-anatomy.spec.ts b/tests/e2e/canvas/label-anatomy.spec.tsindex 7d10e2c74..a7affda03 100644--- a/tests/e2e/canvas/label-anatomy.spec.ts+++ b/tests/e2e/canvas/label-anatomy.spec.ts@@ -16,7 +16,7 @@ test('reused Unicode section labels match fresh paragraphs across zoom reversals{family: 'Noto Naskh Arabic',subset: 'arabic',- data: readFileSync('public/NotoNaskhArabic-Regular.ttf')+ data: readFileSync('packages/core/assets/NotoNaskhArabic-Regular.ttf')},{family: 'Noto Sans SC',diff --git a/tests/e2e/canvas/tiled-property-preview.spec.ts b/tests/e2e/canvas/tiled-property-preview.spec.tsindex b08796858..cd1bc51da 100644--- a/tests/e2e/canvas/tiled-property-preview.spec.ts+++ b/tests/e2e/canvas/tiled-property-preview.spec.ts@@ -160,7 +160,7 @@ for (const [property, label] of [test('font arrival invalidates tiled text and matches a fresh direct render', async ({ page }) => {const requested = Promise.withResolvers<undefined>()const release = Promise.withResolvers<undefined>()- await page.route('**/Inter-Bold.ttf', async (route) => {+ await page.route('**/Inter-Bold*.ttf', async (route) => {requested.resolve(undefined)await release.promiseawait route.continue()@@ -190,6 +190,6 @@ test('font arrival invalidates tiled text and matches a fresh direct render', asexpect(tiled.equals(await directReference(page))).toBe(true)} finally {release.resolve(undefined)- await page.unroute('**/Inter-Bold.ttf')+ await page.unroute('**/Inter-Bold*.ttf')}})diff --git a/tests/engine/app/font-loading.test.ts b/tests/engine/app/font-loading.test.tsindex 6df567b9b..b94c8ff71 100644--- a/tests/engine/app/font-loading.test.ts+++ b/tests/engine/app/font-loading.test.ts@@ -30,7 +30,9 @@ describe('app font loading', () => {})test('ensureGraphFonts loads fallback packs when loaded primary font misses CJK glyphs', async () => {- const interData = await Bun.file(repoPath('public/Inter-Regular.ttf')).arrayBuffer()+ const interData = await Bun.file(+ repoPath('packages/core/assets/Inter-Regular.ttf')+ ).arrayBuffer()fontManager.markLoaded('Inter', 'Regular', interData)const graph = new SceneGraph()diff --git a/tests/engine/render/canvas/labels/fonts.test.ts b/tests/engine/render/canvas/labels/fonts.test.tsindex 79c8b882e..3ac424e61 100644--- a/tests/engine/render/canvas/labels/fonts.test.ts+++ b/tests/engine/render/canvas/labels/fonts.test.ts@@ -30,7 +30,7 @@ test.each([}])('labels reuse shared fallback loading and render real $family glyphs', async (fixture) => {const provider = ck.TypefaceFontProvider.Make()- provider.registerFont(readFileSync(repoPath('public/Inter-Regular.ttf')), 'Inter')+ provider.registerFont(readFileSync(repoPath('packages/core/assets/Inter-Regular.ttf')), 'Inter')const release = Promise.withResolvers<undefined>()const settled = Promise.withResolvers<undefined>()let generation = 1diff --git a/tests/engine/render/canvas/labels/paragraph-cache.test.ts b/tests/engine/render/canvas/labels/paragraph-cache.test.tsindex ef722daee..97df39c92 100644--- a/tests/engine/render/canvas/labels/paragraph-cache.test.ts+++ b/tests/engine/render/canvas/labels/paragraph-cache.test.ts@@ -14,7 +14,7 @@ beforeAll(async () => {describe('label paragraph cache', () => {test('shapes labels with Inter and invalidates native paragraphs by font generation', () => {- const bytes = readFileSync(repoPath('public/Inter-Regular.ttf'))+ const bytes = readFileSync(repoPath('packages/core/assets/Inter-Regular.ttf'))const data = bytes.buffer.slice(bytes.byteOffset, bytes.byteOffset + bytes.byteLength)const provider = ck.TypefaceFontProvider.Make()provider.registerFont(data, 'Inter')diff --git a/tests/engine/render/canvas/labels/paragraph-reuse.test.ts b/tests/engine/render/canvas/labels/paragraph-reuse.test.tsindex 0eee692a9..db15eab65 100644--- a/tests/engine/render/canvas/labels/paragraph-reuse.test.ts+++ b/tests/engine/render/canvas/labels/paragraph-reuse.test.ts@@ -14,8 +14,8 @@ let provider: TypefaceFontProviderbeforeAll(async () => {ck = await initCanvasKit()provider = ck.TypefaceFontProvider.Make()- provider.registerFont(readFileSync(repoPath('public/Inter-Regular.ttf')), 'Inter')- provider.registerFont(readFileSync(repoPath('public/Inter-SemiBold.ttf')), 'Inter')+ provider.registerFont(readFileSync(repoPath('packages/core/assets/Inter-Regular.ttf')), 'Inter')+ provider.registerFont(readFileSync(repoPath('packages/core/assets/Inter-SemiBold.ttf')), 'Inter')})afterAll(() => provider.delete())diff --git a/tests/engine/render/canvas/painted-text.test.ts b/tests/engine/render/canvas/painted-text.test.tsindex 79911ba8a..2f4518bc9 100644--- a/tests/engine/render/canvas/painted-text.test.ts+++ b/tests/engine/render/canvas/painted-text.test.ts@@ -14,7 +14,7 @@ import { repoPath } from '#tests/helpers/paths'const FONT_FAMILY = 'Painted text fixture'beforeAll(async () => {for (const style of ['Regular', 'SemiBold']) {- const data = await Bun.file(repoPath(`public/Inter-${style}.ttf`)).arrayBuffer()+ const data = await Bun.file(repoPath(`packages/core/assets/Inter-${style}.ttf`)).arrayBuffer()fontManager.markLoaded(FONT_FAMILY, style, data)}})diff --git a/tests/engine/render/canvas/text-preparation-cache.test.ts b/tests/engine/render/canvas/text-preparation-cache.test.tsindex b83289c71..27d962c3e 100644--- a/tests/engine/render/canvas/text-preparation-cache.test.ts+++ b/tests/engine/render/canvas/text-preparation-cache.test.ts@@ -60,7 +60,7 @@ async function fixture(maxEntries = 8, maxUnits = 1000) {describe('text preparation cache', () => {test('does not repeatedly shape coverage when a dense scan exceeds paragraph capacity', async () => {const f = await fixture(8)- const data = await Bun.file('public/Inter-Regular.ttf').arrayBuffer()+ const data = await Bun.file('packages/core/assets/Inter-Regular.ttf').arrayBuffer()f.provider.registerFont(data, 'Inter')fontManager.markLoaded('Inter', 'Regular', data)let builds = 0diff --git a/tests/engine/render/canvas/text.test.ts b/tests/engine/render/canvas/text.test.tsindex 6bab7d836..a2b36a4fa 100644--- a/tests/engine/render/canvas/text.test.ts+++ b/tests/engine/render/canvas/text.test.ts@@ -197,7 +197,9 @@ describe('renderText', () => {})test('keeps native paragraph layout even when outline font data is available', async () => {- const interData = await Bun.file(repoPath('public/Inter-Regular.ttf')).arrayBuffer()+ const interData = await Bun.file(+ repoPath('packages/core/assets/Inter-Regular.ttf')+ ).arrayBuffer()fontManager.markLoaded('Inter', 'Regular', interData)const r = createMockRenderer()const canvas = createMockCanvas()@@ -318,8 +320,8 @@ describe('paragraph font weights', () => {test('bold Inter paragraph is wider than regular Inter', async () => {const { renderer, surface } = await createTextRenderer()await renderer.loadFonts()- const regular = await Bun.file(repoPath('public/Inter-Regular.ttf')).arrayBuffer()- const bold = await Bun.file(repoPath('public/Inter-Bold.ttf')).arrayBuffer()+ const regular = await Bun.file(repoPath('packages/core/assets/Inter-Regular.ttf')).arrayBuffer()+ const bold = await Bun.file(repoPath('packages/core/assets/Inter-Bold.ttf')).arrayBuffer()fontManager.markLoaded('Inter', 'Regular', regular)fontManager.markLoaded('Inter', 'Bold', bold)@@ -344,7 +346,7 @@ describe('paragraph font weights', () => {test('shapes italic text when only the regular family face is available', async () => {const { renderer, surface } = await createTextRenderer()await renderer.loadFonts()- const regular = await Bun.file(repoPath('public/Inter-Regular.ttf')).arrayBuffer()+ const regular = await Bun.file(repoPath('packages/core/assets/Inter-Regular.ttf')).arrayBuffer()fontManager.markLoaded('Inter', 'Regular', regular)const demand = fontFaceDemand('Inter', 'Regular Italic', 'Synthetic italic')fontResolver.reset(demand)@@ -380,7 +382,7 @@ describe('renderText headless visual', () => {const ck = await initCanvasKit()const fontProvider = ck.TypefaceFontProvider.Make()fontManager.attachProvider(ck, fontProvider)- const interData = await Bun.file('public/Inter-Regular.ttf').arrayBuffer()+ const interData = await Bun.file('packages/core/assets/Inter-Regular.ttf').arrayBuffer()fontProvider.registerFont(interData, 'Inter')fontManager.markLoaded('Inter', 'Regular', interData)const fallbackFamilies = fontManager.getCJKFallbackFamilies()@@ -410,7 +412,7 @@ describe('renderText headless visual', () => {const ck = await initCanvasKit()const fontProvider = ck.TypefaceFontProvider.Make()fontManager.attachProvider(ck, fontProvider)- const interData = await Bun.file('public/Inter-Regular.ttf').arrayBuffer()+ const interData = await Bun.file('packages/core/assets/Inter-Regular.ttf').arrayBuffer()fontManager.markLoaded('Inter', 'Regular', interData)const fallbackFamilies = fontManager.getCJKFallbackFamilies()const originalFallbacks = [...fallbackFamilies]@@ -463,7 +465,7 @@ describe('renderText headless visual', () => {const fontProvider = ck.TypefaceFontProvider.Make()fontManager.attachProvider(ck, fontProvider)- const interData = await Bun.file('public/Inter-Regular.ttf').arrayBuffer()+ const interData = await Bun.file('packages/core/assets/Inter-Regular.ttf').arrayBuffer()fontManager.markLoaded('Inter', 'Regular', interData)const notoPath = repoPath('tests/fixtures/fonts/NotoSansSC-Regular.ttf')@@ -535,7 +537,7 @@ describe('renderText headless visual', () => {const fontProvider = ck.TypefaceFontProvider.Make()fontManager.attachProvider(ck, fontProvider)- const interData = await Bun.file('public/Inter-Regular.ttf').arrayBuffer()+ const interData = await Bun.file('packages/core/assets/Inter-Regular.ttf').arrayBuffer()fontProvider.registerFont(interData, 'Inter')fontManager.markLoaded('Inter', 'Regular', interData)@@ -614,7 +616,7 @@ describe('renderText headless visual', () => {const fontProvider = ck.TypefaceFontProvider.Make()fontManager.attachProvider(ck, fontProvider)- const interData = await Bun.file('public/Inter-Regular.ttf').arrayBuffer()+ const interData = await Bun.file('packages/core/assets/Inter-Regular.ttf').arrayBuffer()fontProvider.registerFont(interData, 'Inter')fontManager.markLoaded('Inter', 'Regular', interData)diff --git a/tests/engine/render/canvas/visual/inner-shadow-counter.ts b/tests/engine/render/canvas/visual/inner-shadow-counter.tsindex d148d9030..893c4f482 100644--- a/tests/engine/render/canvas/visual/inner-shadow-counter.ts+++ b/tests/engine/render/canvas/visual/inner-shadow-counter.ts@@ -17,7 +17,7 @@ async function main() {const fontProvider = ck.TypefaceFontProvider.Make()fontManager.attachProvider(ck, fontProvider)- const fontPath = join(process.cwd(), 'public/Inter-SemiBold.ttf')+ const fontPath = join(process.cwd(), 'packages/core/assets/Inter-SemiBold.ttf')const fontData = await readFile(fontPath)fontManager.markLoaded('Inter',diff --git a/tests/engine/render/canvas/visual/sdf-test-matrix.ts b/tests/engine/render/canvas/visual/sdf-test-matrix.tsindex d79ef6b97..6200479a2 100644--- a/tests/engine/render/canvas/visual/sdf-test-matrix.ts+++ b/tests/engine/render/canvas/visual/sdf-test-matrix.ts@@ -149,7 +149,7 @@ async function main() {const fontProvider = ck.TypefaceFontProvider.Make()fontManager.attachProvider(ck, fontProvider)- const fontPath = join(process.cwd(), 'public/Inter-SemiBold.ttf')+ const fontPath = join(process.cwd(), 'packages/core/assets/Inter-SemiBold.ttf')const fontData = await readFile(fontPath)fontManager.markLoaded('Inter',diff --git a/tests/engine/render/canvas/visual/verify-text-inner-shadow.ts b/tests/engine/render/canvas/visual/verify-text-inner-shadow.tsindex 602414947..5ec629357 100644--- a/tests/engine/render/canvas/visual/verify-text-inner-shadow.ts+++ b/tests/engine/render/canvas/visual/verify-text-inner-shadow.ts@@ -19,7 +19,7 @@ async function main() {fontManager.attachProvider(ck, fontProvider)// Load Inter font from public dir- const fontPath = join(process.cwd(), 'public/Inter-SemiBold.ttf')+ const fontPath = join(process.cwd(), 'packages/core/assets/Inter-SemiBold.ttf')console.warn('Loading font from:', fontPath)const fontData = await readFile(fontPath)fontManager.markLoaded(diff --git a/tests/engine/text/coverage.test.ts b/tests/engine/text/coverage.test.tsindex c5a19600e..25746be85 100644--- a/tests/engine/text/coverage.test.ts+++ b/tests/engine/text/coverage.test.ts@@ -20,7 +20,7 @@ describe('font fallback coverage indexing', () => {test('detects supplementary-plane Han code points', async () => {const family = `SupplementaryHan_${Date.now()}`- const data = await Bun.file('public/Inter-Regular.ttf').arrayBuffer()+ const data = await Bun.file('packages/core/assets/Inter-Regular.ttf').arrayBuffer()fontManager.markLoaded(family, 'Regular', data)const graph = new SceneGraph()const node = graph.createNode('TEXT', pageId(graph), {@@ -34,7 +34,7 @@ describe('font fallback coverage indexing', () => {test('uses BCP-47 language hints for Han fallback selection', async () => {const family = `LanguageHint_${Date.now()}`- const data = await Bun.file('public/Inter-Regular.ttf').arrayBuffer()+ const data = await Bun.file('packages/core/assets/Inter-Regular.ttf').arrayBuffer()fontManager.markLoaded(family, 'Regular', data)const graph = new SceneGraph()const node = graph.createNode('TEXT', pageId(graph), {@@ -56,7 +56,7 @@ describe('font fallback coverage indexing', () => {test('uses UTF-16 style-run indices after a surrogate pair', async () => {const cjkData = await Bun.file('tests/fixtures/fonts/NotoSansSC-Regular.ttf').arrayBuffer()- const latinData = await Bun.file('public/Inter-Regular.ttf').arrayBuffer()+ const latinData = await Bun.file('packages/core/assets/Inter-Regular.ttf').arrayBuffer()const cjkFamily = `CJKRunBase_${Date.now()}`const latinFamily = `CJKRunOverride_${Date.now()}`fontManager.markLoaded(cjkFamily, 'Regular', cjkData)diff --git a/tests/engine/text/fonts/coverage.test.ts b/tests/engine/text/fonts/coverage.test.tsindex e85ebbe89..7b27a7363 100644--- a/tests/engine/text/fonts/coverage.test.ts+++ b/tests/engine/text/fonts/coverage.test.ts@@ -6,7 +6,7 @@ import { SceneGraph } from '@open-pencil/scene-graph'import { repoPath } from '#tests/helpers/paths'async function loadInter() {- const interData = await Bun.file(repoPath('public/Inter-Regular.ttf')).arrayBuffer()+ const interData = await Bun.file(repoPath('packages/core/assets/Inter-Regular.ttf')).arrayBuffer()fontManager.markLoaded('Inter', 'Regular', interData)}diff --git a/tests/engine/text/fonts/lifecycle.test.ts b/tests/engine/text/fonts/lifecycle.test.tsindex 95710c81c..9cd472540 100644--- a/tests/engine/text/fonts/lifecycle.test.ts+++ b/tests/engine/text/fonts/lifecycle.test.ts@@ -109,4 +109,20 @@ describe('font lifecycle', () => {expect(nodeFontReadiness({}, node)).toBe('ready')fontResolver.reset(demand)})++ test('shares one bundled font request between concurrent loads', async () => {+ const manager = new FontManager()++ const [first, second] = await Promise.all([+ manager.fetchBundledFont('/Inter-Regular.ttf'),+ manager.fetchBundledFont('/Inter-Regular.ttf')+ ])+ expect(first).not.toBeNull()+ expect(second).toBe(first)++ // A settled request is not kept, so a later load (or a retry after a failure) reads again.+ const later = await manager.fetchBundledFont('/Inter-Regular.ttf')+ expect(later).not.toBe(first)+ expect(later?.byteLength).toBe(first?.byteLength)+ })})diff --git a/tools/AGENTS.md b/tools/AGENTS.mdindex 543effbe8..c4d519e3a 100644--- a/tools/AGENTS.md+++ b/tools/AGENTS.md@@ -5,7 +5,7 @@ Private tooling lives under `tools/<role>/<domain>/{src,tests}`; Steiger enforce| Role | Contract | Domains || ----------- | ---------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- || `checks/` | Read the tree and exit non-zero; never write inside the repository except an own baseline behind an explicit `--write` | `architecture`, `lint`, `i18n`, `secret-scan`, `type-shapes`, `docs`, `test-homes`, `package-quality` |-| `generate/` | Write generated files or artifacts, idempotently | `brand`, `demo`, `tauri-menu`, `authoring-reference`, `visual-oracles` |+| `generate/` | Write generated files or artifacts, idempotently | `brand`, `demo`, `tauri-menu`, `authoring-reference`, `visual-oracles`, `landing-posters` || `release/` | Build, verify, and publish packages and native artifacts | `package-artifacts`, `release-packages` || `ci/` | Consumed by workflows: path classification and gate policy, container images, the review-guidance bot | `policy`, `images`, `pr-review-guidance` || `dev/` | Test running and benchmarks for humans | `unit-tests`, `navigation-benchmark`, `dev-server` |@@ -39,6 +39,10 @@ Private tooling lives under `tools/<role>/<domain>/{src,tests}`; Steiger enforceThe `/demo` document is a tour of eight chapters on one page, each a section stacked top to bottom, built from `tools/generate/demo/src/document/`: `theme.ts` (the Theme and App chrome collections, each with a Dark and a Light mode that `src/app/demo/theme.ts` switches by name to follow the app's theme; every color in the tour, icons included, is bound to them), `callout.tsx` (the Tip component every chapter instances, whose Where slot each fills with a piece of the app from `chrome.tsx`, drawn to the dark theme's tokens with the target ringed), `player/` (the player card, its artwork slot, and its controls with behaviours), and one file per chapter under `chapters/`, laid out by `chapters/chapter.ts` as numeral, heading, subject, and tip, with each section's and subject's name from `chapters/names.ts`, which hosts outside the app such as the docs landing import from `@open-pencil/demo-tools/chapters`; `src/app/demo/viewport.ts` opens the tour on the first chapter. It renders design JSX through `document/icons.ts`, which serves Lucide from the bundled icon JSON so the build needs no Iconify API, and writes the ignored `public/demo.fig`, which the app opens like any `.fig` file; it is never generated in the browser. `ensureDemoDocument` runs from `vite.config.ts`, rebuilds only when its inputs' fingerprint changes, and runs the build in Bun; `bun run generate:demo` forces it. A chapter that needs something new from the engine adds that package's `src` to the fingerprint in `tools/generate/demo/src/ensure.ts`. Shader fills get their still frames from `src/shaders/stills.ts`, which draws each preset in the Playwright Chromium with WebGPU, at the size and in the encoding the editor uses (`shaderFramePixels` and `shaderFrameEncoding` from scene-graph) (`bunx playwright install chromium` locally; the deploy and preview workflows install it); without the browser the build warns and the editor draws the frames when the demo opens.+## Landing posters++`tools/generate/landing-posters/` captures WebP stills of every docs landing stage, per locale, theme, and layout, from a production docs build served locally in headless Chromium with software WebGL. `build:production` in `packages/docs` runs it after `vitepress build`; it reuses `.cache/landing-posters/<fingerprint>` when the inputs in `src/fingerprint.ts` are unchanged and copies the stills into `dist`, and `generate:landing-posters` forces a capture. The docs deploy workflow installs Chromium for it; dispatching it with `dry-run` builds and captures without deploying and keeps the stills as an artifact. A stage that starts depending on a new source tree adds it to `LANDING_POSTER_INPUTS`.+## Brand assetsCanonical artwork lives in `assets/brand/` (main mark and optical micro master; see its README). `tools/generate/brand/` derives web, docs, and native icons with RealFaviconGenerator and Tauri; generated assets are ignored, not committed. Vite and VitePress configs prepare their own targets, and Tauri dev/build hooks prepare native icons.diff --git a/tools/checks/docs/tests/download.test.ts b/tools/checks/docs/tests/download.test.tsnew file mode 100644index 000000000..5ca7eac95--- /dev/null+++ b/tools/checks/docs/tests/download.test.ts@@ -0,0 +1,82 @@+import { describe, expect, test } from 'bun:test'++import { fill } from '#docs-config/theme/landing/content/messages/fill'+import { formatSize } from '#docs-config/theme/landing/download/format'+import { latestReleases } from '#docs-config/theme/landing/download/releases'+import { platformOf } from '#docs-config/theme/landing/download/visitor'++const AGENTS = {+ mac: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Safari/605.1.15',+ windows:+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36',+ linux:+ 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36',+ android:+ 'Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Mobile Safari/537.36',+ iphone:+ 'Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Mobile/15E148 Safari/604.1'+}++describe('the visitor platform', () => {+ test('desktop browsers name their system', () => {+ expect(platformOf(AGENTS.mac, 0)).toBe('mac')+ expect(platformOf(AGENTS.windows, 0)).toBe('windows')+ expect(platformOf(AGENTS.linux, 0)).toBe('linux')+ })++ test('phones and tablets get no desktop installer', () => {+ expect(platformOf(AGENTS.android, 5)).toBeNull()+ expect(platformOf(AGENTS.iphone, 5)).toBeNull()+ // An iPad asks for desktop sites with a Mac's user agent, but no Mac takes touches.+ expect(platformOf(AGENTS.mac, 5)).toBeNull()+ })+})++describe('download copy', () => {+ test('fill puts values in their placeholders and leaves unknown ones', () => {+ expect(fill('Download for {platform}', { platform: 'macOS' })).toBe('Download for macOS')+ expect(fill('{count} commands, {missing}', { count: 24 })).toBe('24 commands, {missing}')+ })++ test('sizes are megabytes in the visitor language', () => {+ expect(formatSize(8_450_000, 'en')).toBe('8.5 MB')+ expect(formatSize(98_400_000, 'en')).toBe('98 MB')+ expect(formatSize(8_450_000, 'de')).toBe('8,5 MB')+ })+})++describe('the releases a build shows', () => {+ const release = (version: string, published: string, prerelease = false) => ({+ tag_name: `v${version}`,+ published_at: published,+ prerelease+ })++ test('pick the latest stable release by when it was published, not listed', () => {+ const { stable } = latestReleases([+ release('0.15.0', '2026-09-01T00:00:00Z'),+ release('0.15.1', '2026-09-18T00:00:00Z')+ ])+ expect(stable?.tag_name).toBe('v0.15.1')+ })++ test('show a beta only when it came out after the stable release', () => {+ const newer = latestReleases([+ release('0.16.0-beta.1', '2026-10-01T00:00:00Z', true),+ release('0.16.0-beta.2', '2026-10-10T00:00:00Z', true),+ release('0.15.1', '2026-09-18T00:00:00Z')+ ])+ expect(newer.beta?.tag_name).toBe('v0.16.0-beta.2')+ const older = latestReleases([+ release('0.16.0-beta.2', '2026-10-10T00:00:00Z', true),+ release('0.16.0', '2026-10-12T00:00:00Z')+ ])+ expect(older.beta).toBeNull()+ })++ test('show a beta without any stable release', () => {+ const { stable, beta } = latestReleases([release('0.1.0-beta.1', '2026-01-01T00:00:00Z', true)])+ expect(stable).toBeNull()+ expect(beta?.tag_name).toBe('v0.1.0-beta.1')+ })+})diff --git a/tools/checks/lint/src/rules/quality/tailwind-classes.ts b/tools/checks/lint/src/rules/quality/tailwind-classes.tsindex 91bdb91fe..e163cc944 100644--- a/tools/checks/lint/src/rules/quality/tailwind-classes.ts+++ b/tools/checks/lint/src/rules/quality/tailwind-classes.ts@@ -24,10 +24,12 @@ interface Theme {/*** The stylesheet that builds each part of the repository, first match first: the SDK's- * primitives and their examples render in the docs site, everything else in the app.+ * primitives and their examples, and the landing page, render in the docs site, everything else+ * in the app.*/const STYLESHEETS = [{ files: 'packages/vue/src/', stylesheet: 'packages/docs/.vitepress/theme/tailwind.css' },+ { files: 'packages/docs/.vitepress/', stylesheet: 'packages/docs/.vitepress/theme/tailwind.css' },{ files: '', stylesheet: 'src/app.css' }]diff --git a/tools/checks/lint/tests/tailwind-classes.test.ts b/tools/checks/lint/tests/tailwind-classes.test.tsindex 393f03def..ee68c18bb 100644--- a/tools/checks/lint/tests/tailwind-classes.test.ts+++ b/tools/checks/lint/tests/tailwind-classes.test.ts@@ -88,16 +88,18 @@ describe('no-unknown-tailwind-classes', () => {})})-test('checks SDK examples against the docs stylesheet that builds them', async () => {+test('checks SDK examples and the landing against the docs stylesheet that builds them', async () => {const diagnostics = ruleDiagnostics(await lintFiles({- 'packages/vue/src/primitives/Demo/examples/AppToken.vue': `${SCRIPT}<template><p class="bg-panel" /></template>\n`,- 'packages/vue/src/primitives/Demo/examples/Palette.vue': `${SCRIPT}<template><p class="bg-violet-600 text-[var(--vp-c-text-1)]" /></template>\n`+ // The docs stylesheet takes the app's tokens, which leave Tailwind's palette out.+ 'packages/vue/src/primitives/Demo/examples/AppToken.vue': `${SCRIPT}<template><p class="bg-panel text-[var(--vp-c-text-1)]" /></template>\n`,+ 'packages/vue/src/primitives/Demo/examples/Palette.vue': `${SCRIPT}<template><p class="bg-violet-600" /></template>\n`,+ 'packages/docs/.vitepress/theme/landing/Section.vue': `${SCRIPT}<template><p class="text-surface" /></template>\n`},rules),rule)- expect(diagnostics.map((item) => item.filename?.split('/').pop())).toEqual(['AppToken.vue'])+ expect(diagnostics.map((item) => item.filename?.split('/').pop())).toEqual(['Palette.vue'])})diff --git a/tools/generate/landing-posters/package.json b/tools/generate/landing-posters/package.jsonnew file mode 100644index 000000000..5297534f9--- /dev/null+++ b/tools/generate/landing-posters/package.json@@ -0,0 +1,24 @@+{+ "name": "@open-pencil/landing-posters-tools",+ "private": true,+ "type": "module",+ "imports": {+ "#landing-posters/*": "./src/*.ts"+ },+ "exports": {+ "./fingerprint": "./src/fingerprint.ts"+ },+ "scripts": {+ "test": "bun test tests"+ },+ "dependencies": {+ "@open-pencil/package-artifacts-tools": "workspace:*",+ "@playwright/test": "^1.63.0",+ "sharp": "0.34.5"+ },+ "devDependencies": {+ "@types/bun": "^1.3.14",+ "@types/node": "^25.9.9",+ "typescript": "~5.8.3"+ }+}diff --git a/tools/generate/landing-posters/src/capture.ts b/tools/generate/landing-posters/src/capture.tsnew file mode 100644index 000000000..40601f898--- /dev/null+++ b/tools/generate/landing-posters/src/capture.ts@@ -0,0 +1,136 @@+import { mkdir, stat } from 'node:fs/promises'+import { dirname, join, relative, resolve } from 'node:path'++import { LOCALE_PREFIXES } from '#docs-config/seo'+import { FEATURE_KINDS } from '#docs-config/theme/landing/content/features'+import {+ POSTER_CAPTURE_PARAM,+ POSTER_LAYOUTS,+ POSTER_THEMES,+ posterParts,+ posterPath,+ type PosterLayout,+ type PosterTarget+} from '#docs-config/theme/landing/posters'+import { chromium, type Browser } from '@playwright/test'+import sharp from 'sharp'++/**+ * The visitor's screen for each layout. On a desktop the page caps its content width, so one+ * wide viewport stands for every large screen; the phone is a common handset with touch input.+ */+const VIEWPORTS: Record<PosterLayout, { width: number; height: number; touch: boolean }> = {+ desktop: { width: 1440, height: 900, touch: false },+ phone: { width: 390, height: 844, touch: true }+}+/** Stills for high-density screens, which look sharp downscaled on the others. */+const PIXEL_RATIO = 2+const WEBP_QUALITY = 80+/** After a stage reports ready: fonts swap in, panels finish their transitions. */+const SETTLE_MS = 1000+const STAGE_TIMEOUT_MS = 120_000+/** Pages captured at once; each holds a WebGL context per stage. */+const CONCURRENCY = 3+/** Software WebGL, so headless Chromium renders the canvases on CI machines without a GPU. */+const CHROMIUM_ARGS = ['--use-angle=swiftshader', '--enable-unsafe-swiftshader']++/** Serves the built site with its clean URLs, as the docs host does. */+function serveSite(dist: string) {+ const root = resolve(dist)+ return Bun.serve({+ hostname: '127.0.0.1',+ port: 0,+ async fetch(request) {+ const path = decodeURIComponent(new URL(request.url).pathname)+ for (const candidate of [path, `${path}.html`, join(path, 'index.html')]) {+ const file = resolve(root, `.${candidate}`)+ // An encoded `..` must not reach files outside the build.+ if (relative(root, file).startsWith('..')) continue+ const info = await stat(file).catch(() => null)+ if (info?.isFile()) return new Response(Bun.file(file))+ }+ return new Response('Not found', { status: 404 })+ }+ })+}++async function capturePage(browser: Browser, origin: string, target: PosterTarget, out: string) {+ const viewport = VIEWPORTS[target.layout]+ const context = await browser.newContext({+ viewport: { width: viewport.width, height: viewport.height },+ deviceScaleFactor: PIXEL_RATIO,+ isMobile: viewport.touch,+ hasTouch: viewport.touch,+ colorScheme: target.theme,+ // VitePress reads the visitor's appearance choice from storage before it paints.+ storageState: {+ cookies: [],+ origins: [+ { origin, localStorage: [{ name: 'vitepress-theme-appearance', value: target.theme }] }+ ]+ }+ })+ try {+ const page = await context.newPage()+ const prefix = target.locale === 'root' ? '' : `${target.locale}/`+ await page.goto(`${origin}/${prefix}?${POSTER_CAPTURE_PARAM}`)+ for (const kind of FEATURE_KINDS) {+ const frame = page.locator(`.stage-frame[data-kind="${kind}"]`)+ await frame.scrollIntoViewIfNeeded()+ await page+ .locator(`.stage-frame[data-kind="${kind}"][data-ready]`)+ .waitFor({ timeout: STAGE_TIMEOUT_MS })+ // The page's web fonts swap in when they arrive; a still must show the final ones.+ await page.evaluate(() => document.fonts.ready)+ await page.waitForTimeout(SETTLE_MS)+ for (const part of posterParts(kind)) {+ const element = part === 'frame' ? frame : frame.locator(`[data-poster-part="${part}"]`)+ const png = await element.screenshot({ animations: 'disabled' })+ const file = join(out, posterPath(target, kind, part))+ await mkdir(dirname(file), { recursive: true })+ await sharp(png).webp({ quality: WEBP_QUALITY }).toFile(file)+ }+ }+ } finally {+ await context.close()+ }+}++/**+ * Captures every stage of every landing page in each theme and layout from the built site in+ * `dist`, writing WebP stills under `out` at their poster paths.+ */+export async function capturePosters({+ dist,+ out,+ fingerprint+}: {+ dist: string+ out: string+ fingerprint: string+}): Promise<number> {+ const locales = ['root', ...LOCALE_PREFIXES]+ const targets: PosterTarget[] = locales.flatMap((locale) =>+ POSTER_THEMES.flatMap((theme) =>+ POSTER_LAYOUTS.map((layout) => ({ fingerprint, locale, theme, layout }))+ )+ )+ const server = serveSite(dist)+ let browser: Browser | null = null+ try {+ browser = await chromium.launch({ args: CHROMIUM_ARGS })+ const launched = browser+ const queue = [...targets]+ const worker = async () => {+ for (let target = queue.shift(); target; target = queue.shift()) {+ await capturePage(launched, server.url.origin, target, out)+ console.log(`landing posters: ${target.locale} ${target.theme} ${target.layout}`)+ }+ }+ await Promise.all(Array.from({ length: CONCURRENCY }, worker))+ } finally {+ await browser?.close()+ await server.stop(true)+ }+ return targets.length+}diff --git a/tools/generate/landing-posters/src/fingerprint.ts b/tools/generate/landing-posters/src/fingerprint.tsnew file mode 100644index 000000000..3d686b653--- /dev/null+++ b/tools/generate/landing-posters/src/fingerprint.ts@@ -0,0 +1,60 @@+import { createHash } from 'node:crypto'+import { readdir, readFile } from 'node:fs/promises'+import { join, relative } from 'node:path'++/**+ * What a stage's pixels depend on: the landing and the docs theme around it, the app+ * components it mounts, the engine that draws them, the demo document, and this generator.+ * Imported by the VitePress config, so it uses Node built-ins only.+ */+export const LANDING_POSTER_INPUTS = {+ directories: [+ 'packages/docs/.vitepress/theme',+ 'src',+ 'packages/core/src',+ 'packages/scene-graph/src',+ 'packages/vue/src',+ 'packages/design-jsx/src',+ 'packages/dom-css/src',+ 'packages/emit/src',+ 'packages/fig/src',+ 'packages/kiwi/src',+ 'tools/generate/demo/src',+ 'tools/generate/landing-posters/src'+ ],+ files: [+ 'package.json',+ 'bun.lock',+ 'packages/docs/.vitepress/config.ts',+ // Its locale prefixes are the pages the stills are captured on.+ 'packages/docs/.vitepress/seo.ts'+ ]+}++/** Short enough for a URL segment, long enough that two builds never collide. */+const FINGERPRINT_LENGTH = 16++async function filesUnder(root: string, directory: string): Promise<string[]> {+ const entries = await readdir(join(root, directory), { recursive: true, withFileTypes: true })+ return entries+ .filter((entry) => entry.isFile())+ .map((entry) => relative(root, join(entry.parentPath, entry.name)))+}++/** Changes whenever an input changes, so changed stages get new poster URLs. */+export async function landingPosterFingerprint(+ root: string,+ inputs = LANDING_POSTER_INPUTS+): Promise<string> {+ const listed = await Promise.all(inputs.directories.map((dir) => filesUnder(root, dir)))+ const paths = [...listed.flat(), ...inputs.files].sort()+ const hash = createHash('sha256')+ for (const path of paths) {+ hash+ .update(path)+ .update('\0')+ .update(await readFile(join(root, path)))+ .update('\0')+ }+ return hash.digest('hex').slice(0, FINGERPRINT_LENGTH)+}diff --git a/tools/generate/landing-posters/src/generate.ts b/tools/generate/landing-posters/src/generate.tsnew file mode 100644index 000000000..b848368b3--- /dev/null+++ b/tools/generate/landing-posters/src/generate.ts@@ -0,0 +1,53 @@+import { cp, mkdir, readdir, readFile, rm, stat, writeFile } from 'node:fs/promises'+import { join } from 'node:path'+import { fileURLToPath } from 'node:url'++import { capturePosters } from '#landing-posters/capture'+import { landingPosterFingerprint } from '#landing-posters/fingerprint'++import { resolveWorkspaceRoot } from '@open-pencil/package-artifacts-tools/workspace'++const DIST = 'packages/docs/.vitepress/dist'+/** Captures are kept per fingerprint, so a rebuild with unchanged stages reuses them. */+const CACHE = '.cache'+const POSTERS = 'landing-posters'++const exists = (path: string) =>+ stat(path).then(+ () => true,+ () => false+ )++/**+ * Adds stage stills to a production docs build. The build names the fingerprint in each landing+ * page's data; this captures the stills from that build unless the cache already holds them for+ * the fingerprint, then copies them into the build. `--force` captures again.+ */+async function main(): Promise<void> {+ const root = await resolveWorkspaceRoot(fileURLToPath(import.meta.url))+ const fingerprint = await landingPosterFingerprint(root)+ const dist = join(root, DIST)+ const landing = await readFile(join(dist, 'index.html'), 'utf8').catch(() => '')+ if (!landing.includes(fingerprint)) {+ throw new Error(+ `The docs build in ${DIST} does not reference landing posters ${fingerprint}. ` ++ 'Build it with OPENPENCIL_LANDING_POSTERS=1 (docs build:production) from the same sources.'+ )+ }++ const cacheRoot = join(root, CACHE)+ const cached = join(cacheRoot, POSTERS, fingerprint)+ const complete = `${cached}.complete`+ if (process.argv.includes('--force') || !(await exists(complete))) {+ // Stills of older sources are never served again.+ await rm(join(cacheRoot, POSTERS), { recursive: true, force: true })+ await mkdir(cacheRoot, { recursive: true })+ const count = await capturePosters({ dist, out: cacheRoot, fingerprint })+ await writeFile(complete, `${count}\n`)+ }+ await cp(cached, join(dist, POSTERS, fingerprint), { recursive: true })+ const locales = await readdir(cached)+ console.log(`landing posters ${fingerprint}: ${locales.length} locales copied into ${DIST}`)+}++await main()diff --git a/tools/generate/landing-posters/tests/fingerprint.test.ts b/tools/generate/landing-posters/tests/fingerprint.test.tsnew file mode 100644index 000000000..47093a07b--- /dev/null+++ b/tools/generate/landing-posters/tests/fingerprint.test.ts@@ -0,0 +1,46 @@+import { afterEach, describe, expect, test } from 'bun:test'+import { mkdir, mkdtemp, rm, writeFile } from 'node:fs/promises'+import { tmpdir } from 'node:os'+import { join } from 'node:path'++import { landingPosterFingerprint } from '#landing-posters/fingerprint'++const INPUTS = { directories: ['theme', 'src'], files: ['package.json'] }+let root = ''++async function fixture(): Promise<string> {+ root = await mkdtemp(join(tmpdir(), 'landing-posters-'))+ await mkdir(join(root, 'theme/landing'), { recursive: true })+ await mkdir(join(root, 'src'), { recursive: true })+ await writeFile(join(root, 'theme/landing/page.vue'), '<template />')+ await writeFile(join(root, 'src/app.ts'), 'export {}')+ await writeFile(join(root, 'package.json'), '{}')+ return root+}++afterEach(async () => {+ if (root) await rm(root, { recursive: true, force: true })+})++describe('landing poster fingerprint', () => {+ test('is stable for unchanged sources', async () => {+ const dir = await fixture()+ const first = await landingPosterFingerprint(dir, INPUTS)+ expect(first).toMatch(/^[0-9a-f]{16}$/)+ expect(await landingPosterFingerprint(dir, INPUTS)).toBe(first)+ })++ test('changes when a nested source, a new file, or a listed file changes', async () => {+ const dir = await fixture()+ const seen = new Set([await landingPosterFingerprint(dir, INPUTS)])++ await writeFile(join(dir, 'theme/landing/page.vue'), '<template><p /></template>')+ seen.add(await landingPosterFingerprint(dir, INPUTS))+ await writeFile(join(dir, 'src/new.ts'), 'export {}')+ seen.add(await landingPosterFingerprint(dir, INPUTS))+ await writeFile(join(dir, 'package.json'), '{"version":"1"}')+ seen.add(await landingPosterFingerprint(dir, INPUTS))++ expect(seen.size).toBe(4)+ })+})diff --git a/tools/generate/landing-posters/tests/posters.test.ts b/tools/generate/landing-posters/tests/posters.test.tsnew file mode 100644index 000000000..c6f3521a3--- /dev/null+++ b/tools/generate/landing-posters/tests/posters.test.ts@@ -0,0 +1,32 @@+import { describe, expect, test } from 'bun:test'++import { FEATURE_KINDS } from '#docs-config/theme/landing/content/features'+import { posterParts, posterPath } from '#docs-config/theme/landing/posters'++const TARGET = {+ fingerprint: '0123456789abcdef',+ locale: 'ru',+ theme: 'dark',+ layout: 'phone'+} as const++describe('landing poster paths', () => {+ test('name the fingerprint, locale, theme, layout, stage, and part', () => {+ expect(posterPath(TARGET, 'design', 'panel')).toBe(+ 'landing-posters/0123456789abcdef/ru/dark-phone/design-panel.webp'+ )+ })++ test('split single-editor stages into canvas and panel, and keep collaboration whole', () => {+ expect(posterParts('design')).toEqual(['canvas', 'panel'])+ expect(posterParts('ai')).toEqual(['canvas', 'panel'])+ expect(posterParts('collab')).toEqual(['frame'])+ })++ test('are unique across every stage and part of a page', () => {+ const paths = FEATURE_KINDS.flatMap((kind) =>+ posterParts(kind).map((part) => posterPath(TARGET, kind, part))+ )+ expect(new Set(paths).size).toBe(paths.length)+ })+})diff --git a/tools/release/release-packages/tests/native/download-page.test.ts b/tools/release/release-packages/tests/native/download-page.test.tsnew file mode 100644index 000000000..2598a65c8--- /dev/null+++ b/tools/release/release-packages/tests/native/download-page.test.ts@@ -0,0 +1,52 @@+import { expect, test } from 'bun:test'++import { classifyAsset, filesFor } from '#docs-config/theme/landing/download/releases'+import { desktopAssets, desktopTargets } from '#release/native/catalog'++const VERSION = '0.15.0'++function asset(name: string) {+ return { name, url: `https://example.com/${name}`, size: 1 }+}++const published = desktopTargets.flatMap((target) => desktopAssets(target, VERSION))++test('the download page lists every installer a release publishes', () => {+ const installers = published.filter((file) => !file.name.endsWith('.app.tar.gz'))+ const files = installers.map((file) => classifyAsset(asset(file.name)))+ expect(files.map((file) => file && `${file.platform}/${file.arch}/${file.format}`)).toEqual([+ 'mac/arm64/dmg',+ 'mac/x64/dmg',+ 'windows/x64/exe',+ 'windows/x64/msi',+ 'windows/arm64/exe',+ 'windows/arm64/msi',+ 'linux/x64/appimage',+ 'linux/x64/deb',+ 'linux/x64/rpm'+ ])+})++test('the download page leaves out updater payloads and signatures', () => {+ const updaters = published.filter((file) => file.name.endsWith('.app.tar.gz'))+ expect(updaters).not.toBeEmpty()+ for (const file of updaters) {+ expect(classifyAsset(asset(file.name))).toBeNull()+ expect(classifyAsset(asset(`${file.name}.sig`))).toBeNull()+ }+ expect(classifyAsset(asset('SHA256SUMS'))).toBeNull()+ expect(classifyAsset(asset('latest.json'))).toBeNull()+})++test('a platform lists Apple Silicon or x64 first, then installers in format order', () => {+ const files = published.flatMap((file) => classifyAsset(asset(file.name)) ?? [])+ const release = { version: VERSION, date: '', url: '', files, checksums: null, notes: '' }+ expect(filesFor(release, 'mac').map((file) => file.arch)).toEqual(['arm64', 'x64'])+ expect(filesFor(release, 'windows').map((file) => `${file.arch} ${file.format}`)).toEqual([+ 'x64 exe',+ 'x64 msi',+ 'arm64 exe',+ 'arm64 msi'+ ])+ expect(filesFor(release, 'linux').map((file) => file.format)).toEqual(['appimage', 'deb', 'rpm'])+})diff --git a/tsconfig.json b/tsconfig.jsonindex 61cb451bd..bf6745826 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -58,6 +58,9 @@"#docs-config/*": ["./packages/docs/.vitepress/*"],+ "#docs/*": [+ "./packages/docs/.vitepress/*"+ ],"tinykeys": ["./node_modules/tinykeys/dist/tinykeys.d.ts"],@@ -124,7 +127,9 @@"packages/vue/src/global.d.ts","packages/dom-css/src/cssom.d.ts","packages/dom-css/src/postcss-value-parser.d.ts",- "packages/design-jsx/src/global.d.ts"+ "packages/design-jsx/src/global.d.ts",+ "packages/docs/.vitepress/theme/landing/**/*.ts",+ "packages/docs/.vitepress/theme/landing/**/*.vue"],"references": [{diff --git a/vite/aliases.ts b/vite/aliases.tsindex 6ba93f848..eef6507d3 100644--- a/vite/aliases.ts+++ b/vite/aliases.ts@@ -74,6 +74,11 @@ export function createOpenPencilAliases(rootDir: string) {},{ find: /^@open-pencil\/vue$/, replacement: resolve(rootDir, 'packages/vue/src/index.ts') },{ find: '@open-pencil/vue', replacement: resolve(rootDir, 'packages/vue/src') },+ // Bundled fonts ship beside the sources, not inside them.+ {+ find: /^@open-pencil\/core\/assets\//,+ replacement: `${resolve(rootDir, 'packages/core/assets')}/`+ },{ find: /^@open-pencil\/core$/, replacement: resolve(rootDir, 'packages/core/src/index.ts') },{ find: '@open-pencil/core', replacement: resolve(rootDir, 'packages/core/src') },{diff --git a/vite/app-source.ts b/vite/app-source.tsnew file mode 100644index 000000000..ebc226de0--- /dev/null+++ b/vite/app-source.ts@@ -0,0 +1,78 @@+import { readFile } from 'node:fs/promises'+import { fileURLToPath } from 'node:url'++import IconsResolver from 'unplugin-icons/resolver'+import Icons from 'unplugin-icons/vite'+import Components from 'unplugin-vue-components/vite'+import type { Alias, Plugin, PluginOption } from 'vite'++import rootManifest from '../package.json' with { type: 'json' }+import { createOpenPencilAliases } from './aliases.ts'++const REPO_ROOT = fileURLToPath(new URL('..', import.meta.url))+const SOURCE_ROOT = fileURLToPath(new URL('../src/', import.meta.url))++const RAW_TEXT_PREFIX = '\0app-raw-text:'+// The virtual id must not end in `.md`, or a VitePress host renders the module as a page.+const RAW_TEXT_SUFFIX = '.js'+const RAW_TEXT_EXTENSIONS = ['.md', '.kiwi']++/**+ * The app imports Markdown and Kiwi schemas as strings (`raw-markdown.ts`). A host that+ * treats `.md` as pages, such as VitePress, would compile them instead, so app-side text+ * imports resolve to a virtual module before the host's own transforms see them.+ */+function appRawText(): Plugin {+ return {+ name: 'open-pencil-app-raw-text',+ enforce: 'pre',+ async resolveId(source, importer) {+ if (!importer || !RAW_TEXT_EXTENSIONS.some((extension) => source.endsWith(extension))) {+ return null+ }+ const resolved = await this.resolve(source, importer, { skipSelf: true })+ if (!resolved?.id.startsWith(SOURCE_ROOT)) return null+ return `${RAW_TEXT_PREFIX}${resolved.id}${RAW_TEXT_SUFFIX}`+ },+ async load(id) {+ if (!id.startsWith(RAW_TEXT_PREFIX)) return null+ const file = id.slice(RAW_TEXT_PREFIX.length, -RAW_TEXT_SUFFIX.length)+ return `export default ${JSON.stringify(await readFile(file, 'utf8'))}`+ }+ }+}++export interface AppSourceConfig {+ alias: Alias[]+ define: Record<string, string>+ plugins: PluginOption[]+}++/**+ * What another Vite host needs to compile the app's components from source: the app's+ * aliases, its icon plugins, its text imports, and the build-time constants it reads. The+ * host has no local automation server, so those constants are empty.+ */+export function appSourceConfig(): AppSourceConfig {+ return {+ alias: [+ // Files the app serves from its root, such as the prebuilt demo document.+ {+ find: /^#app-public\//,+ replacement: `${fileURLToPath(new URL('../public/', import.meta.url))}`+ },+ ...createOpenPencilAliases(REPO_ROOT)+ ],+ define: {+ __OPENPENCIL_APP_VERSION__: JSON.stringify(rootManifest.version),+ __OPENPENCIL_LOCAL_AUTOMATION_TOKEN__: JSON.stringify(''),+ __OPENPENCIL_LOCAL_AUTOMATION_URL__: JSON.stringify(''),+ __OPENPENCIL_LOCAL_AUTOMATION_HTTP_URL__: JSON.stringify('')+ },+ plugins: [+ appRawText(),+ Icons({ compiler: 'vue3' }),+ Components({ dirs: [], dts: false, resolvers: [IconsResolver({ prefix: 'icon' })] })+ ]+ }+}diff --git a/vite/package.json b/vite/package.jsonnew file mode 100644index 000000000..878fb8e5f--- /dev/null+++ b/vite/package.json@@ -0,0 +1,15 @@+{+ "name": "@open-pencil/vite-config",+ "private": true,+ "type": "module",+ "exports": {+ "./app-source": "./app-source.ts"+ },+ "dependencies": {+ "@open-pencil/core": "workspace:*",+ "unplugin-icons": "^23.0.1",+ "unplugin-vue-components": "^31.1.0",+ "vite": "8.1.4",+ "vite-plugin-pwa": "^1.3.0"+ }+}