Skip to content

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

refactor: give every package export exactly one import path (#1283)

Danila Poyarkov42ce93c51985
diff --git a/AGENTS.md b/AGENTS.md
index 442eb490c..41cbf05ba 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -46,10 +46,11 @@ Before a PR run `bun run check`, `bun run format`, `bun run test:unit`, and `bun
## Package boundaries
-- Across package/app boundaries import the owning package's public exports, never workspace internals or forwarding-only shims. `@open-pencil/scene-graph` owns graph types and primitives; `@open-pencil/kiwi` owns low-level Kiwi/FIG helpers; `@open-pencil/core` provides the compatibility barrel plus the subpaths listed in `packages/core/package.json`.
+- Across package/app boundaries import the owning package's public exports, never workspace internals or forwarding-only shims. `@open-pencil/scene-graph` owns graph types and primitives; `@open-pencil/kiwi` owns low-level Kiwi/FIG helpers; `@open-pencil/core`'s root is the editor, and its other domains are the subpaths listed in `packages/core/package.json`.
+- A package exports each name from exactly one entry, and never another package's names: a root entry holds the package's core model, domains get a subpath named after their source path, and consumers import a name from the package that declares it. The JSX runtime pair is the one exception (`check:packages`, `tools/checks/package-quality/src/checks/exports.ts`).
- `bun run check:arch` enforces: public workspace exports, framework-neutral Core, no app services in views or shared UI, property-panel internals scoped to that panel.
- The app, CLI, MCP server, and Vue SDK build layers from authored content (HTML, JSX, `.pen`) only through Core: IO `readDocument`, `readHTMLDocument`, `sceneGraphFromStyledHTML`, or `@open-pencil/core/design-jsx`, which lay the layers out. Format packages' own builders, such as `htmlToSceneGraph` or `parsePenFile`, skip that; `open-pencil/no-graph-builders-in-front-ends` (`check:arch`) rejects them outside Core.
-- Package aliases are `#core/*`, `#fig/*`, `#vue/*`, `#cli/*`, `#mcp/*`, `#cloud/*`, `#dom-css/*`, `#design-jsx/*`, `#emit/*`; a package's own tests use `#core-tests/*`, `#fig-tests/*`, `#dom-css-tests/*`, and `#cloud-tests/*`; the app uses `@/`. Prefer clear relative imports nearby. Never escape an alias root with `../` (for example `#tests/../vite`); fix module ownership instead.
+- Package aliases are `#scene-graph/*`, `#core/*`, `#fig/*`, `#vue/*`, `#cli/*`, `#mcp/*`, `#cloud/*`, `#dom-css/*`, `#design-jsx/*`, `#emit/*`; a package's own tests use `#core-tests/*`, `#fig-tests/*`, `#dom-css-tests/*`, and `#cloud-tests/*`; the app uses `@/`. Prefer clear relative imports nearby. Never escape an alias root with `../` (for example `#tests/../vite`); fix module ownership instead.
- Never drill with `../../`: one `../` to a sibling folder is fine, two or more means an alias. This holds in tests as much as in source — a test reaches its package's source through `#<pkg>/*` and its own helpers through `#<pkg>-tests/*`. `open-pencil/no-deep-parent-relative-imports` enforces it for imports and `open-pencil/no-deep-parent-relative-paths` for paths built from `import.meta`; a new test directory must be added to `lint:structure` so the rules reach it.
- Reuse named types from `@open-pencil/scene-graph`; do not respell `Color`, `Vector`, `SceneNode`, `Effect`, `Fill`, or `Stroke`.
diff --git a/bun.lock b/bun.lock
index f2c7e2e1d..428f31314 100644
--- a/bun.lock
+++ b/bun.lock
@@ -558,6 +558,7 @@
"nanostores": "^1.5.4",
"reka-ui": "^2.10.5",
"shaders": "4.0.4",
+ "valibot": "^1.5.0",
},
"devDependencies": {
"tsdown": "^0.22.14",
@@ -622,6 +623,7 @@
"@open-pencil/package-artifacts-tools": "workspace:*",
"citty": "^0.1.6",
"es-toolkit": "^1.52.0",
+ "typescript": "~5.8.3",
},
},
"tools/checks/secret-scan": {
diff --git a/changes/1283/breaking.md b/changes/1283/breaking.md
new file mode 100644
index 000000000..75aab2ae9
--- /dev/null
+++ b/changes/1283/breaking.md
@@ -0,0 +1,5 @@
+- Every public name of `@open-pencil/*` packages now has exactly one import path, and no package re-exports another's names. `@open-pencil/scene-graph`'s root holds `SceneGraph`, `generateId`, `setIdSession`, and the node types; primitives come from `/primitives` and every other domain from its own subpath, such as `/instances`, `/instances/overrides`, `/variables`, `/transfer`, `/components`, `/slots`, `/comments`, and `/fields`. `/text-direction` and `/text-picture` are now `/text/direction` and `/text/picture`, and `/types` is part of the root.
+- `@open-pencil/core`'s root is the editor that `/editor` was; `/editor` and `/kiwi` are removed, and other names come from Core's subpaths or the package that declares them, such as `@open-pencil/kiwi`, `@open-pencil/fig`, and `@open-pencil/pen`.
+- `@open-pencil/vue`'s root holds `provideEditor`, `useEditor`, and `EDITOR_KEY`; every other composable and primitive comes from the subpath of its source folder, such as `/canvas`, `/controls/fill`, `/editor/commands`, `/primitives/NumberField`, and `/i18n`. It no longer re-exports `createEditor`, `EDITOR_TOOLS`, `TOOL_SHORTCUTS`, or Core's editor types.
+- `@open-pencil/kiwi` has no root entry, and `@open-pencil/dom-css`'s root no longer repeats `/browser`, `/export`, `/scene-graph`, or the JSX factories.
+- `SceneGraph.reorderChild` is removed in favor of `insertChildAt`, which takes the same arguments, and `SceneGraph.LAYOUT_AFFECTING_KEYS`, `TEXT_PICTURE_KEYS`, and `GLYPH_AFFECTING_KEYS` are now exports of `/fields` and `/text/picture`.
diff --git a/oxlint.json b/oxlint.json
index 1a3bb1fd8..c2e77f080 100644
--- a/oxlint.json
+++ b/oxlint.json
@@ -204,12 +204,8 @@
"open-pencil/no-mcp-parent-relative-imports": "error",
"open-pencil/no-vue-parent-relative-imports": "error",
"open-pencil/no-cli-parent-relative-imports": "error",
- "open-pencil/no-mcp-core-barrel-imports": "error",
- "open-pencil/no-cli-core-barrel-imports": "error",
- "open-pencil/no-script-core-barrel-imports": "error",
"open-pencil/no-core-self-package-imports": "error",
"open-pencil/no-inline-prompt-constants": "error",
- "open-pencil/no-app-vue-core-barrel-imports": "error",
"open-pencil/no-direct-graph-emitter-subscriptions": "error",
"open-pencil/no-on-unmounted-in-composition-roots": "error",
"open-pencil/no-composable-state-wrappers": "error",
diff --git a/packages/cli/src/commands/export/storybook/fonts.ts b/packages/cli/src/commands/export/storybook/fonts.ts
index 8881ccceb..1c585922f 100644
--- a/packages/cli/src/commands/export/storybook/fonts.ts
+++ b/packages/cli/src/commands/export/storybook/fonts.ts
@@ -1,7 +1,7 @@
import { uniq } from 'es-toolkit/array'
import { exportWebFontFaceAssets } from '@open-pencil/core/text/web-font/assets'
-import type { WebFontFaceResolver } from '@open-pencil/dom-css'
+import type { WebFontFaceResolver } from '@open-pencil/dom-css/export'
import { warn } from '#cli/format'
diff --git a/packages/cli/src/headless.ts b/packages/cli/src/headless.ts
index 25b6d5df1..ef7ba545b 100644
--- a/packages/cli/src/headless.ts
+++ b/packages/cli/src/headless.ts
@@ -1,9 +1,10 @@
import { readFile, writeFile } from 'node:fs/promises'
import { SkiaRenderer } from '@open-pencil/core/canvas'
-import { BUILTIN_IO_FORMATS, IORegistry, initCanvasKit } from '@open-pencil/core/io'
+import { BUILTIN_IO_FORMATS, IORegistry } from '@open-pencil/core/io'
import { populateAllFigPages, populateFigPage } from '@open-pencil/core/io/formats/fig'
import { headlessHTMLReader } from '@open-pencil/core/io/formats/html/import'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import { computeAllLayouts, installTextMeasurer } from '@open-pencil/core/layout'
import type { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/cloud/src/server/index.ts b/packages/cloud/src/server/index.ts
index 149701758..91d7fc116 100644
--- a/packages/cloud/src/server/index.ts
+++ b/packages/cloud/src/server/index.ts
@@ -117,7 +117,6 @@ export {
parseCloudServerConfig,
CLOUD_DEFAULT_MAX_COLLABORATION_MESSAGE_BYTES,
CLOUD_DEFAULT_MAX_CONNECTIONS_PER_ROOM,
- CLOUD_PROTOCOL_MAX_UPLOAD_BYTES,
type CloudDeploymentConfig,
type CloudDeploymentInput,
type CloudEnvironment,
diff --git a/packages/core/AGENTS.md b/packages/core/AGENTS.md
index 8e5e58c7f..9bb8b418e 100644
--- a/packages/core/AGENTS.md
+++ b/packages/core/AGENTS.md
@@ -2,7 +2,7 @@
Renderer, layout, editor, Figma API, tools, clipboard, vector conversion, and document I/O. Depends on scene-graph, pen, kiwi, and fig. Framework-neutral: no Vue, no app imports, no browser DOM; guard browser globals explicitly.
-- Public surface is the compatibility barrel plus the subpaths listed in `packages/core/package.json` `exports`; add a subpath there rather than deep-importing.
+- The root entry is the editor (`createEditor` and its types); every other domain is a subpath listed in `packages/core/package.json` `exports`. Add a subpath there rather than deep-importing, and never re-export another package's names.
- CanvasKit runtime loading is centralized in `@open-pencil/core/canvaskit`. Headless raster export may dynamically load `canvaskit-wasm/full`; elsewhere `import type` and pass CanvasKit in.
- Drawing and input share preview-aware geometry through `@open-pencil/core/geometry`, built on Scene Graph matrices. Use it for world/screen transforms, inverses, bounds, and handle placement.
- Content an author wrote (design JSX, HTML, `.pen`) gets its sizes and positions from `layoutAuthoredNodes` in `packages/core/src/layout.ts`, which measures text that resizes to its content wherever it sits and then lays out the pages involved; renderers and readers of authored formats call it, while `.fig` keeps the geometry it stores (`packages/core/tests/layout/authored.test.ts`).
diff --git a/packages/core/README.md b/packages/core/README.md
index 333847826..44ed80202 100644
--- a/packages/core/README.md
+++ b/packages/core/README.md
@@ -4,7 +4,7 @@ Editor engine for [OpenPencil](https://openpencil.dev): the CanvasKit (Skia WASM
It depends on `@open-pencil/scene-graph`, `@open-pencil/pen`, `@open-pencil/kiwi`, and `@open-pencil/fig`, and keeps browser DOM out so it runs in the app, the CLI, the MCP server, and headless scripts alike.
-Import the root barrel or the targeted subpaths listed in `package.json` `exports`, for example `@open-pencil/core/io`, `@open-pencil/core/geometry`, and `@open-pencil/core/canvaskit`.
+The root entry is the editor: `createEditor` and its types. Everything else comes from the subpaths listed in `package.json` `exports`, for example `@open-pencil/core/io`, `@open-pencil/core/geometry`, and `@open-pencil/core/canvaskit`, and each name has exactly one of them.
Scripts get two globals through `compileScript` from `@open-pencil/core/tools`: `figma`, the Figma Plugin API over a document, and `openpencil` (`OpenPencilAPI` from `@open-pencil/core/openpencil-api`), what OpenPencil adds to it in the same style, such as making a component behave as a Reka UI control:
diff --git a/packages/core/package.json b/packages/core/package.json
index 440f09bf0..b462d121e 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -73,11 +73,6 @@
"import": "./dist/design-jsx/index.js",
"default": "./dist/design-jsx/index.js"
},
- "./editor": {
- "types": "./dist/editor/index.d.ts",
- "import": "./dist/editor/index.js",
- "default": "./dist/editor/index.js"
- },
"./tools": {
"types": "./dist/tools/index.d.ts",
"import": "./dist/tools/index.js",
@@ -139,11 +134,6 @@
"import": "./dist/io/formats/svg/index.js",
"default": "./dist/io/formats/svg/index.js"
},
- "./kiwi": {
- "types": "./dist/kiwi/index.d.ts",
- "import": "./dist/kiwi/index.js",
- "default": "./dist/kiwi/index.js"
- },
"./clipboard": {
"types": "./dist/clipboard.d.ts",
"import": "./dist/clipboard.js",
diff --git a/packages/core/src/canvas/boolean.ts b/packages/core/src/canvas/boolean.ts
index 10787547e..6266717f7 100644
--- a/packages/core/src/canvas/boolean.ts
+++ b/packages/core/src/canvas/boolean.ts
@@ -1,6 +1,7 @@
import type { Canvas, Path, PathBuilder, PathOp } from 'canvaskit-wasm'
-import type { GroupFitOptions, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import type { GroupFitOptions } from '@open-pencil/scene-graph/group-bounds'
import { getTextOutlineSupport } from '#core/text/outlines'
diff --git a/packages/core/src/canvas/index.ts b/packages/core/src/canvas/index.ts
index b7fe79da0..7fb525f01 100644
--- a/packages/core/src/canvas/index.ts
+++ b/packages/core/src/canvas/index.ts
@@ -43,3 +43,5 @@ export type {
PlacedIssueMarker
} from './issues/types'
export { hitTestStatusLabels, type PlacedStatusLabel } from './labels/status'
+export { LabelCache, type CachedComponent, type CachedSection } from './labels/cache'
+export { withFigExportRuntime } from './text/shape'
diff --git a/packages/core/src/canvas/labels/color.ts b/packages/core/src/canvas/labels/color.ts
index 2fe90725d..67061df7a 100644
--- a/packages/core/src/canvas/labels/color.ts
+++ b/packages/core/src/canvas/labels/color.ts
@@ -1,5 +1,6 @@
-import { WHITE, type Color } from '@open-pencil/scene-graph'
import { compositeOver, readableForeground } from '@open-pencil/scene-graph/color'
+import { WHITE } from '@open-pencil/scene-graph/constants'
+import type { Color } from '@open-pencil/scene-graph/primitives'
export function canvasLabelForeground(background: Color, canvasBackground: Color = WHITE): Color {
return readableForeground(compositeOver(background, canvasBackground))
diff --git a/packages/core/src/canvas/labels/draw.ts b/packages/core/src/canvas/labels/draw.ts
index f85ec9e1e..8822e6126 100644
--- a/packages/core/src/canvas/labels/draw.ts
+++ b/packages/core/src/canvas/labels/draw.ts
@@ -1,8 +1,9 @@
import type { Canvas } from 'canvaskit-wasm'
-import { shownStatusState, type SceneNode, type SceneGraph } from '@open-pencil/scene-graph'
+import type { SceneNode, SceneGraph } from '@open-pencil/scene-graph'
import type { Mat3 } from '@open-pencil/scene-graph/matrix'
import type { Rect } from '@open-pencil/scene-graph/primitives'
+import { shownStatusState } from '@open-pencil/scene-graph/statuses'
import type { RenderOverlays, SkiaRenderer } from '#core/canvas/renderer'
import { SECTION_TITLE_RADIUS } from '#core/constants'
diff --git a/packages/core/src/canvas/labels/layout.ts b/packages/core/src/canvas/labels/layout.ts
index da6815c14..c5bfdc572 100644
--- a/packages/core/src/canvas/labels/layout.ts
+++ b/packages/core/src/canvas/labels/layout.ts
@@ -1,4 +1,5 @@
-import { readIcon, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { readIcon } from '@open-pencil/scene-graph/icons'
import type { Rect, Vector } from '@open-pencil/scene-graph/primitives'
import {
diff --git a/packages/core/src/canvas/labels/paragraph-cache.ts b/packages/core/src/canvas/labels/paragraph-cache.ts
index 527b9c3c4..463ccbfa0 100644
--- a/packages/core/src/canvas/labels/paragraph-cache.ts
+++ b/packages/core/src/canvas/labels/paragraph-cache.ts
@@ -7,15 +7,15 @@ import type {
TypefaceFontProvider
} from 'canvaskit-wasm'
-import type { Size } from '@open-pencil/scene-graph'
-import { detectTextDirection } from '@open-pencil/scene-graph/text-direction'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
+import type { Size } from '@open-pencil/scene-graph/primitives'
+import { detectTextDirection } from '@open-pencil/scene-graph/text/direction'
import { ResourceCache } from '#core/cache/resource'
import { resolveParagraphFontFamilies } from '#core/canvas/text/font-families'
import { DEFAULT_FONT_FAMILY, SECTION_TITLE_FONT_FAMILY } from '#core/constants'
import { textHasFallbackScript } from '#core/text/coverage'
import { ELLIPSIS } from '#core/text/ellipsis'
-import { weightToStyle } from '#core/text/fonts'
import { missingGlyphOccurrences, type MissingGlyphOccurrence } from '#core/text/resolver'
export type LabelParagraphMetrics = Readonly<Size>
diff --git a/packages/core/src/canvas/labels/status.ts b/packages/core/src/canvas/labels/status.ts
index d03347c0e..87cd610ab 100644
--- a/packages/core/src/canvas/labels/status.ts
+++ b/packages/core/src/canvas/labels/status.ts
@@ -1,8 +1,8 @@
import type { Canvas, Paragraph } from 'canvaskit-wasm'
-import type { StatusState } from '@open-pencil/scene-graph'
import Matrix, { type Mat3 } from '@open-pencil/scene-graph/matrix'
import type { Color, Rect, Vector } from '@open-pencil/scene-graph/primitives'
+import type { StatusState } from '@open-pencil/scene-graph/statuses'
import type { SkiaRenderer } from '#core/canvas/renderer'
import {
diff --git a/packages/core/src/canvas/labels/transform.ts b/packages/core/src/canvas/labels/transform.ts
index b05d8783e..c904231fc 100644
--- a/packages/core/src/canvas/labels/transform.ts
+++ b/packages/core/src/canvas/labels/transform.ts
@@ -1,5 +1,6 @@
-import type { SceneGraph, SceneNode, Vector } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import Matrix from '@open-pencil/scene-graph/matrix'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import {
createSceneGeometry,
diff --git a/packages/core/src/canvas/node-edit-overlay.ts b/packages/core/src/canvas/node-edit-overlay.ts
index 91a37756a..d7e099dcf 100644
--- a/packages/core/src/canvas/node-edit-overlay.ts
+++ b/packages/core/src/canvas/node-edit-overlay.ts
@@ -1,6 +1,5 @@
import type { Canvas, Paint } from 'canvaskit-wasm'
-import { transformVectorNetwork } from '@open-pencil/scene-graph'
import type {
VectorVertex,
VectorSegment,
@@ -10,6 +9,7 @@ import type {
import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import Matrix from '@open-pencil/scene-graph/matrix'
import type { Vector } from '@open-pencil/scene-graph/primitives'
+import { transformVectorNetwork } from '@open-pencil/scene-graph/vector-network'
import { PEN_HANDLE_RADIUS, PEN_VERTEX_RADIUS } from '#core/constants'
import {
diff --git a/packages/core/src/canvas/overlays/connectors.ts b/packages/core/src/canvas/overlays/connectors.ts
index f34b47333..a55a4ded4 100644
--- a/packages/core/src/canvas/overlays/connectors.ts
+++ b/packages/core/src/canvas/overlays/connectors.ts
@@ -1,6 +1,7 @@
import type { Canvas, Paint } from 'canvaskit-wasm'
-import { connectorSublayers, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { connectorSublayers } from '@open-pencil/scene-graph/connectors'
import { getAxisAlignedBoundsInParent } from '@open-pencil/scene-graph/coordinate'
import Matrix from '@open-pencil/scene-graph/matrix'
import type { Vector } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/core/src/canvas/overlays/gradient-handles.ts b/packages/core/src/canvas/overlays/gradient-handles.ts
index 734219196..9c810a820 100644
--- a/packages/core/src/canvas/overlays/gradient-handles.ts
+++ b/packages/core/src/canvas/overlays/gradient-handles.ts
@@ -1,6 +1,7 @@
import type { Canvas, Path } from 'canvaskit-wasm'
-import type { Color, SceneGraph, Vector } from '@open-pencil/scene-graph'
+import type { SceneGraph } from '@open-pencil/scene-graph'
+import type { Color, Vector } from '@open-pencil/scene-graph/primitives'
import { getCachedMaskBlur } from '#core/canvas/effects'
import type { SkiaRenderer } from '#core/canvas/renderer'
diff --git a/packages/core/src/canvas/overlays/selection.ts b/packages/core/src/canvas/overlays/selection.ts
index cf29d3483..43a6d074f 100644
--- a/packages/core/src/canvas/overlays/selection.ts
+++ b/packages/core/src/canvas/overlays/selection.ts
@@ -1,10 +1,11 @@
import type { Canvas } from 'canvaskit-wasm'
-import { layerRotates, slotPropertyId } from '@open-pencil/scene-graph'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { layerRotates } from '@open-pencil/scene-graph/generated'
import { computeBounds, rotatedCorners } from '@open-pencil/scene-graph/geometry'
import Matrix from '@open-pencil/scene-graph/matrix'
import type { Vector } from '@open-pencil/scene-graph/primitives'
+import { slotPropertyId } from '@open-pencil/scene-graph/slots'
import { drawConnectorHover, drawConnectorSelection } from '#core/canvas/overlays/connectors'
import type { RenderOverlays, SkiaRenderer } from '#core/canvas/renderer'
diff --git a/packages/core/src/canvas/overlays/slots.ts b/packages/core/src/canvas/overlays/slots.ts
index f890fa67d..b0b760778 100644
--- a/packages/core/src/canvas/overlays/slots.ts
+++ b/packages/core/src/canvas/overlays/slots.ts
@@ -1,7 +1,7 @@
import type { Canvas } from 'canvaskit-wasm'
-import { instanceSlotFrames, slotPropertyId } from '@open-pencil/scene-graph'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { instanceSlotFrames, slotPropertyId } from '@open-pencil/scene-graph/slots'
import type { SkiaRenderer } from '#core/canvas/renderer'
import { SLOT_EMPTY_FILL_ALPHA } from '#core/constants'
diff --git a/packages/core/src/canvas/overlays/text-edit.ts b/packages/core/src/canvas/overlays/text-edit.ts
index 7579bee75..40784cbc0 100644
--- a/packages/core/src/canvas/overlays/text-edit.ts
+++ b/packages/core/src/canvas/overlays/text-edit.ts
@@ -1,6 +1,7 @@
import type { Canvas } from 'canvaskit-wasm'
-import type { Color, SceneNode } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import type { SkiaRenderer } from '#core/canvas/renderer'
import { TEXT_CARET_COLOR, TEXT_CARET_WIDTH, TEXT_SELECTION_ALPHA } from '#core/constants'
diff --git a/packages/core/src/canvas/renderer.ts b/packages/core/src/canvas/renderer.ts
index 46d3d3b56..04a8e1699 100644
--- a/packages/core/src/canvas/renderer.ts
+++ b/packages/core/src/canvas/renderer.ts
@@ -1,10 +1,10 @@
import { isEqual } from 'es-toolkit'
import { toUint8Array } from 'js-base64'
-import { slotPropertyId } from '@open-pencil/scene-graph'
import type { SceneNode, SceneGraph, Fill, Stroke } from '@open-pencil/scene-graph'
import type { RenderColorSpace, ResolvedRenderColor } from '@open-pencil/scene-graph/color'
import type { Color, Rect, Vector } from '@open-pencil/scene-graph/primitives'
+import { slotPropertyId } from '@open-pencil/scene-graph/slots'
import type { SnapGuide } from '@open-pencil/scene-graph/snap'
/* eslint-disable max-lines -- SkiaRenderer facade owns CanvasKit state and delegates domain drawing */
diff --git a/packages/core/src/canvas/text/decorations.ts b/packages/core/src/canvas/text/decorations.ts
index d53a4b019..54471584e 100644
--- a/packages/core/src/canvas/text/decorations.ts
+++ b/packages/core/src/canvas/text/decorations.ts
@@ -8,6 +8,7 @@ import type {
TextDecorationStyle
} from '@open-pencil/scene-graph'
import { resolveRGBAForPreview } from '@open-pencil/scene-graph/color'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
import { outlineInk, savedGlyphInk, type InkSpan } from '#core/canvas/text/ink'
import { COMBINING_KEYCAP, drawKeycapFrame } from '#core/canvas/text/keycap'
@@ -17,7 +18,6 @@ import { laidOutGlyphs, type LaidOutGlyph } from '#core/canvas/text/placed'
import type { PreparedText } from '#core/canvas/text/preparation/cache'
import { shownCharacters, shownText } from '#core/text/case'
import { characterStyles, TEXT_STYLE_KEYS, type CharacterStyle } from '#core/text/character-style'
-import { weightToStyle } from '#core/text/fonts'
import { fontDecorationMetricsSync, type FontDecorationMetrics } from '#core/text/opentype'
/**
diff --git a/packages/core/src/canvas/text/derived.ts b/packages/core/src/canvas/text/derived.ts
index eb6512f24..507731722 100644
--- a/packages/core/src/canvas/text/derived.ts
+++ b/packages/core/src/canvas/text/derived.ts
@@ -1,18 +1,15 @@
import type { Canvas, Path } from 'canvaskit-wasm'
import { fromUint8Array } from 'js-base64'
+import type { Fill, DerivedTextGlyph, SceneNode, Stroke } from '@open-pencil/scene-graph'
+import { isGradientFill } from '@open-pencil/scene-graph/gradient'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import {
hasTextList,
textListItems,
textParagraphRanges,
- type Color,
- type Fill,
- type DerivedTextGlyph,
- type SceneNode,
- type Stroke,
type TextParagraphRange
-} from '@open-pencil/scene-graph'
-import { isGradientFill } from '@open-pencil/scene-graph/gradient'
+} from '@open-pencil/scene-graph/text'
import type { ResourceCache } from '#core/cache/resource'
import { createPathCache } from '#core/canvas/paths/cache'
diff --git a/packages/core/src/canvas/text/font-families.ts b/packages/core/src/canvas/text/font-families.ts
index a48b644f4..67afc5121 100644
--- a/packages/core/src/canvas/text/font-families.ts
+++ b/packages/core/src/canvas/text/font-families.ts
@@ -1,10 +1,12 @@
import { uniq } from 'es-toolkit/array'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
+
import { ResourceCache } from '#core/cache/resource'
import { DEFAULT_FONT_FAMILY } from '#core/constants'
import { EMOJI_METRICS_FAMILY } from '#core/text/emoji'
import type { FamilyFace } from '#core/text/font/faces'
-import { fontManager, fontWeightMatchOrder, weightToStyle } from '#core/text/fonts'
+import { fontManager, fontWeightMatchOrder } from '#core/text/fonts'
const familiesCache = new ResourceCache<string, string[]>({ maxEntries: 256 })
diff --git a/packages/core/src/canvas/text/index.ts b/packages/core/src/canvas/text/index.ts
index a46d77d5f..b9575865d 100644
--- a/packages/core/src/canvas/text/index.ts
+++ b/packages/core/src/canvas/text/index.ts
@@ -1,8 +1,9 @@
import type { SceneNode } from '@open-pencil/scene-graph'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
import { DEFAULT_FONT_FAMILY } from '#core/constants'
import { shownCharacters, shownText } from '#core/text/case'
-import { fontManager, weightToStyle } from '#core/text/fonts'
+import { fontManager } from '#core/text/fonts'
import {
fontCoverageDemand,
fontFaceDemand,
diff --git a/packages/core/src/canvas/text/ink.ts b/packages/core/src/canvas/text/ink.ts
index 39cc1694a..254075488 100644
--- a/packages/core/src/canvas/text/ink.ts
+++ b/packages/core/src/canvas/text/ink.ts
@@ -1,4 +1,4 @@
-import { geometryCommandCoordCount } from '@open-pencil/scene-graph'
+import { geometryCommandCoordCount } from '@open-pencil/scene-graph/geometry'
import type { OutlineCommand } from '#core/text/opentype'
diff --git a/packages/core/src/canvas/text/layout/build.ts b/packages/core/src/canvas/text/layout/build.ts
index 1713a3368..825e8e085 100644
--- a/packages/core/src/canvas/text/layout/build.ts
+++ b/packages/core/src/canvas/text/layout/build.ts
@@ -1,5 +1,7 @@
import type { Paragraph } from 'canvaskit-wasm'
+import type { CharacterStyleOverride, StyleRun } from '@open-pencil/scene-graph'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
import {
hasParagraphSpacing,
hasTextList,
@@ -8,12 +10,10 @@ import {
textListItems,
textParagraphRanges,
topLevelNumberDigits,
- type CharacterStyleOverride,
- type StyleRun,
type TextListItem,
type TextParagraphRange
-} from '@open-pencil/scene-graph'
-import { resolveNodeTextDirection } from '@open-pencil/scene-graph/text-direction'
+} from '@open-pencil/scene-graph/text'
+import { resolveNodeTextDirection } from '@open-pencil/scene-graph/text/direction'
import { TextLayout, type TextLayoutBlock, type TextLayoutMarker } from '#core/canvas/text/layout'
import type { LineHeightRun, TextLayoutBlockLines } from '#core/canvas/text/layout/lines'
@@ -29,7 +29,6 @@ import type { TextRenderer } from '#core/canvas/text/renderer'
import { utf8Length } from '#core/canvas/text/utf8'
import { DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE } from '#core/constants'
import { shownText } from '#core/text/case'
-import { weightToStyle } from '#core/text/fonts'
import { glyphAdvanceSync } from '#core/text/opentype'
/** A list item's indent per level, in ems of the list's first character. */
diff --git a/packages/core/src/canvas/text/layout/lines.ts b/packages/core/src/canvas/text/layout/lines.ts
index c2150fe51..272a5f27a 100644
--- a/packages/core/src/canvas/text/layout/lines.ts
+++ b/packages/core/src/canvas/text/layout/lines.ts
@@ -1,6 +1,6 @@
import type { CanvasKit, LineMetrics, Paragraph, ShapedLine } from 'canvaskit-wasm'
-import type { Vector } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
/** A stretch of a paragraph's characters set at one line height, `null` for auto. */
export interface LineHeightRun {
diff --git a/packages/core/src/canvas/text/paragraph/index.ts b/packages/core/src/canvas/text/paragraph/index.ts
index 87bf49f8d..ffba61854 100644
--- a/packages/core/src/canvas/text/paragraph/index.ts
+++ b/packages/core/src/canvas/text/paragraph/index.ts
@@ -12,7 +12,8 @@ import type {
import type { SceneNode } from '@open-pencil/scene-graph'
import { resolveRGBAForPreview } from '@open-pencil/scene-graph/color'
-import { resolveNodeTextDirection } from '@open-pencil/scene-graph/text-direction'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
+import { resolveNodeTextDirection } from '@open-pencil/scene-graph/text/direction'
import { loadedFace, resolveParagraphFontFamilies } from '#core/canvas/text/font-families'
import { laidOutText } from '#core/canvas/text/keycap'
@@ -25,7 +26,7 @@ import type { TextRenderer } from '#core/canvas/text/renderer'
import { DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE } from '#core/constants'
import { shownTextSlice } from '#core/text/case'
import { ELLIPSIS } from '#core/text/ellipsis'
-import { fontManager, weightToStyle } from '#core/text/fonts'
+import { fontManager } from '#core/text/fonts'
import type { ParagraphNode } from './inputs'
diff --git a/packages/core/src/canvas/text/placed.ts b/packages/core/src/canvas/text/placed.ts
index 1777767f1..1e4e3250e 100644
--- a/packages/core/src/canvas/text/placed.ts
+++ b/packages/core/src/canvas/text/placed.ts
@@ -2,6 +2,7 @@ import type { Paragraph } from 'canvaskit-wasm'
import { uniq } from 'es-toolkit/array'
import type { SceneNode } from '@open-pencil/scene-graph'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
import { loadedFace, resolveParagraphFontFamilies } from '#core/canvas/text/font-families'
import { laidOutText } from '#core/canvas/text/keycap'
@@ -10,7 +11,7 @@ import { textFontVariations } from '#core/canvas/text/paragraph'
import { utf16IndicesByUtf8 } from '#core/canvas/text/utf8'
import { DEFAULT_FONT_FAMILY } from '#core/constants'
import { ELLIPSIS } from '#core/text/ellipsis'
-import { fontManager, weightToStyle } from '#core/text/fonts'
+import { fontManager } from '#core/text/fonts'
import { glyphOutlineSourceSync, type GlyphOutlineSource } from '#core/text/opentype'
type GlyphRun = ReturnType<Paragraph['getShapedLines']>[number]['runs'][number]
diff --git a/packages/core/src/canvas/text/sticky-placeholder.ts b/packages/core/src/canvas/text/sticky-placeholder.ts
index 43caa10cb..5f9ec1608 100644
--- a/packages/core/src/canvas/text/sticky-placeholder.ts
+++ b/packages/core/src/canvas/text/sticky-placeholder.ts
@@ -1,6 +1,6 @@
-import { generatedFrameOwner, stickySublayers } from '@open-pencil/scene-graph'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import { BLACK } from '@open-pencil/scene-graph/constants'
+import { generatedFrameOwner, stickySublayers } from '@open-pencil/scene-graph/generated'
/**
* The body of an empty sticky note as an editing canvas draws it: `placeholder`, in the
diff --git a/packages/core/src/clipboard.ts b/packages/core/src/clipboard.ts
index 5a7389c4d..13e88b1d1 100644
--- a/packages/core/src/clipboard.ts
+++ b/packages/core/src/clipboard.ts
@@ -3,23 +3,20 @@ import {
encodeFigmaClipboard,
type FigmaClipboardAssetType
} from '@open-pencil/fig/clipboard'
-import { randomInt } from '@open-pencil/scene-graph/random'
-export {
- parseFigmaClipboard,
- figmaNodesBounds,
- type FigmaClipboardAssetType
-} from '@open-pencil/fig/clipboard'
-import { placeSlotContent, type FigNodeChangeExportRuntime } from '@open-pencil/fig/node-change'
-import { initCodec } from '@open-pencil/kiwi/fig/codec'
-import type { GUID, NodeChange as KiwiNodeChange } from '@open-pencil/kiwi/fig/codec'
import {
- derivedAssetKey,
- derivedAssetVersion,
- ownsSlotContent,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ placeSlotContent,
+ type FigNodeChangeExportRuntime,
+ sceneNodeToKiwi,
+ makeDocumentNodeChange,
+ makeCanvasNodeChange
+} from '@open-pencil/fig/node-change'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import { initCodec, type NodeChange as KiwiNodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { derivedAssetKey, derivedAssetVersion } from '@open-pencil/scene-graph/asset-keys'
import { fractionalPosition } from '@open-pencil/scene-graph/order-keys'
+import { randomInt } from '@open-pencil/scene-graph/random'
+import { ownsSlotContent } from '@open-pencil/scene-graph/slots'
import {
collectComponentPropertyIds,
@@ -34,12 +31,7 @@ import {
import { withFigExportRuntime } from './canvas/text/shape'
import { prepareClipboardImport } from './clipboard/fig-import'
-import {
- sceneNodeToKiwi,
- makeDocumentNodeChange,
- makeCanvasNodeChange,
- buildFontDigestMap
-} from './kiwi/fig/node-change/serialize'
+import { buildFontDigestMap } from './kiwi/fig/node-change/serialize'
import { cloneSceneGraphForFigExport } from './kiwi/fig/parse/transfer'
export async function prefetchFigmaSchema(): Promise<void> {
diff --git a/packages/core/src/clipboard/fig-import.ts b/packages/core/src/clipboard/fig-import.ts
index 6c9747075..ebc2b54b1 100644
--- a/packages/core/src/clipboard/fig-import.ts
+++ b/packages/core/src/clipboard/fig-import.ts
@@ -1,12 +1,12 @@
import { materializeFigFragment } from '@open-pencil/fig'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { SceneGraph } from '@open-pencil/scene-graph'
import {
captureTransferredState,
removeGraphTransfer,
applyGraphTransfer,
- prepareGraphTransfer,
- type SceneGraph
-} from '@open-pencil/scene-graph'
+ prepareGraphTransfer
+} from '@open-pencil/scene-graph/transfer'
/** Interpret in isolation before any destination mutation. */
export function prepareClipboardImport(
diff --git a/packages/core/src/clipboard/openpencil.ts b/packages/core/src/clipboard/openpencil.ts
index 9beaedc6b..d8a5804eb 100644
--- a/packages/core/src/clipboard/openpencil.ts
+++ b/packages/core/src/clipboard/openpencil.ts
@@ -2,18 +2,20 @@ import { deflateSync, inflateSync } from 'fflate'
import { fromUint8Array, isValid, toUint8Array } from 'js-base64'
import * as v from 'valibot'
+import type {
+ GeometryPath,
+ NodeType,
+ SceneGraph,
+ SceneNode,
+ WindingRule
+} from '@open-pencil/scene-graph'
import {
createInstanceOverrideState,
deserializeInstanceOverrideState,
serializeInstanceOverrideState,
setInstanceOverride,
- type InstanceOverrideState,
- type GeometryPath,
- type NodeType,
- type SceneGraph,
- type SceneNode,
- type WindingRule
-} from '@open-pencil/scene-graph'
+ type InstanceOverrideState
+} from '@open-pencil/scene-graph/instances/overrides'
import type { JSONObject } from '@open-pencil/scene-graph/primitives'
import type { ClipboardSnapshot } from '#core/editor/clipboard/copy'
diff --git a/packages/core/src/design-jsx/placement.ts b/packages/core/src/design-jsx/placement.ts
index bf41c9e13..1d3e9515d 100644
--- a/packages/core/src/design-jsx/placement.ts
+++ b/packages/core/src/design-jsx/placement.ts
@@ -64,7 +64,7 @@ export function finishRenderPlacement(
): void {
if (placement.insertIndex !== undefined) {
for (const [offset, result] of results.entries()) {
- graph.reorderChild(result.id, placement.parentId, placement.insertIndex + offset)
+ graph.insertChildAt(result.id, placement.parentId, placement.insertIndex + offset)
}
}
if (placement.replaceId) graph.deleteNode(placement.replaceId)
diff --git a/packages/core/src/editor/clipboard.ts b/packages/core/src/editor/clipboard.ts
index 3c09ee231..5d5d3cecd 100644
--- a/packages/core/src/editor/clipboard.ts
+++ b/packages/core/src/editor/clipboard.ts
@@ -1,15 +1,13 @@
import { uniq } from 'es-toolkit'
-import {
- attachedConnectors,
- CommittedGraphEventError,
- cycleSafeParent
-} from '@open-pencil/scene-graph'
-import type { SceneNode } from '@open-pencil/scene-graph'
+import { parseFigmaClipboard } from '@open-pencil/fig/clipboard'
+import { CommittedGraphEventError, type SceneNode } from '@open-pencil/scene-graph'
+import { attachedConnectors } from '@open-pencil/scene-graph/connectors'
import { getAxisAlignedBoundsInParent } from '@open-pencil/scene-graph/coordinate'
+import { cycleSafeParent } from '@open-pencil/scene-graph/instances'
import type { Rect, Vector } from '@open-pencil/scene-graph/primitives'
-import { parseFigmaClipboard, parseOpenPencilClipboard } from '#core/clipboard'
+import { parseOpenPencilClipboard } from '#core/clipboard'
import { prepareClipboardImport } from '#core/clipboard/fig-import'
import { computeAllLayouts } from '#core/layout'
diff --git a/packages/core/src/editor/clipboard/assets.ts b/packages/core/src/editor/clipboard/assets.ts
index 652594377..a10d338e5 100644
--- a/packages/core/src/editor/clipboard/assets.ts
+++ b/packages/core/src/editor/clipboard/assets.ts
@@ -2,12 +2,12 @@ import { sumBy } from 'es-toolkit'
import type { Fill } from '@open-pencil/scene-graph'
import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
+import { computeImageHash } from '@open-pencil/scene-graph/images'
import Matrix from '@open-pencil/scene-graph/matrix'
import { TRANSPARENT } from '#core/constants'
import { resolvePasteTarget } from '#core/editor/clipboard/paste/target'
import type { EditorContext } from '#core/editor/types'
-import { computeImageHash } from '#core/figma-api'
import {
createSVGNodesFromImport,
isSVGMarkup,
diff --git a/packages/core/src/editor/clipboard/history.ts b/packages/core/src/editor/clipboard/history.ts
index fc8d972af..89a4cbcc4 100644
--- a/packages/core/src/editor/clipboard/history.ts
+++ b/packages/core/src/editor/clipboard/history.ts
@@ -27,6 +27,6 @@ export function restoreDeletedEntries(ctx: EditorContext, entries: DeletedEntry[
for (const { id, parentId, index, subtree } of [...entries].reverse()) {
const rootSnap = subtree.get(id)
if (rootSnap) restoreSubtree(ctx.graph, rootSnap, parentId, subtree)
- if (index >= 0) ctx.graph.reorderChild(id, parentId, index)
+ if (index >= 0) ctx.graph.insertChildAt(id, parentId, index)
}
}
diff --git a/packages/core/src/editor/clipboard/paste/properties.ts b/packages/core/src/editor/clipboard/paste/properties.ts
index d24b55b86..a7f0746e5 100644
--- a/packages/core/src/editor/clipboard/paste/properties.ts
+++ b/packages/core/src/editor/clipboard/paste/properties.ts
@@ -1,20 +1,18 @@
import { omitBy, pick } from 'es-toolkit/object'
import { materializeFigFragment } from '@open-pencil/fig'
+import { parseFigmaClipboard } from '@open-pencil/fig/clipboard'
+import type { SceneGraph, SceneNode, StyleRun } from '@open-pencil/scene-graph'
import {
AUTO_LAYOUT_FIELDS,
CORNER_FIELDS,
PAINT_FIELDS,
STROKE_FIELDS,
- STYLE_LINK_FIELDS,
- TEXT_STYLE_FIELDS,
- sharedStyleRefKey,
- type SceneGraph,
- type SceneNode,
- type StyleRun
-} from '@open-pencil/scene-graph'
-
-import { parseFigmaClipboard, parseOpenPencilClipboard } from '#core/clipboard'
+ TEXT_STYLE_FIELDS
+} from '@open-pencil/scene-graph/fields'
+import { STYLE_LINK_FIELDS, sharedStyleRefKey } from '@open-pencil/scene-graph/shared-styles'
+
+import { parseOpenPencilClipboard } from '#core/clipboard'
import { importClipboardDependenciesWithUndo } from '#core/editor/clipboard/dependencies'
import type { ClipboardSnapshot } from '#core/editor/clipboard/snapshot'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/clipboard/paste/replace.ts b/packages/core/src/editor/clipboard/paste/replace.ts
index ef8509bca..7391859c7 100644
--- a/packages/core/src/editor/clipboard/paste/replace.ts
+++ b/packages/core/src/editor/clipboard/paste/replace.ts
@@ -44,7 +44,7 @@ function reorderCreatedAtReplacementIndex(
// A paste that could not go into the target's parent, such as an instance of a component
// the parent is inside, stays in the ancestor it went to.
if (ctx.graph.getNode(created[i])?.parentId !== insertParentId) continue
- ctx.graph.reorderChild(created[i], insertParentId, insertIndex + i)
+ ctx.graph.insertChildAt(created[i], insertParentId, insertIndex + i)
}
}
diff --git a/packages/core/src/editor/clipboard/snapshot.ts b/packages/core/src/editor/clipboard/snapshot.ts
index 80e872f64..25a305503 100644
--- a/packages/core/src/editor/clipboard/snapshot.ts
+++ b/packages/core/src/editor/clipboard/snapshot.ts
@@ -1,4 +1,5 @@
-import { styleRunReferences, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { styleRunReferences } from '@open-pencil/scene-graph/text'
import { clipboardPlacement, type ClipboardPlacement } from './placement'
import { captureClipboardVariables, type ClipboardVariables } from './variables'
diff --git a/packages/core/src/editor/clipboard/variables.ts b/packages/core/src/editor/clipboard/variables.ts
index a7b1c6dd2..70f1c26fc 100644
--- a/packages/core/src/editor/clipboard/variables.ts
+++ b/packages/core/src/editor/clipboard/variables.ts
@@ -1,14 +1,10 @@
+import type { SceneGraph, SceneNode, Variable, VariableCollection } from '@open-pencil/scene-graph'
+import { remapStyleRunReferences, styleRunReferences } from '@open-pencil/scene-graph/text'
import {
isUnsupportedVariableValue,
- remapStyleRunReferences,
mapVariableValueReferences,
- variableValueReferences,
- styleRunReferences,
- type SceneGraph,
- type SceneNode,
- type Variable,
- type VariableCollection
-} from '@open-pencil/scene-graph'
+ variableValueReferences
+} from '@open-pencil/scene-graph/variables'
export interface ClipboardVariables {
activeModes: Array<[string, string]>
diff --git a/packages/core/src/editor/components/authoring/index.ts b/packages/core/src/editor/components/authoring/index.ts
index ea9e4a792..f8498cdde 100644
--- a/packages/core/src/editor/components/authoring/index.ts
+++ b/packages/core/src/editor/components/authoring/index.ts
@@ -1,13 +1,13 @@
import { isEqual } from 'es-toolkit'
+import type { ComponentPropertyDefinition, SceneNode } from '@open-pencil/scene-graph'
import {
createComponentPropertyId,
exposableInstances,
instanceExposureIssue,
removeComponentProperty,
resolveComponentPropertyValue
-} from '@open-pencil/scene-graph'
-import type { ComponentPropertyDefinition, SceneNode } from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/components'
import { assertNodeEditable } from '#core/editor/capabilities'
import { reorderPropertyDefinitions } from '#core/editor/components/variants/definitions'
diff --git a/packages/core/src/editor/components/authoring/text-edit.ts b/packages/core/src/editor/components/authoring/text-edit.ts
index 170a83beb..73deddab5 100644
--- a/packages/core/src/editor/components/authoring/text-edit.ts
+++ b/packages/core/src/editor/components/authoring/text-edit.ts
@@ -1,12 +1,12 @@
import { pick } from 'es-toolkit/object'
+import type { SceneNode } from '@open-pencil/scene-graph'
import {
applyComponentPropertyValue,
- cloneInstanceOverrideState,
componentPropertyDefinitions,
findComponentPropertyTargets
-} from '@open-pencil/scene-graph'
-import type { SceneNode } from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/components'
+import { cloneInstanceOverrideState } from '@open-pencil/scene-graph/instances/overrides'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/components/authoring/values.ts b/packages/core/src/editor/components/authoring/values.ts
index a0e752b15..47e9e0174 100644
--- a/packages/core/src/editor/components/authoring/values.ts
+++ b/packages/core/src/editor/components/authoring/values.ts
@@ -1,5 +1,6 @@
-import { canCreateInstance, resolveComponentPropertyValue } from '@open-pencil/scene-graph'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { resolveComponentPropertyValue } from '@open-pencil/scene-graph/components'
+import { canCreateInstance } from '@open-pencil/scene-graph/instances'
import { pathTextEditChanges } from '#core/editor/text/path-edit'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/components/authoring/visibility-edit.ts b/packages/core/src/editor/components/authoring/visibility-edit.ts
index 4dae52554..d3679eef3 100644
--- a/packages/core/src/editor/components/authoring/visibility-edit.ts
+++ b/packages/core/src/editor/components/authoring/visibility-edit.ts
@@ -1,12 +1,12 @@
import { isEqual } from 'es-toolkit/predicate'
+import type { SceneNode } from '@open-pencil/scene-graph'
import {
applyComponentPropertyValue,
- cloneInstanceOverrideState,
componentPropertyDefinitions,
findComponentPropertyTargets
-} from '@open-pencil/scene-graph'
-import type { SceneNode } from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/components'
+import { cloneInstanceOverrideState } from '@open-pencil/scene-graph/instances/overrides'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/components/behaviours/complete.ts b/packages/core/src/editor/components/behaviours/complete.ts
index 91a48e912..58a7ffe1a 100644
--- a/packages/core/src/editor/components/behaviours/complete.ts
+++ b/packages/core/src/editor/components/behaviours/complete.ts
@@ -1,12 +1,12 @@
+import type { SceneNode } from '@open-pencil/scene-graph'
import {
- createComponentPropertyId,
- createSlotProperty,
INTERACTION_STATES,
readBehaviour,
type Behaviour,
- type InteractionState,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type InteractionState
+} from '@open-pencil/scene-graph/behaviours'
+import { createComponentPropertyId } from '@open-pencil/scene-graph/components'
+import { createSlotProperty } from '@open-pencil/scene-graph/slots'
import { recordSubtreeEdit } from '#core/editor/components/slots/history'
import { VARIANT_SET_PADDING, variantSetProps } from '#core/editor/components/variant-set'
diff --git a/packages/core/src/editor/components/behaviours/index.ts b/packages/core/src/editor/components/behaviours/index.ts
index 9b683588c..f788e0394 100644
--- a/packages/core/src/editor/components/behaviours/index.ts
+++ b/packages/core/src/editor/components/behaviours/index.ts
@@ -1,4 +1,4 @@
-import { readBehaviour, withBehaviour, type Behaviour } from '@open-pencil/scene-graph'
+import { readBehaviour, withBehaviour, type Behaviour } from '@open-pencil/scene-graph/behaviours'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/components/instances.ts b/packages/core/src/editor/components/instances.ts
index e2cd6819d..6d405a34f 100644
--- a/packages/core/src/editor/components/instances.ts
+++ b/packages/core/src/editor/components/instances.ts
@@ -1,7 +1,9 @@
-import { canCreateInstance, cloneInstanceOverrideState } from '@open-pencil/scene-graph'
-import type { SceneNode, Vector } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
import { getAxisAlignedWorldBounds, getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
+import { canCreateInstance } from '@open-pencil/scene-graph/instances'
+import { cloneInstanceOverrideState } from '@open-pencil/scene-graph/instances/overrides'
import Matrix from '@open-pencil/scene-graph/matrix'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import { prepareSlotEdits } from '#core/editor/components/slots'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/components/properties.ts b/packages/core/src/editor/components/properties.ts
index a1af6fece..acd3364a3 100644
--- a/packages/core/src/editor/components/properties.ts
+++ b/packages/core/src/editor/components/properties.ts
@@ -1,16 +1,15 @@
+import type { ComponentPropertyDefinition, SceneNode } from '@open-pencil/scene-graph'
import {
applyComponentPropertyValue,
- cloneInstanceOverrideState,
componentPropertyDefinitions,
findComponentPropertyTargets,
resolveComponentPropertyValue,
+ type ComponentPropertyTarget
+} from '@open-pencil/scene-graph/components'
+import {
+ cloneInstanceOverrideState,
setInstanceOverride
-} from '@open-pencil/scene-graph'
-import type {
- ComponentPropertyDefinition,
- ComponentPropertyTarget,
- SceneNode
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/instances/overrides'
import { assertNodeEditable } from '#core/editor/capabilities'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/components/slots/authoring.ts b/packages/core/src/editor/components/slots/authoring.ts
index e2c6e8e0f..f231f641a 100644
--- a/packages/core/src/editor/components/slots/authoring.ts
+++ b/packages/core/src/editor/components/slots/authoring.ts
@@ -1,14 +1,16 @@
+import type { SceneNode } from '@open-pencil/scene-graph'
+import {
+ removeComponentProperty,
+ createComponentPropertyId
+} from '@open-pencil/scene-graph/components'
import {
canCreateSlot,
createSlotProperty,
- removeComponentProperty,
slotOwner,
slotPropertyId,
updateSlotProperty,
- type SceneNode,
- type SlotPropertyPatch,
- createComponentPropertyId
-} from '@open-pencil/scene-graph'
+ type SlotPropertyPatch
+} from '@open-pencil/scene-graph/slots'
import { wrapInAutoLayout } from '#core/editor/structure/auto-layout-wrap'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/components/slots/index.ts b/packages/core/src/editor/components/slots/index.ts
index 4a52d82c3..2b0c746d7 100644
--- a/packages/core/src/editor/components/slots/index.ts
+++ b/packages/core/src/editor/components/slots/index.ts
@@ -5,7 +5,7 @@ import {
resetSlotContent,
slotScope,
type SlotScope
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/slots'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/components/variant-set.ts b/packages/core/src/editor/components/variant-set.ts
index 64eef3442..2ee04d17c 100644
--- a/packages/core/src/editor/components/variant-set.ts
+++ b/packages/core/src/editor/components/variant-set.ts
@@ -1,9 +1,5 @@
-import {
- createComponentPropertyId,
- type SceneGraph,
- type SceneNode,
- type Stroke
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode, Stroke } from '@open-pencil/scene-graph'
+import { createComponentPropertyId } from '@open-pencil/scene-graph/components'
import { getAxisAlignedBoundsInParent } from '@open-pencil/scene-graph/coordinate'
import { copyStrokes } from '@open-pencil/scene-graph/copy'
import { deriveVariantProperties } from '@open-pencil/scene-graph/variant-properties'
diff --git a/packages/core/src/editor/components/variants/add.ts b/packages/core/src/editor/components/variants/add.ts
index 65b567c84..32f3974c4 100644
--- a/packages/core/src/editor/components/variants/add.ts
+++ b/packages/core/src/editor/components/variants/add.ts
@@ -1,4 +1,5 @@
-import { createComponentPropertyId, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { createComponentPropertyId } from '@open-pencil/scene-graph/components'
import { buildVariantName } from '@open-pencil/scene-graph/variant-name'
import { assertNodeEditable } from '#core/editor/capabilities'
diff --git a/packages/core/src/editor/components/variants/definitions.ts b/packages/core/src/editor/components/variants/definitions.ts
index 003429cfa..716ea22e6 100644
--- a/packages/core/src/editor/components/variants/definitions.ts
+++ b/packages/core/src/editor/components/variants/definitions.ts
@@ -5,7 +5,7 @@ import type {
ComponentPropertyType,
SceneGraph
} from '@open-pencil/scene-graph'
-import { createComponentPropertyId } from '@open-pencil/scene-graph'
+import { createComponentPropertyId } from '@open-pencil/scene-graph/components'
import { assertNodeEditable } from '#core/editor/capabilities'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/components/variants/model.ts b/packages/core/src/editor/components/variants/model.ts
index f298b411e..c6218d24f 100644
--- a/packages/core/src/editor/components/variants/model.ts
+++ b/packages/core/src/editor/components/variants/model.ts
@@ -1,12 +1,7 @@
import { uniq } from 'es-toolkit/array'
-import {
- compareCanvasPosition,
- defaultVariant,
- type ComponentPropertyDefinition,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { ComponentPropertyDefinition, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { compareCanvasPosition, defaultVariant } from '@open-pencil/scene-graph/components'
export type VariantConflict = {
values: Record<string, string>
diff --git a/packages/core/src/editor/connectors/attach.ts b/packages/core/src/editor/connectors/attach.ts
index ba4cc2468..102687d44 100644
--- a/packages/core/src/editor/connectors/attach.ts
+++ b/packages/core/src/editor/connectors/attach.ts
@@ -1,13 +1,12 @@
import { minBy } from 'es-toolkit'
-import {
- boundEndpoint,
- freeEndpoint,
- type ConnectorEndpoint,
- type ConnectorMagnet,
- type SceneGraph,
- type SceneNode
+import type {
+ ConnectorEndpoint,
+ ConnectorMagnet,
+ SceneGraph,
+ SceneNode
} from '@open-pencil/scene-graph'
+import { boundEndpoint, freeEndpoint } from '@open-pencil/scene-graph/connectors'
import { getAxisAlignedBoundsInParent, getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import Matrix from '@open-pencil/scene-graph/matrix'
import type { Rect, Vector } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/core/src/editor/connectors/draw.ts b/packages/core/src/editor/connectors/draw.ts
index b3651941f..15e981d38 100644
--- a/packages/core/src/editor/connectors/draw.ts
+++ b/packages/core/src/editor/connectors/draw.ts
@@ -1,4 +1,5 @@
-import { createConnector, layoutConnector, type ConnectorEndpoint } from '@open-pencil/scene-graph'
+import type { ConnectorEndpoint } from '@open-pencil/scene-graph'
+import { createConnector, layoutConnector } from '@open-pencil/scene-graph/connectors'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import { connectorAttachment, type ConnectorTarget } from '#core/editor/connectors/attach'
diff --git a/packages/core/src/editor/connectors/routing.ts b/packages/core/src/editor/connectors/routing.ts
index 63a439ce2..f25ccb371 100644
--- a/packages/core/src/editor/connectors/routing.ts
+++ b/packages/core/src/editor/connectors/routing.ts
@@ -1,19 +1,16 @@
import { isEqual, pick } from 'es-toolkit'
+import type { ConnectorEndpoint, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
connectorRouteEnds,
connectorsAffectedBy,
freeEndpoint,
- generatedFrameOwner,
- layoutConnector,
- SIZE_FIELDS,
- TRANSFORM_FIELDS,
- type ConnectorEndpoint,
- type SceneGraph,
- type SceneNode,
- type UndoEntry
-} from '@open-pencil/scene-graph'
+ layoutConnector
+} from '@open-pencil/scene-graph/connectors'
+import { SIZE_FIELDS, TRANSFORM_FIELDS } from '@open-pencil/scene-graph/fields'
+import { generatedFrameOwner } from '@open-pencil/scene-graph/generated'
import type { Vector } from '@open-pencil/scene-graph/primitives'
+import type { UndoEntry } from '@open-pencil/scene-graph/undo'
import type { EditorContext } from '#core/editor/types'
import { routeUnroutedConnectors } from '#core/layout'
diff --git a/packages/core/src/editor/connectors/style.ts b/packages/core/src/editor/connectors/style.ts
index a67ca5199..21c317a96 100644
--- a/packages/core/src/editor/connectors/style.ts
+++ b/packages/core/src/editor/connectors/style.ts
@@ -1,17 +1,18 @@
+import type {
+ ConnectorEndpoint,
+ ConnectorLineType,
+ SceneNode,
+ StrokeCap
+} from '@open-pencil/scene-graph'
import {
CONNECTOR_STROKE_WEIGHT,
CONNECTOR_THICK_STROKE_WEIGHT,
connectorLineStyleFields,
connectorSublayers,
- figJamColor,
layoutConnector,
- type ConnectorEndpoint,
- type ConnectorLineStyle,
- type FigJamColorName,
- type ConnectorLineType,
- type SceneNode,
- type StrokeCap
-} from '@open-pencil/scene-graph'
+ type ConnectorLineStyle
+} from '@open-pencil/scene-graph/connectors'
+import { figJamColor, type FigJamColorName } from '@open-pencil/scene-graph/figjam'
import { recordSubtreeEdit } from '#core/editor/components/slots/history'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/fig-compression.ts b/packages/core/src/editor/fig-compression.ts
index b135f5f13..b18b7c3cf 100644
--- a/packages/core/src/editor/fig-compression.ts
+++ b/packages/core/src/editor/fig-compression.ts
@@ -1,9 +1,8 @@
import {
DEFAULT_FIG_COMPRESSION,
- OPEN_PENCIL_PLUGIN_DATA,
- withPluginData,
type FigCompression
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/fig-compression'
+import { OPEN_PENCIL_PLUGIN_DATA, withPluginData } from '@open-pencil/scene-graph/plugin-data'
import { figCompressionOf } from '#core/io/formats/fig/compression'
diff --git a/packages/core/src/editor/graph-events.ts b/packages/core/src/editor/graph-events.ts
index e0f166dfb..e2e33f0a2 100644
--- a/packages/core/src/editor/graph-events.ts
+++ b/packages/core/src/editor/graph-events.ts
@@ -1,9 +1,5 @@
-import {
- TRANSFORM_FIELDS,
- type SceneGraph,
- type SceneGraphEvents,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneGraphEvents, SceneNode } from '@open-pencil/scene-graph'
+import { TRANSFORM_FIELDS } from '@open-pencil/scene-graph/fields'
import type { SkiaRenderer } from '#core/canvas/renderer'
import { markFlowChanged } from '#core/layout/derived'
diff --git a/packages/core/src/editor/history/atomic-tool.ts b/packages/core/src/editor/history/atomic-tool.ts
index aa007c44f..49d02e76f 100644
--- a/packages/core/src/editor/history/atomic-tool.ts
+++ b/packages/core/src/editor/history/atomic-tool.ts
@@ -1,9 +1,5 @@
-import {
- captureGraphCheckpoint,
- type SceneGraph,
- type SceneNode,
- type Variable
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode, Variable } from '@open-pencil/scene-graph'
+import { captureGraphCheckpoint } from '@open-pencil/scene-graph/checkpoint'
import type { Editor } from '#core/editor/create'
import { ReadOnlyDocumentError } from '#core/editor/read-only'
diff --git a/packages/core/src/editor/history/document-change.ts b/packages/core/src/editor/history/document-change.ts
index 82aeaebee..924456c06 100644
--- a/packages/core/src/editor/history/document-change.ts
+++ b/packages/core/src/editor/history/document-change.ts
@@ -1,17 +1,19 @@
import { isEqual } from 'es-toolkit'
+import type {
+ FigmaSourcePayload,
+ SceneGraph,
+ SceneNode,
+ SourceMetadata,
+ Variable,
+ VariableCollection
+} from '@open-pencil/scene-graph'
+import { withLiveComments } from '@open-pencil/scene-graph/comments'
+import { cloneInstanceOverrideState } from '@open-pencil/scene-graph/instances/overrides'
import {
- cloneInstanceOverrideState,
createSceneMutationImpact,
- recordSceneMutations,
- withLiveComments,
- type FigmaSourcePayload,
- type SceneGraph,
- type SceneNode,
- type SourceMetadata,
- type Variable,
- type VariableCollection
-} from '@open-pencil/scene-graph'
+ recordSceneMutations
+} from '@open-pencil/scene-graph/mutation-impact'
import type { EditorContext } from '#core/editor/types'
import { computeAllLayouts } from '#core/layout'
diff --git a/packages/core/src/editor/history/snapshot/page.ts b/packages/core/src/editor/history/snapshot/page.ts
index c2d632f9d..40048fddf 100644
--- a/packages/core/src/editor/history/snapshot/page.ts
+++ b/packages/core/src/editor/history/snapshot/page.ts
@@ -48,7 +48,7 @@ function restoreChildren(
if (!snap) continue
const { parentId: _snapParentId, childIds: snapChildIds, ...rest } = snap
graph.createNode(snap.type, parentId, { ...rest, childIds: [] })
- graph.reorderChild(snap.id, parentId, childIds.indexOf(childId))
+ graph.insertChildAt(snap.id, parentId, childIds.indexOf(childId))
restoreChildren(graph, snapshot, snap.id, snapChildIds)
}
}
diff --git a/packages/core/src/editor/icons.ts b/packages/core/src/editor/icons.ts
index 81374bb4c..489ac2dbe 100644
--- a/packages/core/src/editor/icons.ts
+++ b/packages/core/src/editor/icons.ts
@@ -1,5 +1,6 @@
-import { readIcon, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
import { BLACK } from '@open-pencil/scene-graph/constants'
+import { readIcon } from '@open-pencil/scene-graph/icons'
import type { Color } from '@open-pencil/scene-graph/primitives'
import { restoreSubtree, snapshotSubtree } from '#core/editor/history/subtree'
diff --git a/packages/core/src/editor/index.ts b/packages/core/src/editor/index.ts
index 2cd4280ab..6519bb7d9 100644
--- a/packages/core/src/editor/index.ts
+++ b/packages/core/src/editor/index.ts
@@ -37,7 +37,6 @@ export type { ShaderRasterizer } from './shaders/types'
export type { ShaderPaintList } from './shaders/actions'
export type { Editor } from './create'
export type { VariableTokenFields } from './variables'
-export type { TokenImportResult } from '#core/io/formats/design-tokens'
export { reapplyInstanceComponentProperties } from './components/properties'
export { createGuideActions } from './guides'
export { createTextActions } from './text'
diff --git a/packages/core/src/editor/line-ends.ts b/packages/core/src/editor/line-ends.ts
index 78ae0976a..9f40c7c18 100644
--- a/packages/core/src/editor/line-ends.ts
+++ b/packages/core/src/editor/line-ends.ts
@@ -1,4 +1,5 @@
-import { layerRotates, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { layerRotates } from '@open-pencil/scene-graph/generated'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import type { NodePreview } from '#core/editor/node-preview'
diff --git a/packages/core/src/editor/nodes.ts b/packages/core/src/editor/nodes.ts
index bcfceade2..b0081d698 100644
--- a/packages/core/src/editor/nodes.ts
+++ b/packages/core/src/editor/nodes.ts
@@ -1,12 +1,9 @@
import { pick } from 'es-toolkit/object'
-import {
- styleDetachmentChanges,
- findInstanceAncestor,
- cloneInstanceOverrideState,
- recordInstanceOverride,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { findInstanceAncestor, recordInstanceOverride } from '@open-pencil/scene-graph/instances'
+import { cloneInstanceOverrideState } from '@open-pencil/scene-graph/instances/overrides'
+import { styleDetachmentChanges } from '@open-pencil/scene-graph/shared-styles'
import { textAutoResizeChanges } from '#core/layout/text-auto-resize'
import { reconcileVariableLayouts } from '#core/layout/variables'
diff --git a/packages/core/src/editor/nudge.ts b/packages/core/src/editor/nudge.ts
index 820e36423..3a718f301 100644
--- a/packages/core/src/editor/nudge.ts
+++ b/packages/core/src/editor/nudge.ts
@@ -54,7 +54,7 @@ export function createNudgeActions(ctx: EditorContext) {
let nudgeCommitTimer: ReturnType<typeof setTimeout> | null = null
function applyOrder(parentId: string, order: readonly string[]) {
- order.forEach((id, index) => ctx.graph.reorderChild(id, parentId, index))
+ order.forEach((id, index) => ctx.graph.insertChildAt(id, parentId, index))
ctx.runLayoutForNode(parentId)
}
diff --git a/packages/core/src/editor/pages.ts b/packages/core/src/editor/pages.ts
index 3cf364676..a38875b2c 100644
--- a/packages/core/src/editor/pages.ts
+++ b/packages/core/src/editor/pages.ts
@@ -1,6 +1,7 @@
import { limitAsync } from 'es-toolkit/promise'
-import { instanceMainComponent, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { instanceMainComponent } from '@open-pencil/scene-graph/instances'
import type { Color } from '@open-pencil/scene-graph/primitives'
import {
diff --git a/packages/core/src/editor/play/islands.ts b/packages/core/src/editor/play/islands.ts
index c31269504..2038c0943 100644
--- a/packages/core/src/editor/play/islands.ts
+++ b/packages/core/src/editor/play/islands.ts
@@ -1,4 +1,5 @@
-import { hasBehaviour, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { hasBehaviour } from '@open-pencil/scene-graph/behaviours'
function containsControl(graph: SceneGraph, node: SceneNode): boolean {
if (hasBehaviour(graph, node)) return true
diff --git a/packages/core/src/editor/play/states.ts b/packages/core/src/editor/play/states.ts
index c0513efad..735341ca6 100644
--- a/packages/core/src/editor/play/states.ts
+++ b/packages/core/src/editor/play/states.ts
@@ -1,11 +1,10 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { findLayerByPath } from '@open-pencil/scene-graph/behaviours'
import {
applyComponentPropertyValue,
- componentPropertyDefinitions,
- findLayerByPath,
- resolvedPaintBindings,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ componentPropertyDefinitions
+} from '@open-pencil/scene-graph/components'
+import { resolvedPaintBindings } from '@open-pencil/scene-graph/variables'
import { extractPageContext, findPageId } from '#core/io/subgraph'
import { computeAllLayouts } from '#core/layout'
diff --git a/packages/core/src/editor/selection.ts b/packages/core/src/editor/selection.ts
index 49f11dc75..5904ec573 100644
--- a/packages/core/src/editor/selection.ts
+++ b/packages/core/src/editor/selection.ts
@@ -1,4 +1,4 @@
-import { generatedFrameOwner } from '@open-pencil/scene-graph'
+import { generatedFrameOwner } from '@open-pencil/scene-graph/generated'
import { createSelectionContainerActions } from './selection/container'
import { createSelectionHitTestActions } from './selection/hit-test'
diff --git a/packages/core/src/editor/selection/colors.ts b/packages/core/src/editor/selection/colors.ts
index fcecf2cf0..0c2b15dde 100644
--- a/packages/core/src/editor/selection/colors.ts
+++ b/packages/core/src/editor/selection/colors.ts
@@ -1,5 +1,6 @@
-import { stickySublayers } from '@open-pencil/scene-graph'
-import type { Color, Fill, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import type { Fill, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { stickySublayers } from '@open-pencil/scene-graph/generated'
+import type { Color } from '@open-pencil/scene-graph/primitives'
/**
* Figma's Selection colors: every solid fill and stroke colour of the selected layers and their
diff --git a/packages/core/src/editor/selection/navigation.ts b/packages/core/src/editor/selection/navigation.ts
index a7b8e4b36..5dab2833c 100644
--- a/packages/core/src/editor/selection/navigation.ts
+++ b/packages/core/src/editor/selection/navigation.ts
@@ -1,4 +1,4 @@
-import { generatedFrameOwner, isGeneratedFrame } from '@open-pencil/scene-graph'
+import { generatedFrameOwner, isGeneratedFrame } from '@open-pencil/scene-graph/generated'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/shaders/actions.ts b/packages/core/src/editor/shaders/actions.ts
index 81ce72da5..ef789487c 100644
--- a/packages/core/src/editor/shaders/actions.ts
+++ b/packages/core/src/editor/shaders/actions.ts
@@ -1,13 +1,12 @@
import { pick } from 'es-toolkit'
+import type { SceneNode, Stroke } from '@open-pencil/scene-graph'
import {
createShaderPaint,
shaderOfPaint,
withShaderPaints,
- type SceneNode,
- type ShaderPreset,
- type Stroke
-} from '@open-pencil/scene-graph'
+ type ShaderPreset
+} from '@open-pencil/scene-graph/shaders'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/shaders/frames.ts b/packages/core/src/editor/shaders/frames.ts
index 665f6756b..e20d5b323 100644
--- a/packages/core/src/editor/shaders/frames.ts
+++ b/packages/core/src/editor/shaders/frames.ts
@@ -1,5 +1,7 @@
import { isEqual } from 'es-toolkit/predicate'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import type { Size } from '@open-pencil/scene-graph/primitives'
import {
isShaderFrameCurrent,
readShaderPaints,
@@ -7,10 +9,8 @@ import {
shaderOfPaint,
shaderPresetKey,
withShaderPaints,
- type SceneNode,
type ShaderPaint
-} from '@open-pencil/scene-graph'
-import type { Size } from '@open-pencil/scene-graph/primitives'
+} from '@open-pencil/scene-graph/shaders'
import type { EditorContext, EditorOptions } from '#core/editor/types'
diff --git a/packages/core/src/editor/shaders/types.ts b/packages/core/src/editor/shaders/types.ts
index ab3a04770..cc283f7bd 100644
--- a/packages/core/src/editor/shaders/types.ts
+++ b/packages/core/src/editor/shaders/types.ts
@@ -1,5 +1,5 @@
-import type { ShaderPreset } from '@open-pencil/scene-graph'
import type { Size } from '@open-pencil/scene-graph/primitives'
+import type { ShaderPreset } from '@open-pencil/scene-graph/shaders'
/**
* Draws a shader's still frame. Core has no GPU or DOM, so the canvas that has them supplies
diff --git a/packages/core/src/editor/shapes.ts b/packages/core/src/editor/shapes.ts
index 98201d773..417e1e05c 100644
--- a/packages/core/src/editor/shapes.ts
+++ b/packages/core/src/editor/shapes.ts
@@ -1,4 +1,5 @@
-import { createShapeWithText, type NodeType, type SceneNode } from '@open-pencil/scene-graph'
+import type { NodeType, SceneNode } from '@open-pencil/scene-graph'
+import { createShapeWithText } from '@open-pencil/scene-graph/generated'
import { prepareSlotEdits } from './components/slots'
import { restoreSubtree, snapshotSubtree } from './history/subtree'
diff --git a/packages/core/src/editor/shapes/defaults.ts b/packages/core/src/editor/shapes/defaults.ts
index 6810e9579..3cebb28f9 100644
--- a/packages/core/src/editor/shapes/defaults.ts
+++ b/packages/core/src/editor/shapes/defaults.ts
@@ -1,11 +1,8 @@
import type { Fill, NodeType, SceneNode, Stroke } from '@open-pencil/scene-graph'
-import {
- DEFAULT_STROKE_WEIGHT,
- figJamColor,
- figJamPairedStroke,
- SHAPE_WITH_TEXT_SIZE
-} from '@open-pencil/scene-graph'
+import { DEFAULT_STROKE_WEIGHT } from '@open-pencil/scene-graph/constants'
import { copyFills, copyStrokes } from '@open-pencil/scene-graph/copy'
+import { figJamColor, figJamPairedStroke } from '@open-pencil/scene-graph/figjam'
+import { SHAPE_WITH_TEXT_SIZE } from '@open-pencil/scene-graph/generated'
import {
BLACK,
diff --git a/packages/core/src/editor/shapes/pen.ts b/packages/core/src/editor/shapes/pen.ts
index 076e80484..caffaccad 100644
--- a/packages/core/src/editor/shapes/pen.ts
+++ b/packages/core/src/editor/shapes/pen.ts
@@ -1,12 +1,12 @@
-import {
- cloneVectorNetwork,
- type SceneNode,
- type VectorNetwork,
- type VectorRegion,
- type VectorSegment,
- type VectorVertex
+import type {
+ SceneNode,
+ VectorNetwork,
+ VectorRegion,
+ VectorSegment,
+ VectorVertex
} from '@open-pencil/scene-graph'
import type { Vector } from '@open-pencil/scene-graph/primitives'
+import { cloneVectorNetwork } from '@open-pencil/scene-graph/vector-network'
import { BLACK } from '#core/constants'
import { createVectorFromNetwork, type CreateShape } from '#core/editor/shapes/vector'
diff --git a/packages/core/src/editor/shapes/vector.ts b/packages/core/src/editor/shapes/vector.ts
index 7568cb516..9bc013cef 100644
--- a/packages/core/src/editor/shapes/vector.ts
+++ b/packages/core/src/editor/shapes/vector.ts
@@ -1,10 +1,7 @@
-import {
- transformVectorNetwork,
- type SceneNode,
- type VectorNetwork
-} from '@open-pencil/scene-graph'
+import type { SceneNode, VectorNetwork } from '@open-pencil/scene-graph'
import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import Matrix from '@open-pencil/scene-graph/matrix'
+import { transformVectorNetwork } from '@open-pencil/scene-graph/vector-network'
import type { EditorContext } from '#core/editor/types'
import { computeAccurateBounds } from '#core/vector'
diff --git a/packages/core/src/editor/shapes/with-text.ts b/packages/core/src/editor/shapes/with-text.ts
index 5e38b484d..9608c6daf 100644
--- a/packages/core/src/editor/shapes/with-text.ts
+++ b/packages/core/src/editor/shapes/with-text.ts
@@ -1,3 +1,4 @@
+import type { SceneNode } from '@open-pencil/scene-graph'
import {
figJamColorName,
figJamFillMode,
@@ -6,14 +7,12 @@ import {
figJamShapePaint,
figJamTextSizeFields,
figJamTypeface,
- shapeWithTextFrameFields,
- shapeWithTextLabel,
type FigJamColorName,
type FigJamFillMode,
type FigJamLineStyle,
- type FigJamTextSize,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type FigJamTextSize
+} from '@open-pencil/scene-graph/figjam'
+import { shapeWithTextFrameFields, shapeWithTextLabel } from '@open-pencil/scene-graph/generated'
import type { ShapeWithTextType } from '@open-pencil/scene-graph/shape-with-text'
import { recordSubtreeEdit } from '#core/editor/components/slots/history'
diff --git a/packages/core/src/editor/statuses.ts b/packages/core/src/editor/statuses.ts
index 615e41059..e3daab5aa 100644
--- a/packages/core/src/editor/statuses.ts
+++ b/packages/core/src/editor/statuses.ts
@@ -1,13 +1,15 @@
import {
- cachedStatusWorkflow,
OPEN_PENCIL_PLUGIN_DATA,
readPluginData,
+ withPluginData
+} from '@open-pencil/scene-graph/plugin-data'
+import {
+ cachedStatusWorkflow,
shownStatusState,
statusPlacement,
- withPluginData,
type StatusState,
type StatusWorkflow
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/statuses'
import type { EditorContext } from './types'
diff --git a/packages/core/src/editor/stickies.ts b/packages/core/src/editor/stickies.ts
index 421fe02d9..dabe8df3e 100644
--- a/packages/core/src/editor/stickies.ts
+++ b/packages/core/src/editor/stickies.ts
@@ -1,16 +1,19 @@
+import type { SceneNode } from '@open-pencil/scene-graph'
+import {
+ figJamTextSizeFields,
+ figJamTypeface,
+ type FigJamTextSize
+} from '@open-pencil/scene-graph/figjam'
import {
createSticky,
DEFAULT_STICKY_COLOR,
- rescaleNodeTree,
stickyScale,
stickyWidth,
STICKY_SIZE,
- figJamTextSizeFields,
- figJamTypeface,
stickySublayers
-} from '@open-pencil/scene-graph'
-import type { SceneNode, FigJamTextSize } from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/generated'
import type { Color, Vector } from '@open-pencil/scene-graph/primitives'
+import { rescaleNodeTree } from '@open-pencil/scene-graph/scaling'
import { recordSubtreeEdit } from '#core/editor/components/slots/history'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/structure.ts b/packages/core/src/editor/structure.ts
index 15940ea14..716799f3c 100644
--- a/packages/core/src/editor/structure.ts
+++ b/packages/core/src/editor/structure.ts
@@ -1,11 +1,9 @@
import { pick } from 'es-toolkit'
-import {
- createsComponentCycle,
- generatedFrameKind,
- TRANSFORM_FIELDS,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { TRANSFORM_FIELDS } from '@open-pencil/scene-graph/fields'
+import { generatedFrameKind } from '@open-pencil/scene-graph/generated'
+import { createsComponentCycle } from '@open-pencil/scene-graph/instances'
import { acceptingParent, acceptsChildren, prepareSlotEdits } from '#core/editor/components/slots'
import { fitEnclosingGroupsWithUndo } from '#core/editor/structure/group/bounds'
@@ -136,7 +134,7 @@ export function createStructureActions(ctx: EditorContext) {
forward: move,
inverse: () => {
for (const { id, parentId, index, place } of origins) {
- ctx.graph.reorderChild(id, parentId, index)
+ ctx.graph.insertChildAt(id, parentId, index)
ctx.graph.updateNode(id, place)
}
for (const parentId of parentIds) ctx.runLayoutForNode(parentId)
diff --git a/packages/core/src/editor/structure/auto-layout-wrap.ts b/packages/core/src/editor/structure/auto-layout-wrap.ts
index cc110e164..41aa90cc9 100644
--- a/packages/core/src/editor/structure/auto-layout-wrap.ts
+++ b/packages/core/src/editor/structure/auto-layout-wrap.ts
@@ -77,7 +77,7 @@ export function wrapInAutoLayout(ctx: EditorContext, selectedNodes: SceneNode[])
inverse: () => {
for (const id of sortedIds) ctx.graph.reparentNode(id, parentId)
ctx.graph.deleteNode(frameId)
- order.forEach((id, index) => ctx.graph.reorderChild(id, parentId, index))
+ order.forEach((id, index) => ctx.graph.insertChildAt(id, parentId, index))
for (const [id, rect] of geometry) ctx.graph.updateNode(id, rect)
ctx.runLayoutForNode(parentId)
ctx.setSelectedIds(prevSelection)
diff --git a/packages/core/src/editor/structure/boolean.ts b/packages/core/src/editor/structure/boolean.ts
index 1eed13053..eba4cfb67 100644
--- a/packages/core/src/editor/structure/boolean.ts
+++ b/packages/core/src/editor/structure/boolean.ts
@@ -1,12 +1,11 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { copyFills } from '@open-pencil/scene-graph/copy'
import {
fitEnclosingGroups,
undoGroupFit,
type GroupFit,
- type GroupFitOptions,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
-import { copyFills } from '@open-pencil/scene-graph/copy'
+ type GroupFitOptions
+} from '@open-pencil/scene-graph/group-bounds'
import { canMakeBooleanSourceNode, groupFitOptions } from '#core/canvas/boolean'
import { restoreSubtree, snapshotSubtree } from '#core/editor/history/subtree'
diff --git a/packages/core/src/editor/structure/group/bounds.ts b/packages/core/src/editor/structure/group/bounds.ts
index 61f6733e3..a8cb3c660 100644
--- a/packages/core/src/editor/structure/group/bounds.ts
+++ b/packages/core/src/editor/structure/group/bounds.ts
@@ -1,4 +1,8 @@
-import { fitEnclosingGroups, redoGroupFit, undoGroupFit } from '@open-pencil/scene-graph'
+import {
+ fitEnclosingGroups,
+ redoGroupFit,
+ undoGroupFit
+} from '@open-pencil/scene-graph/group-bounds'
import { groupFitOptions } from '#core/canvas/boolean'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/structure/layer-type.ts b/packages/core/src/editor/structure/layer-type.ts
index 04e8ff0be..6f9027fc8 100644
--- a/packages/core/src/editor/structure/layer-type.ts
+++ b/packages/core/src/editor/structure/layer-type.ts
@@ -1,12 +1,11 @@
import { pick } from 'es-toolkit/object'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
fitEnclosingGroups,
redoGroupFit,
- undoGroupFit,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ undoGroupFit
+} from '@open-pencil/scene-graph/group-bounds'
import { groupFitOptions } from '#core/canvas/boolean'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/structure/reorder.ts b/packages/core/src/editor/structure/reorder.ts
index 5b8eddb48..eab903605 100644
--- a/packages/core/src/editor/structure/reorder.ts
+++ b/packages/core/src/editor/structure/reorder.ts
@@ -1,6 +1,7 @@
import { pick } from 'es-toolkit'
-import { createsComponentCycle, TRANSFORM_FIELDS } from '@open-pencil/scene-graph'
+import { TRANSFORM_FIELDS } from '@open-pencil/scene-graph/fields'
+import { createsComponentCycle } from '@open-pencil/scene-graph/instances'
import { assertNodeEditable } from '#core/editor/capabilities'
import { prepareSlotEdits } from '#core/editor/components/slots'
@@ -20,7 +21,7 @@ export function createStructureReorderActions(ctx: EditorContext) {
ctx.graph.updateNode(nodeId, { x: absPos.x - parentAbs.x, y: absPos.y - parentAbs.y })
}
- ctx.graph.reorderChild(nodeId, parentId, insertIndex)
+ ctx.graph.insertChildAt(nodeId, parentId, insertIndex)
computeLayout(ctx.graph, parentId)
ctx.runLayoutForNode(parentId)
}
@@ -45,7 +46,7 @@ export function createStructureReorderActions(ctx: EditorContext) {
doReorderChild(nodeId, parentId, insertIndex)
},
inverse: () => {
- ctx.graph.reorderChild(nodeId, origParentId, origIndex >= 0 ? origIndex : 0)
+ ctx.graph.insertChildAt(nodeId, origParentId, origIndex >= 0 ? origIndex : 0)
ctx.graph.updateNode(nodeId, { x: origX, y: origY })
computeLayout(ctx.graph, origParentId)
ctx.runLayoutForNode(origParentId)
@@ -76,7 +77,7 @@ export function createStructureReorderActions(ctx: EditorContext) {
const place = () => {
if (reparents) ctx.graph.reparentNode(nodeId, newParentId)
- ctx.graph.reorderChild(nodeId, newParentId, insertIndex)
+ ctx.graph.insertChildAt(nodeId, newParentId, insertIndex)
ctx.runLayoutForNode(newParentId)
if (reparents) ctx.runLayoutForNode(origParentId)
}
@@ -86,7 +87,7 @@ export function createStructureReorderActions(ctx: EditorContext) {
label: 'Reorder',
forward: place,
inverse: () => {
- ctx.graph.reorderChild(nodeId, origParentId, origIndex)
+ ctx.graph.insertChildAt(nodeId, origParentId, origIndex)
ctx.graph.updateNode(nodeId, origPlace)
ctx.runLayoutForNode(origParentId)
if (reparents) ctx.runLayoutForNode(newParentId)
diff --git a/packages/core/src/editor/structure/state.ts b/packages/core/src/editor/structure/state.ts
index c596dcad0..0a6391514 100644
--- a/packages/core/src/editor/structure/state.ts
+++ b/packages/core/src/editor/structure/state.ts
@@ -1,8 +1,8 @@
+import { findInstanceAncestor } from '@open-pencil/scene-graph/instances'
import {
cloneInstanceOverrideState,
- findInstanceAncestor,
setInstanceOverride
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/instances/overrides'
import { assertNodeEditable } from '#core/editor/capabilities'
import {
diff --git a/packages/core/src/editor/text.ts b/packages/core/src/editor/text.ts
index 312de123b..7573b7b4a 100644
--- a/packages/core/src/editor/text.ts
+++ b/packages/core/src/editor/text.ts
@@ -1,14 +1,14 @@
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { copyDerivedGlyphs, copyGeometryPaths } from '@open-pencil/scene-graph/copy'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
import {
cloneInstanceOverrideState,
setInstanceOverride,
- type InstanceOverrideState,
- type SceneNode
-} from '@open-pencil/scene-graph'
-import { copyDerivedGlyphs, copyGeometryPaths } from '@open-pencil/scene-graph/copy'
+ type InstanceOverrideState
+} from '@open-pencil/scene-graph/instances/overrides'
import { textAutoResizeChanges } from '#core/layout/text-auto-resize'
import type { TextEditorState } from '#core/text/editor'
-import { weightToStyle } from '#core/text/fonts'
import { hasGlyphOutlines } from '#core/text/opentype'
import { applyBoundTextEdit } from './components/authoring/text-edit'
diff --git a/packages/core/src/editor/text/name.ts b/packages/core/src/editor/text/name.ts
index 1c2d160ef..c16a07238 100644
--- a/packages/core/src/editor/text/name.ts
+++ b/packages/core/src/editor/text/name.ts
@@ -2,7 +2,7 @@ import {
generatedFrameKind,
generatedFrameOwner,
generatedFrameText
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/generated'
import { defaultNodeName } from '#core/editor/structure/rename'
import type { EditorContext } from '#core/editor/types'
diff --git a/packages/core/src/editor/text/path-edit.ts b/packages/core/src/editor/text/path-edit.ts
index 9a97a8901..dabe8907a 100644
--- a/packages/core/src/editor/text/path-edit.ts
+++ b/packages/core/src/editor/text/path-edit.ts
@@ -2,9 +2,9 @@ import { mean } from 'es-toolkit'
import { encodePathCommandsBlob } from '@open-pencil/fig/node-change'
import type { DerivedTextGlyph, SceneNode, TextPathData } from '@open-pencil/scene-graph'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
import type { Rect } from '@open-pencil/scene-graph/primitives'
-import { weightToStyle } from '#core/text/fonts'
import { getGlyphOutlineMetricsSync } from '#core/text/opentype'
import {
calibratePathTextLayout,
diff --git a/packages/core/src/editor/text/typeface.ts b/packages/core/src/editor/text/typeface.ts
index 35c3defcd..deabe67fd 100644
--- a/packages/core/src/editor/text/typeface.ts
+++ b/packages/core/src/editor/text/typeface.ts
@@ -1,13 +1,13 @@
import {
FIGJAM_TYPEFACES,
figJamTypefaceFields,
- generatedFrameText,
type FigJamTypeface
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/figjam'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
+import { generatedFrameText } from '@open-pencil/scene-graph/generated'
import { recordSubtreeEdit } from '#core/editor/components/slots/history'
import type { EditorContext } from '#core/editor/types'
-import { weightToStyle } from '#core/text/fonts'
/** Typefaces for the text generated frames are named by, such as a sticky note's body or a shape's label. */
export function createGeneratedTextActions(ctx: EditorContext) {
diff --git a/packages/core/src/editor/undo.ts b/packages/core/src/editor/undo.ts
index af75b0201..0afebaa5a 100644
--- a/packages/core/src/editor/undo.ts
+++ b/packages/core/src/editor/undo.ts
@@ -105,7 +105,7 @@ export function createUndoActions(ctx: EditorContext) {
for (const [id, pos] of ordered) {
ctx.graph.reparentNode(id, pos.parentId)
if (pos.index !== undefined && pos.index >= 0)
- ctx.graph.reorderChild(id, pos.parentId, pos.index)
+ ctx.graph.insertChildAt(id, pos.parentId, pos.index)
ctx.graph.updateNode(id, { x: pos.x, y: pos.y })
}
for (const id of places.keys()) ctx.runLayoutForNode(id)
diff --git a/packages/core/src/editor/variable-bindings.ts b/packages/core/src/editor/variable-bindings.ts
index 5a8c610d2..4b9ee600b 100644
--- a/packages/core/src/editor/variable-bindings.ts
+++ b/packages/core/src/editor/variable-bindings.ts
@@ -1,10 +1,10 @@
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { findInstanceAncestor } from '@open-pencil/scene-graph/instances'
+import { cloneInstanceOverrideState } from '@open-pencil/scene-graph/instances/overrides'
import {
- cloneInstanceOverrideState,
- findInstanceAncestor,
variableBindingOwner,
- isNumericVariableBindingField,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ isNumericVariableBindingField
+} from '@open-pencil/scene-graph/variables'
import { reconcileVariableLayouts } from '#core/layout/variables'
diff --git a/packages/core/src/editor/variables.ts b/packages/core/src/editor/variables.ts
index 5e61ea08f..6ef2de649 100644
--- a/packages/core/src/editor/variables.ts
+++ b/packages/core/src/editor/variables.ts
@@ -3,14 +3,13 @@ import { isEmptyObject } from 'es-toolkit/predicate'
import {
isModeAttributeName,
- tokenExpressionForValue,
- type BindingScope,
type TokenExpression,
type Variable,
type VariableCollection,
type VariableType,
type VariableValue
} from '@open-pencil/scene-graph'
+import { tokenExpressionForValue, type BindingScope } from '@open-pencil/scene-graph/variables'
import { reconcileVariableLayouts } from '#core/layout/variables'
diff --git a/packages/core/src/figma-api/accessor-utils.ts b/packages/core/src/figma-api/accessor-utils.ts
index d7bdc8fd1..4fa251480 100644
--- a/packages/core/src/figma-api/accessor-utils.ts
+++ b/packages/core/src/figma-api/accessor-utils.ts
@@ -1,14 +1,11 @@
import { isEqual } from 'es-toolkit/predicate'
-import {
- fitEnclosingGroups,
- FITTED_CONTAINER_TYPES,
- claimSlotContent,
- connectorSublayers,
- recordInstanceOverride,
- slotScope
-} from '@open-pencil/scene-graph'
-import type { GroupFitOptions, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { connectorSublayers } from '@open-pencil/scene-graph/connectors'
+import { fitEnclosingGroups, type GroupFitOptions } from '@open-pencil/scene-graph/group-bounds'
+import { recordInstanceOverride } from '@open-pencil/scene-graph/instances'
+import { FITTED_CONTAINER_TYPES } from '@open-pencil/scene-graph/node-defaults'
+import { claimSlotContent, slotScope } from '@open-pencil/scene-graph/slots'
import { assertNodeEditable } from '#core/editor/capabilities'
import type { NodeProxyHost } from '#core/figma-api/proxy'
diff --git a/packages/core/src/figma-api/accessors/basic.ts b/packages/core/src/figma-api/accessors/basic.ts
index 9dec265cd..469561fd7 100644
--- a/packages/core/src/figma-api/accessors/basic.ts
+++ b/packages/core/src/figma-api/accessors/basic.ts
@@ -1,25 +1,20 @@
import { pickBy } from 'es-toolkit'
-import {
- getAxisAlignedWorldBounds,
- getWorldMatrix,
- FITTED_CONTAINER_TYPES,
- TRANSFORM_FIELDS as NODE_TRANSFORM_FIELDS,
- findInstanceAncestor,
- recapturedAspectRatio,
- recordInstanceOverride,
- rescaleNodeTree,
- slotPropertyId,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { getAxisAlignedWorldBounds, getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
+import { TRANSFORM_FIELDS as NODE_TRANSFORM_FIELDS } from '@open-pencil/scene-graph/fields'
+import { findInstanceAncestor, recordInstanceOverride } from '@open-pencil/scene-graph/instances'
+import { recapturedAspectRatio } from '@open-pencil/scene-graph/layout'
import type { Mat3 } from '@open-pencil/scene-graph/matrix'
+import { FITTED_CONTAINER_TYPES } from '@open-pencil/scene-graph/node-defaults'
import type { Rect } from '@open-pencil/scene-graph/primitives'
import {
computeConstrainedResizeChanges,
createResizeSnapshot,
type ResizeSnapshot
} from '@open-pencil/scene-graph/resize'
+import { rescaleNodeTree } from '@open-pencil/scene-graph/scaling'
+import { slotPropertyId } from '@open-pencil/scene-graph/slots'
import { assertNodeEditable } from '#core/editor/capabilities'
import {
diff --git a/packages/core/src/figma-api/accessors/connector.ts b/packages/core/src/figma-api/accessors/connector.ts
index d6681429c..82ac64ae7 100644
--- a/packages/core/src/figma-api/accessors/connector.ts
+++ b/packages/core/src/figma-api/accessors/connector.ts
@@ -1,13 +1,15 @@
+import type {
+ ConnectorEndpoint,
+ ConnectorLineType,
+ SceneNode,
+ StrokeCap
+} from '@open-pencil/scene-graph'
import {
boundEndpoint,
connectorSublayers,
freeEndpoint,
- layoutConnector,
- type ConnectorEndpoint,
- type ConnectorLineType,
- type SceneNode,
- type StrokeCap
-} from '@open-pencil/scene-graph'
+ layoutConnector
+} from '@open-pencil/scene-graph/connectors'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import {
diff --git a/packages/core/src/figma-api/accessors/layout.ts b/packages/core/src/figma-api/accessors/layout.ts
index 34aa82711..e6d543a80 100644
--- a/packages/core/src/figma-api/accessors/layout.ts
+++ b/packages/core/src/figma-api/accessors/layout.ts
@@ -1,21 +1,16 @@
+import type { LayoutGrid, LayoutMode, LayoutSizing, SceneNode } from '@open-pencil/scene-graph'
import {
aspectRatioLockEditable,
layoutSizing,
layoutSizingError,
layoutSizingUpdates,
lockedAspectRatioTarget,
- type LayoutGrid,
- type LayoutMode,
- type LayoutSizing,
type LayoutSizingAxis,
- type SceneNode,
- type Vector
-} from '@open-pencil/scene-graph'
-import {
AUTO_LAYOUT_GRID_COUNT,
isAutoGridCount,
layoutGridCount
} from '@open-pencil/scene-graph/layout'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import {
prepareFollowedFieldEdit,
diff --git a/packages/core/src/figma-api/accessors/sticky.ts b/packages/core/src/figma-api/accessors/sticky.ts
index 6cf22a709..9cb6e1fe9 100644
--- a/packages/core/src/figma-api/accessors/sticky.ts
+++ b/packages/core/src/figma-api/accessors/sticky.ts
@@ -1,3 +1,4 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
generatedFrameText,
isGeneratedFrame,
@@ -5,8 +6,7 @@ import {
stickyScale,
stickySublayers,
stickyWidth
-} from '@open-pencil/scene-graph'
-import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/generated'
import {
graph,
diff --git a/packages/core/src/figma-api/accessors/strokes.ts b/packages/core/src/figma-api/accessors/strokes.ts
index 271368985..e599ed3fb 100644
--- a/packages/core/src/figma-api/accessors/strokes.ts
+++ b/packages/core/src/figma-api/accessors/strokes.ts
@@ -1,4 +1,5 @@
-import { newStrokeGeometry, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { newStrokeGeometry } from '@open-pencil/scene-graph/node-defaults'
import {
nodeId,
diff --git a/packages/core/src/figma-api/accessors/vector.ts b/packages/core/src/figma-api/accessors/vector.ts
index 47ba708be..3f58c6eae 100644
--- a/packages/core/src/figma-api/accessors/vector.ts
+++ b/packages/core/src/figma-api/accessors/vector.ts
@@ -1,9 +1,3 @@
-import {
- mergeVectorNetworks,
- normalizeVectorNetwork,
- transformVectorNetwork,
- validateVectorNetwork
-} from '@open-pencil/scene-graph'
import type {
GeometryPath,
HandleMirroring,
@@ -14,6 +8,12 @@ import type {
} from '@open-pencil/scene-graph'
import { copyFills } from '@open-pencil/scene-graph/copy'
import { parsePluginVectorPath } from '@open-pencil/scene-graph/parse-path'
+import {
+ mergeVectorNetworks,
+ normalizeVectorNetwork,
+ transformVectorNetwork,
+ validateVectorNetwork
+} from '@open-pencil/scene-graph/vector-network'
import {
graph,
diff --git a/packages/core/src/figma-api/accessors/visual.ts b/packages/core/src/figma-api/accessors/visual.ts
index 6b0359562..d86f38e74 100644
--- a/packages/core/src/figma-api/accessors/visual.ts
+++ b/packages/core/src/figma-api/accessors/visual.ts
@@ -1,14 +1,9 @@
-import {
- newStrokeGeometry,
- resolvedPaintBindings,
- type Color,
- type Fill,
- type GradientStop,
- type SceneNode,
- type Stroke
-} from '@open-pencil/scene-graph'
+import type { Fill, GradientStop, SceneNode, Stroke } from '@open-pencil/scene-graph'
import { normalizeColor } from '@open-pencil/scene-graph/color'
import { copyFills, copyStrokes } from '@open-pencil/scene-graph/copy'
+import { newStrokeGeometry } from '@open-pencil/scene-graph/node-defaults'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import { resolvedPaintBindings } from '@open-pencil/scene-graph/variables'
import {
graph,
diff --git a/packages/core/src/figma-api/components.ts b/packages/core/src/figma-api/components.ts
index 7c27c7f93..d1495868b 100644
--- a/packages/core/src/figma-api/components.ts
+++ b/packages/core/src/figma-api/components.ts
@@ -15,7 +15,7 @@ import {
exposedInstances,
instanceExposureIssue,
resolveComponentPropertyValue
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/components'
import { cloneNodeProps } from '@open-pencil/scene-graph/copy'
import { becomesComponent, componentWrapProps } from '#core/editor/components/create'
diff --git a/packages/core/src/figma-api/dev-status.ts b/packages/core/src/figma-api/dev-status.ts
index 028990a1d..de149d85e 100644
--- a/packages/core/src/figma-api/dev-status.ts
+++ b/packages/core/src/figma-api/dev-status.ts
@@ -8,7 +8,7 @@ import {
statusPlacement,
STATUS_NODE_TYPES,
type FigmaDevStatus
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/statuses'
import type { NodeProxyInternals, ProxyThis } from './accessor-utils'
import { graph, raw, updateNode } from './accessor-utils'
diff --git a/packages/core/src/figma-api/fonts.ts b/packages/core/src/figma-api/fonts.ts
index e9bbfedbf..2ecfd2e81 100644
--- a/packages/core/src/figma-api/fonts.ts
+++ b/packages/core/src/figma-api/fonts.ts
@@ -1,6 +1,5 @@
-import type { FontFamilyStyle } from '@open-pencil/scene-graph'
-
-import { FONT_WEIGHT_NAMES } from '#core/text/fonts'
+import type { FontFamilyStyle } from '@open-pencil/scene-graph/font-style'
+import { FONT_WEIGHT_NAMES } from '@open-pencil/scene-graph/font-style'
export type FigmaFontName = FontFamilyStyle
export type FigmaFont = { fontName: FigmaFontName }
diff --git a/packages/core/src/figma-api/index.ts b/packages/core/src/figma-api/index.ts
index ca798eea1..24cc55d52 100644
--- a/packages/core/src/figma-api/index.ts
+++ b/packages/core/src/figma-api/index.ts
@@ -1,14 +1,9 @@
import { fromUint8Array, isValid, toUint8Array } from 'js-base64'
-import {
- createConnector,
- freeEndpoint,
- type GroupFitOptions,
- type SceneGraph,
- type SceneNode as CoreSceneNode,
- type NodeType
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode as CoreSceneNode, NodeType } from '@open-pencil/scene-graph'
+import { createConnector, freeEndpoint } from '@open-pencil/scene-graph/connectors'
import { computeBounds } from '@open-pencil/scene-graph/geometry'
+import type { GroupFitOptions } from '@open-pencil/scene-graph/group-bounds'
import { computeImageHash } from '@open-pencil/scene-graph/images'
import type { Rect, Vector } from '@open-pencil/scene-graph/primitives'
@@ -95,8 +90,6 @@ export type {
} from './node-types'
export type { FigmaFont, FigmaFontName } from './proxy'
-export { computeImageHash }
-
// TODO(figma-api): Implement the full official PluginAPI interface once our compatibility
// layer covers all required node-specific return types and unsupported APIs are modeled explicitly.
export class FigmaAPI implements NodeProxyHost {
@@ -460,7 +453,7 @@ export class FigmaAPI implements NodeProxyHost {
sourceNodes.push(raw)
}
const vector = flattenSceneNodes(this.graph, this._renderer, sourceNodes, parentId)
- if (index != null) this.graph.reorderChild(vector.id, parentId, index)
+ if (index != null) this.graph.insertChildAt(vector.id, parentId, index)
for (const node of nodes) {
this.graph.deleteNode(this._nodeId(node))
}
diff --git a/packages/core/src/figma-api/overrides.ts b/packages/core/src/figma-api/overrides.ts
index 0129fce92..b26dca612 100644
--- a/packages/core/src/figma-api/overrides.ts
+++ b/packages/core/src/figma-api/overrides.ts
@@ -1,14 +1,14 @@
import { omit, uniq } from 'es-toolkit'
import { isEqual } from 'es-toolkit/predicate'
-import {
- findInstanceAncestor,
- type ComponentPropertyReferenceField,
- type InstanceOverrideState,
- type SceneGraph,
- type SceneNode,
- type Stroke
+import type {
+ ComponentPropertyReferenceField,
+ SceneGraph,
+ SceneNode,
+ Stroke
} from '@open-pencil/scene-graph'
+import { findInstanceAncestor } from '@open-pencil/scene-graph/instances'
+import type { InstanceOverrideState } from '@open-pencil/scene-graph/instances/overrides'
import type { NodeProxyInternals, ProxyThis } from './accessor-utils'
import { assertProxyEditable, graph, raw } from './accessor-utils'
diff --git a/packages/core/src/figma-api/pending-layout.ts b/packages/core/src/figma-api/pending-layout.ts
index 99a0f3d88..24822bde0 100644
--- a/packages/core/src/figma-api/pending-layout.ts
+++ b/packages/core/src/figma-api/pending-layout.ts
@@ -1,9 +1,9 @@
+import type { SceneGraph } from '@open-pencil/scene-graph'
import {
createSceneMutationImpact,
recordSceneMutations,
- type SceneGraph,
type SceneMutationImpact
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/mutation-impact'
import { createLayoutRunner } from '#core/layout/mutations'
diff --git a/packages/core/src/figma-api/proxy.ts b/packages/core/src/figma-api/proxy.ts
index 2625d42d8..12956ab92 100644
--- a/packages/core/src/figma-api/proxy.ts
+++ b/packages/core/src/figma-api/proxy.ts
@@ -1,12 +1,5 @@
-import {
- attachedConnectors,
- createsComponentCycle,
- recordInstanceOverride,
- slotPropertyId
-} from '@open-pencil/scene-graph'
import type {
ArcData,
- GroupFitOptions,
HyperlinkTarget,
SceneGraph,
SceneNode,
@@ -16,8 +9,12 @@ import type {
LayoutGrid,
LayoutMode
} from '@open-pencil/scene-graph'
+import { attachedConnectors } from '@open-pencil/scene-graph/connectors'
+import type { GroupFitOptions } from '@open-pencil/scene-graph/group-bounds'
+import { createsComponentCycle, recordInstanceOverride } from '@open-pencil/scene-graph/instances'
import type { Rect, Vector } from '@open-pencil/scene-graph/primitives'
import type { ShapeWithTextType } from '@open-pencil/scene-graph/shape-with-text'
+import { slotPropertyId } from '@open-pencil/scene-graph/slots'
import { assertNodeEditable } from '#core/editor/capabilities'
import type { FigmaEffect } from '#core/figma-api/effects'
@@ -442,7 +439,7 @@ export class FigmaNodeProxy {
)
prepareSlotMove(this[INTERNAL_GRAPH], this[INTERNAL_ID], child[INTERNAL_ID], 'insertChild')
this._reparentAndFit(child[INTERNAL_ID])
- this[INTERNAL_GRAPH].reorderChild(child[INTERNAL_ID], this[INTERNAL_ID], index)
+ this[INTERNAL_GRAPH].insertChildAt(child[INTERNAL_ID], this[INTERNAL_ID], index)
}
clone(): FigmaNodeProxy {
diff --git a/packages/core/src/figma-api/render-bounds.ts b/packages/core/src/figma-api/render-bounds.ts
index 9cf4b4cd2..c3376d7e9 100644
--- a/packages/core/src/figma-api/render-bounds.ts
+++ b/packages/core/src/figma-api/render-bounds.ts
@@ -1,4 +1,5 @@
-import { getWorldMatrix, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import {
geometryBlobBounds,
intersectVisualBounds,
diff --git a/packages/core/src/figma-api/shape-with-text.ts b/packages/core/src/figma-api/shape-with-text.ts
index 4cba0dddc..2ef71fffd 100644
--- a/packages/core/src/figma-api/shape-with-text.ts
+++ b/packages/core/src/figma-api/shape-with-text.ts
@@ -1,9 +1,5 @@
-import {
- createShapeWithText,
- shapeWithTextFrameFields,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { createShapeWithText, shapeWithTextFrameFields } from '@open-pencil/scene-graph/generated'
import {
isShapeWithTextType,
SHAPE_WITH_TEXT_TYPES,
diff --git a/packages/core/src/figma-api/slots.ts b/packages/core/src/figma-api/slots.ts
index 720358f03..2f04ff463 100644
--- a/packages/core/src/figma-api/slots.ts
+++ b/packages/core/src/figma-api/slots.ts
@@ -1,18 +1,18 @@
+import type { ComponentPropertyType, SceneGraph, SlotSettings } from '@open-pencil/scene-graph'
import {
createComponentPropertyId,
+ componentPropertyDefinitions
+} from '@open-pencil/scene-graph/components'
+import {
DEFAULT_SLOT_SETTINGS,
claimSlotContent,
- componentPropertyDefinitions,
createSlotProperty,
resetSlotContent,
slotLimitViolations,
slotPropertyId,
slotScope,
- type ComponentPropertyType,
- type SceneGraph,
- type SlotLimitViolation,
- type SlotSettings
-} from '@open-pencil/scene-graph'
+ type SlotLimitViolation
+} from '@open-pencil/scene-graph/slots'
import type { NodeProxyInternals, ProxyThis } from './accessor-utils'
import { assertProxyEditable, graph, nodeId, raw } from './accessor-utils'
diff --git a/packages/core/src/figma-api/strokes.ts b/packages/core/src/figma-api/strokes.ts
index 5d658d2f4..6ee8f3863 100644
--- a/packages/core/src/figma-api/strokes.ts
+++ b/packages/core/src/figma-api/strokes.ts
@@ -1,6 +1,6 @@
-import { recordInstanceOverride } from '@open-pencil/scene-graph'
import type { SceneGraph, SceneNode, Stroke } from '@open-pencil/scene-graph'
import { copyStroke } from '@open-pencil/scene-graph/copy'
+import { recordInstanceOverride } from '@open-pencil/scene-graph/instances'
/**
* Sets the weight of all of a node's strokes and the weight it keeps with none, as Figma's
diff --git a/packages/core/src/figma-api/text/bindings.ts b/packages/core/src/figma-api/text/bindings.ts
index e1736a57e..87c4b46de 100644
--- a/packages/core/src/figma-api/text/bindings.ts
+++ b/packages/core/src/figma-api/text/bindings.ts
@@ -1,8 +1,6 @@
import { mapValues, omit, pick } from 'es-toolkit/object'
import {
- getSharedStyles,
- SHARED_TEXT_STYLE_FIELDS,
TEXT_BINDABLE_FIELDS,
type CharacterStyleOverride,
type SceneGraph,
@@ -12,6 +10,7 @@ import {
type Variable
} from '@open-pencil/scene-graph'
import { copyFills } from '@open-pencil/scene-graph/copy'
+import { getSharedStyles, SHARED_TEXT_STYLE_FIELDS } from '@open-pencil/scene-graph/shared-styles'
import { styleNameToWeight } from '#core/figma-api/fonts'
import { variableAlias, type FigmaVariableAlias } from '#core/figma-api/variables/values'
diff --git a/packages/core/src/figma-api/text/index.ts b/packages/core/src/figma-api/text/index.ts
index da5bb672c..7261dac00 100644
--- a/packages/core/src/figma-api/text/index.ts
+++ b/packages/core/src/figma-api/text/index.ts
@@ -1,25 +1,25 @@
import { upperFirst } from 'es-toolkit/string'
+import type {
+ SceneGraph,
+ SceneNode,
+ TextParagraphSpacingField,
+ TextParagraphStyle
+} from '@open-pencil/scene-graph'
+import { recordInstanceOverride } from '@open-pencil/scene-graph/instances'
import {
MAX_LIST_INDENTATION,
paragraphIndexAt,
paragraphStyleAt,
paragraphStylesAfterEdit,
paragraphStylesInRange,
- recordInstanceOverride,
sharedParagraphSpacing,
textParagraphRanges,
trimParagraphStyles,
withIndentation,
withListType,
withParagraphSpacing
-} from '@open-pencil/scene-graph'
-import type {
- SceneGraph,
- SceneNode,
- TextParagraphSpacingField,
- TextParagraphStyle
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/text'
import { assertTextRange } from './style'
diff --git a/packages/core/src/figma-api/text/style.ts b/packages/core/src/figma-api/text/style.ts
index 09d4117ad..be9a3c8e8 100644
--- a/packages/core/src/figma-api/text/style.ts
+++ b/packages/core/src/figma-api/text/style.ts
@@ -1,14 +1,13 @@
import { mapValues, pickBy } from 'es-toolkit/object'
import { isEqual } from 'es-toolkit/predicate'
+import type { Fill, SceneNode } from '@open-pencil/scene-graph'
+import { copyFills } from '@open-pencil/scene-graph/copy'
import {
paragraphIndexAt,
paragraphSpacingAt,
- paragraphStyleAt,
- type Fill,
- type SceneNode
-} from '@open-pencil/scene-graph'
-import { copyFills } from '@open-pencil/scene-graph/copy'
+ paragraphStyleAt
+} from '@open-pencil/scene-graph/text'
import { weightToStyleName } from '#core/figma-api/fonts'
import { toFigmaPaint, type WithFigmaTransforms } from '#core/figma-api/paints'
diff --git a/packages/core/src/figma-api/transform.ts b/packages/core/src/figma-api/transform.ts
index d29aa50f7..f8f1de27f 100644
--- a/packages/core/src/figma-api/transform.ts
+++ b/packages/core/src/figma-api/transform.ts
@@ -1,10 +1,9 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
getNodeLocalMatrix,
getParentToContainerMatrix,
- localTransformFromWorld,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ localTransformFromWorld
+} from '@open-pencil/scene-graph/coordinate'
import Matrix, { type Mat3 } from '@open-pencil/scene-graph/matrix'
import { figmaRotation } from '#core/geometry/figma'
diff --git a/packages/core/src/figma-api/variables/values.ts b/packages/core/src/figma-api/variables/values.ts
index 44b233a7d..85e9dc73d 100644
--- a/packages/core/src/figma-api/variables/values.ts
+++ b/packages/core/src/figma-api/variables/values.ts
@@ -1,12 +1,12 @@
-import {
- variableValueReferences,
- type Color,
- type SceneGraph,
- type Variable,
- type VariableLiteral,
- type VariableType,
- type VariableValue
+import type {
+ SceneGraph,
+ Variable,
+ VariableLiteral,
+ VariableType,
+ VariableValue
} from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import { variableValueReferences } from '@open-pencil/scene-graph/variables'
/** A reference to a variable, as Figma's plugin API writes one. */
export interface FigmaVariableAlias {
diff --git a/packages/core/src/figma-api/variables/variable.ts b/packages/core/src/figma-api/variables/variable.ts
index 9be1c187a..424ef11b6 100644
--- a/packages/core/src/figma-api/variables/variable.ts
+++ b/packages/core/src/figma-api/variables/variable.ts
@@ -1,7 +1,6 @@
import { uniq } from 'es-toolkit/array'
import {
- updateTokenExpression,
VARIABLE_SCOPES,
type CodeSyntaxPlatform,
type SceneGraph,
@@ -11,6 +10,7 @@ import {
type VariableType,
type VariableValue
} from '@open-pencil/scene-graph'
+import { updateTokenExpression } from '@open-pencil/scene-graph/variables'
import { reconcileVariableLayouts } from '#core/layout/variables'
diff --git a/packages/core/src/geometry/connectors.ts b/packages/core/src/geometry/connectors.ts
index 5fe9642ea..45e4f538a 100644
--- a/packages/core/src/geometry/connectors.ts
+++ b/packages/core/src/geometry/connectors.ts
@@ -1,4 +1,5 @@
-import { connectorLineEnds, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { connectorLineEnds } from '@open-pencil/scene-graph/connectors'
import Matrix from '@open-pencil/scene-graph/matrix'
import type { Vector } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/core/src/geometry/figma.ts b/packages/core/src/geometry/figma.ts
index dafe0a60c..6400ace5e 100644
--- a/packages/core/src/geometry/figma.ts
+++ b/packages/core/src/geometry/figma.ts
@@ -1,11 +1,7 @@
-import {
- FITTED_CONTAINER_TYPES,
- getAxisAlignedWorldBounds,
- getWorldMatrix,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { getAxisAlignedWorldBounds, getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import Matrix, { type Mat3 } from '@open-pencil/scene-graph/matrix'
+import { FITTED_CONTAINER_TYPES } from '@open-pencil/scene-graph/node-defaults'
import type { Vector } from '@open-pencil/scene-graph/primitives'
/**
diff --git a/packages/core/src/geometry/gradient.ts b/packages/core/src/geometry/gradient.ts
index 518c9988d..04a131c39 100644
--- a/packages/core/src/geometry/gradient.ts
+++ b/packages/core/src/geometry/gradient.ts
@@ -1,4 +1,4 @@
-import type { GradientStop, GradientTransform, Vector } from '@open-pencil/scene-graph'
+import type { GradientStop, GradientTransform } from '@open-pencil/scene-graph'
import {
applyGradientTransform,
ellipticalGradientTransform,
@@ -6,6 +6,7 @@ import {
linearGradientTransform,
type GradientFillType
} from '@open-pencil/scene-graph/gradient'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
/**
* On-canvas gradient handles, as Figma desktop 126 draws and drags them, built on the paint
diff --git a/packages/core/src/geometry/handles/arc.ts b/packages/core/src/geometry/handles/arc.ts
index e9d4a6535..a8191d524 100644
--- a/packages/core/src/geometry/handles/arc.ts
+++ b/packages/core/src/geometry/handles/arc.ts
@@ -1,6 +1,7 @@
import { clamp } from 'es-toolkit'
-import type { ArcData, SceneNode, Vector } from '@open-pencil/scene-graph'
+import type { ArcData, SceneNode } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
/**
* On-canvas arc handles, as Figma desktop draws and drags them on a selected ellipse. Angles run
diff --git a/packages/core/src/geometry/handles/shape.ts b/packages/core/src/geometry/handles/shape.ts
index 247aeb242..1adccc13b 100644
--- a/packages/core/src/geometry/handles/shape.ts
+++ b/packages/core/src/geometry/handles/shape.ts
@@ -1,7 +1,8 @@
import { clamp } from 'es-toolkit'
-import type { SceneNode, Vector } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
import { POINT_COUNT_RANGE, polygonCorners } from '@open-pencil/scene-graph/polygon'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import type { SceneGeometry } from '#core/geometry/scene'
import type { ViewportTransform } from '#core/geometry/types'
diff --git a/packages/core/src/geometry/line-ends.ts b/packages/core/src/geometry/line-ends.ts
index 804d5310e..df716461b 100644
--- a/packages/core/src/geometry/line-ends.ts
+++ b/packages/core/src/geometry/line-ends.ts
@@ -1,10 +1,11 @@
-import type { SceneGraph, SceneNode, Vector } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
getParentWorldMatrix,
getWorldMatrix,
localTransformFromWorld
} from '@open-pencil/scene-graph/coordinate'
import Matrix, { type Mat3 } from '@open-pencil/scene-graph/matrix'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import { scaleVectorNetworkForResize } from '@open-pencil/scene-graph/resize'
/** Which end of a line a handle drags: its origin or the far end along its length. */
diff --git a/packages/core/src/geometry/scene.ts b/packages/core/src/geometry/scene.ts
index 7cb3570fc..5bc1636ec 100644
--- a/packages/core/src/geometry/scene.ts
+++ b/packages/core/src/geometry/scene.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph, SceneNode, Vector } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
getAxisAlignedWorldBounds,
getNodeLocalMatrix,
@@ -7,7 +7,7 @@ import {
getWorldMatrix
} from '@open-pencil/scene-graph/coordinate'
import Matrix from '@open-pencil/scene-graph/matrix'
-import type { Rect } from '@open-pencil/scene-graph/primitives'
+import type { Vector, Rect } from '@open-pencil/scene-graph/primitives'
import type { RotationPreview, ViewportTransform } from './types'
diff --git a/packages/core/src/geometry/selection.ts b/packages/core/src/geometry/selection.ts
index 4d229c27a..77ce72462 100644
--- a/packages/core/src/geometry/selection.ts
+++ b/packages/core/src/geometry/selection.ts
@@ -1,5 +1,5 @@
-import type { SceneNode, Vector } from '@open-pencil/scene-graph'
-import type { Rect } from '@open-pencil/scene-graph/primitives'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import type { Vector, Rect } from '@open-pencil/scene-graph/primitives'
import { ROTATION_HANDLE_DISTANCE } from '#core/constants'
import { fitTextPathBoxToGlyphs, getTextPathData, sampleTextPath } from '#core/text/path'
diff --git a/packages/core/src/geometry/transform-zones.ts b/packages/core/src/geometry/transform-zones.ts
index 6658dbd60..0bcb5e6d2 100644
--- a/packages/core/src/geometry/transform-zones.ts
+++ b/packages/core/src/geometry/transform-zones.ts
@@ -1,7 +1,6 @@
import { minBy } from 'es-toolkit'
-import type { Vector } from '@open-pencil/scene-graph'
-import type { Rect } from '@open-pencil/scene-graph/primitives'
+import type { Vector, Rect } from '@open-pencil/scene-graph/primitives'
/**
* Where a selected layer takes the pointer for resizing and rotating, as Figma desktop measures
diff --git a/packages/core/src/icons/render.ts b/packages/core/src/icons/render.ts
index 67372ec38..96efa2d59 100644
--- a/packages/core/src/icons/render.ts
+++ b/packages/core/src/icons/render.ts
@@ -1,3 +1,6 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { parseColor } from '@open-pencil/scene-graph/color'
+import { BLACK } from '@open-pencil/scene-graph/constants'
import {
iconGlyph,
iconLayerName,
@@ -6,12 +9,8 @@ import {
readIconTint,
withIcon,
withIconTint,
- type IconPaint,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
-import { parseColor } from '@open-pencil/scene-graph/color'
-import { BLACK } from '@open-pencil/scene-graph/constants'
+ type IconPaint
+} from '@open-pencil/scene-graph/icons'
import type { Color } from '@open-pencil/scene-graph/primitives'
import {
createResizeSnapshot,
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index 236bcdd2d..1befa5c3d 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -1,385 +1 @@
-export { CODEGEN_PROMPT } from './tools/prompts'
-
-export * from './constants'
-
-export { createDefaultEditorState, createEditor, EDITOR_TOOLS, TOOL_SHORTCUTS } from './editor'
-export type {
- ClipboardImageResolution,
- Editor,
- EditorContext,
- EditorOptions,
- EditorState,
- EditorToolDef,
- FigmaClipboardImageResolver,
- Tool
-} from './editor'
-
-export {
- SceneGraph,
- generateId,
- cloneVectorNetwork,
- normalizeVectorNetwork,
- validateVectorNetwork,
- type SceneNode,
- type NodeType,
- type Fill,
- type FillType,
- type Stroke,
- type StrokeCap,
- type StrokeJoin,
- type MaskType,
- type Effect,
- type BlendMode,
- type ImageScaleMode,
- type GradientStop,
- type GradientTransform,
- type LayoutMode,
- type LayoutSizing,
- type LayoutAlign,
- type LayoutAlignSelf,
- type LayoutCounterAlign,
- type LayoutWrap,
- type GridTrack,
- type GridTrackSizing,
- type GridPosition,
- type ConstraintType,
- type TextAutoResize,
- type TextDirection,
- type TextAlignVertical,
- type TextCase,
- type TextDecoration,
- type LayoutDirection,
- type ArcData,
- type VectorNetwork,
- type VectorVertex,
- type VectorSegment,
- type VectorRegion,
- type GeometryPath,
- type HandleMirroring,
- type WindingRule,
- type VariableType,
- type VariableValue,
- type Variable,
- type VariableCollection,
- type VariableCollectionMode,
- type CharacterStyleOverride,
- type StyleRun,
- type SceneGraphEvents,
- type DocumentColorSpace
-} from '@open-pencil/scene-graph'
-
-export { FigmaAPI, FigmaNodeProxy, computeImageHash, type FigmaFontName } from './figma-api'
-export { BehaviourHandle, OpenPencilAPI, type NodeRef } from './openpencil-api'
-export {
- ALL_TOOLS,
- CORE_TOOLS,
- EXTENDED_TOOLS,
- defineTool,
- toolsToAI,
- buildDebugLog,
- requireNode,
- NodeNotFoundError,
- calcClusterConfidence
-} from './tools'
-export type {
- ToolDef,
- ToolExecution,
- ToolCapability,
- ToolLogEntry,
- ToolDebugLog,
- AIAdapterOptions,
- StepBudget
-} from './tools'
-export { executeRPCCommand, ALL_RPC_COMMANDS } from './rpc'
-export { queryByXPath, matchByXPath, nodeToXPath } from './xpath'
-export type { XPathQueryOptions } from './xpath'
-export {
- okhclToRGBA,
- rgbaToOkHCL,
- serializeOkHCLPayload,
- parseOkHCLPayload,
- setNodeFillOkHCL,
- setNodeStrokeOkHCL,
- clearNodeFillOkHCL,
- clearNodeStrokeOkHCL,
- getNodeOkHCLPayloads,
- getFillOkHCL,
- getStrokeOkHCL,
- type OkHCLColor,
- type OkHCLPayload
-} from '@open-pencil/scene-graph/color'
-export type {
- InfoResult,
- PageItem,
- TreeArgs,
- TreeResult,
- TreeNodeResult,
- FindArgs,
- FindNodeResult,
- QueryArgs,
- QueryNodeResult,
- NodeArgs,
- NodeResult,
- VariablesArgs,
- VariablesResult,
- AnalyzeColorsArgs,
- AnalyzeColorsResult,
- AnalyzeTypographyArgs,
- AnalyzeTypographyResult,
- AnalyzeSpacingResult,
- SpacingValue,
- AnalyzeClustersArgs,
- AnalyzeClustersResult,
- TypographyStyle
-} from './rpc'
-export { SkiaRenderer, type RenderOverlays } from './canvas'
-export { LabelCache, type CachedSection, type CachedComponent } from './canvas/labels/cache'
-export {
- RenderProfiler,
- FrameStats,
- GPUTimer,
- DrawCallCounter,
- PhaseTimer,
- CaptureStack,
- toSpeedscopeJSON
-} from './profiler'
-export type { FrameCapture, NodeProfile } from './profiler'
-export { computeLayout, computeAllLayouts, setTextMeasurer } from './layout'
-export type { TextMeasurer } from './layout'
-export { getCanvasKit, type CanvasKitOptions } from './canvaskit'
-export {
- detectTextDirection,
- resolveTextDirection,
- resolveNodeTextDirection,
- resolveNodeLayoutDirection,
- isLogicalTextAlignStart,
- isLogicalTextAlignEnd
-} from '@open-pencil/scene-graph/text-direction'
-export {
- FONT_WEIGHT_NAMES,
- FontManager,
- chooseLocalFontMatch,
- fontManager,
- fontWeightMatchOrder,
- styleToWeight,
- weightToFigmaStyle,
- weightToStyle,
- normalizeFontFamily,
- isVariableFont,
- styleToVariant,
- type DownloadedFontCache,
- type FontInfo,
- type FontLoadedSource,
- type LocalFontAccessState
-} from './text/fonts'
-export {
- documentFontStatus,
- type DocumentFontFaceStatus,
- type DocumentFontStatus,
- type FontFaceStatus
-} from './text/font/status'
-export {
- fontFaceFromFigmaFontName,
- fontFaceRenderFamily,
- normalizeFontStyleName,
- parseFontStyle,
- type FontFaceRef,
- type ParsedFontStyle
-} from './text/face'
-export {
- ARABIC_LOCAL_FALLBACK_FAMILIES,
- ARABIC_REMOTE_FALLBACK_FAMILIES,
- cjkLocalFallbackFamilies,
- fontFallbackEntry,
- fontFallbackManifest,
- type FontFallbackManifestEntry,
- type FontFallbackScript
-} from './text/fallbacks'
-export {
- parseColor,
- normalizeColor,
- colorToHex,
- colorToHex8,
- colorToHexRaw,
- colorToRgba255,
- colorToCSS,
- colorToCSSCompact,
- rgba255ToColor,
- colorToFill,
- colorDistance
-} from '@open-pencil/scene-graph/color'
-export {
- resolveOkHCLForPreview,
- resolveRGBAForPreview,
- resolveNodeFillColor,
- resolveNodeStrokeColor,
- colorToDisplayCSS,
- getDefaultRenderColorSpace,
- type RenderColorSpace,
- type ColorIntentSpace,
- type ColorPreviewOptions,
- type ResolvedRenderColor
-} from '@open-pencil/scene-graph/color'
-export {
- vectorNetworkToPath,
- geometryBlobToPath,
- decodeVectorNetworkBlob,
- encodeVectorNetworkBlob,
- buildStyleOverrideTable,
- regenerateFillGeometry
-} from './vector'
-export {
- evalCubic,
- splitCubicAt,
- segmentToAbsolute,
- isLineSegment,
- cubicExtrema,
- computeAccurateBounds,
- nearestPointOnCubic,
- nearestPointOnNetwork,
- splitSegmentAt,
- removeVertex,
- breakAtVertex,
- deleteVertex,
- mirrorHandle,
- findOppositeHandle,
- findAllHandles,
- findConnectedComponents,
- extractSubNetwork,
- type CubicPoints,
- type NearestResult,
- type NetworkNearestResult
-} from './vector/bezier'
-export { computeSelectionBounds, computeSnap, type SnapGuide } from '@open-pencil/scene-graph/snap'
-export { UndoManager, type UndoEntry, type UndoManagerOptions } from '@open-pencil/scene-graph/undo'
-export { TextEditor, type TextCaret, type TextEditorState } from './text/editor'
-export {
- getStyleAt,
- applyStyleToRange,
- removeStyleFromRange,
- selectionHasStyle,
- toggleBoldInRange,
- toggleItalicInRange,
- toggleDecorationInRange,
- adjustRunsForInsert,
- adjustRunsForDelete
-} from './text/style-runs'
-export {
- renderNodesToImage,
- renderThumbnail,
- computeContentBounds,
- initCanvasKit,
- headlessRenderNodes,
- headlessRenderThumbnail,
- type RasterExportFormat,
- type ExportFormat
-} from './io/formats/raster'
-export {
- renderNodesToSVG,
- geometryBlobToSVGPath,
- vectorNetworkToSVGPaths,
- type SVGExportOptions
-} from './io/formats/svg/export'
-export { svg, renderSVGNode, type SVGNode } from './io/formats/svg/node'
-export { parseSVGPath } from '@open-pencil/scene-graph/parse-path'
-export {
- createIconifyProvider,
- iconColor,
- iconify,
- parseIconName,
- placeIcon,
- recolorIcon,
- swapIcon,
- type IconData,
- type IconPath,
- type IconProvider,
- type IconSearchOptions,
- type IconSearchResult,
- type PlaceIconOptions
-} from './icons'
-export {
- exportFigFile,
- compressFigData,
- compressFigDataSync,
- type FigFileExtrasOptions
-} from './io/formats/fig/export'
-export {
- FIG_KIWI_DEFAULT_VERSION,
- buildFigKiwi,
- parseFigKiwiChunks,
- decompressFigKiwiDataAsync,
- buildFontDigestMap,
- sceneNodeToKiwi,
- mapToFigmaType
-} from './kiwi/fig/node-change/serialize'
-export { fractionalPosition } from '@open-pencil/scene-graph/order-keys'
-export { withFigExportRuntime } from './canvas/text/shape'
-
-export { renderJSX, renderTree } from './design-jsx'
-export {
- parseFigmaClipboard,
- importClipboardNodes,
- figmaNodesBounds,
- parseOpenPencilClipboard,
- buildFigmaClipboardHTML,
- buildOpenPencilClipboardHTML,
- prefetchFigmaSchema,
- type TextPictureBuilder,
- type OpenPencilClipboardData
-} from './clipboard'
-export { probeGlyphOutlineCommands, type GlyphOutlineProbe } from './text/opentype'
-
-export { readPenFile, parsePenFile } from '@open-pencil/pen'
-
-export {
- readFigFile,
- parseFigFile,
- initCodec,
- encodeMessage,
- decodeMessage,
- compress,
- decompress,
- getCompiledSchema,
- getSchemaBytes,
- isCodecReady,
- peekMessageType,
- createNodeChangesMessage,
- createNodeChange,
- parseVariableId,
- type NodeChange,
- type GUID as KiwiGUID,
- type Color as KiwiColor,
- type Paint as KiwiPaint,
- type Effect as KiwiEffect,
- type ParentIndex,
- type FigmaMessage,
- MESSAGE_TYPES,
- NODE_TYPES,
- NODE_PHASES,
- BLEND_MODES,
- PAINT_TYPES,
- PROTOCOL_VERSION,
- KIWI,
- SESSION_ID,
- ZSTD_MAGIC,
- buildMultiplayerURL,
- isZstdCompressed,
- hasFigWireHeader,
- skipFigWireHeader,
- isKiwiMessage,
- getKiwiMessageType,
- parseVarint,
- FIG_WIRE_MAGIC
-} from './kiwi'
-
-export * from './io'
-export * from './lint'
-
-export {
- setPexelsAPIKey,
- setUnsplashAccessKey,
- registerStockPhotoProvider,
- setActiveStockPhotoProvider,
- getStockPhotoProviders
-} from './tools/stock-photo'
-export type { StockPhotoProvider, StockPhotoResult } from './tools/stock-photo'
+export * from './editor'
diff --git a/packages/core/src/io/formats/design-tokens/apply.ts b/packages/core/src/io/formats/design-tokens/apply.ts
index 940e68e2b..a5d3185e3 100644
--- a/packages/core/src/io/formats/design-tokens/apply.ts
+++ b/packages/core/src/io/formats/design-tokens/apply.ts
@@ -2,19 +2,19 @@ import { compact } from 'es-toolkit/array'
import { pick } from 'es-toolkit/object'
import { isEmptyObject, isEqual } from 'es-toolkit/predicate'
-import {
- findInstanceAncestor,
- type CodeSyntaxPlatform,
- type SceneGraph,
- type SceneNode,
- type TokenExpression,
- type TokenUnit,
- type Variable,
- type VariableCollection,
- type VariableScope,
- type VariableValue
+import type {
+ CodeSyntaxPlatform,
+ SceneGraph,
+ SceneNode,
+ TokenExpression,
+ TokenUnit,
+ Variable,
+ VariableCollection,
+ VariableScope,
+ VariableValue
} from '@open-pencil/scene-graph'
import { copyEffects } from '@open-pencil/scene-graph/copy'
+import { findInstanceAncestor } from '@open-pencil/scene-graph/instances'
import { randomHex } from '@open-pencil/scene-graph/random'
import { reconcileVariableLayouts } from '#core/layout/variables'
diff --git a/packages/core/src/io/formats/design-tokens/decode.ts b/packages/core/src/io/formats/design-tokens/decode.ts
index 46f4df3bb..5623465de 100644
--- a/packages/core/src/io/formats/design-tokens/decode.ts
+++ b/packages/core/src/io/formats/design-tokens/decode.ts
@@ -2,10 +2,8 @@ import * as v from 'valibot'
import {
CODE_SYNTAX_PLATFORMS,
- ROOT_FONT_SIZE_PX,
TOKEN_UNITS,
VARIABLE_SCOPES,
- type Color,
type CodeSyntaxPlatform,
type TokenUnit,
type VariableScope,
@@ -13,6 +11,8 @@ import {
} from '@open-pencil/scene-graph'
import { parseDisplayableColor } from '@open-pencil/scene-graph/color'
import { parseCSSNumber } from '@open-pencil/scene-graph/css'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import { ROOT_FONT_SIZE_PX } from '@open-pencil/scene-graph/variables'
import type { ReadToken } from './read'
import { OPENPENCIL_EXTENSION } from './types'
diff --git a/packages/core/src/io/formats/design-tokens/export.ts b/packages/core/src/io/formats/design-tokens/export.ts
index 738979dc1..57b63b985 100644
--- a/packages/core/src/io/formats/design-tokens/export.ts
+++ b/packages/core/src/io/formats/design-tokens/export.ts
@@ -2,14 +2,13 @@ import { compact } from 'es-toolkit/array'
import { omitBy } from 'es-toolkit/object'
import { isEmptyObject } from 'es-toolkit/predicate'
-import {
- printFormula,
- variableValueReferences,
- type SceneGraph,
- type Variable,
- type VariableCollection,
- type VariableCollectionMode
+import type {
+ SceneGraph,
+ Variable,
+ VariableCollection,
+ VariableCollectionMode
} from '@open-pencil/scene-graph'
+import { printFormula, variableValueReferences } from '@open-pencil/scene-graph/variables'
import { fileSegment, placeTokens, tokenPath, tokenReference, tokenTree } from './paths'
import { styleTokens, withOriginalName, type TokenReferences } from './styles'
diff --git a/packages/core/src/io/formats/design-tokens/plan/styles.ts b/packages/core/src/io/formats/design-tokens/plan/styles.ts
index 1f2f81db2..dbb3c8a91 100644
--- a/packages/core/src/io/formats/design-tokens/plan/styles.ts
+++ b/packages/core/src/io/formats/design-tokens/plan/styles.ts
@@ -1,13 +1,9 @@
import { isEqual, isPlainObject } from 'es-toolkit/predicate'
import * as v from 'valibot'
-import {
- getSharedStyles,
- type Color,
- type Effect,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { Effect, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import { getSharedStyles } from '@open-pencil/scene-graph/shared-styles'
import { tryParseFigmaEffects } from '#core/figma-api/effects'
import {
diff --git a/packages/core/src/io/formats/design-tokens/values.ts b/packages/core/src/io/formats/design-tokens/values.ts
index 57942f709..a228b14da 100644
--- a/packages/core/src/io/formats/design-tokens/values.ts
+++ b/packages/core/src/io/formats/design-tokens/values.ts
@@ -1,6 +1,7 @@
import { variableUnit } from '@open-pencil/dom-css/export'
-import type { Color, TokenUnit, Variable } from '@open-pencil/scene-graph'
+import type { TokenUnit, Variable } from '@open-pencil/scene-graph'
import { colorToHex } from '@open-pencil/scene-graph/color'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import type { DesignTokenType } from './types'
diff --git a/packages/core/src/io/formats/fig/compression.ts b/packages/core/src/io/formats/fig/compression.ts
index 974d41105..b6a9ab0e5 100644
--- a/packages/core/src/io/formats/fig/compression.ts
+++ b/packages/core/src/io/formats/fig/compression.ts
@@ -1,10 +1,9 @@
+import type { SceneGraph } from '@open-pencil/scene-graph'
import {
DEFAULT_FIG_COMPRESSION,
- OPEN_PENCIL_PLUGIN_DATA,
- readPluginData,
- type FigCompression,
- type SceneGraph
-} from '@open-pencil/scene-graph'
+ type FigCompression
+} from '@open-pencil/scene-graph/fig-compression'
+import { OPEN_PENCIL_PLUGIN_DATA, readPluginData } from '@open-pencil/scene-graph/plugin-data'
/**
* The zstd level each preset writes at. Reading costs the same at every level; writing does
diff --git a/packages/core/src/io/formats/fig/document-metadata.ts b/packages/core/src/io/formats/fig/document-metadata.ts
index 058c4aee1..e3d7a4384 100644
--- a/packages/core/src/io/formats/fig/document-metadata.ts
+++ b/packages/core/src/io/formats/fig/document-metadata.ts
@@ -1,12 +1,11 @@
-import { mergePluginData } from '@open-pencil/fig/node-change'
-import type { KiwiNodeChange } from '@open-pencil/fig/node-change'
+import { mergePluginData, type KiwiNodeChange } from '@open-pencil/fig/node-change'
+import type { SceneGraph } from '@open-pencil/scene-graph'
import {
isPluginDataEntry,
OPEN_PENCIL_PLUGIN_DATA,
withoutPluginData,
- withPluginData,
- type SceneGraph
-} from '@open-pencil/scene-graph'
+ withPluginData
+} from '@open-pencil/scene-graph/plugin-data'
const { documentId, enabledLibraries } = OPEN_PENCIL_PLUGIN_DATA
diff --git a/packages/core/src/io/formats/fig/export/index.ts b/packages/core/src/io/formats/fig/export/index.ts
index d14cf03cf..952ef30ca 100644
--- a/packages/core/src/io/formats/fig/export/index.ts
+++ b/packages/core/src/io/formats/fig/export/index.ts
@@ -2,7 +2,8 @@ import { compressFigDataSync, renameFigArchive } from '@open-pencil/fig'
import {
nameImagesForFigma,
placeSlotContent,
- type FigNodeChangeExportRuntime
+ type FigNodeChangeExportRuntime,
+ sceneNodeToKiwi
} from '@open-pencil/fig/node-change'
import { initCodec } from '@open-pencil/kiwi/fig/codec'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
@@ -14,7 +15,6 @@ import type { GUID } from '@open-pencil/scene-graph/primitives'
import { withFigExportRuntime } from '#core/canvas/text/shape'
import { IS_BROWSER, IS_TAURI } from '#core/constants'
import { figCompressionLevel } from '#core/io/formats/fig/compression'
-import { sceneNodeToKiwi } from '#core/kiwi/fig/node-change/serialize'
import { cloneSceneGraphForFigExport } from '#core/kiwi/fig/parse/transfer'
import {
hasPendingReaderPages,
@@ -222,7 +222,6 @@ async function writeFigFile(
)
}
-export { compressFigDataSync } from '@open-pencil/fig'
export type { FigFileExtrasOptions }
function canUseWorker(): boolean {
diff --git a/packages/core/src/io/formats/fig/export/patch/fields.ts b/packages/core/src/io/formats/fig/export/patch/fields.ts
index 1f769b4c9..fe06925d1 100644
--- a/packages/core/src/io/formats/fig/export/patch/fields.ts
+++ b/packages/core/src/io/formats/fig/export/patch/fields.ts
@@ -9,7 +9,8 @@ import {
} from '@open-pencil/fig'
import { derivedSymbolDataOf, symbolDataOf } from '@open-pencil/fig/instance-overrides'
import type { FigNodeChangeExportRuntime } from '@open-pencil/fig/node-change'
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
import type { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/core/src/io/formats/fig/export/patch/index.ts b/packages/core/src/io/formats/fig/export/patch/index.ts
index fab467cf6..637834de4 100644
--- a/packages/core/src/io/formats/fig/export/patch/index.ts
+++ b/packages/core/src/io/formats/fig/export/patch/index.ts
@@ -3,18 +3,19 @@ import {
type FigArchiveRecordInfo,
type FigRecordPatch
} from '@open-pencil/fig'
-import { nameImagesForFigma, type FigNodeChangeExportRuntime } from '@open-pencil/fig/node-change'
-import { stringToGuid } from '@open-pencil/kiwi/fig/guid'
import {
- computeImageHash,
- layersUsingVariables,
- isGeneratedFrame,
- ownsSlotContent,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ nameImagesForFigma,
+ type FigNodeChangeExportRuntime,
+ sceneNodeToKiwi
+} from '@open-pencil/fig/node-change'
+import { stringToGuid } from '@open-pencil/kiwi/fig/guid'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { isGeneratedFrame } from '@open-pencil/scene-graph/generated'
+import { computeImageHash } from '@open-pencil/scene-graph/images'
import { siblingOrderKeys } from '@open-pencil/scene-graph/order-keys'
import type { GUID } from '@open-pencil/scene-graph/primitives'
+import { ownsSlotContent } from '@open-pencil/scene-graph/slots'
+import { layersUsingVariables } from '@open-pencil/scene-graph/variables'
import { figCompressionLevel } from '#core/io/formats/fig/compression'
import {
@@ -26,7 +27,6 @@ import {
type KiwiNodeChange
} from '#core/io/formats/fig/export/setup'
import { appendVariableNodeChanges } from '#core/io/formats/fig/export/variables'
-import { sceneNodeToKiwi } from '#core/kiwi/fig/node-change/serialize'
import { figArchive, type FigArchiveAccess } from '#core/kiwi/fig/session/archive/access'
import { archiveChanges, type ArchiveChangeSummary } from '#core/kiwi/fig/session/archive/changes'
import {
diff --git a/packages/core/src/io/formats/fig/export/setup.ts b/packages/core/src/io/formats/fig/export/setup.ts
index 619c7a229..7b3d4dab0 100644
--- a/packages/core/src/io/formats/fig/export/setup.ts
+++ b/packages/core/src/io/formats/fig/export/setup.ts
@@ -9,23 +9,22 @@ import {
figImageEntries,
importCanvasGuides,
parseGuidOrNull,
- stringToGuid,
- type FigNodeChangeExportRuntime
+ type FigNodeChangeExportRuntime,
+ makeCanvasNodeChange,
+ makeDocumentNodeChange
} from '@open-pencil/fig/node-change'
-import { getCompiledSchema, getSchemaBytes } from '@open-pencil/kiwi/fig/codec'
-import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { getCompiledSchema, getSchemaBytes, type NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { stringToGuid } from '@open-pencil/kiwi/fig/guid'
import { decodeBinarySchema, compileSchema, ByteBuffer } from '@open-pencil/kiwi/schema-runtime'
+import type { PluginDataEntry, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
- ownsSlotContent,
readBehaviour,
renameBehaviourProperties,
- withBehaviour,
- type PluginDataEntry,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ withBehaviour
+} from '@open-pencil/scene-graph/behaviours'
import { fractionalPosition } from '@open-pencil/scene-graph/order-keys'
import type { GUID, Rect, Size } from '@open-pencil/scene-graph/primitives'
+import { ownsSlotContent } from '@open-pencil/scene-graph/slots'
import type { SkiaRenderer } from '#core/canvas'
import { CANVAS_BG_COLOR, IS_BROWSER, IS_TAURI } from '#core/constants'
@@ -33,11 +32,7 @@ import { getPageColor } from '#core/figma-api/page-backgrounds'
import { applyDocumentPluginData } from '#core/io/formats/fig/document-metadata'
import { findFigThumbnailPageId } from '#core/io/formats/fig/thumbnail-page'
import { renderThumbnail, thumbnailFrame } from '#core/io/formats/raster'
-import {
- makeCanvasNodeChange,
- makeDocumentNodeChange,
- settleFontDigestMap
-} from '#core/kiwi/fig/node-change/serialize'
+import { settleFontDigestMap } from '#core/kiwi/fig/node-change/serialize'
import { assignVariableGuid, assignVariableGuids } from './variables'
diff --git a/packages/core/src/io/formats/fig/export/variables.ts b/packages/core/src/io/formats/fig/export/variables.ts
index 596af500c..15a470375 100644
--- a/packages/core/src/io/formats/fig/export/variables.ts
+++ b/packages/core/src/io/formats/fig/export/variables.ts
@@ -7,10 +7,20 @@ import {
mapUnsupportedExpressionReferences,
unsupportedExpressionData,
variableAlias,
- variableMetadataNodeChange
+ variableMetadataNodeChange,
+ safeColor
} from '@open-pencil/fig/node-change'
-import type { GUID, NodeChange, VariableDataEntry } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange, VariableDataEntry } from '@open-pencil/kiwi/fig/codec'
import { guidToString, stringToGuid } from '@open-pencil/kiwi/fig/guid'
+import type {
+ SceneGraph,
+ SceneNode,
+ VariableFormulaNode,
+ VariableCollectionMode,
+ VariableValue
+} from '@open-pencil/scene-graph'
+import { fractionalPosition, orderKeyBetween } from '@open-pencil/scene-graph/order-keys'
import {
modesDefaultFirst,
isUnsupportedVariableValue,
@@ -18,16 +28,8 @@ import {
formulaValueType,
inferFormulaType,
variableFormulaSchema,
- variableColorExpressionSchema,
- type SceneGraph,
- type SceneNode,
- type VariableFormulaNode,
- type VariableCollectionMode,
- type VariableValue
-} from '@open-pencil/scene-graph'
-import { fractionalPosition, orderKeyBetween } from '@open-pencil/scene-graph/order-keys'
-
-import { safeColor } from '#core/kiwi/fig/node-change/serialize'
+ variableColorExpressionSchema
+} from '@open-pencil/scene-graph/variables'
/**
* Identity allocation shared by the two writers. The document exporter and the clipboard
diff --git a/packages/core/src/io/formats/fig/index.ts b/packages/core/src/io/formats/fig/index.ts
index 238d5a4a9..4600eb9b2 100644
--- a/packages/core/src/io/formats/fig/index.ts
+++ b/packages/core/src/io/formats/fig/index.ts
@@ -1,10 +1,5 @@
export { readFigFile, parseFigFile, type ParseFigFileOptions } from './read'
-export {
- exportFigFile,
- compressFigData,
- compressFigDataSync,
- type FigFileExtrasOptions
-} from './write'
+export { exportFigFile, compressFigData, type FigFileExtrasOptions } from './write'
export { findFigThumbnailPageId } from './thumbnail-page'
export {
isReaderPagePending as isFigPagePending,
@@ -12,3 +7,4 @@ export {
populateAllFigPages,
readerDiagnostics
} from '#core/kiwi/fig/session/document-state'
+export { buildFontDigestMap } from '#core/kiwi/fig/node-change/font/digests'
diff --git a/packages/core/src/io/formats/fig/write.ts b/packages/core/src/io/formats/fig/write.ts
index c392894b2..4bc180b3d 100644
--- a/packages/core/src/io/formats/fig/write.ts
+++ b/packages/core/src/io/formats/fig/write.ts
@@ -1,6 +1 @@
-export {
- exportFigFile,
- compressFigData,
- compressFigDataSync,
- type FigFileExtrasOptions
-} from './export'
+export { exportFigFile, compressFigData, type FigFileExtrasOptions } from './export'
diff --git a/packages/core/src/io/formats/html/vectors.ts b/packages/core/src/io/formats/html/vectors.ts
index ababbc3fc..adb6f6706 100644
--- a/packages/core/src/io/formats/html/vectors.ts
+++ b/packages/core/src/io/formats/html/vectors.ts
@@ -1,6 +1,6 @@
import type { DesignElement, DesignNode, VectorElementRenderer } from '@open-pencil/dom-css/export'
-import { isIconModified, readIcon, readIconTint } from '@open-pencil/scene-graph'
import { colorToHex } from '@open-pencil/scene-graph/color'
+import { isIconModified, readIcon, readIconTint } from '@open-pencil/scene-graph/icons'
import { iconColor } from '#core/icons/render'
import { renderNodeSVGElement } from '#core/io/formats/svg/export'
diff --git a/packages/core/src/io/formats/pptx/export.ts b/packages/core/src/io/formats/pptx/export.ts
index cea4f25bb..c996d4fe7 100644
--- a/packages/core/src/io/formats/pptx/export.ts
+++ b/packages/core/src/io/formats/pptx/export.ts
@@ -1,8 +1,9 @@
import { fromUint8Array } from 'js-base64'
import type PptxGenJS from 'pptxgenjs'
-import type { Fill, Mat3, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
-import { TransformMatrix, getWorldMatrix } from '@open-pencil/scene-graph'
+import type { Fill, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
+import TransformMatrix, { type Mat3 } from '@open-pencil/scene-graph/matrix'
import {
hasUnsupportedTransform,
diff --git a/packages/core/src/io/formats/pptx/geometry.ts b/packages/core/src/io/formats/pptx/geometry.ts
index bd170ddc3..aa6ab2548 100644
--- a/packages/core/src/io/formats/pptx/geometry.ts
+++ b/packages/core/src/io/formats/pptx/geometry.ts
@@ -1,5 +1,7 @@
-import type { Mat3, SceneGraph, SceneNode, Vector } from '@open-pencil/scene-graph'
-import { TransformMatrix, getWorldMatrix } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
+import TransformMatrix, { type Mat3 } from '@open-pencil/scene-graph/matrix'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import { clampRot, round2 } from './style'
diff --git a/packages/core/src/io/formats/pptx/style.ts b/packages/core/src/io/formats/pptx/style.ts
index 2d6f457d9..e52b39095 100644
--- a/packages/core/src/io/formats/pptx/style.ts
+++ b/packages/core/src/io/formats/pptx/style.ts
@@ -1,8 +1,9 @@
import { clamp } from 'es-toolkit'
import type PptxGenJS from 'pptxgenjs'
-import type { Color, Fill, SceneNode, Stroke } from '@open-pencil/scene-graph'
+import type { Fill, SceneNode, Stroke } from '@open-pencil/scene-graph'
import { colorToHex } from '@open-pencil/scene-graph/color'
+import type { Color } from '@open-pencil/scene-graph/primitives'
/** Scene paint/effect/text style → PPT property mapping (no slide geometry). */
diff --git a/packages/core/src/io/formats/raster/region.ts b/packages/core/src/io/formats/raster/region.ts
index 34de9c80c..dfc4133f2 100644
--- a/packages/core/src/io/formats/raster/region.ts
+++ b/packages/core/src/io/formats/raster/region.ts
@@ -1,7 +1,8 @@
import type { CanvasKit } from 'canvaskit-wasm'
-import type { Color, SceneGraph } from '@open-pencil/scene-graph'
+import type { SceneGraph } from '@open-pencil/scene-graph'
import type { VisualBounds } from '@open-pencil/scene-graph/geometry'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import { SkiaRenderer } from '#core/canvas'
diff --git a/packages/core/src/io/formats/raster/render.ts b/packages/core/src/io/formats/raster/render.ts
index ad007fffe..73e95406c 100644
--- a/packages/core/src/io/formats/raster/render.ts
+++ b/packages/core/src/io/formats/raster/render.ts
@@ -1,13 +1,10 @@
import type { CanvasKit, Canvas } from 'canvaskit-wasm'
-import {
- getWorldMatrix,
- type Mat3,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import type { RenderColorSpace } from '@open-pencil/scene-graph/color'
+import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import { computeDescendantVisualBounds, type VisualBounds } from '@open-pencil/scene-graph/geometry'
+import type { Mat3 } from '@open-pencil/scene-graph/matrix'
import type { SkiaRenderer } from '#core/canvas'
import { getPageColor } from '#core/figma-api/page-backgrounds'
diff --git a/packages/core/src/io/formats/svg/defs.ts b/packages/core/src/io/formats/svg/defs.ts
index 2bb6d0296..c37972420 100644
--- a/packages/core/src/io/formats/svg/defs.ts
+++ b/packages/core/src/io/formats/svg/defs.ts
@@ -1,12 +1,6 @@
import { fromUint8Array } from 'js-base64'
-import {
- imageMimeType,
- type Effect,
- type Fill,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { Effect, Fill, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
colorToHex,
colorToDisplayCSS,
@@ -18,6 +12,7 @@ import {
invertGradientTransform,
isIdentityGradientTransform
} from '@open-pencil/scene-graph/gradient'
+import { imageMimeType } from '@open-pencil/scene-graph/images'
import type { Color } from '@open-pencil/scene-graph/primitives'
import { svg, type SVGNode } from './node'
diff --git a/packages/core/src/io/formats/svg/import.ts b/packages/core/src/io/formats/svg/import.ts
index 51be9917e..3825af2f3 100644
--- a/packages/core/src/io/formats/svg/import.ts
+++ b/packages/core/src/io/formats/svg/import.ts
@@ -1,11 +1,8 @@
import { groupBy } from 'es-toolkit/array'
-import {
- fitEnclosingGroups,
- WHITE,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { WHITE } from '@open-pencil/scene-graph/constants'
+import { fitEnclosingGroups } from '@open-pencil/scene-graph/group-bounds'
import type { Size } from '@open-pencil/scene-graph/primitives'
import { BLACK } from '#core/constants'
diff --git a/packages/core/src/io/formats/svg/index.ts b/packages/core/src/io/formats/svg/index.ts
index 9fd26ce26..f2eee3e38 100644
--- a/packages/core/src/io/formats/svg/index.ts
+++ b/packages/core/src/io/formats/svg/index.ts
@@ -17,3 +17,4 @@ export { isSVGMarkup } from './metadata'
export type { SVGFontAlias } from './defs'
export type { SVGCharacterEdges, SVGTextLayout, SVGTextLine } from './text/lines'
export { svgImportFonts } from './text/import'
+export { renderSVGNode, svg, type SVGNode } from './node'
diff --git a/packages/core/src/io/formats/svg/text/export.ts b/packages/core/src/io/formats/svg/text/export.ts
index 5dd2fc43b..b91349724 100644
--- a/packages/core/src/io/formats/svg/text/export.ts
+++ b/packages/core/src/io/formats/svg/text/export.ts
@@ -1,5 +1,5 @@
import type { CharacterStyleOverride, SceneNode } from '@open-pencil/scene-graph'
-import { resolveNodeTextDirection } from '@open-pencil/scene-graph/text-direction'
+import { resolveNodeTextDirection } from '@open-pencil/scene-graph/text/direction'
import { formatColor, type SVGExportContext, type SVGFontAlias } from '#core/io/formats/svg/defs'
import { svg, type SVGNode } from '#core/io/formats/svg/node'
diff --git a/packages/core/src/io/formats/svg/text/import.ts b/packages/core/src/io/formats/svg/text/import.ts
index 23833a921..703d97d29 100644
--- a/packages/core/src/io/formats/svg/text/import.ts
+++ b/packages/core/src/io/formats/svg/text/import.ts
@@ -1,17 +1,17 @@
import { isEqual } from 'es-toolkit/predicate'
-import {
- localTransformFromWorld,
- type CharacterStyleOverride,
- type SceneGraph,
- type SceneNode,
- type StyleRun
+import type {
+ CharacterStyleOverride,
+ SceneGraph,
+ SceneNode,
+ StyleRun
} from '@open-pencil/scene-graph'
+import { localTransformFromWorld } from '@open-pencil/scene-graph/coordinate'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
import Matrix from '@open-pencil/scene-graph/matrix'
import type { SVGElementLayer } from '#core/icons/types'
import { measureTextForLayout } from '#core/layout/text-measurement'
-import { weightToStyle } from '#core/text/font/style'
import type {
SVGVectorizeResult,
VectorizedText,
diff --git a/packages/core/src/io/index.ts b/packages/core/src/io/index.ts
index 01e3f923c..2c61848de 100644
--- a/packages/core/src/io/index.ts
+++ b/packages/core/src/io/index.ts
@@ -13,37 +13,6 @@ export {
htmlFormat,
tailwindJSXFormat
} from './formats'
-export {
- exportFigFile,
- parseFigFile,
- readFigFile,
- type FigFileExtrasOptions,
- type ParseFigFileOptions
-} from './formats/fig'
-export { parsePenFile, readPenFile } from '@open-pencil/pen'
-export {
- computeContentBounds,
- renderNodesToImage,
- renderThumbnail,
- initCanvasKit,
- headlessRenderNodes,
- headlessRenderThumbnail,
- type RasterExportFormat,
- type ExportFormat
-} from './formats/raster'
-export {
- createSVGNodes,
- createSVGNodesFromImport,
- isSVGMarkup,
- prepareSVGImport,
- renderNodesToSVG,
- geometryBlobToSVGPath,
- nodeOutlinePath,
- vectorNetworkToSVGPaths,
- type OutlineNode,
- type SVGImportData,
- type SVGImportOptions
-} from './formats/svg'
export { vectorElement } from './formats/html/vectors'
export {
renderNodesToPPTX,
diff --git a/packages/core/src/io/subgraph.ts b/packages/core/src/io/subgraph.ts
index 0f9f36f1f..33796afc9 100644
--- a/packages/core/src/io/subgraph.ts
+++ b/packages/core/src/io/subgraph.ts
@@ -1,4 +1,6 @@
-import { SceneGraph, styleRunReferences, variableValueReferences } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { styleRunReferences } from '@open-pencil/scene-graph/text'
+import { variableValueReferences } from '@open-pencil/scene-graph/variables'
import type { ExportTarget } from './types'
diff --git a/packages/core/src/kiwi/fig/node-change/font/digests.ts b/packages/core/src/kiwi/fig/node-change/font/digests.ts
index 9df878724..1b4d942ee 100644
--- a/packages/core/src/kiwi/fig/node-change/font/digests.ts
+++ b/packages/core/src/kiwi/fig/node-change/font/digests.ts
@@ -1,6 +1,7 @@
import type { SceneGraph } from '@open-pencil/scene-graph'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
-import { fontManager, weightToStyle } from '#core/text/fonts'
+import { fontManager } from '#core/text/fonts'
const fontDigestCache = new Map<string, Uint8Array>()
diff --git a/packages/core/src/kiwi/fig/node-change/serialize.ts b/packages/core/src/kiwi/fig/node-change/serialize.ts
index 74a1451e9..07e3f7fbd 100644
--- a/packages/core/src/kiwi/fig/node-change/serialize.ts
+++ b/packages/core/src/kiwi/fig/node-change/serialize.ts
@@ -1,14 +1 @@
-export {
- buildFigKiwi,
- decompressFigKiwiDataAsync,
- FIG_KIWI_DEFAULT_VERSION,
- makeCanvasNodeChange,
- makeDocumentNodeChange,
- mapToFigmaType,
- parseFigKiwiChunks,
- safeColor,
- sceneNodeToKiwi,
- type KiwiNodeChange,
- type SceneNodeToKiwiOptions
-} from '@open-pencil/fig/node-change'
export { buildFontDigestMap, settleFontDigestMap } from './font/digests'
diff --git a/packages/core/src/kiwi/index.ts b/packages/core/src/kiwi/index.ts
deleted file mode 100644
index e9f894772..000000000
--- a/packages/core/src/kiwi/index.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-export { prefetchFigmaSchema } from '#core/clipboard'
-export { readFigFile, parseFigFile } from './fig/file'
-export { deduplicateNodeChangePluginData } from '@open-pencil/kiwi/fig/parse'
-export {
- initCodec,
- encodeMessage,
- decodeMessage,
- compress,
- decompress,
- getCompiledSchema,
- getSchemaBytes,
- isCodecReady,
- peekMessageType,
- createNodeChangesMessage,
- createNodeChange,
- parseVariableId,
- type NodeChange,
- type GUID,
- type Color,
- type Paint,
- type Effect,
- type VariableAnyValue,
- type VariableDataEntry,
- type VariableConsumptionEntry,
- type VariableDataValuesEntry,
- type ParentIndex,
- type FigmaMessage
-} from '@open-pencil/kiwi/fig/codec'
-export {
- MESSAGE_TYPES,
- NODE_TYPES,
- NODE_PHASES,
- BLEND_MODES,
- PAINT_TYPES,
- PROTOCOL_VERSION,
- KIWI,
- SESSION_ID,
- ZSTD_MAGIC,
- buildMultiplayerURL,
- isZstdCompressed,
- hasFigWireHeader,
- skipFigWireHeader,
- isKiwiMessage,
- getKiwiMessageType,
- parseVarint,
- FIG_WIRE_MAGIC
-} from '@open-pencil/kiwi/fig'
diff --git a/packages/core/src/layout.ts b/packages/core/src/layout.ts
index c1167df55..1d15d9385 100644
--- a/packages/core/src/layout.ts
+++ b/packages/core/src/layout.ts
@@ -11,7 +11,7 @@ import {
type Node as YogaNode
} from 'yoga-layout'
-import { resolveNodeLayoutDirection } from '@open-pencil/scene-graph/text-direction'
+import { resolveNodeLayoutDirection } from '@open-pencil/scene-graph/text/direction'
import { applyYogaLayout } from './layout/apply'
import {
@@ -34,15 +34,10 @@ export {
setTextMeasurer,
type TextMeasurer
} from './layout/text-measurement'
-import {
- connectorSublayers,
- isGeneratedFrame,
- layoutConnector,
- layoutSizing,
- type LayoutSizing,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { LayoutSizing, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { connectorSublayers, layoutConnector } from '@open-pencil/scene-graph/connectors'
+import { isGeneratedFrame } from '@open-pencil/scene-graph/generated'
+import { layoutSizing } from '@open-pencil/scene-graph/layout'
import { fitShapeWithTextFrame } from './layout/shape-with-text'
import { estimateTextSize, getTextMeasurer, measureTextForLayout } from './layout/text-measurement'
diff --git a/packages/core/src/layout/apply.ts b/packages/core/src/layout/apply.ts
index 15bb639e3..6560d9ebc 100644
--- a/packages/core/src/layout/apply.ts
+++ b/packages/core/src/layout/apply.ts
@@ -1,6 +1,7 @@
import type { Node as YogaNode } from 'yoga-layout'
-import { enforcedAspectRatio, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { enforcedAspectRatio } from '@open-pencil/scene-graph/layout'
import { layoutConstrainedChildRect } from '@open-pencil/scene-graph/resize'
import { keepsSavedLayout, usesDetachedDerivedLayout } from './derived'
diff --git a/packages/core/src/layout/axis-sizing.ts b/packages/core/src/layout/axis-sizing.ts
index 92707d879..c32f95cda 100644
--- a/packages/core/src/layout/axis-sizing.ts
+++ b/packages/core/src/layout/axis-sizing.ts
@@ -1,11 +1,7 @@
import { Align, type Node as YogaNode } from 'yoga-layout'
-import {
- layoutSizing,
- type LayoutSizing,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { LayoutSizing, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { layoutSizing } from '@open-pencil/scene-graph/layout'
type Axis = 'width' | 'height'
diff --git a/packages/core/src/layout/derived.ts b/packages/core/src/layout/derived.ts
index d9d80cad7..55e698946 100644
--- a/packages/core/src/layout/derived.ts
+++ b/packages/core/src/layout/derived.ts
@@ -1,8 +1,9 @@
-import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { LAYOUT_AFFECTING_KEYS } from '@open-pencil/scene-graph/fields'
/** Edits that make saved geometry stale: layout fields, visibility, and text laid out again. */
const LAYOUT_EDIT_FIELDS: ReadonlySet<string> = new Set([
- ...SceneGraph.LAYOUT_AFFECTING_KEYS,
+ ...LAYOUT_AFFECTING_KEYS,
'visible',
'derivedLayout'
])
diff --git a/packages/core/src/layout/effective-generated-text.ts b/packages/core/src/layout/effective-generated-text.ts
index 2940f6098..c9415c1f2 100644
--- a/packages/core/src/layout/effective-generated-text.ts
+++ b/packages/core/src/layout/effective-generated-text.ts
@@ -1,4 +1,5 @@
-import type { SceneGraph, SceneNode, Size } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import type { Size } from '@open-pencil/scene-graph/primitives'
import { getTextMeasurer } from './text-measurement'
diff --git a/packages/core/src/layout/grid.ts b/packages/core/src/layout/grid.ts
index 2e9733d30..7b61903d3 100644
--- a/packages/core/src/layout/grid.ts
+++ b/packages/core/src/layout/grid.ts
@@ -1,7 +1,8 @@
import { Direction, Display, Gutter, Edge, type Node as YogaNode } from 'yoga-layout'
-import { layoutSizing, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
-import { resolveNodeLayoutDirection } from '@open-pencil/scene-graph/text-direction'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { layoutSizing } from '@open-pencil/scene-graph/layout'
+import { resolveNodeLayoutDirection } from '@open-pencil/scene-graph/text/direction'
import { configureAbsoluteChild, createYogaNode, mapGridTrack } from './yoga-helpers'
diff --git a/packages/core/src/layout/mutations.ts b/packages/core/src/layout/mutations.ts
index 86e2a06d2..f22a7e58c 100644
--- a/packages/core/src/layout/mutations.ts
+++ b/packages/core/src/layout/mutations.ts
@@ -1,14 +1,12 @@
import { uniq } from 'es-toolkit'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { connectorsAffectedBy, layoutConnector } from '@open-pencil/scene-graph/connectors'
import {
collectSceneMutation,
- connectorsAffectedBy,
- layoutConnector,
mutationLayoutScopeIds,
- type SceneGraph,
- type SceneNode,
type SceneMutationImpact
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/mutation-impact'
import { computeAllLayouts, computeLayout } from '#core/layout'
diff --git a/packages/core/src/layout/shape-with-text.ts b/packages/core/src/layout/shape-with-text.ts
index 37fa089bd..0436b9d84 100644
--- a/packages/core/src/layout/shape-with-text.ts
+++ b/packages/core/src/layout/shape-with-text.ts
@@ -1,9 +1,9 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
SHAPE_WITH_TEXT_LABEL_LAYOUT,
shapeWithTextFrameFields,
shapeWithTextLabel
-} from '@open-pencil/scene-graph'
-import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/generated'
import {
fitShapeWithTextHeight,
shapeWithTextLabelBox
diff --git a/packages/core/src/layout/text-auto-resize.ts b/packages/core/src/layout/text-auto-resize.ts
index 0785f2328..98d307017 100644
--- a/packages/core/src/layout/text-auto-resize.ts
+++ b/packages/core/src/layout/text-auto-resize.ts
@@ -1,4 +1,5 @@
-import { TEXT_METRIC_FIELDS, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { TEXT_METRIC_FIELDS } from '@open-pencil/scene-graph/fields'
import { measureTextForLayout } from './text-measurement'
diff --git a/packages/core/src/layout/text-measurement.ts b/packages/core/src/layout/text-measurement.ts
index 77ca427a3..c1fe2021c 100644
--- a/packages/core/src/layout/text-measurement.ts
+++ b/packages/core/src/layout/text-measurement.ts
@@ -1,6 +1,6 @@
import type { SceneNode } from '@open-pencil/scene-graph'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
-import { weightToStyle } from '#core/text/fonts'
import { measureTextWithOpenType } from '#core/text/opentype'
export type TextMeasurer = (
diff --git a/packages/core/src/layout/variables.ts b/packages/core/src/layout/variables.ts
index 2f58ab62e..677125f6f 100644
--- a/packages/core/src/layout/variables.ts
+++ b/packages/core/src/layout/variables.ts
@@ -1,8 +1,5 @@
-import {
- reconcileVariableBindings,
- type BindingScope,
- type SceneGraph
-} from '@open-pencil/scene-graph'
+import type { SceneGraph } from '@open-pencil/scene-graph'
+import { reconcileVariableBindings, type BindingScope } from '@open-pencil/scene-graph/variables'
import { computeLayout } from '#core/layout'
diff --git a/packages/core/src/layout/yoga-helpers.ts b/packages/core/src/layout/yoga-helpers.ts
index 788e5a7b6..e34d6c1d0 100644
--- a/packages/core/src/layout/yoga-helpers.ts
+++ b/packages/core/src/layout/yoga-helpers.ts
@@ -7,13 +7,8 @@ import Yoga, {
type Node as YogaNode
} from 'yoga-layout'
-import {
- enforcedAspectRatio,
- layoutSizingInParent,
- type GridTrack,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { GridTrack, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { enforcedAspectRatio, layoutSizingInParent } from '@open-pencil/scene-graph/layout'
const yogaConfig = Yoga.Config.create()
yogaConfig.setPointScaleFactor(0)
diff --git a/packages/core/src/library/materialize.ts b/packages/core/src/library/materialize.ts
index 507af843c..476965233 100644
--- a/packages/core/src/library/materialize.ts
+++ b/packages/core/src/library/materialize.ts
@@ -1,4 +1,5 @@
-import { cloneNodeProps, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { cloneNodeProps } from '@open-pencil/scene-graph/copy'
import { findLibraryDefinition } from './definitions'
import { assertLibraryAssetKey, assertLibraryId, libraryAssetIdentityKey } from './identity'
diff --git a/packages/core/src/library/preview.ts b/packages/core/src/library/preview.ts
index 509b30e1b..8a059946a 100644
--- a/packages/core/src/library/preview.ts
+++ b/packages/core/src/library/preview.ts
@@ -1,4 +1,5 @@
-import { cloneNodeProps, SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { cloneNodeProps } from '@open-pencil/scene-graph/copy'
import { reapplyInstanceComponentProperties } from '#core/editor/components/properties'
diff --git a/packages/core/src/library/snapshot.ts b/packages/core/src/library/snapshot.ts
index 0a95f3de7..ccfd1fe43 100644
--- a/packages/core/src/library/snapshot.ts
+++ b/packages/core/src/library/snapshot.ts
@@ -1,5 +1,6 @@
-import { cloneNodeProps, contentPluginData, SceneGraph } from '@open-pencil/scene-graph'
-import type { SceneNode } from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { cloneNodeProps } from '@open-pencil/scene-graph/copy'
+import { contentPluginData } from '@open-pencil/scene-graph/plugin-data'
import { contentHash } from './hash'
import { assertLibraryAssetKey } from './identity'
diff --git a/packages/core/src/library/source-publication.ts b/packages/core/src/library/source-publication.ts
index df58c9a4d..836969207 100644
--- a/packages/core/src/library/source-publication.ts
+++ b/packages/core/src/library/source-publication.ts
@@ -1,10 +1,9 @@
+import type { SceneGraph, SourceLibraryPublication } from '@open-pencil/scene-graph'
import {
OPEN_PENCIL_PLUGIN_DATA,
readPluginData,
- withPluginData,
- type SceneGraph,
- type SourceLibraryPublication
-} from '@open-pencil/scene-graph'
+ withPluginData
+} from '@open-pencil/scene-graph/plugin-data'
export function readSourceLibraryPublication(graph: SceneGraph): SourceLibraryPublication | null {
const root = graph.getNode(graph.rootId)
diff --git a/packages/core/src/openpencil-api/behaviours.ts b/packages/core/src/openpencil-api/behaviours.ts
index ec49eab24..b655f3c63 100644
--- a/packages/core/src/openpencil-api/behaviours.ts
+++ b/packages/core/src/openpencil-api/behaviours.ts
@@ -1,22 +1,19 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
behaviourFromSpec,
behaviourOwner,
behaviourToSpec,
- createComponentPropertyId,
- createSlotProperty,
emptyBehaviour,
missingBindings,
readBehaviour,
- slotOwner,
- slotPropertyId,
withBehaviour,
type Behaviour,
type BehaviourKind,
type BehaviourNumberSettings,
- type BehaviourSpec,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type BehaviourSpec
+} from '@open-pencil/scene-graph/behaviours'
+import { createComponentPropertyId } from '@open-pencil/scene-graph/components'
+import { createSlotProperty, slotOwner, slotPropertyId } from '@open-pencil/scene-graph/slots'
/** A node as scripts pass it: a Figma API node, or its id. */
export type NodeRef = { readonly id: string } | string
diff --git a/packages/core/src/openpencil-api/comments.ts b/packages/core/src/openpencil-api/comments.ts
index 94fb384ec..53de0587a 100644
--- a/packages/core/src/openpencil-api/comments.ts
+++ b/packages/core/src/openpencil-api/comments.ts
@@ -1,3 +1,4 @@
+import type { CommentThread, SceneGraph } from '@open-pencil/scene-graph'
import {
byCreatedAt,
commentPosition,
@@ -13,10 +14,8 @@ import {
resolveCommentThread,
takesPartInThread,
writeComments,
- type CommentAuthor,
- type CommentThread,
- type SceneGraph
-} from '@open-pencil/scene-graph'
+ type CommentAuthor
+} from '@open-pencil/scene-graph/comments'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import { nodeOf, type NodeRef } from './behaviours'
diff --git a/packages/core/src/openpencil-api/index.ts b/packages/core/src/openpencil-api/index.ts
index 5cd1c3571..ed90d6741 100644
--- a/packages/core/src/openpencil-api/index.ts
+++ b/packages/core/src/openpencil-api/index.ts
@@ -1,12 +1,12 @@
+import type { VariableLiteral } from '@open-pencil/scene-graph'
import {
BEHAVIOUR_CONTRACTS,
BEHAVIOUR_KINDS,
- parseVariableFormula,
type BehaviourKind,
- type BehaviourSpec,
- type VariableLiteral
-} from '@open-pencil/scene-graph'
+ type BehaviourSpec
+} from '@open-pencil/scene-graph/behaviours'
import type { OkHCLColor, OkHCLPayload } from '@open-pencil/scene-graph/color'
+import { parseVariableFormula } from '@open-pencil/scene-graph/variables'
import { exposeInstanceSwap } from '#core/figma-api/components'
import type { FigmaAPI, FigmaNodeProxy } from '#core/figma-api/index'
diff --git a/packages/core/src/openpencil-api/nodes.ts b/packages/core/src/openpencil-api/nodes.ts
index 45f4e2f2c..6267405e7 100644
--- a/packages/core/src/openpencil-api/nodes.ts
+++ b/packages/core/src/openpencil-api/nodes.ts
@@ -1,11 +1,10 @@
import { isEqual } from 'es-toolkit/predicate'
-import {
- recordInstanceOverride,
- type LayoutDirection,
- type SceneGraph,
- type SceneNode,
- type TextDirection
+import type {
+ LayoutDirection,
+ SceneGraph,
+ SceneNode,
+ TextDirection
} from '@open-pencil/scene-graph'
import {
getFillOkHCL,
@@ -15,6 +14,7 @@ import {
type OkHCLColor,
type OkHCLPayload
} from '@open-pencil/scene-graph/color'
+import { recordInstanceOverride } from '@open-pencil/scene-graph/instances'
import { assertNodeEditable } from '#core/editor/capabilities'
diff --git a/packages/core/src/openpencil-api/statuses.ts b/packages/core/src/openpencil-api/statuses.ts
index ed61fdfa0..8dded5927 100644
--- a/packages/core/src/openpencil-api/statuses.ts
+++ b/packages/core/src/openpencil-api/statuses.ts
@@ -1,13 +1,13 @@
+import type { SceneGraph } from '@open-pencil/scene-graph'
+import { colorToHex } from '@open-pencil/scene-graph/color'
import {
cachedStatusWorkflow,
figmaDevStatusOf,
shownStatusState,
statusPlacement,
type FigmaDevStatus,
- type SceneGraph,
type StatusPlacement
-} from '@open-pencil/scene-graph'
-import { colorToHex } from '@open-pencil/scene-graph/color'
+} from '@open-pencil/scene-graph/statuses'
import { nodeOf, type NodeRef } from './behaviours'
diff --git a/packages/core/src/openpencil-api/variables.ts b/packages/core/src/openpencil-api/variables.ts
index d7b402a76..4ede20375 100644
--- a/packages/core/src/openpencil-api/variables.ts
+++ b/packages/core/src/openpencil-api/variables.ts
@@ -1,4 +1,5 @@
-import { resolvedPaintBindings, type SceneGraph } from '@open-pencil/scene-graph'
+import type { SceneGraph } from '@open-pencil/scene-graph'
+import { resolvedPaintBindings } from '@open-pencil/scene-graph/variables'
import { reconcileVariableLayouts } from '#core/layout/variables'
diff --git a/packages/core/src/rpc/variables-command.ts b/packages/core/src/rpc/variables-command.ts
index 6830b0581..45bd2a467 100644
--- a/packages/core/src/rpc/variables-command.ts
+++ b/packages/core/src/rpc/variables-command.ts
@@ -1,10 +1,6 @@
-import {
- formatVariableFormula,
- type SceneGraph,
- type Variable,
- type VariableType
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, Variable, VariableType } from '@open-pencil/scene-graph'
import { colorToHex } from '@open-pencil/scene-graph/color'
+import { formatVariableFormula } from '@open-pencil/scene-graph/variables'
import { exportTokenStylesheet, type TokenExport } from '#core/tools/codegen/tokens'
diff --git a/packages/core/src/text/character-style.ts b/packages/core/src/text/character-style.ts
index 1ec727d9f..97973bdb4 100644
--- a/packages/core/src/text/character-style.ts
+++ b/packages/core/src/text/character-style.ts
@@ -2,8 +2,6 @@ import { omit, pick } from 'es-toolkit/object'
import { isEqual } from 'es-toolkit/predicate'
import {
- SHARED_TEXT_STYLE_FIELDS,
- styleDetachmentChanges,
TEXT_BINDABLE_FIELDS,
type CharacterStyleOverride,
type HyperlinkTarget,
@@ -11,6 +9,10 @@ import {
type StyleRun,
type TextBoundVariables
} from '@open-pencil/scene-graph'
+import {
+ SHARED_TEXT_STYLE_FIELDS,
+ styleDetachmentChanges
+} from '@open-pencil/scene-graph/shared-styles'
/** A character's style: the text's own, with its run's overrides over it. */
export type CharacterStyle = Required<
diff --git a/packages/core/src/text/coverage.ts b/packages/core/src/text/coverage.ts
index 473b8d695..dfb20b7e2 100644
--- a/packages/core/src/text/coverage.ts
+++ b/packages/core/src/text/coverage.ts
@@ -1,8 +1,8 @@
import type { SceneNode } from '@open-pencil/scene-graph'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
import { DEFAULT_FONT_FAMILY } from '#core/constants'
import { cjkFallbackScriptForLanguage, type FontFallbackScript } from '#core/text/fallbacks'
-import { weightToStyle } from '#core/text/font/style'
import { fontGlyphCoverageSync } from '#core/text/opentype'
const CJK_IDEOGRAPH_CHAR_RE = /\p{Script=Han}/u
diff --git a/packages/core/src/text/editor.ts b/packages/core/src/text/editor.ts
index 608cdf2aa..c783e9525 100644
--- a/packages/core/src/text/editor.ts
+++ b/packages/core/src/text/editor.ts
@@ -1,12 +1,12 @@
import type { CanvasKit } from 'canvaskit-wasm'
import type { DerivedTextGlyph, SceneNode } from '@open-pencil/scene-graph'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
import type { Rect, Vector } from '@open-pencil/scene-graph/primitives'
-import { resolveNodeTextDirection } from '@open-pencil/scene-graph/text-direction'
+import { resolveNodeTextDirection } from '@open-pencil/scene-graph/text/direction'
import type { SkiaRenderer } from '#core/canvas'
import type { TextLayout } from '#core/canvas/text/layout'
-import { weightToStyle } from '#core/text/fonts'
import { nextGraphemeBoundary, previousGraphemeBoundary } from '#core/text/graphemes'
import { fontVerticalMetricsSync } from '#core/text/opentype'
import {
diff --git a/packages/core/src/text/face.ts b/packages/core/src/text/face.ts
index 5334484b1..112ae6fd4 100644
--- a/packages/core/src/text/face.ts
+++ b/packages/core/src/text/face.ts
@@ -1,8 +1,4 @@
-import { parseFontStyle } from '@open-pencil/scene-graph'
-import type { ParsedFontStyle } from '@open-pencil/scene-graph'
-
-export { normalizeFontStyleName, parseFontStyle, styleToWeight } from '@open-pencil/scene-graph'
-export type { ParsedFontStyle } from '@open-pencil/scene-graph'
+import { parseFontStyle, type ParsedFontStyle } from '@open-pencil/scene-graph/font-style'
export interface FontFaceRef extends ParsedFontStyle {
family: string
diff --git a/packages/core/src/text/font/faces.ts b/packages/core/src/text/font/faces.ts
index d9b3f2ea8..bee537188 100644
--- a/packages/core/src/text/font/faces.ts
+++ b/packages/core/src/text/font/faces.ts
@@ -1,6 +1,6 @@
import { uniqBy } from 'es-toolkit'
-import { parseFontStyle } from '@open-pencil/scene-graph'
+import { parseFontStyle } from '@open-pencil/scene-graph/font-style'
/** One face a font family has: a weight, upright or italic. */
export interface FamilyFace {
diff --git a/packages/core/src/text/font/style.ts b/packages/core/src/text/font/style.ts
index 3e7a9c643..0009d05de 100644
--- a/packages/core/src/text/font/style.ts
+++ b/packages/core/src/text/font/style.ts
@@ -1,15 +1,9 @@
-import { FONT_WEIGHT_NAMES, normalizeFontFamily } from '@open-pencil/scene-graph'
-import type { FontFamilyStyle } from '@open-pencil/scene-graph'
-
-export {
+import {
FONT_WEIGHT_NAMES,
normalizeFontFamily,
- styleToVariant,
- styleToWeight,
- weightToStyle
-} from '@open-pencil/scene-graph'
-
-import { parseFontStyle } from '#core/text/face'
+ type FontFamilyStyle,
+ parseFontStyle
+} from '@open-pencil/scene-graph/font-style'
const FONT_WEIGHTS = Object.keys(FONT_WEIGHT_NAMES)
.map(Number)
@@ -73,5 +67,3 @@ export function chooseLocalFontMatch<T extends FontFamilyStyle>(
return undefined
}
-
-export { weightToFigmaStyle } from '@open-pencil/fig/node-change'
diff --git a/packages/core/src/text/font/variation.ts b/packages/core/src/text/font/variation.ts
index 3b0afd855..3af5e3ce6 100644
--- a/packages/core/src/text/font/variation.ts
+++ b/packages/core/src/text/font/variation.ts
@@ -1,5 +1,5 @@
-import { styleToWeight } from '@open-pencil/scene-graph'
import type { FontVariation } from '@open-pencil/scene-graph'
+import { styleToWeight } from '@open-pencil/scene-graph/font-style'
interface TableRange {
offset: number
diff --git a/packages/core/src/text/fonts.ts b/packages/core/src/text/fonts.ts
index afb886c95..99e58f47c 100644
--- a/packages/core/src/text/fonts.ts
+++ b/packages/core/src/text/fonts.ts
@@ -6,17 +6,18 @@ import type { FontVariation, SceneGraph } from '@open-pencil/scene-graph'
import { DEFAULT_FONT_FAMILY, IS_BROWSER } from '#core/constants'
import { facesFromStyles, hasFamilyFace, type FamilyFace } from '#core/text/font/faces'
-import {
- chooseLocalFontMatch,
- normalizeFontFamily,
- styleToWeight,
- weightToStyle
-} from '#core/text/font/style'
+import { chooseLocalFontMatch } from '#core/text/font/style'
import { isVariableFont, namedInstanceVariations } from '#core/text/font/variation'
export * from '#core/text/font/sources'
export * from '#core/text/font/style'
export * from '#core/text/font/variation'
+import {
+ normalizeFontFamily,
+ styleToWeight,
+ weightToStyle
+} from '@open-pencil/scene-graph/font-style'
+
import { fontFallbackEntry } from '#core/text/fallbacks'
import type { FontFallbackScript } from '#core/text/fallbacks'
import { UnsupportedFontFormatError } from '#core/text/font/sources'
diff --git a/packages/core/src/text/index.ts b/packages/core/src/text/index.ts
index 4e289aae7..2b75b47f2 100644
--- a/packages/core/src/text/index.ts
+++ b/packages/core/src/text/index.ts
@@ -12,4 +12,5 @@ export * from './web-fonts'
export * from './path'
export * from './prepare'
export * from './font/faces'
-export type { OutlineCommand } from './opentype'
+export { fontFaceFromFigmaFontName, fontFaceRenderFamily, type FontFaceRef } from './face'
+export { probeGlyphOutlineCommands, type GlyphOutlineProbe, type OutlineCommand } from './opentype'
diff --git a/packages/core/src/text/outlines.ts b/packages/core/src/text/outlines.ts
index 690c5ca27..b68809b8c 100644
--- a/packages/core/src/text/outlines.ts
+++ b/packages/core/src/text/outlines.ts
@@ -1,8 +1,9 @@
import { prepareWithSegments, layoutWithLines } from '@chenglou/pretext'
import type { CharacterStyleOverride, SceneNode } from '@open-pencil/scene-graph'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
-import { fontManager, weightToStyle } from '#core/text/fonts'
+import { fontManager } from '#core/text/fonts'
import {
fontHasGlyphSync,
getGlyphOutlineMetricsSync,
diff --git a/packages/core/src/text/requirements.ts b/packages/core/src/text/requirements.ts
index db4c8cf1e..945f98213 100644
--- a/packages/core/src/text/requirements.ts
+++ b/packages/core/src/text/requirements.ts
@@ -1,12 +1,12 @@
import { uniqBy } from 'es-toolkit/array'
import type { CharacterStyleOverride, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { weightToStyle } from '@open-pencil/scene-graph/font-style'
import { DEFAULT_FONT_FAMILY } from '#core/constants'
import { shownCharacters } from '#core/text/case'
import type { FontFaceRef } from '#core/text/face'
import { cjkFallbackScriptForLanguage, type FontFallbackScript } from '#core/text/fallbacks'
-import { weightToStyle } from '#core/text/font/style'
/** The face a text draws in, or the face a style run over it draws in. */
export function textFontFace(node: SceneNode, style: CharacterStyleOverride = {}): FontFaceRef {
diff --git a/packages/core/src/text/web-fonts.ts b/packages/core/src/text/web-fonts.ts
index bc47f121b..52cb704d7 100644
--- a/packages/core/src/text/web-fonts.ts
+++ b/packages/core/src/text/web-fonts.ts
@@ -1,8 +1,9 @@
import { uniq } from 'es-toolkit'
import type { FontFaceData, RemoteFontSource, ResolveFontResult } from 'unifont'
+import { parseFontStyle } from '@open-pencil/scene-graph/font-style'
+
import { IS_BROWSER } from '#core/constants'
-import { parseFontStyle } from '#core/text/face'
import type { FamilyFace } from '#core/text/font/faces'
import {
createProviderUnifont,
diff --git a/packages/core/src/tools/analyze/diff/apply.ts b/packages/core/src/tools/analyze/diff/apply.ts
index 61ed4cf81..944f8a8ad 100644
--- a/packages/core/src/tools/analyze/diff/apply.ts
+++ b/packages/core/src/tools/analyze/diff/apply.ts
@@ -10,7 +10,8 @@ import {
sceneNodeAttributes,
type JSXAttributeSource
} from '@open-pencil/design-jsx'
-import { recordInstanceOverride, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { recordInstanceOverride } from '@open-pencil/scene-graph/instances'
import { assertNodeEditable } from '#core/editor/capabilities'
import type { FigmaAPI } from '#core/figma-api'
diff --git a/packages/core/src/tools/create/behaviours.ts b/packages/core/src/tools/create/behaviours.ts
index 7986fca51..a3f2b8bcd 100644
--- a/packages/core/src/tools/create/behaviours.ts
+++ b/packages/core/src/tools/create/behaviours.ts
@@ -1,6 +1,6 @@
import * as v from 'valibot'
-import { behaviourSpecSchema } from '@open-pencil/scene-graph'
+import { behaviourSpecSchema } from '@open-pencil/scene-graph/behaviours'
import { OpenPencilAPI } from '#core/openpencil-api'
import { defineTool, toolFailure } from '#core/tools/schema'
diff --git a/packages/core/src/tools/create/vector.ts b/packages/core/src/tools/create/vector.ts
index 9b629aef6..eb6687a3d 100644
--- a/packages/core/src/tools/create/vector.ts
+++ b/packages/core/src/tools/create/vector.ts
@@ -1,9 +1,9 @@
import * as v from 'valibot'
-import { transformVectorNetwork } from '@open-pencil/scene-graph'
import type { VectorNetwork } from '@open-pencil/scene-graph'
import { parseColor } from '@open-pencil/scene-graph/color'
import { parseSVGPath } from '@open-pencil/scene-graph/parse-path'
+import { transformVectorNetwork } from '@open-pencil/scene-graph/vector-network'
import { toolNumber, positionInputs } from '#core/tools/input'
import { defineTool, nodeSummary } from '#core/tools/schema'
diff --git a/packages/core/src/tools/index.ts b/packages/core/src/tools/index.ts
index 258cabec2..780900c3b 100644
--- a/packages/core/src/tools/index.ts
+++ b/packages/core/src/tools/index.ts
@@ -45,3 +45,10 @@ export {
} from './analyze/overlaps/params'
export { setPexelsAPIKey, setUnsplashAccessKey } from './stock-photo'
export { importSVG } from './create'
+export {
+ getStockPhotoProviders,
+ registerStockPhotoProvider,
+ setActiveStockPhotoProvider,
+ type StockPhotoProvider,
+ type StockPhotoResult
+} from './stock-photo/providers'
diff --git a/packages/core/src/tools/statuses.ts b/packages/core/src/tools/statuses.ts
index fee47e777..d5a9240f4 100644
--- a/packages/core/src/tools/statuses.ts
+++ b/packages/core/src/tools/statuses.ts
@@ -1,6 +1,6 @@
import * as v from 'valibot'
-import { STATUS_NODE_TYPES } from '@open-pencil/scene-graph'
+import { STATUS_NODE_TYPES } from '@open-pencil/scene-graph/statuses'
import { OpenPencilAPI } from '#core/openpencil-api'
import { defineTool, toolFailure } from '#core/tools/schema'
diff --git a/packages/core/src/tools/variables/values.ts b/packages/core/src/tools/variables/values.ts
index 863968483..55c81b9d1 100644
--- a/packages/core/src/tools/variables/values.ts
+++ b/packages/core/src/tools/variables/values.ts
@@ -1,7 +1,8 @@
import * as v from 'valibot'
-import type { Color, VariableType } from '@open-pencil/scene-graph'
+import type { VariableType } from '@open-pencil/scene-graph'
import { parseColor } from '@open-pencil/scene-graph/color'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import type { FigmaVariableValue } from '#core/figma-api'
import { defineTool } from '#core/tools/schema'
diff --git a/packages/core/src/tools/vector/network.ts b/packages/core/src/tools/vector/network.ts
index 5273dfcc3..2d2b0da7e 100644
--- a/packages/core/src/tools/vector/network.ts
+++ b/packages/core/src/tools/vector/network.ts
@@ -1,7 +1,7 @@
import * as v from 'valibot'
-import { validateVectorNetwork } from '@open-pencil/scene-graph'
import type { VectorNetwork } from '@open-pencil/scene-graph'
+import { validateVectorNetwork } from '@open-pencil/scene-graph/vector-network'
const finiteNumber = v.pipe(v.number(), v.finite())
const zeroVector = () => ({ x: 0, y: 0 })
diff --git a/packages/core/src/tools/vector/path.ts b/packages/core/src/tools/vector/path.ts
index eb6e80670..05fab3dbf 100644
--- a/packages/core/src/tools/vector/path.ts
+++ b/packages/core/src/tools/vector/path.ts
@@ -1,7 +1,7 @@
import * as v from 'valibot'
-import { cloneVectorNetwork } from '@open-pencil/scene-graph'
import type { SceneNode, VectorNetwork } from '@open-pencil/scene-graph'
+import { cloneVectorNetwork } from '@open-pencil/scene-graph/vector-network'
import type { FigmaAPI } from '#core/figma-api'
import { toolNumber, nodeIdInput, nodeInput } from '#core/tools/input'
diff --git a/packages/core/src/vector/index.ts b/packages/core/src/vector/index.ts
index c561be91f..5eb810705 100644
--- a/packages/core/src/vector/index.ts
+++ b/packages/core/src/vector/index.ts
@@ -17,11 +17,6 @@ export {
import type { CanvasKit, Path } from 'canvaskit-wasm'
-export {
- buildStyleOverrideTable,
- decodeVectorNetworkBlob,
- encodeVectorNetworkBlob
-} from '@open-pencil/fig/node-change'
import type { VectorNetwork, WindingRule } from '@open-pencil/scene-graph'
import { addLoopToPath, addOpenSegmentsToPath } from './path-helpers'
@@ -140,3 +135,15 @@ export function geometryBlobToPath(
result.setFillType(fillType(ck, windingRule))
return result
}
+export {
+ cubicExtrema,
+ evalCubic,
+ isLineSegment,
+ nearestPointOnCubic,
+ segmentToAbsolute,
+ splitCubicAt,
+ type CubicPoints,
+ type NearestResult,
+ type NetworkNearestResult
+} from './curve-math'
+export { extractSubNetwork, findConnectedComponents } from './connectivity'
diff --git a/packages/core/src/vector/placement.ts b/packages/core/src/vector/placement.ts
index f70654a96..091667b76 100644
--- a/packages/core/src/vector/placement.ts
+++ b/packages/core/src/vector/placement.ts
@@ -1,11 +1,7 @@
-import {
- transformVectorNetwork,
- type SceneGraph,
- type SceneNode,
- type VectorNetwork
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode, VectorNetwork } from '@open-pencil/scene-graph'
import { getNodeLocalMatrix, getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import Matrix from '@open-pencil/scene-graph/matrix'
+import { transformVectorNetwork } from '@open-pencil/scene-graph/vector-network'
import { computeAccurateBounds } from './curve-math'
import { regenerateFillGeometry } from './fill-geometry'
diff --git a/packages/core/tests/canvas/blur.test.ts b/packages/core/tests/canvas/blur.test.ts
index 0a477c61c..fb63fbca1 100644
--- a/packages/core/tests/canvas/blur.test.ts
+++ b/packages/core/tests/canvas/blur.test.ts
@@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from 'bun:test'
-import { SkiaRenderer } from '@open-pencil/core'
-import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io/formats/raster'
import { SceneGraph, type Effect, type SceneNode } from '@open-pencil/scene-graph'
import { expectDefined } from '../helpers/assert'
diff --git a/packages/core/tests/canvas/constraint-resize.test.ts b/packages/core/tests/canvas/constraint-resize.test.ts
index 1d74ea2ae..0a124c564 100644
--- a/packages/core/tests/canvas/constraint-resize.test.ts
+++ b/packages/core/tests/canvas/constraint-resize.test.ts
@@ -1,8 +1,8 @@
import { expect, test } from 'bun:test'
import { resolve } from 'node:path'
-import { SkiaRenderer } from '@open-pencil/core'
-import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io/formats/raster'
import { materializeDocument } from '@open-pencil/fig'
import { expectDefined } from '../helpers/assert'
diff --git a/packages/core/tests/canvas/instance-scale.test.ts b/packages/core/tests/canvas/instance-scale.test.ts
index d349a7a66..169ee096b 100644
--- a/packages/core/tests/canvas/instance-scale.test.ts
+++ b/packages/core/tests/canvas/instance-scale.test.ts
@@ -1,12 +1,12 @@
import { expect, test } from 'bun:test'
import { resolve } from 'node:path'
-import { SkiaRenderer } from '@open-pencil/core'
-import { createEditor } from '@open-pencil/core/editor'
-import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io'
+import { createEditor } from '@open-pencil/core'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io/formats/raster'
import { materializeDocument } from '@open-pencil/fig'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { rescaleNodeTree } from '@open-pencil/scene-graph'
+import { rescaleNodeTree } from '@open-pencil/scene-graph/scaling'
import { expectDefined } from '../helpers/assert'
import {
diff --git a/packages/core/tests/canvas/isolation-layer.test.ts b/packages/core/tests/canvas/isolation-layer.test.ts
index 7e140189c..123a5b131 100644
--- a/packages/core/tests/canvas/isolation-layer.test.ts
+++ b/packages/core/tests/canvas/isolation-layer.test.ts
@@ -3,8 +3,8 @@ import { afterAll, describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
import type { Canvas } from 'canvaskit-wasm'
-import { SkiaRenderer } from '@open-pencil/core'
-import { initCanvasKit } from '@open-pencil/core/io'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
const SIZE = 300
diff --git a/packages/core/tests/canvas/labels/cache.test.ts b/packages/core/tests/canvas/labels/cache.test.ts
index 6f0f357d3..da0346ada 100644
--- a/packages/core/tests/canvas/labels/cache.test.ts
+++ b/packages/core/tests/canvas/labels/cache.test.ts
@@ -1,6 +1,7 @@
import { expect, test } from 'bun:test'
-import { SceneGraph, withIcon } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { withIcon } from '@open-pencil/scene-graph/icons'
import { LabelCache } from '#core/canvas/labels/cache'
diff --git a/packages/core/tests/canvas/masks.test.ts b/packages/core/tests/canvas/masks.test.ts
index d06741724..3e5024033 100644
--- a/packages/core/tests/canvas/masks.test.ts
+++ b/packages/core/tests/canvas/masks.test.ts
@@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from 'bun:test'
-import { SkiaRenderer } from '@open-pencil/core'
-import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io/formats/raster'
import { SceneGraph, type MaskType, type SceneNode } from '@open-pencil/scene-graph'
import { expectDefined } from '../helpers/assert'
diff --git a/packages/core/tests/canvas/overlays/text-caret.test.ts b/packages/core/tests/canvas/overlays/text-caret.test.ts
index bb2c74596..45d683929 100644
--- a/packages/core/tests/canvas/overlays/text-caret.test.ts
+++ b/packages/core/tests/canvas/overlays/text-caret.test.ts
@@ -16,7 +16,11 @@ function textNode(fills: Fill[], runs: Array<[start: number, length: number, fil
return createDefaultNode(() => 'caret-text', 'TEXT', {
text: 'Text',
fills,
- styleRuns: runs.map(([start, length, runFills]) => ({ start, length, style: { fills: runFills } }))
+ styleRuns: runs.map(([start, length, runFills]) => ({
+ start,
+ length,
+ style: { fills: runFills }
+ }))
})
}
@@ -24,10 +28,13 @@ function textNode(fills: Fill[], runs: Array<[start: number, length: number, fil
describe('text caret colour', () => {
const red = solid(1, 0, 0)
const blue = solid(0, 0, 1)
- const runs = textNode([solid(0, 0, 0)], [
- [0, 2, [red]],
- [2, 2, [blue]]
- ])
+ const runs = textNode(
+ [solid(0, 0, 0)],
+ [
+ [0, 2, [red]],
+ [2, 2, [blue]]
+ ]
+ )
test("takes the fill of the character before the caret, or the first's at the start", () => {
expect(textCaretColor(runs, 4)).toEqual(blue.color)
diff --git a/packages/core/tests/canvas/paints.test.ts b/packages/core/tests/canvas/paints.test.ts
index d1b43e65d..877a168cb 100644
--- a/packages/core/tests/canvas/paints.test.ts
+++ b/packages/core/tests/canvas/paints.test.ts
@@ -2,8 +2,8 @@ import { afterAll, describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { SkiaRenderer } from '@open-pencil/core'
-import { initCanvasKit } from '@open-pencil/core/io'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import { SceneGraph, type Fill, type SceneNode } from '@open-pencil/scene-graph'
import { DEFAULT_GRADIENT_TRANSFORM } from '@open-pencil/scene-graph/gradient'
diff --git a/packages/core/tests/canvas/paths/cache.test.ts b/packages/core/tests/canvas/paths/cache.test.ts
index 5d09baf96..a315c723d 100644
--- a/packages/core/tests/canvas/paths/cache.test.ts
+++ b/packages/core/tests/canvas/paths/cache.test.ts
@@ -8,7 +8,7 @@ import { SceneGraph, type Stroke } from '@open-pencil/scene-graph'
import { SkiaRenderer } from '#core/canvas'
import { createPathCache, NodePathCaches } from '#core/canvas/paths/cache'
import { render, renderSceneToCanvas } from '#core/canvas/renderer/pipeline'
-import { initCanvasKit } from '#core/io'
+import { initCanvasKit } from '#core/io/formats/raster/headless'
const ck = await initCanvasKit()
diff --git a/packages/core/tests/canvas/renderer/selection-theme.test.ts b/packages/core/tests/canvas/renderer/selection-theme.test.ts
index 043a7e196..2e8e09c96 100644
--- a/packages/core/tests/canvas/renderer/selection-theme.test.ts
+++ b/packages/core/tests/canvas/renderer/selection-theme.test.ts
@@ -1,10 +1,10 @@
import { expect, test } from 'bun:test'
+import { expectDefined } from '#core-tests/helpers/assert'
+
import { SkiaRenderer } from '#core/canvas'
import { DEFAULT_SELECTION_THEME } from '#core/constants'
-import { initCanvasKit } from '#core/io'
-
-import { expectDefined } from '#core-tests/helpers/assert'
+import { initCanvasKit } from '#core/io/formats/raster/headless'
const ck = await initCanvasKit()
diff --git a/packages/core/tests/canvas/shadows.test.ts b/packages/core/tests/canvas/shadows.test.ts
index 4ac2f9b8d..03e67a9c0 100644
--- a/packages/core/tests/canvas/shadows.test.ts
+++ b/packages/core/tests/canvas/shadows.test.ts
@@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from 'bun:test'
-import { SkiaRenderer } from '@open-pencil/core'
-import { initCanvasKit } from '@open-pencil/core/io'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import { SceneGraph, type Effect, type SceneNode } from '@open-pencil/scene-graph'
import { separateShadowChildren } from '#core/canvas/shadows/silhouette'
diff --git a/packages/core/tests/canvas/shadows/shape.test.ts b/packages/core/tests/canvas/shadows/shape.test.ts
index 6a96b328f..5c271d797 100644
--- a/packages/core/tests/canvas/shadows/shape.test.ts
+++ b/packages/core/tests/canvas/shadows/shape.test.ts
@@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from 'bun:test'
-import { SkiaRenderer } from '@open-pencil/core'
-import { initCanvasKit } from '@open-pencil/core/io'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import { SceneGraph } from '@open-pencil/scene-graph'
import { isolatesInnerShadows } from '#core/canvas/shadows'
diff --git a/packages/core/tests/canvas/shapes.test.ts b/packages/core/tests/canvas/shapes.test.ts
index bdab343d5..5ab4e1e5f 100644
--- a/packages/core/tests/canvas/shapes.test.ts
+++ b/packages/core/tests/canvas/shapes.test.ts
@@ -1,7 +1,7 @@
import { afterAll, describe, test } from 'bun:test'
-import { SkiaRenderer } from '@open-pencil/core'
-import { initCanvasKit } from '@open-pencil/core/io'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import type { SceneGraph, SceneNode, Stroke } from '@open-pencil/scene-graph'
import { expectDefined } from '#core-tests/helpers/assert'
diff --git a/packages/core/tests/canvas/strokes/line.test.ts b/packages/core/tests/canvas/strokes/line.test.ts
index 54d6db41f..3a04fd2ce 100644
--- a/packages/core/tests/canvas/strokes/line.test.ts
+++ b/packages/core/tests/canvas/strokes/line.test.ts
@@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from 'bun:test'
-import { SkiaRenderer } from '@open-pencil/core'
-import { initCanvasKit } from '@open-pencil/core/io'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import { SceneGraph, type SceneNode, type Stroke } from '@open-pencil/scene-graph'
import { silhouetteBounds } from '#core/canvas/shadows/silhouette'
diff --git a/packages/core/tests/canvas/strokes/outlined-dashes.test.ts b/packages/core/tests/canvas/strokes/outlined-dashes.test.ts
index 3e30059c1..55c5cb175 100644
--- a/packages/core/tests/canvas/strokes/outlined-dashes.test.ts
+++ b/packages/core/tests/canvas/strokes/outlined-dashes.test.ts
@@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from 'bun:test'
-import { SkiaRenderer } from '@open-pencil/core'
-import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io/formats/raster'
import { SceneGraph, type SceneNode, type Stroke } from '@open-pencil/scene-graph'
import { expectDefined } from '#core-tests/helpers/assert'
diff --git a/packages/core/tests/canvas/strokes/sides.test.ts b/packages/core/tests/canvas/strokes/sides.test.ts
index 7ca010453..6f2ae84e3 100644
--- a/packages/core/tests/canvas/strokes/sides.test.ts
+++ b/packages/core/tests/canvas/strokes/sides.test.ts
@@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from 'bun:test'
-import { SkiaRenderer } from '@open-pencil/core'
-import { initCanvasKit } from '@open-pencil/core/io'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import type { SceneGraph, SceneNode, Stroke } from '@open-pencil/scene-graph'
import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
diff --git a/packages/core/tests/canvas/text/decorations.test.ts b/packages/core/tests/canvas/text/decorations.test.ts
index de484aaa3..e7f372587 100644
--- a/packages/core/tests/canvas/text/decorations.test.ts
+++ b/packages/core/tests/canvas/text/decorations.test.ts
@@ -1,14 +1,13 @@
import { describe, expect, test } from 'bun:test'
-
-import { toUint8Array } from 'js-base64'
-import * as v from 'valibot'
-
import { join } from 'node:path'
import { expectDefined } from '#core-tests/helpers/assert'
import { FIXTURES } from '#core-tests/helpers/paths'
+import { toUint8Array } from 'js-base64'
+import * as v from 'valibot'
-import { SceneGraph, type SceneNode, type Vector } from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import { savedDecoratedGlyphs, textDecorationRects } from '#core/canvas/text/decorations'
@@ -23,7 +22,11 @@ const Oracle = v.object({
textDecoration: v.picklist(['NONE', 'UNDERLINE', 'STRIKETHROUGH']),
textDecorationStyle: v.picklist(['SOLID', 'DOTTED', 'WAVY']),
styleRuns: v.array(
- v.object({ start: v.number(), length: v.number(), style: v.record(v.string(), v.unknown()) })
+ v.object({
+ start: v.number(),
+ length: v.number(),
+ style: v.record(v.string(), v.unknown())
+ })
),
glyphs: v.array(
v.object({
diff --git a/packages/core/tests/canvas/text/sticky-placeholder.test.ts b/packages/core/tests/canvas/text/sticky-placeholder.test.ts
index 29c251975..ebdf48371 100644
--- a/packages/core/tests/canvas/text/sticky-placeholder.test.ts
+++ b/packages/core/tests/canvas/text/sticky-placeholder.test.ts
@@ -2,7 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { createSticky, SceneGraph, stickySublayers } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { createSticky, stickySublayers } from '@open-pencil/scene-graph/generated'
import { stickyPlaceholderNode } from '#core/canvas/text/sticky-placeholder'
diff --git a/packages/core/tests/canvas/vector-stroke-joins.test.ts b/packages/core/tests/canvas/vector-stroke-joins.test.ts
index f0b6041e8..d0177619e 100644
--- a/packages/core/tests/canvas/vector-stroke-joins.test.ts
+++ b/packages/core/tests/canvas/vector-stroke-joins.test.ts
@@ -1,7 +1,7 @@
import { afterAll, describe, expect, test } from 'bun:test'
-import { SkiaRenderer } from '@open-pencil/core'
-import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io/formats/raster'
import { SceneGraph, type VectorNetwork } from '@open-pencil/scene-graph'
import { expectDefined } from '../helpers/assert'
diff --git a/packages/core/tests/clipboard/figma/connectors.test.ts b/packages/core/tests/clipboard/figma/connectors.test.ts
index f5b6dc74e..df00f358e 100644
--- a/packages/core/tests/clipboard/figma/connectors.test.ts
+++ b/packages/core/tests/clipboard/figma/connectors.test.ts
@@ -4,14 +4,11 @@ import { join } from 'node:path'
import { expectDefined } from '#core-tests/helpers/assert'
import { FIXTURES } from '#core-tests/helpers/paths'
-import {
- buildFigmaClipboardHTML,
- importClipboardNodes,
- initCodec,
- parseFigmaClipboard
-} from '@open-pencil/core'
-import { connectorSublayers, layoutConnector, SceneGraph } from '@open-pencil/scene-graph'
-import type { SceneNode } from '@open-pencil/scene-graph'
+import { buildFigmaClipboardHTML, importClipboardNodes } from '@open-pencil/core/clipboard'
+import { parseFigmaClipboard } from '@open-pencil/fig/clipboard'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { connectorSublayers, layoutConnector } from '@open-pencil/scene-graph/connectors'
import type { Vector } from '@open-pencil/scene-graph/primitives'
/** Two FigJam stickies joined by four connectors, as FigJam copies them. */
diff --git a/packages/core/tests/clipboard/figma/instance-records.test.ts b/packages/core/tests/clipboard/figma/instance-records.test.ts
index e6cf0615e..af74d76a3 100644
--- a/packages/core/tests/clipboard/figma/instance-records.test.ts
+++ b/packages/core/tests/clipboard/figma/instance-records.test.ts
@@ -3,11 +3,12 @@ import { beforeAll, expect, setDefaultTimeout, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
import { readFixtureArrayBuffer } from '#core-tests/helpers/fig/fixtures'
-import { buildFigmaClipboardHTML, parseFigmaClipboard } from '@open-pencil/core'
-import { createEditor } from '@open-pencil/core/editor'
-import { parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { createEditor } from '@open-pencil/core'
+import { buildFigmaClipboardHTML } from '@open-pencil/core/clipboard'
+import { parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { parseFigmaClipboard } from '@open-pencil/fig/clipboard'
import { symbolOverridesOf } from '@open-pencil/fig/instance-overrides'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
setDefaultTimeout(120_000)
diff --git a/packages/core/tests/clipboard/figma/variable-keys.test.ts b/packages/core/tests/clipboard/figma/variable-keys.test.ts
index 56892624b..39ae591bb 100644
--- a/packages/core/tests/clipboard/figma/variable-keys.test.ts
+++ b/packages/core/tests/clipboard/figma/variable-keys.test.ts
@@ -2,8 +2,9 @@ import { beforeAll, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { buildFigmaClipboardHTML, parseFigmaClipboard } from '@open-pencil/core'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { buildFigmaClipboardHTML } from '@open-pencil/core/clipboard'
+import { parseFigmaClipboard } from '@open-pencil/fig/clipboard'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
beforeAll(async () => {
diff --git a/packages/core/tests/design-jsx/behaviours.test.ts b/packages/core/tests/design-jsx/behaviours.test.ts
index d3b7efd48..7bb2f4878 100644
--- a/packages/core/tests/design-jsx/behaviours.test.ts
+++ b/packages/core/tests/design-jsx/behaviours.test.ts
@@ -4,12 +4,8 @@ import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { renderJSX } from '@open-pencil/core/design-jsx'
import { sceneNodeToJSX } from '@open-pencil/design-jsx'
-import {
- missingBindings,
- readBehaviour,
- SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { missingBindings, readBehaviour } from '@open-pencil/scene-graph/behaviours'
async function render(jsx: string) {
const graph = new SceneGraph()
diff --git a/packages/core/tests/design-jsx/connectors.test.ts b/packages/core/tests/design-jsx/connectors.test.ts
index d58d120aa..5cf890c6b 100644
--- a/packages/core/tests/design-jsx/connectors.test.ts
+++ b/packages/core/tests/design-jsx/connectors.test.ts
@@ -9,7 +9,8 @@ import {
selectionToJSX,
selectionToJSXWithLayers
} from '@open-pencil/design-jsx'
-import { connectorRouteEnds, connectorSublayers, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { connectorRouteEnds, connectorSublayers } from '@open-pencil/scene-graph/connectors'
const FLOW = `
<Frame name="Flow" w={800} h={400}>
diff --git a/packages/core/tests/design-jsx/export-round-trip.test.ts b/packages/core/tests/design-jsx/export-round-trip.test.ts
index 4fd4bb710..a1aace43b 100644
--- a/packages/core/tests/design-jsx/export-round-trip.test.ts
+++ b/packages/core/tests/design-jsx/export-round-trip.test.ts
@@ -6,7 +6,8 @@ import { pick } from 'es-toolkit'
import { renderJSX } from '@open-pencil/core/design-jsx'
import { sceneNodeToJSX } from '@open-pencil/design-jsx'
-import { SceneGraph, shaderOfPaint } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { shaderOfPaint } from '@open-pencil/scene-graph/shaders'
describe('attribute string round-trip', () => {
it.each([
diff --git a/packages/core/tests/design-jsx/fill-sizing.test.ts b/packages/core/tests/design-jsx/fill-sizing.test.ts
index 7b4db5833..9af3ea2da 100644
--- a/packages/core/tests/design-jsx/fill-sizing.test.ts
+++ b/packages/core/tests/design-jsx/fill-sizing.test.ts
@@ -5,7 +5,8 @@ import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { renderJSX } from '@open-pencil/core/design-jsx'
import { computeAllLayouts } from '@open-pencil/core/layout'
import { sceneNodeToJSX } from '@open-pencil/design-jsx'
-import { layoutSizing, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { layoutSizing } from '@open-pencil/scene-graph/layout'
const makeSceneGraph = () => new SceneGraph()
diff --git a/packages/core/tests/design-jsx/instance-properties.test.ts b/packages/core/tests/design-jsx/instance-properties.test.ts
index 73bebb66d..37ff76004 100644
--- a/packages/core/tests/design-jsx/instance-properties.test.ts
+++ b/packages/core/tests/design-jsx/instance-properties.test.ts
@@ -1,9 +1,9 @@
import { expect, test } from 'bun:test'
import { renderJSX, renderTree } from '@open-pencil/core/design-jsx'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { Component, Instance, Text } from '@open-pencil/design-jsx'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
const CARD = `
diff --git a/packages/core/tests/design-jsx/shapes-with-text.test.ts b/packages/core/tests/design-jsx/shapes-with-text.test.ts
index 340d72982..f0fc3988e 100644
--- a/packages/core/tests/design-jsx/shapes-with-text.test.ts
+++ b/packages/core/tests/design-jsx/shapes-with-text.test.ts
@@ -4,7 +4,8 @@ import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { renderJSX } from '@open-pencil/core/design-jsx'
import { sceneNodeToJSX } from '@open-pencil/design-jsx'
-import { SceneGraph, shapeWithTextLabel } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { shapeWithTextLabel } from '@open-pencil/scene-graph/generated'
const BOARD = `
<Frame name="Board" w={900} h={400}>
diff --git a/packages/core/tests/design-jsx/stickies.test.ts b/packages/core/tests/design-jsx/stickies.test.ts
index 7a250a4d3..dadfb8b3c 100644
--- a/packages/core/tests/design-jsx/stickies.test.ts
+++ b/packages/core/tests/design-jsx/stickies.test.ts
@@ -4,12 +4,8 @@ import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { renderJSX } from '@open-pencil/core/design-jsx'
import { sceneNodeToJSX } from '@open-pencil/design-jsx'
-import {
- DEFAULT_STICKY_COLOR,
- SceneGraph,
- STICKY_COLORS,
- stickySublayers
-} from '@open-pencil/scene-graph'
+import { DEFAULT_STICKY_COLOR, STICKY_COLORS, stickySublayers } from '@open-pencil/scene-graph/generated'
+import { SceneGraph } from '@open-pencil/scene-graph'
const BOARD = `
<Frame name="Board" w={900} h={400}>
diff --git a/packages/core/tests/editor/bridges/frames.test.ts b/packages/core/tests/editor/bridges/frames.test.ts
index 3ff5fcafc..699b1a7f5 100644
--- a/packages/core/tests/editor/bridges/frames.test.ts
+++ b/packages/core/tests/editor/bridges/frames.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
const VIEWPORT = { width: 800, height: 600 }
@@ -9,7 +9,12 @@ describe('frame navigation', () => {
function frames() {
const editor = createEditor({ getViewportSize: () => VIEWPORT })
const pageId = editor.state.currentPageId
- const right = editor.graph.createNode('FRAME', pageId, { x: 600, y: 0, width: 100, height: 100 })
+ const right = editor.graph.createNode('FRAME', pageId, {
+ x: 600,
+ y: 0,
+ width: 100,
+ height: 100
+ })
const left = editor.graph.createNode('FRAME', pageId, { x: 0, y: 0, width: 100, height: 100 })
const section = editor.graph.createNode('SECTION', pageId, { x: 200, y: 0, width: 300 })
const inSection = editor.graph.createNode('COMPONENT', section.id, {
diff --git a/packages/core/tests/editor/clipboard/binding-corruption.test.ts b/packages/core/tests/editor/clipboard/binding-corruption.test.ts
index 63ee6017c..f82655d06 100644
--- a/packages/core/tests/editor/clipboard/binding-corruption.test.ts
+++ b/packages/core/tests/editor/clipboard/binding-corruption.test.ts
@@ -2,9 +2,10 @@ import { describe, expect, test } from 'bun:test'
import { expectDefined, getNodeOrThrow } from '#core-tests/helpers/assert'
-import { SceneGraph } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { createInstanceOverrideState } from '@open-pencil/scene-graph/instances/overrides'
+
import { collectSubtrees } from '#core/editor/history/subtree'
-import { createInstanceOverrideState } from '@open-pencil/scene-graph'
function pageId(graph: SceneGraph): string {
return graph.getPages()[0].id
diff --git a/packages/core/tests/editor/clipboard/delete.test.ts b/packages/core/tests/editor/clipboard/delete.test.ts
index 1c5d1d971..2e324a22d 100644
--- a/packages/core/tests/editor/clipboard/delete.test.ts
+++ b/packages/core/tests/editor/clipboard/delete.test.ts
@@ -3,7 +3,7 @@ import { describe, expect, test } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { autoFrame, rect } from '#core-tests/helpers/layout'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { computeAllLayouts } from '@open-pencil/core/layout'
describe('deleteSelected', () => {
diff --git a/packages/core/tests/editor/clipboard/duplicate-order.test.ts b/packages/core/tests/editor/clipboard/duplicate-order.test.ts
index e7cdbe15e..23dc461ee 100644
--- a/packages/core/tests/editor/clipboard/duplicate-order.test.ts
+++ b/packages/core/tests/editor/clipboard/duplicate-order.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
let editor: Editor
diff --git a/packages/core/tests/editor/clipboard/fig-transfer-history.test.ts b/packages/core/tests/editor/clipboard/fig-transfer-history.test.ts
index a79e42c51..b94320626 100644
--- a/packages/core/tests/editor/clipboard/fig-transfer-history.test.ts
+++ b/packages/core/tests/editor/clipboard/fig-transfer-history.test.ts
@@ -3,10 +3,10 @@ import { expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
import { CapturedFigRecords, readFixture } from '#core-tests/helpers/fig/fixtures'
+import { createEditor } from '@open-pencil/core'
import { buildFigmaClipboardHTML } from '@open-pencil/core/clipboard'
-import { createEditor } from '@open-pencil/core/editor'
-import { initCodec } from '@open-pencil/core/kiwi'
import { materializeFigFragment } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { CommittedGraphEventError } from '@open-pencil/scene-graph'
const fixture = readFixture('nested-binding-ownership-records.json', CapturedFigRecords)
diff --git a/packages/core/tests/editor/clipboard/figma-images.test.ts b/packages/core/tests/editor/clipboard/figma-images.test.ts
index 911127f26..d3e33b27d 100644
--- a/packages/core/tests/editor/clipboard/figma-images.test.ts
+++ b/packages/core/tests/editor/clipboard/figma-images.test.ts
@@ -2,10 +2,9 @@ import { beforeAll, describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { initCodec } from '@open-pencil/core'
+import { createEditor, type ClipboardImageResolution } from '@open-pencil/core'
import { buildFigmaClipboardHTML } from '@open-pencil/core/clipboard'
-import { createEditor } from '@open-pencil/core/editor'
-import type { ClipboardImageResolution } from '@open-pencil/core/editor'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
const IMAGE_HASH_A = '1111111111111111111111111111111111111111'
const IMAGE_HASH_B = '2222222222222222222222222222222222222222'
diff --git a/packages/core/tests/editor/clipboard/file-placement.test.ts b/packages/core/tests/editor/clipboard/file-placement.test.ts
index 5d34f441f..a6cf3fa58 100644
--- a/packages/core/tests/editor/clipboard/file-placement.test.ts
+++ b/packages/core/tests/editor/clipboard/file-placement.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
function svgFile(name = 'mark.svg', width = 40, height = 20) {
return new File(
diff --git a/packages/core/tests/editor/clipboard/import-nodes/components.test.ts b/packages/core/tests/editor/clipboard/import-nodes/components.test.ts
index d3f240647..ca7b68301 100644
--- a/packages/core/tests/editor/clipboard/import-nodes/components.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/components.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, it } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { createClipboardGraph } from '#core-tests/helpers/clipboard'
-import { importClipboardNodes } from '@open-pencil/core'
-import type { NodeChange } from '@open-pencil/core'
+import { importClipboardNodes } from '@open-pencil/core/clipboard'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
describe('importClipboardNodes: components', () => {
it('maps SYMBOL type to COMPONENT with auto-layout', () => {
diff --git a/packages/core/tests/editor/clipboard/import-nodes/filtering.test.ts b/packages/core/tests/editor/clipboard/import-nodes/filtering.test.ts
index b57d88df6..3dc23a839 100644
--- a/packages/core/tests/editor/clipboard/import-nodes/filtering.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/filtering.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, it } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { createClipboardGraph } from '#core-tests/helpers/clipboard'
-import { importClipboardNodes } from '@open-pencil/core'
-import type { NodeChange } from '@open-pencil/core'
+import { importClipboardNodes } from '@open-pencil/core/clipboard'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
describe('importClipboardNodes: filtering', () => {
it('skips VARIABLE_SET and VARIABLE nodes', () => {
diff --git a/packages/core/tests/editor/clipboard/import-nodes/hierarchy.test.ts b/packages/core/tests/editor/clipboard/import-nodes/hierarchy.test.ts
index c3bc13d55..9932bddd4 100644
--- a/packages/core/tests/editor/clipboard/import-nodes/hierarchy.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/hierarchy.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, it } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { createClipboardGraph } from '#core-tests/helpers/clipboard'
-import { importClipboardNodes } from '@open-pencil/core'
-import type { NodeChange } from '@open-pencil/core'
+import { importClipboardNodes } from '@open-pencil/core/clipboard'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
describe('importClipboardNodes: hierarchy', () => {
it('imports nested frames with children', () => {
diff --git a/packages/core/tests/editor/clipboard/import-nodes/instance-linkage.test.ts b/packages/core/tests/editor/clipboard/import-nodes/instance-linkage.test.ts
index 66e75791d..7220c3d87 100644
--- a/packages/core/tests/editor/clipboard/import-nodes/instance-linkage.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/instance-linkage.test.ts
@@ -2,9 +2,9 @@ import { describe, expect, it } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
-import { importClipboardNodes } from '@open-pencil/core'
-import type { NodeChange } from '@open-pencil/core'
+import { importClipboardNodes } from '@open-pencil/core/clipboard'
import { linkImportedInstanceChildren } from '@open-pencil/fig/node-change'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
describe('importClipboardNodes: instance child linkage', () => {
diff --git a/packages/core/tests/editor/clipboard/import-nodes/paste-scope.test.ts b/packages/core/tests/editor/clipboard/import-nodes/paste-scope.test.ts
index 3eddb1067..148c35454 100644
--- a/packages/core/tests/editor/clipboard/import-nodes/paste-scope.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/paste-scope.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'bun:test'
-import { importClipboardNodes } from '@open-pencil/core'
-import type { NodeChange } from '@open-pencil/core'
+import { importClipboardNodes } from '@open-pencil/core/clipboard'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
describe('importClipboardNodes: paste linkage scoping', () => {
diff --git a/packages/core/tests/editor/clipboard/import-nodes/styling.test.ts b/packages/core/tests/editor/clipboard/import-nodes/styling.test.ts
index 04dcf4fd1..c9eaac28f 100644
--- a/packages/core/tests/editor/clipboard/import-nodes/styling.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/styling.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, it } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { createClipboardGraph } from '#core-tests/helpers/clipboard'
-import { importClipboardNodes } from '@open-pencil/core'
-import type { NodeChange } from '@open-pencil/core'
+import { importClipboardNodes } from '@open-pencil/core/clipboard'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
describe('importClipboardNodes: styling', () => {
it('preserves fills and strokes', () => {
diff --git a/packages/core/tests/editor/clipboard/import-nodes/text/metrics.test.ts b/packages/core/tests/editor/clipboard/import-nodes/text/metrics.test.ts
index d5c454ae9..74371390e 100644
--- a/packages/core/tests/editor/clipboard/import-nodes/text/metrics.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/text/metrics.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, it } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { createClipboardGraph } from '#core-tests/helpers/clipboard'
-import { importClipboardNodes } from '@open-pencil/core'
-import type { NodeChange } from '@open-pencil/core'
+import { importClipboardNodes } from '@open-pencil/core/clipboard'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
describe('importClipboardNodes: text metrics', () => {
it('imports fontWeight from fontName.style via styleToWeight', () => {
diff --git a/packages/core/tests/editor/clipboard/import-nodes/undo/redo.test.ts b/packages/core/tests/editor/clipboard/import-nodes/undo/redo.test.ts
index e2f7377d2..28584256b 100644
--- a/packages/core/tests/editor/clipboard/import-nodes/undo/redo.test.ts
+++ b/packages/core/tests/editor/clipboard/import-nodes/undo/redo.test.ts
@@ -3,8 +3,9 @@ import { describe, expect, it } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { createClipboardGraph } from '#core-tests/helpers/clipboard'
-import { importClipboardNodes } from '@open-pencil/core'
-import type { NodeChange, SceneNode } from '@open-pencil/core'
+import { importClipboardNodes } from '@open-pencil/core/clipboard'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { SceneNode } from '@open-pencil/scene-graph'
describe('importClipboardNodes: undo redo', () => {
it('undo removes all imported nodes including children', () => {
diff --git a/packages/core/tests/editor/clipboard/paste/properties.test.ts b/packages/core/tests/editor/clipboard/paste/properties.test.ts
index fe486bd66..6a8f9c9de 100644
--- a/packages/core/tests/editor/clipboard/paste/properties.test.ts
+++ b/packages/core/tests/editor/clipboard/paste/properties.test.ts
@@ -1,10 +1,11 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { getNodeOrThrow } from '#core-tests/helpers/assert'
+
+import { createEditor, type Editor } from '@open-pencil/core'
import { colorToFill } from '@open-pencil/scene-graph/color'
import { withResolvableLinks } from '#core/editor/clipboard/paste/properties'
-import { getNodeOrThrow } from '#core-tests/helpers/assert'
const LINK = { type: 'URL', value: 'https://example.com/' } as const
const RED = colorToFill('#ff0000')
diff --git a/packages/core/tests/editor/clipboard/paste/replace.test.ts b/packages/core/tests/editor/clipboard/paste/replace.test.ts
index 0023d652a..0245ef3b5 100644
--- a/packages/core/tests/editor/clipboard/paste/replace.test.ts
+++ b/packages/core/tests/editor/clipboard/paste/replace.test.ts
@@ -1,8 +1,7 @@
import { describe, expect, test } from 'bun:test'
+import { createEditor, type Editor } from '@open-pencil/core'
import { buildOpenPencilClipboardHTML } from '@open-pencil/core/clipboard'
-import { createEditor } from '@open-pencil/core/editor'
-import type { Editor } from '@open-pencil/core/editor'
import { getAxisAlignedWorldBounds, getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
function copiedRectangleHTML(name = 'Pasted') {
diff --git a/packages/core/tests/editor/clipboard/paste/target.test.ts b/packages/core/tests/editor/clipboard/paste/target.test.ts
index 5dad71b69..81d0b26dd 100644
--- a/packages/core/tests/editor/clipboard/paste/target.test.ts
+++ b/packages/core/tests/editor/clipboard/paste/target.test.ts
@@ -1,9 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import {
- createEditor,
- resolvePasteTarget as publicResolvePasteTarget
-} from '@open-pencil/core/editor'
+import { createEditor, resolvePasteTarget as publicResolvePasteTarget } from '@open-pencil/core'
import { SceneGraph } from '@open-pencil/scene-graph'
import { resolvePasteTarget } from '#core/editor/clipboard/paste/target'
diff --git a/packages/core/tests/editor/clipboard/placement.test.ts b/packages/core/tests/editor/clipboard/placement.test.ts
index 2710c9dcd..fb9b8570a 100644
--- a/packages/core/tests/editor/clipboard/placement.test.ts
+++ b/packages/core/tests/editor/clipboard/placement.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import { getAxisAlignedWorldBounds, getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import Matrix from '@open-pencil/scene-graph/matrix'
diff --git a/packages/core/tests/editor/clipboard/statuses.test.ts b/packages/core/tests/editor/clipboard/statuses.test.ts
index 769ddd265..8398dde3b 100644
--- a/packages/core/tests/editor/clipboard/statuses.test.ts
+++ b/packages/core/tests/editor/clipboard/statuses.test.ts
@@ -2,9 +2,9 @@ import { afterEach, describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
+import { createEditor, type Editor } from '@open-pencil/core'
import { buildFigmaClipboardHTML } from '@open-pencil/core/clipboard'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
let editor: Editor
diff --git a/packages/core/tests/editor/clipboard/svg-paste.test.ts b/packages/core/tests/editor/clipboard/svg-paste.test.ts
index 888d92648..992ad03de 100644
--- a/packages/core/tests/editor/clipboard/svg-paste.test.ts
+++ b/packages/core/tests/editor/clipboard/svg-paste.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
const BADGE = `<?xml version="1.0"?>
<svg id="badge" viewBox="0 0 40 20"><g id="dot"><circle cx="10" cy="10" r="10"/></g></svg>`
diff --git a/packages/core/tests/editor/components/authoring.test.ts b/packages/core/tests/editor/components/authoring.test.ts
index c99a6c251..5f378f5fe 100644
--- a/packages/core/tests/editor/components/authoring.test.ts
+++ b/packages/core/tests/editor/components/authoring.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
function setup() {
const editor = createEditor()
@@ -275,7 +275,9 @@ describe('manual component property authoring', () => {
editor.undo.undo()
expect(nested.isExposedInstance).toBe(false)
await Promise.resolve()
- const copy = defined(editor.graph.getChildren(instance.id).find((node) => node.type === 'INSTANCE'))
+ const copy = defined(
+ editor.graph.getChildren(instance.id).find((node) => node.type === 'INSTANCE')
+ )
expect(editor.setInstanceExposed(copy.id, true)).toBe(false)
})
})
diff --git a/packages/core/tests/editor/components/behaviours.test.ts b/packages/core/tests/editor/components/behaviours.test.ts
index 6411175a7..e4d29ee69 100644
--- a/packages/core/tests/editor/components/behaviours.test.ts
+++ b/packages/core/tests/editor/components/behaviours.test.ts
@@ -2,13 +2,13 @@ import { describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import {
emptyBehaviour,
missingBindings,
readBehaviour,
type Behaviour
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/behaviours'
describe('setBehaviour', () => {
test('adds, edits, and removes as single undo steps', () => {
diff --git a/packages/core/tests/editor/components/combine-variants.test.ts b/packages/core/tests/editor/components/combine-variants.test.ts
index e1a7ca3c6..f8e74dabf 100644
--- a/packages/core/tests/editor/components/combine-variants.test.ts
+++ b/packages/core/tests/editor/components/combine-variants.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { FigmaAPI } from '@open-pencil/core/figma-api'
// Recorded in Figma desktop 126: Combine as variants from the canvas pads the set and outlines it;
diff --git a/packages/core/tests/editor/components/create-component.test.ts b/packages/core/tests/editor/components/create-component.test.ts
index e937f4254..82b6dd364 100644
--- a/packages/core/tests/editor/components/create-component.test.ts
+++ b/packages/core/tests/editor/components/create-component.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
// Recorded in Figma desktop 126 with Create component from the canvas.
diff --git a/packages/core/tests/editor/components/cycles.test.ts b/packages/core/tests/editor/components/cycles.test.ts
index 9915df051..34fc3e5d3 100644
--- a/packages/core/tests/editor/components/cycles.test.ts
+++ b/packages/core/tests/editor/components/cycles.test.ts
@@ -2,7 +2,7 @@ import { expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { FigmaAPI } from '@open-pencil/core/figma-api'
/** Button holds an Inner frame; Card shows a Button. */
diff --git a/packages/core/tests/editor/components/instance-structure.test.ts b/packages/core/tests/editor/components/instance-structure.test.ts
index 3dcb90835..e7b56e519 100644
--- a/packages/core/tests/editor/components/instance-structure.test.ts
+++ b/packages/core/tests/editor/components/instance-structure.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
+
import { compact } from 'es-toolkit'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
// Each case repeats a Figma desktop 126 script: the instance mirrors the component's new
diff --git a/packages/core/tests/editor/components/library-capabilities.test.ts b/packages/core/tests/editor/components/library-capabilities.test.ts
index 60ebfd90f..1b8cb6286 100644
--- a/packages/core/tests/editor/components/library-capabilities.test.ts
+++ b/packages/core/tests/editor/components/library-capabilities.test.ts
@@ -4,7 +4,7 @@ import {
assertNodeEditable,
getNodeEditCapability,
ReadOnlyLibraryDefinitionError
-} from '@open-pencil/core/editor'
+} from '@open-pencil/core'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { updateNode } from '@open-pencil/core/tools/modify'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/core/tests/editor/components/properties.test.ts b/packages/core/tests/editor/components/properties.test.ts
index b431d6195..6f7cd9f3c 100644
--- a/packages/core/tests/editor/components/properties.test.ts
+++ b/packages/core/tests/editor/components/properties.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
function childByName(editor: ReturnType<typeof createEditor>, parentId: string, name: string) {
return editor.graph.getChildren(parentId).find((node) => node.name === name)
diff --git a/packages/core/tests/editor/components/slots/authoring.test.ts b/packages/core/tests/editor/components/slots/authoring.test.ts
index 675ce8ca4..c1dcef039 100644
--- a/packages/core/tests/editor/components/slots/authoring.test.ts
+++ b/packages/core/tests/editor/components/slots/authoring.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
-import { instanceSlotFrames, slotPropertyId } from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import { instanceSlotFrames, slotPropertyId } from '@open-pencil/scene-graph/slots'
/** A Card component with a Body frame holding Default, and an instance of it. */
function setup() {
diff --git a/packages/core/tests/editor/components/slots/content.test.ts b/packages/core/tests/editor/components/slots/content.test.ts
index 6f1e36e35..a81ee5487 100644
--- a/packages/core/tests/editor/components/slots/content.test.ts
+++ b/packages/core/tests/editor/components/slots/content.test.ts
@@ -2,8 +2,9 @@ import { describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { createEditor } from '@open-pencil/core/editor'
-import { ownsSlotContent, slotPropertyId, type SceneNode } from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { ownsSlotContent, slotPropertyId } from '@open-pencil/scene-graph/slots'
/** A Card component whose `Body` slot holds `Default`, an instance of it, and a free layer. */
function setup() {
diff --git a/packages/core/tests/editor/components/transitive-sync.test.ts b/packages/core/tests/editor/components/transitive-sync.test.ts
index 41ce4c073..6437edbb6 100644
--- a/packages/core/tests/editor/components/transitive-sync.test.ts
+++ b/packages/core/tests/editor/components/transitive-sync.test.ts
@@ -2,7 +2,7 @@ import { expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { SceneGraph } from '@open-pencil/scene-graph'
test('component edits propagate across definition dependencies and undo/redo', async () => {
diff --git a/packages/core/tests/editor/components/variants.test.ts b/packages/core/tests/editor/components/variants.test.ts
index 77f7943f3..0b9152518 100644
--- a/packages/core/tests/editor/components/variants.test.ts
+++ b/packages/core/tests/editor/components/variants.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
function setupVariants() {
const editor = createEditor()
diff --git a/packages/core/tests/editor/components/variants/add.test.ts b/packages/core/tests/editor/components/variants/add.test.ts
index 58efd2524..5481e738c 100644
--- a/packages/core/tests/editor/components/variants/add.test.ts
+++ b/packages/core/tests/editor/components/variants/add.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
function defined<T>(value: T | null | undefined): T {
if (value == null) throw new Error('Expected value')
diff --git a/packages/core/tests/editor/connectors/draw.test.ts b/packages/core/tests/editor/connectors/draw.test.ts
index 5655381fd..1d502925a 100644
--- a/packages/core/tests/editor/connectors/draw.test.ts
+++ b/packages/core/tests/editor/connectors/draw.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
-import { boundEndpoint, createConnector, freeEndpoint } from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import { boundEndpoint, createConnector, freeEndpoint } from '@open-pencil/scene-graph/connectors'
+
import { connectorAttachment, magnetAt } from '#core/editor/connectors/attach'
function setup() {
@@ -47,10 +48,15 @@ describe('where a connector end attaches', () => {
test('a straight connector attaches by centres', () => {
const { editor, page, a } = setup()
- const { endpoint } = connectorAttachment(editor.graph, page, { x: 30, y: 16 }, {
- zoom: 1,
- straight: true
- })
+ const { endpoint } = connectorAttachment(
+ editor.graph,
+ page,
+ { x: 30, y: 16 },
+ {
+ zoom: 1,
+ straight: true
+ }
+ )
expect(endpoint).toEqual({ nodeId: a.id, magnet: 'CENTER', position: { x: 0, y: 0 } })
})
})
@@ -96,7 +102,10 @@ describe('the connector tool', () => {
const [connector] = connectors(editor)
expect(connector.connectorStart).toMatchObject({ nodeId: a.id, magnet: 'AUTO' })
expect(connector.connectorEnd).toMatchObject({ nodeId: b.id, magnet: 'AUTO' })
- expect([connector.connectorStartCap, connector.connectorEndCap]).toEqual(['NONE', 'ARROW_LINES'])
+ expect([connector.connectorStartCap, connector.connectorEndCap]).toEqual([
+ 'NONE',
+ 'ARROW_LINES'
+ ])
expect(editor.state.activeTool).toBe('CONNECTOR')
editor.undoAction()
expect(connectors(editor)).toHaveLength(0)
@@ -170,8 +179,18 @@ describe('dropping a connector end', () => {
const editor = createEditor()
const page = editor.state.currentPageId
const frame = editor.graph.createNode('FRAME', page, { x: 0, y: 0, width: 1000, height: 600 })
- const a = editor.graph.createNode('RECTANGLE', frame.id, { x: 100, y: 100, width: 200, height: 200 })
- const b = editor.graph.createNode('RECTANGLE', frame.id, { x: 600, y: 100, width: 200, height: 200 })
+ const a = editor.graph.createNode('RECTANGLE', frame.id, {
+ x: 100,
+ y: 100,
+ width: 200,
+ height: 200
+ })
+ const b = editor.graph.createNode('RECTANGLE', frame.id, {
+ x: 600,
+ y: 100,
+ width: 200,
+ height: 200
+ })
const connector = createConnector(editor.graph, frame.id, {
start: boundEndpoint(a.id),
end: boundEndpoint(b.id)
@@ -193,14 +212,21 @@ describe('dropping a connector end', () => {
test('on a layer inside a frame attaches to that layer', () => {
const { editor, connector } = framed()
- const c = editor.graph.createNode('RECTANGLE', editor.graph.getNode(connector.id)?.parentId ?? '', {
- x: 350,
- y: 400,
- width: 150,
- height: 150
- })
+ const c = editor.graph.createNode(
+ 'RECTANGLE',
+ editor.graph.getNode(connector.id)?.parentId ?? '',
+ {
+ x: 350,
+ y: 400,
+ width: 150,
+ height: 150
+ }
+ )
dropEnd(editor, connector.id, 425, 475)
- expect(editor.graph.getNode(connector.id)?.connectorEnd).toMatchObject({ nodeId: c.id, magnet: 'AUTO' })
+ expect(editor.graph.getNode(connector.id)?.connectorEnd).toMatchObject({
+ nodeId: c.id,
+ magnet: 'AUTO'
+ })
})
test('on a layer outside a frame that does not clip attaches to that layer', () => {
diff --git a/packages/core/tests/editor/connectors/routing.test.ts b/packages/core/tests/editor/connectors/routing.test.ts
index 7418e8091..ce57427a2 100644
--- a/packages/core/tests/editor/connectors/routing.test.ts
+++ b/packages/core/tests/editor/connectors/routing.test.ts
@@ -2,16 +2,15 @@ import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { computeAllLayouts, setTextMeasurer } from '@open-pencil/core'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
+import { computeAllLayouts, setTextMeasurer } from '@open-pencil/core/layout'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
import {
boundEndpoint,
buildConnectorSublayers,
connectorSublayers,
- freeEndpoint,
- SceneGraph
-} from '@open-pencil/scene-graph'
-import type { SceneNode } from '@open-pencil/scene-graph'
+ freeEndpoint
+} from '@open-pencil/scene-graph/connectors'
/** Two boxes 300 apart with an elbow from the first's right side to the second's left. */
function setup() {
diff --git a/packages/core/tests/editor/connectors/style.test.ts b/packages/core/tests/editor/connectors/style.test.ts
index 1240f157b..e4d2e3387 100644
--- a/packages/core/tests/editor/connectors/style.test.ts
+++ b/packages/core/tests/editor/connectors/style.test.ts
@@ -2,13 +2,9 @@ import { describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { createEditor } from '@open-pencil/core/editor'
-import {
- boundEndpoint,
- buildConnectorSublayers,
- connectorSublayers,
- figJamColor
-} from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import { boundEndpoint, buildConnectorSublayers, connectorSublayers } from '@open-pencil/scene-graph/connectors'
+import { figJamColor } from '@open-pencil/scene-graph/figjam'
function setup() {
const editor = createEditor()
diff --git a/packages/core/tests/editor/design-tokens.test.ts b/packages/core/tests/editor/design-tokens.test.ts
index c486b8add..f5113bc40 100644
--- a/packages/core/tests/editor/design-tokens.test.ts
+++ b/packages/core/tests/editor/design-tokens.test.ts
@@ -1,12 +1,9 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
-import {
- getSharedStyles,
- parseVariableFormula,
- SceneGraph,
- type Variable
-} from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import { SceneGraph, type Variable } from '@open-pencil/scene-graph'
+import { getSharedStyles } from '@open-pencil/scene-graph/shared-styles'
+import { parseVariableFormula } from '@open-pencil/scene-graph/variables'
import {
defaultTokenImportOptions,
diff --git a/packages/core/tests/editor/effects-and-resize.test.ts b/packages/core/tests/editor/effects-and-resize.test.ts
index 12d237711..664395ec2 100644
--- a/packages/core/tests/editor/effects-and-resize.test.ts
+++ b/packages/core/tests/editor/effects-and-resize.test.ts
@@ -1,6 +1,6 @@
import { describe, test, expect } from 'bun:test'
-import { SceneGraph, type Effect } from '@open-pencil/core'
+import { SceneGraph, type Effect } from '@open-pencil/scene-graph'
import type { Rect } from '@open-pencil/scene-graph/primitives'
import { getNodeOrThrow } from '../helpers/assert'
diff --git a/packages/core/tests/editor/fig-compression.test.ts b/packages/core/tests/editor/fig-compression.test.ts
index 53739f851..50d025c90 100644
--- a/packages/core/tests/editor/fig-compression.test.ts
+++ b/packages/core/tests/editor/fig-compression.test.ts
@@ -1,7 +1,7 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
-import { hasPluginData, OPEN_PENCIL_PLUGIN_DATA } from '@open-pencil/scene-graph'
+import { createEditor, type Editor } from '@open-pencil/core'
+import { hasPluginData, OPEN_PENCIL_PLUGIN_DATA } from '@open-pencil/scene-graph/plugin-data'
let editor: Editor
diff --git a/packages/core/tests/editor/frame-presets.test.ts b/packages/core/tests/editor/frame-presets.test.ts
index aff742ec6..9103d23e3 100644
--- a/packages/core/tests/editor/frame-presets.test.ts
+++ b/packages/core/tests/editor/frame-presets.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { computeLayout } from '@open-pencil/core/layout'
import { getNodeOrThrow } from '../helpers/assert'
diff --git a/packages/core/tests/editor/graph/replacement.test.ts b/packages/core/tests/editor/graph/replacement.test.ts
index 662d6cd6b..94639dbf6 100644
--- a/packages/core/tests/editor/graph/replacement.test.ts
+++ b/packages/core/tests/editor/graph/replacement.test.ts
@@ -1,7 +1,7 @@
import { expect, mock, test } from 'bun:test'
+import { createEditor } from '@open-pencil/core'
import type { SkiaRenderer } from '@open-pencil/core/canvas'
-import { createEditor } from '@open-pencil/core/editor'
import { SceneGraph } from '@open-pencil/scene-graph'
test('graph replacement clears tiled state even when page IDs are reused', () => {
diff --git a/packages/core/tests/editor/guides.test.ts b/packages/core/tests/editor/guides.test.ts
index f4f369333..8ea3dd553 100644
--- a/packages/core/tests/editor/guides.test.ts
+++ b/packages/core/tests/editor/guides.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { expectDefined } from '../helpers/assert'
diff --git a/packages/core/tests/editor/history/atomic-tools.test.ts b/packages/core/tests/editor/history/atomic-tools.test.ts
index af2eea5d5..d5dc2424f 100644
--- a/packages/core/tests/editor/history/atomic-tools.test.ts
+++ b/packages/core/tests/editor/history/atomic-tools.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { OpenPencilAPI } from '@open-pencil/core'
-import { createEditor, executeAtomicTool } from '@open-pencil/core/editor'
+import { OpenPencilAPI } from '@open-pencil/core/openpencil-api'
+import { createEditor, executeAtomicTool } from '@open-pencil/core'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { ALL_TOOLS, type ToolDef } from '@open-pencil/core/tools'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/core/tests/editor/history/document-change.test.ts b/packages/core/tests/editor/history/document-change.test.ts
index 5ac12e6ee..ecc913a3e 100644
--- a/packages/core/tests/editor/history/document-change.test.ts
+++ b/packages/core/tests/editor/history/document-change.test.ts
@@ -2,12 +2,9 @@ import { describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import {
- createEditor,
- graphFromDocumentChange,
- isEmptyDocumentChange
-} from '@open-pencil/core/editor'
-import { readComments, writeComments, type CommentThread } from '@open-pencil/scene-graph'
+import { createEditor, graphFromDocumentChange, isEmptyDocumentChange } from '@open-pencil/core'
+import type { CommentThread } from '@open-pencil/scene-graph'
+import { readComments, writeComments } from '@open-pencil/scene-graph/comments'
function setup() {
const editor = createEditor()
@@ -77,7 +74,7 @@ describe('document changes', () => {
const { editor, pageId, card, title, other } = setup()
roundTrip(editor, () => {
editor.graph.insertChildAt(title.id, other.id, 0)
- editor.graph.reorderChild(other.id, pageId, 0)
+ editor.graph.insertChildAt(other.id, pageId, 0)
})
roundTrip(editor, () => {
editor.graph.reparentNode(other.id, card.id)
diff --git a/packages/core/tests/editor/history/snapshot-graph.test.ts b/packages/core/tests/editor/history/snapshot-graph.test.ts
index b155eb7df..6f2142d69 100644
--- a/packages/core/tests/editor/history/snapshot-graph.test.ts
+++ b/packages/core/tests/editor/history/snapshot-graph.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { createEditor, graphFromPageSnapshot } from '@open-pencil/core/editor'
+import { createEditor, graphFromPageSnapshot } from '@open-pencil/core'
import {
comparePNGs,
createCanvasKitRasterCodec,
diff --git a/packages/core/tests/editor/icons.test.ts b/packages/core/tests/editor/icons.test.ts
index 02ad5662b..e6710a059 100644
--- a/packages/core/tests/editor/icons.test.ts
+++ b/packages/core/tests/editor/icons.test.ts
@@ -1,8 +1,9 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { parseIconName, type IconProvider } from '@open-pencil/core/icons'
-import { isIconModified, readIcon, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { isIconModified, readIcon } from '@open-pencil/scene-graph/icons'
import type { Color } from '@open-pencil/scene-graph/primitives'
import { buildIconData } from '#core/icons/svg'
@@ -144,7 +145,10 @@ describe('icon commands across a document change', () => {
return provider.icons(names, size)
}
}
- const editor = createEditor({ getViewportSize: () => ({ width: 1000, height: 800 }), icons: slow })
+ const editor = createEditor({
+ getViewportSize: () => ({ width: 1000, height: 800 }),
+ icons: slow
+ })
const inserting = editor.insertIcon('test:square')
const replacement = new SceneGraph()
editor.replaceGraph(replacement)
diff --git a/packages/core/tests/editor/layout/layout-events.test.ts b/packages/core/tests/editor/layout/layout-events.test.ts
index 5e51cf7be..7da1495c5 100644
--- a/packages/core/tests/editor/layout/layout-events.test.ts
+++ b/packages/core/tests/editor/layout/layout-events.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { computeLayout } from '@open-pencil/core/layout'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/core/tests/editor/layout/mode.test.ts b/packages/core/tests/editor/layout/mode.test.ts
index 3e2bf6151..1aea90af3 100644
--- a/packages/core/tests/editor/layout/mode.test.ts
+++ b/packages/core/tests/editor/layout/mode.test.ts
@@ -1,9 +1,9 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
-
import { expectDefined } from '#core-tests/helpers/assert'
+import { createEditor, type Editor } from '@open-pencil/core'
+
function scene() {
const editor = createEditor()
const outer = editor.graph.createNode('FRAME', editor.state.currentPageId, {
diff --git a/packages/core/tests/editor/layout/positioning.test.ts b/packages/core/tests/editor/layout/positioning.test.ts
index a2b818e7e..801a32ec8 100644
--- a/packages/core/tests/editor/layout/positioning.test.ts
+++ b/packages/core/tests/editor/layout/positioning.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
-import { layoutSizing } from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import { layoutSizing } from '@open-pencil/scene-graph/layout'
/** A Hug row with padding and gap 10 around a 60 × 40 and a 50 × 30 rectangle. */
function row() {
diff --git a/packages/core/tests/editor/navigation-lifecycle.test.ts b/packages/core/tests/editor/navigation-lifecycle.test.ts
index 46af8a66b..c08a564ac 100644
--- a/packages/core/tests/editor/navigation-lifecycle.test.ts
+++ b/packages/core/tests/editor/navigation-lifecycle.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
describe('navigation lifecycle', () => {
test('increments generation when a new gesture starts but not during one gesture', () => {
diff --git a/packages/core/tests/editor/node-preview.test.ts b/packages/core/tests/editor/node-preview.test.ts
index dae0e0afd..123ef2871 100644
--- a/packages/core/tests/editor/node-preview.test.ts
+++ b/packages/core/tests/editor/node-preview.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
describe('owned node previews', () => {
diff --git a/packages/core/tests/editor/nudge.test.ts b/packages/core/tests/editor/nudge.test.ts
index 496b53aaa..ef9eca364 100644
--- a/packages/core/tests/editor/nudge.test.ts
+++ b/packages/core/tests/editor/nudge.test.ts
@@ -1,6 +1,6 @@
import { describe, test, expect } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { getNodeOrThrow } from '../helpers/assert'
diff --git a/packages/core/tests/editor/opacity.test.ts b/packages/core/tests/editor/opacity.test.ts
index a9fb11b39..ecfe35b99 100644
--- a/packages/core/tests/editor/opacity.test.ts
+++ b/packages/core/tests/editor/opacity.test.ts
@@ -1,6 +1,6 @@
import { describe, test, expect } from 'bun:test'
-import { createEditor, opacityFromBuffer } from '@open-pencil/core/editor'
+import { createEditor, opacityFromBuffer } from '@open-pencil/core'
import { getNodeOrThrow } from '../helpers/assert'
diff --git a/packages/core/tests/editor/page-backgrounds.test.ts b/packages/core/tests/editor/page-backgrounds.test.ts
index 52e5dae1c..c173907c9 100644
--- a/packages/core/tests/editor/page-backgrounds.test.ts
+++ b/packages/core/tests/editor/page-backgrounds.test.ts
@@ -1,10 +1,10 @@
import { describe, expect, test } from 'bun:test'
-import { createDefaultEditorState, createEditor } from '@open-pencil/core/editor'
+import { createDefaultEditorState, createEditor } from '@open-pencil/core'
import { FigmaAPI } from '@open-pencil/core/figma-api'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { SceneGraph } from '@open-pencil/scene-graph'
-import type { Color } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
// Exact float32 backgroundColor from the reported finance FIG canvas 0:4.
const navy: Color = {
diff --git a/packages/core/tests/editor/pages/layouts.test.ts b/packages/core/tests/editor/pages/layouts.test.ts
index a911286a6..1cec10107 100644
--- a/packages/core/tests/editor/pages/layouts.test.ts
+++ b/packages/core/tests/editor/pages/layouts.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { SceneGraph } from '@open-pencil/scene-graph'
import { createPageLayouts } from '#core/editor/pages/layouts'
diff --git a/packages/core/tests/editor/pages/loading.test.ts b/packages/core/tests/editor/pages/loading.test.ts
index 34141ebdf..374be8173 100644
--- a/packages/core/tests/editor/pages/loading.test.ts
+++ b/packages/core/tests/editor/pages/loading.test.ts
@@ -1,9 +1,8 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { populateFigPage } from '@open-pencil/core/io/formats/fig'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { createEditor } from '@open-pencil/core'
+import { exportFigFile, parseFigFile, populateFigPage } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import type { PageSwitchProgress } from '#core/editor/pages'
diff --git a/packages/core/tests/editor/pages/navigation.test.ts b/packages/core/tests/editor/pages/navigation.test.ts
index 7ddf975b0..735321ac5 100644
--- a/packages/core/tests/editor/pages/navigation.test.ts
+++ b/packages/core/tests/editor/pages/navigation.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
const VIEWPORT = { width: 800, height: 600 }
diff --git a/packages/core/tests/editor/pen-resume.test.ts b/packages/core/tests/editor/pen-resume.test.ts
index c17c8614d..de57b3bf2 100644
--- a/packages/core/tests/editor/pen-resume.test.ts
+++ b/packages/core/tests/editor/pen-resume.test.ts
@@ -2,7 +2,7 @@ import { afterEach, describe, expect, test } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
let editor: Editor
diff --git a/packages/core/tests/editor/pencil.test.ts b/packages/core/tests/editor/pencil.test.ts
index daca10d86..f773aa217 100644
--- a/packages/core/tests/editor/pencil.test.ts
+++ b/packages/core/tests/editor/pencil.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import type { Vector } from '@open-pencil/scene-graph/primitives'
type Editor = ReturnType<typeof createEditor>
@@ -154,7 +154,9 @@ describe('pencil', () => {
if (!first) throw new Error('nothing drawn')
const red = { r: 1, g: 0, b: 0, a: 1 }
editor.graph.updateNode(first, {
- strokes: [{ type: 'SOLID', color: red, opacity: 1, visible: true, weight: 6, align: 'CENTER' }]
+ strokes: [
+ { type: 'SOLID', color: red, opacity: 1, visible: true, weight: 6, align: 'CENTER' }
+ ]
})
editor.graph.deleteNode(first)
diff --git a/packages/core/tests/editor/play/states.test.ts b/packages/core/tests/editor/play/states.test.ts
index 39471b521..897e07bc5 100644
--- a/packages/core/tests/editor/play/states.test.ts
+++ b/packages/core/tests/editor/play/states.test.ts
@@ -1,13 +1,9 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor, playIslandRoots, resolvePlayState } from '@open-pencil/core/editor'
-import {
- emptyBehaviour,
- findLayerByPath,
- instanceMainComponent,
- layerPath,
- SceneGraph
-} from '@open-pencil/scene-graph'
+import { createEditor, playIslandRoots, resolvePlayState } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { emptyBehaviour, findLayerByPath, layerPath } from '@open-pencil/scene-graph/behaviours'
+import { instanceMainComponent } from '@open-pencil/scene-graph/instances'
/** A Switch set (State × Interaction) and a card frame holding an Off instance with a label. */
function switchCard() {
diff --git a/packages/core/tests/editor/preview-events.test.ts b/packages/core/tests/editor/preview-events.test.ts
index 11614e1c2..a78551b26 100644
--- a/packages/core/tests/editor/preview-events.test.ts
+++ b/packages/core/tests/editor/preview-events.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
describe('preview updates', () => {
test('rotation notifications observe published state and clearing is reentrant', () => {
diff --git a/packages/core/tests/editor/read-only.test.ts b/packages/core/tests/editor/read-only.test.ts
index cd65fe1ff..64111440d 100644
--- a/packages/core/tests/editor/read-only.test.ts
+++ b/packages/core/tests/editor/read-only.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
-import { createEditor, executeAtomicTool, ReadOnlyDocumentError } from '@open-pencil/core/editor'
+import { createEditor, executeAtomicTool, ReadOnlyDocumentError } from '@open-pencil/core'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { ALL_TOOLS } from '@open-pencil/core/tools'
diff --git a/packages/core/tests/editor/reveal.test.ts b/packages/core/tests/editor/reveal.test.ts
index d455b3175..3ffd1c941 100644
--- a/packages/core/tests/editor/reveal.test.ts
+++ b/packages/core/tests/editor/reveal.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
function setup() {
const editor = createEditor({ getViewportSize: () => ({ width: 800, height: 600 }) })
diff --git a/packages/core/tests/editor/selection/alignment.test.ts b/packages/core/tests/editor/selection/alignment.test.ts
index 8a07c4caa..8a55108f9 100644
--- a/packages/core/tests/editor/selection/alignment.test.ts
+++ b/packages/core/tests/editor/selection/alignment.test.ts
@@ -3,8 +3,8 @@ import { describe, expect, test } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { createRect, firstPageId } from '#core-tests/helpers/scene'
-import { SceneGraph } from '@open-pencil/core'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
describe('single-node alignment to parent', () => {
function setup() {
diff --git a/packages/core/tests/editor/selection/colors.test.ts b/packages/core/tests/editor/selection/colors.test.ts
index 51a8583cf..245fa3f64 100644
--- a/packages/core/tests/editor/selection/colors.test.ts
+++ b/packages/core/tests/editor/selection/colors.test.ts
@@ -1,13 +1,9 @@
import { describe, expect, test } from 'bun:test'
-import {
- createEditor,
- replaceSelectionColor,
- selectionColors,
- selectionColorsShown
-} from '@open-pencil/core/editor'
-import { createSticky, stickySublayers } from '@open-pencil/scene-graph'
-import type { Color, Fill } from '@open-pencil/scene-graph'
+import { createEditor, replaceSelectionColor, selectionColors, selectionColorsShown } from '@open-pencil/core'
+import { createSticky, stickySublayers } from '@open-pencil/scene-graph/generated'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import type { Fill } from '@open-pencil/scene-graph'
const RED = { r: 1, g: 0.3, b: 0.2, a: 1 }
const BLUE = { r: 0.2, g: 0.4, b: 1, a: 1 }
@@ -44,12 +40,23 @@ function setup() {
})
const ellipse = graph.createNode('ELLIPSE', pageId, { fills: [solid(BLUE)] })
const text = graph.createNode('TEXT', pageId, { fills: [solid(BLACK)] })
- return { graph, frame: frame.id, rectA: rectA.id, rectB: rectB.id, ellipse: ellipse.id, text: text.id }
+ return {
+ graph,
+ frame: frame.id,
+ rectA: rectA.id,
+ rectB: rectB.id,
+ ellipse: ellipse.id,
+ text: text.id
+ }
}
const hex = (color: Color) =>
[color.r, color.g, color.b]
- .map((channel) => Math.round(channel * 255).toString(16).padStart(2, '0'))
+ .map((channel) =>
+ Math.round(channel * 255)
+ .toString(16)
+ .padStart(2, '0')
+ )
.join('')
.toUpperCase()
@@ -58,7 +65,9 @@ describe('selection colors', () => {
// the rectangle, so it is used twice.
test('lists fills and strokes, most used first', () => {
const { graph, text, rectA } = setup()
- expect(selectionColors(graph, [text, rectA]).map((entry) => [hex(entry.color), entry.count])).toEqual([
+ expect(
+ selectionColors(graph, [text, rectA]).map((entry) => [hex(entry.color), entry.count])
+ ).toEqual([
['000000', 2],
['FF4D33', 1]
])
@@ -82,7 +91,10 @@ describe('selection colors', () => {
{ color: { r: 0, g: 1, b: 0, a: 1 }, opacity: 0.5 }
)
expect(updates.map((update) => update.id)).toEqual([frame, ellipse])
- expect(updates[0]?.changes.fills?.[0]).toMatchObject({ color: { r: 0, g: 1, b: 0 }, opacity: 0.5 })
+ expect(updates[0]?.changes.fills?.[0]).toMatchObject({
+ color: { r: 0, g: 1, b: 0 },
+ opacity: 0.5
+ })
})
// Figma desktop 126 hides the list when the Fill and Stroke sections already show every colour.
diff --git a/packages/core/tests/editor/selection/distribution.test.ts b/packages/core/tests/editor/selection/distribution.test.ts
index 52091ba6b..d1097aef2 100644
--- a/packages/core/tests/editor/selection/distribution.test.ts
+++ b/packages/core/tests/editor/selection/distribution.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { getAbsolutePositionFull } from '@open-pencil/scene-graph/coordinate'
function positions(editor: ReturnType<typeof createEditor>, ids: string[], axis: 'x' | 'y') {
@@ -123,7 +123,12 @@ describe('selection spacing', () => {
const editor = createEditor()
const pageId = editor.state.currentPageId
const a = editor.graph.createNode('RECTANGLE', pageId, { x: 0, y: 180, width: 100, height: 80 })
- const b = editor.graph.createNode('RECTANGLE', pageId, { x: 140, y: 180, width: 120, height: 80 })
+ const b = editor.graph.createNode('RECTANGLE', pageId, {
+ x: 140,
+ y: 180,
+ width: 120,
+ height: 80
+ })
const c = editor.graph.createNode('ELLIPSE', pageId, { x: 320, y: 180, width: 80, height: 80 })
return { editor, ids: [c.id, a.id, b.id], a, b, c }
}
@@ -144,7 +149,12 @@ describe('selection spacing', () => {
test('reads a column when the layers overlap across it', () => {
const editor = createEditor()
const pageId = editor.state.currentPageId
- const rect = editor.graph.createNode('RECTANGLE', pageId, { x: 0, y: 180, width: 100, height: 80 })
+ const rect = editor.graph.createNode('RECTANGLE', pageId, {
+ x: 0,
+ y: 180,
+ width: 100,
+ height: 80
+ })
const text = editor.graph.createNode('TEXT', pageId, { x: 0, y: 300, width: 39, height: 19 })
expect(editor.selectionSpacing([text.id, rect.id])).toEqual({ axis: 'vertical', gaps: [40] })
})
@@ -152,7 +162,12 @@ describe('selection spacing', () => {
test('has no spacing for layers apart on both axes', () => {
const editor = createEditor()
const pageId = editor.state.currentPageId
- const rect = editor.graph.createNode('RECTANGLE', pageId, { x: 110, y: 180, width: 120, height: 80 })
+ const rect = editor.graph.createNode('RECTANGLE', pageId, {
+ x: 110,
+ y: 180,
+ width: 120,
+ height: 80
+ })
const text = editor.graph.createNode('TEXT', pageId, { x: 0, y: 300, width: 39, height: 19 })
expect(editor.selectionSpacing([text.id, rect.id])).toBeNull()
})
diff --git a/packages/core/tests/editor/selection/flip.test.ts b/packages/core/tests/editor/selection/flip.test.ts
index 1388e3722..2cbf1180e 100644
--- a/packages/core/tests/editor/selection/flip.test.ts
+++ b/packages/core/tests/editor/selection/flip.test.ts
@@ -3,7 +3,7 @@ import { describe, expect, test } from 'bun:test'
import { expectDefined, getNodeOrThrow } from '#core-tests/helpers/assert'
import { createRect, firstPageId } from '#core-tests/helpers/scene'
-import { SceneGraph } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
describe('flip', () => {
test('flipX defaults to false', () => {
@@ -42,7 +42,7 @@ describe('flip', () => {
describe('flip roundtrip via kiwi', () => {
async function roundtrip(graph: SceneGraph) {
const { initCodec } = await import('@open-pencil/kiwi/fig/codec')
- const { parseFigFile } = await import('@open-pencil/core/kiwi')
+ const { parseFigFile } = await import('@open-pencil/core/io/formats/fig')
const { exportFigFile } = await import('@open-pencil/core/io/formats/fig')
await initCodec()
const buf = await exportFigFile(graph)
diff --git a/packages/core/tests/editor/selection/hit-test.test.ts b/packages/core/tests/editor/selection/hit-test.test.ts
index 2e5b50d19..ffcb9ff6d 100644
--- a/packages/core/tests/editor/selection/hit-test.test.ts
+++ b/packages/core/tests/editor/selection/hit-test.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
describe('editor scoped hit testing', () => {
test('uses world coordinates inside entered containers', () => {
diff --git a/packages/core/tests/editor/selection/navigation.test.ts b/packages/core/tests/editor/selection/navigation.test.ts
index da38eecd2..674e701ce 100644
--- a/packages/core/tests/editor/selection/navigation.test.ts
+++ b/packages/core/tests/editor/selection/navigation.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
const VIEWPORT = { width: 800, height: 600 }
diff --git a/packages/core/tests/editor/selection/properties.test.ts b/packages/core/tests/editor/selection/properties.test.ts
index 3a6a8c8dd..6cd3ee522 100644
--- a/packages/core/tests/editor/selection/properties.test.ts
+++ b/packages/core/tests/editor/selection/properties.test.ts
@@ -3,7 +3,7 @@ import { describe, expect, test } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { createRect, firstPageId } from '#core-tests/helpers/scene'
-import { SceneGraph } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
describe('multi-node property merging', () => {
test('same values merge to single value', () => {
diff --git a/packages/core/tests/editor/selection/semantics.test.ts b/packages/core/tests/editor/selection/semantics.test.ts
index 9573e23bd..c5a86c1a4 100644
--- a/packages/core/tests/editor/selection/semantics.test.ts
+++ b/packages/core/tests/editor/selection/semantics.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
function renameOptions(replacement: string, match = '', startNumber = 1) {
return { match, replacement, startNumber }
diff --git a/packages/core/tests/editor/shaders.test.ts b/packages/core/tests/editor/shaders.test.ts
index ecd7b9836..847e7ef92 100644
--- a/packages/core/tests/editor/shaders.test.ts
+++ b/packages/core/tests/editor/shaders.test.ts
@@ -1,14 +1,14 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
createShaderPaint,
- SceneGraph,
shaderOfPaint,
shaderPresetKey,
withShaderPaints,
type ShaderPreset
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/shaders'
const AURORA: ShaderPreset = { components: [{ type: 'Aurora' }] }
const SWIRL: ShaderPreset = { components: [{ type: 'Swirl' }] }
diff --git a/packages/core/tests/editor/shapes/with-text.test.ts b/packages/core/tests/editor/shapes/with-text.test.ts
index 93fa610a2..266252a33 100644
--- a/packages/core/tests/editor/shapes/with-text.test.ts
+++ b/packages/core/tests/editor/shapes/with-text.test.ts
@@ -2,9 +2,9 @@ import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { setTextMeasurer } from '@open-pencil/core'
-import { createEditor } from '@open-pencil/core/editor'
-import { shapeWithTextLabel } from '@open-pencil/scene-graph'
+import { setTextMeasurer } from '@open-pencil/core/layout'
+import { createEditor } from '@open-pencil/core'
+import { shapeWithTextLabel } from '@open-pencil/scene-graph/generated'
import { colorToHex } from '@open-pencil/scene-graph/color'
import { applyGeneratedTextNameEdit } from '#core/editor/text/name'
diff --git a/packages/core/tests/editor/statuses.test.ts b/packages/core/tests/editor/statuses.test.ts
index 2eccd1029..557ce2123 100644
--- a/packages/core/tests/editor/statuses.test.ts
+++ b/packages/core/tests/editor/statuses.test.ts
@@ -1,7 +1,7 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
-import { STATUS_WORKFLOW_PRESETS, writeStatusWorkflow } from '@open-pencil/scene-graph'
+import { createEditor, type Editor } from '@open-pencil/core'
+import { STATUS_WORKFLOW_PRESETS, writeStatusWorkflow } from '@open-pencil/scene-graph/statuses'
let editor: Editor
diff --git a/packages/core/tests/editor/stickies.test.ts b/packages/core/tests/editor/stickies.test.ts
index f0cee9d3b..d77033128 100644
--- a/packages/core/tests/editor/stickies.test.ts
+++ b/packages/core/tests/editor/stickies.test.ts
@@ -1,9 +1,9 @@
import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
-import { setTextMeasurer } from '@open-pencil/core'
-import { createEditor } from '@open-pencil/core/editor'
-import { STICKY_COLORS, stickySublayers } from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import { setTextMeasurer } from '@open-pencil/core/layout'
import type { SceneNode } from '@open-pencil/scene-graph'
+import { STICKY_COLORS, stickySublayers } from '@open-pencil/scene-graph/generated'
import { applyGeneratedTextNameEdit } from '#core/editor/text/name'
diff --git a/packages/core/tests/editor/structure/boolean.test.ts b/packages/core/tests/editor/structure/boolean.test.ts
index 860b01d82..710566ea8 100644
--- a/packages/core/tests/editor/structure/boolean.test.ts
+++ b/packages/core/tests/editor/structure/boolean.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
+import { createEditor } from '@open-pencil/core'
import { TRANSPARENT } from '@open-pencil/core/constants'
-import { createEditor } from '@open-pencil/core/editor'
import { getAxisAlignedWorldBounds } from '@open-pencil/scene-graph/coordinate'
describe('booleanOperationSelected', () => {
diff --git a/packages/core/tests/editor/structure/child-order.test.ts b/packages/core/tests/editor/structure/child-order.test.ts
index 982ee28c7..ea4b0dabf 100644
--- a/packages/core/tests/editor/structure/child-order.test.ts
+++ b/packages/core/tests/editor/structure/child-order.test.ts
@@ -1,13 +1,15 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
describe('setting a frame’s child order', () => {
test('moves the children in one undo step, past a read-only library layer that stays', () => {
const editor = createEditor()
try {
const { graph } = editor
- const frame = graph.createNode('FRAME', editor.state.currentPageId, { layoutMode: 'HORIZONTAL' })
+ const frame = graph.createNode('FRAME', editor.state.currentPageId, {
+ layoutMode: 'HORIZONTAL'
+ })
const a = graph.createNode('RECTANGLE', frame.id, { name: 'A', width: 40, height: 40 })
const b = graph.createNode('RECTANGLE', frame.id, { name: 'B', width: 40, height: 40 })
const remote = graph.createNode('COMPONENT', frame.id, {
diff --git a/packages/core/tests/editor/structure/flatten.test.ts b/packages/core/tests/editor/structure/flatten.test.ts
index fcbe5f2e3..3e4dcfaa6 100644
--- a/packages/core/tests/editor/structure/flatten.test.ts
+++ b/packages/core/tests/editor/structure/flatten.test.ts
@@ -1,9 +1,9 @@
import { afterEach, describe, expect, test } from 'bun:test'
+import { createEditor } from '@open-pencil/core'
import { SkiaRenderer } from '@open-pencil/core/canvas'
import { BLACK, TRANSPARENT } from '@open-pencil/core/constants'
-import { createEditor } from '@open-pencil/core/editor'
-import { initCanvasKit } from '@open-pencil/core/io'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import { fontManager } from '@open-pencil/core/text'
import { textNodeToOutlineLayout } from '#core/text/outlines'
@@ -205,33 +205,33 @@ describe('flattenSelected', () => {
test.each(['NONE', 'UNDERLINE'] as const)(
'flattens a list with its bullets, as the canvas draws it (%s)',
async (textDecoration) => {
- await loadInterRegular()
- const { editor, renderer } = await createEditorWithRenderer()
- await renderer.loadFonts()
- const pageId = editor.state.currentPageId
- const text = editor.graph.createNode('TEXT', pageId, {
- x: 100,
- text: 'One\nTwo',
- fontFamily: 'Inter',
- fontWeight: 400,
- fontSize: 16,
- width: 120,
- height: 40,
- textDecoration,
- textParagraphs: [
- { listType: 'UNORDERED', indentation: 1 },
- { listType: 'UNORDERED', indentation: 1 }
- ]
- })
-
- editor.select([text.id])
- editor.flattenSelected()
-
- const [vectorId] = [...editor.state.selectedIds]
- const vector = editor.graph.getNode(vectorId)
- // The bullets sit in the first 24px of indent, left of the items' text.
- expect(vector?.x).toBeGreaterThan(106)
- expect(vector?.x).toBeLessThan(112)
+ await loadInterRegular()
+ const { editor, renderer } = await createEditorWithRenderer()
+ await renderer.loadFonts()
+ const pageId = editor.state.currentPageId
+ const text = editor.graph.createNode('TEXT', pageId, {
+ x: 100,
+ text: 'One\nTwo',
+ fontFamily: 'Inter',
+ fontWeight: 400,
+ fontSize: 16,
+ width: 120,
+ height: 40,
+ textDecoration,
+ textParagraphs: [
+ { listType: 'UNORDERED', indentation: 1 },
+ { listType: 'UNORDERED', indentation: 1 }
+ ]
+ })
+
+ editor.select([text.id])
+ editor.flattenSelected()
+
+ const [vectorId] = [...editor.state.selectedIds]
+ const vector = editor.graph.getNode(vectorId)
+ // The bullets sit in the first 24px of indent, left of the items' text.
+ expect(vector?.x).toBeGreaterThan(106)
+ expect(vector?.x).toBeLessThan(112)
}
)
diff --git a/packages/core/tests/editor/structure/frame-selection.test.ts b/packages/core/tests/editor/structure/frame-selection.test.ts
index 506b0ef79..095b339c1 100644
--- a/packages/core/tests/editor/structure/frame-selection.test.ts
+++ b/packages/core/tests/editor/structure/frame-selection.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
describe('frameSelection', () => {
test('wraps selected nodes in a frame and preserves visual positions', () => {
diff --git a/packages/core/tests/editor/structure/layer-state-undo.test.ts b/packages/core/tests/editor/structure/layer-state-undo.test.ts
index ad4538b6b..8a99ee381 100644
--- a/packages/core/tests/editor/structure/layer-state-undo.test.ts
+++ b/packages/core/tests/editor/structure/layer-state-undo.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
let editor: Editor
diff --git a/packages/core/tests/editor/structure/layer-type.test.ts b/packages/core/tests/editor/structure/layer-type.test.ts
index a49684b72..965fe4264 100644
--- a/packages/core/tests/editor/structure/layer-type.test.ts
+++ b/packages/core/tests/editor/structure/layer-type.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor, layerTypeOptions } from '@open-pencil/core/editor'
+import { createEditor, layerTypeOptions } from '@open-pencil/core'
import { getAxisAlignedWorldBounds } from '@open-pencil/scene-graph/coordinate'
// Each case repeats the layer type menu in Figma desktop 126's properties panel.
diff --git a/packages/core/tests/editor/structure/names.test.ts b/packages/core/tests/editor/structure/names.test.ts
index 920b07f7b..3c22f88b1 100644
--- a/packages/core/tests/editor/structure/names.test.ts
+++ b/packages/core/tests/editor/structure/names.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
// Recorded in Figma desktop 126: a layer made on the canvas is numbered one past the highest
// number any layer on the page has with its name, whatever that layer is; booleans are not.
diff --git a/packages/core/tests/editor/structure/panel-reorder.test.ts b/packages/core/tests/editor/structure/panel-reorder.test.ts
index b3fe274b2..d66ec2f6e 100644
--- a/packages/core/tests/editor/structure/panel-reorder.test.ts
+++ b/packages/core/tests/editor/structure/panel-reorder.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { getAxisAlignedWorldBounds } from '@open-pencil/scene-graph/coordinate'
describe('moving a layer from the layers panel', () => {
diff --git a/packages/core/tests/editor/structure/state.test.ts b/packages/core/tests/editor/structure/state.test.ts
index 24073af25..ae97e2e4a 100644
--- a/packages/core/tests/editor/structure/state.test.ts
+++ b/packages/core/tests/editor/structure/state.test.ts
@@ -3,7 +3,7 @@ import { describe, expect, test } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
import { rect } from '#core-tests/helpers/layout'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { computeAllLayouts } from '@open-pencil/core/layout'
describe('structure state actions', () => {
diff --git a/packages/core/tests/editor/structure/z-order.test.ts b/packages/core/tests/editor/structure/z-order.test.ts
index 3a1c490e6..ee01e83bd 100644
--- a/packages/core/tests/editor/structure/z-order.test.ts
+++ b/packages/core/tests/editor/structure/z-order.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
function setupEditor() {
const editor = createEditor()
diff --git a/packages/core/tests/editor/text/auto-resize.test.ts b/packages/core/tests/editor/text/auto-resize.test.ts
index 5dd82fc2c..09043635d 100644
--- a/packages/core/tests/editor/text/auto-resize.test.ts
+++ b/packages/core/tests/editor/text/auto-resize.test.ts
@@ -1,10 +1,10 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
-import { setTextMeasurer } from '@open-pencil/core/layout'
-
import { getNodeOrThrow } from '#core-tests/helpers/assert'
+import { createEditor } from '@open-pencil/core'
+import { setTextMeasurer } from '@open-pencil/core/layout'
+
afterEach(() => {
setTextMeasurer(null)
})
diff --git a/packages/core/tests/editor/text/pending-layout.test.ts b/packages/core/tests/editor/text/pending-layout.test.ts
index f92652f02..244df6d01 100644
--- a/packages/core/tests/editor/text/pending-layout.test.ts
+++ b/packages/core/tests/editor/text/pending-layout.test.ts
@@ -1,6 +1,6 @@
import { afterEach, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { setTextMeasurer } from '@open-pencil/core/layout'
import {
diff --git a/packages/core/tests/editor/text/selection-style.test.ts b/packages/core/tests/editor/text/selection-style.test.ts
index 5e9d4287d..9bc611ceb 100644
--- a/packages/core/tests/editor/text/selection-style.test.ts
+++ b/packages/core/tests/editor/text/selection-style.test.ts
@@ -2,9 +2,9 @@ import { afterEach, describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
+import { createEditor } from '@open-pencil/core'
import { SkiaRenderer } from '@open-pencil/core/canvas'
-import { createEditor } from '@open-pencil/core/editor'
-import { initCanvasKit } from '@open-pencil/core/io'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import type { Fill } from '@open-pencil/scene-graph'
const cleanups: (() => void)[] = []
diff --git a/packages/core/tests/editor/text/typeface.test.ts b/packages/core/tests/editor/text/typeface.test.ts
index 2a0c5136f..9b0831c37 100644
--- a/packages/core/tests/editor/text/typeface.test.ts
+++ b/packages/core/tests/editor/text/typeface.test.ts
@@ -2,8 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { createEditor } from '@open-pencil/core/editor'
-import { createSticky, shapeWithTextLabel, stickySublayers } from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import { createSticky, shapeWithTextLabel, stickySublayers } from '@open-pencil/scene-graph/generated'
function setup() {
const editor = createEditor({ loadFont: () => Promise.resolve(null) })
diff --git a/packages/core/tests/editor/undo/create-instance.test.ts b/packages/core/tests/editor/undo/create-instance.test.ts
index 50c52da62..89870cd9d 100644
--- a/packages/core/tests/editor/undo/create-instance.test.ts
+++ b/packages/core/tests/editor/undo/create-instance.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { getAxisAlignedWorldBounds } from '@open-pencil/scene-graph/coordinate'
describe('create instance undo/redo', () => {
diff --git a/packages/core/tests/editor/undo/create-shape.test.ts b/packages/core/tests/editor/undo/create-shape.test.ts
index 46a0d216d..19db35214 100644
--- a/packages/core/tests/editor/undo/create-shape.test.ts
+++ b/packages/core/tests/editor/undo/create-shape.test.ts
@@ -2,7 +2,7 @@ import { describe, test, expect } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
describe('create shape undo/redo', () => {
test('batched create+resize undoes in one step', () => {
diff --git a/packages/core/tests/editor/undo/group-resize.test.ts b/packages/core/tests/editor/undo/group-resize.test.ts
index 370bb4d35..c79a0e6e0 100644
--- a/packages/core/tests/editor/undo/group-resize.test.ts
+++ b/packages/core/tests/editor/undo/group-resize.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import type { VectorNetwork } from '@open-pencil/scene-graph'
import { createResizeSnapshot } from '@open-pencil/scene-graph/resize'
diff --git a/packages/core/tests/editor/undo/history-events.test.ts b/packages/core/tests/editor/undo/history-events.test.ts
index e8892a1f9..65ef9cd52 100644
--- a/packages/core/tests/editor/undo/history-events.test.ts
+++ b/packages/core/tests/editor/undo/history-events.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
const entry = { label: 'Edit', forward: () => undefined, inverse: () => undefined }
diff --git a/packages/core/tests/editor/undo/variable/bindings.test.ts b/packages/core/tests/editor/undo/variable/bindings.test.ts
index 6352a1e50..1d657ea27 100644
--- a/packages/core/tests/editor/undo/variable/bindings.test.ts
+++ b/packages/core/tests/editor/undo/variable/bindings.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
function pageId(editor: ReturnType<typeof createEditor>): string {
return editor.graph.getPages()[0].id
diff --git a/packages/core/tests/editor/undo/variable/modes.test.ts b/packages/core/tests/editor/undo/variable/modes.test.ts
index 5fb7a0200..c474fcfcb 100644
--- a/packages/core/tests/editor/undo/variable/modes.test.ts
+++ b/packages/core/tests/editor/undo/variable/modes.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
describe('variable mode undo', () => {
test('setting a default mode moves it first, and undo restores the order', () => {
diff --git a/packages/core/tests/editor/undo/variable/tokens.test.ts b/packages/core/tests/editor/undo/variable/tokens.test.ts
index 2c4299007..17e439fae 100644
--- a/packages/core/tests/editor/undo/variable/tokens.test.ts
+++ b/packages/core/tests/editor/undo/variable/tokens.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
function themeEditor() {
const editor = createEditor()
diff --git a/packages/core/tests/editor/variables/color-expression.test.ts b/packages/core/tests/editor/variables/color-expression.test.ts
index 736d9b44b..812a26d2a 100644
--- a/packages/core/tests/editor/variables/color-expression.test.ts
+++ b/packages/core/tests/editor/variables/color-expression.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { SceneGraph } from '@open-pencil/scene-graph'
import { resolveFillColor } from '#core/canvas/renderer/colors'
diff --git a/packages/core/tests/editor/variables/formula.test.ts b/packages/core/tests/editor/variables/formula.test.ts
index 2d74abadc..7f6c18984 100644
--- a/packages/core/tests/editor/variables/formula.test.ts
+++ b/packages/core/tests/editor/variables/formula.test.ts
@@ -1,7 +1,8 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
-import { SceneGraph, parseVariableFormula } from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { parseVariableFormula } from '@open-pencil/scene-graph/variables'
import {
captureClipboardVariables,
diff --git a/packages/core/tests/editor/variables/list-changes.test.ts b/packages/core/tests/editor/variables/list-changes.test.ts
index 26b8e4eec..b23bbe3d6 100644
--- a/packages/core/tests/editor/variables/list-changes.test.ts
+++ b/packages/core/tests/editor/variables/list-changes.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { SceneGraph } from '@open-pencil/scene-graph'
/** A layer saved at 24 while its binding resolves to 40, as layers in imported files can be. */
diff --git a/packages/core/tests/editor/variables/scaled-bindings.test.ts b/packages/core/tests/editor/variables/scaled-bindings.test.ts
index 6b9c09705..0320c815b 100644
--- a/packages/core/tests/editor/variables/scaled-bindings.test.ts
+++ b/packages/core/tests/editor/variables/scaled-bindings.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { SceneGraph } from '@open-pencil/scene-graph'
import { serializeSceneGraph, deserializeSceneGraph } from '#core/kiwi/fig/parse/transfer'
diff --git a/packages/core/tests/editor/variables/value-bindings.test.ts b/packages/core/tests/editor/variables/value-bindings.test.ts
index e9ed0f5cd..548e765ee 100644
--- a/packages/core/tests/editor/variables/value-bindings.test.ts
+++ b/packages/core/tests/editor/variables/value-bindings.test.ts
@@ -2,8 +2,9 @@ import { expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { createEditor } from '@open-pencil/core/editor'
-import { SceneGraph, setInstanceOverride } from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
function boundText() {
const graph = new SceneGraph()
diff --git a/packages/core/tests/editor/vectorize.test.ts b/packages/core/tests/editor/vectorize.test.ts
index cf4a71363..74411dea5 100644
--- a/packages/core/tests/editor/vectorize.test.ts
+++ b/packages/core/tests/editor/vectorize.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { svgToVectorPaths } from '@open-pencil/core/vector'
import { expectDefined, getNodeOrThrow } from '../helpers/assert'
diff --git a/packages/core/tests/editor/view-state.test.ts b/packages/core/tests/editor/view-state.test.ts
index c4ce2b10c..910849adc 100644
--- a/packages/core/tests/editor/view-state.test.ts
+++ b/packages/core/tests/editor/view-state.test.ts
@@ -6,7 +6,7 @@ import {
createEditor,
createDefaultEditorViewState,
pickEditorViewState
-} from '@open-pencil/core/editor'
+} from '@open-pencil/core'
describe('editor state ownership', () => {
test('composes editor state from shared and view defaults', () => {
diff --git a/packages/core/tests/editor/viewport.test.ts b/packages/core/tests/editor/viewport.test.ts
index d1b9d7d64..b0a72499e 100644
--- a/packages/core/tests/editor/viewport.test.ts
+++ b/packages/core/tests/editor/viewport.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
const VIEWPORT = { width: 800, height: 600 }
diff --git a/packages/core/tests/figma-api/boolean-bounds.test.ts b/packages/core/tests/figma-api/boolean-bounds.test.ts
index 7824d2a7a..407ad4537 100644
--- a/packages/core/tests/figma-api/boolean-bounds.test.ts
+++ b/packages/core/tests/figma-api/boolean-bounds.test.ts
@@ -2,10 +2,10 @@ import { afterAll, beforeAll, describe, expect, test } from 'bun:test'
import type { Surface } from 'canvaskit-wasm'
+import { createEditor } from '@open-pencil/core'
import { SkiaRenderer } from '@open-pencil/core/canvas'
-import { createEditor } from '@open-pencil/core/editor'
import { FigmaAPI, type FigmaNodeProxy } from '@open-pencil/core/figma-api'
-import { initCanvasKit } from '@open-pencil/core/io'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import { SceneGraph } from '@open-pencil/scene-graph'
import type { Rect } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/core/tests/figma-api/connector.test.ts b/packages/core/tests/figma-api/connector.test.ts
index 6d3292d60..5991fa3d8 100644
--- a/packages/core/tests/figma-api/connector.test.ts
+++ b/packages/core/tests/figma-api/connector.test.ts
@@ -1,11 +1,11 @@
import { describe, expect, test } from 'bun:test'
-import { pick } from 'es-toolkit'
-
import { getNodeOrThrow } from '#core-tests/helpers/assert'
+import { pick } from 'es-toolkit'
import { FigmaAPI } from '@open-pencil/core/figma-api'
-import { connectorSublayers, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { connectorSublayers } from '@open-pencil/scene-graph/connectors'
function setup() {
const graph = new SceneGraph()
@@ -39,7 +39,8 @@ describe('ConnectorNode', () => {
startCap: connector.connectorStartStrokeCap,
endCap: connector.connectorEndStrokeCap,
strokeWeight: connector.strokeWeight,
- color: connector.strokes[0]?.type === 'SOLID' && pick(connector.strokes[0].color, ['r', 'g', 'b']),
+ color:
+ connector.strokes[0]?.type === 'SOLID' && pick(connector.strokes[0].color, ['r', 'g', 'b']),
text: connector.text.characters
}).toEqual({
name: 'Connector line',
@@ -111,7 +112,9 @@ describe('ConnectorNode', () => {
}).toThrow('in set_connectorStart: Invalid endpointNodeId')
expect(() => {
connector.connectorStartStrokeCap = 'ROUND' as ConnectorStrokeCap
- }).toThrow('in set_connectorStartStrokeCap: Property "connectorStartStrokeCap" failed validation')
+ }).toThrow(
+ 'in set_connectorStartStrokeCap: Property "connectorStartStrokeCap" failed validation'
+ )
connector.connectorStartStrokeCap = 'DIAMOND_FILLED'
expect(connector.connectorStartStrokeCap).toBe('DIAMOND_FILLED')
expect(() => {
diff --git a/packages/core/tests/figma-api/create-defaults.test.ts b/packages/core/tests/figma-api/create-defaults.test.ts
index 4219e572d..ab9305f0a 100644
--- a/packages/core/tests/figma-api/create-defaults.test.ts
+++ b/packages/core/tests/figma-api/create-defaults.test.ts
@@ -1,9 +1,10 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { expectFills } from '#core-tests/helpers/assert'
+
+import { createEditor } from '@open-pencil/core'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { expectFills } from '#core-tests/helpers/assert'
// Recorded with the same script in Figma desktop 126: new layers from the plugin API and from the
// drawing tools start alike.
diff --git a/packages/core/tests/figma-api/dev-status.test.ts b/packages/core/tests/figma-api/dev-status.test.ts
index 26730c87a..acfff58b0 100644
--- a/packages/core/tests/figma-api/dev-status.test.ts
+++ b/packages/core/tests/figma-api/dev-status.test.ts
@@ -1,7 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import type { FigmaNodeProxy } from '@open-pencil/core'
-import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { type FigmaNodeProxy, FigmaAPI } from '@open-pencil/core/figma-api'
import { SceneGraph } from '@open-pencil/scene-graph'
const createAPI = () => new FigmaAPI(new SceneGraph())
diff --git a/packages/core/tests/figma-api/instance-overrides.test.ts b/packages/core/tests/figma-api/instance-overrides.test.ts
index cdb448125..85694ab0a 100644
--- a/packages/core/tests/figma-api/instance-overrides.test.ts
+++ b/packages/core/tests/figma-api/instance-overrides.test.ts
@@ -3,11 +3,9 @@ import { expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
import { FigmaAPI, type FigmaNodeProxy } from '@open-pencil/core/figma-api'
-import {
- createComponentPropertyId,
- hasInstanceOverride,
- SceneGraph
-} from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { createComponentPropertyId } from '@open-pencil/scene-graph/components'
+import { hasInstanceOverride } from '@open-pencil/scene-graph/instances'
// Recorded with the same script in Figma desktop 126.
diff --git a/packages/core/tests/figma-api/resize-constraints.test.ts b/packages/core/tests/figma-api/resize-constraints.test.ts
index fd9d38333..1c5d8c3f3 100644
--- a/packages/core/tests/figma-api/resize-constraints.test.ts
+++ b/packages/core/tests/figma-api/resize-constraints.test.ts
@@ -1,7 +1,8 @@
import { expect, test } from 'bun:test'
import { FigmaAPI, type FigmaNodeProxy } from '@open-pencil/core/figma-api'
-import { hasInstanceOverride, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { hasInstanceOverride } from '@open-pencil/scene-graph/instances'
// Recorded with the same script in Figma desktop 126.
diff --git a/packages/core/tests/figma-api/shape-with-text.test.ts b/packages/core/tests/figma-api/shape-with-text.test.ts
index 5ba0aa663..b8d0c8bfc 100644
--- a/packages/core/tests/figma-api/shape-with-text.test.ts
+++ b/packages/core/tests/figma-api/shape-with-text.test.ts
@@ -2,7 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { pick } from 'es-toolkit'
-import { SceneGraph, shapeWithTextFrameFields } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { shapeWithTextFrameFields } from '@open-pencil/scene-graph/generated'
import { FigmaAPI } from '#core/figma-api'
diff --git a/packages/core/tests/figma-api/sticky.test.ts b/packages/core/tests/figma-api/sticky.test.ts
index 87d62741b..f99b56021 100644
--- a/packages/core/tests/figma-api/sticky.test.ts
+++ b/packages/core/tests/figma-api/sticky.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
import { FigmaAPI } from '@open-pencil/core/figma-api'
-import { createSticky, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { createSticky } from '@open-pencil/scene-graph/generated'
function stickyNote() {
const graph = new SceneGraph()
diff --git a/packages/core/tests/figma-api/text/lists.test.ts b/packages/core/tests/figma-api/text/lists.test.ts
index eb8491be6..47f1fd3c1 100644
--- a/packages/core/tests/figma-api/text/lists.test.ts
+++ b/packages/core/tests/figma-api/text/lists.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { FigmaAPI, SceneGraph } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { SceneGraph } from '@open-pencil/scene-graph'
// Results recorded from the same scripts run in live Figma (2026-10-09).
function listText(characters: string) {
diff --git a/packages/core/tests/figma-api/text/paragraph-spacing.test.ts b/packages/core/tests/figma-api/text/paragraph-spacing.test.ts
index b8b118ab7..5c6160663 100644
--- a/packages/core/tests/figma-api/text/paragraph-spacing.test.ts
+++ b/packages/core/tests/figma-api/text/paragraph-spacing.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { FigmaAPI, SceneGraph } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { SceneGraph } from '@open-pencil/scene-graph'
// Results recorded from the same scripts run in live Figma (2026-10-10).
function spacedText(characters = 'A\nB\nC') {
@@ -90,8 +91,6 @@ describe('paragraph spacing ranges', () => {
expect(perParagraph(text, (s, e) => text.getRangeParagraphSpacing(s, e))).toEqual([7, 7])
text.setRangeParagraphSpacing(0, 1, 30)
text.insertCharacters(1, '\nZ')
- expect(perParagraph(text, (s, e) => text.getRangeParagraphSpacing(s, e))).toEqual([
- 30, 30, 7
- ])
+ expect(perParagraph(text, (s, e) => text.getRangeParagraphSpacing(s, e))).toEqual([30, 30, 7])
})
})
diff --git a/packages/core/tests/figma-api/text/references.test.ts b/packages/core/tests/figma-api/text/references.test.ts
index 28f2ae1f7..ba4d303dd 100644
--- a/packages/core/tests/figma-api/text/references.test.ts
+++ b/packages/core/tests/figma-api/text/references.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { FigmaAPI, SceneGraph } from '@open-pencil/core'
-import type { Color } from '@open-pencil/scene-graph'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
// Shapes and messages follow `@figma/plugin-typings` and the Plugin API documentation for the
// range methods; validation messages follow those Figma reports for the other range setters.
diff --git a/packages/core/tests/figma-api/text/styles.test.ts b/packages/core/tests/figma-api/text/styles.test.ts
index 704cd91fe..b743696d0 100644
--- a/packages/core/tests/figma-api/text/styles.test.ts
+++ b/packages/core/tests/figma-api/text/styles.test.ts
@@ -2,8 +2,9 @@ import { describe, expect, test } from 'bun:test'
import { expectFills } from '#core-tests/helpers/assert'
-import { FigmaAPI, SceneGraph } from '@open-pencil/core'
-import type { Color } from '@open-pencil/scene-graph'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
// Results recorded from the same scripts run in live Figma (2026-10-11). OpenPencil reports
// lengths in pixels, as its node getters do, and paints in the shape `fills` returns.
@@ -247,9 +248,7 @@ describe('character style ranges', () => {
expect(() => text.setRangeFontSize(5, 9, 0)).toThrow(
'in setRangeFontSize: Range outside of available characters.'
)
- expect(() =>
- text.setRangeLetterSpacing(0, 1, { value: 1, unit: 'EM' as 'PIXELS' })
- ).toThrow(
+ expect(() => text.setRangeLetterSpacing(0, 1, { value: 1, unit: 'EM' as 'PIXELS' })).toThrow(
message(
'setRangeLetterSpacing',
"Invalid enum value. Expected 'PIXELS' | 'PERCENT', received 'EM' at .unit"
@@ -321,8 +320,7 @@ describe('character style ranges', () => {
text.setRangeTextDecoration(0, 3, 'UNDERLINE')
const color = (problem: string) =>
- 'in setRangeTextDecorationColor: Property "textDecorationColor" failed validation: ' +
- problem
+ 'in setRangeTextDecorationColor: Property "textDecorationColor" failed validation: ' + problem
const noneMatched = (issues: string) =>
color(
`Expected one of the following, but none matched:\n${issues}\n` +
diff --git a/packages/core/tests/figma-api/variables/scaled-bindings.test.ts b/packages/core/tests/figma-api/variables/scaled-bindings.test.ts
index 4e86e7245..d6e42a01d 100644
--- a/packages/core/tests/figma-api/variables/scaled-bindings.test.ts
+++ b/packages/core/tests/figma-api/variables/scaled-bindings.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { OpenPencilAPI } from '@open-pencil/core'
+import { OpenPencilAPI } from '@open-pencil/core/openpencil-api'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/core/tests/geometry/gradient.test.ts b/packages/core/tests/geometry/gradient.test.ts
index 5fe2d15a6..4ab9a2244 100644
--- a/packages/core/tests/geometry/gradient.test.ts
+++ b/packages/core/tests/geometry/gradient.test.ts
@@ -1,5 +1,7 @@
import { describe, expect, test } from 'bun:test'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
+
import {
gradientHandleLayout,
gradientHandles,
@@ -7,7 +9,6 @@ import {
hitTestGradientHandles,
moveGradientHandle
} from '#core/geometry'
-import type { Vector } from '@open-pencil/scene-graph'
// A 200 × 140 layer with a linear gradient from its left edge's middle to its right edge's middle:
// Figma's identity transform.
@@ -49,9 +50,9 @@ describe('gradient handles', () => {
y: 120
})
const figma = [1.2820513, 0.0769231, -0.0384615, -0.8547009, 1.2820513, -0.1410256]
- expect([moved.m00, moved.m01, moved.m02, moved.m10, moved.m11, moved.m12].map((v) => +v.toFixed(5))).toEqual(
- figma.map((v) => +v.toFixed(5))
- )
+ expect(
+ [moved.m00, moved.m01, moved.m02, moved.m10, moved.m11, moved.m12].map((v) => +v.toFixed(5))
+ ).toEqual(figma.map((v) => +v.toFixed(5)))
})
// Figma desktop 126: the pointer at −10.2° from the start lands on −15°, at the pointer's distance.
@@ -79,9 +80,9 @@ describe('gradient handles', () => {
expect(gradientStopPosition('GRADIENT_LINEAR', LEFT_TO_RIGHT, 200, 140, { x: 150, y: 3 })).toBe(
0.75
)
- expect(gradientStopPosition('GRADIENT_LINEAR', LEFT_TO_RIGHT, 200, 140, { x: -40, y: 70 })).toBe(
- 0
- )
+ expect(
+ gradientStopPosition('GRADIENT_LINEAR', LEFT_TO_RIGHT, 200, 140, { x: -40, y: 70 })
+ ).toBe(0)
})
test('an angular stop follows the pointer around the centre', () => {
diff --git a/packages/core/tests/geometry/line-ends.test.ts b/packages/core/tests/geometry/line-ends.test.ts
index 09a4376fd..b3e7cd696 100644
--- a/packages/core/tests/geometry/line-ends.test.ts
+++ b/packages/core/tests/geometry/line-ends.test.ts
@@ -1,5 +1,6 @@
import { describe, expect, test } from 'bun:test'
+import { createEditor } from '@open-pencil/core'
import {
aimLine,
draggedLineEnds,
@@ -7,14 +8,9 @@ import {
lineWorldEnds,
type LineEnd
} from '@open-pencil/core/geometry'
-import { createEditor } from '@open-pencil/core/editor'
-import {
- createConnector,
- freeEndpoint,
- SceneGraph,
- type SceneNode,
- type Vector
-} from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { createConnector, freeEndpoint } from '@open-pencil/scene-graph/connectors'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
/** An arrow as Figma's Arrow tool draws one: a flat vector along its width, aimed by rotation. */
function arrow(graph: SceneGraph, start: Vector, end: Vector): SceneNode {
@@ -76,7 +72,10 @@ describe('dragging a line by an end', () => {
expect(result.length).toBe(243.85)
expect(result.rotation).toBe(7.07)
expect(result.aimed.height).toBe(0)
- expect(result.aimed.vectorNetwork?.vertices.map((vertex) => vertex.x)).toEqual([0, result.aimed.width])
+ expect(result.aimed.vectorNetwork?.vertices.map((vertex) => vertex.x)).toEqual([
+ 0,
+ result.aimed.width
+ ])
})
test('Shift holds it to 45° steps, as far as the pointer reaches along them', () => {
@@ -135,13 +134,18 @@ describe('dragging a line by an end', () => {
test('the editor aims a line from a dragged end in one undo step', () => {
const editor = createEditor()
- const line = editor.graph.createNode('LINE', editor.state.currentPageId, { width: 200, height: 0 })
+ const line = editor.graph.createNode('LINE', editor.state.currentPageId, {
+ width: 200,
+ height: 0
+ })
editor.lineEndBegin(line.id, 'end', 200, 0)
editor.lineEndDrag(200, 100)
editor.lineEndDrag(200, 200, { shift: true })
editor.lineEndCommit()
const aimed = editor.graph.getNode(line.id)
- expect(lineWorldEnds(editor.graph, aimed ?? line).map(({ x, y }) => [Math.round(x), Math.round(y)])).toEqual([
+ expect(
+ lineWorldEnds(editor.graph, aimed ?? line).map(({ x, y }) => [Math.round(x), Math.round(y)])
+ ).toEqual([
[0, 0],
[200, 200]
])
@@ -164,4 +168,3 @@ test('a connector is never aimed as a line, though its box is flat', () => {
expect(editor.graph.getNode(connector.id)).toMatchObject({ width: 200, height: 0, rotation: 0 })
editor.dispose()
})
-
diff --git a/packages/core/tests/helpers/editor-history.ts b/packages/core/tests/helpers/editor-history.ts
index 3b20be1c6..e18611060 100644
--- a/packages/core/tests/helpers/editor-history.ts
+++ b/packages/core/tests/helpers/editor-history.ts
@@ -1,5 +1,4 @@
-import { createEditor } from '@open-pencil/core/editor'
-import type { Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
export function setupEditorPage() {
const editor = createEditor()
diff --git a/packages/core/tests/helpers/fig/fixtures.ts b/packages/core/tests/helpers/fig/fixtures.ts
index dfcdb6853..c730417b7 100644
--- a/packages/core/tests/helpers/fig/fixtures.ts
+++ b/packages/core/tests/helpers/fig/fixtures.ts
@@ -3,13 +3,9 @@ import { resolve } from 'node:path'
import * as v from 'valibot'
-import {
- parseFigFile,
- type ParseFigFileOptions,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/core'
+import { parseFigFile, type ParseFigFileOptions } from '@open-pencil/core/io/formats/fig'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import { FIXTURES } from '../paths'
import { collectAllNodes } from './traversal'
diff --git a/packages/core/tests/helpers/fig/guid.ts b/packages/core/tests/helpers/fig/guid.ts
index 559f72914..d2d849d13 100644
--- a/packages/core/tests/helpers/fig/guid.ts
+++ b/packages/core/tests/helpers/fig/guid.ts
@@ -1,4 +1,4 @@
-import type { GUID } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
export function guid(localID: number, sessionID = 1): GUID {
return { sessionID, localID }
diff --git a/packages/core/tests/helpers/fig/traversal.ts b/packages/core/tests/helpers/fig/traversal.ts
index 53bfe8fd9..60f9dc6c0 100644
--- a/packages/core/tests/helpers/fig/traversal.ts
+++ b/packages/core/tests/helpers/fig/traversal.ts
@@ -1,4 +1,4 @@
-import type { NodeType, SceneGraph, SceneNode } from '@open-pencil/core'
+import type { NodeType, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
export function collectAllNodes(graph: SceneGraph): SceneNode[] {
const all: SceneNode[] = []
diff --git a/packages/core/tests/helpers/figma-rows.ts b/packages/core/tests/helpers/figma-rows.ts
index ee661a29e..ec8213807 100644
--- a/packages/core/tests/helpers/figma-rows.ts
+++ b/packages/core/tests/helpers/figma-rows.ts
@@ -2,8 +2,8 @@ import { expect } from 'bun:test'
import type { CanvasKit } from 'canvaskit-wasm'
-import type { SkiaRenderer } from '@open-pencil/core'
-import { renderNodesToImage } from '@open-pencil/core/io'
+import type { SkiaRenderer } from '@open-pencil/core/canvas'
+import { renderNodesToImage } from '@open-pencil/core/io/formats/raster'
import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined } from './assert'
diff --git a/packages/core/tests/helpers/undo.ts b/packages/core/tests/helpers/undo.ts
index c2e431b8c..e9a8bad91 100644
--- a/packages/core/tests/helpers/undo.ts
+++ b/packages/core/tests/helpers/undo.ts
@@ -1,4 +1,4 @@
-import { UndoManager } from '@open-pencil/scene-graph'
+import { UndoManager } from '@open-pencil/scene-graph/undo'
/** An undo entry that records nothing, for tests that only care about the batching. */
export const noop = (): void => undefined
diff --git a/packages/core/tests/icons/glyph.test.ts b/packages/core/tests/icons/glyph.test.ts
index e767899db..ae7945731 100644
--- a/packages/core/tests/icons/glyph.test.ts
+++ b/packages/core/tests/icons/glyph.test.ts
@@ -1,14 +1,15 @@
import { describe, expect, test } from 'bun:test'
-import { isIconModified, readIcon, readIconTint, SceneGraph, withIcon } from '@open-pencil/scene-graph'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { parseColor } from '@open-pencil/scene-graph/color'
+import { isIconModified, readIcon, readIconTint, withIcon } from '@open-pencil/scene-graph/icons'
import {
collectResizeDescendants,
computeConstrainedResizeChanges
} from '@open-pencil/scene-graph/resize'
import { detachIcon, placeIcon, recolorIcon, swapIcon } from '#core/icons/render'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
import { buildIconData } from '#core/icons/svg'
const BLACK = parseColor('#000000')
@@ -48,7 +49,9 @@ describe('icon glyphs', () => {
] as const) {
const { graph, frame } = placed(body, size)
const loaded = await parseFigFile((await exportFigFile(graph)).slice().buffer)
- const icon = [...loaded.getAllNodes()].find((node) => readIcon(node)?.name === readIcon(frame)?.name)
+ const icon = [...loaded.getAllNodes()].find(
+ (node) => readIcon(node)?.name === readIcon(frame)?.name
+ )
if (!icon) throw new Error('Expected the icon to load')
// An icon without a glyph also reads as unedited, so the glyph itself has to survive.
expect(readIcon(icon)?.glyph).toBe(readIcon(frame)?.glyph ?? 'missing')
@@ -94,7 +97,9 @@ describe('icon glyphs', () => {
expect(added.modified()).toBe(true)
const logo = placed(LOGO)
- const own = logo.graph.getChildren(logo.frame.id).find((child) => readIconTint(child).length === 0)
+ const own = logo.graph
+ .getChildren(logo.frame.id)
+ .find((child) => readIconTint(child).length === 0)
if (!own) throw new Error('Expected a path with its own color')
logo.graph.updateNode(own.id, {
fills: own.fills.map((fill) => ({ ...fill, color: parseColor('#16a34a') }))
diff --git a/packages/core/tests/icons/render.test.ts b/packages/core/tests/icons/render.test.ts
index 0253e0f37..32a6792f8 100644
--- a/packages/core/tests/icons/render.test.ts
+++ b/packages/core/tests/icons/render.test.ts
@@ -2,15 +2,12 @@ import { describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { SkiaRenderer } from '@open-pencil/core'
-import {
- exportFigFile,
- initCanvasKit,
- parseFigFile,
- renderNodesToImage
-} from '@open-pencil/core/io'
-import { readIcon, readIconTint, SceneGraph } from '@open-pencil/scene-graph'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io/formats/raster'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { parseColor } from '@open-pencil/scene-graph/color'
+import { readIcon, readIconTint } from '@open-pencil/scene-graph/icons'
import { iconColor, placeIcon, recolorIcon, swapIcon } from '#core/icons/render'
import { buildIconData } from '#core/icons/svg'
@@ -121,7 +118,14 @@ describe('icon identity', () => {
const { frame } = insertIcon(graph, BODY, 24, 32)
const green = parseColor('#00ff00')
recolorIcon(graph, frame.id, green)
- const other = buildIconData({ body: '<path fill="currentColor" d="M0 0h24v24H0z"/>' }, 'test', 'square', 24, 24, 32)
+ const other = buildIconData(
+ { body: '<path fill="currentColor" d="M0 0h24v24H0z"/>' },
+ 'test',
+ 'square',
+ 24,
+ 24,
+ 32
+ )
swapIcon(graph, frame.id, other)
const swapped = expectDefined(graph.getNode(frame.id), 'swapped icon')
@@ -135,7 +139,11 @@ describe('icon identity', () => {
test('leaves artwork without a name in a set unnamed', () => {
const graph = new SceneGraph()
const icon = buildIconData({ body: BODY }, 'svg', 'custom', 24, 24, 24)
- const frame = placeIcon(graph, graph.getPages()[0].id, icon, { size: 24, color: BLACK, identity: false })
+ const frame = placeIcon(graph, graph.getPages()[0].id, icon, {
+ size: 24,
+ color: BLACK,
+ identity: false
+ })
expect(readIcon(frame)).toBeNull()
})
})
diff --git a/packages/core/tests/io/formats/fig/compression.test.ts b/packages/core/tests/io/formats/fig/compression.test.ts
index 10396acdd..c452c86a9 100644
--- a/packages/core/tests/io/formats/fig/compression.test.ts
+++ b/packages/core/tests/io/formats/fig/compression.test.ts
@@ -2,13 +2,12 @@ import { describe, expect, setDefaultTimeout, test } from 'bun:test'
import { unzipSync } from 'fflate'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { parseFigKiwiChunks } from '@open-pencil/kiwi/fig/container'
-import {
- OPEN_PENCIL_PLUGIN_DATA,
- withPluginData,
- type FigCompression
-} from '@open-pencil/scene-graph'
+import { OPEN_PENCIL_PLUGIN_DATA, withPluginData } from '@open-pencil/scene-graph/plugin-data'
+import type { FigCompression } from '@open-pencil/scene-graph/fig-compression'
import { figCompressionOf } from '#core/io/formats/fig/compression'
import { hasPendingReaderPages } from '#core/kiwi/fig/session/document-state'
diff --git a/packages/core/tests/io/formats/fig/export/binding/authoring.test.ts b/packages/core/tests/io/formats/fig/export/binding/authoring.test.ts
index 96bccd8f8..2589b1376 100644
--- a/packages/core/tests/io/formats/fig/export/binding/authoring.test.ts
+++ b/packages/core/tests/io/formats/fig/export/binding/authoring.test.ts
@@ -5,13 +5,13 @@ import { CapturedFigRecords, readFixture } from '#core-tests/helpers/fig/fixture
import { inheritedNestedBindingRecords } from '#core-tests/helpers/fig/nested-binding'
import * as v from 'valibot'
-import { OpenPencilAPI } from '@open-pencil/core'
-import { createEditor } from '@open-pencil/core/editor'
+import { OpenPencilAPI } from '@open-pencil/core/openpencil-api'
+import { createEditor } from '@open-pencil/core'
import { FigmaAPI } from '@open-pencil/core/figma-api'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { materializeDocument, parseFigBuffer } from '@open-pencil/fig'
-import { cloneInstanceOverrideState } from '@open-pencil/scene-graph'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { cloneInstanceOverrideState } from '@open-pencil/scene-graph/instances/overrides'
/** Only the component-edit measurements this file asserts against are read from the oracle. */
const AuthoringOracle = v.looseObject({
diff --git a/packages/core/tests/io/formats/fig/export/binding/import.test.ts b/packages/core/tests/io/formats/fig/export/binding/import.test.ts
index ade7143b7..e26756b79 100644
--- a/packages/core/tests/io/formats/fig/export/binding/import.test.ts
+++ b/packages/core/tests/io/formats/fig/export/binding/import.test.ts
@@ -2,10 +2,10 @@ import { expect, test } from 'bun:test'
import { CapturedFigRecords, readFixture } from '#core-tests/helpers/fig/fixtures'
-import { createEditor } from '@open-pencil/core/editor'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { createEditor } from '@open-pencil/core'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { materializeDocument, parseFigBuffer } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
const fixture = readFixture('nested-binding-ownership-records.json', CapturedFigRecords)
diff --git a/packages/core/tests/io/formats/fig/export/canvas-order-keys.test.ts b/packages/core/tests/io/formats/fig/export/canvas-order-keys.test.ts
index 16c062d01..e014d4bfa 100644
--- a/packages/core/tests/io/formats/fig/export/canvas-order-keys.test.ts
+++ b/packages/core/tests/io/formats/fig/export/canvas-order-keys.test.ts
@@ -1,8 +1,8 @@
import { expect, test } from 'bun:test'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import type { GUID } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/core/tests/io/formats/fig/export/color-expression.test.ts b/packages/core/tests/io/formats/fig/export/color-expression.test.ts
index f5da1557d..f7e5d4de8 100644
--- a/packages/core/tests/io/formats/fig/export/color-expression.test.ts
+++ b/packages/core/tests/io/formats/fig/export/color-expression.test.ts
@@ -1,7 +1,9 @@
import { expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer, patchFigArchive } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
test('color expressions survive fresh export, import, editing and patched export', async () => {
await initCodec()
@@ -17,7 +19,9 @@ test('color expressions survive fresh export, import, editing and patched export
const record = parseFigBuffer(Uint8Array.from(exported).buffer).nodeChanges.find(
(node) => node.name === 'Derived'
)
- expect(record?.variableDataValues?.entries?.[0].variableData.value?.expressionValue).toMatchObject({
+ expect(
+ record?.variableDataValues?.entries?.[0].variableData.value?.expressionValue
+ ).toMatchObject({
expressionFunction: 'COMPOSE_COLOR',
expressionArguments: [{ dataType: 'ALIAS' }, { dataType: 'FLOAT', value: { floatValue: 20 } }]
})
diff --git a/packages/core/tests/io/formats/fig/export/color-variable-binding.test.ts b/packages/core/tests/io/formats/fig/export/color-variable-binding.test.ts
index a0786cd59..a3bd9a022 100644
--- a/packages/core/tests/io/formats/fig/export/color-variable-binding.test.ts
+++ b/packages/core/tests/io/formats/fig/export/color-variable-binding.test.ts
@@ -3,9 +3,11 @@ import { beforeAll, describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
import { inflateSync, unzipSync } from 'fflate'
-import { exportFigFile, initCodec, SceneGraph } from '@open-pencil/core'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { parseFigKiwiContainer } from '@open-pencil/kiwi/fig/parse'
import { ByteBuffer, compileSchema, decodeBinarySchema } from '@open-pencil/kiwi/schema-runtime'
+import { SceneGraph } from '@open-pencil/scene-graph'
import type { Color, GUID } from '@open-pencil/scene-graph/primitives'
interface DecodedPaint {
diff --git a/packages/core/tests/io/formats/fig/export/definition-rescale.test.ts b/packages/core/tests/io/formats/fig/export/definition-rescale.test.ts
index eea2131ee..0ec9fb8ab 100644
--- a/packages/core/tests/io/formats/fig/export/definition-rescale.test.ts
+++ b/packages/core/tests/io/formats/fig/export/definition-rescale.test.ts
@@ -4,12 +4,12 @@ import { expectDefined } from '#core-tests/helpers/assert'
import { CapturedFigRecords, readFixture } from '#core-tests/helpers/fig/fixtures'
import { inheritedNestedBindingRecords } from '#core-tests/helpers/fig/nested-binding'
-import { OpenPencilAPI } from '@open-pencil/core'
-import { createEditor } from '@open-pencil/core/editor'
+import { OpenPencilAPI } from '@open-pencil/core/openpencil-api'
+import { createEditor } from '@open-pencil/core'
import { FigmaAPI } from '@open-pencil/core/figma-api'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { materializeDocument, parseFigBuffer } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
const fixture = readFixture('nested-binding-ownership-records.json', CapturedFigRecords)
diff --git a/packages/core/tests/io/formats/fig/export/export-contract.test.ts b/packages/core/tests/io/formats/fig/export/export-contract.test.ts
index ab75f137a..c0a54e943 100644
--- a/packages/core/tests/io/formats/fig/export/export-contract.test.ts
+++ b/packages/core/tests/io/formats/fig/export/export-contract.test.ts
@@ -2,10 +2,9 @@ import { expect, test } from 'bun:test'
import { toUint8Array } from 'js-base64'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { materializeDocument, parseFigBuffer } from '@open-pencil/fig'
-import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { initCodec, type NodeChange } from '@open-pencil/kiwi/fig/codec'
import fixture from './export-contract.json'
diff --git a/packages/core/tests/io/formats/fig/export/filled-sizing-export.test.ts b/packages/core/tests/io/formats/fig/export/filled-sizing-export.test.ts
index f901f2f56..5065c8bbe 100644
--- a/packages/core/tests/io/formats/fig/export/filled-sizing-export.test.ts
+++ b/packages/core/tests/io/formats/fig/export/filled-sizing-export.test.ts
@@ -3,11 +3,11 @@ import { beforeAll, describe, expect, test } from 'bun:test'
import { guid } from '#core-tests/helpers/fig/guid'
import * as v from 'valibot'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { materializeDocument, parseFigBuffer } from '@open-pencil/fig'
-import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { SceneGraph, setInstanceOverride } from '@open-pencil/scene-graph'
+import { initCodec, type NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
// Figma stores fill on the child and keeps that axis fixed in the frame's own sizing; a hugging
// value there wins over the fill, so a filled row or button opened in Figma shrank to its content.
diff --git a/packages/core/tests/io/formats/fig/export/formula.test.ts b/packages/core/tests/io/formats/fig/export/formula.test.ts
index ddcbbc69d..c9ef55bbf 100644
--- a/packages/core/tests/io/formats/fig/export/formula.test.ts
+++ b/packages/core/tests/io/formats/fig/export/formula.test.ts
@@ -2,10 +2,12 @@ import { expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { parseFigBuffer } from '@open-pencil/fig'
import { FigmaAPI } from '@open-pencil/core/figma-api'
-import { parseVariableFormula } from '@open-pencil/scene-graph'
+import { parseVariableFormula } from '@open-pencil/scene-graph/variables'
test('numeric, Boolean and comparison formulas survive fresh and patched .fig saves', async () => {
await initCodec()
@@ -57,7 +59,6 @@ test('numeric, Boolean and comparison formulas survive fresh and patched .fig sa
}
})
-
test.each([
{ operator: 'add', operands: [true, 1] },
{ operator: 'and', operands: [1, false] },
diff --git a/packages/core/tests/io/formats/fig/export/geometry-winding.test.ts b/packages/core/tests/io/formats/fig/export/geometry-winding.test.ts
index 35a1fea3c..f79ebdafd 100644
--- a/packages/core/tests/io/formats/fig/export/geometry-winding.test.ts
+++ b/packages/core/tests/io/formats/fig/export/geometry-winding.test.ts
@@ -1,8 +1,8 @@
import { expect, test } from 'bun:test'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { resolveGeometryPaths } from '@open-pencil/fig/node-change'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
test('decodes Kiwi ODD geometry as scene even-odd', () => {
diff --git a/packages/core/tests/io/formats/fig/export/gold-edit.test.ts b/packages/core/tests/io/formats/fig/export/gold-edit.test.ts
index 607472f8b..31c562c05 100644
--- a/packages/core/tests/io/formats/fig/export/gold-edit.test.ts
+++ b/packages/core/tests/io/formats/fig/export/gold-edit.test.ts
@@ -2,10 +2,10 @@ import { expect, test } from 'bun:test'
import { readFixtureArrayBuffer } from '#core-tests/helpers/fig/fixtures'
-import { createEditor } from '@open-pencil/core/editor'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { createEditor } from '@open-pencil/core'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { materializeDocument, parseFigBuffer } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import type { SceneNode } from '@open-pencil/scene-graph'
test('Gold document exposes effective Boolean assignments and supports editor undo/redo', async () => {
diff --git a/packages/core/tests/io/formats/fig/export/layout-edit-export.test.ts b/packages/core/tests/io/formats/fig/export/layout-edit-export.test.ts
index 84c541ab7..4a8949914 100644
--- a/packages/core/tests/io/formats/fig/export/layout-edit-export.test.ts
+++ b/packages/core/tests/io/formats/fig/export/layout-edit-export.test.ts
@@ -2,10 +2,9 @@ import { expect, test } from 'bun:test'
import { guid } from '#core-tests/helpers/fig/guid'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { materializeDocument, parseFigBuffer } from '@open-pencil/fig'
-import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { initCodec, type NodeChange } from '@open-pencil/kiwi/fig/codec'
test('retained implicit layout survives import but does not override an explicit sizing edit', async () => {
await initCodec()
diff --git a/packages/core/tests/io/formats/fig/export/layout-scale.test.ts b/packages/core/tests/io/formats/fig/export/layout-scale.test.ts
index 7c9274a7f..56d14e343 100644
--- a/packages/core/tests/io/formats/fig/export/layout-scale.test.ts
+++ b/packages/core/tests/io/formats/fig/export/layout-scale.test.ts
@@ -2,14 +2,13 @@ import { expect, test } from 'bun:test'
import { NestedLayoutScaleFixture, readFixture } from '#core-tests/helpers/fig/fixtures'
-import { createEditor } from '@open-pencil/core/editor'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { createEditor } from '@open-pencil/core'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { computeAllLayouts } from '@open-pencil/core/layout'
import { materializeDocument, parseFigBuffer } from '@open-pencil/fig'
import { symbolOverridesOf } from '@open-pencil/fig/instance-overrides'
-import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { hasInstanceOverride } from '@open-pencil/scene-graph'
+import { initCodec, type NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { hasInstanceOverride } from '@open-pencil/scene-graph/instances'
const fixture = readFixture('nested-layout-scale.json', NestedLayoutScaleFixture)
diff --git a/packages/core/tests/io/formats/fig/export/live-document.test.ts b/packages/core/tests/io/formats/fig/export/live-document.test.ts
index e6691bf38..b64118081 100644
--- a/packages/core/tests/io/formats/fig/export/live-document.test.ts
+++ b/packages/core/tests/io/formats/fig/export/live-document.test.ts
@@ -2,9 +2,11 @@ import { expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'
-import { createEditor } from '@open-pencil/core/editor'
-import { emptyBehaviour, readBehaviour, SceneGraph } from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { emptyBehaviour, readBehaviour } from '@open-pencil/scene-graph/behaviours'
import { settleFontDigestMap } from '#core/kiwi/fig/node-change/font/digests'
import { fontManager } from '#core/text/fonts'
diff --git a/packages/core/tests/io/formats/fig/export/live-variable-scale.test.ts b/packages/core/tests/io/formats/fig/export/live-variable-scale.test.ts
index 2ba796c46..c3547043f 100644
--- a/packages/core/tests/io/formats/fig/export/live-variable-scale.test.ts
+++ b/packages/core/tests/io/formats/fig/export/live-variable-scale.test.ts
@@ -2,10 +2,10 @@ import { expect, test } from 'bun:test'
import { readFixtureArrayBuffer } from '#core-tests/helpers/fig/fixtures'
-import { createEditor } from '@open-pencil/core/editor'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { createEditor } from '@open-pencil/core'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { materializeDocument, parseFigBuffer } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
function tagsInInput(graph: SceneGraph, rootId: string): SceneNode {
diff --git a/packages/core/tests/io/formats/fig/export/meta.test.ts b/packages/core/tests/io/formats/fig/export/meta.test.ts
index fd7dcfd15..f27118f42 100644
--- a/packages/core/tests/io/formats/fig/export/meta.test.ts
+++ b/packages/core/tests/io/formats/fig/export/meta.test.ts
@@ -6,7 +6,7 @@ import { unzipSync } from 'fflate'
import * as v from 'valibot'
import { FigmaAPI } from '@open-pencil/core/figma-api'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer, pngSize, readFigArchiveMeta } from '@open-pencil/fig'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/core/tests/io/formats/fig/export/nested-override-address.test.ts b/packages/core/tests/io/formats/fig/export/nested-override-address.test.ts
index c38f177bf..e17720835 100644
--- a/packages/core/tests/io/formats/fig/export/nested-override-address.test.ts
+++ b/packages/core/tests/io/formats/fig/export/nested-override-address.test.ts
@@ -2,11 +2,13 @@ import { expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { exportFigFile, FigmaAPI, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
import type { SymbolData } from '@open-pencil/fig/instance-overrides'
-import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { initCodec, type NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
+import { SceneGraph } from '@open-pencil/scene-graph'
/** The Kiwi codec types only `symbolID`; the rest of the symbol payload is read through here. */
const symbolDataOf = (record: NodeChange): SymbolData | undefined =>
diff --git a/packages/core/tests/io/formats/fig/export/patch/fields.test.ts b/packages/core/tests/io/formats/fig/export/patch/fields.test.ts
index b0df095fe..e30f3d499 100644
--- a/packages/core/tests/io/formats/fig/export/patch/fields.test.ts
+++ b/packages/core/tests/io/formats/fig/export/patch/fields.test.ts
@@ -5,12 +5,11 @@ import { readFixtureArrayBuffer } from '#core-tests/helpers/fig/fixtures'
import { uniq } from 'es-toolkit/array'
import { isEqual } from 'es-toolkit/predicate'
-import { createEditor } from '@open-pencil/core/editor'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { createEditor } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
import { symbolOverridesOf } from '@open-pencil/fig/instance-overrides'
-import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { initCodec, type NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
import type { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/core/tests/io/formats/fig/export/patch/index.test.ts b/packages/core/tests/io/formats/fig/export/patch/index.test.ts
index fed7c7285..203cfc869 100644
--- a/packages/core/tests/io/formats/fig/export/patch/index.test.ts
+++ b/packages/core/tests/io/formats/fig/export/patch/index.test.ts
@@ -4,13 +4,24 @@ import { expectDefined } from '#core-tests/helpers/assert'
import { isEqual } from 'es-toolkit/predicate'
import { deflateSync } from 'fflate'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
-import { populateAllFigPages, populateFigPage } from '@open-pencil/core/io/formats/fig'
+import {
+ exportFigFile,
+ parseFigFile,
+ populateAllFigPages,
+ populateFigPage
+} from '@open-pencil/core/io/formats/fig'
import { compressFigDataSync, parseFigBuffer } from '@open-pencil/fig'
-import { getCompiledSchema, getSchemaBytes, type NodeChange } from '@open-pencil/kiwi/fig/codec'
+import {
+ initCodec,
+ getCompiledSchema,
+ getSchemaBytes,
+ type NodeChange
+} from '@open-pencil/kiwi/fig/codec'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
-import { computeImageHash, getSharedStyles, type SceneNode } from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
import { cloneNodeProps } from '@open-pencil/scene-graph/copy'
+import { computeImageHash } from '@open-pencil/scene-graph/images'
+import { getSharedStyles } from '@open-pencil/scene-graph/shared-styles'
import { releaseFigArchive } from '#core/kiwi/fig/session/archive/access'
import {
diff --git a/packages/core/tests/io/formats/fig/export/rescale-export.test.ts b/packages/core/tests/io/formats/fig/export/rescale-export.test.ts
index d9634051d..2a6b3a752 100644
--- a/packages/core/tests/io/formats/fig/export/rescale-export.test.ts
+++ b/packages/core/tests/io/formats/fig/export/rescale-export.test.ts
@@ -3,14 +3,14 @@ import { expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
import { CapturedFigRecords, readFixture } from '#core-tests/helpers/fig/fixtures'
-import { createEditor } from '@open-pencil/core/editor'
-import { OpenPencilAPI } from '@open-pencil/core'
+import { createEditor } from '@open-pencil/core'
+import { OpenPencilAPI } from '@open-pencil/core/openpencil-api'
import { FigmaAPI } from '@open-pencil/core/figma-api'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { materializeDocument, parseFigBuffer } from '@open-pencil/fig'
import { symbolDataOf } from '@open-pencil/fig/instance-overrides'
-import { setInstanceOverride } from '@open-pencil/scene-graph'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
const fixture = readFixture('nested-binding-ownership-records.json', CapturedFigRecords)
diff --git a/packages/core/tests/io/formats/fig/export/scalar-override-lifecycle.test.ts b/packages/core/tests/io/formats/fig/export/scalar-override-lifecycle.test.ts
index a0ca585af..820c9eb38 100644
--- a/packages/core/tests/io/formats/fig/export/scalar-override-lifecycle.test.ts
+++ b/packages/core/tests/io/formats/fig/export/scalar-override-lifecycle.test.ts
@@ -1,8 +1,8 @@
import { expect, test } from 'bun:test'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { materializeDocument, parseFigBuffer } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
const guid = (localID: number) => ({ sessionID: 1, localID })
const records = () => [
diff --git a/packages/core/tests/io/formats/fig/export/self-size-export.test.ts b/packages/core/tests/io/formats/fig/export/self-size-export.test.ts
index 4da10e0fc..68bec80d8 100644
--- a/packages/core/tests/io/formats/fig/export/self-size-export.test.ts
+++ b/packages/core/tests/io/formats/fig/export/self-size-export.test.ts
@@ -2,11 +2,13 @@ import { expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
import { symbolDataOf } from '@open-pencil/fig/instance-overrides'
-import { SceneGraph, setInstanceOverride, rescaleNodeTree } from '@open-pencil/scene-graph'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
+import { rescaleNodeTree } from '@open-pencil/scene-graph/scaling'
test('serializes self size claims against the instance main component', async () => {
await initCodec()
diff --git a/packages/core/tests/io/formats/fig/export/shared-style-export.test.ts b/packages/core/tests/io/formats/fig/export/shared-style-export.test.ts
index a936aa0ac..d2157c1db 100644
--- a/packages/core/tests/io/formats/fig/export/shared-style-export.test.ts
+++ b/packages/core/tests/io/formats/fig/export/shared-style-export.test.ts
@@ -1,9 +1,10 @@
import { beforeAll, expect, test } from 'bun:test'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
-import { getSharedStyles, SceneGraph } from '@open-pencil/scene-graph'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { getSharedStyles } from '@open-pencil/scene-graph/shared-styles'
beforeAll(async () => {
await initCodec()
diff --git a/packages/core/tests/io/formats/fig/export/text-sizing-export.test.ts b/packages/core/tests/io/formats/fig/export/text-sizing-export.test.ts
index 281d1d26e..923a1701f 100644
--- a/packages/core/tests/io/formats/fig/export/text-sizing-export.test.ts
+++ b/packages/core/tests/io/formats/fig/export/text-sizing-export.test.ts
@@ -1,8 +1,8 @@
import { expect, test } from 'bun:test'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
for (const mode of ['NONE', 'HEIGHT', 'WIDTH_AND_HEIGHT'] as const) {
diff --git a/packages/core/tests/io/formats/fig/import/shared-instance-values.test.ts b/packages/core/tests/io/formats/fig/import/shared-instance-values.test.ts
index bb900f431..7ee846982 100644
--- a/packages/core/tests/io/formats/fig/import/shared-instance-values.test.ts
+++ b/packages/core/tests/io/formats/fig/import/shared-instance-values.test.ts
@@ -1,6 +1,7 @@
import { expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
const red = { r: 1, g: 0, b: 0, a: 1 }
diff --git a/packages/core/tests/io/formats/fig/import/stale-overrides.test.ts b/packages/core/tests/io/formats/fig/import/stale-overrides.test.ts
index db6448409..7b499026a 100644
--- a/packages/core/tests/io/formats/fig/import/stale-overrides.test.ts
+++ b/packages/core/tests/io/formats/fig/import/stale-overrides.test.ts
@@ -3,8 +3,9 @@ import { afterEach, expect, test } from 'bun:test'
import { readFixtureArrayBuffer } from '#core-tests/helpers/fig/fixtures'
import { HEAVY_TEST_TIMEOUT_MS, runsHeavyTests } from '#core-tests/helpers/test-utils'
-import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { readerDiagnostics, registerReaderSession } from '#core/kiwi/fig/session/document-state'
import { openReaderSession } from '#core/kiwi/fig/session/reader'
diff --git a/packages/core/tests/io/formats/fig/import/unsupported-expressions.test.ts b/packages/core/tests/io/formats/fig/import/unsupported-expressions.test.ts
index 50446d0cf..c083e8356 100644
--- a/packages/core/tests/io/formats/fig/import/unsupported-expressions.test.ts
+++ b/packages/core/tests/io/formats/fig/import/unsupported-expressions.test.ts
@@ -5,7 +5,8 @@ import { deflateSync } from 'fflate'
import { compressFigDataSync, parseFigBuffer } from '@open-pencil/fig'
import { getCompiledSchema, getSchemaBytes, type NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString, stringToGuid } from '@open-pencil/kiwi/fig/guid'
-import { isUnsupportedVariableValue, SceneGraph, type VariableValue } from '@open-pencil/scene-graph'
+import { isUnsupportedVariableValue } from '@open-pencil/scene-graph/variables'
+import { SceneGraph, type VariableValue } from '@open-pencil/scene-graph'
import { createEditor } from '#core/editor/create'
import {
diff --git a/packages/core/tests/io/formats/fig/instance/component-sync.test.ts b/packages/core/tests/io/formats/fig/instance/component-sync.test.ts
index 7c780a74f..a053c9b3b 100644
--- a/packages/core/tests/io/formats/fig/instance/component-sync.test.ts
+++ b/packages/core/tests/io/formats/fig/instance/component-sync.test.ts
@@ -2,11 +2,10 @@ import { expect, test } from 'bun:test'
import { guid } from '#core-tests/helpers/fig/guid'
-import { FigmaAPI } from '@open-pencil/core'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { interpretInstance, materializeInstance } from '@open-pencil/fig/instance-overrides'
-import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { initCodec, type NodeChange } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
test('nested instances retain their outer source-child correspondence during sync', () => {
diff --git a/packages/core/tests/io/formats/fig/instance/derived-geometry.test.ts b/packages/core/tests/io/formats/fig/instance/derived-geometry.test.ts
index 815e00203..26e115b26 100644
--- a/packages/core/tests/io/formats/fig/instance/derived-geometry.test.ts
+++ b/packages/core/tests/io/formats/fig/instance/derived-geometry.test.ts
@@ -2,7 +2,7 @@ import { expect, test } from 'bun:test'
import { guid } from '#core-tests/helpers/fig/guid'
-import { FigmaAPI } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
import { interpretInstance, materializeInstance } from '@open-pencil/fig/instance-overrides'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/core/tests/io/formats/fig/instance/gold/preview.test.ts b/packages/core/tests/io/formats/fig/instance/gold/preview.test.ts
index d66a9905d..0c0784d0b 100644
--- a/packages/core/tests/io/formats/fig/instance/gold/preview.test.ts
+++ b/packages/core/tests/io/formats/fig/instance/gold/preview.test.ts
@@ -2,9 +2,8 @@ import { expect, test } from 'bun:test'
import { readFixtureArrayBuffer } from '#core-tests/helpers/fig/fixtures'
-import { FigmaAPI } from '@open-pencil/core'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
import {
interpretInstance,
@@ -14,6 +13,7 @@ import {
materializeInstance,
type InstanceOccurrence
} from '@open-pencil/fig/instance-overrides'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
function named(node: InstanceOccurrence, name: string): InstanceOccurrence {
diff --git a/packages/core/tests/io/formats/fig/instance/override-reopen-sync.test.ts b/packages/core/tests/io/formats/fig/instance/override-reopen-sync.test.ts
index e37ad77d9..de0af5e0c 100644
--- a/packages/core/tests/io/formats/fig/instance/override-reopen-sync.test.ts
+++ b/packages/core/tests/io/formats/fig/instance/override-reopen-sync.test.ts
@@ -1,9 +1,9 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { FigmaAPI } from '@open-pencil/core/figma-api'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
import { deserializeSceneGraph, serializeSceneGraph } from '#core/kiwi/fig/parse/transfer'
diff --git a/packages/core/tests/io/formats/fig/instance/source-children.test.ts b/packages/core/tests/io/formats/fig/instance/source-children.test.ts
index 252e51ca3..cb3880271 100644
--- a/packages/core/tests/io/formats/fig/instance/source-children.test.ts
+++ b/packages/core/tests/io/formats/fig/instance/source-children.test.ts
@@ -2,9 +2,8 @@ import { expect, test } from 'bun:test'
import { guid } from '#core-tests/helpers/fig/guid'
-import { FigmaAPI } from '@open-pencil/core'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import {
interpretComponent,
interpretInstance,
@@ -12,7 +11,7 @@ import {
mapInstanceSourceChildren,
materializeInstance
} from '@open-pencil/fig/instance-overrides'
-import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { initCodec, type NodeChange } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
test('derives repeated nested child correspondence from materialized component occurrences', async () => {
diff --git a/packages/core/tests/io/formats/fig/roundtrip/archive-assembly.test.ts b/packages/core/tests/io/formats/fig/roundtrip/archive-assembly.test.ts
index 96826c3ce..a62ff18a7 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/archive-assembly.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/archive-assembly.test.ts
@@ -1,8 +1,8 @@
import { expect, test } from 'bun:test'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { materializeDocument, materializeFigArchive, parseFigBuffer } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
test('archive-owned assembly matches record-based assembly and isolates returned graphs', async () => {
diff --git a/packages/core/tests/io/formats/fig/roundtrip/basic.test.ts b/packages/core/tests/io/formats/fig/roundtrip/basic.test.ts
index 3912b193a..7d58d573d 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/basic.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/basic.test.ts
@@ -3,14 +3,9 @@ import { beforeAll, describe, expect, setDefaultTimeout, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
import { collectAllNodes, countByType } from '#core-tests/helpers/fig/traversal'
-import {
- exportFigFile,
- initCodec,
- parseFigFile,
- SceneGraph,
- type SceneNode
-} from '@open-pencil/core'
-import { populateFigPage } from '@open-pencil/core/io/formats/fig'
+import { exportFigFile, parseFigFile, populateFigPage } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
setDefaultTimeout(60_000)
diff --git a/packages/core/tests/io/formats/fig/roundtrip/behaviours.test.ts b/packages/core/tests/io/formats/fig/roundtrip/behaviours.test.ts
index 46a6963e2..c7efe3ff0 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/behaviours.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/behaviours.test.ts
@@ -1,13 +1,14 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import {
emptyBehaviour,
guessInteractionStates,
missingBindings,
readBehaviour
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/behaviours'
describe('.fig round trip of behaviours', () => {
test('bindings follow the GUIDs their component properties get', async () => {
diff --git a/packages/core/tests/io/formats/fig/roundtrip/blend-mode.test.ts b/packages/core/tests/io/formats/fig/roundtrip/blend-mode.test.ts
index 0ee30f3bb..6a2398a9a 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/blend-mode.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/blend-mode.test.ts
@@ -1,7 +1,8 @@
import { beforeAll, describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
-import { populateFigPage } from '@open-pencil/core/io/formats/fig'
+import { exportFigFile, parseFigFile, populateFigPage } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
describe('roundtrip: layer blend modes', () => {
beforeAll(async () => {
diff --git a/packages/core/tests/io/formats/fig/roundtrip/boolean-visibility.test.ts b/packages/core/tests/io/formats/fig/roundtrip/boolean-visibility.test.ts
index 4f8a3e1a6..bf2c4fa25 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/boolean-visibility.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/boolean-visibility.test.ts
@@ -4,7 +4,7 @@ import { expectDefined } from '#core-tests/helpers/assert'
import { createEditor } from '#core/editor/create'
import { FigmaAPI } from '#core/figma-api'
-import { exportFigFile, parseFigFile } from '#core/io'
+import { exportFigFile, parseFigFile } from '#core/io/formats/fig'
import { populateFigPage, readerDiagnostics } from '#core/kiwi/fig/session/document-state'
import { getComponents } from '#core/tools/read/components'
diff --git a/packages/core/tests/io/formats/fig/roundtrip/exhaustive.test.ts b/packages/core/tests/io/formats/fig/roundtrip/exhaustive.test.ts
index 459d7d8f6..25c312a0b 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/exhaustive.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/exhaustive.test.ts
@@ -7,16 +7,12 @@ import {
import { heavy } from '#core-tests/helpers/test-utils'
import { unzipSync } from 'fflate'
-import {
- exportFigFile,
- initCodec,
- isZstdCompressed,
- parseFigFile,
- parseFigKiwiChunks,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { pngSize } from '@open-pencil/fig'
+import { isZstdCompressed } from '@open-pencil/kiwi/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { parseFigKiwiChunks } from '@open-pencil/kiwi/fig/container'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import type { JSONObject } from '@open-pencil/scene-graph/primitives'
import {
diff --git a/packages/core/tests/io/formats/fig/roundtrip/export-settings.test.ts b/packages/core/tests/io/formats/fig/roundtrip/export-settings.test.ts
index f166b59bb..67cb1e15c 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/export-settings.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/export-settings.test.ts
@@ -1,14 +1,10 @@
import { beforeAll, describe, expect, test } from 'bun:test'
-import {
- exportFigFile,
- initCodec,
- parseFigFile,
- SceneGraph,
- type NodeChange
-} from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { effectiveFigmaRawNodeFields, parseFigBuffer, materializeDocument } from '@open-pencil/fig'
-import { MAX_EXPORT_SCALE } from '@open-pencil/scene-graph'
+import { initCodec, type NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { MAX_EXPORT_SCALE } from '@open-pencil/scene-graph/export-scale'
function decodeExport(bytes: Uint8Array) {
return parseFigBuffer(new Uint8Array(bytes).buffer)
diff --git a/packages/core/tests/io/formats/fig/roundtrip/glyph-blob.test.ts b/packages/core/tests/io/formats/fig/roundtrip/glyph-blob.test.ts
index b7769e217..3744da89b 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/glyph-blob.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/glyph-blob.test.ts
@@ -7,9 +7,11 @@ import { FIXTURES } from '#core-tests/helpers/fig/fixtures'
import { corePackagePath } from '#core-tests/helpers/paths'
import { heavy, HEAVY_TEST_TIMEOUT_MS } from '#core-tests/helpers/test-utils'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { fontManager } from '@open-pencil/core/text'
import { parseFigBuffer } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
const INTER_ASSETS = corePackagePath('assets')
diff --git a/packages/core/tests/io/formats/fig/roundtrip/group.test.ts b/packages/core/tests/io/formats/fig/roundtrip/group.test.ts
index 67abdc785..cb9c7a89a 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/group.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/group.test.ts
@@ -2,7 +2,9 @@ import { beforeAll, describe, expect, setDefaultTimeout, test } from 'bun:test'
import { collectAllNodes } from '#core-tests/helpers/fig/traversal'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
setDefaultTimeout(60_000)
diff --git a/packages/core/tests/io/formats/fig/roundtrip/helpers.ts b/packages/core/tests/io/formats/fig/roundtrip/helpers.ts
index 1c0aae01c..cd7a76e0b 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/helpers.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/helpers.ts
@@ -1,7 +1,6 @@
import { isEqual } from 'es-toolkit/predicate'
-import type { SceneGraph, SceneNode } from '@open-pencil/core'
-import type { ComponentPropertyDefinition } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode, ComponentPropertyDefinition } from '@open-pencil/scene-graph'
import type { JSONObject } from '@open-pencil/scene-graph/primitives'
import { verifyComponentPropDefs, verifyDerivedTextData } from './raw-verifiers/helpers'
diff --git a/packages/core/tests/io/formats/fig/roundtrip/instance-overrides.test.ts b/packages/core/tests/io/formats/fig/roundtrip/instance-overrides.test.ts
index 14423da91..a9fa21bba 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/instance-overrides.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/instance-overrides.test.ts
@@ -2,8 +2,10 @@ import { beforeAll, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
-import { hasInstanceOverride, recordInstanceOverride } from '@open-pencil/scene-graph'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { hasInstanceOverride, recordInstanceOverride } from '@open-pencil/scene-graph/instances'
beforeAll(async () => {
await initCodec()
diff --git a/packages/core/tests/io/formats/fig/roundtrip/instance-size.test.ts b/packages/core/tests/io/formats/fig/roundtrip/instance-size.test.ts
index 1a7581123..5a70177d0 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/instance-size.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/instance-size.test.ts
@@ -1,10 +1,12 @@
import { expect, setDefaultTimeout, test } from 'bun:test'
-import { populateAllFigPages } from '#core/io/formats/fig'
-
import { expectDefined } from '#core-tests/helpers/assert'
-import { exportFigFile, initCodec, readFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, readFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+
+import { populateAllFigPages } from '#core/io/formats/fig'
setDefaultTimeout(60_000)
@@ -31,7 +33,10 @@ test('a hug instance keeps the height its own text laid it out to when reopened'
const instance = expectDefined(graph.createInstance(component.id, page.id), 'instance')
const body = expectDefined(graph.getChildren(instance.id)[0], 'instance body')
// Four lines of text, and the hug frame laid out around them.
- graph.updateNode(body.id, { text: 'Four lines of text, as the layout measured them.', height: 80 })
+ graph.updateNode(body.id, {
+ text: 'Four lines of text, as the layout measured them.',
+ height: 80
+ })
graph.updateNode(instance.id, { height: 120 })
const bytes = await exportFigFile(graph)
diff --git a/packages/core/tests/io/formats/fig/roundtrip/layer-ids.test.ts b/packages/core/tests/io/formats/fig/roundtrip/layer-ids.test.ts
index 5b3eb069d..17751cfbc 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/layer-ids.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/layer-ids.test.ts
@@ -1,6 +1,8 @@
import { beforeAll, describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
async function reopen(graph: SceneGraph): Promise<SceneGraph> {
return parseFigFile((await exportFigFile(graph)).slice().buffer)
diff --git a/packages/core/tests/io/formats/fig/roundtrip/layout-guides.test.ts b/packages/core/tests/io/formats/fig/roundtrip/layout-guides.test.ts
index 7bd55f603..1245cb2ee 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/layout-guides.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/layout-guides.test.ts
@@ -1,7 +1,9 @@
import { beforeAll, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
import { FigmaAPI, type FigmaNodeProxy } from '@open-pencil/core/figma-api'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
beforeAll(async () => {
await initCodec()
diff --git a/packages/core/tests/io/formats/fig/roundtrip/shaders.test.ts b/packages/core/tests/io/formats/fig/roundtrip/shaders.test.ts
index 6809cb111..7a93e6c43 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/shaders.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/shaders.test.ts
@@ -3,15 +3,17 @@ import { expect, setDefaultTimeout, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
import { collectAllNodes } from '#core-tests/helpers/fig/traversal'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { computeImageHash } from '@open-pencil/scene-graph/images'
import {
- computeImageHash,
createShaderPaint,
shaderOfPaint,
shaderPresetKey,
withShaderPaints,
type ShaderPreset
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/shaders'
setDefaultTimeout(60_000)
diff --git a/packages/core/tests/io/formats/fig/roundtrip/slots.test.ts b/packages/core/tests/io/formats/fig/roundtrip/slots.test.ts
index 2292a87e2..6ae29a0cd 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/slots.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/slots.test.ts
@@ -1,19 +1,14 @@
import { beforeAll, describe, expect, test } from 'bun:test'
-import { releaseFigPopulationWorker } from '#core/kiwi/fig/population/client'
-
import { FIXTURES } from '#core-tests/helpers/fig/fixtures'
-import {
- exportFigFile,
- initCodec,
- parseFigFile,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
-import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { slotPropertyId } from '@open-pencil/scene-graph'
+import { initCodec, type NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { slotPropertyId } from '@open-pencil/scene-graph/slots'
+
+import { releaseFigPopulationWorker } from '#core/kiwi/fig/population/client'
let original: SceneGraph
let reopened: SceneGraph
diff --git a/packages/core/tests/io/formats/fig/roundtrip/source-metadata.test.ts b/packages/core/tests/io/formats/fig/roundtrip/source-metadata.test.ts
index 2de24a968..7e6d36a5e 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/source-metadata.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/source-metadata.test.ts
@@ -1,9 +1,11 @@
import { beforeAll, describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { effectiveFigmaRawNodeFields, parseFigBuffer } from '@open-pencil/fig'
-import { guidToString } from '@open-pencil/fig/node-change'
-import type { Vector } from '@open-pencil/scene-graph'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { guidToString } from '@open-pencil/kiwi/fig/guid'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
/** The codec types only the fields it writes; raw passthrough metadata is read through these. */
interface RawLayoutGrid {
@@ -498,7 +500,7 @@ describe('fig roundtrip source metadata', () => {
const reopened = await parseFigFile(saved.slice().buffer)
const page = reopened.getPages()[0]
const inserted = reopened.createNode('RECTANGLE', page.id, { name: 'Inserted' })
- reopened.reorderChild(inserted.id, page.id, 0)
+ reopened.insertChildAt(inserted.id, page.id, 0)
const resaved = await exportFigFile(reopened)
const cardGuid = savedGuidOf(saved, 'Card')
@@ -516,7 +518,7 @@ describe('fig roundtrip source metadata', () => {
const cardGuid = savedGuidOf(await exportFigFile(graph), 'Card')
const inserted = graph.createNode('RECTANGLE', page.id, { name: 'Inserted' })
- graph.reorderChild(inserted.id, page.id, 0)
+ graph.insertChildAt(inserted.id, page.id, 0)
const resaved = await exportFigFile(graph)
expect(cardGuid).toBeDefined()
diff --git a/packages/core/tests/io/formats/fig/roundtrip/statuses.test.ts b/packages/core/tests/io/formats/fig/roundtrip/statuses.test.ts
index 05c79a669..357fa378b 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/statuses.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/statuses.test.ts
@@ -1,12 +1,13 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import {
readStatusWorkflow,
STATUS_WORKFLOW_PRESETS,
writeStatusWorkflow
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/statuses'
describe('.fig round trip of statuses', () => {
test('keeps the workflow and every status, Figma-shown or not', async () => {
@@ -14,7 +15,10 @@ describe('.fig round trip of statuses', () => {
const editor = createEditor()
const pageId = editor.state.currentPageId
writeStatusWorkflow(editor.graph, STATUS_WORKFLOW_PRESETS.review)
- const section = editor.graph.createNode('SECTION', pageId, { name: 'Checkout', status: 'approved' })
+ const section = editor.graph.createNode('SECTION', pageId, {
+ name: 'Checkout',
+ status: 'approved'
+ })
editor.graph.createNode('FRAME', section.id, { name: 'Cart', status: 'ready-for-dev' })
const reopened = await parseFigFile((await exportFigFile(editor.graph)).slice().buffer)
diff --git a/packages/core/tests/io/formats/fig/roundtrip/stroke-geometry.test.ts b/packages/core/tests/io/formats/fig/roundtrip/stroke-geometry.test.ts
index 1fb04884a..1a6203aba 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/stroke-geometry.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/stroke-geometry.test.ts
@@ -2,7 +2,8 @@ import { beforeAll, describe, expect, setDefaultTimeout, test } from 'bun:test'
import { collectAllNodes } from '#core-tests/helpers/fig/traversal'
-import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
setDefaultTimeout(60_000)
diff --git a/packages/core/tests/io/formats/fig/roundtrip/stroke-paints.test.ts b/packages/core/tests/io/formats/fig/roundtrip/stroke-paints.test.ts
index 885aa6319..061b0a3d4 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/stroke-paints.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/stroke-paints.test.ts
@@ -3,7 +3,9 @@ import { describe, expect, setDefaultTimeout, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
import { collectAllNodes } from '#core-tests/helpers/fig/traversal'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
setDefaultTimeout(60_000)
diff --git a/packages/core/tests/io/formats/fig/roundtrip/text/lists.test.ts b/packages/core/tests/io/formats/fig/roundtrip/text/lists.test.ts
index b5f757796..945008880 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/text/lists.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/text/lists.test.ts
@@ -2,10 +2,11 @@ import { beforeAll, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { fontManager } from '@open-pencil/core/text'
import { parseFigBuffer } from '@open-pencil/fig'
-import type { TextParagraphStyle } from '@open-pencil/scene-graph'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph, type TextParagraphStyle } from '@open-pencil/scene-graph'
const LIST: TextParagraphStyle[] = [
{ listType: 'NONE', indentation: 0, paragraphSpacing: 24, paragraphIndent: 30 },
@@ -62,7 +63,9 @@ test('writes lists as Figma does and reads them back', async () => {
written.hangingList
]).toEqual([6, 10, 12, true])
// Figma draws pasted and opened text from these glyphs: each marker is one with no character.
- const markers = written.derivedTextData?.glyphs?.filter((glyph) => glyph.firstCharacter === undefined)
+ const markers = written.derivedTextData?.glyphs?.filter(
+ (glyph) => glyph.firstCharacter === undefined
+ )
expect(markers?.length).toBe(5)
const reopened = await parseFigFile(bytes.slice().buffer)
@@ -71,7 +74,7 @@ test('writes lists as Figma does and reads them back', async () => {
'reopened text'
)
expect(text.textParagraphs).toEqual(LIST)
- expect([text.listSpacing, text.paragraphSpacing, text.paragraphIndent, text.hangingList]).toEqual([
- 6, 10, 12, true
- ])
+ expect([text.listSpacing, text.paragraphSpacing, text.paragraphIndent, text.hangingList]).toEqual(
+ [6, 10, 12, true]
+ )
})
diff --git a/packages/core/tests/io/formats/fig/roundtrip/text/styles.test.ts b/packages/core/tests/io/formats/fig/roundtrip/text/styles.test.ts
index 056a97de2..9b4c65c5d 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/text/styles.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/text/styles.test.ts
@@ -2,8 +2,10 @@ import { beforeAll, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { fontManager } from '@open-pencil/core/text'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
beforeAll(async () => {
await initCodec()
diff --git a/packages/core/tests/io/formats/fig/roundtrip/text/variables.test.ts b/packages/core/tests/io/formats/fig/roundtrip/text/variables.test.ts
index f2f01f7f3..0b8216aac 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/text/variables.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/text/variables.test.ts
@@ -1,8 +1,10 @@
import { beforeAll, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
-import { reconcileVariableBindings } from '@open-pencil/scene-graph'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { reconcileVariableBindings } from '@open-pencil/scene-graph/variables'
beforeAll(async () => {
await initCodec()
diff --git a/packages/core/tests/io/formats/fig/roundtrip/variables.test.ts b/packages/core/tests/io/formats/fig/roundtrip/variables.test.ts
index 2dc18f5c7..2582d9ad4 100644
--- a/packages/core/tests/io/formats/fig/roundtrip/variables.test.ts
+++ b/packages/core/tests/io/formats/fig/roundtrip/variables.test.ts
@@ -4,15 +4,11 @@ import { expectDefined } from '#core-tests/helpers/assert'
import { parseFixture } from '#core-tests/helpers/fig/fixtures'
import { runsHeavyTests } from '#core-tests/helpers/test-utils'
-import {
- exportFigFile,
- FigmaAPI,
- initCodec,
- parseFigFile,
- SceneGraph,
- type Variable
-} from '@open-pencil/core'
-import type { Color } from '@open-pencil/scene-graph'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph, type Variable } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
setDefaultTimeout(60_000)
diff --git a/packages/core/tests/io/formats/fig/session/archive-changes.test.ts b/packages/core/tests/io/formats/fig/session/archive-changes.test.ts
index fd78c0e56..5ccfa98bb 100644
--- a/packages/core/tests/io/formats/fig/session/archive-changes.test.ts
+++ b/packages/core/tests/io/formats/fig/session/archive-changes.test.ts
@@ -1,6 +1,9 @@
import { expect, test } from 'bun:test'
-import { computeAllLayouts, exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { computeAllLayouts } from '@open-pencil/core/layout'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { archiveChanges } from '#core/kiwi/fig/session/archive/changes'
diff --git a/packages/core/tests/io/formats/fig/session/document-session.test.ts b/packages/core/tests/io/formats/fig/session/document-session.test.ts
index b0f973afc..2add14889 100644
--- a/packages/core/tests/io/formats/fig/session/document-session.test.ts
+++ b/packages/core/tests/io/formats/fig/session/document-session.test.ts
@@ -1,8 +1,8 @@
import { expect, test } from 'bun:test'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { createFigDocumentSession, materializeFigArchive } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph, CommittedGraphEventError } from '@open-pencil/scene-graph'
test('a mid-load creation failure leaves existing nodes and loaded pages unchanged', async () => {
diff --git a/packages/core/tests/io/formats/fig/session/document-state.test.ts b/packages/core/tests/io/formats/fig/session/document-state.test.ts
index 5e1de9f0e..e05487234 100644
--- a/packages/core/tests/io/formats/fig/session/document-state.test.ts
+++ b/packages/core/tests/io/formats/fig/session/document-state.test.ts
@@ -2,9 +2,9 @@ import { expect, test } from 'bun:test'
import { inertPopulationWorker } from '#core-tests/helpers/fig/population-worker'
-import { createEditor } from '@open-pencil/core/editor'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { createEditor } from '@open-pencil/core'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import { serializeSceneGraph, deserializeSceneGraph } from '#core/kiwi/fig/parse/transfer'
diff --git a/packages/core/tests/io/formats/fig/session/main-thread.test.ts b/packages/core/tests/io/formats/fig/session/main-thread.test.ts
index e36fa6ab8..97ee887d0 100644
--- a/packages/core/tests/io/formats/fig/session/main-thread.test.ts
+++ b/packages/core/tests/io/formats/fig/session/main-thread.test.ts
@@ -5,13 +5,13 @@ import {
snapshotNodes
} from '#core-tests/helpers/fig/save-contract'
-import { exportFigFile } from '@open-pencil/core/io'
import {
+ exportFigFile,
parseFigFile,
populateFigPage,
populateAllFigPages
} from '@open-pencil/core/io/formats/fig'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import { releaseFigPopulationWorker } from '#core/kiwi/fig/population/client'
diff --git a/packages/core/tests/io/formats/fig/session/nested-edits.test.ts b/packages/core/tests/io/formats/fig/session/nested-edits.test.ts
index 814911f09..81a3f71b0 100644
--- a/packages/core/tests/io/formats/fig/session/nested-edits.test.ts
+++ b/packages/core/tests/io/formats/fig/session/nested-edits.test.ts
@@ -1,8 +1,8 @@
import { expect, test } from 'bun:test'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { createFigDocumentSession } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
test('outer component edits win over inner defaults for later-loaded nested instance roots', async () => {
diff --git a/packages/core/tests/io/formats/fig/session/new-page.test.ts b/packages/core/tests/io/formats/fig/session/new-page.test.ts
index 70c30182e..85f746328 100644
--- a/packages/core/tests/io/formats/fig/session/new-page.test.ts
+++ b/packages/core/tests/io/formats/fig/session/new-page.test.ts
@@ -1,8 +1,8 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { exportFigFile, parseFigFile, populateFigPage } from '@open-pencil/core/io/formats/fig'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
test('new pages in reader-backed graphs are live and never queried from the archive', async () => {
diff --git a/packages/core/tests/io/formats/fig/session/page-instance-sync.test.ts b/packages/core/tests/io/formats/fig/session/page-instance-sync.test.ts
index 0d5fff1cb..27eb236e7 100644
--- a/packages/core/tests/io/formats/fig/session/page-instance-sync.test.ts
+++ b/packages/core/tests/io/formats/fig/session/page-instance-sync.test.ts
@@ -1,8 +1,8 @@
import { expect, test } from 'bun:test'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { createFigDocumentSession } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
test('loading a later page keeps the derived sizes of instances earlier pages placed', async () => {
diff --git a/packages/core/tests/io/formats/fig/session/property-driven-text.test.ts b/packages/core/tests/io/formats/fig/session/property-driven-text.test.ts
index 94d082956..df3d3248c 100644
--- a/packages/core/tests/io/formats/fig/session/property-driven-text.test.ts
+++ b/packages/core/tests/io/formats/fig/session/property-driven-text.test.ts
@@ -2,9 +2,9 @@ import { expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { createFigDocumentSession, materializeFigArchive } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
/**
diff --git a/packages/core/tests/io/formats/fig/session/reader-backend.test.ts b/packages/core/tests/io/formats/fig/session/reader-backend.test.ts
index ef09d24df..7a7f898e4 100644
--- a/packages/core/tests/io/formats/fig/session/reader-backend.test.ts
+++ b/packages/core/tests/io/formats/fig/session/reader-backend.test.ts
@@ -1,7 +1,7 @@
import { expect, test } from 'bun:test'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import { openReaderSession } from '#core/kiwi/fig/session/reader'
diff --git a/packages/core/tests/io/formats/fig/session/reader-delta.test.ts b/packages/core/tests/io/formats/fig/session/reader-delta.test.ts
index eb7c84a01..845c7d782 100644
--- a/packages/core/tests/io/formats/fig/session/reader-delta.test.ts
+++ b/packages/core/tests/io/formats/fig/session/reader-delta.test.ts
@@ -1,8 +1,8 @@
import { expect, test } from 'bun:test'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { createFigDocumentSession } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import { serializeSceneGraph, deserializeSceneGraph } from '#core/kiwi/fig/parse/transfer'
diff --git a/packages/core/tests/io/formats/fig/session/structural-edits.test.ts b/packages/core/tests/io/formats/fig/session/structural-edits.test.ts
index 775527580..c42c800b5 100644
--- a/packages/core/tests/io/formats/fig/session/structural-edits.test.ts
+++ b/packages/core/tests/io/formats/fig/session/structural-edits.test.ts
@@ -1,8 +1,8 @@
import { expect, test } from 'bun:test'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { createFigDocumentSession } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
for (const mutation of ['delete', 'reorder', 'add'] as const) {
diff --git a/packages/core/tests/io/formats/fig/session/structural-export.test.ts b/packages/core/tests/io/formats/fig/session/structural-export.test.ts
index 76004d17b..45a7de3c1 100644
--- a/packages/core/tests/io/formats/fig/session/structural-export.test.ts
+++ b/packages/core/tests/io/formats/fig/session/structural-export.test.ts
@@ -1,6 +1,7 @@
import { expect, test } from 'bun:test'
-import { exportFigFile, initCodec } from '@open-pencil/core'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import { openReaderSession } from '#core/kiwi/fig/session/reader'
diff --git a/packages/core/tests/io/formats/fig/session/transfer.test.ts b/packages/core/tests/io/formats/fig/session/transfer.test.ts
index f9ceee393..92da7053b 100644
--- a/packages/core/tests/io/formats/fig/session/transfer.test.ts
+++ b/packages/core/tests/io/formats/fig/session/transfer.test.ts
@@ -1,8 +1,9 @@
import { expect, test } from 'bun:test'
-import { deserializeSceneGraph, serializeSceneGraph } from '#core/kiwi/fig/parse/transfer'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { createConnector, freeEndpoint } from '@open-pencil/scene-graph/connectors'
-import { createConnector, freeEndpoint, SceneGraph } from '@open-pencil/scene-graph'
+import { deserializeSceneGraph, serializeSceneGraph } from '#core/kiwi/fig/parse/transfer'
test('a graph sent from the reader keeps its connectors indexed for routing', () => {
const graph = new SceneGraph()
diff --git a/packages/core/tests/io/formats/fig/session/unavailable-reader.test.ts b/packages/core/tests/io/formats/fig/session/unavailable-reader.test.ts
index 1f04d821f..639a6b106 100644
--- a/packages/core/tests/io/formats/fig/session/unavailable-reader.test.ts
+++ b/packages/core/tests/io/formats/fig/session/unavailable-reader.test.ts
@@ -2,7 +2,7 @@ import { expect, test } from 'bun:test'
import { inertPopulationWorker } from '#core-tests/helpers/fig/population-worker'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import {
registerFigPopulationWorker,
diff --git a/packages/core/tests/io/formats/fig/session/undo-redo.test.ts b/packages/core/tests/io/formats/fig/session/undo-redo.test.ts
index 7136ea430..55e38e544 100644
--- a/packages/core/tests/io/formats/fig/session/undo-redo.test.ts
+++ b/packages/core/tests/io/formats/fig/session/undo-redo.test.ts
@@ -1,10 +1,11 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { createEditor } from '@open-pencil/core'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { createFigDocumentSession } from '@open-pencil/fig'
-import { SceneGraph, recordInstanceOverride } from '@open-pencil/scene-graph'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { recordInstanceOverride } from '@open-pencil/scene-graph/instances'
test('a deleted source node stays deleted across resume and remains undoable', async () => {
await initCodec()
diff --git a/packages/core/tests/io/formats/fig/session/worker/original-archive.test.ts b/packages/core/tests/io/formats/fig/session/worker/original-archive.test.ts
index 9aadb9d93..049d2b949 100644
--- a/packages/core/tests/io/formats/fig/session/worker/original-archive.test.ts
+++ b/packages/core/tests/io/formats/fig/session/worker/original-archive.test.ts
@@ -2,9 +2,9 @@ import { expect, test } from 'bun:test'
import { isEqual } from 'es-toolkit/predicate'
-import { exportFigFile } from '@open-pencil/core/io'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import { parseFigFileViaWorker } from '#core/io/formats/fig/read'
diff --git a/packages/core/tests/io/formats/fig/session/worker/reader.test.ts b/packages/core/tests/io/formats/fig/session/worker/reader.test.ts
index 7d2499c01..a5960f301 100644
--- a/packages/core/tests/io/formats/fig/session/worker/reader.test.ts
+++ b/packages/core/tests/io/formats/fig/session/worker/reader.test.ts
@@ -1,7 +1,7 @@
import { expect, test } from 'bun:test'
-import { exportFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import type { FigSessionResponse } from '#core/kiwi/fig/session/protocol'
diff --git a/packages/core/tests/io/formats/pdf/prepare.test.ts b/packages/core/tests/io/formats/pdf/prepare.test.ts
index 622c090d1..2cd213ed2 100644
--- a/packages/core/tests/io/formats/pdf/prepare.test.ts
+++ b/packages/core/tests/io/formats/pdf/prepare.test.ts
@@ -2,10 +2,10 @@ import { expect, test } from 'bun:test'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { exportFigFile, parseFigFile } from '#core/io'
+import { exportFigFile, parseFigFile } from '#core/io/formats/fig'
import { planPDFPages } from '#core/io/formats/pdf/plan'
import { readPDFPages } from '#core/io/formats/pdf/prepare'
-import { initCodec } from '#core/kiwi'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
/** A `.fig` opened as the editor opens one: only its first page read. */
async function openedFig() {
diff --git a/packages/core/tests/io/formats/svg/byte-order-mark.test.ts b/packages/core/tests/io/formats/svg/byte-order-mark.test.ts
index ebbe6edfe..84b64190e 100644
--- a/packages/core/tests/io/formats/svg/byte-order-mark.test.ts
+++ b/packages/core/tests/io/formats/svg/byte-order-mark.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createSVGNodes } from '@open-pencil/core/io'
+import { createSVGNodes } from '@open-pencil/core/io/formats/svg'
import { SceneGraph } from '@open-pencil/scene-graph'
const BOM = '\uFEFF'
diff --git a/packages/core/tests/io/formats/svg/export.test.ts b/packages/core/tests/io/formats/svg/export.test.ts
index d8f5f0aa1..16ad3c151 100644
--- a/packages/core/tests/io/formats/svg/export.test.ts
+++ b/packages/core/tests/io/formats/svg/export.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { renderNodesToSVG } from '@open-pencil/core'
+import { renderNodesToSVG } from '@open-pencil/core/io/formats/svg'
import { SceneGraph, type SceneNode, type Stroke } from '@open-pencil/scene-graph'
import { expectDefined } from '#core-tests/helpers/assert'
diff --git a/packages/core/tests/io/formats/svg/import-layers.test.ts b/packages/core/tests/io/formats/svg/import-layers.test.ts
index 2f3735be5..a57fd15e0 100644
--- a/packages/core/tests/io/formats/svg/import-layers.test.ts
+++ b/packages/core/tests/io/formats/svg/import-layers.test.ts
@@ -3,7 +3,7 @@ import { describe, expect, test } from 'bun:test'
import { compact } from 'es-toolkit/array'
import { FigmaAPI } from '@open-pencil/core/figma-api'
-import { createSVGNodes } from '@open-pencil/core/io'
+import { createSVGNodes } from '@open-pencil/core/io/formats/svg'
import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
/**
diff --git a/packages/core/tests/io/formats/svg/paths.test.ts b/packages/core/tests/io/formats/svg/paths.test.ts
index cceea471f..cbc6daaa7 100644
--- a/packages/core/tests/io/formats/svg/paths.test.ts
+++ b/packages/core/tests/io/formats/svg/paths.test.ts
@@ -1,11 +1,7 @@
import { expect, test } from 'bun:test'
-import {
- createDefaultNode,
- type NodeType,
- type SceneNode,
- type VectorNetwork
-} from '@open-pencil/scene-graph'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
+import type { NodeType, SceneNode, VectorNetwork } from '@open-pencil/scene-graph'
import { nodeOutlinePath, vectorNetworkToSVGPaths } from '#core/io/formats/svg/paths'
diff --git a/packages/core/tests/layout/auto-layout/saved-geometry.test.ts b/packages/core/tests/layout/auto-layout/saved-geometry.test.ts
index 01429227e..7be0222c5 100644
--- a/packages/core/tests/layout/auto-layout/saved-geometry.test.ts
+++ b/packages/core/tests/layout/auto-layout/saved-geometry.test.ts
@@ -1,8 +1,9 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '#core/editor'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { createEditor } from '#core/editor'
+
/** Marks layers as read from a .fig file, with the geometry the file saved for them. */
function asSaved(graph: SceneGraph, nodes: SceneNode[]) {
for (const node of nodes) {
@@ -52,9 +53,25 @@ function savedNest() {
paddingTop: 10,
paddingBottom: 10
} as const
- const outer = graph.createNode('FRAME', editor.state.currentPageId, { ...hug, width: 70, height: 70 })
- const middle = graph.createNode('FRAME', outer.id, { ...hug, x: 10, y: 10, width: 50, height: 50 })
- const inner = graph.createNode('FRAME', middle.id, { ...hug, x: 10, y: 10, width: 30, height: 30 })
+ const outer = graph.createNode('FRAME', editor.state.currentPageId, {
+ ...hug,
+ width: 70,
+ height: 70
+ })
+ const middle = graph.createNode('FRAME', outer.id, {
+ ...hug,
+ x: 10,
+ y: 10,
+ width: 50,
+ height: 50
+ })
+ const inner = graph.createNode('FRAME', middle.id, {
+ ...hug,
+ x: 10,
+ y: 10,
+ width: 30,
+ height: 30
+ })
const leaf = graph.createNode('RECTANGLE', inner.id, { x: 10, y: 10, width: 10, height: 10 })
asSaved(graph, [outer, middle, inner, leaf])
editor.runLayoutForNode(outer.id)
@@ -87,7 +104,7 @@ describe('a frame read from a .fig file reflows once its layout is edited', () =
test('a new layer in the flow moves the saved ones along', () => {
const { editor, row, first, second } = savedRow()
const added = editor.graph.createNode('RECTANGLE', row.id, { width: 50, height: 40 })
- editor.graph.reorderChild(added.id, row.id, 0)
+ editor.graph.insertChildAt(added.id, row.id, 0)
editor.runLayoutForNode(row.id)
expect([row.width, added.x, first.x, second.x]).toEqual([290, 10, 70, 180])
editor.dispose()
@@ -164,7 +181,11 @@ test('a layer moved into a frame with saved geometry resizes it, even before it
paddingBottom: 2
} as const
// A component's layers as a .fig file loads them: saved sizes, no source format, not laid out.
- const tag = graph.createNode('COMPONENT', editor.state.currentPageId, { ...hug, width: 62, height: 41 })
+ const tag = graph.createNode('COMPONENT', editor.state.currentPageId, {
+ ...hug,
+ width: 62,
+ height: 41
+ })
const badge = graph.createNode('FRAME', tag.id, { ...hug, width: 24, height: 12 })
graph.createNode('ELLIPSE', badge.id, { width: 8, height: 8 })
const number = graph.createNode('RECTANGLE', tag.id, { width: 6, height: 17 })
diff --git a/packages/core/tests/layout/auto-layout/text/fill.test.ts b/packages/core/tests/layout/auto-layout/text/fill.test.ts
index ef549f319..dd5f631a5 100644
--- a/packages/core/tests/layout/auto-layout/text/fill.test.ts
+++ b/packages/core/tests/layout/auto-layout/text/fill.test.ts
@@ -1,6 +1,7 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { computeAllLayouts, SceneGraph, setTextMeasurer } from '@open-pencil/core'
+import { computeAllLayouts, setTextMeasurer } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
const DAYS = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
diff --git a/packages/core/tests/layout/auto-layout/text/fixed-stretch.test.ts b/packages/core/tests/layout/auto-layout/text/fixed-stretch.test.ts
index c38bc5b64..9bed067ff 100644
--- a/packages/core/tests/layout/auto-layout/text/fixed-stretch.test.ts
+++ b/packages/core/tests/layout/auto-layout/text/fixed-stretch.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeAllLayouts, SceneGraph } from '@open-pencil/core'
+import { computeAllLayouts } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
// Reduced from BIZUP's classification label rows: a 10px marker and a
// fixed-size 16px text box that fills both axes in a cross-axis HUG row.
diff --git a/packages/core/tests/layout/generated/shape-with-text.test.ts b/packages/core/tests/layout/generated/shape-with-text.test.ts
index 0aa04d62a..1eee22dae 100644
--- a/packages/core/tests/layout/generated/shape-with-text.test.ts
+++ b/packages/core/tests/layout/generated/shape-with-text.test.ts
@@ -2,8 +2,9 @@ import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
-import { computeAllLayouts, SceneGraph, setTextMeasurer } from '@open-pencil/core'
-import { createShapeWithText, shapeWithTextLabel } from '@open-pencil/scene-graph'
+import { computeAllLayouts, setTextMeasurer } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { createShapeWithText, shapeWithTextLabel } from '@open-pencil/scene-graph/generated'
/** One 36 px line per line break, 12 px a character, never wrapping. */
beforeEach(() =>
diff --git a/packages/core/tests/layout/generated/sticky.test.ts b/packages/core/tests/layout/generated/sticky.test.ts
index af375a66b..22da7fe34 100644
--- a/packages/core/tests/layout/generated/sticky.test.ts
+++ b/packages/core/tests/layout/generated/sticky.test.ts
@@ -1,10 +1,11 @@
import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
-import { computeAllLayouts, SceneGraph, setTextMeasurer } from '@open-pencil/core'
-import { createSticky, stickySublayers } from '@open-pencil/scene-graph'
-
import { expectDefined } from '#core-tests/helpers/assert'
+import { computeAllLayouts, setTextMeasurer } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { createSticky, stickySublayers } from '@open-pencil/scene-graph/generated'
+
/** One line per line break, each as tall as the text's line height. */
function measureLines(): void {
setTextMeasurer((node, maxWidth) => ({
diff --git a/packages/core/tests/library/plugin-content.test.ts b/packages/core/tests/library/plugin-content.test.ts
index 4cab12631..b32e6cef0 100644
--- a/packages/core/tests/library/plugin-content.test.ts
+++ b/packages/core/tests/library/plugin-content.test.ts
@@ -1,15 +1,14 @@
import { describe, expect, test } from 'bun:test'
import { createLibraryRevision, materializeLibraryAsset } from '@open-pencil/core/library'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
emptyBehaviour,
- OPEN_PENCIL_PLUGIN_DATA,
- pluginDataEntry,
readBehaviour,
- SceneGraph,
withBehaviour,
type Behaviour
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/behaviours'
+import { OPEN_PENCIL_PLUGIN_DATA, pluginDataEntry } from '@open-pencil/scene-graph/plugin-data'
const OTHER_PLUGIN = { pluginId: 'tokens-studio', key: 'theme', value: 'dark' }
diff --git a/packages/core/tests/lint/fixes.test.ts b/packages/core/tests/lint/fixes.test.ts
index bc10121b2..8ddecfc0c 100644
--- a/packages/core/tests/lint/fixes.test.ts
+++ b/packages/core/tests/lint/fixes.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import {
applyLintFixes,
createLinter,
diff --git a/packages/core/tests/lint/linter.test.ts b/packages/core/tests/lint/linter.test.ts
index f0111eb7f..449104cc9 100644
--- a/packages/core/tests/lint/linter.test.ts
+++ b/packages/core/tests/lint/linter.test.ts
@@ -11,7 +11,10 @@ describe('lintGraph roots', () => {
const card = graph.createNode('FRAME', page.id, { name: 'Card', width: 200, height: 100 })
const inner = graph.createNode('FRAME', card.id, { name: 'Frame 1', width: 50, height: 50 })
const lint = (roots: string[]) =>
- createLinter({ rules: ['no-default-names'], config: { rules: { 'no-default-names': 'warning' } } })
+ createLinter({
+ rules: ['no-default-names'],
+ config: { rules: { 'no-default-names': 'warning' } }
+ })
.lintGraph(graph, roots)
.messages.map(({ nodeId, nodePath }) => ({ nodeId, nodePath }))
diff --git a/packages/core/tests/openpencil-api/behaviours.test.ts b/packages/core/tests/openpencil-api/behaviours.test.ts
index f51f7c984..412af96da 100644
--- a/packages/core/tests/openpencil-api/behaviours.test.ts
+++ b/packages/core/tests/openpencil-api/behaviours.test.ts
@@ -2,7 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { compileScript } from '@open-pencil/core/tools'
-import { readBehaviour, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { readBehaviour } from '@open-pencil/scene-graph/behaviours'
/** Run a script against a fresh document with a two-variant Switch set and a thumb frame. */
async function run(code: string) {
diff --git a/packages/core/tests/openpencil-api/comments.test.ts b/packages/core/tests/openpencil-api/comments.test.ts
index 165dc69ff..6123495f9 100644
--- a/packages/core/tests/openpencil-api/comments.test.ts
+++ b/packages/core/tests/openpencil-api/comments.test.ts
@@ -1,9 +1,11 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'
import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { compileScript } from '@open-pencil/core/tools'
-import { readComments, SceneGraph } from '@open-pencil/scene-graph'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { readComments } from '@open-pencil/scene-graph/comments'
/** A document with a Card frame holding a Title, as a script would build it. */
async function document() {
diff --git a/packages/core/tests/openpencil-api/expose-instance-swap.test.ts b/packages/core/tests/openpencil-api/expose-instance-swap.test.ts
index 183ea5ff8..851a69233 100644
--- a/packages/core/tests/openpencil-api/expose-instance-swap.test.ts
+++ b/packages/core/tests/openpencil-api/expose-instance-swap.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { OpenPencilAPI } from '@open-pencil/core'
+import { OpenPencilAPI } from '@open-pencil/core/openpencil-api'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/core/tests/openpencil-api/nodes.test.ts b/packages/core/tests/openpencil-api/nodes.test.ts
index d9e74ed56..c958f70ea 100644
--- a/packages/core/tests/openpencil-api/nodes.test.ts
+++ b/packages/core/tests/openpencil-api/nodes.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { OpenPencilAPI } from '@open-pencil/core'
+import { OpenPencilAPI } from '@open-pencil/core/openpencil-api'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { compileScript } from '@open-pencil/core/tools'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/core/tests/openpencil-api/statuses.test.ts b/packages/core/tests/openpencil-api/statuses.test.ts
index 46dab8dfc..42dd20cee 100644
--- a/packages/core/tests/openpencil-api/statuses.test.ts
+++ b/packages/core/tests/openpencil-api/statuses.test.ts
@@ -2,7 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { compileScript } from '@open-pencil/core/tools'
-import { SceneGraph, STATUS_WORKFLOW_PRESETS, writeStatusWorkflow } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { STATUS_WORKFLOW_PRESETS, writeStatusWorkflow } from '@open-pencil/scene-graph/statuses'
/** A document with the design review statuses and a Checkout section holding a Cart frame. */
async function document() {
diff --git a/packages/core/tests/openpencil-api/variables.test.ts b/packages/core/tests/openpencil-api/variables.test.ts
index a5d22b45b..a49c685c7 100644
--- a/packages/core/tests/openpencil-api/variables.test.ts
+++ b/packages/core/tests/openpencil-api/variables.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { OpenPencilAPI } from '@open-pencil/core'
+import { OpenPencilAPI } from '@open-pencil/core/openpencil-api'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { compileScript } from '@open-pencil/core/tools'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/core/tests/rpc/variables-command.test.ts b/packages/core/tests/rpc/variables-command.test.ts
index 297c39a5b..7997951b9 100644
--- a/packages/core/tests/rpc/variables-command.test.ts
+++ b/packages/core/tests/rpc/variables-command.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
import { executeRPCCommand, type TokensResult, type VariablesResult } from '@open-pencil/core/rpc'
-import { parseVariableFormula, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { parseVariableFormula } from '@open-pencil/scene-graph/variables'
function graphWithTokens(): SceneGraph {
const graph = new SceneGraph()
diff --git a/packages/core/tests/text/case.test.ts b/packages/core/tests/text/case.test.ts
index e74775246..332007058 100644
--- a/packages/core/tests/text/case.test.ts
+++ b/packages/core/tests/text/case.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { createDefaultNode, type StyleRun, type TextCase } from '@open-pencil/scene-graph'
+import type { StyleRun, TextCase } from '@open-pencil/scene-graph'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
import { shownCharacters, shownText, shownTextSlice } from '#core/text/case'
diff --git a/packages/core/tests/text/graphemes.test.ts b/packages/core/tests/text/graphemes.test.ts
index ce8d1c63a..9e27c5ae7 100644
--- a/packages/core/tests/text/graphemes.test.ts
+++ b/packages/core/tests/text/graphemes.test.ts
@@ -6,7 +6,15 @@ describe('grapheme boundaries', () => {
const family = '👨‍👩‍👧‍👦'
const flag = '🇺🇸'
const text = `a😀${family}${flag}👍🏽b`
- const boundaries = [0, 1, 3, 3 + family.length, 3 + family.length + 4, text.length - 1, text.length]
+ const boundaries = [
+ 0,
+ 1,
+ 3,
+ 3 + family.length,
+ 3 + family.length + 4,
+ text.length - 1,
+ text.length
+ ]
test('step forward over each user-perceived character whole', () => {
const steps = [0]
diff --git a/packages/core/tests/text/prepare.test.ts b/packages/core/tests/text/prepare.test.ts
index 5fad953e8..e742dec9b 100644
--- a/packages/core/tests/text/prepare.test.ts
+++ b/packages/core/tests/text/prepare.test.ts
@@ -38,13 +38,15 @@ describe('emoji font preparation', () => {
function recordNotoRequests() {
const load = fontManager.loadRemoteFont.bind(fontManager)
- spy = spyOn(fontManager, 'loadRemoteFont').mockImplementation(async (family, style, characters) => {
- if (family === NOTO_COLOR_EMOJI_FAMILY) {
- requested.push(characters ?? '')
- return null
+ spy = spyOn(fontManager, 'loadRemoteFont').mockImplementation(
+ async (family, style, characters) => {
+ if (family === NOTO_COLOR_EMOJI_FAMILY) {
+ requested.push(characters ?? '')
+ return null
+ }
+ return load(family, style, characters)
}
- return load(family, style, characters)
- })
+ )
}
test('fetches nothing for symbols the text font has', async () => {
diff --git a/packages/core/tests/tools/analyze/diff/apply.test.ts b/packages/core/tests/tools/analyze/diff/apply.test.ts
index 1eb400971..50ede94ca 100644
--- a/packages/core/tests/tools/analyze/diff/apply.test.ts
+++ b/packages/core/tests/tools/analyze/diff/apply.test.ts
@@ -6,7 +6,8 @@ import { pick } from 'es-toolkit'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { ALL_TOOLS } from '@open-pencil/core/tools'
-import { createDefaultNode, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
function tool(name: string) {
return expectDefined(
diff --git a/packages/core/tests/tools/analyze/diff/changes.test.ts b/packages/core/tests/tools/analyze/diff/changes.test.ts
index 9b63ecf60..bb2dff6dc 100644
--- a/packages/core/tests/tools/analyze/diff/changes.test.ts
+++ b/packages/core/tests/tools/analyze/diff/changes.test.ts
@@ -2,7 +2,7 @@ import { expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { createEditor, graphFromPageSnapshot } from '@open-pencil/core/editor'
+import { createEditor, graphFromPageSnapshot } from '@open-pencil/core'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { ALL_TOOLS } from '@open-pencil/core/tools'
import { sceneNodeToJSX } from '@open-pencil/design-jsx'
diff --git a/packages/core/tests/tools/analyze/diff/jsx.test.ts b/packages/core/tests/tools/analyze/diff/jsx.test.ts
index 5571e3754..fcdcdeef8 100644
--- a/packages/core/tests/tools/analyze/diff/jsx.test.ts
+++ b/packages/core/tests/tools/analyze/diff/jsx.test.ts
@@ -2,7 +2,7 @@ import { expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { createEditor, graphFromPageSnapshot } from '@open-pencil/core/editor'
+import { createEditor, graphFromPageSnapshot } from '@open-pencil/core'
import { diffPageLayersJSX } from '@open-pencil/core/tools'
test('reports top-level layers changed deep in their subtree, added, or removed', () => {
diff --git a/packages/core/tests/tools/analyze/diff/tools.test.ts b/packages/core/tests/tools/analyze/diff/tools.test.ts
index a0e4dffb9..5f9e27231 100644
--- a/packages/core/tests/tools/analyze/diff/tools.test.ts
+++ b/packages/core/tests/tools/analyze/diff/tools.test.ts
@@ -4,7 +4,8 @@ import { expectDefined, getNodeOrThrow } from '#core-tests/helpers/assert'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { ALL_TOOLS, diffDocuments } from '@open-pencil/core/tools'
-import { SceneGraph, type Color } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
type DiffResult = { diff?: string | null; message?: string; error?: string }
type ApplyResult = {
diff --git a/packages/core/tests/tools/analyze/diff/visual.test.ts b/packages/core/tests/tools/analyze/diff/visual.test.ts
index ee6956b7f..e69437063 100644
--- a/packages/core/tests/tools/analyze/diff/visual.test.ts
+++ b/packages/core/tests/tools/analyze/diff/visual.test.ts
@@ -9,8 +9,8 @@ import {
initCanvasKit
} from '@open-pencil/core/io/formats/raster'
import { ALL_TOOLS } from '@open-pencil/core/tools'
-import { SceneGraph, type Color } from '@open-pencil/scene-graph'
-import type { Rect } from '@open-pencil/scene-graph/primitives'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import type { Color, Rect } from '@open-pencil/scene-graph/primitives'
type VisualDiff = {
error?: string
diff --git a/packages/core/tests/tools/analyze/lint.test.ts b/packages/core/tests/tools/analyze/lint.test.ts
index 0622cd425..d347fe1ef 100644
--- a/packages/core/tests/tools/analyze/lint.test.ts
+++ b/packages/core/tests/tools/analyze/lint.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { getNodeOrThrow } from '#core-tests/helpers/assert'
-import { FigmaAPI } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
import { ALL_TOOLS } from '@open-pencil/core/tools'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/core/tests/tools/statuses.test.ts b/packages/core/tests/tools/statuses.test.ts
index 9f5123dad..2670b6e3f 100644
--- a/packages/core/tests/tools/statuses.test.ts
+++ b/packages/core/tests/tools/statuses.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
import { FigmaAPI } from '@open-pencil/core/figma-api'
-import { SceneGraph, STATUS_WORKFLOW_PRESETS, writeStatusWorkflow } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { STATUS_WORKFLOW_PRESETS, writeStatusWorkflow } from '@open-pencil/scene-graph/statuses'
import { getStatuses, setStatus } from '#core/tools/statuses'
@@ -27,6 +28,8 @@ describe('status tools', () => {
const figma = new FigmaAPI(new SceneGraph())
const section = figma.createSection()
const result = await setStatus.execute(figma, { node: section.id, status: 'Approved' })
- expect(result).toEqual({ error: 'No status named Approved; the document has Ready for dev, Completed' })
+ expect(result).toEqual({
+ error: 'No status named Approved; the document has Ready for dev, Completed'
+ })
})
})
diff --git a/packages/core/tests/vector/vectorize/placement.test.ts b/packages/core/tests/vector/vectorize/placement.test.ts
index 34572ad5e..9873a5a50 100644
--- a/packages/core/tests/vector/vectorize/placement.test.ts
+++ b/packages/core/tests/vector/vectorize/placement.test.ts
@@ -2,8 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { expectDefined } from '#core-tests/helpers/assert'
-import { FigmaAPI } from '@open-pencil/core'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { importSVG } from '@open-pencil/core/tools'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/design-jsx/src/behaviours/index.ts b/packages/design-jsx/src/behaviours/index.ts
index ce5404863..fd512fc65 100644
--- a/packages/design-jsx/src/behaviours/index.ts
+++ b/packages/design-jsx/src/behaviours/index.ts
@@ -1,13 +1,12 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
behaviourFromSpec,
- createComponentPropertyId,
- createSlotProperty,
withBehaviour,
type BehaviourKind,
- type BehaviourSpec,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type BehaviourSpec
+} from '@open-pencil/scene-graph/behaviours'
+import { createComponentPropertyId } from '@open-pencil/scene-graph/components'
+import { createSlotProperty } from '@open-pencil/scene-graph/slots'
import { node, type TreeNode } from '../tree'
diff --git a/packages/design-jsx/src/component-properties.ts b/packages/design-jsx/src/component-properties.ts
index fd8a5b786..b8cd54340 100644
--- a/packages/design-jsx/src/component-properties.ts
+++ b/packages/design-jsx/src/component-properties.ts
@@ -1,17 +1,17 @@
import { compact } from 'es-toolkit/array'
import * as v from 'valibot'
-import {
- applyComponentPropertyValue,
- componentPropertyDefinitions,
- createComponentPropertyId
-} from '@open-pencil/scene-graph'
import type {
ComponentPropertyDefinition,
ComponentPropertyReference,
SceneGraph,
SceneNode
} from '@open-pencil/scene-graph'
+import {
+ applyComponentPropertyValue,
+ componentPropertyDefinitions,
+ createComponentPropertyId
+} from '@open-pencil/scene-graph/components'
import { DESIGN_JSX_SUPPORTED_PROPERTIES } from './schema'
import { parseScriptInput } from './validation'
diff --git a/packages/design-jsx/src/connectors.ts b/packages/design-jsx/src/connectors.ts
index 16f71e50d..b267174b2 100644
--- a/packages/design-jsx/src/connectors.ts
+++ b/packages/design-jsx/src/connectors.ts
@@ -2,6 +2,8 @@ import { compact, countBy } from 'es-toolkit/array'
import { camelCase } from 'es-toolkit/string'
import * as v from 'valibot'
+import type { ConnectorEndpoint, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { colorToHex } from '@open-pencil/scene-graph/color'
import {
boundEndpoint,
CONNECTOR_COLOR,
@@ -11,13 +13,9 @@ import {
connectorStroke,
connectorSublayers,
createConnector,
- freeEndpoint,
- isGeneratedFrame,
- type ConnectorEndpoint,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
-import { colorToHex } from '@open-pencil/scene-graph/color'
+ freeEndpoint
+} from '@open-pencil/scene-graph/connectors'
+import { isGeneratedFrame } from '@open-pencil/scene-graph/generated'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import { CONNECTOR_LINE, CONNECTOR_SIDE, enumProp, STROKE_CAP } from './enums'
diff --git a/packages/design-jsx/src/enums.ts b/packages/design-jsx/src/enums.ts
index f74b9b900..52a2476a5 100644
--- a/packages/design-jsx/src/enums.ts
+++ b/packages/design-jsx/src/enums.ts
@@ -8,8 +8,6 @@ import type {
MaskType,
SceneNode,
Stroke,
- FigJamTextSize,
- FigJamTypeface,
StrokeCap,
StrokeJoin,
TextAutoResize,
@@ -18,6 +16,7 @@ import type {
TextDecorationStyle,
TextDirection
} from '@open-pencil/scene-graph'
+import type { FigJamTextSize, FigJamTypeface } from '@open-pencil/scene-graph/figjam'
import {
SHAPE_WITH_TEXT_TYPES,
type ShapeWithTextType
diff --git a/packages/design-jsx/src/export/behaviours.ts b/packages/design-jsx/src/export/behaviours.ts
index 736aef85e..6870f0dd4 100644
--- a/packages/design-jsx/src/export/behaviours.ts
+++ b/packages/design-jsx/src/export/behaviours.ts
@@ -1,13 +1,12 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
behaviourToSpec,
- instanceMainComponent,
readBehaviour,
- slotPropertyId,
textBinding,
- type BehaviourKind,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type BehaviourKind
+} from '@open-pencil/scene-graph/behaviours'
+import { instanceMainComponent } from '@open-pencil/scene-graph/instances'
+import { slotPropertyId } from '@open-pencil/scene-graph/slots'
import { REKA_ELEMENTS, rekaRole } from '../behaviours'
import type { JSXProp, JSXValue } from './value'
diff --git a/packages/design-jsx/src/export/helpers.ts b/packages/design-jsx/src/export/helpers.ts
index cb967c632..15b7280f1 100644
--- a/packages/design-jsx/src/export/helpers.ts
+++ b/packages/design-jsx/src/export/helpers.ts
@@ -1,5 +1,6 @@
-import type { SceneGraph, SceneNode, Effect, Color, GridTrack } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode, Effect, GridTrack } from '@open-pencil/scene-graph'
import { colorToHex8 } from '@open-pencil/scene-graph/color'
+import type { Color } from '@open-pencil/scene-graph/primitives'
export function formatColor(color: Color, opacity = 1): string {
return colorToHex8(color, opacity)
diff --git a/packages/design-jsx/src/export/icons.ts b/packages/design-jsx/src/export/icons.ts
index 102fa02e8..6a2877a17 100644
--- a/packages/design-jsx/src/export/icons.ts
+++ b/packages/design-jsx/src/export/icons.ts
@@ -1,12 +1,11 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { colorToHex } from '@open-pencil/scene-graph/color'
import {
isIconModified,
isPlacedIconName,
readIcon,
- readIconTint,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
-import { colorToHex } from '@open-pencil/scene-graph/color'
+ readIconTint
+} from '@open-pencil/scene-graph/icons'
import type { JSXProp } from './props'
diff --git a/packages/design-jsx/src/export/index.ts b/packages/design-jsx/src/export/index.ts
index c1961ace4..e9b1762e9 100644
--- a/packages/design-jsx/src/export/index.ts
+++ b/packages/design-jsx/src/export/index.ts
@@ -1,12 +1,8 @@
import { compact } from 'es-toolkit/array'
import { jsx, type SyntaxNode } from '@open-pencil/emit'
-import {
- isGeneratedFrame,
- type GeneratedFrameType,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { isGeneratedFrame, type GeneratedFrameType } from '@open-pencil/scene-graph/generated'
import {
connectorExportScope,
diff --git a/packages/design-jsx/src/export/paint.ts b/packages/design-jsx/src/export/paint.ts
index 27f822d4a..1e48a459a 100644
--- a/packages/design-jsx/src/export/paint.ts
+++ b/packages/design-jsx/src/export/paint.ts
@@ -1,12 +1,6 @@
-import {
- shaderOfPaint,
- type Effect,
- type Fill,
- type GradientTransform,
- type SceneNode,
- type Stroke
-} from '@open-pencil/scene-graph'
+import type { Effect, Fill, GradientTransform, SceneNode, Stroke } from '@open-pencil/scene-graph'
import { isIdentityGradientTransform } from '@open-pencil/scene-graph/gradient'
+import { shaderOfPaint } from '@open-pencil/scene-graph/shaders'
import { STROKE_ALIGN, STROKE_CAP, STROKE_JOIN } from '../enums'
import { formatColor, formatShadow } from './helpers'
diff --git a/packages/design-jsx/src/export/props.ts b/packages/design-jsx/src/export/props.ts
index 149e4253b..ec041e986 100644
--- a/packages/design-jsx/src/export/props.ts
+++ b/packages/design-jsx/src/export/props.ts
@@ -1,14 +1,10 @@
import { isEqual, omitBy, pick } from 'es-toolkit'
-import {
- createDefaultNode,
- layoutSizing,
- type ArcData,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { ArcData, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import { DEFAULT_FONT_FAMILY } from '@open-pencil/scene-graph/constants'
-import { resolveNodeTextDirection } from '@open-pencil/scene-graph/text-direction'
+import { layoutSizing } from '@open-pencil/scene-graph/layout'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
+import { resolveNodeTextDirection } from '@open-pencil/scene-graph/text/direction'
import { BLEND_MODE, TEXT_ALIGN, TEXT_ALIGN_VERTICAL, TEXT_CASE, TEXT_DECORATION } from '../enums'
import { collectDecorationProps } from './decoration'
diff --git a/packages/design-jsx/src/export/text.ts b/packages/design-jsx/src/export/text.ts
index 6691bfe7a..836eb0a7f 100644
--- a/packages/design-jsx/src/export/text.ts
+++ b/packages/design-jsx/src/export/text.ts
@@ -1,16 +1,18 @@
import { isEmptyObject, isEqual, omitBy, pick } from 'es-toolkit'
import { jsx, type SyntaxNode } from '@open-pencil/emit'
+import type {
+ SceneNode,
+ TextParagraphSpacingField,
+ TextParagraphStyle
+} from '@open-pencil/scene-graph'
import {
hasParagraphSpacing,
MAX_LIST_INDENTATION,
paragraphStyleAt,
textParagraphRanges,
- withParagraphSpacing,
- type SceneNode,
- type TextParagraphSpacingField,
- type TextParagraphStyle
-} from '@open-pencil/scene-graph'
+ withParagraphSpacing
+} from '@open-pencil/scene-graph/text'
import { TEXT_CASE, TEXT_DECORATION } from '../enums'
import { AUTO } from '../overrides/text'
diff --git a/packages/design-jsx/src/fields.ts b/packages/design-jsx/src/fields.ts
index acc37cd62..8277aa348 100644
--- a/packages/design-jsx/src/fields.ts
+++ b/packages/design-jsx/src/fields.ts
@@ -1,11 +1,7 @@
import { omit } from 'es-toolkit'
-import {
- createDefaultNode,
- type NodeType,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { NodeType, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
import type { JSXAttributeSource } from './export'
import * as React from './mini-react'
diff --git a/packages/design-jsx/src/figjam-text.ts b/packages/design-jsx/src/figjam-text.ts
index ff337d0ae..8738bc7a6 100644
--- a/packages/design-jsx/src/figjam-text.ts
+++ b/packages/design-jsx/src/figjam-text.ts
@@ -1,12 +1,12 @@
+import type { SceneNode } from '@open-pencil/scene-graph'
import {
figJamTextSize,
figJamTextSizeFields,
figJamTypeface,
figJamTypefaceFields,
type FigJamTextSize,
- type FigJamTypeface,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type FigJamTypeface
+} from '@open-pencil/scene-graph/figjam'
import { FIGJAM_TEXT_SIZE, FIGJAM_TYPEFACE } from './enums'
diff --git a/packages/design-jsx/src/paints.ts b/packages/design-jsx/src/paints.ts
index 0e81b10fd..26ca83a3f 100644
--- a/packages/design-jsx/src/paints.ts
+++ b/packages/design-jsx/src/paints.ts
@@ -1,20 +1,22 @@
import * as v from 'valibot'
-import {
- createShaderPaint,
- shaderPresetSchema,
- type BlendMode,
- type Fill,
- type FillType,
- type GradientStop,
- type GradientTransform,
- type ShaderComponent,
- type ShaderPreset
+import type {
+ BlendMode,
+ Fill,
+ FillType,
+ GradientStop,
+ GradientTransform
} from '@open-pencil/scene-graph'
import { colorToFill, parseColor } from '@open-pencil/scene-graph/color'
import { TRANSPARENT } from '@open-pencil/scene-graph/constants'
import { IDENTITY_GRADIENT_TRANSFORM } from '@open-pencil/scene-graph/gradient'
import type { Color } from '@open-pencil/scene-graph/primitives'
+import {
+ createShaderPaint,
+ shaderPresetSchema,
+ type ShaderComponent,
+ type ShaderPreset
+} from '@open-pencil/scene-graph/shaders'
import { parseScriptInput } from './validation'
diff --git a/packages/design-jsx/src/props-overrides.ts b/packages/design-jsx/src/props-overrides.ts
index 2c601824d..44d1f6d5c 100644
--- a/packages/design-jsx/src/props-overrides.ts
+++ b/packages/design-jsx/src/props-overrides.ts
@@ -1,19 +1,15 @@
+import type { Fill, SceneNode, ArcData, NodeType } from '@open-pencil/scene-graph'
+import { colorToFill } from '@open-pencil/scene-graph/color'
+import { parseCSSGridTracks, parseCSSNumber } from '@open-pencil/scene-graph/css'
import {
autoLayoutSizingFields,
fillSizingFields,
parseAutoLayoutDirection,
parseCounterAxisAlign,
- parsePrimaryAxisAlign,
- withShaderPaints,
- type ArcData,
- type Fill,
- type NodeType,
- type SceneNode,
- type ShaderPaint
-} from '@open-pencil/scene-graph'
-import { colorToFill } from '@open-pencil/scene-graph/color'
-import { parseCSSGridTracks, parseCSSNumber } from '@open-pencil/scene-graph/css'
+ parsePrimaryAxisAlign
+} from '@open-pencil/scene-graph/layout'
import type { Color, JSONObject } from '@open-pencil/scene-graph/primitives'
+import { withShaderPaints, type ShaderPaint } from '@open-pencil/scene-graph/shaders'
import {
BLEND_MODE,
diff --git a/packages/design-jsx/src/renderer.ts b/packages/design-jsx/src/renderer.ts
index c51dbda88..7275784cf 100644
--- a/packages/design-jsx/src/renderer.ts
+++ b/packages/design-jsx/src/renderer.ts
@@ -1,13 +1,9 @@
import { omitBy } from 'es-toolkit/object'
-import {
- setInstanceOverride,
- type Color,
- type NodeType,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { NodeType, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import { parseColor } from '@open-pencil/scene-graph/color'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import type { RekaScope } from './behaviours'
import { renderRekaNode } from './behaviours/render'
diff --git a/packages/design-jsx/src/services.ts b/packages/design-jsx/src/services.ts
index 035d1400b..dd88e09b2 100644
--- a/packages/design-jsx/src/services.ts
+++ b/packages/design-jsx/src/services.ts
@@ -1,4 +1,5 @@
-import type { Color, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import type { TreeNode } from './tree'
diff --git a/packages/design-jsx/src/shapes-with-text.ts b/packages/design-jsx/src/shapes-with-text.ts
index e8cf43e7c..4fb0ab995 100644
--- a/packages/design-jsx/src/shapes-with-text.ts
+++ b/packages/design-jsx/src/shapes-with-text.ts
@@ -1,13 +1,12 @@
import * as v from 'valibot'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
createShapeWithText,
SHAPE_WITH_TEXT_CORNER_RADIUS,
SHAPE_WITH_TEXT_SIZE,
- shapeWithTextLabel,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ shapeWithTextLabel
+} from '@open-pencil/scene-graph/generated'
import {
enumProp,
diff --git a/packages/design-jsx/src/stickies.ts b/packages/design-jsx/src/stickies.ts
index bc26905be..26412bdf4 100644
--- a/packages/design-jsx/src/stickies.ts
+++ b/packages/design-jsx/src/stickies.ts
@@ -1,15 +1,14 @@
import * as v from 'valibot'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { colorToHex, tryParseColor } from '@open-pencil/scene-graph/color'
import {
createSticky,
isWideSticky,
STICKY_COLORS,
stickyScale,
- stickySublayers,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
-import { colorToHex, tryParseColor } from '@open-pencil/scene-graph/color'
+ stickySublayers
+} from '@open-pencil/scene-graph/generated'
import type { Color } from '@open-pencil/scene-graph/primitives'
import { enumProp, FIGJAM_TEXT_SIZE, FIGJAM_TYPEFACE } from './enums'
diff --git a/packages/design-jsx/src/text-content.ts b/packages/design-jsx/src/text-content.ts
index 3076d2f7b..f817a9751 100644
--- a/packages/design-jsx/src/text-content.ts
+++ b/packages/design-jsx/src/text-content.ts
@@ -1,17 +1,19 @@
import { isEmptyObject, isEqual, omitBy, pick } from 'es-toolkit'
import * as v from 'valibot'
+import type {
+ CharacterStyleOverride,
+ SceneNode,
+ StyleRun,
+ TextParagraphStyle
+} from '@open-pencil/scene-graph'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
import {
- createDefaultNode,
MAX_LIST_INDENTATION,
paragraphCount,
PLAIN_PARAGRAPH,
- trimParagraphStyles,
- type CharacterStyleOverride,
- type SceneNode,
- type StyleRun,
- type TextParagraphStyle
-} from '@open-pencil/scene-graph'
+ trimParagraphStyles
+} from '@open-pencil/scene-graph/text'
import { isTreeNode, type TreeNode } from './tree'
import { parseScriptInput } from './validation'
diff --git a/packages/design-jsx/src/vars.ts b/packages/design-jsx/src/vars.ts
index 38b15fa40..511112cc0 100644
--- a/packages/design-jsx/src/vars.ts
+++ b/packages/design-jsx/src/vars.ts
@@ -1,4 +1,5 @@
-import type { Color, SceneGraph } from '@open-pencil/scene-graph'
+import type { SceneGraph } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
const VAR_SYMBOL = Symbol.for('open-pencil.variable')
diff --git a/packages/design-jsx/tests/elements.test.ts b/packages/design-jsx/tests/elements.test.ts
index dae6dbf9a..31e3cb127 100644
--- a/packages/design-jsx/tests/elements.test.ts
+++ b/packages/design-jsx/tests/elements.test.ts
@@ -9,7 +9,8 @@ import {
import { createDesignJSXRenderer } from '#design-jsx/index'
import { elementPropWarnings } from '#design-jsx/validation'
-import { GENERATED_FRAME_TYPES, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { GENERATED_FRAME_TYPES } from '@open-pencil/scene-graph/generated'
const renderer = createDesignJSXRenderer<never>({
icon: () => Promise.resolve(null),
diff --git a/packages/design-jsx/tests/export/icons.test.ts b/packages/design-jsx/tests/export/icons.test.ts
index f9f0c0c66..683885441 100644
--- a/packages/design-jsx/tests/export/icons.test.ts
+++ b/packages/design-jsx/tests/export/icons.test.ts
@@ -2,7 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { sceneNodeToJSX } from '#design-jsx/export/index'
-import { iconGlyph, SceneGraph, withIcon, withIconTint } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { iconGlyph, withIcon, withIconTint } from '@open-pencil/scene-graph/icons'
import type { Color } from '@open-pencil/scene-graph/primitives'
/** An icon frame as placing one leaves it: its name on the frame, its tinted path inside. */
diff --git a/packages/docs/.vitepress/config.ts b/packages/docs/.vitepress/config.ts
index d3611705c..80e55c290 100644
--- a/packages/docs/.vitepress/config.ts
+++ b/packages/docs/.vitepress/config.ts
@@ -81,6 +81,7 @@ export default defineConfig({
baseUrl: repoRoot,
paths: {
'@open-pencil/vue': ['packages/vue/src/index.ts'],
+ '@open-pencil/vue/*': ['packages/vue/src/*'],
'#vue/*': ['packages/vue/src/*']
}
}
diff --git a/packages/docs/.vitepress/theme/landing/stage/FeatureStage.vue b/packages/docs/.vitepress/theme/landing/stage/FeatureStage.vue
index efea65153..f6d958266 100644
--- a/packages/docs/.vitepress/theme/landing/stage/FeatureStage.vue
+++ b/packages/docs/.vitepress/theme/landing/stage/FeatureStage.vue
@@ -4,7 +4,7 @@ import { MotionConfig } from 'motion-v'
import { TooltipProvider } from 'reka-ui'
import { defineAsyncComponent, ref, watch } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { STAGES } from './definitions'
import { prepareEngine } from './engine-assets'
diff --git a/packages/docs/.vitepress/theme/landing/stage/StageCanvas.vue b/packages/docs/.vitepress/theme/landing/stage/StageCanvas.vue
index d165a31f5..b847ea8f6 100644
--- a/packages/docs/.vitepress/theme/landing/stage/StageCanvas.vue
+++ b/packages/docs/.vitepress/theme/landing/stage/StageCanvas.vue
@@ -1,14 +1,11 @@
<script setup lang="ts">
import { computed, ref, useTemplateRef } from 'vue'
-import {
- PlayIslands,
- toolCursor,
- useCanvas,
- useCanvasInput,
- useCanvasIssueMarkers,
- useTextEdit
-} from '@open-pencil/vue'
+import { PlayIslands, useCanvasInput } from '@open-pencil/vue/canvas'
+import { useCanvasIssueMarkers } from '@open-pencil/vue/canvas/issues'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useTextEdit } from '@open-pencil/vue/canvas/text-edit'
+import { toolCursor } from '@open-pencil/vue/editor/tool-cursor'
import { useEditorStore } from '@/app/editor/active-store'
import { useFollowView } from '@/app/presence/follow-view'
diff --git a/packages/docs/.vitepress/theme/landing/stage/StagePreviewControls.vue b/packages/docs/.vitepress/theme/landing/stage/StagePreviewControls.vue
index 38d0e2442..ab49502d5 100644
--- a/packages/docs/.vitepress/theme/landing/stage/StagePreviewControls.vue
+++ b/packages/docs/.vitepress/theme/landing/stage/StagePreviewControls.vue
@@ -2,7 +2,7 @@
import { tinykeys } from 'tinykeys'
import { onScopeDispose } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { getActiveEditorStoreOrNull, useEditorStore } from '@/app/editor/active-store'
import { appMenuShortcutLabel, appMenuTinykeysShortcut } from '@/app/shell/menu/shortcut'
diff --git a/packages/docs/.vitepress/theme/landing/stage/app-plugins.ts b/packages/docs/.vitepress/theme/landing/stage/app-plugins.ts
index 4e4710b4f..b45947672 100644
--- a/packages/docs/.vitepress/theme/landing/stage/app-plugins.ts
+++ b/packages/docs/.vitepress/theme/landing/stage/app-plugins.ts
@@ -1,7 +1,7 @@
import type { App } from 'vue'
import { createMemoryHistory, createRouter } from 'vue-router'
-import { createRetainedScopePlugin } from '@open-pencil/vue'
+import { createRetainedScopePlugin } from '@open-pencil/vue/lifecycle/retention'
const installed = new WeakSet<App>()
diff --git a/packages/docs/.vitepress/theme/landing/stage/collab/CollabStage.vue b/packages/docs/.vitepress/theme/landing/stage/collab/CollabStage.vue
index 2767953ce..8d22ebaab 100644
--- a/packages/docs/.vitepress/theme/landing/stage/collab/CollabStage.vue
+++ b/packages/docs/.vitepress/theme/landing/stage/collab/CollabStage.vue
@@ -5,7 +5,8 @@ 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 { BLACK } from '@open-pencil/scene-graph/constants'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import { PEER_COLORS } from '@/constants'
diff --git a/packages/docs/.vitepress/theme/landing/stage/panels/SdkSnippetPanel.vue b/packages/docs/.vitepress/theme/landing/stage/panels/SdkSnippetPanel.vue
index df6cc33f3..dc8755918 100644
--- a/packages/docs/.vitepress/theme/landing/stage/panels/SdkSnippetPanel.vue
+++ b/packages/docs/.vitepress/theme/landing/stage/panels/SdkSnippetPanel.vue
@@ -13,12 +13,9 @@ 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'
+ import { createEditor } from '@open-pencil/core'
+ import { CanvasRoot, CanvasSurface } from '@open-pencil/vue/canvas'
+ import { provideEditor } from '@open-pencil/vue'
const editor = createEditor()
provideEditor(editor)
diff --git a/packages/docs/.vitepress/theme/landing/stage/useDocsAppearance.ts b/packages/docs/.vitepress/theme/landing/stage/useDocsAppearance.ts
index eb619227d..2281774f4 100644
--- a/packages/docs/.vitepress/theme/landing/stage/useDocsAppearance.ts
+++ b/packages/docs/.vitepress/theme/landing/stage/useDocsAppearance.ts
@@ -1,7 +1,7 @@
import { useData } from 'vitepress'
import { effectScope, watch } from 'vue'
-import { AVAILABLE_LOCALES, setLocale, type Locale } from '@open-pencil/vue'
+import { AVAILABLE_LOCALES, setLocale, type Locale } from '@open-pencil/vue/i18n'
import { useAppTheme } from '@/app/shell/theme'
diff --git a/packages/docs/de/programmable/sdk/api/advanced/locale-apis.md b/packages/docs/de/programmable/sdk/api/advanced/locale-apis.md
index 345650338..c6e5d93df 100644
--- a/packages/docs/de/programmable/sdk/api/advanced/locale-apis.md
+++ b/packages/docs/de/programmable/sdk/api/advanced/locale-apis.md
@@ -18,13 +18,7 @@ Diese Exports eignen sich, wenn Locale Teil eines umfassenderen Application stat
## Verwendung
```ts
-import {
- locale,
- localeSetting,
- setLocale,
- AVAILABLE_LOCALES,
- LOCALE_LABELS,
-} from '@open-pencil/vue'
+import { locale, localeSetting, setLocale, AVAILABLE_LOCALES, LOCALE_LABELS } from '@open-pencil/vue/i18n'
```
## Verhalten
diff --git a/packages/docs/de/programmable/sdk/api/composables/provide-editor.md b/packages/docs/de/programmable/sdk/api/composables/provide-editor.md
index 2987f81cf..ac2634740 100644
--- a/packages/docs/de/programmable/sdk/api/composables/provide-editor.md
+++ b/packages/docs/de/programmable/sdk/api/composables/provide-editor.md
@@ -23,7 +23,7 @@ provideEditor(editor)
<script setup lang="ts">
import { provideEditor } from '@open-pencil/vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
const props = defineProps<{
editor: Editor
diff --git a/packages/docs/de/programmable/sdk/api/composables/use-canvas.md b/packages/docs/de/programmable/sdk/api/composables/use-canvas.md
index 9c2c2d8e0..c9e2c1f07 100644
--- a/packages/docs/de/programmable/sdk/api/composables/use-canvas.md
+++ b/packages/docs/de/programmable/sdk/api/composables/use-canvas.md
@@ -21,7 +21,8 @@ Das composable übernimmt:
```ts
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
@@ -35,7 +36,8 @@ useCanvas(canvasRef, editor)
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
diff --git a/packages/docs/de/programmable/sdk/api/composables/use-editor-commands.md b/packages/docs/de/programmable/sdk/api/composables/use-editor-commands.md
index b4a021096..b7c7b37d8 100644
--- a/packages/docs/de/programmable/sdk/api/composables/use-editor-commands.md
+++ b/packages/docs/de/programmable/sdk/api/composables/use-editor-commands.md
@@ -18,7 +18,7 @@ Das composable eignet sich für:
## Verwendung
```ts
-import { useEditorCommands } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
const { commands, menuItem, runCommand, moveSelectionToPage, otherPages } = useEditorCommands()
```
diff --git a/packages/docs/de/programmable/sdk/api/composables/use-export.md b/packages/docs/de/programmable/sdk/api/composables/use-export.md
index 1a851cc33..46e67412e 100644
--- a/packages/docs/de/programmable/sdk/api/composables/use-export.md
+++ b/packages/docs/de/programmable/sdk/api/composables/use-export.md
@@ -15,7 +15,7 @@ description: Scale und Format für den Export der aktuellen Selection verwalten.
## Verwendung
```ts
-import { useExport } from '@open-pencil/vue'
+import { useExport } from '@open-pencil/vue/document/export'
const exportState = useExport()
```
diff --git a/packages/docs/de/programmable/sdk/api/composables/use-fill-controls.md b/packages/docs/de/programmable/sdk/api/composables/use-fill-controls.md
index ad25cc677..0a0e2c47f 100644
--- a/packages/docs/de/programmable/sdk/api/composables/use-fill-controls.md
+++ b/packages/docs/de/programmable/sdk/api/composables/use-fill-controls.md
@@ -10,7 +10,7 @@ description: Default value für einen neuen Fill im Properties-Panel.
## Verwendung
```ts
-import { useFillControls } from '@open-pencil/vue'
+import { useFillControls } from '@open-pencil/vue/controls/fill'
const fills = useFillControls()
```
diff --git a/packages/docs/de/programmable/sdk/api/composables/use-i18n.md b/packages/docs/de/programmable/sdk/api/composables/use-i18n.md
index f8899adc4..8edb2ab4d 100644
--- a/packages/docs/de/programmable/sdk/api/composables/use-i18n.md
+++ b/packages/docs/de/programmable/sdk/api/composables/use-i18n.md
@@ -12,7 +12,7 @@ Das composable stellt Labels für Menüs, Commands, Tools, Panels, Pages und Dia
## Verwendung
```ts
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
const { menu, commands, panels, locale, availableLocales, localeLabels, setLocale } = useI18n()
```
@@ -34,7 +34,7 @@ const { menu, commands, panels, locale, availableLocales, localeLabels, setLocal
```vue
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
const { menu, locale, availableLocales, localeLabels, setLocale } = useI18n()
</script>
diff --git a/packages/docs/de/programmable/sdk/api/composables/use-menu-model.md b/packages/docs/de/programmable/sdk/api/composables/use-menu-model.md
index d5b6488d0..80ff2be4c 100644
--- a/packages/docs/de/programmable/sdk/api/composables/use-menu-model.md
+++ b/packages/docs/de/programmable/sdk/api/composables/use-menu-model.md
@@ -10,7 +10,7 @@ description: Menümodelle für Application und Canvas aus dem aktuellen Editor s
## Verwendung
```ts
-import { useMenuModel } from '@open-pencil/vue'
+import { useMenuModel } from '@open-pencil/vue/editor/menu-model'
const { appMenu, canvasMenu, selectionLabelMenu } = useMenuModel()
```
diff --git a/packages/docs/de/programmable/sdk/api/composables/use-page-list.md b/packages/docs/de/programmable/sdk/api/composables/use-page-list.md
index 17f0624b2..4473907d0 100644
--- a/packages/docs/de/programmable/sdk/api/composables/use-page-list.md
+++ b/packages/docs/de/programmable/sdk/api/composables/use-page-list.md
@@ -17,7 +17,7 @@ description: Pages lesen, wechseln, erstellen, löschen und umbenennen.
## Verwendung
```ts
-import { usePageList } from '@open-pencil/vue'
+import { usePageList } from '@open-pencil/vue/primitives/PageList'
const pageList = usePageList()
```
diff --git a/packages/docs/de/programmable/sdk/api/composables/use-typography.md b/packages/docs/de/programmable/sdk/api/composables/use-typography.md
index c9547ad6c..ed4664dd6 100644
--- a/packages/docs/de/programmable/sdk/api/composables/use-typography.md
+++ b/packages/docs/de/programmable/sdk/api/composables/use-typography.md
@@ -17,7 +17,7 @@ description: Font family, Style, Size, Alignment und Formatting von Text objects
## Verwendung
```ts
-import { useTypography } from '@open-pencil/vue'
+import { useTypography } from '@open-pencil/vue/controls/typography'
const typography = useTypography()
```
diff --git a/packages/docs/de/programmable/sdk/getting-started.md b/packages/docs/de/programmable/sdk/getting-started.md
index 872e86eff..536aeb775 100644
--- a/packages/docs/de/programmable/sdk/getting-started.md
+++ b/packages/docs/de/programmable/sdk/getting-started.md
@@ -14,8 +14,9 @@ bun add @open-pencil/core @open-pencil/vue canvaskit-wasm
Das SDK befindet sich im OpenPencil-Monorepo und wird als Paket `@open-pencil/vue` veröffentlicht.
```ts
-import { createEditor } from '@open-pencil/core/editor'
-import { provideEditor, useCanvas } from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { provideEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
```
## Anwendungsebenen
@@ -31,7 +32,7 @@ Eine Anwendung auf Grundlage des SDK besteht aus drei Ebenen:
### 1. Editor erstellen
```ts
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
const editor = createEditor({
width: 1200,
@@ -45,7 +46,7 @@ const editor = createEditor({
<script setup lang="ts">
import { provideEditor } from '@open-pencil/vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
const props = defineProps<{
editor: Editor
@@ -67,7 +68,8 @@ provideEditor(props.editor)
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
@@ -85,7 +87,8 @@ useCanvas(canvasRef, editor)
Nach dem Aufruf von `provideEditor()` können untergeordnete Komponenten die Auswahl auslesen und Editor-Befehle ausführen:
```ts
-import { useEditorCommands, useSelectionState } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const selection = useSelectionState()
const commands = useEditorCommands()
@@ -97,7 +100,9 @@ const commands = useEditorCommands()
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor, useSelectionState } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
diff --git a/packages/docs/de/programmable/sdk/guides/custom-editor-shell.md b/packages/docs/de/programmable/sdk/guides/custom-editor-shell.md
index a01686fc0..e2243f52b 100644
--- a/packages/docs/de/programmable/sdk/guides/custom-editor-shell.md
+++ b/packages/docs/de/programmable/sdk/guides/custom-editor-shell.md
@@ -29,15 +29,12 @@ Eine typische Oberfläche:
```vue
<script setup lang="ts">
-import { createEditor } from '@open-pencil/core/editor'
-import {
- provideEditor,
- CanvasRoot,
- CanvasSurface,
- ToolbarRoot,
- PageListRoot,
- LayerTreeRoot,
-} from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { provideEditor } from '@open-pencil/vue'
+import { CanvasRoot, CanvasSurface } from '@open-pencil/vue/canvas'
+import { ToolbarRoot } from '@open-pencil/vue/primitives/Toolbar'
+import { PageListRoot } from '@open-pencil/vue/primitives/PageList'
+import { LayerTreeRoot } from '@open-pencil/vue/primitives/LayerTree'
const editor = createEditor({ width: 1440, height: 900 })
provideEditor(editor)
diff --git a/packages/docs/de/programmable/sdk/guides/property-panels.md b/packages/docs/de/programmable/sdk/guides/property-panels.md
index d6295daa5..41de1b15d 100644
--- a/packages/docs/de/programmable/sdk/guides/property-panels.md
+++ b/packages/docs/de/programmable/sdk/guides/property-panels.md
@@ -41,7 +41,7 @@ Die OpenPencil-App zeigt den Variablennamen im Ruhezustand violett an. Sobald di
```vue
<script setup lang="ts">
-import { usePosition } from '@open-pencil/vue'
+import { usePosition } from '@open-pencil/vue/controls/position'
const { x, y, width, height, updateProp, commitProp } = usePosition()
</script>
@@ -60,11 +60,9 @@ const { x, y, width, height, updateProp, commitProp } = usePosition()
```vue
<script setup lang="ts">
-import {
- PropertyListRoot,
- useEditorPropertyList,
- useFillControls
-} from '@open-pencil/vue'
+import { PropertyListRoot } from '@open-pencil/vue/primitives/PropertyList'
+import { useEditorPropertyList } from '@open-pencil/vue/controls/property-list'
+import { useFillControls } from '@open-pencil/vue/controls/fill'
const fillControls = useFillControls()
const fills = useEditorPropertyList('fills')
diff --git a/packages/docs/es/programmable/sdk/api/advanced/use-viewport-kind.md b/packages/docs/es/programmable/sdk/api/advanced/use-viewport-kind.md
index 0163af3e9..f698cc309 100644
--- a/packages/docs/es/programmable/sdk/api/advanced/use-viewport-kind.md
+++ b/packages/docs/es/programmable/sdk/api/advanced/use-viewport-kind.md
@@ -12,7 +12,7 @@ Usa el composable cuando solo necesites distinguir entre Mobile y Desktop sin co
## Uso
```ts
-import { useViewportKind } from '@open-pencil/vue'
+import { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
const { isMobile, isDesktop } = useViewportKind()
```
diff --git a/packages/docs/es/programmable/sdk/getting-started.md b/packages/docs/es/programmable/sdk/getting-started.md
index 5db19ccc9..fccea1d94 100644
--- a/packages/docs/es/programmable/sdk/getting-started.md
+++ b/packages/docs/es/programmable/sdk/getting-started.md
@@ -14,8 +14,9 @@ bun add @open-pencil/core @open-pencil/vue canvaskit-wasm
El SDK se encuentra en el monorepo de OpenPencil y se publica como paquete `@open-pencil/vue`.
```ts
-import { createEditor } from '@open-pencil/core/editor'
-import { provideEditor, useCanvas } from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { provideEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
```
## Capas de la aplicación
@@ -31,7 +32,7 @@ Una aplicación basada en el SDK consta de tres capas:
### 1. Crea un editor
```ts
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
const editor = createEditor({
width: 1200,
@@ -45,7 +46,7 @@ const editor = createEditor({
<script setup lang="ts">
import { provideEditor } from '@open-pencil/vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
const props = defineProps<{
editor: Editor
@@ -67,7 +68,8 @@ provideEditor(props.editor)
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
@@ -85,7 +87,8 @@ useCanvas(canvasRef, editor)
Después de llamar a `provideEditor()`, los componentes descendientes pueden consultar la selección y ejecutar comandos del editor:
```ts
-import { useEditorCommands, useSelectionState } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const selection = useSelectionState()
const commands = useEditorCommands()
@@ -97,7 +100,9 @@ const commands = useEditorCommands()
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor, useSelectionState } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
diff --git a/packages/docs/es/programmable/sdk/guides/custom-editor-shell.md b/packages/docs/es/programmable/sdk/guides/custom-editor-shell.md
index 138f44e04..59d0888c1 100644
--- a/packages/docs/es/programmable/sdk/guides/custom-editor-shell.md
+++ b/packages/docs/es/programmable/sdk/guides/custom-editor-shell.md
@@ -29,15 +29,12 @@ Una interfaz habitual:
```vue
<script setup lang="ts">
-import { createEditor } from '@open-pencil/core/editor'
-import {
- provideEditor,
- CanvasRoot,
- CanvasSurface,
- ToolbarRoot,
- PageListRoot,
- LayerTreeRoot,
-} from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { provideEditor } from '@open-pencil/vue'
+import { CanvasRoot, CanvasSurface } from '@open-pencil/vue/canvas'
+import { ToolbarRoot } from '@open-pencil/vue/primitives/Toolbar'
+import { PageListRoot } from '@open-pencil/vue/primitives/PageList'
+import { LayerTreeRoot } from '@open-pencil/vue/primitives/LayerTree'
const editor = createEditor({ width: 1440, height: 900 })
provideEditor(editor)
diff --git a/packages/docs/es/programmable/sdk/guides/property-panels.md b/packages/docs/es/programmable/sdk/guides/property-panels.md
index 6492db691..a1bd5602c 100644
--- a/packages/docs/es/programmable/sdk/guides/property-panels.md
+++ b/packages/docs/es/programmable/sdk/guides/property-panels.md
@@ -41,7 +41,7 @@ La aplicación de OpenPencil muestra el nombre de la variable en morado cuando e
```vue
<script setup lang="ts">
-import { usePosition } from '@open-pencil/vue'
+import { usePosition } from '@open-pencil/vue/controls/position'
const { x, y, width, height, updateProp, commitProp } = usePosition()
</script>
@@ -60,11 +60,9 @@ const { x, y, width, height, updateProp, commitProp } = usePosition()
```vue
<script setup lang="ts">
-import {
- PropertyListRoot,
- useEditorPropertyList,
- useFillControls
-} from '@open-pencil/vue'
+import { PropertyListRoot } from '@open-pencil/vue/primitives/PropertyList'
+import { useEditorPropertyList } from '@open-pencil/vue/controls/property-list'
+import { useFillControls } from '@open-pencil/vue/controls/fill'
const fillControls = useFillControls()
const fills = useEditorPropertyList('fills')
diff --git a/packages/docs/fr/programmable/sdk/api/advanced/use-viewport-kind.md b/packages/docs/fr/programmable/sdk/api/advanced/use-viewport-kind.md
index d964f622d..8400df5d4 100644
--- a/packages/docs/fr/programmable/sdk/api/advanced/use-viewport-kind.md
+++ b/packages/docs/fr/programmable/sdk/api/advanced/use-viewport-kind.md
@@ -12,7 +12,7 @@ Utilisez le composable lorsqu’il suffit de distinguer Mobile et Desktop sans c
## Utilisation
```ts
-import { useViewportKind } from '@open-pencil/vue'
+import { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
const { isMobile, isDesktop } = useViewportKind()
```
diff --git a/packages/docs/fr/programmable/sdk/getting-started.md b/packages/docs/fr/programmable/sdk/getting-started.md
index 319b6c85e..8ca0e553a 100644
--- a/packages/docs/fr/programmable/sdk/getting-started.md
+++ b/packages/docs/fr/programmable/sdk/getting-started.md
@@ -14,8 +14,9 @@ bun add @open-pencil/core @open-pencil/vue canvaskit-wasm
Le SDK se trouve dans le monorepo OpenPencil et est publié sous forme de package `@open-pencil/vue`.
```ts
-import { createEditor } from '@open-pencil/core/editor'
-import { provideEditor, useCanvas } from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { provideEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
```
## Couches de l'application
@@ -31,7 +32,7 @@ Une application basée sur le SDK se compose de trois couches :
### 1. Créez un éditeur
```ts
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
const editor = createEditor({
width: 1200,
@@ -45,7 +46,7 @@ const editor = createEditor({
<script setup lang="ts">
import { provideEditor } from '@open-pencil/vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
const props = defineProps<{
editor: Editor
@@ -67,7 +68,8 @@ provideEditor(props.editor)
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
@@ -85,7 +87,8 @@ useCanvas(canvasRef, editor)
Après l'appel à `provideEditor()`, les composants descendants peuvent consulter la sélection et exécuter des commandes de l'éditeur :
```ts
-import { useEditorCommands, useSelectionState } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const selection = useSelectionState()
const commands = useEditorCommands()
@@ -97,7 +100,9 @@ const commands = useEditorCommands()
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor, useSelectionState } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
diff --git a/packages/docs/fr/programmable/sdk/guides/custom-editor-shell.md b/packages/docs/fr/programmable/sdk/guides/custom-editor-shell.md
index a217a1eff..98ede9b38 100644
--- a/packages/docs/fr/programmable/sdk/guides/custom-editor-shell.md
+++ b/packages/docs/fr/programmable/sdk/guides/custom-editor-shell.md
@@ -29,15 +29,12 @@ Une interface courante :
```vue
<script setup lang="ts">
-import { createEditor } from '@open-pencil/core/editor'
-import {
- provideEditor,
- CanvasRoot,
- CanvasSurface,
- ToolbarRoot,
- PageListRoot,
- LayerTreeRoot,
-} from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { provideEditor } from '@open-pencil/vue'
+import { CanvasRoot, CanvasSurface } from '@open-pencil/vue/canvas'
+import { ToolbarRoot } from '@open-pencil/vue/primitives/Toolbar'
+import { PageListRoot } from '@open-pencil/vue/primitives/PageList'
+import { LayerTreeRoot } from '@open-pencil/vue/primitives/LayerTree'
const editor = createEditor({ width: 1440, height: 900 })
provideEditor(editor)
diff --git a/packages/docs/fr/programmable/sdk/guides/property-panels.md b/packages/docs/fr/programmable/sdk/guides/property-panels.md
index ac606311d..a6d2e76d1 100644
--- a/packages/docs/fr/programmable/sdk/guides/property-panels.md
+++ b/packages/docs/fr/programmable/sdk/guides/property-panels.md
@@ -41,7 +41,7 @@ L’application OpenPencil affiche le nom de la variable en violet lorsque le ch
```vue
<script setup lang="ts">
-import { usePosition } from '@open-pencil/vue'
+import { usePosition } from '@open-pencil/vue/controls/position'
const { x, y, width, height, updateProp, commitProp } = usePosition()
</script>
@@ -60,11 +60,9 @@ const { x, y, width, height, updateProp, commitProp } = usePosition()
```vue
<script setup lang="ts">
-import {
- PropertyListRoot,
- useEditorPropertyList,
- useFillControls
-} from '@open-pencil/vue'
+import { PropertyListRoot } from '@open-pencil/vue/primitives/PropertyList'
+import { useEditorPropertyList } from '@open-pencil/vue/controls/property-list'
+import { useFillControls } from '@open-pencil/vue/controls/fill'
const fillControls = useFillControls()
const fills = useEditorPropertyList('fills')
diff --git a/packages/docs/it/programmable/sdk/api/advanced/locale-apis.md b/packages/docs/it/programmable/sdk/api/advanced/locale-apis.md
index 84e683a95..25186d1d2 100644
--- a/packages/docs/it/programmable/sdk/api/advanced/locale-apis.md
+++ b/packages/docs/it/programmable/sdk/api/advanced/locale-apis.md
@@ -16,13 +16,7 @@ Oltre a `useI18n()`, il Vue SDK esporta un’API di basso livello per accedere d
Questi export sono utili quando la lingua fa parte di uno stato applicativo più ampio o serve l’elenco delle lingue senza l’intera API di `useI18n()`.
```ts
-import {
- locale,
- localeSetting,
- setLocale,
- AVAILABLE_LOCALES,
- LOCALE_LABELS,
-} from '@open-pencil/vue'
+import { locale, localeSetting, setLocale, AVAILABLE_LOCALES, LOCALE_LABELS } from '@open-pencil/vue/i18n'
```
- `locale` contiene la lingua effettivamente usata dopo impostazioni e ripiego.
diff --git a/packages/docs/it/programmable/sdk/getting-started.md b/packages/docs/it/programmable/sdk/getting-started.md
index dee646c61..0348878ea 100644
--- a/packages/docs/it/programmable/sdk/getting-started.md
+++ b/packages/docs/it/programmable/sdk/getting-started.md
@@ -14,8 +14,9 @@ bun add @open-pencil/core @open-pencil/vue canvaskit-wasm
L'SDK si trova nel monorepo OpenPencil ed è pubblicato come pacchetto `@open-pencil/vue`.
```ts
-import { createEditor } from '@open-pencil/core/editor'
-import { provideEditor, useCanvas } from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { provideEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
```
## Livelli dell'applicazione
@@ -31,7 +32,7 @@ Un'applicazione basata sull'SDK è composta da tre livelli:
### 1. Crea un editor
```ts
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
const editor = createEditor({
width: 1200,
@@ -45,7 +46,7 @@ const editor = createEditor({
<script setup lang="ts">
import { provideEditor } from '@open-pencil/vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
const props = defineProps<{
editor: Editor
@@ -67,7 +68,8 @@ provideEditor(props.editor)
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
@@ -85,7 +87,8 @@ useCanvas(canvasRef, editor)
Dopo la chiamata a `provideEditor()`, i componenti discendenti possono leggere la selezione ed eseguire i comandi dell'editor:
```ts
-import { useEditorCommands, useSelectionState } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const selection = useSelectionState()
const commands = useEditorCommands()
@@ -97,7 +100,9 @@ const commands = useEditorCommands()
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor, useSelectionState } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
diff --git a/packages/docs/it/programmable/sdk/guides/custom-editor-shell.md b/packages/docs/it/programmable/sdk/guides/custom-editor-shell.md
index ecdc28224..7273d6ed6 100644
--- a/packages/docs/it/programmable/sdk/guides/custom-editor-shell.md
+++ b/packages/docs/it/programmable/sdk/guides/custom-editor-shell.md
@@ -29,14 +29,11 @@ Un’interfaccia tipica:
```vue
<script setup lang="ts">
-import { createEditor } from '@open-pencil/core/editor'
-import {
- provideEditor,
- CanvasRoot,
- CanvasSurface,
- ToolbarRoot,
- PageListRoot,
-} from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { provideEditor } from '@open-pencil/vue'
+import { CanvasRoot, CanvasSurface } from '@open-pencil/vue/canvas'
+import { ToolbarRoot } from '@open-pencil/vue/primitives/Toolbar'
+import { PageListRoot } from '@open-pencil/vue/primitives/PageList'
const editor = createEditor({ width: 1440, height: 900 })
provideEditor(editor)
diff --git a/packages/docs/pl/programmable/sdk/api/advanced/locale-apis.md b/packages/docs/pl/programmable/sdk/api/advanced/locale-apis.md
index 9b3061946..f69ab9ac1 100644
--- a/packages/docs/pl/programmable/sdk/api/advanced/locale-apis.md
+++ b/packages/docs/pl/programmable/sdk/api/advanced/locale-apis.md
@@ -18,13 +18,7 @@ Użyj tych exports, gdy locale jest częścią szerszego application state albo
## Użycie
```ts
-import {
- locale,
- localeSetting,
- setLocale,
- AVAILABLE_LOCALES,
- LOCALE_LABELS,
-} from '@open-pencil/vue'
+import { locale, localeSetting, setLocale, AVAILABLE_LOCALES, LOCALE_LABELS } from '@open-pencil/vue/i18n'
```
## Zachowanie
diff --git a/packages/docs/pl/programmable/sdk/api/components/property-list-root.md b/packages/docs/pl/programmable/sdk/api/components/property-list-root.md
index 348129d42..381956a50 100644
--- a/packages/docs/pl/programmable/sdk/api/components/property-list-root.md
+++ b/packages/docs/pl/programmable/sdk/api/components/property-list-root.md
@@ -13,7 +13,8 @@ import { data } from '#docs-api/components/property-list.data'
```vue
<script setup lang="ts">
-import { PropertyListRoot, useEditorPropertyList } from '@open-pencil/vue'
+import { PropertyListRoot } from '@open-pencil/vue/primitives/PropertyList'
+import { useEditorPropertyList } from '@open-pencil/vue/controls/property-list'
const fills = useEditorPropertyList('fills')
</script>
diff --git a/packages/docs/pl/programmable/sdk/api/composables/provide-editor.md b/packages/docs/pl/programmable/sdk/api/composables/provide-editor.md
index cddd81662..be70d352f 100644
--- a/packages/docs/pl/programmable/sdk/api/composables/provide-editor.md
+++ b/packages/docs/pl/programmable/sdk/api/composables/provide-editor.md
@@ -23,7 +23,7 @@ provideEditor(editor)
<script setup lang="ts">
import { provideEditor } from '@open-pencil/vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
const props = defineProps<{
editor: Editor
diff --git a/packages/docs/pl/programmable/sdk/api/composables/use-canvas.md b/packages/docs/pl/programmable/sdk/api/composables/use-canvas.md
index 8362b9d30..4e0a40909 100644
--- a/packages/docs/pl/programmable/sdk/api/composables/use-canvas.md
+++ b/packages/docs/pl/programmable/sdk/api/composables/use-canvas.md
@@ -21,7 +21,8 @@ Obsługuje:
```ts
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
@@ -35,7 +36,8 @@ useCanvas(canvasRef, editor)
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
diff --git a/packages/docs/pl/programmable/sdk/api/composables/use-editor-commands.md b/packages/docs/pl/programmable/sdk/api/composables/use-editor-commands.md
index caf53a752..d8a0421a8 100644
--- a/packages/docs/pl/programmable/sdk/api/composables/use-editor-commands.md
+++ b/packages/docs/pl/programmable/sdk/api/composables/use-editor-commands.md
@@ -18,7 +18,7 @@ Przydaje się podczas tworzenia:
## Użycie
```ts
-import { useEditorCommands } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
const { commands, menuItem, runCommand, moveSelectionToPage, otherPages } = useEditorCommands()
```
diff --git a/packages/docs/pl/programmable/sdk/api/composables/use-export.md b/packages/docs/pl/programmable/sdk/api/composables/use-export.md
index 645712e35..77b5b99eb 100644
--- a/packages/docs/pl/programmable/sdk/api/composables/use-export.md
+++ b/packages/docs/pl/programmable/sdk/api/composables/use-export.md
@@ -15,7 +15,7 @@ description: Ustawienia scale i format eksportu bieżącego selection.
## Użycie
```ts
-import { useExport } from '@open-pencil/vue'
+import { useExport } from '@open-pencil/vue/document/export'
const exportState = useExport()
```
diff --git a/packages/docs/pl/programmable/sdk/api/composables/use-fill-controls.md b/packages/docs/pl/programmable/sdk/api/composables/use-fill-controls.md
index 76c00e6b8..9436fd11d 100644
--- a/packages/docs/pl/programmable/sdk/api/composables/use-fill-controls.md
+++ b/packages/docs/pl/programmable/sdk/api/composables/use-fill-controls.md
@@ -10,7 +10,7 @@ description: Domyślna wartość nowego fill w panelu właściwości.
## Użycie
```ts
-import { useFillControls } from '@open-pencil/vue'
+import { useFillControls } from '@open-pencil/vue/controls/fill'
const fills = useFillControls()
```
diff --git a/packages/docs/pl/programmable/sdk/api/composables/use-i18n.md b/packages/docs/pl/programmable/sdk/api/composables/use-i18n.md
index 489a1c570..887910526 100644
--- a/packages/docs/pl/programmable/sdk/api/composables/use-i18n.md
+++ b/packages/docs/pl/programmable/sdk/api/composables/use-i18n.md
@@ -12,7 +12,7 @@ Użyj go, aby pobierać etykiety menu, commands, panels, pages i dialogs dostarc
## Użycie
```ts
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
const { menu, commands, panels, locale, availableLocales, localeLabels, setLocale } = useI18n()
```
@@ -34,7 +34,7 @@ const { menu, commands, panels, locale, availableLocales, localeLabels, setLocal
```vue
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
const { menu, locale, availableLocales, localeLabels, setLocale } = useI18n()
</script>
diff --git a/packages/docs/pl/programmable/sdk/api/composables/use-menu-model.md b/packages/docs/pl/programmable/sdk/api/composables/use-menu-model.md
index bc6c37b4f..d6b54bdf8 100644
--- a/packages/docs/pl/programmable/sdk/api/composables/use-menu-model.md
+++ b/packages/docs/pl/programmable/sdk/api/composables/use-menu-model.md
@@ -12,7 +12,7 @@ Użyj go, jeśli nie chcesz samodzielnie składać menu z pojedynczych poleceń.
## Użycie
```ts
-import { useMenuModel } from '@open-pencil/vue'
+import { useMenuModel } from '@open-pencil/vue/editor/menu-model'
const { appMenu, canvasMenu, selectionLabelMenu } = useMenuModel()
```
diff --git a/packages/docs/pl/programmable/sdk/api/composables/use-page-list.md b/packages/docs/pl/programmable/sdk/api/composables/use-page-list.md
index 8561640ee..6d061d4d4 100644
--- a/packages/docs/pl/programmable/sdk/api/composables/use-page-list.md
+++ b/packages/docs/pl/programmable/sdk/api/composables/use-page-list.md
@@ -19,7 +19,7 @@ Zwraca:
## Użycie
```ts
-import { usePageList } from '@open-pencil/vue'
+import { usePageList } from '@open-pencil/vue/primitives/PageList'
const pageList = usePageList()
```
diff --git a/packages/docs/pl/programmable/sdk/getting-started.md b/packages/docs/pl/programmable/sdk/getting-started.md
index f46a5f620..46e211a64 100644
--- a/packages/docs/pl/programmable/sdk/getting-started.md
+++ b/packages/docs/pl/programmable/sdk/getting-started.md
@@ -14,8 +14,9 @@ bun add @open-pencil/core @open-pencil/vue canvaskit-wasm
SDK znajduje się w monorepo OpenPencil i jest publikowany jako pakiet `@open-pencil/vue`.
```ts
-import { createEditor } from '@open-pencil/core/editor'
-import { provideEditor, useCanvas } from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { provideEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
```
## Warstwy aplikacji
@@ -31,7 +32,7 @@ Aplikacja oparta na SDK składa się z trzech warstw:
### 1. Utwórz edytor
```ts
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
const editor = createEditor({
width: 1200,
@@ -45,7 +46,7 @@ const editor = createEditor({
<script setup lang="ts">
import { provideEditor } from '@open-pencil/vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
const props = defineProps<{
editor: Editor
@@ -67,7 +68,8 @@ provideEditor(props.editor)
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
@@ -85,7 +87,8 @@ useCanvas(canvasRef, editor)
Po wywołaniu `provideEditor()` komponenty potomne mogą odczytywać zaznaczenie i wykonywać polecenia edytora:
```ts
-import { useEditorCommands, useSelectionState } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const selection = useSelectionState()
const commands = useEditorCommands()
@@ -97,7 +100,9 @@ const commands = useEditorCommands()
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor, useSelectionState } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
diff --git a/packages/docs/pl/programmable/sdk/guides/custom-editor-shell.md b/packages/docs/pl/programmable/sdk/guides/custom-editor-shell.md
index 348fa9f67..70a7fa19b 100644
--- a/packages/docs/pl/programmable/sdk/guides/custom-editor-shell.md
+++ b/packages/docs/pl/programmable/sdk/guides/custom-editor-shell.md
@@ -31,15 +31,12 @@ Wygodny interfejs zwykle:
```vue
<script setup lang="ts">
-import { createEditor } from '@open-pencil/core/editor'
-import {
- provideEditor,
- CanvasRoot,
- CanvasSurface,
- ToolbarRoot,
- PageListRoot,
- LayerTreeRoot,
-} from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { provideEditor } from '@open-pencil/vue'
+import { CanvasRoot, CanvasSurface } from '@open-pencil/vue/canvas'
+import { ToolbarRoot } from '@open-pencil/vue/primitives/Toolbar'
+import { PageListRoot } from '@open-pencil/vue/primitives/PageList'
+import { LayerTreeRoot } from '@open-pencil/vue/primitives/LayerTree'
const editor = createEditor({ width: 1440, height: 900 })
provideEditor(editor)
diff --git a/packages/docs/pl/programmable/sdk/guides/property-panels.md b/packages/docs/pl/programmable/sdk/guides/property-panels.md
index 932bedaac..df5aec990 100644
--- a/packages/docs/pl/programmable/sdk/guides/property-panels.md
+++ b/packages/docs/pl/programmable/sdk/guides/property-panels.md
@@ -41,7 +41,7 @@ Aplikacja OpenPencil pokazuje nazwę zmiennej na fioletowym tle, gdy pole nie je
```vue
<script setup lang="ts">
-import { usePosition } from '@open-pencil/vue'
+import { usePosition } from '@open-pencil/vue/controls/position'
const { x, y, width, height, updateProp, commitProp } = usePosition()
</script>
@@ -60,11 +60,9 @@ const { x, y, width, height, updateProp, commitProp } = usePosition()
```vue
<script setup lang="ts">
-import {
- PropertyListRoot,
- useEditorPropertyList,
- useFillControls
-} from '@open-pencil/vue'
+import { PropertyListRoot } from '@open-pencil/vue/primitives/PropertyList'
+import { useEditorPropertyList } from '@open-pencil/vue/controls/property-list'
+import { useFillControls } from '@open-pencil/vue/controls/fill'
const fillControls = useFillControls()
const fills = useEditorPropertyList('fills')
diff --git a/packages/docs/programmable/native-api.md b/packages/docs/programmable/native-api.md
index 8ab80eff8..5ebed0d85 100644
--- a/packages/docs/programmable/native-api.md
+++ b/packages/docs/programmable/native-api.md
@@ -10,7 +10,7 @@ OpenPencil's native APIs are the ordinary JavaScript libraries used by the edito
| Responsibility | Public entry point | Start here |
| --- | --- | --- |
| Document nodes, hierarchy, variables, instances, geometry | `@open-pencil/scene-graph` | [Scene Graph](../reference/scene-graph) |
-| Editing actions, selection, undo, component properties, events | `@open-pencil/core/editor` | `createEditor()` and its inferred `Editor` type; [custom editor shell](./sdk/guides/custom-editor-shell) |
+| Editing actions, selection, undo, component properties, events | `@open-pencil/core` | `createEditor()` and its inferred `Editor` type; [custom editor shell](./sdk/guides/custom-editor-shell) |
| Declarative scene construction | `@open-pencil/design-jsx` for elements, helpers, and JSX export; `@open-pencil/core/design-jsx` to render them | [JSX guide](./jsx-renderer) and [authoring reference](../reference/design-authoring) |
| Layout computation | `@open-pencil/core/layout` | `computeLayout(graph, frameId)` and `computeAllLayouts(graph, scopeId)` |
| Figma-compatible scripting | `@open-pencil/core/figma-api` | [Compatibility](../reference/figma-compatibility) |
diff --git a/packages/docs/programmable/sdk/api/advanced/locale-apis.md b/packages/docs/programmable/sdk/api/advanced/locale-apis.md
index d4ffc3ad2..97a1b47b8 100644
--- a/packages/docs/programmable/sdk/api/advanced/locale-apis.md
+++ b/packages/docs/programmable/sdk/api/advanced/locale-apis.md
@@ -18,13 +18,7 @@ Use these when you want direct store access, need to integrate locale state with
## Usage
```ts
-import {
- locale,
- localeSetting,
- setLocale,
- AVAILABLE_LOCALES,
- LOCALE_LABELS,
-} from '@open-pencil/vue'
+import { locale, localeSetting, setLocale, AVAILABLE_LOCALES, LOCALE_LABELS } from '@open-pencil/vue/i18n'
```
## Notes
diff --git a/packages/docs/programmable/sdk/api/advanced/use-color-binding-provider.md b/packages/docs/programmable/sdk/api/advanced/use-color-binding-provider.md
index 23e309559..d68500fee 100644
--- a/packages/docs/programmable/sdk/api/advanced/use-color-binding-provider.md
+++ b/packages/docs/programmable/sdk/api/advanced/use-color-binding-provider.md
@@ -14,9 +14,8 @@ Use it with `BindableValueRoot` and explicit targets such as `fills/0/color` or
actual color mutation begins and commits.
```ts twoslash
-import type { Color } from '@open-pencil/scene-graph'
-import type { BindingTarget } from '@open-pencil/vue'
-import { useColorBindingProvider } from '@open-pencil/vue'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import { type BindingTarget, useColorBindingProvider } from '@open-pencil/vue/controls/binding-provider'
const provider = useColorBindingProvider()
const targets: BindingTarget[] = [
diff --git a/packages/docs/programmable/sdk/api/advanced/use-color-variable-binding.md b/packages/docs/programmable/sdk/api/advanced/use-color-variable-binding.md
index 742d3e9e1..29e1d4044 100644
--- a/packages/docs/programmable/sdk/api/advanced/use-color-variable-binding.md
+++ b/packages/docs/programmable/sdk/api/advanced/use-color-variable-binding.md
@@ -12,7 +12,7 @@ Use it when building color UIs that need to connect fills or strokes to design v
## Usage
```ts
-import { useColorVariableBinding } from '@open-pencil/vue'
+import { useColorVariableBinding } from '@open-pencil/vue/controls/color-variable-binding'
const fillBinding = useColorVariableBinding('fills')
const strokeBinding = useColorVariableBinding('strokes')
diff --git a/packages/docs/programmable/sdk/api/advanced/use-number-field.md b/packages/docs/programmable/sdk/api/advanced/use-number-field.md
index a4e2f9e0e..624fb13a5 100644
--- a/packages/docs/programmable/sdk/api/advanced/use-number-field.md
+++ b/packages/docs/programmable/sdk/api/advanced/use-number-field.md
@@ -11,7 +11,7 @@ parts that need the canonical value, draft, state attributes, ARIA attributes, o
It throws when called outside a `NumberFieldRoot` subtree.
```ts
-import { useNumberField } from '@open-pencil/vue'
+import { useNumberField } from '@open-pencil/vue/primitives/NumberField'
const field = useNumberField()
field.actions.startEdit()
diff --git a/packages/docs/programmable/sdk/api/advanced/use-okhcl.md b/packages/docs/programmable/sdk/api/advanced/use-okhcl.md
index 81fe1df56..b9f84b65a 100644
--- a/packages/docs/programmable/sdk/api/advanced/use-okhcl.md
+++ b/packages/docs/programmable/sdk/api/advanced/use-okhcl.md
@@ -16,7 +16,7 @@ OpenPencil editor.
## Usage
```ts
-import { useOkHCL } from '@open-pencil/vue'
+import { useOkHCL } from '@open-pencil/vue/controls/okhcl'
const okhcl = useOkHCL()
diff --git a/packages/docs/programmable/sdk/api/advanced/use-variables.md b/packages/docs/programmable/sdk/api/advanced/use-variables.md
index 7084d60eb..71e9d2286 100644
--- a/packages/docs/programmable/sdk/api/advanced/use-variables.md
+++ b/packages/docs/programmable/sdk/api/advanced/use-variables.md
@@ -12,7 +12,7 @@ Use it when you want direct control over collections, active modes, filtering, a
## Usage
```ts
-import { useVariables } from '@open-pencil/vue'
+import { useVariables } from '@open-pencil/vue/variables'
const variables = useVariables()
```
diff --git a/packages/docs/programmable/sdk/api/advanced/use-viewport-kind.md b/packages/docs/programmable/sdk/api/advanced/use-viewport-kind.md
index 731d22862..b689a5702 100644
--- a/packages/docs/programmable/sdk/api/advanced/use-viewport-kind.md
+++ b/packages/docs/programmable/sdk/api/advanced/use-viewport-kind.md
@@ -12,7 +12,7 @@ Use it when your shell needs a light abstraction over breakpoints instead of wir
## Usage
```ts
-import { useViewportKind } from '@open-pencil/vue'
+import { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
const { isMobile, isDesktop } = useViewportKind()
```
diff --git a/packages/docs/programmable/sdk/api/components/bindable-value.md b/packages/docs/programmable/sdk/api/components/bindable-value.md
index c5e47ee38..a39527972 100644
--- a/packages/docs/programmable/sdk/api/components/bindable-value.md
+++ b/packages/docs/programmable/sdk/api/components/bindable-value.md
@@ -39,7 +39,7 @@ where possible.
```ts twoslash
import type { Variable } from '@open-pencil/scene-graph'
-import type { BindingProvider, BindingTarget } from '@open-pencil/vue'
+import type { BindingProvider, BindingTarget } from '@open-pencil/vue/controls/binding-provider'
const variable: Variable = {
id: 'spacing/md', name: 'Spacing / Medium', type: 'FLOAT',
diff --git a/packages/docs/programmable/sdk/api/components/channel-slider.md b/packages/docs/programmable/sdk/api/components/channel-slider.md
index 778879e06..cfef0461f 100644
--- a/packages/docs/programmable/sdk/api/components/channel-slider.md
+++ b/packages/docs/programmable/sdk/api/components/channel-slider.md
@@ -29,11 +29,7 @@ provides first-class OkHCL support.
```vue twoslash
<script setup lang="ts">
import { ref } from 'vue'
-import {
- ChannelSliderRoot,
- ChannelSliderThumb,
- ChannelSliderTrack
-} from '@open-pencil/vue'
+import { ChannelSliderRoot, ChannelSliderThumb, ChannelSliderTrack } from '@open-pencil/vue/primitives/ChannelSlider'
const chroma = ref(0.16)
</script>
diff --git a/packages/docs/programmable/sdk/api/components/color-picker-root.md b/packages/docs/programmable/sdk/api/components/color-picker-root.md
index 78a4cb092..55d447806 100644
--- a/packages/docs/programmable/sdk/api/components/color-picker-root.md
+++ b/packages/docs/programmable/sdk/api/components/color-picker-root.md
@@ -20,8 +20,8 @@ Opening or focusing the picker does not emit a color update.
```vue twoslash
<script setup lang="ts">
import { ref } from 'vue'
-import type { Color } from '@open-pencil/scene-graph'
-import { ColorPickerRoot } from '@open-pencil/vue'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import { ColorPickerRoot } from '@open-pencil/vue/primitives/ColorPicker'
const color = ref<Color>({ r: 0.2, g: 0.5, b: 0.9, a: 1 })
</script>
diff --git a/packages/docs/programmable/sdk/api/components/fill-root.md b/packages/docs/programmable/sdk/api/components/fill-root.md
index 41a4b882c..093980bf6 100644
--- a/packages/docs/programmable/sdk/api/components/fill-root.md
+++ b/packages/docs/programmable/sdk/api/components/fill-root.md
@@ -23,7 +23,7 @@ category is already active.
<script setup lang="ts">
import { ref } from 'vue'
import type { Fill } from '@open-pencil/scene-graph'
-import { FillRoot } from '@open-pencil/vue'
+import { FillRoot } from '@open-pencil/vue/primitives/Fill'
const fill = ref<Fill>({
type: 'SOLID',
diff --git a/packages/docs/programmable/sdk/api/components/fill-swatch.md b/packages/docs/programmable/sdk/api/components/fill-swatch.md
index 0fc7bd2ab..9d3378056 100644
--- a/packages/docs/programmable/sdk/api/components/fill-swatch.md
+++ b/packages/docs/programmable/sdk/api/components/fill-swatch.md
@@ -20,7 +20,7 @@ Consumers can place a checkerboard below the slot's `background` value for trans
```vue twoslash
<script setup lang="ts">
import type { Fill } from '@open-pencil/scene-graph'
-import { FillSwatch } from '@open-pencil/vue'
+import { FillSwatch } from '@open-pencil/vue/primitives/Fill'
const fill: Fill = {
type: 'SOLID',
diff --git a/packages/docs/programmable/sdk/api/components/gradient-editor-stop.md b/packages/docs/programmable/sdk/api/components/gradient-editor-stop.md
index 1dd06de07..a4703c956 100644
--- a/packages/docs/programmable/sdk/api/components/gradient-editor-stop.md
+++ b/packages/docs/programmable/sdk/api/components/gradient-editor-stop.md
@@ -23,7 +23,7 @@ exposes slot actions and `data-selected`/`data-dragging`, but does not enter the
```vue twoslash
<script setup lang="ts">
import type { GradientStop } from '@open-pencil/scene-graph'
-import { GradientEditorStop } from '@open-pencil/vue'
+import { GradientEditorStop } from '@open-pencil/vue/primitives/GradientEditor'
const stop: GradientStop = {
color: { r: 0.4, g: 0.2, b: 0.9, a: 1 },
diff --git a/packages/docs/programmable/sdk/api/components/number-field.md b/packages/docs/programmable/sdk/api/components/number-field.md
index c10257532..cf4429b9f 100644
--- a/packages/docs/programmable/sdk/api/components/number-field.md
+++ b/packages/docs/programmable/sdk/api/components/number-field.md
@@ -46,13 +46,7 @@ commits and Escape restores the interaction-start value.
```vue twoslash
<script setup lang="ts">
import { ref } from 'vue'
-import {
- NumberFieldInput,
- NumberFieldLeading,
- NumberFieldRoot,
- NumberFieldUnit,
- NumberFieldValue
-} from '@open-pencil/vue'
+import { NumberFieldInput, NumberFieldLeading, NumberFieldRoot, NumberFieldUnit, NumberFieldValue } from '@open-pencil/vue/primitives/NumberField'
const width = ref(120)
// ^?
diff --git a/packages/docs/programmable/sdk/api/components/property-grid.md b/packages/docs/programmable/sdk/api/components/property-grid.md
index 14374349f..bfbd232f8 100644
--- a/packages/docs/programmable/sdk/api/components/property-grid.md
+++ b/packages/docs/programmable/sdk/api/components/property-grid.md
@@ -13,7 +13,7 @@ import { data } from './property-grid.data'
```vue twoslash
<script setup lang="ts">
-import { PropertyGridRoot } from '@open-pencil/vue'
+import { PropertyGridRoot } from '@open-pencil/vue/primitives/PropertyGrid'
</script>
<template>
diff --git a/packages/docs/programmable/sdk/api/components/property-list-root.md b/packages/docs/programmable/sdk/api/components/property-list-root.md
index 16a7a9e87..e46766470 100644
--- a/packages/docs/programmable/sdk/api/components/property-list-root.md
+++ b/packages/docs/programmable/sdk/api/components/property-list-root.md
@@ -25,11 +25,7 @@ mutation and undo behavior stay in `useEditorPropertyList()` or an application a
<script setup lang="ts">
import { ref } from 'vue'
import type { Fill } from '@open-pencil/scene-graph'
-import {
- PropertyListItem,
- PropertyListRemove,
- PropertyListRoot
-} from '@open-pencil/vue'
+import { PropertyListItem, PropertyListRemove, PropertyListRoot } from '@open-pencil/vue/primitives/PropertyList'
const fills = ref<Fill[]>([])
</script>
diff --git a/packages/docs/programmable/sdk/api/components/property-section.md b/packages/docs/programmable/sdk/api/components/property-section.md
index 59c609dcf..411877482 100644
--- a/packages/docs/programmable/sdk/api/components/property-section.md
+++ b/packages/docs/programmable/sdk/api/components/property-section.md
@@ -26,12 +26,7 @@ attributes without imposing presentation.
```vue twoslash
<script setup lang="ts">
-import {
- PropertySectionContent,
- PropertySectionHeader,
- PropertySectionRoot,
- PropertySectionTitle
-} from '@open-pencil/vue'
+import { PropertySectionContent, PropertySectionHeader, PropertySectionRoot, PropertySectionTitle } from '@open-pencil/vue/primitives/PropertySection'
</script>
<template>
diff --git a/packages/docs/programmable/sdk/api/components/segmented-control.md b/packages/docs/programmable/sdk/api/components/segmented-control.md
index f253c6817..f5b0e182b 100644
--- a/packages/docs/programmable/sdk/api/components/segmented-control.md
+++ b/packages/docs/programmable/sdk/api/components/segmented-control.md
@@ -17,7 +17,7 @@ multiple modes retain selection; action mode emits commands without toggle state
```vue twoslash
<script setup lang="ts">
import { ref } from 'vue'
-import { SegmentedControlItem, SegmentedControlRoot } from '@open-pencil/vue'
+import { SegmentedControlItem, SegmentedControlRoot } from '@open-pencil/vue/primitives/SegmentedControl'
const alignment = ref('left')
</script>
diff --git a/packages/docs/programmable/sdk/api/composables/provide-editor.md b/packages/docs/programmable/sdk/api/composables/provide-editor.md
index 03fc6ad2e..1a45ef083 100644
--- a/packages/docs/programmable/sdk/api/composables/provide-editor.md
+++ b/packages/docs/programmable/sdk/api/composables/provide-editor.md
@@ -23,7 +23,7 @@ provideEditor(editor)
<script setup lang="ts">
import { provideEditor } from '@open-pencil/vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
const props = defineProps<{
editor: Editor
diff --git a/packages/docs/programmable/sdk/api/composables/use-appearance.md b/packages/docs/programmable/sdk/api/composables/use-appearance.md
index 14fec50e5..02380c400 100644
--- a/packages/docs/programmable/sdk/api/composables/use-appearance.md
+++ b/packages/docs/programmable/sdk/api/composables/use-appearance.md
@@ -19,7 +19,7 @@ It exposes selection-derived UI state for:
## Usage
```ts
-import { useAppearance } from '@open-pencil/vue'
+import { useAppearance } from '@open-pencil/vue/controls/appearance'
const appearance = useAppearance()
```
diff --git a/packages/docs/programmable/sdk/api/composables/use-canvas.md b/packages/docs/programmable/sdk/api/composables/use-canvas.md
index 74435dbf0..23975f711 100644
--- a/packages/docs/programmable/sdk/api/composables/use-canvas.md
+++ b/packages/docs/programmable/sdk/api/composables/use-canvas.md
@@ -21,7 +21,8 @@ It handles:
```ts
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
@@ -35,7 +36,8 @@ useCanvas(canvasRef, editor)
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
diff --git a/packages/docs/programmable/sdk/api/composables/use-color-model.md b/packages/docs/programmable/sdk/api/composables/use-color-model.md
index 4df7f156a..a02a8f55c 100644
--- a/packages/docs/programmable/sdk/api/composables/use-color-model.md
+++ b/packages/docs/programmable/sdk/api/composables/use-color-model.md
@@ -16,8 +16,8 @@ Pass callbacks to connect it to your own state or persistence layer.
```ts
import { ref } from 'vue'
-import { useColorModel } from '@open-pencil/vue'
-import type { Color } from '@open-pencil/scene-graph'
+import { useColorModel } from '@open-pencil/vue/controls/color-model'
+import type { Color } from '@open-pencil/scene-graph/primitives'
const color = ref<Color>({ r: 0.25, g: 0.5, b: 0.9, a: 1 })
diff --git a/packages/docs/programmable/sdk/api/composables/use-component-properties.md b/packages/docs/programmable/sdk/api/composables/use-component-properties.md
index cf1b45cbb..c4905c19d 100644
--- a/packages/docs/programmable/sdk/api/composables/use-component-properties.md
+++ b/packages/docs/programmable/sdk/api/composables/use-component-properties.md
@@ -9,7 +9,7 @@ description: Read and edit variant, text, boolean, and instance-swap properties
undo-aware value action.
```ts
-import { useComponentProperties } from '@open-pencil/vue'
+import { useComponentProperties } from '@open-pencil/vue/controls/component-props'
const { active, controls, setValue } = useComponentProperties()
diff --git a/packages/docs/programmable/sdk/api/composables/use-constraints.md b/packages/docs/programmable/sdk/api/composables/use-constraints.md
index a2900f8ed..270982f62 100644
--- a/packages/docs/programmable/sdk/api/composables/use-constraints.md
+++ b/packages/docs/programmable/sdk/api/composables/use-constraints.md
@@ -9,7 +9,7 @@ description: Read and update resize constraints for eligible frame children.
undo-aware actions.
```ts
-import { useConstraints } from '@open-pencil/vue'
+import { useConstraints } from '@open-pencil/vue/controls/constraints'
const constraints = useConstraints()
constraints.setAxis('horizontal', 'STRETCH')
diff --git a/packages/docs/programmable/sdk/api/composables/use-document-workspace.md b/packages/docs/programmable/sdk/api/composables/use-document-workspace.md
index dfca6ad1b..65fc22b27 100644
--- a/packages/docs/programmable/sdk/api/composables/use-document-workspace.md
+++ b/packages/docs/programmable/sdk/api/composables/use-document-workspace.md
@@ -18,7 +18,7 @@ It manages:
## Usage
```ts
-import { useDocumentWorkspace } from '@open-pencil/vue'
+import { useDocumentWorkspace } from '@open-pencil/vue/document/workspace'
const workspace = useDocumentWorkspace({
source: {
diff --git a/packages/docs/programmable/sdk/api/composables/use-editor-commands.md b/packages/docs/programmable/sdk/api/composables/use-editor-commands.md
index f58b2cc6c..848736786 100644
--- a/packages/docs/programmable/sdk/api/composables/use-editor-commands.md
+++ b/packages/docs/programmable/sdk/api/composables/use-editor-commands.md
@@ -18,7 +18,7 @@ It is useful when building:
## Usage
```ts
-import { useEditorCommands } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
const { commands, menuItem, runCommand, moveSelectionToPage, otherPages } = useEditorCommands()
```
diff --git a/packages/docs/programmable/sdk/api/composables/use-effects-controls.md b/packages/docs/programmable/sdk/api/composables/use-effects-controls.md
index 0ae4d7f2f..414f17e1e 100644
--- a/packages/docs/programmable/sdk/api/composables/use-effects-controls.md
+++ b/packages/docs/programmable/sdk/api/composables/use-effects-controls.md
@@ -19,7 +19,7 @@ It provides helpers for:
## Usage
```ts
-import { useEffectsControls } from '@open-pencil/vue'
+import { useEffectsControls } from '@open-pencil/vue/controls/effects'
const effects = useEffectsControls()
```
diff --git a/packages/docs/programmable/sdk/api/composables/use-export.md b/packages/docs/programmable/sdk/api/composables/use-export.md
index 16908f215..811d597f2 100644
--- a/packages/docs/programmable/sdk/api/composables/use-export.md
+++ b/packages/docs/programmable/sdk/api/composables/use-export.md
@@ -17,7 +17,7 @@ It manages:
## Usage
```ts
-import { useExport } from '@open-pencil/vue'
+import { useExport } from '@open-pencil/vue/document/export'
const exportState = useExport()
```
diff --git a/packages/docs/programmable/sdk/api/composables/use-fill-controls.md b/packages/docs/programmable/sdk/api/composables/use-fill-controls.md
index 78a0fc2db..20779191d 100644
--- a/packages/docs/programmable/sdk/api/composables/use-fill-controls.md
+++ b/packages/docs/programmable/sdk/api/composables/use-fill-controls.md
@@ -12,7 +12,7 @@ It adds a reusable default fill value.
## Usage
```ts
-import { useFillControls } from '@open-pencil/vue'
+import { useFillControls } from '@open-pencil/vue/controls/fill'
const fills = useFillControls()
```
diff --git a/packages/docs/programmable/sdk/api/composables/use-i18n.md b/packages/docs/programmable/sdk/api/composables/use-i18n.md
index 6e697acc5..8923569f9 100644
--- a/packages/docs/programmable/sdk/api/composables/use-i18n.md
+++ b/packages/docs/programmable/sdk/api/composables/use-i18n.md
@@ -8,7 +8,7 @@ description: Read localized OpenPencil UI messages and switch the active SDK loc
`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.
```ts twoslash
-import { useSettingsMessages, useRenameMessages } from '@open-pencil/vue'
+import { useSettingsMessages, useRenameMessages } from '@open-pencil/vue/i18n'
const settings = useSettingsMessages()
const rename = useRenameMessages()
@@ -19,7 +19,7 @@ Each domain composable returns a reactive ref. Read `.value` in script; Vue unwr
## Usage
```ts
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
const { menu, commands, panels, locale, availableLocales, localeLabels, setLocale } = useI18n()
```
@@ -36,7 +36,7 @@ The former `dialogs` group, `useDialogMessages()`, and `dialogMessages` are remo
```vue
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
const { menu, locale, availableLocales, localeLabels, setLocale } = useI18n()
</script>
diff --git a/packages/docs/programmable/sdk/api/composables/use-layout.md b/packages/docs/programmable/sdk/api/composables/use-layout.md
index d8da51229..3deacbb68 100644
--- a/packages/docs/programmable/sdk/api/composables/use-layout.md
+++ b/packages/docs/programmable/sdk/api/composables/use-layout.md
@@ -19,7 +19,7 @@ It exposes state and actions for:
## Usage
```ts
-import { useLayout } from '@open-pencil/vue'
+import { useLayout } from '@open-pencil/vue/controls/layout'
const layout = useLayout()
```
diff --git a/packages/docs/programmable/sdk/api/composables/use-mask.md b/packages/docs/programmable/sdk/api/composables/use-mask.md
index eb6cd332b..41d8c4f09 100644
--- a/packages/docs/programmable/sdk/api/composables/use-mask.md
+++ b/packages/docs/programmable/sdk/api/composables/use-mask.md
@@ -10,7 +10,7 @@ description: Read and update mask state for the selected node.
## Usage
```ts
-import { useMask } from '@open-pencil/vue'
+import { useMask } from '@open-pencil/vue/controls/mask'
const { active, maskType, setMaskType } = useMask()
```
diff --git a/packages/docs/programmable/sdk/api/composables/use-menu-model.md b/packages/docs/programmable/sdk/api/composables/use-menu-model.md
index 23453dea6..e859187f8 100644
--- a/packages/docs/programmable/sdk/api/composables/use-menu-model.md
+++ b/packages/docs/programmable/sdk/api/composables/use-menu-model.md
@@ -12,7 +12,7 @@ It is useful when you want ready-to-render menu groups instead of composing comm
## Usage
```ts
-import { useMenuModel } from '@open-pencil/vue'
+import { useMenuModel } from '@open-pencil/vue/editor/menu-model'
const { appMenu, canvasMenu, selectionLabelMenu } = useMenuModel()
```
diff --git a/packages/docs/programmable/sdk/api/composables/use-page-list.md b/packages/docs/programmable/sdk/api/composables/use-page-list.md
index 75fe389e7..635e66c1e 100644
--- a/packages/docs/programmable/sdk/api/composables/use-page-list.md
+++ b/packages/docs/programmable/sdk/api/composables/use-page-list.md
@@ -19,7 +19,7 @@ It exposes:
## Usage
```ts
-import { usePageList } from '@open-pencil/vue'
+import { usePageList } from '@open-pencil/vue/primitives/PageList'
const pageList = usePageList()
```
diff --git a/packages/docs/programmable/sdk/api/composables/use-position.md b/packages/docs/programmable/sdk/api/composables/use-position.md
index 87c444305..67a31bd73 100644
--- a/packages/docs/programmable/sdk/api/composables/use-position.md
+++ b/packages/docs/programmable/sdk/api/composables/use-position.md
@@ -27,7 +27,7 @@ and actions like:
## Usage
```ts
-import { usePosition } from '@open-pencil/vue'
+import { usePosition } from '@open-pencil/vue/controls/position'
const position = usePosition()
```
diff --git a/packages/docs/programmable/sdk/api/composables/use-selection-capabilities.md b/packages/docs/programmable/sdk/api/composables/use-selection-capabilities.md
index 5645455e5..341eb8199 100644
--- a/packages/docs/programmable/sdk/api/composables/use-selection-capabilities.md
+++ b/packages/docs/programmable/sdk/api/composables/use-selection-capabilities.md
@@ -18,7 +18,7 @@ Use it when building:
## Usage
```ts
-import { useSelectionCapabilities } from '@open-pencil/vue'
+import { useSelectionCapabilities } from '@open-pencil/vue/editor/selection-capabilities'
const caps = useSelectionCapabilities()
```
@@ -27,7 +27,7 @@ const caps = useSelectionCapabilities()
```vue
<script setup lang="ts">
-import { useSelectionCapabilities } from '@open-pencil/vue'
+import { useSelectionCapabilities } from '@open-pencil/vue/editor/selection-capabilities'
const { canDelete, canDuplicate, canCreateComponent } = useSelectionCapabilities()
</script>
diff --git a/packages/docs/programmable/sdk/api/composables/use-selection-colors.md b/packages/docs/programmable/sdk/api/composables/use-selection-colors.md
index 69cf99e20..89b637663 100644
--- a/packages/docs/programmable/sdk/api/composables/use-selection-colors.md
+++ b/packages/docs/programmable/sdk/api/composables/use-selection-colors.md
@@ -13,7 +13,7 @@ because they differ across the selection or a selected layer has children.
## Usage
```ts
-import { useSelectionColors } from '@open-pencil/vue'
+import { useSelectionColors } from '@open-pencil/vue/controls/selection-colors'
const selection = useSelectionColors()
diff --git a/packages/docs/programmable/sdk/api/composables/use-selection-layout.md b/packages/docs/programmable/sdk/api/composables/use-selection-layout.md
index a7d944288..c87ad531a 100644
--- a/packages/docs/programmable/sdk/api/composables/use-selection-layout.md
+++ b/packages/docs/programmable/sdk/api/composables/use-selection-layout.md
@@ -19,7 +19,7 @@ Each action changes only the layers it applies to, in one undo step.
## Usage
```ts
-import { useSelectionLayout } from '@open-pencil/vue'
+import { useSelectionLayout } from '@open-pencil/vue/controls/selection-layout'
const layout = useSelectionLayout()
diff --git a/packages/docs/programmable/sdk/api/composables/use-selection-state.md b/packages/docs/programmable/sdk/api/composables/use-selection-state.md
index 7361c32e7..4f6614856 100644
--- a/packages/docs/programmable/sdk/api/composables/use-selection-state.md
+++ b/packages/docs/programmable/sdk/api/composables/use-selection-state.md
@@ -17,7 +17,7 @@ Use it when you need to render UI based on:
## Usage
```ts
-import { useSelectionState } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const selection = useSelectionState()
```
@@ -26,7 +26,7 @@ const selection = useSelectionState()
```vue
<script setup lang="ts">
-import { useSelectionState } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const { hasSelection, selectedCount, isInstance } = useSelectionState()
</script>
diff --git a/packages/docs/programmable/sdk/api/composables/use-shared-style-binding.md b/packages/docs/programmable/sdk/api/composables/use-shared-style-binding.md
index c261c3e45..27057cf66 100644
--- a/packages/docs/programmable/sdk/api/composables/use-shared-style-binding.md
+++ b/packages/docs/programmable/sdk/api/composables/use-shared-style-binding.md
@@ -9,7 +9,7 @@ description: Apply and detach local fill, stroke, text, effect, and grid styles.
style definitions, and undo-aware bind/detach actions.
```ts
-import { useSharedStyleBinding } from '@open-pencil/vue'
+import { useSharedStyleBinding } from '@open-pencil/vue/controls/shared-style'
const fillStyle = useSharedStyleBinding('fill')
diff --git a/packages/docs/programmable/sdk/api/composables/use-stroke-controls.md b/packages/docs/programmable/sdk/api/composables/use-stroke-controls.md
index bb70a3722..a3725e79e 100644
--- a/packages/docs/programmable/sdk/api/composables/use-stroke-controls.md
+++ b/packages/docs/programmable/sdk/api/composables/use-stroke-controls.md
@@ -20,7 +20,7 @@ It provides:
## Usage
```ts
-import { useStrokeControls } from '@open-pencil/vue'
+import { useStrokeControls } from '@open-pencil/vue/controls/stroke'
const strokes = useStrokeControls()
```
diff --git a/packages/docs/programmable/sdk/api/composables/use-typography.md b/packages/docs/programmable/sdk/api/composables/use-typography.md
index 0ed55c6c0..491c4f4fb 100644
--- a/packages/docs/programmable/sdk/api/composables/use-typography.md
+++ b/packages/docs/programmable/sdk/api/composables/use-typography.md
@@ -27,7 +27,7 @@ It exposes:
## Usage
```ts
-import { useTypography } from '@open-pencil/vue'
+import { useTypography } from '@open-pencil/vue/controls/typography'
const typography = useTypography()
```
diff --git a/packages/docs/programmable/sdk/api/composables/use-variable-modes.md b/packages/docs/programmable/sdk/api/composables/use-variable-modes.md
index d0b03deb7..e08ffa587 100644
--- a/packages/docs/programmable/sdk/api/composables/use-variable-modes.md
+++ b/packages/docs/programmable/sdk/api/composables/use-variable-modes.md
@@ -10,7 +10,7 @@ description: Read and set the variable modes the selection or the current page s
## Usage
```ts
-import { useVariableModes } from '@open-pencil/vue'
+import { useVariableModes } from '@open-pencil/vue/controls/variable-modes'
const { choices, applied, setMode } = useVariableModes()
```
diff --git a/packages/docs/programmable/sdk/getting-started.md b/packages/docs/programmable/sdk/getting-started.md
index b336a7107..a764a919c 100644
--- a/packages/docs/programmable/sdk/getting-started.md
+++ b/packages/docs/programmable/sdk/getting-started.md
@@ -14,8 +14,9 @@ bun add @open-pencil/core @open-pencil/scene-graph @open-pencil/vue canvaskit-wa
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'
-import { provideEditor, useCanvas } from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { provideEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
```
## Mental model
@@ -35,7 +36,7 @@ There are three layers:
// @moduleResolution: bundler
// ---cut---
import { reactive } from 'vue'
-import { createDefaultEditorState, createEditor } from '@open-pencil/core/editor'
+import { createDefaultEditorState, createEditor } from '@open-pencil/core'
import { SceneGraph } from '@open-pencil/scene-graph'
const graph = new SceneGraph()
@@ -59,7 +60,7 @@ Icons come from Iconify by default. To serve them from elsewhere, such as a bund
<script setup lang="ts">
import { provideEditor } from '@open-pencil/vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
const props = defineProps<{
editor: Editor
@@ -81,7 +82,8 @@ You can think of this as the provider layer for the editor tree. The docs prefer
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
@@ -99,7 +101,8 @@ useCanvas(canvasRef, editor)
Once the editor is provided, child components can read selection and issue commands:
```ts
-import { useEditorCommands, useSelectionState } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const selection = useSelectionState()
const commands = useEditorCommands()
@@ -111,7 +114,9 @@ const commands = useEditorCommands()
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor, useSelectionState } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
diff --git a/packages/docs/programmable/sdk/guides/custom-editor-shell.md b/packages/docs/programmable/sdk/guides/custom-editor-shell.md
index 2c84d0fad..69916a1ff 100644
--- a/packages/docs/programmable/sdk/guides/custom-editor-shell.md
+++ b/packages/docs/programmable/sdk/guides/custom-editor-shell.md
@@ -34,15 +34,12 @@ A practical shell often looks like this:
```vue
<script setup lang="ts">
import { reactive } from 'vue'
-import { createDefaultEditorState, createEditor } from '@open-pencil/core/editor'
+import { createDefaultEditorState, createEditor } from '@open-pencil/core'
import { SceneGraph } from '@open-pencil/scene-graph'
-import {
- provideEditor,
- CanvasRoot,
- CanvasSurface,
- ToolbarRoot,
- PageListRoot,
-} from '@open-pencil/vue'
+import { provideEditor } from '@open-pencil/vue'
+import { CanvasRoot, CanvasSurface } from '@open-pencil/vue/canvas'
+import { ToolbarRoot } from '@open-pencil/vue/primitives/Toolbar'
+import { PageListRoot } from '@open-pencil/vue/primitives/PageList'
const graph = new SceneGraph()
const page = graph.getPages()[0]
diff --git a/packages/docs/programmable/sdk/guides/property-panels.md b/packages/docs/programmable/sdk/guides/property-panels.md
index bc1a795b7..63ac66225 100644
--- a/packages/docs/programmable/sdk/guides/property-panels.md
+++ b/packages/docs/programmable/sdk/guides/property-panels.md
@@ -48,7 +48,7 @@ state differently.
```vue
<script setup lang="ts">
-import { usePosition } from '@open-pencil/vue'
+import { usePosition } from '@open-pencil/vue/controls/position'
const { x, y, width, height, updateProp, commitProp } = usePosition()
</script>
@@ -67,11 +67,9 @@ const { x, y, width, height, updateProp, commitProp } = usePosition()
```vue
<script setup lang="ts">
-import {
- PropertyListRoot,
- useEditorPropertyList,
- useFillControls
-} from '@open-pencil/vue'
+import { PropertyListRoot } from '@open-pencil/vue/primitives/PropertyList'
+import { useEditorPropertyList } from '@open-pencil/vue/controls/property-list'
+import { useFillControls } from '@open-pencil/vue/controls/fill'
const fillControls = useFillControls()
const fills = useEditorPropertyList('fills')
diff --git a/packages/docs/ru/programmable/sdk/api/advanced/locale-apis.md b/packages/docs/ru/programmable/sdk/api/advanced/locale-apis.md
index 4d9a481d1..ae0913e81 100644
--- a/packages/docs/ru/programmable/sdk/api/advanced/locale-apis.md
+++ b/packages/docs/ru/programmable/sdk/api/advanced/locale-apis.md
@@ -18,13 +18,7 @@ description: Low-level locale stores и metadata из @open-pencil/vue.
## Использование
```ts
-import {
- locale,
- localeSetting,
- setLocale,
- AVAILABLE_LOCALES,
- LOCALE_LABELS,
-} from '@open-pencil/vue'
+import { locale, localeSetting, setLocale, AVAILABLE_LOCALES, LOCALE_LABELS } from '@open-pencil/vue/i18n'
```
## Поведение
diff --git a/packages/docs/ru/programmable/sdk/api/components/color-picker-root.md b/packages/docs/ru/programmable/sdk/api/components/color-picker-root.md
index 8786424c7..10b7c67cc 100644
--- a/packages/docs/ru/programmable/sdk/api/components/color-picker-root.md
+++ b/packages/docs/ru/programmable/sdk/api/components/color-picker-root.md
@@ -16,8 +16,8 @@ import { data } from '#docs-api/components/color-picker-root.data'
```vue twoslash
<script setup lang="ts">
import { ref } from 'vue'
-import type { Color } from '@open-pencil/scene-graph'
-import { ColorPickerRoot } from '@open-pencil/vue'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import { ColorPickerRoot } from '@open-pencil/vue/primitives/ColorPicker'
const color = ref<Color>({ r: 0.2, g: 0.5, b: 0.9, a: 1 })
</script>
diff --git a/packages/docs/ru/programmable/sdk/api/components/gradient-editor-stop.md b/packages/docs/ru/programmable/sdk/api/components/gradient-editor-stop.md
index bd80d6852..f58fa25d8 100644
--- a/packages/docs/ru/programmable/sdk/api/components/gradient-editor-stop.md
+++ b/packages/docs/ru/programmable/sdk/api/components/gradient-editor-stop.md
@@ -20,7 +20,7 @@ import { data } from '#docs-api/components/gradient-editor-stop.data'
```vue twoslash
<script setup lang="ts">
import type { GradientStop } from '@open-pencil/scene-graph'
-import { GradientEditorStop } from '@open-pencil/vue'
+import { GradientEditorStop } from '@open-pencil/vue/primitives/GradientEditor'
const stop: GradientStop = {
color: { r: 0.4, g: 0.2, b: 0.9, a: 1 },
diff --git a/packages/docs/ru/programmable/sdk/api/components/property-list-root.md b/packages/docs/ru/programmable/sdk/api/components/property-list-root.md
index 71025f460..53727c33c 100644
--- a/packages/docs/ru/programmable/sdk/api/components/property-list-root.md
+++ b/packages/docs/ru/programmable/sdk/api/components/property-list-root.md
@@ -23,11 +23,7 @@ PropertyList — управляемый компонент без встроен
<script setup lang="ts">
import { ref } from 'vue'
import type { Fill } from '@open-pencil/scene-graph'
-import {
- PropertyListItem,
- PropertyListRemove,
- PropertyListRoot
-} from '@open-pencil/vue'
+import { PropertyListItem, PropertyListRemove, PropertyListRoot } from '@open-pencil/vue/primitives/PropertyList'
const fills = ref<Fill[]>([])
</script>
diff --git a/packages/docs/ru/programmable/sdk/api/composables/provide-editor.md b/packages/docs/ru/programmable/sdk/api/composables/provide-editor.md
index cb9283d15..b66882eef 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/provide-editor.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/provide-editor.md
@@ -23,7 +23,7 @@ provideEditor(editor)
<script setup lang="ts">
import { provideEditor } from '@open-pencil/vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
const props = defineProps<{
editor: Editor
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-appearance.md b/packages/docs/ru/programmable/sdk/api/composables/use-appearance.md
index 8d15a23c2..7e7d3116a 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-appearance.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-appearance.md
@@ -17,7 +17,7 @@ description: Управление видимостью, прозрачность
## Использование
```ts
-import { useAppearance } from '@open-pencil/vue'
+import { useAppearance } from '@open-pencil/vue/controls/appearance'
const appearance = useAppearance()
```
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-canvas.md b/packages/docs/ru/programmable/sdk/api/composables/use-canvas.md
index 419bb087d..592a43a58 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-canvas.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-canvas.md
@@ -21,7 +21,8 @@ description: Подключение отрисовки CanvasKit к элемен
```ts
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
@@ -35,7 +36,8 @@ useCanvas(canvasRef, editor)
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-editor-commands.md b/packages/docs/ru/programmable/sdk/api/composables/use-editor-commands.md
index 6ab6ea2dc..635ccf9f6 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-editor-commands.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-editor-commands.md
@@ -18,7 +18,7 @@ description: Создание меню и других элементов инт
## Использование
```ts
-import { useEditorCommands } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
const { commands, menuItem, runCommand, moveSelectionToPage, otherPages } = useEditorCommands()
```
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-effects-controls.md b/packages/docs/ru/programmable/sdk/api/composables/use-effects-controls.md
index 4019330d8..77aa0602e 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-effects-controls.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-effects-controls.md
@@ -17,7 +17,7 @@ description: Управление тенями и blur effects в панели
## Использование
```ts
-import { useEffectsControls } from '@open-pencil/vue'
+import { useEffectsControls } from '@open-pencil/vue/controls/effects'
const effects = useEffectsControls()
```
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-export.md b/packages/docs/ru/programmable/sdk/api/composables/use-export.md
index 5fc3af746..ecc314467 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-export.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-export.md
@@ -17,7 +17,7 @@ description: Управление настройками экспорта — м
## Использование
```ts
-import { useExport } from '@open-pencil/vue'
+import { useExport } from '@open-pencil/vue/document/export'
const exportState = useExport()
```
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-fill-controls.md b/packages/docs/ru/programmable/sdk/api/composables/use-fill-controls.md
index d969d8914..0d6c1fffc 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-fill-controls.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-fill-controls.md
@@ -10,7 +10,7 @@ description: Значение по умолчанию для новых зали
## Использование
```ts
-import { useFillControls } from '@open-pencil/vue'
+import { useFillControls } from '@open-pencil/vue/controls/fill'
const fills = useFillControls()
```
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-i18n.md b/packages/docs/ru/programmable/sdk/api/composables/use-i18n.md
index 3ae2d93d8..dde59f9d6 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-i18n.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-i18n.md
@@ -12,7 +12,7 @@ description: Получение переведённых сообщений ин
## Использование
```ts
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
const { menu, commands, panels, locale, availableLocales, localeLabels, setLocale } = useI18n()
```
@@ -34,7 +34,7 @@ const { menu, commands, panels, locale, availableLocales, localeLabels, setLocal
```vue
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
const { menu, locale, availableLocales, localeLabels, setLocale } = useI18n()
</script>
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-layout.md b/packages/docs/ru/programmable/sdk/api/composables/use-layout.md
index b3530728d..97d283378 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-layout.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-layout.md
@@ -16,7 +16,7 @@ description: Управление автоматической компонов
## Использование
```ts
-import { useLayout } from '@open-pencil/vue'
+import { useLayout } from '@open-pencil/vue/controls/layout'
const layout = useLayout()
```
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-menu-model.md b/packages/docs/ru/programmable/sdk/api/composables/use-menu-model.md
index fc30d5b2e..429b5d749 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-menu-model.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-menu-model.md
@@ -12,7 +12,7 @@ description: Создание моделей меню приложения и х
## Использование
```ts
-import { useMenuModel } from '@open-pencil/vue'
+import { useMenuModel } from '@open-pencil/vue/editor/menu-model'
const { appMenu, canvasMenu, selectionLabelMenu } = useMenuModel()
```
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-page-list.md b/packages/docs/ru/programmable/sdk/api/composables/use-page-list.md
index 36e5d9dc7..e2241c462 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-page-list.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-page-list.md
@@ -19,7 +19,7 @@ description: Чтение страниц и управление переклю
## Использование
```ts
-import { usePageList } from '@open-pencil/vue'
+import { usePageList } from '@open-pencil/vue/primitives/PageList'
const pageList = usePageList()
```
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-position.md b/packages/docs/ru/programmable/sdk/api/composables/use-position.md
index b2386b31d..70b9af282 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-position.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-position.md
@@ -23,7 +23,7 @@ description: Чтение и изменение положения, размер
## Использование
```ts
-import { usePosition } from '@open-pencil/vue'
+import { usePosition } from '@open-pencil/vue/controls/position'
const position = usePosition()
```
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-selection-capabilities.md b/packages/docs/ru/programmable/sdk/api/composables/use-selection-capabilities.md
index 79fbc394e..411e0e23c 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-selection-capabilities.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-selection-capabilities.md
@@ -18,7 +18,7 @@ description: Реактивные булевы значения для UI и д
## Использование
```ts
-import { useSelectionCapabilities } from '@open-pencil/vue'
+import { useSelectionCapabilities } from '@open-pencil/vue/editor/selection-capabilities'
const caps = useSelectionCapabilities()
```
@@ -27,7 +27,7 @@ const caps = useSelectionCapabilities()
```vue
<script setup lang="ts">
-import { useSelectionCapabilities } from '@open-pencil/vue'
+import { useSelectionCapabilities } from '@open-pencil/vue/editor/selection-capabilities'
const { canDelete, canDuplicate, canCreateComponent } = useSelectionCapabilities()
</script>
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-selection-state.md b/packages/docs/ru/programmable/sdk/api/composables/use-selection-state.md
index a3df4bc95..cd314a5c9 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-selection-state.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-selection-state.md
@@ -17,7 +17,7 @@ description: "Реактивные сведения о выделении: ос
## Использование
```ts
-import { useSelectionState } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const selection = useSelectionState()
```
@@ -26,7 +26,7 @@ const selection = useSelectionState()
```vue
<script setup lang="ts">
-import { useSelectionState } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const { hasSelection, selectedCount, isInstance } = useSelectionState()
</script>
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-stroke-controls.md b/packages/docs/ru/programmable/sdk/api/composables/use-stroke-controls.md
index 2339df74e..b5ac0607c 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-stroke-controls.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-stroke-controls.md
@@ -15,7 +15,7 @@ description: Настройка расположения и толщины об
## Использование
```ts
-import { useStrokeControls } from '@open-pencil/vue'
+import { useStrokeControls } from '@open-pencil/vue/controls/stroke'
const strokes = useStrokeControls()
```
diff --git a/packages/docs/ru/programmable/sdk/api/composables/use-typography.md b/packages/docs/ru/programmable/sdk/api/composables/use-typography.md
index 00289af19..76904c760 100644
--- a/packages/docs/ru/programmable/sdk/api/composables/use-typography.md
+++ b/packages/docs/ru/programmable/sdk/api/composables/use-typography.md
@@ -17,7 +17,7 @@ description: Чтение и изменение семейства, начерт
## Использование
```ts
-import { useTypography } from '@open-pencil/vue'
+import { useTypography } from '@open-pencil/vue/controls/typography'
const typography = useTypography()
```
diff --git a/packages/docs/ru/programmable/sdk/getting-started.md b/packages/docs/ru/programmable/sdk/getting-started.md
index ef9491df5..13313ec00 100644
--- a/packages/docs/ru/programmable/sdk/getting-started.md
+++ b/packages/docs/ru/programmable/sdk/getting-started.md
@@ -14,8 +14,9 @@ bun add @open-pencil/core @open-pencil/vue canvaskit-wasm
SDK находится в монорепозитории OpenPencil и опубликован как пакет `@open-pencil/vue`.
```ts
-import { createEditor } from '@open-pencil/core/editor'
-import { provideEditor, useCanvas } from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { provideEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
```
## Из чего состоит приложение
@@ -31,7 +32,7 @@ import { provideEditor, useCanvas } from '@open-pencil/vue'
### 1. Создайте редактор
```ts
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
const editor = createEditor({
width: 1200,
@@ -45,7 +46,7 @@ const editor = createEditor({
<script setup lang="ts">
import { provideEditor } from '@open-pencil/vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
const props = defineProps<{
editor: Editor
@@ -67,7 +68,8 @@ provideEditor(props.editor)
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
@@ -85,7 +87,8 @@ useCanvas(canvasRef, editor)
После вызова `provideEditor()` дочерние компоненты могут получать сведения о выделении и выполнять команды редактора:
```ts
-import { useEditorCommands, useSelectionState } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const selection = useSelectionState()
const commands = useEditorCommands()
@@ -97,7 +100,9 @@ const commands = useEditorCommands()
<script setup lang="ts">
import { ref } from 'vue'
-import { useCanvas, useEditor, useSelectionState } from '@open-pencil/vue'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useEditor } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const canvasRef = ref<HTMLCanvasElement | null>(null)
const editor = useEditor()
diff --git a/packages/docs/ru/programmable/sdk/guides/custom-editor-shell.md b/packages/docs/ru/programmable/sdk/guides/custom-editor-shell.md
index 9808b59cc..c2fa680f9 100644
--- a/packages/docs/ru/programmable/sdk/guides/custom-editor-shell.md
+++ b/packages/docs/ru/programmable/sdk/guides/custom-editor-shell.md
@@ -31,15 +31,12 @@ description: Создание собственного интерфейса ре
```vue
<script setup lang="ts">
-import { createEditor } from '@open-pencil/core/editor'
-import {
- provideEditor,
- CanvasRoot,
- CanvasSurface,
- ToolbarRoot,
- PageListRoot,
- LayerTreeRoot,
-} from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { provideEditor } from '@open-pencil/vue'
+import { CanvasRoot, CanvasSurface } from '@open-pencil/vue/canvas'
+import { ToolbarRoot } from '@open-pencil/vue/primitives/Toolbar'
+import { PageListRoot } from '@open-pencil/vue/primitives/PageList'
+import { LayerTreeRoot } from '@open-pencil/vue/primitives/LayerTree'
const editor = createEditor({ width: 1440, height: 900 })
provideEditor(editor)
diff --git a/packages/docs/ru/programmable/sdk/guides/property-panels.md b/packages/docs/ru/programmable/sdk/guides/property-panels.md
index 1f7524bd2..1325f8092 100644
--- a/packages/docs/ru/programmable/sdk/guides/property-panels.md
+++ b/packages/docs/ru/programmable/sdk/guides/property-panels.md
@@ -41,7 +41,7 @@ description: Создание панелей свойств с помощью co
```vue
<script setup lang="ts">
-import { usePosition } from '@open-pencil/vue'
+import { usePosition } from '@open-pencil/vue/controls/position'
const { x, y, width, height, updateProp, commitProp } = usePosition()
</script>
@@ -60,11 +60,9 @@ const { x, y, width, height, updateProp, commitProp } = usePosition()
```vue
<script setup lang="ts">
-import {
- PropertyListRoot,
- useEditorPropertyList,
- useFillControls
-} from '@open-pencil/vue'
+import { PropertyListRoot } from '@open-pencil/vue/primitives/PropertyList'
+import { useEditorPropertyList } from '@open-pencil/vue/controls/property-list'
+import { useFillControls } from '@open-pencil/vue/controls/fill'
const fillControls = useFillControls()
const fills = useEditorPropertyList('fills')
diff --git a/packages/dom-css/src/behaviours/args.ts b/packages/dom-css/src/behaviours/args.ts
index 90f2f510c..57dbf7987 100644
--- a/packages/dom-css/src/behaviours/args.ts
+++ b/packages/dom-css/src/behaviours/args.ts
@@ -1,12 +1,10 @@
+import type { ComponentPropertyDefinition, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
behaviourProperties,
readBehaviour,
type Behaviour,
- type BehaviourKind,
- type ComponentPropertyDefinition,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type BehaviourKind
+} from '@open-pencil/scene-graph/behaviours'
/** A variant property a boolean value draws, as the component's boolean prop. */
export interface BooleanArg {
diff --git a/packages/dom-css/src/behaviours/controls.ts b/packages/dom-css/src/behaviours/controls.ts
index d48faf8a5..04a8f8314 100644
--- a/packages/dom-css/src/behaviours/controls.ts
+++ b/packages/dom-css/src/behaviours/controls.ts
@@ -1,22 +1,19 @@
+import type { ComponentPropertyDefinition, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
behaviourContract,
behaviourOwner,
behaviourProperties,
booleanBinding,
- findComponentPropertyTargets,
hasBehaviour,
- instanceMainComponent,
- instanceSlotFrames,
layerPath,
partBinding,
readBehaviour,
- slotPropertyId,
textBinding,
- type Behaviour,
- type ComponentPropertyDefinition,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type Behaviour
+} from '@open-pencil/scene-graph/behaviours'
+import { findComponentPropertyTargets } from '@open-pencil/scene-graph/components'
+import { instanceMainComponent } from '@open-pencil/scene-graph/instances'
+import { instanceSlotFrames, slotPropertyId } from '@open-pencil/scene-graph/slots'
/** A boolean value of a control and the property that draws it. */
export interface BooleanModel {
diff --git a/packages/dom-css/src/behaviours/states/conditions.ts b/packages/dom-css/src/behaviours/states/conditions.ts
index 2685849ac..e0aa953bf 100644
--- a/packages/dom-css/src/behaviours/states/conditions.ts
+++ b/packages/dom-css/src/behaviours/states/conditions.ts
@@ -1,12 +1,10 @@
+import type { ComponentPropertyDefinition, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
behaviourProperties,
readBehaviour,
- variantDefaultValue,
- type BehaviourKind,
- type ComponentPropertyDefinition,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type BehaviourKind
+} from '@open-pencil/scene-graph/behaviours'
+import { variantDefaultValue } from '@open-pencil/scene-graph/components'
import { behaviourArgs, type BehaviourArgs, type BooleanArg } from '../args'
import type { StateCondition } from './types'
diff --git a/packages/dom-css/src/behaviours/states/layers.ts b/packages/dom-css/src/behaviours/states/layers.ts
index b5d29676a..0b69d7c35 100644
--- a/packages/dom-css/src/behaviours/states/layers.ts
+++ b/packages/dom-css/src/behaviours/states/layers.ts
@@ -5,18 +5,16 @@ import {
import type { DesignElement, DesignNode, DesignText } from '#dom-css/types'
import { omit } from 'es-toolkit/object'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
behaviourOwner,
- instanceMainComponent,
- instanceSlotFrames,
layerPath,
partBinding,
- readBehaviour,
- readIcon,
- slotPropertyId,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ readBehaviour
+} from '@open-pencil/scene-graph/behaviours'
+import { readIcon } from '@open-pencil/scene-graph/icons'
+import { instanceMainComponent } from '@open-pencil/scene-graph/instances'
+import { instanceSlotFrames, slotPropertyId } from '@open-pencil/scene-graph/slots'
import type { StateElement } from './types'
diff --git a/packages/dom-css/src/behaviours/states/model.ts b/packages/dom-css/src/behaviours/states/model.ts
index 76d7d615c..1f73e4c0f 100644
--- a/packages/dom-css/src/behaviours/states/model.ts
+++ b/packages/dom-css/src/behaviours/states/model.ts
@@ -2,7 +2,8 @@ import type { SceneGraphToDesignOptions } from '#dom-css/export/projection'
import type { DesignStyleDeclaration } from '#dom-css/types'
import { isEmptyObject, isEqual } from 'es-toolkit/predicate'
-import { findLayerByPath, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { findLayerByPath } from '@open-pencil/scene-graph/behaviours'
import { variantConditions } from './conditions'
import {
diff --git a/packages/dom-css/src/export/bundle.ts b/packages/dom-css/src/export/bundle.ts
index f3d415d19..e93c4479f 100644
--- a/packages/dom-css/src/export/bundle.ts
+++ b/packages/dom-css/src/export/bundle.ts
@@ -2,7 +2,7 @@ import type { CSSFontFaceRule } from '@acemir/cssom'
import { isValid, toUint8Array } from 'js-base64'
import { parseFragment, serialize, type DefaultTreeAdapterTypes } from 'parse5'
-import { normalizeFontFamily } from '@open-pencil/scene-graph'
+import { normalizeFontFamily } from '@open-pencil/scene-graph/font-style'
import { tokenStylesheet, type TokenStylesheetFormat } from '../tokens/stylesheet'
import type { DesignDocument, DesignElement, DesignNode, DesignStyleDeclaration } from '../types'
diff --git a/packages/dom-css/src/export/components/fields.ts b/packages/dom-css/src/export/components/fields.ts
index c799e4319..08201e718 100644
--- a/packages/dom-css/src/export/components/fields.ts
+++ b/packages/dom-css/src/export/components/fields.ts
@@ -5,12 +5,12 @@ import { omit, pick } from 'es-toolkit/object'
import { isEmptyObject } from 'es-toolkit/predicate'
import { es } from '@open-pencil/emit'
+import type { ComponentPropertyDefinition } from '@open-pencil/scene-graph'
import {
DEFAULT_NUMBER_SETTINGS,
numberSettings,
- type Behaviour,
- type ComponentPropertyDefinition
-} from '@open-pencil/scene-graph'
+ type Behaviour
+} from '@open-pencil/scene-graph/behaviours'
import type { GeneratedKind, RangeModel, TextModel } from './model'
diff --git a/packages/dom-css/src/export/components/groups.ts b/packages/dom-css/src/export/components/groups.ts
index e398abdc6..713a71e8f 100644
--- a/packages/dom-css/src/export/components/groups.ts
+++ b/packages/dom-css/src/export/components/groups.ts
@@ -1,12 +1,8 @@
import type { StateElement } from '#dom-css/behaviours/states/types'
-import {
- behaviourOwner,
- findLayerByPath,
- instanceMainComponent,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { behaviourOwner, findLayerByPath } from '@open-pencil/scene-graph/behaviours'
+import { instanceMainComponent } from '@open-pencil/scene-graph/instances'
import type { ComponentModel } from './model'
import { placementOnly, referenceValues, shownText, type UsedLayer } from './references'
diff --git a/packages/dom-css/src/export/components/model.ts b/packages/dom-css/src/export/components/model.ts
index d62cd12c6..6c483407b 100644
--- a/packages/dom-css/src/export/components/model.ts
+++ b/packages/dom-css/src/export/components/model.ts
@@ -7,18 +7,17 @@ import type { StateElement, StateStyles } from '#dom-css/behaviours/states/types
import { uniq } from 'es-toolkit/array'
import { camelCase } from 'es-toolkit/string'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
behaviourContract,
behaviourProperties,
layerPath,
readBehaviour,
- slotPropertyId,
textBinding,
- variantDefaultValue,
- type Behaviour,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type Behaviour
+} from '@open-pencil/scene-graph/behaviours'
+import { variantDefaultValue } from '@open-pencil/scene-graph/components'
+import { slotPropertyId } from '@open-pencil/scene-graph/slots'
import type { SceneGraphToDesignOptions } from '../projection'
import { claimName, identifierName } from '../storybook/names'
diff --git a/packages/dom-css/src/export/components/properties.ts b/packages/dom-css/src/export/components/properties.ts
index f9f59bdd3..b9b11fd68 100644
--- a/packages/dom-css/src/export/components/properties.ts
+++ b/packages/dom-css/src/export/components/properties.ts
@@ -2,13 +2,12 @@ import { ownerVariants } from '#dom-css/behaviours/states/model'
import type { StateElement } from '#dom-css/behaviours/states/types'
import { camelCase } from 'es-toolkit/string'
-import {
- behaviourProperties,
- findLayerByPath,
- type ComponentPropertyReferenceField,
- type SceneGraph,
- type SceneNode
+import type {
+ ComponentPropertyReferenceField,
+ SceneGraph,
+ SceneNode
} from '@open-pencil/scene-graph'
+import { behaviourProperties, findLayerByPath } from '@open-pencil/scene-graph/behaviours'
import { claimName, identifierName } from '../storybook/names'
diff --git a/packages/dom-css/src/export/components/react/index.ts b/packages/dom-css/src/export/components/react/index.ts
index 01a2982b5..7f8111f68 100644
--- a/packages/dom-css/src/export/components/react/index.ts
+++ b/packages/dom-css/src/export/components/react/index.ts
@@ -6,7 +6,7 @@ import { omit } from 'es-toolkit/object'
import { camelCase, upperFirst } from 'es-toolkit/string'
import { es, jsx } from '@open-pencil/emit'
-import type { ShaderComponent } from '@open-pencil/scene-graph'
+import type { ShaderComponent } from '@open-pencil/scene-graph/shaders'
import type {
ComponentElement,
diff --git a/packages/dom-css/src/export/components/references.ts b/packages/dom-css/src/export/components/references.ts
index 1e1d6200d..61bcdb60f 100644
--- a/packages/dom-css/src/export/components/references.ts
+++ b/packages/dom-css/src/export/components/references.ts
@@ -3,16 +3,11 @@ import type { StateElement } from '#dom-css/behaviours/states/types'
import type { DesignStyleDeclaration } from '#dom-css/types'
import { isEmptyObject } from 'es-toolkit/predicate'
-import {
- behaviourOwner,
- findComponentPropertyTargets,
- findLayerByPath,
- instanceMainComponent,
- isIconModified,
- readIcon,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { behaviourOwner, findLayerByPath } from '@open-pencil/scene-graph/behaviours'
+import { findComponentPropertyTargets } from '@open-pencil/scene-graph/components'
+import { isIconModified, readIcon } from '@open-pencil/scene-graph/icons'
+import { instanceMainComponent } from '@open-pencil/scene-graph/instances'
import { drawsAsMain } from './drawn'
import type { ComponentModel } from './model'
diff --git a/packages/dom-css/src/export/components/shaders.ts b/packages/dom-css/src/export/components/shaders.ts
index 140914445..1cc91a593 100644
--- a/packages/dom-css/src/export/components/shaders.ts
+++ b/packages/dom-css/src/export/components/shaders.ts
@@ -1,13 +1,13 @@
import type { StateElement } from '#dom-css/behaviours/states/types'
import { es, jsx } from '@open-pencil/emit'
+import type { SceneGraph } from '@open-pencil/scene-graph'
+import { findLayerByPath } from '@open-pencil/scene-graph/behaviours'
import {
- findLayerByPath,
shaderOfPaint,
- type SceneGraph,
type ShaderComponent,
type ShaderPreset
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/shaders'
import { isPositioned } from '../projection'
import type { ComponentElement, ComponentNode } from './model'
diff --git a/packages/dom-css/src/export/components/tree.ts b/packages/dom-css/src/export/components/tree.ts
index 712c1c2df..c68d02642 100644
--- a/packages/dom-css/src/export/components/tree.ts
+++ b/packages/dom-css/src/export/components/tree.ts
@@ -1,6 +1,6 @@
import type { StateElement } from '#dom-css/behaviours/states/types'
-import type { ShaderPreset } from '@open-pencil/scene-graph'
+import type { ShaderPreset } from '@open-pencil/scene-graph/shaders'
import type { InputLayers } from './fields'
import type { ComponentBinding, ComponentElement, ComponentNode } from './model'
diff --git a/packages/dom-css/src/export/components/vue.ts b/packages/dom-css/src/export/components/vue.ts
index dc453687d..8ee19623c 100644
--- a/packages/dom-css/src/export/components/vue.ts
+++ b/packages/dom-css/src/export/components/vue.ts
@@ -6,7 +6,7 @@ import { omit } from 'es-toolkit/object'
import { camelCase, kebabCase, upperFirst } from 'es-toolkit/string'
import { es, vue } from '@open-pencil/emit'
-import type { ShaderComponent } from '@open-pencil/scene-graph'
+import type { ShaderComponent } from '@open-pencil/scene-graph/shaders'
import { claimName } from '../storybook/names'
import { progressWidth } from './fields'
diff --git a/packages/dom-css/src/export/projection.ts b/packages/dom-css/src/export/projection.ts
index e28286edc..2cb6d502d 100644
--- a/packages/dom-css/src/export/projection.ts
+++ b/packages/dom-css/src/export/projection.ts
@@ -1,15 +1,12 @@
import { fromUint8Array } from 'js-base64'
-import {
- imageMimeType,
- layoutSizingInParent,
- readIcon,
- shaderOfPaint,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import { BLACK } from '@open-pencil/scene-graph/constants'
-import { resolveNodeTextDirection } from '@open-pencil/scene-graph/text-direction'
+import { readIcon } from '@open-pencil/scene-graph/icons'
+import { imageMimeType } from '@open-pencil/scene-graph/images'
+import { layoutSizingInParent } from '@open-pencil/scene-graph/layout'
+import { shaderOfPaint } from '@open-pencil/scene-graph/shaders'
+import { resolveNodeTextDirection } from '@open-pencil/scene-graph/text/direction'
import { DesignTokens, type CSSModes } from '../tokens/references'
import type { DesignDocument, DesignElement, DesignNode, DesignStyleDeclaration } from '../types'
diff --git a/packages/dom-css/src/export/storybook/groups.ts b/packages/dom-css/src/export/storybook/groups.ts
index e6620e034..fa245541d 100644
--- a/packages/dom-css/src/export/storybook/groups.ts
+++ b/packages/dom-css/src/export/storybook/groups.ts
@@ -1,7 +1,8 @@
import { behaviourArgs } from '#dom-css/behaviours/args'
import { uniq } from 'es-toolkit/array'
-import { restingVariant, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { restingVariant } from '@open-pencil/scene-graph/components'
import { deriveSlashVariantProperties } from '@open-pencil/scene-graph/variant-properties'
import type { StoryProp } from './module'
diff --git a/packages/dom-css/src/export/tailwind-jsx.ts b/packages/dom-css/src/export/tailwind-jsx.ts
index 7b67660cc..8d3e67e86 100644
--- a/packages/dom-css/src/export/tailwind-jsx.ts
+++ b/packages/dom-css/src/export/tailwind-jsx.ts
@@ -1,5 +1,6 @@
import { jsx, type SyntaxNode } from '@open-pencil/emit'
-import type { SceneGraph, ShaderComponent, ShaderPreset } from '@open-pencil/scene-graph'
+import type { SceneGraph } from '@open-pencil/scene-graph'
+import type { ShaderComponent, ShaderPreset } from '@open-pencil/scene-graph/shaders'
import type { DesignDocument, DesignElement, DesignNode } from '../types'
import { shaderEffectAttributes } from './components/shaders'
diff --git a/packages/dom-css/src/export/text.ts b/packages/dom-css/src/export/text.ts
index b7564b9a9..e7c727545 100644
--- a/packages/dom-css/src/export/text.ts
+++ b/packages/dom-css/src/export/text.ts
@@ -1,5 +1,6 @@
import { isEqual } from 'es-toolkit/predicate'
+import type { CharacterStyleOverride, HyperlinkTarget, SceneNode } from '@open-pencil/scene-graph'
import {
hasTextList,
listNumberFormat,
@@ -7,12 +8,9 @@ import {
paragraphStyleAt,
textListItems,
textParagraphRanges,
- type CharacterStyleOverride,
- type HyperlinkTarget,
- type SceneNode,
type TextListItem,
type TextParagraphRange
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/text'
import type { DesignElement, DesignNode, DesignStyleDeclaration } from '../types'
import { fillToCSS } from './css'
diff --git a/packages/dom-css/src/import/flow.ts b/packages/dom-css/src/import/flow.ts
index 8ea4ecb76..325665778 100644
--- a/packages/dom-css/src/import/flow.ts
+++ b/packages/dom-css/src/import/flow.ts
@@ -1,19 +1,18 @@
import { pick } from 'es-toolkit'
-import {
- autoLayoutSizingFields,
- fillSizingFields,
- layoutSizing,
- textAutoResizeFor,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
parseCSSAlignItems,
parseCSSFlexDirection,
parseCSSJustifyContent,
parseCSSNumber
} from '@open-pencil/scene-graph/css'
+import {
+ autoLayoutSizingFields,
+ fillSizingFields,
+ layoutSizing,
+ textAutoResizeFor
+} from '@open-pencil/scene-graph/layout'
import type { DesignElement, DesignStyleDeclaration } from '../types'
import { pickStyle } from './css-values'
diff --git a/packages/dom-css/src/index.ts b/packages/dom-css/src/index.ts
index 2c5fefb58..4305c5e7c 100644
--- a/packages/dom-css/src/index.ts
+++ b/packages/dom-css/src/index.ts
@@ -1,8 +1,7 @@
import type * as DesignTypes from './types'
-export { exportHTMLBundle } from './export/bundle'
export { exportStorybook, STORY_MODES, STORYBOOK_FRAMEWORKS } from './export/storybook/export'
-export { serializeHTML, serializeNode } from './export/html'
+export { serializeNode } from './export/html'
export { createBrowserCSSRuntime, createCSSRuntime, createHeadlessCSSRuntime } from './runtime'
export {
htmlToDesignDocument,
@@ -10,31 +9,10 @@ export {
tailwindHTMLToDesignDocument,
tailwindHTMLToSceneGraph
} from './import/html'
-export { designDocumentToSceneGraph } from './import/scene-graph'
-export { sceneGraphToDesignDocument, sceneNodeToDesignDocument } from './export/projection'
-export {
- designDocumentToTailwindJSX,
- sceneNodesToTailwindJSX,
- sceneNodesToTailwindJSXWithLayers,
- type TailwindJSXWithLayers
-} from './export/tailwind-jsx'
export { compileTailwindCSS } from './import/tailwind'
export {
- browserHTMLToDesignDocument,
- browserHTMLToSceneGraph,
- browserJSXToDesignDocument,
- browserJSXToSceneGraph,
- browserTailwindHTMLToDesignDocument,
- browserTailwindHTMLToSceneGraph,
- browserTailwindJSXToDesignDocument,
- browserTailwindJSXToSceneGraph
-} from './browser'
-export {
- Fragment,
- jsx,
jsxToDesignDocument,
jsxToSceneGraph,
- jsxs,
tailwindJSXToDesignDocument,
tailwindJSXToSceneGraph
} from './import/jsx/runtime'
@@ -44,39 +22,16 @@ export type {
TailwindHTMLToDesignDocumentOptions,
TailwindHTMLToSceneGraphOptions
} from './import/html'
-export type { ToDesignDocumentOptions } from './export/projection'
export type { BrowserCSSRuntimeOptions } from './runtime'
export type {
- JSXChild,
- JSXElementProps,
- JSXStyleInput,
JSXStyleObject,
JSXStyleValue,
- JSXTag,
JSXToDesignDocumentOptions,
JSXToSceneGraphOptions,
TailwindJSXToDesignDocumentOptions,
TailwindJSXToSceneGraphOptions
} from './import/jsx/runtime'
-export type {
- BrowserHTMLToDesignDocumentOptions,
- BrowserHTMLToSceneGraphOptions,
- BrowserTailwindHTMLToDesignDocumentOptions,
- BrowserTailwindHTMLToSceneGraphOptions,
- BrowserTailwindToDesignDocumentOptions,
- BrowserTailwindToSceneGraphOptions,
- BrowserToDesignDocumentOptions,
- BrowserToSceneGraphOptions
-} from './browser'
export type { CompileTailwindCSSOptions } from './import/tailwind'
-export type {
- ExportHTMLBundle,
- ExportHTMLBundleOptions,
- ExportHTMLFile,
- WebFontFaceAsset,
- WebFontFaceRequest,
- WebFontFaceResolver
-} from './export/bundle'
export type {
ExportStorybookOptions,
StorybookFile,
@@ -86,7 +41,6 @@ export type {
StoryTarget
} from './export/storybook/export'
export type { SerializeHTMLOptions } from './export/html'
-export type { ToSceneGraphOptions } from './import/scene-graph'
export type CSSComputeOptions = DesignTypes.CSSComputeOptions
export type CSSRuntime = DesignTypes.CSSRuntime
export type DesignDocument = DesignTypes.DesignDocument
diff --git a/packages/dom-css/src/tokens/formula.ts b/packages/dom-css/src/tokens/formula.ts
index 01d6b9c04..ec5cb15d4 100644
--- a/packages/dom-css/src/tokens/formula.ts
+++ b/packages/dom-css/src/tokens/formula.ts
@@ -1,4 +1,5 @@
-import { foldFormula, type Variable, type VariableFormulaNode } from '@open-pencil/scene-graph'
+import type { Variable, VariableFormulaNode } from '@open-pencil/scene-graph'
+import { foldFormula } from '@open-pencil/scene-graph/variables'
import { tokenNumberToCSS, variableUnit } from './values'
diff --git a/packages/dom-css/src/tokens/references.ts b/packages/dom-css/src/tokens/references.ts
index 649d92728..17a111ac0 100644
--- a/packages/dom-css/src/tokens/references.ts
+++ b/packages/dom-css/src/tokens/references.ts
@@ -1,9 +1,5 @@
-import {
- type Color,
- type SceneGraph,
- type SceneNode,
- type Variable
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode, Variable } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import { collectionVariables, variableCSSNames, variableNamespace } from './names'
import { modeAttribute } from './stylesheet'
diff --git a/packages/dom-css/src/tokens/stylesheet.ts b/packages/dom-css/src/tokens/stylesheet.ts
index c41d4a75d..bd674d4ea 100644
--- a/packages/dom-css/src/tokens/stylesheet.ts
+++ b/packages/dom-css/src/tokens/stylesheet.ts
@@ -1,11 +1,11 @@
-import {
- variableValueReferences,
- type SceneGraph,
- type Variable,
- type VariableCollection,
- type VariableCollectionMode,
- type VariableValue
+import type {
+ SceneGraph,
+ Variable,
+ VariableCollection,
+ VariableCollectionMode,
+ VariableValue
} from '@open-pencil/scene-graph'
+import { variableValueReferences } from '@open-pencil/scene-graph/variables'
import { cssColor } from '../export/css'
import { formulaToCSS } from './formula'
diff --git a/packages/dom-css/src/tokens/values.ts b/packages/dom-css/src/tokens/values.ts
index 0d33fd2a5..8942cdb0d 100644
--- a/packages/dom-css/src/tokens/values.ts
+++ b/packages/dom-css/src/tokens/values.ts
@@ -1,9 +1,5 @@
-import {
- tokenNumberInUnit,
- type TokenUnit,
- type Variable,
- type VariableScope
-} from '@open-pencil/scene-graph'
+import type { TokenUnit, Variable, VariableScope } from '@open-pencil/scene-graph'
+import { tokenNumberInUnit } from '@open-pencil/scene-graph/variables'
import { variableNamespace } from './names'
diff --git a/packages/dom-css/src/types.ts b/packages/dom-css/src/types.ts
index a74b3a7ee..0d22c6842 100644
--- a/packages/dom-css/src/types.ts
+++ b/packages/dom-css/src/types.ts
@@ -1,4 +1,5 @@
-import type { SceneGraph, SceneNode, ShaderPreset } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import type { ShaderPreset } from '@open-pencil/scene-graph/shaders'
import type { DesignTokens } from './tokens/references'
diff --git a/packages/dom-css/tests/behaviours/args.test.ts b/packages/dom-css/tests/behaviours/args.test.ts
index 0b0ce40f4..f85e5830d 100644
--- a/packages/dom-css/tests/behaviours/args.test.ts
+++ b/packages/dom-css/tests/behaviours/args.test.ts
@@ -2,7 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { behaviourArgs } from '#dom-css/behaviours/args'
-import { emptyBehaviour, SceneGraph, withBehaviour } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { emptyBehaviour, withBehaviour } from '@open-pencil/scene-graph/behaviours'
function toggleSet(options: string[]) {
const graph = new SceneGraph()
diff --git a/packages/dom-css/tests/behaviours/controls.test.ts b/packages/dom-css/tests/behaviours/controls.test.ts
index a9908b274..13c232b4e 100644
--- a/packages/dom-css/tests/behaviours/controls.test.ts
+++ b/packages/dom-css/tests/behaviours/controls.test.ts
@@ -3,7 +3,8 @@ import { describe, expect, test } from 'bun:test'
import { behaviourControls, booleanOf } from '#dom-css/behaviours/controls'
import { controlRoles } from '#dom-css/behaviours/roles'
-import { emptyBehaviour, SceneGraph, withBehaviour } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { emptyBehaviour, withBehaviour } from '@open-pencil/scene-graph/behaviours'
/** A Switch set (State) and a card frame holding an On instance named Wifi. */
function switchCard() {
diff --git a/packages/dom-css/tests/behaviours/fixtures.ts b/packages/dom-css/tests/behaviours/fixtures.ts
index 97a28f291..4c2cbec9a 100644
--- a/packages/dom-css/tests/behaviours/fixtures.ts
+++ b/packages/dom-css/tests/behaviours/fixtures.ts
@@ -1,11 +1,6 @@
-import {
- emptyBehaviour,
- SceneGraph,
- withBehaviour,
- withIcon,
- type Behaviour,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { emptyBehaviour, withBehaviour, type Behaviour } from '@open-pencil/scene-graph/behaviours'
+import { withIcon } from '@open-pencil/scene-graph/icons'
const solid = (r: number, g: number, b: number) => [
{ type: 'SOLID' as const, color: { r, g, b, a: 1 }, opacity: 1, visible: true }
diff --git a/packages/dom-css/tests/behaviours/states.test.ts b/packages/dom-css/tests/behaviours/states.test.ts
index c5880d70d..e169c82d8 100644
--- a/packages/dom-css/tests/behaviours/states.test.ts
+++ b/packages/dom-css/tests/behaviours/states.test.ts
@@ -16,7 +16,7 @@ import type { DesignElement, DesignNode } from '#dom-css/types'
import { sortBy } from 'es-toolkit/array'
import { isEqual } from 'es-toolkit/predicate'
-import { emptyBehaviour } from '@open-pencil/scene-graph'
+import { emptyBehaviour } from '@open-pencil/scene-graph/behaviours'
import {
buttonSet,
diff --git a/packages/dom-css/tests/export/components/shader-fixtures.ts b/packages/dom-css/tests/export/components/shader-fixtures.ts
index 99fb9db51..e498c8c4c 100644
--- a/packages/dom-css/tests/export/components/shader-fixtures.ts
+++ b/packages/dom-css/tests/export/components/shader-fixtures.ts
@@ -1,4 +1,5 @@
-import { createShaderPaint, SceneGraph, withShaderPaints } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { createShaderPaint, withShaderPaints } from '@open-pencil/scene-graph/shaders'
/** The preset the hero plays: an aurora with a few props, and film grain over it. */
export const HERO_PRESET = {
diff --git a/packages/dom-css/tests/export/shaders.test.ts b/packages/dom-css/tests/export/shaders.test.ts
index a65443374..e8e68e178 100644
--- a/packages/dom-css/tests/export/shaders.test.ts
+++ b/packages/dom-css/tests/export/shaders.test.ts
@@ -1,12 +1,11 @@
import { describe, expect, test } from 'bun:test'
-import {
- sceneNodeToDesignDocument,
- sceneNodesToTailwindJSXWithLayers,
- serializeHTML
-} from '#dom-css/index'
+import { serializeHTML } from '#dom-css/export/html'
+import { sceneNodeToDesignDocument } from '#dom-css/export/projection'
+import { sceneNodesToTailwindJSXWithLayers } from '#dom-css/export/tailwind-jsx'
-import { createShaderPaint, SceneGraph, withShaderPaints } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { createShaderPaint, withShaderPaints } from '@open-pencil/scene-graph/shaders'
const PRESET = {
components: [{ type: 'Aurora', props: { colorA: '#ff3300', speed: 2 } }, { type: 'FilmGrain' }]
diff --git a/packages/dom-css/tests/export/storybook/export.test.ts b/packages/dom-css/tests/export/storybook/export.test.ts
index cefe361d3..dfdf42870 100644
--- a/packages/dom-css/tests/export/storybook/export.test.ts
+++ b/packages/dom-css/tests/export/storybook/export.test.ts
@@ -7,7 +7,8 @@ import { BLUE_500, card, designSystem } from '#dom-css-tests/export/token-fixtur
import { exportStorybook } from '#dom-css/index'
import { es } from '@open-pencil/emit'
-import { emptyBehaviour, SceneGraph, withBehaviour } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { emptyBehaviour, withBehaviour } from '@open-pencil/scene-graph/behaviours'
function buttonGraph() {
const graph = new SceneGraph()
diff --git a/packages/dom-css/tests/export/tailwind-jsx/helpers.ts b/packages/dom-css/tests/export/tailwind-jsx/helpers.ts
index e9582e5ed..e1033a106 100644
--- a/packages/dom-css/tests/export/tailwind-jsx/helpers.ts
+++ b/packages/dom-css/tests/export/tailwind-jsx/helpers.ts
@@ -1,4 +1,4 @@
-import { sceneNodesToTailwindJSX } from '#dom-css/index'
+import { sceneNodesToTailwindJSX } from '#dom-css/export/tailwind-jsx'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/packages/dom-css/tests/export/tailwind-jsx/layers.test.ts b/packages/dom-css/tests/export/tailwind-jsx/layers.test.ts
index f6c9001bc..784efdd57 100644
--- a/packages/dom-css/tests/export/tailwind-jsx/layers.test.ts
+++ b/packages/dom-css/tests/export/tailwind-jsx/layers.test.ts
@@ -1,6 +1,9 @@
import { describe, expect, test } from 'bun:test'
-import { sceneNodesToTailwindJSX, sceneNodesToTailwindJSXWithLayers } from '#dom-css/index'
+import {
+ sceneNodesToTailwindJSX,
+ sceneNodesToTailwindJSXWithLayers
+} from '#dom-css/export/tailwind-jsx'
import { makeGraph, pageId } from './helpers'
diff --git a/packages/dom-css/tests/export/tailwind-jsx/structure.test.ts b/packages/dom-css/tests/export/tailwind-jsx/structure.test.ts
index 2c69fd80d..3bc1fd481 100644
--- a/packages/dom-css/tests/export/tailwind-jsx/structure.test.ts
+++ b/packages/dom-css/tests/export/tailwind-jsx/structure.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { sceneNodesToTailwindJSX } from '#dom-css/index'
+import { sceneNodesToTailwindJSX } from '#dom-css/export/tailwind-jsx'
import { makeGraph, pageId, tw } from './helpers'
diff --git a/packages/dom-css/tests/export/tailwind-jsx/tokens.test.ts b/packages/dom-css/tests/export/tailwind-jsx/tokens.test.ts
index cb5e65fe9..9a9d175e3 100644
--- a/packages/dom-css/tests/export/tailwind-jsx/tokens.test.ts
+++ b/packages/dom-css/tests/export/tailwind-jsx/tokens.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { sceneNodesToTailwindJSX } from '#dom-css/index'
+import { sceneNodesToTailwindJSX } from '#dom-css/export/tailwind-jsx'
import { makeGraph, pageId } from './helpers'
diff --git a/packages/dom-css/tests/export/text.test.ts b/packages/dom-css/tests/export/text.test.ts
index ae06bbf4d..0a2665352 100644
--- a/packages/dom-css/tests/export/text.test.ts
+++ b/packages/dom-css/tests/export/text.test.ts
@@ -1,11 +1,11 @@
import { describe, expect, test } from 'bun:test'
+import { serializeHTML } from '#dom-css/export/html'
+import { sceneNodeToDesignDocument } from '#dom-css/export/projection'
import {
- sceneNodeToDesignDocument,
sceneNodesToTailwindJSX,
- sceneNodesToTailwindJSXWithLayers,
- serializeHTML
-} from '#dom-css/index'
+ sceneNodesToTailwindJSXWithLayers
+} from '#dom-css/export/tailwind-jsx'
import { SceneGraph, type Fill, type TextParagraphStyle } from '@open-pencil/scene-graph'
diff --git a/packages/dom-css/tests/import/conversion.test.ts b/packages/dom-css/tests/import/conversion.test.ts
index c6c0a32ad..817882dc6 100644
--- a/packages/dom-css/tests/import/conversion.test.ts
+++ b/packages/dom-css/tests/import/conversion.test.ts
@@ -1,15 +1,11 @@
import { describe, expect, it } from 'bun:test'
import { browserHTMLToSceneGraph } from '#dom-css/browser'
+import { serializeHTML } from '#dom-css/export/html'
+import { sceneGraphToDesignDocument } from '#dom-css/export/projection'
+import { designDocumentToSceneGraph } from '#dom-css/import/scene-graph'
import type { DesignElement, DesignNode } from '#dom-css/index'
-import {
- createHeadlessCSSRuntime,
- designDocumentToSceneGraph,
- htmlToDesignDocument,
- htmlToSceneGraph,
- sceneGraphToDesignDocument,
- serializeHTML
-} from '#dom-css/index'
+import { createHeadlessCSSRuntime, htmlToDesignDocument, htmlToSceneGraph } from '#dom-css/index'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
diff --git a/packages/dom-css/tests/import/flow.test.ts b/packages/dom-css/tests/import/flow.test.ts
index 47babe334..a283119a3 100644
--- a/packages/dom-css/tests/import/flow.test.ts
+++ b/packages/dom-css/tests/import/flow.test.ts
@@ -2,7 +2,8 @@ import { describe, expect, it } from 'bun:test'
import { createHeadlessCSSRuntime, htmlToSceneGraph } from '#dom-css/index'
-import { layoutSizing, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { layoutSizing } from '@open-pencil/scene-graph/layout'
async function importHTML(html: string) {
const graph = await htmlToSceneGraph(html, { runtime: createHeadlessCSSRuntime() })
diff --git a/packages/dom-css/tests/import/tailwind.test.ts b/packages/dom-css/tests/import/tailwind.test.ts
index b531bbe89..2ec4f23aa 100644
--- a/packages/dom-css/tests/import/tailwind.test.ts
+++ b/packages/dom-css/tests/import/tailwind.test.ts
@@ -1,9 +1,9 @@
import { describe, expect, it } from 'bun:test'
+import { designDocumentToSceneGraph } from '#dom-css/import/scene-graph'
import {
compileTailwindCSS,
createHeadlessCSSRuntime,
- designDocumentToSceneGraph,
tailwindHTMLToSceneGraph
} from '#dom-css/index'
diff --git a/packages/dom-css/tests/import/text.test.ts b/packages/dom-css/tests/import/text.test.ts
index 48bec59dd..ec7245b23 100644
--- a/packages/dom-css/tests/import/text.test.ts
+++ b/packages/dom-css/tests/import/text.test.ts
@@ -1,20 +1,12 @@
import { describe, expect, test } from 'bun:test'
-import {
- createHeadlessCSSRuntime,
- designDocumentToSceneGraph,
- htmlToDesignDocument,
- sceneNodeToDesignDocument,
- serializeHTML
-} from '#dom-css/index'
+import { serializeHTML } from '#dom-css/export/html'
+import { sceneNodeToDesignDocument } from '#dom-css/export/projection'
+import { designDocumentToSceneGraph } from '#dom-css/import/scene-graph'
+import { createHeadlessCSSRuntime, htmlToDesignDocument } from '#dom-css/index'
-import {
- paragraphSpacingAt,
- SceneGraph,
- textParagraphRanges,
- type SceneNode,
- type TextParagraphStyle
-} from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode, type TextParagraphStyle } from '@open-pencil/scene-graph'
+import { paragraphSpacingAt, textParagraphRanges } from '@open-pencil/scene-graph/text'
async function texts(html: string): Promise<SceneNode[]> {
const document = await htmlToDesignDocument(html, { runtime: createHeadlessCSSRuntime() })
diff --git a/packages/dom-css/tests/runtime.test.ts b/packages/dom-css/tests/runtime.test.ts
index 3650cb4e7..57dfd247e 100644
--- a/packages/dom-css/tests/runtime.test.ts
+++ b/packages/dom-css/tests/runtime.test.ts
@@ -1,11 +1,9 @@
import { describe, expect, it } from 'bun:test'
-import {
- createCSSRuntime,
- createHeadlessCSSRuntime,
- exportHTMLBundle,
- serializeHTML
-} from '../src/index'
+import { exportHTMLBundle } from '#dom-css/export/bundle'
+import { serializeHTML } from '#dom-css/export/html'
+
+import { createCSSRuntime, createHeadlessCSSRuntime } from '../src/index'
import { cardDocument, TEST_COLORS } from './helpers'
describe('@open-pencil/dom-css runtime', () => {
diff --git a/packages/dom-css/tests/tokens/formula.test.ts b/packages/dom-css/tests/tokens/formula.test.ts
index 9f1ca7336..d98c31bd3 100644
--- a/packages/dom-css/tests/tokens/formula.test.ts
+++ b/packages/dom-css/tests/tokens/formula.test.ts
@@ -1,7 +1,8 @@
import { expect, test } from 'bun:test'
import { tokenStylesheet } from '@open-pencil/dom-css/export'
-import { parseVariableFormula, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { parseVariableFormula } from '@open-pencil/scene-graph/variables'
function spacing() {
const graph = new SceneGraph()
diff --git a/packages/fig/src/clipboard/encode.ts b/packages/fig/src/clipboard/encode.ts
index 8e0950199..010582efb 100644
--- a/packages/fig/src/clipboard/encode.ts
+++ b/packages/fig/src/clipboard/encode.ts
@@ -3,8 +3,7 @@ import { encode, fromUint8Array } from 'js-base64'
import { getCompiledSchema, getSchemaBytes } from '@open-pencil/kiwi/fig/codec'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-
-import { buildFigKiwi } from '../node-change'
+import { buildFigKiwi } from '@open-pencil/kiwi/fig/container'
/** What a clipboard payload is for: layers to paste, or Copy properties' look for Paste properties. */
export type FigmaClipboardAssetType = 'UNKNOWN' | 'STYLE_PROPERTIES'
diff --git a/packages/fig/src/clipboard/import.ts b/packages/fig/src/clipboard/import.ts
index 90ca71c22..19088422b 100644
--- a/packages/fig/src/clipboard/import.ts
+++ b/packages/fig/src/clipboard/import.ts
@@ -3,9 +3,9 @@ import { decode as decodeText, toUint8Array, isValid } from 'js-base64'
import * as v from 'valibot'
import type { NodeChange as KiwiNodeChange } from '@open-pencil/kiwi/fig/codec'
+import { decompressFigKiwiDataAsync, parseFigKiwiChunks } from '@open-pencil/kiwi/fig/container'
import { decodeBinarySchema, compileSchema, ByteBuffer } from '@open-pencil/kiwi/schema-runtime'
-import { parseFigKiwiChunks, decompressFigKiwiDataAsync } from '../node-change'
import { isFigClipboardVisualType } from '../node-classification'
const FigmaClipboardMetaJSON = v.pipe(
diff --git a/packages/fig/src/document/bindings/layout.ts b/packages/fig/src/document/bindings/layout.ts
index 15f991cea..50bba1ad4 100644
--- a/packages/fig/src/document/bindings/layout.ts
+++ b/packages/fig/src/document/bindings/layout.ts
@@ -3,8 +3,8 @@ import {
numericVariableBindingScales
} from '#fig/node-change/variable/bindings'
-import { forEachInstanceOverride } from '@open-pencil/scene-graph'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { forEachInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
/** Apply resolved scalar layout values after hierarchy and explicit modes exist. */
export function applyDocumentLayoutBindings(
diff --git a/packages/fig/src/document/bindings/paint.ts b/packages/fig/src/document/bindings/paint.ts
index bdcdd2f64..81bfb35c2 100644
--- a/packages/fig/src/document/bindings/paint.ts
+++ b/packages/fig/src/document/bindings/paint.ts
@@ -1,4 +1,5 @@
-import { resolvedPaintBindings, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { resolvedPaintBindings } from '@open-pencil/scene-graph/variables'
/** Resolve bound paint colors only after occurrence hierarchy and modes are available. */
export function applyDocumentPaintBindings(
diff --git a/packages/fig/src/document/bindings/references.ts b/packages/fig/src/document/bindings/references.ts
index 9dbaab0d3..0b9f95832 100644
--- a/packages/fig/src/document/bindings/references.ts
+++ b/packages/fig/src/document/bindings/references.ts
@@ -2,7 +2,8 @@ import { symbolOverridesOf, type SymbolOverride } from '#fig/instance-overrides/
import { variableConsumptionEntries } from '#fig/node-change/variable/bindings'
import { visitVariableReferences } from '#fig/node-change/variable/expression'
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString, stringToGuid } from '@open-pencil/kiwi/fig/guid'
import { normalizeComponentPropertyRecords } from '../property-records'
diff --git a/packages/fig/src/document/bindings/values.ts b/packages/fig/src/document/bindings/values.ts
index abb8d640c..6c3c12628 100644
--- a/packages/fig/src/document/bindings/values.ts
+++ b/packages/fig/src/document/bindings/values.ts
@@ -1,9 +1,5 @@
-import {
- resolvedValueBindings,
- variableText,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { resolvedValueBindings, variableText } from '@open-pencil/scene-graph/variables'
/**
* Resolve values once occurrence hierarchy and modes exist. Visibility uses the
diff --git a/packages/fig/src/document/component/dependencies.ts b/packages/fig/src/document/component/dependencies.ts
index e9be41af8..5da2c1dc7 100644
--- a/packages/fig/src/document/component/dependencies.ts
+++ b/packages/fig/src/document/component/dependencies.ts
@@ -5,7 +5,8 @@ import {
type ComponentPropAssignment
} from '#fig/instance-overrides/types'
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
interface DependencyDefinition {
diff --git a/packages/fig/src/document/fragment.ts b/packages/fig/src/document/fragment.ts
index 9be90cfc7..f9e67386b 100644
--- a/packages/fig/src/document/fragment.ts
+++ b/packages/fig/src/document/fragment.ts
@@ -1,4 +1,5 @@
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
import { isUnsupportedFigFragmentType } from '../node-classification'
diff --git a/packages/fig/src/document/materialize.ts b/packages/fig/src/document/materialize.ts
index 0ce950fdb..0029e05e4 100644
--- a/packages/fig/src/document/materialize.ts
+++ b/packages/fig/src/document/materialize.ts
@@ -1,12 +1,8 @@
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
-import {
- generateId,
- OPEN_PENCIL_PLUGIN_DATA,
- remapStyleRunReferences,
- SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import { generateId, SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { OPEN_PENCIL_PLUGIN_DATA } from '@open-pencil/scene-graph/plugin-data'
+import { remapStyleRunReferences } from '@open-pencil/scene-graph/text'
import {
reconcileLiveComponentEdits,
diff --git a/packages/fig/src/document/metadata.ts b/packages/fig/src/document/metadata.ts
index 582ae463f..d85addc8c 100644
--- a/packages/fig/src/document/metadata.ts
+++ b/packages/fig/src/document/metadata.ts
@@ -1,5 +1,6 @@
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { OPEN_PENCIL_PLUGIN_DATA, type SceneGraph } from '@open-pencil/scene-graph'
+import type { SceneGraph } from '@open-pencil/scene-graph'
+import { OPEN_PENCIL_PLUGIN_DATA } from '@open-pencil/scene-graph/plugin-data'
import { readNodeChangePluginData } from '../node-change/plugin-data'
diff --git a/packages/fig/src/document/property-inheritance.ts b/packages/fig/src/document/property-inheritance.ts
index f3776f9be..9e076e7c5 100644
--- a/packages/fig/src/document/property-inheritance.ts
+++ b/packages/fig/src/document/property-inheritance.ts
@@ -1,4 +1,5 @@
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
import { parentIdOf } from '../instance-overrides/source-index'
diff --git a/packages/fig/src/document/variables.ts b/packages/fig/src/document/variables.ts
index ed90936de..a735b4156 100644
--- a/packages/fig/src/document/variables.ts
+++ b/packages/fig/src/document/variables.ts
@@ -2,16 +2,18 @@ import * as v from 'valibot'
import type { NodeChange, VariableDataEntry } from '@open-pencil/kiwi/fig/codec'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
+import type {
+ SceneGraph,
+ VariableFormulaNode,
+ VariableValue,
+ VariableColorExpression
+} from '@open-pencil/scene-graph'
import {
variableFormulaSchema,
variableColorExpressionSchema,
inferFormulaType,
- MAX_FORMULA_DEPTH,
- type SceneGraph,
- type VariableFormulaNode,
- type VariableValue,
- type VariableColorExpression
-} from '@open-pencil/scene-graph'
+ MAX_FORMULA_DEPTH
+} from '@open-pencil/scene-graph/variables'
import { extractPluginData } from '../node-change/plugin-data'
import { formulaOperatorOfFigmaFunction } from '../node-change/variable/formula'
diff --git a/packages/fig/src/instance-overrides/bindings/properties.ts b/packages/fig/src/instance-overrides/bindings/properties.ts
index 856906958..19705b917 100644
--- a/packages/fig/src/instance-overrides/bindings/properties.ts
+++ b/packages/fig/src/instance-overrides/bindings/properties.ts
@@ -1,6 +1,7 @@
import { cloneRecord } from '#fig/node-change/clone'
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { sameGuid } from '../source-index'
import type {
diff --git a/packages/fig/src/instance-overrides/bindings/variables.ts b/packages/fig/src/instance-overrides/bindings/variables.ts
index b25c6aee8..7ddee40af 100644
--- a/packages/fig/src/instance-overrides/bindings/variables.ts
+++ b/packages/fig/src/instance-overrides/bindings/variables.ts
@@ -6,7 +6,8 @@ import {
import { linearVariableExpression } from '#fig/node-change/variable/expression'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { setInstanceOverride, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
import type { InstanceOccurrence } from '../occurrence/types'
import { uniformScaleOf } from '../types'
diff --git a/packages/fig/src/instance-overrides/interpret.ts b/packages/fig/src/instance-overrides/interpret.ts
index 5271da342..a9011813f 100644
--- a/packages/fig/src/instance-overrides/interpret.ts
+++ b/packages/fig/src/instance-overrides/interpret.ts
@@ -1,6 +1,7 @@
import { omit } from 'es-toolkit/object'
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
import { cloneRecord } from '../node-change/clone'
diff --git a/packages/fig/src/instance-overrides/layers.ts b/packages/fig/src/instance-overrides/layers.ts
index 6c38fcf49..2b2129c33 100644
--- a/packages/fig/src/instance-overrides/layers.ts
+++ b/packages/fig/src/instance-overrides/layers.ts
@@ -1,4 +1,5 @@
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import type { InstanceAssignmentDiagnostic } from './occurrence/types'
import { symbolOverridesOf, type ComponentPropAssignment } from './types'
diff --git a/packages/fig/src/instance-overrides/live-component-edits.ts b/packages/fig/src/instance-overrides/live-component-edits.ts
index dc802a636..bef2b0fdc 100644
--- a/packages/fig/src/instance-overrides/live-component-edits.ts
+++ b/packages/fig/src/instance-overrides/live-component-edits.ts
@@ -1,9 +1,6 @@
-import {
- getInstanceOverride,
- INSTANCE_SYNC_FIELDS,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { INSTANCE_SYNC_FIELDS } from '@open-pencil/scene-graph/instances'
+import { getInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
import type { MaterializedInstance } from './materialize-instance'
diff --git a/packages/fig/src/instance-overrides/materialize-instance.ts b/packages/fig/src/instance-overrides/materialize-instance.ts
index 55a6846a9..e18f57650 100644
--- a/packages/fig/src/instance-overrides/materialize-instance.ts
+++ b/packages/fig/src/instance-overrides/materialize-instance.ts
@@ -1,7 +1,8 @@
import { isEqual } from 'es-toolkit/predicate'
import type { NodeChange, Paint } from '@open-pencil/kiwi/fig/codec'
-import { setInstanceOverride, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
import { createDefaultSourceMetadata } from '@open-pencil/scene-graph/node-defaults'
import { nodeChangeToProps } from '../node-change'
diff --git a/packages/fig/src/instance-overrides/occurrence/path.ts b/packages/fig/src/instance-overrides/occurrence/path.ts
index 76da1b087..86b18e01c 100644
--- a/packages/fig/src/instance-overrides/occurrence/path.ts
+++ b/packages/fig/src/instance-overrides/occurrence/path.ts
@@ -1,4 +1,4 @@
-import type { GUID } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
import { sameGuid } from '../source-index'
diff --git a/packages/fig/src/instance-overrides/occurrence/types.ts b/packages/fig/src/instance-overrides/occurrence/types.ts
index 3584ff33f..871945ae5 100644
--- a/packages/fig/src/instance-overrides/occurrence/types.ts
+++ b/packages/fig/src/instance-overrides/occurrence/types.ts
@@ -1,5 +1,6 @@
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
-import type { Vector } from '@open-pencil/scene-graph'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import type { BoundPropertyClaim } from '../bindings/properties'
import type { ComponentPropAssignment } from '../types'
diff --git a/packages/fig/src/instance-overrides/resize.ts b/packages/fig/src/instance-overrides/resize.ts
index fe5f85dbc..d8e1fa9e7 100644
--- a/packages/fig/src/instance-overrides/resize.ts
+++ b/packages/fig/src/instance-overrides/resize.ts
@@ -1,4 +1,5 @@
-import type { NodeChange, Vector } from '@open-pencil/kiwi/fig/codec'
+import type { Vector } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import type { InstanceOccurrence } from './occurrence/types'
import { uniformScaleOf } from './types'
diff --git a/packages/fig/src/instance-overrides/scale/text.ts b/packages/fig/src/instance-overrides/scale/text.ts
index 97bf7a1bd..6874c9cad 100644
--- a/packages/fig/src/instance-overrides/scale/text.ts
+++ b/packages/fig/src/instance-overrides/scale/text.ts
@@ -1,5 +1,5 @@
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import type { Vector } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
const scaledVector = (value: Vector, factor: number): Vector => ({
x: value.x * factor,
diff --git a/packages/fig/src/instance-overrides/source-children.ts b/packages/fig/src/instance-overrides/source-children.ts
index d5df13491..ea31a6690 100644
--- a/packages/fig/src/instance-overrides/source-children.ts
+++ b/packages/fig/src/instance-overrides/source-children.ts
@@ -1,4 +1,5 @@
-import { setInstanceOverride, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
import type { MaterializedInstance } from './materialize-instance'
import { occurrences } from './occurrence/path'
diff --git a/packages/fig/src/instance-overrides/source-index.ts b/packages/fig/src/instance-overrides/source-index.ts
index c7b74ae67..1c84955e7 100644
--- a/packages/fig/src/instance-overrides/source-index.ts
+++ b/packages/fig/src/instance-overrides/source-index.ts
@@ -1,4 +1,5 @@
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString, isUnsetGuid } from '@open-pencil/kiwi/fig/guid'
import { findWithinBoundary, type TreeShape } from './tree'
diff --git a/packages/fig/src/instance-overrides/types.ts b/packages/fig/src/instance-overrides/types.ts
index c9003e849..74b84ed16 100644
--- a/packages/fig/src/instance-overrides/types.ts
+++ b/packages/fig/src/instance-overrides/types.ts
@@ -1,4 +1,5 @@
-import type { GUID, NodeChange, VariableConsumptionEntry } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange, VariableConsumptionEntry } from '@open-pencil/kiwi/fig/codec'
import { isUnsetGuid, UNSET_GUID } from '@open-pencil/kiwi/fig/guid'
import type { Matrix, Vector } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/fig/src/node-change/basics.ts b/packages/fig/src/node-change/basics.ts
index 0ddc14c58..196dbc2ce 100644
--- a/packages/fig/src/node-change/basics.ts
+++ b/packages/fig/src/node-change/basics.ts
@@ -1,4 +1,5 @@
-import { getNodeLocalMatrix, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { getNodeLocalMatrix } from '@open-pencil/scene-graph/coordinate'
import type { Matrix } from '@open-pencil/scene-graph/primitives'
export function mapToFigmaType(type: SceneNode['type']): string {
diff --git a/packages/fig/src/node-change/convert.ts b/packages/fig/src/node-change/convert.ts
index c23947fb2..ae3c3f29e 100644
--- a/packages/fig/src/node-change/convert.ts
+++ b/packages/fig/src/node-change/convert.ts
@@ -4,12 +4,12 @@ import { guidToString, isUnsetGuid } from '@open-pencil/kiwi/fig/guid'
import {
DEFAULT_FONT_FAMILY,
DEFAULT_STROKE_MITER_LIMIT,
- DEFAULT_STROKE_WEIGHT,
- getNodeLocalMatrix,
- OPEN_PENCIL_PLUGIN_DATA,
- styleToWeight
-} from '@open-pencil/scene-graph'
+ DEFAULT_STROKE_WEIGHT
+} from '@open-pencil/scene-graph/constants'
+import { getNodeLocalMatrix } from '@open-pencil/scene-graph/coordinate'
+import { styleToWeight } from '@open-pencil/scene-graph/font-style'
import { createDefaultSourceMetadata } from '@open-pencil/scene-graph/node-defaults'
+import { OPEN_PENCIL_PLUGIN_DATA } from '@open-pencil/scene-graph/plugin-data'
import { POINT_COUNT_RANGE } from '@open-pencil/scene-graph/polygon'
import { isShapeWithTextType } from '@open-pencil/scene-graph/shape-with-text'
import { parseVariantName } from '@open-pencil/scene-graph/variant-name'
@@ -79,12 +79,10 @@ import type {
ComponentPropertyType,
SymbolLink,
VariantPropSpec,
- VariableModeMap,
- Vector
+ VariableModeMap
} from '@open-pencil/scene-graph'
-import type { GUID } from '@open-pencil/scene-graph/primitives'
+import type { Vector, GUID } from '@open-pencil/scene-graph/primitives'
-export { guidToString, stringToGuid } from '@open-pencil/kiwi/fig/guid'
import { numericVariableAssignmentScales, sourceVariableBindingScales } from './variable/bindings'
export { VARIABLE_BINDING_FIELDS, VARIABLE_BINDING_FIELDS_INVERSE } from './variable/bindings'
diff --git a/packages/fig/src/node-change/derived-text/build.ts b/packages/fig/src/node-change/derived-text/build.ts
index 4bbb24d95..397b1808b 100644
--- a/packages/fig/src/node-change/derived-text/build.ts
+++ b/packages/fig/src/node-change/derived-text/build.ts
@@ -1,14 +1,9 @@
import { groupBy } from 'es-toolkit/array'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import {
- hasTextList,
- normalizeFontFamily,
- paragraphIndexAt,
- textParagraphRanges,
- weightToStyle
-} from '@open-pencil/scene-graph'
import type { DerivedTextGlyph, SceneNode } from '@open-pencil/scene-graph'
+import { normalizeFontFamily, weightToStyle } from '@open-pencil/scene-graph/font-style'
+import { hasTextList, paragraphIndexAt, textParagraphRanges } from '@open-pencil/scene-graph/text'
import { bytesToHex } from '../bytes'
import type { PlacedTextGlyph, TextDecorationRecord } from '../export/runtime'
diff --git a/packages/fig/src/node-change/export/fill-sizing.ts b/packages/fig/src/node-change/export/fill-sizing.ts
index 24376778a..57e87efd3 100644
--- a/packages/fig/src/node-change/export/fill-sizing.ts
+++ b/packages/fig/src/node-change/export/fill-sizing.ts
@@ -1,4 +1,5 @@
-import { layoutSizing, type SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { layoutSizing } from '@open-pencil/scene-graph/layout'
export type OwnSizingField = 'stackPrimarySizing' | 'stackCounterSizing'
diff --git a/packages/fig/src/node-change/export/generated.ts b/packages/fig/src/node-change/export/generated.ts
index db84d2b01..4582325ae 100644
--- a/packages/fig/src/node-change/export/generated.ts
+++ b/packages/fig/src/node-change/export/generated.ts
@@ -1,5 +1,5 @@
-import { generatedFrameKind } from '@open-pencil/scene-graph'
import type { SceneNode } from '@open-pencil/scene-graph'
+import { generatedFrameKind } from '@open-pencil/scene-graph/generated'
import { generatedFrameCodec } from '../generated/codecs'
import type { KiwiNodeChange, SceneNodeToKiwiContext } from './context'
diff --git a/packages/fig/src/node-change/export/node.ts b/packages/fig/src/node-change/export/node.ts
index 0435bf18a..50ca80e06 100644
--- a/packages/fig/src/node-change/export/node.ts
+++ b/packages/fig/src/node-change/export/node.ts
@@ -12,13 +12,12 @@ import type {
} from '@open-pencil/scene-graph'
import {
DEFAULT_STROKE_MITER_LIMIT,
- DEFAULT_STROKE_WEIGHT,
- isGeneratedFrame,
- OPEN_PENCIL_PLUGIN_DATA,
- withPluginData
-} from '@open-pencil/scene-graph'
+ DEFAULT_STROKE_WEIGHT
+} from '@open-pencil/scene-graph/constants'
+import { isGeneratedFrame } from '@open-pencil/scene-graph/generated'
import { layoutGridCount } from '@open-pencil/scene-graph/layout'
import { siblingOrderKeys } from '@open-pencil/scene-graph/order-keys'
+import { OPEN_PENCIL_PLUGIN_DATA, withPluginData } from '@open-pencil/scene-graph/plugin-data'
import type { GUID, Matrix, Vector } from '@open-pencil/scene-graph/primitives'
/* eslint-disable max-lines */
diff --git a/packages/fig/src/node-change/export/override-claims.ts b/packages/fig/src/node-change/export/override-claims.ts
index 0f795aad5..654248038 100644
--- a/packages/fig/src/node-change/export/override-claims.ts
+++ b/packages/fig/src/node-change/export/override-claims.ts
@@ -5,14 +5,11 @@ import {
} from '#fig/instance-overrides/fields'
import { compact } from 'es-toolkit'
-import {
- forEachInstanceOverride,
- ownsSlotContent,
- scaleNodeChanges,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { forEachInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
import type { GUID, Vector } from '@open-pencil/scene-graph/primitives'
+import { scaleNodeChanges } from '@open-pencil/scene-graph/scaling'
+import { ownsSlotContent } from '@open-pencil/scene-graph/slots'
import { instanceExportAddress } from '../instance/geometry'
import { mergeVariableConsumptionMaps, overrideVariableBindingEntry } from '../variable/bindings'
diff --git a/packages/fig/src/node-change/export/resolved-bindings.ts b/packages/fig/src/node-change/export/resolved-bindings.ts
index 611620af6..a6b5e2ff6 100644
--- a/packages/fig/src/node-change/export/resolved-bindings.ts
+++ b/packages/fig/src/node-change/export/resolved-bindings.ts
@@ -1,11 +1,10 @@
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
resolvedNumericBindings,
resolvedPaintBindings,
resolvedRunBindings,
- resolvedValueBindings,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ resolvedValueBindings
+} from '@open-pencil/scene-graph/variables'
/**
* Figma draws the value a bound field stores until something makes it resolve the binding
diff --git a/packages/fig/src/node-change/export/slots.ts b/packages/fig/src/node-change/export/slots.ts
index 106529f25..9ce2752f8 100644
--- a/packages/fig/src/node-change/export/slots.ts
+++ b/packages/fig/src/node-change/export/slots.ts
@@ -1,12 +1,8 @@
import { DEFAULT_SLOT_CONTENT } from '#fig/instance-overrides/types'
-import {
- ownsSlotContent,
- slotPropertyId,
- type ComponentPropertyDefinition,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { ComponentPropertyDefinition, SceneNode } from '@open-pencil/scene-graph'
import type { GUID } from '@open-pencil/scene-graph/primitives'
+import { ownsSlotContent, slotPropertyId } from '@open-pencil/scene-graph/slots'
import type { KiwiNodeChange, SceneNodeToKiwiContext } from './context'
diff --git a/packages/fig/src/node-change/font/style.ts b/packages/fig/src/node-change/font/style.ts
index 6463e620f..88117f732 100644
--- a/packages/fig/src/node-change/font/style.ts
+++ b/packages/fig/src/node-change/font/style.ts
@@ -1,4 +1,4 @@
-import { FONT_WEIGHT_NAMES } from '@open-pencil/scene-graph'
+import { FONT_WEIGHT_NAMES } from '@open-pencil/scene-graph/font-style'
export function weightToFigmaStyle(weight: number, italic = false): string {
const rounded = Math.round(weight / 100) * 100
diff --git a/packages/fig/src/node-change/generated/connector.ts b/packages/fig/src/node-change/generated/connector.ts
index ba037253b..391dfe98e 100644
--- a/packages/fig/src/node-change/generated/connector.ts
+++ b/packages/fig/src/node-change/generated/connector.ts
@@ -1,12 +1,8 @@
import { pick } from 'es-toolkit'
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString, isUnsetGuid, UNSET_GUID } from '@open-pencil/kiwi/fig/guid'
-import {
- buildConnectorSublayers,
- connectorRouteEnds,
- connectorSublayers
-} from '@open-pencil/scene-graph'
import type {
ConnectorEndpoint,
ConnectorLineType,
@@ -15,6 +11,11 @@ import type {
SceneNode,
StrokeCap
} from '@open-pencil/scene-graph'
+import {
+ buildConnectorSublayers,
+ connectorRouteEnds,
+ connectorSublayers
+} from '@open-pencil/scene-graph/connectors'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import { nodeChangeToProps } from '../convert'
diff --git a/packages/fig/src/node-change/generated/records.ts b/packages/fig/src/node-change/generated/records.ts
index 97b809c6d..efda44bdd 100644
--- a/packages/fig/src/node-change/generated/records.ts
+++ b/packages/fig/src/node-change/generated/records.ts
@@ -1,4 +1,5 @@
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
/**
* A generated frame's record carries its sublayers as partial records, addressed by paths of one
diff --git a/packages/fig/src/node-change/generated/shape-with-text.ts b/packages/fig/src/node-change/generated/shape-with-text.ts
index e5c91560c..4224311bc 100644
--- a/packages/fig/src/node-change/generated/shape-with-text.ts
+++ b/packages/fig/src/node-change/generated/shape-with-text.ts
@@ -1,13 +1,13 @@
import { omit, pick } from 'es-toolkit'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
buildShapeWithTextLabel,
SHAPE_WITH_TEXT_LABEL_LAYOUT,
shapeWithTextFrameFields,
shapeWithTextLabel
-} from '@open-pencil/scene-graph'
-import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/generated'
import { cloneRecord } from '../clone'
import { nodeChangeToProps } from '../convert'
diff --git a/packages/fig/src/node-change/generated/sticky.ts b/packages/fig/src/node-change/generated/sticky.ts
index 505b41542..e6f017b3b 100644
--- a/packages/fig/src/node-change/generated/sticky.ts
+++ b/packages/fig/src/node-change/generated/sticky.ts
@@ -1,14 +1,14 @@
import { pick } from 'es-toolkit'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
buildStickySublayers,
STICKY_SUBLAYER_LAYOUT,
stickyFrameFields,
stickyScale,
stickySublayers
-} from '@open-pencil/scene-graph'
-import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/generated'
import { nodeChangeToProps } from '../convert'
import { createFillPaints } from '../export/context'
diff --git a/packages/fig/src/node-change/images.ts b/packages/fig/src/node-change/images.ts
index c58f75b0f..c0602080d 100644
--- a/packages/fig/src/node-change/images.ts
+++ b/packages/fig/src/node-change/images.ts
@@ -1,9 +1,9 @@
import type { NodeChange, PluginData } from '@open-pencil/kiwi/fig/codec'
+import { computeImageHash } from '@open-pencil/scene-graph/images'
import {
- computeImageHash,
OPEN_PENCIL_PLUGIN_DATA,
OPEN_PENCIL_PLUGIN_ID
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/plugin-data'
import { bytesToHex, hexToBytes } from './bytes'
diff --git a/packages/fig/src/node-change/instance/geometry.ts b/packages/fig/src/node-change/instance/geometry.ts
index 792e99435..3dabbb6e3 100644
--- a/packages/fig/src/node-change/instance/geometry.ts
+++ b/packages/fig/src/node-change/instance/geometry.ts
@@ -1,13 +1,10 @@
import type { DerivedSymbolOverride } from '#fig/instance-overrides/types'
-import type { GUID } from '@open-pencil/kiwi/fig/codec'
-import {
- findInstanceAncestor,
- getInstanceOverride,
- ownsSlotContent,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { findInstanceAncestor } from '@open-pencil/scene-graph/instances'
+import { getInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
+import { ownsSlotContent } from '@open-pencil/scene-graph/slots'
type ResolveGuid = (id: string) => GUID | undefined
diff --git a/packages/fig/src/node-change/instance/linkage/index.ts b/packages/fig/src/node-change/instance/linkage/index.ts
index 06aad56e5..9b225dd1e 100644
--- a/packages/fig/src/node-change/instance/linkage/index.ts
+++ b/packages/fig/src/node-change/instance/linkage/index.ts
@@ -1,4 +1,5 @@
-import { type SceneGraph, type SceneNode, setInstanceOverride } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
function linkSubtree(
graph: SceneGraph,
diff --git a/packages/fig/src/node-change/plugin-data.ts b/packages/fig/src/node-change/plugin-data.ts
index 444c31d69..4cee2e168 100644
--- a/packages/fig/src/node-change/plugin-data.ts
+++ b/packages/fig/src/node-change/plugin-data.ts
@@ -2,19 +2,21 @@ import { omit } from 'es-toolkit/object'
import type { NodeChange, PluginData, PluginRelaunchData } from '@open-pencil/kiwi/fig/codec'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
+import type {
+ ExportSetting,
+ PluginDataEntry,
+ PluginRelaunchDataEntry,
+ SceneNode
+} from '@open-pencil/scene-graph'
+import type { ExportFormatId } from '@open-pencil/scene-graph/export-format'
+import { clampExportScale } from '@open-pencil/scene-graph/export-scale'
import {
- clampExportScale,
hasPluginData,
OPEN_PENCIL_PLUGIN_DATA,
OPEN_PENCIL_PLUGIN_ID,
withPluginData,
- type ExportFormatId,
- type ExportSetting,
- type PluginDataEntry,
- type PluginDataField,
- type PluginRelaunchDataEntry,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type PluginDataField
+} from '@open-pencil/scene-graph/plugin-data'
import type { Rect } from '@open-pencil/scene-graph/primitives'
import { readEffectiveFigmaRawField } from '../source-metadata'
diff --git a/packages/fig/src/node-change/serialize.ts b/packages/fig/src/node-change/serialize.ts
index 17886172e..dec6adb5a 100644
--- a/packages/fig/src/node-change/serialize.ts
+++ b/packages/fig/src/node-change/serialize.ts
@@ -1,55 +1,44 @@
-import {
- DEFAULT_STROKE_WEIGHT,
- normalizeFontFamily,
- OPEN_PENCIL_PLUGIN_DATA,
- withPluginData
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { guidToString, stringToGuid } from '@open-pencil/kiwi/fig/guid'
+import type {
+ ComponentPropertyDefinition,
+ PluginDataEntry,
+ SceneGraph,
+ SceneNode
} from '@open-pencil/scene-graph'
+import { DEFAULT_STROKE_WEIGHT } from '@open-pencil/scene-graph/constants'
+import { normalizeFontFamily } from '@open-pencil/scene-graph/font-style'
import { fractionalPosition } from '@open-pencil/scene-graph/order-keys'
+import { OPEN_PENCIL_PLUGIN_DATA, withPluginData } from '@open-pencil/scene-graph/plugin-data'
+import type { GUID, JSONObject } from '@open-pencil/scene-graph/primitives'
import { effectiveFigmaRawNodeFields } from '../source-metadata'
import { computeExportTransform, mapToFigmaType } from './basics'
import { buildNodeDerivedTextData } from './derived-text/build'
import { fillsOwnSizingAxis } from './export/fill-sizing'
+import {
+ buildAssetRefToVarGuidMap,
+ buildComponentPropIndex,
+ sceneNodeToKiwiWithContext,
+ type KiwiNodeChange
+} from './export/node'
import { EMPTY_EXPORT_RUNTIME, type FigNodeChangeExportRuntime } from './export/runtime'
import { applyFontFeaturesToKiwi } from './font/features'
import { weightToFigmaStyle } from './font/style'
import { fillToKiwiPaint, safeColor } from './paint'
+import { exportTextData, fontVariationToKiwi } from './text/data-export'
+import { FIGMA_AUTO_LINE_HEIGHT } from './text/values'
import {
exportedVariableConsumptionEntries,
mergeVariableConsumptionMaps
} from './variable/bindings'
+import { toKiwiWindingRule } from './vector/geometry'
import {
buildStyleOverrideTable,
encodeVectorNetworkBlob,
type StyleOverride
} from './vector/network'
-export {
- buildFigKiwi,
- decompressFigKiwiDataAsync,
- FIG_KIWI_DEFAULT_VERSION,
- parseFigKiwiChunks
-} from '@open-pencil/kiwi/fig/container'
-import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { guidToString, stringToGuid } from '@open-pencil/kiwi/fig/guid'
-import type {
- ComponentPropertyDefinition,
- PluginDataEntry,
- SceneGraph,
- SceneNode
-} from '@open-pencil/scene-graph'
-import type { GUID, JSONObject } from '@open-pencil/scene-graph/primitives'
-
-import {
- buildAssetRefToVarGuidMap,
- buildComponentPropIndex,
- sceneNodeToKiwiWithContext,
- type KiwiNodeChange
-} from './export/node'
-import { exportTextData, fontVariationToKiwi } from './text/data-export'
-import { FIGMA_AUTO_LINE_HEIGHT } from './text/values'
-import { toKiwiWindingRule } from './vector/geometry'
-
function serializeCornerRadii(node: SceneNode, nc: KiwiNodeChange): void {
const anyIndividual =
node.topLeftRadius > 0 ||
diff --git a/packages/fig/src/node-change/status.ts b/packages/fig/src/node-change/status.ts
index 655074122..f4be31517 100644
--- a/packages/fig/src/node-change/status.ts
+++ b/packages/fig/src/node-change/status.ts
@@ -1,14 +1,13 @@
import * as v from 'valibot'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { OPEN_PENCIL_PLUGIN_DATA, withPluginData } from '@open-pencil/scene-graph/plugin-data'
import {
FIGMA_STATUS_STATE_IDS,
figmaDevStatusOf,
- OPEN_PENCIL_PLUGIN_DATA,
- withPluginData,
- type FigmaDevStatus,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type FigmaDevStatus
+} from '@open-pencil/scene-graph/statuses'
import { readEffectiveFigmaRawField } from '../source-metadata'
import type { KiwiNodeChange } from './export/context'
diff --git a/packages/fig/src/node-change/style/refs.ts b/packages/fig/src/node-change/style/refs.ts
index e10143634..67e731364 100644
--- a/packages/fig/src/node-change/style/refs.ts
+++ b/packages/fig/src/node-change/style/refs.ts
@@ -1,4 +1,5 @@
-import type { GUID, NodeChange, StyleReference } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange, StyleReference } from '@open-pencil/kiwi/fig/codec'
import { guidToString, isUnsetGuid } from '@open-pencil/kiwi/fig/guid'
const TEXT_STYLE_FIELDS = [
diff --git a/packages/fig/src/node-change/style/runs.ts b/packages/fig/src/node-change/style/runs.ts
index 30f0264de..ee79d881a 100644
--- a/packages/fig/src/node-change/style/runs.ts
+++ b/packages/fig/src/node-change/style/runs.ts
@@ -1,14 +1,15 @@
import { isEmptyObject } from 'es-toolkit/predicate'
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString, isUnsetGuid } from '@open-pencil/kiwi/fig/guid'
-import { styleToWeight } from '@open-pencil/scene-graph'
import type {
CharacterStyleOverride,
HyperlinkTarget,
StyleRun,
TextCase
} from '@open-pencil/scene-graph'
+import { styleToWeight } from '@open-pencil/scene-graph/font-style'
import { convertFontFeatures } from '../font/features'
import { convertFontVariations } from '../font/variations'
diff --git a/packages/fig/src/node-change/text/data-export.ts b/packages/fig/src/node-change/text/data-export.ts
index 327e8f58c..7dad66958 100644
--- a/packages/fig/src/node-change/text/data-export.ts
+++ b/packages/fig/src/node-change/text/data-export.ts
@@ -1,6 +1,6 @@
import type { NodeChange, Paint } from '@open-pencil/kiwi/fig/codec'
-import { normalizeFontFamily } from '@open-pencil/scene-graph'
import type { CharacterStyleOverride, SceneNode } from '@open-pencil/scene-graph'
+import { normalizeFontFamily } from '@open-pencil/scene-graph/font-style'
import { applyFontFeaturesToKiwi } from '../font/features'
import { weightToFigmaStyle } from '../font/style'
diff --git a/packages/fig/src/node-change/text/lines.ts b/packages/fig/src/node-change/text/lines.ts
index ea5d8996a..9297f5c4b 100644
--- a/packages/fig/src/node-change/text/lines.ts
+++ b/packages/fig/src/node-change/text/lines.ts
@@ -1,6 +1,12 @@
import { isEmptyObject } from 'es-toolkit/predicate'
import type { NodeChange, TextLineData } from '@open-pencil/kiwi/fig/codec'
+import type {
+ SceneNode,
+ TextListType,
+ TextParagraphSpacingField,
+ TextParagraphStyle
+} from '@open-pencil/scene-graph'
import {
TEXT_PARAGRAPH_SPACING_FIELDS,
paragraphStyleAt,
@@ -8,12 +14,8 @@ import {
textParagraphRanges,
trimParagraphStyles,
withIndentation,
- withParagraphSpacing,
- type SceneNode,
- type TextListType,
- type TextParagraphSpacingField,
- type TextParagraphStyle
-} from '@open-pencil/scene-graph'
+ withParagraphSpacing
+} from '@open-pencil/scene-graph/text'
const LINE_TYPES: Record<TextListType, NonNullable<TextLineData['lineType']>> = {
NONE: 'PLAIN',
diff --git a/packages/fig/src/node-change/text/run-references.ts b/packages/fig/src/node-change/text/run-references.ts
index fb413b508..804f746f8 100644
--- a/packages/fig/src/node-change/text/run-references.ts
+++ b/packages/fig/src/node-change/text/run-references.ts
@@ -1,4 +1,5 @@
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { stringToGuid, UNSET_GUID } from '@open-pencil/kiwi/fig/guid'
import type { CharacterStyleOverride, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
diff --git a/packages/fig/src/node-change/variable/bindings.ts b/packages/fig/src/node-change/variable/bindings.ts
index 96641b504..029883230 100644
--- a/packages/fig/src/node-change/variable/bindings.ts
+++ b/packages/fig/src/node-change/variable/bindings.ts
@@ -1,15 +1,16 @@
import { effectiveFigmaRawNodeFields } from '#fig/source-metadata'
import { invert } from 'es-toolkit/object'
-import type { VariableConsumptionEntry, GUID } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { VariableConsumptionEntry } from '@open-pencil/kiwi/fig/codec'
import { guidToString, stringToGuid } from '@open-pencil/kiwi/fig/guid'
-import {
- isNumericVariableBindingField,
- type SceneNode,
- type SceneGraph,
- type TextBindableField,
- type TextBoundVariables
+import type {
+ SceneNode,
+ SceneGraph,
+ TextBindableField,
+ TextBoundVariables
} from '@open-pencil/scene-graph'
+import { isNumericVariableBindingField } from '@open-pencil/scene-graph/variables'
import { cloneRecord } from '../clone'
import { linearVariableExpression } from './expression'
diff --git a/packages/fig/src/node-change/variable/token.ts b/packages/fig/src/node-change/variable/token.ts
index 3276a343a..eefa75b91 100644
--- a/packages/fig/src/node-change/variable/token.ts
+++ b/packages/fig/src/node-change/variable/token.ts
@@ -2,15 +2,17 @@ import { mapKeys } from 'es-toolkit/object'
import { isEmptyObject } from 'es-toolkit/predicate'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type {
+ PluginDataEntry,
+ Variable,
+ VariableCollection,
+ VariableValue
+} from '@open-pencil/scene-graph'
import {
OPEN_PENCIL_PLUGIN_DATA,
pluginDataEntry,
- withoutPluginData,
- type PluginDataEntry,
- type Variable,
- type VariableCollection,
- type VariableValue
-} from '@open-pencil/scene-graph'
+ withoutPluginData
+} from '@open-pencil/scene-graph/plugin-data'
import { readNodeChangePluginData } from '../plugin-data'
diff --git a/packages/fig/src/node-change/variable/unsupported.ts b/packages/fig/src/node-change/variable/unsupported.ts
index 3c360cd19..bfd4605f2 100644
--- a/packages/fig/src/node-change/variable/unsupported.ts
+++ b/packages/fig/src/node-change/variable/unsupported.ts
@@ -1,6 +1,7 @@
import * as v from 'valibot'
-import type { GUID, VariableDataEntry } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { VariableDataEntry } from '@open-pencil/kiwi/fig/codec'
const guid = v.looseObject({
sessionID: v.pipe(v.number(), v.integer(), v.minValue(0)),
diff --git a/packages/fig/src/node-classification.ts b/packages/fig/src/node-classification.ts
index 15b1742f2..12b44674d 100644
--- a/packages/fig/src/node-classification.ts
+++ b/packages/fig/src/node-classification.ts
@@ -1,4 +1,4 @@
-import { GENERATED_FRAME_TYPES } from '@open-pencil/scene-graph'
+import { GENERATED_FRAME_TYPES } from '@open-pencil/scene-graph/generated'
const UNSUPPORTED_FRAGMENT_TYPES: ReadonlySet<string> = new Set([
'STYLE',
diff --git a/packages/fig/src/record-patch/fields.ts b/packages/fig/src/record-patch/fields.ts
index 890b57f6d..3742cfcd2 100644
--- a/packages/fig/src/record-patch/fields.ts
+++ b/packages/fig/src/record-patch/fields.ts
@@ -1,4 +1,5 @@
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
import { derivedSymbolDataOf, symbolDataOf, type SymbolData } from '../instance-overrides/types'
diff --git a/packages/fig/src/record-patch/index.ts b/packages/fig/src/record-patch/index.ts
index 6c2226716..584e0c2cd 100644
--- a/packages/fig/src/record-patch/index.ts
+++ b/packages/fig/src/record-patch/index.ts
@@ -1,6 +1,7 @@
import { inflateSync } from 'fflate'
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import type { FigDataCompressor } from '@open-pencil/kiwi/fig/container'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
import {
diff --git a/packages/fig/tests/document/metadata.test.ts b/packages/fig/tests/document/metadata.test.ts
index cce0e9f5c..a58a346a4 100644
--- a/packages/fig/tests/document/metadata.test.ts
+++ b/packages/fig/tests/document/metadata.test.ts
@@ -2,11 +2,11 @@ import { describe, expect, test } from 'bun:test'
import { applyDocumentMetadata } from '#fig/document/metadata'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
OPEN_PENCIL_PLUGIN_DATA,
- OPEN_PENCIL_PLUGIN_ID,
- SceneGraph
-} from '@open-pencil/scene-graph'
+ OPEN_PENCIL_PLUGIN_ID
+} from '@open-pencil/scene-graph/plugin-data'
function enabledLibraries(value: string) {
const graph = new SceneGraph()
diff --git a/packages/fig/tests/document/slots.test.ts b/packages/fig/tests/document/slots.test.ts
index f05867a99..1d9a7a3e1 100644
--- a/packages/fig/tests/document/slots.test.ts
+++ b/packages/fig/tests/document/slots.test.ts
@@ -5,7 +5,8 @@ import { guid } from '#fig-tests/helpers/guid'
import { materializeDocument, materializeFigArchive } from '#fig/document/materialize'
import { DEFAULT_SLOT_CONTENT } from '#fig/instance-overrides/types'
-import type { GUID, NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
/**
diff --git a/packages/fig/tests/helpers/guid.ts b/packages/fig/tests/helpers/guid.ts
index 559f72914..d2d849d13 100644
--- a/packages/fig/tests/helpers/guid.ts
+++ b/packages/fig/tests/helpers/guid.ts
@@ -1,4 +1,4 @@
-import type { GUID } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
export function guid(localID: number, sessionID = 1): GUID {
return { sessionID, localID }
diff --git a/packages/fig/tests/instance-overrides/binding-provenance.test.ts b/packages/fig/tests/instance-overrides/binding-provenance.test.ts
index 31973b125..4f98d83a7 100644
--- a/packages/fig/tests/instance-overrides/binding-provenance.test.ts
+++ b/packages/fig/tests/instance-overrides/binding-provenance.test.ts
@@ -13,7 +13,8 @@ import { materializeInstance } from '#fig/instance-overrides/materialize-instanc
import { mapInstanceSourceChildren } from '#fig/instance-overrides/source-children'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { SceneGraph, hasInstanceOverride } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { hasInstanceOverride } from '@open-pencil/scene-graph/instances'
test('materialization preserves explicit equal-to-default text', () => {
const changes: NodeChange[] = [
diff --git a/packages/fig/tests/instance-overrides/derived-transform.test.ts b/packages/fig/tests/instance-overrides/derived-transform.test.ts
index 6d9bda742..c2f89bcf1 100644
--- a/packages/fig/tests/instance-overrides/derived-transform.test.ts
+++ b/packages/fig/tests/instance-overrides/derived-transform.test.ts
@@ -2,7 +2,8 @@ import { expect, test } from 'bun:test'
import { interpretInstance, materializeInstance } from '@open-pencil/fig/instance-overrides'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { SceneGraph, getNodeLocalMatrix } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { getNodeLocalMatrix } from '@open-pencil/scene-graph/coordinate'
for (const reflected of [false, true]) {
test(`derived size keeps the original local matrix (reflected=${reflected})`, () => {
diff --git a/packages/fig/tests/instance-overrides/gold/saved-layout.test.ts b/packages/fig/tests/instance-overrides/gold/saved-layout.test.ts
index 4d365451c..8358aee31 100644
--- a/packages/fig/tests/instance-overrides/gold/saved-layout.test.ts
+++ b/packages/fig/tests/instance-overrides/gold/saved-layout.test.ts
@@ -4,7 +4,8 @@ import { readFixtureArrayBuffer } from '#fig-tests/helpers/fig-fixtures'
import { interpretInstance, resolveOccurrencePath } from '#fig/instance-overrides/interpret'
import { parseFigBuffer } from '@open-pencil/fig'
-import { nodeChangeToProps, stringToGuid } from '@open-pencil/fig/node-change'
+import { nodeChangeToProps } from '@open-pencil/fig/node-change'
+import { stringToGuid } from '@open-pencil/kiwi/fig/guid'
import oracle from './fixtures/gold-input-layout.json'
diff --git a/packages/fig/tests/node-change/generated/codecs.test.ts b/packages/fig/tests/node-change/generated/codecs.test.ts
index 56004180f..3022ed4b0 100644
--- a/packages/fig/tests/node-change/generated/codecs.test.ts
+++ b/packages/fig/tests/node-change/generated/codecs.test.ts
@@ -2,7 +2,7 @@ import { expect, test } from 'bun:test'
import { generatedFrameCodec } from '#fig/node-change/generated/codecs'
-import { GENERATED_FRAME_TYPES } from '@open-pencil/scene-graph'
+import { GENERATED_FRAME_TYPES } from '@open-pencil/scene-graph/generated'
test('every generated frame type is read and written through a codec', () => {
for (const type of GENERATED_FRAME_TYPES)
diff --git a/packages/fig/tests/node-change/generated/shape-with-text.test.ts b/packages/fig/tests/node-change/generated/shape-with-text.test.ts
index 237fa1ec0..2f30f6f29 100644
--- a/packages/fig/tests/node-change/generated/shape-with-text.test.ts
+++ b/packages/fig/tests/node-change/generated/shape-with-text.test.ts
@@ -7,8 +7,8 @@ import { nodeChangeToProps, sceneNodeToKiwi } from '#fig/node-change/index'
import { materializeDocument } from '@open-pencil/fig'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { createShapeWithText, shapeWithTextLabel } from '@open-pencil/scene-graph'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { createShapeWithText, shapeWithTextLabel } from '@open-pencil/scene-graph/generated'
import type { Color } from '@open-pencil/scene-graph/primitives'
import { shapeWithTextLabelBox } from '@open-pencil/scene-graph/shape-with-text'
diff --git a/packages/fig/tests/node-change/generated/sticky.test.ts b/packages/fig/tests/node-change/generated/sticky.test.ts
index 8a971905b..2d9225fb8 100644
--- a/packages/fig/tests/node-change/generated/sticky.test.ts
+++ b/packages/fig/tests/node-change/generated/sticky.test.ts
@@ -7,8 +7,8 @@ import { sceneNodeToKiwi } from '#fig/node-change/index'
import { materializeDocument } from '@open-pencil/fig'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { createSticky, stickySublayers, STICKY_COLORS } from '@open-pencil/scene-graph'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { createSticky, stickySublayers, STICKY_COLORS } from '@open-pencil/scene-graph/generated'
const guid = (localID: number) => ({ sessionID: 0, localID })
const slot = (localID: number) => ({ guids: [{ sessionID: 40_000_000, localID }] })
diff --git a/packages/fig/tests/node-change/images.test.ts b/packages/fig/tests/node-change/images.test.ts
index 4683f7f8d..26ec3646a 100644
--- a/packages/fig/tests/node-change/images.test.ts
+++ b/packages/fig/tests/node-change/images.test.ts
@@ -4,11 +4,11 @@ import { bytesToHex, hexToBytes } from '#fig/node-change/bytes'
import { figImageEntries, nameImagesForFigma } from '#fig/node-change/images'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { computeImageHash } from '@open-pencil/scene-graph/images'
import {
- computeImageHash,
OPEN_PENCIL_PLUGIN_DATA,
OPEN_PENCIL_PLUGIN_ID
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/plugin-data'
const STILL = new Uint8Array([0xff, 0xd8, 0xff, 0xe0, 1, 2, 3])
/** A shader still's own name, which is not the SHA-1 of its bytes. */
diff --git a/packages/fig/tests/node-change/index.test.ts b/packages/fig/tests/node-change/index.test.ts
index 5f4bb3100..00b99e456 100644
--- a/packages/fig/tests/node-change/index.test.ts
+++ b/packages/fig/tests/node-change/index.test.ts
@@ -19,9 +19,15 @@ import {
} from '#fig/node-change/index'
import { fillToKiwiPaint } from '#fig/node-change/paint'
-import { getCompiledSchema, initCodec } from '@open-pencil/kiwi/fig/codec'
-import type { NodeChange, Paint } from '@open-pencil/kiwi/fig/codec'
-import { SceneGraph, getWorldMatrix, TransformMatrix } from '@open-pencil/scene-graph'
+import {
+ getCompiledSchema,
+ initCodec,
+ type NodeChange,
+ type Paint
+} from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
+import TransformMatrix from '@open-pencil/scene-graph/matrix'
describe('@open-pencil/fig NodeChange policy', () => {
test('keeps raw LINE endpoints through reflected parents and exports authored origin pivots', () => {
diff --git a/packages/fig/tests/node-change/plugin-data.test.ts b/packages/fig/tests/node-change/plugin-data.test.ts
index 01e32a9bd..a7994dae9 100644
--- a/packages/fig/tests/node-change/plugin-data.test.ts
+++ b/packages/fig/tests/node-change/plugin-data.test.ts
@@ -8,11 +8,11 @@ import {
} from '#fig/node-change/plugin-data'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { clampExportScale } from '@open-pencil/scene-graph/export-scale'
import {
- clampExportScale,
OPEN_PENCIL_PLUGIN_DATA,
OPEN_PENCIL_PLUGIN_ID
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/plugin-data'
function withPluginValue(key: string, value: string, extra: NodeChange = {}): NodeChange {
return { ...extra, pluginData: [{ pluginID: OPEN_PENCIL_PLUGIN_ID, key, value }] }
diff --git a/packages/fig/tests/node-change/status.test.ts b/packages/fig/tests/node-change/status.test.ts
index 60f1945fb..8b6bf77d5 100644
--- a/packages/fig/tests/node-change/status.test.ts
+++ b/packages/fig/tests/node-change/status.test.ts
@@ -4,8 +4,11 @@ import type { KiwiNodeChange } from '#fig/node-change/export/context'
import { extractNodeStatus, serializeNodeStatus } from '#fig/node-change/status'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { OPEN_PENCIL_PLUGIN_DATA, OPEN_PENCIL_PLUGIN_ID } from '@open-pencil/scene-graph'
import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
+import {
+ OPEN_PENCIL_PLUGIN_DATA,
+ OPEN_PENCIL_PLUGIN_ID
+} from '@open-pencil/scene-graph/plugin-data'
function written(status: string): NodeChange {
let id = 0
diff --git a/packages/fig/tests/node-change/variable-token.test.ts b/packages/fig/tests/node-change/variable-token.test.ts
index b36c38436..e6a2d0d0d 100644
--- a/packages/fig/tests/node-change/variable-token.test.ts
+++ b/packages/fig/tests/node-change/variable-token.test.ts
@@ -3,7 +3,10 @@ import { describe, expect, test } from 'bun:test'
import { readModeConditions, readVariableToken } from '#fig/node-change/index'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { OPEN_PENCIL_PLUGIN_DATA, OPEN_PENCIL_PLUGIN_ID } from '@open-pencil/scene-graph'
+import {
+ OPEN_PENCIL_PLUGIN_DATA,
+ OPEN_PENCIL_PLUGIN_ID
+} from '@open-pencil/scene-graph/plugin-data'
function record(key: string, value: string): NodeChange {
return { pluginData: [{ pluginID: OPEN_PENCIL_PLUGIN_ID, key, value }] }
diff --git a/packages/kiwi/README.md b/packages/kiwi/README.md
index 0b0c7ec25..637878e31 100644
--- a/packages/kiwi/README.md
+++ b/packages/kiwi/README.md
@@ -102,7 +102,8 @@ const guid = stringToGuid('1:42')
## Public subpaths
-- `@open-pencil/kiwi`
+The package has no root entry; import each name from its subpath.
+
- `@open-pencil/kiwi/schema-runtime`
- `@open-pencil/kiwi/fig`
- `@open-pencil/kiwi/fig/codec`
diff --git a/packages/kiwi/package.json b/packages/kiwi/package.json
index cca7a298c..c3714b003 100644
--- a/packages/kiwi/package.json
+++ b/packages/kiwi/package.json
@@ -15,15 +15,7 @@
],
"type": "module",
"sideEffects": false,
- "main": "./dist/index.js",
- "types": "./dist/index.d.ts",
"exports": {
- ".": {
- "types": "./dist/index.d.ts",
- "bun": "./src/index.ts",
- "import": "./dist/index.js",
- "default": "./dist/index.js"
- },
"./schema-runtime": {
"types": "./dist/schema-runtime.d.ts",
"bun": "./src/schema-runtime/index.ts",
diff --git a/packages/kiwi/src/fig/codec.ts b/packages/kiwi/src/fig/codec.ts
index 05f8e64e4..95372e692 100644
--- a/packages/kiwi/src/fig/codec.ts
+++ b/packages/kiwi/src/fig/codec.ts
@@ -98,8 +98,6 @@ export function peekMessageType(data: Uint8Array): number | null {
// Type definitions
-export type { Color, GUID, Matrix, Vector } from './types'
-
export interface ParentIndex {
guid: GUID
position: string
@@ -536,5 +534,3 @@ export function createNodeChange(opts: {
return change
}
-
-export { parseVariableId } from './variable-bindings'
diff --git a/packages/kiwi/src/fig/parse.ts b/packages/kiwi/src/fig/parse.ts
index 1104cde5c..6a9f8a320 100644
--- a/packages/kiwi/src/fig/parse.ts
+++ b/packages/kiwi/src/fig/parse.ts
@@ -11,8 +11,6 @@ import type { NodeChange } from './codec'
import { decompressFigKiwiData } from './container'
import { extractFigPageManifest, type FigPageManifestEntry } from './page-manifest'
-export type { NodeChange } from './codec'
-
/**
* Deduplicates pluginData/pluginRelaunchData entries on raw NodeChange objects.
* Some .fig files have millions of identical entries where only a small
diff --git a/packages/kiwi/src/index.ts b/packages/kiwi/src/index.ts
deleted file mode 100644
index 91082a251..000000000
--- a/packages/kiwi/src/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export * from './schema-runtime'
-export * from './fig'
diff --git a/packages/kiwi/tests/codec.test.ts b/packages/kiwi/tests/codec.test.ts
index eb1ee6ab3..9850b8d5d 100644
--- a/packages/kiwi/tests/codec.test.ts
+++ b/packages/kiwi/tests/codec.test.ts
@@ -9,9 +9,9 @@ import {
initCodec,
isCodecReady,
peekMessageType,
- type Color,
type NodeChange
} from '../src/fig/codec'
+import type { Color } from '../src/fig/types'
const red: Color = { r: 1, g: 0, b: 0, a: 1 }
diff --git a/packages/kiwi/tests/parse.test.ts b/packages/kiwi/tests/parse.test.ts
index 138070889..67b645f52 100644
--- a/packages/kiwi/tests/parse.test.ts
+++ b/packages/kiwi/tests/parse.test.ts
@@ -1,10 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import {
- deduplicateNodeChangePluginData,
- parseFigKiwiContainer,
- type NodeChange
-} from '../src/fig/parse'
+import { type NodeChange } from '../src/fig/codec'
+import { deduplicateNodeChangePluginData, parseFigKiwiContainer } from '../src/fig/parse'
describe('Figma FIG parse helpers', () => {
test('rejects non fig-kiwi containers', () => {
diff --git a/packages/kiwi/tsdown.config.ts b/packages/kiwi/tsdown.config.ts
index e8be047fc..12a4d67bb 100644
--- a/packages/kiwi/tsdown.config.ts
+++ b/packages/kiwi/tsdown.config.ts
@@ -17,7 +17,6 @@ function rawText(): Rolldown.Plugin {
export default defineConfig({
entry: {
- index: './src/index.ts',
'schema-runtime': './src/schema-runtime/index.ts',
fig: './src/fig/index.ts',
'fig/codec': './src/fig/codec.ts',
@@ -50,7 +49,8 @@ export default defineConfig({
const cleanId = id.split('?')[0]
const parts = cleanId.split(/[\\/]/g)
const srcIndex = parts.lastIndexOf('src')
- const file = srcIndex >= 0 ? parts.slice(srcIndex + 1).join('/') : parts.at(-1) ?? 'chunk'
+ const file =
+ srcIndex >= 0 ? parts.slice(srcIndex + 1).join('/') : (parts.at(-1) ?? 'chunk')
return `chunks/${file.replace(/\.(ts|tsx)$/, '')}`
}
}
diff --git a/packages/mcp/src/tool/manifest.ts b/packages/mcp/src/tool/manifest.ts
index 4e9c927b6..cf369e3b7 100644
--- a/packages/mcp/src/tool/manifest.ts
+++ b/packages/mcp/src/tool/manifest.ts
@@ -1,12 +1,7 @@
-import type { ToolDef } from '@open-pencil/core/tools'
+import type { ToolCapability, ToolDef } from '@open-pencil/core/tools'
import { ALL_TOOLS, toolChangesDocument, isToolExposed } from '@open-pencil/core/tools'
-import type {
- ToolAvailability,
- ToolCapability,
- ToolDescriptor,
- ToolEffect
-} from '#mcp/tool/metadata'
+import type { ToolAvailability, ToolDescriptor, ToolEffect } from '#mcp/tool/metadata'
export function coreToolEffect(def: ToolDef): ToolEffect {
return toolChangesDocument(def) ? 'write' : 'read'
diff --git a/packages/mcp/src/tool/metadata.ts b/packages/mcp/src/tool/metadata.ts
index 4d62f629e..1f4187793 100644
--- a/packages/mcp/src/tool/metadata.ts
+++ b/packages/mcp/src/tool/metadata.ts
@@ -3,7 +3,6 @@ import * as v from 'valibot'
import type { ToolCapability } from '@open-pencil/core/tools'
import type { MCPToolScope } from '#mcp/tool/scope'
-export type { ToolCapability } from '@open-pencil/core/tools'
const TOOL_EFFECTS = ['read', 'write'] as const
const TOOL_AVAILABILITIES = ['default', 'eval', 'filesystem'] as const
diff --git a/packages/pen/src/convert.ts b/packages/pen/src/convert.ts
index 5a498ea64..7d04af1c5 100644
--- a/packages/pen/src/convert.ts
+++ b/packages/pen/src/convert.ts
@@ -1,34 +1,33 @@
import {
generateId,
+ type Effect,
+ type Fill,
+ type LayoutAlign,
+ type LayoutCounterAlign,
+ type LayoutMode,
+ type LayoutSizing,
+ type NodeType,
+ type SceneGraph,
+ type SceneNode,
+ type Stroke,
+ type StrokeCap,
+ type StrokeJoin,
+ type TextAlignVertical,
+ type Variable,
+ type VariableCollection,
+ type VariableCollectionMode,
+ type VariableType,
+ type VariableValue
+} from '@open-pencil/scene-graph'
+import { parseColor } from '@open-pencil/scene-graph/color'
+import { BLACK } from '@open-pencil/scene-graph/constants'
+import {
paddingFromShorthand,
parseAutoLayoutDirection,
parseCounterAxisAlign,
parsePrimaryAxisAlign
-} from '@open-pencil/scene-graph'
-import type {
- Color,
- Effect,
- Fill,
- LayoutAlign,
- LayoutCounterAlign,
- LayoutMode,
- LayoutSizing,
- NodeType,
- SceneGraph,
- SceneNode,
- Stroke,
- StrokeCap,
- StrokeJoin,
- TextAlignVertical,
- Variable,
- VariableCollection,
- VariableCollectionMode,
- VariableType,
- VariableValue
-} from '@open-pencil/scene-graph'
-import { parseColor } from '@open-pencil/scene-graph/color'
-import { BLACK } from '@open-pencil/scene-graph/constants'
-import type { Vector } from '@open-pencil/scene-graph/primitives'
+} from '@open-pencil/scene-graph/layout'
+import type { Color, Vector } from '@open-pencil/scene-graph/primitives'
export interface PenDocument {
version: string
diff --git a/packages/pen/src/read.ts b/packages/pen/src/read.ts
index c5c4af611..e4cd518d5 100644
--- a/packages/pen/src/read.ts
+++ b/packages/pen/src/read.ts
@@ -1,13 +1,14 @@
-import { fillSizingFields, SceneGraph } from '@open-pencil/scene-graph'
-import type {
- AxisSizingMode,
- LayoutMode,
- LayoutSizing,
- SceneNode,
- VectorNetwork
+import {
+ SceneGraph,
+ type AxisSizingMode,
+ type LayoutMode,
+ type LayoutSizing,
+ type SceneNode,
+ type VectorNetwork
} from '@open-pencil/scene-graph'
import { copyEffects, copyFills, copyStrokes } from '@open-pencil/scene-graph/copy'
import { populateInstanceChildren } from '@open-pencil/scene-graph/instances'
+import { fillSizingFields } from '@open-pencil/scene-graph/layout'
import { parseSVGPath } from '@open-pencil/scene-graph/parse-path'
import {
diff --git a/packages/scene-graph/AGENTS.md b/packages/scene-graph/AGENTS.md
index 1892e09b6..246e14dd7 100644
--- a/packages/scene-graph/AGENTS.md
+++ b/packages/scene-graph/AGENTS.md
@@ -2,19 +2,21 @@
Framework-neutral document model. Owns node types, primitives, geometry, matrices, copy/snap/undo helpers, variables, instances, hit testing, and checkpoint recovery.
+- The root entry holds the model: `SceneGraph` (`src/graph.ts`), ID generation (`src/ids.ts`), and the node types (`src/types.ts`). Every other domain is a subpath named after its source path, such as `./instances/overrides` for `src/instances/overrides.ts`; `src/index.ts` only re-exports. Add a subpath to `package.json` and `tsdown.config.ts` together (`check:packages`).
+
- Nodes live in a flat `Map<string, SceneNode>`; runtime hierarchy uses `parentId` and `childIds`. Frames do not clip by default.
- Walk up the tree with `SceneGraph.closest()` or `isDescendant()`, which stop on a parent cycle in bad data, rather than a hand-written `parentId` loop (`packages/scene-graph/tests/basic/graph.test.ts`).
-- Change a live graph's hierarchy through `reparentNode`, `reorderChild`, `insertChildAt`, or `updateNode`, which emit the events collaboration syncs; assign `childIds` directly only on a graph copy or nodes created in the same edit (`sortInstanceChildren` in `packages/scene-graph/src/instances/sync.ts`).
+- Change a live graph's hierarchy through `reparentNode`, `insertChildAt`, or `updateNode`, which emit the events collaboration syncs; assign `childIds` directly only on a graph copy or nodes created in the same edit (`sortInstanceChildren` in `packages/scene-graph/src/instances/sync.ts`).
- Geometry is built on the matrices in `packages/scene-graph/src/matrix.ts` and `packages/scene-graph/src/coordinate.ts` (`getWorldMatrix`, `getAxisAlignedWorldBounds`, `getNodeLocalMatrix`). Add new transform, bounds, or inverse helpers here beside them; do not interpret ancestor rotations or reflections independently elsewhere. LINE pivots remain at the origin; other nodes rotate around their centers.
- Bounds accumulation goes through the helpers in `packages/scene-graph/src/geometry.ts` (`computeBounds`, `computeAbsoluteBounds`, `computeVisualBounds`); do not add another min/max loop.
- Reparenting preserves child world positions; groups preserve them too. Sort children geometrically before creating auto-layout. Consumers such as layer trees must react to reparenting rather than retaining stale child references.
- Use the copy helpers in `packages/scene-graph/src/copy.ts` for nested values (fills, strokes, effects); never hand-copy node properties.
- A generated frame (Figma's immutable frames such as `STICKY`, `SHAPE_WITH_TEXT` and `CONNECTOR`) owns real child layers built from its template in `packages/scene-graph/src/generated/` (a connector's in `packages/scene-graph/src/connectors/`); nothing adds, moves, or removes them (`slotScope` reports `locked`), and the layers panel lists the frame alone. Each type registers a `GeneratedFrameKind` in `GENERATED_FRAME_KINDS`, and the editor asks it (`layerRotates`, `layerResizes`, `generatedFrameText`) instead of testing node types. A kind's `sized` hook says what a width or height set outside layout also sets, such as a shape's given size, and `updateNode` and `updateNodePreview` apply it to every such write (`packages/scene-graph/tests/generated/kind.test.ts`). A connector's ends name the layers they follow by ID; a transfer that leaves those layers behind keeps the IDs, and a reader that cannot find one leaves that end free where it was drawn (`packages/scene-graph/tests/connectors/endpoints.test.ts`).
- A connector's route derives from the layers its ends follow: `routeConnector` routes as FigJam does and `layoutConnector` lays the line, label plate, and label out to match. Core's editor routes again when those layers change, during previews too, and deletes connectors with the layers they attach to; loading a document keeps the routes it saved, and one saved without a route is routed by layout or when its page is shown, once its label is measured (`packages/scene-graph/tests/connectors/route.test.ts` against recorded Figma routes, `packages/core/tests/editor/connectors/routing.test.ts`).
-- Instance children map to component children through `componentId`; runtime overrides use the structured `InstanceOverrideState` (`self` and `descendants` maps) in `packages/scene-graph/src/instance-overrides.ts`.
+- Instance children map to component children through `componentId`; runtime overrides use the structured `InstanceOverrideState` (`self` and `descendants` maps) in `packages/scene-graph/src/instances/overrides.ts`.
- A bound numeric field records its unit conversion in `variableBindingScales`; preserve it through clone, copy, and transfer so a binding keeps meaning in its new scope. Core reconciles bindings and layout together in `packages/core/src/layout/variables.ts`, which the editor and the Figma API both call rather than reimplementing.
- `componentScale` records an occurrence's coordinates relative to its component definition. Shared rescaling lives in `packages/scene-graph/src/scaling/`; Core's Figma API delegates there instead of scaling nodes itself.
-- Shared primitives that format packages and collaboration need live here: color conversion and management under `@open-pencil/scene-graph/color`, text/layout direction under `@open-pencil/scene-graph/text-direction`, and fractional sibling order keys under `@open-pencil/scene-graph/order-keys` (`packages/scene-graph/tests/order-keys.test.ts`).
+- Shared primitives that format packages and collaboration need live here: color conversion and management under `@open-pencil/scene-graph/color`, text/layout direction under `@open-pencil/scene-graph/text/direction`, and fractional sibling order keys under `@open-pencil/scene-graph/order-keys` (`packages/scene-graph/tests/order-keys.test.ts`).
- A text's list items, and spacing a paragraph sets for itself over the text's (`paragraphSpacingAt`), are one `TextParagraphStyle` per paragraph in `textParagraphs`; `@open-pencil/scene-graph/text` numbers them (`textListItems`) and keeps the styles aligned through edits (`paragraphStylesAfterEdit`, `paragraphStylesInRange`), so the renderer, `.fig`, the Figma API, and exporters never count markers or split paragraphs themselves (`packages/scene-graph/tests/text/lists.test.ts`).
- A node's per-axis sizing (Figma's `layoutSizingHorizontal`/`Vertical`) is read and written through `packages/scene-graph/src/layout/sizing.ts`. Fill is stored on the child as Figma stores it, `layoutGrow` along the parent's primary axis (a grid's is horizontal) and `layoutAlignSelf: 'STRETCH'` across it; `primaryAxisSizing`/`counterAxisSizing` only fix or hug. Layout, the Figma API, the properties panel, and exporters call it instead of mapping axes themselves (`tests/engine/figma/api/layout/sizing.test.ts`).
- 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`).
@@ -24,7 +26,7 @@ Framework-neutral document model. Owns node types, primitives, geometry, matrice
- A layer's `status` stays stored wherever the layer moves, as Figma keeps it; whether it shows, and whether one may be set, come from `effectiveStatus` and `statusPlacement` in `packages/scene-graph/src/statuses/node.ts`, which the Figma API, `.fig` and the UI share. Copies start without one (`packages/core/tests/figma-api/dev-status.test.ts`).
- 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.
+- Node types (`SceneNode`, `Effect`, `Fill`, `Stroke`) come from the root entry and primitives (`Color`, `Vector`, `Rect`) from `@open-pencil/scene-graph/primitives`; 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`).
- `Stroke` extends `Fill`, so a stroke is a paint plus its geometry; add a paint field to `Fill` and both get it, and copy it in `copyFill`, which `copyStroke` reuses (`packages/scene-graph/src/copy.ts`).
diff --git a/packages/scene-graph/package.json b/packages/scene-graph/package.json
index 1c721e3dc..4ff187d0b 100644
--- a/packages/scene-graph/package.json
+++ b/packages/scene-graph/package.json
@@ -16,6 +16,9 @@
"sideEffects": false,
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
+ "imports": {
+ "#scene-graph/*": "./src/*.ts"
+ },
"exports": {
".": {
"types": "./dist/index.d.ts",
@@ -29,59 +32,131 @@
"import": "./dist/arrow-caps.js",
"default": "./dist/arrow-caps.js"
},
+ "./asset-keys": {
+ "types": "./dist/asset-keys.d.ts",
+ "bun": "./src/asset-keys.ts",
+ "import": "./dist/asset-keys.js",
+ "default": "./dist/asset-keys.js"
+ },
+ "./behaviours": {
+ "types": "./dist/behaviours/index.d.ts",
+ "bun": "./src/behaviours/index.ts",
+ "import": "./dist/behaviours/index.js",
+ "default": "./dist/behaviours/index.js"
+ },
+ "./checkpoint": {
+ "types": "./dist/checkpoint.d.ts",
+ "bun": "./src/checkpoint.ts",
+ "import": "./dist/checkpoint.js",
+ "default": "./dist/checkpoint.js"
+ },
+ "./color": {
+ "types": "./dist/color/index.d.ts",
+ "bun": "./src/color/index.ts",
+ "import": "./dist/color/index.js",
+ "default": "./dist/color/index.js"
+ },
+ "./comments": {
+ "types": "./dist/comments/index.d.ts",
+ "bun": "./src/comments/index.ts",
+ "import": "./dist/comments/index.js",
+ "default": "./dist/comments/index.js"
+ },
+ "./components": {
+ "types": "./dist/components/index.d.ts",
+ "bun": "./src/components/index.ts",
+ "import": "./dist/components/index.js",
+ "default": "./dist/components/index.js"
+ },
+ "./connectors": {
+ "types": "./dist/connectors/index.d.ts",
+ "bun": "./src/connectors/index.ts",
+ "import": "./dist/connectors/index.js",
+ "default": "./dist/connectors/index.js"
+ },
+ "./constants": {
+ "types": "./dist/constants.d.ts",
+ "bun": "./src/constants.ts",
+ "import": "./dist/constants.js",
+ "default": "./dist/constants.js"
+ },
+ "./coordinate": {
+ "types": "./dist/coordinate.d.ts",
+ "bun": "./src/coordinate.ts",
+ "import": "./dist/coordinate.js",
+ "default": "./dist/coordinate.js"
+ },
"./copy": {
"types": "./dist/copy.d.ts",
"bun": "./src/copy.ts",
"import": "./dist/copy.js",
"default": "./dist/copy.js"
},
- "./node-defaults": {
- "types": "./dist/node-defaults.d.ts",
- "bun": "./src/node-defaults.ts",
- "import": "./dist/node-defaults.js",
- "default": "./dist/node-defaults.js"
- },
- "./instances": {
- "types": "./dist/instances.d.ts",
- "bun": "./src/instances.ts",
- "import": "./dist/instances.js",
- "default": "./dist/instances.js"
- },
- "./snap": {
- "types": "./dist/snap.d.ts",
- "bun": "./src/snap.ts",
- "import": "./dist/snap.js",
- "default": "./dist/snap.js"
- },
- "./source-metadata": {
- "types": "./dist/source-metadata.d.ts",
- "bun": "./src/source-metadata.ts",
- "import": "./dist/source-metadata.js",
- "default": "./dist/source-metadata.js"
- },
- "./undo": {
- "types": "./dist/undo.d.ts",
- "bun": "./src/undo.ts",
- "import": "./dist/undo.js",
- "default": "./dist/undo.js"
+ "./css": {
+ "types": "./dist/css/index.d.ts",
+ "bun": "./src/css/index.ts",
+ "import": "./dist/css/index.js",
+ "default": "./dist/css/index.js"
+ },
+ "./export-format": {
+ "types": "./dist/export-format.d.ts",
+ "bun": "./src/export-format.ts",
+ "import": "./dist/export-format.js",
+ "default": "./dist/export-format.js"
+ },
+ "./export-scale": {
+ "types": "./dist/export-scale.d.ts",
+ "bun": "./src/export-scale.ts",
+ "import": "./dist/export-scale.js",
+ "default": "./dist/export-scale.js"
+ },
+ "./fields": {
+ "types": "./dist/fields/index.d.ts",
+ "bun": "./src/fields/index.ts",
+ "import": "./dist/fields/index.js",
+ "default": "./dist/fields/index.js"
+ },
+ "./fig-compression": {
+ "types": "./dist/fig-compression.d.ts",
+ "bun": "./src/fig-compression.ts",
+ "import": "./dist/fig-compression.js",
+ "default": "./dist/fig-compression.js"
+ },
+ "./figjam": {
+ "types": "./dist/figjam/index.d.ts",
+ "bun": "./src/figjam/index.ts",
+ "import": "./dist/figjam/index.js",
+ "default": "./dist/figjam/index.js"
+ },
+ "./font-style": {
+ "types": "./dist/font-style.d.ts",
+ "bun": "./src/font-style.ts",
+ "import": "./dist/font-style.js",
+ "default": "./dist/font-style.js"
+ },
+ "./generated": {
+ "types": "./dist/generated/index.d.ts",
+ "bun": "./src/generated/index.ts",
+ "import": "./dist/generated/index.js",
+ "default": "./dist/generated/index.js"
},
- "./variant-name": {
- "types": "./dist/variant-name.d.ts",
- "bun": "./src/variant-name.ts",
- "import": "./dist/variant-name.js",
- "default": "./dist/variant-name.js"
+ "./geometry": {
+ "types": "./dist/geometry.d.ts",
+ "bun": "./src/geometry.ts",
+ "import": "./dist/geometry.js",
+ "default": "./dist/geometry.js"
},
- "./variant-properties": {
- "types": "./dist/variant-properties.d.ts",
- "bun": "./src/variant-properties.ts",
- "import": "./dist/variant-properties.js",
- "default": "./dist/variant-properties.js"
+ "./gradient": {
+ "types": "./dist/gradient.d.ts",
+ "bun": "./src/gradient.ts",
+ "import": "./dist/gradient.js",
+ "default": "./dist/gradient.js"
},
- "./vector-network": {
- "types": "./dist/vector-network.d.ts",
- "bun": "./src/vector-network.ts",
- "import": "./dist/vector-network.js",
- "default": "./dist/vector-network.js"
+ "./group-bounds": {
+ "types": "./dist/group-bounds.d.ts",
+ "bun": "./src/group-bounds.ts",
+ "import": "./dist/group-bounds.js",
+ "default": "./dist/group-bounds.js"
},
"./guides": {
"types": "./dist/guides.d.ts",
@@ -89,59 +164,17 @@
"import": "./dist/guides.js",
"default": "./dist/guides.js"
},
- "./layout": {
- "types": "./dist/layout.d.ts",
- "bun": "./src/layout/index.ts",
- "import": "./dist/layout.js",
- "default": "./dist/layout.js"
- },
- "./text": {
- "types": "./dist/text.d.ts",
- "bun": "./src/text/index.ts",
- "import": "./dist/text.js",
- "default": "./dist/text.js"
- },
- "./types": {
- "types": "./dist/types.d.ts",
- "bun": "./src/types.ts",
- "import": "./dist/types.js",
- "default": "./dist/types.js"
- },
- "./primitives": {
- "types": "./dist/primitives.d.ts",
- "bun": "./src/primitives.ts",
- "import": "./dist/primitives.js",
- "default": "./dist/primitives.js"
- },
- "./constants": {
- "types": "./dist/constants.d.ts",
- "bun": "./src/constants.ts",
- "import": "./dist/constants.js",
- "default": "./dist/constants.js"
- },
"./hit-test": {
"types": "./dist/hit-test.d.ts",
"bun": "./src/hit-test.ts",
"import": "./dist/hit-test.js",
"default": "./dist/hit-test.js"
},
- "./preview": {
- "types": "./dist/preview.d.ts",
- "bun": "./src/preview.ts",
- "import": "./dist/preview.js",
- "default": "./dist/preview.js"
- },
- "./text-picture": {
- "types": "./dist/text-picture.d.ts",
- "bun": "./src/text/picture.ts",
- "import": "./dist/text-picture.js",
- "default": "./dist/text-picture.js"
- },
- "./variables": {
- "types": "./dist/variables.d.ts",
- "bun": "./src/variables.ts",
- "import": "./dist/variables.js",
- "default": "./dist/variables.js"
+ "./icons": {
+ "types": "./dist/icons/index.d.ts",
+ "bun": "./src/icons/index.ts",
+ "import": "./dist/icons/index.js",
+ "default": "./dist/icons/index.js"
},
"./images": {
"types": "./dist/images.d.ts",
@@ -149,11 +182,23 @@
"import": "./dist/images.js",
"default": "./dist/images.js"
},
- "./coordinate": {
- "types": "./dist/coordinate.d.ts",
- "bun": "./src/coordinate.ts",
- "import": "./dist/coordinate.js",
- "default": "./dist/coordinate.js"
+ "./instances": {
+ "types": "./dist/instances/index.d.ts",
+ "bun": "./src/instances/index.ts",
+ "import": "./dist/instances/index.js",
+ "default": "./dist/instances/index.js"
+ },
+ "./instances/overrides": {
+ "types": "./dist/instances/overrides.d.ts",
+ "bun": "./src/instances/overrides.ts",
+ "import": "./dist/instances/overrides.js",
+ "default": "./dist/instances/overrides.js"
+ },
+ "./layout": {
+ "types": "./dist/layout/index.d.ts",
+ "bun": "./src/layout/index.ts",
+ "import": "./dist/layout/index.js",
+ "default": "./dist/layout/index.js"
},
"./matrix": {
"types": "./dist/matrix.d.ts",
@@ -161,11 +206,35 @@
"import": "./dist/matrix.js",
"default": "./dist/matrix.js"
},
- "./geometry": {
- "types": "./dist/geometry.d.ts",
- "bun": "./src/geometry.ts",
- "import": "./dist/geometry.js",
- "default": "./dist/geometry.js"
+ "./mutation-impact": {
+ "types": "./dist/mutation-impact.d.ts",
+ "bun": "./src/mutation-impact.ts",
+ "import": "./dist/mutation-impact.js",
+ "default": "./dist/mutation-impact.js"
+ },
+ "./node-defaults": {
+ "types": "./dist/node-defaults.d.ts",
+ "bun": "./src/node-defaults.ts",
+ "import": "./dist/node-defaults.js",
+ "default": "./dist/node-defaults.js"
+ },
+ "./order-keys": {
+ "types": "./dist/order-keys.d.ts",
+ "bun": "./src/order-keys.ts",
+ "import": "./dist/order-keys.js",
+ "default": "./dist/order-keys.js"
+ },
+ "./parse-path": {
+ "types": "./dist/parse-path.d.ts",
+ "bun": "./src/parse-path.ts",
+ "import": "./dist/parse-path.js",
+ "default": "./dist/parse-path.js"
+ },
+ "./plugin-data": {
+ "types": "./dist/plugin-data/index.d.ts",
+ "bun": "./src/plugin-data/index.ts",
+ "import": "./dist/plugin-data/index.js",
+ "default": "./dist/plugin-data/index.js"
},
"./polygon": {
"types": "./dist/polygon.d.ts",
@@ -173,11 +242,23 @@
"import": "./dist/polygon.js",
"default": "./dist/polygon.js"
},
- "./shape-with-text": {
- "types": "./dist/shape-with-text.d.ts",
- "bun": "./src/shape-with-text/index.ts",
- "import": "./dist/shape-with-text.js",
- "default": "./dist/shape-with-text.js"
+ "./preview": {
+ "types": "./dist/preview.d.ts",
+ "bun": "./src/preview.ts",
+ "import": "./dist/preview.js",
+ "default": "./dist/preview.js"
+ },
+ "./primitives": {
+ "types": "./dist/primitives.d.ts",
+ "bun": "./src/primitives.ts",
+ "import": "./dist/primitives.js",
+ "default": "./dist/primitives.js"
+ },
+ "./random": {
+ "types": "./dist/random.d.ts",
+ "bun": "./src/random.ts",
+ "import": "./dist/random.js",
+ "default": "./dist/random.js"
},
"./resize": {
"types": "./dist/resize.d.ts",
@@ -185,47 +266,107 @@
"import": "./dist/resize.js",
"default": "./dist/resize.js"
},
- "./gradient": {
- "types": "./dist/gradient.d.ts",
- "bun": "./src/gradient.ts",
- "import": "./dist/gradient.js",
- "default": "./dist/gradient.js"
+ "./scaling": {
+ "types": "./dist/scaling/index.d.ts",
+ "bun": "./src/scaling/index.ts",
+ "import": "./dist/scaling/index.js",
+ "default": "./dist/scaling/index.js"
},
- "./random": {
- "types": "./dist/random.d.ts",
- "bun": "./src/random.ts",
- "import": "./dist/random.js",
- "default": "./dist/random.js"
+ "./shaders": {
+ "types": "./dist/shaders/index.d.ts",
+ "bun": "./src/shaders/index.ts",
+ "import": "./dist/shaders/index.js",
+ "default": "./dist/shaders/index.js"
},
- "./order-keys": {
- "types": "./dist/order-keys.d.ts",
- "bun": "./src/order-keys.ts",
- "import": "./dist/order-keys.js",
- "default": "./dist/order-keys.js"
+ "./shape-with-text": {
+ "types": "./dist/shape-with-text/index.d.ts",
+ "bun": "./src/shape-with-text/index.ts",
+ "import": "./dist/shape-with-text/index.js",
+ "default": "./dist/shape-with-text/index.js"
},
- "./parse-path": {
- "types": "./dist/parse-path.d.ts",
- "bun": "./src/parse-path.ts",
- "import": "./dist/parse-path.js",
- "default": "./dist/parse-path.js"
+ "./shared-styles": {
+ "types": "./dist/shared-styles.d.ts",
+ "bun": "./src/shared-styles.ts",
+ "import": "./dist/shared-styles.js",
+ "default": "./dist/shared-styles.js"
},
- "./color": {
- "types": "./dist/color.d.ts",
- "bun": "./src/color/index.ts",
- "import": "./dist/color.js",
- "default": "./dist/color.js"
+ "./slots": {
+ "types": "./dist/slots/index.d.ts",
+ "bun": "./src/slots/index.ts",
+ "import": "./dist/slots/index.js",
+ "default": "./dist/slots/index.js"
},
- "./css": {
- "types": "./dist/css.d.ts",
- "bun": "./src/css/index.ts",
- "import": "./dist/css.js",
- "default": "./dist/css.js"
+ "./snap": {
+ "types": "./dist/snap.d.ts",
+ "bun": "./src/snap.ts",
+ "import": "./dist/snap.js",
+ "default": "./dist/snap.js"
+ },
+ "./source-metadata": {
+ "types": "./dist/source-metadata.d.ts",
+ "bun": "./src/source-metadata.ts",
+ "import": "./dist/source-metadata.js",
+ "default": "./dist/source-metadata.js"
+ },
+ "./statuses": {
+ "types": "./dist/statuses/index.d.ts",
+ "bun": "./src/statuses/index.ts",
+ "import": "./dist/statuses/index.js",
+ "default": "./dist/statuses/index.js"
},
- "./text-direction": {
- "types": "./dist/text-direction.d.ts",
+ "./text": {
+ "types": "./dist/text/index.d.ts",
+ "bun": "./src/text/index.ts",
+ "import": "./dist/text/index.js",
+ "default": "./dist/text/index.js"
+ },
+ "./text/direction": {
+ "types": "./dist/text/direction.d.ts",
"bun": "./src/text/direction.ts",
- "import": "./dist/text-direction.js",
- "default": "./dist/text-direction.js"
+ "import": "./dist/text/direction.js",
+ "default": "./dist/text/direction.js"
+ },
+ "./text/picture": {
+ "types": "./dist/text/picture.d.ts",
+ "bun": "./src/text/picture.ts",
+ "import": "./dist/text/picture.js",
+ "default": "./dist/text/picture.js"
+ },
+ "./transfer": {
+ "types": "./dist/transfer/index.d.ts",
+ "bun": "./src/transfer/index.ts",
+ "import": "./dist/transfer/index.js",
+ "default": "./dist/transfer/index.js"
+ },
+ "./undo": {
+ "types": "./dist/undo.d.ts",
+ "bun": "./src/undo.ts",
+ "import": "./dist/undo.js",
+ "default": "./dist/undo.js"
+ },
+ "./variables": {
+ "types": "./dist/variables/index.d.ts",
+ "bun": "./src/variables/index.ts",
+ "import": "./dist/variables/index.js",
+ "default": "./dist/variables/index.js"
+ },
+ "./variant-name": {
+ "types": "./dist/variant-name.d.ts",
+ "bun": "./src/variant-name.ts",
+ "import": "./dist/variant-name.js",
+ "default": "./dist/variant-name.js"
+ },
+ "./variant-properties": {
+ "types": "./dist/variant-properties.d.ts",
+ "bun": "./src/variant-properties.ts",
+ "import": "./dist/variant-properties.js",
+ "default": "./dist/variant-properties.js"
+ },
+ "./vector-network": {
+ "types": "./dist/vector-network.d.ts",
+ "bun": "./src/vector-network.ts",
+ "import": "./dist/vector-network.js",
+ "default": "./dist/vector-network.js"
}
},
"publishConfig": {
diff --git a/packages/scene-graph/src/behaviours/index.ts b/packages/scene-graph/src/behaviours/index.ts
new file mode 100644
index 000000000..77bfa573a
--- /dev/null
+++ b/packages/scene-graph/src/behaviours/index.ts
@@ -0,0 +1,4 @@
+export * from './kinds'
+export * from './layers'
+export * from './model'
+export * from './spec'
diff --git a/packages/scene-graph/src/behaviours/layers.ts b/packages/scene-graph/src/behaviours/layers.ts
index e0eb3be7e..a4db1e9f7 100644
--- a/packages/scene-graph/src/behaviours/layers.ts
+++ b/packages/scene-graph/src/behaviours/layers.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { SceneNode } from '../types'
import { behaviourOwner, readBehaviour } from './model'
diff --git a/packages/scene-graph/src/behaviours/model.ts b/packages/scene-graph/src/behaviours/model.ts
index 725d95ae4..90a099937 100644
--- a/packages/scene-graph/src/behaviours/model.ts
+++ b/packages/scene-graph/src/behaviours/model.ts
@@ -1,6 +1,6 @@
import { mapValues } from 'es-toolkit'
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import { readPluginData, withPluginData } from '../plugin-data/field'
import { OPEN_PENCIL_PLUGIN_DATA } from '../plugin-data/fields'
import type { ComponentPropertyDefinition, SceneNode } from '../types'
diff --git a/packages/scene-graph/src/behaviours/spec.ts b/packages/scene-graph/src/behaviours/spec.ts
index cf8b876e9..edfab5b99 100644
--- a/packages/scene-graph/src/behaviours/spec.ts
+++ b/packages/scene-graph/src/behaviours/spec.ts
@@ -1,7 +1,7 @@
import { omitBy } from 'es-toolkit/object'
import * as v from 'valibot'
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { ComponentPropertyDefinition, SceneNode } from '../types'
import { BEHAVIOUR_KINDS, behaviourContract, type BehaviourKind } from './kinds'
import {
diff --git a/packages/scene-graph/src/checkpoint.ts b/packages/scene-graph/src/checkpoint.ts
index 4e39eb67e..4315bb65b 100644
--- a/packages/scene-graph/src/checkpoint.ts
+++ b/packages/scene-graph/src/checkpoint.ts
@@ -1,6 +1,6 @@
import { isEqual } from 'es-toolkit'
-import type { SceneGraph } from './index'
+import type { SceneGraph } from './graph'
/** Capture rollback state without changing graph or surviving object identities. */
export function captureGraphCheckpoint(graph: SceneGraph) {
diff --git a/packages/scene-graph/src/comments/document.ts b/packages/scene-graph/src/comments/document.ts
index ea84faa6d..2b7a1a29b 100644
--- a/packages/scene-graph/src/comments/document.ts
+++ b/packages/scene-graph/src/comments/document.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import {
isPluginDataEntry,
readPluginData,
diff --git a/packages/scene-graph/src/comments/index.ts b/packages/scene-graph/src/comments/index.ts
new file mode 100644
index 000000000..9f75a910a
--- /dev/null
+++ b/packages/scene-graph/src/comments/index.ts
@@ -0,0 +1,4 @@
+export * from './document'
+export * from './list'
+export * from './merge'
+export * from './threads'
diff --git a/packages/scene-graph/src/comments/threads.ts b/packages/scene-graph/src/comments/threads.ts
index d1e0bdba2..b66110e21 100644
--- a/packages/scene-graph/src/comments/threads.ts
+++ b/packages/scene-graph/src/comments/threads.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { Color, Vector } from '../primitives'
import { randomHex } from '../random'
import type { CommentReply, CommentThread, SceneNode } from '../types'
diff --git a/packages/scene-graph/src/components/exposure.ts b/packages/scene-graph/src/components/exposure.ts
index 3944c90a2..13fa3a6b0 100644
--- a/packages/scene-graph/src/components/exposure.ts
+++ b/packages/scene-graph/src/components/exposure.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import { instanceMainComponent } from '../instances/main-component'
import { walkInstanceSources } from '../instances/source-walk'
import type { SceneNode } from '../types'
diff --git a/packages/scene-graph/src/components/index.ts b/packages/scene-graph/src/components/index.ts
new file mode 100644
index 000000000..7a045d661
--- /dev/null
+++ b/packages/scene-graph/src/components/index.ts
@@ -0,0 +1,8 @@
+export * from './properties'
+export * from './variants'
+export {
+ exposableInstances,
+ exposedInstances,
+ instanceExposureIssue,
+ type InstanceExposureIssue
+} from './exposure'
diff --git a/packages/scene-graph/src/components/properties.ts b/packages/scene-graph/src/components/properties.ts
index 1e1396ff1..f001fa91e 100644
--- a/packages/scene-graph/src/components/properties.ts
+++ b/packages/scene-graph/src/components/properties.ts
@@ -1,7 +1,7 @@
-import type { SceneGraph } from '../index'
-import { setInstanceOverride } from '../instance-overrides'
+import type { SceneGraph } from '../graph'
import { findInstanceAncestor } from '../instances'
import { instanceMainComponent } from '../instances/main-component'
+import { setInstanceOverride } from '../instances/overrides'
import { walkInstanceSources } from '../instances/source-walk'
import { randomHex } from '../random'
import type {
diff --git a/packages/scene-graph/src/components/variants.ts b/packages/scene-graph/src/components/variants.ts
index c85c51a07..55a6447b3 100644
--- a/packages/scene-graph/src/components/variants.ts
+++ b/packages/scene-graph/src/components/variants.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { SceneNode } from '../types'
/** Variants in reading order on the canvas: top to bottom, then left to right, then by name. */
diff --git a/packages/scene-graph/src/connectors/create.ts b/packages/scene-graph/src/connectors/create.ts
index 1d27ed027..698fa60c7 100644
--- a/packages/scene-graph/src/connectors/create.ts
+++ b/packages/scene-graph/src/connectors/create.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { ConnectorEndpoint, ConnectorLineType, SceneNode, StrokeCap } from '../types'
import { layoutConnector } from './layout'
import { buildConnectorSublayers } from './sublayers'
diff --git a/packages/scene-graph/src/connectors/hit.ts b/packages/scene-graph/src/connectors/hit.ts
index 67a2c0c13..8d8fec2b9 100644
--- a/packages/scene-graph/src/connectors/hit.ts
+++ b/packages/scene-graph/src/connectors/hit.ts
@@ -1,5 +1,5 @@
import { getWorldMatrix } from '../coordinate'
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import Matrix from '../matrix'
import type { Vector } from '../primitives'
import type { SceneNode } from '../types'
diff --git a/packages/scene-graph/src/connectors/layout.ts b/packages/scene-graph/src/connectors/layout.ts
index c01c53b5d..63b4afd7d 100644
--- a/packages/scene-graph/src/connectors/layout.ts
+++ b/packages/scene-graph/src/connectors/layout.ts
@@ -2,7 +2,7 @@ import { compact, isEqual, pick } from 'es-toolkit'
import { getAxisAlignedBoundsInParent, getParentWorldMatrix, getWorldMatrix } from '../coordinate'
import { computeBounds } from '../geometry'
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import Matrix from '../matrix'
import type { Vector } from '../primitives'
import type { ConnectorEndpoint, SceneNode, StrokeCap } from '../types'
diff --git a/packages/scene-graph/src/connectors/sublayers.ts b/packages/scene-graph/src/connectors/sublayers.ts
index 8016b8e44..f8f8790fe 100644
--- a/packages/scene-graph/src/connectors/sublayers.ts
+++ b/packages/scene-graph/src/connectors/sublayers.ts
@@ -1,6 +1,6 @@
import { BLACK } from '../constants'
import type { GeneratedFrameKind } from '../generated/kind'
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { Color, Vector } from '../primitives'
import type { ConnectorEndpoint, Fill, SceneNode, Stroke, VectorNetwork } from '../types'
diff --git a/packages/scene-graph/src/coordinate.ts b/packages/scene-graph/src/coordinate.ts
index 7330e1dde..be25f4a11 100644
--- a/packages/scene-graph/src/coordinate.ts
+++ b/packages/scene-graph/src/coordinate.ts
@@ -1,7 +1,8 @@
-import type { SceneGraph, SceneNode } from './index'
+import type { SceneGraph } from './graph'
import Matrix, { type Mat3 } from './matrix'
import { FITTED_CONTAINER_TYPES } from './node-defaults'
import type { Rect, Vector } from './primitives'
+import type { SceneNode } from './types'
export function getWorldMatrix(node: SceneNode, graph: Pick<SceneGraph, 'getNode'>): Mat3 {
const chain: SceneNode[] = []
diff --git a/packages/scene-graph/src/copy.ts b/packages/scene-graph/src/copy.ts
index 1a5c75a07..54328a5db 100644
--- a/packages/scene-graph/src/copy.ts
+++ b/packages/scene-graph/src/copy.ts
@@ -8,6 +8,9 @@
* no shared references between source and copy.
*/
+import { geometryCommandCoordCount } from './geometry'
+import { cloneInstanceOverrideState } from './instances/overrides'
+import { createDefaultSourceMetadata } from './node-defaults'
import type {
ArcData,
ComponentPropertyDefinition,
@@ -21,10 +24,7 @@ import type {
SceneNode,
Stroke,
StyleRun
-} from './'
-import { geometryCommandCoordCount } from './geometry'
-import { cloneInstanceOverrideState } from './instance-overrides'
-import { createDefaultSourceMetadata } from './node-defaults'
+} from './types'
import { cloneVectorNetwork } from './vector-network'
// --- Individual copy functions ---
diff --git a/packages/scene-graph/src/fields/index.ts b/packages/scene-graph/src/fields/index.ts
new file mode 100644
index 000000000..8938f4cef
--- /dev/null
+++ b/packages/scene-graph/src/fields/index.ts
@@ -0,0 +1,4 @@
+export * from './appearance'
+export * from './geometry'
+export * from './layout'
+export * from './text'
diff --git a/packages/scene-graph/src/fields/layout.ts b/packages/scene-graph/src/fields/layout.ts
index ef85cea80..2b58dda5a 100644
--- a/packages/scene-graph/src/fields/layout.ts
+++ b/packages/scene-graph/src/fields/layout.ts
@@ -1,4 +1,5 @@
import type { SceneNode } from '../types'
+import { SIZE_FIELDS, TRANSFORM_FIELDS } from './geometry'
/** How a frame lays out its children: auto layout and its grid tracks. */
export const AUTO_LAYOUT_FIELDS = [
@@ -31,3 +32,17 @@ export const SIZE_CONSTRAINT_FIELDS = [
'maxHeight',
'targetAspectRatio'
] as const satisfies readonly (keyof SceneNode)[]
+
+/** Fields whose change moves a layer or its children, so cached absolute positions go stale. */
+export const LAYOUT_AFFECTING_KEYS: ReadonlySet<string> = new Set([
+ ...TRANSFORM_FIELDS,
+ ...SIZE_FIELDS,
+ ...AUTO_LAYOUT_FIELDS,
+ 'layoutPositioning',
+ 'layoutGrow',
+ 'layoutAlignSelf',
+ 'horizontalConstraint',
+ 'verticalConstraint',
+ 'gridPosition',
+ ...SIZE_CONSTRAINT_FIELDS
+])
diff --git a/packages/scene-graph/src/generated/index.ts b/packages/scene-graph/src/generated/index.ts
index 6cc9c5e58..3b90aebe6 100644
--- a/packages/scene-graph/src/generated/index.ts
+++ b/packages/scene-graph/src/generated/index.ts
@@ -1,5 +1,5 @@
import { CONNECTOR_KIND } from '../connectors/sublayers'
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { NodeType, SceneNode } from '../types'
import type { GeneratedFrameKind } from './kind'
import { SHAPE_WITH_TEXT_KIND } from './shape-with-text'
diff --git a/packages/scene-graph/src/generated/kind.ts b/packages/scene-graph/src/generated/kind.ts
index 2e9afb40a..47b0c8db6 100644
--- a/packages/scene-graph/src/generated/kind.ts
+++ b/packages/scene-graph/src/generated/kind.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { SceneNode } from '../types'
/**
diff --git a/packages/scene-graph/src/generated/sticky.ts b/packages/scene-graph/src/generated/sticky.ts
index 20e7f99b2..5221da321 100644
--- a/packages/scene-graph/src/generated/sticky.ts
+++ b/packages/scene-graph/src/generated/sticky.ts
@@ -1,5 +1,5 @@
import { BLACK } from '../constants'
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { Color } from '../primitives'
import type { Effect, Fill, SceneNode } from '../types'
import type { GeneratedFrameKind } from './kind'
diff --git a/packages/scene-graph/src/geometry.ts b/packages/scene-graph/src/geometry.ts
index 6bda46047..771088c01 100644
--- a/packages/scene-graph/src/geometry.ts
+++ b/packages/scene-graph/src/geometry.ts
@@ -1,6 +1,6 @@
import { arrowCapOverflow } from './arrow-caps'
-import type { Effect, Stroke, StrokeCap, StrokeJoin, VectorNetwork } from './index'
import type { Rect, Vector } from './primitives'
+import type { Effect, Stroke, StrokeCap, StrokeJoin, VectorNetwork } from './types'
export function degToRad(degrees: number): number {
return (degrees * Math.PI) / 180
diff --git a/packages/scene-graph/src/graph.ts b/packages/scene-graph/src/graph.ts
new file mode 100644
index 000000000..1cedb5444
--- /dev/null
+++ b/packages/scene-graph/src/graph.ts
@@ -0,0 +1,804 @@
+/* eslint-disable max-lines -- SceneGraph is the facade over the domain modules */
+import { omitBy } from 'es-toolkit/object'
+import { isUndefined } from 'es-toolkit/predicate'
+
+import { removeStaleBindings } from './bindings'
+import { BufferedSceneEmitter } from './buffered-events'
+import {
+ getAbsolutePosition,
+ getNodeLocalMatrix,
+ getParentWorldMatrix,
+ isTranslationOnly,
+ localTransformFromWorld
+} from './coordinate'
+import { cloneNodeProps, type NodeCloneMode } from './copy'
+import { bindNodeEvents } from './events'
+import { LAYOUT_AFFECTING_KEYS } from './fields/layout'
+import { withGeneratedFrameSize } from './generated'
+import * as HitTest from './hit-test'
+import { generateId } from './ids'
+import * as Instances from './instances'
+import { LayoutWrites } from './layout/writes'
+import Matrix from './matrix'
+import { CONTAINER_TYPES, createDefaultNode } from './node-defaults'
+import { updateNodePreview, type NodePreviewObserver } from './preview'
+import type { Color, Rect, Vector } from './primitives'
+import { styleDetachmentChanges } from './shared-styles'
+import { markSourceFieldsEdited } from './source-metadata'
+import { invalidateTextCaches } from './text/picture'
+import type {
+ DocumentColorSpace,
+ EnabledLibraryBinding,
+ NodeChangeObserver,
+ NodeType,
+ SceneGraphEventHandlers,
+ SceneNode,
+ Variable,
+ VariableCollection,
+ VariableType,
+ VariableValue,
+ VariableLiteral
+} from './types'
+import * as Variables from './variables'
+import type { VariableModeFallback } from './variables'
+import { normalizeVectorNetwork } from './vector-network'
+
+/** Scopes that graph methods check while a caller's callback runs; scopes nest. */
+type GraphScope = 'preview' | 'sourceMetadata' | 'importedState' | 'layout' | 'derivedLayout'
+
+export class SceneGraph {
+ nodes = new Map<string, SceneNode>()
+ images = new Map<string, Uint8Array>()
+ variables = new Map<string, Variable>()
+ variableCollections = new Map<string, VariableCollection>()
+ activeMode = new Map<string, string>()
+ rootId: string
+ figKiwiVersion: number | null = null
+ /** Deflated kiwi schema bytes from the original .fig file, preserved for roundtrip fidelity. */
+ figSchemaDeflated: Uint8Array | null = null
+ documentColorSpace: DocumentColorSpace = 'srgb'
+ enabledLibraries = new Map<string, EnabledLibraryBinding>()
+ readonly emitter = new BufferedSceneEmitter()
+ private absPosCache = new Map<string, Vector>()
+ private readonly scopeDepths: Record<GraphScope, number> = {
+ preview: 0,
+ sourceMetadata: 0,
+ importedState: 0,
+ layout: 0,
+ derivedLayout: 0
+ }
+ private previewObservers: NodePreviewObserver[] = []
+ private readonly changeObservers = new Set<NodeChangeObserver>()
+ private importedIdGenerator: (() => string) | undefined
+ private layoutWrites: LayoutWrites | null = null
+ positionPreviewVersion = 0
+ instanceIndex = new Map<string, Set<string>>()
+ /** Every connector in the graph, so routing need not scan every layer. */
+ connectorIds = new Set<string>()
+
+ constructor(private readonly idGenerator: () => string = generateId) {
+ const root = createDefaultNode(this.idGenerator, 'FRAME', {
+ name: 'Document',
+ width: 0,
+ height: 0
+ })
+ this.rootId = root.id
+ this.nodes.set(root.id, root)
+
+ this.addPage('Page 1')
+ }
+ addPage(name: string): SceneNode {
+ return this.createNode('CANVAS', this.rootId, { name, width: 0, height: 0 })
+ }
+
+ getPages(includeInternal = false): SceneNode[] {
+ return this.getChildren(this.rootId).filter(
+ (n) => n.type === 'CANVAS' && (includeInternal || !n.internalOnly)
+ )
+ }
+ getAllNodes(): Iterable<SceneNode> {
+ return this.nodes.values()
+ }
+ getNode(id: string): SceneNode | undefined {
+ return this.nodes.get(id)
+ }
+ onNodeEvents(handlers: SceneGraphEventHandlers): () => void {
+ return bindNodeEvents(this.emitter, handlers)
+ }
+
+ /**
+ * Tells `observer` about each node an edit adds and, before it changes, each node it is about
+ * to change, so a recorder can keep the node as it was. Unlike node events these are never
+ * buffered. Graph methods report the nodes they change; code that writes into a node directly
+ * reports it with `willChangeNode` first.
+ */
+ observeNodeChanges(observer: NodeChangeObserver): () => void {
+ this.changeObservers.add(observer)
+ return () => this.changeObservers.delete(observer)
+ }
+
+ /** Tells `observeNodeChanges` observers that `node` is about to change. */
+ willChangeNode(node: SceneNode | undefined): void {
+ if (!node) return
+ for (const observer of this.changeObservers) observer.before(node)
+ }
+
+ countDescendants(nodeId: string): number {
+ const node = this.nodes.get(nodeId)
+ if (!node) return 0
+ let count = 0
+ const stack = [...node.childIds]
+ while (stack.length > 0) {
+ const id = stack.pop()
+ if (id === undefined) break
+ count++
+ const child = this.nodes.get(id)
+ if (child) {
+ for (const childId of child.childIds) {
+ stack.push(childId)
+ }
+ }
+ }
+ return count
+ }
+ addVariable(variable: Variable): void {
+ Variables.addVariable(this, variable)
+ }
+ removeVariable(id: string): void {
+ Variables.removeVariable(this, id)
+ }
+ addCollection(collection: VariableCollection): void {
+ Variables.addCollection(this, collection)
+ }
+ createVariable(
+ name: string,
+ type: VariableType,
+ collectionId: string,
+ value?: VariableValue
+ ): Variable {
+ return Variables.createVariable(
+ this,
+ () => this.generateEntityId(),
+ name,
+ type,
+ collectionId,
+ value
+ )
+ }
+
+ createCollection(name: string): VariableCollection {
+ // The collection and its default mode are both created before either is registered.
+ const issued = new Set<string>()
+ return Variables.createCollection(this, () => this.generateEntityId(issued), name)
+ }
+
+ createMode(collectionId: string, name: string, sourceModeId?: string): string | undefined {
+ return Variables.createMode(
+ this,
+ () => this.generateEntityId(),
+ collectionId,
+ name,
+ sourceModeId
+ )
+ }
+
+ removeCollection(id: string): void {
+ Variables.removeCollection(this, id)
+ }
+
+ getActiveModeId(collectionId: string): string {
+ return Variables.getActiveModeId(this, collectionId)
+ }
+
+ getNodeVariableModeId(nodeId: string, collectionId: string): string {
+ return Variables.getNodeVariableModeId(this, nodeId, collectionId)
+ }
+
+ setActiveMode(collectionId: string, modeId: string): void {
+ Variables.setActiveMode(this, collectionId, modeId)
+ }
+
+ addMode(collectionId: string, modeId: string, name: string, sourceMode?: string): void {
+ Variables.addMode(this, collectionId, modeId, name, sourceMode)
+ }
+
+ removeMode(collectionId: string, modeId: string): void {
+ Variables.removeMode(this, collectionId, modeId)
+ }
+
+ renameMode(collectionId: string, modeId: string, name: string): void {
+ Variables.renameMode(this, collectionId, modeId, name)
+ }
+
+ setDefaultMode(collectionId: string, modeId: string): void {
+ Variables.setDefaultMode(this, collectionId, modeId)
+ }
+
+ resolveVariable(
+ variableId: string,
+ modeId?: string,
+ visited?: Set<string>
+ ): VariableLiteral | undefined {
+ return Variables.resolveVariable(this, variableId, modeId, visited)
+ }
+
+ resolveColorVariable(variableId: string): Color | undefined {
+ return Variables.resolveColorVariable(this, variableId)
+ }
+
+ resolveNumberVariable(variableId: string): number | undefined {
+ return Variables.resolveNumberVariable(this, variableId)
+ }
+
+ resolveColorVariableForNode(
+ nodeId: string,
+ variableId: string,
+ fallback?: VariableModeFallback
+ ): Color | undefined {
+ return Variables.resolveColorVariableForNode(this, nodeId, variableId, fallback)
+ }
+
+ resolveNumberVariableForNode(
+ nodeId: string,
+ variableId: string,
+ fallback?: VariableModeFallback
+ ): number | undefined {
+ return Variables.resolveNumberVariableForNode(this, nodeId, variableId, fallback)
+ }
+
+ resolveVariableForNode(
+ nodeId: string,
+ variableId: string,
+ fallback?: VariableModeFallback
+ ): VariableLiteral | undefined {
+ return Variables.resolveVariableForNode(this, nodeId, variableId, fallback)
+ }
+
+ resolveStringVariableForNode(
+ nodeId: string,
+ variableId: string,
+ fallback?: VariableModeFallback
+ ): string | undefined {
+ return Variables.resolveStringVariableForNode(this, nodeId, variableId, fallback)
+ }
+
+ getVariablesForCollection(collectionId: string): Variable[] {
+ return Variables.getVariablesForCollection(this, collectionId)
+ }
+
+ getVariablesByType(type: VariableType): Variable[] {
+ return Variables.getVariablesByType(this, type)
+ }
+
+ bindVariable(nodeId: string, field: string, variableId: string): void {
+ Variables.bindVariable(this, nodeId, field, variableId)
+ }
+
+ unbindVariable(nodeId: string, field: string): void {
+ Variables.unbindVariable(this, nodeId, field)
+ }
+
+ getChildren(id: string): SceneNode[] {
+ const node = this.nodes.get(id)
+ if (!node) return []
+ return node.childIds
+ .map((cid) => this.nodes.get(cid))
+ .filter((n): n is SceneNode => n !== undefined)
+ }
+
+ isContainer(id: string): boolean {
+ const node = this.nodes.get(id)
+ return node ? CONTAINER_TYPES.has(node.type) : false
+ }
+
+ isDescendant(childId: string, ancestorId: string): boolean {
+ return this.closest(childId, (node) => node.id === ancestorId) !== undefined
+ }
+
+ /**
+ * The node itself or its nearest ancestor that matches. The walk visits at most as many nodes
+ * as the graph holds, so a parent cycle in bad data cannot hang it.
+ */
+ closest(id: string, match: (node: SceneNode) => boolean): SceneNode | undefined {
+ let current = this.nodes.get(id)
+ for (let steps = 0; current && steps < this.nodes.size; steps++) {
+ if (match(current)) return current
+ current = current.parentId ? this.nodes.get(current.parentId) : undefined
+ }
+ return undefined
+ }
+
+ /**
+ * The page a node is on: the node itself for a page, its nearest page ancestor otherwise, and
+ * null for the document root or a node on no page.
+ */
+ pageOf(id: string): string | null {
+ return this.closest(id, (node) => node.type === 'CANVAS')?.id ?? null
+ }
+
+ clearAbsPosCache(): void {
+ this.absPosCache.clear()
+ }
+
+ getAbsolutePosition(id: string): Vector {
+ const cached = this.absPosCache.get(id)
+ if (cached) return cached
+
+ const node = this.getNode(id)
+ if (!node) return { x: 0, y: 0 }
+
+ const result = getAbsolutePosition(node, this)
+ this.absPosCache.set(id, result)
+ return result
+ }
+
+ getAbsoluteBounds(id: string): Rect {
+ const pos = this.getAbsolutePosition(id)
+ const node = this.nodes.get(id)
+ return {
+ x: pos.x,
+ y: pos.y,
+ width: node?.width ?? 0,
+ height: node?.height ?? 0
+ }
+ }
+ /**
+ * An ID no entity uses; `issued` also excludes IDs handed out earlier in the same creation.
+ * A generator that returns more taken IDs than the graph holds must be repeating itself, so
+ * it counts as exhausted then; a fixed cap would reject a sequence walking past a large import.
+ */
+ private generateEntityId(issued?: Set<string>): string {
+ let limit = Infinity
+ for (let attempt = 0; attempt < limit; attempt++) {
+ const id = (this.importedIdGenerator ?? this.idGenerator)()
+ if (this.isEntityIdTaken(id) || issued?.has(id)) {
+ if (limit === Infinity) limit = this.entityIdCount() + (issued?.size ?? 0) + 1
+ continue
+ }
+ issued?.add(id)
+ return id
+ }
+ throw new Error('The ID generator only returned IDs that are in use')
+ }
+ private entityIdCount(): number {
+ let count = this.nodes.size + this.variables.size + this.variableCollections.size
+ for (const collection of this.variableCollections.values()) count += collection.modes.length
+ return count
+ }
+ /** Whether a node, variable, collection, or mode has this id. */
+ isEntityIdTaken(id: string): boolean {
+ if (this.nodes.has(id) || this.variables.has(id) || this.variableCollections.has(id))
+ return true
+ // Callers replace collection maps and edit `modes` in place (history snapshots, transfer,
+ // undo), so an index of mode IDs would go stale; walk them without allocating instead.
+ for (const collection of this.variableCollections.values()) {
+ for (const mode of collection.modes) if (mode.modeId === id) return true
+ }
+ return false
+ }
+ private indexInstance(componentId: string, instanceId: string): void {
+ let set = this.instanceIndex.get(componentId)
+ if (!set) {
+ set = new Set()
+ this.instanceIndex.set(componentId, set)
+ }
+ set.add(instanceId)
+ }
+ private unindexInstance(componentId: string, instanceId: string): void {
+ this.instanceIndex.get(componentId)?.delete(instanceId)
+ }
+ private registerNode(node: SceneNode, parentId: string | null): SceneNode {
+ node.parentId = parentId
+ this.nodes.set(node.id, node)
+ if (node.type === 'CONNECTOR') this.connectorIds.add(node.id)
+ for (const observer of this.changeObservers) observer.created(node)
+ if (node.type === 'INSTANCE' && node.componentId) this.indexInstance(node.componentId, node.id)
+ this.emitter.emit('node:created', node)
+ return node
+ }
+ /** Publish synchronous graph events only after the supplied mutation succeeds. */
+ withBufferedEvents<T>(action: () => T): T {
+ return this.emitter.batch(action)
+ }
+
+ createNode(type: NodeType, parentId: string, overrides: Partial<SceneNode> = {}): SceneNode {
+ const node = createDefaultNode(() => this.generateEntityId(), type, overrides)
+ const parent = this.nodes.get(parentId)
+ this.willChangeNode(parent)
+ parent?.childIds.push(node.id)
+ return this.registerNode(node, parentId)
+ }
+ createNodeWithId(
+ id: string,
+ type: NodeType,
+ parentId: string | null,
+ overrides: Partial<SceneNode> = {}
+ ): SceneNode {
+ const node = createDefaultNode(() => id, type, overrides)
+ // `overrides` may be another node's snapshot, ID included.
+ node.id = id
+ const parent = parentId ? this.nodes.get(parentId) : undefined
+ if (parent && !parent.childIds.includes(id)) {
+ this.willChangeNode(parent)
+ parent.childIds.push(id)
+ }
+ return this.registerNode(node, parentId)
+ }
+
+ private withScope<T>(scope: GraphScope, fn: () => T): T {
+ this.scopeDepths[scope]++
+ try {
+ return fn()
+ } finally {
+ this.scopeDepths[scope]--
+ }
+ }
+
+ runPreviewUpdates(fn: () => void, beforeUpdate?: NodePreviewObserver): void {
+ if (beforeUpdate) this.previewObservers.push(beforeUpdate)
+ try {
+ this.withScope('preview', fn)
+ } finally {
+ if (beforeUpdate) this.previewObservers.pop()
+ }
+ }
+ preserveSourceMetadataDuring<T>(fn: () => T): T {
+ return this.withScope('sourceMetadata', fn)
+ }
+ get isPreservingSourceMetadata(): boolean {
+ return this.scopeDepths.sourceMetadata > 0
+ }
+
+ applyImportedStateDuring<T>(fn: () => T, idGenerator?: () => string): T {
+ const previousGenerator = this.importedIdGenerator
+ this.importedIdGenerator = idGenerator ?? previousGenerator
+ try {
+ return this.withScope('importedState', () => this.preserveSourceMetadataDuring(fn))
+ } finally {
+ this.importedIdGenerator = previousGenerator
+ }
+ }
+
+ get isApplyingImportedState(): boolean {
+ return this.scopeDepths.importedState > 0
+ }
+
+ /**
+ * Lays out what the document already holds: a page as it loads, or again once its fonts
+ * arrive. What this writes derives from the document; an edit's own layout is not this.
+ */
+ applyDerivedLayoutDuring(fn: () => void): void {
+ this.withScope('derivedLayout', fn)
+ }
+
+ get isApplyingDerivedLayout(): boolean {
+ return this.scopeDepths.derivedLayout > 0
+ }
+
+ /**
+ * Runs `fn` as layout. Its updates are published once the outermost layout ends, still as
+ * layout, and without values a pass changed and a later pass put back (`LayoutWrites`).
+ */
+ withLayoutMutations(fn: () => void): void {
+ const outermost = this.scopeDepths.layout === 0
+ this.scopeDepths.layout++
+ if (outermost) this.layoutWrites = new LayoutWrites()
+ try {
+ fn()
+ } finally {
+ try {
+ if (outermost) this.publishLayoutUpdates()
+ } finally {
+ this.scopeDepths.layout--
+ }
+ }
+ }
+
+ private publishLayoutUpdates(): void {
+ const writes = this.layoutWrites
+ this.layoutWrites = null
+ if (!writes) return
+ for (const [id, changes] of writes.updates((nodeId) => this.nodes.get(nodeId))) {
+ this.emitter.emit('node:updated', id, changes)
+ }
+ }
+ get isApplyingLayout(): boolean {
+ return this.scopeDepths.layout > 0
+ }
+ updateNodePositionPreview(id: string, x: number, y: number): void {
+ this.updateNodePreview(id, { x, y })
+ }
+ updateNodePreview(id: string, changes: Partial<SceneNode>): void {
+ const node = this.nodes.get(id)
+ if (node) changes = this.sizedChanges(node, changes)
+ const appliedChanges = updateNodePreview(this, id, changes, (node, applied) => {
+ for (const observe of this.previewObservers) observe(node, applied)
+ })
+ if (appliedChanges) this.emitter.emit('node:previewUpdated', id, appliedChanges)
+ }
+
+ updateNode(id: string, changes: Partial<SceneNode>): void {
+ if (this.scopeDepths.preview > 0) {
+ this.updateNodePreview(id, changes)
+ return
+ }
+
+ const node = this.nodes.get(id)
+ if (!node) return
+ const defined = omitBy(changes, isUndefined)
+ const detached = omitBy(styleDetachmentChanges(node, defined), isUndefined)
+ this.applyNodeChanges(node, this.sizedChanges(node, detached))
+ }
+
+ /** A size set from outside layout, with what it also sets on a generated frame. */
+ private sizedChanges(node: SceneNode, changes: Partial<SceneNode>): Partial<SceneNode> {
+ return this.isApplyingLayout ? changes : withGeneratedFrameSize(node, changes)
+ }
+
+ /** Replay captured properties without dropping explicit undefined values or absent keys. */
+ restoreNodeProperties(
+ id: string,
+ changes: Partial<SceneNode>,
+ absent: readonly (keyof SceneNode)[]
+ ): void {
+ const node = this.nodes.get(id)
+ if (node) this.applyNodeChanges(node, changes, absent)
+ }
+
+ private applyNodeChanges(
+ node: SceneNode,
+ changes: Partial<SceneNode>,
+ absent: readonly (keyof SceneNode)[] = []
+ ): void {
+ const { id } = node
+ this.willChangeNode(node)
+ // Include removed keys in cache invalidation and update notifications.
+ if (absent.length) {
+ changes = { ...changes }
+ for (const key of absent) Reflect.set(changes, key, undefined)
+ }
+
+ // Only clear absPosCache when layout-affecting properties change.
+ // Fills, strokes, effects, plugin data changes do NOT affect absolute position.
+ const affectsLayout = Object.keys(changes).some((k) => LAYOUT_AFFECTING_KEYS.has(k))
+ if (affectsLayout) this.absPosCache.clear()
+ if (
+ node.type === 'INSTANCE' &&
+ 'componentId' in changes &&
+ changes.componentId !== node.componentId
+ ) {
+ if (node.componentId) this.unindexInstance(node.componentId, id)
+ if (changes.componentId) this.indexInstance(changes.componentId, id)
+ }
+ if (node.type === 'TEXT') invalidateTextCaches(node, changes)
+ if (this.scopeDepths.sourceMetadata === 0 && !this.isApplyingLayout) {
+ markSourceFieldsEdited(node, Object.keys(changes))
+ }
+ if (changes.vectorNetwork) {
+ changes = { ...changes, vectorNetwork: normalizeVectorNetwork(changes.vectorNetwork) }
+ }
+ this.layoutWrites?.record(node, changes)
+ Object.assign(node, changes)
+ if (changes.fills) removeStaleBindings(node, 'fills', changes)
+ if (changes.strokes) removeStaleBindings(node, 'strokes', changes)
+ for (const key of absent) Reflect.deleteProperty(node, key)
+ this.publishNodeUpdate(id, changes)
+ }
+
+ /** Publishes an update now, or leaves it to the running layout, which publishes once it ends. */
+ private publishNodeUpdate(id: string, changes: Partial<SceneNode>): void {
+ if (!this.layoutWrites) this.emitter.emit('node:updated', id, changes)
+ }
+
+ reparentNode(nodeId: string, newParentId: string): void {
+ const node = this.nodes.get(nodeId)
+ if (!node || nodeId === this.rootId) return
+ if (this.isDescendant(newParentId, nodeId)) return
+
+ const oldParent = node.parentId ? this.nodes.get(node.parentId) : undefined
+ const newParent = this.nodes.get(newParentId)
+ if (!newParent) return
+ if (node.parentId === newParentId) return
+
+ const oldParentId = node.parentId
+ this.willChangeNode(node)
+ this.willChangeNode(oldParent)
+ this.willChangeNode(newParent)
+ this.absPosCache.clear()
+
+ const oldParentWorld = getParentWorldMatrix(oldParent, this)
+ const newParentWorld = getParentWorldMatrix(newParent, this)
+
+ if (oldParent) {
+ oldParent.childIds = oldParent.childIds.filter((cid) => cid !== nodeId)
+ }
+
+ node.parentId = newParentId
+ newParent.childIds.push(nodeId)
+
+ if (isTranslationOnly(oldParentWorld) && isTranslationOnly(newParentWorld)) {
+ node.x += oldParentWorld[2] - newParentWorld[2]
+ node.y += oldParentWorld[5] - newParentWorld[5]
+ } else {
+ const world = Matrix.multiply(oldParentWorld, getNodeLocalMatrix(node))
+ const local = localTransformFromWorld(node, world, newParentWorld)
+ if (local) Object.assign(node, local)
+ }
+
+ this.emitter.emit('node:reparented', nodeId, oldParentId, newParentId)
+ }
+
+ /**
+ * Moves a node to `index` among `parentId`'s children, from wherever it was, without changing
+ * its own coordinates. An index past the end appends; a move into the node itself or one of
+ * its descendants is ignored.
+ */
+ insertChildAt(childId: string, parentId: string, index: number): void {
+ const node = this.nodes.get(childId)
+ const newParent = this.nodes.get(parentId)
+ if (!node || !newParent || this.isDescendant(parentId, childId)) return
+ const previousParentId = node.parentId
+ const oldParent = previousParentId ? this.nodes.get(previousParentId) : undefined
+ this.willChangeNode(node)
+ this.willChangeNode(oldParent)
+ this.willChangeNode(newParent)
+ if (oldParent) {
+ oldParent.childIds = oldParent.childIds.filter((id) => id !== childId)
+ }
+ newParent.childIds = newParent.childIds.filter((id) => id !== childId)
+ const at = Math.min(index, newParent.childIds.length)
+ newParent.childIds.splice(at, 0, childId)
+ node.parentId = parentId
+ this.absPosCache.clear()
+ this.emitter.emit('node:reordered', childId, parentId, at, previousParentId)
+ }
+
+ deleteNode(id: string): void {
+ const node = this.nodes.get(id)
+ if (!node || id === this.rootId) return
+ this.willChangeNode(node)
+
+ if (node.parentId) {
+ const parent = this.nodes.get(node.parentId)
+ this.willChangeNode(parent)
+ if (parent) {
+ parent.childIds = parent.childIds.filter((cid) => cid !== id)
+ }
+ }
+
+ for (const childId of Array.from(node.childIds)) {
+ this.deleteNode(childId)
+ }
+
+ if (node.type === 'INSTANCE' && node.componentId) this.unindexInstance(node.componentId, id)
+ this.connectorIds.delete(id)
+ this.nodes.delete(id)
+ this.emitter.emit('node:deleted', id, node.parentId)
+ }
+
+ hitTest(px: number, py: number, scopeId?: string): SceneNode | null {
+ return HitTest.hitTest(this, px, py, scopeId)
+ }
+
+ /** `pad`, in canvas units, grows each shape's box, as Figma takes clicks just outside one. */
+ hitTestDeep(px: number, py: number, scopeId?: string, pad = 0): SceneNode | null {
+ return HitTest.hitTestDeep(this, px, py, scopeId, pad)
+ }
+
+ hitTestSelectable(
+ px: number,
+ py: number,
+ scopeId: string,
+ selectedIds: ReadonlySet<string>,
+ pad = 0
+ ): SceneNode | null {
+ return HitTest.hitTestSelectable(this, px, py, scopeId, selectedIds, pad)
+ }
+
+ hitTestOpenContainer(px: number, py: number, scopeId: string): SceneNode | null {
+ return HitTest.hitTestOpenContainer(this, px, py, scopeId)
+ }
+
+ isOpenContainer(nodeId: string): boolean {
+ return HitTest.isOpenContainer(this, nodeId)
+ }
+
+ isPointInNode(nodeId: string, px: number, py: number): boolean {
+ return HitTest.isPointInNode(this, nodeId, px, py)
+ }
+
+ hitTestDropTarget(
+ px: number,
+ py: number,
+ excludeIds: ReadonlySet<string>,
+ scopeId?: string,
+ options?: HitTest.DropTargetOptions
+ ): SceneNode | null {
+ return HitTest.hitTestDropTarget(this, px, py, excludeIds, scopeId, options)
+ }
+
+ cloneTree(
+ sourceId: string,
+ parentId: string,
+ overrides: Partial<SceneNode> = {}
+ ): SceneNode | null {
+ const src = this.nodes.get(sourceId)
+ if (!src) return null
+
+ const props = cloneNodeProps(src, null)
+ // Null out Figma source identifiers so the clone is treated as local.
+ if (props.source) props.source = { ...props.source, id: null, orderKey: null }
+ // A copy is a new design nobody has reviewed: Figma's duplicate and clone() drop the status.
+ props.status = null
+ const clone = this.createNode(src.type, parentId, { ...props, ...overrides })
+ if (src.status) markSourceFieldsEdited(clone, ['status'])
+
+ for (const childId of src.childIds) {
+ this.cloneTree(childId, clone.id)
+ }
+
+ return clone
+ }
+
+ createInstance(
+ componentId: string,
+ parentId: string,
+ overrides: Partial<SceneNode> = {}
+ ): SceneNode | null {
+ return Instances.createInstance(this, componentId, parentId, overrides)
+ }
+
+ populateInstanceChildren(
+ instanceId: string,
+ componentId: string,
+ mode: NodeCloneMode = 'deep'
+ ): void {
+ Instances.populateInstanceChildren(this, instanceId, componentId, mode)
+ }
+
+ swapInstanceComponent(
+ instanceId: string,
+ componentId: string,
+ options?: Instances.SwapInstanceOptions
+ ): void {
+ Instances.swapInstanceComponent(this, instanceId, componentId, options)
+ }
+
+ syncInstances(componentId: string): void {
+ Instances.syncInstances(this, componentId)
+ }
+
+ syncInstancesTogether(componentIds: Iterable<string>): void {
+ Instances.syncInstancesTogether(this, componentIds)
+ }
+
+ syncInstance(instanceId: string): void {
+ Instances.syncInstance(this, instanceId)
+ }
+
+ detachInstance(instanceId: string): void {
+ Instances.detachInstance(this, instanceId)
+ }
+
+ getMainComponent(instanceId: string): SceneNode | undefined {
+ return Instances.getMainComponent(this, instanceId)
+ }
+
+ getInstances(componentId: string): SceneNode[] {
+ return Instances.getInstances(this, componentId)
+ }
+
+ flattenTree(parentId?: string, depth = 0): Array<{ node: SceneNode; depth: number }> {
+ const id = parentId ?? this.rootId
+ const parent = this.nodes.get(id)
+ if (!parent) return []
+ const result: Array<{ node: SceneNode; depth: number }> = []
+ for (const childId of parent.childIds) {
+ const child = this.nodes.get(childId)
+ if (!child) continue
+ result.push({ node: child, depth })
+ if (child.childIds.length > 0) result.push(...this.flattenTree(childId, depth + 1))
+ }
+ return result
+ }
+}
diff --git a/packages/scene-graph/src/group-bounds.ts b/packages/scene-graph/src/group-bounds.ts
index aedfd46d6..652a0a8f6 100644
--- a/packages/scene-graph/src/group-bounds.ts
+++ b/packages/scene-graph/src/group-bounds.ts
@@ -1,5 +1,5 @@
import { getAxisAlignedBoundsInParent } from './coordinate'
-import type { SceneGraph } from './index'
+import type { SceneGraph } from './graph'
import { FITTED_CONTAINER_TYPES } from './node-defaults'
import type { Rect } from './primitives'
import type { SceneNode } from './types'
diff --git a/packages/scene-graph/src/guides.ts b/packages/scene-graph/src/guides.ts
index 38da530bc..0f5cf58b0 100644
--- a/packages/scene-graph/src/guides.ts
+++ b/packages/scene-graph/src/guides.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from './index'
+import type { SceneGraph } from './graph'
import type { GUID } from './primitives'
import type { SceneNode } from './types'
diff --git a/packages/scene-graph/src/hit-test.ts b/packages/scene-graph/src/hit-test.ts
index 0e487bb44..2ba950871 100644
--- a/packages/scene-graph/src/hit-test.ts
+++ b/packages/scene-graph/src/hit-test.ts
@@ -1,7 +1,8 @@
-import type { SceneGraph, SceneNode, NodeType } from './'
import { hitsConnectorLine } from './connectors/hit'
import { getWorldMatrix } from './coordinate'
+import type { SceneGraph } from './graph'
import Matrix from './matrix'
+import type { SceneNode, NodeType } from './types'
const CONTAINER_TYPES = new Set<NodeType>([
'CANVAS',
diff --git a/packages/scene-graph/src/icons/index.ts b/packages/scene-graph/src/icons/index.ts
new file mode 100644
index 000000000..029c9fd27
--- /dev/null
+++ b/packages/scene-graph/src/icons/index.ts
@@ -0,0 +1,3 @@
+export * from './glyph'
+export * from './model'
+export * from './schema'
diff --git a/packages/scene-graph/src/ids.ts b/packages/scene-graph/src/ids.ts
new file mode 100644
index 000000000..4db5fc6c9
--- /dev/null
+++ b/packages/scene-graph/src/ids.ts
@@ -0,0 +1,34 @@
+import { randomIndex } from './random'
+
+/** Figma reads both parts of a GUID as signed 32-bit integers and drops records beyond them. */
+const MAX_ID_SESSION = 0x7fffffff
+
+/** Sessions 0 and 1 hold FIG's document and internal-resource records and counter GUIDs. */
+const FIRST_RANDOM_SESSION = 2
+
+/** A random session, as Yjs picks each document's `clientID`, so processes never share IDs. */
+function randomIdSession(): number {
+ return FIRST_RANDOM_SESSION + randomIndex(MAX_ID_SESSION - FIRST_RANDOM_SESSION + 1)
+}
+
+let idSession = randomIdSession()
+let nextLocalID = 1
+
+/**
+ * Sets the session part of the IDs this process mints, as in Figma's `sessionID:localID` GUIDs.
+ * Every process starts in a random session, so layers that the editor, the CLI, or MCP add to
+ * copies of one file never share IDs. Tests and fixtures that need the same IDs on every run
+ * set a fixed session or give the graph its own generator. Returns the previous session.
+ */
+export function setIdSession(sessionId: number): number {
+ if (!Number.isInteger(sessionId) || sessionId < 0 || sessionId > MAX_ID_SESSION) {
+ throw new RangeError('sessionId must be a non-negative 31-bit integer')
+ }
+ const previous = idSession
+ idSession = sessionId
+ return previous
+}
+
+export function generateId(): string {
+ return `${idSession}:${nextLocalID++}`
+}
diff --git a/packages/scene-graph/src/index.ts b/packages/scene-graph/src/index.ts
index 110090696..90f326a93 100644
--- a/packages/scene-graph/src/index.ts
+++ b/packages/scene-graph/src/index.ts
@@ -1,1023 +1,4 @@
-/* eslint-disable max-lines -- SceneGraph exposes a stable facade over domain modules */
-export * from './mutation-impact'
-export * from './variables/bindings'
-export * from './variables/text'
-export type { VariableModeFallback } from './variables'
-export { modesDefaultFirst } from './variables'
-export * from './variables/token'
-export * from './variables/value'
-export * from './variables/formula'
-export * from './variables/formula/schema'
-export * from './variables/schema'
-export * from './plugin-data/field'
-export * from './plugin-data/fields'
-export { rescaleNodeTree, scaleNodeChanges } from './scaling'
-import { TRANSFORM_FIELDS, SIZE_FIELDS } from './fields/geometry'
-export { TRANSFORM_FIELDS, SIZE_FIELDS } from './fields/geometry'
-import { AUTO_LAYOUT_FIELDS, SIZE_CONSTRAINT_FIELDS } from './fields/layout'
-export { AUTO_LAYOUT_FIELDS, SIZE_CONSTRAINT_FIELDS } from './fields/layout'
-export { CORNER_FIELDS, PAINT_FIELDS, STROKE_FIELDS } from './fields/appearance'
-export {
- TEXT_METRIC_FIELDS,
- TEXT_SHAPING_FIELDS,
- TEXT_LAYOUT_FIELDS,
- TEXT_DECORATION_FIELDS,
- TEXT_STYLE_FIELDS
-} from './fields/text'
-export * from './transfer'
-export * from './instance-overrides'
-export * from './asset-keys'
-export * from './images'
-export * from './components/properties'
-export * from './components/variants'
-export * from './slots/frames'
-export { instanceMainComponent } from './instances/main-component'
-export { canCreateInstance, createsComponentCycle, cycleSafeParent } from './instances/cycles'
-export {
- exposableInstances,
- exposedInstances,
- instanceExposureIssue,
- type InstanceExposureIssue
-} from './components/exposure'
-export * from './slots/content'
-export * from './slots/authoring'
-export * from './slots/limits'
-export * from './connectors'
-export * from './figjam'
-export * from './generated'
-export * from './behaviours/kinds'
-export * from './icons/schema'
-export * from './icons/model'
-export * from './icons/glyph'
-export * from './shaders/schema'
-export * from './shaders/model'
-export * from './shaders/still'
-export * from './behaviours/layers'
-export * from './behaviours/model'
-export * from './behaviours/spec'
-export * from './comments/document'
-export * from './comments/list'
-export * from './comments/merge'
-export * from './comments/threads'
-export * from './statuses/impact'
-export * from './statuses/node'
-export * from './statuses/schema'
-export * from './statuses/workflow'
-export * from './copy'
-export {
- createDefaultNode,
- defaultStrokeAlign,
- FITTED_CONTAINER_TYPES,
- newStrokeGeometry,
- SIDE_STROKE_TYPES
-} from './node-defaults'
-export {
- copyInstanceComponentProps,
- findInstanceAncestor,
- hasInstanceOverride,
- INSTANCE_FOLLOWED_FIELDS,
- INSTANCE_OVERRIDE_FIELDS,
- INSTANCE_SYNC_FIELDS,
- INSTANCE_SYNC_PROPS,
- INSTANCE_SYNC_TEXT_PROPS,
- recordInstanceOverride
-} from './instances'
-export {
- clearInstanceOverrides,
- cloneInstanceOverrideState,
- forEachInstanceOverride,
- getInstanceOverride,
- setInstanceOverride,
- type InstanceOverrideState
-} from './instance-overrides'
-export * from './snap'
-export * from './export-format'
-export * from './export-scale'
-export * from './fig-compression'
-export * from './coordinate'
-export * from './layout'
-export * from './text'
-export * from './group-bounds'
-export * from './constants'
-export * from './geometry'
-export * from './guides'
-export * from './font-style'
-export * from './shared-styles'
-export { default as TransformMatrix } from './matrix'
-export type { Mat3 } from './matrix'
-export { DEFAULT_HISTORY_LIMIT, UndoManager, type UndoEntry, type UndoManagerOptions } from './undo'
-
-import { removeStaleBindings } from './bindings'
export { CommittedGraphEventError } from './buffered-events'
-import { BufferedSceneEmitter } from './buffered-events'
-import { cloneNodeProps } from './copy'
-import { bindNodeEvents } from './events'
-import { withGeneratedFrameSize } from './generated'
-import * as HitTest from './hit-test'
-export type { DropTargetOptions } from './hit-test'
-import * as Instances from './instances'
-import { LayoutWrites } from './layout/writes'
-import Matrix, { type Mat3 } from './matrix'
-import { CONTAINER_TYPES, createDefaultNode } from './node-defaults'
-import { updateNodePreview, type NodePreviewObserver } from './preview'
-import { randomIndex } from './random'
-import { styleDetachmentChanges } from './shared-styles'
-import { markSourceFieldsEdited } from './source-metadata'
-import { GLYPH_AFFECTING_KEYS, invalidateTextCaches, TEXT_PICTURE_KEYS } from './text/picture'
-import * as Variables from './variables'
-import type { VariableModeFallback } from './variables'
-import { normalizeVectorNetwork } from './vector-network'
-
-export type { GUID, Color, Size, Vector } from './primitives'
+export { SceneGraph } from './graph'
+export { generateId, setIdSession } from './ids'
export * from './types'
-
-import {
- getAbsolutePosition,
- getNodeLocalMatrix,
- getParentWorldMatrix,
- isTranslationOnly,
- localTransformFromWorld
-} from './coordinate'
-import type { Color, Rect, Vector } from './primitives'
-import type {
- DocumentColorSpace,
- EnabledLibraryBinding,
- NodeType,
- NodeChangeObserver,
- SceneGraphEventHandlers,
- SceneNode,
- SourceMetadata,
- Variable,
- VariableCollection,
- VariableType,
- VariableValue,
- VariableLiteral
-} from './types'
-
-export {
- cloneVectorNetwork,
- mergeVectorNetworks,
- normalizeVectorNetwork,
- transformVectorNetwork,
- validateVectorNetwork,
- vectorNetworksEqual
-} from './vector-network'
-
-/** Figma reads both parts of a GUID as signed 32-bit integers and drops records beyond them. */
-const MAX_ID_SESSION = 0x7fffffff
-
-/** Sessions 0 and 1 hold FIG's document and internal-resource records and counter GUIDs. */
-const FIRST_RANDOM_SESSION = 2
-
-/** A random session, as Yjs picks each document's `clientID`, so processes never share IDs. */
-function randomIdSession(): number {
- return FIRST_RANDOM_SESSION + randomIndex(MAX_ID_SESSION - FIRST_RANDOM_SESSION + 1)
-}
-
-let idSession = randomIdSession()
-let nextLocalID = 1
-
-/**
- * Sets the session part of the IDs this process mints, as in Figma's `sessionID:localID` GUIDs.
- * Every process starts in a random session, so layers that the editor, the CLI, or MCP add to
- * copies of one file never share IDs. Tests and fixtures that need the same IDs on every run
- * set a fixed session or give the graph its own generator. Returns the previous session.
- */
-export function setIdSession(sessionId: number): number {
- if (!Number.isInteger(sessionId) || sessionId < 0 || sessionId > MAX_ID_SESSION) {
- throw new RangeError('sessionId must be a non-negative 31-bit integer')
- }
- const previous = idSession
- idSession = sessionId
- return previous
-}
-
-export function generateId(): string {
- return `${idSession}:${nextLocalID++}`
-}
-
-function stripUndefinedProps<T extends object>(obj: T): T {
- const result = {} as T
- for (const key of Object.keys(obj) as (keyof T)[]) {
- const val = obj[key]
- if (val !== undefined) {
- result[key] = val
- }
- }
- return result
-}
-
-export { captureGraphCheckpoint } from './checkpoint'
-
-export class SceneGraph {
- nodes = new Map<string, SceneNode>()
- images = new Map<string, Uint8Array>()
- variables = new Map<string, Variable>()
- variableCollections = new Map<string, VariableCollection>()
- activeMode = new Map<string, string>()
- rootId: string
- figKiwiVersion: number | null = null
- /** Deflated kiwi schema bytes from the original .fig file, preserved for roundtrip fidelity. */
- figSchemaDeflated: Uint8Array | null = null
- documentColorSpace: DocumentColorSpace = 'srgb'
- enabledLibraries = new Map<string, EnabledLibraryBinding>()
- readonly emitter = new BufferedSceneEmitter()
- private absPosCache = new Map<string, Vector>()
- private previewMutationDepth = 0
- private previewObservers: NodePreviewObserver[] = []
- private readonly changeObservers = new Set<NodeChangeObserver>()
- private sourceMetadataPreservationDepth = 0
- private importedStateApplicationDepth = 0
- private importedIdGenerator: (() => string) | undefined
- private layoutMutationDepth = 0
- private layoutWrites: LayoutWrites | null = null
- private derivedLayoutDepth = 0
- positionPreviewVersion = 0
- instanceIndex = new Map<string, Set<string>>()
- /** Every connector in the graph, so routing need not scan every layer. */
- connectorIds = new Set<string>()
-
- constructor(private readonly idGenerator: () => string = generateId) {
- const root = createDefaultNode(this.idGenerator, 'FRAME', {
- name: 'Document',
- width: 0,
- height: 0
- })
- this.rootId = root.id
- this.nodes.set(root.id, root)
-
- this.addPage('Page 1')
- }
- addPage(name: string): SceneNode {
- return this.createNode('CANVAS', this.rootId, { name, width: 0, height: 0 })
- }
-
- getPages(includeInternal = false): SceneNode[] {
- return this.getChildren(this.rootId).filter(
- (n) => n.type === 'CANVAS' && (includeInternal || !n.internalOnly)
- )
- }
- getAllNodes(): Iterable<SceneNode> {
- return this.nodes.values()
- }
- getNode(id: string): SceneNode | undefined {
- return this.nodes.get(id)
- }
- onNodeEvents(handlers: SceneGraphEventHandlers): () => void {
- return bindNodeEvents(this.emitter, handlers)
- }
-
- /**
- * Tells `observer` about each node an edit adds and, before it changes, each node it is about
- * to change, so a recorder can keep the node as it was. Unlike node events these are never
- * buffered. Graph methods report the nodes they change; code that writes into a node directly
- * reports it with `willChangeNode` first.
- */
- observeNodeChanges(observer: NodeChangeObserver): () => void {
- this.changeObservers.add(observer)
- return () => this.changeObservers.delete(observer)
- }
-
- /** Tells `observeNodeChanges` observers that `node` is about to change. */
- willChangeNode(node: SceneNode | undefined): void {
- if (!node) return
- for (const observer of this.changeObservers) observer.before(node)
- }
-
- countDescendants(nodeId: string): number {
- const node = this.nodes.get(nodeId)
- if (!node) return 0
- let count = 0
- const stack = [...node.childIds]
- while (stack.length > 0) {
- const id = stack.pop()
- if (id === undefined) break
- count++
- const child = this.nodes.get(id)
- if (child) {
- for (const childId of child.childIds) {
- stack.push(childId)
- }
- }
- }
- return count
- }
- addVariable(variable: Variable): void {
- Variables.addVariable(this, variable)
- }
- removeVariable(id: string): void {
- Variables.removeVariable(this, id)
- }
- addCollection(collection: VariableCollection): void {
- Variables.addCollection(this, collection)
- }
- createVariable(
- name: string,
- type: VariableType,
- collectionId: string,
- value?: VariableValue
- ): Variable {
- return Variables.createVariable(
- this,
- () => this.generateEntityId(),
- name,
- type,
- collectionId,
- value
- )
- }
-
- createCollection(name: string): VariableCollection {
- // The collection and its default mode are both created before either is registered.
- const issued = new Set<string>()
- return Variables.createCollection(this, () => this.generateEntityId(issued), name)
- }
-
- createMode(collectionId: string, name: string, sourceModeId?: string): string | undefined {
- return Variables.createMode(
- this,
- () => this.generateEntityId(),
- collectionId,
- name,
- sourceModeId
- )
- }
-
- removeCollection(id: string): void {
- Variables.removeCollection(this, id)
- }
-
- getActiveModeId(collectionId: string): string {
- return Variables.getActiveModeId(this, collectionId)
- }
-
- getNodeVariableModeId(nodeId: string, collectionId: string): string {
- return Variables.getNodeVariableModeId(this, nodeId, collectionId)
- }
-
- setActiveMode(collectionId: string, modeId: string): void {
- Variables.setActiveMode(this, collectionId, modeId)
- }
-
- addMode(collectionId: string, modeId: string, name: string, sourceMode?: string): void {
- Variables.addMode(this, collectionId, modeId, name, sourceMode)
- }
-
- removeMode(collectionId: string, modeId: string): void {
- Variables.removeMode(this, collectionId, modeId)
- }
-
- renameMode(collectionId: string, modeId: string, name: string): void {
- Variables.renameMode(this, collectionId, modeId, name)
- }
-
- setDefaultMode(collectionId: string, modeId: string): void {
- Variables.setDefaultMode(this, collectionId, modeId)
- }
-
- resolveVariable(
- variableId: string,
- modeId?: string,
- visited?: Set<string>
- ): VariableLiteral | undefined {
- return Variables.resolveVariable(this, variableId, modeId, visited)
- }
-
- resolveColorVariable(variableId: string): Color | undefined {
- return Variables.resolveColorVariable(this, variableId)
- }
-
- resolveNumberVariable(variableId: string): number | undefined {
- return Variables.resolveNumberVariable(this, variableId)
- }
-
- resolveColorVariableForNode(
- nodeId: string,
- variableId: string,
- fallback?: VariableModeFallback
- ): Color | undefined {
- return Variables.resolveColorVariableForNode(this, nodeId, variableId, fallback)
- }
-
- resolveNumberVariableForNode(
- nodeId: string,
- variableId: string,
- fallback?: VariableModeFallback
- ): number | undefined {
- return Variables.resolveNumberVariableForNode(this, nodeId, variableId, fallback)
- }
-
- resolveVariableForNode(
- nodeId: string,
- variableId: string,
- fallback?: VariableModeFallback
- ): VariableLiteral | undefined {
- return Variables.resolveVariableForNode(this, nodeId, variableId, fallback)
- }
-
- resolveStringVariableForNode(
- nodeId: string,
- variableId: string,
- fallback?: VariableModeFallback
- ): string | undefined {
- return Variables.resolveStringVariableForNode(this, nodeId, variableId, fallback)
- }
-
- getVariablesForCollection(collectionId: string): Variable[] {
- return Variables.getVariablesForCollection(this, collectionId)
- }
-
- getVariablesByType(type: VariableType): Variable[] {
- return Variables.getVariablesByType(this, type)
- }
-
- bindVariable(nodeId: string, field: string, variableId: string): void {
- Variables.bindVariable(this, nodeId, field, variableId)
- }
-
- unbindVariable(nodeId: string, field: string): void {
- Variables.unbindVariable(this, nodeId, field)
- }
-
- getChildren(id: string): SceneNode[] {
- const node = this.nodes.get(id)
- if (!node) return []
- return node.childIds
- .map((cid) => this.nodes.get(cid))
- .filter((n): n is SceneNode => n !== undefined)
- }
-
- isContainer(id: string): boolean {
- const node = this.nodes.get(id)
- return node ? CONTAINER_TYPES.has(node.type) : false
- }
-
- isDescendant(childId: string, ancestorId: string): boolean {
- return this.closest(childId, (node) => node.id === ancestorId) !== undefined
- }
-
- /**
- * The node itself or its nearest ancestor that matches. The walk visits at most as many nodes
- * as the graph holds, so a parent cycle in bad data cannot hang it.
- */
- closest(id: string, match: (node: SceneNode) => boolean): SceneNode | undefined {
- let current = this.nodes.get(id)
- for (let steps = 0; current && steps < this.nodes.size; steps++) {
- if (match(current)) return current
- current = current.parentId ? this.nodes.get(current.parentId) : undefined
- }
- return undefined
- }
-
- /**
- * The page a node is on: the node itself for a page, its nearest page ancestor otherwise, and
- * null for the document root or a node on no page.
- */
- pageOf(id: string): string | null {
- return this.closest(id, (node) => node.type === 'CANVAS')?.id ?? null
- }
-
- clearAbsPosCache(): void {
- this.absPosCache.clear()
- }
-
- getAbsolutePosition(id: string): Vector {
- const cached = this.absPosCache.get(id)
- if (cached) return cached
-
- const node = this.getNode(id)
- if (!node) return { x: 0, y: 0 }
-
- const result = getAbsolutePosition(node, this)
- this.absPosCache.set(id, result)
- return result
- }
-
- getAbsoluteBounds(id: string): Rect {
- const pos = this.getAbsolutePosition(id)
- const node = this.nodes.get(id)
- return {
- x: pos.x,
- y: pos.y,
- width: node?.width ?? 0,
- height: node?.height ?? 0
- }
- }
- /**
- * An ID no entity uses; `issued` also excludes IDs handed out earlier in the same creation.
- * A generator that returns more taken IDs than the graph holds must be repeating itself, so
- * it counts as exhausted then; a fixed cap would reject a sequence walking past a large import.
- */
- private generateEntityId(issued?: Set<string>): string {
- let limit = Infinity
- for (let attempt = 0; attempt < limit; attempt++) {
- const id = (this.importedIdGenerator ?? this.idGenerator)()
- if (this.isEntityIdTaken(id) || issued?.has(id)) {
- if (limit === Infinity) limit = this.entityIdCount() + (issued?.size ?? 0) + 1
- continue
- }
- issued?.add(id)
- return id
- }
- throw new Error('The ID generator only returned IDs that are in use')
- }
- private entityIdCount(): number {
- let count = this.nodes.size + this.variables.size + this.variableCollections.size
- for (const collection of this.variableCollections.values()) count += collection.modes.length
- return count
- }
- /** Whether a node, variable, collection, or mode has this id. */
- isEntityIdTaken(id: string): boolean {
- if (this.nodes.has(id) || this.variables.has(id) || this.variableCollections.has(id))
- return true
- // Callers replace collection maps and edit `modes` in place (history snapshots, transfer,
- // undo), so an index of mode IDs would go stale; walk them without allocating instead.
- for (const collection of this.variableCollections.values()) {
- for (const mode of collection.modes) if (mode.modeId === id) return true
- }
- return false
- }
- private registerNode(node: SceneNode, parentId: string | null): SceneNode {
- node.parentId = parentId
- this.nodes.set(node.id, node)
- if (node.type === 'CONNECTOR') this.connectorIds.add(node.id)
- for (const observer of this.changeObservers) observer.created(node)
- if (node.type === 'INSTANCE' && node.componentId) {
- let set = this.instanceIndex.get(node.componentId)
- if (!set) {
- set = new Set()
- this.instanceIndex.set(node.componentId, set)
- }
- set.add(node.id)
- }
- this.emitter.emit('node:created', node)
- return node
- }
- /** Publish synchronous graph events only after the supplied mutation succeeds. */
- withBufferedEvents<T>(action: () => T): T {
- return this.emitter.batch(action)
- }
-
- createNode(type: NodeType, parentId: string, overrides: Partial<SceneNode> = {}): SceneNode {
- const node = createDefaultNode(() => this.generateEntityId(), type, overrides)
- const parent = this.nodes.get(parentId)
- this.willChangeNode(parent)
- parent?.childIds.push(node.id)
- return this.registerNode(node, parentId)
- }
- createNodeWithId(
- id: string,
- type: NodeType,
- parentId: string | null,
- overrides: Partial<SceneNode> = {}
- ): SceneNode {
- const node = createDefaultNode(() => id, type, overrides)
- node.id = id
- const parent = parentId ? this.nodes.get(parentId) : undefined
- if (parent && !parent.childIds.includes(id)) {
- this.willChangeNode(parent)
- parent.childIds.push(id)
- }
- return this.registerNode(node, parentId)
- }
-
- static TEXT_PICTURE_KEYS: ReadonlySet<string> = TEXT_PICTURE_KEYS
- static GLYPH_AFFECTING_KEYS: ReadonlySet<string> = GLYPH_AFFECTING_KEYS
-
- static LAYOUT_AFFECTING_KEYS: ReadonlySet<string> = new Set([
- ...TRANSFORM_FIELDS,
- ...SIZE_FIELDS,
- ...AUTO_LAYOUT_FIELDS,
- 'layoutPositioning',
- 'layoutGrow',
- 'layoutAlignSelf',
- 'horizontalConstraint',
- 'verticalConstraint',
- 'gridPosition',
- ...SIZE_CONSTRAINT_FIELDS
- ])
-
- runPreviewUpdates(fn: () => void, beforeUpdate?: NodePreviewObserver): void {
- this.previewMutationDepth++
- if (beforeUpdate) this.previewObservers.push(beforeUpdate)
- try {
- fn()
- } finally {
- if (beforeUpdate) this.previewObservers.pop()
- this.previewMutationDepth--
- }
- }
- preserveSourceMetadataDuring<T>(fn: () => T): T {
- this.sourceMetadataPreservationDepth++
- try {
- return fn()
- } finally {
- this.sourceMetadataPreservationDepth--
- }
- }
- get isPreservingSourceMetadata(): boolean {
- return this.sourceMetadataPreservationDepth > 0
- }
-
- applyImportedStateDuring<T>(fn: () => T, idGenerator?: () => string): T {
- const previousGenerator = this.importedIdGenerator
- this.importedIdGenerator = idGenerator ?? previousGenerator
- this.importedStateApplicationDepth++
- try {
- return this.preserveSourceMetadataDuring(fn)
- } finally {
- this.importedStateApplicationDepth--
- this.importedIdGenerator = previousGenerator
- }
- }
-
- get isApplyingImportedState(): boolean {
- return this.importedStateApplicationDepth > 0
- }
-
- /**
- * Lays out what the document already holds: a page as it loads, or again once its fonts
- * arrive. What this writes derives from the document; an edit's own layout is not this.
- */
- applyDerivedLayoutDuring(fn: () => void): void {
- this.derivedLayoutDepth++
- try {
- fn()
- } finally {
- this.derivedLayoutDepth--
- }
- }
-
- get isApplyingDerivedLayout(): boolean {
- return this.derivedLayoutDepth > 0
- }
-
- /**
- * Runs `fn` as layout. Its updates are published once the outermost layout ends, still as
- * layout, and without values a pass changed and a later pass put back (`LayoutWrites`).
- */
- withLayoutMutations(fn: () => void): void {
- const outermost = this.layoutMutationDepth === 0
- this.layoutMutationDepth++
- if (outermost) this.layoutWrites = new LayoutWrites()
- try {
- fn()
- } finally {
- try {
- if (outermost) this.publishLayoutUpdates()
- } finally {
- this.layoutMutationDepth--
- }
- }
- }
-
- private publishLayoutUpdates(): void {
- const writes = this.layoutWrites
- this.layoutWrites = null
- if (!writes) return
- for (const [id, changes] of writes.updates((nodeId) => this.nodes.get(nodeId))) {
- this.emitter.emit('node:updated', id, changes)
- }
- }
- get isApplyingLayout(): boolean {
- return this.layoutMutationDepth > 0
- }
- updateNodePositionPreview(id: string, x: number, y: number): void {
- this.updateNodePreview(id, { x, y })
- }
- updateNodePreview(id: string, changes: Partial<SceneNode>): void {
- const node = this.nodes.get(id)
- if (node) changes = this.sizedChanges(node, changes)
- const appliedChanges = updateNodePreview(this, id, changes, (node, applied) => {
- for (const observe of this.previewObservers) observe(node, applied)
- })
- if (appliedChanges) this.emitter.emit('node:previewUpdated', id, appliedChanges)
- }
-
- updateNode(id: string, changes: Partial<SceneNode>): void {
- if (this.previewMutationDepth > 0) {
- this.updateNodePreview(id, changes)
- return
- }
-
- const node = this.nodes.get(id)
- if (!node) return
- changes = stripUndefinedProps(styleDetachmentChanges(node, stripUndefinedProps(changes)))
- this.applyNodeChanges(node, this.sizedChanges(node, changes))
- }
-
- /** A size set from outside layout, with what it also sets on a generated frame. */
- private sizedChanges(node: SceneNode, changes: Partial<SceneNode>): Partial<SceneNode> {
- return this.isApplyingLayout ? changes : withGeneratedFrameSize(node, changes)
- }
-
- /** Replay captured properties without dropping explicit undefined values or absent keys. */
- restoreNodeProperties(
- id: string,
- changes: Partial<SceneNode>,
- absent: readonly (keyof SceneNode)[]
- ): void {
- const node = this.nodes.get(id)
- if (node) this.applyNodeChanges(node, changes, absent)
- }
-
- private applyNodeChanges(
- node: SceneNode,
- changes: Partial<SceneNode>,
- absent: readonly (keyof SceneNode)[] = []
- ): void {
- const { id } = node
- this.willChangeNode(node)
- // Include removed keys in cache invalidation and update notifications.
- if (absent.length) {
- changes = { ...changes }
- for (const key of absent) Reflect.set(changes, key, undefined)
- }
-
- // Only clear absPosCache when layout-affecting properties change.
- // Fills, strokes, effects, plugin data changes do NOT affect absolute position.
- const affectsLayout = Object.keys(changes).some((k) => SceneGraph.LAYOUT_AFFECTING_KEYS.has(k))
- if (affectsLayout) this.absPosCache.clear()
- if (
- node.type === 'INSTANCE' &&
- 'componentId' in changes &&
- changes.componentId !== node.componentId
- ) {
- if (node.componentId) this.instanceIndex.get(node.componentId)?.delete(id)
- if (changes.componentId) {
- let set = this.instanceIndex.get(changes.componentId)
- if (!set) {
- set = new Set()
- this.instanceIndex.set(changes.componentId, set)
- }
- set.add(id)
- }
- }
- if (node.type === 'TEXT') invalidateTextCaches(node, changes)
- if (this.sourceMetadataPreservationDepth === 0 && !this.isApplyingLayout) {
- markSourceFieldsEdited(node, Object.keys(changes))
- }
- if (changes.vectorNetwork) {
- changes = { ...changes, vectorNetwork: normalizeVectorNetwork(changes.vectorNetwork) }
- }
- this.layoutWrites?.record(node, changes)
- Object.assign(node, changes)
- if (changes.fills) removeStaleBindings(node, 'fills', changes)
- if (changes.strokes) removeStaleBindings(node, 'strokes', changes)
- for (const key of absent) Reflect.deleteProperty(node, key)
- this.publishNodeUpdate(id, changes)
- }
-
- /** Publishes an update now, or leaves it to the running layout, which publishes once it ends. */
- private publishNodeUpdate(id: string, changes: Partial<SceneNode>): void {
- if (!this.layoutWrites) this.emitter.emit('node:updated', id, changes)
- }
-
- reparentNode(nodeId: string, newParentId: string): void {
- const node = this.nodes.get(nodeId)
- if (!node || nodeId === this.rootId) return
- if (this.isDescendant(newParentId, nodeId)) return
-
- const oldParent = node.parentId ? this.nodes.get(node.parentId) : undefined
- const newParent = this.nodes.get(newParentId)
- if (!newParent) return
- if (node.parentId === newParentId) return
-
- const oldParentId = node.parentId
- this.willChangeNode(node)
- this.willChangeNode(oldParent)
- this.willChangeNode(newParent)
- this.absPosCache.clear()
-
- const oldParentWorld = this.parentWorldMatrix(oldParent)
- const newParentWorld = this.parentWorldMatrix(newParent)
-
- if (oldParent) {
- oldParent.childIds = oldParent.childIds.filter((cid) => cid !== nodeId)
- }
-
- node.parentId = newParentId
- newParent.childIds.push(nodeId)
-
- if (isTranslationOnly(oldParentWorld) && isTranslationOnly(newParentWorld)) {
- node.x += oldParentWorld[2] - newParentWorld[2]
- node.y += oldParentWorld[5] - newParentWorld[5]
- } else {
- const world = Matrix.multiply(oldParentWorld, getNodeLocalMatrix(node))
- const local = localTransformFromWorld(node, world, newParentWorld)
- if (local) Object.assign(node, local)
- }
-
- this.emitter.emit('node:reparented', nodeId, oldParentId, newParentId)
- }
-
- private parentWorldMatrix(parent: SceneNode | undefined): Mat3 {
- return getParentWorldMatrix(parent, this)
- }
-
- reorderChild(nodeId: string, parentId: string, insertIndex: number): void {
- const node = this.nodes.get(nodeId)
- if (!node) return
-
- const previousParentId = node.parentId
- const oldParent = previousParentId ? this.nodes.get(previousParentId) : undefined
- const newParent = this.nodes.get(parentId)
- if (!newParent || this.isDescendant(parentId, nodeId)) return
- this.willChangeNode(node)
- this.willChangeNode(oldParent)
- this.willChangeNode(newParent)
-
- // Remove from old parent
- if (oldParent) {
- oldParent.childIds = oldParent.childIds.filter((cid) => cid !== nodeId)
- }
-
- // If same parent, adjust index since we removed the item
- let idx = insertIndex
- if (
- oldParent === newParent &&
- idx > (!oldParent.childIds.includes(nodeId) ? idx : oldParent.childIds.length)
- ) {
- // Already removed above, no adjustment needed
- }
-
- node.parentId = parentId
- this.absPosCache.clear()
- idx = Math.min(idx, newParent.childIds.length)
- newParent.childIds.splice(idx, 0, nodeId)
-
- this.emitter.emit('node:reordered', nodeId, parentId, idx, previousParentId)
- }
-
- insertChildAt(childId: string, parentId: string, index: number): void {
- const node = this.getNode(childId)
- const newParent = this.getNode(parentId)
- if (!node || !newParent || childId === parentId || this.isDescendant(parentId, childId)) return
- const previousParentId = node.parentId
- const oldParent = previousParentId ? this.getNode(previousParentId) : undefined
- this.willChangeNode(node)
- this.willChangeNode(oldParent)
- this.willChangeNode(newParent)
- if (oldParent) {
- oldParent.childIds = oldParent.childIds.filter((id) => id !== childId)
- }
- newParent.childIds = newParent.childIds.filter((id) => id !== childId)
- newParent.childIds.splice(index, 0, childId)
- node.parentId = parentId
- this.clearAbsPosCache()
- this.emitter.emit('node:reordered', childId, parentId, index, previousParentId)
- }
-
- deleteNode(id: string): void {
- const node = this.nodes.get(id)
- if (!node || id === this.rootId) return
- this.willChangeNode(node)
-
- if (node.parentId) {
- const parent = this.nodes.get(node.parentId)
- this.willChangeNode(parent)
- if (parent) {
- parent.childIds = parent.childIds.filter((cid) => cid !== id)
- }
- }
-
- for (const childId of Array.from(node.childIds)) {
- this.deleteNode(childId)
- }
-
- if (node.type === 'INSTANCE' && node.componentId) {
- this.instanceIndex.get(node.componentId)?.delete(id)
- }
- this.connectorIds.delete(id)
- this.nodes.delete(id)
- this.emitter.emit('node:deleted', id, node.parentId)
- }
-
- hitTest(px: number, py: number, scopeId?: string): SceneNode | null {
- return HitTest.hitTest(this, px, py, scopeId)
- }
-
- /** `pad`, in canvas units, grows each shape's box, as Figma takes clicks just outside one. */
- hitTestDeep(px: number, py: number, scopeId?: string, pad = 0): SceneNode | null {
- return HitTest.hitTestDeep(this, px, py, scopeId, pad)
- }
-
- hitTestSelectable(
- px: number,
- py: number,
- scopeId: string,
- selectedIds: ReadonlySet<string>,
- pad = 0
- ): SceneNode | null {
- return HitTest.hitTestSelectable(this, px, py, scopeId, selectedIds, pad)
- }
-
- hitTestOpenContainer(px: number, py: number, scopeId: string): SceneNode | null {
- return HitTest.hitTestOpenContainer(this, px, py, scopeId)
- }
-
- isOpenContainer(nodeId: string): boolean {
- return HitTest.isOpenContainer(this, nodeId)
- }
-
- isPointInNode(nodeId: string, px: number, py: number): boolean {
- return HitTest.isPointInNode(this, nodeId, px, py)
- }
-
- hitTestDropTarget(
- px: number,
- py: number,
- excludeIds: ReadonlySet<string>,
- scopeId?: string,
- options?: HitTest.DropTargetOptions
- ): SceneNode | null {
- return HitTest.hitTestDropTarget(this, px, py, excludeIds, scopeId, options)
- }
-
- cloneTree(
- sourceId: string,
- parentId: string,
- overrides: Partial<SceneNode> = {}
- ): SceneNode | null {
- const src = this.nodes.get(sourceId)
- if (!src) return null
-
- const props = cloneNodeProps(src, null)
- // Null out Figma source identifiers so the clone is treated as local.
- // `as SourceMetadata` required: cloneNodeProps returns Partial<SceneNode>,
- // so props.source is SourceMetadata | undefined, but we know it's always set.
- props.source = { ...(props.source as SourceMetadata), id: null, orderKey: null }
- // A copy is a new design nobody has reviewed: Figma's duplicate and clone() drop the status.
- props.status = null
- const clone = this.createNode(src.type, parentId, { ...props, ...overrides })
- if (src.status) markSourceFieldsEdited(clone, ['status'])
-
- for (const childId of src.childIds) {
- this.cloneTree(childId, clone.id)
- }
-
- return clone
- }
-
- createInstance(
- componentId: string,
- parentId: string,
- overrides: Partial<SceneNode> = {}
- ): SceneNode | null {
- return Instances.createInstance(this, componentId, parentId, overrides)
- }
-
- populateInstanceChildren(
- instanceId: string,
- componentId: string,
- mode: Instances.NodeCloneMode = 'deep'
- ): void {
- Instances.populateInstanceChildren(this, instanceId, componentId, mode)
- }
-
- swapInstanceComponent(
- instanceId: string,
- componentId: string,
- options?: Instances.SwapInstanceOptions
- ): void {
- Instances.swapInstanceComponent(this, instanceId, componentId, options)
- }
-
- syncInstances(componentId: string): void {
- Instances.syncInstances(this, componentId)
- }
-
- syncInstancesTogether(componentIds: Iterable<string>): void {
- Instances.syncInstancesTogether(this, componentIds)
- }
-
- syncInstance(instanceId: string): void {
- Instances.syncInstance(this, instanceId)
- }
-
- detachInstance(instanceId: string): void {
- Instances.detachInstance(this, instanceId)
- }
-
- getMainComponent(instanceId: string): SceneNode | undefined {
- return Instances.getMainComponent(this, instanceId)
- }
-
- getInstances(componentId: string): SceneNode[] {
- return Instances.getInstances(this, componentId)
- }
-
- flattenTree(parentId?: string, depth = 0): Array<{ node: SceneNode; depth: number }> {
- const id = parentId ?? this.rootId
- const parent = this.nodes.get(id)
- if (!parent) return []
- const result: Array<{ node: SceneNode; depth: number }> = []
- for (const childId of parent.childIds) {
- const child = this.nodes.get(childId)
- if (!child) continue
- result.push({ node: child, depth })
- if (child.childIds.length > 0) result.push(...this.flattenTree(childId, depth + 1))
- }
- return result
- }
-}
diff --git a/packages/scene-graph/src/instances/assignments.ts b/packages/scene-graph/src/instances/assignments.ts
index a07030414..f1e898e0d 100644
--- a/packages/scene-graph/src/instances/assignments.ts
+++ b/packages/scene-graph/src/instances/assignments.ts
@@ -1,5 +1,6 @@
// What enclosing instances assign the component properties that drive a copy's layers.
-import type { ComponentPropertyReferenceField, SceneGraph, SceneNode } from '../'
+import type { SceneGraph } from '../graph'
+import type { ComponentPropertyReferenceField, SceneNode } from '../types'
/** SLOT_CONTENT is absent because it drives children, which `ownsSlotContent` keeps instead. */
const PROPERTY_REFERENCE_FIELDS: Partial<Record<ComponentPropertyReferenceField, string>> = {
diff --git a/packages/scene-graph/src/instances/content-size.ts b/packages/scene-graph/src/instances/content-size.ts
index 5ae04e859..d32f720bc 100644
--- a/packages/scene-graph/src/instances/content-size.ts
+++ b/packages/scene-graph/src/instances/content-size.ts
@@ -1,10 +1,11 @@
import { isEqual } from 'es-toolkit/predicate'
-import type { SceneGraph, SceneNode } from '../'
import { TEXT_METRIC_FIELDS, TEXT_SHAPING_FIELDS } from '../fields/text'
+import type { SceneGraph } from '../graph'
import { layoutSizing } from '../layout/sizing'
import type { Rect } from '../primitives'
import { resizedChildRect } from '../resize'
+import type { SceneNode } from '../types'
const METRIC_FIELDS: ReadonlySet<string> = new Set(TEXT_METRIC_FIELDS)
diff --git a/packages/scene-graph/src/instances/copies.ts b/packages/scene-graph/src/instances/copies.ts
index 476e13a05..983720c08 100644
--- a/packages/scene-graph/src/instances/copies.ts
+++ b/packages/scene-graph/src/instances/copies.ts
@@ -1,12 +1,13 @@
// How an instance's copies follow the component's layers when its structure changes.
-import type { SceneGraph, SceneNode } from '../'
+import type { SceneGraph } from '../graph'
+import { ownsSlotContent, slotPropertyId } from '../slots/frames'
+import type { SceneNode } from '../types'
+import { DEFAULT_HISTORY_LIMIT } from '../undo'
import {
getInstanceOverride,
hasInstanceOverride as hasNodeInstanceOverride,
type InstanceOverrideState
-} from '../instance-overrides'
-import { ownsSlotContent, slotPropertyId } from '../slots/frames'
-import { DEFAULT_HISTORY_LIMIT } from '../undo'
+} from './overrides'
/**
* One instance's sync: the copies it has matched to the component's layers, the parents it
diff --git a/packages/scene-graph/src/instances/cycles.ts b/packages/scene-graph/src/instances/cycles.ts
index b16e0ba15..c5fd310f2 100644
--- a/packages/scene-graph/src/instances/cycles.ts
+++ b/packages/scene-graph/src/instances/cycles.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../'
+import type { SceneGraph } from '../graph'
import { instanceMainComponent } from './main-component'
/** Components at or above `parentId`, counting the component each enclosing instance shows. */
diff --git a/packages/scene-graph/src/instances/fields.ts b/packages/scene-graph/src/instances/fields.ts
index ee053b8a9..07b579878 100644
--- a/packages/scene-graph/src/instances/fields.ts
+++ b/packages/scene-graph/src/instances/fields.ts
@@ -1,11 +1,11 @@
import { difference } from 'es-toolkit/array'
-import type { SceneNode } from '../'
import { CORNER_FIELDS, PAINT_FIELDS, STROKE_FIELDS } from '../fields/appearance'
import { SIZE_FIELDS, TRANSFORM_FIELDS } from '../fields/geometry'
import { AUTO_LAYOUT_FIELDS, SIZE_CONSTRAINT_FIELDS } from '../fields/layout'
import { TEXT_STYLE_FIELDS } from '../fields/text'
import { STYLE_LINK_FIELDS } from '../shared-styles'
+import type { SceneNode } from '../types'
export const INSTANCE_SYNC_TEXT_PROPS = [
'name',
diff --git a/packages/scene-graph/src/instances.ts b/packages/scene-graph/src/instances/index.ts
similarity index 94%
rename from packages/scene-graph/src/instances.ts
rename to packages/scene-graph/src/instances/index.ts
index 572037243..66e643b52 100644
--- a/packages/scene-graph/src/instances.ts
+++ b/packages/scene-graph/src/instances/index.ts
@@ -1,19 +1,17 @@
-import type { SceneGraph, SceneNode } from './'
-import type { NodeCloneMode } from './copy'
+import type { NodeCloneMode } from '../copy'
+import type { SceneGraph } from '../graph'
+import { detachOwnedSlotContent, restoreOwnedSlotContent } from '../slots/frames'
+import type { SceneNode } from '../types'
+import { keepOwnContentSize } from './content-size'
+import { createInstanceSyncContext, groupCopyRemovals, removeLeftoverCopies } from './copies'
+import { canCreateInstance } from './cycles'
+import { INSTANCE_OVERRIDE_FIELDS, INSTANCE_SYNC_PROPS } from './fields'
import {
clearInstanceOverrides,
getInstanceOverride,
hasInstanceOverride as hasNodeInstanceOverride,
setInstanceOverride
-} from './instance-overrides'
-import { keepOwnContentSize } from './instances/content-size'
-import {
- createInstanceSyncContext,
- groupCopyRemovals,
- removeLeftoverCopies
-} from './instances/copies'
-import { canCreateInstance } from './instances/cycles'
-import { INSTANCE_OVERRIDE_FIELDS, INSTANCE_SYNC_PROPS } from './instances/fields'
+} from './overrides'
import {
bindingProtection,
cloneChildrenWithMapping,
@@ -24,17 +22,17 @@ import {
syncBindingFields,
syncChildren,
updateSyncedProps
-} from './instances/sync'
-import { detachOwnedSlotContent, restoreOwnedSlotContent } from './slots/frames'
+} from './sync'
-export type { NodeCloneMode } from './copy'
+export { canCreateInstance, createsComponentCycle, cycleSafeParent } from './cycles'
+export { instanceMainComponent } from './main-component'
export {
INSTANCE_FOLLOWED_FIELDS,
INSTANCE_OVERRIDE_FIELDS,
INSTANCE_SYNC_FIELDS,
INSTANCE_SYNC_PROPS,
INSTANCE_SYNC_TEXT_PROPS
-} from './instances/fields'
+} from './fields'
export function copyInstanceComponentProps(component: SceneNode): Partial<SceneNode> {
const props: Partial<SceneNode> = {}
diff --git a/packages/scene-graph/src/instances/main-component.ts b/packages/scene-graph/src/instances/main-component.ts
index 56840f265..72ebbb54e 100644
--- a/packages/scene-graph/src/instances/main-component.ts
+++ b/packages/scene-graph/src/instances/main-component.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { SceneNode } from '../types'
/**
diff --git a/packages/scene-graph/src/instance-overrides.ts b/packages/scene-graph/src/instances/overrides.ts
similarity index 100%
rename from packages/scene-graph/src/instance-overrides.ts
rename to packages/scene-graph/src/instances/overrides.ts
diff --git a/packages/scene-graph/src/instances/placement.ts b/packages/scene-graph/src/instances/placement.ts
index cb8bbcfd8..ad313436e 100644
--- a/packages/scene-graph/src/instances/placement.ts
+++ b/packages/scene-graph/src/instances/placement.ts
@@ -1,6 +1,6 @@
-import type { SceneNode } from '../'
import { enforcedAspectRatio } from '../layout/aspect-ratio'
import { layoutConstrainedChildRect } from '../resize'
+import type { SceneNode } from '../types'
/** The fields that say where a copy sits in its parent. */
export const PLACEMENT_FIELDS: ReadonlySet<string> = new Set(['x', 'y', 'width', 'height'])
diff --git a/packages/scene-graph/src/instances/source-walk.ts b/packages/scene-graph/src/instances/source-walk.ts
index 62162e5bb..8c7795ad5 100644
--- a/packages/scene-graph/src/instances/source-walk.ts
+++ b/packages/scene-graph/src/instances/source-walk.ts
@@ -1,6 +1,6 @@
-import type { SceneGraph } from '../'
-import { getInstanceOverride } from '../instance-overrides'
+import type { SceneGraph } from '../graph'
import type { SceneNode } from '../types'
+import { getInstanceOverride } from './overrides'
/**
* Walk an instance's layers beside the component layers they copy, matched the way instance
diff --git a/packages/scene-graph/src/instances/sync.ts b/packages/scene-graph/src/instances/sync.ts
index e4fec62f8..42f858567 100644
--- a/packages/scene-graph/src/instances/sync.ts
+++ b/packages/scene-graph/src/instances/sync.ts
@@ -1,17 +1,12 @@
// Child cloning and property synchronization shared by instance creation, swap, and sync.
import { isEqual } from 'es-toolkit/predicate'
-import type { SceneGraph, SceneNode } from '../'
import { cloneNodeProps, copyEffects, copyFills, copyStrokes, copyStyleRuns } from '../copy'
import type { NodeCloneMode } from '../copy'
-import {
- getInstanceOverride,
- hasInstanceOverride as hasNodeInstanceOverride,
- setInstanceOverride,
- type InstanceOverrideState
-} from '../instance-overrides'
+import type { SceneGraph } from '../graph'
import { scaleNodeChanges } from '../scaling/node'
import { ownsSlotContent, slotPropertyId } from '../slots/frames'
+import type { SceneNode } from '../types'
import { scaleVariableBindingUnits } from '../variables/units'
import { applyEnclosingAssignments, assignedFieldValues, propertyDrivenFields } from './assignments'
import { keepOwnContentSize, remeasureChangedText, type SyncedPlacement } from './content-size'
@@ -24,6 +19,12 @@ import {
} from './copies'
import { INSTANCE_SYNC_FIELD_OWNERS, INSTANCE_SYNC_FIELDS } from './fields'
import { ownsSelfFillField, sourceWithEffectiveFill } from './main-component'
+import {
+ getInstanceOverride,
+ hasInstanceOverride as hasNodeInstanceOverride,
+ setInstanceOverride,
+ type InstanceOverrideState
+} from './overrides'
import { PLACEMENT_FIELDS, placedByConstraints } from './placement'
import { followVectorGeometry } from './vector-geometry'
diff --git a/packages/scene-graph/src/instances/vector-geometry.ts b/packages/scene-graph/src/instances/vector-geometry.ts
index f8900ad03..b2469b956 100644
--- a/packages/scene-graph/src/instances/vector-geometry.ts
+++ b/packages/scene-graph/src/instances/vector-geometry.ts
@@ -1,7 +1,7 @@
import { isEqual } from 'es-toolkit/predicate'
-import type { SceneNode, VectorNetwork } from '../'
import { copyGeometryPaths, scaleGeometryPaths } from '../copy'
+import type { SceneNode, VectorNetwork } from '../types'
import { cloneVectorNetwork, transformVectorNetwork } from '../vector-network'
/** How far apart two paths' points may be and still count as one path, in pixels. */
diff --git a/packages/scene-graph/src/layout/aspect-ratio.ts b/packages/scene-graph/src/layout/aspect-ratio.ts
index b80f4ed17..97c0fd3b9 100644
--- a/packages/scene-graph/src/layout/aspect-ratio.ts
+++ b/packages/scene-graph/src/layout/aspect-ratio.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { Vector } from '../primitives'
import type { SceneNode } from '../types'
diff --git a/packages/scene-graph/src/layout/sizing.ts b/packages/scene-graph/src/layout/sizing.ts
index 1c63bf394..bb4844c15 100644
--- a/packages/scene-graph/src/layout/sizing.ts
+++ b/packages/scene-graph/src/layout/sizing.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { LayoutSizing, SceneNode, TextAutoResize } from '../types'
/**
diff --git a/packages/scene-graph/src/mutation-impact.ts b/packages/scene-graph/src/mutation-impact.ts
index fabb58118..97d6fa22a 100644
--- a/packages/scene-graph/src/mutation-impact.ts
+++ b/packages/scene-graph/src/mutation-impact.ts
@@ -1,6 +1,6 @@
import { uniq } from 'es-toolkit/array'
-import type { SceneGraph } from './index'
+import type { SceneGraph } from './graph'
export interface SceneMutationImpact {
changedNodeIds: Set<string>
diff --git a/packages/scene-graph/src/node-defaults.ts b/packages/scene-graph/src/node-defaults.ts
index 751ea5816..f00d1f212 100644
--- a/packages/scene-graph/src/node-defaults.ts
+++ b/packages/scene-graph/src/node-defaults.ts
@@ -4,7 +4,7 @@ import {
DEFAULT_STROKE_MITER_LIMIT,
DEFAULT_STROKE_WEIGHT
} from './constants'
-import { createInstanceOverrideState } from './instance-overrides'
+import { createInstanceOverrideState } from './instances/overrides'
import type { NodeType, SceneNode, SourceMetadata } from './types'
export function createDefaultSourceMetadata(): SourceMetadata {
diff --git a/packages/scene-graph/src/parse-path.ts b/packages/scene-graph/src/parse-path.ts
index 61786b00d..0e0bc36c0 100644
--- a/packages/scene-graph/src/parse-path.ts
+++ b/packages/scene-graph/src/parse-path.ts
@@ -1,6 +1,6 @@
import svgpath from 'svgpath'
-import type { VectorNetwork, VectorVertex, VectorSegment, VectorRegion, WindingRule } from './index'
+import type { VectorNetwork, VectorVertex, VectorSegment, VectorRegion, WindingRule } from './types'
interface SubPath {
startVertexIndex: number
diff --git a/packages/scene-graph/src/plugin-data/index.ts b/packages/scene-graph/src/plugin-data/index.ts
new file mode 100644
index 000000000..80a14bd72
--- /dev/null
+++ b/packages/scene-graph/src/plugin-data/index.ts
@@ -0,0 +1,2 @@
+export * from './field'
+export * from './fields'
diff --git a/packages/scene-graph/src/scaling/tree.ts b/packages/scene-graph/src/scaling/tree.ts
index 5c95a7952..22e52b75e 100644
--- a/packages/scene-graph/src/scaling/tree.ts
+++ b/packages/scene-graph/src/scaling/tree.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import { findInstanceAncestor } from '../instances'
import type { SceneNode } from '../types'
import { scaleVariableBindingUnits } from '../variables/units'
diff --git a/packages/scene-graph/src/shaders/index.ts b/packages/scene-graph/src/shaders/index.ts
new file mode 100644
index 000000000..d6b84c468
--- /dev/null
+++ b/packages/scene-graph/src/shaders/index.ts
@@ -0,0 +1,3 @@
+export * from './model'
+export * from './schema'
+export * from './still'
diff --git a/packages/scene-graph/src/shared-styles.ts b/packages/scene-graph/src/shared-styles.ts
index a9197318f..7768445fe 100644
--- a/packages/scene-graph/src/shared-styles.ts
+++ b/packages/scene-graph/src/shared-styles.ts
@@ -1,4 +1,5 @@
-import type { SceneGraph, SceneNode, SharedStyle, SharedStyleKind, SharedStyleType } from './index'
+import type { SceneGraph } from './graph'
+import type { SceneNode, SharedStyle, SharedStyleKind, SharedStyleType } from './types'
const STYLE_REF_KEYS = {
fill: 'fillStyleId',
diff --git a/packages/scene-graph/src/slots/authoring.ts b/packages/scene-graph/src/slots/authoring.ts
index 04ae3599d..94e82a949 100644
--- a/packages/scene-graph/src/slots/authoring.ts
+++ b/packages/scene-graph/src/slots/authoring.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { ComponentPropertyDefinition, SceneNode, SlotSettings } from '../types'
import { slotPropertyId } from './frames'
diff --git a/packages/scene-graph/src/slots/content.ts b/packages/scene-graph/src/slots/content.ts
index 2e49f97e3..bf062f39f 100644
--- a/packages/scene-graph/src/slots/content.ts
+++ b/packages/scene-graph/src/slots/content.ts
@@ -1,6 +1,6 @@
import { isGeneratedFrame } from '../generated'
-import type { SceneGraph } from '../index'
-import { getInstanceOverride, setInstanceOverride } from '../instance-overrides'
+import type { SceneGraph } from '../graph'
+import { getInstanceOverride, setInstanceOverride } from '../instances/overrides'
import { cloneChildrenWithMapping } from '../instances/sync'
import type { SceneNode } from '../types'
import { ownsSlotContent, slotPropertyId } from './frames'
diff --git a/packages/scene-graph/src/slots/frames.ts b/packages/scene-graph/src/slots/frames.ts
index 86c8bf5d1..767808426 100644
--- a/packages/scene-graph/src/slots/frames.ts
+++ b/packages/scene-graph/src/slots/frames.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import { instanceMainComponent } from '../instances/main-component'
import type { SceneNode } from '../types'
@@ -111,7 +111,7 @@ export function detachOwnedSlotContent(graph: SceneGraph, instance: SceneNode):
if (!name || parked.slots.some((slot) => [...slot.path, slot.name].join('\u0000') === key))
continue
const content = [...frame.childIds]
- for (const id of content) graph.reorderChild(id, instance.id, instance.childIds.length)
+ for (const id of content) graph.insertChildAt(id, instance.id, instance.childIds.length)
parked.slots.push({ path, name, content })
}
}
@@ -152,7 +152,7 @@ export function restoreOwnedSlotContent(
continue
}
for (const id of Array.from(frame.childIds)) graph.deleteNode(id)
- for (const [index, id] of slot.content.entries()) graph.reorderChild(id, frame.id, index)
+ for (const [index, id] of slot.content.entries()) graph.insertChildAt(id, frame.id, index)
graph.updateNode(owner.id, {
componentPropertyAssignments: { ...owner.componentPropertyAssignments, [propertyId]: '' }
})
diff --git a/packages/scene-graph/src/slots/index.ts b/packages/scene-graph/src/slots/index.ts
new file mode 100644
index 000000000..621efb4d2
--- /dev/null
+++ b/packages/scene-graph/src/slots/index.ts
@@ -0,0 +1,4 @@
+export * from './authoring'
+export * from './content'
+export * from './frames'
+export * from './limits'
diff --git a/packages/scene-graph/src/slots/limits.ts b/packages/scene-graph/src/slots/limits.ts
index 5aced8127..f4e780491 100644
--- a/packages/scene-graph/src/slots/limits.ts
+++ b/packages/scene-graph/src/slots/limits.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { ComponentPropertyDefinition, SceneNode } from '../types'
/** A limit a slot's content breaks, named as Figma's `SlotNode.limitViolations` names them. */
diff --git a/packages/scene-graph/src/snap.ts b/packages/scene-graph/src/snap.ts
index c7e285acd..2e188741e 100644
--- a/packages/scene-graph/src/snap.ts
+++ b/packages/scene-graph/src/snap.ts
@@ -1,6 +1,6 @@
-import type { SceneNode } from './'
import { rotatedBBox } from './geometry'
import type { Rect } from './primitives'
+import type { SceneNode } from './types'
const DEFAULT_SNAP_THRESHOLD = 5
diff --git a/packages/scene-graph/src/statuses/impact.ts b/packages/scene-graph/src/statuses/impact.ts
index 6f9460a98..65c9a0b8f 100644
--- a/packages/scene-graph/src/statuses/impact.ts
+++ b/packages/scene-graph/src/statuses/impact.ts
@@ -1,6 +1,6 @@
import { groupBy } from 'es-toolkit'
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import { effectiveStatus } from './node'
import type { StatusWorkflow } from './schema'
import { findStatusState } from './workflow'
diff --git a/packages/scene-graph/src/statuses/index.ts b/packages/scene-graph/src/statuses/index.ts
new file mode 100644
index 000000000..52653fa93
--- /dev/null
+++ b/packages/scene-graph/src/statuses/index.ts
@@ -0,0 +1,4 @@
+export * from './impact'
+export * from './node'
+export * from './schema'
+export * from './workflow'
diff --git a/packages/scene-graph/src/statuses/node.ts b/packages/scene-graph/src/statuses/node.ts
index 64f500d2e..362f34143 100644
--- a/packages/scene-graph/src/statuses/node.ts
+++ b/packages/scene-graph/src/statuses/node.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { NodeType, SceneNode } from '../types'
/** Layers Figma lets carry a status, `DevStatusMixin` in the Plugin API. */
diff --git a/packages/scene-graph/src/statuses/workflow.ts b/packages/scene-graph/src/statuses/workflow.ts
index a3f463ed9..bc7c77e50 100644
--- a/packages/scene-graph/src/statuses/workflow.ts
+++ b/packages/scene-graph/src/statuses/workflow.ts
@@ -1,5 +1,5 @@
import { parseColor } from '../color'
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import { readPluginData, withPluginData } from '../plugin-data/field'
import { OPEN_PENCIL_PLUGIN_DATA } from '../plugin-data/fields'
import type { SceneNode } from '../types'
diff --git a/packages/scene-graph/src/transfer/apply.ts b/packages/scene-graph/src/transfer/apply.ts
index ca3a6d2ad..16a62653a 100644
--- a/packages/scene-graph/src/transfer/apply.ts
+++ b/packages/scene-graph/src/transfer/apply.ts
@@ -1,6 +1,6 @@
import { isEqual } from 'es-toolkit/predicate'
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import { variableIdentityReferences } from './identity'
import type { prepareGraphTransfer } from './plan'
import { validateTransferReferences } from './validation'
diff --git a/packages/scene-graph/src/transfer/history.ts b/packages/scene-graph/src/transfer/history.ts
index 5192169cd..af0719899 100644
--- a/packages/scene-graph/src/transfer/history.ts
+++ b/packages/scene-graph/src/transfer/history.ts
@@ -1,5 +1,5 @@
import { cloneNodeProps } from '../copy'
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { GraphTransferPlan } from './apply'
/** Capture post-placement state for redo; this does not authorize deleting shared resources. */
diff --git a/packages/scene-graph/src/transfer/nodes.ts b/packages/scene-graph/src/transfer/nodes.ts
index ddc5ea922..49b945b57 100644
--- a/packages/scene-graph/src/transfer/nodes.ts
+++ b/packages/scene-graph/src/transfer/nodes.ts
@@ -1,5 +1,5 @@
import { cloneNodeProps } from '../copy'
-import { remapInstanceOverrideState } from '../instance-overrides'
+import { remapInstanceOverrideState } from '../instances/overrides'
import { remapStyleRunReferences, styleRunReferences } from '../text/references'
import type { ComponentPropertyType, SceneNode } from '../types'
import { requireTransferReference as required } from './references'
diff --git a/packages/scene-graph/src/transfer/plan.ts b/packages/scene-graph/src/transfer/plan.ts
index d0458a285..b5b1d6bfe 100644
--- a/packages/scene-graph/src/transfer/plan.ts
+++ b/packages/scene-graph/src/transfer/plan.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { ComponentPropertyType, SceneNode } from '../types'
import { prepareNodeTransfer } from './nodes'
import { requireTransferReference } from './references'
diff --git a/packages/scene-graph/src/transfer/remove.ts b/packages/scene-graph/src/transfer/remove.ts
index efc9a19df..8279e88e6 100644
--- a/packages/scene-graph/src/transfer/remove.ts
+++ b/packages/scene-graph/src/transfer/remove.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { GraphTransferPlan } from './apply'
import { semanticTransferReferences } from './nodes'
diff --git a/packages/scene-graph/src/transfer/validation.ts b/packages/scene-graph/src/transfer/validation.ts
index 910c297a7..fa67af17b 100644
--- a/packages/scene-graph/src/transfer/validation.ts
+++ b/packages/scene-graph/src/transfer/validation.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import { createDefaultNode } from '../node-defaults'
import type { ComponentPropertyType } from '../types'
import type { GraphTransferPlan } from './apply'
diff --git a/packages/scene-graph/src/types.ts b/packages/scene-graph/src/types.ts
index a8b85fb47..41b84e034 100644
--- a/packages/scene-graph/src/types.ts
+++ b/packages/scene-graph/src/types.ts
@@ -2,7 +2,7 @@
import type { ExportFormatId } from './export-format'
import type { CanvasGuide } from './guides'
-import type { InstanceOverrideState } from './instance-overrides'
+import type { InstanceOverrideState } from './instances/overrides'
import type { Color, Matrix, Rect, Vector } from './primitives'
import type { ShapeWithTextType } from './shape-with-text/kinds'
diff --git a/packages/scene-graph/src/variables/bindings.ts b/packages/scene-graph/src/variables/bindings.ts
index 6ccff016d..92502d36a 100644
--- a/packages/scene-graph/src/variables/bindings.ts
+++ b/packages/scene-graph/src/variables/bindings.ts
@@ -1,9 +1,9 @@
+import type { VariableModeFallback } from '.'
import { copyFills, copyStrokes } from '../copy'
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import { hasInstanceOverride } from '../instances'
import type { Color } from '../primitives'
import type { Fill, SceneNode, Stroke, StyleRun } from '../types'
-import type { VariableModeFallback } from '../variables'
import { NUMERIC_FIELDS, isNumericVariableBindingField } from './fields'
import { variableText, variableTruthy } from './text'
import { variableValueReferences } from './value'
diff --git a/packages/scene-graph/src/variables/formula/check.ts b/packages/scene-graph/src/variables/formula/check.ts
index d781486e9..5d22c348f 100644
--- a/packages/scene-graph/src/variables/formula/check.ts
+++ b/packages/scene-graph/src/variables/formula/check.ts
@@ -1,9 +1,9 @@
+import type { Color } from '#scene-graph/primitives'
import type {
- Color,
VariableFormulaNode,
VariableFormulaOperator,
VariableLiteral
-} from '@open-pencil/scene-graph'
+} from '#scene-graph/types'
import {
formulaArity,
diff --git a/packages/scene-graph/src/variables/formula/evaluate.ts b/packages/scene-graph/src/variables/formula/evaluate.ts
index 91ee83fbf..7cd8ad30b 100644
--- a/packages/scene-graph/src/variables/formula/evaluate.ts
+++ b/packages/scene-graph/src/variables/formula/evaluate.ts
@@ -1,4 +1,4 @@
-import type { VariableFormulaNode, VariableLiteral } from '@open-pencil/scene-graph'
+import type { VariableFormulaNode, VariableLiteral } from '#scene-graph/types'
import { checkFormulaOperands, formulaValueType } from './check'
import { applyFormulaOperator, isFormulaOperator } from './signatures'
diff --git a/packages/scene-graph/src/variables/formula/index.ts b/packages/scene-graph/src/variables/formula/index.ts
index 8cd1ad989..b27fa5828 100644
--- a/packages/scene-graph/src/variables/formula/index.ts
+++ b/packages/scene-graph/src/variables/formula/index.ts
@@ -1,4 +1,5 @@
-import type { SceneGraph, VariableLiteral, VariableValue } from '@open-pencil/scene-graph'
+import type { SceneGraph } from '#scene-graph/graph'
+import type { VariableLiteral, VariableValue } from '#scene-graph/types'
import { resolveVariableInModes } from '../resolution'
import { parseFormulaSyntax, type FormulaReference } from './parse'
diff --git a/packages/scene-graph/src/variables/formula/parse.ts b/packages/scene-graph/src/variables/formula/parse.ts
index 1989407b7..d4f529c71 100644
--- a/packages/scene-graph/src/variables/formula/parse.ts
+++ b/packages/scene-graph/src/variables/formula/parse.ts
@@ -1,8 +1,8 @@
+import { tryParseColor } from '#scene-graph/color/index'
+import type { Color } from '#scene-graph/primitives'
+import type { VariableFormulaNode, VariableFormulaOperator } from '#scene-graph/types'
import * as v from 'valibot'
-import type { Color, VariableFormulaNode, VariableFormulaOperator } from '@open-pencil/scene-graph'
-import { tryParseColor } from '@open-pencil/scene-graph/color'
-
import { checkFormulaOperands } from './check'
import {
binaryFormulaOperator,
diff --git a/packages/scene-graph/src/variables/formula/print.ts b/packages/scene-graph/src/variables/formula/print.ts
index 7d0d2c0ae..ffd81cc74 100644
--- a/packages/scene-graph/src/variables/formula/print.ts
+++ b/packages/scene-graph/src/variables/formula/print.ts
@@ -1,9 +1,9 @@
+import { colorToHex8 } from '#scene-graph/color/index'
import type {
VariableFormulaNode,
VariableFormulaOperation,
VariableFormulaOperator
-} from '@open-pencil/scene-graph'
-import { colorToHex8 } from '@open-pencil/scene-graph/color'
+} from '#scene-graph/types'
import { inferFormulaType } from './check'
import {
diff --git a/packages/scene-graph/src/variables/formula/schema.ts b/packages/scene-graph/src/variables/formula/schema.ts
index 18dfa3051..167999171 100644
--- a/packages/scene-graph/src/variables/formula/schema.ts
+++ b/packages/scene-graph/src/variables/formula/schema.ts
@@ -1,10 +1,9 @@
-import * as v from 'valibot'
-
import {
VARIABLE_FORMULA_OPERATORS,
type VariableFormula,
type VariableFormulaNode
-} from '@open-pencil/scene-graph/types'
+} from '#scene-graph/types'
+import * as v from 'valibot'
import { variableAliasSchema } from '../schema'
import { inferFormulaType } from './check'
diff --git a/packages/scene-graph/src/variables/formula/signatures.ts b/packages/scene-graph/src/variables/formula/signatures.ts
index 42977ac7e..0a32787a2 100644
--- a/packages/scene-graph/src/variables/formula/signatures.ts
+++ b/packages/scene-graph/src/variables/formula/signatures.ts
@@ -1,8 +1,4 @@
-import type {
- VariableFormulaOperator,
- VariableLiteral,
- VariableType
-} from '@open-pencil/scene-graph'
+import type { VariableFormulaOperator, VariableLiteral, VariableType } from '#scene-graph/types'
import { variableText, variableTruthy } from '../text'
import { VariableFormulaError } from './tree'
diff --git a/packages/scene-graph/src/variables/formula/tree.ts b/packages/scene-graph/src/variables/formula/tree.ts
index f13319899..823d79694 100644
--- a/packages/scene-graph/src/variables/formula/tree.ts
+++ b/packages/scene-graph/src/variables/formula/tree.ts
@@ -3,7 +3,7 @@ import type {
VariableFormulaNode,
VariableFormulaOperation,
VariableLiteral
-} from '@open-pencil/scene-graph'
+} from '#scene-graph/types'
export const MAX_FORMULA_DEPTH = 64
export const MAX_FORMULA_LENGTH = 4096
diff --git a/packages/scene-graph/src/variables.ts b/packages/scene-graph/src/variables/index.ts
similarity index 95%
rename from packages/scene-graph/src/variables.ts
rename to packages/scene-graph/src/variables/index.ts
index ef3b43375..478cce7c0 100644
--- a/packages/scene-graph/src/variables.ts
+++ b/packages/scene-graph/src/variables/index.ts
@@ -1,30 +1,30 @@
import { partition } from 'es-toolkit/array'
import { omit, omitBy } from 'es-toolkit/object'
-import { BLACK } from './constants'
-import type { SceneGraph } from './index'
-import { setInstanceOverride } from './instance-overrides'
-import { findInstanceAncestor } from './instances'
+import { BLACK } from '../constants'
+import type { SceneGraph } from '../graph'
+import { findInstanceAncestor } from '../instances'
+import { setInstanceOverride } from '../instances/overrides'
import type {
Variable,
VariableCollection,
VariableCollectionMode,
VariableType,
VariableValue
-} from './types'
+} from '../types'
import {
isNumericVariableBindingField,
variableBindingOwner,
assignVariableBindingUnits
-} from './variables/bindings'
+} from './bindings'
import {
BOOLEAN_BINDING_FIELDS,
STRING_BINDING_FIELDS,
TEXT_CONTENT_VARIABLE_TYPES,
VISIBILITY_VARIABLE_TYPES
-} from './variables/fields'
+} from './fields'
-export * from './variables/resolution'
+export * from './resolution'
export function addVariable(graph: SceneGraph, variable: Variable): void {
graph.variables.set(variable.id, variable)
@@ -335,3 +335,11 @@ function markBoundVariablesOverrideOnInstance(
node.boundVariables[field] ?? null
)
}
+
+export * from './bindings'
+export * from './formula'
+export * from './formula/schema'
+export * from './schema'
+export * from './text'
+export * from './token'
+export * from './value'
diff --git a/packages/scene-graph/src/variables/resolution.ts b/packages/scene-graph/src/variables/resolution.ts
index a250ae27c..3c65f21df 100644
--- a/packages/scene-graph/src/variables/resolution.ts
+++ b/packages/scene-graph/src/variables/resolution.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '../index'
+import type { SceneGraph } from '../graph'
import type { Color } from '../primitives'
import type { Variable, VariableLiteral, VariableValue } from '../types'
import { MAX_FORMULA_DEPTH, VariableFormulaError } from './formula/tree'
diff --git a/packages/scene-graph/tests/basic/layout-affecting-keys.test.ts b/packages/scene-graph/tests/basic/layout-affecting-keys.test.ts
index a4cd28887..5e261d86a 100644
--- a/packages/scene-graph/tests/basic/layout-affecting-keys.test.ts
+++ b/packages/scene-graph/tests/basic/layout-affecting-keys.test.ts
@@ -1,17 +1,17 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph } from '@open-pencil/scene-graph'
+import { LAYOUT_AFFECTING_KEYS } from '@open-pencil/scene-graph/fields'
describe('LAYOUT_AFFECTING_KEYS membership', () => {
test('contains all direct transform properties', () => {
- const keys = SceneGraph.LAYOUT_AFFECTING_KEYS
+ const keys = LAYOUT_AFFECTING_KEYS
for (const k of ['x', 'y', 'width', 'height', 'rotation', 'flipX', 'flipY']) {
expect(keys.has(k)).toBe(true)
}
})
test('contains all auto-layout properties', () => {
- const keys = SceneGraph.LAYOUT_AFFECTING_KEYS
+ const keys = LAYOUT_AFFECTING_KEYS
for (const k of [
'layoutMode',
'layoutDirection',
@@ -37,7 +37,7 @@ describe('LAYOUT_AFFECTING_KEYS membership', () => {
})
test('contains grid and sizing constraint properties', () => {
- const keys = SceneGraph.LAYOUT_AFFECTING_KEYS
+ const keys = LAYOUT_AFFECTING_KEYS
for (const k of [
'gridTemplateColumns',
'gridTemplateRows',
@@ -55,7 +55,7 @@ describe('LAYOUT_AFFECTING_KEYS membership', () => {
})
test('does NOT contain visual-only properties', () => {
- const keys = SceneGraph.LAYOUT_AFFECTING_KEYS
+ const keys = LAYOUT_AFFECTING_KEYS
for (const k of ['fills', 'strokes', 'effects', 'opacity', 'visible', 'name', 'pluginData']) {
expect(keys.has(k)).toBe(false)
}
@@ -72,6 +72,6 @@ describe('LAYOUT_AFFECTING_KEYS membership', () => {
// gridTemplateColumns,gridTemplateRows,gridColumnGap,gridRowGap,gridPosition = 5
// minWidth,maxWidth,minHeight,maxHeight,targetAspectRatio = 5
// Total: 37
- expect(SceneGraph.LAYOUT_AFFECTING_KEYS.size).toBe(37)
+ expect(LAYOUT_AFFECTING_KEYS.size).toBe(37)
})
})
diff --git a/packages/scene-graph/tests/basic/text-picture-keys.test.ts b/packages/scene-graph/tests/basic/text-picture-keys.test.ts
index e1cd06824..7de6b24bf 100644
--- a/packages/scene-graph/tests/basic/text-picture-keys.test.ts
+++ b/packages/scene-graph/tests/basic/text-picture-keys.test.ts
@@ -1,10 +1,10 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph } from '@open-pencil/scene-graph'
+import { GLYPH_AFFECTING_KEYS, TEXT_PICTURE_KEYS } from '@open-pencil/scene-graph/text/picture'
describe('text rendering invalidation keys', () => {
test('TEXT_PICTURE_KEYS contains rendered-picture properties', () => {
- const keys = SceneGraph.TEXT_PICTURE_KEYS
+ const keys = TEXT_PICTURE_KEYS
for (const k of [
'text',
'fontSize',
@@ -28,7 +28,7 @@ describe('text rendering invalidation keys', () => {
})
test('GLYPH_AFFECTING_KEYS contains only properties that change imported glyphs', () => {
- const keys = SceneGraph.GLYPH_AFFECTING_KEYS
+ const keys = GLYPH_AFFECTING_KEYS
for (const k of [
'text',
'fontSize',
@@ -53,7 +53,7 @@ describe('text rendering invalidation keys', () => {
})
test('TEXT_PICTURE_KEYS does NOT contain non-text properties', () => {
- const keys = SceneGraph.TEXT_PICTURE_KEYS
+ const keys = TEXT_PICTURE_KEYS
for (const k of ['x', 'y', 'rotation', 'opacity', 'visible', 'name']) {
expect(keys.has(k)).toBe(false)
}
diff --git a/packages/scene-graph/tests/basic/variables.test.ts b/packages/scene-graph/tests/basic/variables.test.ts
index b73c9717b..8e39497d5 100644
--- a/packages/scene-graph/tests/basic/variables.test.ts
+++ b/packages/scene-graph/tests/basic/variables.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { resolvedValueBindings, SceneGraph } from '@open-pencil/scene-graph'
+import { resolvedValueBindings } from '@open-pencil/scene-graph/variables'
+import { SceneGraph } from '@open-pencil/scene-graph'
describe('Variables', () => {
function pageId(graph: SceneGraph): string {
diff --git a/packages/scene-graph/tests/behaviours/layers.test.ts b/packages/scene-graph/tests/behaviours/layers.test.ts
index 47727bc23..0222980f9 100644
--- a/packages/scene-graph/tests/behaviours/layers.test.ts
+++ b/packages/scene-graph/tests/behaviours/layers.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { findLayerByPath, layerPath, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { findLayerByPath, layerPath } from '@open-pencil/scene-graph/behaviours'
describe('layer paths', () => {
test('round-trip names that contain the path separators', () => {
diff --git a/packages/scene-graph/tests/behaviours/model.test.ts b/packages/scene-graph/tests/behaviours/model.test.ts
index 4df31b51e..df4014f36 100644
--- a/packages/scene-graph/tests/behaviours/model.test.ts
+++ b/packages/scene-graph/tests/behaviours/model.test.ts
@@ -1,14 +1,14 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
behaviourOwner,
emptyBehaviour,
guessInteractionStates,
missingBindings,
readBehaviour,
- SceneGraph,
withBehaviour
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/behaviours'
/** A Switch set with a State variant property and a Thumb slot. */
function switchSet() {
diff --git a/packages/scene-graph/tests/behaviours/spec.test.ts b/packages/scene-graph/tests/behaviours/spec.test.ts
index c95d8e68b..cbe32497a 100644
--- a/packages/scene-graph/tests/behaviours/spec.test.ts
+++ b/packages/scene-graph/tests/behaviours/spec.test.ts
@@ -1,11 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import {
- behaviourFromSpec,
- behaviourToSpec,
- guessOnOff,
- SceneGraph
-} from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { behaviourFromSpec, behaviourToSpec, guessOnOff } from '@open-pencil/scene-graph/behaviours'
/** A switch set with State and Interaction variant properties and a Thumb slot. */
function switchSet() {
diff --git a/packages/scene-graph/tests/clone/node-props.test.ts b/packages/scene-graph/tests/clone/node-props.test.ts
index d5670bab3..f33df9f77 100644
--- a/packages/scene-graph/tests/clone/node-props.test.ts
+++ b/packages/scene-graph/tests/clone/node-props.test.ts
@@ -1,7 +1,11 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph, getInstanceOverride, setInstanceOverride, type SceneNode } from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
import { cloneNodeProps } from '@open-pencil/scene-graph/copy'
+import {
+ getInstanceOverride,
+ setInstanceOverride
+} from '@open-pencil/scene-graph/instances/overrides'
import { expectDefined, getNodeOrThrow } from '../helpers/assert'
diff --git a/packages/scene-graph/tests/comments/document.test.ts b/packages/scene-graph/tests/comments/document.test.ts
index 71e6ea571..223b6f90c 100644
--- a/packages/scene-graph/tests/comments/document.test.ts
+++ b/packages/scene-graph/tests/comments/document.test.ts
@@ -1,13 +1,12 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph, type CommentThread } from '@open-pencil/scene-graph'
import {
commentAnchor,
commentPosition,
readComments,
- SceneGraph,
- writeComments,
- type CommentThread
-} from '@open-pencil/scene-graph'
+ writeComments
+} from '@open-pencil/scene-graph/comments'
function thread(id: string, patch: Partial<CommentThread> = {}): CommentThread {
return {
@@ -75,4 +74,3 @@ describe('document comments', () => {
expect(commentAnchor(graph, page.id, { x: 115, y: 115 }).nodeId).toBe(frame.id)
})
})
-
diff --git a/packages/scene-graph/tests/comments/list.test.ts b/packages/scene-graph/tests/comments/list.test.ts
index 6ef029134..92029fbae 100644
--- a/packages/scene-graph/tests/comments/list.test.ts
+++ b/packages/scene-graph/tests/comments/list.test.ts
@@ -1,12 +1,11 @@
import { describe, expect, test } from 'bun:test'
+import type { CommentThread } from '@open-pencil/scene-graph'
import {
commentThreadNumbers,
listCommentThreads,
- type CommentListOptions,
- type CommentThread
-} from '@open-pencil/scene-graph'
-
+ type CommentListOptions
+} from '@open-pencil/scene-graph/comments'
function thread(id: string, patch: Partial<CommentThread> = {}): CommentThread {
return {
@@ -63,8 +62,14 @@ describe('comments list', () => {
}),
thread('theirs', { pageId: '0:2', author: 'Claude' })
]
- expect(ids(listCommentThreads(threads, { ...base, onlyPage: true }))).toEqual(['mine', 'replied'])
- expect(ids(listCommentThreads(threads, { ...base, onlyMine: true }))).toEqual(['mine', 'replied'])
+ expect(ids(listCommentThreads(threads, { ...base, onlyPage: true }))).toEqual([
+ 'mine',
+ 'replied'
+ ])
+ expect(ids(listCommentThreads(threads, { ...base, onlyMine: true }))).toEqual([
+ 'mine',
+ 'replied'
+ ])
})
test('sorts by when each thread was started', () => {
diff --git a/packages/scene-graph/tests/comments/merge.test.ts b/packages/scene-graph/tests/comments/merge.test.ts
index f7ef4d61c..02ac63631 100644
--- a/packages/scene-graph/tests/comments/merge.test.ts
+++ b/packages/scene-graph/tests/comments/merge.test.ts
@@ -1,11 +1,7 @@
import { expect, test } from 'bun:test'
-import {
- hasNewerComments,
- mergeCommentThreads,
- type CommentThread
-} from '@open-pencil/scene-graph'
-
+import type { CommentThread } from '@open-pencil/scene-graph'
+import { hasNewerComments, mergeCommentThreads } from '@open-pencil/scene-graph/comments'
function thread(id: string, patch: Partial<CommentThread> = {}): CommentThread {
return {
diff --git a/packages/scene-graph/tests/components/binding-protection.test.ts b/packages/scene-graph/tests/components/binding-protection.test.ts
index 695bf1b81..4de18bab9 100644
--- a/packages/scene-graph/tests/components/binding-protection.test.ts
+++ b/packages/scene-graph/tests/components/binding-protection.test.ts
@@ -1,6 +1,7 @@
import { expect, test } from 'bun:test'
-import { SceneGraph, setInstanceOverride } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
import { expectDefined } from '../helpers/assert'
diff --git a/packages/scene-graph/tests/components/cycles.test.ts b/packages/scene-graph/tests/components/cycles.test.ts
index 741bf2e3a..48cb239b2 100644
--- a/packages/scene-graph/tests/components/cycles.test.ts
+++ b/packages/scene-graph/tests/components/cycles.test.ts
@@ -1,11 +1,11 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
canCreateInstance,
createsComponentCycle,
- cycleSafeParent,
- SceneGraph
-} from '@open-pencil/scene-graph'
+ cycleSafeParent
+} from '@open-pencil/scene-graph/instances'
/** Card holds a Footer with an Action instance of Button, which holds an instance of Icon. */
function setup() {
diff --git a/packages/scene-graph/tests/components/exposure.test.ts b/packages/scene-graph/tests/components/exposure.test.ts
index 60c0c2b37..ccaaa03d7 100644
--- a/packages/scene-graph/tests/components/exposure.test.ts
+++ b/packages/scene-graph/tests/components/exposure.test.ts
@@ -1,10 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import {
- exposableInstances,
- exposedInstances,
- SceneGraph
-} from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { exposableInstances, exposedInstances } from '@open-pencil/scene-graph/components'
function setup() {
const graph = new SceneGraph()
diff --git a/packages/scene-graph/tests/components/nested-sync.test.ts b/packages/scene-graph/tests/components/nested-sync.test.ts
index d2e15341e..c51b313b2 100644
--- a/packages/scene-graph/tests/components/nested-sync.test.ts
+++ b/packages/scene-graph/tests/components/nested-sync.test.ts
@@ -1,10 +1,8 @@
import { expect, test } from 'bun:test'
-import {
- SceneGraph,
- recordInstanceOverride,
- deleteInstanceOverride
-} from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { recordInstanceOverride } from '@open-pencil/scene-graph/instances'
+import { deleteInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
test('outer sync preserves a nested edit without blocking sibling or other-field inheritance', () => {
const graph = new SceneGraph()
diff --git a/packages/scene-graph/tests/components/override-transfer.test.ts b/packages/scene-graph/tests/components/override-transfer.test.ts
index 228a198b4..cf68afa22 100644
--- a/packages/scene-graph/tests/components/override-transfer.test.ts
+++ b/packages/scene-graph/tests/components/override-transfer.test.ts
@@ -1,6 +1,9 @@
import { expect, test } from 'bun:test'
-import { createInstanceOverrideState, remapInstanceOverrideState } from '@open-pencil/scene-graph'
+import {
+ createInstanceOverrideState,
+ remapInstanceOverrideState
+} from '@open-pencil/scene-graph/instances/overrides'
test('override transfer remaps typed identities without rewriting equal text', () => {
const state = createInstanceOverrideState()
diff --git a/packages/scene-graph/tests/components/properties.test.ts b/packages/scene-graph/tests/components/properties.test.ts
index 3a80ce852..717a10900 100644
--- a/packages/scene-graph/tests/components/properties.test.ts
+++ b/packages/scene-graph/tests/components/properties.test.ts
@@ -1,15 +1,15 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
applyComponentPropertyValue,
componentPropertyDefinitions,
componentPropertyOwners,
findComponentPropertyTarget,
- forEachInstanceOverride,
removeComponentProperty,
- resolveComponentPropertyValue,
- SceneGraph
-} from '@open-pencil/scene-graph'
+ resolveComponentPropertyValue
+} from '@open-pencil/scene-graph/components'
+import { forEachInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
function component(
graph: SceneGraph,
diff --git a/packages/scene-graph/tests/components/property/driven-sync.test.ts b/packages/scene-graph/tests/components/property/driven-sync.test.ts
index bc686d68f..bf800564d 100644
--- a/packages/scene-graph/tests/components/property/driven-sync.test.ts
+++ b/packages/scene-graph/tests/components/property/driven-sync.test.ts
@@ -1,6 +1,7 @@
import { expect, test } from 'bun:test'
-import { applyComponentPropertyValue, SceneGraph } from '@open-pencil/scene-graph'
+import { applyComponentPropertyValue } from '@open-pencil/scene-graph/components'
+import { SceneGraph } from '@open-pencil/scene-graph'
function graphWithAssignedLabel() {
const graph = new SceneGraph()
diff --git a/packages/scene-graph/tests/components/property/targets.test.ts b/packages/scene-graph/tests/components/property/targets.test.ts
index 419bab729..00d568dc8 100644
--- a/packages/scene-graph/tests/components/property/targets.test.ts
+++ b/packages/scene-graph/tests/components/property/targets.test.ts
@@ -1,6 +1,7 @@
import { expect, test } from 'bun:test'
-import { SceneGraph, findComponentPropertyTarget } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { findComponentPropertyTarget } from '@open-pencil/scene-graph/components'
test('component properties follow source identity when instance siblings are reordered', () => {
const graph = new SceneGraph()
diff --git a/packages/scene-graph/tests/components/removed-copies.test.ts b/packages/scene-graph/tests/components/removed-copies.test.ts
index 091783ae9..3bb58ae80 100644
--- a/packages/scene-graph/tests/components/removed-copies.test.ts
+++ b/packages/scene-graph/tests/components/removed-copies.test.ts
@@ -1,6 +1,8 @@
import { expect, test } from 'bun:test'
-import { DEFAULT_HISTORY_LIMIT, SceneGraph, setInstanceOverride } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
+import { DEFAULT_HISTORY_LIMIT } from '@open-pencil/scene-graph/undo'
/**
* A List component whose layer A an instance overrides, deleted, then `edits` other edits that
diff --git a/packages/scene-graph/tests/components/scale.test.ts b/packages/scene-graph/tests/components/scale.test.ts
index d0a3a4a4a..3ee85f70c 100644
--- a/packages/scene-graph/tests/components/scale.test.ts
+++ b/packages/scene-graph/tests/components/scale.test.ts
@@ -1,6 +1,7 @@
import { expect, test } from 'bun:test'
-import { SceneGraph, rescaleNodeTree } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { rescaleNodeTree } from '@open-pencil/scene-graph/scaling'
import { expectDefined } from '../helpers/assert'
diff --git a/packages/scene-graph/tests/components/swapped-fill.test.ts b/packages/scene-graph/tests/components/swapped-fill.test.ts
index 3f02a6fb0..c64ec2088 100644
--- a/packages/scene-graph/tests/components/swapped-fill.test.ts
+++ b/packages/scene-graph/tests/components/swapped-fill.test.ts
@@ -1,6 +1,7 @@
import { expect, test } from 'bun:test'
-import { SceneGraph, setInstanceOverride, type SceneNode } from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
import { expectDefined } from '../helpers/assert'
diff --git a/packages/scene-graph/tests/components/sync-field-contract.test.ts b/packages/scene-graph/tests/components/sync-field-contract.test.ts
index 2cc2a8232..0c88f396a 100644
--- a/packages/scene-graph/tests/components/sync-field-contract.test.ts
+++ b/packages/scene-graph/tests/components/sync-field-contract.test.ts
@@ -1,6 +1,7 @@
import { expect, test } from 'bun:test'
-import { SceneGraph, setInstanceOverride, type SceneNode } from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
import { expectDefined } from '../helpers/assert'
diff --git a/packages/scene-graph/tests/components/variants.test.ts b/packages/scene-graph/tests/components/variants.test.ts
index b8d0494dc..feda1d121 100644
--- a/packages/scene-graph/tests/components/variants.test.ts
+++ b/packages/scene-graph/tests/components/variants.test.ts
@@ -1,11 +1,11 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
defaultVariant,
restingVariant,
- SceneGraph,
variantDefaultValue
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/components'
/** A set of sizes laid out with Large first in its children but Small in the top-left corner. */
function sizes(defaultValue: string) {
diff --git a/packages/scene-graph/tests/connectors/endpoints.test.ts b/packages/scene-graph/tests/connectors/endpoints.test.ts
index b92eabec8..a319a34d5 100644
--- a/packages/scene-graph/tests/connectors/endpoints.test.ts
+++ b/packages/scene-graph/tests/connectors/endpoints.test.ts
@@ -1,14 +1,12 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph, type VectorNetwork } from '@open-pencil/scene-graph'
import {
- applyGraphTransfer,
boundEndpoint,
buildConnectorSublayers,
- freeEndpoint,
- prepareGraphTransfer,
- SceneGraph
-} from '@open-pencil/scene-graph'
-import type { VectorNetwork } from '@open-pencil/scene-graph'
+ freeEndpoint
+} from '@open-pencil/scene-graph/connectors'
+import { applyGraphTransfer, prepareGraphTransfer } from '@open-pencil/scene-graph/transfer'
const straight = { tangentStart: { x: 0, y: 0 }, tangentEnd: { x: 0, y: 0 } }
diff --git a/packages/scene-graph/tests/connectors/layout.test.ts b/packages/scene-graph/tests/connectors/layout.test.ts
index 9701d3256..cba7a823e 100644
--- a/packages/scene-graph/tests/connectors/layout.test.ts
+++ b/packages/scene-graph/tests/connectors/layout.test.ts
@@ -1,5 +1,6 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph, type Stroke } from '@open-pencil/scene-graph'
import {
attachedConnectors,
boundEndpoint,
@@ -8,10 +9,8 @@ import {
connectorSublayers,
createConnector,
freeEndpoint,
- layoutConnector,
- SceneGraph,
- type Stroke
-} from '@open-pencil/scene-graph'
+ layoutConnector
+} from '@open-pencil/scene-graph/connectors'
import { BLACK } from '@open-pencil/scene-graph/constants'
function boxes() {
diff --git a/packages/scene-graph/tests/connectors/route.test.ts b/packages/scene-graph/tests/connectors/route.test.ts
index cdeb89e4d..899bf16e7 100644
--- a/packages/scene-graph/tests/connectors/route.test.ts
+++ b/packages/scene-graph/tests/connectors/route.test.ts
@@ -8,7 +8,7 @@ import {
placeConnectorLabel,
routeConnector,
type ConnectorRouteEnd
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/connectors'
const MAGNETS = [
'NONE',
diff --git a/packages/scene-graph/tests/connectors/sublayers.test.ts b/packages/scene-graph/tests/connectors/sublayers.test.ts
index 6692db052..6cc07b5ab 100644
--- a/packages/scene-graph/tests/connectors/sublayers.test.ts
+++ b/packages/scene-graph/tests/connectors/sublayers.test.ts
@@ -1,11 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import {
- connectorDash,
- connectorLineStyle,
- connectorLineStyleFields,
- connectorStroke
-} from '@open-pencil/scene-graph'
+import { connectorDash, connectorLineStyle, connectorLineStyleFields, connectorStroke } from '@open-pencil/scene-graph/connectors'
describe('connector line style', () => {
test("FigJam's dash is longer for a thick line", () => {
diff --git a/packages/scene-graph/tests/css/shadows.test.ts b/packages/scene-graph/tests/css/shadows.test.ts
index 9185e9949..18dfe46f2 100644
--- a/packages/scene-graph/tests/css/shadows.test.ts
+++ b/packages/scene-graph/tests/css/shadows.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import type { Color, Effect } from '@open-pencil/scene-graph'
+import type { Effect } from '@open-pencil/scene-graph'
import { parseCSSShadows } from '@open-pencil/scene-graph/css'
+import type { Color } from '@open-pencil/scene-graph/primitives'
const RED: Color = { r: 1, g: 0, b: 0, a: 1 }
diff --git a/packages/scene-graph/tests/figjam/palette.test.ts b/packages/scene-graph/tests/figjam/palette.test.ts
index 999f22328..cea845171 100644
--- a/packages/scene-graph/tests/figjam/palette.test.ts
+++ b/packages/scene-graph/tests/figjam/palette.test.ts
@@ -1,16 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import {
- createShapeWithText,
- figJamColor,
- figJamColorName,
- figJamLineColorFields,
- figJamLineStyle,
- figJamLineStyleFields,
- figJamShapePaint,
- SceneGraph,
- shapeWithTextLabel
-} from '@open-pencil/scene-graph'
+import { createShapeWithText, shapeWithTextLabel } from '@open-pencil/scene-graph/generated'
+import { figJamColor, figJamColorName, figJamLineColorFields, figJamLineStyle, figJamLineStyleFields, figJamShapePaint } from '@open-pencil/scene-graph/figjam'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { colorToHex } from '@open-pencil/scene-graph/color'
/** A shape as FigJam's tool places it: white, with its #757575 outline and a dark label. */
diff --git a/packages/scene-graph/tests/figjam/text.test.ts b/packages/scene-graph/tests/figjam/text.test.ts
index 7536a1392..01fe65a74 100644
--- a/packages/scene-graph/tests/figjam/text.test.ts
+++ b/packages/scene-graph/tests/figjam/text.test.ts
@@ -1,10 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import {
- figJamTextSizeFields,
- figJamTypeface,
- figJamTypefaceFields
-} from '@open-pencil/scene-graph'
+import { figJamTextSizeFields, figJamTypeface, figJamTypefaceFields } from '@open-pencil/scene-graph/figjam'
// Values measured in FigJam's text menus.
describe("FigJam's text", () => {
diff --git a/packages/scene-graph/tests/generated/kind.test.ts b/packages/scene-graph/tests/generated/kind.test.ts
index a2baa4074..fd96aa58f 100644
--- a/packages/scene-graph/tests/generated/kind.test.ts
+++ b/packages/scene-graph/tests/generated/kind.test.ts
@@ -1,5 +1,6 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
createShapeWithText,
createSticky,
@@ -7,9 +8,8 @@ import {
generatedFrameText,
layerResizes,
layerRotates,
- SceneGraph,
stickySublayers
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/generated'
describe('generated frame kinds', () => {
test('a sticky note edits its body in place, stays upright, and scales by its own handles', () => {
diff --git a/packages/scene-graph/tests/group-bounds.test.ts b/packages/scene-graph/tests/group-bounds.test.ts
index 87ae14a9b..44e1569f5 100644
--- a/packages/scene-graph/tests/group-bounds.test.ts
+++ b/packages/scene-graph/tests/group-bounds.test.ts
@@ -1,6 +1,7 @@
import { expect, test } from 'bun:test'
-import { fitEnclosingGroups, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { fitEnclosingGroups } from '@open-pencil/scene-graph/group-bounds'
// Live Figma 126: a group holding a rectangle, then a mask ellipse, then a larger rectangle
// measures 0,0 150×150, and moving the masked rectangle leaves it unchanged.
diff --git a/packages/scene-graph/tests/icons/model.test.ts b/packages/scene-graph/tests/icons/model.test.ts
index 00f074003..6e71f2740 100644
--- a/packages/scene-graph/tests/icons/model.test.ts
+++ b/packages/scene-graph/tests/icons/model.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { iconNames, SceneGraph, withIcon } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { iconNames, withIcon } from '@open-pencil/scene-graph/icons'
function icon(graph: SceneGraph, parentId: string, name: string) {
const frame = graph.createNode('FRAME', parentId, { name: `Icon / ${name}` })
diff --git a/packages/scene-graph/tests/images.test.ts b/packages/scene-graph/tests/images.test.ts
index f3d2c5083..e4a2c8e6d 100644
--- a/packages/scene-graph/tests/images.test.ts
+++ b/packages/scene-graph/tests/images.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { computeImageHash, coverImageTransform, imageMimeType } from '@open-pencil/scene-graph'
+import { computeImageHash, imageMimeType, coverImageTransform } from '@open-pencil/scene-graph/images'
describe('computeImageHash', () => {
test('names bytes by their SHA-1, as Figma names images', () => {
diff --git a/packages/scene-graph/tests/instance-overrides.test.ts b/packages/scene-graph/tests/instance-overrides.test.ts
index 5a8a68187..066fa86bf 100644
--- a/packages/scene-graph/tests/instance-overrides.test.ts
+++ b/packages/scene-graph/tests/instance-overrides.test.ts
@@ -10,7 +10,7 @@ import {
hasInstanceOverride,
serializeInstanceOverrideState,
setInstanceOverride
-} from '../src/instance-overrides'
+} from '../src/instances/overrides'
describe('instance override state', () => {
test('stores self and descendant values structurally', () => {
diff --git a/packages/scene-graph/tests/instance-sync-duplication.test.ts b/packages/scene-graph/tests/instance-sync-duplication.test.ts
index ffe5a4cb8..1d7446827 100644
--- a/packages/scene-graph/tests/instance-sync-duplication.test.ts
+++ b/packages/scene-graph/tests/instance-sync-duplication.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
import { linkImportedInstanceChildren } from '@open-pencil/fig/node-change'
-import { SceneGraph, recordInstanceOverride } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { recordInstanceOverride } from '@open-pencil/scene-graph/instances'
describe('instance synchronization child deduplication', () => {
test('syncInstances on instance with imported children without componentId does not duplicate children', () => {
diff --git a/packages/scene-graph/tests/layout/aspect-ratio.test.ts b/packages/scene-graph/tests/layout/aspect-ratio.test.ts
index 7e8c08a95..c819bdedf 100644
--- a/packages/scene-graph/tests/layout/aspect-ratio.test.ts
+++ b/packages/scene-graph/tests/layout/aspect-ratio.test.ts
@@ -1,11 +1,11 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
enforcedAspectRatio,
recapturedAspectRatio,
- SceneGraph,
sizeKeepingAspectRatio
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/layout'
describe('aspect ratio lock', () => {
test('a locked layer keeps the ratio of its stored size', () => {
diff --git a/packages/scene-graph/tests/layout/keywords.test.ts b/packages/scene-graph/tests/layout/keywords.test.ts
index ec25893a9..21a1539cd 100644
--- a/packages/scene-graph/tests/layout/keywords.test.ts
+++ b/packages/scene-graph/tests/layout/keywords.test.ts
@@ -6,7 +6,7 @@ import {
parseCounterAxisAlign,
parseLayoutAlignSelf,
parsePrimaryAxisAlign
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/layout'
describe('auto layout keywords', () => {
test('read stack directions in each format spelling', () => {
diff --git a/packages/scene-graph/tests/layout/sizing.test.ts b/packages/scene-graph/tests/layout/sizing.test.ts
index ae501aa3c..72375a669 100644
--- a/packages/scene-graph/tests/layout/sizing.test.ts
+++ b/packages/scene-graph/tests/layout/sizing.test.ts
@@ -1,13 +1,12 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
import {
autoLayoutSizingFields,
fillSizingFields,
layoutSizing,
- layoutSizingUpdates,
- SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ layoutSizingUpdates
+} from '@open-pencil/scene-graph/layout'
function child(parent: Partial<SceneNode>, node: Partial<SceneNode> = {}) {
const graph = new SceneGraph()
diff --git a/packages/scene-graph/tests/mutation-impact.test.ts b/packages/scene-graph/tests/mutation-impact.test.ts
index 1bc38bc7a..cb5e5a176 100644
--- a/packages/scene-graph/tests/mutation-impact.test.ts
+++ b/packages/scene-graph/tests/mutation-impact.test.ts
@@ -1,6 +1,10 @@
import { describe, expect, test } from 'bun:test'
-import { collectSceneMutation, mutationLayoutScopeIds, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import {
+ collectSceneMutation,
+ mutationLayoutScopeIds
+} from '@open-pencil/scene-graph/mutation-impact'
function pageId(graph: SceneGraph): string {
return graph.getPages()[0].id
@@ -53,11 +57,11 @@ describe('scene mutation impact', () => {
expect(impact.currentParentIds).toContain(right.id)
})
- test('retains old and new parents when reorderChild transfers a node', async () => {
+ test('retains old and new parents when insertChildAt transfers a node', async () => {
const { graph, left, right, child } = transferSetup()
const { impact } = await collectSceneMutation(graph, () =>
- graph.reorderChild(child.id, right.id, 0)
+ graph.insertChildAt(child.id, right.id, 0)
)
expect(child.parentId).toBe(right.id)
diff --git a/packages/scene-graph/tests/plugin-data/fields.test.ts b/packages/scene-graph/tests/plugin-data/fields.test.ts
index fff1c6592..2933ba52e 100644
--- a/packages/scene-graph/tests/plugin-data/fields.test.ts
+++ b/packages/scene-graph/tests/plugin-data/fields.test.ts
@@ -1,21 +1,20 @@
import { describe, expect, test } from 'bun:test'
-import {
- contentPluginData,
- OPEN_PENCIL_PLUGIN_DATA,
- OPEN_PENCIL_PLUGIN_ID,
- readAllPluginData,
- readPluginData,
- SceneGraph,
- withPluginData,
- type PluginDataEntry
-} from '@open-pencil/scene-graph'
+import { SceneGraph, type PluginDataEntry } from '@open-pencil/scene-graph'
import {
clearNodeFillOkHCL,
getNodeOkHCLPayloads,
setNodeFillOkHCL,
setNodeStrokeOkHCL
} from '@open-pencil/scene-graph/color'
+import {
+ contentPluginData,
+ OPEN_PENCIL_PLUGIN_DATA,
+ OPEN_PENCIL_PLUGIN_ID,
+ readAllPluginData,
+ readPluginData,
+ withPluginData
+} from '@open-pencil/scene-graph/plugin-data'
const { exportSettings, okhcl, textDirection } = OPEN_PENCIL_PLUGIN_DATA
const OTHER_PLUGIN: PluginDataEntry = { pluginId: 'other-plugin', key: 'okhcl', value: 'theirs' }
@@ -71,7 +70,12 @@ describe('OpenPencil plugin data', () => {
test('picking an OkHCL color keeps the node’s other plugin data', () => {
const graph = new SceneGraph()
- const paint = { type: 'SOLID' as const, visible: true, opacity: 1, color: { r: 1, g: 0, b: 0, a: 1 } }
+ const paint = {
+ type: 'SOLID' as const,
+ visible: true,
+ opacity: 1,
+ color: { r: 1, g: 0, b: 0, a: 1 }
+ }
const node = graph.createNode('FRAME', graph.getPages()[0].id, {
fills: [paint],
strokes: [{ ...paint, weight: 1, align: 'INSIDE' as const }],
diff --git a/packages/scene-graph/tests/reparent-transform.test.ts b/packages/scene-graph/tests/reparent-transform.test.ts
index e4c59ff32..04b6adb17 100644
--- a/packages/scene-graph/tests/reparent-transform.test.ts
+++ b/packages/scene-graph/tests/reparent-transform.test.ts
@@ -1,6 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { getWorldMatrix, SceneGraph, TransformMatrix } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
+import TransformMatrix from '@open-pencil/scene-graph/matrix'
function setup() {
const graph = new SceneGraph()
diff --git a/packages/scene-graph/tests/shaders/model.test.ts b/packages/scene-graph/tests/shaders/model.test.ts
index 16fbe2164..0a3d9c192 100644
--- a/packages/scene-graph/tests/shaders/model.test.ts
+++ b/packages/scene-graph/tests/shaders/model.test.ts
@@ -1,17 +1,16 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { OPEN_PENCIL_PLUGIN_DATA, pluginDataEntry } from '@open-pencil/scene-graph/plugin-data'
import {
createShaderPaint,
isShaderFrameCurrent,
- OPEN_PENCIL_PLUGIN_DATA,
- pluginDataEntry,
readShaderPaints,
- SceneGraph,
shaderOfPaint,
shaderPresetKey,
withShaderPaints,
type ShaderPreset
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/shaders'
const AURORA: ShaderPreset = {
components: [{ type: 'Aurora', props: { colorA: '#7c3aed' } }]
diff --git a/packages/scene-graph/tests/shaders/still.test.ts b/packages/scene-graph/tests/shaders/still.test.ts
index 457316aa1..6ef74b487 100644
--- a/packages/scene-graph/tests/shaders/still.test.ts
+++ b/packages/scene-graph/tests/shaders/still.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { shaderFrameEncoding, shaderFramePixels } from '@open-pencil/scene-graph'
+import { shaderFrameEncoding, shaderFramePixels } from '@open-pencil/scene-graph/shaders'
/** RGBA pixels with every alpha set to `alpha`. */
function pixels(count: number, alpha: number): Uint8ClampedArray {
diff --git a/packages/scene-graph/tests/shape-with-text/geometry.test.ts b/packages/scene-graph/tests/shape-with-text/geometry.test.ts
index 342700218..66eba1f59 100644
--- a/packages/scene-graph/tests/shape-with-text/geometry.test.ts
+++ b/packages/scene-graph/tests/shape-with-text/geometry.test.ts
@@ -1,11 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import type { Vector } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import type { PolygonOutlineCommand } from '@open-pencil/scene-graph/polygon'
-import {
- SHAPE_WITH_TEXT_TYPES,
- shapeWithTextGeometry
-} from '@open-pencil/scene-graph/shape-with-text'
+import { SHAPE_WITH_TEXT_TYPES, shapeWithTextGeometry } from '@open-pencil/scene-graph/shape-with-text'
function points(commands: PolygonOutlineCommand[]): Vector[] {
return commands.flatMap((command) => {
diff --git a/packages/scene-graph/tests/slots/content.test.ts b/packages/scene-graph/tests/slots/content.test.ts
index 565dea1e9..619669403 100644
--- a/packages/scene-graph/tests/slots/content.test.ts
+++ b/packages/scene-graph/tests/slots/content.test.ts
@@ -1,15 +1,14 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
import {
claimSlotContent,
clearSlotContent,
ownsSlotContent,
resetSlotContent,
- SceneGraph,
slotPropertyId,
- slotScope,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ slotScope
+} from '@open-pencil/scene-graph/slots'
/** A component set with a Small and a Large variant, each with a `Content` slot. */
function panel(graph: SceneGraph, page: SceneNode) {
diff --git a/packages/scene-graph/tests/statuses/impact.test.ts b/packages/scene-graph/tests/statuses/impact.test.ts
index cbd79ea99..35a4bf0bf 100644
--- a/packages/scene-graph/tests/statuses/impact.test.ts
+++ b/packages/scene-graph/tests/statuses/impact.test.ts
@@ -1,18 +1,19 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
- SceneGraph,
statusWorkflowImpact,
STATUS_WORKFLOW_PRESETS,
type StatusWorkflow
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/statuses'
const { review } = STATUS_WORKFLOW_PRESETS
function setup(states: Record<string, string>) {
const graph = new SceneGraph()
const page = graph.getPages()[0].id
- for (const [name, status] of Object.entries(states)) graph.createNode('FRAME', page, { name, status })
+ for (const [name, status] of Object.entries(states))
+ graph.createNode('FRAME', page, { name, status })
return graph
}
@@ -30,9 +31,9 @@ describe('what a workflow change does to layers', () => {
test('a rename of a state in use, counted per pair of names', () => {
const graph = setup({ A: 'approved', B: 'approved', C: 'draft' })
- expect(statusWorkflowImpact(graph, review, renamed(review, 'approved', 'Signed off'), {})).toEqual([
- { from: 'Approved', to: 'Signed off', count: 2 }
- ])
+ expect(
+ statusWorkflowImpact(graph, review, renamed(review, 'approved', 'Signed off'), {})
+ ).toEqual([{ from: 'Approved', to: 'Signed off', count: 2 }])
})
test('a dropped state moves its layers or clears their status', () => {
diff --git a/packages/scene-graph/tests/statuses/workflow.test.ts b/packages/scene-graph/tests/statuses/workflow.test.ts
index 8961267c9..359dcfe26 100644
--- a/packages/scene-graph/tests/statuses/workflow.test.ts
+++ b/packages/scene-graph/tests/statuses/workflow.test.ts
@@ -1,14 +1,13 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { OPEN_PENCIL_PLUGIN_DATA, withPluginData } from '@open-pencil/scene-graph/plugin-data'
import {
findStatusState,
- OPEN_PENCIL_PLUGIN_DATA,
readStatusWorkflow,
- SceneGraph,
STATUS_WORKFLOW_PRESETS,
- withPluginData,
writeStatusWorkflow
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/statuses'
describe('status workflow', () => {
test("a document without one has Figma's Ready for dev and Completed", () => {
diff --git a/packages/scene-graph/tests/text/layout-invalidation.test.ts b/packages/scene-graph/tests/text/layout-invalidation.test.ts
index 11222c87d..324df2921 100644
--- a/packages/scene-graph/tests/text/layout-invalidation.test.ts
+++ b/packages/scene-graph/tests/text/layout-invalidation.test.ts
@@ -1,7 +1,7 @@
import { expect, test } from 'bun:test'
-import { SceneGraph, copyStyleRuns } from '@open-pencil/scene-graph'
-import type { SceneNode } from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { copyStyleRuns } from '@open-pencil/scene-graph/copy'
import { scaledGeometryChanges } from '@open-pencil/scene-graph/resize'
const shapingEdits: Partial<SceneNode>[] = [
diff --git a/packages/scene-graph/tests/text/lists.test.ts b/packages/scene-graph/tests/text/lists.test.ts
index 259820ae3..b67c7de31 100644
--- a/packages/scene-graph/tests/text/lists.test.ts
+++ b/packages/scene-graph/tests/text/lists.test.ts
@@ -1,5 +1,6 @@
import { describe, expect, test } from 'bun:test'
+import type { TextParagraphStyle } from '@open-pencil/scene-graph'
import {
paragraphStylesAfterEdit,
paragraphStylesAfterTextChange,
@@ -7,9 +8,8 @@ import {
textListItems,
topLevelNumberDigits,
withIndentation,
- withListType,
- type TextParagraphStyle
-} from '@open-pencil/scene-graph'
+ withListType
+} from '@open-pencil/scene-graph/text'
const ol = (indentation = 1): TextParagraphStyle => ({ listType: 'ORDERED', indentation })
const ul = (indentation = 1): TextParagraphStyle => ({ listType: 'UNORDERED', indentation })
@@ -43,7 +43,17 @@ describe('list numbering', () => {
const letters = markers([ol(1), ...Array.from({ length: 28 }, () => ol(2))])
expect(letters.slice(-3)).toEqual(['z.', 'aa.', 'ab.'])
const numerals = markers([ol(1), ol(2), ...Array.from({ length: 9 }, () => ol(3))])
- expect(numerals.slice(2)).toEqual(['i.', 'ii.', 'iii.', 'iv.', 'v.', 'vi.', 'vii.', 'viii.', 'ix.'])
+ expect(numerals.slice(2)).toEqual([
+ 'i.',
+ 'ii.',
+ 'iii.',
+ 'iv.',
+ 'v.',
+ 'vi.',
+ 'vii.',
+ 'viii.',
+ 'ix.'
+ ])
})
test('styles markers from the first item of each list group', () => {
@@ -52,10 +62,10 @@ describe('list numbering', () => {
})
test('widens by the digits of the largest top-level number only', () => {
- const items = textListItems(
- Array.from({ length: 13 }, (_, index) => `p${index}`).join('\n'),
- [ol(1), ...Array.from({ length: 12 }, () => ol(4))]
- )
+ const items = textListItems(Array.from({ length: 13 }, (_, index) => `p${index}`).join('\n'), [
+ ol(1),
+ ...Array.from({ length: 12 }, () => ol(4))
+ ])
expect(topLevelNumberDigits(items)).toBe(1)
const long = textListItems(
Array.from({ length: 12 }, (_, index) => `p${index}`).join('\n'),
@@ -67,8 +77,16 @@ describe('list numbering', () => {
describe('paragraph styles through edits', () => {
test('continue the list into inserted paragraphs', () => {
- expect(paragraphStylesAfterEdit([ul(), ul()], 'a\nb', 1, 1, '\nnew')).toEqual([ul(), ul(), ul()])
- expect(paragraphStylesAfterEdit([plain, ol()], 'a\nb', 3, 3, '\nend')).toEqual([plain, ol(), ol()])
+ expect(paragraphStylesAfterEdit([ul(), ul()], 'a\nb', 1, 1, '\nnew')).toEqual([
+ ul(),
+ ul(),
+ ul()
+ ])
+ expect(paragraphStylesAfterEdit([plain, ol()], 'a\nb', 3, 3, '\nend')).toEqual([
+ plain,
+ ol(),
+ ol()
+ ])
})
test('keep the first paragraph style when a newline is deleted', () => {
@@ -78,12 +96,18 @@ describe('paragraph styles through edits', () => {
test('follow an editor that replaces the whole text', () => {
// Enter at the end of an item, then joining the item back.
- expect(paragraphStylesAfterTextChange([plain, ol()], 'a\nb', 'a\nb\n')).toEqual([plain, ol(), ol()])
+ expect(paragraphStylesAfterTextChange([plain, ol()], 'a\nb', 'a\nb\n')).toEqual([
+ plain,
+ ol(),
+ ol()
+ ])
expect(paragraphStylesAfterTextChange([ul(), ol()], 'a\nb', 'ab')).toEqual([ul()])
})
test('change whole paragraphs a range touches, not the one after its newline', () => {
- const next = paragraphStylesInRange([], 'a\nb\nc', 0, 2, (style) => withListType(style, 'ORDERED'))
+ const next = paragraphStylesInRange([], 'a\nb\nc', 0, 2, (style) =>
+ withListType(style, 'ORDERED')
+ )
expect(next).toEqual([ol()])
})
diff --git a/packages/scene-graph/tests/text/paragraphs.test.ts b/packages/scene-graph/tests/text/paragraphs.test.ts
index 99ad69607..47373cdbe 100644
--- a/packages/scene-graph/tests/text/paragraphs.test.ts
+++ b/packages/scene-graph/tests/text/paragraphs.test.ts
@@ -1,5 +1,6 @@
import { describe, expect, test } from 'bun:test'
+import type { TextParagraphStyle } from '@open-pencil/scene-graph'
import {
paragraphSpacingAt,
paragraphStylesAfterEdit,
@@ -7,9 +8,8 @@ import {
sharedParagraphSpacing,
trimParagraphStyles,
withListType,
- withParagraphSpacing,
- type TextParagraphStyle
-} from '@open-pencil/scene-graph'
+ withParagraphSpacing
+} from '@open-pencil/scene-graph/text'
const plain: TextParagraphStyle = { listType: 'NONE', indentation: 0 }
const node = (textParagraphs: TextParagraphStyle[]) => ({
diff --git a/packages/scene-graph/tests/text/references.test.ts b/packages/scene-graph/tests/text/references.test.ts
index 52ac36d3e..24d8d0312 100644
--- a/packages/scene-graph/tests/text/references.test.ts
+++ b/packages/scene-graph/tests/text/references.test.ts
@@ -1,10 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import {
- remapStyleRunReferences,
- styleRunReferences,
- type StyleRun
-} from '@open-pencil/scene-graph'
+import type { StyleRun } from '@open-pencil/scene-graph'
+import { remapStyleRunReferences, styleRunReferences } from '@open-pencil/scene-graph/text'
const RUNS: StyleRun[] = [
{ start: 0, length: 2, style: { boundVariables: { fontSize: 'v1' }, textStyleId: 's1' } },
diff --git a/packages/scene-graph/tests/transfer/apply.test.ts b/packages/scene-graph/tests/transfer/apply.test.ts
index 3c1b7ef17..f5787c0d0 100644
--- a/packages/scene-graph/tests/transfer/apply.test.ts
+++ b/packages/scene-graph/tests/transfer/apply.test.ts
@@ -1,12 +1,8 @@
import { expect, test } from 'bun:test'
-import {
- applyGraphTransfer,
- getSharedStyles,
- prepareGraphTransfer,
- SceneGraph,
- CommittedGraphEventError
-} from '@open-pencil/scene-graph'
+import { SceneGraph, CommittedGraphEventError } from '@open-pencil/scene-graph'
+import { getSharedStyles } from '@open-pencil/scene-graph/shared-styles'
+import { applyGraphTransfer, prepareGraphTransfer } from '@open-pencil/scene-graph/transfer'
function setup() {
const source = new SceneGraph(),
diff --git a/packages/scene-graph/tests/transfer/history.test.ts b/packages/scene-graph/tests/transfer/history.test.ts
index 1c4490bc6..4f897120d 100644
--- a/packages/scene-graph/tests/transfer/history.test.ts
+++ b/packages/scene-graph/tests/transfer/history.test.ts
@@ -1,11 +1,11 @@
import { expect, test } from 'bun:test'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
applyGraphTransfer,
captureTransferredState,
- prepareGraphTransfer,
- SceneGraph
-} from '@open-pencil/scene-graph'
+ prepareGraphTransfer
+} from '@open-pencil/scene-graph/transfer'
test('history captures post-placement geometry and separates reused image ownership', () => {
const source = new SceneGraph(),
diff --git a/packages/scene-graph/tests/transfer/nodes.test.ts b/packages/scene-graph/tests/transfer/nodes.test.ts
index 589cd479d..612d019d4 100644
--- a/packages/scene-graph/tests/transfer/nodes.test.ts
+++ b/packages/scene-graph/tests/transfer/nodes.test.ts
@@ -1,10 +1,7 @@
import { expect, test } from 'bun:test'
-import {
- prepareNodeTransfer,
- SceneGraph,
- type NodeTransferReferences
-} from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { prepareNodeTransfer, type NodeTransferReferences } from '@open-pencil/scene-graph/transfer'
const references = (): NodeTransferReferences => ({
nodes: new Map([['component', 'new-component']]),
diff --git a/packages/scene-graph/tests/transfer/variables.test.ts b/packages/scene-graph/tests/transfer/variables.test.ts
index 0abcd7cc5..4ec4bc40b 100644
--- a/packages/scene-graph/tests/transfer/variables.test.ts
+++ b/packages/scene-graph/tests/transfer/variables.test.ts
@@ -1,10 +1,7 @@
import { expect, test } from 'bun:test'
-import {
- prepareVariableTransfer,
- type Variable,
- type VariableCollection
-} from '@open-pencil/scene-graph'
+import type { Variable, VariableCollection } from '@open-pencil/scene-graph'
+import { prepareVariableTransfer } from '@open-pencil/scene-graph/transfer'
const collections: VariableCollection[] = [
{
diff --git a/packages/scene-graph/tests/undo/batch.test.ts b/packages/scene-graph/tests/undo/batch.test.ts
index 3873107af..b835e4d55 100644
--- a/packages/scene-graph/tests/undo/batch.test.ts
+++ b/packages/scene-graph/tests/undo/batch.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { UndoManager } from '@open-pencil/scene-graph'
+import { UndoManager } from '@open-pencil/scene-graph/undo'
test('discarding nested batches preserves committed undo/redo without replay or notifications', () => {
let changes = 0
diff --git a/packages/scene-graph/tests/undo/extend.test.ts b/packages/scene-graph/tests/undo/extend.test.ts
index 845bf4d5a..bf8a020b6 100644
--- a/packages/scene-graph/tests/undo/extend.test.ts
+++ b/packages/scene-graph/tests/undo/extend.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { UndoManager } from '@open-pencil/scene-graph'
+import { UndoManager } from '@open-pencil/scene-graph/undo'
test('a change a step caused joins it, so undo and redo apply them together', () => {
const undo = new UndoManager()
diff --git a/packages/scene-graph/tests/undo/mutation.test.ts b/packages/scene-graph/tests/undo/mutation.test.ts
index 491b122c6..03a802d3d 100644
--- a/packages/scene-graph/tests/undo/mutation.test.ts
+++ b/packages/scene-graph/tests/undo/mutation.test.ts
@@ -1,6 +1,7 @@
import { describe, test, expect } from 'bun:test'
-import { SceneGraph, UndoManager, type SceneNode } from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { UndoManager } from '@open-pencil/scene-graph/undo'
import { getNodeOrThrow } from '../helpers/assert'
diff --git a/packages/scene-graph/tests/undo/peek.test.ts b/packages/scene-graph/tests/undo/peek.test.ts
index 03a9e22bb..1aca7fe24 100644
--- a/packages/scene-graph/tests/undo/peek.test.ts
+++ b/packages/scene-graph/tests/undo/peek.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { UndoManager } from '@open-pencil/scene-graph'
+import { UndoManager } from '@open-pencil/scene-graph/undo'
test('peeks entries from the top of the undo stack without changing it', () => {
const undo = new UndoManager()
diff --git a/packages/scene-graph/tests/variable/binding/instance-override.test.ts b/packages/scene-graph/tests/variable/binding/instance-override.test.ts
index 8f49d63e0..ad55bacbf 100644
--- a/packages/scene-graph/tests/variable/binding/instance-override.test.ts
+++ b/packages/scene-graph/tests/variable/binding/instance-override.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph, getInstanceOverride } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { getInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
function pageId(graph: SceneGraph): string {
return graph.getPages()[0].id
}
diff --git a/packages/scene-graph/tests/variable/binding/scope.test.ts b/packages/scene-graph/tests/variable/binding/scope.test.ts
index 2999ddc81..716b61f46 100644
--- a/packages/scene-graph/tests/variable/binding/scope.test.ts
+++ b/packages/scene-graph/tests/variable/binding/scope.test.ts
@@ -1,10 +1,10 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
reconcileVariableBindings,
- SceneGraph,
variablesResolvingThrough
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/variables'
/** Two layers saved at 10 while their bindings say otherwise, as layers in imported files can be. */
function drifted() {
diff --git a/packages/scene-graph/tests/variable/binding/value-text.test.ts b/packages/scene-graph/tests/variable/binding/value-text.test.ts
index a3a0140c5..a7140cb1f 100644
--- a/packages/scene-graph/tests/variable/binding/value-text.test.ts
+++ b/packages/scene-graph/tests/variable/binding/value-text.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { variableText } from '@open-pencil/scene-graph'
+import { variableText } from '@open-pencil/scene-graph/variables'
// What Figma desktop 126 showed for text bound to each float32 variable value.
const FIGMA_TEXT: Array<[number, string]> = [
diff --git a/packages/scene-graph/tests/variable/token.test.ts b/packages/scene-graph/tests/variable/token.test.ts
index b0ba686a7..ef2e474f6 100644
--- a/packages/scene-graph/tests/variable/token.test.ts
+++ b/packages/scene-graph/tests/variable/token.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { tokenNumberFromUnit, tokenNumberInUnit } from '@open-pencil/scene-graph'
+import { tokenNumberFromUnit, tokenNumberInUnit } from '@open-pencil/scene-graph/variables'
describe('token units', () => {
test('store rem as canvas pixels and read it back', () => {
diff --git a/packages/scene-graph/tests/variables/color-expression.test.ts b/packages/scene-graph/tests/variables/color-expression.test.ts
index b5fafebac..c16cdbef8 100644
--- a/packages/scene-graph/tests/variables/color-expression.test.ts
+++ b/packages/scene-graph/tests/variables/color-expression.test.ts
@@ -1,11 +1,10 @@
import { expect, test } from 'bun:test'
+import { SceneGraph, type VariableValue } from '@open-pencil/scene-graph'
import {
- SceneGraph,
mapVariableValueReferences,
- variablesResolvingThrough,
- type VariableValue
-} from '@open-pencil/scene-graph'
+ variablesResolvingThrough
+} from '@open-pencil/scene-graph/variables'
function setup() {
const graph = new SceneGraph()
diff --git a/packages/scene-graph/tests/variables/formula.test.ts b/packages/scene-graph/tests/variables/formula.test.ts
index 68c804205..8ba437c13 100644
--- a/packages/scene-graph/tests/variables/formula.test.ts
+++ b/packages/scene-graph/tests/variables/formula.test.ts
@@ -2,8 +2,8 @@ import { expect, test, spyOn } from 'bun:test'
import * as v from 'valibot'
+import { SceneGraph, type VariableFormulaNode, type VariableValue } from '@open-pencil/scene-graph'
import {
- SceneGraph,
parseVariableFormula,
formatVariableFormula,
variableValueReferences,
@@ -11,10 +11,8 @@ import {
variableFormulaSchema,
collectionsBoundIn,
formulaTokens,
- type VariableFormulaNode,
- type VariableValue
-} from '@open-pencil/scene-graph'
-import { createBatchVariableResolver } from '@open-pencil/scene-graph/variables'
+ createBatchVariableResolver
+} from '@open-pencil/scene-graph/variables'
function setup(type: 'FLOAT' | 'BOOLEAN' = 'FLOAT') {
const graph = new SceneGraph()
@@ -328,8 +326,7 @@ test('collection discovery follows formulas and composed color operands transiti
})
test('the tokenizer reads half-typed formulas without failing, as an editor needs', () => {
- const kinds = (source: string) =>
- formulaTokens(source).map(({ kind, text }) => `${kind}:${text}`)
+ const kinds = (source: string) => formulaTokens(source).map(({ kind, text }) => `${kind}:${text}`)
expect(kinds('{space/md} * 2 - base')).toEqual([
'reference:{space/md}',
'operator:*',
diff --git a/packages/scene-graph/tests/variables/functions.test.ts b/packages/scene-graph/tests/variables/functions.test.ts
index 39e79d3ca..9a5d15bb7 100644
--- a/packages/scene-graph/tests/variables/functions.test.ts
+++ b/packages/scene-graph/tests/variables/functions.test.ts
@@ -2,14 +2,8 @@ import { expect, test } from 'bun:test'
import * as v from 'valibot'
-import {
- SceneGraph,
- formatVariableFormula,
- formulaTokens,
- parseVariableFormula,
- variableFormulaSchema,
- type VariableType
-} from '@open-pencil/scene-graph'
+import { SceneGraph, type VariableType } from '@open-pencil/scene-graph'
+import { formatVariableFormula, formulaTokens, parseVariableFormula, variableFormulaSchema } from '@open-pencil/scene-graph/variables'
/** A variable of each type to refer to, and one of `type` whose formula is parsed. */
function setup(type: VariableType) {
diff --git a/packages/scene-graph/tests/vector-network.test.ts b/packages/scene-graph/tests/vector-network.test.ts
index 8897d03c8..e709919cb 100644
--- a/packages/scene-graph/tests/vector-network.test.ts
+++ b/packages/scene-graph/tests/vector-network.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { mergeVectorNetworks, type VectorNetwork } from '@open-pencil/scene-graph'
+import type { VectorNetwork } from '@open-pencil/scene-graph'
+import { mergeVectorNetworks } from '@open-pencil/scene-graph/vector-network'
import { expectDefined } from './helpers/assert'
diff --git a/packages/scene-graph/tests/world-transform.test.ts b/packages/scene-graph/tests/world-transform.test.ts
index b95dbee69..00e282877 100644
--- a/packages/scene-graph/tests/world-transform.test.ts
+++ b/packages/scene-graph/tests/world-transform.test.ts
@@ -7,12 +7,9 @@
*/
import { describe, expect, test } from 'bun:test'
-import {
- getWorldHandles,
- getWorldMatrix,
- SceneGraph,
- TransformMatrix
-} from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { getWorldHandles, getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
+import TransformMatrix from '@open-pencil/scene-graph/matrix'
function pageId(graph: SceneGraph) {
return graph.getPages()[0].id
diff --git a/packages/scene-graph/tsdown.config.ts b/packages/scene-graph/tsdown.config.ts
index 271b05f89..93b47cce8 100644
--- a/packages/scene-graph/tsdown.config.ts
+++ b/packages/scene-graph/tsdown.config.ts
@@ -4,39 +4,62 @@ export default defineConfig({
entry: {
index: './src/index.ts',
'arrow-caps': './src/arrow-caps.ts',
+ 'asset-keys': './src/asset-keys.ts',
+ 'behaviours/index': './src/behaviours/index.ts',
+ checkpoint: './src/checkpoint.ts',
+ 'color/index': './src/color/index.ts',
+ 'comments/index': './src/comments/index.ts',
+ 'components/index': './src/components/index.ts',
+ 'connectors/index': './src/connectors/index.ts',
+ constants: './src/constants.ts',
+ coordinate: './src/coordinate.ts',
copy: './src/copy.ts',
- 'node-defaults': './src/node-defaults.ts',
+ 'css/index': './src/css/index.ts',
+ 'export-format': './src/export-format.ts',
+ 'export-scale': './src/export-scale.ts',
+ 'fields/index': './src/fields/index.ts',
+ 'fig-compression': './src/fig-compression.ts',
+ 'figjam/index': './src/figjam/index.ts',
+ 'font-style': './src/font-style.ts',
+ 'generated/index': './src/generated/index.ts',
+ geometry: './src/geometry.ts',
+ gradient: './src/gradient.ts',
+ 'group-bounds': './src/group-bounds.ts',
+ guides: './src/guides.ts',
'hit-test': './src/hit-test.ts',
+ 'icons/index': './src/icons/index.ts',
images: './src/images.ts',
- instances: './src/instances.ts',
+ 'instances/index': './src/instances/index.ts',
+ 'instances/overrides': './src/instances/overrides.ts',
+ 'layout/index': './src/layout/index.ts',
+ matrix: './src/matrix.ts',
+ 'mutation-impact': './src/mutation-impact.ts',
+ 'node-defaults': './src/node-defaults.ts',
+ 'order-keys': './src/order-keys.ts',
+ 'parse-path': './src/parse-path.ts',
+ 'plugin-data/index': './src/plugin-data/index.ts',
+ polygon: './src/polygon.ts',
+ preview: './src/preview.ts',
+ primitives: './src/primitives.ts',
+ random: './src/random.ts',
+ resize: './src/resize.ts',
+ 'scaling/index': './src/scaling/index.ts',
+ 'shaders/index': './src/shaders/index.ts',
+ 'shape-with-text/index': './src/shape-with-text/index.ts',
+ 'shared-styles': './src/shared-styles.ts',
+ 'slots/index': './src/slots/index.ts',
snap: './src/snap.ts',
'source-metadata': './src/source-metadata.ts',
- preview: './src/preview.ts',
- 'text-picture': './src/text/picture.ts',
+ 'statuses/index': './src/statuses/index.ts',
+ 'text/index': './src/text/index.ts',
+ 'text/direction': './src/text/direction.ts',
+ 'text/picture': './src/text/picture.ts',
+ 'transfer/index': './src/transfer/index.ts',
undo: './src/undo.ts',
- variables: './src/variables.ts',
+ 'variables/index': './src/variables/index.ts',
'variant-name': './src/variant-name.ts',
'variant-properties': './src/variant-properties.ts',
- 'vector-network': './src/vector-network.ts',
- types: './src/types.ts',
- primitives: './src/primitives.ts',
- constants: './src/constants.ts',
- coordinate: './src/coordinate.ts',
- matrix: './src/matrix.ts',
- geometry: './src/geometry.ts',
- gradient: './src/gradient.ts',
- polygon: './src/polygon.ts',
- 'shape-with-text': './src/shape-with-text/index.ts',
- guides: './src/guides.ts',
- layout: './src/layout/index.ts',
- text: './src/text/index.ts',
- resize: './src/resize.ts',
- 'parse-path': './src/parse-path.ts',
- random: './src/random.ts',
- 'order-keys': './src/order-keys.ts',
- color: './src/color/index.ts',
- css: './src/css/index.ts',
- 'text-direction': './src/text/direction.ts'
+ 'vector-network': './src/vector-network.ts'
},
platform: 'neutral',
format: ['esm'],
@@ -52,22 +75,6 @@ export default defineConfig({
neverBundle: [/^node:/],
onlyBundle: false
},
- outputOptions: {
- minifyInternalExports: false,
- codeSplitting: {
- groups: [
- {
- test: /(?<!\.d\.c?ts)$/,
- name: (id) => {
- const cleanId = id.split('?')[0]
- const parts = cleanId.split(/[\\/]/g)
- const srcIndex = parts.lastIndexOf('src')
- const file =
- srcIndex >= 0 ? parts.slice(srcIndex + 1).join('/') : (parts.at(-1) ?? 'chunk')
- return `chunks/${file.replace(/\.(ts|tsx)$/, '')}`
- }
- }
- ]
- }
- }
+ // Each module keeps its source path, so an entry's declarations never share a name with a chunk.
+ unbundle: true
})
diff --git a/packages/vue/README.md b/packages/vue/README.md
index ddf56cf96..111e959bb 100644
--- a/packages/vue/README.md
+++ b/packages/vue/README.md
@@ -24,9 +24,10 @@ The current development version requires Vue `^3.5.41` and, when supplying the o
```vue
<script setup lang="ts">
import { reactive } from 'vue'
-import { createDefaultEditorState, createEditor } from '@open-pencil/core/editor'
+import { createDefaultEditorState, createEditor } from '@open-pencil/core'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { CanvasRoot, CanvasSurface, provideEditor } from '@open-pencil/vue'
+import { CanvasRoot, CanvasSurface } from '@open-pencil/vue/canvas'
+import { provideEditor } from '@open-pencil/vue'
const graph = new SceneGraph()
const page = graph.getPages()[0]
@@ -55,6 +56,10 @@ provideEditor(editor)
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.
+## Entry points
+
+The root exports only the editor context: `provideEditor`, `useEditor`, and `EDITOR_KEY`. Everything else comes from the subpath named after its source folder, such as `@open-pencil/vue/canvas`, `@open-pencil/vue/controls/fill`, `@open-pencil/vue/editor/commands`, `@open-pencil/vue/primitives/NumberField`, and `@open-pencil/vue/i18n`; `package.json` lists them all.
+
## Core concepts
### Editor context
@@ -240,7 +245,7 @@ These are mostly useful when extending SDK primitives rather than building from
<script setup lang="ts">
import { provideEditor } from '@open-pencil/vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
const props = defineProps<{
editor: Editor
@@ -257,7 +262,7 @@ provideEditor(props.editor)
### Read selection state
```ts
-import { useSelectionState } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
const { hasSelection, selectedCount, selectedNode } = useSelectionState()
```
@@ -265,7 +270,7 @@ const { hasSelection, selectedCount, selectedNode } = useSelectionState()
### Build a menu
```ts
-import { useMenuModel } from '@open-pencil/vue'
+import { useMenuModel } from '@open-pencil/vue/editor/menu-model'
const { appMenu, canvasMenu } = useMenuModel()
```
diff --git a/packages/vue/example/src/App.vue b/packages/vue/example/src/App.vue
index 2403cfa46..bdda8b09a 100644
--- a/packages/vue/example/src/App.vue
+++ b/packages/vue/example/src/App.vue
@@ -1,14 +1,8 @@
<script setup lang="ts">
-import { createEditor, type Tool } from '@open-pencil/core/editor'
-import {
- OpenPencilProvider,
- CanvasRoot,
- CanvasSurface,
- LayerTree,
- ToolbarRoot,
- ToolbarItem,
- NodeProperties
-} from '@open-pencil/vue'
+import { createEditor, type Tool } from '@open-pencil/core'
+import { OpenPencilProvider, LayerTree, NodeProperties } from '@open-pencil/vue'
+import { CanvasRoot, CanvasSurface } from '@open-pencil/vue/canvas'
+import { ToolbarRoot, ToolbarItem } from '@open-pencil/vue/primitives/Toolbar'
const editor = createEditor()
const pages = () => editor.graph.getPages()
@@ -21,8 +15,16 @@ editor.createShape('ELLIPSE', 350, 200, 100, 100)
editor.zoomToFit()
const TOOL_LIST: Tool[] = [
- 'SELECT', 'FRAME', 'RECTANGLE', 'ELLIPSE',
- 'LINE', 'POLYGON', 'STAR', 'TEXT', 'PEN', 'HAND'
+ 'SELECT',
+ 'FRAME',
+ 'RECTANGLE',
+ 'ELLIPSE',
+ 'LINE',
+ 'POLYGON',
+ 'STAR',
+ 'TEXT',
+ 'PEN',
+ 'HAND'
]
</script>
@@ -31,7 +33,12 @@ const TOOL_LIST: Tool[] = [
<div class="layout">
<ToolbarRoot>
<div class="toolbar">
- <ToolbarItem v-for="tool in TOOL_LIST" :key="tool" v-slot="{ active, select }" :tool="tool">
+ <ToolbarItem
+ v-for="tool in TOOL_LIST"
+ :key="tool"
+ v-slot="{ active, select }"
+ :tool="tool"
+ >
<button :class="{ active }" @click="select">{{ tool }}</button>
</ToolbarItem>
</div>
@@ -78,16 +85,36 @@ const TOOL_LIST: Tool[] = [
<div v-if="node" class="section">
<h3>{{ node.type }}</h3>
<label>
- X <input type="number" :value="node.x" @change="update({ x: +($event.target as HTMLInputElement).value })">
+ X
+ <input
+ type="number"
+ :value="node.x"
+ @change="update({ x: +($event.target as HTMLInputElement).value })"
+ />
</label>
<label>
- Y <input type="number" :value="node.y" @change="update({ y: +($event.target as HTMLInputElement).value })">
+ Y
+ <input
+ type="number"
+ :value="node.y"
+ @change="update({ y: +($event.target as HTMLInputElement).value })"
+ />
</label>
<label>
- W <input type="number" :value="node.width" @change="update({ width: +($event.target as HTMLInputElement).value })">
+ W
+ <input
+ type="number"
+ :value="node.width"
+ @change="update({ width: +($event.target as HTMLInputElement).value })"
+ />
</label>
<label>
- H <input type="number" :value="node.height" @change="update({ height: +($event.target as HTMLInputElement).value })">
+ H
+ <input
+ type="number"
+ :value="node.height"
+ @change="update({ height: +($event.target as HTMLInputElement).value })"
+ />
</label>
</div>
<div v-else class="section">
@@ -101,42 +128,115 @@ const TOOL_LIST: Tool[] = [
</template>
<style>
-* { margin: 0; padding: 0; box-sizing: border-box; }
-body { font-family: system-ui, sans-serif; background: #1e1e1e; color: #e0e0e0; }
+* {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+}
+body {
+ font-family: system-ui, sans-serif;
+ background: #1e1e1e;
+ color: #e0e0e0;
+}
-.layout { display: flex; flex-direction: column; height: 100vh; }
+.layout {
+ display: flex;
+ flex-direction: column;
+ height: 100vh;
+}
.toolbar {
- display: flex; gap: 2px; padding: 4px 8px;
- background: #2a2a2a; border-bottom: 1px solid #3a3a3a;
+ display: flex;
+ gap: 2px;
+ padding: 4px 8px;
+ background: #2a2a2a;
+ border-bottom: 1px solid #3a3a3a;
}
.toolbar button {
- padding: 4px 10px; font-size: 11px; background: transparent;
- color: #ccc; border: 1px solid transparent; border-radius: 4px; cursor: pointer;
+ padding: 4px 10px;
+ font-size: 11px;
+ background: transparent;
+ color: #ccc;
+ border: 1px solid transparent;
+ border-radius: 4px;
+ cursor: pointer;
+}
+.toolbar button:hover {
+ background: #3a3a3a;
+}
+.toolbar button.active {
+ background: #4a90d9;
+ color: white;
+ border-color: #5a9fe9;
}
-.toolbar button:hover { background: #3a3a3a; }
-.toolbar button.active { background: #4a90d9; color: white; border-color: #5a9fe9; }
-.main { display: flex; flex: 1; overflow: hidden; }
+.main {
+ display: flex;
+ flex: 1;
+ overflow: hidden;
+}
-.panel { width: 220px; background: #252525; overflow-y: auto; flex-shrink: 0; }
-.panel.left { border-right: 1px solid #3a3a3a; }
-.panel.right { border-left: 1px solid #3a3a3a; }
+.panel {
+ width: 220px;
+ background: #252525;
+ overflow-y: auto;
+ flex-shrink: 0;
+}
+.panel.left {
+ border-right: 1px solid #3a3a3a;
+}
+.panel.right {
+ border-left: 1px solid #3a3a3a;
+}
-.section { padding: 8px; }
-.section h3 { font-size: 11px; text-transform: uppercase; color: #888; margin-bottom: 6px; letter-spacing: 0.5px; }
+.section {
+ padding: 8px;
+}
+.section h3 {
+ font-size: 11px;
+ text-transform: uppercase;
+ color: #888;
+ margin-bottom: 6px;
+ letter-spacing: 0.5px;
+}
-.list-item { padding: 4px 8px; font-size: 13px; border-radius: 4px; cursor: pointer; }
-.list-item:hover { background: #333; }
-.list-item.active { background: #4a90d9; color: white; }
+.list-item {
+ padding: 4px 8px;
+ font-size: 13px;
+ border-radius: 4px;
+ cursor: pointer;
+}
+.list-item:hover {
+ background: #333;
+}
+.list-item.active {
+ background: #4a90d9;
+ color: white;
+}
-.canvas-area { flex: 1; }
+.canvas-area {
+ flex: 1;
+}
-label { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 4px; }
+label {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ font-size: 12px;
+ margin-bottom: 4px;
+}
label input {
- flex: 1; background: #1e1e1e; border: 1px solid #3a3a3a;
- color: #e0e0e0; padding: 3px 6px; border-radius: 3px; font-size: 12px;
+ flex: 1;
+ background: #1e1e1e;
+ border: 1px solid #3a3a3a;
+ color: #e0e0e0;
+ padding: 3px 6px;
+ border-radius: 3px;
+ font-size: 12px;
}
-.muted { color: #666; font-size: 13px; }
+.muted {
+ color: #666;
+ font-size: 13px;
+}
</style>
diff --git a/packages/vue/package.json b/packages/vue/package.json
index 3a2ed073f..66b9161f6 100644
--- a/packages/vue/package.json
+++ b/packages/vue/package.json
@@ -8,6 +8,406 @@
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
+ },
+ "./canvas": {
+ "types": "./dist/canvas/index.d.ts",
+ "import": "./dist/canvas/index.js",
+ "default": "./dist/canvas/index.js"
+ },
+ "./canvas/drop": {
+ "types": "./dist/canvas/drop/index.d.ts",
+ "import": "./dist/canvas/drop/index.js",
+ "default": "./dist/canvas/drop/index.js"
+ },
+ "./canvas/issues": {
+ "types": "./dist/canvas/issues/index.d.ts",
+ "import": "./dist/canvas/issues/index.js",
+ "default": "./dist/canvas/issues/index.js"
+ },
+ "./canvas/labels": {
+ "types": "./dist/canvas/labels/index.d.ts",
+ "import": "./dist/canvas/labels/index.js",
+ "default": "./dist/canvas/labels/index.js"
+ },
+ "./canvas/overlays": {
+ "types": "./dist/canvas/overlays/index.d.ts",
+ "import": "./dist/canvas/overlays/index.js",
+ "default": "./dist/canvas/overlays/index.js"
+ },
+ "./canvas/statuses": {
+ "types": "./dist/canvas/statuses/index.d.ts",
+ "import": "./dist/canvas/statuses/index.js",
+ "default": "./dist/canvas/statuses/index.js"
+ },
+ "./canvas/surface": {
+ "types": "./dist/canvas/surface/index.d.ts",
+ "import": "./dist/canvas/surface/index.js",
+ "default": "./dist/canvas/surface/index.js"
+ },
+ "./canvas/text-edit": {
+ "types": "./dist/canvas/text-edit/index.d.ts",
+ "import": "./dist/canvas/text-edit/index.js",
+ "default": "./dist/canvas/text-edit/index.js"
+ },
+ "./controls/appearance": {
+ "types": "./dist/controls/appearance/index.d.ts",
+ "import": "./dist/controls/appearance/index.js",
+ "default": "./dist/controls/appearance/index.js"
+ },
+ "./controls/behaviour": {
+ "types": "./dist/controls/behaviour/index.d.ts",
+ "import": "./dist/controls/behaviour/index.js",
+ "default": "./dist/controls/behaviour/index.js"
+ },
+ "./controls/binding-provider": {
+ "types": "./dist/controls/binding-provider/index.d.ts",
+ "import": "./dist/controls/binding-provider/index.js",
+ "default": "./dist/controls/binding-provider/index.js"
+ },
+ "./controls/color-model": {
+ "types": "./dist/controls/color-model/index.d.ts",
+ "import": "./dist/controls/color-model/index.js",
+ "default": "./dist/controls/color-model/index.js"
+ },
+ "./controls/color-variable-binding": {
+ "types": "./dist/controls/color-variable-binding/index.d.ts",
+ "import": "./dist/controls/color-variable-binding/index.js",
+ "default": "./dist/controls/color-variable-binding/index.js"
+ },
+ "./controls/component-props": {
+ "types": "./dist/controls/component-props/index.d.ts",
+ "import": "./dist/controls/component-props/index.js",
+ "default": "./dist/controls/component-props/index.js"
+ },
+ "./controls/connector": {
+ "types": "./dist/controls/connector/index.d.ts",
+ "import": "./dist/controls/connector/index.js",
+ "default": "./dist/controls/connector/index.js"
+ },
+ "./controls/constraints": {
+ "types": "./dist/controls/constraints/index.d.ts",
+ "import": "./dist/controls/constraints/index.js",
+ "default": "./dist/controls/constraints/index.js"
+ },
+ "./controls/effects": {
+ "types": "./dist/controls/effects/index.d.ts",
+ "import": "./dist/controls/effects/index.js",
+ "default": "./dist/controls/effects/index.js"
+ },
+ "./controls/fill": {
+ "types": "./dist/controls/fill/index.d.ts",
+ "import": "./dist/controls/fill/index.js",
+ "default": "./dist/controls/fill/index.js"
+ },
+ "./controls/icon": {
+ "types": "./dist/controls/icon/index.d.ts",
+ "import": "./dist/controls/icon/index.js",
+ "default": "./dist/controls/icon/index.js"
+ },
+ "./controls/layout": {
+ "types": "./dist/controls/layout/index.d.ts",
+ "import": "./dist/controls/layout/index.js",
+ "default": "./dist/controls/layout/index.js"
+ },
+ "./controls/mask": {
+ "types": "./dist/controls/mask/index.d.ts",
+ "import": "./dist/controls/mask/index.js",
+ "default": "./dist/controls/mask/index.js"
+ },
+ "./controls/node-props": {
+ "types": "./dist/controls/node-props/index.d.ts",
+ "import": "./dist/controls/node-props/index.js",
+ "default": "./dist/controls/node-props/index.js"
+ },
+ "./controls/number-expression": {
+ "types": "./dist/controls/number-expression/index.d.ts",
+ "import": "./dist/controls/number-expression/index.js",
+ "default": "./dist/controls/number-expression/index.js"
+ },
+ "./controls/number-variable-binding": {
+ "types": "./dist/controls/number-variable-binding/index.d.ts",
+ "import": "./dist/controls/number-variable-binding/index.js",
+ "default": "./dist/controls/number-variable-binding/index.js"
+ },
+ "./controls/okhcl": {
+ "types": "./dist/controls/okhcl/index.d.ts",
+ "import": "./dist/controls/okhcl/index.js",
+ "default": "./dist/controls/okhcl/index.js"
+ },
+ "./controls/position": {
+ "types": "./dist/controls/position/index.d.ts",
+ "import": "./dist/controls/position/index.js",
+ "default": "./dist/controls/position/index.js"
+ },
+ "./controls/prop-scrub": {
+ "types": "./dist/controls/prop-scrub/index.d.ts",
+ "import": "./dist/controls/prop-scrub/index.js",
+ "default": "./dist/controls/prop-scrub/index.js"
+ },
+ "./controls/property-list": {
+ "types": "./dist/controls/property-list/index.d.ts",
+ "import": "./dist/controls/property-list/index.js",
+ "default": "./dist/controls/property-list/index.js"
+ },
+ "./controls/selection-colors": {
+ "types": "./dist/controls/selection-colors/index.d.ts",
+ "import": "./dist/controls/selection-colors/index.js",
+ "default": "./dist/controls/selection-colors/index.js"
+ },
+ "./controls/selection-layout": {
+ "types": "./dist/controls/selection-layout/index.d.ts",
+ "import": "./dist/controls/selection-layout/index.js",
+ "default": "./dist/controls/selection-layout/index.js"
+ },
+ "./controls/shader": {
+ "types": "./dist/controls/shader/index.d.ts",
+ "import": "./dist/controls/shader/index.js",
+ "default": "./dist/controls/shader/index.js"
+ },
+ "./controls/shape-with-text": {
+ "types": "./dist/controls/shape-with-text/index.d.ts",
+ "import": "./dist/controls/shape-with-text/index.js",
+ "default": "./dist/controls/shape-with-text/index.js"
+ },
+ "./controls/shared-style": {
+ "types": "./dist/controls/shared-style/index.d.ts",
+ "import": "./dist/controls/shared-style/index.js",
+ "default": "./dist/controls/shared-style/index.js"
+ },
+ "./controls/slots": {
+ "types": "./dist/controls/slots/index.d.ts",
+ "import": "./dist/controls/slots/index.js",
+ "default": "./dist/controls/slots/index.js"
+ },
+ "./controls/sticky": {
+ "types": "./dist/controls/sticky/index.d.ts",
+ "import": "./dist/controls/sticky/index.js",
+ "default": "./dist/controls/sticky/index.js"
+ },
+ "./controls/stroke": {
+ "types": "./dist/controls/stroke/index.d.ts",
+ "import": "./dist/controls/stroke/index.js",
+ "default": "./dist/controls/stroke/index.js"
+ },
+ "./controls/typography": {
+ "types": "./dist/controls/typography/index.d.ts",
+ "import": "./dist/controls/typography/index.js",
+ "default": "./dist/controls/typography/index.js"
+ },
+ "./controls/variable-binding": {
+ "types": "./dist/controls/variable-binding/index.d.ts",
+ "import": "./dist/controls/variable-binding/index.js",
+ "default": "./dist/controls/variable-binding/index.js"
+ },
+ "./controls/variable-modes": {
+ "types": "./dist/controls/variable-modes/index.d.ts",
+ "import": "./dist/controls/variable-modes/index.js",
+ "default": "./dist/controls/variable-modes/index.js"
+ },
+ "./controls/variants": {
+ "types": "./dist/controls/variants/index.d.ts",
+ "import": "./dist/controls/variants/index.js",
+ "default": "./dist/controls/variants/index.js"
+ },
+ "./document/export": {
+ "types": "./dist/document/export/index.d.ts",
+ "import": "./dist/document/export/index.js",
+ "default": "./dist/document/export/index.js"
+ },
+ "./document/workspace": {
+ "types": "./dist/document/workspace/index.d.ts",
+ "import": "./dist/document/workspace/index.js",
+ "default": "./dist/document/workspace/index.js"
+ },
+ "./editor/commands": {
+ "types": "./dist/editor/commands/index.d.ts",
+ "import": "./dist/editor/commands/index.js",
+ "default": "./dist/editor/commands/index.js"
+ },
+ "./editor/events": {
+ "types": "./dist/editor/events/index.d.ts",
+ "import": "./dist/editor/events/index.js",
+ "default": "./dist/editor/events/index.js"
+ },
+ "./editor/inline-rename": {
+ "types": "./dist/editor/inline-rename/index.d.ts",
+ "import": "./dist/editor/inline-rename/index.js",
+ "default": "./dist/editor/inline-rename/index.js"
+ },
+ "./editor/menu-model": {
+ "types": "./dist/editor/menu-model/index.d.ts",
+ "import": "./dist/editor/menu-model/index.js",
+ "default": "./dist/editor/menu-model/index.js"
+ },
+ "./editor/selection-capabilities": {
+ "types": "./dist/editor/selection-capabilities/index.d.ts",
+ "import": "./dist/editor/selection-capabilities/index.js",
+ "default": "./dist/editor/selection-capabilities/index.js"
+ },
+ "./editor/selection-state": {
+ "types": "./dist/editor/selection-state/index.d.ts",
+ "import": "./dist/editor/selection-state/index.js",
+ "default": "./dist/editor/selection-state/index.js"
+ },
+ "./editor/tool-cursor": {
+ "types": "./dist/editor/tool-cursor/index.d.ts",
+ "import": "./dist/editor/tool-cursor/index.js",
+ "default": "./dist/editor/tool-cursor/index.js"
+ },
+ "./editor/viewport-kind": {
+ "types": "./dist/editor/viewport-kind/index.d.ts",
+ "import": "./dist/editor/viewport-kind/index.js",
+ "default": "./dist/editor/viewport-kind/index.js"
+ },
+ "./i18n": {
+ "types": "./dist/i18n/index.d.ts",
+ "import": "./dist/i18n/index.js",
+ "default": "./dist/i18n/index.js"
+ },
+ "./internal/scene-computed": {
+ "types": "./dist/internal/scene-computed/index.d.ts",
+ "import": "./dist/internal/scene-computed/index.js",
+ "default": "./dist/internal/scene-computed/index.js"
+ },
+ "./lifecycle/retention": {
+ "types": "./dist/lifecycle/retention/index.d.ts",
+ "import": "./dist/lifecycle/retention/index.js",
+ "default": "./dist/lifecycle/retention/index.js"
+ },
+ "./primitives/AppearanceControls": {
+ "types": "./dist/primitives/AppearanceControls/index.d.ts",
+ "import": "./dist/primitives/AppearanceControls/index.js",
+ "default": "./dist/primitives/AppearanceControls/index.js"
+ },
+ "./primitives/BindableValue": {
+ "types": "./dist/primitives/BindableValue/index.d.ts",
+ "import": "./dist/primitives/BindableValue/index.js",
+ "default": "./dist/primitives/BindableValue/index.js"
+ },
+ "./primitives/ChannelSlider": {
+ "types": "./dist/primitives/ChannelSlider/index.d.ts",
+ "import": "./dist/primitives/ChannelSlider/index.js",
+ "default": "./dist/primitives/ChannelSlider/index.js"
+ },
+ "./primitives/ColorPicker": {
+ "types": "./dist/primitives/ColorPicker/index.d.ts",
+ "import": "./dist/primitives/ColorPicker/index.js",
+ "default": "./dist/primitives/ColorPicker/index.js"
+ },
+ "./primitives/CommandPalette": {
+ "types": "./dist/primitives/CommandPalette/index.d.ts",
+ "import": "./dist/primitives/CommandPalette/index.js",
+ "default": "./dist/primitives/CommandPalette/index.js"
+ },
+ "./primitives/ConstraintsControl": {
+ "types": "./dist/primitives/ConstraintsControl/index.d.ts",
+ "import": "./dist/primitives/ConstraintsControl/index.js",
+ "default": "./dist/primitives/ConstraintsControl/index.js"
+ },
+ "./primitives/Fill": {
+ "types": "./dist/primitives/Fill/index.d.ts",
+ "import": "./dist/primitives/Fill/index.js",
+ "default": "./dist/primitives/Fill/index.js"
+ },
+ "./primitives/FontPicker": {
+ "types": "./dist/primitives/FontPicker/index.d.ts",
+ "import": "./dist/primitives/FontPicker/index.js",
+ "default": "./dist/primitives/FontPicker/index.js"
+ },
+ "./primitives/GradientEditor": {
+ "types": "./dist/primitives/GradientEditor/index.d.ts",
+ "import": "./dist/primitives/GradientEditor/index.js",
+ "default": "./dist/primitives/GradientEditor/index.js"
+ },
+ "./primitives/LayerTree": {
+ "types": "./dist/primitives/LayerTree/index.d.ts",
+ "import": "./dist/primitives/LayerTree/index.js",
+ "default": "./dist/primitives/LayerTree/index.js"
+ },
+ "./primitives/LayoutControls": {
+ "types": "./dist/primitives/LayoutControls/index.d.ts",
+ "import": "./dist/primitives/LayoutControls/index.js",
+ "default": "./dist/primitives/LayoutControls/index.js"
+ },
+ "./primitives/NumberField": {
+ "types": "./dist/primitives/NumberField/index.d.ts",
+ "import": "./dist/primitives/NumberField/index.js",
+ "default": "./dist/primitives/NumberField/index.js"
+ },
+ "./primitives/PageList": {
+ "types": "./dist/primitives/PageList/index.d.ts",
+ "import": "./dist/primitives/PageList/index.js",
+ "default": "./dist/primitives/PageList/index.js"
+ },
+ "./primitives/PositionControls": {
+ "types": "./dist/primitives/PositionControls/index.d.ts",
+ "import": "./dist/primitives/PositionControls/index.js",
+ "default": "./dist/primitives/PositionControls/index.js"
+ },
+ "./primitives/PropertyGrid": {
+ "types": "./dist/primitives/PropertyGrid/index.d.ts",
+ "import": "./dist/primitives/PropertyGrid/index.js",
+ "default": "./dist/primitives/PropertyGrid/index.js"
+ },
+ "./primitives/PropertyList": {
+ "types": "./dist/primitives/PropertyList/index.d.ts",
+ "import": "./dist/primitives/PropertyList/index.js",
+ "default": "./dist/primitives/PropertyList/index.js"
+ },
+ "./primitives/PropertySection": {
+ "types": "./dist/primitives/PropertySection/index.d.ts",
+ "import": "./dist/primitives/PropertySection/index.js",
+ "default": "./dist/primitives/PropertySection/index.js"
+ },
+ "./primitives/SegmentedControl": {
+ "types": "./dist/primitives/SegmentedControl/index.d.ts",
+ "import": "./dist/primitives/SegmentedControl/index.js",
+ "default": "./dist/primitives/SegmentedControl/index.js"
+ },
+ "./primitives/Toolbar": {
+ "types": "./dist/primitives/Toolbar/index.d.ts",
+ "import": "./dist/primitives/Toolbar/index.js",
+ "default": "./dist/primitives/Toolbar/index.js"
+ },
+ "./primitives/TypographyControls": {
+ "types": "./dist/primitives/TypographyControls/index.d.ts",
+ "import": "./dist/primitives/TypographyControls/index.js",
+ "default": "./dist/primitives/TypographyControls/index.js"
+ },
+ "./shared/dom-events": {
+ "types": "./dist/shared/dom-events.d.ts",
+ "import": "./dist/shared/dom-events.js",
+ "default": "./dist/shared/dom-events.js"
+ },
+ "./shared/drag": {
+ "types": "./dist/shared/drag/index.d.ts",
+ "import": "./dist/shared/drag/index.js",
+ "default": "./dist/shared/drag/index.js"
+ },
+ "./shared/font-status": {
+ "types": "./dist/shared/font-status/index.d.ts",
+ "import": "./dist/shared/font-status/index.js",
+ "default": "./dist/shared/font-status/index.js"
+ },
+ "./shared/input": {
+ "types": "./dist/shared/input/index.d.ts",
+ "import": "./dist/shared/input/index.js",
+ "default": "./dist/shared/input/index.js"
+ },
+ "./shared/search": {
+ "types": "./dist/shared/search/index.d.ts",
+ "import": "./dist/shared/search/index.js",
+ "default": "./dist/shared/search/index.js"
+ },
+ "./testing": {
+ "types": "./dist/testing/index.d.ts",
+ "import": "./dist/testing/index.js",
+ "default": "./dist/testing/index.js"
+ },
+ "./variables": {
+ "types": "./dist/variables/index.d.ts",
+ "import": "./dist/variables/index.js",
+ "default": "./dist/variables/index.js"
}
},
"main": "./dist/index.js",
@@ -52,7 +452,8 @@
"fuse.js": "^7.5.0",
"nanostores": "^1.5.4",
"reka-ui": "^2.10.5",
- "shaders": "4.0.4"
+ "shaders": "4.0.4",
+ "valibot": "^1.5.0"
},
"devDependencies": {
"tsdown": "^0.22.14",
diff --git a/packages/vue/src/canvas/auto-layout/value-edit.ts b/packages/vue/src/canvas/auto-layout/value-edit.ts
index 754bee03b..469190c94 100644
--- a/packages/vue/src/canvas/auto-layout/value-edit.ts
+++ b/packages/vue/src/canvas/auto-layout/value-edit.ts
@@ -1,6 +1,6 @@
import { ref } from 'vue'
-import type { Editor, NodePreview } from '@open-pencil/core/editor'
+import type { Editor, NodePreview } from '@open-pencil/core'
import {
autoLayoutValueField,
diff --git a/packages/vue/src/canvas/drop/index.ts b/packages/vue/src/canvas/drop/index.ts
new file mode 100644
index 000000000..1d46786d9
--- /dev/null
+++ b/packages/vue/src/canvas/drop/index.ts
@@ -0,0 +1 @@
+export { useCanvasDrop, extractImageFilesFromClipboard, filterCanvasFiles } from './use'
diff --git a/packages/vue/src/canvas/drop/use.ts b/packages/vue/src/canvas/drop/use.ts
index 080531e8c..7adb902c2 100644
--- a/packages/vue/src/canvas/drop/use.ts
+++ b/packages/vue/src/canvas/drop/use.ts
@@ -1,7 +1,7 @@
import { useEventListener } from '@vueuse/core'
import { ref, type Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { cycleSafeTarget, findMoveDropTarget } from '#vue/shared/input/drop-target'
diff --git a/packages/vue/src/canvas/examples/CanvasRootExample.vue b/packages/vue/src/canvas/examples/CanvasRootExample.vue
index 12ac0075f..d62425d2a 100644
--- a/packages/vue/src/canvas/examples/CanvasRootExample.vue
+++ b/packages/vue/src/canvas/examples/CanvasRootExample.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { parseColor } from '@open-pencil/scene-graph/color'
import CanvasRoot from '#vue/canvas/CanvasRoot.vue'
diff --git a/packages/vue/src/canvas/examples/PresenceCursors.vue b/packages/vue/src/canvas/examples/PresenceCursors.vue
index 6a290b79c..f90a84077 100644
--- a/packages/vue/src/canvas/examples/PresenceCursors.vue
+++ b/packages/vue/src/canvas/examples/PresenceCursors.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { watchEffect } from 'vue'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { parseColor } from '@open-pencil/scene-graph/color'
import CanvasRoot from '#vue/canvas/CanvasRoot.vue'
diff --git a/packages/vue/src/canvas/guides/input.ts b/packages/vue/src/canvas/guides/input.ts
index 119d5ba5a..5356937d3 100644
--- a/packages/vue/src/canvas/guides/input.ts
+++ b/packages/vue/src/canvas/guides/input.ts
@@ -1,8 +1,8 @@
import type { Ref } from 'vue'
+import type { Editor } from '@open-pencil/core'
import { computeGuideRedline, hitTestGuides } from '@open-pencil/core/canvas'
import { RULER_SIZE } from '@open-pencil/core/constants'
-import type { Editor } from '@open-pencil/core/editor'
import { isPastPointerDragThreshold } from '#vue/shared/input/drag-threshold'
import type { DragGuide, DragState } from '#vue/shared/input/types'
diff --git a/packages/vue/src/canvas/index.ts b/packages/vue/src/canvas/index.ts
index 55e396f14..352e08b93 100644
--- a/packages/vue/src/canvas/index.ts
+++ b/packages/vue/src/canvas/index.ts
@@ -3,3 +3,4 @@ export { default as CanvasSurface } from '#vue/canvas/CanvasSurface.vue'
export { useCanvasContext } from '#vue/canvas/context'
export type { CanvasContext } from '#vue/canvas/context'
export { default as PlayIslands } from '#vue/canvas/islands/IslandLayer.vue'
+export { useCanvasInput } from './useCanvasInput'
diff --git a/packages/vue/src/canvas/islands/Island.vue b/packages/vue/src/canvas/islands/Island.vue
index 467bc2c8e..c30cb8f6e 100644
--- a/packages/vue/src/canvas/islands/Island.vue
+++ b/packages/vue/src/canvas/islands/Island.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, shallowRef, useTemplateRef, watch } from 'vue'
-import { resolvePlayState } from '@open-pencil/core/editor'
+import { resolvePlayState } from '@open-pencil/core'
import { vectorElement } from '@open-pencil/core/io'
import {
behaviourControls,
diff --git a/packages/vue/src/canvas/islands/IslandLayer.vue b/packages/vue/src/canvas/islands/IslandLayer.vue
index f302a654a..733389080 100644
--- a/packages/vue/src/canvas/islands/IslandLayer.vue
+++ b/packages/vue/src/canvas/islands/IslandLayer.vue
@@ -2,7 +2,7 @@
import { computedAsync } from '@vueuse/core'
import { computed, watch } from 'vue'
-import { playIslandRoots, type PlayState } from '@open-pencil/core/editor'
+import { playIslandRoots, type PlayState } from '@open-pencil/core'
import type { ViewportTransform } from '@open-pencil/core/geometry'
import { tokenStylesheet } from '@open-pencil/dom-css/export'
diff --git a/packages/vue/src/canvas/islands/controls/fields.ts b/packages/vue/src/canvas/islands/controls/fields.ts
index d0d8a53b0..566cf60bb 100644
--- a/packages/vue/src/canvas/islands/controls/fields.ts
+++ b/packages/vue/src/canvas/islands/controls/fields.ts
@@ -12,7 +12,7 @@ import {
type ControlModel,
type ControlRole
} from '@open-pencil/dom-css/export'
-import { numberSettings } from '@open-pencil/scene-graph'
+import { numberSettings } from '@open-pencil/scene-graph/behaviours'
import type { ElementOverride, IslandRenderContext } from '#vue/canvas/islands/render'
diff --git a/packages/vue/src/canvas/islands/controls/index.ts b/packages/vue/src/canvas/islands/controls/index.ts
index 502709999..5d210a870 100644
--- a/packages/vue/src/canvas/islands/controls/index.ts
+++ b/packages/vue/src/canvas/islands/controls/index.ts
@@ -29,7 +29,7 @@ import {
import { h, type Component, type VNode } from 'vue'
import { groupOf, type ControlRole, type DesignElement } from '@open-pencil/dom-css/export'
-import { numberSettings } from '@open-pencil/scene-graph'
+import { numberSettings } from '@open-pencil/scene-graph/behaviours'
import type { ElementOverride, IslandRenderContext } from '#vue/canvas/islands/render'
diff --git a/packages/vue/src/canvas/islands/render.ts b/packages/vue/src/canvas/islands/render.ts
index 9a5f9a9c3..c54dfdb99 100644
--- a/packages/vue/src/canvas/islands/render.ts
+++ b/packages/vue/src/canvas/islands/render.ts
@@ -7,7 +7,9 @@ import {
type DesignElement,
type DesignNode
} from '@open-pencil/dom-css/export'
-import { layerPath, shaderOfPaint, type SceneGraph } from '@open-pencil/scene-graph'
+import type { SceneGraph } from '@open-pencil/scene-graph'
+import { layerPath } from '@open-pencil/scene-graph/behaviours'
+import { shaderOfPaint } from '@open-pencil/scene-graph/shaders'
import { wrapRole } from './controls'
import IslandShader from './IslandShader.vue'
diff --git a/packages/vue/src/canvas/islands/state.ts b/packages/vue/src/canvas/islands/state.ts
index 9e1ac40de..051daea25 100644
--- a/packages/vue/src/canvas/islands/state.ts
+++ b/packages/vue/src/canvas/islands/state.ts
@@ -1,8 +1,8 @@
import { reactive } from 'vue'
-import type { InstanceState } from '@open-pencil/core/editor'
+import type { InstanceState } from '@open-pencil/core'
import { booleanOf, type ControlModel } from '@open-pencil/dom-css/export'
-import { numberSettings, type InteractionState } from '@open-pencil/scene-graph'
+import { numberSettings, type InteractionState } from '@open-pencil/scene-graph/behaviours'
/** What one control of an island holds while it runs. */
export interface ControlState {
diff --git a/packages/vue/src/canvas/issues/index.ts b/packages/vue/src/canvas/issues/index.ts
new file mode 100644
index 000000000..1f4af86f3
--- /dev/null
+++ b/packages/vue/src/canvas/issues/index.ts
@@ -0,0 +1,2 @@
+export { useCanvasIssueMarkers } from './use'
+export type { CanvasIssueMarkerOptions } from './use'
diff --git a/packages/vue/src/canvas/issues/use.ts b/packages/vue/src/canvas/issues/use.ts
index 7295fa02a..88d7cfc2b 100644
--- a/packages/vue/src/canvas/issues/use.ts
+++ b/packages/vue/src/canvas/issues/use.ts
@@ -1,8 +1,8 @@
import { useEventListener } from '@vueuse/core'
import { computed, onScopeDispose, shallowRef, type Ref } from 'vue'
+import type { Editor } from '@open-pencil/core'
import type { PlacedIssueMarker } from '@open-pencil/core/canvas'
-import type { Editor } from '@open-pencil/core/editor'
export interface CanvasIssueMarkerOptions {
/** Marker under a point in canvas-element CSS pixels; `useCanvas()` returns one. */
diff --git a/packages/vue/src/canvas/labels/edit.ts b/packages/vue/src/canvas/labels/edit.ts
index bb0821121..98708ba79 100644
--- a/packages/vue/src/canvas/labels/edit.ts
+++ b/packages/vue/src/canvas/labels/edit.ts
@@ -1,6 +1,6 @@
import { ref, type Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
export type CanvasLabelKind = 'section-title' | 'frame-title' | 'component-label'
diff --git a/packages/vue/src/canvas/labels/index.ts b/packages/vue/src/canvas/labels/index.ts
new file mode 100644
index 000000000..8a9c478c5
--- /dev/null
+++ b/packages/vue/src/canvas/labels/index.ts
@@ -0,0 +1 @@
+export type { CanvasLabelEdit, CanvasLabelKind } from './edit'
diff --git a/packages/vue/src/canvas/overlays/index.ts b/packages/vue/src/canvas/overlays/index.ts
new file mode 100644
index 000000000..e6e0a7dfa
--- /dev/null
+++ b/packages/vue/src/canvas/overlays/index.ts
@@ -0,0 +1 @@
+export { useCanvasVirtualReference } from './useCanvasVirtualReference'
diff --git a/packages/vue/src/canvas/overlays/useCanvasVirtualReference.ts b/packages/vue/src/canvas/overlays/useCanvasVirtualReference.ts
index e7422c063..41def2178 100644
--- a/packages/vue/src/canvas/overlays/useCanvasVirtualReference.ts
+++ b/packages/vue/src/canvas/overlays/useCanvasVirtualReference.ts
@@ -1,6 +1,6 @@
import { computed, type ComputedRef, type Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { Vector } from '@open-pencil/scene-graph/primitives'
type CanvasVirtualReference = {
diff --git a/packages/vue/src/canvas/pen/drag.ts b/packages/vue/src/canvas/pen/drag.ts
index 9ac3c5ae1..a2697fd9f 100644
--- a/packages/vue/src/canvas/pen/drag.ts
+++ b/packages/vue/src/canvas/pen/drag.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import type { DragState } from '#vue/shared/input/types'
diff --git a/packages/vue/src/canvas/pen/input.ts b/packages/vue/src/canvas/pen/input.ts
index ac3d21126..d1ec3e943 100644
--- a/packages/vue/src/canvas/pen/input.ts
+++ b/packages/vue/src/canvas/pen/input.ts
@@ -1,7 +1,7 @@
import type { Ref } from 'vue'
+import type { Editor } from '@open-pencil/core'
import { PEN_CLOSE_THRESHOLD } from '@open-pencil/core/constants'
-import type { Editor } from '@open-pencil/core/editor'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import { createPenDrag, handlePenDragMove } from '#vue/canvas/pen/drag'
diff --git a/packages/vue/src/canvas/pencil/input.ts b/packages/vue/src/canvas/pencil/input.ts
index b62dc9d6e..4985bde99 100644
--- a/packages/vue/src/canvas/pencil/input.ts
+++ b/packages/vue/src/canvas/pencil/input.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { findEnclosingDrawParent } from '#vue/shared/input/drop-target'
import type { DragState } from '#vue/shared/input/types'
diff --git a/packages/vue/src/canvas/pointer/use.ts b/packages/vue/src/canvas/pointer/use.ts
index 8576c152e..06eefc20e 100644
--- a/packages/vue/src/canvas/pointer/use.ts
+++ b/packages/vue/src/canvas/pointer/use.ts
@@ -1,6 +1,6 @@
import type { Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import {
diff --git a/packages/vue/src/canvas/statuses/index.ts b/packages/vue/src/canvas/statuses/index.ts
new file mode 100644
index 000000000..968ca9734
--- /dev/null
+++ b/packages/vue/src/canvas/statuses/index.ts
@@ -0,0 +1 @@
+export { useCanvasStatusLabels } from './use'
diff --git a/packages/vue/src/canvas/statuses/use.ts b/packages/vue/src/canvas/statuses/use.ts
index 070ef59a5..1cfda96c1 100644
--- a/packages/vue/src/canvas/statuses/use.ts
+++ b/packages/vue/src/canvas/statuses/use.ts
@@ -1,8 +1,8 @@
import { useEventListener } from '@vueuse/core'
import { computed, onScopeDispose, shallowRef, type Ref } from 'vue'
+import type { Editor } from '@open-pencil/core'
import type { PlacedStatusLabel } from '@open-pencil/core/canvas'
-import type { Editor } from '@open-pencil/core/editor'
export interface CanvasStatusLabelOptions {
/** Status label under a point in canvas-element CSS pixels; `useCanvas()` returns one. */
diff --git a/packages/vue/src/canvas/surface/gl-surface.ts b/packages/vue/src/canvas/surface/gl-surface.ts
index 26660dd80..6aead1249 100644
--- a/packages/vue/src/canvas/surface/gl-surface.ts
+++ b/packages/vue/src/canvas/surface/gl-surface.ts
@@ -1,7 +1,7 @@
import type { CanvasKit, Surface } from 'canvaskit-wasm'
+import type { Editor } from '@open-pencil/core'
import { IS_BROWSER } from '@open-pencil/core/constants'
-import type { Editor } from '@open-pencil/core/editor'
import type { DocumentColorSpace } from '@open-pencil/scene-graph'
import type { UseCanvasOptions } from '#vue/canvas/surface/types'
diff --git a/packages/vue/src/canvas/surface/index.ts b/packages/vue/src/canvas/surface/index.ts
new file mode 100644
index 000000000..81f52de1b
--- /dev/null
+++ b/packages/vue/src/canvas/surface/index.ts
@@ -0,0 +1,5 @@
+export { supportsWideGamutPresentation } from './color-space'
+export type { PresentationColorSpace } from './color-space'
+export { useCanvas } from './use'
+export type { UseCanvasOptions } from './use'
+export { canDrawShaders, createShaderRasterizer } from './shader/rasterizer'
diff --git a/packages/vue/src/canvas/surface/lifecycle.ts b/packages/vue/src/canvas/surface/lifecycle.ts
index b4c379456..a12592d28 100644
--- a/packages/vue/src/canvas/surface/lifecycle.ts
+++ b/packages/vue/src/canvas/surface/lifecycle.ts
@@ -2,8 +2,8 @@ import type { CanvasKit } from 'canvaskit-wasm'
import { onScopeDispose } from 'vue'
import type { Ref } from 'vue'
+import type { Editor } from '@open-pencil/core'
import { SkiaRenderer } from '@open-pencil/core/canvas'
-import type { Editor } from '@open-pencil/core/editor'
import {
supportsWideGamutPresentation,
diff --git a/packages/vue/src/canvas/surface/overlays.ts b/packages/vue/src/canvas/surface/overlays.ts
index 361111c5f..dca56e08a 100644
--- a/packages/vue/src/canvas/surface/overlays.ts
+++ b/packages/vue/src/canvas/surface/overlays.ts
@@ -1,9 +1,9 @@
+import type { Editor } from '@open-pencil/core'
import {
hitTestIssueMarkers,
hitTestStatusLabels,
type SkiaRenderer
} from '@open-pencil/core/canvas'
-import type { Editor } from '@open-pencil/core/editor'
import { useViewportKind } from '#vue/editor/viewport-kind/use'
diff --git a/packages/vue/src/canvas/surface/render-loop.ts b/packages/vue/src/canvas/surface/render-loop.ts
index 8de97b550..007c8292a 100644
--- a/packages/vue/src/canvas/surface/render-loop.ts
+++ b/packages/vue/src/canvas/surface/render-loop.ts
@@ -1,4 +1,4 @@
-import type { Editor, EditorState } from '@open-pencil/core/editor'
+import type { Editor, EditorState } from '@open-pencil/core'
import type { CanvasRenderLayer } from './types'
diff --git a/packages/vue/src/canvas/surface/shader/frames.ts b/packages/vue/src/canvas/surface/shader/frames.ts
index cc0661277..5de73f259 100644
--- a/packages/vue/src/canvas/surface/shader/frames.ts
+++ b/packages/vue/src/canvas/surface/shader/frames.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
/**
* Draws one fresh frame of a shader. The source is a WebGPU canvas that keeps the frame only
diff --git a/packages/vue/src/canvas/surface/shader/playback.ts b/packages/vue/src/canvas/surface/shader/playback.ts
index 2a0449a82..584424935 100644
--- a/packages/vue/src/canvas/surface/shader/playback.ts
+++ b/packages/vue/src/canvas/surface/shader/playback.ts
@@ -2,10 +2,14 @@ import { useRafFn, watchThrottled } from '@vueuse/core'
import type { createRendererFromJSON } from 'shaders/core'
import { onScopeDispose, watch } from 'vue'
+import type { Editor, EditorState } from '@open-pencil/core'
import type { SkiaRenderer } from '@open-pencil/core/canvas'
-import type { Editor, EditorState } from '@open-pencil/core/editor'
-import { readShaderPaints, shaderOfPaint, type ShaderPreset } from '@open-pencil/scene-graph'
import type { Rect } from '@open-pencil/scene-graph/primitives'
+import {
+ readShaderPaints,
+ shaderOfPaint,
+ type ShaderPreset
+} from '@open-pencil/scene-graph/shaders'
import { shaderFrames } from '#vue/canvas/surface/shader/frames'
import { canDrawShaders } from '#vue/canvas/surface/shader/rasterizer'
diff --git a/packages/vue/src/canvas/surface/shader/rasterizer.ts b/packages/vue/src/canvas/surface/shader/rasterizer.ts
index 1d5748db8..7d4a2ea9c 100644
--- a/packages/vue/src/canvas/surface/shader/rasterizer.ts
+++ b/packages/vue/src/canvas/surface/shader/rasterizer.ts
@@ -1,5 +1,5 @@
-import type { ShaderRasterizer } from '@open-pencil/core/editor'
-import { shaderFrameEncoding } from '@open-pencil/scene-graph'
+import type { ShaderRasterizer } from '@open-pencil/core'
+import { shaderFrameEncoding } from '@open-pencil/scene-graph/shaders'
/** Whether this browser can draw shaders, which need WebGPU. */
export function canDrawShaders(): boolean {
diff --git a/packages/vue/src/canvas/surface/types.ts b/packages/vue/src/canvas/surface/types.ts
index 0069081a5..8f3df3ad2 100644
--- a/packages/vue/src/canvas/surface/types.ts
+++ b/packages/vue/src/canvas/surface/types.ts
@@ -1,4 +1,4 @@
-import type { EditorState } from '@open-pencil/core/editor'
+import type { EditorState } from '@open-pencil/core'
import type { ViewportTransform } from '@open-pencil/core/geometry'
import type { Rect } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/vue/src/canvas/surface/use.ts b/packages/vue/src/canvas/surface/use.ts
index 20fb441ff..db5e1272d 100644
--- a/packages/vue/src/canvas/surface/use.ts
+++ b/packages/vue/src/canvas/surface/use.ts
@@ -2,7 +2,7 @@ import { useElementSize } from '@vueuse/core'
import type { CanvasKit } from 'canvaskit-wasm'
import type { Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import {
createCanvasSurfaceManager,
diff --git a/packages/vue/src/canvas/text-edit/clipboard.ts b/packages/vue/src/canvas/text-edit/clipboard.ts
index f14813b77..5920955d9 100644
--- a/packages/vue/src/canvas/text-edit/clipboard.ts
+++ b/packages/vue/src/canvas/text-edit/clipboard.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
type TextClipboardOptions = {
diff --git a/packages/vue/src/canvas/text-edit/editing.ts b/packages/vue/src/canvas/text-edit/editing.ts
index 48b33c0b3..54d27113c 100644
--- a/packages/vue/src/canvas/text-edit/editing.ts
+++ b/packages/vue/src/canvas/text-edit/editing.ts
@@ -1,9 +1,10 @@
import { useIntervalFn } from '@vueuse/core'
import type { ShallowRef } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { adjustRunsForDelete, adjustRunsForInsert } from '@open-pencil/core/text'
-import { paragraphStylesAfterTextChange, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { paragraphStylesAfterTextChange } from '@open-pencil/scene-graph/text'
const CARET_BLINK_MS = 530
diff --git a/packages/vue/src/canvas/text-edit/formatting.ts b/packages/vue/src/canvas/text-edit/formatting.ts
index e7d90e208..4245b048e 100644
--- a/packages/vue/src/canvas/text-edit/formatting.ts
+++ b/packages/vue/src/canvas/text-edit/formatting.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import {
fontManager,
getStyleAt,
diff --git a/packages/vue/src/canvas/text-edit/index.ts b/packages/vue/src/canvas/text-edit/index.ts
new file mode 100644
index 000000000..2800550b6
--- /dev/null
+++ b/packages/vue/src/canvas/text-edit/index.ts
@@ -0,0 +1,2 @@
+export { useTextEdit } from './use'
+export { isCanvasTextInput } from './textarea'
diff --git a/packages/vue/src/canvas/text-edit/input.ts b/packages/vue/src/canvas/text-edit/input.ts
index 965b797e8..4bd3ef52d 100644
--- a/packages/vue/src/canvas/text-edit/input.ts
+++ b/packages/vue/src/canvas/text-edit/input.ts
@@ -1,5 +1,6 @@
-import { getNodeEditCapability, type Editor } from '@open-pencil/core/editor'
-import { generatedFrameOwner, generatedFrameText, type SceneNode } from '@open-pencil/scene-graph'
+import { getNodeEditCapability, type Editor } from '@open-pencil/core'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { generatedFrameOwner, generatedFrameText } from '@open-pencil/scene-graph/generated'
import type { CanvasLabelKind } from '#vue/canvas/labels/edit'
import type { DragState } from '#vue/shared/input/types'
diff --git a/packages/vue/src/canvas/text-edit/keyboard.ts b/packages/vue/src/canvas/text-edit/keyboard.ts
index 98e12ff39..271061484 100644
--- a/packages/vue/src/canvas/text-edit/keyboard.ts
+++ b/packages/vue/src/canvas/text-edit/keyboard.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { SceneNode, TextListType } from '@open-pencil/scene-graph'
import { extendSelectionForDeletion, handleNavigationKey } from './navigation'
diff --git a/packages/vue/src/canvas/text-edit/navigation.ts b/packages/vue/src/canvas/text-edit/navigation.ts
index 54d1a4ed3..ff9b17eec 100644
--- a/packages/vue/src/canvas/text-edit/navigation.ts
+++ b/packages/vue/src/canvas/text-edit/navigation.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
type TextEditor = NonNullable<Editor['textEditor']>
diff --git a/packages/vue/src/canvas/text-edit/paragraphs.ts b/packages/vue/src/canvas/text-edit/paragraphs.ts
index 9b16b38f5..625e23ae3 100644
--- a/packages/vue/src/canvas/text-edit/paragraphs.ts
+++ b/packages/vue/src/canvas/text-edit/paragraphs.ts
@@ -1,4 +1,10 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
+import type {
+ SceneNode,
+ TextListType,
+ TextParagraphSpacingField,
+ TextParagraphStyle
+} from '@open-pencil/scene-graph'
import {
paragraphIndexAt,
paragraphStyleAt,
@@ -7,12 +13,8 @@ import {
sharedParagraphSpacing,
withIndentation,
withListType,
- withParagraphSpacing,
- type SceneNode,
- type TextListType,
- type TextParagraphSpacingField,
- type TextParagraphStyle
-} from '@open-pencil/scene-graph'
+ withParagraphSpacing
+} from '@open-pencil/scene-graph/text'
/**
* The characters paragraph changes apply to: the selection or the caret's paragraph while the
diff --git a/packages/vue/src/canvas/text-edit/textarea.ts b/packages/vue/src/canvas/text-edit/textarea.ts
index da2ab9af8..ef3e5fef4 100644
--- a/packages/vue/src/canvas/text-edit/textarea.ts
+++ b/packages/vue/src/canvas/text-edit/textarea.ts
@@ -1,7 +1,7 @@
import { watch } from 'vue'
import type { ShallowRef } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
const CANVAS_TEXT_INPUT = 'data-canvas-text-input'
diff --git a/packages/vue/src/canvas/text-edit/use.ts b/packages/vue/src/canvas/text-edit/use.ts
index c6d78463d..0114b6b23 100644
--- a/packages/vue/src/canvas/text-edit/use.ts
+++ b/packages/vue/src/canvas/text-edit/use.ts
@@ -1,7 +1,7 @@
import { useEventListener } from '@vueuse/core'
import { shallowRef, type Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { createTextClipboardActions } from './clipboard'
import { createCaretBlink, createTextCompositionHandlers, createTextEditActions } from './editing'
diff --git a/packages/vue/src/canvas/tools/input.ts b/packages/vue/src/canvas/tools/input.ts
index ef825a34c..79e9a46b5 100644
--- a/packages/vue/src/canvas/tools/input.ts
+++ b/packages/vue/src/canvas/tools/input.ts
@@ -1,6 +1,6 @@
import type { Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { startPenInput } from '#vue/canvas/pen/input'
import { startPencilInput } from '#vue/canvas/pencil/input'
diff --git a/packages/vue/src/canvas/transform/actions.ts b/packages/vue/src/canvas/transform/actions.ts
index 225aa76ab..99f7c7e06 100644
--- a/packages/vue/src/canvas/transform/actions.ts
+++ b/packages/vue/src/canvas/transform/actions.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { handleMarqueeMove as handleMarqueeMoveAction } from '#vue/canvas/transform/marquee'
import { handlePanMove as handlePanMoveAction } from '#vue/canvas/transform/pan'
diff --git a/packages/vue/src/canvas/transform/marquee.ts b/packages/vue/src/canvas/transform/marquee.ts
index ea62e6dce..ef9069c20 100644
--- a/packages/vue/src/canvas/transform/marquee.ts
+++ b/packages/vue/src/canvas/transform/marquee.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { getAxisAlignedWorldBounds } from '@open-pencil/scene-graph/coordinate'
import type { Rect } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/vue/src/canvas/transform/pan.ts b/packages/vue/src/canvas/transform/pan.ts
index 6bb024872..457e09bd5 100644
--- a/packages/vue/src/canvas/transform/pan.ts
+++ b/packages/vue/src/canvas/transform/pan.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { DragPan } from '#vue/shared/input/types'
diff --git a/packages/vue/src/canvas/transform/rotation.ts b/packages/vue/src/canvas/transform/rotation.ts
index 97c89622c..8c3fedd8b 100644
--- a/packages/vue/src/canvas/transform/rotation.ts
+++ b/packages/vue/src/canvas/transform/rotation.ts
@@ -1,7 +1,7 @@
+import type { Editor } from '@open-pencil/core'
import { ROTATION_SNAP_DEGREES } from '@open-pencil/core/constants'
-import type { Editor } from '@open-pencil/core/editor'
import { createSceneGeometry } from '@open-pencil/core/geometry'
-import { layerRotates } from '@open-pencil/scene-graph'
+import { layerRotates } from '@open-pencil/scene-graph/generated'
import {
hitTestCornerRotationByMatrix,
diff --git a/packages/vue/src/canvas/transform/text-selection.ts b/packages/vue/src/canvas/transform/text-selection.ts
index 797282551..d4103bd19 100644
--- a/packages/vue/src/canvas/transform/text-selection.ts
+++ b/packages/vue/src/canvas/transform/text-selection.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
export function handleTextSelectMove(editor: Editor, cx: number, cy: number) {
const textEditor = editor.textEditor
diff --git a/packages/vue/src/canvas/useCanvasInput.ts b/packages/vue/src/canvas/useCanvasInput.ts
index 40a4ffd7d..b506e9eda 100644
--- a/packages/vue/src/canvas/useCanvasInput.ts
+++ b/packages/vue/src/canvas/useCanvasInput.ts
@@ -1,7 +1,7 @@
import { useEventListener } from '@vueuse/core'
import { onScopeDispose, ref, watch, type Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import { createAutoLayoutValueEdit } from '#vue/canvas/auto-layout/value-edit'
diff --git a/packages/vue/src/canvas/vector-input/bend.ts b/packages/vue/src/canvas/vector-input/bend.ts
index 2390d3505..2460198c1 100644
--- a/packages/vue/src/canvas/vector-input/bend.ts
+++ b/packages/vue/src/canvas/vector-input/bend.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { VectorSegment } from '@open-pencil/scene-graph'
import type { Vector } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/vue/src/canvas/vector-input/input.ts b/packages/vue/src/canvas/vector-input/input.ts
index 133eee8f4..342c163ee 100644
--- a/packages/vue/src/canvas/vector-input/input.ts
+++ b/packages/vue/src/canvas/vector-input/input.ts
@@ -1,6 +1,6 @@
import type { Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import {
getCanvasNodeEditState,
diff --git a/packages/vue/src/controls/appearance/helpers.ts b/packages/vue/src/controls/appearance/helpers.ts
index f591ca028..d151dc4b3 100644
--- a/packages/vue/src/controls/appearance/helpers.ts
+++ b/packages/vue/src/controls/appearance/helpers.ts
@@ -2,7 +2,7 @@ import { compact } from 'es-toolkit'
import { computed } from 'vue'
import type { ComputedRef, Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { BlendMode, SceneNode } from '@open-pencil/scene-graph'
import type { CornerGeometryKey, CornerRadiusKey } from '#vue/controls/appearance/types'
diff --git a/packages/vue/src/controls/appearance/index.ts b/packages/vue/src/controls/appearance/index.ts
new file mode 100644
index 000000000..c7b1063c0
--- /dev/null
+++ b/packages/vue/src/controls/appearance/index.ts
@@ -0,0 +1,2 @@
+export { useAppearance } from './use'
+export type { CornerGeometryKey, CornerRadiusKey } from './types'
diff --git a/packages/vue/src/controls/behaviour/types.ts b/packages/vue/src/controls/behaviour/types.ts
index 02140764f..8fc6a6e90 100644
--- a/packages/vue/src/controls/behaviour/types.ts
+++ b/packages/vue/src/controls/behaviour/types.ts
@@ -1,4 +1,4 @@
-import type { BehaviourKind, InteractionState } from '@open-pencil/scene-graph'
+import type { BehaviourKind, InteractionState } from '@open-pencil/scene-graph/behaviours'
import type { VariantDefinitionControl } from '#vue/controls/variants'
diff --git a/packages/vue/src/controls/behaviour/use.ts b/packages/vue/src/controls/behaviour/use.ts
index 1bfe90efa..619b586b8 100644
--- a/packages/vue/src/controls/behaviour/use.ts
+++ b/packages/vue/src/controls/behaviour/use.ts
@@ -17,7 +17,7 @@ import {
type BehaviourKind,
type BehaviourNumberSettings,
type InteractionState
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/behaviours'
import type { VariantDefinitionControl } from '#vue/controls/variants'
import { useEditor } from '#vue/editor/context'
diff --git a/packages/vue/src/controls/binding-provider/color.ts b/packages/vue/src/controls/binding-provider/color.ts
index ad1550d57..e8eb94332 100644
--- a/packages/vue/src/controls/binding-provider/color.ts
+++ b/packages/vue/src/controls/binding-provider/color.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { VariableCollection } from '@open-pencil/scene-graph'
import type { Color } from '@open-pencil/scene-graph/primitives'
import { randomHex } from '@open-pencil/scene-graph/random'
diff --git a/packages/vue/src/controls/binding-provider/mode-edit.ts b/packages/vue/src/controls/binding-provider/mode-edit.ts
index 5f0c00a0c..d29cf9595 100644
--- a/packages/vue/src/controls/binding-provider/mode-edit.ts
+++ b/packages/vue/src/controls/binding-provider/mode-edit.ts
@@ -1,5 +1,5 @@
-import type { Editor } from '@open-pencil/core/editor'
-import type { Color } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import type { BindingTarget, BindingValueEdit } from './types'
diff --git a/packages/vue/src/controls/binding-provider/number.ts b/packages/vue/src/controls/binding-provider/number.ts
index 3913db2f4..f06b6cf15 100644
--- a/packages/vue/src/controls/binding-provider/number.ts
+++ b/packages/vue/src/controls/binding-provider/number.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { VariableCollection } from '@open-pencil/scene-graph'
import { randomHex } from '@open-pencil/scene-graph/random'
diff --git a/packages/vue/src/controls/binding-provider/open-pencil.ts b/packages/vue/src/controls/binding-provider/open-pencil.ts
index 7e0b424f5..31521c1c7 100644
--- a/packages/vue/src/controls/binding-provider/open-pencil.ts
+++ b/packages/vue/src/controls/binding-provider/open-pencil.ts
@@ -1,7 +1,7 @@
import { isEqual } from 'es-toolkit'
import { useFilter } from 'reka-ui'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { Variable, VariableType } from '@open-pencil/scene-graph'
import type {
diff --git a/packages/vue/src/controls/binding-provider/resolution.ts b/packages/vue/src/controls/binding-provider/resolution.ts
index bbf4b12e5..349872341 100644
--- a/packages/vue/src/controls/binding-provider/resolution.ts
+++ b/packages/vue/src/controls/binding-provider/resolution.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { VariableValue } from '@open-pencil/scene-graph'
import type { BindingTarget } from './types'
diff --git a/packages/vue/src/controls/binding-provider/text.ts b/packages/vue/src/controls/binding-provider/text.ts
index fa05f5898..f4323ece3 100644
--- a/packages/vue/src/controls/binding-provider/text.ts
+++ b/packages/vue/src/controls/binding-provider/text.ts
@@ -1,5 +1,5 @@
-import type { Editor } from '@open-pencil/core/editor'
-import { TEXT_CONTENT_VARIABLE_TYPES, variableText } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
+import { TEXT_CONTENT_VARIABLE_TYPES, variableText } from '@open-pencil/scene-graph/variables'
import { useOpenPencilBindingProvider } from '#vue/controls/binding-provider/open-pencil'
import type { BindingTarget } from '#vue/controls/binding-provider/types'
diff --git a/packages/vue/src/controls/binding-provider/visibility.ts b/packages/vue/src/controls/binding-provider/visibility.ts
index 353d0a69a..fd3c31eb4 100644
--- a/packages/vue/src/controls/binding-provider/visibility.ts
+++ b/packages/vue/src/controls/binding-provider/visibility.ts
@@ -1,5 +1,5 @@
-import type { Editor } from '@open-pencil/core/editor'
-import { VISIBILITY_VARIABLE_TYPES, variableTruthy } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
+import { VISIBILITY_VARIABLE_TYPES, variableTruthy } from '@open-pencil/scene-graph/variables'
import { useOpenPencilBindingProvider } from '#vue/controls/binding-provider/open-pencil'
import type { BindingTarget } from '#vue/controls/binding-provider/types'
diff --git a/packages/vue/src/controls/color-variable-binding/index.ts b/packages/vue/src/controls/color-variable-binding/index.ts
new file mode 100644
index 000000000..4de396b3d
--- /dev/null
+++ b/packages/vue/src/controls/color-variable-binding/index.ts
@@ -0,0 +1 @@
+export { useColorVariableBinding } from './use'
diff --git a/packages/vue/src/controls/component-props/authoring.ts b/packages/vue/src/controls/component-props/authoring.ts
index c0c3746fc..87f6b2c9d 100644
--- a/packages/vue/src/controls/component-props/authoring.ts
+++ b/packages/vue/src/controls/component-props/authoring.ts
@@ -1,7 +1,8 @@
import { uniqBy } from 'es-toolkit/array'
import { computed } from 'vue'
-import { instanceExposureIssue, type ComponentPropertyType } from '@open-pencil/scene-graph'
+import type { ComponentPropertyType } from '@open-pencil/scene-graph'
+import { instanceExposureIssue } from '@open-pencil/scene-graph/components'
import { useEditor } from '#vue/editor/context'
import { useSceneComputed } from '#vue/internal/scene-computed/use'
diff --git a/packages/vue/src/controls/component-props/model.ts b/packages/vue/src/controls/component-props/model.ts
index 2455becee..4fa8267cf 100644
--- a/packages/vue/src/controls/component-props/model.ts
+++ b/packages/vue/src/controls/component-props/model.ts
@@ -1,11 +1,11 @@
-import type { Editor } from '@open-pencil/core/editor'
-import { canCreateInstance } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
import type {
ComponentPropertyDefinition,
ComponentPropertyType,
SceneGraph,
SceneNode
} from '@open-pencil/scene-graph'
+import { canCreateInstance } from '@open-pencil/scene-graph/instances'
import { MIXED, type MixedValue } from '#vue/controls/node-props/helpers'
diff --git a/packages/vue/src/controls/component-props/use.ts b/packages/vue/src/controls/component-props/use.ts
index 5ea493081..3857e2247 100644
--- a/packages/vue/src/controls/component-props/use.ts
+++ b/packages/vue/src/controls/component-props/use.ts
@@ -1,7 +1,7 @@
import { computed, watch } from 'vue'
-import { exposedInstances, findComponentPropertyTargets } from '@open-pencil/scene-graph'
import type { ComponentPropertyDefinition, SceneNode } from '@open-pencil/scene-graph'
+import { exposedInstances, findComponentPropertyTargets } from '@open-pencil/scene-graph/components'
import {
compatibleComponentPropertyDefinitions,
diff --git a/packages/vue/src/controls/connector/index.ts b/packages/vue/src/controls/connector/index.ts
new file mode 100644
index 000000000..9b59bcb26
--- /dev/null
+++ b/packages/vue/src/controls/connector/index.ts
@@ -0,0 +1 @@
+export { useConnector } from './use'
diff --git a/packages/vue/src/controls/connector/use.ts b/packages/vue/src/controls/connector/use.ts
index 544941446..c7c6fc4d2 100644
--- a/packages/vue/src/controls/connector/use.ts
+++ b/packages/vue/src/controls/connector/use.ts
@@ -1,17 +1,12 @@
import { computed } from 'vue'
+import type { ConnectorLineType, SceneNode, StrokeCap } from '@open-pencil/scene-graph'
import {
CONNECTOR_THICK_STROKE_WEIGHT,
connectorLineStyle,
- connectorSublayers,
- figJamColorName
-} from '@open-pencil/scene-graph'
-import type {
- ConnectorLineType,
- FigJamColorName,
- SceneNode,
- StrokeCap
-} from '@open-pencil/scene-graph'
+ connectorSublayers
+} from '@open-pencil/scene-graph/connectors'
+import { figJamColorName, type FigJamColorName } from '@open-pencil/scene-graph/figjam'
import { useEditor } from '#vue/editor/context'
import { useSelectionState } from '#vue/editor/selection-state/use'
diff --git a/packages/vue/src/controls/effects/helpers.ts b/packages/vue/src/controls/effects/helpers.ts
index 6d151b955..79caf3f3e 100644
--- a/packages/vue/src/controls/effects/helpers.ts
+++ b/packages/vue/src/controls/effects/helpers.ts
@@ -1,7 +1,8 @@
import type { Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
-import { copyEffects, type Effect, type SceneNode } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
+import type { Effect, SceneNode } from '@open-pencil/scene-graph'
+import { copyEffects } from '@open-pencil/scene-graph/copy'
import type { Color } from '@open-pencil/scene-graph/primitives'
import { useI18n } from '#vue/i18n/useI18n.js'
diff --git a/packages/vue/src/controls/effects/index.ts b/packages/vue/src/controls/effects/index.ts
new file mode 100644
index 000000000..fbbe95538
--- /dev/null
+++ b/packages/vue/src/controls/effects/index.ts
@@ -0,0 +1 @@
+export { useEffectsControls } from './use'
diff --git a/packages/vue/src/controls/fill/index.ts b/packages/vue/src/controls/fill/index.ts
new file mode 100644
index 000000000..5f9eb256e
--- /dev/null
+++ b/packages/vue/src/controls/fill/index.ts
@@ -0,0 +1 @@
+export { useFillControls } from './use'
diff --git a/packages/vue/src/controls/icon/index.ts b/packages/vue/src/controls/icon/index.ts
new file mode 100644
index 000000000..f1f4c88df
--- /dev/null
+++ b/packages/vue/src/controls/icon/index.ts
@@ -0,0 +1,2 @@
+export { useIcon } from './use'
+export { useIconSearch } from './search'
diff --git a/packages/vue/src/controls/icon/use.ts b/packages/vue/src/controls/icon/use.ts
index c48a49896..34761ede8 100644
--- a/packages/vue/src/controls/icon/use.ts
+++ b/packages/vue/src/controls/icon/use.ts
@@ -2,7 +2,7 @@ import { watchImmediate } from '@vueuse/core'
import { computed, ref } from 'vue'
import { iconColor } from '@open-pencil/core/icons'
-import { isIconModified, readIcon } from '@open-pencil/scene-graph'
+import { isIconModified, readIcon } from '@open-pencil/scene-graph/icons'
import type { Color } from '@open-pencil/scene-graph/primitives'
import { useUndoBatch } from '#vue/controls/undo-batch/use'
diff --git a/packages/vue/src/controls/layout/helpers.ts b/packages/vue/src/controls/layout/helpers.ts
index cfc1f834e..87bdb9bd9 100644
--- a/packages/vue/src/controls/layout/helpers.ts
+++ b/packages/vue/src/controls/layout/helpers.ts
@@ -1,7 +1,16 @@
import { computed, ref } from 'vue'
import type { ComputedRef } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
+import type {
+ GridTrack,
+ LayoutAlign,
+ LayoutCounterAlign,
+ LayoutSizing,
+ NumericNodeProperty,
+ SceneGraph,
+ SceneNode
+} from '@open-pencil/scene-graph'
import {
aspectRatioLockEditable,
enforcedAspectRatio,
@@ -10,15 +19,8 @@ import {
layoutSizingUpdates,
lockedAspectRatioTarget,
sizeKeepingAspectRatio,
- type GridTrack,
- type LayoutAlign,
- type LayoutCounterAlign,
- type LayoutSizing,
- type LayoutSizingAxis,
- type NumericNodeProperty,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type LayoutSizingAxis
+} from '@open-pencil/scene-graph/layout'
import { useNodePreview } from '#vue/controls/node-preview/use'
import { useSelectedNodeState } from '#vue/editor/selection-state/nodes'
diff --git a/packages/vue/src/controls/layout/index.ts b/packages/vue/src/controls/layout/index.ts
new file mode 100644
index 000000000..51ef18021
--- /dev/null
+++ b/packages/vue/src/controls/layout/index.ts
@@ -0,0 +1,2 @@
+export { useLayout } from './use'
+export type { LayoutAxis, SizeLimitProp } from './helpers'
diff --git a/packages/vue/src/controls/mask/index.ts b/packages/vue/src/controls/mask/index.ts
new file mode 100644
index 000000000..7f4b56af6
--- /dev/null
+++ b/packages/vue/src/controls/mask/index.ts
@@ -0,0 +1 @@
+export { useMask } from './use'
diff --git a/packages/vue/src/controls/node-preview/use.ts b/packages/vue/src/controls/node-preview/use.ts
index 513520361..c201acdb5 100644
--- a/packages/vue/src/controls/node-preview/use.ts
+++ b/packages/vue/src/controls/node-preview/use.ts
@@ -1,7 +1,7 @@
import { tryOnScopeDispose } from '@vueuse/core'
import { getCurrentInstance, onDeactivated } from 'vue'
-import type { Editor, NodePreview } from '@open-pencil/core/editor'
+import type { Editor, NodePreview } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
/** Keeps an edit's original targets until its terminal event, even after selection changes. */
diff --git a/packages/vue/src/controls/node-props/helpers.ts b/packages/vue/src/controls/node-props/helpers.ts
index b45b17d2e..c5ddbc774 100644
--- a/packages/vue/src/controls/node-props/helpers.ts
+++ b/packages/vue/src/controls/node-props/helpers.ts
@@ -1,7 +1,7 @@
import { computed } from 'vue'
import type { ComputedRef } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { Effect, Fill, SceneNode, Stroke } from '@open-pencil/scene-graph'
import { useSelectedNodeState } from '#vue/editor/selection-state/nodes'
diff --git a/packages/vue/src/controls/node-props/index.ts b/packages/vue/src/controls/node-props/index.ts
new file mode 100644
index 000000000..c497781f7
--- /dev/null
+++ b/packages/vue/src/controls/node-props/index.ts
@@ -0,0 +1,2 @@
+export { useNodeProps, MIXED } from './use'
+export type { MixedValue } from './use'
diff --git a/packages/vue/src/controls/number-variable-binding/index.ts b/packages/vue/src/controls/number-variable-binding/index.ts
new file mode 100644
index 000000000..1c14d50d4
--- /dev/null
+++ b/packages/vue/src/controls/number-variable-binding/index.ts
@@ -0,0 +1,2 @@
+export { useNumberVariableBinding } from './use'
+export type { NumberBindingPath } from './use'
diff --git a/packages/vue/src/controls/okhcl/helpers.ts b/packages/vue/src/controls/okhcl/helpers.ts
index ce952430f..4c0b50e8a 100644
--- a/packages/vue/src/controls/okhcl/helpers.ts
+++ b/packages/vue/src/controls/okhcl/helpers.ts
@@ -1,7 +1,7 @@
import type { Ref } from 'vue'
+import type { Editor } from '@open-pencil/core'
import { BLACK } from '@open-pencil/core/constants'
-import type { Editor } from '@open-pencil/core/editor'
import type { SceneNode } from '@open-pencil/scene-graph'
import {
getFillOkHCL,
@@ -9,9 +9,10 @@ import {
resolveOkHCLForPreview,
rgbaToOkHCL,
setNodeFillOkHCL,
- setNodeStrokeOkHCL
+ setNodeStrokeOkHCL,
+ type OkHCLColor,
+ type OkHCLColorSpace
} from '@open-pencil/scene-graph/color'
-import type { OkHCLColor, OkHCLColorSpace } from '@open-pencil/scene-graph/color'
import type { ColorFieldFormat } from '#vue/controls/color-model/types'
diff --git a/packages/vue/src/controls/okhcl/index.ts b/packages/vue/src/controls/okhcl/index.ts
new file mode 100644
index 000000000..14166d56a
--- /dev/null
+++ b/packages/vue/src/controls/okhcl/index.ts
@@ -0,0 +1 @@
+export { useOkHCL } from './use'
diff --git a/packages/vue/src/controls/position/index.ts b/packages/vue/src/controls/position/index.ts
new file mode 100644
index 000000000..4d63ccb11
--- /dev/null
+++ b/packages/vue/src/controls/position/index.ts
@@ -0,0 +1 @@
+export { usePosition } from './use'
diff --git a/packages/vue/src/controls/position/use.ts b/packages/vue/src/controls/position/use.ts
index 137ed4fe5..2cc5bfc0d 100644
--- a/packages/vue/src/controls/position/use.ts
+++ b/packages/vue/src/controls/position/use.ts
@@ -6,7 +6,8 @@ import {
panelRotation,
panelRotationChange
} from '@open-pencil/core/geometry'
-import { layerRotates, type NumericNodeProperty, type SceneNode } from '@open-pencil/scene-graph'
+import type { NumericNodeProperty, SceneNode } from '@open-pencil/scene-graph'
+import { layerRotates } from '@open-pencil/scene-graph/generated'
import { MIXED, useNodeProps, type MixedValue } from '#vue/controls/node-props/use'
import { usePropScrub } from '#vue/controls/prop-scrub/use'
diff --git a/packages/vue/src/controls/prop-scrub/index.ts b/packages/vue/src/controls/prop-scrub/index.ts
new file mode 100644
index 000000000..733a12f89
--- /dev/null
+++ b/packages/vue/src/controls/prop-scrub/index.ts
@@ -0,0 +1 @@
+export { usePropScrub } from './use'
diff --git a/packages/vue/src/controls/prop-scrub/use.ts b/packages/vue/src/controls/prop-scrub/use.ts
index aaa97e8e8..a20b6b8d8 100644
--- a/packages/vue/src/controls/prop-scrub/use.ts
+++ b/packages/vue/src/controls/prop-scrub/use.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { NumericNodeProperty, SceneNode } from '@open-pencil/scene-graph'
import { useNodePreview } from '#vue/controls/node-preview/use'
diff --git a/packages/vue/src/controls/selection-colors/index.ts b/packages/vue/src/controls/selection-colors/index.ts
new file mode 100644
index 000000000..1042dff0b
--- /dev/null
+++ b/packages/vue/src/controls/selection-colors/index.ts
@@ -0,0 +1 @@
+export { useSelectionColors } from './use'
diff --git a/packages/vue/src/controls/selection-colors/use.ts b/packages/vue/src/controls/selection-colors/use.ts
index f4ddb5d49..ee443d2e8 100644
--- a/packages/vue/src/controls/selection-colors/use.ts
+++ b/packages/vue/src/controls/selection-colors/use.ts
@@ -5,7 +5,7 @@ import {
selectionColors,
selectionColorsShown,
type SelectionColor
-} from '@open-pencil/core/editor'
+} from '@open-pencil/core'
import { useUndoBatch } from '#vue/controls/undo-batch/use'
import { useEditor } from '#vue/editor/context'
diff --git a/packages/vue/src/controls/selection-layout/index.ts b/packages/vue/src/controls/selection-layout/index.ts
new file mode 100644
index 000000000..f5f5ae213
--- /dev/null
+++ b/packages/vue/src/controls/selection-layout/index.ts
@@ -0,0 +1,2 @@
+export { LAYOUT_CONTAINER_TYPES, textResizeMode, useSelectionLayout } from './use'
+export type { TextResizeMode } from './use'
diff --git a/packages/vue/src/controls/shader/preset.ts b/packages/vue/src/controls/shader/preset.ts
index bc58efaac..8e9851cee 100644
--- a/packages/vue/src/controls/shader/preset.ts
+++ b/packages/vue/src/controls/shader/preset.ts
@@ -1,6 +1,6 @@
import * as v from 'valibot'
-import { shaderPresetSchema, type ShaderPreset } from '@open-pencil/scene-graph'
+import { shaderPresetSchema, type ShaderPreset } from '@open-pencil/scene-graph/shaders'
/**
* Edits of a shader preset's stack of effects. The effects at the top level draw first to last,
diff --git a/packages/vue/src/controls/shader/preview.ts b/packages/vue/src/controls/shader/preview.ts
index 1c12d3a78..a6150b95d 100644
--- a/packages/vue/src/controls/shader/preview.ts
+++ b/packages/vue/src/controls/shader/preview.ts
@@ -1,4 +1,5 @@
-import { imageMimeType, type ShaderPreset } from '@open-pencil/scene-graph'
+import { imageMimeType } from '@open-pencil/scene-graph/images'
+import type { ShaderPreset } from '@open-pencil/scene-graph/shaders'
import { createShaderRasterizer } from '#vue/canvas/surface/shader/rasterizer'
diff --git a/packages/vue/src/controls/shape-with-text/index.ts b/packages/vue/src/controls/shape-with-text/index.ts
new file mode 100644
index 000000000..0eabf106e
--- /dev/null
+++ b/packages/vue/src/controls/shape-with-text/index.ts
@@ -0,0 +1 @@
+export { useShapeWithText } from './use'
diff --git a/packages/vue/src/controls/shape-with-text/use.ts b/packages/vue/src/controls/shape-with-text/use.ts
index 99b2f4899..9b5fa5b4e 100644
--- a/packages/vue/src/controls/shape-with-text/use.ts
+++ b/packages/vue/src/controls/shape-with-text/use.ts
@@ -1,21 +1,19 @@
import { computed } from 'vue'
+import type { SceneNode } from '@open-pencil/scene-graph'
import {
figJamColorName,
figJamFillMode,
figJamLineStyle,
figJamTextSize,
figJamTypeface,
- shapeWithTextLabel
-} from '@open-pencil/scene-graph'
-import type {
- FigJamColorName,
- FigJamFillMode,
- FigJamLineStyle,
- FigJamTextSize,
- FigJamTypeface,
- SceneNode
-} from '@open-pencil/scene-graph'
+ type FigJamColorName,
+ type FigJamFillMode,
+ type FigJamLineStyle,
+ type FigJamTextSize,
+ type FigJamTypeface
+} from '@open-pencil/scene-graph/figjam'
+import { shapeWithTextLabel } from '@open-pencil/scene-graph/generated'
import type { ShapeWithTextType } from '@open-pencil/scene-graph/shape-with-text'
import { useEditor } from '#vue/editor/context'
diff --git a/packages/vue/src/controls/shared-style/model.ts b/packages/vue/src/controls/shared-style/model.ts
index 93227126c..19f011b8b 100644
--- a/packages/vue/src/controls/shared-style/model.ts
+++ b/packages/vue/src/controls/shared-style/model.ts
@@ -1,12 +1,7 @@
import { BLACK } from '@open-pencil/core/constants'
-import {
- copyEffects,
- copyFills,
- copyLayoutGrids,
- sharedStyleRefKey,
- type SceneNode,
- type SharedStyleKind
-} from '@open-pencil/scene-graph'
+import type { SceneNode, SharedStyleKind } from '@open-pencil/scene-graph'
+import { copyEffects, copyFills, copyLayoutGrids } from '@open-pencil/scene-graph/copy'
+import { sharedStyleRefKey } from '@open-pencil/scene-graph/shared-styles'
function strokePaintsFromStyle(target: SceneNode, style: SceneNode): SceneNode['strokes'] {
const fills = style.fills.filter((fill) => fill.type === 'SOLID')
diff --git a/packages/vue/src/controls/shared-style/use.ts b/packages/vue/src/controls/shared-style/use.ts
index dab0ac92d..83ff46ba5 100644
--- a/packages/vue/src/controls/shared-style/use.ts
+++ b/packages/vue/src/controls/shared-style/use.ts
@@ -1,12 +1,11 @@
import { computed } from 'vue'
+import type { SceneNode, SharedStyleKind } from '@open-pencil/scene-graph'
import {
getSharedStyles,
sharedStyleRefKey,
- sharedStyleTypeForKind,
- type SceneNode,
- type SharedStyleKind
-} from '@open-pencil/scene-graph'
+ sharedStyleTypeForKind
+} from '@open-pencil/scene-graph/shared-styles'
import { useNodeProps } from '#vue/controls/node-props/use'
import { sharedStyleDetachPatch, sharedStylePatch } from '#vue/controls/shared-style/model'
diff --git a/packages/vue/src/controls/slots/authoring.ts b/packages/vue/src/controls/slots/authoring.ts
index 2c412cf3c..3b3a08332 100644
--- a/packages/vue/src/controls/slots/authoring.ts
+++ b/packages/vue/src/controls/slots/authoring.ts
@@ -1,9 +1,10 @@
-import { canCreateSlot, slotOwner, slotPropertyId } from '@open-pencil/scene-graph'
-import type {
- ComponentPropertyDefinition,
- SceneNode,
- SlotPropertyPatch
-} from '@open-pencil/scene-graph'
+import type { ComponentPropertyDefinition, SceneNode } from '@open-pencil/scene-graph'
+import {
+ canCreateSlot,
+ slotOwner,
+ slotPropertyId,
+ type SlotPropertyPatch
+} from '@open-pencil/scene-graph/slots'
import { useEditor } from '#vue/editor/context'
import { useSceneComputed } from '#vue/internal/scene-computed/use'
diff --git a/packages/vue/src/controls/slots/instance.ts b/packages/vue/src/controls/slots/instance.ts
index ae9a8bca1..cd35e0131 100644
--- a/packages/vue/src/controls/slots/instance.ts
+++ b/packages/vue/src/controls/slots/instance.ts
@@ -1,11 +1,11 @@
+import type { ComponentPropertyDefinition, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
instanceSlotFrames,
isPreferredComponent,
nonPreferredLayers,
ownsSlotContent,
slotPropertyId
-} from '@open-pencil/scene-graph'
-import type { ComponentPropertyDefinition, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/slots'
import { useEditor } from '#vue/editor/context'
import { useSceneComputed } from '#vue/internal/scene-computed/use'
diff --git a/packages/vue/src/controls/sticky/index.ts b/packages/vue/src/controls/sticky/index.ts
new file mode 100644
index 000000000..3a8bfb318
--- /dev/null
+++ b/packages/vue/src/controls/sticky/index.ts
@@ -0,0 +1 @@
+export { useStickyNote } from './use'
diff --git a/packages/vue/src/controls/sticky/use.ts b/packages/vue/src/controls/sticky/use.ts
index e1382b039..98386cabc 100644
--- a/packages/vue/src/controls/sticky/use.ts
+++ b/packages/vue/src/controls/sticky/use.ts
@@ -1,7 +1,13 @@
import { computed } from 'vue'
-import { figJamTextSize, figJamTypeface, stickySublayers } from '@open-pencil/scene-graph'
-import type { FigJamTextSize, FigJamTypeface, SceneNode } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import {
+ figJamTextSize,
+ figJamTypeface,
+ type FigJamTextSize,
+ type FigJamTypeface
+} from '@open-pencil/scene-graph/figjam'
+import { stickySublayers } from '@open-pencil/scene-graph/generated'
import type { Color } from '@open-pencil/scene-graph/primitives'
import { useEditor } from '#vue/editor/context'
diff --git a/packages/vue/src/controls/stroke/helpers.ts b/packages/vue/src/controls/stroke/helpers.ts
index a353dd828..5f5208e0d 100644
--- a/packages/vue/src/controls/stroke/helpers.ts
+++ b/packages/vue/src/controls/stroke/helpers.ts
@@ -1,10 +1,10 @@
import { compact } from 'es-toolkit/array'
import { computed, type ComputedRef, type Ref } from 'vue'
+import type { Editor } from '@open-pencil/core'
import { BLACK } from '@open-pencil/core/constants'
-import type { Editor } from '@open-pencil/core/editor'
-import { cloneVectorNetwork } from '@open-pencil/scene-graph'
import type { SceneNode, Stroke, StrokeCap, StrokeJoin } from '@open-pencil/scene-graph'
+import { cloneVectorNetwork } from '@open-pencil/scene-graph/vector-network'
import { MIXED } from '#vue/controls/node-props/use'
import type { MixedValue } from '#vue/controls/node-props/use'
diff --git a/packages/vue/src/controls/stroke/index.ts b/packages/vue/src/controls/stroke/index.ts
new file mode 100644
index 000000000..8b597b52a
--- /dev/null
+++ b/packages/vue/src/controls/stroke/index.ts
@@ -0,0 +1,2 @@
+export { useStrokeControls } from './use'
+export { isStrokeCapValue } from './helpers'
diff --git a/packages/vue/src/controls/stroke/use.ts b/packages/vue/src/controls/stroke/use.ts
index e0b9d78ad..726f58b96 100644
--- a/packages/vue/src/controls/stroke/use.ts
+++ b/packages/vue/src/controls/stroke/use.ts
@@ -1,6 +1,7 @@
import { ref } from 'vue'
-import { newStrokeGeometry, type Stroke } from '@open-pencil/scene-graph'
+import type { Stroke } from '@open-pencil/scene-graph'
+import { newStrokeGeometry } from '@open-pencil/scene-graph/node-defaults'
import { useNodeProps } from '#vue/controls/node-props/use'
import {
diff --git a/packages/vue/src/controls/typography/actions.ts b/packages/vue/src/controls/typography/actions.ts
index 8e1269b44..7af7e3096 100644
--- a/packages/vue/src/controls/typography/actions.ts
+++ b/packages/vue/src/controls/typography/actions.ts
@@ -1,20 +1,16 @@
import { computed } from 'vue'
import type { ComputedRef } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
-import {
- FONT_WEIGHT_NAMES,
- fontManager,
- nearestFamilyFace,
- weightToStyle
-} from '@open-pencil/core/text'
-import { shapeWithTextLabel } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
+import { fontManager, nearestFamilyFace } from '@open-pencil/core/text'
import type {
SceneNode,
TextDecoration,
TextListType,
TextParagraphSpacingField
} from '@open-pencil/scene-graph'
+import { FONT_WEIGHT_NAMES, weightToStyle } from '@open-pencil/scene-graph/font-style'
+import { shapeWithTextLabel } from '@open-pencil/scene-graph/generated'
import {
createTextListActions,
diff --git a/packages/vue/src/controls/typography/index.ts b/packages/vue/src/controls/typography/index.ts
new file mode 100644
index 000000000..a76616939
--- /dev/null
+++ b/packages/vue/src/controls/typography/index.ts
@@ -0,0 +1,2 @@
+export { useTypography } from './use'
+export type { UseTypographyOptions } from './use'
diff --git a/packages/vue/src/controls/typography/weights.ts b/packages/vue/src/controls/typography/weights.ts
index 445e1be5a..056658831 100644
--- a/packages/vue/src/controls/typography/weights.ts
+++ b/packages/vue/src/controls/typography/weights.ts
@@ -1,4 +1,4 @@
-import { FONT_WEIGHT_NAMES } from '@open-pencil/core/text'
+import { FONT_WEIGHT_NAMES } from '@open-pencil/scene-graph/font-style'
/** The standard weights by value, Thin 100 to Black 900, named as Figma names them. */
export const TYPOGRAPHY_WEIGHTS = Object.entries(FONT_WEIGHT_NAMES).map(([value, label]) => ({
diff --git a/packages/vue/src/controls/undo-batch/use.ts b/packages/vue/src/controls/undo-batch/use.ts
index fbba55cf0..369848bfd 100644
--- a/packages/vue/src/controls/undo-batch/use.ts
+++ b/packages/vue/src/controls/undo-batch/use.ts
@@ -1,7 +1,7 @@
import { tryOnScopeDispose, useTimeoutFn } from '@vueuse/core'
import { getCurrentInstance, onDeactivated } from 'vue'
-import type { UndoManager } from '@open-pencil/scene-graph'
+import type { UndoManager } from '@open-pencil/scene-graph/undo'
const BATCH_IDLE_MS = 300
diff --git a/packages/vue/src/controls/variable-binding/index.ts b/packages/vue/src/controls/variable-binding/index.ts
new file mode 100644
index 000000000..1cbcbcf89
--- /dev/null
+++ b/packages/vue/src/controls/variable-binding/index.ts
@@ -0,0 +1,2 @@
+export { useVariableBinding } from './use'
+export type { VariableBindingState, UseVariableBindingOptions } from './use'
diff --git a/packages/vue/src/controls/variable-modes/helpers.ts b/packages/vue/src/controls/variable-modes/helpers.ts
index 896dea5f0..05b9ca1de 100644
--- a/packages/vue/src/controls/variable-modes/helpers.ts
+++ b/packages/vue/src/controls/variable-modes/helpers.ts
@@ -1,13 +1,13 @@
import { omit } from 'es-toolkit'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import {
- collectionsBoundIn,
isLibraryCollection,
type SceneNode,
type VariableCollection,
type VariableCollectionMode
} from '@open-pencil/scene-graph'
+import { collectionsBoundIn } from '@open-pencil/scene-graph/variables'
import { MIXED, type MixedValue } from '#vue/controls/node-props/use'
diff --git a/packages/vue/src/controls/variable-modes/index.ts b/packages/vue/src/controls/variable-modes/index.ts
new file mode 100644
index 000000000..c3108eb50
--- /dev/null
+++ b/packages/vue/src/controls/variable-modes/index.ts
@@ -0,0 +1,7 @@
+export { useVariableModes } from './use'
+export {
+ setVariableMode,
+ variableModeChoices,
+ type VariableModeChoice,
+ type VariableModeOption
+} from './helpers'
diff --git a/packages/vue/src/controls/variants/authoring.ts b/packages/vue/src/controls/variants/authoring.ts
index 20977249f..2dc693280 100644
--- a/packages/vue/src/controls/variants/authoring.ts
+++ b/packages/vue/src/controls/variants/authoring.ts
@@ -1,6 +1,6 @@
import { computed } from 'vue'
-import type { VariantConflict } from '@open-pencil/core/editor'
+import type { VariantConflict } from '@open-pencil/core'
import type { ComponentPropertyDefinition, SceneNode } from '@open-pencil/scene-graph'
import { useEditor } from '#vue/editor/context'
diff --git a/packages/vue/src/document/export/helpers.ts b/packages/vue/src/document/export/helpers.ts
index df7abc754..720e11fb2 100644
--- a/packages/vue/src/document/export/helpers.ts
+++ b/packages/vue/src/document/export/helpers.ts
@@ -1,17 +1,16 @@
import { computed } from 'vue'
import type { ComputedRef } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { BUILTIN_IO_FORMATS, IORegistry, type BuiltinIOFormatId } from '@open-pencil/core/io'
+import type { ExportSetting, PluginDataEntry } from '@open-pencil/scene-graph'
+import { EXPORT_FORMAT_IDS, type ExportFormatId } from '@open-pencil/scene-graph/export-format'
import {
- EXPORT_FORMAT_IDS,
MAX_EXPORT_SCALE,
MIN_EXPORT_SCALE,
- OPEN_PENCIL_PLUGIN_DATA,
- clampExportScale,
- withPluginData
-} from '@open-pencil/scene-graph'
-import type { ExportFormatId, ExportSetting, PluginDataEntry } from '@open-pencil/scene-graph'
+ clampExportScale
+} from '@open-pencil/scene-graph/export-scale'
+import { OPEN_PENCIL_PLUGIN_DATA, withPluginData } from '@open-pencil/scene-graph/plugin-data'
import { useSceneComputed } from '#vue/internal/scene-computed/use'
diff --git a/packages/vue/src/document/export/index.ts b/packages/vue/src/document/export/index.ts
new file mode 100644
index 000000000..73b39b42b
--- /dev/null
+++ b/packages/vue/src/document/export/index.ts
@@ -0,0 +1,2 @@
+export { useExport } from './use'
+export type { ExportFormatOption } from './use'
diff --git a/packages/vue/src/document/export/use.ts b/packages/vue/src/document/export/use.ts
index dd722f22f..b57aba2af 100644
--- a/packages/vue/src/document/export/use.ts
+++ b/packages/vue/src/document/export/use.ts
@@ -12,7 +12,6 @@ import {
import { useEditor } from '#vue/editor/context'
import { useSceneComputed } from '#vue/internal/scene-computed/use'
-export type { ExportFormatId, ExportSetting } from '@open-pencil/scene-graph'
export type { ExportFormatOption, ExportPanelTarget } from '#vue/document/export/helpers'
export function useExport() {
diff --git a/packages/vue/src/document/workspace/index.ts b/packages/vue/src/document/workspace/index.ts
new file mode 100644
index 000000000..f50b995b0
--- /dev/null
+++ b/packages/vue/src/document/workspace/index.ts
@@ -0,0 +1,6 @@
+export { useDocumentWorkspace } from './use'
+export type {
+ DocumentWorkspaceItem,
+ DocumentWorkspaceSource,
+ UseDocumentWorkspaceOptions
+} from './use'
diff --git a/packages/vue/src/editor/commands/context.ts b/packages/vue/src/editor/commands/context.ts
index aa6f989e3..1847cca02 100644
--- a/packages/vue/src/editor/commands/context.ts
+++ b/packages/vue/src/editor/commands/context.ts
@@ -1,6 +1,6 @@
import type { ComputedRef } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { useSelectionCapabilities } from '#vue/editor/selection-capabilities/use'
import type { useSelectionState } from '#vue/editor/selection-state/use'
diff --git a/packages/vue/src/editor/commands/index.ts b/packages/vue/src/editor/commands/index.ts
new file mode 100644
index 000000000..d131e3097
--- /dev/null
+++ b/packages/vue/src/editor/commands/index.ts
@@ -0,0 +1,6 @@
+export { useEditorCommands } from './use'
+export { EDITOR_COMMAND_METADATA, editorCommandMetadata } from './registry'
+export { formatShortcut, shortcutPlatform } from './shortcut'
+export type { EditorCommandMetadata } from './registry'
+export type { ShortcutPlatform } from './shortcut'
+export type { EditorCommand, EditorCommandId } from './use'
diff --git a/packages/vue/src/editor/commands/selection.ts b/packages/vue/src/editor/commands/selection.ts
index bd784061c..0a30a6d04 100644
--- a/packages/vue/src/editor/commands/selection.ts
+++ b/packages/vue/src/editor/commands/selection.ts
@@ -1,4 +1,5 @@
-import { readIcon, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { readIcon } from '@open-pencil/scene-graph/icons'
import type { EditorCommandMapOptions } from './context'
import type { EditorCommand, EditorCommandId } from './types'
diff --git a/packages/vue/src/editor/context/index.ts b/packages/vue/src/editor/context/index.ts
index 532e21715..65a31206a 100644
--- a/packages/vue/src/editor/context/index.ts
+++ b/packages/vue/src/editor/context/index.ts
@@ -1,7 +1,7 @@
import { inject, provide } from 'vue'
import type { InjectionKey } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
/**
* Injection key for the current OpenPencil editor instance.
diff --git a/packages/vue/src/editor/events/index.ts b/packages/vue/src/editor/events/index.ts
new file mode 100644
index 000000000..aaeac6bb0
--- /dev/null
+++ b/packages/vue/src/editor/events/index.ts
@@ -0,0 +1 @@
+export { useEditorEvent } from './use'
diff --git a/packages/vue/src/editor/events/use.ts b/packages/vue/src/editor/events/use.ts
index 5a8c89490..1a70283da 100644
--- a/packages/vue/src/editor/events/use.ts
+++ b/packages/vue/src/editor/events/use.ts
@@ -1,6 +1,6 @@
import { onScopeDispose } from 'vue'
-import type { EditorEventName, EditorEvents } from '@open-pencil/core/editor'
+import type { EditorEventName, EditorEvents } from '@open-pencil/core'
import { useEditor } from '#vue/editor/context'
diff --git a/packages/vue/src/editor/inline-rename/index.ts b/packages/vue/src/editor/inline-rename/index.ts
new file mode 100644
index 000000000..55397278a
--- /dev/null
+++ b/packages/vue/src/editor/inline-rename/index.ts
@@ -0,0 +1 @@
+export { useInlineRename } from './use'
diff --git a/packages/vue/src/editor/menu-model/index.ts b/packages/vue/src/editor/menu-model/index.ts
new file mode 100644
index 000000000..2794a7018
--- /dev/null
+++ b/packages/vue/src/editor/menu-model/index.ts
@@ -0,0 +1,2 @@
+export { useMenuModel } from './use'
+export type { MenuActionNode, MenuEntry, MenuSeparatorNode } from './use'
diff --git a/packages/vue/src/editor/selection-capabilities/index.ts b/packages/vue/src/editor/selection-capabilities/index.ts
new file mode 100644
index 000000000..ed138b5e6
--- /dev/null
+++ b/packages/vue/src/editor/selection-capabilities/index.ts
@@ -0,0 +1 @@
+export { useSelectionCapabilities } from './use'
diff --git a/packages/vue/src/editor/selection-state/index.ts b/packages/vue/src/editor/selection-state/index.ts
new file mode 100644
index 000000000..eaa979464
--- /dev/null
+++ b/packages/vue/src/editor/selection-state/index.ts
@@ -0,0 +1,3 @@
+export { useSelectionState } from './use'
+export { createSelectedNodeState } from './nodes'
+export type { SelectedNodeState } from './nodes'
diff --git a/packages/vue/src/editor/selection-state/nodes.ts b/packages/vue/src/editor/selection-state/nodes.ts
index 2a1617f66..952988b2f 100644
--- a/packages/vue/src/editor/selection-state/nodes.ts
+++ b/packages/vue/src/editor/selection-state/nodes.ts
@@ -2,7 +2,7 @@ import { tryOnScopeDispose, watchImmediate } from '@vueuse/core'
import { computed, shallowReactive, shallowRef } from 'vue'
import type { ComputedRef, Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import { useEditor } from '#vue/editor/context'
diff --git a/packages/vue/src/editor/selection-state/use.ts b/packages/vue/src/editor/selection-state/use.ts
index 8593562ba..4580d8a1c 100644
--- a/packages/vue/src/editor/selection-state/use.ts
+++ b/packages/vue/src/editor/selection-state/use.ts
@@ -1,11 +1,11 @@
import { computed } from 'vue'
+import { readIcon } from '@open-pencil/scene-graph/icons'
import {
canCreateSlot as canBecomeSlot,
- readIcon,
slotOwner,
slotPropertyId
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/slots'
import { useEditor } from '#vue/editor/context'
import { useSelectedNodeState } from '#vue/editor/selection-state/nodes'
diff --git a/packages/vue/src/editor/tool-cursor/index.ts b/packages/vue/src/editor/tool-cursor/index.ts
index f6d086637..3bdd66163 100644
--- a/packages/vue/src/editor/tool-cursor/index.ts
+++ b/packages/vue/src/editor/tool-cursor/index.ts
@@ -1,4 +1,4 @@
-import type { Tool } from '@open-pencil/core/editor'
+import type { Tool } from '@open-pencil/core'
import commentCursorSVG from '#vue/shared/assets/cursors/comment.svg?raw'
import handGrabCursorSVG from '#vue/shared/assets/cursors/hand-grab.svg?raw'
diff --git a/packages/vue/src/editor/viewport-kind/index.ts b/packages/vue/src/editor/viewport-kind/index.ts
new file mode 100644
index 000000000..24723cdba
--- /dev/null
+++ b/packages/vue/src/editor/viewport-kind/index.ts
@@ -0,0 +1 @@
+export { useViewportKind } from './use'
diff --git a/packages/vue/src/index.ts b/packages/vue/src/index.ts
index 5353a34dc..64d2cb7f6 100644
--- a/packages/vue/src/index.ts
+++ b/packages/vue/src/index.ts
@@ -1,473 +1,5 @@
-export type {
- Editor,
- EditorState,
- EditorOptions,
- EditorEvents,
- EditorEventName,
- Tool,
- EditorToolDef
-} from '@open-pencil/core/editor'
-export { createEditor, EDITOR_TOOLS, TOOL_SHORTCUTS } from '@open-pencil/core/editor'
-
/**
- * Public editor-context API for the Vue SDK.
- *
- * These are the primary entry points for making an editor available to a Vue
- * subtree and reading it back inside composables and headless primitives.
+ * Public editor-context API for the Vue SDK: makes an editor available to a Vue subtree and
+ * reads it back. Every other domain is a subpath named after its source folder.
*/
export { provideEditor, useEditor, EDITOR_KEY } from '#vue/editor/context'
-
-/** Canvas and input integration composables. */
-export { supportsWideGamutPresentation } from '#vue/canvas/surface/color-space'
-export type { PresentationColorSpace } from '#vue/canvas/surface/color-space'
-export { useCanvas } from '#vue/canvas/surface/use'
-export type { UseCanvasOptions } from '#vue/canvas/surface/use'
-export { useCanvasInput } from '#vue/canvas/useCanvasInput'
-export {
- autoLayoutValueAnchor,
- type AutoLayoutValueField
-} from '#vue/shared/input/auto-layout-hover'
-export { useCanvasIssueMarkers } from '#vue/canvas/issues/use'
-export { useCanvasStatusLabels } from '#vue/canvas/statuses/use'
-export type { CanvasIssueMarkerOptions } from '#vue/canvas/issues/use'
-export type { CanvasLabelEdit, CanvasLabelKind } from '#vue/canvas/labels/edit'
-export { useCanvasVirtualReference } from '#vue/canvas/overlays/useCanvasVirtualReference'
-export { useTextEdit } from '#vue/canvas/text-edit/use'
-export { isCanvasTextInput } from '#vue/canvas/text-edit/textarea'
-export {
- useCanvasDrop,
- extractImageFilesFromClipboard,
- filterCanvasFiles
-} from '#vue/canvas/drop/use'
-
-/** Low-level selection, graph, and derived-state helpers. */
-export { useNodeProps, MIXED } from '#vue/controls/node-props/use'
-export type { MixedValue } from '#vue/controls/node-props/use'
-export { useSceneComputed } from '#vue/internal/scene-computed/use'
-export { useSelectionState } from '#vue/editor/selection-state/use'
-export { createSelectedNodeState } from '#vue/editor/selection-state/nodes'
-export { provideRetainedActivity, useRetainedActivity } from '#vue/lifecycle/retention/context'
-export { createRetainedScopePlugin } from '#vue/lifecycle/retention/plugin'
-export { useRetainedPopup } from '#vue/lifecycle/retention/popup'
-export type { SelectedNodeState } from '#vue/editor/selection-state/nodes'
-export { useEditorEvent } from '#vue/editor/events/use'
-export { useSelectionCapabilities } from '#vue/editor/selection-capabilities/use'
-
-/** Command palette primitives and search state. */
-export { CommandPaletteRoot, useCommandPalette } from '#vue/primitives/CommandPalette'
-export type {
- CommandPaletteGroup,
- CommandPaletteItem,
- CommandPaletteShortcut,
- CommandPaletteLabels,
- CommandPaletteUI,
- UseCommandPaletteOptions
-} from '#vue/primitives/CommandPalette'
-
-export { useEditorCommands } from '#vue/editor/commands/use'
-export { EDITOR_COMMAND_METADATA, editorCommandMetadata } from '#vue/editor/commands/registry'
-export { formatShortcut, shortcutPlatform } from '#vue/editor/commands/shortcut'
-export type { EditorCommandMetadata } from '#vue/editor/commands/registry'
-export type { ShortcutPlatform } from '#vue/editor/commands/shortcut'
-export type { EditorCommand, EditorCommandId } from '#vue/editor/commands/use'
-export { useMenuModel } from '#vue/editor/menu-model/use'
-export type { MenuActionNode, MenuEntry, MenuSeparatorNode } from '#vue/editor/menu-model/use'
-
-/** Miscellaneous editor-shell helpers. */
-export { useViewportKind } from '#vue/editor/viewport-kind/use'
-export { useLayerDrag } from '#vue/primitives/LayerTree/useLayerDrag'
-export { useFlatReorderDrag } from '#vue/shared/drag/useFlatReorderDrag'
-export type {
- FlatReorderAxis,
- FlatReorderInstruction,
- FlatReorderItem,
- FlatReorderOperations,
- UseFlatReorderDragOptions
-} from '#vue/shared/drag/useFlatReorderDrag'
-export { useInlineRename } from '#vue/editor/inline-rename/use'
-export {
- getToolbarToolSelection,
- isToolbarToolActive,
- useToolbarState
-} from '#vue/primitives/Toolbar/useToolbarState'
-export { useNodeFontStatus } from '#vue/shared/font-status/use'
-export { fuzzyFilter, fuzzySearch } from '#vue/shared/search/fuzzy'
-export { usePropScrub } from '#vue/controls/prop-scrub/use'
-export { toolCursor } from '#vue/editor/tool-cursor'
-export {
- acpPermissionOptionTestId,
- testId,
- testIdSelector,
- toolbarFlyoutItemTestId,
- toolbarFlyoutTestId,
- toolbarToolTestId,
- variablesAddTestId
-} from '#vue/testing/test-id'
-export { vTestId } from '#vue/testing/v-test-id'
-export type { TestId } from '#vue/testing/test-id'
-
-/** Property-panel composables. */
-export { usePosition } from '#vue/controls/position/use'
-export { useLayout } from '#vue/controls/layout/use'
-export { useSelectionColors } from '#vue/controls/selection-colors/use'
-export {
- LAYOUT_CONTAINER_TYPES,
- textResizeMode,
- useSelectionLayout
-} from '#vue/controls/selection-layout/use'
-export type { TextResizeMode } from '#vue/controls/selection-layout/use'
-export type { LayoutAxis, SizeLimitProp } from '#vue/controls/layout/helpers'
-export { useAppearance } from '#vue/controls/appearance/use'
-export { useVariableModes } from '#vue/controls/variable-modes/use'
-export {
- setVariableMode,
- variableModeChoices,
- type VariableModeChoice,
- type VariableModeOption
-} from '#vue/controls/variable-modes/helpers'
-export { useMask } from '#vue/controls/mask/use'
-export { useConnector } from '#vue/controls/connector/use'
-export { useShapeWithText } from '#vue/controls/shape-with-text/use'
-export { useStickyNote } from '#vue/controls/sticky/use'
-export { useIcon } from '#vue/controls/icon/use'
-export { useIconSearch } from '#vue/controls/icon/search'
-export { useTypography } from '#vue/controls/typography/use'
-export type { UseTypographyOptions } from '#vue/controls/typography/use'
-export { useDocumentWorkspace } from '#vue/document/workspace/use'
-export type {
- DocumentWorkspaceItem,
- DocumentWorkspaceSource,
- UseDocumentWorkspaceOptions
-} from '#vue/document/workspace/use'
-export { useExport } from '#vue/document/export/use'
-export type { ExportFormatId, ExportFormatOption, ExportSetting } from '#vue/document/export/use'
-export { useFillControls } from '#vue/controls/fill/use'
-export { canDrawShaders, createShaderRasterizer } from '#vue/canvas/surface/shader/rasterizer'
-export {
- addShaderEffect,
- DEFAULT_SHADER_EFFECT,
- DEFAULT_SHADER_PRESET,
- loadShaderCatalog,
- moveShaderEffect,
- parseShaderPreset,
- removeShaderEffect,
- setShaderEffectProp,
- shaderEffectLabel,
- shaderEffectPreview,
- shaderPresetJSON
-} from '#vue/controls/shader'
-export type { ShaderEffect, ShaderPropControl } from '#vue/controls/shader'
-export { useColorVariableBinding } from '#vue/controls/color-variable-binding/use'
-export { useNumberVariableBinding } from '#vue/controls/number-variable-binding/use'
-export type { NumberBindingPath } from '#vue/controls/number-variable-binding/use'
-export { useVariableBinding } from '#vue/controls/variable-binding/use'
-export type {
- VariableBindingState,
- UseVariableBindingOptions
-} from '#vue/controls/variable-binding/use'
-export { useEffectsControls } from '#vue/controls/effects/use'
-export { useSharedStyleBinding } from '#vue/controls/shared-style/use'
-export { useStrokeControls } from '#vue/controls/stroke/use'
-export { isStrokeCapValue } from '#vue/controls/stroke/helpers'
-export {
- applySolidFillColor,
- applySolidStrokeColor,
- applyStrokePaint,
- BUILT_IN_COLOR_FORMATS,
- fromPercent,
- toPercent,
- useColorModel
-} from '#vue/controls/color-model'
-export type {
- BuiltInColorFormat,
- ColorFieldFormat,
- ColorFieldOption,
- OkHCLControls,
- UseColorModelOptions
-} from '#vue/controls/color-model'
-export { useOkHCL } from '#vue/controls/okhcl/use'
-
-/** Variables, page navigation, and picker helpers. */
-export { useVariables } from '#vue/variables/use'
-export { usePageList } from '#vue/primitives/PageList/usePageList'
-export {
- fillCategory,
- fillIsTransparent,
- fillSwatchBackground,
- useFill
-} from '#vue/primitives/Fill'
-export type { FillActions, FillCategory } from '#vue/primitives/Fill'
-export { useGradientStops } from '#vue/primitives/GradientEditor/useGradientStops'
-export { useFontPicker } from '#vue/primitives/FontPicker/useFontPicker'
-
-/** Headless structural primitives and their local contexts. */
-export { CanvasRoot, CanvasSurface, PlayIslands, useCanvasContext } from '#vue/canvas'
-export type { CanvasContext } from '#vue/canvas'
-export { ColorInputRoot, ColorPickerRoot } from '#vue/primitives/ColorPicker'
-export {
- ChannelSliderRoot,
- ChannelSliderThumb,
- ChannelSliderTrack
-} from '#vue/primitives/ChannelSlider'
-export type {
- ChannelSliderOrientation,
- ChannelSliderPartProps,
- ChannelSliderRootProps,
- ChannelSliderRootSlotProps,
- ChannelSliderThumbSlotProps
-} from '#vue/primitives/ChannelSlider'
-export { FillRoot, FillSwatch } from '#vue/primitives/Fill'
-export type {
- FillRootSlotProps,
- FillRootSlots,
- FillSwatchProps,
- FillSwatchSlotProps,
- FillSwatchSlots
-} from '#vue/primitives/Fill'
-export { FontPickerRoot } from '#vue/primitives/FontPicker'
-export type { FontFamilyOption, FontPickerUI } from '#vue/primitives/FontPicker'
-export {
- GradientEditorRoot,
- GradientEditorBar,
- GradientEditorStop
-} from '#vue/primitives/GradientEditor'
-export type {
- GradientEditorStopActions,
- GradientEditorStopProps,
- GradientEditorStopSlotProps,
- GradientEditorStopSlots
-} from '#vue/primitives/GradientEditor'
-export {
- buildLayerTreeModel,
- indexLayerNodes,
- layerSelectionForTarget,
- LayerTreeItem,
- LayerTreeRoot,
- patchLayerNode,
- stickyTopLevelRow,
- useLayerTree,
- visibleLayerRows
-} from '#vue/primitives/LayerTree'
-export type {
- LayerDragInstruction,
- LayerNode,
- LayerRow,
- StickyLayerRow,
- LayerSelectionMode,
- LayerTreeContext,
- LayerOutline,
- LayerTreeVirtualizer
-} from '#vue/primitives/LayerTree'
-export { LayoutControlsRoot, useLayoutControlsContext } from '#vue/primitives/LayoutControls'
-export type {
- LayoutControlsContext,
- LayoutControlsRootSlotProps,
- LayoutControlsRootSlots
-} from '#vue/primitives/LayoutControls'
-export { AppearanceControlsRoot } from '#vue/primitives/AppearanceControls'
-export type {
- AppearanceControlsActions,
- AppearanceControlsRootSlotProps,
- AppearanceControlsRootSlots
-} from '#vue/primitives/AppearanceControls'
-export { ConstraintsControlRoot } from '#vue/primitives/ConstraintsControl'
-export type {
- ConstraintsControlActions,
- ConstraintsControlRootSlotProps,
- ConstraintsControlRootSlots
-} from '#vue/primitives/ConstraintsControl'
-export {
- constraintPins,
- isConstraintEligible,
- toggleConstraintPin,
- useConstraints
-} from '#vue/controls/constraints'
-export type { ConstraintAxis, ConstraintEdge, ConstraintValue } from '#vue/controls/constraints'
-export {
- compatibleComponentPropertyDefinitions,
- instanceSwapOptions,
- mergedComponentPropertyValue,
- useComponentProperties,
- useComponentPropertyAuthoring,
- useExposedInstances
-} from '#vue/controls/component-props'
-export type { ComponentBinding, ComponentBindingGroup } from '#vue/controls/component-props'
-export {
- slotInstanceOptions,
- slotLimits,
- useSlotAuthoring,
- useSlotProperties
-} from '#vue/controls/slots'
-export { useVariantAuthoring } from '#vue/controls/variants'
-export { useBehaviour } from '#vue/controls/behaviour'
-export type {
- BehaviourBooleanControl,
- BehaviourControl,
- BehaviourNumberControl,
- BehaviourPartControl,
- BehaviourStatesControl,
- BehaviourTextControl,
- BehaviourValueControl
-} from '#vue/controls/behaviour'
-export type {
- ComponentPropertyControl,
- ComponentPropertyOption
-} from '#vue/controls/component-props'
-export type {
- SlotDefinitionControl,
- SlotInstanceOption,
- SlotLimit,
- SlotPropertyControl
-} from '#vue/controls/slots'
-export type { VariantDefinitionControl } from '#vue/controls/variants'
-export type { CornerGeometryKey, CornerRadiusKey } from '#vue/controls/appearance/types'
-export { isPageDivider, PageListRoot, PAGE_DIVIDER_PATTERN } from '#vue/primitives/PageList'
-export { PositionControlsRoot } from '#vue/primitives/PositionControls'
-export { useEditorPropertyList } from '#vue/controls/property-list'
-export {
- PropertyListRoot,
- PropertyListItem,
- PropertyListAdd,
- PropertyListRemove,
- PropertyListVisibility,
- usePropertyList
-} from '#vue/primitives/PropertyList'
-export type {
- PropertyListActions,
- PropertyListContext,
- PropertyListIdentity,
- PropertyListItemActions,
- PropertyListItemFor,
- PropertyListItemMap,
- PropertyListItemSlotProps,
- PropertyListKey,
- PropertyListPartProps,
- PropertyListPatchFor,
- PropertyListRootProps,
- PropertyListRootSlotProps,
- PropertyListRootSlots
-} from '#vue/primitives/PropertyList'
-export { PropertyGridRoot } from '#vue/primitives/PropertyGrid'
-export type {
- PropertyGridColumns,
- PropertyGridDistribution,
- PropertyGridRootProps,
- PropertyGridRootSlots
-} from '#vue/primitives/PropertyGrid'
-
-export {
- PropertySectionRoot,
- PropertySectionHeader,
- PropertySectionTitle,
- PropertySectionActions,
- PropertySectionContent,
- PropertySectionEmptyAction,
- usePropertySection
-} from '#vue/primitives/PropertySection'
-export type {
- PropertySectionActionAPI,
- PropertySectionContext,
- PropertySectionPartProps,
- PropertySectionRootProps,
- PropertySectionRootSlots,
- PropertySectionSlotProps,
- PropertySectionStateAttrs
-} from '#vue/primitives/PropertySection'
-export {
- SegmentedControlRoot,
- SegmentedControlItem,
- useSegmentedControl
-} from '#vue/primitives/SegmentedControl'
-export type {
- SegmentedControlContext,
- SegmentedControlItemProps,
- SegmentedControlItemSlotProps,
- SegmentedControlItemSlots,
- SegmentedControlMode,
- SegmentedControlOrientation,
- SegmentedControlRootProps,
- SegmentedControlRootSlots
-} from '#vue/primitives/SegmentedControl'
-export {
- BindableValueRoot,
- BindableValueTrigger,
- BindableValuePicker,
- useBindableValue,
- useOptionalBindableValue
-} from '#vue/primitives/BindableValue'
-export type {
- BindableValueActions,
- BindableValueContext,
- BindableValueRootProps,
- BindableValueRootSlots,
- BindableValueSlotProps,
- BindableValueStateAttrs,
- BindableValueTriggerProps
-} from '#vue/primitives/BindableValue'
-export {
- provideBindingProvider,
- useBindingProvider,
- useOpenPencilBindingProvider,
- useNumberBindingProvider,
- useColorBindingProvider,
- useTextContentBindingProvider,
- useVisibilityBindingProvider
-} from '#vue/controls/binding-provider'
-export type {
- BindingMutationSource,
- BindingProvider,
- BindingState,
- BindingTarget,
- BoundEditPolicy,
- OpenPencilBindingProviderOptions
-} from '#vue/controls/binding-provider'
-export {
- NumberFieldRoot,
- NumberFieldInput,
- NumberFieldValue,
- NumberFieldLeading,
- NumberFieldUnit,
- NumberFieldTrailing,
- NumberFieldMenu,
- useNumberField
-} from '#vue/primitives/NumberField'
-export type {
- NumberFieldActions,
- NumberFieldContext,
- NumberFieldEditPolicy,
- NumberFieldMutationSource,
- NumberFieldRootAttrs,
- NumberFieldRootEmits,
- NumberFieldRootProps,
- NumberFieldRootSlots,
- NumberFieldSlotProps,
- NumberFieldState,
- NumberFieldStateAttrs,
- NumberFieldValueSlots
-} from '#vue/primitives/NumberField'
-export {
- clampNumberValue,
- evaluateNumberExpression,
- normalizeNumberValue,
- stepNumberValue
-} from '#vue/controls/number-expression'
-export type {
- NumberExpressionError,
- NumberExpressionOptions,
- NumberExpressionResult
-} from '#vue/controls/number-expression'
-export { TypographyControlsRoot } from '#vue/primitives/TypographyControls'
-export { ToolbarRoot, ToolbarItem, useToolbar } from '#vue/primitives/Toolbar'
-export type { ToolbarContext } from '#vue/primitives/Toolbar'
-
-/** DOM event helpers for cast-free template bindings. */
-export {
- blurTarget,
- inputChecked,
- inputNumberValue,
- inputValue,
- selectTarget
-} from '#vue/shared/dom-events'
-
-/** Internationalization. */
-export * from '#vue/i18n'
diff --git a/packages/vue/src/internal/scene-computed/index.ts b/packages/vue/src/internal/scene-computed/index.ts
new file mode 100644
index 000000000..767e54775
--- /dev/null
+++ b/packages/vue/src/internal/scene-computed/index.ts
@@ -0,0 +1 @@
+export { useSceneComputed } from './use'
diff --git a/packages/vue/src/lifecycle/retention/index.ts b/packages/vue/src/lifecycle/retention/index.ts
new file mode 100644
index 000000000..d425c5724
--- /dev/null
+++ b/packages/vue/src/lifecycle/retention/index.ts
@@ -0,0 +1,3 @@
+export { provideRetainedActivity, useRetainedActivity } from './context'
+export { createRetainedScopePlugin } from './plugin'
+export { useRetainedPopup } from './popup'
diff --git a/packages/vue/src/primitives/BindableValue/examples/ModeEdit.vue b/packages/vue/src/primitives/BindableValue/examples/ModeEdit.vue
index 40bad4dd8..d09da1066 100644
--- a/packages/vue/src/primitives/BindableValue/examples/ModeEdit.vue
+++ b/packages/vue/src/primitives/BindableValue/examples/ModeEdit.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { prepareModeEdit } from '#vue/controls/binding-provider/mode-edit'
import { createOpenPencilBindingProvider } from '#vue/controls/binding-provider/open-pencil'
diff --git a/packages/vue/src/primitives/FontPicker/FontPickerRoot.vue b/packages/vue/src/primitives/FontPicker/FontPickerRoot.vue
index 14fc997af..c8971a3aa 100644
--- a/packages/vue/src/primitives/FontPicker/FontPickerRoot.vue
+++ b/packages/vue/src/primitives/FontPicker/FontPickerRoot.vue
@@ -15,13 +15,11 @@ import {
} from 'reka-ui'
import { nextTick, useTemplateRef, watch } from 'vue'
+import type { FontFamilyOption } from '@open-pencil/core/text'
+
import { useRetainedPopup } from '#vue/lifecycle/retention/popup'
import type { FontPickerUI } from '#vue/primitives/FontPicker/types'
-import {
- useFontPicker,
- type FontAccessController,
- type FontFamilyOption
-} from '#vue/primitives/FontPicker/useFontPicker'
+import { useFontPicker, type FontAccessController } from '#vue/primitives/FontPicker/useFontPicker'
const { listFamilies, localFontAccess, ui, emptySearchText, emptyFontsText, emptyFontsHint } =
defineProps<{
diff --git a/packages/vue/src/primitives/FontPicker/index.ts b/packages/vue/src/primitives/FontPicker/index.ts
index 50450dac4..ddfda08b4 100644
--- a/packages/vue/src/primitives/FontPicker/index.ts
+++ b/packages/vue/src/primitives/FontPicker/index.ts
@@ -1,3 +1,3 @@
export { default as FontPickerRoot } from '#vue/primitives/FontPicker/FontPickerRoot.vue'
export type { FontPickerUI } from '#vue/primitives/FontPicker/types'
-export type { FontFamilyOption } from '#vue/primitives/FontPicker/useFontPicker'
+export { useFontPicker } from './useFontPicker'
diff --git a/packages/vue/src/primitives/FontPicker/useFontPicker.ts b/packages/vue/src/primitives/FontPicker/useFontPicker.ts
index bf24db653..7560bc525 100644
--- a/packages/vue/src/primitives/FontPicker/useFontPicker.ts
+++ b/packages/vue/src/primitives/FontPicker/useFontPicker.ts
@@ -8,7 +8,6 @@ import type { FontFamilyOption } from '@open-pencil/core/text'
import { useRetainedActivity } from '#vue/lifecycle/retention/context'
export type FontAccessState = 'unsupported' | 'prompt' | 'granted' | 'denied'
-export type { FontFamilyOption, FontFamilySource } from '@open-pencil/core/text'
export interface FontAccessController {
state: () => FontAccessState
diff --git a/packages/vue/src/primitives/GradientEditor/index.ts b/packages/vue/src/primitives/GradientEditor/index.ts
index 0f8b4006a..da1891c4b 100644
--- a/packages/vue/src/primitives/GradientEditor/index.ts
+++ b/packages/vue/src/primitives/GradientEditor/index.ts
@@ -7,3 +7,4 @@ export type {
GradientEditorStopSlotProps,
GradientEditorStopSlots
} from '#vue/primitives/GradientEditor/types'
+export { useGradientStops } from './useGradientStops'
diff --git a/packages/vue/src/primitives/LayerTree/context.ts b/packages/vue/src/primitives/LayerTree/context.ts
index c82e0dae8..0508e1778 100644
--- a/packages/vue/src/primitives/LayerTree/context.ts
+++ b/packages/vue/src/primitives/LayerTree/context.ts
@@ -1,6 +1,6 @@
import { type ComputedRef, type InjectionKey, type Ref, inject, provide } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import type { ShapeWithTextType } from '@open-pencil/scene-graph/shape-with-text'
diff --git a/packages/vue/src/primitives/LayerTree/index.ts b/packages/vue/src/primitives/LayerTree/index.ts
index 537f5d962..45a63c383 100644
--- a/packages/vue/src/primitives/LayerTree/index.ts
+++ b/packages/vue/src/primitives/LayerTree/index.ts
@@ -17,4 +17,5 @@ export {
patchLayerNode,
visibleLayerRows
} from '#vue/primitives/LayerTree/model'
-export { stickyTopLevelRow, type StickyLayerRow } from '#vue/primitives/LayerTree/sticky'
+export { useLayerDrag } from './useLayerDrag'
+export { stickyTopLevelRow, type StickyLayerRow } from './sticky'
diff --git a/packages/vue/src/primitives/LayerTree/model.ts b/packages/vue/src/primitives/LayerTree/model.ts
index 3a4f2b28f..7b7183d66 100644
--- a/packages/vue/src/primitives/LayerTree/model.ts
+++ b/packages/vue/src/primitives/LayerTree/model.ts
@@ -1,9 +1,11 @@
import { isEqual, pick } from 'es-toolkit'
import { toRaw } from 'vue'
-import { isGeneratedFrame, readIcon, slotPropertyId } from '@open-pencil/scene-graph'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { isGeneratedFrame } from '@open-pencil/scene-graph/generated'
+import { readIcon } from '@open-pencil/scene-graph/icons'
import type { ShapeWithTextType } from '@open-pencil/scene-graph/shape-with-text'
+import { slotPropertyId } from '@open-pencil/scene-graph/slots'
import { LAYER_OUTLINE_FIELDS } from '#vue/primitives/LayerTree/context'
import type {
diff --git a/packages/vue/src/primitives/LayerTree/useLayerDrag.ts b/packages/vue/src/primitives/LayerTree/useLayerDrag.ts
index 6d28be1c6..3140339a7 100644
--- a/packages/vue/src/primitives/LayerTree/useLayerDrag.ts
+++ b/packages/vue/src/primitives/LayerTree/useLayerDrag.ts
@@ -11,7 +11,7 @@ import {
} from '@atlaskit/pragmatic-drag-and-drop/element/adapter'
import { onScopeDispose, ref, watchEffect, type Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { LayerDragInstruction } from '#vue/primitives/LayerTree/context'
import { dropIndex, listsChildrenInFlow } from '#vue/primitives/LayerTree/model'
diff --git a/packages/vue/src/primitives/PageList/index.ts b/packages/vue/src/primitives/PageList/index.ts
index dc575f56e..5dd07e6b9 100644
--- a/packages/vue/src/primitives/PageList/index.ts
+++ b/packages/vue/src/primitives/PageList/index.ts
@@ -1,2 +1,3 @@
export { default as PageListRoot } from '#vue/primitives/PageList/PageListRoot.vue'
export { isPageDivider, PAGE_DIVIDER_PATTERN } from '#vue/primitives/PageList/divider'
+export { usePageList } from './usePageList'
diff --git a/packages/vue/src/primitives/Toolbar/ToolbarItem.vue b/packages/vue/src/primitives/Toolbar/ToolbarItem.vue
index 4036d456f..d3b247778 100644
--- a/packages/vue/src/primitives/Toolbar/ToolbarItem.vue
+++ b/packages/vue/src/primitives/Toolbar/ToolbarItem.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import type { Tool } from '@open-pencil/core/editor'
+import type { Tool } from '@open-pencil/core'
import { useToolbar } from '#vue/primitives/Toolbar/context'
diff --git a/packages/vue/src/primitives/Toolbar/ToolbarRoot.vue b/packages/vue/src/primitives/Toolbar/ToolbarRoot.vue
index 353d74e82..2233ceab5 100644
--- a/packages/vue/src/primitives/Toolbar/ToolbarRoot.vue
+++ b/packages/vue/src/primitives/Toolbar/ToolbarRoot.vue
@@ -1,8 +1,7 @@
<script setup lang="ts">
import { computed, reactive, ref, watch } from 'vue'
-import { EDITOR_TOOLS } from '@open-pencil/core/editor'
-import type { EditorToolDef, Tool } from '@open-pencil/core/editor'
+import { EDITOR_TOOLS, type EditorToolDef, type Tool } from '@open-pencil/core'
import { useEditor } from '#vue/editor/context'
import { provideToolbar } from '#vue/primitives/Toolbar/context'
diff --git a/packages/vue/src/primitives/Toolbar/context.ts b/packages/vue/src/primitives/Toolbar/context.ts
index 3ad84d398..681a2fb75 100644
--- a/packages/vue/src/primitives/Toolbar/context.ts
+++ b/packages/vue/src/primitives/Toolbar/context.ts
@@ -1,6 +1,6 @@
import { type ComputedRef, type InjectionKey, type Ref, inject, provide } from 'vue'
-import type { Editor, EditorToolDef, Tool } from '@open-pencil/core/editor'
+import type { Editor, EditorToolDef, Tool } from '@open-pencil/core'
export interface ToolbarContext {
editor: Editor
diff --git a/packages/vue/src/primitives/Toolbar/index.ts b/packages/vue/src/primitives/Toolbar/index.ts
index 92be543f9..d7125cf61 100644
--- a/packages/vue/src/primitives/Toolbar/index.ts
+++ b/packages/vue/src/primitives/Toolbar/index.ts
@@ -2,3 +2,4 @@ export { default as ToolbarRoot } from '#vue/primitives/Toolbar/ToolbarRoot.vue'
export { default as ToolbarItem } from '#vue/primitives/Toolbar/ToolbarItem.vue'
export { useToolbar } from '#vue/primitives/Toolbar/context'
export type { ToolbarContext } from '#vue/primitives/Toolbar/context'
+export { getToolbarToolSelection, isToolbarToolActive, useToolbarState } from './useToolbarState'
diff --git a/packages/vue/src/primitives/Toolbar/useToolbarState.ts b/packages/vue/src/primitives/Toolbar/useToolbarState.ts
index 5e33dcd38..50e06c82e 100644
--- a/packages/vue/src/primitives/Toolbar/useToolbarState.ts
+++ b/packages/vue/src/primitives/Toolbar/useToolbarState.ts
@@ -1,6 +1,6 @@
import { computed, ref } from 'vue'
-import type { Tool, EditorToolDef } from '@open-pencil/core/editor'
+import type { Tool, EditorToolDef } from '@open-pencil/core'
const CATEGORY_COUNT = 3
diff --git a/packages/vue/src/shared/drag/index.ts b/packages/vue/src/shared/drag/index.ts
new file mode 100644
index 000000000..e5b21d39b
--- /dev/null
+++ b/packages/vue/src/shared/drag/index.ts
@@ -0,0 +1,8 @@
+export { useFlatReorderDrag } from './useFlatReorderDrag'
+export type {
+ FlatReorderAxis,
+ FlatReorderInstruction,
+ FlatReorderItem,
+ FlatReorderOperations,
+ UseFlatReorderDragOptions
+} from './useFlatReorderDrag'
diff --git a/packages/vue/src/shared/font-status/index.ts b/packages/vue/src/shared/font-status/index.ts
new file mode 100644
index 000000000..22a7d88f8
--- /dev/null
+++ b/packages/vue/src/shared/font-status/index.ts
@@ -0,0 +1 @@
+export { useNodeFontStatus } from './use'
diff --git a/packages/vue/src/shared/input/auto-layout-hover.ts b/packages/vue/src/shared/input/auto-layout-hover.ts
index de03a1bad..ec9dcf875 100644
--- a/packages/vue/src/shared/input/auto-layout-hover.ts
+++ b/packages/vue/src/shared/input/auto-layout-hover.ts
@@ -1,11 +1,12 @@
+import type { Editor } from '@open-pencil/core'
import {
AUTO_LAYOUT_HOVER_GAP_REGION_TOLERANCE,
AUTO_LAYOUT_HOVER_PADDING_REGION_TOLERANCE,
AUTO_LAYOUT_HOVER_TICK_HIT_TOLERANCE
} from '@open-pencil/core/constants'
-import type { Editor } from '@open-pencil/core/editor'
-import { isGeneratedFrame } from '@open-pencil/scene-graph'
-import type { SceneNode, Vector } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { isGeneratedFrame } from '@open-pencil/scene-graph/generated'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
type AutoLayoutHover = NonNullable<Editor['state']['autoLayoutHover']>
diff --git a/packages/vue/src/shared/input/auto-layout.ts b/packages/vue/src/shared/input/auto-layout.ts
index f343fc067..c72421935 100644
--- a/packages/vue/src/shared/input/auto-layout.ts
+++ b/packages/vue/src/shared/input/auto-layout.ts
@@ -1,7 +1,7 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import type { Vector } from '@open-pencil/scene-graph/primitives'
-import { resolveNodeLayoutDirection } from '@open-pencil/scene-graph/text-direction'
+import { resolveNodeLayoutDirection } from '@open-pencil/scene-graph/text/direction'
import type { DragMove } from '#vue/shared/input/types'
diff --git a/packages/vue/src/shared/input/connector/draw.ts b/packages/vue/src/shared/input/connector/draw.ts
index f70c79b30..07654cff0 100644
--- a/packages/vue/src/shared/input/connector/draw.ts
+++ b/packages/vue/src/shared/input/connector/draw.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { isPastPointerDragThreshold } from '#vue/shared/input/drag-threshold'
import type { DragConnectorDraw, DragState } from '#vue/shared/input/types'
diff --git a/packages/vue/src/shared/input/connector/end.ts b/packages/vue/src/shared/input/connector/end.ts
index 6f45e7618..e0abf0411 100644
--- a/packages/vue/src/shared/input/connector/end.ts
+++ b/packages/vue/src/shared/input/connector/end.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { connectorScreenEnds } from '@open-pencil/core/geometry'
import type { Vector } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/vue/src/shared/input/draw.ts b/packages/vue/src/shared/input/draw.ts
index ec32c0d5b..4ce897520 100644
--- a/packages/vue/src/shared/input/draw.ts
+++ b/packages/vue/src/shared/input/draw.ts
@@ -1,8 +1,8 @@
+import type { Editor } from '@open-pencil/core'
import { DEFAULT_TEXT_HEIGHT, DEFAULT_TEXT_WIDTH } from '@open-pencil/core/constants'
-import type { Editor } from '@open-pencil/core/editor'
-import { generatedFrameText, SHAPE_WITH_TEXT_SIZE } from '@open-pencil/scene-graph'
import type { NodeType, SceneNode } from '@open-pencil/scene-graph'
import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
+import { generatedFrameText, SHAPE_WITH_TEXT_SIZE } from '@open-pencil/scene-graph/generated'
import Matrix from '@open-pencil/scene-graph/matrix'
import { findDrawParent } from '#vue/shared/input/drop-target'
diff --git a/packages/vue/src/shared/input/drop-target.ts b/packages/vue/src/shared/input/drop-target.ts
index 72cbc493a..81de1d7e5 100644
--- a/packages/vue/src/shared/input/drop-target.ts
+++ b/packages/vue/src/shared/input/drop-target.ts
@@ -1,6 +1,7 @@
-import type { Editor } from '@open-pencil/core/editor'
-import { cycleSafeParent, type NodeType, type SceneNode } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
+import type { NodeType, SceneNode } from '@open-pencil/scene-graph'
import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
+import { cycleSafeParent } from '@open-pencil/scene-graph/instances'
import Matrix from '@open-pencil/scene-graph/matrix'
import type { Vector } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/vue/src/shared/input/duplicate-drag.ts b/packages/vue/src/shared/input/duplicate-drag.ts
index 9682417ee..57507a0a0 100644
--- a/packages/vue/src/shared/input/duplicate-drag.ts
+++ b/packages/vue/src/shared/input/duplicate-drag.ts
@@ -1,4 +1,4 @@
-import type { Editor, MovePlace } from '@open-pencil/core/editor'
+import type { Editor, MovePlace } from '@open-pencil/core'
import type { DragState } from '#vue/shared/input/types'
diff --git a/packages/vue/src/shared/input/explicit-snap-targets.ts b/packages/vue/src/shared/input/explicit-snap-targets.ts
index 41b83a92f..f4a17981c 100644
--- a/packages/vue/src/shared/input/explicit-snap-targets.ts
+++ b/packages/vue/src/shared/input/explicit-snap-targets.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import { layoutGuideLines } from '@open-pencil/scene-graph/layout'
diff --git a/packages/vue/src/shared/input/flow-reorder.ts b/packages/vue/src/shared/input/flow-reorder.ts
index 59c6184c6..0870a4300 100644
--- a/packages/vue/src/shared/input/flow-reorder.ts
+++ b/packages/vue/src/shared/input/flow-reorder.ts
@@ -1,7 +1,7 @@
-import type { Editor, MovePlace } from '@open-pencil/core/editor'
+import type { Editor, MovePlace } from '@open-pencil/core'
import { createSceneGeometry } from '@open-pencil/core/geometry'
import type { SceneNode } from '@open-pencil/scene-graph'
-import { resolveNodeLayoutDirection } from '@open-pencil/scene-graph/text-direction'
+import { resolveNodeLayoutDirection } from '@open-pencil/scene-graph/text/direction'
/**
* Layers dragged along their own auto layout flow, as one block: the selected layers of one
diff --git a/packages/vue/src/shared/input/geometry.ts b/packages/vue/src/shared/input/geometry.ts
index 580fd020a..817241054 100644
--- a/packages/vue/src/shared/input/geometry.ts
+++ b/packages/vue/src/shared/input/geometry.ts
@@ -1,5 +1,5 @@
+import type { Editor } from '@open-pencil/core'
import { HANDLE_HIT_RADIUS, LAYER_HIT_PAD } from '@open-pencil/core/constants'
-import type { Editor } from '@open-pencil/core/editor'
import {
createSceneGeometry,
isLineLike,
diff --git a/packages/vue/src/shared/input/gesture.ts b/packages/vue/src/shared/input/gesture.ts
index 3bc9fe937..c64f110db 100644
--- a/packages/vue/src/shared/input/gesture.ts
+++ b/packages/vue/src/shared/input/gesture.ts
@@ -1,7 +1,7 @@
import { useEventListener } from '@vueuse/core'
import { computed, type Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { createRafScheduler } from '#vue/shared/input/raf-scheduler'
import { PINCH_SCALE_EXPONENT } from '#vue/shared/input/wheel'
diff --git a/packages/vue/src/shared/input/gradient.ts b/packages/vue/src/shared/input/gradient.ts
index 75f5e7f19..10f90a35b 100644
--- a/packages/vue/src/shared/input/gradient.ts
+++ b/packages/vue/src/shared/input/gradient.ts
@@ -1,4 +1,4 @@
-import { editedGradient, editedGradientLayout, type Editor } from '@open-pencil/core/editor'
+import { editedGradient, editedGradientLayout, type Editor } from '@open-pencil/core'
import {
createSceneGeometry,
gradientStopPosition,
diff --git a/packages/vue/src/shared/input/index.ts b/packages/vue/src/shared/input/index.ts
new file mode 100644
index 000000000..42444b767
--- /dev/null
+++ b/packages/vue/src/shared/input/index.ts
@@ -0,0 +1 @@
+export { autoLayoutValueAnchor, type AutoLayoutValueField } from './auto-layout-hover'
diff --git a/packages/vue/src/shared/input/line/end.ts b/packages/vue/src/shared/input/line/end.ts
index 4bc7097d4..edfc8b4a9 100644
--- a/packages/vue/src/shared/input/line/end.ts
+++ b/packages/vue/src/shared/input/line/end.ts
@@ -1,6 +1,6 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { isLineLike, lineWorldEnds, TRANSFORM_ZONE, type LineEnd } from '@open-pencil/core/geometry'
-import { layerRotates } from '@open-pencil/scene-graph'
+import { layerRotates } from '@open-pencil/scene-graph/generated'
import type { DragState } from '#vue/shared/input/types'
diff --git a/packages/vue/src/shared/input/move/drag.ts b/packages/vue/src/shared/input/move/drag.ts
index f0936d572..4c589ad53 100644
--- a/packages/vue/src/shared/input/move/drag.ts
+++ b/packages/vue/src/shared/input/move/drag.ts
@@ -12,7 +12,7 @@ import {
} from '#vue/shared/input/drag-threshold'
import { findMoveDropTarget, reparentDroppedNodes } from '#vue/shared/input/drop-target'
export { duplicateAndDrag } from '#vue/shared/input/duplicate-drag'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { flowBlockBounds, flowOrder, flowSlot, type FlowDrag } from '#vue/shared/input/flow-reorder'
import { applyMoveSnap } from '#vue/shared/input/move/snap'
diff --git a/packages/vue/src/shared/input/move/snap.ts b/packages/vue/src/shared/input/move/snap.ts
index 7ade90bbe..187c4dc6b 100644
--- a/packages/vue/src/shared/input/move/snap.ts
+++ b/packages/vue/src/shared/input/move/snap.ts
@@ -1,7 +1,7 @@
-import type { Editor } from '@open-pencil/core/editor'
-import { computeSelectionBounds } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import { getAxisAlignedWorldBounds } from '@open-pencil/scene-graph/coordinate'
+import { computeSelectionBounds } from '@open-pencil/scene-graph/snap'
import { explicitSnapTargets } from '#vue/shared/input/explicit-snap-targets'
import {
diff --git a/packages/vue/src/shared/input/pan/drag.ts b/packages/vue/src/shared/input/pan/drag.ts
index 718f753ae..c7801a6a3 100644
--- a/packages/vue/src/shared/input/pan/drag.ts
+++ b/packages/vue/src/shared/input/pan/drag.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { DragState } from '#vue/shared/input/types'
diff --git a/packages/vue/src/shared/input/pan/zoom.ts b/packages/vue/src/shared/input/pan/zoom.ts
index 846ff469c..7af9332b8 100644
--- a/packages/vue/src/shared/input/pan/zoom.ts
+++ b/packages/vue/src/shared/input/pan/zoom.ts
@@ -1,7 +1,7 @@
import { useEventListener } from '@vueuse/core'
import type { Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { setupSafariGestureZoom } from '#vue/shared/input/gesture'
import type { DragState } from '#vue/shared/input/types'
diff --git a/packages/vue/src/shared/input/resize.ts b/packages/vue/src/shared/input/resize.ts
index d3775f264..634156667 100644
--- a/packages/vue/src/shared/input/resize.ts
+++ b/packages/vue/src/shared/input/resize.ts
@@ -3,23 +3,17 @@ export { tryStartResize } from '#vue/shared/input/resize/start'
import { isEqual } from 'es-toolkit'
import { toRaw } from 'vue'
-import { resizedPathTextGlyphs, type Editor } from '@open-pencil/core/editor'
+import { resizedPathTextGlyphs, type Editor } from '@open-pencil/core'
import { computeAllLayouts } from '@open-pencil/core/layout'
import { calibratePathTextLayout, reflowPathTextGlyphs } from '@open-pencil/core/text'
+import type { SceneNode, DerivedTextGlyph, TextPathData } from '@open-pencil/scene-graph'
+import { copyDerivedGlyphs, copyGeometryPaths, copyStrokes } from '@open-pencil/scene-graph/copy'
+import { findInstanceAncestor, recordInstanceOverride } from '@open-pencil/scene-graph/instances'
import {
cloneInstanceOverrideState,
- cloneVectorNetwork,
- findInstanceAncestor,
- recapturedAspectRatio,
- recordInstanceOverride
-} from '@open-pencil/scene-graph'
-import type {
- DerivedTextGlyph,
- InstanceOverrideState,
- SceneNode,
- TextPathData
-} from '@open-pencil/scene-graph'
-import { copyDerivedGlyphs, copyGeometryPaths, copyStrokes } from '@open-pencil/scene-graph/copy'
+ type InstanceOverrideState
+} from '@open-pencil/scene-graph/instances/overrides'
+import { recapturedAspectRatio } from '@open-pencil/scene-graph/layout'
import type { Rect } from '@open-pencil/scene-graph/primitives'
import {
computeConstrainedResizeChanges,
@@ -27,6 +21,7 @@ import {
type ResizeSnapshot
} from '@open-pencil/scene-graph/resize'
import { markSourceFieldsEdited } from '@open-pencil/scene-graph/source-metadata'
+import { cloneVectorNetwork } from '@open-pencil/scene-graph/vector-network'
import { calculateResizeRect } from '#vue/shared/input/resize/rect'
import { draggedSizing, layerSizing } from '#vue/shared/input/resize/sizing'
diff --git a/packages/vue/src/shared/input/resize/sizing.ts b/packages/vue/src/shared/input/resize/sizing.ts
index 818b085c5..5b26ff470 100644
--- a/packages/vue/src/shared/input/resize/sizing.ts
+++ b/packages/vue/src/shared/input/resize/sizing.ts
@@ -1,12 +1,11 @@
import { pick } from 'es-toolkit'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
layoutSizing,
layoutSizingUpdates,
- type LayoutSizingAxis,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+ type LayoutSizingAxis
+} from '@open-pencil/scene-graph/layout'
import type { Rect } from '@open-pencil/scene-graph/primitives'
const SIZING_FIELDS = [
diff --git a/packages/vue/src/shared/input/resize/snap.ts b/packages/vue/src/shared/input/resize/snap.ts
index b4944aa1c..59a99a463 100644
--- a/packages/vue/src/shared/input/resize/snap.ts
+++ b/packages/vue/src/shared/input/resize/snap.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { HandlePosition } from '@open-pencil/core/geometry'
import type { SceneNode } from '@open-pencil/scene-graph'
import { getAxisAlignedWorldBounds, getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
diff --git a/packages/vue/src/shared/input/resize/start.ts b/packages/vue/src/shared/input/resize/start.ts
index 8de3ea4a2..496632291 100644
--- a/packages/vue/src/shared/input/resize/start.ts
+++ b/packages/vue/src/shared/input/resize/start.ts
@@ -1,5 +1,6 @@
-import type { Editor } from '@open-pencil/core/editor'
-import { enforcedAspectRatio, layerResizes } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
+import { layerResizes } from '@open-pencil/scene-graph/generated'
+import { enforcedAspectRatio } from '@open-pencil/scene-graph/layout'
import { collectResizeDescendants, createResizeSnapshot } from '@open-pencil/scene-graph/resize'
import { getHitHandleByMatrix } from '#vue/shared/input/geometry'
diff --git a/packages/vue/src/shared/input/select.ts b/packages/vue/src/shared/input/select.ts
index e8c3ec5bb..41db3c941 100644
--- a/packages/vue/src/shared/input/select.ts
+++ b/packages/vue/src/shared/input/select.ts
@@ -2,7 +2,7 @@ import { getNodeEditState, handleNodeEditDown } from '#vue/shared/input/vector'
export { resolveHit } from '#vue/shared/input/select/hit'
import { hitTestLabel, resolveHit, tinySelectionAt } from '#vue/shared/input/select/hit'
export { updateHoverCursor } from '#vue/shared/input/select/hover'
-import { editedGradient, type Editor } from '@open-pencil/core/editor'
+import { editedGradient, type Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import { tryStartConnectorEndDrag } from '#vue/shared/input/connector/end'
diff --git a/packages/vue/src/shared/input/select/hit.ts b/packages/vue/src/shared/input/select/hit.ts
index 739086774..6cec9fc37 100644
--- a/packages/vue/src/shared/input/select/hit.ts
+++ b/packages/vue/src/shared/input/select/hit.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import {
createSceneGeometry,
pressesTinyLayer,
diff --git a/packages/vue/src/shared/input/select/hover.ts b/packages/vue/src/shared/input/select/hover.ts
index 7c4eb6e29..4a3483910 100644
--- a/packages/vue/src/shared/input/select/hover.ts
+++ b/packages/vue/src/shared/input/select/hover.ts
@@ -1,5 +1,5 @@
-import type { Editor } from '@open-pencil/core/editor'
-import { layerResizes, layerRotates } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
+import { layerResizes, layerRotates } from '@open-pencil/scene-graph/generated'
import {
MOVE_CURSOR,
diff --git a/packages/vue/src/shared/input/select/move.ts b/packages/vue/src/shared/input/select/move.ts
index 4d2498035..982b03e18 100644
--- a/packages/vue/src/shared/input/select/move.ts
+++ b/packages/vue/src/shared/input/select/move.ts
@@ -1,4 +1,4 @@
-import type { Editor, MovePlace } from '@open-pencil/core/editor'
+import type { Editor, MovePlace } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import { duplicateAndDrag } from '#vue/shared/input/duplicate-drag'
diff --git a/packages/vue/src/shared/input/shape-handles.ts b/packages/vue/src/shared/input/shape-handles.ts
index 8f47bf71f..a72dcd25e 100644
--- a/packages/vue/src/shared/input/shape-handles.ts
+++ b/packages/vue/src/shared/input/shape-handles.ts
@@ -1,4 +1,4 @@
-import type { Editor, ShapeHandleHover } from '@open-pencil/core/editor'
+import type { Editor, ShapeHandleHover } from '@open-pencil/core'
import {
arcChanges,
cornerRadiusAtPoint,
@@ -12,7 +12,8 @@ import {
starRatioAtPoint,
type ShapeHandleKind
} from '@open-pencil/core/geometry'
-import type { SceneNode, Vector } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import { editorMessages } from '#vue/i18n/messages/editor'
import { isPastPointerDragThreshold } from '#vue/shared/input/drag-threshold'
diff --git a/packages/vue/src/shared/input/snap.ts b/packages/vue/src/shared/input/snap.ts
index 32a366243..bf70afc7d 100644
--- a/packages/vue/src/shared/input/snap.ts
+++ b/packages/vue/src/shared/input/snap.ts
@@ -1,13 +1,12 @@
import { uniq } from 'es-toolkit'
+import type { Editor } from '@open-pencil/core'
import { SNAP_THRESHOLD_SCREEN_PX } from '@open-pencil/core/constants'
-import type { Editor } from '@open-pencil/core/editor'
-import { computeSnap } from '@open-pencil/scene-graph'
import type { SceneNode } from '@open-pencil/scene-graph'
import { getAxisAlignedWorldBounds, getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import Matrix from '@open-pencil/scene-graph/matrix'
import type { Rect, Vector } from '@open-pencil/scene-graph/primitives'
-import type { SnapGuide } from '@open-pencil/scene-graph/snap'
+import { computeSnap, type SnapGuide } from '@open-pencil/scene-graph/snap'
export interface PixelSnapResult {
delta: Vector
diff --git a/packages/vue/src/shared/input/sticky/draw.ts b/packages/vue/src/shared/input/sticky/draw.ts
index 026b5efbb..d34d3b655 100644
--- a/packages/vue/src/shared/input/sticky/draw.ts
+++ b/packages/vue/src/shared/input/sticky/draw.ts
@@ -1,9 +1,10 @@
import { toRaw } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
-import { scaleNodeChanges, STICKY_SIZE, stickySublayers } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
+import { STICKY_SIZE, stickySublayers } from '@open-pencil/scene-graph/generated'
import type { Vector } from '@open-pencil/scene-graph/primitives'
+import { scaleNodeChanges } from '@open-pencil/scene-graph/scaling'
import { parentSpace } from '#vue/shared/input/draw'
import { findDrawParent } from '#vue/shared/input/drop-target'
diff --git a/packages/vue/src/shared/input/sticky/scale.ts b/packages/vue/src/shared/input/sticky/scale.ts
index 83c28e653..aa161ade5 100644
--- a/packages/vue/src/shared/input/sticky/scale.ts
+++ b/packages/vue/src/shared/input/sticky/scale.ts
@@ -1,14 +1,14 @@
import { toRaw } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
+import type { SceneNode } from '@open-pencil/scene-graph'
import {
isWideSticky,
- scaleNodeChanges,
stickyScale,
stickySublayers,
stickyWidth
-} from '@open-pencil/scene-graph'
-import type { SceneNode } from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/generated'
+import { scaleNodeChanges } from '@open-pencil/scene-graph/scaling'
import { getHitHandleByMatrix } from '#vue/shared/input/geometry'
import { calculateResizeRect } from '#vue/shared/input/resize/rect'
diff --git a/packages/vue/src/shared/input/types.ts b/packages/vue/src/shared/input/types.ts
index 490a463e6..3c69245ba 100644
--- a/packages/vue/src/shared/input/types.ts
+++ b/packages/vue/src/shared/input/types.ts
@@ -1,4 +1,4 @@
-import type { MovePlace, Tool } from '@open-pencil/core/editor'
+import type { MovePlace, Tool } from '@open-pencil/core'
import type { HandlePosition } from '@open-pencil/core/geometry'
import type {
DerivedTextGlyph,
diff --git a/packages/vue/src/shared/input/vector/hit-test.ts b/packages/vue/src/shared/input/vector/hit-test.ts
index a6c1b6b65..66f975066 100644
--- a/packages/vue/src/shared/input/vector/hit-test.ts
+++ b/packages/vue/src/shared/input/vector/hit-test.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { nearestPointOnNetwork, regionAtPoint, vectorHandleParts } from '@open-pencil/core/vector'
import type { VectorRegion, VectorSegment, VectorVertex } from '@open-pencil/scene-graph'
import type { Rect } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/vue/src/shared/input/vector/index.ts b/packages/vue/src/shared/input/vector/index.ts
index 1e911f014..8ba8ab3d9 100644
--- a/packages/vue/src/shared/input/vector/index.ts
+++ b/packages/vue/src/shared/input/vector/index.ts
@@ -25,7 +25,7 @@ export {
isEndpoint,
NODE_HIT_THRESHOLD
} from '#vue/shared/input/vector/hit-test'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { regionVertexIndices, vectorHandleId } from '@open-pencil/core/vector'
import type { Vector } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/vue/src/shared/input/vector/snap.ts b/packages/vue/src/shared/input/vector/snap.ts
index a04f48e45..cd93595aa 100644
--- a/packages/vue/src/shared/input/vector/snap.ts
+++ b/packages/vue/src/shared/input/vector/snap.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import type { Rect, Vector } from '@open-pencil/scene-graph/primitives'
diff --git a/packages/vue/src/shared/input/wheel.ts b/packages/vue/src/shared/input/wheel.ts
index 45cedf199..03073cfdd 100644
--- a/packages/vue/src/shared/input/wheel.ts
+++ b/packages/vue/src/shared/input/wheel.ts
@@ -1,7 +1,7 @@
import { useEventListener } from '@vueuse/core'
import { onScopeDispose, type Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { emitNavigationTrace } from '@open-pencil/core/profiler'
import { createRafScheduler } from '#vue/shared/input/raf-scheduler'
diff --git a/packages/vue/src/shared/search/index.ts b/packages/vue/src/shared/search/index.ts
new file mode 100644
index 000000000..c6a3083d7
--- /dev/null
+++ b/packages/vue/src/shared/search/index.ts
@@ -0,0 +1 @@
+export { fuzzyFilter, fuzzySearch } from './fuzzy'
diff --git a/packages/vue/src/testing/index.ts b/packages/vue/src/testing/index.ts
new file mode 100644
index 000000000..ecefe0acb
--- /dev/null
+++ b/packages/vue/src/testing/index.ts
@@ -0,0 +1,11 @@
+export {
+ acpPermissionOptionTestId,
+ testId,
+ testIdSelector,
+ toolbarFlyoutItemTestId,
+ toolbarFlyoutTestId,
+ toolbarToolTestId,
+ variablesAddTestId
+} from './test-id'
+export { vTestId } from './v-test-id'
+export type { TestId } from './test-id'
diff --git a/packages/vue/src/variables/helpers.ts b/packages/vue/src/variables/helpers.ts
index 3a83604a6..da1eb47cf 100644
--- a/packages/vue/src/variables/helpers.ts
+++ b/packages/vue/src/variables/helpers.ts
@@ -1,7 +1,7 @@
import type { Ref } from 'vue'
+import type { Editor } from '@open-pencil/core'
import { BLACK } from '@open-pencil/core/constants'
-import type { Editor } from '@open-pencil/core/editor'
import type { VariableCollection, VariableType, VariableValue } from '@open-pencil/scene-graph'
import { randomHex } from '@open-pencil/scene-graph/random'
diff --git a/packages/vue/src/variables/index.ts b/packages/vue/src/variables/index.ts
new file mode 100644
index 000000000..dbe01a7ef
--- /dev/null
+++ b/packages/vue/src/variables/index.ts
@@ -0,0 +1 @@
+export { useVariables } from './use'
diff --git a/packages/vue/tests/canvas/pen/input.test.ts b/packages/vue/tests/canvas/pen/input.test.ts
index d06d6be60..03ddf7ed9 100644
--- a/packages/vue/tests/canvas/pen/input.test.ts
+++ b/packages/vue/tests/canvas/pen/input.test.ts
@@ -2,7 +2,7 @@ import { afterEach, describe, expect, mock, test } from 'bun:test'
import { ref } from 'vue'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import { startPenInput, updatePenHover } from '#vue/canvas/pen/input'
diff --git a/packages/vue/tests/canvas/pencil/input.test.ts b/packages/vue/tests/canvas/pencil/input.test.ts
index 4566c8e71..da35c1ff2 100644
--- a/packages/vue/tests/canvas/pencil/input.test.ts
+++ b/packages/vue/tests/canvas/pencil/input.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, mock, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import Matrix from '@open-pencil/scene-graph/matrix'
@@ -76,7 +76,14 @@ describe('pencil parent', () => {
test('checks a rotated frame by its own box, not the box around it', () => {
const page = setup()
const band = frame(page, { x: 200, y: 100, width: 300, height: 40, rotation: 45 })
- expect(stroke(inLayer(band, wave(20, 20, 260).map((p) => ({ x: p.x, y: 20 }))))).toBe(band.id)
+ expect(
+ stroke(
+ inLayer(
+ band,
+ wave(20, 20, 260).map((p) => ({ x: p.x, y: 20 }))
+ )
+ )
+ ).toBe(band.id)
// Leaves the band sideways while staying inside its axis-aligned bounds.
expect(
stroke(
diff --git a/packages/vue/tests/canvas/text-edit/paragraphs.test.ts b/packages/vue/tests/canvas/text-edit/paragraphs.test.ts
index 6eabf8a25..4be897f96 100644
--- a/packages/vue/tests/canvas/text-edit/paragraphs.test.ts
+++ b/packages/vue/tests/canvas/text-edit/paragraphs.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
import {
createTextListActions,
@@ -59,7 +59,7 @@ describe('text list actions', () => {
})
describe('paragraph spacing', () => {
- test('sets the whole text outside editing, dropping paragraphs\' own values', () => {
+ test("sets the whole text outside editing, dropping paragraphs' own values", () => {
const { node, read } = textWithList()
editor.graph.updateNode(node.id, {
textParagraphs: [{ listType: 'NONE', indentation: 0, paragraphSpacing: 25 }]
@@ -71,4 +71,3 @@ describe('paragraph spacing', () => {
})
})
})
-
diff --git a/packages/vue/tests/canvas/transform/marquee.test.ts b/packages/vue/tests/canvas/transform/marquee.test.ts
index 9e3e4b802..982da70da 100644
--- a/packages/vue/tests/canvas/transform/marquee.test.ts
+++ b/packages/vue/tests/canvas/transform/marquee.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
import { handleMarqueeMove } from '#vue/canvas/transform/marquee'
@@ -10,7 +10,11 @@ afterEach(() => editor.dispose())
function marquee(from: [number, number], to: [number, number], containerId?: string) {
editor.clearSelection()
- handleMarqueeMove(editor, { type: 'marquee', startX: from[0], startY: from[1], containerId }, ...to)
+ handleMarqueeMove(
+ editor,
+ { type: 'marquee', startX: from[0], startY: from[1], containerId },
+ ...to
+ )
return [...editor.state.selectedIds]
}
diff --git a/packages/vue/tests/controls/color-model/stroke-paint.test.ts b/packages/vue/tests/controls/color-model/stroke-paint.test.ts
index 872fc8d66..77a6558af 100644
--- a/packages/vue/tests/controls/color-model/stroke-paint.test.ts
+++ b/packages/vue/tests/controls/color-model/stroke-paint.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
import type { Fill, Stroke } from '@open-pencil/scene-graph'
-import { applyStrokePaint } from '@open-pencil/vue'
+import { applyStrokePaint } from '@open-pencil/vue/controls/color-model'
const GRADIENT: Fill = {
type: 'GRADIENT_LINEAR',
diff --git a/packages/vue/tests/controls/component-props/slots.test.ts b/packages/vue/tests/controls/component-props/slots.test.ts
index 6f151be22..c7ed01989 100644
--- a/packages/vue/tests/controls/component-props/slots.test.ts
+++ b/packages/vue/tests/controls/component-props/slots.test.ts
@@ -1,8 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph, instanceSlotFrames } from '@open-pencil/scene-graph'
-import type { ComponentPropertyDefinition } from '@open-pencil/scene-graph'
-import { slotInstanceOptions, slotLimits } from '@open-pencil/vue'
+import { SceneGraph, type ComponentPropertyDefinition } from '@open-pencil/scene-graph'
+import { instanceSlotFrames } from '@open-pencil/scene-graph/slots'
+import { slotInstanceOptions, slotLimits } from '@open-pencil/vue/controls/slots'
function card() {
const graph = new SceneGraph()
diff --git a/packages/vue/tests/controls/typography.test.ts b/packages/vue/tests/controls/typography.test.ts
index ba8de9592..4ff91e1df 100644
--- a/packages/vue/tests/controls/typography.test.ts
+++ b/packages/vue/tests/controls/typography.test.ts
@@ -2,7 +2,7 @@ import { afterAll, beforeAll, expect, test } from 'bun:test'
import { computed, effectScope, nextTick, shallowRef } from 'vue'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { DEFAULT_WEB_FONT_PROVIDER_SETTINGS, fontManager } from '@open-pencil/core/text'
import type { SceneNode } from '@open-pencil/scene-graph'
diff --git a/packages/vue/tests/controls/variable-modes.test.ts b/packages/vue/tests/controls/variable-modes.test.ts
index 78d1a36a3..3ddac3fd6 100644
--- a/packages/vue/tests/controls/variable-modes.test.ts
+++ b/packages/vue/tests/controls/variable-modes.test.ts
@@ -1,8 +1,10 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
-import { collectionsBoundIn, SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
-import { MIXED, setVariableMode, variableModeChoices } from '@open-pencil/vue'
+import { createEditor } from '@open-pencil/core'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { collectionsBoundIn } from '@open-pencil/scene-graph/variables'
+import { MIXED } from '@open-pencil/vue/controls/node-props'
+import { setVariableMode, variableModeChoices } from '@open-pencil/vue/controls/variable-modes'
const RED = { r: 1, g: 0, b: 0, a: 1 }
diff --git a/packages/vue/tests/editor/menu-model/canvas.test.ts b/packages/vue/tests/editor/menu-model/canvas.test.ts
index def44d8a0..0b2da8111 100644
--- a/packages/vue/tests/editor/menu-model/canvas.test.ts
+++ b/packages/vue/tests/editor/menu-model/canvas.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { ref } from 'vue'
-import type { EditorCommandId } from '@open-pencil/vue'
+import type { EditorCommandId } from '@open-pencil/vue/editor/commands'
import { buildCanvasContextMenu } from '#vue/editor/menu-model/canvas'
import type { CanvasMenuOptions } from '#vue/editor/menu-model/canvas'
diff --git a/packages/vue/tests/primitives/CommandPalette/useCommandPalette.test.ts b/packages/vue/tests/primitives/CommandPalette/useCommandPalette.test.ts
index 217265ea0..ac6175b98 100644
--- a/packages/vue/tests/primitives/CommandPalette/useCommandPalette.test.ts
+++ b/packages/vue/tests/primitives/CommandPalette/useCommandPalette.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { range } from 'es-toolkit'
-import { useCommandPalette } from '@open-pencil/vue'
+import { useCommandPalette } from '@open-pencil/vue/primitives/CommandPalette'
const palette = () =>
useCommandPalette({
diff --git a/packages/vue/tests/primitives/FontPicker/useFontPicker.test.ts b/packages/vue/tests/primitives/FontPicker/useFontPicker.test.ts
index a7630a4bc..dda93d47b 100644
--- a/packages/vue/tests/primitives/FontPicker/useFontPicker.test.ts
+++ b/packages/vue/tests/primitives/FontPicker/useFontPicker.test.ts
@@ -1,7 +1,8 @@
import { expect, test } from 'bun:test'
+
import { nextTick, ref } from 'vue'
-import { useFontPicker } from '@open-pencil/vue'
+import { useFontPicker } from '@open-pencil/vue/primitives/FontPicker'
test('a search lists the family it names first, then families it begins, as Figma does', async () => {
const picker = useFontPicker({
diff --git a/packages/vue/tests/primitives/LayerTree/model.test.ts b/packages/vue/tests/primitives/LayerTree/model.test.ts
index 51e64054b..816888495 100644
--- a/packages/vue/tests/primitives/LayerTree/model.test.ts
+++ b/packages/vue/tests/primitives/LayerTree/model.test.ts
@@ -2,9 +2,11 @@ import { describe, expect, test } from 'bun:test'
import { reactive } from 'vue'
-import { createShapeWithText, SceneGraph, withIcon } from '@open-pencil/scene-graph'
+import { createShapeWithText } from '@open-pencil/scene-graph/generated'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { withIcon } from '@open-pencil/scene-graph/icons'
import { colorToFill } from '@open-pencil/scene-graph/color'
-import { buildLayerTreeModel, patchLayerNode } from '@open-pencil/vue'
+import { buildLayerTreeModel, patchLayerNode } from '@open-pencil/vue/primitives/LayerTree'
import { dropIndex } from '#vue/primitives/LayerTree/model'
diff --git a/packages/vue/tests/shared/input/draw-parent.test.ts b/packages/vue/tests/shared/input/draw-parent.test.ts
index f8b3dd246..33bc167c3 100644
--- a/packages/vue/tests/shared/input/draw-parent.test.ts
+++ b/packages/vue/tests/shared/input/draw-parent.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { createEditor, type Editor, type Tool } from '@open-pencil/core/editor'
+import { createEditor, type Editor, type Tool } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import { handleDrawMove, startShapeDraw } from '#vue/shared/input/draw'
diff --git a/packages/vue/tests/shared/input/move/connectors.test.ts b/packages/vue/tests/shared/input/move/connectors.test.ts
index d0393c2dd..4c9113595 100644
--- a/packages/vue/tests/shared/input/move/connectors.test.ts
+++ b/packages/vue/tests/shared/input/move/connectors.test.ts
@@ -1,6 +1,10 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { boundEndpoint, buildConnectorSublayers, freeEndpoint } from '@open-pencil/scene-graph'
+import {
+ boundEndpoint,
+ buildConnectorSublayers,
+ freeEndpoint
+} from '@open-pencil/scene-graph/connectors'
import { createMoveHarness, type MoveHarness } from './harness'
diff --git a/packages/vue/tests/shared/input/move/drop.test.ts b/packages/vue/tests/shared/input/move/drop.test.ts
index b25f3d07e..bc930b062 100644
--- a/packages/vue/tests/shared/input/move/drop.test.ts
+++ b/packages/vue/tests/shared/input/move/drop.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { createMoveHarness, type MoveHarness } from './harness'
diff --git a/packages/vue/tests/shared/input/move/harness.ts b/packages/vue/tests/shared/input/move/harness.ts
index f1200fc7c..91bf3e25a 100644
--- a/packages/vue/tests/shared/input/move/harness.ts
+++ b/packages/vue/tests/shared/input/move/harness.ts
@@ -1,4 +1,4 @@
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import { handleMoveMove, handleMoveUp, type MoveModifiers } from '#vue/shared/input/move/drag'
diff --git a/packages/vue/tests/shared/input/resize.test.ts b/packages/vue/tests/shared/input/resize.test.ts
index e92c1dca2..c02ad5346 100644
--- a/packages/vue/tests/shared/input/resize.test.ts
+++ b/packages/vue/tests/shared/input/resize.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
-import { hasInstanceOverride, type SceneNode } from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { hasInstanceOverride } from '@open-pencil/scene-graph/instances'
import { createResizeSnapshot } from '@open-pencil/scene-graph/resize'
import { applyResize, cancelResizePreview, commitResizePreview } from '#vue/shared/input/resize'
diff --git a/packages/vue/tests/shared/input/resize/aspect-ratio.test.ts b/packages/vue/tests/shared/input/resize/aspect-ratio.test.ts
index f179f796f..fb581481c 100644
--- a/packages/vue/tests/shared/input/resize/aspect-ratio.test.ts
+++ b/packages/vue/tests/shared/input/resize/aspect-ratio.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import { applyResize, commitResizePreview } from '#vue/shared/input/resize'
diff --git a/packages/vue/tests/shared/input/resize/sizing.test.ts b/packages/vue/tests/shared/input/resize/sizing.test.ts
index 8297e95b9..092d43cc2 100644
--- a/packages/vue/tests/shared/input/resize/sizing.test.ts
+++ b/packages/vue/tests/shared/input/resize/sizing.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { applyResize, cancelResizePreview, commitResizePreview } from '#vue/shared/input/resize'
import { tryStartResize } from '#vue/shared/input/resize/start'
@@ -8,7 +8,7 @@ import type { DragResize } from '#vue/shared/input/types'
// Handle drags on a Hug × Hug auto layout frame of two 100×100 frames at 200,150, recorded in
// live Figma on 2026-10-10: [x, y, width, height, horizontal sizing, vertical sizing].
-const CASES: [DragResize["handle"], number, number, boolean, (number | string)[]][] = [
+const CASES: [DragResize['handle'], number, number, boolean, (number | string)[]][] = [
['e', 60, 0, false, [200, 150, 260, 100, 'FIXED', 'HUG']],
['s', 0, 40, false, [200, 150, 200, 140, 'HUG', 'FIXED']],
['se', 60, 40, false, [200, 150, 260, 140, 'FIXED', 'FIXED']],
diff --git a/packages/vue/tests/shared/input/section-resize.test.ts b/packages/vue/tests/shared/input/section-resize.test.ts
index 7a265d799..621fddf60 100644
--- a/packages/vue/tests/shared/input/section-resize.test.ts
+++ b/packages/vue/tests/shared/input/section-resize.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { applyResize, commitResizePreview } from '#vue/shared/input/resize'
import type { DragResize } from '#vue/shared/input/types'
diff --git a/packages/vue/tests/shared/input/select/hit.test.ts b/packages/vue/tests/shared/input/select/hit.test.ts
index 4255848fe..4f5572d05 100644
--- a/packages/vue/tests/shared/input/select/hit.test.ts
+++ b/packages/vue/tests/shared/input/select/hit.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import type { HitTestFns } from '#vue/shared/input/select'
@@ -10,7 +10,9 @@ let editor: Editor
afterEach(() => editor.dispose())
-function labelHits(hits: Partial<Record<'frame' | 'section' | 'component', SceneNode>>): HitTestFns {
+function labelHits(
+ hits: Partial<Record<'frame' | 'section' | 'component', SceneNode>>
+): HitTestFns {
return {
hitTestInScope: () => null,
isInsideContainerBounds: () => false,
diff --git a/packages/vue/tests/shared/input/select/hover.test.ts b/packages/vue/tests/shared/input/select/hover.test.ts
index b1c05c168..8760298fb 100644
--- a/packages/vue/tests/shared/input/select/hover.test.ts
+++ b/packages/vue/tests/shared/input/select/hover.test.ts
@@ -1,7 +1,9 @@
import { afterEach, expect, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
-import { boundEndpoint, createConnector, createSticky, type SceneNode } from '@open-pencil/scene-graph'
+import { createEditor, type Editor } from '@open-pencil/core'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { boundEndpoint, createConnector } from '@open-pencil/scene-graph/connectors'
+import { createSticky } from '@open-pencil/scene-graph/generated'
import {
MOVE_CURSOR,
@@ -83,10 +85,12 @@ test("a sticky note's handles keep their cursor, since they scale it", () => {
test("a line's ends show the move cursor, and its length takes no resize", () => {
editor = createEditor()
- const line = editor.graph.createNode('LINE', editor.state.currentPageId, { width: 200, height: 0 })
+ const line = editor.graph.createNode('LINE', editor.state.currentPageId, {
+ width: 200,
+ height: 0
+ })
editor.select([line.id])
expect(updateHoverCursor(200, 0, editor, NO_HITS)).toBe(MOVE_CURSOR)
expect(updateHoverCursor(0, 2, editor, NO_HITS)).toBe(MOVE_CURSOR)
expect(updateHoverCursor(100, 3, editor, NO_HITS)).toBeNull()
})
-
diff --git a/packages/vue/tests/shared/input/select/read-only.test.ts b/packages/vue/tests/shared/input/select/read-only.test.ts
index c48e0948a..38c76eae5 100644
--- a/packages/vue/tests/shared/input/select/read-only.test.ts
+++ b/packages/vue/tests/shared/input/select/read-only.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import { handleSelectDown, type HitTestFns } from '#vue/shared/input/select'
diff --git a/packages/vue/tests/shared/input/vector/segments.test.ts b/packages/vue/tests/shared/input/vector/segments.test.ts
index bf967daa3..600dd9455 100644
--- a/packages/vue/tests/shared/input/vector/segments.test.ts
+++ b/packages/vue/tests/shared/input/vector/segments.test.ts
@@ -2,7 +2,7 @@ import { afterEach, describe, expect, mock, test } from 'bun:test'
import { ref } from 'vue'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
import { handleNodeEditPointerUp } from '#vue/canvas/vector-input/input'
import type { DragState } from '#vue/shared/input/types'
diff --git a/packages/vue/tsconfig.json b/packages/vue/tsconfig.json
index 99ef91aaf..c5f921806 100644
--- a/packages/vue/tsconfig.json
+++ b/packages/vue/tsconfig.json
@@ -17,6 +17,7 @@
"#vue/*": ["./src/*", "./src/*.vue"],
"#core/*": ["../core/src/*"],
"@open-pencil/vue": ["./src/index.ts"],
+ "@open-pencil/vue/*": ["./src/*"],
"@open-pencil/core": ["../core/src/index.ts"],
"@open-pencil/core/*": ["../core/src/*"],
"@open-pencil/core/editor": ["../core/src/editor/index.ts"],
diff --git a/packages/vue/tsdown.config.ts b/packages/vue/tsdown.config.ts
index afa5716bf..c2678fd5a 100644
--- a/packages/vue/tsdown.config.ts
+++ b/packages/vue/tsdown.config.ts
@@ -1,11 +1,34 @@
+import { readFileSync } from 'node:fs'
import { createRequire } from 'node:module'
+import { defineConfig } from 'tsdown'
import raw from 'unplugin-raw/rolldown'
import vue from 'unplugin-vue/rolldown'
-import { defineConfig } from 'tsdown'
const require = createRequire(import.meta.url)
+const packageJSON = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')) as {
+ dependencies?: Record<string, string>
+ peerDependencies?: Record<string, string>
+}
+/** Bundled because their ES modules are `.js` files Node reads as CommonJS. */
+const BUNDLED = ['@atlaskit/pragmatic-drag-and-drop', '@atlaskit/pragmatic-drag-and-drop-hitbox']
+const external = Object.keys({ ...packageJSON.dependencies, ...packageJSON.peerDependencies })
+ .filter((name) => !BUNDLED.includes(name))
+ .flatMap((name) => [name, new RegExp(`^${name.replaceAll('/', '\\/')}/`)])
+
+/**
+ * Where an unbundled module is written: bundled packages keep their install path, and npm never
+ * packs a folder named `node_modules`, so they go under `vendor/` instead.
+ */
+function outputPath(chunk: { name: string }): string {
+ // A `?raw` import is a module of its own; its query would read as a URL query to Node.
+ const source = chunk.name.replace(/\?.*$/, '')
+ const vendored = source.lastIndexOf('node_modules/')
+ const name = vendored < 0 ? source : `vendor/${source.slice(vendored + 'node_modules/'.length)}`
+ return `${name}.js`
+}
+
function atlaskitSubpathResolver() {
const aliases = new Map([
[
@@ -33,7 +56,87 @@ function atlaskitSubpathResolver() {
export default defineConfig({
entry: {
- index: './src/index.ts'
+ index: './src/index.ts',
+ 'canvas/index': './src/canvas/index.ts',
+ 'canvas/drop/index': './src/canvas/drop/index.ts',
+ 'canvas/issues/index': './src/canvas/issues/index.ts',
+ 'canvas/labels/index': './src/canvas/labels/index.ts',
+ 'canvas/overlays/index': './src/canvas/overlays/index.ts',
+ 'canvas/statuses/index': './src/canvas/statuses/index.ts',
+ 'canvas/surface/index': './src/canvas/surface/index.ts',
+ 'canvas/text-edit/index': './src/canvas/text-edit/index.ts',
+ 'controls/appearance/index': './src/controls/appearance/index.ts',
+ 'controls/behaviour/index': './src/controls/behaviour/index.ts',
+ 'controls/binding-provider/index': './src/controls/binding-provider/index.ts',
+ 'controls/color-model/index': './src/controls/color-model/index.ts',
+ 'controls/color-variable-binding/index': './src/controls/color-variable-binding/index.ts',
+ 'controls/component-props/index': './src/controls/component-props/index.ts',
+ 'controls/connector/index': './src/controls/connector/index.ts',
+ 'controls/constraints/index': './src/controls/constraints/index.ts',
+ 'controls/effects/index': './src/controls/effects/index.ts',
+ 'controls/fill/index': './src/controls/fill/index.ts',
+ 'controls/icon/index': './src/controls/icon/index.ts',
+ 'controls/layout/index': './src/controls/layout/index.ts',
+ 'controls/mask/index': './src/controls/mask/index.ts',
+ 'controls/node-props/index': './src/controls/node-props/index.ts',
+ 'controls/number-expression/index': './src/controls/number-expression/index.ts',
+ 'controls/number-variable-binding/index': './src/controls/number-variable-binding/index.ts',
+ 'controls/okhcl/index': './src/controls/okhcl/index.ts',
+ 'controls/position/index': './src/controls/position/index.ts',
+ 'controls/prop-scrub/index': './src/controls/prop-scrub/index.ts',
+ 'controls/property-list/index': './src/controls/property-list/index.ts',
+ 'controls/selection-colors/index': './src/controls/selection-colors/index.ts',
+ 'controls/selection-layout/index': './src/controls/selection-layout/index.ts',
+ 'controls/shader/index': './src/controls/shader/index.ts',
+ 'controls/shape-with-text/index': './src/controls/shape-with-text/index.ts',
+ 'controls/shared-style/index': './src/controls/shared-style/index.ts',
+ 'controls/slots/index': './src/controls/slots/index.ts',
+ 'controls/sticky/index': './src/controls/sticky/index.ts',
+ 'controls/stroke/index': './src/controls/stroke/index.ts',
+ 'controls/typography/index': './src/controls/typography/index.ts',
+ 'controls/variable-binding/index': './src/controls/variable-binding/index.ts',
+ 'controls/variable-modes/index': './src/controls/variable-modes/index.ts',
+ 'controls/variants/index': './src/controls/variants/index.ts',
+ 'document/export/index': './src/document/export/index.ts',
+ 'document/workspace/index': './src/document/workspace/index.ts',
+ 'editor/commands/index': './src/editor/commands/index.ts',
+ 'editor/events/index': './src/editor/events/index.ts',
+ 'editor/inline-rename/index': './src/editor/inline-rename/index.ts',
+ 'editor/menu-model/index': './src/editor/menu-model/index.ts',
+ 'editor/selection-capabilities/index': './src/editor/selection-capabilities/index.ts',
+ 'editor/selection-state/index': './src/editor/selection-state/index.ts',
+ 'editor/tool-cursor/index': './src/editor/tool-cursor/index.ts',
+ 'editor/viewport-kind/index': './src/editor/viewport-kind/index.ts',
+ 'i18n/index': './src/i18n/index.ts',
+ 'internal/scene-computed/index': './src/internal/scene-computed/index.ts',
+ 'lifecycle/retention/index': './src/lifecycle/retention/index.ts',
+ 'primitives/AppearanceControls/index': './src/primitives/AppearanceControls/index.ts',
+ 'primitives/BindableValue/index': './src/primitives/BindableValue/index.ts',
+ 'primitives/ChannelSlider/index': './src/primitives/ChannelSlider/index.ts',
+ 'primitives/ColorPicker/index': './src/primitives/ColorPicker/index.ts',
+ 'primitives/CommandPalette/index': './src/primitives/CommandPalette/index.ts',
+ 'primitives/ConstraintsControl/index': './src/primitives/ConstraintsControl/index.ts',
+ 'primitives/Fill/index': './src/primitives/Fill/index.ts',
+ 'primitives/FontPicker/index': './src/primitives/FontPicker/index.ts',
+ 'primitives/GradientEditor/index': './src/primitives/GradientEditor/index.ts',
+ 'primitives/LayerTree/index': './src/primitives/LayerTree/index.ts',
+ 'primitives/LayoutControls/index': './src/primitives/LayoutControls/index.ts',
+ 'primitives/NumberField/index': './src/primitives/NumberField/index.ts',
+ 'primitives/PageList/index': './src/primitives/PageList/index.ts',
+ 'primitives/PositionControls/index': './src/primitives/PositionControls/index.ts',
+ 'primitives/PropertyGrid/index': './src/primitives/PropertyGrid/index.ts',
+ 'primitives/PropertyList/index': './src/primitives/PropertyList/index.ts',
+ 'primitives/PropertySection/index': './src/primitives/PropertySection/index.ts',
+ 'primitives/SegmentedControl/index': './src/primitives/SegmentedControl/index.ts',
+ 'primitives/Toolbar/index': './src/primitives/Toolbar/index.ts',
+ 'primitives/TypographyControls/index': './src/primitives/TypographyControls/index.ts',
+ 'shared/dom-events': './src/shared/dom-events.ts',
+ 'shared/drag/index': './src/shared/drag/index.ts',
+ 'shared/font-status/index': './src/shared/font-status/index.ts',
+ 'shared/input/index': './src/shared/input/index.ts',
+ 'shared/search/index': './src/shared/search/index.ts',
+ 'testing/index': './src/testing/index.ts',
+ 'variables/index': './src/variables/index.ts'
},
platform: 'browser',
format: ['esm'],
@@ -49,27 +152,8 @@ export default defineConfig({
moduleSideEffects: false
},
deps: {
- alwaysBundle: [
- '@atlaskit/pragmatic-drag-and-drop',
- /^@atlaskit\/pragmatic-drag-and-drop\//,
- '@atlaskit/pragmatic-drag-and-drop-hitbox',
- /^@atlaskit\/pragmatic-drag-and-drop-hitbox\//
- ],
- neverBundle: [
- 'vue',
- /^vue\//,
- '@open-pencil/core',
- /^@open-pencil\/core\//,
- '@open-pencil/scene-graph',
- /^@open-pencil\/scene-graph\//,
- 'canvaskit-wasm',
- 'opentype.js',
- '@vueuse/core',
- '@nanostores/vue',
- '@nanostores/i18n',
- 'nanostores',
- 'reka-ui'
- ],
+ alwaysBundle: BUNDLED.flatMap((name) => [name, new RegExp(`^${name.replaceAll('/', '\\/')}/`)]),
+ neverBundle: [...external, /^node:/ ],
onlyBundle: false
},
plugins: [atlaskitSubpathResolver(), raw(), vue()],
@@ -81,19 +165,9 @@ export default defineConfig({
},
outputOptions: {
minifyInternalExports: false,
- codeSplitting: {
- groups: [
- {
- test: /(?<!\.d\.c?ts)$/,
- name: (id) => {
- const cleanId = id.split('?')[0]
- const parts = cleanId.split(/[\\/]/g)
- const srcIndex = parts.lastIndexOf('src')
- const file = srcIndex >= 0 ? parts.slice(srcIndex + 1).join('/') : parts.at(-1) ?? 'index'
- return file.replace(/\.(vue|ts)$/, '')
- }
- }
- ]
- }
- }
+ entryFileNames: outputPath,
+ chunkFileNames: outputPath
+ },
+ // Each module keeps its source path, so an entry's declarations never share a name with a chunk.
+ unbundle: true
})
diff --git a/src/App.vue b/src/App.vue
index a011bfaf4..200c4c105 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -6,7 +6,8 @@ import { TooltipProvider } from 'reka-ui'
import { computed, onMounted, onUnmounted } from 'vue'
import { useRouter } from 'vue-router'
-import { provideEditor, useI18n } from '@open-pencil/vue'
+import { provideEditor } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { startCloud } from '@/app/cloud/integration'
import { useDocumentCloseProtection } from '@/app/document/close/use'
diff --git a/src/app/ai/attachment/image/analyze.ts b/src/app/ai/attachment/image/analyze.ts
index 4b541dfd5..4413e7423 100644
--- a/src/app/ai/attachment/image/analyze.ts
+++ b/src/app/ai/attachment/image/analyze.ts
@@ -1,6 +1,6 @@
import { generateText } from 'ai'
-import { computeContentBounds } from '@open-pencil/core/io'
+import { computeContentBounds } from '@open-pencil/core/io/formats/raster'
import { IMAGE_ATTACHMENT_MAX_EDGE } from '@/app/ai/attachment/image/prepare'
import type { PreparedImageAttachment } from '@/app/ai/attachment/image/types'
diff --git a/src/app/ai/attachment/node/snapshot.ts b/src/app/ai/attachment/node/snapshot.ts
index 13c095a80..f8a88fbb2 100644
--- a/src/app/ai/attachment/node/snapshot.ts
+++ b/src/app/ai/attachment/node/snapshot.ts
@@ -1,4 +1,4 @@
-import { renderNodesToImage } from '@open-pencil/core/io'
+import { renderNodesToImage } from '@open-pencil/core/io/formats/raster'
import type { NodePresentation } from '@/app/ai/attachment/presentation/types'
import type { ReferencedNode } from '@/app/ai/chat/context'
diff --git a/src/app/ai/attachment/presentation/types.ts b/src/app/ai/attachment/presentation/types.ts
index 8264c82ce..7fc70b91f 100644
--- a/src/app/ai/attachment/presentation/types.ts
+++ b/src/app/ai/attachment/presentation/types.ts
@@ -1,4 +1,5 @@
-import type { SceneNode, Vector } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import type { ImageAttachmentMediaType } from '@/app/ai/attachment/image/types'
diff --git a/src/app/ai/preview/canvas.ts b/src/app/ai/preview/canvas.ts
index ae9c26fc1..56a05b8b0 100644
--- a/src/app/ai/preview/canvas.ts
+++ b/src/app/ai/preview/canvas.ts
@@ -7,7 +7,7 @@ import {
stageJSXPreview,
type StagedJSXPreview
} from '@open-pencil/core/design-jsx'
-import { computeContentBounds } from '@open-pencil/core/io'
+import { computeContentBounds } from '@open-pencil/core/io/formats/raster'
import type { JSXPreviewNode } from '@open-pencil/design-jsx'
import type { SceneGraph } from '@open-pencil/scene-graph'
import type { Rect, Vector } from '@open-pencil/scene-graph/primitives'
diff --git a/src/app/ai/reply/run.ts b/src/app/ai/reply/run.ts
index a3ef37493..1613cf1ad 100644
--- a/src/app/ai/reply/run.ts
+++ b/src/app/ai/reply/run.ts
@@ -1,4 +1,4 @@
-import type { DocumentChange, PageSnapshot } from '@open-pencil/core/editor'
+import type { DocumentChange, PageSnapshot } from '@open-pencil/core'
import type { StepBudget } from '@open-pencil/core/tools'
import type { UndoEntry } from '@open-pencil/scene-graph/undo'
diff --git a/src/app/ai/tools/changes/capture.ts b/src/app/ai/tools/changes/capture.ts
index ab79cf0c4..a9244cd19 100644
--- a/src/app/ai/tools/changes/capture.ts
+++ b/src/app/ai/tools/changes/capture.ts
@@ -5,7 +5,7 @@ import {
graphFromDocumentChange,
isEmptyDocumentChange,
type DocumentChange
-} from '@open-pencil/core/editor'
+} from '@open-pencil/core'
import { diffPageLayersJSX } from '@open-pencil/core/tools'
import type { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/src/app/ai/tools/index.ts b/src/app/ai/tools/index.ts
index f01a52af3..abd3bded9 100644
--- a/src/app/ai/tools/index.ts
+++ b/src/app/ai/tools/index.ts
@@ -1,7 +1,7 @@
import { tool } from 'ai'
import { isPlainObject } from 'es-toolkit'
-import { graphFromPageSnapshot } from '@open-pencil/core/editor'
+import { graphFromPageSnapshot } from '@open-pencil/core'
import { registerComponentCatalog, isAtomicTool, toolsToAI } from '@open-pencil/core/tools'
import {
diff --git a/src/app/ai/tools/runner.ts b/src/app/ai/tools/runner.ts
index da64380b3..7f61352af 100644
--- a/src/app/ai/tools/runner.ts
+++ b/src/app/ai/tools/runner.ts
@@ -1,4 +1,4 @@
-import { isEmptyDocumentChange } from '@open-pencil/core/editor'
+import { isEmptyDocumentChange } from '@open-pencil/core'
import type { FigmaAPI } from '@open-pencil/core/figma-api'
import { isAtomicTool, toolChangesDocument, type ToolDef } from '@open-pencil/core/tools'
diff --git a/src/app/ai/tools/vision/inspect.ts b/src/app/ai/tools/vision/inspect.ts
index 463aea7ea..9a8d89c77 100644
--- a/src/app/ai/tools/vision/inspect.ts
+++ b/src/app/ai/tools/vision/inspect.ts
@@ -2,7 +2,7 @@ import { valibotSchema } from '@ai-sdk/valibot'
import { generateText, tool } from 'ai'
import * as v from 'valibot'
-import { computeContentBounds } from '@open-pencil/core/io'
+import { computeContentBounds } from '@open-pencil/core/io/formats/raster'
import { createAIModelRuntime } from '@/app/ai/models'
import { runtimeReasoningSettings } from '@/app/ai/models/reasoning/settings'
diff --git a/src/app/automation/bridge/export-handlers.ts b/src/app/automation/bridge/export-handlers.ts
index 7674d858e..cc6673210 100644
--- a/src/app/automation/bridge/export-handlers.ts
+++ b/src/app/automation/bridge/export-handlers.ts
@@ -1,6 +1,6 @@
import { fromUint8Array } from 'js-base64'
-import type { RasterExportFormat } from '@open-pencil/core/io'
+import type { RasterExportFormat } from '@open-pencil/core/io/formats/raster'
import { selectionToJSX } from '@open-pencil/design-jsx'
import { sceneNodesToTailwindJSX } from '@open-pencil/dom-css/export'
diff --git a/src/app/automation/execution/editor.ts b/src/app/automation/execution/editor.ts
index 238c96685..812cb4859 100644
--- a/src/app/automation/execution/editor.ts
+++ b/src/app/automation/execution/editor.ts
@@ -1,4 +1,4 @@
-import { executeAtomicTool, isEmptyDocumentChange } from '@open-pencil/core/editor'
+import { executeAtomicTool, isEmptyDocumentChange } from '@open-pencil/core'
import type { FigmaAPI } from '@open-pencil/core/figma-api'
import type { ToolDef } from '@open-pencil/core/tools'
diff --git a/src/app/automation/mcp/preferences.ts b/src/app/automation/mcp/preferences.ts
index 96a30f0d9..1b661da48 100644
--- a/src/app/automation/mcp/preferences.ts
+++ b/src/app/automation/mcp/preferences.ts
@@ -1,11 +1,8 @@
import { useLocalStorage } from '@vueuse/core'
import { ref } from 'vue'
-import {
- createToolDescriptors,
- type MCPToolScope,
- type ToolDescriptor
-} from '@open-pencil/mcp/tools'
+import { type MCPToolScope, type ToolDescriptor } from '@open-pencil/mcp/tools'
+import { createToolDescriptors } from '@open-pencil/mcp/tools'
const DISABLED_TOOLS_STORAGE_KEY = 'open-pencil:mcp:disabled-tools'
const ROOT_DIRECTORY_STORAGE_KEY = 'open-pencil:mcp:root-directory'
diff --git a/src/app/cloud-portal/failure.ts b/src/app/cloud-portal/failure.ts
index fb67163c8..264238c34 100644
--- a/src/app/cloud-portal/failure.ts
+++ b/src/app/cloud-portal/failure.ts
@@ -1,5 +1,5 @@
import { CloudPortalAPIError, type CloudAuthFailure } from '@open-pencil/cloud/client'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import { cloudAuthFailureMessage } from '@/app/cloud/sessions/account-form'
diff --git a/src/app/cloud/documents/link.ts b/src/app/cloud/documents/link.ts
index 0ff01d091..ef83e7344 100644
--- a/src/app/cloud/documents/link.ts
+++ b/src/app/cloud/documents/link.ts
@@ -3,7 +3,7 @@ import * as v from 'valibot'
import { ref, watch } from 'vue'
import { cloudDocumentPath, cloudDocumentURL } from '@open-pencil/cloud/contract'
-import { cloudMessages } from '@open-pencil/vue'
+import { cloudMessages } from '@open-pencil/vue/i18n'
import type { EditorStore } from '@/app/editor/session'
import { toast } from '@/app/shell/ui'
diff --git a/src/app/cloud/links.ts b/src/app/cloud/links.ts
index 4f453b72d..d24f4af9a 100644
--- a/src/app/cloud/links.ts
+++ b/src/app/cloud/links.ts
@@ -1,7 +1,8 @@
import * as v from 'valibot'
import { cloudDesktopLinkURL, type CloudLinkKind } from '@open-pencil/cloud/contract'
-import { cloudMessages, useViewportKind } from '@open-pencil/vue'
+import { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
+import { cloudMessages } from '@open-pencil/vue/i18n'
import { toast } from '@/app/shell/ui'
import { isTauri } from '@/app/tauri/env'
diff --git a/src/app/cloud/sessions/account-form.ts b/src/app/cloud/sessions/account-form.ts
index 3333c0ecf..da30f1b46 100644
--- a/src/app/cloud/sessions/account-form.ts
+++ b/src/app/cloud/sessions/account-form.ts
@@ -3,7 +3,7 @@ import { useForm } from 'vee-validate'
import { computed, type Ref } from 'vue'
import type { CloudAuthFailure } from '@open-pencil/cloud/client'
-import type { useCloudPortalMessages } from '@open-pencil/vue'
+import type { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import { validateAfterFirstError } from '@/app/settings/validation/use'
diff --git a/src/app/code/layers/use.ts b/src/app/code/layers/use.ts
index f9f27ef23..b669e36de 100644
--- a/src/app/code/layers/use.ts
+++ b/src/app/code/layers/use.ts
@@ -5,7 +5,7 @@ import {
selectionToJSXWithLayers,
type DesignJSXElement
} from '@open-pencil/design-jsx'
-import { useDesignCheckMessages } from '@open-pencil/vue'
+import { useDesignCheckMessages } from '@open-pencil/vue/i18n'
import type { GeneratedCode } from '@/app/code/generated'
import type { DesignJSXLayerLine } from '@/app/code/live-preview'
diff --git a/src/app/code/live-preview.ts b/src/app/code/live-preview.ts
index 7f2c7373e..df385c4af 100644
--- a/src/app/code/live-preview.ts
+++ b/src/app/code/live-preview.ts
@@ -1,7 +1,8 @@
import { renderTree } from '@open-pencil/core/design-jsx'
import { computeAllLayouts } from '@open-pencil/core/layout'
import { reconcileRenderedLayers, type TreeNode } from '@open-pencil/design-jsx'
-import type { SceneNode, Vector } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import { convertDesignJSXRoots } from '@/app/code/sandbox/convert'
import { evaluateDesignJSX } from '@/app/code/sandbox/evaluate'
diff --git a/src/app/collab/join.ts b/src/app/collab/join.ts
index 2a02237d5..7badb1c42 100644
--- a/src/app/collab/join.ts
+++ b/src/app/collab/join.ts
@@ -1,4 +1,4 @@
-import { useCollaborationMessages } from '@open-pencil/vue'
+import { useCollaborationMessages } from '@open-pencil/vue/i18n'
import { parseRoomInput } from '@/app/collab/room/id'
import { joinRoom } from '@/app/collab/rooms'
diff --git a/src/app/collab/node-codec.ts b/src/app/collab/node-codec.ts
index f31ce9b10..b59028ba5 100644
--- a/src/app/collab/node-codec.ts
+++ b/src/app/collab/node-codec.ts
@@ -1,15 +1,17 @@
import { isEqual } from 'es-toolkit/predicate'
-import {
- deserializeInstanceOverrideState,
- serializeInstanceOverrideState,
- type Fill,
- type FillType,
- type GeometryPath,
- type SceneNode,
- type SourceMetadata
+import type {
+ Fill,
+ FillType,
+ GeometryPath,
+ SceneNode,
+ SourceMetadata
} from '@open-pencil/scene-graph'
import { copyFills } from '@open-pencil/scene-graph/copy'
+import {
+ deserializeInstanceOverrideState,
+ serializeInstanceOverrideState
+} from '@open-pencil/scene-graph/instances/overrides'
import { createDefaultSourceMetadata } from '@open-pencil/scene-graph/node-defaults'
import type { Matrix, Vector } from '@open-pencil/scene-graph/primitives'
diff --git a/src/app/comments/document.ts b/src/app/comments/document.ts
index 1f21423cb..f19058289 100644
--- a/src/app/comments/document.ts
+++ b/src/app/comments/document.ts
@@ -1,5 +1,6 @@
import { ref, watch, type Ref } from 'vue'
+import type { CommentThread } from '@open-pencil/scene-graph'
import {
commentPosition,
commentTimestamp as now,
@@ -7,9 +8,8 @@ import {
hasNewerComments,
mergeCommentThreads,
readComments,
- writeComments,
- type CommentThread
-} from '@open-pencil/scene-graph'
+ writeComments
+} from '@open-pencil/scene-graph/comments'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import type { EditorStore } from '@/app/editor/active-store'
diff --git a/src/app/comments/use.ts b/src/app/comments/use.ts
index 152d0cbce..161b386e4 100644
--- a/src/app/comments/use.ts
+++ b/src/app/comments/use.ts
@@ -10,7 +10,7 @@ import {
deleteCommentThread,
replyToCommentThread,
resolveCommentThread
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/comments'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import { useCollabIdentity } from '@/app/collab/identity'
diff --git a/src/app/demo/theme.ts b/src/app/demo/theme.ts
index 4a7d5e33b..29befb4c4 100644
--- a/src/app/demo/theme.ts
+++ b/src/app/demo/theme.ts
@@ -1,7 +1,7 @@
import { watch, type WatchSource } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
-import type { Color } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
+import type { Color } from '@open-pencil/scene-graph/primitives'
type AppTheme = 'dark' | 'light'
type TourThemeEditor = Pick<
diff --git a/src/app/demo/viewport.ts b/src/app/demo/viewport.ts
index 12cc968f6..34fb7fde1 100644
--- a/src/app/demo/viewport.ts
+++ b/src/app/demo/viewport.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
type DemoViewportEditor = Pick<Editor, 'graph' | 'state' | 'zoomToBounds'>
diff --git a/src/app/document/close/native.ts b/src/app/document/close/native.ts
index 45f890159..adaf7c06b 100644
--- a/src/app/document/close/native.ts
+++ b/src/app/document/close/native.ts
@@ -1,7 +1,7 @@
import { message } from '@tauri-apps/plugin-dialog'
import type { MessageDialogOptions, MessageDialogResult } from '@tauri-apps/plugin-dialog'
-import { commonMessages, filesMessages } from '@open-pencil/vue'
+import { commonMessages, filesMessages } from '@open-pencil/vue/i18n'
import type { CloseChoice } from './controller'
diff --git a/src/app/document/export/create.ts b/src/app/document/export/create.ts
index d362a9361..d3a50cf8a 100644
--- a/src/app/document/export/create.ts
+++ b/src/app/document/export/create.ts
@@ -1,4 +1,4 @@
-import type { Editor, EditorState } from '@open-pencil/core/editor'
+import type { Editor, EditorState } from '@open-pencil/core'
import type { BuiltinIOFormatId, ExportRequest, IORegistry } from '@open-pencil/core/io'
import {
diff --git a/src/app/document/export/files.ts b/src/app/document/export/files.ts
index 02e9b43e3..2ae1191c7 100644
--- a/src/app/document/export/files.ts
+++ b/src/app/document/export/files.ts
@@ -1,14 +1,13 @@
import { zipSync, type Zippable } from 'fflate'
-import type { Editor, EditorState } from '@open-pencil/core/editor'
+import type { Editor, EditorState } from '@open-pencil/core'
import {
findPageId,
type ExportRequest,
type IOFormatAdapter,
- type IORegistry,
- type RasterExportFormat
+ type IORegistry
} from '@open-pencil/core/io'
-import { renderNodesToImage } from '@open-pencil/core/io/formats/raster'
+import { type RasterExportFormat, renderNodesToImage } from '@open-pencil/core/io/formats/raster'
import type { SceneGraph } from '@open-pencil/scene-graph'
import type { ExportOptions } from '@/app/document/export/types'
diff --git a/src/app/document/io/changes.ts b/src/app/document/io/changes.ts
index 65a99c89a..487a59c29 100644
--- a/src/app/document/io/changes.ts
+++ b/src/app/document/io/changes.ts
@@ -1,7 +1,7 @@
import { computed, ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
-import type { UndoEntry } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
+import type { UndoEntry } from '@open-pencil/scene-graph/undo'
/** Stands for the history of a save whose state was not captured, which history never returns to. */
const UNKNOWN_HISTORY: UndoEntry = { label: '', forward: () => undefined, inverse: () => undefined }
diff --git a/src/app/document/io/create.ts b/src/app/document/io/create.ts
index 93e4f6463..b7179a389 100644
--- a/src/app/document/io/create.ts
+++ b/src/app/document/io/create.ts
@@ -1,5 +1,5 @@
-import type { Editor, EditorState } from '@open-pencil/core/editor'
-import { prefetchFigmaSchema } from '@open-pencil/core/kiwi'
+import type { Editor, EditorState } from '@open-pencil/core'
+import { prefetchFigmaSchema } from '@open-pencil/core/clipboard'
import { createDocumentViewportActions, downloadBlob } from '@/app/document/io/browser'
import { createDOMOpenActions } from '@/app/document/io/dom'
diff --git a/src/app/document/io/dom.ts b/src/app/document/io/dom.ts
index 0a3cf8a2f..fd7710aaa 100644
--- a/src/app/document/io/dom.ts
+++ b/src/app/document/io/dom.ts
@@ -1,4 +1,4 @@
-import type { Editor, EditorState } from '@open-pencil/core/editor'
+import type { Editor, EditorState } from '@open-pencil/core'
import { sceneGraphFromStyledHTML } from '@open-pencil/core/io/formats/html/layers'
import { browserHTMLToDesignDocument } from '@open-pencil/dom-css/browser'
diff --git a/src/app/document/io/fig.ts b/src/app/document/io/fig.ts
index c4fe73b55..86ff7cb33 100644
--- a/src/app/document/io/fig.ts
+++ b/src/app/document/io/fig.ts
@@ -1,5 +1,6 @@
import { readFigFile } from '@open-pencil/core/io/formats/fig'
-import { isUnsupportedVariableValue, type SceneGraph } from '@open-pencil/scene-graph'
+import type { SceneGraph } from '@open-pencil/scene-graph'
+import { isUnsupportedVariableValue } from '@open-pencil/scene-graph/variables'
import { notificationMessages } from '@/app/i18n/notifications'
import { toast } from '@/app/shell/ui'
diff --git a/src/app/document/io/imported-document.ts b/src/app/document/io/imported-document.ts
index 39472b046..c50e0d29a 100644
--- a/src/app/document/io/imported-document.ts
+++ b/src/app/document/io/imported-document.ts
@@ -1,4 +1,4 @@
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import { loadFont } from '@/app/editor/fonts'
diff --git a/src/app/document/io/read.ts b/src/app/document/io/read.ts
index e93b3a298..5e9924597 100644
--- a/src/app/document/io/read.ts
+++ b/src/app/document/io/read.ts
@@ -1,4 +1,4 @@
-import type { Editor, EditorState } from '@open-pencil/core/editor'
+import type { Editor, EditorState } from '@open-pencil/core'
import { describeDiagnosticError, recordDocumentFailure } from '@/app/diagnostics'
import { yieldToUI } from '@/app/document/io/browser'
diff --git a/src/app/document/io/reload-state.ts b/src/app/document/io/reload-state.ts
index 77e2fa6ce..1eb64c552 100644
--- a/src/app/document/io/reload-state.ts
+++ b/src/app/document/io/reload-state.ts
@@ -1,4 +1,4 @@
-import type { Editor, EditorState } from '@open-pencil/core/editor'
+import type { Editor, EditorState } from '@open-pencil/core'
import type { ViewportTransform } from '@open-pencil/core/geometry'
export type ReloadStateSnapshot = {
diff --git a/src/app/document/io/save/actions.ts b/src/app/document/io/save/actions.ts
index 241dcde64..16e85294c 100644
--- a/src/app/document/io/save/actions.ts
+++ b/src/app/document/io/save/actions.ts
@@ -1,5 +1,5 @@
-import type { EditorState } from '@open-pencil/core/editor'
-import { filesMessages } from '@open-pencil/vue'
+import type { EditorState } from '@open-pencil/core'
+import { filesMessages } from '@open-pencil/vue/i18n'
import { downloadBlob } from '@/app/document/io/browser'
import { isFileWriteRefused } from '@/app/document/io/capability'
diff --git a/src/app/document/io/source/actions.ts b/src/app/document/io/source/actions.ts
index 2bc73d2eb..56004489d 100644
--- a/src/app/document/io/source/actions.ts
+++ b/src/app/document/io/source/actions.ts
@@ -1,4 +1,4 @@
-import type { Editor, EditorState } from '@open-pencil/core/editor'
+import type { Editor, EditorState } from '@open-pencil/core'
import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { createAutosave } from '@/app/document/autosave'
diff --git a/src/app/editor/canvas/menu/context.ts b/src/app/editor/canvas/menu/context.ts
index 98f7fb5c0..6b62a9d1e 100644
--- a/src/app/editor/canvas/menu/context.ts
+++ b/src/app/editor/canvas/menu/context.ts
@@ -1,6 +1,8 @@
import { computed, type Ref } from 'vue'
-import { formatShortcut, type Editor, type MenuEntry } from '@open-pencil/vue'
+import type { Editor } from '@open-pencil/core'
+import { formatShortcut } from '@open-pencil/vue/editor/commands'
+import type { MenuEntry } from '@open-pencil/vue/editor/menu-model'
import type { createCanvasMenuActions } from '@/app/editor/canvas/menu/actions'
import {
diff --git a/src/app/editor/canvas/menu/registry.ts b/src/app/editor/canvas/menu/registry.ts
index 3f9eef1f2..866ad21c2 100644
--- a/src/app/editor/canvas/menu/registry.ts
+++ b/src/app/editor/canvas/menu/registry.ts
@@ -1,4 +1,4 @@
-import type { TestId } from '@open-pencil/vue'
+import type { TestId } from '@open-pencil/vue/testing'
export type CanvasContextActionId =
| 'copy-as-text'
diff --git a/src/app/editor/clipboard/notifications.ts b/src/app/editor/clipboard/notifications.ts
index 109345615..4fdc3c62e 100644
--- a/src/app/editor/clipboard/notifications.ts
+++ b/src/app/editor/clipboard/notifications.ts
@@ -1,5 +1,5 @@
-import type { ClipboardImageResolution, Editor } from '@open-pencil/core/editor'
-import { filesMessages } from '@open-pencil/vue'
+import type { ClipboardImageResolution, Editor } from '@open-pencil/core'
+import { filesMessages } from '@open-pencil/vue/i18n'
import { toast } from '@/app/shell/ui'
diff --git a/src/app/editor/clipboard/paste/content.ts b/src/app/editor/clipboard/paste/content.ts
index 5d7d3493b..92e1fb913 100644
--- a/src/app/editor/clipboard/paste/content.ts
+++ b/src/app/editor/clipboard/paste/content.ts
@@ -1,5 +1,5 @@
-import type { Editor } from '@open-pencil/core/editor'
-import { isSVGMarkup } from '@open-pencil/core/io'
+import type { Editor } from '@open-pencil/core'
+import { isSVGMarkup } from '@open-pencil/core/io/formats/svg'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import { matchingClipboardSnapshot } from '../memory'
diff --git a/src/app/editor/clipboard/system/browser.ts b/src/app/editor/clipboard/system/browser.ts
index f677e6ebf..cb0166135 100644
--- a/src/app/editor/clipboard/system/browser.ts
+++ b/src/app/editor/clipboard/system/browser.ts
@@ -1,6 +1,6 @@
import copy from 'copy-to-clipboard'
-import type { CopyOptions } from '@open-pencil/core/editor'
+import type { CopyOptions } from '@open-pencil/core'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import type { EditorStore } from '@/app/editor/active-store'
diff --git a/src/app/editor/clipboard/system/tauri.ts b/src/app/editor/clipboard/system/tauri.ts
index 033cee928..f2e3dac5e 100644
--- a/src/app/editor/clipboard/system/tauri.ts
+++ b/src/app/editor/clipboard/system/tauri.ts
@@ -1,4 +1,4 @@
-import type { CopyOptions } from '@open-pencil/core/editor'
+import type { CopyOptions } from '@open-pencil/core'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import type { EditorStore } from '@/app/editor/active-store'
diff --git a/src/app/editor/clipboard/system/types.ts b/src/app/editor/clipboard/system/types.ts
index 61c94a6b1..aedd21cae 100644
--- a/src/app/editor/clipboard/system/types.ts
+++ b/src/app/editor/clipboard/system/types.ts
@@ -1,8 +1,8 @@
-import type { ClipboardPayload, CopyOptions } from '@open-pencil/core/editor'
+import type { ClipboardPayload, CopyOptions } from '@open-pencil/core'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import type { EditorStore } from '@/app/editor/active-store'
-export type { ClipboardPayload } from '@open-pencil/core/editor'
+export type { ClipboardPayload } from '@open-pencil/core'
export interface SystemClipboard {
copy(store: EditorStore, options?: CopyOptions): Promise<boolean>
diff --git a/src/app/editor/design-check/format.ts b/src/app/editor/design-check/format.ts
index e2d1b4175..442252a13 100644
--- a/src/app/editor/design-check/format.ts
+++ b/src/app/editor/design-check/format.ts
@@ -1,5 +1,5 @@
import type { LintFix, LintFixRequest } from '@open-pencil/core/lint'
-import type { useDesignCheckMessages } from '@open-pencil/vue'
+import type { useDesignCheckMessages } from '@open-pencil/vue/i18n'
import { formatNumber } from '@/app/i18n/number'
diff --git a/src/app/editor/design-check/session.ts b/src/app/editor/design-check/session.ts
index 43ed93f04..a9a4be137 100644
--- a/src/app/editor/design-check/session.ts
+++ b/src/app/editor/design-check/session.ts
@@ -1,7 +1,7 @@
import { useTimeoutFn } from '@vueuse/core'
import { computed, effectScope, ref, shallowRef, watch } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { isFigPagePending } from '@open-pencil/core/io/formats/fig'
import { createLinter, type LintConfig, type LintFixRequest } from '@open-pencil/core/lint'
diff --git a/src/app/editor/flash/create.ts b/src/app/editor/flash/create.ts
index c92bb00e2..1442b911a 100644
--- a/src/app/editor/flash/create.ts
+++ b/src/app/editor/flash/create.ts
@@ -1,4 +1,4 @@
-import type { Editor, EditorState } from '@open-pencil/core/editor'
+import type { Editor, EditorState } from '@open-pencil/core'
export function createFlashActions(editor: Editor, state: EditorState) {
let flashRafId = 0
diff --git a/src/app/editor/fonts/status.ts b/src/app/editor/fonts/status.ts
index c9ad11d49..27e961a37 100644
--- a/src/app/editor/fonts/status.ts
+++ b/src/app/editor/fonts/status.ts
@@ -2,7 +2,7 @@ import { computed, ref } from 'vue'
import { computeAllLayouts } from '@open-pencil/core/layout'
import { documentFontStatus, fontManager, fontResolver } from '@open-pencil/core/text'
-import { useEditorEvent } from '@open-pencil/vue'
+import { useEditorEvent } from '@open-pencil/vue/editor/events'
import { useEditorStore } from '@/app/editor/active-store'
import { loadFont, requestLocalFontAccess } from '@/app/editor/fonts'
diff --git a/src/app/editor/icon-picker/history.ts b/src/app/editor/icon-picker/history.ts
index 334d4c83c..b08ed8c31 100644
--- a/src/app/editor/icon-picker/history.ts
+++ b/src/app/editor/icon-picker/history.ts
@@ -2,7 +2,7 @@ import { useLocalStorage } from '@vueuse/core'
import { uniq } from 'es-toolkit'
import * as v from 'valibot'
-import { ICON_NAME } from '@open-pencil/scene-graph'
+import { ICON_NAME } from '@open-pencil/scene-graph/icons'
const MAX_RECENT_ICONS = 24
const RECENT_ICONS_STORAGE_KEY = 'open-pencil:recent-icons'
diff --git a/src/app/editor/mobile-clipboard/index.ts b/src/app/editor/mobile-clipboard/index.ts
index 82792ff32..5b6baae1e 100644
--- a/src/app/editor/mobile-clipboard/index.ts
+++ b/src/app/editor/mobile-clipboard/index.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import {
getInMemoryClipboardHTML,
diff --git a/src/app/editor/pages/palette.ts b/src/app/editor/pages/palette.ts
index cc1fc28fa..016512430 100644
--- a/src/app/editor/pages/palette.ts
+++ b/src/app/editor/pages/palette.ts
@@ -4,12 +4,12 @@ import IconFile from '~icons/lucide/file'
import IconFiles from '~icons/lucide/files'
import type { SceneNode } from '@open-pencil/scene-graph'
-import {
- isPageDivider,
- usePageMessages,
- type CommandPaletteGroup,
- type CommandPaletteItem
-} from '@open-pencil/vue'
+import { usePageMessages } from '@open-pencil/vue/i18n'
+import type {
+ CommandPaletteGroup,
+ CommandPaletteItem
+} from '@open-pencil/vue/primitives/CommandPalette'
+import { isPageDivider } from '@open-pencil/vue/primitives/PageList'
import type { EditorStore } from '@/app/editor/active-store'
import { presenceByPage, type PagePresenceEntry } from '@/app/presence/registry'
diff --git a/src/app/editor/pages/recent.ts b/src/app/editor/pages/recent.ts
index 7a3356fb1..68cb22e2e 100644
--- a/src/app/editor/pages/recent.ts
+++ b/src/app/editor/pages/recent.ts
@@ -1,7 +1,7 @@
import { take, uniq } from 'es-toolkit'
import { shallowRef, type ShallowRef } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
/** How many pages a tab remembers, including the current one. */
const MAX_RECENT_PAGES = 8
diff --git a/src/app/editor/panes/registry.ts b/src/app/editor/panes/registry.ts
index 795b42c84..98c336f1d 100644
--- a/src/app/editor/panes/registry.ts
+++ b/src/app/editor/panes/registry.ts
@@ -1,7 +1,6 @@
import { computed, ref, shallowRef, triggerRef } from 'vue'
-import type { EditorState } from '@open-pencil/core/editor'
-import { copyEditorViewState, pickEditorViewState } from '@open-pencil/core/editor'
+import { type EditorState, copyEditorViewState, pickEditorViewState } from '@open-pencil/core'
import {
closePaneNode,
diff --git a/src/app/editor/panes/state.ts b/src/app/editor/panes/state.ts
index d3da3d613..2f4efad38 100644
--- a/src/app/editor/panes/state.ts
+++ b/src/app/editor/panes/state.ts
@@ -1,7 +1,11 @@
import { shallowReactive } from 'vue'
-import type { EditorState, EditorViewState } from '@open-pencil/core/editor'
-import { copyEditorViewState, pickEditorViewState } from '@open-pencil/core/editor'
+import {
+ type EditorState,
+ type EditorViewState,
+ copyEditorViewState,
+ pickEditorViewState
+} from '@open-pencil/core'
export interface CanvasPaneState extends EditorViewState {
id: string
diff --git a/src/app/editor/pen/create.ts b/src/app/editor/pen/create.ts
index bf9687a94..0d4fe37a4 100644
--- a/src/app/editor/pen/create.ts
+++ b/src/app/editor/pen/create.ts
@@ -1,7 +1,8 @@
-import type { Editor, Tool } from '@open-pencil/core/editor'
-import { transformVectorNetwork, type VectorNetwork } from '@open-pencil/scene-graph'
+import type { Editor, Tool } from '@open-pencil/core'
+import type { VectorNetwork } from '@open-pencil/scene-graph'
import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import type { Vector } from '@open-pencil/scene-graph/primitives'
+import { transformVectorNetwork } from '@open-pencil/scene-graph/vector-network'
import {
chainEndingAt,
diff --git a/src/app/editor/pen/resume.ts b/src/app/editor/pen/resume.ts
index 81a1adaeb..5b7480102 100644
--- a/src/app/editor/pen/resume.ts
+++ b/src/app/editor/pen/resume.ts
@@ -1,12 +1,12 @@
-import type { EditorState, ResumedPath } from '@open-pencil/core/editor'
-import {
- cloneVectorNetwork,
- type SceneNode,
- type VectorNetwork,
- type VectorSegment,
- type VectorVertex
+import type { EditorState, ResumedPath } from '@open-pencil/core'
+import type {
+ SceneNode,
+ VectorNetwork,
+ VectorSegment,
+ VectorVertex
} from '@open-pencil/scene-graph'
import type { Vector } from '@open-pencil/scene-graph/primitives'
+import { cloneVectorNetwork } from '@open-pencil/scene-graph/vector-network'
export type PenState = EditorState
type PenStateInit = NonNullable<EditorState['penState']>
diff --git a/src/app/editor/profiler/index.ts b/src/app/editor/profiler/index.ts
index 1b7b41fb6..62cf97d47 100644
--- a/src/app/editor/profiler/index.ts
+++ b/src/app/editor/profiler/index.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
export function createProfilerActions(editor: Editor) {
function activeCanvas() {
diff --git a/src/app/editor/session/create.ts b/src/app/editor/session/create.ts
index 534fa3f5a..f62ca28d3 100644
--- a/src/app/editor/session/create.ts
+++ b/src/app/editor/session/create.ts
@@ -1,9 +1,9 @@
import { shallowReactive } from 'vue'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { BUILTIN_IO_FORMATS, IORegistry } from '@open-pencil/core/io'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { createShaderRasterizer } from '@open-pencil/vue'
+import { createShaderRasterizer } from '@open-pencil/vue/canvas/surface'
import { useCollabIdentity } from '@/app/collab/identity'
import { recordPreparationOutcome } from '@/app/diagnostics'
@@ -36,8 +36,8 @@ import { createDeferred } from '@/app/runtime/deferred'
import { toast } from '@/app/shell/ui'
import { IS_BROWSER, IS_TAURI } from '@/constants'
-export { EDITOR_TOOLS as TOOLS, TOOL_SHORTCUTS } from '@open-pencil/core/editor'
-export type { EditorToolDef as ToolDef, Tool } from '@open-pencil/core/editor'
+export { EDITOR_TOOLS as TOOLS, TOOL_SHORTCUTS } from '@open-pencil/core'
+export type { EditorToolDef as ToolDef, Tool } from '@open-pencil/core'
function buildEditorStore(initialGraph?: SceneGraph) {
const graph = initialGraph ?? new SceneGraph()
diff --git a/src/app/editor/session/modules.ts b/src/app/editor/session/modules.ts
index d442e6efc..9f0d11359 100644
--- a/src/app/editor/session/modules.ts
+++ b/src/app/editor/session/modules.ts
@@ -1,8 +1,8 @@
import { computed } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { IORegistry } from '@open-pencil/core/io'
-import { createSelectedNodeState } from '@open-pencil/vue'
+import { createSelectedNodeState } from '@open-pencil/vue/editor/selection-state'
import { createDocumentExportActions } from '@/app/document/export'
import { createDocumentIOActions } from '@/app/document/io'
diff --git a/src/app/editor/session/types.ts b/src/app/editor/session/types.ts
index b668cc6a3..1bf0d26ca 100644
--- a/src/app/editor/session/types.ts
+++ b/src/app/editor/session/types.ts
@@ -1,6 +1,6 @@
-import { createDefaultEditorState, type EditorState } from '@open-pencil/core/editor'
+import { createDefaultEditorState, type EditorState } from '@open-pencil/core'
import type { DocumentColorSpace } from '@open-pencil/scene-graph'
-import type { PresentationColorSpace } from '@open-pencil/vue'
+import type { PresentationColorSpace } from '@open-pencil/vue/canvas/surface'
import type { EditorPreparation } from '@/app/editor/preparation/types'
import type { NodeEditState } from '@/app/editor/vector/types'
diff --git a/src/app/editor/statuses/selection.ts b/src/app/editor/statuses/selection.ts
index 98c2c4a2a..9f6f6db6e 100644
--- a/src/app/editor/statuses/selection.ts
+++ b/src/app/editor/statuses/selection.ts
@@ -1,12 +1,12 @@
import { computed } from 'vue'
+import type { SceneNode } from '@open-pencil/scene-graph'
import {
STATUS_NODE_TYPES,
statusPlacement,
- type SceneNode,
type StatusState
-} from '@open-pencil/scene-graph'
-import { useSceneComputed } from '@open-pencil/vue'
+} from '@open-pencil/scene-graph/statuses'
+import { useSceneComputed } from '@open-pencil/vue/internal/scene-computed'
import { useEditorStore } from '@/app/editor/active-store'
diff --git a/src/app/editor/statuses/workflow.ts b/src/app/editor/statuses/workflow.ts
index 15959fd47..d45625d33 100644
--- a/src/app/editor/statuses/workflow.ts
+++ b/src/app/editor/statuses/workflow.ts
@@ -1,17 +1,17 @@
import { isEqual } from 'es-toolkit'
import { computed, shallowRef, watch } from 'vue'
+import { parseColor } from '@open-pencil/scene-graph/color'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import { randomHex } from '@open-pencil/scene-graph/random'
import {
STATUS_WORKFLOW_PRESETS,
statusWorkflowImpact,
type StatusState,
type StatusWorkflow,
type StatusWorkflowPreset
-} from '@open-pencil/scene-graph'
-import { parseColor } from '@open-pencil/scene-graph/color'
-import type { Color } from '@open-pencil/scene-graph/primitives'
-import { randomHex } from '@open-pencil/scene-graph/random'
-import { useSceneComputed } from '@open-pencil/vue'
+} from '@open-pencil/scene-graph/statuses'
+import { useSceneComputed } from '@open-pencil/vue/internal/scene-computed'
import { useEditorStore } from '@/app/editor/active-store'
diff --git a/src/app/editor/tokens/model.ts b/src/app/editor/tokens/model.ts
index 6ce234fa4..d2eaf83d2 100644
--- a/src/app/editor/tokens/model.ts
+++ b/src/app/editor/tokens/model.ts
@@ -8,22 +8,24 @@ import {
variableCSSNames,
variableUnit
} from '@open-pencil/dom-css/export'
+import type {
+ SceneGraph,
+ Variable,
+ VariableCollection,
+ VariableColorExpression,
+ VariableValue,
+ VariableFormula,
+ VariableLiteral
+} from '@open-pencil/scene-graph'
+import { colorToHex } from '@open-pencil/scene-graph/color'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import {
tokenNumberFromUnit,
tokenNumberInUnit,
variableValueReferences,
- printFormula,
- type Color,
- type SceneGraph,
- type Variable,
- type VariableCollection,
- type VariableColorExpression,
- type VariableFormula,
- type VariableLiteral,
- type VariableValue
-} from '@open-pencil/scene-graph'
-import { colorToHex } from '@open-pencil/scene-graph/color'
-import { fuzzyFilter } from '@open-pencil/vue'
+ printFormula
+} from '@open-pencil/scene-graph/variables'
+import { fuzzyFilter } from '@open-pencil/vue/shared/search'
/** One mode's value as the stylesheet writes it, with what the panel previews beside it. */
export interface TokenModeValue {
diff --git a/src/app/editor/toolbar/layout.ts b/src/app/editor/toolbar/layout.ts
index 763a7b6e0..ad5103015 100644
--- a/src/app/editor/toolbar/layout.ts
+++ b/src/app/editor/toolbar/layout.ts
@@ -1,11 +1,6 @@
import { uniq } from 'es-toolkit'
-import {
- EDITOR_TOOLS,
- READ_ONLY_TOOLS,
- type EditorToolDef,
- type Tool
-} from '@open-pencil/core/editor'
+import { EDITOR_TOOLS, READ_ONLY_TOOLS, type EditorToolDef, type Tool } from '@open-pencil/core'
/** Toolbar buttons that run a command instead of switching the tool. */
export const TOOLBAR_ACTIONS = ['insert-icon'] as const
diff --git a/src/app/editor/toolbar/shortcuts.ts b/src/app/editor/toolbar/shortcuts.ts
index fb55fa3d3..cea2b2ad2 100644
--- a/src/app/editor/toolbar/shortcuts.ts
+++ b/src/app/editor/toolbar/shortcuts.ts
@@ -1,7 +1,7 @@
import { mapValues } from 'es-toolkit/object'
-import type { Tool } from '@open-pencil/core/editor'
-import { formatShortcut, type ShortcutPlatform } from '@open-pencil/vue'
+import type { Tool } from '@open-pencil/core'
+import { formatShortcut, type ShortcutPlatform } from '@open-pencil/vue/editor/commands'
/** Each tool's key in the command registry's notation; empty for tools without one. */
const TOOL_SHORTCUT_KEYS: Readonly<Record<Tool, string>> = {
diff --git a/src/app/editor/vector/create.ts b/src/app/editor/vector/create.ts
index a969edb09..5ee330802 100644
--- a/src/app/editor/vector/create.ts
+++ b/src/app/editor/vector/create.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { createVectorEditHandleActions } from './handle-actions'
import { createVectorEditHistoryActions } from './history'
diff --git a/src/app/editor/vector/handle-actions.ts b/src/app/editor/vector/handle-actions.ts
index ba5c63a20..0ca1eaa1e 100644
--- a/src/app/editor/vector/handle-actions.ts
+++ b/src/app/editor/vector/handle-actions.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { findAllHandles, findOppositeHandle, mirrorHandle } from '@open-pencil/core/vector'
import type { Vector } from '@open-pencil/scene-graph/primitives'
diff --git a/src/app/editor/vector/history.ts b/src/app/editor/vector/history.ts
index a2b080507..6f0da19bd 100644
--- a/src/app/editor/vector/history.ts
+++ b/src/app/editor/vector/history.ts
@@ -1,6 +1,6 @@
-import type { Editor } from '@open-pencil/core/editor'
-import { cloneVectorNetwork, vectorNetworksEqual } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
import type { VectorNetwork } from '@open-pencil/scene-graph'
+import { cloneVectorNetwork, vectorNetworksEqual } from '@open-pencil/scene-graph/vector-network'
import type { NodeEditState, VectorEditState } from './types'
diff --git a/src/app/editor/vector/lifecycle.ts b/src/app/editor/vector/lifecycle.ts
index 5f23dbc77..3578a004e 100644
--- a/src/app/editor/vector/lifecycle.ts
+++ b/src/app/editor/vector/lifecycle.ts
@@ -1,12 +1,12 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { vectorChangesFromPagePath } from '@open-pencil/core/vector'
+import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
+import { slotScope } from '@open-pencil/scene-graph/slots'
import {
cloneVectorNetwork,
- slotScope,
transformVectorNetwork,
vectorNetworksEqual
-} from '@open-pencil/scene-graph'
-import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
+} from '@open-pencil/scene-graph/vector-network'
import { getLiveNetwork } from './network'
import type { VectorEditState } from './types'
diff --git a/src/app/editor/vector/network.ts b/src/app/editor/vector/network.ts
index 72b13dec2..afdb8a319 100644
--- a/src/app/editor/vector/network.ts
+++ b/src/app/editor/vector/network.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { nearestPointOnNetwork, removeVertex, splitSegmentAt } from '@open-pencil/core/vector'
import type { VectorNetwork } from '@open-pencil/scene-graph'
diff --git a/src/app/editor/vector/selection.ts b/src/app/editor/vector/selection.ts
index aad38e673..65ab1d063 100644
--- a/src/app/editor/vector/selection.ts
+++ b/src/app/editor/vector/selection.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { breakAtVertex, deleteVectorParts, vectorHandleParts } from '@open-pencil/core/vector'
import { pushNodeEditHistory } from './history'
diff --git a/src/app/editor/vector/types.ts b/src/app/editor/vector/types.ts
index d21ee0119..25af2e007 100644
--- a/src/app/editor/vector/types.ts
+++ b/src/app/editor/vector/types.ts
@@ -1,4 +1,4 @@
-import type { EditorState } from '@open-pencil/core/editor'
+import type { EditorState } from '@open-pencil/core'
import type {
VectorNetwork,
VectorRegion,
diff --git a/src/app/i18n/date.ts b/src/app/i18n/date.ts
index dd91e7de9..f670a5a77 100644
--- a/src/app/i18n/date.ts
+++ b/src/app/i18n/date.ts
@@ -1,6 +1,6 @@
import { createSharedComposable, useNow } from '@vueuse/core'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
/** How each kind of date in the interface reads, shown here in English. */
const DATE_FORMATS = {
diff --git a/src/app/i18n/notifications/index.ts b/src/app/i18n/notifications/index.ts
index e0f2cd24f..baabd7232 100644
--- a/src/app/i18n/notifications/index.ts
+++ b/src/app/i18n/notifications/index.ts
@@ -2,7 +2,7 @@ import { createI18n, params } from '@nanostores/i18n'
import type { ComponentsJSON } from '@nanostores/i18n'
import { useStore } from '@nanostores/vue'
-import { locale, type Locale, type TranslatedLocale } from '@open-pencil/vue'
+import { locale, type Locale, type TranslatedLocale } from '@open-pencil/vue/i18n'
export const notificationMessageDefaults = {
chatInitializationFailed: params('Could not initialize chat: {error}'),
diff --git a/src/app/i18n/number.ts b/src/app/i18n/number.ts
index 5b068bd81..4d3cde36a 100644
--- a/src/app/i18n/number.ts
+++ b/src/app/i18n/number.ts
@@ -1,4 +1,4 @@
-import { locale } from '@open-pencil/vue'
+import { locale } from '@open-pencil/vue/i18n'
const numberFormats = new Map<string, Intl.NumberFormat>()
diff --git a/src/app/libraries/service.ts b/src/app/libraries/service.ts
index 924f0a642..b3e4e8359 100644
--- a/src/app/libraries/service.ts
+++ b/src/app/libraries/service.ts
@@ -1,6 +1,6 @@
import { markRaw, shallowRef } from 'vue'
-import { reapplyInstanceComponentProperties } from '@open-pencil/core/editor'
+import { reapplyInstanceComponentProperties } from '@open-pencil/core'
import {
materializeLibraryAsset,
ensureLibraryAssetKeys,
@@ -12,16 +12,14 @@ import {
createSelectiveLibraryRevision,
discoverPublishableLibraryChanges,
readSourceLibraryPublication,
- writeSourceLibraryPublication
-} from '@open-pencil/core/library'
-import type {
- ComponentLibraryRevision,
- LibraryCatalog,
- LibrarySummary,
- LibraryUpdateImpact,
- LibraryUpdateSummary,
- PublishLibraryInput,
- LibraryAssetChange
+ writeSourceLibraryPublication,
+ type ComponentLibraryRevision,
+ type LibraryCatalog,
+ type LibrarySummary,
+ type LibraryUpdateImpact,
+ type LibraryUpdateSummary,
+ type PublishLibraryInput,
+ type LibraryAssetChange
} from '@open-pencil/core/library'
import type {
ComponentCatalog,
diff --git a/src/app/presence/registry.ts b/src/app/presence/registry.ts
index 3c520be09..5663a4098 100644
--- a/src/app/presence/registry.ts
+++ b/src/app/presence/registry.ts
@@ -1,7 +1,7 @@
import { shallowRef, type ShallowRef } from 'vue'
import { AI_ACTIVE_COLOR } from '@open-pencil/core/constants'
-import { computeContentBounds } from '@open-pencil/core/io'
+import { computeContentBounds } from '@open-pencil/core/io/formats/raster'
import type { Color } from '@open-pencil/scene-graph/primitives'
import { randomHex } from '@open-pencil/scene-graph/random'
diff --git a/src/app/settings/automation.ts b/src/app/settings/automation.ts
index 15425d381..593973d57 100644
--- a/src/app/settings/automation.ts
+++ b/src/app/settings/automation.ts
@@ -2,7 +2,7 @@ import { isEmptyObject } from 'es-toolkit'
import * as v from 'valibot'
import { allRules } from '@open-pencil/core/lint'
-import { AVAILABLE_LOCALES, locale, setLocale, type Locale } from '@open-pencil/vue'
+import { AVAILABLE_LOCALES, locale, setLocale, type Locale } from '@open-pencil/vue/i18n'
import { agentStepLimitSchema } from '@/app/ai/reply/step-limit'
import { applySnappingPreferences, setDesignIssuesOnCanvas } from '@/app/settings/preferences/apply'
diff --git a/src/app/settings/preferences/apply.ts b/src/app/settings/preferences/apply.ts
index 699fe733f..34c88f594 100644
--- a/src/app/settings/preferences/apply.ts
+++ b/src/app/settings/preferences/apply.ts
@@ -1,4 +1,4 @@
-import type { SnappingPreferences } from '@open-pencil/core/editor'
+import type { SnappingPreferences } from '@open-pencil/core'
import { getTabsSnapshot } from '@/app/tabs'
diff --git a/src/app/settings/preferences/native-menu.ts b/src/app/settings/preferences/native-menu.ts
index 05b77e670..c3fecc90b 100644
--- a/src/app/settings/preferences/native-menu.ts
+++ b/src/app/settings/preferences/native-menu.ts
@@ -1,4 +1,4 @@
-import type { SnappingPreferences } from '@open-pencil/core/editor'
+import type { SnappingPreferences } from '@open-pencil/core'
import { isTauri } from '@/app/tauri/env'
diff --git a/src/app/settings/preferences/store.ts b/src/app/settings/preferences/store.ts
index 67b07a31e..928854d78 100644
--- a/src/app/settings/preferences/store.ts
+++ b/src/app/settings/preferences/store.ts
@@ -2,8 +2,8 @@ import { useLocalStorage } from '@vueuse/core'
import { uniq } from 'es-toolkit'
import * as v from 'valibot'
-import { DEFAULT_SNAPPING_PREFERENCES, type SnappingPreferences } from '@open-pencil/core/editor'
-import { COMMENT_SORTS, type CommentSort } from '@open-pencil/scene-graph'
+import { DEFAULT_SNAPPING_PREFERENCES, type SnappingPreferences } from '@open-pencil/core'
+import { COMMENT_SORTS, type CommentSort } from '@open-pencil/scene-graph/comments'
import { DEFAULT_AGENT_STEPS, resolveAgentStepLimit } from '@/app/ai/reply/step-limit'
import {
diff --git a/src/app/shell/commands/focused.ts b/src/app/shell/commands/focused.ts
index bcbd27e86..8007fd159 100644
--- a/src/app/shell/commands/focused.ts
+++ b/src/app/shell/commands/focused.ts
@@ -1,5 +1,5 @@
-import { isCanvasTextInput } from '@open-pencil/vue'
-import type { EditorCommandId } from '@open-pencil/vue'
+import { isCanvasTextInput } from '@open-pencil/vue/canvas/text-edit'
+import type { EditorCommandId } from '@open-pencil/vue/editor/commands'
import type { EditorStore } from '@/app/editor/active-store'
import { isInputElement } from '@/app/shell/keyboard/focus'
diff --git a/src/app/shell/document-drop.ts b/src/app/shell/document-drop.ts
index a6d5be3cc..bf59a98c6 100644
--- a/src/app/shell/document-drop.ts
+++ b/src/app/shell/document-drop.ts
@@ -1,6 +1,6 @@
import { useEventListener } from '@vueuse/core'
-import { filterCanvasFiles } from '@open-pencil/vue'
+import { filterCanvasFiles } from '@open-pencil/vue/canvas/drop'
import { getActiveEditorStoreOrNull } from '@/app/editor/active-store'
import { isDesignTokenFileName } from '@/app/editor/tokens/design-tokens'
diff --git a/src/app/shell/keyboard/actions.ts b/src/app/shell/keyboard/actions.ts
index 2736c500a..18e13c637 100644
--- a/src/app/shell/keyboard/actions.ts
+++ b/src/app/shell/keyboard/actions.ts
@@ -1,8 +1,9 @@
import type { Ref } from 'vue'
-import { opacityFromBuffer } from '@open-pencil/core/editor'
-import { generatedFrameText } from '@open-pencil/scene-graph'
-import type { useEditorCommands, useViewportKind } from '@open-pencil/vue'
+import { opacityFromBuffer } from '@open-pencil/core'
+import { generatedFrameText } from '@open-pencil/scene-graph/generated'
+import type { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import type { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
import type { PropertiesTab } from '@/app/ai/chat/use'
import { useComments } from '@/app/comments/use'
diff --git a/src/app/shell/keyboard/clipboard.ts b/src/app/shell/keyboard/clipboard.ts
index f1c622145..37fbd7005 100644
--- a/src/app/shell/keyboard/clipboard.ts
+++ b/src/app/shell/keyboard/clipboard.ts
@@ -1,7 +1,7 @@
import { useEventListener } from '@vueuse/core'
-import { isSVGMarkup } from '@open-pencil/core/io'
-import { extractImageFilesFromClipboard } from '@open-pencil/vue'
+import { isSVGMarkup } from '@open-pencil/core/io/formats/svg'
+import { extractImageFilesFromClipboard } from '@open-pencil/vue/canvas/drop'
import type { EditorStore } from '@/app/editor/active-store'
import { isDesignClipboardHTML } from '@/app/editor/clipboard/html'
diff --git a/src/app/shell/keyboard/document.ts b/src/app/shell/keyboard/document.ts
index 9c62d92c9..c788d14fe 100644
--- a/src/app/shell/keyboard/document.ts
+++ b/src/app/shell/keyboard/document.ts
@@ -1,6 +1,10 @@
import { createKeybindingsHandler, type KeyBindingMap } from 'tinykeys'
-import { editorCommandMetadata, useEditorCommands, type EditorCommandId } from '@open-pencil/vue'
+import {
+ editorCommandMetadata,
+ useEditorCommands,
+ type EditorCommandId
+} from '@open-pencil/vue/editor/commands'
import { isEditing } from '@/app/shell/keyboard/focus'
import { shortcutEvent } from '@/app/shell/keyboard/layout'
diff --git a/src/app/shell/keyboard/registry.ts b/src/app/shell/keyboard/registry.ts
index 8bf6086b0..f767f9c82 100644
--- a/src/app/shell/keyboard/registry.ts
+++ b/src/app/shell/keyboard/registry.ts
@@ -2,8 +2,7 @@ import { useEventListener } from '@vueuse/core'
import { createKeybindingsHandler } from 'tinykeys'
import type { KeyBindingMap } from 'tinykeys'
-import { editorCommandMetadata } from '@open-pencil/vue'
-import type { EditorCommandId } from '@open-pencil/vue'
+import { editorCommandMetadata, type EditorCommandId } from '@open-pencil/vue/editor/commands'
import { isCloudBinding, openVersionDialog } from '@/app/cloud/integration'
import { useComments } from '@/app/comments/use'
diff --git a/src/app/shell/keyboard/types.ts b/src/app/shell/keyboard/types.ts
index 059874fb2..c8a73c0b0 100644
--- a/src/app/shell/keyboard/types.ts
+++ b/src/app/shell/keyboard/types.ts
@@ -1,6 +1,6 @@
import type { ComputedRef } from 'vue'
-import type { useEditorCommands } from '@open-pencil/vue'
+import type { useEditorCommands } from '@open-pencil/vue/editor/commands'
import type { EditorStore } from '@/app/editor/active-store'
diff --git a/src/app/shell/keyboard/use.ts b/src/app/shell/keyboard/use.ts
index cee60121d..6ee41bf5f 100644
--- a/src/app/shell/keyboard/use.ts
+++ b/src/app/shell/keyboard/use.ts
@@ -1,7 +1,8 @@
import { useActiveElement } from '@vueuse/core'
import { computed } from 'vue'
-import { useEditorCommands, useViewportKind } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
import { useAIChat } from '@/app/ai/chat/use'
import { useEditorStore } from '@/app/editor/active-store'
diff --git a/src/app/shell/menu/app-menu.ts b/src/app/shell/menu/app-menu.ts
index c7e31cc12..fa2c338fc 100644
--- a/src/app/shell/menu/app-menu.ts
+++ b/src/app/shell/menu/app-menu.ts
@@ -17,8 +17,13 @@ import IconZoomIn from '~icons/lucide/zoom-in'
import IconZoomOut from '~icons/lucide/zoom-out'
import type { BuiltinIOFormatId } from '@open-pencil/core/io'
-import type { CommandPaletteGroup, CommandPaletteItem, MenuEntry } from '@open-pencil/vue'
-import { shortcutPlatform, useEditorCommands, useI18n } from '@open-pencil/vue'
+import { shortcutPlatform, useEditorCommands } from '@open-pencil/vue/editor/commands'
+import type { MenuEntry } from '@open-pencil/vue/editor/menu-model'
+import { useI18n } from '@open-pencil/vue/i18n'
+import type {
+ CommandPaletteGroup,
+ CommandPaletteItem
+} from '@open-pencil/vue/primitives/CommandPalette'
import { openTour } from '@/app/demo/document'
import { useEditorStore } from '@/app/editor/active-store'
diff --git a/src/app/shell/menu/document-name.ts b/src/app/shell/menu/document-name.ts
index 9cd73239f..7e161250b 100644
--- a/src/app/shell/menu/document-name.ts
+++ b/src/app/shell/menu/document-name.ts
@@ -1,6 +1,6 @@
import { computed } from 'vue'
-import { useInlineRename } from '@open-pencil/vue'
+import { useInlineRename } from '@open-pencil/vue/editor/inline-rename'
import type { EditorStore } from '@/app/editor/active-store'
diff --git a/src/app/shell/menu/editor.ts b/src/app/shell/menu/editor.ts
index ccd1fb4c1..75fd19e2e 100644
--- a/src/app/shell/menu/editor.ts
+++ b/src/app/shell/menu/editor.ts
@@ -1,5 +1,4 @@
-import { useEditorCommands } from '@open-pencil/vue'
-import type { EditorCommandId } from '@open-pencil/vue'
+import { useEditorCommands, type EditorCommandId } from '@open-pencil/vue/editor/commands'
import { useEditorStore } from '@/app/editor/active-store'
import { clearRecentFiles, forgetRecentFile, recentLocalFileAt } from '@/app/recent-files'
diff --git a/src/app/shell/menu/entry.ts b/src/app/shell/menu/entry.ts
index d59ebc070..8d79577af 100644
--- a/src/app/shell/menu/entry.ts
+++ b/src/app/shell/menu/entry.ts
@@ -1,4 +1,4 @@
-import type { MenuActionNode, MenuEntry } from '@open-pencil/vue'
+import type { MenuActionNode, MenuEntry } from '@open-pencil/vue/editor/menu-model'
export function isMenuSeparator(entry: MenuEntry) {
return 'separator' in entry && entry.separator
diff --git a/src/app/shell/menu/schema.ts b/src/app/shell/menu/schema.ts
index 135a9e83e..10af51fbb 100644
--- a/src/app/shell/menu/schema.ts
+++ b/src/app/shell/menu/schema.ts
@@ -1,4 +1,4 @@
-import type { EditorCommandId } from '@open-pencil/vue'
+import type { EditorCommandId } from '@open-pencil/vue/editor/commands'
export type AppMenuTarget = 'all' | 'browser' | 'native'
diff --git a/src/app/shell/menu/shell.ts b/src/app/shell/menu/shell.ts
index 443bae164..d8ea12dee 100644
--- a/src/app/shell/menu/shell.ts
+++ b/src/app/shell/menu/shell.ts
@@ -1,4 +1,4 @@
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { openTour } from '@/app/demo/document'
import { requestAppExit } from '@/app/document/close/exit'
diff --git a/src/app/shell/menu/shortcut.ts b/src/app/shell/menu/shortcut.ts
index d06a196dc..eacc11cf4 100644
--- a/src/app/shell/menu/shortcut.ts
+++ b/src/app/shell/menu/shortcut.ts
@@ -1,4 +1,4 @@
-import { editorCommandMetadata, formatShortcut } from '@open-pencil/vue'
+import { editorCommandMetadata, formatShortcut } from '@open-pencil/vue/editor/commands'
import type { AppMenuActionItem, AppMenuEntry } from '@/app/shell/menu/schema'
import { APP_MENU_SCHEMA } from '@/app/shell/menu/schema'
diff --git a/src/app/shell/share/link.ts b/src/app/shell/share/link.ts
index 4535fdee8..bdeb14406 100644
--- a/src/app/shell/share/link.ts
+++ b/src/app/shell/share/link.ts
@@ -1,7 +1,7 @@
import { useClipboard, useShare } from '@vueuse/core'
import { computed } from 'vue'
-import { useViewportKind } from '@open-pencil/vue'
+import { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
/** How a link went out: through the system share sheet, onto the clipboard, or not at all. */
export type SentLink = 'shared' | 'copied' | 'cancelled'
diff --git a/src/app/shell/ui.ts b/src/app/shell/ui.ts
index 19491ad3b..574568d97 100644
--- a/src/app/shell/ui.ts
+++ b/src/app/shell/ui.ts
@@ -1,7 +1,7 @@
import { useEventListener } from '@vueuse/core'
import { ref } from 'vue'
-import { ReadOnlyDocumentError } from '@open-pencil/core/editor'
+import { ReadOnlyDocumentError } from '@open-pencil/core'
import { recordRuntimeError } from '@/app/diagnostics'
import { isTauri } from '@/app/tauri/env'
diff --git a/src/app/shell/updater/messages.ts b/src/app/shell/updater/messages.ts
index 2599e37d8..c9dbd593b 100644
--- a/src/app/shell/updater/messages.ts
+++ b/src/app/shell/updater/messages.ts
@@ -1,4 +1,4 @@
-import type { useI18n } from '@open-pencil/vue'
+import type { useI18n } from '@open-pencil/vue/i18n'
export type UpdaterMessages = ReturnType<typeof useI18n>['updates']['value']
diff --git a/src/app/telemetry/consent.ts b/src/app/telemetry/consent.ts
index ef4359f3d..828165d9a 100644
--- a/src/app/telemetry/consent.ts
+++ b/src/app/telemetry/consent.ts
@@ -2,7 +2,7 @@ import { computed, ref } from 'vue'
import type { ConsentSource } from '@open-pencil/feedback/contract'
import { randomHex } from '@open-pencil/scene-graph/random'
-import { locale } from '@open-pencil/vue'
+import { locale } from '@open-pencil/vue/i18n'
import { appPreferences, updateSharingPreferences } from '@/app/settings/preferences/store'
diff --git a/src/app/telemetry/index.ts b/src/app/telemetry/index.ts
index 75d3e900a..8a693e066 100644
--- a/src/app/telemetry/index.ts
+++ b/src/app/telemetry/index.ts
@@ -1,6 +1,6 @@
import { useEventListener, useIntervalFn } from '@vueuse/core'
-import { locale } from '@open-pencil/vue'
+import { locale } from '@open-pencil/vue/i18n'
import { resolveUsageStatsQuestion } from './consent'
import { sharingClient } from './instance'
diff --git a/src/boot.ts b/src/boot.ts
index 1dc1a356a..fa3108907 100644
--- a/src/boot.ts
+++ b/src/boot.ts
@@ -1,8 +1,8 @@
import { createHead } from '@unhead/vue/client'
import { createApp, nextTick } from 'vue'
-import { ReadOnlyDocumentError } from '@open-pencil/core/editor'
-import { createRetainedScopePlugin } from '@open-pencil/vue'
+import { ReadOnlyDocumentError } from '@open-pencil/core'
+import { createRetainedScopePlugin } from '@open-pencil/vue/lifecycle/retention'
import './app.css'
import { recordRuntimeError } from '@/app/diagnostics'
diff --git a/src/components/ChatPanel.vue b/src/components/ChatPanel.vue
index ff0cf04e2..a456bed37 100644
--- a/src/components/ChatPanel.vue
+++ b/src/components/ChatPanel.vue
@@ -3,7 +3,7 @@ import type { Chat } from '@ai-sdk/vue'
import type { UIMessage } from 'ai'
import { computed, shallowRef, useTemplateRef, watch } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { revokeImagePreviewURL } from '@/app/ai/attachment/image/prepare'
import { chatDocumentId } from '@/app/ai/chat/history/document'
diff --git a/src/components/CodePanel.vue b/src/components/CodePanel.vue
index 4e002467b..e176d48ed 100644
--- a/src/components/CodePanel.vue
+++ b/src/components/CodePanel.vue
@@ -14,7 +14,8 @@ import {
import { JSX_REFERENCE } from '@open-pencil/design-jsx'
import type { SceneNode } from '@open-pencil/scene-graph'
-import { useEditorEvent, useI18n } from '@open-pencil/vue'
+import { useEditorEvent } from '@open-pencil/vue/editor/events'
+import { useI18n } from '@open-pencil/vue/i18n'
import {
commitDOMCodeSession,
diff --git a/src/components/ColorPicker/ColorInput.vue b/src/components/ColorPicker/ColorInput.vue
index b55ced3bd..a3948a854 100644
--- a/src/components/ColorPicker/ColorInput.vue
+++ b/src/components/ColorPicker/ColorInput.vue
@@ -2,8 +2,9 @@
import { useAttrs } from 'vue'
import type { Color } from '@open-pencil/scene-graph/primitives'
-import { ColorInputRoot, inputValue } from '@open-pencil/vue'
-import type { OkHCLControls } from '@open-pencil/vue'
+import type { OkHCLControls } from '@open-pencil/vue/controls/color-model'
+import { ColorInputRoot } from '@open-pencil/vue/primitives/ColorPicker'
+import { inputValue } from '@open-pencil/vue/shared/dom-events'
import ColorPicker from '@/components/ColorPicker/ColorPicker.vue'
diff --git a/src/components/ColorPicker/ColorPicker.vue b/src/components/ColorPicker/ColorPicker.vue
index 92b0b57a0..1677d8273 100644
--- a/src/components/ColorPicker/ColorPicker.vue
+++ b/src/components/ColorPicker/ColorPicker.vue
@@ -2,8 +2,9 @@
import type { VNode } from 'vue'
import type { Color } from '@open-pencil/scene-graph/primitives'
-import { ColorPickerRoot, useI18n } from '@open-pencil/vue'
-import type { OkHCLControls } from '@open-pencil/vue'
+import type { OkHCLControls } from '@open-pencil/vue/controls/color-model'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { ColorPickerRoot } from '@open-pencil/vue/primitives/ColorPicker'
import ColorPickerPanel from '@/components/color-picker-panel/ColorPickerPanel.vue'
import { usePopoverUI } from '@/components/ui/overlay/popover'
diff --git a/src/components/DesignPanel.vue b/src/components/DesignPanel.vue
index 18cd4695a..6841e8ed7 100644
--- a/src/components/DesignPanel.vue
+++ b/src/components/DesignPanel.vue
@@ -1,9 +1,13 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { getNodeEditCapability } from '@open-pencil/core/editor'
-import { layerResizes, layerStrokesAndEffects, readIcon } from '@open-pencil/scene-graph'
-import { useI18n, useSceneComputed, useSelectionState, useEditorCommands } from '@open-pencil/vue'
+import { getNodeEditCapability } from '@open-pencil/core'
+import { layerResizes, layerStrokesAndEffects } from '@open-pencil/scene-graph/generated'
+import { readIcon } from '@open-pencil/scene-graph/icons'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useSceneComputed } from '@open-pencil/vue/internal/scene-computed'
import { useEditorStore } from '@/app/editor/active-store'
import { openVariablesDialog } from '@/app/editor/tokens/dialog'
diff --git a/src/components/EditorCanvas.vue b/src/components/EditorCanvas.vue
index 2b70e32bd..c3238e0e4 100644
--- a/src/components/EditorCanvas.vue
+++ b/src/components/EditorCanvas.vue
@@ -25,19 +25,15 @@ import {
SECTION_TITLE_HEIGHT
} from '@open-pencil/core/constants'
import type { ViewportTransform } from '@open-pencil/core/geometry'
-import {
- autoLayoutValueAnchor,
- PlayIslands,
- toolCursor,
- useCanvas,
- useCanvasDrop,
- useCanvasInput,
- useCanvasIssueMarkers,
- useCanvasStatusLabels,
- useCanvasVirtualReference,
- useTextEdit,
- type AutoLayoutValueField
-} from '@open-pencil/vue'
+import { PlayIslands, useCanvasInput } from '@open-pencil/vue/canvas'
+import { useCanvasDrop } from '@open-pencil/vue/canvas/drop'
+import { useCanvasIssueMarkers } from '@open-pencil/vue/canvas/issues'
+import { useCanvasVirtualReference } from '@open-pencil/vue/canvas/overlays'
+import { useCanvasStatusLabels } from '@open-pencil/vue/canvas/statuses'
+import { useCanvas } from '@open-pencil/vue/canvas/surface'
+import { useTextEdit } from '@open-pencil/vue/canvas/text-edit'
+import { toolCursor } from '@open-pencil/vue/editor/tool-cursor'
+import { autoLayoutValueAnchor, type AutoLayoutValueField } from '@open-pencil/vue/shared/input'
import { useAIChat } from '@/app/ai/chat/use'
import { useEditorStore } from '@/app/editor/active-store'
diff --git a/src/components/FileApiBanner.vue b/src/components/FileApiBanner.vue
index bd8694453..d4ff143f7 100644
--- a/src/components/FileApiBanner.vue
+++ b/src/components/FileApiBanner.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { supportsFileSystemAccess } from '@/app/document/io/capability'
import ExternalLink from '@/components/links/ExternalLink.vue'
diff --git a/src/components/LayerTree/LayerTree.vue b/src/components/LayerTree/LayerTree.vue
index 3b219988f..9dc60f159 100644
--- a/src/components/LayerTree/LayerTree.vue
+++ b/src/components/LayerTree/LayerTree.vue
@@ -10,14 +10,17 @@ import {
import { tv } from 'tailwind-variants'
import { computed, nextTick, useAttrs, useTemplateRef, watch } from 'vue'
-import { LayerTreeRoot, LayerTreeItem, stickyTopLevelRow, useInlineRename } from '@open-pencil/vue'
-import type {
- LayerDragInstruction,
- LayerNode,
- LayerRow,
- LayerSelectionMode,
- LayerTreeVirtualizer
-} from '@open-pencil/vue'
+import { useInlineRename } from '@open-pencil/vue/editor/inline-rename'
+import {
+ LayerTreeRoot,
+ LayerTreeItem,
+ stickyTopLevelRow,
+ type LayerDragInstruction,
+ type LayerNode,
+ type LayerRow,
+ type LayerSelectionMode,
+ type LayerTreeVirtualizer
+} from '@open-pencil/vue/primitives/LayerTree'
import { useEditorStore } from '@/app/editor/active-store'
import { layerIssueMarks } from '@/app/editor/design-check/layers'
diff --git a/src/components/LayerTree/LayerTreeActions.vue b/src/components/LayerTree/LayerTreeActions.vue
index 700696e72..0cb8cfe86 100644
--- a/src/components/LayerTree/LayerTreeActions.vue
+++ b/src/components/LayerTree/LayerTreeActions.vue
@@ -1,6 +1,6 @@
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
-import type { LayerNode } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import type { LayerNode } from '@open-pencil/vue/primitives/LayerTree'
import Tip from '../ui/overlay/Tip.vue'
diff --git a/src/components/LayerTree/LayerTreeDropIndicator.vue b/src/components/LayerTree/LayerTreeDropIndicator.vue
index ce44f020f..766fe77e5 100644
--- a/src/components/LayerTree/LayerTreeDropIndicator.vue
+++ b/src/components/LayerTree/LayerTreeDropIndicator.vue
@@ -2,7 +2,7 @@
import { tv } from 'tailwind-variants'
import { computed } from 'vue'
-import type { LayerDragInstruction } from '@open-pencil/vue'
+import type { LayerDragInstruction } from '@open-pencil/vue/primitives/LayerTree'
import layerTreeTheme from '@/theme/layer-tree'
diff --git a/src/components/LayerTree/LayerTreeNodeRow.vue b/src/components/LayerTree/LayerTreeNodeRow.vue
index 7821793b7..fc8f2fb02 100644
--- a/src/components/LayerTree/LayerTreeNodeRow.vue
+++ b/src/components/LayerTree/LayerTreeNodeRow.vue
@@ -2,7 +2,7 @@
import { tv } from 'tailwind-variants'
import { computed } from 'vue'
-import type { LayerNode } from '@open-pencil/vue'
+import type { LayerNode } from '@open-pencil/vue/primitives/LayerTree'
import { useEditorStore } from '@/app/editor/active-store'
import type { LayerIssueMark as LayerIssueMarkData } from '@/app/editor/design-check/layers'
diff --git a/src/components/LayerTree/LayerTreeRenameRow.vue b/src/components/LayerTree/LayerTreeRenameRow.vue
index ba3e27fef..eedc0bdd8 100644
--- a/src/components/LayerTree/LayerTreeRenameRow.vue
+++ b/src/components/LayerTree/LayerTreeRenameRow.vue
@@ -2,7 +2,8 @@
import { tv } from 'tailwind-variants'
import { computed, useTemplateRef, watch } from 'vue'
-import { useI18n, type LayerNode } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import type { LayerNode } from '@open-pencil/vue/primitives/LayerTree'
import { nodeIcon } from '@/components/icons'
import layerTreeTheme from '@/theme/layer-tree'
diff --git a/src/components/LayerTree/LayerTreeStickyRow.vue b/src/components/LayerTree/LayerTreeStickyRow.vue
index 65bd6b3d3..f9570c69f 100644
--- a/src/components/LayerTree/LayerTreeStickyRow.vue
+++ b/src/components/LayerTree/LayerTreeStickyRow.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { stickyTopLevelRow, useLayerTree } from '@open-pencil/vue'
+import { stickyTopLevelRow, useLayerTree } from '@open-pencil/vue/primitives/LayerTree'
import type { LayerIssueMark } from '@/app/editor/design-check/layers'
diff --git a/src/components/LayerTree/examples/States.vue b/src/components/LayerTree/examples/States.vue
index f44abd30b..1e6803bec 100644
--- a/src/components/LayerTree/examples/States.vue
+++ b/src/components/LayerTree/examples/States.vue
@@ -1,11 +1,7 @@
<script setup lang="ts">
-import {
- createDefaultNode,
- type NodeType,
- type SceneNode,
- type VectorNetwork
-} from '@open-pencil/scene-graph'
-import type { LayerNode, LayerOutline } from '@open-pencil/vue'
+import type { NodeType, SceneNode, VectorNetwork } from '@open-pencil/scene-graph'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
+import type { LayerNode, LayerOutline } from '@open-pencil/vue/primitives/LayerTree'
import type { LayerIssueMark } from '@/app/editor/design-check/layers'
import LayerTreeNodeRow from '@/components/LayerTree/LayerTreeNodeRow.vue'
diff --git a/src/components/LayerTree/examples/Virtualized.vue b/src/components/LayerTree/examples/Virtualized.vue
index 30d22e29b..7499e8fa4 100644
--- a/src/components/LayerTree/examples/Virtualized.vue
+++ b/src/components/LayerTree/examples/Virtualized.vue
@@ -2,8 +2,8 @@
import { TreeItem, TreeRoot, TreeVirtualizer } from 'reka-ui'
import { reactive, ref } from 'vue'
-import { useInlineRename } from '@open-pencil/vue'
-import type { LayerNode } from '@open-pencil/vue'
+import { useInlineRename } from '@open-pencil/vue/editor/inline-rename'
+import type { LayerNode } from '@open-pencil/vue/primitives/LayerTree'
import { LAYER_TREE_ROW_HEIGHT } from '@/components/LayerTree/geometry'
import LayerTreeNodeRow from '@/components/LayerTree/LayerTreeNodeRow.vue'
diff --git a/src/components/LayerTree/types.ts b/src/components/LayerTree/types.ts
index 4ae0fd875..f39f6b497 100644
--- a/src/components/LayerTree/types.ts
+++ b/src/components/LayerTree/types.ts
@@ -1,4 +1,4 @@
-import type { LayerDragInstruction } from '@open-pencil/vue'
+import type { LayerDragInstruction } from '@open-pencil/vue/primitives/LayerTree'
export interface LayerTreeItemActions {
select: (additive: boolean) => void
diff --git a/src/components/LayersPanel.vue b/src/components/LayersPanel.vue
index 269651a8d..5607f7e60 100644
--- a/src/components/LayersPanel.vue
+++ b/src/components/LayersPanel.vue
@@ -3,7 +3,8 @@ import { SplitterGroup, SplitterPanel, SplitterResizeHandle } from 'reka-ui'
import { tv } from 'tailwind-variants'
import { computed, ref } from 'vue'
-import { useI18n, vTestId } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { vTestId } from '@open-pencil/vue/testing'
import AppMenu from '@/components/shell/AppMenu.vue'
import SegmentedControl from '@/components/ui/select/SegmentedControl.vue'
diff --git a/src/components/MobileDrawer.vue b/src/components/MobileDrawer.vue
index 00cafa4a4..008ab08e9 100644
--- a/src/components/MobileDrawer.vue
+++ b/src/components/MobileDrawer.vue
@@ -5,7 +5,7 @@ import type { PanInfo } from 'motion-v'
import { TabsContent, TabsList, TabsRoot, TabsTrigger } from 'reka-ui'
import { computed, ref } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import { useMotionTransition } from '@/app/shell/motion/transitions'
diff --git a/src/components/MobileHud/MobileFileMenu.vue b/src/components/MobileHud/MobileFileMenu.vue
index 4d920a00b..fd2ce4f03 100644
--- a/src/components/MobileHud/MobileFileMenu.vue
+++ b/src/components/MobileHud/MobileFileMenu.vue
@@ -7,7 +7,7 @@ import {
DropdownMenuTrigger
} from 'reka-ui'
-import { useMenuMessages } from '@open-pencil/vue'
+import { useMenuMessages } from '@open-pencil/vue/i18n'
import HudButton from '@/components/mobile-hud/HudButton.vue'
import { useMobileHudContext } from '@/components/MobileHud/context'
diff --git a/src/components/MobileHud/MobileUndoRedo.vue b/src/components/MobileHud/MobileUndoRedo.vue
index 5e8a7a4ca..1325041b4 100644
--- a/src/components/MobileHud/MobileUndoRedo.vue
+++ b/src/components/MobileHud/MobileUndoRedo.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import HudButton from '@/components/mobile-hud/HudButton.vue'
import { useMobileHudContext } from '@/components/MobileHud/context'
diff --git a/src/components/MobileHud/context.ts b/src/components/MobileHud/context.ts
index d0b7d9fb6..9ad52f471 100644
--- a/src/components/MobileHud/context.ts
+++ b/src/components/MobileHud/context.ts
@@ -6,7 +6,8 @@ import IconImageDown from '~icons/lucide/image-down'
import IconSave from '~icons/lucide/save'
import IconZoomIn from '~icons/lucide/zoom-in'
-import { useEditorCommands, useI18n } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import { useI18n } from '@open-pencil/vue/i18n'
import { isCloudBinding, openCloudShare } from '@/app/cloud/integration'
import { DEFAULT_COLLAB_STATE, useCollabInjected } from '@/app/collab/use'
diff --git a/src/components/PagesPanel.vue b/src/components/PagesPanel.vue
index 2e8b51ee9..6cb7c3a50 100644
--- a/src/components/PagesPanel.vue
+++ b/src/components/PagesPanel.vue
@@ -11,7 +11,10 @@ import { tv } from 'tailwind-variants'
import { computed, ref, watch, type ComponentPublicInstance } from 'vue'
import type { SceneNode } from '@open-pencil/scene-graph'
-import { PageListRoot, useFlatReorderDrag, useI18n, useInlineRename } from '@open-pencil/vue'
+import { useInlineRename } from '@open-pencil/vue/editor/inline-rename'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { PageListRoot } from '@open-pencil/vue/primitives/PageList'
+import { useFlatReorderDrag } from '@open-pencil/vue/shared/drag'
import { useActiveEditorStoreRef } from '@/app/editor/active-store'
import { presenceByPage } from '@/app/presence/registry'
diff --git a/src/components/PropertiesPanel.vue b/src/components/PropertiesPanel.vue
index 7fe3c67fb..db777f24c 100644
--- a/src/components/PropertiesPanel.vue
+++ b/src/components/PropertiesPanel.vue
@@ -2,7 +2,7 @@
import { TabsContent, TabsList, TabsRoot, TabsTrigger } from 'reka-ui'
import { computed } from 'vue'
-import { useDesignCheckMessages, useI18n } from '@open-pencil/vue'
+import { useDesignCheckMessages, useI18n } from '@open-pencil/vue/i18n'
import { useAIChat } from '@/app/ai/chat/use'
import { isVersionHistoryOpen } from '@/app/cloud/integration'
diff --git a/src/components/TabBar.vue b/src/components/TabBar.vue
index b4df2617b..6e821c5f1 100644
--- a/src/components/TabBar.vue
+++ b/src/components/TabBar.vue
@@ -3,7 +3,7 @@ import { TabsList, TabsRoot, TabsTrigger } from 'reka-ui'
import { tv } from 'tailwind-variants'
import { computed, useTemplateRef, watch } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { animationsEnabled } from '@/app/shell/motion'
import { useTabsStore, createHomeTab } from '@/app/tabs'
diff --git a/src/components/assets-panel/AssetsPanel.vue b/src/components/assets-panel/AssetsPanel.vue
index 6299ec227..d54c8ef4b 100644
--- a/src/components/assets-panel/AssetsPanel.vue
+++ b/src/components/assets-panel/AssetsPanel.vue
@@ -11,9 +11,10 @@ import {
} from 'reka-ui'
import { computed, onMounted, ref, shallowRef, watch } from 'vue'
-import { cycleSafeParent, type SceneNode } from '@open-pencil/scene-graph'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { cycleSafeParent } from '@open-pencil/scene-graph/instances'
import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import { useLibraryService } from '@/app/libraries'
diff --git a/src/components/canvas/CanvasMenu.vue b/src/components/canvas/CanvasMenu.vue
index 708f42c18..be3ff652e 100644
--- a/src/components/canvas/CanvasMenu.vue
+++ b/src/components/canvas/CanvasMenu.vue
@@ -12,15 +12,15 @@ import { computed } from 'vue'
import IconChevronRight from '~icons/lucide/chevron-right'
import {
- vTestId,
useEditorCommands,
- useI18n,
- useMenuModel,
- useSelectionState,
editorCommandMetadata,
- formatShortcut
-} from '@open-pencil/vue'
-import type { EditorCommandId } from '@open-pencil/vue'
+ formatShortcut,
+ type EditorCommandId
+} from '@open-pencil/vue/editor/commands'
+import { useMenuModel } from '@open-pencil/vue/editor/menu-model'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { vTestId } from '@open-pencil/vue/testing'
import { useEditorStore } from '@/app/editor/active-store'
import { createCanvasMenuActions } from '@/app/editor/canvas/menu/actions'
diff --git a/src/components/canvas/CanvasPaneHeader.vue b/src/components/canvas/CanvasPaneHeader.vue
index 92f0ec8c9..f693e0ec9 100644
--- a/src/components/canvas/CanvasPaneHeader.vue
+++ b/src/components/canvas/CanvasPaneHeader.vue
@@ -9,7 +9,7 @@ import {
import { tv } from 'tailwind-variants'
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import type { SplitDirection } from '@/app/editor/panes/split-tree'
diff --git a/src/components/canvas/ColorSpaceBanner.vue b/src/components/canvas/ColorSpaceBanner.vue
index 6a7b3413c..4012b0039 100644
--- a/src/components/canvas/ColorSpaceBanner.vue
+++ b/src/components/canvas/ColorSpaceBanner.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { activeTab } from '@/app/tabs'
import ExternalLink from '@/components/links/ExternalLink.vue'
diff --git a/src/components/canvas/labels/CanvasLabelEditor.vue b/src/components/canvas/labels/CanvasLabelEditor.vue
index f58003b7d..3af099eec 100644
--- a/src/components/canvas/labels/CanvasLabelEditor.vue
+++ b/src/components/canvas/labels/CanvasLabelEditor.vue
@@ -10,7 +10,7 @@ import {
LABEL_OFFSET_Y
} from '@open-pencil/core/constants'
import { colorToCSS } from '@open-pencil/scene-graph/color'
-import type { CanvasLabelEdit } from '@open-pencil/vue'
+import type { CanvasLabelEdit } from '@open-pencil/vue/canvas/labels'
import type { CanvasLabelPresentation } from '@/components/canvas/labels/presentation'
import InlineLabelEditor from '@/components/ui/input/InlineLabelEditor.vue'
diff --git a/src/components/canvas/labels/presentation.ts b/src/components/canvas/labels/presentation.ts
index 75700ded9..dea84d521 100644
--- a/src/components/canvas/labels/presentation.ts
+++ b/src/components/canvas/labels/presentation.ts
@@ -1,7 +1,8 @@
+import type { Editor } from '@open-pencil/core'
import { canvasLabelForeground } from '@open-pencil/core/canvas'
-import type { Editor } from '@open-pencil/core/editor'
-import type { Color, SceneNode } from '@open-pencil/scene-graph'
-import type { CanvasLabelKind } from '@open-pencil/vue'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import type { CanvasLabelKind } from '@open-pencil/vue/canvas/labels'
export interface CanvasLabelPresentation {
background: Color
diff --git a/src/components/chat/ACPPermissionDialog.vue b/src/components/chat/ACPPermissionDialog.vue
index 37b3dae8c..e95c26274 100644
--- a/src/components/chat/ACPPermissionDialog.vue
+++ b/src/components/chat/ACPPermissionDialog.vue
@@ -7,7 +7,8 @@ import {
} from 'reka-ui'
import { computed } from 'vue'
-import { acpPermissionOptionTestId, useI18n, vTestId } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { acpPermissionOptionTestId, vTestId } from '@open-pencil/vue/testing'
import {
currentPermission,
diff --git a/src/components/chat/ChatComposer.vue b/src/components/chat/ChatComposer.vue
index a53f44611..63495a123 100644
--- a/src/components/chat/ChatComposer.vue
+++ b/src/components/chat/ChatComposer.vue
@@ -4,7 +4,7 @@ import type { ChatStatus } from 'ai'
import { TooltipProvider } from 'reka-ui'
import { computed, ref } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import IconButton from '@/components/ui/button/IconButton.vue'
import InputGroup from '@/components/ui/input/InputGroup.vue'
diff --git a/src/components/chat/ChatHistory.vue b/src/components/chat/ChatHistory.vue
index 6da1cd105..a4da57c78 100644
--- a/src/components/chat/ChatHistory.vue
+++ b/src/components/chat/ChatHistory.vue
@@ -14,7 +14,7 @@ import {
import { tv } from 'tailwind-variants'
import { computed, nextTick, ref, watch } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import IconButton from '@/components/ui/button/IconButton.vue'
diff --git a/src/components/chat/ChatInput.vue b/src/components/chat/ChatInput.vue
index 51c56fae3..70ce4624f 100644
--- a/src/components/chat/ChatInput.vue
+++ b/src/components/chat/ChatInput.vue
@@ -2,7 +2,8 @@
import { computed, useTemplateRef } from 'vue'
import { ACP_AGENTS } from '@open-pencil/core/constants'
-import { useI18n, useSelectionState } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
+import { useI18n } from '@open-pencil/vue/i18n'
import { revokeImagePreviewURL } from '@/app/ai/attachment/image/prepare'
import { MAX_IMAGE_ATTACHMENTS } from '@/app/ai/attachment/image/types'
diff --git a/src/components/chat/ChatMessage.vue b/src/components/chat/ChatMessage.vue
index 8236c32c8..e559a551c 100644
--- a/src/components/chat/ChatMessage.vue
+++ b/src/components/chat/ChatMessage.vue
@@ -4,7 +4,8 @@ import { isReasoningUIPart, isTextUIPart } from 'ai'
import type { UIMessage } from 'ai'
import { computed, ref } from 'vue'
-import { useI18n, vTestId } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { vTestId } from '@open-pencil/vue/testing'
import { attachmentsForMessage } from '@/app/ai/attachment/presentation/store'
import type { AttachmentPresentation } from '@/app/ai/attachment/presentation/types'
diff --git a/src/components/chat/ChatNodePreview.vue b/src/components/chat/ChatNodePreview.vue
index 37354455a..8875bffc6 100644
--- a/src/components/chat/ChatNodePreview.vue
+++ b/src/components/chat/ChatNodePreview.vue
@@ -2,8 +2,8 @@
import { useObjectUrl } from '@vueuse/core'
import { shallowRef, watch } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
-import { renderNodesToImage } from '@open-pencil/core/io'
+import type { Editor } from '@open-pencil/core'
+import { renderNodesToImage } from '@open-pencil/core/io/formats/raster'
import type { ReferencedNode } from '@/app/ai/chat/context'
diff --git a/src/components/chat/ChatProfileSelect.vue b/src/components/chat/ChatProfileSelect.vue
index 5166c5863..5bb8a2b74 100644
--- a/src/components/chat/ChatProfileSelect.vue
+++ b/src/components/chat/ChatProfileSelect.vue
@@ -15,7 +15,7 @@ import {
import { computed, ref } from 'vue'
import { AI_PROVIDERS } from '@open-pencil/core/constants'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import {
aiModelSettings,
diff --git a/src/components/chat/ChatRunLocation.vue b/src/components/chat/ChatRunLocation.vue
index 9f086490b..d8d5d46df 100644
--- a/src/components/chat/ChatRunLocation.vue
+++ b/src/components/chat/ChatRunLocation.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/chat/ChatThinkingSelect.vue b/src/components/chat/ChatThinkingSelect.vue
index f91176e3a..90e0128df 100644
--- a/src/components/chat/ChatThinkingSelect.vue
+++ b/src/components/chat/ChatThinkingSelect.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { chatThinkingLevel } from '@/app/ai/chat/thinking'
import { thinkingLevelLabel, thinkingLevelOptions } from '@/app/ai/models/thinking'
diff --git a/src/components/chat/ChatTranscript.vue b/src/components/chat/ChatTranscript.vue
index 54d109d4b..bc50d01d3 100644
--- a/src/components/chat/ChatTranscript.vue
+++ b/src/components/chat/ChatTranscript.vue
@@ -3,7 +3,7 @@ import type { ChatStatus, UIMessage } from 'ai'
import { ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport } from 'reka-ui'
import { computed, provide, ref } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { attachmentsForMessage } from '@/app/ai/attachment/presentation/store'
import type { AttachmentPresentation } from '@/app/ai/attachment/presentation/types'
diff --git a/src/components/chat/FollowAgentsToggle.vue b/src/components/chat/FollowAgentsToggle.vue
index d1262d424..12aea2cbd 100644
--- a/src/components/chat/FollowAgentsToggle.vue
+++ b/src/components/chat/FollowAgentsToggle.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useAIMessages } from '@open-pencil/vue'
+import { useAIMessages } from '@open-pencil/vue/i18n'
import { useActiveEditorStoreRef, type EditorStore } from '@/app/editor/active-store'
import { followWorkingAgents } from '@/app/presence/registry'
diff --git a/src/components/chat/ProviderModelSelect.vue b/src/components/chat/ProviderModelSelect.vue
index 8786a79bd..b5518e347 100644
--- a/src/components/chat/ProviderModelSelect.vue
+++ b/src/components/chat/ProviderModelSelect.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useAIChat } from '@/app/ai/chat/use'
import { useProviderModelCatalog } from '@/app/ai/models/catalog/use'
diff --git a/src/components/chat/ProviderSetup.vue b/src/components/chat/ProviderSetup.vue
index 9080146a4..ec9c77e06 100644
--- a/src/components/chat/ProviderSetup.vue
+++ b/src/components/chat/ProviderSetup.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { openSettingsDialog } from '@/app/settings/dialog'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/chat/attachment/AttachmentCard.vue b/src/components/chat/attachment/AttachmentCard.vue
index 1f7c2da90..bbd409575 100644
--- a/src/components/chat/attachment/AttachmentCard.vue
+++ b/src/components/chat/attachment/AttachmentCard.vue
@@ -2,7 +2,7 @@
import { useObjectUrl } from '@vueuse/core'
import { computed, ref, toRef } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { AttachmentPresentation } from '@/app/ai/attachment/presentation/types'
import { AppDialogBody, AppDialogHeader, AppDialogRoot } from '@/components/ui/dialog'
diff --git a/src/components/chat/input/useAttachments.ts b/src/components/chat/input/useAttachments.ts
index bb00e8e21..239ed1f3e 100644
--- a/src/components/chat/input/useAttachments.ts
+++ b/src/components/chat/input/useAttachments.ts
@@ -2,7 +2,7 @@ import { useFileDialog } from '@vueuse/core'
import { uniq } from 'es-toolkit'
import { computed, onBeforeUnmount, ref, type Ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import {
createImagePreviewURL,
diff --git a/src/components/chat/tool/ToolCallCard.vue b/src/components/chat/tool/ToolCallCard.vue
index c0f57e1fe..3444d1f96 100644
--- a/src/components/chat/tool/ToolCallCard.vue
+++ b/src/components/chat/tool/ToolCallCard.vue
@@ -2,7 +2,7 @@
import { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger } from 'reka-ui'
import { computed, ref } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import {
displayedToolOutput,
diff --git a/src/components/chat/tool/ToolCallGroup.vue b/src/components/chat/tool/ToolCallGroup.vue
index bf37196f3..19209da29 100644
--- a/src/components/chat/tool/ToolCallGroup.vue
+++ b/src/components/chat/tool/ToolCallGroup.vue
@@ -2,7 +2,7 @@
import { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger } from 'reka-ui'
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { toolDisplayName, type ToolCallPart } from '@/app/ai/chat/tool-calls/display'
import { toolCallState } from '@/components/chat/tool/state'
diff --git a/src/components/chat/tool/ToolChangeView.vue b/src/components/chat/tool/ToolChangeView.vue
index fe4414f86..0a43969c3 100644
--- a/src/components/chat/tool/ToolChangeView.vue
+++ b/src/components/chat/tool/ToolChangeView.vue
@@ -4,7 +4,7 @@ import { SplitterGroup, SplitterPanel, SplitterResizeHandle } from 'reka-ui'
import { tv } from 'tailwind-variants'
import { computed, ref } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { ToolChange } from '@/app/ai/tools/changes/types'
import CodeViewer from '@/components/code-editor/LazyCodeViewer.vue'
diff --git a/src/components/chat/tool/ToolNodeChips.vue b/src/components/chat/tool/ToolNodeChips.vue
index bca2e1aa3..71659ac54 100644
--- a/src/components/chat/tool/ToolNodeChips.vue
+++ b/src/components/chat/tool/ToolNodeChips.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useToolNodes } from '@/components/chat/tool/useToolNodes'
import { chatToolTheme } from '@/theme/chat/tool'
diff --git a/src/components/chat/turn/ChatMessageEditor.vue b/src/components/chat/turn/ChatMessageEditor.vue
index 0572b3292..06cab3889 100644
--- a/src/components/chat/turn/ChatMessageEditor.vue
+++ b/src/components/chat/turn/ChatMessageEditor.vue
@@ -2,7 +2,7 @@
import { useTextareaAutosize } from '@vueuse/core'
import { onMounted, ref, useTemplateRef } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/chat/turn/ChatTurnActions.vue b/src/components/chat/turn/ChatTurnActions.vue
index 9ff636ee3..935f19181 100644
--- a/src/components/chat/turn/ChatTurnActions.vue
+++ b/src/components/chat/turn/ChatTurnActions.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { turnEdits } from '@/app/ai/reply/turns'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/cloud-portal/account/PortalAccountSecurity.vue b/src/components/cloud-portal/account/PortalAccountSecurity.vue
index 9dec3ccda..7502b7011 100644
--- a/src/components/cloud-portal/account/PortalAccountSecurity.vue
+++ b/src/components/cloud-portal/account/PortalAccountSecurity.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'
import SettingsRow from '@/components/settings/layout/SettingsRow.vue'
diff --git a/src/components/cloud-portal/account/PortalAuthenticatorSetup.vue b/src/components/cloud-portal/account/PortalAuthenticatorSetup.vue
index 10270d42b..63307f30e 100644
--- a/src/components/cloud-portal/account/PortalAuthenticatorSetup.vue
+++ b/src/components/cloud-portal/account/PortalAuthenticatorSetup.vue
@@ -3,7 +3,7 @@ import { computedAsync } from '@vueuse/core'
import { toDataURL } from 'qrcode'
import { computed, ref } from 'vue'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import AppDialogBody from '@/components/ui/dialog/AppDialogBody.vue'
diff --git a/src/components/cloud-portal/account/PortalPasswordDialog.vue b/src/components/cloud-portal/account/PortalPasswordDialog.vue
index ca60e3d0e..c604aeaeb 100644
--- a/src/components/cloud-portal/account/PortalPasswordDialog.vue
+++ b/src/components/cloud-portal/account/PortalPasswordDialog.vue
@@ -2,7 +2,7 @@
import * as v from 'valibot'
import { computed, ref, watch } from 'vue'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import AppDialogBody from '@/components/ui/dialog/AppDialogBody.vue'
diff --git a/src/components/cloud-portal/account/PortalRecoveryCodes.vue b/src/components/cloud-portal/account/PortalRecoveryCodes.vue
index 7959e2079..fe19c7dfb 100644
--- a/src/components/cloud-portal/account/PortalRecoveryCodes.vue
+++ b/src/components/cloud-portal/account/PortalRecoveryCodes.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { useClipboard } from '@vueuse/core'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import AppDialogBody from '@/components/ui/dialog/AppDialogBody.vue'
diff --git a/src/components/cloud-portal/auth/PortalDeviceApproval.vue b/src/components/cloud-portal/auth/PortalDeviceApproval.vue
index 173906456..285a29a56 100644
--- a/src/components/cloud-portal/auth/PortalDeviceApproval.vue
+++ b/src/components/cloud-portal/auth/PortalDeviceApproval.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import AppAlert from '@/components/ui/feedback/AppAlert.vue'
diff --git a/src/components/cloud-portal/auth/PortalResetPassword.vue b/src/components/cloud-portal/auth/PortalResetPassword.vue
index fab743fba..af5ad5c89 100644
--- a/src/components/cloud-portal/auth/PortalResetPassword.vue
+++ b/src/components/cloud-portal/auth/PortalResetPassword.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import AppAlert from '@/components/ui/feedback/AppAlert.vue'
diff --git a/src/components/cloud-portal/auth/PortalSignIn.vue b/src/components/cloud-portal/auth/PortalSignIn.vue
index 94cd30c03..152be59a2 100644
--- a/src/components/cloud-portal/auth/PortalSignIn.vue
+++ b/src/components/cloud-portal/auth/PortalSignIn.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import CloudAccountForm from '@/components/cloud/account/CloudAccountForm.vue'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/cloud-portal/auth/PortalTwoFactor.vue b/src/components/cloud-portal/auth/PortalTwoFactor.vue
index d0f1400f2..86dae5e09 100644
--- a/src/components/cloud-portal/auth/PortalTwoFactor.vue
+++ b/src/components/cloud-portal/auth/PortalTwoFactor.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import AppAlert from '@/components/ui/feedback/AppAlert.vue'
diff --git a/src/components/cloud-portal/console/PortalAccessRequests.vue b/src/components/cloud-portal/console/PortalAccessRequests.vue
index 1c55785e6..333936030 100644
--- a/src/components/cloud-portal/console/PortalAccessRequests.vue
+++ b/src/components/cloud-portal/console/PortalAccessRequests.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import AccountAvatar from '@/components/presence/AccountAvatar.vue'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/cloud-portal/console/PortalActivity.vue b/src/components/cloud-portal/console/PortalActivity.vue
index a23edf33b..3e9afa74b 100644
--- a/src/components/cloud-portal/console/PortalActivity.vue
+++ b/src/components/cloud-portal/console/PortalActivity.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import AccountAvatar from '@/components/presence/AccountAvatar.vue'
import { portalList } from '@/theme/cloud-portal/list'
diff --git a/src/components/cloud-portal/console/PortalEmailDelivery.vue b/src/components/cloud-portal/console/PortalEmailDelivery.vue
index 4d73800f3..43af23540 100644
--- a/src/components/cloud-portal/console/PortalEmailDelivery.vue
+++ b/src/components/cloud-portal/console/PortalEmailDelivery.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import { portalList } from '@/theme/cloud-portal/list'
diff --git a/src/components/cloud-portal/console/PortalPeople.vue b/src/components/cloud-portal/console/PortalPeople.vue
index bb193df0c..d5908e865 100644
--- a/src/components/cloud-portal/console/PortalPeople.vue
+++ b/src/components/cloud-portal/console/PortalPeople.vue
@@ -8,7 +8,7 @@ import {
DropdownMenuTrigger
} from 'reka-ui'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import AccountAvatar from '@/components/presence/AccountAvatar.vue'
import IconButton from '@/components/ui/button/IconButton.vue'
diff --git a/src/components/cloud-portal/console/PortalStatus.vue b/src/components/cloud-portal/console/PortalStatus.vue
index 279e9ab61..a054fca2d 100644
--- a/src/components/cloud-portal/console/PortalStatus.vue
+++ b/src/components/cloud-portal/console/PortalStatus.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'
import SettingsRow from '@/components/settings/layout/SettingsRow.vue'
diff --git a/src/components/cloud-portal/layout/PortalConsoleLayout.vue b/src/components/cloud-portal/layout/PortalConsoleLayout.vue
index 6e1158361..ffdec7055 100644
--- a/src/components/cloud-portal/layout/PortalConsoleLayout.vue
+++ b/src/components/cloud-portal/layout/PortalConsoleLayout.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { uniq } from 'es-toolkit'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import BrandMark from '@/components/brand/BrandMark.vue'
import AccountAvatar from '@/components/presence/AccountAvatar.vue'
diff --git a/src/components/cloud-portal/layout/PortalPublicLayout.vue b/src/components/cloud-portal/layout/PortalPublicLayout.vue
index d2cd6e084..de1fd0323 100644
--- a/src/components/cloud-portal/layout/PortalPublicLayout.vue
+++ b/src/components/cloud-portal/layout/PortalPublicLayout.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import BrandMark from '@/components/brand/BrandMark.vue'
import { CLOUD_DOCS_URL } from '@/constants'
diff --git a/src/components/cloud-portal/sections/AdminActivitySection.vue b/src/components/cloud-portal/sections/AdminActivitySection.vue
index 9397779f8..5c396134c 100644
--- a/src/components/cloud-portal/sections/AdminActivitySection.vue
+++ b/src/components/cloud-portal/sections/AdminActivitySection.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useCloudPortalMessages, useI18n } from '@open-pencil/vue'
+import { useCloudPortalMessages, useI18n } from '@open-pencil/vue/i18n'
import { usePortal } from '@/app/cloud-portal/context'
import { usePortalLoad } from '@/app/cloud-portal/state'
diff --git a/src/components/cloud-portal/sections/AdminEmailSection.vue b/src/components/cloud-portal/sections/AdminEmailSection.vue
index 3c715a553..1fedc43e7 100644
--- a/src/components/cloud-portal/sections/AdminEmailSection.vue
+++ b/src/components/cloud-portal/sections/AdminEmailSection.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useCloudPortalMessages, useI18n } from '@open-pencil/vue'
+import { useCloudPortalMessages, useI18n } from '@open-pencil/vue/i18n'
import { usePortal } from '@/app/cloud-portal/context'
import { usePortalAction, usePortalLoad } from '@/app/cloud-portal/state'
diff --git a/src/components/cloud-portal/sections/AdminOverviewSection.vue b/src/components/cloud-portal/sections/AdminOverviewSection.vue
index 82765fbf8..b252baa89 100644
--- a/src/components/cloud-portal/sections/AdminOverviewSection.vue
+++ b/src/components/cloud-portal/sections/AdminOverviewSection.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import { usePortal } from '@/app/cloud-portal/context'
import { usePortalLoad } from '@/app/cloud-portal/state'
diff --git a/src/components/cloud-portal/sections/AdminPeopleSection.vue b/src/components/cloud-portal/sections/AdminPeopleSection.vue
index b2fdd657a..f8e0adc1f 100644
--- a/src/components/cloud-portal/sections/AdminPeopleSection.vue
+++ b/src/components/cloud-portal/sections/AdminPeopleSection.vue
@@ -2,7 +2,7 @@
import { refDebounced } from '@vueuse/core'
import { computed, ref, watch } from 'vue'
-import { useCloudPortalMessages, useI18n } from '@open-pencil/vue'
+import { useCloudPortalMessages, useI18n } from '@open-pencil/vue/i18n'
import { usePortal } from '@/app/cloud-portal/context'
import { usePortalAction, usePortalLoad } from '@/app/cloud-portal/state'
diff --git a/src/components/cloud-portal/sections/AdminRequestsSection.vue b/src/components/cloud-portal/sections/AdminRequestsSection.vue
index 12fe0222b..244d685cc 100644
--- a/src/components/cloud-portal/sections/AdminRequestsSection.vue
+++ b/src/components/cloud-portal/sections/AdminRequestsSection.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue'
-import { useCloudPortalMessages, useI18n } from '@open-pencil/vue'
+import { useCloudPortalMessages, useI18n } from '@open-pencil/vue/i18n'
import { usePortal } from '@/app/cloud-portal/context'
import { usePortalAction, usePortalLoad } from '@/app/cloud-portal/state'
diff --git a/src/components/cloud-portal/sections/SecuritySection.vue b/src/components/cloud-portal/sections/SecuritySection.vue
index 2113b1bd8..083d71cae 100644
--- a/src/components/cloud-portal/sections/SecuritySection.vue
+++ b/src/components/cloud-portal/sections/SecuritySection.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
-import { useCloudPortalMessages, useI18n } from '@open-pencil/vue'
+import { useCloudPortalMessages, useI18n } from '@open-pencil/vue/i18n'
import { usePortal } from '@/app/cloud-portal/context'
import { usePortalFailureMessages } from '@/app/cloud-portal/failure'
diff --git a/src/components/cloud/account/CloudAccountForm.vue b/src/components/cloud/account/CloudAccountForm.vue
index c60d0bff8..1da5fa601 100644
--- a/src/components/cloud/account/CloudAccountForm.vue
+++ b/src/components/cloud/account/CloudAccountForm.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, toRef, watch } from 'vue'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import {
useCloudAccountForm,
diff --git a/src/components/cloud/conflict/CloudConflictDialog.vue b/src/components/cloud/conflict/CloudConflictDialog.vue
index cbbee7513..f77837241 100644
--- a/src/components/cloud/conflict/CloudConflictDialog.vue
+++ b/src/components/cloud/conflict/CloudConflictDialog.vue
@@ -2,7 +2,7 @@
import { RadioGroupItem, RadioGroupRoot } from 'reka-ui'
import { computed } from 'vue'
-import { useCloudMessages, useCommonMessages } from '@open-pencil/vue'
+import { useCloudMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import AppDialogBody from '@/components/ui/dialog/AppDialogBody.vue'
diff --git a/src/components/cloud/connect/CloudConnectDialog.vue b/src/components/cloud/connect/CloudConnectDialog.vue
index 1e2aba6c1..8c51ca5fc 100644
--- a/src/components/cloud/connect/CloudConnectDialog.vue
+++ b/src/components/cloud/connect/CloudConnectDialog.vue
@@ -2,7 +2,7 @@
import { RadioGroupItem, RadioGroupRoot } from 'reka-ui'
import { computed } from 'vue'
-import { useCloudMessages, useCloudPortalMessages, useCommonMessages } from '@open-pencil/vue'
+import { useCloudMessages, useCloudPortalMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import {
cloudAuthFailureMessage,
diff --git a/src/components/cloud/connect/CloudConnectHost.vue b/src/components/cloud/connect/CloudConnectHost.vue
index 3817b0388..a56d04f2e 100644
--- a/src/components/cloud/connect/CloudConnectHost.vue
+++ b/src/components/cloud/connect/CloudConnectHost.vue
@@ -2,7 +2,7 @@
import { useDocumentVisibility, useNow } from '@vueuse/core'
import { computed, watch } from 'vue'
-import { useCloudMessages, useI18n } from '@open-pencil/vue'
+import { useCloudMessages, useI18n } from '@open-pencil/vue/i18n'
import {
backCloudConnect,
diff --git a/src/components/cloud/invitation/CloudInvitationDialog.vue b/src/components/cloud/invitation/CloudInvitationDialog.vue
index f990302d4..2e259935b 100644
--- a/src/components/cloud/invitation/CloudInvitationDialog.vue
+++ b/src/components/cloud/invitation/CloudInvitationDialog.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useCloudMessages, useCommonMessages } from '@open-pencil/vue'
+import { useCloudMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import AppDialogBody from '@/components/ui/dialog/AppDialogBody.vue'
diff --git a/src/components/cloud/invitation/CloudInvitationHost.vue b/src/components/cloud/invitation/CloudInvitationHost.vue
index d4020c00f..e289ff393 100644
--- a/src/components/cloud/invitation/CloudInvitationHost.vue
+++ b/src/components/cloud/invitation/CloudInvitationHost.vue
@@ -2,7 +2,7 @@
import { useNow } from '@vueuse/core'
import { computed, watch } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { cloudSignedIn } from '@/app/cloud/connect/flow'
import {
diff --git a/src/components/cloud/share/CloudShareButton.vue b/src/components/cloud/share/CloudShareButton.vue
index 652512007..a36cf42fe 100644
--- a/src/components/cloud/share/CloudShareButton.vue
+++ b/src/components/cloud/share/CloudShareButton.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { cloudShareOpen } from '@/app/cloud/sharing/dialog'
import { cloudShareTarget } from '@/app/cloud/sharing/document'
diff --git a/src/components/cloud/share/CloudShareDialog.vue b/src/components/cloud/share/CloudShareDialog.vue
index 268ea538a..7c3370b00 100644
--- a/src/components/cloud/share/CloudShareDialog.vue
+++ b/src/components/cloud/share/CloudShareDialog.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
-import { useCloudMessages, useCommonMessages } from '@open-pencil/vue'
+import { useCloudMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import AccountAvatar from '@/components/presence/AccountAvatar.vue'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/cloud/share/CloudShareHost.vue b/src/components/cloud/share/CloudShareHost.vue
index adb7249aa..952ba7a61 100644
--- a/src/components/cloud/share/CloudShareHost.vue
+++ b/src/components/cloud/share/CloudShareHost.vue
@@ -2,7 +2,7 @@
import { computed, watch } from 'vue'
import type { DocumentPermission } from '@open-pencil/cloud/contract'
-import { useCloudMessages } from '@open-pencil/vue'
+import { useCloudMessages } from '@open-pencil/vue/i18n'
import { cloudConnection } from '@/app/cloud/sessions/connection'
import { cloudShareOpen } from '@/app/cloud/sharing/dialog'
diff --git a/src/components/cloud/status/CloudDocumentStatus.vue b/src/components/cloud/status/CloudDocumentStatus.vue
index 21786c47f..0b4b7491b 100644
--- a/src/components/cloud/status/CloudDocumentStatus.vue
+++ b/src/components/cloud/status/CloudDocumentStatus.vue
@@ -2,7 +2,7 @@
import { PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger } from 'reka-ui'
import { computed, ref } from 'vue'
-import { useCloudMessages } from '@open-pencil/vue'
+import { useCloudMessages } from '@open-pencil/vue/i18n'
import type { CloudSyncState } from '@/components/home/cloud/types'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/cloud/status/CloudDocumentStatusHost.vue b/src/components/cloud/status/CloudDocumentStatusHost.vue
index 11402c937..084d98fe6 100644
--- a/src/components/cloud/status/CloudDocumentStatusHost.vue
+++ b/src/components/cloud/status/CloudDocumentStatusHost.vue
@@ -3,7 +3,7 @@ import { useObjectUrl } from '@vueuse/core'
import { computed, ref, shallowRef } from 'vue'
import { useRouter } from 'vue-router'
-import { useCloudMessages } from '@open-pencil/vue'
+import { useCloudMessages } from '@open-pencil/vue/i18n'
import { openCloudConnect } from '@/app/cloud/connect/flow'
import { resolveCloudConflict, type CloudConflictChoice } from '@/app/cloud/documents/conflict'
diff --git a/src/components/cloud/versions/CloudVersionDialog.vue b/src/components/cloud/versions/CloudVersionDialog.vue
index 5c83ffc03..057a4af69 100644
--- a/src/components/cloud/versions/CloudVersionDialog.vue
+++ b/src/components/cloud/versions/CloudVersionDialog.vue
@@ -5,7 +5,7 @@ import {
DOCUMENT_VERSION_DESCRIPTION_MAX_LENGTH,
DOCUMENT_VERSION_NAME_MAX_LENGTH
} from '@open-pencil/cloud/contract'
-import { useCloudMessages, useCommonMessages } from '@open-pencil/vue'
+import { useCloudMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import { editVersion, saveVersion } from '@/app/cloud/versions/actions'
import { versionDialog, versionsChanged } from '@/app/cloud/versions/history'
diff --git a/src/components/cloud/versions/CloudVersionHistory.vue b/src/components/cloud/versions/CloudVersionHistory.vue
index 03310745b..391ab06b0 100644
--- a/src/components/cloud/versions/CloudVersionHistory.vue
+++ b/src/components/cloud/versions/CloudVersionHistory.vue
@@ -15,7 +15,7 @@ import {
import { computed, onMounted, useTemplateRef } from 'vue'
import type { DocumentVersion } from '@open-pencil/cloud/contract'
-import { useCloudMessages } from '@open-pencil/vue'
+import { useCloudMessages } from '@open-pencil/vue/i18n'
import { canLinkToVersions, cloudVersionLinkURL } from '@/app/cloud/documents/link'
import { duplicateVersion, editVersion, restoreVersion } from '@/app/cloud/versions/actions'
diff --git a/src/components/cloud/workspace/CloudNewWorkspaceDialog.vue b/src/components/cloud/workspace/CloudNewWorkspaceDialog.vue
index e07284eea..67731486a 100644
--- a/src/components/cloud/workspace/CloudNewWorkspaceDialog.vue
+++ b/src/components/cloud/workspace/CloudNewWorkspaceDialog.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue'
-import { useCloudMessages, useCommonMessages } from '@open-pencil/vue'
+import { useCloudMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import AppDialogBody from '@/components/ui/dialog/AppDialogBody.vue'
diff --git a/src/components/cloud/workspace/CloudWorkspaceMembersDialog.vue b/src/components/cloud/workspace/CloudWorkspaceMembersDialog.vue
index 78522038f..85b03c365 100644
--- a/src/components/cloud/workspace/CloudWorkspaceMembersDialog.vue
+++ b/src/components/cloud/workspace/CloudWorkspaceMembersDialog.vue
@@ -3,7 +3,7 @@ import { useClipboard } from '@vueuse/core'
import { computed, ref, watch } from 'vue'
import type { WorkspaceMembers, WorkspaceRole } from '@open-pencil/cloud/contract'
-import { useCloudMessages, useCommonMessages } from '@open-pencil/vue'
+import { useCloudMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import AccountAvatar from '@/components/presence/AccountAvatar.vue'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/cloud/workspace/CloudWorkspaceMembersHost.vue b/src/components/cloud/workspace/CloudWorkspaceMembersHost.vue
index becc698ff..f5bdb32ab 100644
--- a/src/components/cloud/workspace/CloudWorkspaceMembersHost.vue
+++ b/src/components/cloud/workspace/CloudWorkspaceMembersHost.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useCloudMessages } from '@open-pencil/vue'
+import { useCloudMessages } from '@open-pencil/vue/i18n'
import {
changeWorkspaceRole,
diff --git a/src/components/code-editor/CodeEditor.vue b/src/components/code-editor/CodeEditor.vue
index 1ad59fef0..5284d75eb 100644
--- a/src/components/code-editor/CodeEditor.vue
+++ b/src/components/code-editor/CodeEditor.vue
@@ -19,7 +19,7 @@ import {
import { useTemplateRef, watch } from 'vue'
import { DESIGN_JSX_ELEMENTS, type DesignJSXElement } from '@open-pencil/design-jsx'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { LayerIssue } from '@/app/code/layers/issues'
import type { LayerLinkSource } from '@/app/code/layers/links'
diff --git a/src/components/collab-panel/ConnectedRoom.vue b/src/components/collab-panel/ConnectedRoom.vue
index 1c69602d3..3103255af 100644
--- a/src/components/collab-panel/ConnectedRoom.vue
+++ b/src/components/collab-panel/ConnectedRoom.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { selectTarget } from '@open-pencil/vue'
+import { selectTarget } from '@open-pencil/vue/shared/dom-events'
import { useCollabPanelContext } from '@/components/collab-panel/context'
import { roomStatusText } from '@/components/collab-room/statusText'
diff --git a/src/components/collab-panel/PresenceAvatars.vue b/src/components/collab-panel/PresenceAvatars.vue
index fed63f986..2a05e50dc 100644
--- a/src/components/collab-panel/PresenceAvatars.vue
+++ b/src/components/collab-panel/PresenceAvatars.vue
@@ -10,7 +10,7 @@ import {
PopoverTrigger
} from 'reka-ui'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { FollowTarget } from '@/app/presence/types'
import AvatarStack from '@/components/presence/AvatarStack.vue'
diff --git a/src/components/collab-panel/context.ts b/src/components/collab-panel/context.ts
index 8189a3272..533d11342 100644
--- a/src/components/collab-panel/context.ts
+++ b/src/components/collab-panel/context.ts
@@ -2,7 +2,7 @@ import { useClipboard } from '@vueuse/core'
import { computed, inject, provide, proxyRefs, ref, watch } from 'vue'
import type { InjectionKey, ShallowUnwrapRef } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useJoinRoom } from '@/app/collab/join'
import { activeRoom } from '@/app/collab/rooms'
diff --git a/src/components/collab-room/LeftRoomNotice.vue b/src/components/collab-room/LeftRoomNotice.vue
index 9ca069961..f6868f45b 100644
--- a/src/components/collab-room/LeftRoomNotice.vue
+++ b/src/components/collab-room/LeftRoomNotice.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useCollaborationMessages } from '@open-pencil/vue'
+import { useCollaborationMessages } from '@open-pencil/vue/i18n'
import IconButton from '@/components/ui/button/IconButton.vue'
import { roomNotice } from '@/theme/collaboration/room-screen'
diff --git a/src/components/collab-room/RoomNameLine.vue b/src/components/collab-room/RoomNameLine.vue
index b28d70d36..0cba9cfaa 100644
--- a/src/components/collab-room/RoomNameLine.vue
+++ b/src/components/collab-room/RoomNameLine.vue
@@ -2,7 +2,7 @@
import { PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger } from 'reka-ui'
import { ref, watch } from 'vue'
-import { useCollaborationMessages, useCommonMessages } from '@open-pencil/vue'
+import { useCollaborationMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import AppInput from '@/components/ui/input/AppInput.vue'
diff --git a/src/components/collab-room/RoomScreen.vue b/src/components/collab-room/RoomScreen.vue
index 24f1b9095..33d29b01d 100644
--- a/src/components/collab-room/RoomScreen.vue
+++ b/src/components/collab-room/RoomScreen.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useCollaborationMessages } from '@open-pencil/vue'
+import { useCollaborationMessages } from '@open-pencil/vue/i18n'
import { isFetchingRoom, type PendingRoomStatus } from '@/app/collab/room/status'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/collab-room/statusText.ts b/src/components/collab-room/statusText.ts
index 0ac12974f..918ea9aff 100644
--- a/src/components/collab-room/statusText.ts
+++ b/src/components/collab-room/statusText.ts
@@ -1,4 +1,4 @@
-import type { useCollaborationMessages } from '@open-pencil/vue'
+import type { useCollaborationMessages } from '@open-pencil/vue/i18n'
import type { RoomStatus } from '@/app/collab/room/status'
diff --git a/src/components/collab-room/useRoomActions.ts b/src/components/collab-room/useRoomActions.ts
index b72ea17ca..6c5d0c5f2 100644
--- a/src/components/collab-room/useRoomActions.ts
+++ b/src/components/collab-room/useRoomActions.ts
@@ -1,7 +1,7 @@
import { useClipboard } from '@vueuse/core'
import { computed } from 'vue'
-import { useViewportKind } from '@open-pencil/vue'
+import { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
import { roomLinkURL } from '@/app/collab/room/links'
import { showsRoomDocument, type PendingRoomStatus } from '@/app/collab/room/status'
diff --git a/src/components/color-picker-panel/ColorPickerPanel.vue b/src/components/color-picker-panel/ColorPickerPanel.vue
index 8b8fe746b..3d584c230 100644
--- a/src/components/color-picker-panel/ColorPickerPanel.vue
+++ b/src/components/color-picker-panel/ColorPickerPanel.vue
@@ -1,6 +1,6 @@
<script setup lang="ts">
import type { Color } from '@open-pencil/scene-graph/primitives'
-import type { OkHCLControls } from '@open-pencil/vue'
+import type { OkHCLControls } from '@open-pencil/vue/controls/color-model'
import ColorAreaControl from '@/components/color-picker-panel/ColorAreaControl.vue'
import { provideColorPickerPanel } from '@/components/color-picker-panel/context'
diff --git a/src/components/color-picker-panel/HsbFields.vue b/src/components/color-picker-panel/HsbFields.vue
index 957b16a6b..d32f81a4c 100644
--- a/src/components/color-picker-panel/HsbFields.vue
+++ b/src/components/color-picker-panel/HsbFields.vue
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { colorToCSS } from '@open-pencil/scene-graph/color'
-import { inputNumberValue, useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { inputNumberValue } from '@open-pencil/vue/shared/dom-events'
import { useColorPickerPanelContext } from '@/components/color-picker-panel/context'
import StandardColorSlider from '@/components/color-picker-panel/StandardColorSlider.vue'
diff --git a/src/components/color-picker-panel/HslFields.vue b/src/components/color-picker-panel/HslFields.vue
index 089442647..9c9b8ee0f 100644
--- a/src/components/color-picker-panel/HslFields.vue
+++ b/src/components/color-picker-panel/HslFields.vue
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { colorToCSS } from '@open-pencil/scene-graph/color'
-import { inputNumberValue, useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { inputNumberValue } from '@open-pencil/vue/shared/dom-events'
import { useColorPickerPanelContext } from '@/components/color-picker-panel/context'
import StandardColorSlider from '@/components/color-picker-panel/StandardColorSlider.vue'
diff --git a/src/components/color-picker-panel/HueAlphaSliders.vue b/src/components/color-picker-panel/HueAlphaSliders.vue
index 4176d2130..d7c0d695a 100644
--- a/src/components/color-picker-panel/HueAlphaSliders.vue
+++ b/src/components/color-picker-panel/HueAlphaSliders.vue
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { colorToCSS } from '@open-pencil/scene-graph/color'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useColorPickerPanelContext } from '@/components/color-picker-panel/context'
import StandardColorSlider from '@/components/color-picker-panel/StandardColorSlider.vue'
diff --git a/src/components/color-picker-panel/OkhclChannelSlider.vue b/src/components/color-picker-panel/OkhclChannelSlider.vue
index 5b48e93ad..05f24f47d 100644
--- a/src/components/color-picker-panel/OkhclChannelSlider.vue
+++ b/src/components/color-picker-panel/OkhclChannelSlider.vue
@@ -1,5 +1,9 @@
<script setup lang="ts">
-import { ChannelSliderRoot, ChannelSliderThumb, ChannelSliderTrack } from '@open-pencil/vue'
+import {
+ ChannelSliderRoot,
+ ChannelSliderThumb,
+ ChannelSliderTrack
+} from '@open-pencil/vue/primitives/ChannelSlider'
import type { ColorSliderUI } from '@/components/color-picker-panel/ui'
import { useColorSliderUI } from '@/components/color-picker-panel/ui'
diff --git a/src/components/color-picker-panel/OkhclFields.vue b/src/components/color-picker-panel/OkhclFields.vue
index 71a653e46..4c1e08477 100644
--- a/src/components/color-picker-panel/OkhclFields.vue
+++ b/src/components/color-picker-panel/OkhclFields.vue
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { colorToCSS } from '@open-pencil/scene-graph/color'
-import { fromPercent, toPercent, useI18n } from '@open-pencil/vue'
+import { fromPercent, toPercent } from '@open-pencil/vue/controls/color-model'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useColorPickerPanelContext } from '@/components/color-picker-panel/context'
import OkhclChannelSlider from '@/components/color-picker-panel/OkhclChannelSlider.vue'
diff --git a/src/components/color-picker-panel/RGBFields.vue b/src/components/color-picker-panel/RGBFields.vue
index c45e51273..6bede764e 100644
--- a/src/components/color-picker-panel/RGBFields.vue
+++ b/src/components/color-picker-panel/RGBFields.vue
@@ -1,5 +1,6 @@
<script setup lang="ts">
-import { inputNumberValue, useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { inputNumberValue } from '@open-pencil/vue/shared/dom-events'
import { useColorPickerPanelContext } from '@/components/color-picker-panel/context'
diff --git a/src/components/color-picker-panel/context.ts b/src/components/color-picker-panel/context.ts
index d4424b7f3..0a1acc251 100644
--- a/src/components/color-picker-panel/context.ts
+++ b/src/components/color-picker-panel/context.ts
@@ -2,8 +2,12 @@ import { computed, inject, provide, proxyRefs } from 'vue'
import type { InjectionKey, ShallowUnwrapRef } from 'vue'
import type { Color } from '@open-pencil/scene-graph/primitives'
-import { useColorModel, useI18n } from '@open-pencil/vue'
-import type { ColorFieldFormat, OkHCLControls } from '@open-pencil/vue'
+import {
+ useColorModel,
+ type ColorFieldFormat,
+ type OkHCLControls
+} from '@open-pencil/vue/controls/color-model'
+import { useI18n } from '@open-pencil/vue/i18n'
interface ColorPanelProps {
color: Color
diff --git a/src/components/commands/CommandPalette.vue b/src/components/commands/CommandPalette.vue
index 25888ba3c..f03c718e9 100644
--- a/src/components/commands/CommandPalette.vue
+++ b/src/components/commands/CommandPalette.vue
@@ -5,12 +5,9 @@ import { computed } from 'vue'
import Search from '~icons/lucide/search'
import X from '~icons/lucide/x'
-import {
- CommandPaletteRoot,
- shortcutPlatform,
- useCommandMessages,
- useCommonMessages
-} from '@open-pencil/vue'
+import { shortcutPlatform } from '@open-pencil/vue/editor/commands'
+import { useCommandMessages, useCommonMessages } from '@open-pencil/vue/i18n'
+import { CommandPaletteRoot } from '@open-pencil/vue/primitives/CommandPalette'
import { usePagePaletteGroup } from '@/app/editor/pages/palette'
import { shortcutCode } from '@/app/shell/keyboard/layout'
diff --git a/src/components/comments/CommentActionsMenu.vue b/src/components/comments/CommentActionsMenu.vue
index d2b070505..19929395d 100644
--- a/src/components/comments/CommentActionsMenu.vue
+++ b/src/components/comments/CommentActionsMenu.vue
@@ -9,7 +9,7 @@ import {
import { computed } from 'vue'
import type { CommentThread } from '@open-pencil/scene-graph'
-import { useCommentMessages, useCommonMessages } from '@open-pencil/vue'
+import { useCommentMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import { useComments } from '@/app/comments/use'
import { appMenuShortcutLabel } from '@/app/shell/menu/shortcut'
diff --git a/src/components/comments/CommentComposer.vue b/src/components/comments/CommentComposer.vue
index 3b3136e54..4cebcc2f7 100644
--- a/src/components/comments/CommentComposer.vue
+++ b/src/components/comments/CommentComposer.vue
@@ -2,7 +2,8 @@
import { useTextareaAutosize } from '@vueuse/core'
import { computed, nextTick, useTemplateRef } from 'vue'
-import { shortcutPlatform, useCommentMessages } from '@open-pencil/vue'
+import { shortcutPlatform } from '@open-pencil/vue/editor/commands'
+import { useCommentMessages } from '@open-pencil/vue/i18n'
import {
commentFormatForKey,
diff --git a/src/components/comments/CommentDeleteDialog.vue b/src/components/comments/CommentDeleteDialog.vue
index c90c069f8..18a966f62 100644
--- a/src/components/comments/CommentDeleteDialog.vue
+++ b/src/components/comments/CommentDeleteDialog.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue'
-import { useCommentMessages, useCommonMessages } from '@open-pencil/vue'
+import { useCommentMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import { useComments } from '@/app/comments/use'
import { useActionToast } from '@/app/shell/toast/action'
diff --git a/src/components/comments/CommentListItem.vue b/src/components/comments/CommentListItem.vue
index a218edfa1..9bafe0a85 100644
--- a/src/components/comments/CommentListItem.vue
+++ b/src/components/comments/CommentListItem.vue
@@ -2,8 +2,9 @@
import { uniqBy } from 'es-toolkit'
import { computed } from 'vue'
-import { liveReplies, type CommentThread } from '@open-pencil/scene-graph'
-import { useCommentMessages } from '@open-pencil/vue'
+import type { CommentThread } from '@open-pencil/scene-graph'
+import { liveReplies } from '@open-pencil/scene-graph/comments'
+import { useCommentMessages } from '@open-pencil/vue/i18n'
import { commentPreview } from '@/app/comments/format'
import AvatarStack from '@/components/presence/AvatarStack.vue'
diff --git a/src/components/comments/CommentThreadCard.vue b/src/components/comments/CommentThreadCard.vue
index cc1f6e89e..e48572f28 100644
--- a/src/components/comments/CommentThreadCard.vue
+++ b/src/components/comments/CommentThreadCard.vue
@@ -7,8 +7,9 @@ import {
} from 'reka-ui'
import { computed, ref, useTemplateRef } from 'vue'
-import { liveReplies, type CommentThread } from '@open-pencil/scene-graph'
-import { useCommentMessages, useCommonMessages } from '@open-pencil/vue'
+import type { CommentThread } from '@open-pencil/scene-graph'
+import { liveReplies } from '@open-pencil/scene-graph/comments'
+import { useCommentMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import IconButton from '@/components/ui/button/IconButton.vue'
import { useMenuUI } from '@/components/ui/menu/menu'
diff --git a/src/components/comments/CommentsLayer.vue b/src/components/comments/CommentsLayer.vue
index ccf4b0bca..cf738edf0 100644
--- a/src/components/comments/CommentsLayer.vue
+++ b/src/components/comments/CommentsLayer.vue
@@ -12,7 +12,8 @@ import { computed, ref, useTemplateRef, watch } from 'vue'
import type { ViewportTransform } from '@open-pencil/core/geometry'
import type { Vector } from '@open-pencil/scene-graph/primitives'
-import { toolCursor, useCommentMessages } from '@open-pencil/vue'
+import { toolCursor } from '@open-pencil/vue/editor/tool-cursor'
+import { useCommentMessages } from '@open-pencil/vue/i18n'
import { useComments } from '@/app/comments/use'
import { useEditorStore } from '@/app/editor/active-store'
diff --git a/src/components/comments/CommentsPanel.vue b/src/components/comments/CommentsPanel.vue
index 62e36658f..be402b88d 100644
--- a/src/components/comments/CommentsPanel.vue
+++ b/src/components/comments/CommentsPanel.vue
@@ -16,8 +16,8 @@ import {
} from 'reka-ui'
import { computed } from 'vue'
-import { commentThreadNumbers, listCommentThreads } from '@open-pencil/scene-graph'
-import { useCommentMessages } from '@open-pencil/vue'
+import { commentThreadNumbers, listCommentThreads } from '@open-pencil/scene-graph/comments'
+import { useCommentMessages } from '@open-pencil/vue/i18n'
import { useComments } from '@/app/comments/use'
import { useEditorStore } from '@/app/editor/active-store'
diff --git a/src/components/comments/author.ts b/src/components/comments/author.ts
index 00f2d2b62..a269e7452 100644
--- a/src/components/comments/author.ts
+++ b/src/components/comments/author.ts
@@ -1,5 +1,5 @@
import type { Color } from '@open-pencil/scene-graph/primitives'
-import { useCommentMessages } from '@open-pencil/vue'
+import { useCommentMessages } from '@open-pencil/vue/i18n'
import { PEER_COLORS } from '@/constants'
diff --git a/src/components/design-check/DesignCheckPanel.vue b/src/components/design-check/DesignCheckPanel.vue
index d17fea59c..43b9c3bd5 100644
--- a/src/components/design-check/DesignCheckPanel.vue
+++ b/src/components/design-check/DesignCheckPanel.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, useTemplateRef } from 'vue'
-import { useDesignCheckMessages } from '@open-pencil/vue'
+import { useDesignCheckMessages } from '@open-pencil/vue/i18n'
import { turnOffDesignCheckRule } from '@/app/settings/preferences/apply'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/design-check/DesignCheckRulesMenu.vue b/src/components/design-check/DesignCheckRulesMenu.vue
index 258debabb..f14c100ea 100644
--- a/src/components/design-check/DesignCheckRulesMenu.vue
+++ b/src/components/design-check/DesignCheckRulesMenu.vue
@@ -14,7 +14,7 @@ import {
} from 'reka-ui'
import { computed } from 'vue'
-import { useDesignCheckMessages } from '@open-pencil/vue'
+import { useDesignCheckMessages } from '@open-pencil/vue/i18n'
import {
setDesignCheckPreset,
diff --git a/src/components/design-check/IssueGroup.vue b/src/components/design-check/IssueGroup.vue
index 34a541faf..4e02d1fd8 100644
--- a/src/components/design-check/IssueGroup.vue
+++ b/src/components/design-check/IssueGroup.vue
@@ -8,7 +8,7 @@ import {
} from 'reka-ui'
import { computed, ref } from 'vue'
-import { useDesignCheckMessages } from '@open-pencil/vue'
+import { useDesignCheckMessages } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import IconButton from '@/components/ui/button/IconButton.vue'
diff --git a/src/components/design-check/IssueMarkerTooltip.vue b/src/components/design-check/IssueMarkerTooltip.vue
index e0e0e695c..d6414a8c0 100644
--- a/src/components/design-check/IssueMarkerTooltip.vue
+++ b/src/components/design-check/IssueMarkerTooltip.vue
@@ -10,7 +10,7 @@ import {
import { computed } from 'vue'
import type { PlacedIssueMarker } from '@open-pencil/core/canvas'
-import { useDesignCheckMessages } from '@open-pencil/vue'
+import { useDesignCheckMessages } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import { issueDetail, ruleTitle } from '@/app/editor/design-check/format'
diff --git a/src/components/design-check/IssueRow.vue b/src/components/design-check/IssueRow.vue
index b9e35b1d4..2a1c79a6f 100644
--- a/src/components/design-check/IssueRow.vue
+++ b/src/components/design-check/IssueRow.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useDesignCheckMessages } from '@open-pencil/vue'
+import { useDesignCheckMessages } from '@open-pencil/vue/i18n'
import Tip from '@/components/ui/overlay/Tip.vue'
import { designCheck } from '@/theme/design-check'
diff --git a/src/components/design-check/LayerIssueMark.vue b/src/components/design-check/LayerIssueMark.vue
index 76066dba8..f0ecea186 100644
--- a/src/components/design-check/LayerIssueMark.vue
+++ b/src/components/design-check/LayerIssueMark.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useDesignCheckMessages } from '@open-pencil/vue'
+import { useDesignCheckMessages } from '@open-pencil/vue/i18n'
import type { LayerIssueMark } from '@/app/editor/design-check/layers'
import SeverityIcon from '@/components/ui/feedback/SeverityIcon.vue'
diff --git a/src/components/design-check/PageIssueBadge.vue b/src/components/design-check/PageIssueBadge.vue
index 239954045..202613656 100644
--- a/src/components/design-check/PageIssueBadge.vue
+++ b/src/components/design-check/PageIssueBadge.vue
@@ -2,7 +2,7 @@
import { compact } from 'es-toolkit/array'
import { computed } from 'vue'
-import { useDesignCheckMessages } from '@open-pencil/vue'
+import { useDesignCheckMessages } from '@open-pencil/vue/i18n'
import type { DesignIssueCounts } from '@/app/editor/design-check/issues'
import Tip from '@/components/ui/overlay/Tip.vue'
diff --git a/src/components/design-check/SeverityFilters.vue b/src/components/design-check/SeverityFilters.vue
index 94a7100c5..9d4e13fd0 100644
--- a/src/components/design-check/SeverityFilters.vue
+++ b/src/components/design-check/SeverityFilters.vue
@@ -2,7 +2,7 @@
import { ToggleGroupItem, ToggleGroupRoot } from 'reka-ui'
import { computed } from 'vue'
-import { useDesignCheckMessages } from '@open-pencil/vue'
+import { useDesignCheckMessages } from '@open-pencil/vue/i18n'
import {
DESIGN_ISSUE_SEVERITIES,
diff --git a/src/components/design-check/useDesignCheckPanel.ts b/src/components/design-check/useDesignCheckPanel.ts
index 10326aa99..400d3242b 100644
--- a/src/components/design-check/useDesignCheckPanel.ts
+++ b/src/components/design-check/useDesignCheckPanel.ts
@@ -1,6 +1,6 @@
import { computed, nextTick, onBeforeUnmount, reactive, ref, watch, type Ref } from 'vue'
-import { useDesignCheckMessages } from '@open-pencil/vue'
+import { useDesignCheckMessages } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import {
diff --git a/src/components/design-check/usePresetLabels.ts b/src/components/design-check/usePresetLabels.ts
index 43cbbd76e..27ff86b0b 100644
--- a/src/components/design-check/usePresetLabels.ts
+++ b/src/components/design-check/usePresetLabels.ts
@@ -1,6 +1,6 @@
import { computed } from 'vue'
-import { useDesignCheckMessages } from '@open-pencil/vue'
+import { useDesignCheckMessages } from '@open-pencil/vue/i18n'
import type { DesignCheckPreset } from '@/app/settings/preferences/store'
diff --git a/src/components/document/UnsavedChangesDialog.vue b/src/components/document/UnsavedChangesDialog.vue
index 22dcc4cc2..7847ed9c3 100644
--- a/src/components/document/UnsavedChangesDialog.vue
+++ b/src/components/document/UnsavedChangesDialog.vue
@@ -3,7 +3,7 @@ import { useStore } from '@nanostores/vue'
import { useFocus } from '@vueuse/core'
import { useTemplateRef } from 'vue'
-import { commonMessages, filesMessages } from '@open-pencil/vue'
+import { commonMessages, filesMessages } from '@open-pencil/vue/i18n'
import { answerClosePrompt, closePrompt } from '@/app/document/close/prompt'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/editor/EditorWorkspace.vue b/src/components/editor/EditorWorkspace.vue
index 08a3c3473..4770d9107 100644
--- a/src/components/editor/EditorWorkspace.vue
+++ b/src/components/editor/EditorWorkspace.vue
@@ -3,7 +3,9 @@ import { SplitterGroup, SplitterPanel, SplitterResizeHandle } from 'reka-ui'
import { tv } from 'tailwind-variants'
import { computed } from 'vue'
-import { formatShortcut, useI18n, useViewportKind } from '@open-pencil/vue'
+import { formatShortcut } from '@open-pencil/vue/editor/commands'
+import { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
+import { useI18n } from '@open-pencil/vue/i18n'
import { provideTabEditorStore } from '@/app/editor/active-store'
import { appRuntimeConfig } from '@/app/runtime/config'
diff --git a/src/components/editor/WorkspacePill.vue b/src/components/editor/WorkspacePill.vue
index cb3e49292..66a1c11eb 100644
--- a/src/components/editor/WorkspacePill.vue
+++ b/src/components/editor/WorkspacePill.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { resolvedAppTheme } from '@/app/shell/theme'
import BrandMark from '@/components/brand/BrandMark.vue'
diff --git a/src/components/editor/ZoomDropdown.vue b/src/components/editor/ZoomDropdown.vue
index 65def72b6..231001446 100644
--- a/src/components/editor/ZoomDropdown.vue
+++ b/src/components/editor/ZoomDropdown.vue
@@ -9,7 +9,8 @@ import {
} from 'reka-ui'
import { nextTick, ref, watch } from 'vue'
-import { useEditorCommands, useI18n } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import {
diff --git a/src/components/figjam/FigJamPalette.vue b/src/components/figjam/FigJamPalette.vue
index e96cc3d3e..92ac97431 100644
--- a/src/components/figjam/FigJamPalette.vue
+++ b/src/components/figjam/FigJamPalette.vue
@@ -1,9 +1,13 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { FIGJAM_COLOR_NAMES, figJamColor, type FigJamColorName } from '@open-pencil/scene-graph'
import { colorToHex } from '@open-pencil/scene-graph/color'
-import { useFigJamMessages } from '@open-pencil/vue'
+import {
+ FIGJAM_COLOR_NAMES,
+ figJamColor,
+ type FigJamColorName
+} from '@open-pencil/scene-graph/figjam'
+import { useFigJamMessages } from '@open-pencil/vue/i18n'
import Swatches from './Swatches.vue'
diff --git a/src/components/figjam/text-options.ts b/src/components/figjam/text-options.ts
index 86b9407a2..8751269fd 100644
--- a/src/components/figjam/text-options.ts
+++ b/src/components/figjam/text-options.ts
@@ -4,8 +4,8 @@ import {
isFigJamTypeface,
type FigJamTextSize,
type FigJamTypeface
-} from '@open-pencil/scene-graph'
-import { useFigJamMessages } from '@open-pencil/vue'
+} from '@open-pencil/scene-graph/figjam'
+import { useFigJamMessages } from '@open-pencil/vue/i18n'
/** FigJam's text sizes and typefaces as select options, shared by sticky notes and shapes. */
export function useFigJamTextOptions() {
diff --git a/src/components/fill-picker/FillPicker.vue b/src/components/fill-picker/FillPicker.vue
index 3e915b72b..9819a02d1 100644
--- a/src/components/fill-picker/FillPicker.vue
+++ b/src/components/fill-picker/FillPicker.vue
@@ -4,15 +4,13 @@ import type { FocusOutsideEvent, PointerDownOutsideEvent } from 'reka-ui'
import { tv } from 'tailwind-variants'
import { computed } from 'vue'
-import type { Fill, ShaderPaint, ShaderPreset } from '@open-pencil/scene-graph'
-import {
- applySolidFillColor,
- DEFAULT_SHADER_PRESET,
- FillRoot,
- useI18n,
- useRetainedPopup
-} from '@open-pencil/vue'
-import type { OkHCLControls } from '@open-pencil/vue'
+import type { Fill } from '@open-pencil/scene-graph'
+import type { ShaderPaint, ShaderPreset } from '@open-pencil/scene-graph/shaders'
+import { applySolidFillColor, type OkHCLControls } from '@open-pencil/vue/controls/color-model'
+import { DEFAULT_SHADER_PRESET } from '@open-pencil/vue/controls/shader'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
+import { FillRoot } from '@open-pencil/vue/primitives/Fill'
import ColorPickerPanel from '@/components/color-picker-panel/ColorPickerPanel.vue'
import GradientEditor from '@/components/fill-picker/GradientEditor.vue'
diff --git a/src/components/fill-picker/GradientEditor.vue b/src/components/fill-picker/GradientEditor.vue
index ea2bb2572..828c12524 100644
--- a/src/components/fill-picker/GradientEditor.vue
+++ b/src/components/fill-picker/GradientEditor.vue
@@ -3,13 +3,13 @@ import { tv } from 'tailwind-variants'
import type { Fill } from '@open-pencil/scene-graph'
import { colorToCSS } from '@open-pencil/scene-graph/color'
+import { useI18n } from '@open-pencil/vue/i18n'
import {
GradientEditorRoot,
GradientEditorBar,
- GradientEditorStop,
- inputValue,
- useI18n
-} from '@open-pencil/vue'
+ GradientEditorStop
+} from '@open-pencil/vue/primitives/GradientEditor'
+import { inputValue } from '@open-pencil/vue/shared/dom-events'
import ColorPickerPanel from '@/components/color-picker-panel/ColorPickerPanel.vue'
import NumberField from '@/components/inputs/NumberField.vue'
diff --git a/src/components/fill-picker/ImageFillPicker.vue b/src/components/fill-picker/ImageFillPicker.vue
index 113724cfe..3a76227ba 100644
--- a/src/components/fill-picker/ImageFillPicker.vue
+++ b/src/components/fill-picker/ImageFillPicker.vue
@@ -4,7 +4,7 @@ import { computed } from 'vue'
import type { Fill, ImageScaleMode } from '@open-pencil/scene-graph'
import { coverImageTransform } from '@open-pencil/scene-graph/images'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import NumberField from '@/components/inputs/NumberField.vue'
diff --git a/src/components/fill-picker/shader/ShaderEffectControls.vue b/src/components/fill-picker/shader/ShaderEffectControls.vue
index 4a6761c9f..5c21b74bf 100644
--- a/src/components/fill-picker/shader/ShaderEffectControls.vue
+++ b/src/components/fill-picker/shader/ShaderEffectControls.vue
@@ -1,10 +1,12 @@
<script setup lang="ts">
import { computed } from 'vue'
-import type { ShaderComponent } from '@open-pencil/scene-graph'
import { colorToHexRaw, parseColor } from '@open-pencil/scene-graph/color'
import type { Color, Vector } from '@open-pencil/scene-graph/primitives'
-import { inputChecked, useI18n, type ShaderEffect, type ShaderPropControl } from '@open-pencil/vue'
+import type { ShaderComponent } from '@open-pencil/scene-graph/shaders'
+import type { ShaderEffect, ShaderPropControl } from '@open-pencil/vue/controls/shader'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { inputChecked } from '@open-pencil/vue/shared/dom-events'
import ColorInput from '@/components/ColorPicker/ColorInput.vue'
import NumberField from '@/components/inputs/NumberField.vue'
diff --git a/src/components/fill-picker/shader/ShaderEffectThumb.vue b/src/components/fill-picker/shader/ShaderEffectThumb.vue
index 6bfaff668..b8bac32df 100644
--- a/src/components/fill-picker/shader/ShaderEffectThumb.vue
+++ b/src/components/fill-picker/shader/ShaderEffectThumb.vue
@@ -2,7 +2,7 @@
import { useIntersectionObserver } from '@vueuse/core'
import { ref, useTemplateRef } from 'vue'
-import { shaderEffectPreview, type ShaderEffect } from '@open-pencil/vue'
+import { shaderEffectPreview, type ShaderEffect } from '@open-pencil/vue/controls/shader'
/** A small still of an effect, drawn the first time its row scrolls into view. */
const { effect } = defineProps<{ effect?: ShaderEffect }>()
diff --git a/src/components/fill-picker/shader/ShaderFillPicker.vue b/src/components/fill-picker/shader/ShaderFillPicker.vue
index 414f03923..e5019892d 100644
--- a/src/components/fill-picker/shader/ShaderFillPicker.vue
+++ b/src/components/fill-picker/shader/ShaderFillPicker.vue
@@ -1,10 +1,10 @@
<script setup lang="ts">
import { computed, onMounted, ref, shallowRef, type ComponentPublicInstance } from 'vue'
-import type { ShaderPreset } from '@open-pencil/scene-graph'
+import type { ShaderPreset } from '@open-pencil/scene-graph/shaders'
+import { canDrawShaders } from '@open-pencil/vue/canvas/surface'
import {
addShaderEffect,
- canDrawShaders,
DEFAULT_SHADER_EFFECT,
loadShaderCatalog,
moveShaderEffect,
@@ -13,10 +13,10 @@ import {
setShaderEffectProp,
shaderEffectLabel,
shaderPresetJSON,
- useFlatReorderDrag,
- useI18n,
type ShaderEffect
-} from '@open-pencil/vue'
+} from '@open-pencil/vue/controls/shader'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useFlatReorderDrag } from '@open-pencil/vue/shared/drag'
import ShaderEffectControls from '@/components/fill-picker/shader/ShaderEffectControls.vue'
import ShaderEffectThumb from '@/components/fill-picker/shader/ShaderEffectThumb.vue'
diff --git a/src/components/font-picker/FontPicker.vue b/src/components/font-picker/FontPicker.vue
index f9e962025..3e8a3a4e0 100644
--- a/src/components/font-picker/FontPicker.vue
+++ b/src/components/font-picker/FontPicker.vue
@@ -2,8 +2,8 @@
import { computed } from 'vue'
import { WEB_FONT_PROVIDER_IDS } from '@open-pencil/core/text'
-import { FontPickerRoot, useI18n } from '@open-pencil/vue'
-import type { FontPickerUI } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { FontPickerRoot, type FontPickerUI } from '@open-pencil/vue/primitives/FontPicker'
import {
listFamilies,
diff --git a/src/components/font-settings/FontSettingsPopover.vue b/src/components/font-settings/FontSettingsPopover.vue
index 015e236ae..ec416f31a 100644
--- a/src/components/font-settings/FontSettingsPopover.vue
+++ b/src/components/font-settings/FontSettingsPopover.vue
@@ -4,7 +4,9 @@ import { onMounted } from 'vue'
import { WEB_FONT_PROVIDER_IDS, WEB_FONT_PROVIDER_LABELS } from '@open-pencil/core/text'
import type { WebFontProviderId } from '@open-pencil/core/text'
-import { useI18n, useRetainedPopup, vTestId } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
+import { vTestId } from '@open-pencil/vue/testing'
import { isTauri } from '@/app/tauri/env'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/font-settings/use.ts b/src/components/font-settings/use.ts
index 3baffb3cc..a6be4fa29 100644
--- a/src/components/font-settings/use.ts
+++ b/src/components/font-settings/use.ts
@@ -5,7 +5,7 @@ import type {
LocalFontAccessState,
WebFontProviderId
} from '@open-pencil/core/text'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import {
clearDownloadedFontCache,
diff --git a/src/components/font-status/FontStatusBanner.vue b/src/components/font-status/FontStatusBanner.vue
index 7d21aa639..0cf52631a 100644
--- a/src/components/font-status/FontStatusBanner.vue
+++ b/src/components/font-status/FontStatusBanner.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useDocumentFontStatus } from '@/app/editor/fonts/status'
import Tip from '@/components/ui/overlay/Tip.vue'
diff --git a/src/components/home/HomeWorkspace.vue b/src/components/home/HomeWorkspace.vue
index 50a4fe748..4f5cb5884 100644
--- a/src/components/home/HomeWorkspace.vue
+++ b/src/components/home/HomeWorkspace.vue
@@ -2,7 +2,9 @@
import { useLocalStorage } from '@vueuse/core'
import { computed, ref, watch } from 'vue'
-import { useDocumentWorkspace, useI18n, useViewportKind } from '@open-pencil/vue'
+import { useDocumentWorkspace } from '@open-pencil/vue/document/workspace'
+import { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
+import { useI18n } from '@open-pencil/vue/i18n'
import { CLOUD_INCLUDED, CLOUD_STORAGE_PROVIDER_ID } from '@/app/cloud/integration'
import { useHomeLocations } from '@/app/home/locations'
diff --git a/src/components/home/cloud/CloudSharedSection.vue b/src/components/home/cloud/CloudSharedSection.vue
index afc11df0d..adb9393f3 100644
--- a/src/components/home/cloud/CloudSharedSection.vue
+++ b/src/components/home/cloud/CloudSharedSection.vue
@@ -3,7 +3,7 @@ import { useAsyncState, useLocalStorage } from '@vueuse/core'
import { computed, watch } from 'vue'
import type { SharedDocument } from '@open-pencil/cloud/contract'
-import { useCloudMessages, useI18n } from '@open-pencil/vue'
+import { useCloudMessages, useI18n } from '@open-pencil/vue/i18n'
import { findCloudServer } from '@/app/cloud/servers/store'
import { cloudAPIClient, cloudConnection } from '@/app/cloud/sessions/connection'
diff --git a/src/components/home/cloud/CloudSyncIcon.vue b/src/components/home/cloud/CloudSyncIcon.vue
index 99c28bfe4..eb8caca68 100644
--- a/src/components/home/cloud/CloudSyncIcon.vue
+++ b/src/components/home/cloud/CloudSyncIcon.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useCloudMessages } from '@open-pencil/vue'
+import { useCloudMessages } from '@open-pencil/vue/i18n'
import Tip from '@/components/ui/overlay/Tip.vue'
diff --git a/src/components/home/cloud/CloudWorkspaceSection.vue b/src/components/home/cloud/CloudWorkspaceSection.vue
index 887f39e43..28c9ee162 100644
--- a/src/components/home/cloud/CloudWorkspaceSection.vue
+++ b/src/components/home/cloud/CloudWorkspaceSection.vue
@@ -2,7 +2,8 @@
import { computedAsync, useLocalStorage, useOnline } from '@vueuse/core'
import { computed, shallowRef, watch } from 'vue'
-import { useCloudMessages, useDocumentWorkspace, useI18n } from '@open-pencil/vue'
+import { useDocumentWorkspace } from '@open-pencil/vue/document/workspace'
+import { useCloudMessages, useI18n } from '@open-pencil/vue/i18n'
import { cloudSyncState } from '@/app/cloud/documents/status'
import { findCloudServer } from '@/app/cloud/servers/store'
diff --git a/src/components/home/cloud/CloudWorkspaceView.vue b/src/components/home/cloud/CloudWorkspaceView.vue
index 4fcb44799..4ab9d2e71 100644
--- a/src/components/home/cloud/CloudWorkspaceView.vue
+++ b/src/components/home/cloud/CloudWorkspaceView.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useCloudMessages, useCommonMessages } from '@open-pencil/vue'
+import { useCloudMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import { formatStorageBytes } from '@/app/storage/format-bytes'
import DocumentEntry from '@/components/home/document/DocumentEntry.vue'
diff --git a/src/components/home/search/HomeJoinRoom.vue b/src/components/home/search/HomeJoinRoom.vue
index 66a897bab..e2c67cc60 100644
--- a/src/components/home/search/HomeJoinRoom.vue
+++ b/src/components/home/search/HomeJoinRoom.vue
@@ -2,7 +2,7 @@
import { PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger } from 'reka-ui'
import { ref } from 'vue'
-import { useCollaborationMessages } from '@open-pencil/vue'
+import { useCollaborationMessages } from '@open-pencil/vue/i18n'
import { useJoinRoom } from '@/app/collab/join'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/home/search/HomeSearchActions.vue b/src/components/home/search/HomeSearchActions.vue
index 2d5ceeee3..07fa8b78b 100644
--- a/src/components/home/search/HomeSearchActions.vue
+++ b/src/components/home/search/HomeSearchActions.vue
@@ -2,7 +2,8 @@
import { templateRef } from '@vueuse/core'
import { nextTick, watch } from 'vue'
-import { useI18n, useViewportKind } from '@open-pencil/vue'
+import { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
+import { useI18n } from '@open-pencil/vue/i18n'
import { openFileDialog } from '@/app/shell/menu/use'
import { activeTab } from '@/app/tabs'
diff --git a/src/components/home/sidebar/HomeLocationMenu.vue b/src/components/home/sidebar/HomeLocationMenu.vue
index cf71af924..dc0d5e705 100644
--- a/src/components/home/sidebar/HomeLocationMenu.vue
+++ b/src/components/home/sidebar/HomeLocationMenu.vue
@@ -11,7 +11,7 @@ import {
} from 'reka-ui'
import { computed } from 'vue'
-import { useCloudMessages } from '@open-pencil/vue'
+import { useCloudMessages } from '@open-pencil/vue/i18n'
import { menu } from '@/components/ui/menu/menu'
import { homeLocationMenu } from '@/theme/home/location-menu'
diff --git a/src/components/home/sidebar/HomeSidebar.vue b/src/components/home/sidebar/HomeSidebar.vue
index 8071ff15f..e45b5b8e9 100644
--- a/src/components/home/sidebar/HomeSidebar.vue
+++ b/src/components/home/sidebar/HomeSidebar.vue
@@ -10,7 +10,7 @@ import {
} from 'reka-ui'
import { computed } from 'vue'
-import { useCloudMessages } from '@open-pencil/vue'
+import { useCloudMessages } from '@open-pencil/vue/i18n'
import IconButton from '@/components/ui/button/IconButton.vue'
import { menu } from '@/components/ui/menu/menu'
diff --git a/src/components/icon-picker/IconPicker.vue b/src/components/icon-picker/IconPicker.vue
index 7a65bedb7..746159777 100644
--- a/src/components/icon-picker/IconPicker.vue
+++ b/src/components/icon-picker/IconPicker.vue
@@ -2,8 +2,9 @@
import { compact } from 'es-toolkit'
import { computed, ref, watch } from 'vue'
-import { iconNames } from '@open-pencil/scene-graph'
-import { useCommonMessages, useIconSearch, usePanelMessages } from '@open-pencil/vue'
+import { iconNames } from '@open-pencil/scene-graph/icons'
+import { useIconSearch } from '@open-pencil/vue/controls/icon'
+import { useCommonMessages, usePanelMessages } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import { lastIconSet, recentIcons, rememberIcon } from '@/app/editor/icon-picker/history'
diff --git a/src/components/icon-picker/InsertIconButton.vue b/src/components/icon-picker/InsertIconButton.vue
index 09731e7e1..b1fae4f4d 100644
--- a/src/components/icon-picker/InsertIconButton.vue
+++ b/src/components/icon-picker/InsertIconButton.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import IconSmilePlus from '~icons/lucide/smile-plus'
-import { usePanelMessages } from '@open-pencil/vue'
+import { usePanelMessages } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import { toast } from '@/app/shell/ui'
diff --git a/src/components/icons/index.ts b/src/components/icons/index.ts
index 9215a6702..c7c986f86 100644
--- a/src/components/icons/index.ts
+++ b/src/components/icons/index.ts
@@ -26,9 +26,12 @@ import IconStickyNote from '~icons/lucide/sticky-note'
import IconTriangle from '~icons/lucide/triangle'
import IconType from '~icons/lucide/type'
-import { readIcon, slotPropertyId, type SceneNode } from '@open-pencil/scene-graph'
+import type { Tool } from '@open-pencil/core'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { readIcon } from '@open-pencil/scene-graph/icons'
import type { ShapeWithTextType } from '@open-pencil/scene-graph/shape-with-text'
-import type { LayerOutline, Tool } from '@open-pencil/vue'
+import { slotPropertyId } from '@open-pencil/scene-graph/slots'
+import type { LayerOutline } from '@open-pencil/vue/primitives/LayerTree'
import { outlineIcon } from './outlines'
import { SHAPE_KIND_ICONS } from './shapes'
diff --git a/src/components/icons/outlines.ts b/src/components/icons/outlines.ts
index 0fa1f8560..a3b2e7de4 100644
--- a/src/components/icons/outlines.ts
+++ b/src/components/icons/outlines.ts
@@ -1,10 +1,10 @@
import { toRaw, type FunctionalComponent } from 'vue'
-import { nodeOutlinePath } from '@open-pencil/core/io'
-import { validateVectorNetwork } from '@open-pencil/scene-graph'
+import { nodeOutlinePath } from '@open-pencil/core/io/formats/svg'
import { getNodeLocalMatrix } from '@open-pencil/scene-graph/coordinate'
import Matrix from '@open-pencil/scene-graph/matrix'
-import type { LayerOutline } from '@open-pencil/vue'
+import { validateVectorNetwork } from '@open-pencil/scene-graph/vector-network'
+import type { LayerOutline } from '@open-pencil/vue/primitives/LayerTree'
import { maskIcon } from './mask'
diff --git a/src/components/inputs/NumberField.vue b/src/components/inputs/NumberField.vue
index 105597549..e7842f964 100644
--- a/src/components/inputs/NumberField.vue
+++ b/src/components/inputs/NumberField.vue
@@ -1,11 +1,11 @@
<script lang="ts">
import type { VNode } from 'vue'
+import type { NumberExpressionError } from '@open-pencil/vue/controls/number-expression'
import type {
- NumberExpressionError,
NumberFieldEditPolicy,
NumberFieldSlotProps
-} from '@open-pencil/vue'
+} from '@open-pencil/vue/primitives/NumberField'
import type { ComponentUI } from '@/components/ui/types'
import type { NumberFieldTheme } from '@/theme/input/number-field'
@@ -41,7 +41,12 @@ export interface NumberFieldSlots {
import { tv } from 'tailwind-variants'
import { computed, normalizeClass, useAttrs } from 'vue'
-import { NumberFieldRoot, NumberFieldInput, NumberFieldValue, useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import {
+ NumberFieldRoot,
+ NumberFieldInput,
+ NumberFieldValue
+} from '@open-pencil/vue/primitives/NumberField'
import { useEditorStore } from '@/app/editor/active-store'
import theme from '@/theme/input/number-field'
diff --git a/src/components/libraries/LibraryManagerDialog.vue b/src/components/libraries/LibraryManagerDialog.vue
index c2162ff83..eff13bd34 100644
--- a/src/components/libraries/LibraryManagerDialog.vue
+++ b/src/components/libraries/LibraryManagerDialog.vue
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { nextTick, watch } from 'vue'
-import { useI18n, useViewportKind } from '@open-pencil/vue'
+import { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import { openLibraryReview, openPublishLibraryDialog, useLibraryService } from '@/app/libraries'
diff --git a/src/components/libraries/PublishLibraryDialog.vue b/src/components/libraries/PublishLibraryDialog.vue
index 82b221d45..05ab3fd4c 100644
--- a/src/components/libraries/PublishLibraryDialog.vue
+++ b/src/components/libraries/PublishLibraryDialog.vue
@@ -7,7 +7,7 @@ import {
publishableLibraryRoots,
readSourceLibraryPublication
} from '@open-pencil/core/library'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import { publishLibraryDialogOpen, useLibraryService } from '@/app/libraries'
diff --git a/src/components/libraries/review/LibraryComparisonPreview.vue b/src/components/libraries/review/LibraryComparisonPreview.vue
index c8ad32602..0e53fe386 100644
--- a/src/components/libraries/review/LibraryComparisonPreview.vue
+++ b/src/components/libraries/review/LibraryComparisonPreview.vue
@@ -2,7 +2,7 @@
import { useObjectUrl } from '@vueuse/core'
import { shallowRef, watch } from 'vue'
-import { renderNodesToImage } from '@open-pencil/core/io'
+import { renderNodesToImage } from '@open-pencil/core/io/formats/raster'
import type { SceneGraph } from '@open-pencil/scene-graph'
import { useEditorStore } from '@/app/editor/active-store'
diff --git a/src/components/libraries/review/LibraryUpdateReviewDialog.vue b/src/components/libraries/review/LibraryUpdateReviewDialog.vue
index 2e6b4e97f..40e212287 100644
--- a/src/components/libraries/review/LibraryUpdateReviewDialog.vue
+++ b/src/components/libraries/review/LibraryUpdateReviewDialog.vue
@@ -3,7 +3,7 @@ import { SliderRange, SliderRoot, SliderThumb, SliderTrack } from 'reka-ui'
import { computed, ref, shallowRef, watch } from 'vue'
import { createLibraryUpdatePreview, type LibraryUpdatePreview } from '@open-pencil/core/library'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import { notificationMessages } from '@/app/i18n/notifications'
diff --git a/src/components/presence/AvatarStack.vue b/src/components/presence/AvatarStack.vue
index c7aeec525..a633ac355 100644
--- a/src/components/presence/AvatarStack.vue
+++ b/src/components/presence/AvatarStack.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useCommonMessages } from '@open-pencil/vue'
+import { useCommonMessages } from '@open-pencil/vue/i18n'
import { avatarStack } from '@/theme/collaboration/avatar/stack'
diff --git a/src/components/presence/FollowFrame.vue b/src/components/presence/FollowFrame.vue
index 0e0a41f64..facfc9d7f 100644
--- a/src/components/presence/FollowFrame.vue
+++ b/src/components/presence/FollowFrame.vue
@@ -3,7 +3,7 @@ import { useEventListener } from '@vueuse/core'
import { computed } from 'vue'
import { colorToCSS, darkenForContrast } from '@open-pencil/scene-graph/color'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { FollowedLabel } from '@/app/presence/registry'
import { isEditing } from '@/app/shell/keyboard/focus'
diff --git a/src/components/presence/PagePresenceHover.vue b/src/components/presence/PagePresenceHover.vue
index ddd885214..e344f1b32 100644
--- a/src/components/presence/PagePresenceHover.vue
+++ b/src/components/presence/PagePresenceHover.vue
@@ -2,7 +2,7 @@
import { HoverCardContent, HoverCardPortal, HoverCardRoot, HoverCardTrigger } from 'reka-ui'
import { computed } from 'vue'
-import { useCollaborationMessages } from '@open-pencil/vue'
+import { useCollaborationMessages } from '@open-pencil/vue/i18n'
import { DEFAULT_COLLAB_STATE, useCollabInjected } from '@/app/collab/use'
import { useActiveEditorStoreRef } from '@/app/editor/active-store'
diff --git a/src/components/presence/PersonAvatar.vue b/src/components/presence/PersonAvatar.vue
index efe4a9b63..de683bc84 100644
--- a/src/components/presence/PersonAvatar.vue
+++ b/src/components/presence/PersonAvatar.vue
@@ -3,7 +3,7 @@ import { computed } from 'vue'
import { colorToCSS } from '@open-pencil/scene-graph/color'
import type { Color } from '@open-pencil/scene-graph/primitives'
-import { useCollaborationMessages } from '@open-pencil/vue'
+import { useCollaborationMessages } from '@open-pencil/vue/i18n'
import { initials } from '@/app/presence/initials'
import { avatar } from '@/theme/collaboration/avatar/person'
diff --git a/src/components/presence/PresenceList.vue b/src/components/presence/PresenceList.vue
index 65f664904..65f1251b6 100644
--- a/src/components/presence/PresenceList.vue
+++ b/src/components/presence/PresenceList.vue
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { colorToCSS } from '@open-pencil/scene-graph/color'
-import { useI18n, useInlineRename } from '@open-pencil/vue'
+import { useInlineRename } from '@open-pencil/vue/editor/inline-rename'
+import { useI18n } from '@open-pencil/vue/i18n'
import { initials } from '@/app/presence/initials'
import type { FollowTarget } from '@/app/presence/types'
diff --git a/src/components/properties/AppearanceSection.vue b/src/components/properties/AppearanceSection.vue
index 68db59965..a42161fb6 100644
--- a/src/components/properties/AppearanceSection.vue
+++ b/src/components/properties/AppearanceSection.vue
@@ -1,7 +1,10 @@
<script setup lang="ts">
import type { BlendMode } from '@open-pencil/scene-graph'
import { POINT_COUNT_RANGE } from '@open-pencil/scene-graph/polygon'
-import { AppearanceControlsRoot, MIXED, useI18n, useVariableModes } from '@open-pencil/vue'
+import { MIXED } from '@open-pencil/vue/controls/node-props'
+import { useVariableModes } from '@open-pencil/vue/controls/variable-modes'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { AppearanceControlsRoot } from '@open-pencil/vue/primitives/AppearanceControls'
import NumberField from '@/components/inputs/NumberField.vue'
import { useBlendModeGroups } from '@/components/properties/blend-mode/use'
diff --git a/src/components/properties/BooleanOperationsControl.vue b/src/components/properties/BooleanOperationsControl.vue
index aa63d942d..41b42e57d 100644
--- a/src/components/properties/BooleanOperationsControl.vue
+++ b/src/components/properties/BooleanOperationsControl.vue
@@ -17,10 +17,10 @@ import {
editorCommandMetadata,
formatShortcut,
useEditorCommands,
- useI18n,
- useRetainedPopup
-} from '@open-pencil/vue'
-import type { EditorCommandId } from '@open-pencil/vue'
+ type EditorCommandId
+} from '@open-pencil/vue/editor/commands'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
import { menuItem, useMenuUI } from '@/components/ui/menu/menu'
import MenuScrollArea from '@/components/ui/menu/MenuScrollArea.vue'
diff --git a/src/components/properties/DocumentSection.vue b/src/components/properties/DocumentSection.vue
index 7f0aec271..2bc0ba960 100644
--- a/src/components/properties/DocumentSection.vue
+++ b/src/components/properties/DocumentSection.vue
@@ -1,8 +1,9 @@
<script setup lang="ts">
import { computed } from 'vue'
-import type { FigCompression } from '@open-pencil/scene-graph'
-import { useI18n, useSceneComputed } from '@open-pencil/vue'
+import type { FigCompression } from '@open-pencil/scene-graph/fig-compression'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useSceneComputed } from '@open-pencil/vue/internal/scene-computed'
import { useEditorStore } from '@/app/editor/active-store'
import PanelFieldGroup from '@/components/ui/panel/PanelFieldGroup.vue'
diff --git a/src/components/properties/EffectsSection.vue b/src/components/properties/EffectsSection.vue
index e83870934..0303fe088 100644
--- a/src/components/properties/EffectsSection.vue
+++ b/src/components/properties/EffectsSection.vue
@@ -1,6 +1,7 @@
<script setup lang="ts">
import type { Effect, Fill } from '@open-pencil/scene-graph'
-import { useEffectsControls, useI18n } from '@open-pencil/vue'
+import { useEffectsControls } from '@open-pencil/vue/controls/effects'
+import { useI18n } from '@open-pencil/vue/i18n'
import ColorInput from '@/components/ColorPicker/ColorInput.vue'
import NumberField from '@/components/inputs/NumberField.vue'
diff --git a/src/components/properties/ExportScaleInput.vue b/src/components/properties/ExportScaleInput.vue
index d8b119ad6..bbf13760b 100644
--- a/src/components/properties/ExportScaleInput.vue
+++ b/src/components/properties/ExportScaleInput.vue
@@ -8,7 +8,7 @@ import {
} from 'reka-ui'
import { onDeactivated, ref, watch } from 'vue'
-import { useRetainedPopup } from '@open-pencil/vue'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
import { useInputUI } from '@/components/ui/input/input'
import { menuItem, useMenuUI } from '@/components/ui/menu/menu'
diff --git a/src/components/properties/ExportSection.vue b/src/components/properties/ExportSection.vue
index ade4626ff..276716fcb 100644
--- a/src/components/properties/ExportSection.vue
+++ b/src/components/properties/ExportSection.vue
@@ -2,7 +2,9 @@
import { tryOnScopeDispose, useObjectUrl } from '@vueuse/core'
import { computed, onActivated, onDeactivated, ref, shallowRef, watch } from 'vue'
-import { useExport, useI18n, useRetainedActivity } from '@open-pencil/vue'
+import { useExport } from '@open-pencil/vue/document/export'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useRetainedActivity } from '@open-pencil/vue/lifecycle/retention'
import { useEditorStore } from '@/app/editor/active-store'
import ExportScaleInput from '@/components/properties/ExportScaleInput.vue'
diff --git a/src/components/properties/FillSection.vue b/src/components/properties/FillSection.vue
index ea07c47fa..f783dbde8 100644
--- a/src/components/properties/FillSection.vue
+++ b/src/components/properties/FillSection.vue
@@ -1,15 +1,16 @@
<script setup lang="ts">
-import { shaderOfPaint, type Fill, type SceneNode } from '@open-pencil/scene-graph'
+import type { Fill, SceneNode } from '@open-pencil/scene-graph'
import { colorToHexRaw } from '@open-pencil/scene-graph/color'
import type { Color } from '@open-pencil/scene-graph/primitives'
+import { shaderOfPaint } from '@open-pencil/scene-graph/shaders'
+import { useColorBindingProvider } from '@open-pencil/vue/controls/binding-provider'
+import { useFillControls } from '@open-pencil/vue/controls/fill'
+import { useOkHCL } from '@open-pencil/vue/controls/okhcl'
+import { useI18n } from '@open-pencil/vue/i18n'
import {
BindableValueRoot,
- useColorBindingProvider,
- useFillControls,
- useI18n,
- useOkHCL
-} from '@open-pencil/vue'
-import type { BindableValueActions } from '@open-pencil/vue'
+ type BindableValueActions
+} from '@open-pencil/vue/primitives/BindableValue'
import { useEditorStore } from '@/app/editor/active-store'
import FillPicker from '@/components/fill-picker/FillPicker.vue'
diff --git a/src/components/properties/IconSection.vue b/src/components/properties/IconSection.vue
index f69ae11e7..ca34af699 100644
--- a/src/components/properties/IconSection.vue
+++ b/src/components/properties/IconSection.vue
@@ -2,8 +2,9 @@
import { tv } from 'tailwind-variants'
import { ref, watch } from 'vue'
-import { iconLayerName } from '@open-pencil/scene-graph'
-import { useCommonMessages, useIcon, usePanelMessages } from '@open-pencil/vue'
+import { iconLayerName } from '@open-pencil/scene-graph/icons'
+import { useIcon } from '@open-pencil/vue/controls/icon'
+import { useCommonMessages, usePanelMessages } from '@open-pencil/vue/i18n'
import ColorInput from '@/components/ColorPicker/ColorInput.vue'
import IconPicker from '@/components/icon-picker/IconPicker.vue'
diff --git a/src/components/properties/LayerTypeMenu.vue b/src/components/properties/LayerTypeMenu.vue
index e096ff6df..ebb58b17f 100644
--- a/src/components/properties/LayerTypeMenu.vue
+++ b/src/components/properties/LayerTypeMenu.vue
@@ -10,9 +10,10 @@ import type { Component } from 'vue'
import IconCheck from '~icons/lucide/check'
import IconChevronDown from '~icons/lucide/chevron-down'
-import { layerTypeOptions, type LayerType } from '@open-pencil/core/editor'
+import { layerTypeOptions, type LayerType } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
-import { useI18n, useRetainedPopup } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
import { useEditorStore } from '@/app/editor/active-store'
import { NODE_ICONS } from '@/components/icons'
diff --git a/src/components/properties/MaskSection.vue b/src/components/properties/MaskSection.vue
index 5da4f0a35..972f5e862 100644
--- a/src/components/properties/MaskSection.vue
+++ b/src/components/properties/MaskSection.vue
@@ -2,7 +2,8 @@
import { computed } from 'vue'
import type { MaskType } from '@open-pencil/scene-graph'
-import { useI18n, useMask } from '@open-pencil/vue'
+import { useMask } from '@open-pencil/vue/controls/mask'
+import { useI18n } from '@open-pencil/vue/i18n'
import PanelFieldGroup from '@/components/ui/panel/PanelFieldGroup.vue'
import PanelSection from '@/components/ui/panel/PanelSection.vue'
diff --git a/src/components/properties/PageSection.vue b/src/components/properties/PageSection.vue
index 1fca0fc84..d9fd5001e 100644
--- a/src/components/properties/PageSection.vue
+++ b/src/components/properties/PageSection.vue
@@ -1,8 +1,10 @@
<script setup lang="ts">
import { computed } from 'vue'
-import type { Color, Fill } from '@open-pencil/scene-graph'
-import { useI18n, useVariableModes } from '@open-pencil/vue'
+import type { Fill } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import { useVariableModes } from '@open-pencil/vue/controls/variable-modes'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import ColorPicker from '@/components/ColorPicker/ColorPicker.vue'
diff --git a/src/components/properties/PositionSection.vue b/src/components/properties/PositionSection.vue
index c77fd3640..a2e804675 100644
--- a/src/components/properties/PositionSection.vue
+++ b/src/components/properties/PositionSection.vue
@@ -1,5 +1,6 @@
<script setup lang="ts">
-import { PositionControlsRoot, useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { PositionControlsRoot } from '@open-pencil/vue/primitives/PositionControls'
import { useEditorStore } from '@/app/editor/active-store'
import NumberField from '@/components/inputs/NumberField.vue'
diff --git a/src/components/properties/PropertyListRoot.vue b/src/components/properties/PropertyListRoot.vue
index 680ea96b7..fae482e06 100644
--- a/src/components/properties/PropertyListRoot.vue
+++ b/src/components/properties/PropertyListRoot.vue
@@ -2,11 +2,12 @@
import type { VNode } from 'vue'
import type { SceneNode } from '@open-pencil/scene-graph'
+import { useEditorPropertyList } from '@open-pencil/vue/controls/property-list'
import {
PropertyListRoot as HeadlessPropertyListRoot,
- useEditorPropertyList
-} from '@open-pencil/vue'
-import type { PropertyListKey, PropertyListRootSlotProps } from '@open-pencil/vue'
+ type PropertyListKey,
+ type PropertyListRootSlotProps
+} from '@open-pencil/vue/primitives/PropertyList'
const { propKey, label } = defineProps<{
propKey: K
diff --git a/src/components/properties/SelectionActionsControl.vue b/src/components/properties/SelectionActionsControl.vue
index 542ee14f1..8624ecc1a 100644
--- a/src/components/properties/SelectionActionsControl.vue
+++ b/src/components/properties/SelectionActionsControl.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useEditorCommands } from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
import BooleanOperationsControl from '@/components/properties/BooleanOperationsControl.vue'
import IconButton from '@/components/ui/button/IconButton.vue'
diff --git a/src/components/properties/TypographySection.vue b/src/components/properties/TypographySection.vue
index 51164caaf..2234798b9 100644
--- a/src/components/properties/TypographySection.vue
+++ b/src/components/properties/TypographySection.vue
@@ -1,7 +1,9 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { MIXED, TypographyControlsRoot, useI18n, type MixedValue } from '@open-pencil/vue'
+import { MIXED, type MixedValue } from '@open-pencil/vue/controls/node-props'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { TypographyControlsRoot } from '@open-pencil/vue/primitives/TypographyControls'
import { loadFont } from '@/app/editor/fonts'
import { appMenuShortcutLabel } from '@/app/shell/menu/shortcut'
diff --git a/src/components/properties/VariableNumberField.vue b/src/components/properties/VariableNumberField.vue
index 31e977d46..e15670e68 100644
--- a/src/components/properties/VariableNumberField.vue
+++ b/src/components/properties/VariableNumberField.vue
@@ -1,8 +1,13 @@
<script setup lang="ts">
import { computed, useAttrs } from 'vue'
-import { BindableValueRoot, useI18n, useNumberBindingProvider } from '@open-pencil/vue'
-import type { BindingTarget, NumberBindingPath } from '@open-pencil/vue'
+import {
+ useNumberBindingProvider,
+ type BindingTarget
+} from '@open-pencil/vue/controls/binding-provider'
+import type { NumberBindingPath } from '@open-pencil/vue/controls/number-variable-binding'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { BindableValueRoot } from '@open-pencil/vue/primitives/BindableValue'
import NumberField from '@/components/inputs/NumberField.vue'
import VariableBindingPicker from '@/components/properties/binding/VariableBindingPicker.vue'
diff --git a/src/components/properties/VariablesSection.vue b/src/components/properties/VariablesSection.vue
index 1400b15ed..c0161ce12 100644
--- a/src/components/properties/VariablesSection.vue
+++ b/src/components/properties/VariablesSection.vue
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n, useSceneComputed } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useSceneComputed } from '@open-pencil/vue/internal/scene-computed'
import { useEditorStore } from '@/app/editor/active-store'
import IconButton from '@/components/ui/button/IconButton.vue'
diff --git a/src/components/properties/binding/FieldBindingPicker.vue b/src/components/properties/binding/FieldBindingPicker.vue
index 9a808c433..dff4fb52d 100644
--- a/src/components/properties/binding/FieldBindingPicker.vue
+++ b/src/components/properties/binding/FieldBindingPicker.vue
@@ -1,8 +1,10 @@
<script setup lang="ts">
import { computed, useSlots } from 'vue'
-import { variableText } from '@open-pencil/scene-graph'
-import { useBindableValue, useEditor, useI18n } from '@open-pencil/vue'
+import { variableText } from '@open-pencil/scene-graph/variables'
+import { useEditor } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useBindableValue } from '@open-pencil/vue/primitives/BindableValue'
import PropertyTypeIcon from '@/components/properties/component-properties/PropertyTypeIcon.vue'
import { usePropertyBinding } from '@/components/properties/component-properties/usePropertyBinding'
diff --git a/src/components/properties/binding/VariableBindingPicker.vue b/src/components/properties/binding/VariableBindingPicker.vue
index 789d308fa..14c4d22b7 100644
--- a/src/components/properties/binding/VariableBindingPicker.vue
+++ b/src/components/properties/binding/VariableBindingPicker.vue
@@ -21,7 +21,7 @@ export interface VariableBindingPickerProps {
import { computed } from 'vue'
import type { Color } from '@open-pencil/scene-graph/primitives'
-import { useBindableValue } from '@open-pencil/vue'
+import { useBindableValue } from '@open-pencil/vue/primitives/BindableValue'
import { VariablePicker, type VariablePickerItem } from '@/components/ui/binding'
diff --git a/src/components/properties/binding/VariableBoundRow.vue b/src/components/properties/binding/VariableBoundRow.vue
index d31d1cc33..1e0d5c034 100644
--- a/src/components/properties/binding/VariableBoundRow.vue
+++ b/src/components/properties/binding/VariableBoundRow.vue
@@ -1,8 +1,11 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { variableText } from '@open-pencil/scene-graph'
-import { BindableValueRoot, useEditor, useI18n, type BindingProvider } from '@open-pencil/vue'
+import { variableText } from '@open-pencil/scene-graph/variables'
+import { useEditor } from '@open-pencil/vue'
+import type { BindingProvider } from '@open-pencil/vue/controls/binding-provider'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { BindableValueRoot } from '@open-pencil/vue/primitives/BindableValue'
import IconButton from '@/components/ui/button/IconButton.vue'
import { VARIABLE_TYPE_ICONS } from '@/components/variables/type-icons'
diff --git a/src/components/properties/binding/examples/Field.vue b/src/components/properties/binding/examples/Field.vue
index 3b47edeb1..1c82678ce 100644
--- a/src/components/properties/binding/examples/Field.vue
+++ b/src/components/properties/binding/examples/Field.vue
@@ -1,11 +1,15 @@
<script setup lang="ts">
-import type { BindingProvider, BindingTarget, BoundEditPolicy } from '@open-pencil/vue'
+import type {
+ BindingProvider,
+ BindingTarget,
+ BoundEditPolicy
+} from '@open-pencil/vue/controls/binding-provider'
+import { BindableValueRoot } from '@open-pencil/vue/primitives/BindableValue'
import {
- BindableValueRoot,
NumberFieldInput,
NumberFieldRoot,
NumberFieldValue
-} from '@open-pencil/vue'
+} from '@open-pencil/vue/primitives/NumberField'
import VariableBindingPicker from '@/components/properties/binding/VariableBindingPicker.vue'
import { BindingPill } from '@/components/ui/binding'
diff --git a/src/components/properties/binding/examples/States.vue b/src/components/properties/binding/examples/States.vue
index dd9aa7ddc..7fdf9fd0e 100644
--- a/src/components/properties/binding/examples/States.vue
+++ b/src/components/properties/binding/examples/States.vue
@@ -2,7 +2,11 @@
import { ref } from 'vue'
import type { Variable } from '@open-pencil/scene-graph'
-import type { BindingProvider, BindingState, BindingTarget } from '@open-pencil/vue'
+import type {
+ BindingProvider,
+ BindingState,
+ BindingTarget
+} from '@open-pencil/vue/controls/binding-provider'
import Field from './Field.vue'
diff --git a/src/components/properties/binding/fields.ts b/src/components/properties/binding/fields.ts
index 56ef3e701..67b6df668 100644
--- a/src/components/properties/binding/fields.ts
+++ b/src/components/properties/binding/fields.ts
@@ -1,4 +1,7 @@
-import { useTextContentBindingProvider, useVisibilityBindingProvider } from '@open-pencil/vue'
+import {
+ useTextContentBindingProvider,
+ useVisibilityBindingProvider
+} from '@open-pencil/vue/controls/binding-provider'
/** The layer fields a component property or a variable can decide, as Figma's layer panel offers. */
export type BoundLayerField = 'VISIBLE' | 'TEXT'
diff --git a/src/components/properties/blend-mode/use.ts b/src/components/properties/blend-mode/use.ts
index 141dce94c..1780c8455 100644
--- a/src/components/properties/blend-mode/use.ts
+++ b/src/components/properties/blend-mode/use.ts
@@ -1,7 +1,7 @@
import { computed } from 'vue'
import type { BlendMode } from '@open-pencil/scene-graph'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { AppSelectGroup } from '@/components/ui/select/select'
diff --git a/src/components/properties/component-properties/ComponentPropertiesSection.vue b/src/components/properties/component-properties/ComponentPropertiesSection.vue
index 8447c0d5e..b5a88bf5b 100644
--- a/src/components/properties/component-properties/ComponentPropertiesSection.vue
+++ b/src/components/properties/component-properties/ComponentPropertiesSection.vue
@@ -3,10 +3,10 @@ import { computed } from 'vue'
import {
useComponentProperties,
- useExposedInstances,
- useI18n,
- useSlotProperties
-} from '@open-pencil/vue'
+ useExposedInstances
+} from '@open-pencil/vue/controls/component-props'
+import { useSlotProperties } from '@open-pencil/vue/controls/slots'
+import { useI18n } from '@open-pencil/vue/i18n'
import AssetThumbnail from '@/components/assets-panel/AssetThumbnail.vue'
import PanelSection from '@/components/ui/panel/PanelSection.vue'
diff --git a/src/components/properties/component-properties/ComponentPropertyControl.vue b/src/components/properties/component-properties/ComponentPropertyControl.vue
index 01cab0ab4..a5933ac7f 100644
--- a/src/components/properties/component-properties/ComponentPropertyControl.vue
+++ b/src/components/properties/component-properties/ComponentPropertyControl.vue
@@ -1,6 +1,7 @@
<script setup lang="ts">
-import { MIXED, useI18n } from '@open-pencil/vue'
-import type { ComponentPropertyControl } from '@open-pencil/vue'
+import type { ComponentPropertyControl } from '@open-pencil/vue/controls/component-props'
+import { MIXED } from '@open-pencil/vue/controls/node-props'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { AppPickerItem } from '@/components/ui/select/AppPicker.vue'
import AppPickerField from '@/components/ui/select/AppPickerField.vue'
diff --git a/src/components/properties/component-properties/ComponentPropertyListSection.vue b/src/components/properties/component-properties/ComponentPropertyListSection.vue
index f16a45fa0..10933a286 100644
--- a/src/components/properties/component-properties/ComponentPropertyListSection.vue
+++ b/src/components/properties/component-properties/ComponentPropertyListSection.vue
@@ -14,7 +14,9 @@ import {
import { computed, ref, type ComponentPublicInstance } from 'vue'
import type { ComponentPropertyType } from '@open-pencil/scene-graph'
-import { useComponentPropertyAuthoring, useFlatReorderDrag, useI18n } from '@open-pencil/vue'
+import { useComponentPropertyAuthoring } from '@open-pencil/vue/controls/component-props'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useFlatReorderDrag } from '@open-pencil/vue/shared/drag'
import AppButton from '@/components/ui/button/AppButton.vue'
import IconButton from '@/components/ui/button/IconButton.vue'
diff --git a/src/components/properties/component-properties/ComponentPropertyTextField.vue b/src/components/properties/component-properties/ComponentPropertyTextField.vue
index 5729541f2..4bcbc92ef 100644
--- a/src/components/properties/component-properties/ComponentPropertyTextField.vue
+++ b/src/components/properties/component-properties/ComponentPropertyTextField.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { MIXED, type MixedValue } from '@open-pencil/vue'
+import { MIXED, type MixedValue } from '@open-pencil/vue/controls/node-props'
import AppInput from '@/components/ui/input/AppInput.vue'
diff --git a/src/components/properties/component-properties/ExposedInstanceGroup.vue b/src/components/properties/component-properties/ExposedInstanceGroup.vue
index 09f475802..fd0c774eb 100644
--- a/src/components/properties/component-properties/ExposedInstanceGroup.vue
+++ b/src/components/properties/component-properties/ExposedInstanceGroup.vue
@@ -1,7 +1,9 @@
<script setup lang="ts">
import { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger } from 'reka-ui'
-import { useComponentProperties, useSceneComputed, useEditor } from '@open-pencil/vue'
+import { useEditor } from '@open-pencil/vue'
+import { useComponentProperties } from '@open-pencil/vue/controls/component-props'
+import { useSceneComputed } from '@open-pencil/vue/internal/scene-computed'
import { collapsibleContentMotion } from '@/theme/collapsible/collapsible'
diff --git a/src/components/properties/component-properties/PropertyBindButton.vue b/src/components/properties/component-properties/PropertyBindButton.vue
index c1b7771d4..0df799f63 100644
--- a/src/components/properties/component-properties/PropertyBindButton.vue
+++ b/src/components/properties/component-properties/PropertyBindButton.vue
@@ -9,7 +9,7 @@ import {
DropdownMenuTrigger
} from 'reka-ui'
-import { usePanelMessages } from '@open-pencil/vue'
+import { usePanelMessages } from '@open-pencil/vue/i18n'
import IconButton from '@/components/ui/button/IconButton.vue'
import { menuItem, useMenuUI } from '@/components/ui/menu/menu'
diff --git a/src/components/properties/component-properties/PropertyBindingRow.vue b/src/components/properties/component-properties/PropertyBindingRow.vue
index 0414a623f..a6b3bb963 100644
--- a/src/components/properties/component-properties/PropertyBindingRow.vue
+++ b/src/components/properties/component-properties/PropertyBindingRow.vue
@@ -1,6 +1,6 @@
<script setup lang="ts">
-import type { ComponentBinding } from '@open-pencil/vue'
-import { usePanelMessages } from '@open-pencil/vue'
+import type { ComponentBinding } from '@open-pencil/vue/controls/component-props'
+import { usePanelMessages } from '@open-pencil/vue/i18n'
import { sceneNodeIcon } from '@/components/icons'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/properties/component-properties/PropertyBindings.vue b/src/components/properties/component-properties/PropertyBindings.vue
index ad5f70dff..1cb93d1f8 100644
--- a/src/components/properties/component-properties/PropertyBindings.vue
+++ b/src/components/properties/component-properties/PropertyBindings.vue
@@ -1,11 +1,11 @@
<script setup lang="ts">
import { CollapsibleRoot, CollapsibleContent, CollapsibleTrigger } from 'reka-ui'
-import {
- usePanelMessages,
- type ComponentBinding,
- type ComponentBindingGroup
-} from '@open-pencil/vue'
+import type {
+ ComponentBinding,
+ ComponentBindingGroup
+} from '@open-pencil/vue/controls/component-props'
+import { usePanelMessages } from '@open-pencil/vue/i18n'
import { sceneNodeIcon } from '@/components/icons'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/properties/component-properties/PropertyBoundField.vue b/src/components/properties/component-properties/PropertyBoundField.vue
index 935123f8d..59cd99684 100644
--- a/src/components/properties/component-properties/PropertyBoundField.vue
+++ b/src/components/properties/component-properties/PropertyBoundField.vue
@@ -7,7 +7,7 @@ import {
DropdownMenuTrigger
} from 'reka-ui'
-import { usePanelMessages } from '@open-pencil/vue'
+import { usePanelMessages } from '@open-pencil/vue/i18n'
import BoundFieldRow from '@/components/properties/binding/BoundFieldRow.vue'
import IconButton from '@/components/ui/button/IconButton.vue'
diff --git a/src/components/properties/component-properties/PropertyRow.vue b/src/components/properties/component-properties/PropertyRow.vue
index 44434c592..442d7a650 100644
--- a/src/components/properties/component-properties/PropertyRow.vue
+++ b/src/components/properties/component-properties/PropertyRow.vue
@@ -3,8 +3,12 @@ import { PopoverClose, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigge
import { computed, ref, watch } from 'vue'
import type { ComponentPropertyType } from '@open-pencil/scene-graph'
-import { useI18n, useRetainedPopup } from '@open-pencil/vue'
-import type { ComponentBinding, ComponentBindingGroup } from '@open-pencil/vue'
+import type {
+ ComponentBinding,
+ ComponentBindingGroup
+} from '@open-pencil/vue/controls/component-props'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
import AppButton from '@/components/ui/button/AppButton.vue'
import AppInput from '@/components/ui/input/AppInput.vue'
diff --git a/src/components/properties/component-properties/behaviour/AddBehaviourPicker.vue b/src/components/properties/component-properties/behaviour/AddBehaviourPicker.vue
index e36fdf57d..93a578fa5 100644
--- a/src/components/properties/component-properties/behaviour/AddBehaviourPicker.vue
+++ b/src/components/properties/component-properties/behaviour/AddBehaviourPicker.vue
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { BEHAVIOUR_KINDS, type BehaviourKind } from '@open-pencil/scene-graph'
-import { useI18n } from '@open-pencil/vue'
+import { BEHAVIOUR_KINDS, type BehaviourKind } from '@open-pencil/scene-graph/behaviours'
+import { useI18n } from '@open-pencil/vue/i18n'
import IconButton from '@/components/ui/button/IconButton.vue'
import AppPicker, { type AppPickerItem } from '@/components/ui/select/AppPicker.vue'
diff --git a/src/components/properties/component-properties/behaviour/BehaviourBindingField.vue b/src/components/properties/component-properties/behaviour/BehaviourBindingField.vue
index 69125388d..97471bf39 100644
--- a/src/components/properties/component-properties/behaviour/BehaviourBindingField.vue
+++ b/src/components/properties/component-properties/behaviour/BehaviourBindingField.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import AppPickerField from '@/components/ui/select/AppPickerField.vue'
diff --git a/src/components/properties/component-properties/behaviour/BehaviourPanel.vue b/src/components/properties/component-properties/behaviour/BehaviourPanel.vue
index cf7cb7961..37019e403 100644
--- a/src/components/properties/component-properties/behaviour/BehaviourPanel.vue
+++ b/src/components/properties/component-properties/behaviour/BehaviourPanel.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useBehaviour } from '@open-pencil/vue'
+import { useBehaviour } from '@open-pencil/vue/controls/behaviour'
import BehaviourSection from './BehaviourSection.vue'
diff --git a/src/components/properties/component-properties/behaviour/BehaviourRow.vue b/src/components/properties/component-properties/behaviour/BehaviourRow.vue
index 636ce6bc0..3bf2bd3b2 100644
--- a/src/components/properties/component-properties/behaviour/BehaviourRow.vue
+++ b/src/components/properties/component-properties/behaviour/BehaviourRow.vue
@@ -1,14 +1,14 @@
<script setup lang="ts">
import { computed, reactive, watch } from 'vue'
-import { isNumberRange, type BehaviourKind } from '@open-pencil/scene-graph'
-import { useI18n } from '@open-pencil/vue'
+import { isNumberRange, type BehaviourKind } from '@open-pencil/scene-graph/behaviours'
import type {
BehaviourBooleanControl,
BehaviourNumberControl,
BehaviourPartControl,
BehaviourValueControl
-} from '@open-pencil/vue'
+} from '@open-pencil/vue/controls/behaviour'
+import { useI18n } from '@open-pencil/vue/i18n'
import NumberField from '@/components/inputs/NumberField.vue'
import PanelFieldGroup from '@/components/ui/panel/PanelFieldGroup.vue'
diff --git a/src/components/properties/component-properties/behaviour/BehaviourSection.vue b/src/components/properties/component-properties/behaviour/BehaviourSection.vue
index 444b67c63..d86bf7e25 100644
--- a/src/components/properties/component-properties/behaviour/BehaviourSection.vue
+++ b/src/components/properties/component-properties/behaviour/BehaviourSection.vue
@@ -1,14 +1,14 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
-import type { BehaviourKind, InteractionState } from '@open-pencil/scene-graph'
-import { useI18n } from '@open-pencil/vue'
+import type { BehaviourKind, InteractionState } from '@open-pencil/scene-graph/behaviours'
import type {
BehaviourControl,
BehaviourNumberControl,
BehaviourPartControl,
BehaviourValueControl
-} from '@open-pencil/vue'
+} from '@open-pencil/vue/controls/behaviour'
+import { useI18n } from '@open-pencil/vue/i18n'
import IconButton from '@/components/ui/button/IconButton.vue'
import AppCollapsible from '@/components/ui/collapsible/AppCollapsible.vue'
diff --git a/src/components/properties/component-properties/behaviour/BehaviourStates.vue b/src/components/properties/component-properties/behaviour/BehaviourStates.vue
index 46f7c0cfb..96cddc4ec 100644
--- a/src/components/properties/component-properties/behaviour/BehaviourStates.vue
+++ b/src/components/properties/component-properties/behaviour/BehaviourStates.vue
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { INTERACTION_STATES, type InteractionState } from '@open-pencil/scene-graph'
-import { useI18n } from '@open-pencil/vue'
-import type { BehaviourStatesControl } from '@open-pencil/vue'
+import { INTERACTION_STATES, type InteractionState } from '@open-pencil/scene-graph/behaviours'
+import type { BehaviourStatesControl } from '@open-pencil/vue/controls/behaviour'
+import { useI18n } from '@open-pencil/vue/i18n'
import PanelFieldGroup from '@/components/ui/panel/PanelFieldGroup.vue'
import AppPickerField from '@/components/ui/select/AppPickerField.vue'
diff --git a/src/components/properties/component-properties/behaviour/examples/States.vue b/src/components/properties/component-properties/behaviour/examples/States.vue
index cb6f623ca..40929cab2 100644
--- a/src/components/properties/component-properties/behaviour/examples/States.vue
+++ b/src/components/properties/component-properties/behaviour/examples/States.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue'
-import type { BehaviourControl } from '@open-pencil/vue'
+import type { BehaviourControl } from '@open-pencil/vue/controls/behaviour'
import BehaviourSection from '../BehaviourSection.vue'
diff --git a/src/components/properties/component-properties/behaviour/labels.ts b/src/components/properties/component-properties/behaviour/labels.ts
index 9d796c0f8..464bc52bc 100644
--- a/src/components/properties/component-properties/behaviour/labels.ts
+++ b/src/components/properties/component-properties/behaviour/labels.ts
@@ -1,7 +1,7 @@
import { computed } from 'vue'
-import type { BehaviourKind, InteractionState } from '@open-pencil/scene-graph'
-import { useI18n } from '@open-pencil/vue'
+import type { BehaviourKind, InteractionState } from '@open-pencil/scene-graph/behaviours'
+import { useI18n } from '@open-pencil/vue/i18n'
/** Translated names of behaviour kinds, values, parts, and interaction states. */
export function useBehaviourLabels() {
diff --git a/src/components/properties/component-properties/instance-update/InstanceUpdateAction.vue b/src/components/properties/component-properties/instance-update/InstanceUpdateAction.vue
index 8ff610e50..11cbea407 100644
--- a/src/components/properties/component-properties/instance-update/InstanceUpdateAction.vue
+++ b/src/components/properties/component-properties/instance-update/InstanceUpdateAction.vue
@@ -9,7 +9,8 @@ import {
import { toRef } from 'vue'
import type { SceneNode } from '@open-pencil/scene-graph'
-import { useI18n, useRetainedPopup } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
import type { EditorStore } from '@/app/editor/session'
import type { LibraryService } from '@/app/libraries'
diff --git a/src/components/properties/component-properties/slot/AddInstancesPopover.vue b/src/components/properties/component-properties/slot/AddInstancesPopover.vue
index e9f06619b..0236c0fdc 100644
--- a/src/components/properties/component-properties/slot/AddInstancesPopover.vue
+++ b/src/components/properties/component-properties/slot/AddInstancesPopover.vue
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
-import type { SlotInstanceOption } from '@open-pencil/vue'
+import type { SlotInstanceOption } from '@open-pencil/vue/controls/slots'
+import { useI18n } from '@open-pencil/vue/i18n'
import IconButton from '@/components/ui/button/IconButton.vue'
import AppPicker, { type AppPickerItem } from '@/components/ui/select/AppPicker.vue'
diff --git a/src/components/properties/component-properties/slot/SlotAuthoringSection.vue b/src/components/properties/component-properties/slot/SlotAuthoringSection.vue
index 3b779f1ad..ab4c678cc 100644
--- a/src/components/properties/component-properties/slot/SlotAuthoringSection.vue
+++ b/src/components/properties/component-properties/slot/SlotAuthoringSection.vue
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { reactive, watch } from 'vue'
-import { useI18n, useSlotAuthoring } from '@open-pencil/vue'
+import { useSlotAuthoring } from '@open-pencil/vue/controls/slots'
+import { useI18n } from '@open-pencil/vue/i18n'
import AssetThumbnail from '@/components/assets-panel/AssetThumbnail.vue'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/properties/component-properties/slot/SlotLimitsPopover.vue b/src/components/properties/component-properties/slot/SlotLimitsPopover.vue
index 54b1a0387..f76d3b185 100644
--- a/src/components/properties/component-properties/slot/SlotLimitsPopover.vue
+++ b/src/components/properties/component-properties/slot/SlotLimitsPopover.vue
@@ -2,8 +2,9 @@
import { PopoverClose, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger } from 'reka-ui'
import { computed } from 'vue'
-import { useI18n, useRetainedPopup } from '@open-pencil/vue'
-import type { SlotLimit } from '@open-pencil/vue'
+import type { SlotLimit } from '@open-pencil/vue/controls/slots'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
import AppButton from '@/components/ui/button/AppButton.vue'
import SeverityIcon from '@/components/ui/feedback/SeverityIcon.vue'
diff --git a/src/components/properties/component-properties/slot/SlotPropertyRow.vue b/src/components/properties/component-properties/slot/SlotPropertyRow.vue
index 731a77e12..3b29c46db 100644
--- a/src/components/properties/component-properties/slot/SlotPropertyRow.vue
+++ b/src/components/properties/component-properties/slot/SlotPropertyRow.vue
@@ -7,8 +7,8 @@ import {
DropdownMenuTrigger
} from 'reka-ui'
-import { useI18n } from '@open-pencil/vue'
-import type { SlotInstanceOption, SlotLimit } from '@open-pencil/vue'
+import type { SlotInstanceOption, SlotLimit } from '@open-pencil/vue/controls/slots'
+import { useI18n } from '@open-pencil/vue/i18n'
import IconButton from '@/components/ui/button/IconButton.vue'
import { menuItem, useMenuUI } from '@/components/ui/menu/menu'
diff --git a/src/components/properties/component-properties/slot/SlotSettingsPopover.vue b/src/components/properties/component-properties/slot/SlotSettingsPopover.vue
index eb49568fb..c172478ea 100644
--- a/src/components/properties/component-properties/slot/SlotSettingsPopover.vue
+++ b/src/components/properties/component-properties/slot/SlotSettingsPopover.vue
@@ -2,8 +2,9 @@
import { PopoverClose, PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger } from 'reka-ui'
import { computed, ref, watch } from 'vue'
-import { useI18n, useRetainedPopup } from '@open-pencil/vue'
-import type { SlotDefinitionControl, SlotInstanceOption } from '@open-pencil/vue'
+import type { SlotDefinitionControl, SlotInstanceOption } from '@open-pencil/vue/controls/slots'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
import AppButton from '@/components/ui/button/AppButton.vue'
import IconButton from '@/components/ui/button/IconButton.vue'
diff --git a/src/components/properties/component-properties/slot/examples/Settings.vue b/src/components/properties/component-properties/slot/examples/Settings.vue
index f6d6ac949..2c4b42a9c 100644
--- a/src/components/properties/component-properties/slot/examples/Settings.vue
+++ b/src/components/properties/component-properties/slot/examples/Settings.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue'
-import type { SlotDefinitionControl, SlotInstanceOption } from '@open-pencil/vue'
+import type { SlotDefinitionControl, SlotInstanceOption } from '@open-pencil/vue/controls/slots'
import PanelSection from '@/components/ui/panel/PanelSection.vue'
diff --git a/src/components/properties/component-properties/slot/examples/States.vue b/src/components/properties/component-properties/slot/examples/States.vue
index c9f69dbc1..5f349d679 100644
--- a/src/components/properties/component-properties/slot/examples/States.vue
+++ b/src/components/properties/component-properties/slot/examples/States.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue'
-import type { SlotInstanceOption, SlotLimit } from '@open-pencil/vue'
+import type { SlotInstanceOption, SlotLimit } from '@open-pencil/vue/controls/slots'
import ComponentPropertyTextField from '@/components/properties/component-properties/ComponentPropertyTextField.vue'
import PanelFieldGroup from '@/components/ui/panel/PanelFieldGroup.vue'
diff --git a/src/components/properties/component-properties/usePropertyBinding.ts b/src/components/properties/component-properties/usePropertyBinding.ts
index 0e2d7c5ed..e99191f88 100644
--- a/src/components/properties/component-properties/usePropertyBinding.ts
+++ b/src/components/properties/component-properties/usePropertyBinding.ts
@@ -1,6 +1,7 @@
import { computed } from 'vue'
-import { useComponentPropertyAuthoring, usePanelMessages } from '@open-pencil/vue'
+import { useComponentPropertyAuthoring } from '@open-pencil/vue/controls/component-props'
+import { usePanelMessages } from '@open-pencil/vue/i18n'
export type BindableField = 'TEXT' | 'VISIBLE' | 'INSTANCE_SWAP'
diff --git a/src/components/properties/component-properties/variant/VariantAuthoringSection.vue b/src/components/properties/component-properties/variant/VariantAuthoringSection.vue
index d3577e720..c29fc7a38 100644
--- a/src/components/properties/component-properties/variant/VariantAuthoringSection.vue
+++ b/src/components/properties/component-properties/variant/VariantAuthoringSection.vue
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { computed, reactive, ref, watch } from 'vue'
-import { useI18n, useVariantAuthoring } from '@open-pencil/vue'
+import { useVariantAuthoring } from '@open-pencil/vue/controls/variants'
+import { useI18n } from '@open-pencil/vue/i18n'
import AppInput from '@/components/ui/input/AppInput.vue'
import PanelFieldGroup from '@/components/ui/panel/PanelFieldGroup.vue'
diff --git a/src/components/properties/component-properties/variant/VariantValueList.vue b/src/components/properties/component-properties/variant/VariantValueList.vue
index 4ca4faf04..4115e0a4d 100644
--- a/src/components/properties/component-properties/variant/VariantValueList.vue
+++ b/src/components/properties/component-properties/variant/VariantValueList.vue
@@ -2,8 +2,9 @@
import { omit } from 'es-toolkit'
import { ref, type ComponentPublicInstance } from 'vue'
-import type { VariantMutationResult } from '@open-pencil/core/editor'
-import { useFlatReorderDrag, useI18n } from '@open-pencil/vue'
+import type { VariantMutationResult } from '@open-pencil/core'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useFlatReorderDrag } from '@open-pencil/vue/shared/drag'
import IconButton from '@/components/ui/button/IconButton.vue'
import AppInput from '@/components/ui/input/AppInput.vue'
diff --git a/src/components/properties/connector/ConnectorControls.vue b/src/components/properties/connector/ConnectorControls.vue
index 3280c477d..7d7a58abf 100644
--- a/src/components/properties/connector/ConnectorControls.vue
+++ b/src/components/properties/connector/ConnectorControls.vue
@@ -2,8 +2,9 @@
import { tv } from 'tailwind-variants'
import { computed } from 'vue'
-import type { ConnectorLineType, FigJamColorName, StrokeCap } from '@open-pencil/scene-graph'
-import { useI18n } from '@open-pencil/vue'
+import type { ConnectorLineType, StrokeCap } from '@open-pencil/scene-graph'
+import type { FigJamColorName } from '@open-pencil/scene-graph/figjam'
+import { useI18n } from '@open-pencil/vue/i18n'
import FigJamPalette from '@/components/figjam/FigJamPalette.vue'
import { CONNECTOR_LINE_TYPE_ICONS, connectorCapIcon } from '@/components/icons/connectors'
diff --git a/src/components/properties/connector/ConnectorSection.vue b/src/components/properties/connector/ConnectorSection.vue
index 9636b4af9..b6c0b557e 100644
--- a/src/components/properties/connector/ConnectorSection.vue
+++ b/src/components/properties/connector/ConnectorSection.vue
@@ -1,5 +1,6 @@
<script setup lang="ts">
-import { useConnector, useI18n } from '@open-pencil/vue'
+import { useConnector } from '@open-pencil/vue/controls/connector'
+import { useI18n } from '@open-pencil/vue/i18n'
import PanelSection from '@/components/ui/panel/PanelSection.vue'
diff --git a/src/components/properties/constraints/ConstraintsPinControl.vue b/src/components/properties/constraints/ConstraintsPinControl.vue
index ad8524066..e55ee22ea 100644
--- a/src/components/properties/constraints/ConstraintsPinControl.vue
+++ b/src/components/properties/constraints/ConstraintsPinControl.vue
@@ -2,13 +2,14 @@
import { tv } from 'tailwind-variants'
import { computed } from 'vue'
-import { constraintPins, useI18n } from '@open-pencil/vue'
-import type {
- ConstraintsControlActions,
- ConstraintAxis,
- ConstraintEdge,
- ConstraintValue
-} from '@open-pencil/vue'
+import {
+ constraintPins,
+ type ConstraintAxis,
+ type ConstraintEdge,
+ type ConstraintValue
+} from '@open-pencil/vue/controls/constraints'
+import { useI18n } from '@open-pencil/vue/i18n'
+import type { ConstraintsControlActions } from '@open-pencil/vue/primitives/ConstraintsControl'
import Tip from '@/components/ui/overlay/Tip.vue'
import constraintsTheme from '@/theme/constraints'
diff --git a/src/components/properties/constraints/ConstraintsSection.vue b/src/components/properties/constraints/ConstraintsSection.vue
index 88bd80f3c..d8ba43392 100644
--- a/src/components/properties/constraints/ConstraintsSection.vue
+++ b/src/components/properties/constraints/ConstraintsSection.vue
@@ -3,7 +3,9 @@ import { tv } from 'tailwind-variants'
import { computed } from 'vue'
import type { ConstraintType } from '@open-pencil/scene-graph'
-import { ConstraintsControlRoot, MIXED, useI18n } from '@open-pencil/vue'
+import { MIXED } from '@open-pencil/vue/controls/node-props'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { ConstraintsControlRoot } from '@open-pencil/vue/primitives/ConstraintsControl'
import ConstraintsPinControl from '@/components/properties/constraints/ConstraintsPinControl.vue'
import PanelFieldGroup from '@/components/ui/panel/PanelFieldGroup.vue'
diff --git a/src/components/properties/fill-label.ts b/src/components/properties/fill-label.ts
index 07fcff134..09938b997 100644
--- a/src/components/properties/fill-label.ts
+++ b/src/components/properties/fill-label.ts
@@ -1,6 +1,7 @@
-import type { Fill, ShaderPaint, Variable } from '@open-pencil/scene-graph'
+import type { Fill, Variable } from '@open-pencil/scene-graph'
import { colorToHexRaw } from '@open-pencil/scene-graph/color'
-import { shaderEffectLabel } from '@open-pencil/vue'
+import type { ShaderPaint } from '@open-pencil/scene-graph/shaders'
+import { shaderEffectLabel } from '@open-pencil/vue/controls/shader'
export function fillLabel(
fill: Fill,
diff --git a/src/components/properties/frame-presets/FramePresetSelect.vue b/src/components/properties/frame-presets/FramePresetSelect.vue
index 770df7b27..9fac5a67e 100644
--- a/src/components/properties/frame-presets/FramePresetSelect.vue
+++ b/src/components/properties/frame-presets/FramePresetSelect.vue
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n, useSelectionState } from '@open-pencil/vue'
+import { useSelectionState } from '@open-pencil/vue/editor/selection-state'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import {
diff --git a/src/components/properties/frame-presets/FramePresetsSection.vue b/src/components/properties/frame-presets/FramePresetsSection.vue
index 1082a339c..b99421078 100644
--- a/src/components/properties/frame-presets/FramePresetsSection.vue
+++ b/src/components/properties/frame-presets/FramePresetsSection.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger } from 'reka-ui'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import { FRAME_PRESET_CATEGORIES, type FramePreset } from '@/app/editor/frame-presets'
diff --git a/src/components/properties/item-list/PropertyItemRow.vue b/src/components/properties/item-list/PropertyItemRow.vue
index baa626f88..c646edc65 100644
--- a/src/components/properties/item-list/PropertyItemRow.vue
+++ b/src/components/properties/item-list/PropertyItemRow.vue
@@ -2,8 +2,13 @@
import type { ClassValue } from 'tailwind-variants'
import type { VNode } from 'vue'
-import { PropertyListItem, PropertyListRemove, PropertyListVisibility } from '@open-pencil/vue'
-import type { PropertyListItemSlotProps, PropertyListKey } from '@open-pencil/vue'
+import {
+ PropertyListItem,
+ PropertyListRemove,
+ PropertyListVisibility,
+ type PropertyListItemSlotProps,
+ type PropertyListKey
+} from '@open-pencil/vue/primitives/PropertyList'
import Tip from '@/components/ui/overlay/Tip.vue'
import PanelItemRow from '@/components/ui/panel/PanelItemRow.vue'
diff --git a/src/components/properties/layout/ClipContentControl.vue b/src/components/properties/layout/ClipContentControl.vue
index 902a2903a..5fffa8bd5 100644
--- a/src/components/properties/layout/ClipContentControl.vue
+++ b/src/components/properties/layout/ClipContentControl.vue
@@ -1,5 +1,7 @@
<script setup lang="ts">
-import { MIXED, useI18n, useSelectionLayout } from '@open-pencil/vue'
+import { MIXED } from '@open-pencil/vue/controls/node-props'
+import { useSelectionLayout } from '@open-pencil/vue/controls/selection-layout'
+import { useI18n } from '@open-pencil/vue/i18n'
const layout = useSelectionLayout()
const { panels } = useI18n()
diff --git a/src/components/properties/layout/LayoutFlowControl.vue b/src/components/properties/layout/LayoutFlowControl.vue
index 1df6bbad1..1688c5e21 100644
--- a/src/components/properties/layout/LayoutFlowControl.vue
+++ b/src/components/properties/layout/LayoutFlowControl.vue
@@ -3,7 +3,9 @@ import { computed } from 'vue'
import type { VNode } from 'vue'
import type { LayoutMode } from '@open-pencil/scene-graph'
-import { MIXED, useI18n, useSelectionLayout } from '@open-pencil/vue'
+import { MIXED } from '@open-pencil/vue/controls/node-props'
+import { useSelectionLayout } from '@open-pencil/vue/controls/selection-layout'
+import { useI18n } from '@open-pencil/vue/i18n'
import Tip from '@/components/ui/overlay/Tip.vue'
import SegmentedControl from '@/components/ui/select/SegmentedControl.vue'
diff --git a/src/components/properties/layout/LayoutSection.vue b/src/components/properties/layout/LayoutSection.vue
index abe1c9f58..897954d18 100644
--- a/src/components/properties/layout/LayoutSection.vue
+++ b/src/components/properties/layout/LayoutSection.vue
@@ -1,6 +1,8 @@
<script setup lang="ts">
-import { isGeneratedFrame } from '@open-pencil/scene-graph'
-import { LAYOUT_CONTAINER_TYPES, LayoutControlsRoot, useI18n } from '@open-pencil/vue'
+import { isGeneratedFrame } from '@open-pencil/scene-graph/generated'
+import { LAYOUT_CONTAINER_TYPES } from '@open-pencil/vue/controls/selection-layout'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { LayoutControlsRoot } from '@open-pencil/vue/primitives/LayoutControls'
import ClipContentControl from '@/components/properties/layout/ClipContentControl.vue'
import FlexControls from '@/components/properties/layout/flex/FlexControls.vue'
diff --git a/src/components/properties/layout/LayoutWrapToggle.vue b/src/components/properties/layout/LayoutWrapToggle.vue
index 97b34ceee..aca7cb056 100644
--- a/src/components/properties/layout/LayoutWrapToggle.vue
+++ b/src/components/properties/layout/LayoutWrapToggle.vue
@@ -1,5 +1,6 @@
<script setup lang="ts">
-import { useI18n, useLayoutControlsContext } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useLayoutControlsContext } from '@open-pencil/vue/primitives/LayoutControls'
import IconButton from '@/components/ui/button/IconButton.vue'
diff --git a/src/components/properties/layout/TextResizingControl.vue b/src/components/properties/layout/TextResizingControl.vue
index b84f29ced..88054a203 100644
--- a/src/components/properties/layout/TextResizingControl.vue
+++ b/src/components/properties/layout/TextResizingControl.vue
@@ -1,7 +1,9 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { MIXED, useI18n, useSelectionLayout, type TextResizeMode } from '@open-pencil/vue'
+import { MIXED } from '@open-pencil/vue/controls/node-props'
+import { useSelectionLayout, type TextResizeMode } from '@open-pencil/vue/controls/selection-layout'
+import { useI18n } from '@open-pencil/vue/i18n'
import Tip from '@/components/ui/overlay/Tip.vue'
import PanelFieldGroup from '@/components/ui/panel/PanelFieldGroup.vue'
diff --git a/src/components/properties/layout/flex/FlexControls.vue b/src/components/properties/layout/flex/FlexControls.vue
index fd6644a18..39cb46140 100644
--- a/src/components/properties/layout/flex/FlexControls.vue
+++ b/src/components/properties/layout/flex/FlexControls.vue
@@ -2,7 +2,8 @@
import { computed } from 'vue'
import type { LayoutDirection } from '@open-pencil/scene-graph'
-import { useI18n, useLayoutControlsContext } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useLayoutControlsContext } from '@open-pencil/vue/primitives/LayoutControls'
import AppSelect from '@/components/ui/select/AppSelect.vue'
diff --git a/src/components/properties/layout/flex/FlexGapField.vue b/src/components/properties/layout/flex/FlexGapField.vue
index f16c4bade..d8c365042 100644
--- a/src/components/properties/layout/flex/FlexGapField.vue
+++ b/src/components/properties/layout/flex/FlexGapField.vue
@@ -2,7 +2,9 @@
import { SelectRoot, SelectTrigger } from 'reka-ui'
import { computed, ref } from 'vue'
-import { useI18n, useLayoutControlsContext, useRetainedPopup } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
+import { useLayoutControlsContext } from '@open-pencil/vue/primitives/LayoutControls'
import VariableNumberField from '@/components/properties/VariableNumberField.vue'
import AppSelectContent from '@/components/ui/select/AppSelectContent.vue'
diff --git a/src/components/properties/layout/grid/GridControls.vue b/src/components/properties/layout/grid/GridControls.vue
index f961c4eb7..9bed04d28 100644
--- a/src/components/properties/layout/grid/GridControls.vue
+++ b/src/components/properties/layout/grid/GridControls.vue
@@ -1,6 +1,7 @@
<script setup lang="ts">
import type { GridTrackSizing } from '@open-pencil/scene-graph'
-import { useI18n, useLayoutControlsContext } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useLayoutControlsContext } from '@open-pencil/vue/primitives/LayoutControls'
import NumberField from '@/components/inputs/NumberField.vue'
import type { GridTrackProp } from '@/components/properties/layout/types'
diff --git a/src/components/properties/layout/guides/LayoutGridSection.vue b/src/components/properties/layout/guides/LayoutGridSection.vue
index 4094e2720..06f2dd8ba 100644
--- a/src/components/properties/layout/guides/LayoutGridSection.vue
+++ b/src/components/properties/layout/guides/LayoutGridSection.vue
@@ -4,7 +4,9 @@ import { computed, ref } from 'vue'
import type { LayoutGrid, SceneNode } from '@open-pencil/scene-graph'
import { AUTO_LAYOUT_GRID_COUNT, layoutGridCount } from '@open-pencil/scene-graph/layout'
-import { useEditor, useI18n, useSceneComputed } from '@open-pencil/vue'
+import { useEditor } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useSceneComputed } from '@open-pencil/vue/internal/scene-computed'
import ColorInput from '@/components/ColorPicker/ColorInput.vue'
import NumberField from '@/components/inputs/NumberField.vue'
diff --git a/src/components/properties/layout/padding/PaddingControls.vue b/src/components/properties/layout/padding/PaddingControls.vue
index 8ff948796..fc623bdd3 100644
--- a/src/components/properties/layout/padding/PaddingControls.vue
+++ b/src/components/properties/layout/padding/PaddingControls.vue
@@ -1,5 +1,6 @@
<script setup lang="ts">
-import { useI18n, useLayoutControlsContext } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useLayoutControlsContext } from '@open-pencil/vue/primitives/LayoutControls'
import type { PaddingProp } from '@/components/properties/layout/types'
import VariableNumberField from '@/components/properties/VariableNumberField.vue'
diff --git a/src/components/properties/layout/size/SizeAxisField.vue b/src/components/properties/layout/size/SizeAxisField.vue
index b3798fd24..933db4a22 100644
--- a/src/components/properties/layout/size/SizeAxisField.vue
+++ b/src/components/properties/layout/size/SizeAxisField.vue
@@ -2,8 +2,10 @@
import { SelectRoot, SelectSeparator, SelectTrigger } from 'reka-ui'
import type { LayoutSizing } from '@open-pencil/scene-graph'
-import { useI18n, useLayoutControlsContext, useRetainedPopup } from '@open-pencil/vue'
-import type { SizeLimitProp } from '@open-pencil/vue'
+import type { SizeLimitProp } from '@open-pencil/vue/controls/layout'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
+import { useLayoutControlsContext } from '@open-pencil/vue/primitives/LayoutControls'
import type { SizeAxisFieldProps } from '@/components/properties/layout/size/types'
import VariableNumberField from '@/components/properties/VariableNumberField.vue'
diff --git a/src/components/properties/layout/size/SizeControls.vue b/src/components/properties/layout/size/SizeControls.vue
index 5a889eeec..ee31742df 100644
--- a/src/components/properties/layout/size/SizeControls.vue
+++ b/src/components/properties/layout/size/SizeControls.vue
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n, useLayoutControlsContext } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useLayoutControlsContext } from '@open-pencil/vue/primitives/LayoutControls'
import SizeAxisField from '@/components/properties/layout/size/SizeAxisField.vue'
import SizeLimitField from '@/components/properties/layout/size/SizeLimitField.vue'
diff --git a/src/components/properties/layout/size/SizeLimitField.vue b/src/components/properties/layout/size/SizeLimitField.vue
index f2dc615cb..b3143eaec 100644
--- a/src/components/properties/layout/size/SizeLimitField.vue
+++ b/src/components/properties/layout/size/SizeLimitField.vue
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { SelectRoot, SelectTrigger } from 'reka-ui'
-import { useLayoutControlsContext, useRetainedPopup } from '@open-pencil/vue'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
+import { useLayoutControlsContext } from '@open-pencil/vue/primitives/LayoutControls'
import type { SizeLimitFieldProps } from '@/components/properties/layout/size/types'
import VariableNumberField from '@/components/properties/VariableNumberField.vue'
diff --git a/src/components/properties/layout/size/types.ts b/src/components/properties/layout/size/types.ts
index d5dd9e862..b5d9b3425 100644
--- a/src/components/properties/layout/size/types.ts
+++ b/src/components/properties/layout/size/types.ts
@@ -1,4 +1,4 @@
-import type { LayoutAxis, SizeLimitProp } from '@open-pencil/vue'
+import type { LayoutAxis, SizeLimitProp } from '@open-pencil/vue/controls/layout'
export interface SizeAxisFieldProps {
axis: LayoutAxis
diff --git a/src/components/properties/paint/PaintValue.vue b/src/components/properties/paint/PaintValue.vue
index 3b2626bb3..761b6d773 100644
--- a/src/components/properties/paint/PaintValue.vue
+++ b/src/components/properties/paint/PaintValue.vue
@@ -2,7 +2,8 @@
import { computed } from 'vue'
import type { Color } from '@open-pencil/scene-graph/primitives'
-import { inputValue, useColorModel } from '@open-pencil/vue'
+import { useColorModel } from '@open-pencil/vue/controls/color-model'
+import { inputValue } from '@open-pencil/vue/shared/dom-events'
import { BindingPill } from '@/components/ui/binding'
diff --git a/src/components/properties/paint/binding.ts b/src/components/properties/paint/binding.ts
index be24e62ae..eb7895355 100644
--- a/src/components/properties/paint/binding.ts
+++ b/src/components/properties/paint/binding.ts
@@ -1,5 +1,6 @@
import type { Color } from '@open-pencil/scene-graph/primitives'
-import type { BindableValueActions, BindingTarget } from '@open-pencil/vue'
+import type { BindingTarget } from '@open-pencil/vue/controls/binding-provider'
+import type { BindableValueActions } from '@open-pencil/vue/primitives/BindableValue'
export type PaintBindingKind = 'fills' | 'strokes'
diff --git a/src/components/properties/paint/gradient-edit.ts b/src/components/properties/paint/gradient-edit.ts
index 59e713247..c7521e01e 100644
--- a/src/components/properties/paint/gradient-edit.ts
+++ b/src/components/properties/paint/gradient-edit.ts
@@ -1,4 +1,4 @@
-import { editedGradientLayout, type GradientEdit } from '@open-pencil/core/editor'
+import { editedGradientLayout, type GradientEdit } from '@open-pencil/core'
import { hitTestGradientHandles } from '@open-pencil/core/geometry'
import { useEditorStore } from '@/app/editor/active-store'
diff --git a/src/components/properties/paint/okhcl.ts b/src/components/properties/paint/okhcl.ts
index 81136bfac..ee9dfc2e1 100644
--- a/src/components/properties/paint/okhcl.ts
+++ b/src/components/properties/paint/okhcl.ts
@@ -1,5 +1,5 @@
import type { SceneNode } from '@open-pencil/scene-graph'
-import type { useOkHCL } from '@open-pencil/vue'
+import type { useOkHCL } from '@open-pencil/vue/controls/okhcl'
type OkhclControls = ReturnType<typeof useOkHCL>
type ColorFieldFormat = Parameters<OkhclControls['setFillFieldFormat']>[2]
diff --git a/src/components/properties/panel/RetainedPanel.vue b/src/components/properties/panel/RetainedPanel.vue
index cb2705ec6..d48b86078 100644
--- a/src/components/properties/panel/RetainedPanel.vue
+++ b/src/components/properties/panel/RetainedPanel.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { defineComponent, KeepAlive, toRef } from 'vue'
-import { provideRetainedActivity } from '@open-pencil/vue'
+import { provideRetainedActivity } from '@open-pencil/vue/lifecycle/retention'
const { active } = defineProps<{ active: boolean }>()
provideRetainedActivity(toRef(() => active))
diff --git a/src/components/properties/selection/SelectionColorsSection.vue b/src/components/properties/selection/SelectionColorsSection.vue
index e797a850b..c1ff1ede2 100644
--- a/src/components/properties/selection/SelectionColorsSection.vue
+++ b/src/components/properties/selection/SelectionColorsSection.vue
@@ -1,6 +1,8 @@
<script setup lang="ts">
-import type { Color, Fill } from '@open-pencil/scene-graph'
-import { useI18n, useSelectionColors } from '@open-pencil/vue'
+import type { Fill } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import { useSelectionColors } from '@open-pencil/vue/controls/selection-colors'
+import { useI18n } from '@open-pencil/vue/i18n'
import ColorPicker from '@/components/ColorPicker/ColorPicker.vue'
import PaintField from '@/components/inputs/PaintField.vue'
diff --git a/src/components/properties/selection/SelectionLayoutSection.vue b/src/components/properties/selection/SelectionLayoutSection.vue
index e033916b8..c5994b795 100644
--- a/src/components/properties/selection/SelectionLayoutSection.vue
+++ b/src/components/properties/selection/SelectionLayoutSection.vue
@@ -1,10 +1,8 @@
<script setup lang="ts">
-import {
- PositionControlsRoot,
- useEditorCommands,
- useI18n,
- useSelectionLayout
-} from '@open-pencil/vue'
+import { useSelectionLayout } from '@open-pencil/vue/controls/selection-layout'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { PositionControlsRoot } from '@open-pencil/vue/primitives/PositionControls'
import NumberField from '@/components/inputs/NumberField.vue'
import ClipContentControl from '@/components/properties/layout/ClipContentControl.vue'
diff --git a/src/components/properties/shape-with-text/ShapeWithTextControls.stories.ts b/src/components/properties/shape-with-text/ShapeWithTextControls.stories.ts
index 086d65495..c090d24c3 100644
--- a/src/components/properties/shape-with-text/ShapeWithTextControls.stories.ts
+++ b/src/components/properties/shape-with-text/ShapeWithTextControls.stories.ts
@@ -8,7 +8,7 @@ import type {
FigJamLineStyle,
FigJamTextSize,
FigJamTypeface
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/figjam'
import type { ShapeWithTextType } from '@open-pencil/scene-graph/shape-with-text'
import ShapeWithTextControls from './ShapeWithTextControls.vue'
diff --git a/src/components/properties/shape-with-text/ShapeWithTextControls.vue b/src/components/properties/shape-with-text/ShapeWithTextControls.vue
index 8b0fbd380..618b2ad41 100644
--- a/src/components/properties/shape-with-text/ShapeWithTextControls.vue
+++ b/src/components/properties/shape-with-text/ShapeWithTextControls.vue
@@ -8,9 +8,9 @@ import type {
FigJamLineStyle,
FigJamTextSize,
FigJamTypeface
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/figjam'
import type { ShapeWithTextType } from '@open-pencil/scene-graph/shape-with-text'
-import { useFigJamMessages, useShapeMessages } from '@open-pencil/vue'
+import { useFigJamMessages, useShapeMessages } from '@open-pencil/vue/i18n'
import FigJamPalette from '@/components/figjam/FigJamPalette.vue'
import { typefaceModel, useFigJamTextOptions } from '@/components/figjam/text-options'
diff --git a/src/components/properties/shape-with-text/ShapeWithTextSection.vue b/src/components/properties/shape-with-text/ShapeWithTextSection.vue
index 46f1e791b..006569eac 100644
--- a/src/components/properties/shape-with-text/ShapeWithTextSection.vue
+++ b/src/components/properties/shape-with-text/ShapeWithTextSection.vue
@@ -1,5 +1,6 @@
<script setup lang="ts">
-import { useShapeMessages, useShapeWithText } from '@open-pencil/vue'
+import { useShapeWithText } from '@open-pencil/vue/controls/shape-with-text'
+import { useShapeMessages } from '@open-pencil/vue/i18n'
import PanelSection from '@/components/ui/panel/PanelSection.vue'
diff --git a/src/components/properties/shared-style/SharedStyleField.vue b/src/components/properties/shared-style/SharedStyleField.vue
index 258c17330..4dff2909b 100644
--- a/src/components/properties/shared-style/SharedStyleField.vue
+++ b/src/components/properties/shared-style/SharedStyleField.vue
@@ -1,6 +1,6 @@
<script setup lang="ts">
import type { SharedStyleKind } from '@open-pencil/scene-graph'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useSharedStylePicker } from '@/components/properties/shared-style/useSharedStylePicker'
import PanelFieldGroup from '@/components/ui/panel/PanelFieldGroup.vue'
diff --git a/src/components/properties/shared-style/useSharedStylePicker.ts b/src/components/properties/shared-style/useSharedStylePicker.ts
index fbbd7df68..ac26e5d60 100644
--- a/src/components/properties/shared-style/useSharedStylePicker.ts
+++ b/src/components/properties/shared-style/useSharedStylePicker.ts
@@ -1,7 +1,9 @@
import { computed } from 'vue'
import type { SharedStyleKind } from '@open-pencil/scene-graph'
-import { MIXED, useI18n, useSharedStyleBinding } from '@open-pencil/vue'
+import { MIXED } from '@open-pencil/vue/controls/node-props'
+import { useSharedStyleBinding } from '@open-pencil/vue/controls/shared-style'
+import { useI18n } from '@open-pencil/vue/i18n'
export function useSharedStylePicker(kind: SharedStyleKind) {
const { panels } = useI18n()
diff --git a/src/components/properties/status/StatusSection.vue b/src/components/properties/status/StatusSection.vue
index a6855d1d9..e093137e3 100644
--- a/src/components/properties/status/StatusSection.vue
+++ b/src/components/properties/status/StatusSection.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useStatusMessages } from '@open-pencil/vue'
+import { useStatusMessages } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import { openStatusesDialog } from '@/app/editor/statuses/dialog'
diff --git a/src/components/properties/status/StatusesSection.vue b/src/components/properties/status/StatusesSection.vue
index 191192c30..50ef4bed3 100644
--- a/src/components/properties/status/StatusesSection.vue
+++ b/src/components/properties/status/StatusesSection.vue
@@ -1,5 +1,6 @@
<script setup lang="ts">
-import { useSceneComputed, useStatusMessages } from '@open-pencil/vue'
+import { useStatusMessages } from '@open-pencil/vue/i18n'
+import { useSceneComputed } from '@open-pencil/vue/internal/scene-computed'
import { useEditorStore } from '@/app/editor/active-store'
import { openStatusesDialog } from '@/app/editor/statuses/dialog'
diff --git a/src/components/properties/sticky/StickyControls.stories.ts b/src/components/properties/sticky/StickyControls.stories.ts
index e4580ccff..a063cc600 100644
--- a/src/components/properties/sticky/StickyControls.stories.ts
+++ b/src/components/properties/sticky/StickyControls.stories.ts
@@ -2,7 +2,8 @@ import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { expect, userEvent, within } from 'storybook/test'
import { ref } from 'vue'
-import { DEFAULT_STICKY_COLOR, type FigJamTextSize } from '@open-pencil/scene-graph'
+import type { FigJamTextSize } from '@open-pencil/scene-graph/figjam'
+import { DEFAULT_STICKY_COLOR } from '@open-pencil/scene-graph/generated'
import type { Color } from '@open-pencil/scene-graph/primitives'
import StickyControls from './StickyControls.vue'
diff --git a/src/components/properties/sticky/StickyControls.vue b/src/components/properties/sticky/StickyControls.vue
index 0555f1275..bc3452b6c 100644
--- a/src/components/properties/sticky/StickyControls.vue
+++ b/src/components/properties/sticky/StickyControls.vue
@@ -2,10 +2,11 @@
import { tv } from 'tailwind-variants'
import { computed } from 'vue'
-import { STICKY_COLORS, type FigJamTextSize, type FigJamTypeface } from '@open-pencil/scene-graph'
import { colorToHex } from '@open-pencil/scene-graph/color'
+import type { FigJamTextSize, FigJamTypeface } from '@open-pencil/scene-graph/figjam'
+import { STICKY_COLORS } from '@open-pencil/scene-graph/generated'
import type { Color } from '@open-pencil/scene-graph/primitives'
-import { useFigJamMessages, useI18n } from '@open-pencil/vue'
+import { useFigJamMessages, useI18n } from '@open-pencil/vue/i18n'
import Swatches from '@/components/figjam/Swatches.vue'
import { typefaceModel, useFigJamTextOptions } from '@/components/figjam/text-options'
diff --git a/src/components/properties/sticky/StickySection.vue b/src/components/properties/sticky/StickySection.vue
index 3aa8f6152..054a9f447 100644
--- a/src/components/properties/sticky/StickySection.vue
+++ b/src/components/properties/sticky/StickySection.vue
@@ -1,5 +1,6 @@
<script setup lang="ts">
-import { useI18n, useStickyNote } from '@open-pencil/vue'
+import { useStickyNote } from '@open-pencil/vue/controls/sticky'
+import { useI18n } from '@open-pencil/vue/i18n'
import PanelSection from '@/components/ui/panel/PanelSection.vue'
diff --git a/src/components/properties/stroke/StrokeDashControls.vue b/src/components/properties/stroke/StrokeDashControls.vue
index ce64308dc..b35a61050 100644
--- a/src/components/properties/stroke/StrokeDashControls.vue
+++ b/src/components/properties/stroke/StrokeDashControls.vue
@@ -1,6 +1,7 @@
<script setup lang="ts">
import type { Stroke } from '@open-pencil/scene-graph'
-import { useI18n, useStrokeControls } from '@open-pencil/vue'
+import { useStrokeControls } from '@open-pencil/vue/controls/stroke'
+import { useI18n } from '@open-pencil/vue/i18n'
import NumberField from '@/components/inputs/NumberField.vue'
import PanelFieldGroup from '@/components/ui/panel/PanelFieldGroup.vue'
diff --git a/src/components/properties/stroke/StrokeGeometryControls.vue b/src/components/properties/stroke/StrokeGeometryControls.vue
index 341063d0b..490ec28d9 100644
--- a/src/components/properties/stroke/StrokeGeometryControls.vue
+++ b/src/components/properties/stroke/StrokeGeometryControls.vue
@@ -1,5 +1,7 @@
<script setup lang="ts">
-import { isStrokeCapValue, MIXED, useI18n, useStrokeControls } from '@open-pencil/vue'
+import { MIXED } from '@open-pencil/vue/controls/node-props'
+import { isStrokeCapValue, useStrokeControls } from '@open-pencil/vue/controls/stroke'
+import { useI18n } from '@open-pencil/vue/i18n'
import NumberField from '@/components/inputs/NumberField.vue'
import Tip from '@/components/ui/overlay/Tip.vue'
diff --git a/src/components/properties/stroke/StrokeSection.vue b/src/components/properties/stroke/StrokeSection.vue
index 7041b70cc..8a9725542 100644
--- a/src/components/properties/stroke/StrokeSection.vue
+++ b/src/components/properties/stroke/StrokeSection.vue
@@ -1,21 +1,20 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
-import { SIDE_STROKE_TYPES } from '@open-pencil/scene-graph'
-import type { Color, Fill, SceneNode, Stroke } from '@open-pencil/scene-graph'
+import type { Fill, SceneNode, Stroke } from '@open-pencil/scene-graph'
import { colorToHexRaw } from '@open-pencil/scene-graph/color'
+import { SIDE_STROKE_TYPES } from '@open-pencil/scene-graph/node-defaults'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import { useColorBindingProvider } from '@open-pencil/vue/controls/binding-provider'
+import { applySolidStrokeColor, applyStrokePaint } from '@open-pencil/vue/controls/color-model'
+import { MIXED, useNodeProps } from '@open-pencil/vue/controls/node-props'
+import { useOkHCL } from '@open-pencil/vue/controls/okhcl'
+import { useStrokeControls } from '@open-pencil/vue/controls/stroke'
+import { useI18n } from '@open-pencil/vue/i18n'
import {
- applySolidStrokeColor,
- applyStrokePaint,
BindableValueRoot,
- MIXED,
- useColorBindingProvider,
- useI18n,
- useNodeProps,
- useOkHCL,
- useStrokeControls
-} from '@open-pencil/vue'
-import type { BindableValueActions } from '@open-pencil/vue'
+ type BindableValueActions
+} from '@open-pencil/vue/primitives/BindableValue'
import FillPicker from '@/components/fill-picker/FillPicker.vue'
import NumberField from '@/components/inputs/NumberField.vue'
diff --git a/src/components/properties/stroke/StrokeSettingsPopover.vue b/src/components/properties/stroke/StrokeSettingsPopover.vue
index 9529c61ca..793a7df51 100644
--- a/src/components/properties/stroke/StrokeSettingsPopover.vue
+++ b/src/components/properties/stroke/StrokeSettingsPopover.vue
@@ -2,7 +2,8 @@
import { PopoverRoot, PopoverTrigger, PopoverPortal, PopoverContent, PopoverClose } from 'reka-ui'
import type { Stroke } from '@open-pencil/scene-graph'
-import { useI18n, useRetainedPopup } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
import AppButton from '@/components/ui/button/AppButton.vue'
import { usePopoverUI } from '@/components/ui/overlay/popover'
diff --git a/src/components/properties/text-content/TextContentControl.vue b/src/components/properties/text-content/TextContentControl.vue
index 1a5c4e25e..a44dd8fda 100644
--- a/src/components/properties/text-content/TextContentControl.vue
+++ b/src/components/properties/text-content/TextContentControl.vue
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { BindableValueRoot, useTextContentBindingProvider } from '@open-pencil/vue'
+import { useTextContentBindingProvider } from '@open-pencil/vue/controls/binding-provider'
+import { BindableValueRoot } from '@open-pencil/vue/primitives/BindableValue'
import FieldBindingPicker from '@/components/properties/binding/FieldBindingPicker.vue'
diff --git a/src/components/properties/text-content/TextContentSection.vue b/src/components/properties/text-content/TextContentSection.vue
index 3ddce85ee..d61bc2619 100644
--- a/src/components/properties/text-content/TextContentSection.vue
+++ b/src/components/properties/text-content/TextContentSection.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import VariableBoundRow from '@/components/properties/binding/VariableBoundRow.vue'
import PropertyBoundField from '@/components/properties/component-properties/PropertyBoundField.vue'
diff --git a/src/components/properties/typography/LineHeightField.vue b/src/components/properties/typography/LineHeightField.vue
index 06eda10f9..5fa3039fb 100644
--- a/src/components/properties/typography/LineHeightField.vue
+++ b/src/components/properties/typography/LineHeightField.vue
@@ -3,7 +3,10 @@ import { SelectRoot, SelectTrigger } from 'reka-ui'
import { computed } from 'vue'
import type { SceneNode } from '@open-pencil/scene-graph'
-import { MIXED, useEditor, useI18n, useRetainedPopup } from '@open-pencil/vue'
+import { useEditor } from '@open-pencil/vue'
+import { MIXED } from '@open-pencil/vue/controls/node-props'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
import VariableNumberField from '@/components/properties/VariableNumberField.vue'
import AppSelectContent from '@/components/ui/select/AppSelectContent.vue'
diff --git a/src/components/properties/variable-modes/VariableModeMenu.vue b/src/components/properties/variable-modes/VariableModeMenu.vue
index 33bf5fd02..3b2cc98c4 100644
--- a/src/components/properties/variable-modes/VariableModeMenu.vue
+++ b/src/components/properties/variable-modes/VariableModeMenu.vue
@@ -15,7 +15,9 @@ import {
} from 'reka-ui'
import { computed } from 'vue'
-import { MIXED, usePanelMessages, type VariableModeChoice } from '@open-pencil/vue'
+import { MIXED } from '@open-pencil/vue/controls/node-props'
+import type { VariableModeChoice } from '@open-pencil/vue/controls/variable-modes'
+import { usePanelMessages } from '@open-pencil/vue/i18n'
import IconButton from '@/components/ui/button/IconButton.vue'
import { menuItem, useMenuUI } from '@/components/ui/menu/menu'
diff --git a/src/components/properties/variable-modes/VariableModeRows.vue b/src/components/properties/variable-modes/VariableModeRows.vue
index 191c5d307..c7f7b771e 100644
--- a/src/components/properties/variable-modes/VariableModeRows.vue
+++ b/src/components/properties/variable-modes/VariableModeRows.vue
@@ -1,5 +1,7 @@
<script setup lang="ts">
-import { MIXED, usePanelMessages, type VariableModeChoice } from '@open-pencil/vue'
+import { MIXED } from '@open-pencil/vue/controls/node-props'
+import type { VariableModeChoice } from '@open-pencil/vue/controls/variable-modes'
+import { usePanelMessages } from '@open-pencil/vue/i18n'
import IconButton from '@/components/ui/button/IconButton.vue'
import AppSelect from '@/components/ui/select/AppSelect.vue'
diff --git a/src/components/properties/variable-modes/labels.ts b/src/components/properties/variable-modes/labels.ts
index 3a8f84d6b..5fa38fc05 100644
--- a/src/components/properties/variable-modes/labels.ts
+++ b/src/components/properties/variable-modes/labels.ts
@@ -1,4 +1,5 @@
-import type { usePanelMessages, VariableModeChoice } from '@open-pencil/vue'
+import type { VariableModeChoice } from '@open-pencil/vue/controls/variable-modes'
+import type { usePanelMessages } from '@open-pencil/vue/i18n'
type PanelMessages = ReturnType<typeof usePanelMessages>['value']
diff --git a/src/components/properties/visibility/VisibilityControl.vue b/src/components/properties/visibility/VisibilityControl.vue
index 4a81b6356..93f65106f 100644
--- a/src/components/properties/visibility/VisibilityControl.vue
+++ b/src/components/properties/visibility/VisibilityControl.vue
@@ -1,7 +1,9 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { BindableValueRoot, useI18n, useVisibilityBindingProvider } from '@open-pencil/vue'
+import { useVisibilityBindingProvider } from '@open-pencil/vue/controls/binding-provider'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { BindableValueRoot } from '@open-pencil/vue/primitives/BindableValue'
import FieldBindingPicker from '@/components/properties/binding/FieldBindingPicker.vue'
import IconButton from '@/components/ui/button/IconButton.vue'
diff --git a/src/components/recovery/RecoveryDialog.vue b/src/components/recovery/RecoveryDialog.vue
index 28fcfe1d3..6e72d77e1 100644
--- a/src/components/recovery/RecoveryDialog.vue
+++ b/src/components/recovery/RecoveryDialog.vue
@@ -3,7 +3,7 @@ import { AlertDialogCancel, AlertDialogDescription, AlertDialogTitle } from 'rek
import { onMounted, ref } from 'vue'
import { useRoute } from 'vue-router'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { RecoverySnapshotMeta } from '@/app/document/recovery'
import { recoveryEnabled } from '@/app/document/recovery/preferences'
diff --git a/src/components/save-to/SaveToDialog.vue b/src/components/save-to/SaveToDialog.vue
index 025c162f4..ea70e070c 100644
--- a/src/components/save-to/SaveToDialog.vue
+++ b/src/components/save-to/SaveToDialog.vue
@@ -3,7 +3,7 @@ import { groupBy } from 'es-toolkit'
import { RadioGroupItem, RadioGroupRoot } from 'reka-ui'
import { computed } from 'vue'
-import { useCloudMessages, useCommonMessages } from '@open-pencil/vue'
+import { useCloudMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import { formatStorageBytes } from '@/app/storage/format-bytes'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/selection/RenameSelectionDialog.vue b/src/components/selection/RenameSelectionDialog.vue
index 56430a983..3400f8a7b 100644
--- a/src/components/selection/RenameSelectionDialog.vue
+++ b/src/components/selection/RenameSelectionDialog.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, nextTick, ref, watch, useTemplateRef } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/settings/SettingsDialog.vue b/src/components/settings/SettingsDialog.vue
index a99c1029a..f7a149aa1 100644
--- a/src/components/settings/SettingsDialog.vue
+++ b/src/components/settings/SettingsDialog.vue
@@ -3,7 +3,8 @@ import { tryOnScopeDispose } from '@vueuse/core'
import { AlertDialogCancel, DialogClose } from 'reka-ui'
import { computed } from 'vue'
-import { useI18n, useViewportKind } from '@open-pencil/vue'
+import { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
+import { useI18n } from '@open-pencil/vue/i18n'
import { CLOUD_INCLUDED } from '@/app/cloud/integration'
import {
diff --git a/src/components/settings/agents/AgentSetup.vue b/src/components/settings/agents/AgentSetup.vue
index 48e0cde03..7108b69e8 100644
--- a/src/components/settings/agents/AgentSetup.vue
+++ b/src/components/settings/agents/AgentSetup.vue
@@ -4,7 +4,7 @@ import { tv } from 'tailwind-variants'
import { computed } from 'vue'
import type { ACPAgentDef } from '@open-pencil/core/constants'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { codingAgentGuideURL, codingAgentSetupPrompt } from '@/app/ai/agents/setup/prompt'
import { agentSetupView, type AgentSetupState } from '@/app/ai/agents/setup/view'
diff --git a/src/components/settings/agents/AgentSignInProgress.vue b/src/components/settings/agents/AgentSignInProgress.vue
index 7489a8df9..bbf848c2a 100644
--- a/src/components/settings/agents/AgentSignInProgress.vue
+++ b/src/components/settings/agents/AgentSignInProgress.vue
@@ -2,7 +2,7 @@
import { tv } from 'tailwind-variants'
import { ref } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { AgentAccountView } from '@/app/ai/agents/setup/view'
import SettingsLink from '@/components/settings/layout/SettingsLink.vue'
diff --git a/src/components/settings/agents/PiSetup.vue b/src/components/settings/agents/PiSetup.vue
index d2db39c5c..ebccdda36 100644
--- a/src/components/settings/agents/PiSetup.vue
+++ b/src/components/settings/agents/PiSetup.vue
@@ -2,7 +2,7 @@
import { tv } from 'tailwind-variants'
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { piSetupView, type CompanionCheck, type PiSetupState } from '@/app/ai/agents/setup/view'
import SettingsLink from '@/components/settings/layout/SettingsLink.vue'
diff --git a/src/components/settings/agents/problem.ts b/src/components/settings/agents/problem.ts
index a5d454a65..ba9892236 100644
--- a/src/components/settings/agents/problem.ts
+++ b/src/components/settings/agents/problem.ts
@@ -1,4 +1,4 @@
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { SetupProblem } from '@/app/ai/agents/setup/view'
diff --git a/src/components/settings/ai-setup/AISetupAccess.vue b/src/components/settings/ai-setup/AISetupAccess.vue
index c953aa9c6..7d241a2a1 100644
--- a/src/components/settings/ai-setup/AISetupAccess.vue
+++ b/src/components/settings/ai-setup/AISetupAccess.vue
@@ -2,7 +2,7 @@
import { tv } from 'tailwind-variants'
import { ref } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { AgentDetection } from '@/app/ai/agents/setup/detection'
import { modelProviderName } from '@/app/ai/models/provider-name'
diff --git a/src/components/settings/ai-setup/AISetupConnection.vue b/src/components/settings/ai-setup/AISetupConnection.vue
index 73a36a262..65c200a2c 100644
--- a/src/components/settings/ai-setup/AISetupConnection.vue
+++ b/src/components/settings/ai-setup/AISetupConnection.vue
@@ -3,7 +3,7 @@ import { tv } from 'tailwind-variants'
import { computed } from 'vue'
import { ACP_AGENTS, AI_PROVIDERS } from '@open-pencil/core/constants'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { AgentSetupState, PiSetupState } from '@/app/ai/agents/setup/view'
import { modelProviderName } from '@/app/ai/models/provider-name'
diff --git a/src/components/settings/ai-setup/AISetupFlow.vue b/src/components/settings/ai-setup/AISetupFlow.vue
index 6193e9d7a..b404db44f 100644
--- a/src/components/settings/ai-setup/AISetupFlow.vue
+++ b/src/components/settings/ai-setup/AISetupFlow.vue
@@ -3,7 +3,7 @@ import { tv } from 'tailwind-variants'
import { computed, ref } from 'vue'
import { IS_TAURI } from '@open-pencil/core/constants'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { AISetupEntry } from '@/app/ai/models/settings/onboarding/dialog'
import type { OnboardingAccess } from '@/app/ai/models/settings/onboarding/plan'
diff --git a/src/components/settings/ai-setup/AISetupRoles.vue b/src/components/settings/ai-setup/AISetupRoles.vue
index 9335791a3..3884041d5 100644
--- a/src/components/settings/ai-setup/AISetupRoles.vue
+++ b/src/components/settings/ai-setup/AISetupRoles.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import {
roleChoiceKey,
diff --git a/src/components/settings/ai-setup/AISetupServer.vue b/src/components/settings/ai-setup/AISetupServer.vue
index bb47a3a60..7a687d66f 100644
--- a/src/components/settings/ai-setup/AISetupServer.vue
+++ b/src/components/settings/ai-setup/AISetupServer.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import {
ONBOARDING_SERVER_PRESETS,
diff --git a/src/components/settings/ai-setup/AISetupSignIn.vue b/src/components/settings/ai-setup/AISetupSignIn.vue
index 471d43e4c..9c7d78fa3 100644
--- a/src/components/settings/ai-setup/AISetupSignIn.vue
+++ b/src/components/settings/ai-setup/AISetupSignIn.vue
@@ -2,7 +2,7 @@
import { tv } from 'tailwind-variants'
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { OnboardingConnectionState } from '@/app/ai/models/settings/onboarding/connections'
import type { OnboardingSignInStatus } from '@/app/ai/models/settings/onboarding/sign-in'
diff --git a/src/components/settings/ai-setup/role-label.ts b/src/components/settings/ai-setup/role-label.ts
index d0c9b1e47..becfb0d23 100644
--- a/src/components/settings/ai-setup/role-label.ts
+++ b/src/components/settings/ai-setup/role-label.ts
@@ -1,4 +1,4 @@
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { modelProviderName } from '@/app/ai/models/provider-name'
import { isOnboardingAgent, type PlannedRole } from '@/app/ai/models/settings/onboarding/plan'
diff --git a/src/components/settings/chat/ChatSettingsSection.vue b/src/components/settings/chat/ChatSettingsSection.vue
index 13c14e04f..79a275190 100644
--- a/src/components/settings/chat/ChatSettingsSection.vue
+++ b/src/components/settings/chat/ChatSettingsSection.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { changePreviewSize, maxAgentSteps, reasoningDisplay } from '@/app/ai/chat/preferences'
import { AGENT_STEP_LIMIT_MIN, AGENT_STEP_LIMIT_MAX } from '@/app/ai/reply/step-limit'
diff --git a/src/components/settings/cloud/CloudSettingsPanel.vue b/src/components/settings/cloud/CloudSettingsPanel.vue
index 3a6d1a72c..370e518f6 100644
--- a/src/components/settings/cloud/CloudSettingsPanel.vue
+++ b/src/components/settings/cloud/CloudSettingsPanel.vue
@@ -8,7 +8,7 @@ import {
DropdownMenuTrigger
} from 'reka-ui'
-import { useCloudMessages } from '@open-pencil/vue'
+import { useCloudMessages } from '@open-pencil/vue/i18n'
import AccountAvatar from '@/components/presence/AccountAvatar.vue'
import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'
diff --git a/src/components/settings/cloud/CloudSettingsSection.vue b/src/components/settings/cloud/CloudSettingsSection.vue
index 533162a40..76edc17be 100644
--- a/src/components/settings/cloud/CloudSettingsSection.vue
+++ b/src/components/settings/cloud/CloudSettingsSection.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
-import { useCloudMessages, useCommonMessages } from '@open-pencil/vue'
+import { useCloudMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import { cloudOfficialListed } from '@/app/cloud/availability'
import { openCloudConnect } from '@/app/cloud/connect/flow'
diff --git a/src/components/settings/cloud/CloudWaitlist.vue b/src/components/settings/cloud/CloudWaitlist.vue
index 883e48530..d7bd974c4 100644
--- a/src/components/settings/cloud/CloudWaitlist.vue
+++ b/src/components/settings/cloud/CloudWaitlist.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, useTemplateRef } from 'vue'
-import { useStorageMessages } from '@open-pencil/vue'
+import { useStorageMessages } from '@open-pencil/vue/i18n'
import { useWaitlistSignup } from '@/app/cloud/waitlist/signup'
import { openExternalLink } from '@/app/shell/ui'
diff --git a/src/components/settings/credentials/CredentialSettingsSection.vue b/src/components/settings/credentials/CredentialSettingsSection.vue
index 19a4f9b57..c1a5173ce 100644
--- a/src/components/settings/credentials/CredentialSettingsSection.vue
+++ b/src/components/settings/credentials/CredentialSettingsSection.vue
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { IS_TAURI } from '@open-pencil/core/constants'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useCredentialSettings } from '@/app/settings/credentials/preferences/use'
import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'
diff --git a/src/components/settings/diagnostics/DiagnosticsEventList.vue b/src/components/settings/diagnostics/DiagnosticsEventList.vue
index bbea92cb6..2d9ede1e7 100644
--- a/src/components/settings/diagnostics/DiagnosticsEventList.vue
+++ b/src/components/settings/diagnostics/DiagnosticsEventList.vue
@@ -2,7 +2,7 @@
import { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger } from 'reka-ui'
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { summarizeDiagnosticEvent, type DiagnosticCategory } from '@/app/diagnostics'
import { useRecentDiagnostics } from '@/app/diagnostics/settings/recent'
diff --git a/src/components/settings/diagnostics/DiagnosticsSettingsPanel.vue b/src/components/settings/diagnostics/DiagnosticsSettingsPanel.vue
index 3b6697799..d3fb9d349 100644
--- a/src/components/settings/diagnostics/DiagnosticsSettingsPanel.vue
+++ b/src/components/settings/diagnostics/DiagnosticsSettingsPanel.vue
@@ -2,7 +2,7 @@
import { useClipboard } from '@vueuse/core'
import { computed, ref } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { diagnostics } from '@/app/diagnostics'
import { diagnosticsEnvironment } from '@/app/diagnostics/environment'
diff --git a/src/components/settings/general/AccentColorPicker.vue b/src/components/settings/general/AccentColorPicker.vue
index fb9886d6d..b7a2148bd 100644
--- a/src/components/settings/general/AccentColorPicker.vue
+++ b/src/components/settings/general/AccentColorPicker.vue
@@ -5,7 +5,7 @@ import { computed, shallowRef } from 'vue'
import { colorToHex } from '@open-pencil/scene-graph/color'
import type { Color } from '@open-pencil/scene-graph/primitives'
-import { useSettingsMessages } from '@open-pencil/vue'
+import { useSettingsMessages } from '@open-pencil/vue/i18n'
import { accentPreference } from '@/app/shell/accent'
import {
diff --git a/src/components/settings/general/CollaborationNameSection.vue b/src/components/settings/general/CollaborationNameSection.vue
index 4d767b0fd..606bdc256 100644
--- a/src/components/settings/general/CollaborationNameSection.vue
+++ b/src/components/settings/general/CollaborationNameSection.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue'
-import { useCollaborationMessages } from '@open-pencil/vue'
+import { useCollaborationMessages } from '@open-pencil/vue/i18n'
import { useCollabIdentity } from '@/app/collab/identity'
import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'
diff --git a/src/components/settings/general/GeneralSettingsPanel.vue b/src/components/settings/general/GeneralSettingsPanel.vue
index 60cc3a57f..a2dcfed91 100644
--- a/src/components/settings/general/GeneralSettingsPanel.vue
+++ b/src/components/settings/general/GeneralSettingsPanel.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { type Locale, useI18n } from '@open-pencil/vue'
+import { type Locale, useI18n } from '@open-pencil/vue/i18n'
import { recoveryEnabled, setRecoveryEnabled } from '@/app/document/recovery/preferences'
import { RECENT_FILES_LIMIT_MIN, RECENT_FILES_LIMIT_MAX } from '@/app/recent-files/limit'
diff --git a/src/components/settings/general/RenderingSettingsSection.vue b/src/components/settings/general/RenderingSettingsSection.vue
index 2ef00fb2d..aaf779e7a 100644
--- a/src/components/settings/general/RenderingSettingsSection.vue
+++ b/src/components/settings/general/RenderingSettingsSection.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { appRuntimeConfig } from '@/app/runtime/config'
import { appPreferences, updateCanvasRenderingMode } from '@/app/settings/preferences/store'
diff --git a/src/components/settings/layout/SettingsSaveFeedback.vue b/src/components/settings/layout/SettingsSaveFeedback.vue
index bb6162302..04e8c9fe8 100644
--- a/src/components/settings/layout/SettingsSaveFeedback.vue
+++ b/src/components/settings/layout/SettingsSaveFeedback.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useSettingsMessages } from '@open-pencil/vue'
+import { useSettingsMessages } from '@open-pencil/vue/i18n'
import type { SettingsSaveResult } from '@/app/settings/save-result'
import AppAlert from '@/components/ui/feedback/AppAlert.vue'
diff --git a/src/components/settings/mcp/MCPConnectionEditor.vue b/src/components/settings/mcp/MCPConnectionEditor.vue
index 639369b71..2e96eade2 100644
--- a/src/components/settings/mcp/MCPConnectionEditor.vue
+++ b/src/components/settings/mcp/MCPConnectionEditor.vue
@@ -6,7 +6,7 @@ import {
useCommonMessages,
useCredentialMessages,
useSettingsMessages
-} from '@open-pencil/vue'
+} from '@open-pencil/vue/i18n'
import type { MCPConnectionDraft } from '@/app/integrations/mcp'
import type { MCPConnectionFieldErrors } from '@/app/integrations/mcp/settings/form'
diff --git a/src/components/settings/mcp/MCPConnectionsSection.vue b/src/components/settings/mcp/MCPConnectionsSection.vue
index 0e10f7372..7855cabf2 100644
--- a/src/components/settings/mcp/MCPConnectionsSection.vue
+++ b/src/components/settings/mcp/MCPConnectionsSection.vue
@@ -2,7 +2,11 @@
import { AlertDialogAction, AlertDialogCancel } from 'reka-ui'
import { computed, ref, useTemplateRef, watch } from 'vue'
-import { useAutomationMessages, useCommonMessages, useSettingsMessages } from '@open-pencil/vue'
+import {
+ useAutomationMessages,
+ useCommonMessages,
+ useSettingsMessages
+} from '@open-pencil/vue/i18n'
import { mcpConnectionSettings } from '@/app/integrations/mcp'
import { useMCPConnectionForm } from '@/app/integrations/mcp/settings/form'
diff --git a/src/components/settings/mcp/MCPFailureAlert.vue b/src/components/settings/mcp/MCPFailureAlert.vue
index d0ba0b9e4..3ef5221ee 100644
--- a/src/components/settings/mcp/MCPFailureAlert.vue
+++ b/src/components/settings/mcp/MCPFailureAlert.vue
@@ -3,7 +3,7 @@ import { useClipboard } from '@vueuse/core'
import { compact } from 'es-toolkit/array'
import { computed, ref } from 'vue'
-import { useAutomationMessages, useI18n } from '@open-pencil/vue'
+import { useAutomationMessages, useI18n } from '@open-pencil/vue/i18n'
import { mcpServerSetupView, type MCPServerSetupState } from '@/app/ai/agents/setup/view'
import {
diff --git a/src/components/settings/mcp/MCPSettingsPanel.vue b/src/components/settings/mcp/MCPSettingsPanel.vue
index f2fa1a51b..648782f82 100644
--- a/src/components/settings/mcp/MCPSettingsPanel.vue
+++ b/src/components/settings/mcp/MCPSettingsPanel.vue
@@ -6,7 +6,7 @@ import {
useAutomationMessages,
useCommonMessages,
useSettingsMessages
-} from '@open-pencil/vue'
+} from '@open-pencil/vue/i18n'
import { useMCPServerSetup } from '@/app/ai/agents/setup/use'
import { restartFixesMCPFailure } from '@/app/automation/mcp/failure'
diff --git a/src/components/settings/mcp/WebMCPSettingsPanel.vue b/src/components/settings/mcp/WebMCPSettingsPanel.vue
index 21f27c3de..8d90a27a0 100644
--- a/src/components/settings/mcp/WebMCPSettingsPanel.vue
+++ b/src/components/settings/mcp/WebMCPSettingsPanel.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useAutomationMessages, useCommonMessages } from '@open-pencil/vue'
+import { useAutomationMessages, useCommonMessages } from '@open-pencil/vue/i18n'
import type { WebMCPMode } from '@/app/automation/webmcp/policy'
import type { WebMCPRuntimeState } from '@/app/automation/webmcp/service'
diff --git a/src/components/settings/media/MediaCredentialEditor.vue b/src/components/settings/media/MediaCredentialEditor.vue
index 33fb48ff7..7fb13372c 100644
--- a/src/components/settings/media/MediaCredentialEditor.vue
+++ b/src/components/settings/media/MediaCredentialEditor.vue
@@ -6,7 +6,7 @@ import {
useCredentialMessages,
useMediaMessages,
useSettingsMessages
-} from '@open-pencil/vue'
+} from '@open-pencil/vue/i18n'
import { useMediaSettingsEditor, type MediaSettingsService } from '@/app/settings/media/use'
import { useSettingsFormGuard } from '@/app/settings/navigation/use'
diff --git a/src/components/settings/media/MediaSettingsPanel.vue b/src/components/settings/media/MediaSettingsPanel.vue
index 2e2fa0535..b425e8d77 100644
--- a/src/components/settings/media/MediaSettingsPanel.vue
+++ b/src/components/settings/media/MediaSettingsPanel.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
-import { useMediaMessages, useSettingsMessages } from '@open-pencil/vue'
+import { useMediaMessages, useSettingsMessages } from '@open-pencil/vue/i18n'
import { vectorizeProviderID, VECTORIZE_PROVIDER_DEFINITIONS } from '@/app/editor/vectorize'
import { pexelsKeyStatus, unsplashKeyStatus } from '@/app/settings/credentials/media'
diff --git a/src/components/settings/models/ModelsPanel.vue b/src/components/settings/models/ModelsPanel.vue
index 6639ddb0b..46978f6a1 100644
--- a/src/components/settings/models/ModelsPanel.vue
+++ b/src/components/settings/models/ModelsPanel.vue
@@ -2,7 +2,7 @@
import { ref, onUnmounted, useTemplateRef } from 'vue'
import { HARNESS_PROVIDER_ID } from '@open-pencil/core/constants'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { openAISetup } from '@/app/ai/models/settings/onboarding/dialog'
import { useModelSettings } from '@/app/ai/models/settings/use'
diff --git a/src/components/settings/models/ProfileEditor.vue b/src/components/settings/models/ProfileEditor.vue
index 883ed559d..23e72c24b 100644
--- a/src/components/settings/models/ProfileEditor.vue
+++ b/src/components/settings/models/ProfileEditor.vue
@@ -2,7 +2,7 @@
import { computed, ref, useTemplateRef } from 'vue'
import type { AIProviderID } from '@open-pencil/core/constants'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { usePiSetup } from '@/app/ai/agents/setup/use'
import { useModelProfileFeedback } from '@/app/ai/models/settings/profile-editor/feedback'
diff --git a/src/components/settings/models/RoleAssignments.vue b/src/components/settings/models/RoleAssignments.vue
index c885ebf4e..897e13473 100644
--- a/src/components/settings/models/RoleAssignments.vue
+++ b/src/components/settings/models/RoleAssignments.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useModelRoleAssignments } from '@/app/ai/models/settings/assignments'
import { AI_MODEL_ROLES } from '@/app/ai/models/types'
diff --git a/src/components/settings/models/role-labels.ts b/src/components/settings/models/role-labels.ts
index a666a41fc..4cb9fa173 100644
--- a/src/components/settings/models/role-labels.ts
+++ b/src/components/settings/models/role-labels.ts
@@ -1,4 +1,4 @@
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { AIModelRole } from '@/app/ai/models/types'
diff --git a/src/components/settings/privacy/PrivacySettingsPanel.vue b/src/components/settings/privacy/PrivacySettingsPanel.vue
index ba9d0ff34..a7661539f 100644
--- a/src/components/settings/privacy/PrivacySettingsPanel.vue
+++ b/src/components/settings/privacy/PrivacySettingsPanel.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useSharingSettings } from '@/app/telemetry/settings'
import SettingsGroup from '@/components/settings/layout/SettingsGroup.vue'
diff --git a/src/components/settings/provider-select/ProviderSelect.vue b/src/components/settings/provider-select/ProviderSelect.vue
index b1d158f66..82bfba8cb 100644
--- a/src/components/settings/provider-select/ProviderSelect.vue
+++ b/src/components/settings/provider-select/ProviderSelect.vue
@@ -9,7 +9,7 @@ import {
IS_TAURI,
type AIProviderID
} from '@open-pencil/core/constants'
-import { useAIMessages } from '@open-pencil/vue'
+import { useAIMessages } from '@open-pencil/vue/i18n'
import AppSelect from '@/components/ui/select/AppSelect.vue'
import type { AppSelectGroup } from '@/components/ui/select/select'
diff --git a/src/components/settings/provider/ProviderConnectionTestButton.vue b/src/components/settings/provider/ProviderConnectionTestButton.vue
index e638debfd..07b9b10e7 100644
--- a/src/components/settings/provider/ProviderConnectionTestButton.vue
+++ b/src/components/settings/provider/ProviderConnectionTestButton.vue
@@ -2,7 +2,7 @@
import { tv } from 'tailwind-variants'
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { ProviderConnectionTestFailureReason } from '@/app/ai/models/connection-test'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/components/settings/provider/ProviderSettingsKeyField.vue b/src/components/settings/provider/ProviderSettingsKeyField.vue
index fa45deae1..778fca92e 100644
--- a/src/components/settings/provider/ProviderSettingsKeyField.vue
+++ b/src/components/settings/provider/ProviderSettingsKeyField.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import SettingsLink from '@/components/settings/layout/SettingsLink.vue'
import ProviderSettingsField from '@/components/settings/provider/ProviderSettingsField.vue'
diff --git a/src/components/settings/storage/StorageSettingsPanel.vue b/src/components/settings/storage/StorageSettingsPanel.vue
index 27eb10462..a8bb84f9d 100644
--- a/src/components/settings/storage/StorageSettingsPanel.vue
+++ b/src/components/settings/storage/StorageSettingsPanel.vue
@@ -7,7 +7,7 @@ import {
useCredentialMessages,
useSettingsMessages,
useStorageMessages
-} from '@open-pencil/vue'
+} from '@open-pencil/vue/i18n'
import { homeLocation } from '@/app/home/location'
import { useNotificationMessages } from '@/app/i18n/notifications'
diff --git a/src/components/settings/tool-access/ToolAccessSettingsPanel.vue b/src/components/settings/tool-access/ToolAccessSettingsPanel.vue
index b5d0da50e..36bb070fa 100644
--- a/src/components/settings/tool-access/ToolAccessSettingsPanel.vue
+++ b/src/components/settings/tool-access/ToolAccessSettingsPanel.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useAutomationMessages } from '@open-pencil/vue'
+import { useAutomationMessages } from '@open-pencil/vue/i18n'
import { mcpRuntime } from '@/app/automation/mcp/runtime'
import { useMCPSettings } from '@/app/automation/mcp/settings/use'
diff --git a/src/components/settings/toolbar/ToolbarLayoutEditor.vue b/src/components/settings/toolbar/ToolbarLayoutEditor.vue
index 18e4714f0..79486fa2a 100644
--- a/src/components/settings/toolbar/ToolbarLayoutEditor.vue
+++ b/src/components/settings/toolbar/ToolbarLayoutEditor.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref, type ComponentPublicInstance } from 'vue'
-import { useFlatReorderDrag } from '@open-pencil/vue'
+import { useFlatReorderDrag } from '@open-pencil/vue/shared/drag'
import {
combineToolbarEntry,
diff --git a/src/components/settings/toolbar/ToolbarLayoutRow.vue b/src/components/settings/toolbar/ToolbarLayoutRow.vue
index 29c0a81dd..203c7f08a 100644
--- a/src/components/settings/toolbar/ToolbarLayoutRow.vue
+++ b/src/components/settings/toolbar/ToolbarLayoutRow.vue
@@ -10,7 +10,7 @@ import {
import { tv } from 'tailwind-variants'
import { useTemplateRef, watchPostEffect, type Component } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import IconButton from '@/components/ui/button/IconButton.vue'
import AppShortcutText from '@/components/ui/menu/AppShortcutText.vue'
diff --git a/src/components/settings/toolbar/ToolbarSettingsPanel.vue b/src/components/settings/toolbar/ToolbarSettingsPanel.vue
index 9d283ab41..9806af996 100644
--- a/src/components/settings/toolbar/ToolbarSettingsPanel.vue
+++ b/src/components/settings/toolbar/ToolbarSettingsPanel.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { DEFAULT_TOOLBAR_LAYOUT } from '@/app/editor/toolbar/layout'
import { appPreferences, updateToolbarLayout } from '@/app/settings/preferences/store'
diff --git a/src/components/settings/usage/UsageSettingsPanel.vue b/src/components/settings/usage/UsageSettingsPanel.vue
index eb1c6962a..a1c6ac057 100644
--- a/src/components/settings/usage/UsageSettingsPanel.vue
+++ b/src/components/settings/usage/UsageSettingsPanel.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useUsageSettings } from '@/app/usage/settings/use'
import SettingsSection from '@/components/settings/layout/SettingsSection.vue'
diff --git a/src/components/shapes/ShapeKindPicker.vue b/src/components/shapes/ShapeKindPicker.vue
index 420262d12..4f170d46e 100644
--- a/src/components/shapes/ShapeKindPicker.vue
+++ b/src/components/shapes/ShapeKindPicker.vue
@@ -6,7 +6,7 @@ import {
isShapeWithTextType,
type ShapeWithTextType
} from '@open-pencil/scene-graph/shape-with-text'
-import { useCommonMessages, useShapeMessages } from '@open-pencil/vue'
+import { useCommonMessages, useShapeMessages } from '@open-pencil/vue/i18n'
import { SHAPE_KIND_ICONS } from '@/components/icons/shapes'
import AppPicker from '@/components/ui/select/AppPicker.vue'
diff --git a/src/components/shapes/labels.ts b/src/components/shapes/labels.ts
index a26e13e3d..262807399 100644
--- a/src/components/shapes/labels.ts
+++ b/src/components/shapes/labels.ts
@@ -1,7 +1,7 @@
import { computed } from 'vue'
import type { ShapeWithTextType } from '@open-pencil/scene-graph/shape-with-text'
-import { useShapeMessages } from '@open-pencil/vue'
+import { useShapeMessages } from '@open-pencil/vue/i18n'
type ShapeMessages = ReturnType<typeof useShapeMessages>['value']
diff --git a/src/components/sharing/UsageStatsQuestion.vue b/src/components/sharing/UsageStatsQuestion.vue
index 3555d4f47..622a8d81f 100644
--- a/src/components/sharing/UsageStatsQuestion.vue
+++ b/src/components/sharing/UsageStatsQuestion.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { tv } from 'tailwind-variants'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { setUsageStatsConsent, usageStatsConsent } from '@/app/telemetry'
import ExternalLink from '@/components/links/ExternalLink.vue'
diff --git a/src/components/shell/AppMenu.vue b/src/components/shell/AppMenu.vue
index 9109b74ac..61c62a4b6 100644
--- a/src/components/shell/AppMenu.vue
+++ b/src/components/shell/AppMenu.vue
@@ -17,7 +17,8 @@ import {
import { useTemplateRef, watch } from 'vue'
import IconChevronRight from '~icons/lucide/chevron-right'
-import { vTestId, useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { vTestId } from '@open-pencil/vue/testing'
import { useEditorStore } from '@/app/editor/active-store'
import { openSettingsDialog } from '@/app/settings/dialog'
diff --git a/src/components/shell/Toaster.vue b/src/components/shell/Toaster.vue
index 59442c34c..3a76aee50 100644
--- a/src/components/shell/Toaster.vue
+++ b/src/components/shell/Toaster.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ToastProvider, ToastViewport } from 'reka-ui'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { toast, toastDuration } from '@/app/shell/ui'
import AppToast from '@/components/ui/feedback/AppToast.vue'
diff --git a/src/components/statuses/StatusDot.vue b/src/components/statuses/StatusDot.vue
index cce9b12f7..db1837fc8 100644
--- a/src/components/statuses/StatusDot.vue
+++ b/src/components/statuses/StatusDot.vue
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { computed } from 'vue'
-import type { Color } from '@open-pencil/scene-graph'
import { colorToCSS } from '@open-pencil/scene-graph/color'
+import type { Color } from '@open-pencil/scene-graph/primitives'
/** A status's color, as the canvas label, panels and menus mark it. */
const { color } = defineProps<{ color: Color | undefined }>()
diff --git a/src/components/statuses/StatusLabelMenu.vue b/src/components/statuses/StatusLabelMenu.vue
index 2630aaa22..906306d6f 100644
--- a/src/components/statuses/StatusLabelMenu.vue
+++ b/src/components/statuses/StatusLabelMenu.vue
@@ -3,7 +3,7 @@ import { PopoverContent, PopoverPortal, PopoverRoot } from 'reka-ui'
import { computed } from 'vue'
import type { PlacedStatusLabel } from '@open-pencil/core/canvas'
-import { useStatusMessages } from '@open-pencil/vue'
+import { useStatusMessages } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import { openStatusesDialog } from '@/app/editor/statuses/dialog'
diff --git a/src/components/statuses/StatusStateRow.vue b/src/components/statuses/StatusStateRow.vue
index 3d23ae5ac..1eee30dfa 100644
--- a/src/components/statuses/StatusStateRow.vue
+++ b/src/components/statuses/StatusStateRow.vue
@@ -1,9 +1,9 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
-import { figmaDevStatusOf, type StatusState } from '@open-pencil/scene-graph'
import { colorToHex } from '@open-pencil/scene-graph/color'
-import { useStatusMessages } from '@open-pencil/vue'
+import { figmaDevStatusOf, type StatusState } from '@open-pencil/scene-graph/statuses'
+import { useStatusMessages } from '@open-pencil/vue/i18n'
import { STATUS_COLORS } from '@/app/editor/statuses/workflow'
import StatusDot from '@/components/statuses/StatusDot.vue'
diff --git a/src/components/statuses/StatusesDialog.vue b/src/components/statuses/StatusesDialog.vue
index e9de5206b..fd3c18de4 100644
--- a/src/components/statuses/StatusesDialog.vue
+++ b/src/components/statuses/StatusesDialog.vue
@@ -1,8 +1,9 @@
<script setup lang="ts">
import { computed, nextTick, ref, useTemplateRef, watch, type ComponentPublicInstance } from 'vue'
-import type { StatusWorkflowPreset } from '@open-pencil/scene-graph'
-import { useCommonMessages, useFlatReorderDrag, useStatusMessages } from '@open-pencil/vue'
+import type { StatusWorkflowPreset } from '@open-pencil/scene-graph/statuses'
+import { useCommonMessages, useStatusMessages } from '@open-pencil/vue/i18n'
+import { useFlatReorderDrag } from '@open-pencil/vue/shared/drag'
import { useEditorStore } from '@/app/editor/active-store'
import { useStatusWorkflowDraft } from '@/app/editor/statuses/workflow'
diff --git a/src/components/toolbar/DesktopToolbar.vue b/src/components/toolbar/DesktopToolbar.vue
index ffd08007e..7765c791a 100644
--- a/src/components/toolbar/DesktopToolbar.vue
+++ b/src/components/toolbar/DesktopToolbar.vue
@@ -1,14 +1,13 @@
<script setup lang="ts">
import { ToolbarRoot } from 'reka-ui'
-import type { EditorToolDef } from '@open-pencil/core/editor'
+import type { EditorToolDef, Tool } from '@open-pencil/core'
import {
getToolbarToolSelection,
isToolbarToolActive,
- toolbarToolTestId,
ToolbarItem
-} from '@open-pencil/vue'
-import type { Tool } from '@open-pencil/vue'
+} from '@open-pencil/vue/primitives/Toolbar'
+import { toolbarToolTestId } from '@open-pencil/vue/testing'
import type { ToolbarAction, ToolbarItem as ToolbarLayoutItem } from '@/app/editor/toolbar/layout'
import { toolTip } from '@/app/editor/toolbar/shortcuts'
diff --git a/src/components/toolbar/MobileToolbar.vue b/src/components/toolbar/MobileToolbar.vue
index 3d5e2b4f5..4eac62d34 100644
--- a/src/components/toolbar/MobileToolbar.vue
+++ b/src/components/toolbar/MobileToolbar.vue
@@ -5,9 +5,9 @@ import { tv } from 'tailwind-variants'
import IconChevronLeft from '~icons/lucide/chevron-left'
import IconChevronRight from '~icons/lucide/chevron-right'
-import type { EditorToolDef } from '@open-pencil/core/editor'
-import { getToolbarToolSelection, toolbarToolTestId, ToolbarItem } from '@open-pencil/vue'
-import type { Tool } from '@open-pencil/vue'
+import type { EditorToolDef, Tool } from '@open-pencil/core'
+import { getToolbarToolSelection, ToolbarItem } from '@open-pencil/vue/primitives/Toolbar'
+import { toolbarToolTestId } from '@open-pencil/vue/testing'
import { animationsEnabled } from '@/app/shell/motion'
import { useMotionTransitions } from '@/app/shell/motion/transitions'
diff --git a/src/components/toolbar/ShapeToolButton.vue b/src/components/toolbar/ShapeToolButton.vue
index b04589c6b..72d9c4a7a 100644
--- a/src/components/toolbar/ShapeToolButton.vue
+++ b/src/components/toolbar/ShapeToolButton.vue
@@ -2,7 +2,9 @@
import { ref } from 'vue'
import type { ShapeWithTextType } from '@open-pencil/scene-graph/shape-with-text'
-import { toolbarToolTestId, useShapeWithText, useToolMessages } from '@open-pencil/vue'
+import { useShapeWithText } from '@open-pencil/vue/controls/shape-with-text'
+import { useToolMessages } from '@open-pencil/vue/i18n'
+import { toolbarToolTestId } from '@open-pencil/vue/testing'
import { SHAPE_KIND_ICONS } from '@/components/icons/shapes'
import ShapeKindPicker from '@/components/shapes/ShapeKindPicker.vue'
diff --git a/src/components/toolbar/ToolFlyout.vue b/src/components/toolbar/ToolFlyout.vue
index e754f6922..6f29f2411 100644
--- a/src/components/toolbar/ToolFlyout.vue
+++ b/src/components/toolbar/ToolFlyout.vue
@@ -13,16 +13,15 @@ import { tv } from 'tailwind-variants'
import { computed } from 'vue'
import IconChevronDown from '~icons/lucide/chevron-down'
-import type { EditorToolDef } from '@open-pencil/core/editor'
+import type { EditorToolDef, Tool } from '@open-pencil/core'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { isToolbarToolActive } from '@open-pencil/vue/primitives/Toolbar'
import {
- isToolbarToolActive,
toolbarFlyoutItemTestId,
toolbarFlyoutTestId,
toolbarToolTestId,
- useI18n,
vTestId
-} from '@open-pencil/vue'
-import type { Tool } from '@open-pencil/vue'
+} from '@open-pencil/vue/testing'
import { toolTip } from '@/app/editor/toolbar/shortcuts'
import ToolButton from '@/components/toolbar/ToolButton.vue'
diff --git a/src/components/toolbar/Toolbar.vue b/src/components/toolbar/Toolbar.vue
index 0f530072b..94fa4b29e 100644
--- a/src/components/toolbar/Toolbar.vue
+++ b/src/components/toolbar/Toolbar.vue
@@ -1,13 +1,10 @@
<script setup lang="ts">
import { computed } from 'vue'
-import {
- ToolbarRoot,
- useEditorCommands,
- useI18n,
- useToolbarState,
- useViewportKind
-} from '@open-pencil/vue'
+import { useEditorCommands } from '@open-pencil/vue/editor/commands'
+import { useViewportKind } from '@open-pencil/vue/editor/viewport-kind'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { ToolbarRoot, useToolbarState } from '@open-pencil/vue/primitives/Toolbar'
import { useEditorStore } from '@/app/editor/active-store'
import { readOnlyToolbarLayout, toolbarItems } from '@/app/editor/toolbar/layout'
diff --git a/src/components/toolbar/ToolbarActionGroup.vue b/src/components/toolbar/ToolbarActionGroup.vue
index 8c5c28f07..779378dce 100644
--- a/src/components/toolbar/ToolbarActionGroup.vue
+++ b/src/components/toolbar/ToolbarActionGroup.vue
@@ -2,7 +2,7 @@
import { ToolbarButton } from 'reka-ui'
import { tv } from 'tailwind-variants'
-import { vTestId } from '@open-pencil/vue'
+import { vTestId } from '@open-pencil/vue/testing'
import type { ToolbarActionItem, ToolbarUI } from '@/components/toolbar/types'
import toolbarTheme from '@/theme/toolbar'
diff --git a/src/components/toolbar/ToolbarContextMenu.vue b/src/components/toolbar/ToolbarContextMenu.vue
index 5cb466491..d48bda187 100644
--- a/src/components/toolbar/ToolbarContextMenu.vue
+++ b/src/components/toolbar/ToolbarContextMenu.vue
@@ -7,7 +7,7 @@ import {
ContextMenuTrigger
} from 'reka-ui'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { openSettingsDialog } from '@/app/settings/dialog'
import { useMenuUI } from '@/components/ui/menu/menu'
diff --git a/src/components/toolbar/actions.ts b/src/components/toolbar/actions.ts
index f587d4f91..ec8a966d4 100644
--- a/src/components/toolbar/actions.ts
+++ b/src/components/toolbar/actions.ts
@@ -11,7 +11,7 @@ import IconScissors from '~icons/lucide/scissors'
import IconTrash2 from '~icons/lucide/trash-2'
import IconUngroup from '~icons/lucide/ungroup'
-import type { useEditorCommands } from '@open-pencil/vue'
+import type { useEditorCommands } from '@open-pencil/vue/editor/commands'
import type { EditorStore } from '@/app/editor/active-store'
import type { ToolbarActionItem } from '@/components/toolbar/types'
diff --git a/src/components/toolbar/labels.ts b/src/components/toolbar/labels.ts
index a9b971d4b..6b58dd967 100644
--- a/src/components/toolbar/labels.ts
+++ b/src/components/toolbar/labels.ts
@@ -1,8 +1,8 @@
import { computed, type Component } from 'vue'
import IconSmilePlus from '~icons/lucide/smile-plus'
-import { useI18n, usePanelMessages } from '@open-pencil/vue'
-import type { Tool } from '@open-pencil/vue'
+import type { Tool } from '@open-pencil/core'
+import { useI18n, usePanelMessages } from '@open-pencil/vue/i18n'
import type { ToolbarEntry } from '@/app/editor/toolbar/layout'
import { toolIcons } from '@/components/icons'
diff --git a/src/components/toolbar/types.ts b/src/components/toolbar/types.ts
index 85de13b83..398ed5aaf 100644
--- a/src/components/toolbar/types.ts
+++ b/src/components/toolbar/types.ts
@@ -1,6 +1,6 @@
import type { Component } from 'vue'
-import type { Tool } from '@open-pencil/vue'
+import type { Tool } from '@open-pencil/core'
import type { ComponentUI } from '@/components/ui/types'
import type { ToolbarTheme } from '@/theme/toolbar'
diff --git a/src/components/ui/binding/BindingTrigger.vue b/src/components/ui/binding/BindingTrigger.vue
index 9c052d715..0c06869dd 100644
--- a/src/components/ui/binding/BindingTrigger.vue
+++ b/src/components/ui/binding/BindingTrigger.vue
@@ -3,7 +3,7 @@ import { compact } from 'es-toolkit/array'
import type { PrimitiveProps } from 'reka-ui'
import type { HTMLAttributes } from 'vue'
-import type { BindingState } from '@open-pencil/vue'
+import type { BindingState } from '@open-pencil/vue/controls/binding-provider'
import type { BindingFieldUI } from './ui'
diff --git a/src/components/ui/binding/VariablePicker.vue b/src/components/ui/binding/VariablePicker.vue
index 502b9b0c9..11be03a68 100644
--- a/src/components/ui/binding/VariablePicker.vue
+++ b/src/components/ui/binding/VariablePicker.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, nextTick, ref, watch } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import FillSwatch from '@/components/ui/paint/FillSwatch.vue'
diff --git a/src/components/ui/binding/picker.ts b/src/components/ui/binding/picker.ts
index 1dda6cef9..d175ae2cd 100644
--- a/src/components/ui/binding/picker.ts
+++ b/src/components/ui/binding/picker.ts
@@ -1,5 +1,5 @@
import type { Color } from '@open-pencil/scene-graph/primitives'
-import type { BindingState } from '@open-pencil/vue'
+import type { BindingState } from '@open-pencil/vue/controls/binding-provider'
import type { BindingFieldUI } from './ui'
diff --git a/src/components/ui/binding/ui.ts b/src/components/ui/binding/ui.ts
index 740dad7a3..f71c7e0f1 100644
--- a/src/components/ui/binding/ui.ts
+++ b/src/components/ui/binding/ui.ts
@@ -1,6 +1,6 @@
import { tv } from 'tailwind-variants'
-import type { BindingState } from '@open-pencil/vue'
+import type { BindingState } from '@open-pencil/vue/controls/binding-provider'
import type { ComponentUI } from '@/components/ui/types'
import theme from '@/theme/binding/field'
diff --git a/src/components/ui/input/AppPasswordInput.vue b/src/components/ui/input/AppPasswordInput.vue
index d253a2ea1..3db557399 100644
--- a/src/components/ui/input/AppPasswordInput.vue
+++ b/src/components/ui/input/AppPasswordInput.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue'
-import { useCommonMessages } from '@open-pencil/vue'
+import { useCommonMessages } from '@open-pencil/vue/i18n'
import type { ControlSize } from '@/theme/control'
diff --git a/src/components/ui/paint/FillSwatch.vue b/src/components/ui/paint/FillSwatch.vue
index 673b7da94..61bd4353f 100644
--- a/src/components/ui/paint/FillSwatch.vue
+++ b/src/components/ui/paint/FillSwatch.vue
@@ -2,7 +2,7 @@
import type { VNode } from 'vue'
import type { Fill } from '@open-pencil/scene-graph'
-import type { FillSwatchSlotProps } from '@open-pencil/vue'
+import type { FillSwatchSlotProps } from '@open-pencil/vue/primitives/Fill'
import type { ComponentUI } from '@/components/ui/types'
import type theme from '@/theme/paint/fill-swatch'
@@ -24,7 +24,7 @@ export interface FillSwatchSlots {
import { tv } from 'tailwind-variants'
import { computed, normalizeClass, useAttrs } from 'vue'
-import { FillSwatch as FillSwatchPrimitive } from '@open-pencil/vue'
+import { FillSwatch as FillSwatchPrimitive } from '@open-pencil/vue/primitives/Fill'
import fillSwatchTheme from '@/theme/paint/fill-swatch'
diff --git a/src/components/ui/panel/PanelGrid.vue b/src/components/ui/panel/PanelGrid.vue
index ac8d31051..6132269b1 100644
--- a/src/components/ui/panel/PanelGrid.vue
+++ b/src/components/ui/panel/PanelGrid.vue
@@ -1,7 +1,7 @@
<script lang="ts">
import type { ClassValue } from 'tailwind-variants'
-import type { PropertyGridRootSlots } from '@open-pencil/vue'
+import type { PropertyGridRootSlots } from '@open-pencil/vue/primitives/PropertyGrid'
export interface PanelGridProps {
columns?: 1 | 2 | 3
@@ -15,7 +15,7 @@ export type PanelGridSlots = PropertyGridRootSlots
<script setup lang="ts">
import { tv } from 'tailwind-variants'
-import { PropertyGridRoot } from '@open-pencil/vue'
+import { PropertyGridRoot } from '@open-pencil/vue/primitives/PropertyGrid'
import theme from '@/theme/panel/grid'
diff --git a/src/components/ui/panel/PanelSection.vue b/src/components/ui/panel/PanelSection.vue
index d5d3f796e..04ad197c7 100644
--- a/src/components/ui/panel/PanelSection.vue
+++ b/src/components/ui/panel/PanelSection.vue
@@ -32,7 +32,7 @@ import {
PropertySectionHeader,
PropertySectionRoot,
PropertySectionTitle
-} from '@open-pencil/vue'
+} from '@open-pencil/vue/primitives/PropertySection'
import theme from '@/theme/panel/section'
diff --git a/src/components/ui/select/AppCombobox.vue b/src/components/ui/select/AppCombobox.vue
index 4da204ca0..952a50cff 100644
--- a/src/components/ui/select/AppCombobox.vue
+++ b/src/components/ui/select/AppCombobox.vue
@@ -17,7 +17,8 @@ import {
import { tv } from 'tailwind-variants'
import { computed, ref } from 'vue'
-import { fuzzySearch, useRetainedPopup } from '@open-pencil/vue'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
+import { fuzzySearch } from '@open-pencil/vue/shared/search'
import type { ComponentUI } from '@/components/ui/types'
import theme from '@/theme/select/combobox'
diff --git a/src/components/ui/select/AppPicker.vue b/src/components/ui/select/AppPicker.vue
index 569c708bf..c34382329 100644
--- a/src/components/ui/select/AppPicker.vue
+++ b/src/components/ui/select/AppPicker.vue
@@ -83,7 +83,8 @@ import {
import { tv } from 'tailwind-variants'
import { computed, shallowRef, useTemplateRef, watch, type ComponentPublicInstance } from 'vue'
-import { fuzzySearch, useRetainedPopup } from '@open-pencil/vue'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
+import { fuzzySearch } from '@open-pencil/vue/shared/search'
import IconButton from '@/components/ui/button/IconButton.vue'
import Tip from '@/components/ui/overlay/Tip.vue'
diff --git a/src/components/ui/select/AppSelect.vue b/src/components/ui/select/AppSelect.vue
index 313c0697e..4f1cedbf4 100644
--- a/src/components/ui/select/AppSelect.vue
+++ b/src/components/ui/select/AppSelect.vue
@@ -10,7 +10,7 @@ import {
import { tv } from 'tailwind-variants'
import { computed, ref, useSlots, watch } from 'vue'
-import { useRetainedPopup } from '@open-pencil/vue'
+import { useRetainedPopup } from '@open-pencil/vue/lifecycle/retention'
import AppSelectContent from '@/components/ui/select/AppSelectContent.vue'
import AppSelectItem from '@/components/ui/select/AppSelectItem.vue'
diff --git a/src/components/ui/select/SegmentedControl.vue b/src/components/ui/select/SegmentedControl.vue
index 74316e600..5e932cac9 100644
--- a/src/components/ui/select/SegmentedControl.vue
+++ b/src/components/ui/select/SegmentedControl.vue
@@ -28,7 +28,10 @@ export interface SegmentedControlSlots {
import { tv } from 'tailwind-variants'
import { computed } from 'vue'
-import { SegmentedControlItem, SegmentedControlRoot } from '@open-pencil/vue'
+import {
+ SegmentedControlItem,
+ SegmentedControlRoot
+} from '@open-pencil/vue/primitives/SegmentedControl'
import theme from '@/theme/select/segmented-control'
diff --git a/src/components/updater/UpdatePrompt.vue b/src/components/updater/UpdatePrompt.vue
index 54fa64045..c4f9ae3bc 100644
--- a/src/components/updater/UpdatePrompt.vue
+++ b/src/components/updater/UpdatePrompt.vue
@@ -2,7 +2,7 @@
import { mapValues } from 'es-toolkit'
import { computed } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { openExternalLink } from '@/app/shell/ui'
import { updateFailureText } from '@/app/shell/updater/messages'
diff --git a/src/components/variables/CollectionInspector.vue b/src/components/variables/CollectionInspector.vue
index 0f5faae47..1800b2d03 100644
--- a/src/components/variables/CollectionInspector.vue
+++ b/src/components/variables/CollectionInspector.vue
@@ -16,7 +16,7 @@ import {
isModeAttributeName,
type VariableCollection
} from '@open-pencil/scene-graph'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import {
changeConditionKind,
diff --git a/src/components/variables/TokenAddMenu.vue b/src/components/variables/TokenAddMenu.vue
index 6696ae35a..e0d967065 100644
--- a/src/components/variables/TokenAddMenu.vue
+++ b/src/components/variables/TokenAddMenu.vue
@@ -9,7 +9,8 @@ import {
import { computed } from 'vue'
import type { VariableType } from '@open-pencil/scene-graph'
-import { useI18n, variablesAddTestId, vTestId } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { variablesAddTestId, vTestId } from '@open-pencil/vue/testing'
import AppButton from '@/components/ui/button/AppButton.vue'
import IconButton from '@/components/ui/button/IconButton.vue'
diff --git a/src/components/variables/TokenBulkInspector.vue b/src/components/variables/TokenBulkInspector.vue
index 3e9a21cdd..753ebc942 100644
--- a/src/components/variables/TokenBulkInspector.vue
+++ b/src/components/variables/TokenBulkInspector.vue
@@ -2,7 +2,7 @@
import { tv } from 'tailwind-variants'
import { computed, onMounted, ref, useId, useTemplateRef, type ComponentPublicInstance } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import AppButton from '@/components/ui/button/AppButton.vue'
import AppInput from '@/components/ui/input/AppInput.vue'
diff --git a/src/components/variables/TokenCSSExpression.vue b/src/components/variables/TokenCSSExpression.vue
index 4cef87766..16fd70565 100644
--- a/src/components/variables/TokenCSSExpression.vue
+++ b/src/components/variables/TokenCSSExpression.vue
@@ -9,7 +9,7 @@ import {
tokenNumberToCSS
} from '@open-pencil/dom-css/export'
import type { TokenUnit } from '@open-pencil/scene-graph'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { cssExpressionPreview } from '@/app/editor/tokens/css-expression'
import type { CSSReferenceCandidate } from '@/app/editor/tokens/model'
diff --git a/src/components/variables/TokenImportDialog.vue b/src/components/variables/TokenImportDialog.vue
index 095638455..ad57efe6d 100644
--- a/src/components/variables/TokenImportDialog.vue
+++ b/src/components/variables/TokenImportDialog.vue
@@ -1,8 +1,8 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue'
-import type { TokenImportResult } from '@open-pencil/core/editor'
import {
+ type TokenImportResult,
defaultTokenImportOptions,
planTokenImport,
type CollectionTarget,
@@ -13,7 +13,7 @@ import {
type TokenImportOptions
} from '@open-pencil/core/io/formats/design-tokens'
import { isLibraryCollection } from '@open-pencil/scene-graph'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import { notificationMessages } from '@/app/i18n/notifications'
diff --git a/src/components/variables/TokenInspector.vue b/src/components/variables/TokenInspector.vue
index 72ad14aee..096f9b8c1 100644
--- a/src/components/variables/TokenInspector.vue
+++ b/src/components/variables/TokenInspector.vue
@@ -4,7 +4,7 @@ import { isEmptyObject, omit } from 'es-toolkit'
import { tv } from 'tailwind-variants'
import { computed, nextTick, reactive, ref, useId, watch } from 'vue'
-import type { VariableTokenFields } from '@open-pencil/core/editor'
+import type { VariableTokenFields } from '@open-pencil/core'
import {
cssNameCodeSyntax,
explicitCSSName,
@@ -14,17 +14,16 @@ import {
} from '@open-pencil/dom-css/export'
import {
TOKEN_UNITS,
- tokenNumberFromUnit,
- tokenNumberInUnit,
- type Color,
type TokenExpression,
type Variable,
type VariableCollection,
type VariableScope,
type VariableValue
} from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import { randomHex } from '@open-pencil/scene-graph/random'
-import { useI18n } from '@open-pencil/vue'
+import { tokenNumberFromUnit, tokenNumberInUnit } from '@open-pencil/scene-graph/variables'
+import { useI18n } from '@open-pencil/vue/i18n'
import type {
AliasCandidate,
diff --git a/src/components/variables/TokenOutput.vue b/src/components/variables/TokenOutput.vue
index 054f83bc6..43b72ebcd 100644
--- a/src/components/variables/TokenOutput.vue
+++ b/src/components/variables/TokenOutput.vue
@@ -12,7 +12,9 @@ import { tv } from 'tailwind-variants'
import { computed } from 'vue'
import type { TokenStylesheetFormat } from '@open-pencil/dom-css/export'
-import { useEditor, useI18n, useSceneComputed } from '@open-pencil/vue'
+import { useEditor } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useSceneComputed } from '@open-pencil/vue/internal/scene-computed'
import CodeViewer from '@/components/code-editor/CodeViewer.vue'
import IconButton from '@/components/ui/button/IconButton.vue'
diff --git a/src/components/variables/TokenRowMenu.vue b/src/components/variables/TokenRowMenu.vue
index 82ec0a45f..9a21938c4 100644
--- a/src/components/variables/TokenRowMenu.vue
+++ b/src/components/variables/TokenRowMenu.vue
@@ -11,7 +11,7 @@ import {
ContextMenuTrigger
} from 'reka-ui'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useMenuUI } from '@/components/ui/menu/menu'
import MenuScrollArea from '@/components/ui/menu/MenuScrollArea.vue'
diff --git a/src/components/variables/TokenSidebar.vue b/src/components/variables/TokenSidebar.vue
index 5d3e29894..6df48eb62 100644
--- a/src/components/variables/TokenSidebar.vue
+++ b/src/components/variables/TokenSidebar.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { tv } from 'tailwind-variants'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import type { GroupEntry } from '@/app/editor/tokens/model'
import IconButton from '@/components/ui/button/IconButton.vue'
diff --git a/src/components/variables/TokenTable.vue b/src/components/variables/TokenTable.vue
index aaa11535b..fb167370b 100644
--- a/src/components/variables/TokenTable.vue
+++ b/src/components/variables/TokenTable.vue
@@ -8,7 +8,8 @@ import {
type VariableCollection,
type VariableValue
} from '@open-pencil/scene-graph'
-import { useFlatReorderDrag, useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useFlatReorderDrag } from '@open-pencil/vue/shared/drag'
import {
parseTokenValueText,
diff --git a/src/components/variables/TokenTypeFilter.vue b/src/components/variables/TokenTypeFilter.vue
index 95e9e9131..eeb7535e4 100644
--- a/src/components/variables/TokenTypeFilter.vue
+++ b/src/components/variables/TokenTypeFilter.vue
@@ -10,7 +10,7 @@ import {
import { computed } from 'vue'
import type { VariableType } from '@open-pencil/scene-graph'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import IconButton from '@/components/ui/button/IconButton.vue'
import { useMenuUI } from '@/components/ui/menu/menu'
diff --git a/src/components/variables/TokenValueEditor.vue b/src/components/variables/TokenValueEditor.vue
index b40bf0807..d92b4902c 100644
--- a/src/components/variables/TokenValueEditor.vue
+++ b/src/components/variables/TokenValueEditor.vue
@@ -3,14 +3,10 @@ import { tv } from 'tailwind-variants'
import { computed, nextTick, ref, useId, useTemplateRef, watch } from 'vue'
import { tokenNumberToCSS, variableUnit } from '@open-pencil/dom-css/export'
-import {
- formulaSymbol,
- type Variable,
- type VariableLiteral,
- type VariableValue
-} from '@open-pencil/scene-graph'
+import type { Variable, VariableLiteral, VariableValue } from '@open-pencil/scene-graph'
import { colorToHex8 } from '@open-pencil/scene-graph/color'
-import { useI18n } from '@open-pencil/vue'
+import { formulaSymbol } from '@open-pencil/scene-graph/variables'
+import { useI18n } from '@open-pencil/vue/i18n'
import {
referencePillName,
diff --git a/src/components/variables/TokensPanel.vue b/src/components/variables/TokensPanel.vue
index 38b75743a..18dc3e81a 100644
--- a/src/components/variables/TokensPanel.vue
+++ b/src/components/variables/TokensPanel.vue
@@ -3,17 +3,21 @@ import { useElementSize } from '@vueuse/core'
import { tv } from 'tailwind-variants'
import { computed, ref, useTemplateRef, watch } from 'vue'
-import type { VariableTokenFields } from '@open-pencil/core/editor'
+import type { VariableTokenFields } from '@open-pencil/core'
import type { TokenStylesheetFormat } from '@open-pencil/dom-css/export'
import {
- formatVariableFormula,
- parseVariableFormula,
- variableFormulaReference,
isLibraryCollection,
type VariableType,
type VariableValue
} from '@open-pencil/scene-graph'
-import { useI18n, useSceneComputed, useVariables } from '@open-pencil/vue'
+import {
+ formatVariableFormula,
+ parseVariableFormula,
+ variableFormulaReference
+} from '@open-pencil/scene-graph/variables'
+import { useI18n } from '@open-pencil/vue/i18n'
+import { useSceneComputed } from '@open-pencil/vue/internal/scene-computed'
+import { useVariables } from '@open-pencil/vue/variables'
import {
aliasCandidates,
diff --git a/src/components/variables/VariablesDialog.vue b/src/components/variables/VariablesDialog.vue
index 7722855ba..e61ccd337 100644
--- a/src/components/variables/VariablesDialog.vue
+++ b/src/components/variables/VariablesDialog.vue
@@ -4,7 +4,7 @@ import { DialogTitle } from 'reka-ui'
import { computed, defineAsyncComponent, ref, shallowRef, watch } from 'vue'
import type { DesignTokenBundle } from '@open-pencil/core/io/formats/design-tokens'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { useEditorStore } from '@/app/editor/active-store'
import { createTokenCopy } from '@/app/editor/tokens/copy'
diff --git a/src/components/variables/examples/DesignSystem.vue b/src/components/variables/examples/DesignSystem.vue
index 9fe7b5bfd..65cd06828 100644
--- a/src/components/variables/examples/DesignSystem.vue
+++ b/src/components/variables/examples/DesignSystem.vue
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { shallowReactive } from 'vue'
-import { createDefaultEditorState, createEditor } from '@open-pencil/core/editor'
+import { createDefaultEditorState, createEditor } from '@open-pencil/core'
import { SceneGraph, type Variable, type VariableValue } from '@open-pencil/scene-graph'
import { parseColor } from '@open-pencil/scene-graph/color'
import { provideEditor } from '@open-pencil/vue'
diff --git a/src/components/variables/formula-field/dialects/formula.ts b/src/components/variables/formula-field/dialects/formula.ts
index 22c7fc71b..a64316034 100644
--- a/src/components/variables/formula-field/dialects/formula.ts
+++ b/src/components/variables/formula-field/dialects/formula.ts
@@ -7,7 +7,11 @@ import { StreamLanguage } from '@codemirror/language'
import type { EditorState } from '@codemirror/state'
import { tags } from '@lezer/highlight'
-import { formulaTokens, readFormulaToken, type FormulaTokenKind } from '@open-pencil/scene-graph'
+import {
+ formulaTokens,
+ readFormulaToken,
+ type FormulaTokenKind
+} from '@open-pencil/scene-graph/variables'
import { nodeText, tokenBefore, type SyntaxNode } from './syntax'
import type { ExpressionDialect, ReferenceCompletion } from './types'
diff --git a/src/components/variables/useConditionLabels.ts b/src/components/variables/useConditionLabels.ts
index 3d1a84f7f..a32060578 100644
--- a/src/components/variables/useConditionLabels.ts
+++ b/src/components/variables/useConditionLabels.ts
@@ -1,7 +1,7 @@
import { computed } from 'vue'
import type { VariableCollection } from '@open-pencil/scene-graph'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import {
CONDITION_KINDS,
diff --git a/src/components/variables/useTokenActions.ts b/src/components/variables/useTokenActions.ts
index 10c59e4d0..bd1e91973 100644
--- a/src/components/variables/useTokenActions.ts
+++ b/src/components/variables/useTokenActions.ts
@@ -1,4 +1,4 @@
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { nameInGroup, reorderedVariableIds } from '@/app/editor/tokens/model'
diff --git a/src/components/voice-call/VoiceCallMenu.vue b/src/components/voice-call/VoiceCallMenu.vue
index 44ff9af0b..057d0483d 100644
--- a/src/components/voice-call/VoiceCallMenu.vue
+++ b/src/components/voice-call/VoiceCallMenu.vue
@@ -2,7 +2,7 @@
import { PopoverContent, PopoverPortal, PopoverRoot, PopoverTrigger } from 'reka-ui'
import { computed, useId } from 'vue'
-import { useCollaborationMessages } from '@open-pencil/vue'
+import { useCollaborationMessages } from '@open-pencil/vue/i18n'
import type { VoiceCallError } from '@/app/collab/voice/call'
import AvatarStack from '@/components/presence/AvatarStack.vue'
diff --git a/src/components/voice-call/useVoiceCallControl.ts b/src/components/voice-call/useVoiceCallControl.ts
index aca758f87..af549448a 100644
--- a/src/components/voice-call/useVoiceCallControl.ts
+++ b/src/components/voice-call/useVoiceCallControl.ts
@@ -1,6 +1,6 @@
import { computed, toValue, type MaybeRefOrGetter } from 'vue'
-import { useCollaborationMessages } from '@open-pencil/vue'
+import { useCollaborationMessages } from '@open-pencil/vue/i18n'
import { activeRoom } from '@/app/collab/rooms'
import { CAN_CHOOSE_SPEAKERS, SYSTEM_DEVICE, useVoiceCall } from '@/app/collab/voice/call'
diff --git a/src/views/UpdaterView.vue b/src/views/UpdaterView.vue
index 74a888f15..fae148a97 100644
--- a/src/views/UpdaterView.vue
+++ b/src/views/UpdaterView.vue
@@ -2,7 +2,7 @@
import { useHead } from '@unhead/vue'
import { computed, onMounted, onScopeDispose } from 'vue'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { APP_VERSION } from '@/app/runtime/version'
import { animationsEnabled } from '@/app/shell/motion'
diff --git a/src/views/WorkspaceView.vue b/src/views/WorkspaceView.vue
index 7c7ac54f4..be221a1c1 100644
--- a/src/views/WorkspaceView.vue
+++ b/src/views/WorkspaceView.vue
@@ -4,7 +4,7 @@ import { useEventListener, whenever } from '@vueuse/core'
import { computed, onMounted, onUnmounted, provide, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import {
aiSetupDialogOpen,
diff --git a/src/views/cloud/CheckEmailView.vue b/src/views/cloud/CheckEmailView.vue
index 2aa83bad0..342771083 100644
--- a/src/views/cloud/CheckEmailView.vue
+++ b/src/views/cloud/CheckEmailView.vue
@@ -2,7 +2,7 @@
import { computed, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import { usePortal } from '@/app/cloud-portal/context'
import { usePortalFailureMessages } from '@/app/cloud-portal/failure'
diff --git a/src/views/cloud/CloudPortalUnavailableView.vue b/src/views/cloud/CloudPortalUnavailableView.vue
index b1ea9376b..b081f0c0d 100644
--- a/src/views/cloud/CloudPortalUnavailableView.vue
+++ b/src/views/cloud/CloudPortalUnavailableView.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import { usePortalTheme } from '@/app/cloud-portal/theme'
import AppButton from '@/components/ui/button/AppButton.vue'
diff --git a/src/views/cloud/ConsoleView.vue b/src/views/cloud/ConsoleView.vue
index f831c45ef..97214a510 100644
--- a/src/views/cloud/ConsoleView.vue
+++ b/src/views/cloud/ConsoleView.vue
@@ -2,7 +2,7 @@
import { computed, onMounted, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import { usePortal } from '@/app/cloud-portal/context'
import PortalConsoleLayout from '@/components/cloud-portal/layout/PortalConsoleLayout.vue'
diff --git a/src/views/cloud/DeviceView.vue b/src/views/cloud/DeviceView.vue
index 7f80cc4a1..2760445e7 100644
--- a/src/views/cloud/DeviceView.vue
+++ b/src/views/cloud/DeviceView.vue
@@ -2,7 +2,7 @@
import { computed, onMounted, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import { usePortal } from '@/app/cloud-portal/context'
import { usePortalFailureMessages } from '@/app/cloud-portal/failure'
diff --git a/src/views/cloud/ResetPasswordView.vue b/src/views/cloud/ResetPasswordView.vue
index ef26e50a6..32e36a59c 100644
--- a/src/views/cloud/ResetPasswordView.vue
+++ b/src/views/cloud/ResetPasswordView.vue
@@ -2,7 +2,7 @@
import { computed, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import { usePortal } from '@/app/cloud-portal/context'
import { usePortalFailureMessages } from '@/app/cloud-portal/failure'
diff --git a/src/views/cloud/ReturnView.vue b/src/views/cloud/ReturnView.vue
index 3b5e7974b..fa100f7b1 100644
--- a/src/views/cloud/ReturnView.vue
+++ b/src/views/cloud/ReturnView.vue
@@ -3,7 +3,7 @@ import { onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { cloudEditorReturnURL } from '@open-pencil/cloud/client'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import { usePortal } from '@/app/cloud-portal/context'
import { PORTAL_HOME } from '@/app/cloud-portal/navigation'
diff --git a/src/views/cloud/StandingView.vue b/src/views/cloud/StandingView.vue
index 4e488f292..2ca998c66 100644
--- a/src/views/cloud/StandingView.vue
+++ b/src/views/cloud/StandingView.vue
@@ -2,7 +2,7 @@
import { computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import { usePortal } from '@/app/cloud-portal/context'
import PortalNotice from '@/components/cloud-portal/auth/PortalNotice.vue'
diff --git a/src/views/cloud/VerifiedView.vue b/src/views/cloud/VerifiedView.vue
index 24843a47a..143b96c08 100644
--- a/src/views/cloud/VerifiedView.vue
+++ b/src/views/cloud/VerifiedView.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
-import { useCloudPortalMessages } from '@open-pencil/vue'
+import { useCloudPortalMessages } from '@open-pencil/vue/i18n'
import { usePortal } from '@/app/cloud-portal/context'
import PortalNotice from '@/components/cloud-portal/auth/PortalNotice.vue'
diff --git a/tests/app/automation/bridge/export.test.ts b/tests/app/automation/bridge/export.test.ts
index 5cd9a4da7..f198cc889 100644
--- a/tests/app/automation/bridge/export.test.ts
+++ b/tests/app/automation/bridge/export.test.ts
@@ -4,7 +4,9 @@ import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
import { toUint8Array } from 'js-base64'
import { SkiaRenderer } from '@open-pencil/core/canvas'
-import { BUILTIN_IO_FORMATS, IORegistry, initCanvasKit, parseFigFile } from '@open-pencil/core/io'
+import { BUILTIN_IO_FORMATS, IORegistry } from '@open-pencil/core/io'
+import { parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import { pngSize } from '@open-pencil/fig'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/tests/app/automation/bridge/tool-page.test.ts b/tests/app/automation/bridge/tool-page.test.ts
index 3ff485742..42d22ad04 100644
--- a/tests/app/automation/bridge/tool-page.test.ts
+++ b/tests/app/automation/bridge/tool-page.test.ts
@@ -1,7 +1,8 @@
import 'fake-indexeddb/auto'
import { afterEach, beforeEach, describe, expect, test } from 'bun:test'
-import { BUILTIN_IO_FORMATS, IORegistry, parseFigFile } from '@open-pencil/core/io'
+import { BUILTIN_IO_FORMATS, IORegistry } from '@open-pencil/core/io'
+import { parseFigFile } from '@open-pencil/core/io/formats/fig'
import { SceneGraph } from '@open-pencil/scene-graph'
import { makeFigmaFromStore } from '@/app/automation/bridge/figma-factory'
diff --git a/tests/app/collab/concurrent-edits.test.ts b/tests/app/collab/concurrent-edits.test.ts
index b6d034d7e..1dcd02f22 100644
--- a/tests/app/collab/concurrent-edits.test.ts
+++ b/tests/app/collab/concurrent-edits.test.ts
@@ -225,9 +225,9 @@ describe('collab concurrent edits', () => {
},
({ hostStore, peerStore }, pageId) => {
const host = hostStore.graph.createNode('RECTANGLE', pageId, { id: 'host:1' })
- hostStore.graph.reorderChild(host.id, pageId, 1)
+ hostStore.graph.insertChildAt(host.id, pageId, 1)
const peer = peerStore.graph.createNode('RECTANGLE', pageId, { id: 'peer:1' })
- peerStore.graph.reorderChild(peer.id, pageId, 1)
+ peerStore.graph.insertChildAt(peer.id, pageId, 1)
},
(stores, pageId) => {
expectSameLayerTree(stores, [pageId])
@@ -250,9 +250,9 @@ describe('collab concurrent edits', () => {
}
},
({ hostStore, peerStore }, pageId) => {
- hostStore.graph.reorderChild('rect:4', pageId, 0)
- peerStore.graph.reorderChild('rect:1', pageId, 3)
- peerStore.graph.reorderChild('rect:4', pageId, 2)
+ hostStore.graph.insertChildAt('rect:4', pageId, 0)
+ peerStore.graph.insertChildAt('rect:1', pageId, 3)
+ peerStore.graph.insertChildAt('rect:4', pageId, 2)
},
(stores, pageId) => {
const layers = expectSameLayerTree(stores, [pageId])
diff --git a/tests/app/collab/random-edits.test.ts b/tests/app/collab/random-edits.test.ts
index 564e62983..d97ebcac4 100644
--- a/tests/app/collab/random-edits.test.ts
+++ b/tests/app/collab/random-edits.test.ts
@@ -37,7 +37,7 @@ function randomEdit(random: PRNG, graph: SceneGraph, pageId: string, nextId: ()
} else {
const parentId = expectDefined(graph.getNode(id)?.parentId, 'parent of a layer')
const siblings = graph.getNode(parentId)?.childIds.length ?? 1
- graph.reorderChild(id, parentId, Math.floor(real53(random) * siblings))
+ graph.insertChildAt(id, parentId, Math.floor(real53(random) * siblings))
}
}
diff --git a/tests/app/collab/shared-tree/migration.test.ts b/tests/app/collab/shared-tree/migration.test.ts
index 05ebc3ae0..cf0942e8f 100644
--- a/tests/app/collab/shared-tree/migration.test.ts
+++ b/tests/app/collab/shared-tree/migration.test.ts
@@ -32,7 +32,7 @@ function legacyDocument(): { update: Uint8Array; graph: SceneGraph; pageId: stri
graph.createNode('RECTANGLE', 'frame:1', { id: 'rect:2' })
graph.createNode('RECTANGLE', 'frame:1', { id: 'rect:1' })
graph.createNode('RECTANGLE', pageId, { id: 'rect:3' })
- graph.reorderChild('rect:3', pageId, 0)
+ graph.insertChildAt('rect:3', pageId, 0)
const doc = new Y.Doc()
const ynodes = doc.getMap<Y.Map<unknown>>('nodes')
diff --git a/tests/app/collab/shared-tree/sync.test.ts b/tests/app/collab/shared-tree/sync.test.ts
index 850945417..20d8cef91 100644
--- a/tests/app/collab/shared-tree/sync.test.ts
+++ b/tests/app/collab/shared-tree/sync.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import type * as Y from 'yjs'
-import { captureGraphCheckpoint } from '@open-pencil/scene-graph'
+import { captureGraphCheckpoint } from '@open-pencil/scene-graph/checkpoint'
import { readPage } from '@/app/collab/shared-tree/fields'
@@ -62,7 +62,7 @@ describe('collab layer tree', () => {
}
},
({ hostStore }, pageId) => {
- hostStore.graph.reorderChild('rect:3', pageId, 0)
+ hostStore.graph.insertChildAt('rect:3', pageId, 0)
},
(stores, pageId) => {
expect(getNodeOrThrow(stores.peerStore.graph, pageId).childIds).toEqual([
@@ -138,7 +138,7 @@ describe('collab layer tree', () => {
const checkpoint = captureGraphCheckpoint(hostStore.graph)
hostStore.graph.reparentNode('rect:1', 'frame:1')
- hostStore.graph.reorderChild('rect:2', pageId, 0)
+ hostStore.graph.insertChildAt('rect:2', pageId, 0)
await settleGraphSync()
expect(getNodeOrThrow(peerStore.graph, 'rect:1').parentId).toBe('frame:1')
diff --git a/tests/app/collab/variables.test.ts b/tests/app/collab/variables.test.ts
index 04296246e..173b4fc4f 100644
--- a/tests/app/collab/variables.test.ts
+++ b/tests/app/collab/variables.test.ts
@@ -1,11 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import {
- SceneGraph,
- parseVariableFormula,
- type Color,
- type Variable
-} from '@open-pencil/scene-graph'
+import { SceneGraph, type Variable } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import { parseVariableFormula } from '@open-pencil/scene-graph/variables'
import { openRoomSession, type RoomSession } from '@/app/collab/session'
import { createEditorStore, type EditorStore } from '@/app/editor/session'
diff --git a/tests/app/comments/session.test.ts b/tests/app/comments/session.test.ts
index 2123167ab..925ad6246 100644
--- a/tests/app/comments/session.test.ts
+++ b/tests/app/comments/session.test.ts
@@ -5,13 +5,13 @@ import { shallowRef } from 'vue'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { ALL_TOOLS } from '@open-pencil/core/tools'
+import type { CommentThread } from '@open-pencil/scene-graph'
import {
COMMENT_SORTS,
listCommentThreads,
readComments,
- writeComments,
- type CommentThread
-} from '@open-pencil/scene-graph'
+ writeComments
+} from '@open-pencil/scene-graph/comments'
import { executeWithDocumentUndo } from '@/app/automation/execution/editor'
import { openDocumentRoom, roomForStore, leaveRoom } from '@/app/collab/rooms'
diff --git a/tests/app/diagnostics/summary.test.ts b/tests/app/diagnostics/summary.test.ts
index 50c26527b..02e47041e 100644
--- a/tests/app/diagnostics/summary.test.ts
+++ b/tests/app/diagnostics/summary.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { diagnosticsMessages } from '@open-pencil/vue'
+import { diagnosticsMessages } from '@open-pencil/vue/i18n'
import { summarizeDiagnosticEvent } from '@/app/diagnostics'
import type { DiagnosticEvent } from '@/app/diagnostics/types'
diff --git a/tests/app/editor/pages/recent.test.ts b/tests/app/editor/pages/recent.test.ts
index 4326bb80d..73fcba253 100644
--- a/tests/app/editor/pages/recent.test.ts
+++ b/tests/app/editor/pages/recent.test.ts
@@ -2,7 +2,7 @@ import { expect, test } from 'bun:test'
import { range } from 'es-toolkit'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { SceneGraph } from '@open-pencil/scene-graph'
import { createRecentPages } from '@/app/editor/pages/recent'
diff --git a/tests/app/editor/pen/resume.test.ts b/tests/app/editor/pen/resume.test.ts
index 56c3a8a7c..a8e02c88d 100644
--- a/tests/app/editor/pen/resume.test.ts
+++ b/tests/app/editor/pen/resume.test.ts
@@ -1,6 +1,6 @@
import { afterEach, expect, test } from 'bun:test'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
+import { createEditor, type Editor } from '@open-pencil/core'
import type { VectorNetwork } from '@open-pencil/scene-graph'
import { createPenActions } from '@/app/editor/pen'
diff --git a/tests/app/editor/tokens/value-editor.test.ts b/tests/app/editor/tokens/value-editor.test.ts
index 9e6b8522a..c36ace96c 100644
--- a/tests/app/editor/tokens/value-editor.test.ts
+++ b/tests/app/editor/tokens/value-editor.test.ts
@@ -1,12 +1,11 @@
import { expect, test } from 'bun:test'
+import { SceneGraph, type Variable } from '@open-pencil/scene-graph'
import {
formatVariableFormula,
parseVariableFormula,
- SceneGraph,
- variableFormulaReference,
- type Variable
-} from '@open-pencil/scene-graph'
+ variableFormulaReference
+} from '@open-pencil/scene-graph/variables'
import { parseTokenEditorText, tokenEditorText } from '@/app/editor/tokens/value-editor'
diff --git a/tests/app/editor/vector/lifecycle.test.ts b/tests/app/editor/vector/lifecycle.test.ts
index 34cb040a9..6ac81903b 100644
--- a/tests/app/editor/vector/lifecycle.test.ts
+++ b/tests/app/editor/vector/lifecycle.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { SceneGraph, type VectorNetwork } from '@open-pencil/scene-graph'
import { createVectorEditLifecycle } from '@/app/editor/vector/lifecycle'
diff --git a/tests/app/editor/vector/selection.test.ts b/tests/app/editor/vector/selection.test.ts
index 56e701ee7..f3161bcaf 100644
--- a/tests/app/editor/vector/selection.test.ts
+++ b/tests/app/editor/vector/selection.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { SceneGraph, type VectorNetwork } from '@open-pencil/scene-graph'
import { createVectorEditActions } from '@/app/editor/vector/create'
diff --git a/tests/app/libraries/hash-normalization.test.ts b/tests/app/libraries/hash-normalization.test.ts
index 97cc3cda4..3ac7d6523 100644
--- a/tests/app/libraries/hash-normalization.test.ts
+++ b/tests/app/libraries/hash-normalization.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { createLibraryRevision, discoverPublishableLibraryChanges } from '@open-pencil/core/library'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
function source() {
diff --git a/tests/app/libraries/source-publication.test.ts b/tests/app/libraries/source-publication.test.ts
index 1a4dafaf2..b8c4dbe27 100644
--- a/tests/app/libraries/source-publication.test.ts
+++ b/tests/app/libraries/source-publication.test.ts
@@ -1,10 +1,11 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import {
readSourceLibraryPublication,
writeSourceLibraryPublication
} from '@open-pencil/core/library'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
describe('source library publication identity', () => {
diff --git a/tests/app/libraries/storage-catalog.test.ts b/tests/app/libraries/storage-catalog.test.ts
index 69ec8052d..1eba168a3 100644
--- a/tests/app/libraries/storage-catalog.test.ts
+++ b/tests/app/libraries/storage-catalog.test.ts
@@ -1,6 +1,10 @@
import { describe, expect, test } from 'bun:test'
-import { getInstanceOverride, SceneGraph, setInstanceOverride } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import {
+ getInstanceOverride,
+ setInstanceOverride
+} from '@open-pencil/scene-graph/instances/overrides'
import type { LibraryObjectStore } from '@/app/integrations/storage'
import { StorageLibraryCatalog } from '@/app/libraries/catalog/storage'
diff --git a/tests/app/settings/automation.test.ts b/tests/app/settings/automation.test.ts
index e3f0a6675..e6105b423 100644
--- a/tests/app/settings/automation.test.ts
+++ b/tests/app/settings/automation.test.ts
@@ -3,7 +3,7 @@ import { afterEach, beforeEach, expect, test } from 'bun:test'
import { toRaw } from 'vue'
import { allRules } from '@open-pencil/core/lint'
-import { locale, setLocale } from '@open-pencil/vue'
+import { locale, setLocale } from '@open-pencil/vue/i18n'
import { readAutomationSettings, updateAutomationSettings } from '@/app/settings/automation'
import { appPreferences } from '@/app/settings/preferences/store'
diff --git a/tests/app/shell/updater/check.test.ts b/tests/app/shell/updater/check.test.ts
index ffd8d808c..a50c16786 100644
--- a/tests/app/shell/updater/check.test.ts
+++ b/tests/app/shell/updater/check.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { useI18n } from '@open-pencil/vue'
+import { useI18n } from '@open-pencil/vue/i18n'
import { toast } from '@/app/shell/ui'
import { checkForAppUpdate } from '@/app/shell/updater/check'
diff --git a/tests/e2e/app/focused-commands.webkit.spec.ts b/tests/e2e/app/focused-commands.webkit.spec.ts
index fa5a7d8f4..cffd5c97a 100644
--- a/tests/e2e/app/focused-commands.webkit.spec.ts
+++ b/tests/e2e/app/focused-commands.webkit.spec.ts
@@ -1,4 +1,4 @@
-import type { EditorCommandId } from '@open-pencil/vue'
+import type { EditorCommandId } from '@open-pencil/vue/editor/commands'
import type { runFocusedCommand } from '@/app/shell/commands/focused'
diff --git a/tests/e2e/canvas/fill-modes-visual.spec.ts b/tests/e2e/canvas/fill-modes-visual.spec.ts
index fc3bdab9e..c17d6ad14 100644
--- a/tests/e2e/canvas/fill-modes-visual.spec.ts
+++ b/tests/e2e/canvas/fill-modes-visual.spec.ts
@@ -1,7 +1,8 @@
import { readFile } from 'node:fs/promises'
import type * as FigNodeChange from '@open-pencil/fig/node-change'
-import { shaderPresetKey, type Fill } from '@open-pencil/scene-graph'
+import type { Fill } from '@open-pencil/scene-graph'
+import { shaderPresetKey } from '@open-pencil/scene-graph/shaders'
import { expect, test, useEditorSetupWithClear } from '#tests/e2e/fixtures'
import { readScenePixels } from '#tests/helpers/canvas/pixels'
diff --git a/tests/e2e/canvas/instance-scale-visual.spec.ts b/tests/e2e/canvas/instance-scale-visual.spec.ts
index 1b67dfc00..46cf56a88 100644
--- a/tests/e2e/canvas/instance-scale-visual.spec.ts
+++ b/tests/e2e/canvas/instance-scale-visual.spec.ts
@@ -11,12 +11,9 @@ import {
initCodec,
type NodeChange
} from '@open-pencil/kiwi/fig/codec'
-import {
- reconcileVariableBindings,
- rescaleNodeTree,
- type SceneNode,
- SceneGraph
-} from '@open-pencil/scene-graph'
+import { type SceneNode, SceneGraph } from '@open-pencil/scene-graph'
+import { rescaleNodeTree } from '@open-pencil/scene-graph/scaling'
+import { reconcileVariableBindings } from '@open-pencil/scene-graph/variables'
import { expect, test, useEditorSetupWithClear } from '#tests/e2e/fixtures'
import bindingFixture from '#tests/fixtures/nested-binding-ownership-records.json' with { type: 'json' }
diff --git a/tests/e2e/code/layer-links.spec.ts b/tests/e2e/code/layer-links.spec.ts
index fa9b40a8a..a2ca993b8 100644
--- a/tests/e2e/code/layer-links.spec.ts
+++ b/tests/e2e/code/layer-links.spec.ts
@@ -340,7 +340,7 @@ test('reordering layers on the canvas moves their elements and keeps them linked
const store = window.openPencil?.getStore?.()
const swatch = [...(store?.graph.getAllNodes() ?? [])].find((node) => node.name === 'Swatch')
if (!store || !swatch?.parentId) throw new Error('Swatch not found')
- store.graph.reorderChild(swatch.id, swatch.parentId, 0)
+ store.graph.insertChildAt(swatch.id, swatch.parentId, 0)
store.requestRender()
})
@@ -395,7 +395,7 @@ test('a reorder that cannot move the code still writes layers added with it', as
const store = window.openPencil?.getStore?.()
const swatch = [...(store?.graph.getAllNodes() ?? [])].find((node) => node.name === 'Swatch')
if (!store || !swatch?.parentId) throw new Error('Swatch not found')
- store.graph.reorderChild(swatch.id, swatch.parentId, 0)
+ store.graph.insertChildAt(swatch.id, swatch.parentId, 0)
store.graph.createNode('ELLIPSE', swatch.parentId, { name: 'Dot', width: 24, height: 24 })
store.requestRender()
})
diff --git a/tests/e2e/design-check/design-check.spec.ts b/tests/e2e/design-check/design-check.spec.ts
index 25cb3076f..0218e5153 100644
--- a/tests/e2e/design-check/design-check.spec.ts
+++ b/tests/e2e/design-check/design-check.spec.ts
@@ -1,6 +1,6 @@
import type { Page } from '@playwright/test'
-import type { Vector } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import { expect, test, useEditorSetupWithClear } from '#tests/e2e/fixtures'
diff --git a/tests/e2e/dom-css/browser-runtime.spec.ts b/tests/e2e/dom-css/browser-runtime.spec.ts
index b5019ecae..542b877bd 100644
--- a/tests/e2e/dom-css/browser-runtime.spec.ts
+++ b/tests/e2e/dom-css/browser-runtime.spec.ts
@@ -1,10 +1,6 @@
-import {
- compileTailwindCSS,
- designDocumentToSceneGraph,
- jsx,
- jsxToDesignDocument,
- type DesignDocument
-} from '@open-pencil/dom-css'
+import { compileTailwindCSS, jsxToDesignDocument, type DesignDocument } from '@open-pencil/dom-css'
+import { jsx } from '@open-pencil/dom-css/browser'
+import { designDocumentToSceneGraph } from '@open-pencil/dom-css/scene-graph'
import {
DOM_CSS_COLORS,
diff --git a/tests/e2e/dom-css/generated-components.spec.ts b/tests/e2e/dom-css/generated-components.spec.ts
index a8060129c..8f080267c 100644
--- a/tests/e2e/dom-css/generated-components.spec.ts
+++ b/tests/e2e/dom-css/generated-components.spec.ts
@@ -6,13 +6,8 @@ import vue from '@vitejs/plugin-vue'
import { createServer, type PluginOption, type ViteDevServer } from 'vite'
import { exportStorybook } from '@open-pencil/dom-css'
-import {
- emptyBehaviour,
- SceneGraph,
- withBehaviour,
- type Behaviour,
- type ComponentPropertyReference
-} from '@open-pencil/scene-graph'
+import { SceneGraph, type ComponentPropertyReference } from '@open-pencil/scene-graph'
+import { emptyBehaviour, withBehaviour, type Behaviour } from '@open-pencil/scene-graph/behaviours'
import { expect, test } from '../fixtures'
diff --git a/tests/e2e/layers/drop-indicator.spec.ts b/tests/e2e/layers/drop-indicator.spec.ts
index 6aba0f1f2..4492ce734 100644
--- a/tests/e2e/layers/drop-indicator.spec.ts
+++ b/tests/e2e/layers/drop-indicator.spec.ts
@@ -1,6 +1,6 @@
import { expect, test, type Page } from '@playwright/test'
-import type { Vector } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import { CanvasHelper } from '#tests/helpers/canvas'
diff --git a/tests/engine/app/demo/viewport.test.ts b/tests/engine/app/demo/viewport.test.ts
index 52cffbf76..eed2ac394 100644
--- a/tests/engine/app/demo/viewport.test.ts
+++ b/tests/engine/app/demo/viewport.test.ts
@@ -1,6 +1,6 @@
import { expect, spyOn, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { showFirstChapter } from '@/app/demo/viewport'
diff --git a/tests/engine/app/document/close/native.test.ts b/tests/engine/app/document/close/native.test.ts
index e338714fd..b7aa0bd25 100644
--- a/tests/engine/app/document/close/native.test.ts
+++ b/tests/engine/app/document/close/native.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { commonMessages, filesMessages } from '@open-pencil/vue'
+import { commonMessages, filesMessages } from '@open-pencil/vue/i18n'
import { chooseNativeDocumentClose } from '@/app/document/close/native'
diff --git a/tests/engine/app/document/io/changes.test.ts b/tests/engine/app/document/io/changes.test.ts
index c5851c95f..91a84b932 100644
--- a/tests/engine/app/document/io/changes.test.ts
+++ b/tests/engine/app/document/io/changes.test.ts
@@ -1,10 +1,9 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { populateFigPage } from '@open-pencil/core/io/formats/fig'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { createEditor } from '@open-pencil/core'
+import { exportFigFile, parseFigFile, populateFigPage } from '@open-pencil/core/io/formats/fig'
import { computeAllLayouts } from '@open-pencil/core/layout'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import { createDocumentChanges } from '@/app/document/io/changes'
diff --git a/tests/engine/app/document/io/imported-document.test.ts b/tests/engine/app/document/io/imported-document.test.ts
index f75be5e97..7710188bd 100644
--- a/tests/engine/app/document/io/imported-document.test.ts
+++ b/tests/engine/app/document/io/imported-document.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { SceneGraph } from '@open-pencil/scene-graph'
import { applyImportedDocument } from '@/app/document/io/imported-document'
diff --git a/tests/engine/app/document/io/pending-open.test.ts b/tests/engine/app/document/io/pending-open.test.ts
index 6943d71dd..5599dee06 100644
--- a/tests/engine/app/document/io/pending-open.test.ts
+++ b/tests/engine/app/document/io/pending-open.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, mock, test } from 'bun:test'
-import { localeSetting } from '@open-pencil/vue'
+import { localeSetting } from '@open-pencil/vue/i18n'
import type { PendingOpenFile } from '@/app/document/io/pending-open'
import { openPendingFiles } from '@/app/document/io/pending-open'
diff --git a/tests/engine/app/document/io/source-identity.test.ts b/tests/engine/app/document/io/source-identity.test.ts
index b54f508f1..f19993fb8 100644
--- a/tests/engine/app/document/io/source-identity.test.ts
+++ b/tests/engine/app/document/io/source-identity.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test, vi } from 'bun:test'
-import { createDefaultEditorState } from '@open-pencil/core/editor'
+import { createDefaultEditorState } from '@open-pencil/core'
import * as browserIO from '@/app/document/io/browser'
import { createSaveActions } from '@/app/document/io/save/actions'
diff --git a/tests/engine/app/document/recovery/controller.test.ts b/tests/engine/app/document/recovery/controller.test.ts
index 0ac329036..07a07c011 100644
--- a/tests/engine/app/document/recovery/controller.test.ts
+++ b/tests/engine/app/document/recovery/controller.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { reactive, ref } from 'vue'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { createDocumentChanges } from '@/app/document/io/changes'
import { createDocumentRecovery } from '@/app/document/recovery/controller'
diff --git a/tests/engine/app/editor/panes.test.ts b/tests/engine/app/editor/panes.test.ts
index 4212c74eb..063ee0972 100644
--- a/tests/engine/app/editor/panes.test.ts
+++ b/tests/engine/app/editor/panes.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createDefaultEditorState } from '@open-pencil/core/editor'
+import { createDefaultEditorState } from '@open-pencil/core'
import { createCanvasPaneRegistry } from '@/app/editor/panes/registry'
import {
diff --git a/tests/engine/app/editor/variables.test.ts b/tests/engine/app/editor/variables.test.ts
index 4165247ef..3d757b03c 100644
--- a/tests/engine/app/editor/variables.test.ts
+++ b/tests/engine/app/editor/variables.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { ref } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import type { Variable, VariableCollection } from '@open-pencil/scene-graph'
import { createVariableCollectionActions, createVariableValueActions } from '#vue/variables/helpers'
diff --git a/tests/engine/app/shell/menu/file-batch.test.ts b/tests/engine/app/shell/menu/file-batch.test.ts
index 8d7035973..55f33ac75 100644
--- a/tests/engine/app/shell/menu/file-batch.test.ts
+++ b/tests/engine/app/shell/menu/file-batch.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, mock, test } from 'bun:test'
-import { localeSetting } from '@open-pencil/vue'
+import { localeSetting } from '@open-pencil/vue/i18n'
import { openDesignFileBatch } from '@/app/shell/menu/files'
import { toast } from '@/app/shell/ui'
diff --git a/tests/engine/app/vector-edit-transforms.test.ts b/tests/engine/app/vector-edit-transforms.test.ts
index 5e956cefe..115875ce6 100644
--- a/tests/engine/app/vector-edit-transforms.test.ts
+++ b/tests/engine/app/vector-edit-transforms.test.ts
@@ -1,10 +1,9 @@
import { describe, test, expect } from 'bun:test'
+import { createEditor, type Editor } from '@open-pencil/core'
import { computeHandleVisibleVertices } from '@open-pencil/core/canvas/overlays'
-import { createEditor, type Editor } from '@open-pencil/core/editor'
import { regenerateFillGeometry } from '@open-pencil/core/vector'
-import { SceneGraph } from '@open-pencil/scene-graph'
-import type { SceneNode, VectorNetwork } from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode, type VectorNetwork } from '@open-pencil/scene-graph'
import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import Matrix from '@open-pencil/scene-graph/matrix'
diff --git a/tests/engine/cli/import.test.ts b/tests/engine/cli/import.test.ts
index 1fd80837b..259ca2820 100644
--- a/tests/engine/cli/import.test.ts
+++ b/tests/engine/cli/import.test.ts
@@ -3,7 +3,7 @@ import { mkdtemp } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
-import { parseFigFile } from '@open-pencil/core/io'
+import { parseFigFile } from '@open-pencil/core/io/formats/fig'
import type { SceneNode } from '@open-pencil/scene-graph'
import { runOpenPencilCLI } from '#tests/helpers/cli'
diff --git a/tests/engine/cli/overlaps.test.ts b/tests/engine/cli/overlaps.test.ts
index e6949f9e5..2abd164e2 100644
--- a/tests/engine/cli/overlaps.test.ts
+++ b/tests/engine/cli/overlaps.test.ts
@@ -3,8 +3,8 @@ import { mkdtempSync, writeFileSync } from 'node:fs'
import { tmpdir } from 'node:os'
import { join } from 'node:path'
-import { SceneGraph } from '@open-pencil/core'
import { exportFigFile } from '@open-pencil/core/io/formats/fig'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { cliSourcePath, repoPath, requireBuiltWorkspacePackages } from '#tests/helpers/paths'
import { heavy } from '#tests/helpers/test-utils'
diff --git a/tests/engine/clipboard/figma/bounds.test.ts b/tests/engine/clipboard/figma/bounds.test.ts
index 6750fe4e7..7da4ac0f0 100644
--- a/tests/engine/clipboard/figma/bounds.test.ts
+++ b/tests/engine/clipboard/figma/bounds.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'bun:test'
-import { figmaNodesBounds } from '@open-pencil/core'
-import type { NodeChange } from '@open-pencil/core'
+import { figmaNodesBounds } from '@open-pencil/fig/clipboard'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
describe('figmaNodesBounds', () => {
it('computes bounds of top-level visual nodes', () => {
diff --git a/tests/engine/clipboard/figma/html.test.ts b/tests/engine/clipboard/figma/html.test.ts
index 7d0b5800f..66252c87a 100644
--- a/tests/engine/clipboard/figma/html.test.ts
+++ b/tests/engine/clipboard/figma/html.test.ts
@@ -1,14 +1,11 @@
import { beforeAll, describe, expect, it } from 'bun:test'
-import {
- buildFigmaClipboardHTML,
- fontManager,
- importClipboardNodes,
- initCodec,
- parseFigmaClipboard,
- SceneGraph
-} from '@open-pencil/core'
-import { slotPropertyId } from '@open-pencil/scene-graph'
+import { buildFigmaClipboardHTML, importClipboardNodes } from '@open-pencil/core/clipboard'
+import { fontManager } from '@open-pencil/core/text'
+import { parseFigmaClipboard } from '@open-pencil/fig/clipboard'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { slotPropertyId } from '@open-pencil/scene-graph/slots'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/clipboard/figma/images.test.ts b/tests/engine/clipboard/figma/images.test.ts
index 72585fc11..bd3b8e0b4 100644
--- a/tests/engine/clipboard/figma/images.test.ts
+++ b/tests/engine/clipboard/figma/images.test.ts
@@ -1,6 +1,7 @@
import { expect, test } from 'bun:test'
-import { buildFigmaClipboardHTML, FigmaAPI } from '@open-pencil/core'
+import { buildFigmaClipboardHTML } from '@open-pencil/core/clipboard'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
import { parseFigmaClipboard } from '@open-pencil/fig/clipboard'
import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/tests/engine/clipboard/fixtures/gold-preview-roundtrip.test.ts b/tests/engine/clipboard/fixtures/gold-preview-roundtrip.test.ts
index a6a43d320..b5589c6e6 100644
--- a/tests/engine/clipboard/fixtures/gold-preview-roundtrip.test.ts
+++ b/tests/engine/clipboard/fixtures/gold-preview-roundtrip.test.ts
@@ -5,13 +5,12 @@ import {
buildFigmaClipboardHTML,
buildOpenPencilClipboardHTML,
importClipboardNodes,
- parseFigmaClipboard,
- parseOpenPencilClipboard,
- readFigFile,
- initCodec,
- type SceneNode,
- SceneGraph
-} from '@open-pencil/core'
+ parseOpenPencilClipboard
+} from '@open-pencil/core/clipboard'
+import { readFigFile } from '@open-pencil/core/io/formats/fig'
+import { parseFigmaClipboard } from '@open-pencil/fig/clipboard'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { type SceneNode, SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined } from '#tests/helpers/assert'
import { heavy, HEAVY_TEST_TIMEOUT_MS } from '#tests/helpers/test-utils'
diff --git a/tests/engine/clipboard/openpencil/green-50.test.ts b/tests/engine/clipboard/openpencil/green-50.test.ts
index 745924b35..50a8645c3 100644
--- a/tests/engine/clipboard/openpencil/green-50.test.ts
+++ b/tests/engine/clipboard/openpencil/green-50.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { parseOpenPencilClipboard } from '@open-pencil/core'
+import { parseOpenPencilClipboard } from '@open-pencil/core/clipboard'
import { geometryBlobBounds } from '@open-pencil/scene-graph/geometry'
const fixture = await Bun.file('tests/fixtures/clipboard/green-50.openpencil.html').text()
diff --git a/tests/engine/clipboard/openpencil/images.test.ts b/tests/engine/clipboard/openpencil/images.test.ts
index 6964334c5..5192851ec 100644
--- a/tests/engine/clipboard/openpencil/images.test.ts
+++ b/tests/engine/clipboard/openpencil/images.test.ts
@@ -3,14 +3,13 @@ import { describe, expect, test } from 'bun:test'
import { deflateSync } from 'fflate'
import { fromUint8Array } from 'js-base64'
+import { buildOpenPencilClipboardHTML, parseOpenPencilClipboard } from '@open-pencil/core/clipboard'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
import {
- buildOpenPencilClipboardHTML,
- FigmaAPI,
- parseOpenPencilClipboard,
- SceneGraph
-} from '@open-pencil/core'
-import type { SceneNode } from '@open-pencil/core'
-import { getInstanceOverride, setInstanceOverride } from '@open-pencil/scene-graph'
+ getInstanceOverride,
+ setInstanceOverride
+} from '@open-pencil/scene-graph/instances/overrides'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/color/basic.test.ts b/tests/engine/color/basic.test.ts
index ef4b12ef7..6f2daf2c8 100644
--- a/tests/engine/color/basic.test.ts
+++ b/tests/engine/color/basic.test.ts
@@ -12,7 +12,7 @@ import {
rgba255ToColor,
colorToFill,
colorDistance
-} from '@open-pencil/core'
+} from '@open-pencil/scene-graph/color'
describe('parseColor', () => {
test('hex 6-digit', () => {
diff --git a/tests/engine/color/color-model.test.ts b/tests/engine/color/color-model.test.ts
index e915dbe9d..f2f70b2a3 100644
--- a/tests/engine/color/color-model.test.ts
+++ b/tests/engine/color/color-model.test.ts
@@ -2,10 +2,15 @@ import { describe, expect, test } from 'bun:test'
import { ref } from 'vue'
-import type { OkHCLColor } from '@open-pencil/core'
-import type { Color } from '@open-pencil/scene-graph'
-import type { ColorFieldFormat } from '@open-pencil/vue'
-import { BUILT_IN_COLOR_FORMATS, fromPercent, toPercent, useColorModel } from '@open-pencil/vue'
+import type { OkHCLColor } from '@open-pencil/scene-graph/color'
+import type { Color } from '@open-pencil/scene-graph/primitives'
+import {
+ type ColorFieldFormat,
+ BUILT_IN_COLOR_FORMATS,
+ fromPercent,
+ toPercent,
+ useColorModel
+} from '@open-pencil/vue/controls/color-model'
function expectColorClose(actual: Color, expected: Color, precision = 5) {
expect(actual.r).toBeCloseTo(expected.r, precision)
diff --git a/tests/engine/color/okhcl/basic.test.ts b/tests/engine/color/okhcl/basic.test.ts
index a30990193..966528b3e 100644
--- a/tests/engine/color/okhcl/basic.test.ts
+++ b/tests/engine/color/okhcl/basic.test.ts
@@ -1,18 +1,17 @@
import { describe, expect, test } from 'bun:test'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { OpenPencilAPI } from '@open-pencil/core/openpencil-api'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
colorDistance,
- exportFigFile,
- FigmaAPI,
getFillOkHCL,
getStrokeOkHCL,
- initCodec,
- OpenPencilAPI,
okhclToRGBA,
- parseFigFile,
- rgbaToOkHCL,
- SceneGraph
-} from '@open-pencil/core'
+ rgbaToOkHCL
+} from '@open-pencil/scene-graph/color'
import { solidFill, solidStroke } from '#tests/engine/figma/api/helpers'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/color/okhcl/toggle-conversion.test.ts b/tests/engine/color/okhcl/toggle-conversion.test.ts
index 30757b2e6..a425aa719 100644
--- a/tests/engine/color/okhcl/toggle-conversion.test.ts
+++ b/tests/engine/color/okhcl/toggle-conversion.test.ts
@@ -1,13 +1,13 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
clearNodeFillOkHCL,
colorDistance,
getFillOkHCL,
rgbaToOkHCL,
- SceneGraph,
setNodeFillOkHCL
-} from '@open-pencil/core'
+} from '@open-pencil/scene-graph/color'
import { expectDefined, getNodeOrThrow } from '#tests/helpers/assert'
diff --git a/tests/engine/color/okhcl/ui-logic.test.ts b/tests/engine/color/okhcl/ui-logic.test.ts
index 881a735d9..0485b20d9 100644
--- a/tests/engine/color/okhcl/ui-logic.test.ts
+++ b/tests/engine/color/okhcl/ui-logic.test.ts
@@ -1,14 +1,14 @@
import { describe, expect, test } from 'bun:test'
+import { SceneGraph } from '@open-pencil/scene-graph'
import {
clearNodeFillOkHCL,
clearNodeStrokeOkHCL,
getFillOkHCL,
getStrokeOkHCL,
- SceneGraph,
setNodeFillOkHCL,
setNodeStrokeOkHCL
-} from '@open-pencil/core'
+} from '@open-pencil/scene-graph/color'
import { getNodeOrThrow } from '#tests/helpers/assert'
diff --git a/tests/engine/color/solid-commit.test.ts b/tests/engine/color/solid-commit.test.ts
index aaf4f129f..b69215dd7 100644
--- a/tests/engine/color/solid-commit.test.ts
+++ b/tests/engine/color/solid-commit.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import type { Fill } from '@open-pencil/core'
-import { applySolidFillColor, applySolidStrokeColor } from '@open-pencil/vue'
+import type { Fill } from '@open-pencil/scene-graph'
+import { applySolidFillColor, applySolidStrokeColor } from '@open-pencil/vue/controls/color-model'
describe('solid color commit helpers', () => {
test('syncs fill opacity with color alpha', () => {
diff --git a/tests/engine/core/editor/text/start-editing-gate.test.ts b/tests/engine/core/editor/text/start-editing-gate.test.ts
index 3b467f4cc..9db33b353 100644
--- a/tests/engine/core/editor/text/start-editing-gate.test.ts
+++ b/tests/engine/core/editor/text/start-editing-gate.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { fontManager } from '#core/text/fonts'
diff --git a/tests/engine/dom-css/conversion.test.ts b/tests/engine/dom-css/conversion.test.ts
index 28351ec43..ca7536960 100644
--- a/tests/engine/dom-css/conversion.test.ts
+++ b/tests/engine/dom-css/conversion.test.ts
@@ -1,16 +1,15 @@
import { describe, expect, it } from 'bun:test'
-import type { DesignElement } from '@open-pencil/dom-css'
import {
+ type DesignElement,
compileTailwindCSS,
createHeadlessCSSRuntime,
- designDocumentToSceneGraph,
htmlToDesignDocument,
htmlToSceneGraph,
- sceneGraphToDesignDocument,
- serializeHTML,
tailwindHTMLToSceneGraph
} from '@open-pencil/dom-css'
+import { sceneGraphToDesignDocument, serializeHTML } from '@open-pencil/dom-css/export'
+import { designDocumentToSceneGraph } from '@open-pencil/dom-css/scene-graph'
import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import { parseColor } from '@open-pencil/scene-graph/color'
diff --git a/tests/engine/dom-css/jsx.test.ts b/tests/engine/dom-css/jsx.test.ts
index 5f3c7488d..3c0949530 100644
--- a/tests/engine/dom-css/jsx.test.ts
+++ b/tests/engine/dom-css/jsx.test.ts
@@ -2,11 +2,11 @@ import { describe, expect, it } from 'bun:test'
import {
createHeadlessCSSRuntime,
- jsx,
jsxToDesignDocument,
jsxToSceneGraph,
tailwindJSXToSceneGraph
} from '@open-pencil/dom-css'
+import { jsx } from '@open-pencil/dom-css/browser'
import { tailwindCardClasses } from '#tests/helpers/dom-css'
diff --git a/tests/engine/dom-css/runtime.test.ts b/tests/engine/dom-css/runtime.test.ts
index 5a5268c47..1a135d4d8 100644
--- a/tests/engine/dom-css/runtime.test.ts
+++ b/tests/engine/dom-css/runtime.test.ts
@@ -1,11 +1,7 @@
import { describe, expect, it } from 'bun:test'
-import {
- createCSSRuntime,
- createHeadlessCSSRuntime,
- exportHTMLBundle,
- serializeHTML
-} from '@open-pencil/dom-css'
+import { createCSSRuntime, createHeadlessCSSRuntime } from '@open-pencil/dom-css'
+import { exportHTMLBundle, serializeHTML } from '@open-pencil/dom-css/export'
import { DOM_CSS_COLORS, simpleCardDocument } from '#tests/helpers/dom-css'
diff --git a/tests/engine/figma/api/components.test.ts b/tests/engine/figma/api/components.test.ts
index e9410a04f..90ef806a3 100644
--- a/tests/engine/figma/api/components.test.ts
+++ b/tests/engine/figma/api/components.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { hasInstanceOverride } from '@open-pencil/scene-graph'
+import { hasInstanceOverride } from '@open-pencil/scene-graph/instances'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/figma/api/create/component-from-node.test.ts b/tests/engine/figma/api/create/component-from-node.test.ts
index e00a9f18f..daaa47627 100644
--- a/tests/engine/figma/api/create/component-from-node.test.ts
+++ b/tests/engine/figma/api/create/component-from-node.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { OpenPencilAPI, computeAllLayouts } from '@open-pencil/core'
+import { computeAllLayouts } from '@open-pencil/core/layout'
+import { OpenPencilAPI } from '@open-pencil/core/openpencil-api'
import { createAPI } from '../helpers'
diff --git a/tests/engine/figma/api/create/instance-fill-override.test.ts b/tests/engine/figma/api/create/instance-fill-override.test.ts
index 2c718ef8e..90897c273 100644
--- a/tests/engine/figma/api/create/instance-fill-override.test.ts
+++ b/tests/engine/figma/api/create/instance-fill-override.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { getInstanceOverride } from '@open-pencil/scene-graph'
+import { getInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
import { createAPI, solidFill } from '../helpers'
diff --git a/tests/engine/figma/api/frozen/arrays.test.ts b/tests/engine/figma/api/frozen/arrays.test.ts
index ed23ff160..b823a4b64 100644
--- a/tests/engine/figma/api/frozen/arrays.test.ts
+++ b/tests/engine/figma/api/frozen/arrays.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { type Fill } from '@open-pencil/core'
+import type { Fill } from '@open-pencil/scene-graph'
import { createAPI, solidFill } from '../helpers'
diff --git a/tests/engine/figma/api/helpers.ts b/tests/engine/figma/api/helpers.ts
index 21e92d4c8..c3ad0cd0d 100644
--- a/tests/engine/figma/api/helpers.ts
+++ b/tests/engine/figma/api/helpers.ts
@@ -1,6 +1,6 @@
-import { FigmaAPI, SceneGraph } from '@open-pencil/core'
-import type { FigmaNodeProxy } from '@open-pencil/core'
-import type { Color, Fill, Stroke } from '@open-pencil/scene-graph'
+import { FigmaAPI, type FigmaNodeProxy } from '@open-pencil/core/figma-api'
+import { SceneGraph, type Fill, type Stroke } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
export function createAPI(): FigmaAPI {
return new FigmaAPI(new SceneGraph())
diff --git a/tests/engine/figma/api/images.test.ts b/tests/engine/figma/api/images.test.ts
index 595589e16..f8342db5f 100644
--- a/tests/engine/figma/api/images.test.ts
+++ b/tests/engine/figma/api/images.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { FigmaAPI, SceneGraph } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { SceneGraph } from '@open-pencil/scene-graph'
const PNG_MAGIC = new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a])
const JPEG_MAGIC = new Uint8Array([0xff, 0xd8, 0xff, 0xe0])
diff --git a/tests/engine/figma/api/stroke/individual-strokes.test.ts b/tests/engine/figma/api/stroke/individual-strokes.test.ts
index 295ee819c..9387499af 100644
--- a/tests/engine/figma/api/stroke/individual-strokes.test.ts
+++ b/tests/engine/figma/api/stroke/individual-strokes.test.ts
@@ -1,6 +1,8 @@
import { describe, test, expect } from 'bun:test'
-import { SceneGraph, FigmaAPI, sceneNodeToKiwi, type Stroke } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { sceneNodeToKiwi } from '@open-pencil/fig/node-change'
+import { SceneGraph, type Stroke } from '@open-pencil/scene-graph'
import { expectDefined, getNodeOrThrow } from '#tests/helpers/assert'
diff --git a/tests/engine/figma/api/variable-binding-extended.test.ts b/tests/engine/figma/api/variable-binding-extended.test.ts
index 9154c464c..243bbe74a 100644
--- a/tests/engine/figma/api/variable-binding-extended.test.ts
+++ b/tests/engine/figma/api/variable-binding-extended.test.ts
@@ -1,9 +1,9 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph } from '@open-pencil/core'
import { FigmaAPI } from '@open-pencil/core/figma-api'
import { nodeProxyToJSON } from '@open-pencil/core/figma-api/serialization'
-import { setInstanceOverride } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
import { getNodeOrThrow } from '#tests/helpers/assert'
diff --git a/tests/engine/geometry/angles.test.ts b/tests/engine/geometry/angles.test.ts
index 8da2b8e67..0cf105728 100644
--- a/tests/engine/geometry/angles.test.ts
+++ b/tests/engine/geometry/angles.test.ts
@@ -1,6 +1,6 @@
import { describe, test, expect } from 'bun:test'
-import { degToRad, radToDeg } from '@open-pencil/scene-graph'
+import { degToRad, radToDeg } from '@open-pencil/scene-graph/geometry'
describe('degToRad / radToDeg', () => {
test('degToRad converts degrees to radians', () => {
diff --git a/tests/engine/geometry/bounds.test.ts b/tests/engine/geometry/bounds.test.ts
index 5d4ce7803..9f59c336d 100644
--- a/tests/engine/geometry/bounds.test.ts
+++ b/tests/engine/geometry/bounds.test.ts
@@ -1,6 +1,7 @@
import { describe, test, expect } from 'bun:test'
-import { computeAbsoluteBounds, computeBounds, type Vector } from '@open-pencil/scene-graph'
+import { computeAbsoluteBounds, computeBounds } from '@open-pencil/scene-graph/geometry'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
describe('computeBounds', () => {
test('empty iterable returns zero rect', () => {
diff --git a/tests/engine/geometry/clip-polygon.test.ts b/tests/engine/geometry/clip-polygon.test.ts
index 489576048..b16def3e7 100644
--- a/tests/engine/geometry/clip-polygon.test.ts
+++ b/tests/engine/geometry/clip-polygon.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { clipBoundsToPolygon, clipPolygon, type Vector } from '@open-pencil/scene-graph'
+import { clipBoundsToPolygon, clipPolygon } from '@open-pencil/scene-graph/geometry'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
describe('clipPolygon', () => {
test('returns the subject unchanged when the clip has fewer than 3 corners', () => {
diff --git a/tests/engine/geometry/matrix.test.ts b/tests/engine/geometry/matrix.test.ts
index 88ec6a0a0..b64fffe18 100644
--- a/tests/engine/geometry/matrix.test.ts
+++ b/tests/engine/geometry/matrix.test.ts
@@ -7,7 +7,7 @@
*/
import { describe, test, expect } from 'bun:test'
-import { TransformMatrix } from '@open-pencil/scene-graph'
+import TransformMatrix from '@open-pencil/scene-graph/matrix'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/geometry/rotation.test.ts b/tests/engine/geometry/rotation.test.ts
index 1e181872d..80df43197 100644
--- a/tests/engine/geometry/rotation.test.ts
+++ b/tests/engine/geometry/rotation.test.ts
@@ -1,6 +1,6 @@
import { describe, test, expect } from 'bun:test'
-import { rotatePoint, rotatedBBox, rotatedCorners } from '@open-pencil/scene-graph'
+import { rotatePoint, rotatedBBox, rotatedCorners } from '@open-pencil/scene-graph/geometry'
describe('rotatePoint', () => {
test('no rotation returns same point', () => {
diff --git a/tests/engine/geometry/visual-bounds.test.ts b/tests/engine/geometry/visual-bounds.test.ts
index 08d86d876..4942a41b5 100644
--- a/tests/engine/geometry/visual-bounds.test.ts
+++ b/tests/engine/geometry/visual-bounds.test.ts
@@ -1,12 +1,12 @@
import { describe, test, expect } from 'bun:test'
-import type { Vector } from '@open-pencil/scene-graph'
-import type { VisualBoundsNode } from '@open-pencil/scene-graph/geometry'
import {
+ type VisualBoundsNode,
computeDescendantVisualBounds,
computeVisualBounds,
strokeOverflow
} from '@open-pencil/scene-graph/geometry'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
function commandsBlobFromPoints(points: Vector[]): Uint8Array {
const blob = new Uint8Array(points.length * 9 + 1)
diff --git a/tests/engine/hit-test/basic.test.ts b/tests/engine/hit-test/basic.test.ts
index b9378e810..c80bd586e 100644
--- a/tests/engine/hit-test/basic.test.ts
+++ b/tests/engine/hit-test/basic.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
function pageId(graph: SceneGraph) {
return graph.getPages()[0].id
diff --git a/tests/engine/hit-test/scope.test.ts b/tests/engine/hit-test/scope.test.ts
index cbed52a16..d02f2b272 100644
--- a/tests/engine/hit-test/scope.test.ts
+++ b/tests/engine/hit-test/scope.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined, getNodeOrThrow } from '#tests/helpers/assert'
@@ -308,11 +308,11 @@ describe('hitTest — frame with children', () => {
graph.updateNode(left.id, { flipX: false })
expect(graph.getAbsolutePosition(child.id)).toEqual({ x: 120, y: 120 })
- graph.reorderChild(child.id, right.id, 0)
+ graph.insertChildAt(child.id, right.id, 0)
expect(graph.getAbsolutePosition(child.id)).toEqual({ x: 420, y: 120 })
expect(graph.hitTest(430, 130, right.id)?.id).toBe(child.id)
- graph.reorderChild(right.id, child.id, 0)
+ graph.insertChildAt(right.id, child.id, 0)
expect(right.parentId).toBe(page)
expect(child.parentId).toBe(right.id)
})
diff --git a/tests/engine/icons/iconify.test.ts b/tests/engine/icons/iconify.test.ts
index 854d54152..d72a75e67 100644
--- a/tests/engine/icons/iconify.test.ts
+++ b/tests/engine/icons/iconify.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test, beforeAll } from 'bun:test'
-import { createIconifyProvider } from '@open-pencil/core'
+import { createIconifyProvider } from '@open-pencil/core/icons'
const provider = createIconifyProvider()
const fetchIcons = (names: string[], size = 24) => provider.icons(names, size)
diff --git a/tests/engine/io/dom-css-formats.test.ts b/tests/engine/io/dom-css-formats.test.ts
index 5eba2542d..9580e6d21 100644
--- a/tests/engine/io/dom-css-formats.test.ts
+++ b/tests/engine/io/dom-css-formats.test.ts
@@ -3,7 +3,8 @@ import { describe, expect, test } from 'bun:test'
import { toUint8Array } from 'js-base64'
import { BUILTIN_IO_FORMATS, IORegistry } from '@open-pencil/core/io'
-import { SceneGraph, TRANSPARENT } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { TRANSPARENT } from '@open-pencil/scene-graph/constants'
const io = new IORegistry(BUILTIN_IO_FORMATS)
diff --git a/tests/engine/io/export-formats.test.ts b/tests/engine/io/export-formats.test.ts
index 1ff5f9623..b14867b66 100644
--- a/tests/engine/io/export-formats.test.ts
+++ b/tests/engine/io/export-formats.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
import { BUILTIN_IO_FORMATS, IORegistry } from '@open-pencil/core/io'
-import { EXPORT_FORMAT_IDS, isExportFormatId } from '@open-pencil/scene-graph'
+import { EXPORT_FORMAT_IDS, isExportFormatId } from '@open-pencil/scene-graph/export-format'
const io = new IORegistry(BUILTIN_IO_FORMATS)
diff --git a/tests/engine/io/fig/export/auto-layout.test.ts b/tests/engine/io/fig/export/auto-layout.test.ts
index 13837d0aa..6adae90b4 100644
--- a/tests/engine/io/fig/export/auto-layout.test.ts
+++ b/tests/engine/io/fig/export/auto-layout.test.ts
@@ -1,7 +1,9 @@
import { beforeAll, describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { uint8ArrayToArrayBuffer } from '#tests/helpers/fig/fixtures'
diff --git a/tests/engine/io/fig/export/boolean-operation.test.ts b/tests/engine/io/fig/export/boolean-operation.test.ts
index 8889ccf18..5afaf4dc0 100644
--- a/tests/engine/io/fig/export/boolean-operation.test.ts
+++ b/tests/engine/io/fig/export/boolean-operation.test.ts
@@ -1,10 +1,9 @@
import { describe, expect, test } from 'bun:test'
+import { sceneNodeToKiwi } from '@open-pencil/fig/node-change'
import { createNodeChangesMessage, encodeMessage, initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { sceneNodeToKiwi } from '#core/kiwi/fig/node-change/serialize'
-
describe('Figma boolean operation export', () => {
test('exports boolean operation node type and operation', () => {
const graph = new SceneGraph()
diff --git a/tests/engine/io/fig/export/component-properties.test.ts b/tests/engine/io/fig/export/component-properties.test.ts
index 035af8c17..e4fcd1d7e 100644
--- a/tests/engine/io/fig/export/component-properties.test.ts
+++ b/tests/engine/io/fig/export/component-properties.test.ts
@@ -1,7 +1,8 @@
import { beforeAll, describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec } from '@open-pencil/core'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer, materializeDocument } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import { uint8ArrayToArrayBuffer } from '#tests/helpers/fig/fixtures'
diff --git a/tests/engine/io/fig/export/corner-smoothing.test.ts b/tests/engine/io/fig/export/corner-smoothing.test.ts
index a7d48b446..605489fcb 100644
--- a/tests/engine/io/fig/export/corner-smoothing.test.ts
+++ b/tests/engine/io/fig/export/corner-smoothing.test.ts
@@ -1,9 +1,8 @@
import { describe, expect, test } from 'bun:test'
+import { sceneNodeToKiwi } from '@open-pencil/fig/node-change'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { sceneNodeToKiwi } from '#core/kiwi/fig/node-change/serialize'
-
function serializeCornerSmoothing(value: number, importedValue?: number) {
const graph = new SceneGraph()
const page = graph.getPages()[0]
diff --git a/tests/engine/io/fig/export/font-feature-encoding.test.ts b/tests/engine/io/fig/export/font-feature-encoding.test.ts
index c464b55d1..7da6f3571 100644
--- a/tests/engine/io/fig/export/font-feature-encoding.test.ts
+++ b/tests/engine/io/fig/export/font-feature-encoding.test.ts
@@ -1,6 +1,7 @@
import { beforeAll, describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import { HEAVY_TEST_TIMEOUT_MS } from '#tests/helpers/test-utils'
diff --git a/tests/engine/io/fig/export/font-variations.test.ts b/tests/engine/io/fig/export/font-variations.test.ts
index d66b261eb..826e92d0c 100644
--- a/tests/engine/io/fig/export/font-variations.test.ts
+++ b/tests/engine/io/fig/export/font-variations.test.ts
@@ -1,9 +1,8 @@
import { describe, expect, test } from 'bun:test'
+import { sceneNodeToKiwi } from '@open-pencil/fig/node-change'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { sceneNodeToKiwi } from '#core/kiwi/fig/node-change/serialize'
-
describe('Figma font variation export', () => {
test('exports base and styled-run variable font axes', () => {
const graph = new SceneGraph()
diff --git a/tests/engine/io/fig/export/guid-collision.test.ts b/tests/engine/io/fig/export/guid-collision.test.ts
index 834b1648d..c18921434 100644
--- a/tests/engine/io/fig/export/guid-collision.test.ts
+++ b/tests/engine/io/fig/export/guid-collision.test.ts
@@ -1,6 +1,8 @@
import { beforeAll, describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
/**
* Regression test: two distinct nodes sharing the same source.id
diff --git a/tests/engine/io/fig/export/images.test.ts b/tests/engine/io/fig/export/images.test.ts
index 0c0643ebe..21fd17fa0 100644
--- a/tests/engine/io/fig/export/images.test.ts
+++ b/tests/engine/io/fig/export/images.test.ts
@@ -2,7 +2,10 @@ import { beforeAll, describe, expect, test } from 'bun:test'
import { unzipSync } from 'fflate'
-import { exportFigFile, FigmaAPI, initCodec, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/io/fig/export/lazy-population.test.ts b/tests/engine/io/fig/export/lazy-population.test.ts
index b58e34df6..d9a07c473 100644
--- a/tests/engine/io/fig/export/lazy-population.test.ts
+++ b/tests/engine/io/fig/export/lazy-population.test.ts
@@ -1,8 +1,10 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { cloneSceneGraphForFigExport } from '@open-pencil/core/kiwi/fig/parse/transfer'
-import { SceneGraph, setInstanceOverride } from '@open-pencil/scene-graph'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
function lazyExportGraph() {
const graph = new SceneGraph()
diff --git a/tests/engine/io/fig/export/masks.test.ts b/tests/engine/io/fig/export/masks.test.ts
index eb283bb42..d2d5e1800 100644
--- a/tests/engine/io/fig/export/masks.test.ts
+++ b/tests/engine/io/fig/export/masks.test.ts
@@ -1,9 +1,8 @@
import { describe, expect, test } from 'bun:test'
+import { sceneNodeToKiwi } from '@open-pencil/fig/node-change'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { sceneNodeToKiwi } from '#core/kiwi/fig/node-change/serialize'
-
describe('Figma mask export', () => {
test('exports schema mask fields', () => {
const graph = new SceneGraph()
diff --git a/tests/engine/io/fig/export/paint-schema-fields.test.ts b/tests/engine/io/fig/export/paint-schema-fields.test.ts
index e10f19949..64d192922 100644
--- a/tests/engine/io/fig/export/paint-schema-fields.test.ts
+++ b/tests/engine/io/fig/export/paint-schema-fields.test.ts
@@ -1,9 +1,8 @@
import { describe, expect, test } from 'bun:test'
+import { sceneNodeToKiwi } from '@open-pencil/fig/node-change'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { sceneNodeToKiwi } from '#core/kiwi/fig/node-change/serialize'
-
describe('Figma paint schema field export', () => {
test('exports pattern, noise, and custom fill metadata', () => {
const graph = new SceneGraph()
diff --git a/tests/engine/io/fig/export/shared-styles.test.ts b/tests/engine/io/fig/export/shared-styles.test.ts
index ce908d973..5cdfe5692 100644
--- a/tests/engine/io/fig/export/shared-styles.test.ts
+++ b/tests/engine/io/fig/export/shared-styles.test.ts
@@ -1,11 +1,11 @@
import { beforeAll, describe, expect, test } from 'bun:test'
-import { exportFigFile, initCodec } from '@open-pencil/core'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
+import { sceneNodeToKiwi } from '@open-pencil/fig/node-change'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { sceneNodeToKiwi } from '#core/kiwi/fig/node-change/serialize'
-
import { uint8ArrayToArrayBuffer } from '#tests/helpers/fig/fixtures'
function serialize(graph: SceneGraph, nodeId: string) {
diff --git a/tests/engine/io/fig/export/stroke-geometry.test.ts b/tests/engine/io/fig/export/stroke-geometry.test.ts
index df46e2514..6ecd2257c 100644
--- a/tests/engine/io/fig/export/stroke-geometry.test.ts
+++ b/tests/engine/io/fig/export/stroke-geometry.test.ts
@@ -1,9 +1,8 @@
import { describe, expect, test } from 'bun:test'
+import { sceneNodeToKiwi } from '@open-pencil/fig/node-change'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { sceneNodeToKiwi } from '#core/kiwi/fig/node-change/serialize'
-
function serializeMiterLimit(strokeMiterLimit: number, importedMiterLimit?: number) {
const graph = new SceneGraph()
const page = graph.getPages()[0]
diff --git a/tests/engine/io/fig/export/text.test.ts b/tests/engine/io/fig/export/text.test.ts
index ac5ec9511..e9358787e 100644
--- a/tests/engine/io/fig/export/text.test.ts
+++ b/tests/engine/io/fig/export/text.test.ts
@@ -1,12 +1,9 @@
import { describe, expect, setDefaultTimeout, test } from 'bun:test'
-import {
- decompressFigKiwiDataAsync,
- exportFigFile,
- initCodec,
- parseFigFile,
- SceneGraph
-} from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { decompressFigKiwiDataAsync } from '@open-pencil/kiwi/fig/container'
+import { SceneGraph } from '@open-pencil/scene-graph'
import type { JSONObject } from '@open-pencil/scene-graph/primitives'
import { expectDefined } from '#tests/helpers/assert'
@@ -121,7 +118,7 @@ describe('text node export', () => {
const { unzipSync, inflateSync } = await import('fflate')
const { decodeBinarySchema, compileSchema, ByteBuffer } =
await import('@open-pencil/kiwi/schema-runtime')
- const { parseFigKiwiChunks } = await import('@open-pencil/core')
+ const { parseFigKiwiChunks } = await import('@open-pencil/kiwi/fig/container')
const graph = new SceneGraph()
const page = graph.getPages()[0]
@@ -189,7 +186,7 @@ describe('text node export', () => {
const { unzipSync, inflateSync } = await import('fflate')
const { decodeBinarySchema, compileSchema, ByteBuffer } =
await import('@open-pencil/kiwi/schema-runtime')
- const { parseFigKiwiChunks } = await import('@open-pencil/core')
+ const { parseFigKiwiChunks } = await import('@open-pencil/kiwi/fig/container')
const graph = new SceneGraph()
const page = graph.getPages()[0]
@@ -235,7 +232,7 @@ describe('text node export', () => {
const { unzipSync, inflateSync } = await import('fflate')
const { decodeBinarySchema, compileSchema, ByteBuffer } =
await import('@open-pencil/kiwi/schema-runtime')
- const { parseFigKiwiChunks } = await import('@open-pencil/core')
+ const { parseFigKiwiChunks } = await import('@open-pencil/kiwi/fig/container')
const graph = new SceneGraph()
const page = graph.getPages()[0]
@@ -312,7 +309,7 @@ describe('text node export', () => {
const { unzipSync, inflateSync } = await import('fflate')
const { decodeBinarySchema, compileSchema, ByteBuffer } =
await import('@open-pencil/kiwi/schema-runtime')
- const { parseFigKiwiChunks } = await import('@open-pencil/core')
+ const { parseFigKiwiChunks } = await import('@open-pencil/kiwi/fig/container')
const graph = new SceneGraph()
const page = graph.getPages()[0]
diff --git a/tests/engine/io/fig/export/variables.test.ts b/tests/engine/io/fig/export/variables.test.ts
index a4ec955d1..bc4630a47 100644
--- a/tests/engine/io/fig/export/variables.test.ts
+++ b/tests/engine/io/fig/export/variables.test.ts
@@ -1,6 +1,8 @@
import { describe, test, expect, beforeAll } from 'bun:test'
-import { exportFigFile, parseFigFile, initCodec, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
import type { Color } from '@open-pencil/scene-graph/primitives'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/io/fig/export/worker.test.ts b/tests/engine/io/fig/export/worker.test.ts
index ee317ec95..c5e3ee317 100644
--- a/tests/engine/io/fig/export/worker.test.ts
+++ b/tests/engine/io/fig/export/worker.test.ts
@@ -5,13 +5,10 @@ import { pathToFileURL } from 'node:url'
import { unzipSync } from 'fflate'
-import {
- parseFigFile,
- exportFigFile,
- compressFigDataSync,
- initCodec,
- SceneGraph
-} from '@open-pencil/core'
+import { parseFigFile, exportFigFile } from '@open-pencil/core/io/formats/fig'
+import { compressFigDataSync } from '@open-pencil/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { coreSourcePath, testPath } from '#tests/helpers/paths'
import { heavy } from '#tests/helpers/test-utils'
diff --git a/tests/engine/io/fig/heavy/fixtures.test.ts b/tests/engine/io/fig/heavy/fixtures.test.ts
index 6ed26e408..55e5d0729 100644
--- a/tests/engine/io/fig/heavy/fixtures.test.ts
+++ b/tests/engine/io/fig/heavy/fixtures.test.ts
@@ -1,7 +1,7 @@
import { afterAll, beforeAll, expect, setDefaultTimeout, test } from 'bun:test'
-import { SceneGraph, type SceneNode } from '@open-pencil/core'
import { populateFigPage } from '@open-pencil/core/io/formats/fig'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
import { releaseFigPopulationWorker } from '#core/kiwi/fig/population/client'
diff --git a/tests/engine/io/fig/import/basic.test.ts b/tests/engine/io/fig/import/basic.test.ts
index a2ce7e828..b8d4a2873 100644
--- a/tests/engine/io/fig/import/basic.test.ts
+++ b/tests/engine/io/fig/import/basic.test.ts
@@ -1,6 +1,6 @@
import { beforeAll, describe, expect, setDefaultTimeout, test } from 'bun:test'
-import { SceneGraph, type SceneNode } from '@open-pencil/core'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
import { sharedGoldPreviewFixture, VALID_NODE_TYPES } from '#tests/helpers/fig/fixtures'
diff --git a/tests/engine/io/fig/import/derived-symbol-data.test.ts b/tests/engine/io/fig/import/derived-symbol-data.test.ts
index 8d6648d8e..631affb85 100644
--- a/tests/engine/io/fig/import/derived-symbol-data.test.ts
+++ b/tests/engine/io/fig/import/derived-symbol-data.test.ts
@@ -3,7 +3,7 @@ import { describe, expect, test } from 'bun:test'
import { materializeDocument } from '@open-pencil/fig'
import type { DerivedSymbolOverride } from '@open-pencil/fig/instance-overrides'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { getNodeLocalMatrix } from '@open-pencil/scene-graph'
+import { getNodeLocalMatrix } from '@open-pencil/scene-graph/coordinate'
const guid = (localID: number) => ({ sessionID: 1, localID })
function derivedChild(
diff --git a/tests/engine/io/fig/import/edge-cases.test.ts b/tests/engine/io/fig/import/edge-cases.test.ts
index af617ebfe..cc8705320 100644
--- a/tests/engine/io/fig/import/edge-cases.test.ts
+++ b/tests/engine/io/fig/import/edge-cases.test.ts
@@ -1,7 +1,9 @@
import { describe, expect, setDefaultTimeout, test } from 'bun:test'
-import { type NodeChange, parseFigFile, type SceneNode } from '@open-pencil/core'
+import { parseFigFile } from '@open-pencil/core/io/formats/fig'
import { materializeDocument } from '@open-pencil/fig'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
+import type { SceneNode } from '@open-pencil/scene-graph'
import { expectDefined } from '#tests/helpers/assert'
import { sharedGoldPreviewFixture } from '#tests/helpers/fig/fixtures'
diff --git a/tests/engine/io/fig/import/field-protection.test.ts b/tests/engine/io/fig/import/field-protection.test.ts
index 979fbd13a..266ff0353 100644
--- a/tests/engine/io/fig/import/field-protection.test.ts
+++ b/tests/engine/io/fig/import/field-protection.test.ts
@@ -2,8 +2,8 @@ import { describe, expect, test } from 'bun:test'
import { materializeDocument } from '@open-pencil/fig'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
-import { SceneGraph, setInstanceOverride } from '@open-pencil/scene-graph'
-import type { Fill, Stroke } from '@open-pencil/scene-graph'
+import { SceneGraph, type Fill, type Stroke } from '@open-pencil/scene-graph'
+import { setInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
function pageId(graph: SceneGraph): string {
return graph.getPages()[0].id
diff --git a/tests/engine/io/fig/import/instance-regressions.test.ts b/tests/engine/io/fig/import/instance-regressions.test.ts
index 3c99f1de7..a706e4c46 100644
--- a/tests/engine/io/fig/import/instance-regressions.test.ts
+++ b/tests/engine/io/fig/import/instance-regressions.test.ts
@@ -1,6 +1,8 @@
import { beforeAll, describe, expect, setDefaultTimeout, test } from 'bun:test'
-import { computeAllLayouts, parseFigFile, type SceneGraph, type SceneNode } from '@open-pencil/core'
+import { parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { computeAllLayouts } from '@open-pencil/core/layout'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import { computeContentBounds } from '#core/io/formats/raster/render'
diff --git a/tests/engine/io/fig/import/lazy-pages.test.ts b/tests/engine/io/fig/import/lazy-pages.test.ts
index 438853f85..90d1f7887 100644
--- a/tests/engine/io/fig/import/lazy-pages.test.ts
+++ b/tests/engine/io/fig/import/lazy-pages.test.ts
@@ -1,7 +1,12 @@
import { expect, test } from 'bun:test'
-import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'
-import { populateAllFigPages, populateFigPage } from '@open-pencil/core/io/formats/fig'
+import {
+ exportFigFile,
+ parseFigFile,
+ populateAllFigPages,
+ populateFigPage
+} from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
async function createLazyGraph() {
diff --git a/tests/engine/io/fig/import/legacy/helpers.ts b/tests/engine/io/fig/import/legacy/helpers.ts
index 2343457db..0998d1087 100644
--- a/tests/engine/io/fig/import/legacy/helpers.ts
+++ b/tests/engine/io/fig/import/legacy/helpers.ts
@@ -1,4 +1,4 @@
-import type { NodeChange } from '@open-pencil/core'
+import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
export function doc(): NodeChange {
return {
diff --git a/tests/engine/io/fig/import/mask-oracle.test.ts b/tests/engine/io/fig/import/mask-oracle.test.ts
index 20997db7e..2d28f0495 100644
--- a/tests/engine/io/fig/import/mask-oracle.test.ts
+++ b/tests/engine/io/fig/import/mask-oracle.test.ts
@@ -3,12 +3,10 @@ import { readFileSync } from 'node:fs'
import * as v from 'valibot'
-import { nodeChangeToProps } from '@open-pencil/fig/node-change'
+import { nodeChangeToProps, sceneNodeToKiwi } from '@open-pencil/fig/node-change'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph, type MaskType } from '@open-pencil/scene-graph'
-import { sceneNodeToKiwi } from '#core/kiwi/fig/node-change/serialize'
-
const MASK_TYPE_VALUES = ['ALPHA', 'VECTOR', 'LUMINANCE'] as const satisfies readonly MaskType[]
const MaskOracleEntry = v.object({ isMask: v.boolean(), maskType: v.picklist(MASK_TYPE_VALUES) })
diff --git a/tests/engine/io/fig/import/property-integrity.test.ts b/tests/engine/io/fig/import/property-integrity.test.ts
index f655c0b33..76928260f 100644
--- a/tests/engine/io/fig/import/property-integrity.test.ts
+++ b/tests/engine/io/fig/import/property-integrity.test.ts
@@ -1,6 +1,6 @@
import { beforeAll, describe, expect, setDefaultTimeout, test } from 'bun:test'
-import { type Fill, type SceneNode } from '@open-pencil/core'
+import type { Fill, SceneNode } from '@open-pencil/scene-graph'
import { sharedGoldPreviewFixture } from '#tests/helpers/fig/fixtures'
diff --git a/tests/engine/io/fig/import/rich-text-oracle.test.ts b/tests/engine/io/fig/import/rich-text-oracle.test.ts
index ce63b46d7..697d8cd8e 100644
--- a/tests/engine/io/fig/import/rich-text-oracle.test.ts
+++ b/tests/engine/io/fig/import/rich-text-oracle.test.ts
@@ -3,12 +3,10 @@ import { readFileSync } from 'node:fs'
import * as v from 'valibot'
-import { nodeChangeToProps } from '@open-pencil/fig/node-change'
+import { nodeChangeToProps, sceneNodeToKiwi } from '@open-pencil/fig/node-change'
import type { NodeChange, Paint } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
-import { sceneNodeToKiwi } from '#core/kiwi/fig/node-change/serialize'
-
const OracleLength = v.object({ unit: v.string(), value: v.number() })
const OracleDecorationColor = v.object({
diff --git a/tests/engine/io/fig/import/text-path.test.ts b/tests/engine/io/fig/import/text-path.test.ts
index c6dcc6e28..72b92738c 100644
--- a/tests/engine/io/fig/import/text-path.test.ts
+++ b/tests/engine/io/fig/import/text-path.test.ts
@@ -1,14 +1,17 @@
import { describe, expect, test } from 'bun:test'
import { parseFigBuffer } from '@open-pencil/fig'
-import { convertFigmaDerivedTextGlyphs, nodeChangeToProps } from '@open-pencil/fig/node-change'
+import {
+ convertFigmaDerivedTextGlyphs,
+ nodeChangeToProps,
+ encodeVectorNetworkBlob
+} from '@open-pencil/fig/node-change'
import type { NodeChange } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import type { Vector } from '@open-pencil/scene-graph/primitives'
import { importClipboardNodes } from '#core/clipboard'
import { exportFigFile } from '#core/io/formats/fig/export'
-import { encodeVectorNetworkBlob } from '#core/vector'
import { expectDefined } from '#tests/helpers/assert'
import { loadFigFixture, uint8ArrayToArrayBuffer } from '#tests/helpers/fig/fixtures'
diff --git a/tests/engine/io/fig/instance/override-resave.test.ts b/tests/engine/io/fig/instance/override-resave.test.ts
index 567173179..d1811078c 100644
--- a/tests/engine/io/fig/instance/override-resave.test.ts
+++ b/tests/engine/io/fig/instance/override-resave.test.ts
@@ -1,8 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { FigmaAPI } from '@open-pencil/core'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
const BLUE = { r: 0, g: 0, b: 1, a: 1 }
diff --git a/tests/engine/io/fig/instance/override-roundtrip.test.ts b/tests/engine/io/fig/instance/override-roundtrip.test.ts
index fe67f59d5..2a8bde51b 100644
--- a/tests/engine/io/fig/instance/override-roundtrip.test.ts
+++ b/tests/engine/io/fig/instance/override-roundtrip.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
describe('instance descendant fill override round trip', () => {
@@ -26,7 +26,7 @@ describe('instance descendant fill override round trip', () => {
graph.updateNode(instancePath.id, {
fills: [{ type: 'SOLID', color: { r: 0, g: 0, b: 1, a: 1 }, opacity: 1, visible: true }]
})
- const { recordInstanceOverride } = await import('@open-pencil/scene-graph')
+ const { recordInstanceOverride } = await import('@open-pencil/scene-graph/instances')
recordInstanceOverride(graph, instancePath.id, ['fills'])
const exported = await exportFigFile(graph)
diff --git a/tests/engine/io/fig/instance/swap-roundtrip.test.ts b/tests/engine/io/fig/instance/swap-roundtrip.test.ts
index fd29f8023..4d208ecda 100644
--- a/tests/engine/io/fig/instance/swap-roundtrip.test.ts
+++ b/tests/engine/io/fig/instance/swap-roundtrip.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
describe('INSTANCE_SWAP component property round trip', () => {
diff --git a/tests/engine/io/fig/instance/text-marker-roundtrip.test.ts b/tests/engine/io/fig/instance/text-marker-roundtrip.test.ts
index 5bb632d9a..7683415be 100644
--- a/tests/engine/io/fig/instance/text-marker-roundtrip.test.ts
+++ b/tests/engine/io/fig/instance/text-marker-roundtrip.test.ts
@@ -1,9 +1,10 @@
import { expect, test } from 'bun:test'
-import { FigmaAPI } from '@open-pencil/core'
-import { exportFigFile, parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
-import { SceneGraph, getInstanceOverride } from '@open-pencil/scene-graph'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { getInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
for (const text of ['User edit', '']) {
test(`preserves API instance text edit ${JSON.stringify(text)} across save/reload`, async () => {
diff --git a/tests/engine/io/fig/plugin-data.test.ts b/tests/engine/io/fig/plugin-data.test.ts
index 063c50657..ae962e614 100644
--- a/tests/engine/io/fig/plugin-data.test.ts
+++ b/tests/engine/io/fig/plugin-data.test.ts
@@ -1,16 +1,11 @@
import { describe, expect, test } from 'bun:test'
-import {
- exportFigFile,
- FigmaAPI,
- initCodec,
- parseFigFile,
- SceneGraph,
- type NodeChange
-} from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { materializeDocument } from '@open-pencil/fig'
-
-import { deduplicateNodeChangePluginData } from '#core/kiwi'
+import { initCodec, type NodeChange } from '@open-pencil/kiwi/fig/codec'
+import { deduplicateNodeChangePluginData } from '@open-pencil/kiwi/fig/parse'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined } from '#tests/helpers/assert'
import { parseFixture, uint8ArrayToArrayBuffer } from '#tests/helpers/fig/fixtures'
diff --git a/tests/engine/io/pptx/export/fidelity.test.ts b/tests/engine/io/pptx/export/fidelity.test.ts
index f5e50c018..da8dbccac 100644
--- a/tests/engine/io/pptx/export/fidelity.test.ts
+++ b/tests/engine/io/pptx/export/fidelity.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { renderNodesToPPTX, type Effect, type PPTXExportStats } from '@open-pencil/core'
-import { TransformMatrix } from '@open-pencil/scene-graph'
+import { renderNodesToPPTX, type PPTXExportStats } from '@open-pencil/core/io'
+import type { Effect } from '@open-pencil/scene-graph'
+import TransformMatrix from '@open-pencil/scene-graph/matrix'
import { hasUnsupportedTransform, nodeBox } from '#core/io/formats/pptx/geometry'
diff --git a/tests/engine/io/pptx/export/render.test.ts b/tests/engine/io/pptx/export/render.test.ts
index aa348338a..8342b51ea 100644
--- a/tests/engine/io/pptx/export/render.test.ts
+++ b/tests/engine/io/pptx/export/render.test.ts
@@ -1,7 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { renderNodesToPPTX, type PPTXExportStats } from '@open-pencil/core'
-import { BUILTIN_IO_FORMATS } from '@open-pencil/core/io'
+import { renderNodesToPPTX, type PPTXExportStats, BUILTIN_IO_FORMATS } from '@open-pencil/core/io'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/io/subgraph.test.ts b/tests/engine/io/subgraph.test.ts
index 976f683ee..7d6b2065a 100644
--- a/tests/engine/io/subgraph.test.ts
+++ b/tests/engine/io/subgraph.test.ts
@@ -1,9 +1,10 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, extractExportGraph, parseFigFile } from '@open-pencil/core/io'
-import { initCodec } from '@open-pencil/core/kiwi'
+import { extractExportGraph } from '@open-pencil/core/io'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
import { parseFigBuffer } from '@open-pencil/fig'
import type { SymbolData } from '@open-pencil/fig/instance-overrides'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { guidToString } from '@open-pencil/kiwi/fig/guid'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/tests/engine/io/svg/export/builder.test.ts b/tests/engine/io/svg/export/builder.test.ts
index 3a2f3432e..675e7ca92 100644
--- a/tests/engine/io/svg/export/builder.test.ts
+++ b/tests/engine/io/svg/export/builder.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { renderSVGNode, svg } from '@open-pencil/core'
+import { renderSVGNode, svg } from '@open-pencil/core/io/formats/svg'
// --- SVGNode builder tests ---
diff --git a/tests/engine/io/svg/export/helpers.ts b/tests/engine/io/svg/export/helpers.ts
index 83d627609..dac24f350 100644
--- a/tests/engine/io/svg/export/helpers.ts
+++ b/tests/engine/io/svg/export/helpers.ts
@@ -1,4 +1,5 @@
-import { SceneGraph, renderNodesToSVG } from '@open-pencil/core'
+import { renderNodesToSVG } from '@open-pencil/core/io/formats/svg'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/io/svg/export/paths.test.ts b/tests/engine/io/svg/export/paths.test.ts
index bec8ce3bc..5f3a954b7 100644
--- a/tests/engine/io/svg/export/paths.test.ts
+++ b/tests/engine/io/svg/export/paths.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { geometryBlobToSVGPath, vectorNetworkToSVGPaths } from '@open-pencil/core'
+import { geometryBlobToSVGPath, vectorNetworkToSVGPaths } from '@open-pencil/core/io/formats/svg'
// --- geometryBlobToSVGPath tests ---
diff --git a/tests/engine/io/svg/import.test.ts b/tests/engine/io/svg/import.test.ts
index 1e6e14bfd..176d72eb8 100644
--- a/tests/engine/io/svg/import.test.ts
+++ b/tests/engine/io/svg/import.test.ts
@@ -2,8 +2,10 @@ import { describe, test, expect, beforeEach } from 'bun:test'
import { readFileSync } from 'node:fs'
import { join } from 'node:path'
-import { FigmaAPI, renderNodesToSVG, SceneGraph } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { renderNodesToSVG } from '@open-pencil/core/io/formats/svg'
import { importSVG } from '@open-pencil/core/tools'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined, getNodeOrThrow } from '#tests/helpers/assert'
diff --git a/tests/engine/io/svg/path-parse.test.ts b/tests/engine/io/svg/path-parse.test.ts
index 6ae296f20..ee4a22dbc 100644
--- a/tests/engine/io/svg/path-parse.test.ts
+++ b/tests/engine/io/svg/path-parse.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { parseSVGPath, vectorNetworkToSVGPaths } from '@open-pencil/core'
+import { vectorNetworkToSVGPaths } from '@open-pencil/core/io/formats/svg'
+import { parseSVGPath } from '@open-pencil/scene-graph/parse-path'
describe('parseSVGPath', () => {
test('simple rectangle M L L L Z', () => {
diff --git a/tests/engine/kiwi/serialize-fixes/auto-layout/transforms.test.ts b/tests/engine/kiwi/serialize-fixes/auto-layout/transforms.test.ts
index 906c5cc38..d2423ac65 100644
--- a/tests/engine/kiwi/serialize-fixes/auto-layout/transforms.test.ts
+++ b/tests/engine/kiwi/serialize-fixes/auto-layout/transforms.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph, sceneNodeToKiwi } from '@open-pencil/core'
+import { sceneNodeToKiwi } from '@open-pencil/fig/node-change'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined, getNodeOrThrow } from '#tests/helpers/assert'
diff --git a/tests/engine/kiwi/serialize-fixes/borders/take-space.test.ts b/tests/engine/kiwi/serialize-fixes/borders/take-space.test.ts
index 2cccc2a2b..2c3e76390 100644
--- a/tests/engine/kiwi/serialize-fixes/borders/take-space.test.ts
+++ b/tests/engine/kiwi/serialize-fixes/borders/take-space.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { pageId, toKiwi } from '../helpers'
diff --git a/tests/engine/kiwi/serialize-fixes/component-metadata.test.ts b/tests/engine/kiwi/serialize-fixes/component-metadata.test.ts
index bee1a4e30..9428607d0 100644
--- a/tests/engine/kiwi/serialize-fixes/component-metadata.test.ts
+++ b/tests/engine/kiwi/serialize-fixes/component-metadata.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { pageId, toKiwi } from './helpers'
diff --git a/tests/engine/kiwi/serialize-fixes/directionality.test.ts b/tests/engine/kiwi/serialize-fixes/directionality.test.ts
index 2f394dad1..7417facfb 100644
--- a/tests/engine/kiwi/serialize-fixes/directionality.test.ts
+++ b/tests/engine/kiwi/serialize-fixes/directionality.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { pageId } from './helpers'
diff --git a/tests/engine/kiwi/serialize-fixes/font/family.test.ts b/tests/engine/kiwi/serialize-fixes/font/family.test.ts
index 3ab65dfb3..7836b97f1 100644
--- a/tests/engine/kiwi/serialize-fixes/font/family.test.ts
+++ b/tests/engine/kiwi/serialize-fixes/font/family.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/kiwi/serialize-fixes/frame/mask.test.ts b/tests/engine/kiwi/serialize-fixes/frame/mask.test.ts
index 2d1f62302..7ab3df16b 100644
--- a/tests/engine/kiwi/serialize-fixes/frame/mask.test.ts
+++ b/tests/engine/kiwi/serialize-fixes/frame/mask.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/kiwi/serialize-fixes/helpers.ts b/tests/engine/kiwi/serialize-fixes/helpers.ts
index 59e47fb97..41c5f1b35 100644
--- a/tests/engine/kiwi/serialize-fixes/helpers.ts
+++ b/tests/engine/kiwi/serialize-fixes/helpers.ts
@@ -1,6 +1,8 @@
import { beforeAll } from 'bun:test'
-import { initCodec, sceneNodeToKiwi, type SceneGraph } from '@open-pencil/core'
+import { sceneNodeToKiwi } from '@open-pencil/fig/node-change'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import type { SceneGraph } from '@open-pencil/scene-graph'
beforeAll(async () => {
await initCodec()
diff --git a/tests/engine/kiwi/serialize-fixes/integration.test.ts b/tests/engine/kiwi/serialize-fixes/integration.test.ts
index 129c87ea3..7b9acfca6 100644
--- a/tests/engine/kiwi/serialize-fixes/integration.test.ts
+++ b/tests/engine/kiwi/serialize-fixes/integration.test.ts
@@ -1,6 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, parseFigFile, SceneGraph, sceneNodeToKiwi } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { sceneNodeToKiwi } from '@open-pencil/fig/node-change'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined, getNodeOrThrow } from '#tests/helpers/assert'
diff --git a/tests/engine/kiwi/serialize-fixes/line/height.test.ts b/tests/engine/kiwi/serialize-fixes/line/height.test.ts
index 020566c87..5a7968d2a 100644
--- a/tests/engine/kiwi/serialize-fixes/line/height.test.ts
+++ b/tests/engine/kiwi/serialize-fixes/line/height.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { exportFigFile, parseFigFile, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/layout/absolute-position/cache.test.ts b/tests/engine/layout/absolute-position/cache.test.ts
index 0932278fe..564257e1d 100644
--- a/tests/engine/layout/absolute-position/cache.test.ts
+++ b/tests/engine/layout/absolute-position/cache.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph } from '@open-pencil/core'
+import { SceneGraph } from '@open-pencil/scene-graph'
function pageId(graph: SceneGraph) {
return graph.getPages()[0].id
diff --git a/tests/engine/layout/auto-layout/absolute/children-in-yoga-tree.test.ts b/tests/engine/layout/auto-layout/absolute/children-in-yoga-tree.test.ts
index 736fd669e..d5bad662c 100644
--- a/tests/engine/layout/auto-layout/absolute/children-in-yoga-tree.test.ts
+++ b/tests/engine/layout/auto-layout/absolute/children-in-yoga-tree.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/absolute/positioning.test.ts b/tests/engine/layout/auto-layout/absolute/positioning.test.ts
index e5aa18cdb..ed7840116 100644
--- a/tests/engine/layout/auto-layout/absolute/positioning.test.ts
+++ b/tests/engine/layout/auto-layout/absolute/positioning.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/alignment/counter-axis.test.ts b/tests/engine/layout/auto-layout/alignment/counter-axis.test.ts
index 614625f15..002844833 100644
--- a/tests/engine/layout/auto-layout/alignment/counter-axis.test.ts
+++ b/tests/engine/layout/auto-layout/alignment/counter-axis.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/alignment/primary-axis.test.ts b/tests/engine/layout/auto-layout/alignment/primary-axis.test.ts
index 0efb5b42a..df2a2ad5c 100644
--- a/tests/engine/layout/auto-layout/alignment/primary-axis.test.ts
+++ b/tests/engine/layout/auto-layout/alignment/primary-axis.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/counter-axis/align-content.test.ts b/tests/engine/layout/auto-layout/counter-axis/align-content.test.ts
index 36fa7c4c4..0aa595133 100644
--- a/tests/engine/layout/auto-layout/counter-axis/align-content.test.ts
+++ b/tests/engine/layout/auto-layout/counter-axis/align-content.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/counter-axis/spacing-no-wrap.test.ts b/tests/engine/layout/auto-layout/counter-axis/spacing-no-wrap.test.ts
index 6fcf0d972..9e9a1c715 100644
--- a/tests/engine/layout/auto-layout/counter-axis/spacing-no-wrap.test.ts
+++ b/tests/engine/layout/auto-layout/counter-axis/spacing-no-wrap.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/edge-cases.test.ts b/tests/engine/layout/auto-layout/edge-cases.test.ts
index c13ae37a7..ac173297a 100644
--- a/tests/engine/layout/auto-layout/edge-cases.test.ts
+++ b/tests/engine/layout/auto-layout/edge-cases.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/fill/flex-basis.test.ts b/tests/engine/layout/auto-layout/fill/flex-basis.test.ts
index a109fdeb5..64cabdd39 100644
--- a/tests/engine/layout/auto-layout/fill/flex-basis.test.ts
+++ b/tests/engine/layout/auto-layout/fill/flex-basis.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/gap/mapping-correctness.test.ts b/tests/engine/layout/auto-layout/gap/mapping-correctness.test.ts
index 2be2b4b7f..839812d49 100644
--- a/tests/engine/layout/auto-layout/gap/mapping-correctness.test.ts
+++ b/tests/engine/layout/auto-layout/gap/mapping-correctness.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/hidden-children/basic.test.ts b/tests/engine/layout/auto-layout/hidden-children/basic.test.ts
index e7ccda833..2ed4d59b7 100644
--- a/tests/engine/layout/auto-layout/hidden-children/basic.test.ts
+++ b/tests/engine/layout/auto-layout/hidden-children/basic.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/hidden-children/preserve-dimensions.test.ts b/tests/engine/layout/auto-layout/hidden-children/preserve-dimensions.test.ts
index 45a3224d3..565c6bd10 100644
--- a/tests/engine/layout/auto-layout/hidden-children/preserve-dimensions.test.ts
+++ b/tests/engine/layout/auto-layout/hidden-children/preserve-dimensions.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/horizontal/basic.test.ts b/tests/engine/layout/auto-layout/horizontal/basic.test.ts
index 043cd7ef7..b506505dd 100644
--- a/tests/engine/layout/auto-layout/horizontal/basic.test.ts
+++ b/tests/engine/layout/auto-layout/horizontal/basic.test.ts
@@ -1,6 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { computeAllLayouts, computeLayout, createEditor, SceneGraph } from '@open-pencil/core'
+import { createEditor } from '@open-pencil/core'
+import { computeAllLayouts, computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/imported-derived-layout/effective-generated-text.test.ts b/tests/engine/layout/auto-layout/imported-derived-layout/effective-generated-text.test.ts
index 576f904c0..5281637c9 100644
--- a/tests/engine/layout/auto-layout/imported-derived-layout/effective-generated-text.test.ts
+++ b/tests/engine/layout/auto-layout/imported-derived-layout/effective-generated-text.test.ts
@@ -1,6 +1,7 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { computeAllLayouts, SceneGraph, setTextMeasurer } from '@open-pencil/core'
+import { computeAllLayouts, setTextMeasurer } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
function importedText(graph: SceneGraph, text: string, width: number, height: number, id: string) {
const page = graph.getPages()[0]
diff --git a/tests/engine/layout/auto-layout/layout-align-self/extended-values.test.ts b/tests/engine/layout/auto-layout/layout-align-self/extended-values.test.ts
index c34b99a5b..d7b85230c 100644
--- a/tests/engine/layout/auto-layout/layout-align-self/extended-values.test.ts
+++ b/tests/engine/layout/auto-layout/layout-align-self/extended-values.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/layout/imported-derived.test.ts b/tests/engine/layout/auto-layout/layout/imported-derived.test.ts
index c8a607bb3..b3b61bdc8 100644
--- a/tests/engine/layout/auto-layout/layout/imported-derived.test.ts
+++ b/tests/engine/layout/auto-layout/layout/imported-derived.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { computeAllLayouts, SceneGraph } from '@open-pencil/core'
-import { getAbsolutePositionFull } from '@open-pencil/scene-graph'
+import { computeAllLayouts } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { getAbsolutePositionFull } from '@open-pencil/scene-graph/coordinate'
describe('imported auto-layout bounds', () => {
test('preserves direct imported line geometry inside imported parents', () => {
diff --git a/tests/engine/layout/auto-layout/layout/mode-none.test.ts b/tests/engine/layout/auto-layout/layout/mode-none.test.ts
index 3a9fbccab..1820c12e4 100644
--- a/tests/engine/layout/auto-layout/layout/mode-none.test.ts
+++ b/tests/engine/layout/auto-layout/layout/mode-none.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
import { pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/min-max/constraints.test.ts b/tests/engine/layout/auto-layout/min-max/constraints.test.ts
index a00749c72..0b24fce62 100644
--- a/tests/engine/layout/auto-layout/min-max/constraints.test.ts
+++ b/tests/engine/layout/auto-layout/min-max/constraints.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/mixed/sizing.test.ts b/tests/engine/layout/auto-layout/mixed/sizing.test.ts
index 11972a2bb..0a197c26d 100644
--- a/tests/engine/layout/auto-layout/mixed/sizing.test.ts
+++ b/tests/engine/layout/auto-layout/mixed/sizing.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/nested/basic.test.ts b/tests/engine/layout/auto-layout/nested/basic.test.ts
index 0d2dc0cf3..80cf92a57 100644
--- a/tests/engine/layout/auto-layout/nested/basic.test.ts
+++ b/tests/engine/layout/auto-layout/nested/basic.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeAllLayouts, computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeAllLayouts, computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/nested/fill-children.test.ts b/tests/engine/layout/auto-layout/nested/fill-children.test.ts
index 5ef6ce45e..e3c6017c0 100644
--- a/tests/engine/layout/auto-layout/nested/fill-children.test.ts
+++ b/tests/engine/layout/auto-layout/nested/fill-children.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/self/alignment.test.ts b/tests/engine/layout/auto-layout/self/alignment.test.ts
index bccb2a11f..fceba8350 100644
--- a/tests/engine/layout/auto-layout/self/alignment.test.ts
+++ b/tests/engine/layout/auto-layout/self/alignment.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/sizing/modes.test.ts b/tests/engine/layout/auto-layout/sizing/modes.test.ts
index 91020e726..81b01503a 100644
--- a/tests/engine/layout/auto-layout/sizing/modes.test.ts
+++ b/tests/engine/layout/auto-layout/sizing/modes.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/text/measurement.test.ts b/tests/engine/layout/auto-layout/text/measurement.test.ts
index 6d80457ea..b41f0671c 100644
--- a/tests/engine/layout/auto-layout/text/measurement.test.ts
+++ b/tests/engine/layout/auto-layout/text/measurement.test.ts
@@ -1,7 +1,8 @@
import { expect, test } from 'bun:test'
-import { computeAllLayouts, SceneGraph, setTextMeasurer } from '@open-pencil/core'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
+import { computeAllLayouts, setTextMeasurer } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
import { autoFrame, loadFixtureGraph, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/vertical/basic.test.ts b/tests/engine/layout/auto-layout/vertical/basic.test.ts
index f612b536d..4c1b26431 100644
--- a/tests/engine/layout/auto-layout/vertical/basic.test.ts
+++ b/tests/engine/layout/auto-layout/vertical/basic.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeAllLayouts, computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeAllLayouts, computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/auto-layout/wrap/layout.test.ts b/tests/engine/layout/auto-layout/wrap/layout.test.ts
index 82831c70d..08e5c1052 100644
--- a/tests/engine/layout/auto-layout/wrap/layout.test.ts
+++ b/tests/engine/layout/auto-layout/wrap/layout.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, SceneGraph } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { autoFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/layout/grid-layout.test.ts b/tests/engine/layout/grid-layout.test.ts
index e4d4b59df..56b277cbb 100644
--- a/tests/engine/layout/grid-layout.test.ts
+++ b/tests/engine/layout/grid-layout.test.ts
@@ -1,6 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { computeLayout, computeAllLayouts, FigmaAPI, SceneGraph } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { computeLayout, computeAllLayouts } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
import { autoFrame, fixed, fr, gridFrame, pageId, rect } from '#tests/helpers/layout'
diff --git a/tests/engine/lint/basic.test.ts b/tests/engine/lint/basic.test.ts
index 40af52372..ba51dcbd2 100644
--- a/tests/engine/lint/basic.test.ts
+++ b/tests/engine/lint/basic.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph, createLinter } from '@open-pencil/core'
+import { createLinter } from '@open-pencil/core/lint'
+import { SceneGraph } from '@open-pencil/scene-graph'
describe('createLinter', () => {
test('reports default names and empty frames', () => {
diff --git a/tests/engine/lint/variable-binding-validation.test.ts b/tests/engine/lint/variable-binding-validation.test.ts
index bd530dde4..5666bfff0 100644
--- a/tests/engine/lint/variable-binding-validation.test.ts
+++ b/tests/engine/lint/variable-binding-validation.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph } from '@open-pencil/core'
import noHardcodedColors from '@open-pencil/core/lint/rules/no-hardcoded-colors'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { getNodeOrThrow } from '#tests/helpers/assert'
diff --git a/tests/engine/mcp/tools.test.ts b/tests/engine/mcp/tools.test.ts
index 55e541471..d18180037 100644
--- a/tests/engine/mcp/tools.test.ts
+++ b/tests/engine/mcp/tools.test.ts
@@ -1,6 +1,10 @@
import { describe, expect, test } from 'bun:test'
-import { ALL_TOOLS, FigmaAPI, SceneGraph, computeAllLayouts, parseFigFile } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { computeAllLayouts } from '@open-pencil/core/layout'
+import { ALL_TOOLS } from '@open-pencil/core/tools'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined, expectFills } from '#tests/helpers/assert'
diff --git a/tests/engine/pen/file.test.ts b/tests/engine/pen/file.test.ts
index b9c4a1a77..8726f0d0e 100644
--- a/tests/engine/pen/file.test.ts
+++ b/tests/engine/pen/file.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { parsePenFile } from '@open-pencil/core'
+import { parsePenFile } from '@open-pencil/pen'
import { repoPath } from '#tests/helpers/paths'
diff --git a/tests/engine/pen/var-padding.test.ts b/tests/engine/pen/var-padding.test.ts
index e1b6e7f0f..b65867820 100644
--- a/tests/engine/pen/var-padding.test.ts
+++ b/tests/engine/pen/var-padding.test.ts
@@ -1,8 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import type { SceneNode } from '@open-pencil/core'
import { applyPadding, isVarRef, type VarContext } from '@open-pencil/pen'
-import type { Variable } from '@open-pencil/scene-graph'
+import type { SceneNode, Variable } from '@open-pencil/scene-graph'
/**
* Regression test for open-pencil/open-pencil#201
diff --git a/tests/engine/perf.bench.ts b/tests/engine/perf.bench.ts
index 983d4c4b3..11dcc547d 100644
--- a/tests/engine/perf.bench.ts
+++ b/tests/engine/perf.bench.ts
@@ -3,7 +3,9 @@ import { resolve } from 'node:path'
import { bench, group, run } from 'mitata'
-import { parseFigFile, exportFigFile, initCodec, SceneGraph } from '@open-pencil/core'
+import { parseFigFile, exportFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { copyFills } from '@open-pencil/scene-graph/copy'
const FIXTURES = resolve(import.meta.dir, '../fixtures')
diff --git a/tests/engine/profiler/capture-stack.test.ts b/tests/engine/profiler/capture-stack.test.ts
index 36091cbe6..df9d5e38e 100644
--- a/tests/engine/profiler/capture-stack.test.ts
+++ b/tests/engine/profiler/capture-stack.test.ts
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'bun:test'
-import { CaptureStack } from '@open-pencil/core'
+import { CaptureStack } from '@open-pencil/core/profiler'
describe('CaptureStack', () => {
it('builds a tree of node profiles', () => {
diff --git a/tests/engine/profiler/draw-call-counter.test.ts b/tests/engine/profiler/draw-call-counter.test.ts
index 1bbe80eb1..b65a0cacf 100644
--- a/tests/engine/profiler/draw-call-counter.test.ts
+++ b/tests/engine/profiler/draw-call-counter.test.ts
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'bun:test'
-import { DrawCallCounter } from '@open-pencil/core'
+import { DrawCallCounter } from '@open-pencil/core/profiler'
import { asDouble } from '#tests/helpers/doubles'
diff --git a/tests/engine/profiler/frame-stats.test.ts b/tests/engine/profiler/frame-stats.test.ts
index c62b7b52e..4b2556b9c 100644
--- a/tests/engine/profiler/frame-stats.test.ts
+++ b/tests/engine/profiler/frame-stats.test.ts
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'bun:test'
-import { FrameStats } from '@open-pencil/core'
+import { FrameStats } from '@open-pencil/core/profiler'
describe('FrameStats', () => {
it('records frames and computes rolling averages', () => {
diff --git a/tests/engine/profiler/gpu-timer.test.ts b/tests/engine/profiler/gpu-timer.test.ts
index d67eadbbe..9a0fab930 100644
--- a/tests/engine/profiler/gpu-timer.test.ts
+++ b/tests/engine/profiler/gpu-timer.test.ts
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'bun:test'
-import { GPUTimer } from '@open-pencil/core'
+import { GPUTimer } from '@open-pencil/core/profiler'
describe('GPUTimer', () => {
it('handles null GL context', () => {
diff --git a/tests/engine/profiler/phase-timer.test.ts b/tests/engine/profiler/phase-timer.test.ts
index 876b2869e..ca9aadea9 100644
--- a/tests/engine/profiler/phase-timer.test.ts
+++ b/tests/engine/profiler/phase-timer.test.ts
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'bun:test'
-import { PhaseTimer } from '@open-pencil/core'
+import { PhaseTimer } from '@open-pencil/core/profiler'
describe('PhaseTimer', () => {
it('is disabled by default', () => {
diff --git a/tests/engine/profiler/speedscope.test.ts b/tests/engine/profiler/speedscope.test.ts
index 107d28d9e..19b31481b 100644
--- a/tests/engine/profiler/speedscope.test.ts
+++ b/tests/engine/profiler/speedscope.test.ts
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'bun:test'
-import { toSpeedscopeJSON, type FrameCapture } from '@open-pencil/core'
+import { toSpeedscopeJSON, type FrameCapture } from '@open-pencil/core/profiler'
describe('toSpeedscopeJSON', () => {
it('produces valid speedscope JSON', () => {
diff --git a/tests/engine/render/canvas/boolean.test.ts b/tests/engine/render/canvas/boolean.test.ts
index a1e21715b..fdeab3a04 100644
--- a/tests/engine/render/canvas/boolean.test.ts
+++ b/tests/engine/render/canvas/boolean.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createDefaultNode } from '@open-pencil/scene-graph'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
import { initCanvasKit } from '#cli/headless'
import { makeBooleanOperationPath } from '#core/canvas/boolean'
diff --git a/tests/engine/render/canvas/cache.test.ts b/tests/engine/render/canvas/cache.test.ts
index fdc30b311..24d50b08c 100644
--- a/tests/engine/render/canvas/cache.test.ts
+++ b/tests/engine/render/canvas/cache.test.ts
@@ -1,15 +1,12 @@
import { beforeAll, expect, setDefaultTimeout, test } from 'bun:test'
import { readFileSync } from 'node:fs'
-import {
- computeAllLayouts,
- initCodec,
- parseFigFile,
- renderNodesToImage,
- SkiaRenderer,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/core'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { renderNodesToImage } from '@open-pencil/core/io/formats/raster'
+import { computeAllLayouts } from '@open-pencil/core/layout'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import { initCanvasKit } from '#cli/headless'
diff --git a/tests/engine/render/canvas/effects/edge-cases.test.ts b/tests/engine/render/canvas/effects/edge-cases.test.ts
index 23c3d9820..435c9f0c1 100644
--- a/tests/engine/render/canvas/effects/edge-cases.test.ts
+++ b/tests/engine/render/canvas/effects/edge-cases.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, mock, test } from 'bun:test'
-import { createDefaultNode } from '@open-pencil/scene-graph'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
import { renderEffects } from '#core/canvas/shadows'
diff --git a/tests/engine/render/canvas/font-readiness.test.ts b/tests/engine/render/canvas/font-readiness.test.ts
index 9481a28fb..7ddcae0eb 100644
--- a/tests/engine/render/canvas/font-readiness.test.ts
+++ b/tests/engine/render/canvas/font-readiness.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createDefaultNode } from '@open-pencil/scene-graph'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
import { isNodeFontLoaded } from '#core/canvas/text'
import { fontManager } from '#core/text/fonts'
diff --git a/tests/engine/render/canvas/guides/draw.test.ts b/tests/engine/render/canvas/guides/draw.test.ts
index 38eaf635b..6f409057a 100644
--- a/tests/engine/render/canvas/guides/draw.test.ts
+++ b/tests/engine/render/canvas/guides/draw.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, mock, test } from 'bun:test'
-import { createDefaultNode, SceneGraph } from '@open-pencil/scene-graph'
-import type { SceneNode } from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
import { drawGuides } from '#core/canvas/guides/draw'
diff --git a/tests/engine/render/canvas/guides/geometry.test.ts b/tests/engine/render/canvas/guides/geometry.test.ts
index 93135bbe2..50382c07d 100644
--- a/tests/engine/render/canvas/guides/geometry.test.ts
+++ b/tests/engine/render/canvas/guides/geometry.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { createDefaultNode, SceneGraph } from '@open-pencil/scene-graph'
-import type { SceneNode } from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
import { distanceToGuideSegment, getGuideScreenSegment } from '#core/canvas/guides/geometry'
import { hitTestGuides } from '#core/canvas/guides/hit-test'
diff --git a/tests/engine/render/canvas/label-cache.test.ts b/tests/engine/render/canvas/label-cache.test.ts
index 5665916eb..2d06582de 100644
--- a/tests/engine/render/canvas/label-cache.test.ts
+++ b/tests/engine/render/canvas/label-cache.test.ts
@@ -1,6 +1,7 @@
import { describe, it, expect } from 'bun:test'
-import { SceneGraph, LabelCache } from '@open-pencil/core'
+import { LabelCache } from '@open-pencil/core/canvas'
+import { SceneGraph } from '@open-pencil/scene-graph'
function buildGraph() {
const g = new SceneGraph()
diff --git a/tests/engine/render/canvas/layout-grids.test.ts b/tests/engine/render/canvas/layout-grids.test.ts
index 39193a09a..19197d291 100644
--- a/tests/engine/render/canvas/layout-grids.test.ts
+++ b/tests/engine/render/canvas/layout-grids.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { createDefaultNode } from '@open-pencil/scene-graph'
import type { SceneNode } from '@open-pencil/scene-graph'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
import { drawLayoutGrids } from '#core/canvas/layout-grids'
diff --git a/tests/engine/render/canvas/line.test.ts b/tests/engine/render/canvas/line.test.ts
index 7cd51ea24..beaf85d4b 100644
--- a/tests/engine/render/canvas/line.test.ts
+++ b/tests/engine/render/canvas/line.test.ts
@@ -1,6 +1,8 @@
import { beforeAll, describe, expect, test } from 'bun:test'
-import { renderNodesToImage, SceneGraph, SkiaRenderer } from '@open-pencil/core'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { renderNodesToImage } from '@open-pencil/core/io/formats/raster'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { initCanvasKit } from '#cli/headless'
diff --git a/tests/engine/render/canvas/raster-export.test.ts b/tests/engine/render/canvas/raster-export.test.ts
index 89a1b82e1..47cca6a3d 100644
--- a/tests/engine/render/canvas/raster-export.test.ts
+++ b/tests/engine/render/canvas/raster-export.test.ts
@@ -2,8 +2,10 @@ import { beforeAll, describe, expect, test } from 'bun:test'
import type { Canvas } from 'canvaskit-wasm'
-import { renderNodesToImage, SceneGraph, SkiaRenderer } from '@open-pencil/core'
-import { getWorldMatrix } from '@open-pencil/scene-graph'
+import { SkiaRenderer } from '@open-pencil/core/canvas'
+import { renderNodesToImage } from '@open-pencil/core/io/formats/raster'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
import { initCanvasKit } from '#cli/headless'
import { NodePathCaches } from '#core/canvas/paths/cache'
diff --git a/tests/engine/render/canvas/retained-backing.test.ts b/tests/engine/render/canvas/retained-backing.test.ts
index ef15a304a..9745c97e1 100644
--- a/tests/engine/render/canvas/retained-backing.test.ts
+++ b/tests/engine/render/canvas/retained-backing.test.ts
@@ -2,7 +2,8 @@ import { expect, mock, spyOn, test } from 'bun:test'
import type { Canvas, Image as CKImage, ImageInfo, Paint, Surface } from 'canvaskit-wasm'
-import { getAbsolutePositionFull, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { getAbsolutePositionFull } from '@open-pencil/scene-graph/coordinate'
import type { SkiaRenderer } from '#core/canvas/renderer'
import {
diff --git a/tests/engine/render/canvas/text/render.test.ts b/tests/engine/render/canvas/text/render.test.ts
index 5a0c504b9..3340626eb 100644
--- a/tests/engine/render/canvas/text/render.test.ts
+++ b/tests/engine/render/canvas/text/render.test.ts
@@ -2,14 +2,10 @@
import { describe, test, expect, mock, spyOn } from 'bun:test'
-import {
- detectTextDirection,
- resolveTextDirection,
- SceneGraph,
- SkiaRenderer as SkiaRendererClass
-} from '@open-pencil/core'
-import type { SceneNode } from '@open-pencil/scene-graph'
+import { SkiaRenderer as SkiaRendererClass } from '@open-pencil/core/canvas'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
+import { detectTextDirection, resolveTextDirection } from '@open-pencil/scene-graph/text/direction'
import { initCanvasKit } from '#cli/headless'
import type { SkiaRenderer } from '#core/canvas/renderer'
diff --git a/tests/engine/render/jsx/gaps.test.ts b/tests/engine/render/jsx/gaps.test.ts
index c70659924..e7fd089d6 100644
--- a/tests/engine/render/jsx/gaps.test.ts
+++ b/tests/engine/render/jsx/gaps.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'bun:test'
-import { renderJSX } from '@open-pencil/core'
+import { renderJSX } from '@open-pencil/core/design-jsx'
import { makeSceneGraph } from '#tests/helpers/scene'
diff --git a/tests/engine/render/jsx/grid-layout.test.ts b/tests/engine/render/jsx/grid-layout.test.ts
index 9ad8e5069..69fa36522 100644
--- a/tests/engine/render/jsx/grid-layout.test.ts
+++ b/tests/engine/render/jsx/grid-layout.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, it } from 'bun:test'
-import { renderTree, renderJSX, computeLayout, computeAllLayouts } from '@open-pencil/core'
+import { renderTree, renderJSX } from '@open-pencil/core/design-jsx'
+import { computeLayout, computeAllLayouts } from '@open-pencil/core/layout'
import { Frame, Rectangle } from '@open-pencil/design-jsx'
import { expectDefined, getNodeOrThrow } from '#tests/helpers/assert'
diff --git a/tests/engine/render/jsx/reference.test.ts b/tests/engine/render/jsx/reference.test.ts
index 32b08887c..c6612f58f 100644
--- a/tests/engine/render/jsx/reference.test.ts
+++ b/tests/engine/render/jsx/reference.test.ts
@@ -1,8 +1,7 @@
import { expect, test } from 'bun:test'
-import { CODEGEN_PROMPT as BARREL_CODEGEN } from '@open-pencil/core'
import { renderJSX } from '@open-pencil/core/design-jsx'
-import { CODEGEN_PROMPT } from '@open-pencil/core/tools'
+import { CODEGEN_PROMPT as BARREL_CODEGEN, CODEGEN_PROMPT } from '@open-pencil/core/tools'
import { AUTHORING_EXAMPLES, JSX_REFERENCE } from '@open-pencil/design-jsx'
import SYSTEM_PROMPT from '@/app/ai/chat/system-prompt'
diff --git a/tests/engine/render/jsx/render-tree.test.ts b/tests/engine/render/jsx/render-tree.test.ts
index ad78f51bd..2bdf011cc 100644
--- a/tests/engine/render/jsx/render-tree.test.ts
+++ b/tests/engine/render/jsx/render-tree.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'bun:test'
-import { renderTree, renderJSX } from '@open-pencil/core'
+import { renderTree, renderJSX } from '@open-pencil/core/design-jsx'
import {
Frame,
Text,
diff --git a/tests/engine/render/jsx/text-props.test.ts b/tests/engine/render/jsx/text-props.test.ts
index 3a44b623f..7118f3221 100644
--- a/tests/engine/render/jsx/text-props.test.ts
+++ b/tests/engine/render/jsx/text-props.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'bun:test'
-import { renderJSX } from '@open-pencil/core'
+import { renderJSX } from '@open-pencil/core/design-jsx'
import { sceneNodeToJSX } from '@open-pencil/design-jsx'
import { getNodeOrThrow, childIdAt } from '#tests/helpers/assert'
diff --git a/tests/engine/snap/basic.test.ts b/tests/engine/snap/basic.test.ts
index 691e9fce7..93a544ac7 100644
--- a/tests/engine/snap/basic.test.ts
+++ b/tests/engine/snap/basic.test.ts
@@ -1,6 +1,7 @@
import { describe, test, expect } from 'bun:test'
-import { computeSnap, computeSelectionBounds, type SceneNode } from '@open-pencil/core'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { computeSnap, computeSelectionBounds } from '@open-pencil/scene-graph/snap'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/text/coverage.test.ts b/tests/engine/text/coverage.test.ts
index 25746be85..bd664e6a2 100644
--- a/tests/engine/text/coverage.test.ts
+++ b/tests/engine/text/coverage.test.ts
@@ -1,11 +1,11 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph } from '@open-pencil/core'
import {
collectGraphFontRequirements,
fontManager,
textNeededFallbackScripts
} from '@open-pencil/core/text'
+import { SceneGraph } from '@open-pencil/scene-graph'
function pageId(graph: SceneGraph): string {
return graph.getPages()[0].id
diff --git a/tests/engine/text/edit-undo.test.ts b/tests/engine/text/edit-undo.test.ts
index e76a3c337..3e8f25f47 100644
--- a/tests/engine/text/edit-undo.test.ts
+++ b/tests/engine/text/edit-undo.test.ts
@@ -2,13 +2,12 @@ import { describe, test, expect } from 'bun:test'
import type { CanvasKit } from 'canvaskit-wasm'
-import { SceneGraph, TextEditor, UndoManager } from '@open-pencil/core'
-import type { StyleRun } from '@open-pencil/core'
-import { createTextActions } from '@open-pencil/core/editor'
-import type { EditorContext, EditorState } from '@open-pencil/core/editor'
+import { createTextActions, type EditorContext, type EditorState } from '@open-pencil/core'
import { iconify } from '@open-pencil/core/icons'
-import { getInstanceOverride } from '@open-pencil/scene-graph'
-import type { DerivedTextGlyph } from '@open-pencil/scene-graph'
+import { TextEditor } from '@open-pencil/core/text'
+import { SceneGraph, type StyleRun, type DerivedTextGlyph } from '@open-pencil/scene-graph'
+import { getInstanceOverride } from '@open-pencil/scene-graph/instances/overrides'
+import { UndoManager } from '@open-pencil/scene-graph/undo'
import { fontManager } from '#core/text/fonts'
diff --git a/tests/engine/text/editor.test.ts b/tests/engine/text/editor.test.ts
index 0c5ff5906..5db145583 100644
--- a/tests/engine/text/editor.test.ts
+++ b/tests/engine/text/editor.test.ts
@@ -2,7 +2,8 @@ import { describe, test, expect } from 'bun:test'
import type { CanvasKit, LineMetrics, Paragraph, RectWithDirection } from 'canvaskit-wasm'
-import { TextEditor, type SceneNode } from '@open-pencil/core'
+import { TextEditor } from '@open-pencil/core/text'
+import type { SceneNode } from '@open-pencil/scene-graph'
import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
import { TextLayout } from '#core/canvas/text/layout'
diff --git a/tests/engine/text/fonts/fallbacks.test.ts b/tests/engine/text/fonts/fallbacks.test.ts
index af8a07ffa..2f097a9c1 100644
--- a/tests/engine/text/fonts/fallbacks.test.ts
+++ b/tests/engine/text/fonts/fallbacks.test.ts
@@ -4,7 +4,7 @@ import {
cjkLocalFallbackFamilies,
fontFallbackEntry,
fontFallbackManifest
-} from '@open-pencil/core'
+} from '@open-pencil/core/text'
describe('font fallback manifest', () => {
test('selects platform CJK local candidates', () => {
diff --git a/tests/engine/text/fonts/loading.test.ts b/tests/engine/text/fonts/loading.test.ts
index d2300070b..7276a2328 100644
--- a/tests/engine/text/fonts/loading.test.ts
+++ b/tests/engine/text/fonts/loading.test.ts
@@ -9,14 +9,16 @@ import {
fontWeightMatchOrder,
fontManager,
isVariableFont,
+ FontManager
+} from '@open-pencil/core/text'
+import { weightToFigmaStyle } from '@open-pencil/fig/node-change'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import {
normalizeFontFamily,
styleToVariant,
styleToWeight,
- weightToFigmaStyle,
- weightToStyle,
- FontManager,
- SceneGraph
-} from '@open-pencil/core'
+ weightToStyle
+} from '@open-pencil/scene-graph/font-style'
import { expectDefined } from '#tests/helpers/assert'
import { fetchStub } from '#tests/helpers/fetch'
diff --git a/tests/engine/text/fonts/normalize-export.test.ts b/tests/engine/text/fonts/normalize-export.test.ts
index 1a4491d05..2492da34e 100644
--- a/tests/engine/text/fonts/normalize-export.test.ts
+++ b/tests/engine/text/fonts/normalize-export.test.ts
@@ -1,6 +1,8 @@
import { describe, test, expect, beforeAll } from 'bun:test'
-import { exportFigFile, parseFigFile, initCodec, SceneGraph } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined, getNodeOrThrow } from '#tests/helpers/assert'
diff --git a/tests/engine/text/fonts/status.test.ts b/tests/engine/text/fonts/status.test.ts
index a8ae03667..e5c03d17c 100644
--- a/tests/engine/text/fonts/status.test.ts
+++ b/tests/engine/text/fonts/status.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { FontManager, SceneGraph, documentFontStatus } from '@open-pencil/core'
-import { UnsupportedFontFormatError } from '@open-pencil/core/text'
+import { FontManager, documentFontStatus, UnsupportedFontFormatError } from '@open-pencil/core/text'
+import { SceneGraph } from '@open-pencil/scene-graph'
function pageId(graph: SceneGraph): string {
return graph.getPages()[0].id
diff --git a/tests/engine/text/fonts/variations.test.ts b/tests/engine/text/fonts/variations.test.ts
index 62ddef82e..0e80f9ba3 100644
--- a/tests/engine/text/fonts/variations.test.ts
+++ b/tests/engine/text/fonts/variations.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { FontManager } from '@open-pencil/core'
+import { FontManager } from '@open-pencil/core/text'
import { isVariableFont, namedInstanceVariations } from '#core/text/font/variation'
diff --git a/tests/engine/text/opentype/outlines.test.ts b/tests/engine/text/opentype/outlines.test.ts
index 25faa457a..03a186f29 100644
--- a/tests/engine/text/opentype/outlines.test.ts
+++ b/tests/engine/text/opentype/outlines.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { fontManager, probeGlyphOutlineCommands } from '@open-pencil/core'
+import { fontManager, probeGlyphOutlineCommands } from '@open-pencil/core/text'
describe('clipboard text outline probe', () => {
test('lazy-loads opentype.js and extracts glyph commands from a loaded font', async () => {
diff --git a/tests/engine/text/rtl-auto-layout-input.test.ts b/tests/engine/text/rtl-auto-layout-input.test.ts
index 66ac5e322..9ca89d97c 100644
--- a/tests/engine/text/rtl-auto-layout-input.test.ts
+++ b/tests/engine/text/rtl-auto-layout-input.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph, computeLayout } from '@open-pencil/core'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
+import { computeLayout } from '@open-pencil/core/layout'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { computeAutoLayoutIndicatorForFrame } from '#vue/shared/input/auto-layout'
import { handleMoveUp } from '#vue/shared/input/move/drag'
diff --git a/tests/engine/text/style-runs.test.ts b/tests/engine/text/style-runs.test.ts
index 71df0c85f..4bbf49825 100644
--- a/tests/engine/text/style-runs.test.ts
+++ b/tests/engine/text/style-runs.test.ts
@@ -9,9 +9,9 @@ import {
selectionHasStyle,
toggleBoldInRange,
toggleDecorationInRange,
- toggleItalicInRange,
- type StyleRun
-} from '@open-pencil/core'
+ toggleItalicInRange
+} from '@open-pencil/core/text'
+import type { StyleRun } from '@open-pencil/scene-graph'
describe('getStyleAt', () => {
test('returns style within run', () => {
diff --git a/tests/engine/text/style-runs/mutation.test.ts b/tests/engine/text/style-runs/mutation.test.ts
index 5efc0ae94..a34024336 100644
--- a/tests/engine/text/style-runs/mutation.test.ts
+++ b/tests/engine/text/style-runs/mutation.test.ts
@@ -5,9 +5,9 @@ import {
getStyleAt,
removeStyleFromRange,
toggleBoldInRange,
- toggleItalicInRange,
- type StyleRun
-} from '@open-pencil/core'
+ toggleItalicInRange
+} from '@open-pencil/core/text'
+import type { StyleRun } from '@open-pencil/scene-graph'
// ---------------------------------------------------------------------------
// toggleBoldInRange — mutation coverage
diff --git a/tests/engine/tools/ai-adapter.test.ts b/tests/engine/tools/ai-adapter.test.ts
index 012526541..929c51908 100644
--- a/tests/engine/tools/ai-adapter.test.ts
+++ b/tests/engine/tools/ai-adapter.test.ts
@@ -2,7 +2,9 @@ import { describe, expect, test } from 'bun:test'
import { tool } from 'ai'
-import { ALL_TOOLS, FigmaAPI, SceneGraph, toolsToAI } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { ALL_TOOLS, toolsToAI } from '@open-pencil/core/tools'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined, expectFills } from '#tests/helpers/assert'
diff --git a/tests/engine/tools/analyze/overlaps/bounds.test.ts b/tests/engine/tools/analyze/overlaps/bounds.test.ts
index 6642a442c..4e1a67336 100644
--- a/tests/engine/tools/analyze/overlaps/bounds.test.ts
+++ b/tests/engine/tools/analyze/overlaps/bounds.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { SceneGraph } from '@open-pencil/core'
import { computeOverlaps } from '@open-pencil/core/tools/analyze/overlaps'
+import { SceneGraph } from '@open-pencil/scene-graph'
import type { Rect } from '@open-pencil/scene-graph/primitives'
import { frame, pageId, rect } from './helpers'
diff --git a/tests/engine/tools/analyze/overlaps/helpers.ts b/tests/engine/tools/analyze/overlaps/helpers.ts
index 5d2002469..df36c1e5b 100644
--- a/tests/engine/tools/analyze/overlaps/helpers.ts
+++ b/tests/engine/tools/analyze/overlaps/helpers.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph } from '@open-pencil/core'
+import type { SceneGraph } from '@open-pencil/scene-graph'
export function pageId(graph: SceneGraph) {
return graph.getPages()[0].id
diff --git a/tests/engine/tools/analyze/overlaps/index.test.ts b/tests/engine/tools/analyze/overlaps/index.test.ts
index 9142f0f1a..a7072e8de 100644
--- a/tests/engine/tools/analyze/overlaps/index.test.ts
+++ b/tests/engine/tools/analyze/overlaps/index.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { FigmaAPI, SceneGraph } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
import {
analyzeOverlaps,
computeOverlaps,
@@ -8,6 +8,7 @@ import {
type OverlapScope,
type OverlapSeverity
} from '@open-pencil/core/tools/analyze/overlaps'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { frame, pageId, rect, text } from './helpers'
diff --git a/tests/engine/tools/analyze/overlaps/page-scope.test.ts b/tests/engine/tools/analyze/overlaps/page-scope.test.ts
index 560e025ad..af9533c51 100644
--- a/tests/engine/tools/analyze/overlaps/page-scope.test.ts
+++ b/tests/engine/tools/analyze/overlaps/page-scope.test.ts
@@ -1,12 +1,13 @@
import { describe, expect, test } from 'bun:test'
-import { FigmaAPI, SceneGraph } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
import {
analyzeOverlaps,
computeOverlaps,
findPageId,
type AnalyzeOverlapsResult
} from '@open-pencil/core/tools/analyze/overlaps'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { pageId, rect } from './helpers'
diff --git a/tests/engine/tools/describe.test.ts b/tests/engine/tools/describe.test.ts
index 6345c3edc..5f7998207 100644
--- a/tests/engine/tools/describe.test.ts
+++ b/tests/engine/tools/describe.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import type { Color, Fill, SceneNode, Stroke } from '@open-pencil/scene-graph'
+import type { Fill, SceneNode, Stroke } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import { expectDefined } from '#tests/helpers/assert'
import { getTool, setupToolTest, type ToolResult } from '#tests/helpers/tools'
diff --git a/tests/engine/tools/modify.test.ts b/tests/engine/tools/modify.test.ts
index dd9728f2e..40d3ddb4f 100644
--- a/tests/engine/tools/modify.test.ts
+++ b/tests/engine/tools/modify.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { computeAllLayouts } from '@open-pencil/core'
+import { computeAllLayouts } from '@open-pencil/core/layout'
import { expectDefined, expectFills, getNodeOrThrow } from '#tests/helpers/assert'
import { getTool, setupToolTest, type ToolResult } from '#tests/helpers/tools'
diff --git a/tests/engine/tools/modify/image-fill.test.ts b/tests/engine/tools/modify/image-fill.test.ts
index 57b136a4e..e4d52b2f9 100644
--- a/tests/engine/tools/modify/image-fill.test.ts
+++ b/tests/engine/tools/modify/image-fill.test.ts
@@ -1,6 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { ALL_TOOLS, FigmaAPI, SceneGraph } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { ALL_TOOLS } from '@open-pencil/core/tools'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined, expectFills } from '#tests/helpers/assert'
diff --git a/tests/engine/tools/read.test.ts b/tests/engine/tools/read.test.ts
index 2d03ed727..4b6c1cd42 100644
--- a/tests/engine/tools/read.test.ts
+++ b/tests/engine/tools/read.test.ts
@@ -1,6 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { DEFAULT_FONT_FAMILY, FigmaAPI, fontManager } from '@open-pencil/core'
+import { DEFAULT_FONT_FAMILY } from '@open-pencil/core/constants'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { fontManager } from '@open-pencil/core/text'
import { expectDefined } from '#tests/helpers/assert'
import { getTool, setupToolTest, type ALL_TOOLS, type ToolResult } from '#tests/helpers/tools'
diff --git a/tests/engine/tools/stock-photo/apply.test.ts b/tests/engine/tools/stock-photo/apply.test.ts
index e4e3708ff..c07855416 100644
--- a/tests/engine/tools/stock-photo/apply.test.ts
+++ b/tests/engine/tools/stock-photo/apply.test.ts
@@ -1,7 +1,7 @@
import { describe, expect, test } from 'bun:test'
-import { FigmaAPI, SceneGraph } from '@open-pencil/core'
-import type { NodeType } from '@open-pencil/scene-graph'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { SceneGraph, type NodeType } from '@open-pencil/scene-graph'
import { copyFills } from '@open-pencil/scene-graph/copy'
import { applyPhoto } from '#core/tools/stock-photo/apply'
diff --git a/tests/engine/tools/xpath/basic.test.ts b/tests/engine/tools/xpath/basic.test.ts
index 84df5461b..af63ccd14 100644
--- a/tests/engine/tools/xpath/basic.test.ts
+++ b/tests/engine/tools/xpath/basic.test.ts
@@ -1,6 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { FigmaAPI, SceneGraph, matchByXPath, nodeToXPath, queryByXPath } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { matchByXPath, nodeToXPath, queryByXPath } from '@open-pencil/core/xpath'
+import { SceneGraph } from '@open-pencil/scene-graph'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/vector/blob/mutation.test.ts b/tests/engine/vector/blob/mutation.test.ts
index f9e78c69c..64682eb1d 100644
--- a/tests/engine/vector/blob/mutation.test.ts
+++ b/tests/engine/vector/blob/mutation.test.ts
@@ -1,10 +1,7 @@
import { describe, test, expect } from 'bun:test'
-import {
- decodeVectorNetworkBlob,
- encodeVectorNetworkBlob,
- type VectorNetwork
-} from '@open-pencil/core'
+import { decodeVectorNetworkBlob, encodeVectorNetworkBlob } from '@open-pencil/fig/node-change'
+import type { VectorNetwork } from '@open-pencil/scene-graph'
// ---------------------------------------------------------------------------
// vectorNetworkBlob — precision and handleMirroring round-trip
diff --git a/tests/engine/vector/blob/roundtrip.test.ts b/tests/engine/vector/blob/roundtrip.test.ts
index 5d9ed7f87..1bb615ac9 100644
--- a/tests/engine/vector/blob/roundtrip.test.ts
+++ b/tests/engine/vector/blob/roundtrip.test.ts
@@ -4,9 +4,9 @@ import {
buildStyleOverrideTable,
encodeVectorNetworkBlob,
decodeVectorNetworkBlob,
- type VectorNetwork
-} from '@open-pencil/core'
-import { textPathStartSegment } from '@open-pencil/fig/node-change'
+ textPathStartSegment
+} from '@open-pencil/fig/node-change'
+import type { VectorNetwork } from '@open-pencil/scene-graph'
import {
lineNetwork,
diff --git a/tests/engine/vector/bounds.test.ts b/tests/engine/vector/bounds.test.ts
index d97aa599a..58f8e7060 100644
--- a/tests/engine/vector/bounds.test.ts
+++ b/tests/engine/vector/bounds.test.ts
@@ -1,6 +1,6 @@
import { describe, test, expect } from 'bun:test'
-import { computeAccurateBounds } from '@open-pencil/core'
+import { computeAccurateBounds } from '@open-pencil/core/vector'
describe('computeAccurateBounds', () => {
test('empty network', () => {
diff --git a/tests/engine/vector/centerline.test.ts b/tests/engine/vector/centerline.test.ts
index 6266b5095..8145418b1 100644
--- a/tests/engine/vector/centerline.test.ts
+++ b/tests/engine/vector/centerline.test.ts
@@ -1,7 +1,8 @@
import { describe, test, expect } from 'bun:test'
import { fitCircleArc, isClosedThinCrescent } from '@open-pencil/core/vector'
-import type { Vector, VectorNetwork } from '@open-pencil/scene-graph'
+import type { VectorNetwork } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
import { expectDefined } from '#tests/helpers/assert'
diff --git a/tests/engine/vector/normalize.test.ts b/tests/engine/vector/normalize.test.ts
index ee06b5035..5278e931a 100644
--- a/tests/engine/vector/normalize.test.ts
+++ b/tests/engine/vector/normalize.test.ts
@@ -1,12 +1,8 @@
import { describe, test, expect } from 'bun:test'
-import {
- decodeVectorNetworkBlob,
- encodeVectorNetworkBlob,
- normalizeVectorNetwork,
- type VectorNetwork,
- type VectorSegment
-} from '@open-pencil/core'
+import { decodeVectorNetworkBlob, encodeVectorNetworkBlob } from '@open-pencil/fig/node-change'
+import type { VectorNetwork, VectorSegment } from '@open-pencil/scene-graph'
+import { normalizeVectorNetwork } from '@open-pencil/scene-graph/vector-network'
describe('normalizeVectorNetwork', () => {
test('passes through segments that already have tangents', () => {
diff --git a/tests/engine/vector/validate.test.ts b/tests/engine/vector/validate.test.ts
index f1708988f..ad08e8d36 100644
--- a/tests/engine/vector/validate.test.ts
+++ b/tests/engine/vector/validate.test.ts
@@ -1,11 +1,10 @@
import { describe, test, expect } from 'bun:test'
+import type { VectorNetwork, VectorSegment } from '@open-pencil/scene-graph'
import {
normalizeVectorNetwork,
- validateVectorNetwork,
- type VectorNetwork,
- type VectorSegment
-} from '@open-pencil/core'
+ validateVectorNetwork
+} from '@open-pencil/scene-graph/vector-network'
describe('validateVectorNetwork', () => {
test('valid network returns no errors', () => {
diff --git a/tests/engine/vue/canvas/render-loop.test.ts b/tests/engine/vue/canvas/render-loop.test.ts
index 762e692a9..015e12f75 100644
--- a/tests/engine/vue/canvas/render-loop.test.ts
+++ b/tests/engine/vue/canvas/render-loop.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import type { Editor, EditorEvents } from '@open-pencil/core/editor'
+import type { Editor, EditorEvents } from '@open-pencil/core'
import { createCanvasRenderLoop } from '#vue/canvas/surface/render-loop'
diff --git a/tests/engine/vue/controls/appearance.test.ts b/tests/engine/vue/controls/appearance.test.ts
index 2fb02ae11..b00bdc3a4 100644
--- a/tests/engine/vue/controls/appearance.test.ts
+++ b/tests/engine/vue/controls/appearance.test.ts
@@ -2,9 +2,9 @@ import { describe, expect, test } from 'bun:test'
import { computed, ref } from 'vue'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
-import { MIXED, type MixedValue } from '@open-pencil/vue'
+import { MIXED, type MixedValue } from '@open-pencil/vue/controls/node-props'
import { createAppearanceActions, createAppearanceState } from '#vue/controls/appearance/helpers'
diff --git a/tests/engine/vue/controls/binding-mode-edit.test.ts b/tests/engine/vue/controls/binding-mode-edit.test.ts
index 0f29842d5..63f151ec9 100644
--- a/tests/engine/vue/controls/binding-mode-edit.test.ts
+++ b/tests/engine/vue/controls/binding-mode-edit.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { prepareModeEdit } from '#vue/controls/binding-provider/mode-edit'
import { createOpenPencilBindingProvider } from '#vue/controls/binding-provider/open-pencil'
diff --git a/tests/engine/vue/controls/binding-modes.test.ts b/tests/engine/vue/controls/binding-modes.test.ts
index 641ef7461..0eb1dadb1 100644
--- a/tests/engine/vue/controls/binding-modes.test.ts
+++ b/tests/engine/vue/controls/binding-modes.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { prepareModeEdit } from '#vue/controls/binding-provider/mode-edit'
import { createOpenPencilBindingProvider } from '#vue/controls/binding-provider/open-pencil'
diff --git a/tests/engine/vue/controls/color-binding-provider.test.ts b/tests/engine/vue/controls/color-binding-provider.test.ts
index d357d8015..d72514900 100644
--- a/tests/engine/vue/controls/color-binding-provider.test.ts
+++ b/tests/engine/vue/controls/color-binding-provider.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
-import type { Color, Fill } from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import type { Fill } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import { createAndBindColorVariable } from '#vue/controls/binding-provider/color'
import { prepareModeEdit } from '#vue/controls/binding-provider/mode-edit'
diff --git a/tests/engine/vue/controls/component-properties.test.ts b/tests/engine/vue/controls/component-properties.test.ts
index 93551bafc..769a6086c 100644
--- a/tests/engine/vue/controls/component-properties.test.ts
+++ b/tests/engine/vue/controls/component-properties.test.ts
@@ -2,11 +2,11 @@ import { describe, expect, test } from 'bun:test'
import { SceneGraph } from '@open-pencil/scene-graph'
import {
- MIXED,
compatibleComponentPropertyDefinitions,
instanceSwapOptions,
mergedComponentPropertyValue
-} from '@open-pencil/vue'
+} from '@open-pencil/vue/controls/component-props'
+import { MIXED } from '@open-pencil/vue/controls/node-props'
describe('component property control model', () => {
test('requires identical ordered property IDs and types', () => {
diff --git a/tests/engine/vue/controls/constraints.test.ts b/tests/engine/vue/controls/constraints.test.ts
index 738f46394..790f497d7 100644
--- a/tests/engine/vue/controls/constraints.test.ts
+++ b/tests/engine/vue/controls/constraints.test.ts
@@ -1,13 +1,17 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import type { ConstraintType } from '@open-pencil/scene-graph'
import {
collectResizeDescendants,
constrainedChildRect,
type ResizeSnapshot
} from '@open-pencil/scene-graph/resize'
-import { constraintPins, isConstraintEligible, toggleConstraintPin } from '@open-pencil/vue'
+import {
+ constraintPins,
+ isConstraintEligible,
+ toggleConstraintPin
+} from '@open-pencil/vue/controls/constraints'
import { applyResize } from '#vue/shared/input/resize'
import type { DragResize } from '#vue/shared/input/types'
diff --git a/tests/engine/vue/controls/node-preview.test.ts b/tests/engine/vue/controls/node-preview.test.ts
index 537d394eb..d0ee88b8d 100644
--- a/tests/engine/vue/controls/node-preview.test.ts
+++ b/tests/engine/vue/controls/node-preview.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { useNodePreview } from '#vue/controls/node-preview/use'
diff --git a/tests/engine/vue/controls/property-preview.test.ts b/tests/engine/vue/controls/property-preview.test.ts
index 372338225..7b916ec5d 100644
--- a/tests/engine/vue/controls/property-preview.test.ts
+++ b/tests/engine/vue/controls/property-preview.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { computed, effectScope } from 'vue'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { createLayoutActions } from '#vue/controls/layout/helpers'
import { usePropScrub } from '#vue/controls/prop-scrub/use'
diff --git a/tests/engine/vue/controls/shared-style.test.ts b/tests/engine/vue/controls/shared-style.test.ts
index c4e196ddb..ff0821ab8 100644
--- a/tests/engine/vue/controls/shared-style.test.ts
+++ b/tests/engine/vue/controls/shared-style.test.ts
@@ -1,8 +1,9 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { effectiveFigmaRawNodeFields } from '@open-pencil/fig'
-import { getSharedStyles, type Effect, type Fill, type SceneNode } from '@open-pencil/scene-graph'
+import type { Effect, Fill, SceneNode } from '@open-pencil/scene-graph'
+import { getSharedStyles } from '@open-pencil/scene-graph/shared-styles'
import { sharedStyleDetachPatch, sharedStylePatch } from '#vue/controls/shared-style/model'
diff --git a/tests/engine/vue/controls/stroke.test.ts b/tests/engine/vue/controls/stroke.test.ts
index a84225606..daefef75a 100644
--- a/tests/engine/vue/controls/stroke.test.ts
+++ b/tests/engine/vue/controls/stroke.test.ts
@@ -3,7 +3,7 @@ import { describe, expect, test } from 'bun:test'
import { compact } from 'es-toolkit/array'
import { computed, ref } from 'vue'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import type { SceneNode } from '@open-pencil/scene-graph'
import { MIXED, type MixedValue } from '#vue/controls/node-props/use'
diff --git a/tests/engine/vue/controls/typography-depth.test.ts b/tests/engine/vue/controls/typography-depth.test.ts
index f70e4bb86..b17c4e0ce 100644
--- a/tests/engine/vue/controls/typography-depth.test.ts
+++ b/tests/engine/vue/controls/typography-depth.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { computed } from 'vue'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { createTypographyActions } from '#vue/controls/typography/actions'
diff --git a/tests/engine/vue/document-workspace.test.ts b/tests/engine/vue/document-workspace.test.ts
index 5c6823fec..55e85e50d 100644
--- a/tests/engine/vue/document-workspace.test.ts
+++ b/tests/engine/vue/document-workspace.test.ts
@@ -6,7 +6,7 @@ import {
useDocumentWorkspace,
type DocumentWorkspaceItem,
type DocumentWorkspaceSource
-} from '@open-pencil/vue'
+} from '@open-pencil/vue/document/workspace'
import { createTestRenderer, hostNode } from '#tests/helpers/vue/renderer'
diff --git a/tests/engine/vue/editor/menu-model/canvas.test.ts b/tests/engine/vue/editor/menu-model/canvas.test.ts
index c4edfee47..99d91333a 100644
--- a/tests/engine/vue/editor/menu-model/canvas.test.ts
+++ b/tests/engine/vue/editor/menu-model/canvas.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { computed, ref } from 'vue'
-import type { EditorCommandId } from '@open-pencil/vue'
+import type { EditorCommandId } from '@open-pencil/vue/editor/commands'
import { buildCanvasContextMenu } from '#vue/editor/menu-model/canvas'
import type { CanvasMenuOptions } from '#vue/editor/menu-model/canvas'
diff --git a/tests/engine/vue/editor/selected-nodes.test.ts b/tests/engine/vue/editor/selected-nodes.test.ts
index c52407014..9fce895ad 100644
--- a/tests/engine/vue/editor/selected-nodes.test.ts
+++ b/tests/engine/vue/editor/selected-nodes.test.ts
@@ -2,8 +2,9 @@ import { describe, expect, test } from 'bun:test'
import { computed, createApp, effectScope, ref, shallowReactive } from 'vue'
-import { createDefaultEditorState, createEditor } from '@open-pencil/core/editor'
-import { getSharedStyles, SceneGraph, type Fill } from '@open-pencil/scene-graph'
+import { createDefaultEditorState, createEditor } from '@open-pencil/core'
+import { SceneGraph, type Fill } from '@open-pencil/scene-graph'
+import { getSharedStyles } from '@open-pencil/scene-graph/shared-styles'
import { EDITOR_KEY } from '#vue/editor/context'
import { createSelectedNodeState, useSelectedNodeState } from '#vue/editor/selection-state/nodes'
diff --git a/tests/engine/vue/fill/model.test.ts b/tests/engine/vue/fill/model.test.ts
index 2bba864d0..841a03ad6 100644
--- a/tests/engine/vue/fill/model.test.ts
+++ b/tests/engine/vue/fill/model.test.ts
@@ -7,9 +7,9 @@ import {
fillCategory,
fillIsTransparent,
fillSwatchBackground,
- useFill,
- useGradientStops
-} from '@open-pencil/vue'
+ useFill
+} from '@open-pencil/vue/primitives/Fill'
+import { useGradientStops } from '@open-pencil/vue/primitives/GradientEditor'
const solid: Fill = {
type: 'SOLID',
diff --git a/tests/engine/vue/input/auto-layout-hover.test.ts b/tests/engine/vue/input/auto-layout-hover.test.ts
index cb8301370..c7e01809c 100644
--- a/tests/engine/vue/input/auto-layout-hover.test.ts
+++ b/tests/engine/vue/input/auto-layout-hover.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import type { Editor } from '@open-pencil/core/editor'
-import { createDefaultNode, type SceneNode } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
+import type { SceneNode } from '@open-pencil/scene-graph'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
import { autoLayoutValueAnchor, resolveAutoLayoutHover } from '#vue/shared/input/auto-layout-hover'
diff --git a/tests/engine/vue/input/draw.test.ts b/tests/engine/vue/input/draw.test.ts
index a6ee2ece1..a584c7374 100644
--- a/tests/engine/vue/input/draw.test.ts
+++ b/tests/engine/vue/input/draw.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor, type Editor, type Tool } from '@open-pencil/core/editor'
+import { createEditor, type Editor, type Tool } from '@open-pencil/core'
import { SceneGraph } from '@open-pencil/scene-graph'
import { handleDrawMove, startShapeDraw, startTextDraw } from '#vue/shared/input/draw'
diff --git a/tests/engine/vue/input/explicit-snap-targets.test.ts b/tests/engine/vue/input/explicit-snap-targets.test.ts
index fa08d7fb9..5954d0698 100644
--- a/tests/engine/vue/input/explicit-snap-targets.test.ts
+++ b/tests/engine/vue/input/explicit-snap-targets.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { explicitSnapTargets } from '#vue/shared/input/explicit-snap-targets'
import {
diff --git a/tests/engine/vue/input/geometry.test.ts b/tests/engine/vue/input/geometry.test.ts
index e223c4649..0aadd63be 100644
--- a/tests/engine/vue/input/geometry.test.ts
+++ b/tests/engine/vue/input/geometry.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import {
createSceneGeometry,
rotationHandleLayout,
diff --git a/tests/engine/vue/input/guides.test.ts b/tests/engine/vue/input/guides.test.ts
index 59170fc39..7631c6075 100644
--- a/tests/engine/vue/input/guides.test.ts
+++ b/tests/engine/vue/input/guides.test.ts
@@ -2,7 +2,7 @@ import { describe, expect, test } from 'bun:test'
import { ref } from 'vue'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { createGuideInput, selectedTopLevelGuideFrameId } from '#vue/canvas/guides/input'
import type { DragState } from '#vue/shared/input/types'
diff --git a/tests/engine/vue/input/move-threshold.test.ts b/tests/engine/vue/input/move-threshold.test.ts
index 61387a6a3..279be7b61 100644
--- a/tests/engine/vue/input/move-threshold.test.ts
+++ b/tests/engine/vue/input/move-threshold.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import {
handleMoveMove,
diff --git a/tests/engine/vue/input/node-edit-snap.test.ts b/tests/engine/vue/input/node-edit-snap.test.ts
index a00cc050d..1042f4516 100644
--- a/tests/engine/vue/input/node-edit-snap.test.ts
+++ b/tests/engine/vue/input/node-edit-snap.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { DEFAULT_SNAPPING_PREFERENCES, createEditor } from '@open-pencil/core/editor'
+import { DEFAULT_SNAPPING_PREFERENCES, createEditor } from '@open-pencil/core'
import type { DragEditNode } from '#vue/shared/input/types'
import { applyNodeEditSnap } from '#vue/shared/input/vector/snap'
diff --git a/tests/engine/vue/input/resize/geometry.test.ts b/tests/engine/vue/input/resize/geometry.test.ts
index 16eaa94ef..221fc1db6 100644
--- a/tests/engine/vue/input/resize/geometry.test.ts
+++ b/tests/engine/vue/input/resize/geometry.test.ts
@@ -1,10 +1,10 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import type { Fill, GeometryPath, SceneNode, VectorNetwork } from '@open-pencil/scene-graph'
-import { cloneVectorNetwork } from '@open-pencil/scene-graph'
import { copyGeometryPaths } from '@open-pencil/scene-graph/copy'
import { collectResizeDescendants } from '@open-pencil/scene-graph/resize'
+import { cloneVectorNetwork } from '@open-pencil/scene-graph/vector-network'
import { applyResize, commitResizePreview } from '#vue/shared/input/resize'
import type { DragResize } from '#vue/shared/input/types'
diff --git a/tests/engine/vue/input/resize/path-text/basic.test.ts b/tests/engine/vue/input/resize/path-text/basic.test.ts
index 332fa91d4..7c3e449cc 100644
--- a/tests/engine/vue/input/resize/path-text/basic.test.ts
+++ b/tests/engine/vue/input/resize/path-text/basic.test.ts
@@ -2,9 +2,14 @@ import { describe, expect, test } from 'bun:test'
import { reactive } from 'vue'
-import type { Editor } from '@open-pencil/core/editor'
-import { SceneGraph } from '@open-pencil/scene-graph'
-import type { DerivedTextGlyph, Fill, SceneNode, Stroke } from '@open-pencil/scene-graph'
+import type { Editor } from '@open-pencil/core'
+import {
+ SceneGraph,
+ type DerivedTextGlyph,
+ type Fill,
+ type SceneNode,
+ type Stroke
+} from '@open-pencil/scene-graph'
import { copyGeometryPaths, copyStrokes } from '@open-pencil/scene-graph/copy'
import type { ResizeSnapshot } from '@open-pencil/scene-graph/resize'
diff --git a/tests/engine/vue/input/resize/path-text/reflow.test.ts b/tests/engine/vue/input/resize/path-text/reflow.test.ts
index 0f3bad3d5..e341d1e5a 100644
--- a/tests/engine/vue/input/resize/path-text/reflow.test.ts
+++ b/tests/engine/vue/input/resize/path-text/reflow.test.ts
@@ -1,9 +1,14 @@
import { describe, expect, test } from 'bun:test'
-import type { Editor } from '@open-pencil/core/editor'
+import type { Editor } from '@open-pencil/core'
import { parseFigBuffer } from '@open-pencil/fig'
-import { SceneGraph } from '@open-pencil/scene-graph'
-import type { Fill, SceneNode, Stroke, VectorNetwork } from '@open-pencil/scene-graph'
+import {
+ SceneGraph,
+ type Fill,
+ type SceneNode,
+ type Stroke,
+ type VectorNetwork
+} from '@open-pencil/scene-graph'
import { copyGeometryPaths, copyStrokes } from '@open-pencil/scene-graph/copy'
import type { ResizeSnapshot } from '@open-pencil/scene-graph/resize'
diff --git a/tests/engine/vue/input/resize/snapping.test.ts b/tests/engine/vue/input/resize/snapping.test.ts
index 9d7ea8c9d..7692f3c0f 100644
--- a/tests/engine/vue/input/resize/snapping.test.ts
+++ b/tests/engine/vue/input/resize/snapping.test.ts
@@ -1,6 +1,6 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { applyResize, commitResizePreview } from '#vue/shared/input/resize'
import type { DragResize } from '#vue/shared/input/types'
diff --git a/tests/engine/vue/input/snap-guides.test.ts b/tests/engine/vue/input/snap-guides.test.ts
index baf67ffe9..a0ec73a61 100644
--- a/tests/engine/vue/input/snap-guides.test.ts
+++ b/tests/engine/vue/input/snap-guides.test.ts
@@ -1,7 +1,8 @@
import { describe, expect, test } from 'bun:test'
-import { createEditor } from '@open-pencil/core/editor'
-import { computeSnap, createDefaultNode } from '@open-pencil/scene-graph'
+import { createEditor } from '@open-pencil/core'
+import { createDefaultNode } from '@open-pencil/scene-graph/node-defaults'
+import { computeSnap } from '@open-pencil/scene-graph/snap'
import { computePixelGridSnap, resolveObjectPixelSnap } from '#vue/shared/input/snap'
diff --git a/tests/engine/vue/layer-tree/model.test.ts b/tests/engine/vue/layer-tree/model.test.ts
index 8071d08d6..3338cd83b 100644
--- a/tests/engine/vue/layer-tree/model.test.ts
+++ b/tests/engine/vue/layer-tree/model.test.ts
@@ -5,7 +5,7 @@ import {
layerSelectionForTarget,
patchLayerNode,
visibleLayerRows
-} from '@open-pencil/vue'
+} from '@open-pencil/vue/primitives/LayerTree'
import { createRect, firstPageId, makeSceneGraph } from '#tests/helpers/scene'
diff --git a/tests/engine/vue/lifecycle/retention.test.ts b/tests/engine/vue/lifecycle/retention.test.ts
index eb846c808..aabceda4d 100644
--- a/tests/engine/vue/lifecycle/retention.test.ts
+++ b/tests/engine/vue/lifecycle/retention.test.ts
@@ -2,7 +2,7 @@ import { expect, test } from 'bun:test'
import { defineComponent, h, KeepAlive, nextTick, ref, watchEffect } from 'vue'
-import { createEditor } from '@open-pencil/core/editor'
+import { createEditor } from '@open-pencil/core'
import { usePropScrub } from '#vue/controls/prop-scrub/use'
import { useUndoBatch } from '#vue/controls/undo-batch/use'
diff --git a/tests/engine/vue/testing/test-id.test.ts b/tests/engine/vue/testing/test-id.test.ts
index 8bd5a9fe6..4382daa62 100644
--- a/tests/engine/vue/testing/test-id.test.ts
+++ b/tests/engine/vue/testing/test-id.test.ts
@@ -1,6 +1,6 @@
import { afterEach, describe, expect, test } from 'bun:test'
-import { testIdSelector } from '@open-pencil/vue'
+import { testIdSelector } from '@open-pencil/vue/testing'
const originalCSSDescriptor = Reflect.getOwnPropertyDescriptor(globalThis, 'CSS')
diff --git a/tests/helpers/assert.ts b/tests/helpers/assert.ts
index 49eb204cc..f596cf241 100644
--- a/tests/helpers/assert.ts
+++ b/tests/helpers/assert.ts
@@ -1,4 +1,4 @@
-import type { SceneGraph, SceneNode } from '@open-pencil/core'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
export function expectDefined<T>(value: T | null | undefined, label = 'value'): NonNullable<T> {
if (value == null) {
diff --git a/tests/helpers/canvas/mixed-selection/scene.ts b/tests/helpers/canvas/mixed-selection/scene.ts
index 538e0c5b9..5ac5c3031 100644
--- a/tests/helpers/canvas/mixed-selection/scene.ts
+++ b/tests/helpers/canvas/mixed-selection/scene.ts
@@ -1,4 +1,5 @@
-import type { Color, Fill, SceneGraph } from '@open-pencil/scene-graph'
+import type { Fill, SceneGraph } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
const RED = { r: 1, g: 0.3, b: 0.2, a: 1 }
const BLUE = { r: 0.2, g: 0.4, b: 1, a: 1 }
diff --git a/tests/helpers/canvas/pixels.ts b/tests/helpers/canvas/pixels.ts
index e534c03d5..93194f15d 100644
--- a/tests/helpers/canvas/pixels.ts
+++ b/tests/helpers/canvas/pixels.ts
@@ -1,6 +1,6 @@
import type { Page } from '@playwright/test'
-import type { Vector } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
/** Read freshly painted scene pixels in sRGB, before WebGL discards its drawing buffer. */
export async function readScenePixels(page: Page, points: readonly Vector[]): Promise<number[][]> {
diff --git a/tests/helpers/chat/placement-scene.ts b/tests/helpers/chat/placement-scene.ts
index ffc3b58bf..177ed1aad 100644
--- a/tests/helpers/chat/placement-scene.ts
+++ b/tests/helpers/chat/placement-scene.ts
@@ -1,7 +1,8 @@
import type { Page } from '@playwright/test'
import type { RenderPlacementInput } from '@open-pencil/core/design-jsx'
-import type { Color, Fill } from '@open-pencil/scene-graph'
+import type { Fill } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
export type PlacementScenario =
| 'nested-fill'
diff --git a/tests/helpers/fig/fixtures.ts b/tests/helpers/fig/fixtures.ts
index d189af8ba..5258c7c03 100644
--- a/tests/helpers/fig/fixtures.ts
+++ b/tests/helpers/fig/fixtures.ts
@@ -3,12 +3,8 @@ import { resolve } from 'node:path'
import * as v from 'valibot'
-import {
- parseFigFile,
- type ParseFigFileOptions,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/core'
+import { parseFigFile, type ParseFigFileOptions } from '@open-pencil/core/io/formats/fig'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import { testPath } from '../paths'
import { collectAllNodes } from './traversal'
diff --git a/tests/helpers/fig/guid.ts b/tests/helpers/fig/guid.ts
index 559f72914..d2d849d13 100644
--- a/tests/helpers/fig/guid.ts
+++ b/tests/helpers/fig/guid.ts
@@ -1,4 +1,4 @@
-import type { GUID } from '@open-pencil/kiwi/fig/codec'
+import type { GUID } from '@open-pencil/kiwi/fig'
export function guid(localID: number, sessionID = 1): GUID {
return { sessionID, localID }
diff --git a/tests/helpers/fig/traversal.ts b/tests/helpers/fig/traversal.ts
index 53bfe8fd9..60f9dc6c0 100644
--- a/tests/helpers/fig/traversal.ts
+++ b/tests/helpers/fig/traversal.ts
@@ -1,4 +1,4 @@
-import type { NodeType, SceneGraph, SceneNode } from '@open-pencil/core'
+import type { NodeType, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
export function collectAllNodes(graph: SceneGraph): SceneNode[] {
const all: SceneNode[] = []
diff --git a/tests/helpers/geometry.ts b/tests/helpers/geometry.ts
index 91fdd84f5..4bdc4821a 100644
--- a/tests/helpers/geometry.ts
+++ b/tests/helpers/geometry.ts
@@ -1,4 +1,5 @@
-import type { SceneGraph, SceneNode, Vector } from '@open-pencil/scene-graph'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import type { Vector } from '@open-pencil/scene-graph/primitives'
type FixtureNode = Pick<
SceneNode,
diff --git a/tests/helpers/layout.ts b/tests/helpers/layout.ts
index 64c858582..1285f69f9 100644
--- a/tests/helpers/layout.ts
+++ b/tests/helpers/layout.ts
@@ -1,5 +1,5 @@
-import { readFigFile } from '@open-pencil/core'
-import type { GridTrack, SceneGraph, SceneNode } from '@open-pencil/core'
+import { readFigFile } from '@open-pencil/core/io/formats/fig'
+import type { GridTrack, SceneGraph, SceneNode } from '@open-pencil/scene-graph'
export function pageId(graph: SceneGraph) {
return graph.getPages()[0].id
diff --git a/tests/helpers/mcp/server.ts b/tests/helpers/mcp/server.ts
index aa28a4942..f52cba993 100644
--- a/tests/helpers/mcp/server.ts
+++ b/tests/helpers/mcp/server.ts
@@ -3,14 +3,12 @@ import { type RequestOptions, request as httpRequest } from 'node:http'
import * as v from 'valibot'
import { WebSocket } from 'ws'
-import {
- type SceneGraph,
- ALL_TOOLS,
- FigmaAPI,
- computeAllLayouts,
- executeRPCCommand
-} from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { computeAllLayouts } from '@open-pencil/core/layout'
+import { executeRPCCommand } from '@open-pencil/core/rpc'
+import { ALL_TOOLS } from '@open-pencil/core/tools'
import type { ToolDescriptor } from '@open-pencil/mcp/tools'
+import type { SceneGraph } from '@open-pencil/scene-graph'
import { randomHex } from '@open-pencil/scene-graph/random'
const ToolDescriptorShape = v.looseObject({ name: v.string(), enabled: v.boolean() })
diff --git a/tests/helpers/scene.ts b/tests/helpers/scene.ts
index bef1a3896..eb43c9aad 100644
--- a/tests/helpers/scene.ts
+++ b/tests/helpers/scene.ts
@@ -1,6 +1,5 @@
-import { SceneGraph } from '@open-pencil/core'
-import type { SceneNode } from '@open-pencil/core'
-import type { Color } from '@open-pencil/scene-graph'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
export function makeSceneGraph(pageName = 'Test'): SceneGraph {
const graph = new SceneGraph()
diff --git a/tests/helpers/tools.ts b/tests/helpers/tools.ts
index 2f85ea1a3..8b057e76b 100644
--- a/tests/helpers/tools.ts
+++ b/tests/helpers/tools.ts
@@ -1,4 +1,6 @@
-import { ALL_TOOLS, FigmaAPI, SceneGraph } from '@open-pencil/core'
+import { FigmaAPI } from '@open-pencil/core/figma-api'
+import { ALL_TOOLS } from '@open-pencil/core/tools'
+import { SceneGraph } from '@open-pencil/scene-graph'
export { ALL_TOOLS }
diff --git a/tests/helpers/vector-network.ts b/tests/helpers/vector-network.ts
index 4947ed041..804d4bad5 100644
--- a/tests/helpers/vector-network.ts
+++ b/tests/helpers/vector-network.ts
@@ -1,4 +1,4 @@
-import type { VectorNetwork, VectorSegment, VectorVertex } from '@open-pencil/core'
+import type { VectorNetwork, VectorSegment, VectorVertex } from '@open-pencil/scene-graph'
export function vectorVertex(x: number, y: number): VectorVertex {
return { x, y, handleMirroring: 'NONE' }
diff --git a/tests/integration/collab/cloud-relay.test.ts b/tests/integration/collab/cloud-relay.test.ts
index d17941276..73f08e304 100644
--- a/tests/integration/collab/cloud-relay.test.ts
+++ b/tests/integration/collab/cloud-relay.test.ts
@@ -6,7 +6,8 @@ import * as awarenessProtocol from 'y-protocols/awareness'
import * as Y from 'yjs'
import type { DocumentPermission } from '@open-pencil/cloud/contract'
-import { exportFigFile, initCodec, parseFigFile } from '@open-pencil/core'
+import { exportFigFile, parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCodec } from '@open-pencil/kiwi/fig/codec'
import { SceneGraph } from '@open-pencil/scene-graph'
import { accountRoomIdentity } from '@/app/cloud/rooms/identity'
diff --git a/tests/integration/fig-transfer-plan.test.ts b/tests/integration/fig-transfer-plan.test.ts
index 46a6b89b2..37f03b974 100644
--- a/tests/integration/fig-transfer-plan.test.ts
+++ b/tests/integration/fig-transfer-plan.test.ts
@@ -3,7 +3,8 @@ import { expect, test } from 'bun:test'
import * as v from 'valibot'
import { materializeFigFragment } from '@open-pencil/fig'
-import { prepareGraphTransfer, applyGraphTransfer, SceneGraph } from '@open-pencil/scene-graph'
+import { SceneGraph } from '@open-pencil/scene-graph'
+import { prepareGraphTransfer, applyGraphTransfer } from '@open-pencil/scene-graph/transfer'
import { readFixtureObject } from '#tests/helpers/fig/fixtures'
diff --git a/tools/checks/i18n/src/check-locales.ts b/tools/checks/i18n/src/check-locales.ts
index efaf53df6..fa48c81c2 100644
--- a/tools/checks/i18n/src/check-locales.ts
+++ b/tools/checks/i18n/src/check-locales.ts
@@ -9,9 +9,9 @@ import type { JSONObject } from '@open-pencil/scene-graph/primitives'
import {
LOCALE_DIR_NAMES,
TRANSLATED_LOCALES,
- messageDefaults,
- type TranslatedLocale
-} from '@open-pencil/vue'
+ type TranslatedLocale,
+ messageDefaults
+} from '@open-pencil/vue/i18n'
import { hasMixedLatinAndCjk, placeholders } from './quality'
diff --git a/tools/checks/lint/src/plugin.ts b/tools/checks/lint/src/plugin.ts
index ae4ddfa77..dcb21a739 100644
--- a/tools/checks/lint/src/plugin.ts
+++ b/tools/checks/lint/src/plugin.ts
@@ -20,7 +20,7 @@ import { normalizedFilename } from '#lint/support/context.ts'
import type { PluginRule, RuleDefinition } from '#lint/support/types.ts'
import type { TSESTree } from '@typescript-eslint/utils'
-import type { Color } from '@open-pencil/scene-graph'
+import type { Color } from '@open-pencil/scene-graph/primitives'
const noInlineNamedTypes = {
meta: {
@@ -386,12 +386,8 @@ import {
noMcpParentRelativeImports,
noVueParentRelativeImports,
noCliParentRelativeImports,
- noMcpCoreBarrelImports,
- noCliCoreBarrelImports,
- noScriptCoreBarrelImports,
noCoreSelfPackageImports,
noInlinePromptConstants,
- noAppVueCoreBarrelImports,
noAppImportsInPackages,
noCoreFrameworkImports
} from '#lint/rules/imports.ts'
@@ -467,12 +463,8 @@ const plugin = {
'no-mcp-parent-relative-imports': noMcpParentRelativeImports,
'no-vue-parent-relative-imports': noVueParentRelativeImports,
'no-cli-parent-relative-imports': noCliParentRelativeImports,
- 'no-mcp-core-barrel-imports': noMcpCoreBarrelImports,
- 'no-cli-core-barrel-imports': noCliCoreBarrelImports,
- 'no-script-core-barrel-imports': noScriptCoreBarrelImports,
'no-core-self-package-imports': noCoreSelfPackageImports,
'no-inline-prompt-constants': noInlinePromptConstants,
- 'no-app-vue-core-barrel-imports': noAppVueCoreBarrelImports,
'no-app-imports-in-packages': noAppImportsInPackages,
'no-core-framework-imports': noCoreFrameworkImports,
'no-direct-storage-access': noDirectStorageAccess,
diff --git a/tools/checks/lint/src/rules/imports.ts b/tools/checks/lint/src/rules/imports.ts
index f41fdcc97..b4c995549 100644
--- a/tools/checks/lint/src/rules/imports.ts
+++ b/tools/checks/lint/src/rules/imports.ts
@@ -178,45 +178,6 @@ const noCliParentRelativeImports = createParentRelativeImportRule({
message: 'Use the #cli/* package-local alias instead of parent-relative CLI imports.'
})
-interface ExactCoreBarrelRuleOptions {
- description: string
- applies(file: string): boolean
- message: string
-}
-
-function createExactCoreBarrelImportRule({
- description,
- applies,
- message
-}: ExactCoreBarrelRuleOptions): RuleDefinition {
- return createImportSourceRule({
- description,
- applies,
- check: (source) => source === '@open-pencil/core' && message
- })
-}
-
-const noMcpCoreBarrelImports = createExactCoreBarrelImportRule({
- description: 'Disallow MCP imports from @open-pencil/core root barrel — use domain subpaths',
- applies: (file) => file.includes('/packages/mcp/src/'),
- message:
- 'Use a targeted @open-pencil/core subpath in MCP code instead of the compatibility barrel.'
-})
-
-const noCliCoreBarrelImports = createExactCoreBarrelImportRule({
- description: 'Disallow CLI imports from @open-pencil/core root barrel — use domain subpaths',
- applies: (file) => file.includes('/packages/cli/src/'),
- message:
- 'Use a targeted @open-pencil/core subpath in CLI code instead of the compatibility barrel.'
-})
-
-const noScriptCoreBarrelImports = createExactCoreBarrelImportRule({
- description: 'Disallow script imports from @open-pencil/core root barrel — use domain subpaths',
- applies: (file) => file.includes('/scripts/'),
- message:
- 'Use a targeted @open-pencil/core subpath or #core/* alias in scripts instead of the compatibility barrel.'
-})
-
const noCoreSelfPackageImports = createImportSourceRule({
description: 'Disallow @open-pencil/core self-imports inside packages/core/src',
applies: (file) => file.includes('/packages/core/src/'),
@@ -247,15 +208,6 @@ const noInlinePromptConstants = {
}
} satisfies RuleDefinition
-const noAppVueCoreBarrelImports = createExactCoreBarrelImportRule({
- description:
- 'Disallow app and Vue SDK imports from @open-pencil/core root barrel — use domain subpaths',
- applies: (file) =>
- (file.includes('/src/') && !file.includes('/packages/')) || file.includes('/packages/vue/src/'),
- message:
- 'Use a targeted @open-pencil/core subpath (editor, scene-graph, constants, io, etc.) instead of the compatibility barrel.'
-})
-
const noAppImportsInPackages = createImportSourceRule({
description: 'Disallow app-shell imports from workspace packages',
applies: (file) => file.includes('/packages/'),
@@ -284,12 +236,8 @@ export {
noMcpParentRelativeImports,
noVueParentRelativeImports,
noCliParentRelativeImports,
- noMcpCoreBarrelImports,
- noCliCoreBarrelImports,
- noScriptCoreBarrelImports,
noCoreSelfPackageImports,
noInlinePromptConstants,
- noAppVueCoreBarrelImports,
noAppImportsInPackages,
noCoreFrameworkImports
}
diff --git a/tools/checks/package-quality/package.json b/tools/checks/package-quality/package.json
index 7532fe038..5f5aa693f 100644
--- a/tools/checks/package-quality/package.json
+++ b/tools/checks/package-quality/package.json
@@ -14,6 +14,7 @@
"dependencies": {
"@open-pencil/package-artifacts-tools": "workspace:*",
"citty": "^0.1.6",
- "es-toolkit": "^1.52.0"
+ "es-toolkit": "^1.52.0",
+ "typescript": "~5.8.3"
}
}
diff --git a/tools/checks/package-quality/src/checks/exports.ts b/tools/checks/package-quality/src/checks/exports.ts
new file mode 100644
index 000000000..1ad5bee84
--- /dev/null
+++ b/tools/checks/package-quality/src/checks/exports.ts
@@ -0,0 +1,113 @@
+import { existsSync } from 'node:fs'
+import { join, relative, sep } from 'node:path'
+
+import { groupBy, isPlainObject, uniq } from 'es-toolkit'
+import ts from 'typescript'
+
+import {
+ discoverPublicPackages,
+ type PackageDiagnostic
+} from '@open-pencil/package-artifacts-tools'
+
+/** The JSX automatic runtime requires both entries to export the same factory functions. */
+const JSX_RUNTIME_ENTRIES = new Set(['./jsx-runtime', './jsx-dev-runtime'])
+
+/** One name an entry exports, with the package and declaration it resolves to. */
+export interface EntryExport {
+ packageName: string
+ entry: string
+ name: string
+ /** Declaring file relative to the workspace root, and the declared name. */
+ declaration: string
+ declaringPackage: string | undefined
+}
+
+function sourceOf(directory: string, target: unknown): string | null {
+ if (typeof target === 'string') {
+ if (target.includes('*') || target.endsWith('.json')) return null
+ const path = target.replace(/^\.\/dist\//, './src/').replace(/\.(m?js|d\.m?ts)$/, '.ts')
+ return existsSync(join(directory, path)) ? join(directory, path) : null
+ }
+ if (!target || typeof target !== 'object') return null
+ for (const condition of ['bun', 'import', 'default', 'types']) {
+ const source = sourceOf(directory, Reflect.get(target, condition))
+ if (source) return source
+ }
+ return null
+}
+
+/** Every name each public package's entries export, resolved through re-exports. */
+export async function collectEntryExports(root: string): Promise<EntryExport[]> {
+ const packages = await discoverPublicPackages(root)
+ const entries = packages.flatMap(({ directory, manifest }) =>
+ Object.entries(isPlainObject(manifest.exports) ? manifest.exports : {}).flatMap(
+ ([entry, target]) => {
+ const file = sourceOf(join(root, directory), target)
+ return file ? [{ packageName: manifest.name, entry, file }] : []
+ }
+ )
+ )
+ const config = ts.readConfigFile(join(root, 'tsconfig.json'), (path) => ts.sys.readFile(path))
+ const { options } = ts.parseJsonConfigFileContent(config.config, ts.sys, root)
+ const program = ts.createProgram({
+ rootNames: entries.map(({ file }) => file),
+ options: { ...options, noEmit: true, customConditions: ['bun'] }
+ })
+ const checker = program.getTypeChecker()
+ const packageOf = (file: string) =>
+ packages.find(({ directory }) => file.startsWith(join(root, directory) + sep))?.manifest.name
+
+ return entries.flatMap(({ packageName, entry, file }) => {
+ const source = program.getSourceFile(file)
+ const module = source && checker.getSymbolAtLocation(source)
+ if (!module) return []
+ return checker.getExportsOfModule(module).map((symbol) => {
+ const target = symbol.flags & ts.SymbolFlags.Alias ? checker.getAliasedSymbol(symbol) : symbol
+ const declaringFile = target.declarations?.[0]?.getSourceFile().fileName ?? file
+ return {
+ packageName,
+ entry,
+ name: symbol.getName(),
+ declaration: `${relative(root, declaringFile)}#${target.getName()}`,
+ declaringPackage: packageOf(declaringFile)
+ }
+ })
+ })
+}
+
+/**
+ * A package exports each of its names from one entry, and only names it declares itself:
+ * consumers import another package's names from that package.
+ */
+export function entryExportDiagnostics(exports: EntryExport[]): PackageDiagnostic[] {
+ const diagnostics: PackageDiagnostic[] = []
+ for (const [packageName, own] of Object.entries(groupBy(exports, (row) => row.packageName))) {
+ for (const row of own) {
+ if (row.declaringPackage && row.declaringPackage !== packageName) {
+ diagnostics.push({
+ packageName,
+ field: `exports["${row.entry}"]`,
+ message: `re-exports ${row.name} from ${row.declaringPackage}; import it from there`
+ })
+ }
+ }
+ const shared = groupBy(
+ own.filter((row) => !JSX_RUNTIME_ENTRIES.has(row.entry)),
+ (row) => row.declaration
+ )
+ for (const rows of Object.values(shared)) {
+ const entries = uniq(rows.map((row) => row.entry))
+ if (entries.length < 2) continue
+ diagnostics.push({
+ packageName,
+ field: 'exports',
+ message: `${rows[0].name} is exported from ${entries.join(', ')}; keep one entry`
+ })
+ }
+ }
+ return diagnostics
+}
+
+export async function validateEntryExports(root: string): Promise<PackageDiagnostic[]> {
+ return entryExportDiagnostics(await collectEntryExports(root))
+}
diff --git a/tools/checks/package-quality/src/commands.ts b/tools/checks/package-quality/src/commands.ts
index 29ddf1fcf..1f9978df3 100644
--- a/tools/checks/package-quality/src/commands.ts
+++ b/tools/checks/package-quality/src/commands.ts
@@ -3,6 +3,7 @@ import { defineCommand } from 'citty'
import { resolveWorkspaceRoot } from '@open-pencil/package-artifacts-tools'
import { checkTypes } from './checks/attw'
+import { validateEntryExports } from './checks/exports'
import { formatPackageDiagnostics, validatePackageMetadata } from './checks/metadata'
import { checkPublint } from './checks/publint'
import { verifyPackedPackages } from './smoke/verify'
@@ -13,9 +14,11 @@ const rootArg = { type: 'string', description: 'Explicit workspace root' } as co
async function check(root: string): Promise<void> {
const diagnostics = await measurePhase('metadata', () => validatePackageMetadata(root))
if (diagnostics.length > 0) throw new Error(formatPackageDiagnostics(diagnostics))
+ const exportDiagnostics = await measurePhase('exports', () => validateEntryExports(root))
+ if (exportDiagnostics.length > 0) throw new Error(formatPackageDiagnostics(exportDiagnostics))
await measurePhase('Publint', () => checkPublint(root))
await measurePhase('ATTW', () => checkTypes(root))
- console.log('Package metadata, Publint and ATTW checks passed.')
+ console.log('Package metadata, exports, Publint and ATTW checks passed.')
}
export const checkCommand = defineCommand({
diff --git a/tools/checks/package-quality/src/smoke/type-consumer.ts b/tools/checks/package-quality/src/smoke/type-consumer.ts
index 8f364e545..68a5a0ae9 100644
--- a/tools/checks/package-quality/src/smoke/type-consumer.ts
+++ b/tools/checks/package-quality/src/smoke/type-consumer.ts
@@ -8,10 +8,11 @@ import { Frame, type TreeNode } from '@open-pencil/design-jsx'
import { htmlToDesignDocument, type DesignDocument } from '@open-pencil/dom-css'
import { FIG_PACKAGE_STATUS, type FigContainerDocument } from '@open-pencil/fig'
import { FIG_KIWI_DEFAULT_VERSION, buildFigKiwi } from '@open-pencil/kiwi/fig/container'
-import { type GUID as KiwiGUID } from '@open-pencil/kiwi/fig'
+import type { GUID as KiwiGUID } from '@open-pencil/kiwi/fig'
import { parsePenFile, type PenDocument } from '@open-pencil/pen'
-import { SceneGraph, type Color, type SceneNode, type Vector } from '@open-pencil/scene-graph'
-import { testIdSelector } from '@open-pencil/vue'
+import { SceneGraph, type SceneNode } from '@open-pencil/scene-graph'
+import type { Color, Vector } from '@open-pencil/scene-graph/primitives'
+import { testIdSelector } from '@open-pencil/vue/testing'
const graph = new SceneGraph()
const editorFactory: typeof createEditor = createEditor
diff --git a/tools/checks/package-quality/tests/exports.test.ts b/tools/checks/package-quality/tests/exports.test.ts
new file mode 100644
index 000000000..336e7de19
--- /dev/null
+++ b/tools/checks/package-quality/tests/exports.test.ts
@@ -0,0 +1,47 @@
+import { describe, expect, test } from 'bun:test'
+
+import { entryExportDiagnostics, type EntryExport } from '#package-quality/checks/exports'
+
+function row(entry: string, name: string, declaration: string, declaringPackage = '@x/a') {
+ return { packageName: '@x/a', entry, name, declaration, declaringPackage } satisfies EntryExport
+}
+
+describe('entry exports', () => {
+ test('a name exported from one entry passes', () => {
+ expect(
+ entryExportDiagnostics([row('.', 'Graph', 'a.ts#Graph'), row('./color', 'mix', 'c.ts#mix')])
+ ).toEqual([])
+ })
+
+ test('a name reachable from two entries fails', () => {
+ expect(
+ entryExportDiagnostics([row('.', 'mix', 'c.ts#mix'), row('./color', 'mix', 'c.ts#mix')])
+ ).toEqual([
+ {
+ packageName: '@x/a',
+ field: 'exports',
+ message: 'mix is exported from ., ./color; keep one entry'
+ }
+ ])
+ })
+
+ test('the two JSX runtime entries may share their factories', () => {
+ expect(
+ entryExportDiagnostics([
+ row('.', 'renderJSX', 'r.ts#renderJSX'),
+ row('./jsx-runtime', 'jsx', 'r.ts#jsx'),
+ row('./jsx-dev-runtime', 'jsx', 'r.ts#jsx')
+ ])
+ ).toEqual([])
+ })
+
+ test("another package's name fails", () => {
+ expect(entryExportDiagnostics([row('.', 'Color', 'b.ts#Color', '@x/b')])).toEqual([
+ {
+ packageName: '@x/a',
+ field: 'exports["."]',
+ message: 're-exports Color from @x/b; import it from there'
+ }
+ ])
+ })
+})
diff --git a/tools/generate/demo/src/build.ts b/tools/generate/demo/src/build.ts
index 2d1c54c4e..6076a55e3 100644
--- a/tools/generate/demo/src/build.ts
+++ b/tools/generate/demo/src/build.ts
@@ -1,6 +1,7 @@
import { SkiaRenderer } from '@open-pencil/core/canvas'
import { setPageBackgrounds } from '@open-pencil/core/figma-api'
-import { exportFigFile, initCanvasKit } from '@open-pencil/core/io'
+import { exportFigFile } from '@open-pencil/core/io/formats/fig'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import { computeAllLayouts, installTextMeasurer } from '@open-pencil/core/layout'
import { fontManager, prepareGraphFonts } from '@open-pencil/core/text'
import { SceneGraph } from '@open-pencil/scene-graph'
diff --git a/tools/generate/demo/src/document/callout.tsx b/tools/generate/demo/src/document/callout.tsx
index 1a5b81567..b54346dee 100644
--- a/tools/generate/demo/src/document/callout.tsx
+++ b/tools/generate/demo/src/document/callout.tsx
@@ -5,13 +5,9 @@
* clicks one sees in the panel.
*/
import { Component, Frame, Instance, Text, type TreeNode } from '@open-pencil/design-jsx'
-import {
- createComponentPropertyId,
- createSlotProperty,
- updateSlotProperty,
- type ComponentPropertyDefinition,
- type SceneGraph
-} from '@open-pencil/scene-graph'
+import type { ComponentPropertyDefinition, SceneGraph } from '@open-pencil/scene-graph'
+import { createComponentPropertyId } from '@open-pencil/scene-graph/components'
+import { createSlotProperty, updateSlotProperty } from '@open-pencil/scene-graph/slots'
import { previewButton } from './chrome'
import { renderTree } from './icons'
diff --git a/tools/generate/demo/src/document/chapters/hello.ts b/tools/generate/demo/src/document/chapters/hello.ts
index ff0722fb9..a39cd26db 100644
--- a/tools/generate/demo/src/document/chapters/hello.ts
+++ b/tools/generate/demo/src/document/chapters/hello.ts
@@ -1,5 +1,5 @@
import { Frame, Instance, shader } from '@open-pencil/design-jsx'
-import type { ShaderPreset } from '@open-pencil/scene-graph'
+import type { ShaderPreset } from '@open-pencil/scene-graph/shaders'
import { previewButton } from '../chrome'
import { layoutChapter, type Chapter, type ChapterContext } from './chapter'
diff --git a/tools/generate/demo/src/document/chapters/shaders.ts b/tools/generate/demo/src/document/chapters/shaders.ts
index 26f04ab87..b2336871a 100644
--- a/tools/generate/demo/src/document/chapters/shaders.ts
+++ b/tools/generate/demo/src/document/chapters/shaders.ts
@@ -1,6 +1,5 @@
-import { Frame, Rectangle, Text, shader } from '@open-pencil/design-jsx'
-import type { TreeNode } from '@open-pencil/design-jsx'
-import type { ShaderPreset } from '@open-pencil/scene-graph'
+import { Frame, Rectangle, Text, shader, type TreeNode } from '@open-pencil/design-jsx'
+import type { ShaderPreset } from '@open-pencil/scene-graph/shaders'
import { fillRow } from '../chrome'
import { COVER_PRESET } from '../player/card'
diff --git a/tools/generate/demo/src/document/chapters/slots.ts b/tools/generate/demo/src/document/chapters/slots.ts
index 2e39e1dfe..80387908b 100644
--- a/tools/generate/demo/src/document/chapters/slots.ts
+++ b/tools/generate/demo/src/document/chapters/slots.ts
@@ -1,10 +1,6 @@
-import { Frame, Instance, Text, linearGradient } from '@open-pencil/design-jsx'
-import type { TreeNode } from '@open-pencil/design-jsx'
-import {
- createComponentPropertyId,
- createSlotProperty,
- updateSlotProperty
-} from '@open-pencil/scene-graph'
+import { Frame, Instance, Text, linearGradient, type TreeNode } from '@open-pencil/design-jsx'
+import { createComponentPropertyId } from '@open-pencil/scene-graph/components'
+import { createSlotProperty, updateSlotProperty } from '@open-pencil/scene-graph/slots'
import { slotRow } from '../chrome'
import { Icon } from '../elements'
diff --git a/tools/generate/demo/src/document/player/card.tsx b/tools/generate/demo/src/document/player/card.tsx
index 1c0b52a0f..95cc9d7d9 100644
--- a/tools/generate/demo/src/document/player/card.tsx
+++ b/tools/generate/demo/src/document/player/card.tsx
@@ -12,7 +12,8 @@ import {
shader,
type TreeNode
} from '@open-pencil/design-jsx'
-import type { ComponentPropertyDefinition, ShaderPreset } from '@open-pencil/scene-graph'
+import type { ComponentPropertyDefinition } from '@open-pencil/scene-graph'
+import type { ShaderPreset } from '@open-pencil/scene-graph/shaders'
import type { Theme } from '../theme'
diff --git a/tools/generate/demo/src/document/slot-content.ts b/tools/generate/demo/src/document/slot-content.ts
index 94dc67afb..33b64cc9a 100644
--- a/tools/generate/demo/src/document/slot-content.ts
+++ b/tools/generate/demo/src/document/slot-content.ts
@@ -1,11 +1,11 @@
import type { TreeNode } from '@open-pencil/design-jsx'
+import type { SceneGraph } from '@open-pencil/scene-graph'
import {
claimSlotContent,
instanceSlotFrames,
slotPropertyId,
- slotScope,
- type SceneGraph
-} from '@open-pencil/scene-graph'
+ slotScope
+} from '@open-pencil/scene-graph/slots'
import { renderTree } from './icons'
diff --git a/tools/generate/demo/src/shaders/page.ts b/tools/generate/demo/src/shaders/page.ts
index 4c821db72..83d8ca7d1 100644
--- a/tools/generate/demo/src/shaders/page.ts
+++ b/tools/generate/demo/src/shaders/page.ts
@@ -5,7 +5,7 @@
*/
import { createRendererFromJSON } from 'shaders/core'
-import { shaderFrameEncoding, type ShaderPreset } from '@open-pencil/scene-graph'
+import { shaderFrameEncoding, type ShaderPreset } from '@open-pencil/scene-graph/shaders'
export interface ShaderStillPage {
renderStill(preset: ShaderPreset, width: number, height: number): Promise<string>
diff --git a/tools/generate/demo/src/shaders/stills.ts b/tools/generate/demo/src/shaders/stills.ts
index d6f3fbfe1..74e314931 100644
--- a/tools/generate/demo/src/shaders/stills.ts
+++ b/tools/generate/demo/src/shaders/stills.ts
@@ -3,16 +3,15 @@ import { fileURLToPath } from 'node:url'
import { chromium } from '@playwright/test'
import { toUint8Array } from 'js-base64'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
import {
isShaderFrameCurrent,
shaderFramePixels,
shaderOfPaint,
shaderPresetKey,
withShaderPaints,
- type SceneGraph,
- type SceneNode,
type ShaderPaint
-} from '@open-pencil/scene-graph'
+} from '@open-pencil/scene-graph/shaders'
import type { ShaderStillPage } from './page'
diff --git a/tools/generate/demo/tests/build.test.ts b/tools/generate/demo/tests/build.test.ts
index 433bfc3e4..dbf83dfa4 100644
--- a/tools/generate/demo/tests/build.test.ts
+++ b/tools/generate/demo/tests/build.test.ts
@@ -3,17 +3,11 @@ import { beforeAll, describe, expect, test } from 'bun:test'
import { buildDemoGraph, measuringRenderer } from '#demo/build'
import { CHAPTERS, sectionName } from '#demo/document/chapters/names'
-import { exportFigFile, readFigFile } from '@open-pencil/core/io'
-import { populateAllFigPages } from '@open-pencil/core/io/formats/fig'
-import {
- instanceSlotFrames,
- missingBindings,
- ownsSlotContent,
- readBehaviour,
- readShaderPaints,
- type SceneGraph,
- type SceneNode
-} from '@open-pencil/scene-graph'
+import { exportFigFile, readFigFile, populateAllFigPages } from '@open-pencil/core/io/formats/fig'
+import type { SceneGraph, SceneNode } from '@open-pencil/scene-graph'
+import { missingBindings, readBehaviour } from '@open-pencil/scene-graph/behaviours'
+import { readShaderPaints } from '@open-pencil/scene-graph/shaders'
+import { instanceSlotFrames, ownsSlotContent } from '@open-pencil/scene-graph/slots'
let graph: SceneGraph
diff --git a/tools/generate/tauri-menu/src/menu.ts b/tools/generate/tauri-menu/src/menu.ts
index 671715809..91aefc234 100644
--- a/tools/generate/tauri-menu/src/menu.ts
+++ b/tools/generate/tauri-menu/src/menu.ts
@@ -1,6 +1,6 @@
import { compact } from 'es-toolkit/array'
-import { editorCommandMetadata } from '@open-pencil/vue'
+import { editorCommandMetadata } from '@open-pencil/vue/editor/commands'
import { APP_MENU_APP_ITEMS, APP_MENU_SCHEMA } from '@/app/shell/menu/schema'
import type { AppMenuActionItem, AppMenuEntry, AppMenuGroupSchema } from '@/app/shell/menu/schema'
diff --git a/tools/generate/visual-oracles/src/document/capture/scene.ts b/tools/generate/visual-oracles/src/document/capture/scene.ts
index d564a38a1..f64606009 100644
--- a/tools/generate/visual-oracles/src/document/capture/scene.ts
+++ b/tools/generate/visual-oracles/src/document/capture/scene.ts
@@ -1,5 +1,6 @@
-import type { Color, Fill, SceneGraph, Stroke } from '@open-pencil/scene-graph'
+import type { Fill, SceneGraph, Stroke } from '@open-pencil/scene-graph'
import { getWorldMatrix } from '@open-pencil/scene-graph/coordinate'
+import type { Color } from '@open-pencil/scene-graph/primitives'
import type { SceneOracleNode } from '../scene-oracle'
diff --git a/tools/generate/visual-oracles/src/operations/analyze-pattern.ts b/tools/generate/visual-oracles/src/operations/analyze-pattern.ts
index 0e8b96a9e..8ee41b63f 100644
--- a/tools/generate/visual-oracles/src/operations/analyze-pattern.ts
+++ b/tools/generate/visual-oracles/src/operations/analyze-pattern.ts
@@ -2,7 +2,7 @@
import { existsSync } from 'node:fs'
import { parseArgs } from 'node:util'
-import { initCanvasKit } from '@open-pencil/core/io'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import type { PixelImage } from '../image/pixel-image'
diff --git a/tools/generate/visual-oracles/src/operations/analyze-text-decoration.ts b/tools/generate/visual-oracles/src/operations/analyze-text-decoration.ts
index 6d378b2e8..886332db5 100644
--- a/tools/generate/visual-oracles/src/operations/analyze-text-decoration.ts
+++ b/tools/generate/visual-oracles/src/operations/analyze-text-decoration.ts
@@ -2,7 +2,7 @@
import { existsSync } from 'node:fs'
import { parseArgs } from 'node:util'
-import { initCanvasKit } from '@open-pencil/core/io'
+import { initCanvasKit } from '@open-pencil/core/io/formats/raster'
import type { PixelImage } from '../image/pixel-image'
diff --git a/tools/generate/visual-oracles/src/operations/bisect.ts b/tools/generate/visual-oracles/src/operations/bisect.ts
index 09beeb4cb..e5c7311fd 100644
--- a/tools/generate/visual-oracles/src/operations/bisect.ts
+++ b/tools/generate/visual-oracles/src/operations/bisect.ts
@@ -6,7 +6,8 @@ import { parseArgs } from 'node:util'
import { $ } from 'bun'
-import { headlessRenderNodes, initCanvasKit, parseFigFile } from '@open-pencil/core/io'
+import { parseFigFile } from '@open-pencil/core/io/formats/fig'
+import { headlessRenderNodes, initCanvasKit } from '@open-pencil/core/io/formats/raster'
import { computeAllLayouts } from '@open-pencil/core/layout'
import type { SceneGraph } from '@open-pencil/scene-graph'
import { parseColor } from '@open-pencil/scene-graph/color'
diff --git a/tools/generate/visual-oracles/src/operations/compare/node.ts b/tools/generate/visual-oracles/src/operations/compare/node.ts
index 9446f3628..8cfe3c5d6 100644
--- a/tools/generate/visual-oracles/src/operations/compare/node.ts
+++ b/tools/generate/visual-oracles/src/operations/compare/node.ts
@@ -20,10 +20,11 @@ import { parseArgs } from 'node:util'
import { $ } from 'bun'
import { SkiaRenderer } from '@open-pencil/core/canvas'
-import { importClipboardNodes, parseFigmaClipboard } from '@open-pencil/core/clipboard'
-import { renderNodesToImage, initCanvasKit } from '@open-pencil/core/io'
+import { importClipboardNodes } from '@open-pencil/core/clipboard'
+import { renderNodesToImage, initCanvasKit } from '@open-pencil/core/io/formats/raster'
import { computeAllLayouts } from '@open-pencil/core/layout'
import { fontManager } from '@open-pencil/core/text'
+import { parseFigmaClipboard } from '@open-pencil/fig/clipboard'
import { SceneGraph } from '@open-pencil/scene-graph'
const { values: opts } = parseArgs({
diff --git a/tools/generate/visual-oracles/src/operations/interpret-instance.ts b/tools/generate/visual-oracles/src/operations/interpret-instance.ts
index f80c49808..3971b6a5b 100644
--- a/tools/generate/visual-oracles/src/operations/interpret-instance.ts
+++ b/tools/generate/visual-oracles/src/operations/interpret-instance.ts
@@ -7,7 +7,7 @@ import { toUint8Array } from 'js-base64'
import * as v from 'valibot'
import { SkiaRenderer } from '@open-pencil/core/canvas'
-import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io'
+import { initCanvasKit, renderNodesToImage } from '@open-pencil/core/io/formats/raster'
import { prepareGraphFonts } from '@open-pencil/core/text'
import { parseFigBuffer } from '@open-pencil/fig'
import {
diff --git a/tsconfig.json b/tsconfig.json
index c0fffade7..792d2b0c1 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -76,6 +76,9 @@
"@open-pencil/vue": [
"./packages/vue/src/index.ts"
],
+ "@open-pencil/vue/*": [
+ "./packages/vue/src/*"
+ ],
"@open-pencil/core": [
"./packages/core/src/index.ts"
],
diff --git a/tsconfig.tests.json b/tsconfig.tests.json
index c4dbdad55..48a76aa00 100644
--- a/tsconfig.tests.json
+++ b/tsconfig.tests.json
@@ -70,6 +70,9 @@
"@open-pencil/vue": [
"./packages/vue/src/index.ts"
],
+ "@open-pencil/vue/*": [
+ "./packages/vue/src/*"
+ ],
"@open-pencil/core": [
"./packages/core/src/index.ts"
],
@@ -79,6 +82,15 @@
"@open-pencil/dom-css": [
"./packages/dom-css/src/index.ts"
],
+ "@open-pencil/dom-css/scene-graph": [
+ "./packages/dom-css/src/import/scene-graph.ts"
+ ],
+ "@open-pencil/dom-css/export": [
+ "./packages/dom-css/src/export/index.ts"
+ ],
+ "@open-pencil/dom-css/*": [
+ "./packages/dom-css/src/*"
+ ],
"#scene-graph/*": [
"./packages/scene-graph/src/*"
],
diff --git a/vite/aliases.ts b/vite/aliases.ts
index 71bc508ce..df581cadd 100644
--- a/vite/aliases.ts
+++ b/vite/aliases.ts
@@ -33,6 +33,7 @@ export function createOpenPencilAliases(rootDir: string, options: { cloud?: bool
{ find: '#vue', replacement: resolve(rootDir, 'packages/vue/src') },
{ find: '#core', replacement: resolve(rootDir, 'packages/core/src') },
{ find: '#dom-css', replacement: resolve(rootDir, 'packages/dom-css/src') },
+ { find: '#scene-graph', replacement: resolve(rootDir, 'packages/scene-graph/src') },
{
find: /^@open-pencil\/dom-css\/browser$/,
replacement: resolve(rootDir, 'packages/dom-css/src/browser.ts')
@@ -61,15 +62,6 @@ export function createOpenPencilAliases(rootDir: string, options: { cloud?: bool
find: /^@open-pencil\/scene-graph$/,
replacement: resolve(rootDir, 'packages/scene-graph/src/index.ts')
},
- // Subpaths whose names differ from their files under src/.
- {
- find: /^@open-pencil\/scene-graph\/text-direction$/,
- replacement: resolve(rootDir, 'packages/scene-graph/src/text/direction.ts')
- },
- {
- find: /^@open-pencil\/scene-graph\/text-picture$/,
- replacement: resolve(rootDir, 'packages/scene-graph/src/text/picture.ts')
- },
{ find: '@open-pencil/scene-graph', replacement: resolve(rootDir, 'packages/scene-graph/src') },
{ find: '#cloud', replacement: resolve(rootDir, 'packages/cloud/src') },
{
@@ -88,7 +80,6 @@ export function createOpenPencilAliases(rootDir: string, options: { cloud?: bool
},
{ find: /^@open-pencil\/pen$/, replacement: resolve(rootDir, 'packages/pen/src/index.ts') },
{ find: '@open-pencil/pen', replacement: resolve(rootDir, 'packages/pen/src') },
- { find: /^@open-pencil\/kiwi$/, replacement: resolve(rootDir, 'packages/kiwi/src/index.ts') },
{ find: '@open-pencil/kiwi', replacement: resolve(rootDir, 'packages/kiwi/src') },
{ find: /^@open-pencil\/fig$/, replacement: resolve(rootDir, 'packages/fig/src/index.ts') },
{ find: '@open-pencil/fig', replacement: resolve(rootDir, 'packages/fig/src') },