Skip to content

AI-native design editor. Open-source Figma alternative.

docs: refresh SDK and workflow guides

Danila Poyarkovd354c990eee0
diff --git a/packages/docs/development/roadmap.md b/packages/docs/development/roadmap.md
index 69f9aa749..e60955906 100644
--- a/packages/docs/development/roadmap.md
+++ b/packages/docs/development/roadmap.md
@@ -26,6 +26,12 @@ v0.14.0 established several foundations that earlier versions of this roadmap tr
- 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.
+### 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.
+
+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).
+
## Near-term work
### Figma fidelity
@@ -38,10 +44,10 @@ v0.14.0 established several foundations that earlier versions of this roadmap tr
### Editor depth
- Complete variable inspector coverage for common numeric/text/layout fields.
-- Improve component and instance authoring: component-set definitions, override inspection, slots, and shared-library workflows. Common variant, text, boolean, and instance-swap properties are already editable on instances.
+- Extend component and instance authoring with deeper override inspection and slots. Multidimensional variant definitions, instance property editing, and component-library publish/update workflows are already supported.
- Treat variables, styles, components, and libraries as governed design-system assets with proposal, review, publish, update, migration, and conformance workflows.
-- Complete page-guide creation/editing and layout-grid style parity. Layout-grid rendering and common inspector editing are already supported.
-- Add Figma-style inspection aids for distances, spacing, bounds, and alignment, including modifier-key measurement between selected and hovered layers.
+- Complete layout-grid style parity beyond existing grid geometry controls and editable page/frame guides.
+- Extend inspection aids beyond the existing Option/Alt measurements between selected and hovered layers.
- Expand vector editing workflows without regressing imported vector fidelity.
### Reliability and international text
@@ -50,7 +56,7 @@ v0.14.0 established several foundations that earlier versions of this roadmap tr
- Surface provider, model-budget, renderer, and automation failures with actionable recovery paths instead of silent stalls.
- Make desktop automation recover from orphaned processes and renderer crashes without manual cleanup.
- Prevent non-Latin font discovery and rendering crashes across platforms; add Arabic/Persian shaping and RTL layout, then broaden CJK and mixed-script visual fixtures.
-- Define a portable-font strategy for reproducible documents across machines, including curated redistributable fonts, embedded or linked document fonts, licensing metadata, fallback visibility, and agent-readable font availability ([#502](https://github.com/open-pencil/open-pencil/issues/502), [#503](https://github.com/open-pencil/open-pencil/issues/503)).
+- Build a portable-font strategy for reproducible documents across machines on top of existing substitution visibility and agent-readable font status, including curated redistributable fonts, embedded or linked document fonts, and licensing metadata ([#502](https://github.com/open-pencil/open-pencil/issues/502), [#503](https://github.com/open-pencil/open-pencil/issues/503)).
### Cloud and self-hosting
@@ -121,7 +127,7 @@ v0.14.0 established several foundations that earlier versions of this roadmap tr
- Motion: reusable code-authored animation presets, timelines, easing, and deterministic playback/export that compose with prototype interactions and shader inputs.
- Tables and data grids: structured rows, columns, headers, resizing, merged cells, and normal scene nodes inside cells instead of drawing tables as unrelated rectangles.
- Comments: pins, threads, resolution state, and collaboration-aware display.
-- Shared libraries: publish, consume, and update components/styles across files.
+- Extend shared libraries beyond the existing component publish/consume/update workflow to broader style management and governance.
- Platform asset libraries: use licensed system-native and third-party icon sources, including SF Symbols where platform and redistribution rules allow, alongside the existing Iconify/Lucide workflow.
- Figma Slides (`.deck`) interoperability: import/export, slide editing, presentation, speaker notes, and filmstrip workflows. This ranks below core Figma Design fidelity, reliability, Cloud/self-hosting, and international-text work.
- Platform polish: Windows code signing, PWA support, packaged updater improvements, and desktop-side MCP bundling.
@@ -178,7 +184,7 @@ Figma's design documentation groups features into these areas:
| Vectors / vector networks | ✅ | ✅ | ◐ | ✅ | ✅ | Vector edit support exists; Figma Draw tools are not fully replicated. |
| Boolean operations | ✅ | ✅ | ◐ | ✅ | ✅ | Figma `BOOLEAN_OPERATION` nodes import/export as boolean operations; inspector editing remains limited. |
| Components | ✅ | ✅ | ◐ | ✅ | ✅ | Component metadata, descriptions, links, and publish fields mostly round-trip. |
-| Component sets / variants | ✅ | ✅ | ◐ | ✅ | ✅ | Variant, text, boolean, and instance-swap properties are editable on instances; definition authoring remains incomplete. |
+| Component sets / variants | ✅ | ✅ | ◐ | ✅ | ✅ | Multidimensional variant definitions and common instance properties are editable; slots and broader Figma-specific property parity remain incomplete. |
| Instances / overrides | ✅ | ✅ | ◐ | ✅ | ✅ | Component-property refs and typed assignments are modeled and editable; raw symbol overrides and derived data remain preserved for fidelity. |
| Slots | ↩ | ◐ | — | ↩ | — | Some component property payloads may survive round-trip, but Figma slots are not a first-class workflow. |
| Connectors | ◐ | ◐ | — | ◐ | ◐ | Type exists, but Figma connector semantics are weak. |
@@ -208,7 +214,7 @@ Figma's design documentation groups features into these areas:
| Strokes included in layout | ✅ | ◐ | — | ✅ | ✅ | Stored/exported and used in layout paths, but no obvious panel control. |
| Reverse z-index / align-content | ✅ | ◐ | — | ✅ | ✅ | Modeled and exported; UI is limited. |
| Constraints | ✅ | ◐ | ✅ | ✅ | ✅ | Horizontal and vertical pin, center, stretch, and scale modes are editable; imported edge-case parity remains partial. |
-| Layout grids / guides | ✅ | ✅ | ◐ | ✅ | ✅ | Layout grids render and common column, row, and square-grid geometry is editable. Imported page guides render, but guide creation/editing and full grid-style management remain incomplete. |
+| Layout grids / guides | ✅ | ✅ | ◐ | ✅ | ✅ | Layout-grid geometry and page/frame guides are editable, including guide creation, movement, duplication, transfer, and removal. Full grid-style management remains incomplete. |
| Text styles | ✅ | ✅ | ◐ | ✅ | ✅ | Imported local text styles are modeled, selectable, and detachable; authoring and publishing style definitions still needs a style manager. |
| Rich style runs | ✅ | ✅ | ◐ | ✅ | ✅ | Import/render/export support; editing mixed runs is partial. |
| Text auto resize | ✅ | ✅ | ◐ | ✅ | ✅ | Used by renderer/layout; UI does not expose every mode. |
@@ -221,13 +227,13 @@ Figma's design documentation groups features into these areas:
| Variables bound to fills/strokes | ✅ | ✅ | ✅ | ✅ | ✅ | Common color bindings render and edit. |
| Variables bound to text/layout/visibility/effects | ◐ | ◐ | ◐ | ◐ | ✅ | Some bindings exist; not full Figma property coverage. |
| Variables in prototypes / expressions / conditionals | — | — | — | — | — | Depends on prototype system, which is not implemented. |
-| Libraries / publish / update review | ↩ | — | ◐ | ↩ | — | Metadata can survive round-trip; no full library workflow. |
+| Libraries / publish / update review | ↩ | — | ◐ | ↩ | — | Figma library metadata survives round-trip. OpenPencil supports its own component-library publishing, catalogs, revision previews, and linked-instance updates, not synchronization with Figma-hosted libraries. |
| Prototype flows / starting points | — | — | — | — | — | Not modeled. |
| Prototype hotspots / triggers / actions | — | — | — | — | — | Not modeled. |
| Prototype overlays / scroll-to | — | — | — | — | — | Not modeled. |
| Smart animate / easing / spring / duration | — | — | — | — | — | Not modeled. |
| Interactive components | — | — | — | — | — | Component-level prototype connections are not supported. |
-| Dev Mode inspect / measurements / annotations | — | — | — | — | ◐ | OpenPencil has CLI/MCP inspection, but not Figma Dev Mode UI. |
+| Dev Mode inspect / measurements / annotations | — | ◐ | ◐ | — | ◐ | OpenPencil has CLI/MCP inspection and Option/Alt distance overlays, but not Figma Dev Mode annotations or its full UI. |
| Code Connect / dev resources / ready-for-dev | — | — | — | — | — | Not modeled. |
| Comments | — | — | — | — | — | Not modeled. |
| Version history / branches | — | — | — | — | — | Not modeled. |
@@ -251,9 +257,9 @@ OpenPencil deliberately preserves many Figma/Kiwi fields even when they are not
| Style IDs: fill/stroke/text/effect/grid | ↩ | — | — | Preserves style linkage for Figma, but OpenPencil has no style manager yet. |
| Component property refs/defs/specs | ✅ | Indirect | ◐ | Full Figma component-property authoring is incomplete. |
| State-group metadata | ↩ | — | — | Preserved only. |
-| Version/sort/publish/library metadata | ↩ | — | ◐ | Assets UI shows a subset; publish/update workflow is missing. |
+| Version/sort/publish/library metadata | ↩ | — | ◐ | Figma metadata is preserved; OpenPencil's component-library publish/update workflow uses its own stable asset identities and revision review. |
| Variable and parameter consumption maps | ✅ | ◐ | ◐ | Filtered/preserved for safe round-trip; normalized bindings cover common cases. |
-| Page fields: background, page type, guides | ↩ | ◐ | — | Background color, background paints, page type, and guides round-trip for imported pages. Guides render as editor overlays but are not editable. |
+| Page fields: background, page type, guides | ↩ | ◐ | ◐ | Background color, background paints, page type, and guides round-trip for imported pages. Normalized page/frame guides render as overlays and support undoable editing. |
| Text internals: `textData`, layout versions, font version, derived data | ✅ | ✅ | — | Important for text fidelity; most internals are not editable. Imported derived text data, leading trim, decoration style, underline decoration paint/offset/thickness/skip-ink, semantic font metadata, and raw OpenType feature toggles are preserved for round-trip when safe; decoration style/thickness/color and leading trim now render through CanvasKit, and raster export bounds account for decoration overflow. |
| `fontVariations` | ✅ | ✅ | — | Variable font axes are imported, rendered, and exported for text nodes and style runs. |
| Raw paint/effect/vector/geometry payloads | ✅ | ✅ | ◐ | Converted fields render; raw payloads preserve Figma import/export details, including mask, background paint, layout grid, export setting, and prototype interaction metadata where safe. |
@@ -267,7 +273,7 @@ These are parsed or visible in Figma docs and most likely to cause visible diffe
3. **Pattern/noise/custom fills** — tune first-class pattern rendering for nested/effectful pattern sources and exact Figma hex spacing. `tests/fixtures/figma-oracles/pattern-noise-custom-paints.json` captures a real async Figma `PATTERN` payload and Figma-authored noise/texture/glass effect payloads; real `NOISE` / `CUSTOM` paint payloads remain blocked on Figma-authored samples.
4. **Variable-font and rich text fixtures** — broaden real-file coverage for variable axes, derived text data, leading trim, decoration style, underline offset/skip-ink, semantic font metadata, and raw OpenType feature metadata; `tests/fixtures/figma-oracles/rich-text-decoration.json` captures the first live Figma rich-text oracle.
5. **Boolean operation editing** — improve inspector/tooling workflows for imported boolean-operation nodes.
-6. **Layout grids and guides** — complete page-guide creation/editing and fuller grid style parity; common imported layout grids already render and have inspector controls.
+6. **Layout grids and guides** — broaden grid-style parity and Figma edge-case coverage; common grid geometry and page/frame guide editing are already supported.
7. **Full component property and slot workflows** — support authoring, not just preserving imported payloads.
8. **Prototype/media/interaction metadata** — schema now includes more interaction, media runtime, animation, and slide fields; start by preserving flows/connections/runtime metadata before building playback.
diff --git a/packages/docs/programmable/ai-chat.md b/packages/docs/programmable/ai-chat.md
index 7b48db1cf..f05a44dab 100644
--- a/packages/docs/programmable/ai-chat.md
+++ b/packages/docs/programmable/ai-chat.md
@@ -18,7 +18,15 @@ You can configure multiple reusable models and separately assign models for desi
The chat composer grows with multiline prompts and can pin the current canvas selection as explicit node context. Assistant messages show provider reasoning in collapsible sections and provide a per-response copy action. Image attachments remain available for visual references when a Vision model is configured. Streaming responses use a hardened Markdown renderer with Shiki-highlighted code blocks; unsafe link protocols and embedded data images are blocked.
-### Supported Providers
+## Saved Conversations
+
+Use **Conversation history** to return to a saved chat, start a **New chat**, or rename or delete a conversation. History and attachment previews are stored locally; **All chats** lets you browse transcripts from other documents.
+
+A conversation belonging to another document is read-only until you open that document. A saved agent transcript is not a guarantee that its external agent session can resume: when resumption is unavailable, start a new chat. Local history is not cloud synchronization or a backup.
+
+In the Chat settings beside the model overview, choose whether reasoning is **Collapsed by default**, **Expand while thinking**, or **Expanded by default**. Disclosure animations follow the app's reduced-motion preference. Expanding older reasoning does not force the conversation to scroll to the bottom.
+
+## Supported Providers
| Provider | Models | Setup |
| ------------------------ | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
@@ -33,9 +41,9 @@ The chat composer grows with multiline prompts and can pin the current canvas se
No backend, no subscription — your key talks directly to the provider. Browser requests are subject to each provider's CORS policy, and model deployments vary in how reliably they stream tool calls. See [BYOK provider and model compatibility](./byok-provider-compatibility) for measured results and reproduction steps.
-### External MCP connections
+## External MCP connections
-Desktop ACP agents can also use trusted remote [Model Context Protocol](https://modelcontextprotocol.io/) servers. In **Settings → MCP connections**, add a named Streamable HTTP endpoint, optionally save a bearer token, and enable the connection. OpenPencil stores the token in the configured credential backend rather than ordinary settings and resolves it only when starting the ACP session.
+Desktop ACP agents can also use trusted remote [Model Context Protocol](https://modelcontextprotocol.io/) servers. In **Settings → MCP**, under remote connections, add a named Streamable HTTP endpoint, optionally save a bearer token, and enable the connection. OpenPencil stores the token in the configured credential backend rather than ordinary settings and resolves it only when starting the ACP session.
Remote servers must use HTTPS. Loopback HTTP endpoints are accepted for local development. Review and trust a server before enabling it: its tools may read external data or perform actions with the credentials you provide. OpenPencil's built-in design MCP server remains attached automatically and does not need to be added here.
diff --git a/packages/docs/programmable/cli/exporting.md b/packages/docs/programmable/cli/exporting.md
index 3f259f153..5d20f429e 100644
--- a/packages/docs/programmable/cli/exporting.md
+++ b/packages/docs/programmable/cli/exporting.md
@@ -1,11 +1,11 @@
---
title: Exporting
-description: Export document content to PNG, JPG, WEBP, SVG, `.fig`, JSX, or HTML, and convert between document formats.
+description: Export document content to images, PDF, PowerPoint, `.fig`, JSX, or HTML, with font-substitution policies for raster and PDF output.
---
# Exporting
-Export designs from the terminal — raster images, vectors, `.fig` subsets, JSX code, or HTML.
+Export designs from the terminal — raster images, vectors, PDF, editable PowerPoint, `.fig` subsets, JSX code, or HTML.
## Image Export
@@ -14,6 +14,8 @@ openpencil export design.fig # PNG (default)
openpencil export design.fig -f jpg -s 2 -q 90 # JPG at 2×, quality 90
openpencil export design.fig -f webp -s 3 # WEBP at 3×
openpencil export design.fig -f svg # SVG vector
+openpencil export design.fig -f pdf # PDF
+openpencil export design.fig -f pptx # editable PowerPoint
openpencil export design.fig -f fig --page "Page 1" # export one page as .fig
openpencil export design.fig -f fig --node 1:23 # export one node as .fig
openpencil export design.fig -f html --css tailwind # export an HTML fragment with Tailwind classes
@@ -21,13 +23,31 @@ openpencil export design.fig -f html --css tailwind # export an HTML fragment
Options:
-- `-f` — format: `png`, `jpg`, `webp`, `svg`, `jsx`, `html`, `fig`
-- `-s` — scale: `1`–`4`
+- `-f` — format: `png`, `jpg`, `webp`, `svg`, `pdf`, `pptx`, `jsx`, `html`, `fig`
+- `-s` — export scale (default: `1`)
- `-q` — quality: `0`–`100` (JPG/WEBP only)
- `-o` — output path
- `--page` — page name
- `--node` — specific node ID
+## Font Substitution Policy
+
+For file-backed PNG, JPG, WEBP, and PDF exports, choose how missing or substituted fonts are handled:
+
+```sh
+openpencil export design.fig -f pdf --font-policy strict
+openpencil export design.fig -f png --font-policy warn
+openpencil export design.fig -f webp --font-policy allow
+```
+
+- `warn` (default) — report substitutions and continue exporting.
+- `strict` — stop with a nonzero exit status if font preparation cannot faithfully resolve the requested faces.
+- `allow` — export without the additional font-fidelity check.
+
+Run [`openpencil fonts`](./inspecting#font-diagnostics) first to inspect affected faces. Export preparation may use configured font providers, so its result can differ from the offline file diagnostic.
+
+This policy does not apply to exports from the running app, or to SVG, PowerPoint, JSX, HTML, and `.fig` output. It checks font resolution, not complete visual equivalence with Figma.
+
## JSX Export
Export as JSX with Tailwind utility classes:
@@ -68,16 +88,12 @@ Standalone Tailwind output is compiled during export; it does not depend on the
HTML export is available in file mode.
-## Thumbnails
-
-```sh
-openpencil export design.fig --thumbnail --width 1920 --height 1080
-```
-
## Live App Mode
Omit the file to export from the running app:
```sh
-openpencil export -f png # screenshot the current canvas
+openpencil export -f png # export from the current document
```
+
+Live app mode supports PNG, JPG, WEBP, SVG, and PDF. PowerPoint, JSX, HTML, and `.fig` exports require a file argument. File-mode thumbnail export is not currently supported.
diff --git a/packages/docs/programmable/cli/inspecting.md b/packages/docs/programmable/cli/inspecting.md
index 12098a9a8..a5fbe50bc 100644
--- a/packages/docs/programmable/cli/inspecting.md
+++ b/packages/docs/programmable/cli/inspecting.md
@@ -23,6 +23,20 @@ Get a quick overview — page count, total nodes, fonts used, file size:
openpencil info design.fig
```
+## Font Diagnostics
+
+Report requested font faces, available sources, substitutions, and affected layers:
+
+```sh
+openpencil fonts design.fig
+openpencil fonts design.fig --json
+openpencil fonts --document-id tab-123 --page-id 0:1
+```
+
+File mode checks all document pages using the CLI host's available fonts without downloading online fonts. Live mode reports the targeted app document/page, whose loaded fonts may differ from the CLI host. Faces are reported as `available`, `substituted`, or `unresolved`; JSON output includes `faithful`, `faces`, and `issues`.
+
+Use [export font policies](./exporting#font-substitution-policy) to warn about or reject substitutions during file-backed raster and PDF exports.
+
## Node Tree
Print the full node hierarchy:
diff --git a/packages/docs/programmable/sdk/api/composables/use-i18n.md b/packages/docs/programmable/sdk/api/composables/use-i18n.md
index c271a8818..6e697acc5 100644
--- a/packages/docs/programmable/sdk/api/composables/use-i18n.md
+++ b/packages/docs/programmable/sdk/api/composables/use-i18n.md
@@ -5,9 +5,16 @@ description: Read localized OpenPencil UI messages and switch the active SDK loc
# useI18n
-`useI18n()` returns reactive translation groups plus locale controls for OpenPencil-powered editor shells.
+`useI18n()` is a compatibility aggregate returning reactive translation groups and locale controls. New components should import only the product-domain composables they need, rather than subscribe to every catalog.
-Use it when you want SDK-backed labels for menus, commands, panels, pages, and dialogs, or when you need to let users switch locales.
+```ts twoslash
+import { useSettingsMessages, useRenameMessages } from '@open-pencil/vue'
+
+const settings = useSettingsMessages()
+const rename = useRenameMessages()
+```
+
+Each domain composable returns a reactive ref. Read `.value` in script; Vue unwraps it in templates. See [Locale APIs](../advanced/locale-apis) for locale switching without the aggregate.
## Usage
@@ -19,16 +26,11 @@ const { menu, commands, panels, locale, availableLocales, localeLabels, setLocal
## Returns
-- `menu`
-- `commands`
-- `tools`
-- `panels`
-- `pages`
-- `dialogs`
-- `locale`
-- `availableLocales`
-- `localeLabels`
-- `setLocale`
+Translation refs: `ai`, `automation`, `code`, `collaboration`, `commands`, `common`, `credentials`, `diagnostics`, `editor`, `files`, `fonts`, `media`, `menu`, `pages`, `panels`, `recovery`, `rendering`, `rename`, `settings`, `storage`, `tools`, `updates`, `variables`, and `variableTypes`.
+
+Locale controls: `locale`, `availableLocales`, `localeLabels`, and `setLocale`.
+
+The former `dialogs` group, `useDialogMessages()`, and `dialogMessages` are removed in the development version after v0.14.0. Use the owning domain, such as `settings`, `rename`, or `recovery`, and update the corresponding message keys.
## Basic example
diff --git a/packages/docs/programmable/sdk/getting-started.md b/packages/docs/programmable/sdk/getting-started.md
index a15047cc6..7a1c107bf 100644
--- a/packages/docs/programmable/sdk/getting-started.md
+++ b/packages/docs/programmable/sdk/getting-started.md
@@ -8,10 +8,10 @@ description: Set up @open-pencil/vue with createEditor, provideEditor, and a can
## Installation
```bash
-bun add @open-pencil/core @open-pencil/vue canvaskit-wasm
+bun add @open-pencil/core @open-pencil/scene-graph @open-pencil/vue canvaskit-wasm
```
-The SDK lives in the monorepo today and is also published as `@open-pencil/vue`.
+The SDK lives in the monorepo and is published as `@open-pencil/vue`. The current development version requires Vue `^3.5.41` and, when using its optional CanvasKit peer, `canvaskit-wasm >=0.41.1`. Check the installed package's peer requirements when using an older release.
```ts
import { createEditor } from '@open-pencil/core/editor'
@@ -30,15 +30,27 @@ There are three layers:
### 1. Create an editor
-```ts
-import { createEditor } from '@open-pencil/core/editor'
+```ts twoslash
+// @module: esnext
+// @moduleResolution: bundler
+// ---cut---
+import { reactive } from 'vue'
+import { createDefaultEditorState, createEditor } from '@open-pencil/core/editor'
+import { SceneGraph } from '@open-pencil/scene-graph'
+
+const graph = new SceneGraph()
+const page = graph.getPages()[0]
+if (!page) throw new Error('Expected an initial page')
const editor = createEditor({
- width: 1200,
- height: 800,
+ graph,
+ state: reactive(createDefaultEditorState(page.id)),
+ getViewportSize: () => ({ width: 1200, height: 800 }),
})
```
+Core state is framework-neutral; passing reactive state lets Vue controls observe editor changes. For a resizable editor, have `getViewportSize` return the current canvas container dimensions. `width` and `height` are not `EditorOptions` properties.
+
### 2. Provide it to Vue
```vue
@@ -120,6 +132,17 @@ useCanvas(canvasRef, editor, {
</template>
```
+## Migrating from v0.14.0
+
+These changes describe the current development version; use them when upgrading beyond v0.14.0.
+
+- **Scene Graph overrides:** replace `SceneNode.overrides` records with `instanceOverrides`, whose `self` and `descendants` maps distinguish instance-level and descendant overrides. Use the public override helpers from `@open-pencil/scene-graph` rather than treating this as a simple field rename.
+- **Derived geometry:** rename `figmaDerivedLayout` to `derivedLayout`, `figmaDerivedTextGlyphs` to `derivedTextGlyphs`, and the exported `FigmaDerivedTextGlyph` type to `DerivedTextGlyph`.
+- **Binding providers:** implement `getBindingId()` and handle `unresolved`. For `edit-variable`, replace `setValue()` with `prepareEdit()`, which captures the edit key, value, setter, and restoration callback. See [BindableValue](./api/components/bindable-value).
+- **Translations:** replace `useDialogMessages()` and `dialogMessages` with the relevant product-domain composables and catalogs, such as `useSettingsMessages()` or `useRenameMessages()`. Catalog keys have also moved; do not just rename the import. See [useI18n](./api/composables/use-i18n).
+- **CanvasKit:** use `PathBuilder` for mutable construction and retain the returned paths from immutable `Path` operations instead of expecting in-place mutation.
+- **Custom tools:** use native Valibot `input` schemas and execution metadata instead of `params`, `ParamDef`, or `paramToZod()`. Programmatic MCP integrations use MCP SDK v2 server/client types; see [MCP](../mcp-server).
+
## Next steps
- [Architecture](./architecture)
diff --git a/packages/docs/programmable/sdk/guides/custom-editor-shell.md b/packages/docs/programmable/sdk/guides/custom-editor-shell.md
index 632a3b6d4..2c84d0fad 100644
--- a/packages/docs/programmable/sdk/guides/custom-editor-shell.md
+++ b/packages/docs/programmable/sdk/guides/custom-editor-shell.md
@@ -33,29 +33,38 @@ A practical shell often looks like this:
```vue
<script setup lang="ts">
-import { createEditor } from '@open-pencil/core/editor'
+import { reactive } from 'vue'
+import { createDefaultEditorState, createEditor } from '@open-pencil/core/editor'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
provideEditor,
CanvasRoot,
CanvasSurface,
ToolbarRoot,
PageListRoot,
- LayerTreeRoot,
} from '@open-pencil/vue'
-const editor = createEditor({ width: 1440, height: 900 })
+const graph = new SceneGraph()
+const page = graph.getPages()[0]
+if (!page) throw new Error('Expected an initial page')
+
+const editor = createEditor({
+ graph,
+ state: reactive(createDefaultEditorState(page.id)),
+ getViewportSize: () => ({ width: 1440, height: 900 }),
+})
provideEditor(editor)
</script>
<template>
<div class="grid h-screen grid-cols-[240px_1fr_320px] grid-rows-[48px_1fr]">
- <ToolbarRoot v-slot="{ tools, activeTool, setTool }">
+ <ToolbarRoot v-slot="{ tools, activeTool, actions }">
<header class="col-span-3 flex items-center gap-2 border-b px-3">
<button
v-for="tool in tools"
- :key="tool.id"
- :data-active="activeTool === tool.id"
- @click="setTool(tool.id)"
+ :key="tool.key"
+ :data-active="activeTool === tool.key"
+ @click="actions.setTool(tool.key)"
>
{{ tool.label }}
</button>
@@ -63,13 +72,13 @@ provideEditor(editor)
</ToolbarRoot>
<aside class="border-r">
- <PageListRoot v-slot="{ pages, currentPageId, switchPage }">
+ <PageListRoot v-slot="{ pages, currentPageId, actions }">
<nav>
<button
v-for="page in pages"
:key="page.id"
:data-active="page.id === currentPageId"
- @click="switchPage(page.id)"
+ @click="actions.switch(page.id)"
>
{{ page.name }}
</button>
@@ -90,6 +99,8 @@ provideEditor(editor)
</template>
```
+The fixed viewport dimensions above keep the example short. In a resizable shell, return the actual canvas container size from `getViewportSize`; do not include the surrounding sidebars or toolbar. See [SDK Getting Started](../getting-started) for installation requirements and migration notes.
+
## Why this split works
- the SDK owns editor integration and reusable headless logic
diff --git a/packages/docs/user-guide/canvas-navigation.md b/packages/docs/user-guide/canvas-navigation.md
index 61e96d291..f2093ce6f 100644
--- a/packages/docs/user-guide/canvas-navigation.md
+++ b/packages/docs/user-guide/canvas-navigation.md
@@ -1,11 +1,12 @@
---
title: Canvas Navigation
-description: Panning, zooming, and the hand tool in OpenPencil.
+description: Panning, zooming, ruler guides, snapping, and distance measurements in OpenPencil.
---
# Canvas Navigation
The canvas is your infinite workspace. You can pan and zoom freely to navigate your design.
+
## Panning
Move the visible area of the canvas without affecting any objects.
@@ -13,6 +14,7 @@ Move the visible area of the canvas without affecting any objects.
- <kbd>Space</kbd> + drag — hold Space and drag anywhere on the canvas
- **Middle mouse drag** — press and drag the middle mouse button
- **Two-finger trackpad** — swipe with two fingers on a trackpad
+- <kbd>Shift</kbd> + mouse wheel — pan horizontally
## Hand Tool
@@ -38,6 +40,31 @@ Pinch-to-zoom on UI panels (layers, properties) is prevented so it doesn't accid
| Zoom out | <kbd>⌘</kbd><kbd>−</kbd> | <kbd>Ctrl</kbd> + <kbd>−</kbd> |
| Zoom to 100% | <kbd>⌘</kbd><kbd>0</kbd> | <kbd>Ctrl</kbd> + <kbd>0</kbd> |
+## Ruler Guides
+
+Enable **View → Rulers**, then drag from the top ruler for a horizontal guide or the left ruler for a vertical guide. Drop onto the page for a canvas guide, or onto a frame for a guide in that frame's coordinates.
+
+- Click a guide to select it; drag it to reposition it or transfer it between the page and a frame.
+- Hold <kbd>Option</kbd> / <kbd>Alt</kbd> while dragging an existing guide to duplicate it.
+- Drag a guide back onto a ruler to remove it, or use its context menu's **Remove guide** action.
+- Guide changes support undo/redo and are preserved in `.fig` files.
+
+## Snapping
+
+Under **View → Preferences**, toggle **Snap to Geometry**, **Snap to Objects**, and **Snap to Pixel Grid** independently. Preferences are saved between sessions.
+
+Geometry and object snapping help align vector points, moved layers, and resized edges with nearby geometry, objects, guides, and frame bounds. Alignment lines appear for those targets; pixel-grid rounding does not draw an alignment line for every pixel.
+
+Hold <kbd>Control</kbd> during a layer drag to temporarily bypass object and pixel snapping, including on macOS where this is Control, not Command.
+
+## Distance Measurements
+
+Select a layer, hold <kbd>Option</kbd> on macOS or <kbd>Alt</kbd> on Windows/Linux, and hover another layer to see temporary distance measurements. Releasing the modifier clears the overlay; it does not add guides or change the document.
+
+## Command Palette
+
+Press <kbd>⌘</kbd><kbd>K</kbd> on macOS or <kbd>Ctrl</kbd> + <kbd>K</kbd> on Windows/Linux to search editor and application actions. Select a result to run it; unavailable actions remain subject to the current selection and document state.
+
## Tips
- Zooming always targets the cursor position, so point at what you want to see closer.
diff --git a/packages/docs/user-guide/layers-and-pages.md b/packages/docs/user-guide/layers-and-pages.md
index a9a510854..d9c04d593 100644
--- a/packages/docs/user-guide/layers-and-pages.md
+++ b/packages/docs/user-guide/layers-and-pages.md
@@ -41,6 +41,14 @@ The pages panel shows all pages in the document.
Each page has its own canvas and viewport state.
+## Documents and Recovery
+
+The Home workspace lists recent local documents and documents from configured storage providers. Use grid or list view, or open multiple selected files into separate editor tabs.
+
+In **Settings → General → Recovery**, **Automatically preserve unsaved work** controls local recovery copies. With recovery enabled, unsaved documents without a file path remain recoverable even after their tabs close. When OpenPencil offers **Recover unsaved work**, choose **Restore** to reopen a document or **Discard** to remove its recovery copy.
+
+Disabling recovery stops automatic preservation; it is not a bulk-delete control for snapshots from previously closed documents. Recovery is local to this installation/browser profile; it is not a replacement for saving a file, cloud synchronization, or a backup.
+
## Properties Panel
The properties panel on the right has three tabs:
@@ -63,12 +71,12 @@ When no nodes are selected, the Design tab shows page-level properties including
Displays the selected node as code with syntax highlighting, line numbers, and a copy button. A format toggle lets you switch between two output modes:
-- **OpenPencil JSX** — custom component tree compatible with `renderJsx()` for programmatic round-trip
+- **OpenPencil JSX** — custom component tree compatible with `renderJSX()` for programmatic round-trip
- **Tailwind CSS v4** — HTML with utility classes (`<div className="flex gap-4 p-3">`) ready to paste into React/Vue projects
### AI Tab
-An AI chat interface (also toggled with <kbd>⌘</kbd><kbd>J</kbd>) that can create and modify design elements via natural language. Supports multiple AI models through OpenRouter.
+An [AI chat interface](../programmable/ai-chat) (also toggled with <kbd>⌘</kbd><kbd>J</kbd>) that can create and modify design elements via natural language. Configure reusable models and provider connections in Settings, and browse locally saved conversations.
## Keyboard Shortcuts
diff --git a/packages/docs/user-guide/text-editing.md b/packages/docs/user-guide/text-editing.md
index 927d056b4..0fb968856 100644
--- a/packages/docs/user-guide/text-editing.md
+++ b/packages/docs/user-guide/text-editing.md
@@ -69,6 +69,10 @@ Open the font picker in the Typography section of the properties panel to change
- **Virtual scroll** — handles large font lists efficiently
- **Scroll-to-current** — the current font is highlighted when the picker opens
+## Text on a Path
+
+Imported Figma text-on-path layers retain their curved glyph layout. You can edit their text and typography, resize and select them, and save or export the result while preserving the path layout. This is support for existing imported path-text layers, not a separate drawing tool for attaching arbitrary text to a new path.
+
## Font Weight
Change the font weight in the Typography section of the properties panel. Available weights depend on the selected font family (e.g., Regular, Medium, Bold, Black).
@@ -77,7 +81,7 @@ Change the font weight in the Typography section of the properties panel. Availa
- **Default font** — Inter is loaded automatically
- **Desktop app** — system fonts plus enabled Google Fonts, Fontsource, Bunny Fonts, and Fontshare catalogs
-- **Browser** — system fonts are available in Chrome and Edge; online font catalogs require the desktop app
+- **Browser** — system fonts are available in Chrome and Edge with local-font permission. Enabled Fontsource, Bunny Fonts, and Fontshare providers can load online fonts, subject to network access and browser CORS rules; Google Fonts is disabled in the browser
- **Downloaded fonts** — the desktop app caches downloaded faces for reuse on the same machine
## Missing Fonts and Substitutions
diff --git a/packages/vue/README.md b/packages/vue/README.md
index 7f524d966..3068ee903 100644
--- a/packages/vue/README.md
+++ b/packages/vue/README.md
@@ -14,19 +14,28 @@ The SDK is headless by design: it provides logic and structure, while your app o
## Install
```bash
-bun add @open-pencil/vue @open-pencil/core canvaskit-wasm
+bun add @open-pencil/vue @open-pencil/core @open-pencil/scene-graph canvaskit-wasm
```
+The current development version requires Vue `^3.5.41` and, when supplying the optional CanvasKit peer, `canvaskit-wasm >=0.41.1`. See [SDK Getting Started](https://openpencil.dev/programmable/sdk/getting-started) for migration guidance; older releases may have different peer requirements.
+
## Quick start
```vue
<script setup lang="ts">
-import { createEditor } from '@open-pencil/core/editor'
-import { provideEditor } from '@open-pencil/vue'
+import { reactive } from 'vue'
+import { createDefaultEditorState, createEditor } from '@open-pencil/core/editor'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { CanvasRoot, CanvasSurface, provideEditor } from '@open-pencil/vue'
+
+const graph = new SceneGraph()
+const page = graph.getPages()[0]
+if (!page) throw new Error('Expected an initial page')
const editor = createEditor({
- width: 1200,
- height: 800,
+ graph,
+ state: reactive(createDefaultEditorState(page.id)),
+ getViewportSize: () => ({ width: 1200, height: 800 }),
})
editor.createShape('RECTANGLE', 100, 100, 200, 150)
@@ -37,13 +46,15 @@ provideEditor(editor)
<template>
<div class="h-screen">
- <CanvasRoot v-slot="{ canvasRef }">
- <canvas ref="canvasRef" class="size-full" />
+ <CanvasRoot>
+ <CanvasSurface class="size-full" />
</CanvasRoot>
</div>
</template>
```
+The fixed viewport size above is illustrative; a resizable shell should return its actual canvas container dimensions from `getViewportSize`. Pass reactive state for Vue controls, while keeping the Scene Graph itself framework-neutral.
+
## Core concepts
### Editor context