@dxos/plugin-illustrator 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/IllustratorPlugin.mjs +7 -3
- package/dist/lib/IllustratorPlugin.mjs.map +1 -1
- package/dist/lib/IllustratorPlugin.node.mjs +3 -3
- package/dist/lib/IllustratorPlugin.node.mjs.map +1 -1
- package/dist/lib/IllustratorPlugin.workerd.mjs +2 -2
- package/dist/lib/IllustratorPlugin.workerd.mjs.map +1 -1
- package/dist/lib/capabilities.mjs +2 -1
- package/dist/lib/capabilities.mjs.map +1 -1
- package/dist/lib/chunk-Drawing.mjs +64 -0
- package/dist/lib/chunk-Drawing.mjs.map +1 -0
- package/dist/lib/chunk-IllustratorCapabilities.mjs +2 -2
- package/dist/lib/chunk-IllustratorCapabilities.mjs.map +1 -1
- package/dist/lib/chunk-comment-config.mjs +3 -3
- package/dist/lib/chunk-comment-config.mjs.map +1 -1
- package/dist/lib/chunk-create-object.mjs +13 -12
- package/dist/lib/chunk-create-object.mjs.map +1 -1
- package/dist/lib/chunk-create.mjs +5 -4
- package/dist/lib/chunk-create.mjs.map +1 -1
- package/dist/lib/chunk-edit.mjs +4 -4
- package/dist/lib/chunk-edit.mjs.map +1 -1
- package/dist/lib/chunk-generate.mjs +20 -0
- package/dist/lib/chunk-generate.mjs.map +1 -0
- package/dist/lib/chunk-load-drawing.mjs +35 -0
- package/dist/lib/chunk-load-drawing.mjs.map +1 -0
- package/dist/lib/chunk-meta.mjs +2 -1
- package/dist/lib/chunk-meta.mjs.map +1 -1
- package/dist/lib/chunk-migrations.mjs +23 -0
- package/dist/lib/chunk-migrations.mjs.map +1 -0
- package/dist/lib/chunk-model.mjs +387 -4
- package/dist/lib/chunk-model.mjs.map +1 -1
- package/dist/lib/chunk-react-surface.mjs +14 -13
- package/dist/lib/chunk-react-surface.mjs.map +1 -1
- package/dist/lib/chunk-read.mjs +4 -4
- package/dist/lib/chunk-read.mjs.map +1 -1
- package/dist/lib/chunk-skill-definition.mjs +2 -2
- package/dist/lib/chunk-skill-definition.mjs.map +1 -1
- package/dist/lib/chunk-skills.mjs +10 -10
- package/dist/lib/chunk-skills.mjs.map +1 -1
- package/dist/lib/chunk-types.mjs +41 -49
- package/dist/lib/chunk-types.mjs.map +1 -1
- package/dist/lib/components.mjs +6 -6
- package/dist/lib/components.mjs.map +1 -1
- package/dist/lib/containers.mjs +17 -19
- package/dist/lib/containers.mjs.map +1 -1
- package/dist/lib/index.mjs +4 -3
- package/dist/lib/model.mjs +2 -2
- package/dist/lib/operations.mjs +1 -1
- package/dist/lib/operations.mjs.map +1 -1
- package/dist/lib/skills.mjs +1 -1
- package/dist/lib/translations.mjs +13 -13
- package/dist/lib/translations.mjs.map +1 -1
- package/dist/lib/types.mjs +3 -2
- package/dist/lib/util.mjs +2 -2
- package/dist/types/src/IllustratorPlugin.d.ts.map +1 -1
- package/dist/types/src/IllustratorPlugin.node.d.ts +1 -1
- package/dist/types/src/IllustratorPlugin.test.d.ts +2 -0
- package/dist/types/src/IllustratorPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +1 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +7 -0
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
- package/dist/types/src/capabilities/migrations.test.d.ts +2 -0
- package/dist/types/src/capabilities/migrations.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -1
- package/dist/types/src/components/CreateDrawingPanel.d.ts +15 -0
- package/dist/types/src/components/CreateDrawingPanel.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DrawingArticle/DrawingArticle.d.ts +11 -0
- package/dist/types/src/containers/DrawingArticle/DrawingArticle.d.ts.map +1 -0
- package/dist/types/src/containers/DrawingArticle/index.d.ts +2 -0
- package/dist/types/src/containers/DrawingArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/DrawingCard/DrawingCard.d.ts +10 -0
- package/dist/types/src/containers/DrawingCard/DrawingCard.d.ts.map +1 -0
- package/dist/types/src/containers/DrawingCard/index.d.ts +2 -0
- package/dist/types/src/containers/DrawingCard/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +2 -2
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/model/builder.d.ts +18 -26
- package/dist/types/src/model/builder.d.ts.map +1 -1
- package/dist/types/src/model/content.d.ts +60 -0
- package/dist/types/src/model/content.d.ts.map +1 -0
- package/dist/types/src/model/index.d.ts +2 -0
- package/dist/types/src/model/index.d.ts.map +1 -1
- package/dist/types/src/model/mermaid.d.ts +38 -0
- package/dist/types/src/model/mermaid.d.ts.map +1 -0
- package/dist/types/src/model/mermaid.test.d.ts +3 -0
- package/dist/types/src/model/mermaid.test.d.ts.map +1 -0
- package/dist/types/src/operations/create.d.ts +2 -2
- package/dist/types/src/operations/create.d.ts.map +1 -1
- package/dist/types/src/operations/edit.d.ts +2 -2
- package/dist/types/src/operations/edit.d.ts.map +1 -1
- package/dist/types/src/operations/generate.d.ts +5 -0
- package/dist/types/src/operations/generate.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/read.d.ts +2 -2
- package/dist/types/src/operations/read.d.ts.map +1 -1
- package/dist/types/src/skills/{sketch-skill.d.ts → drawing-skill.d.ts} +1 -1
- package/dist/types/src/skills/drawing-skill.d.ts.map +1 -0
- package/dist/types/src/skills/index.d.ts +1 -1
- package/dist/types/src/skills/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +10 -10
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Drawing.d.ts +50 -0
- package/dist/types/src/types/Drawing.d.ts.map +1 -0
- package/dist/types/src/types/{SketchOperation.d.ts → DrawingOperation.d.ts} +111 -5
- package/dist/types/src/types/DrawingOperation.d.ts.map +1 -0
- package/dist/types/src/types/IllustratorCapabilities.d.ts +4 -4
- package/dist/types/src/types/IllustratorCapabilities.d.ts.map +1 -1
- package/dist/types/src/types/LegacySketch.d.ts +17 -0
- package/dist/types/src/types/LegacySketch.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +18 -18
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/load-drawing.d.ts +22 -0
- package/dist/types/src/util/load-drawing.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +1 -0
- package/package.json +21 -19
- package/src/IllustratorPlugin.node.tsx +3 -3
- package/src/IllustratorPlugin.test.ts +32 -0
- package/src/IllustratorPlugin.tsx +15 -3
- package/src/IllustratorPlugin.workerd.tsx +2 -2
- package/src/capabilities/comment-config.ts +2 -2
- package/src/capabilities/create-object.ts +16 -14
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/migrations.test.ts +142 -0
- package/src/capabilities/migrations.ts +28 -0
- package/src/capabilities/react-surface.ts +36 -0
- package/src/capabilities/skill-definition.ts +2 -2
- package/src/components/{CreateSketchPanel.tsx → CreateDrawingPanel.tsx} +7 -7
- package/src/components/index.ts +1 -1
- package/src/containers/{SketchArticle/SketchArticle.tsx → DrawingArticle/DrawingArticle.tsx} +10 -11
- package/src/containers/{SketchArticle → DrawingArticle}/index.ts +1 -1
- package/src/containers/DrawingCard/DrawingCard.tsx +38 -0
- package/src/containers/{SketchCard → DrawingCard}/index.ts +1 -1
- package/src/containers/index.ts +2 -2
- package/src/model/builder.ts +34 -26
- package/src/model/content.ts +180 -0
- package/src/model/index.ts +2 -0
- package/src/model/mermaid.test.ts +116 -0
- package/src/model/mermaid.ts +299 -0
- package/src/operations/create.ts +6 -6
- package/src/operations/edit.ts +5 -5
- package/src/operations/generate.ts +25 -0
- package/src/operations/index.ts +1 -0
- package/src/operations/read.ts +5 -5
- package/src/skills/{sketch-skill.ts → drawing-skill.ts} +7 -7
- package/src/skills/index.ts +1 -1
- package/src/translations.ts +12 -12
- package/src/types/Drawing.ts +69 -0
- package/src/types/{SketchOperation.ts → DrawingOperation.ts} +28 -9
- package/src/types/IllustratorCapabilities.ts +4 -4
- package/src/types/LegacySketch.ts +25 -0
- package/src/types/index.ts +3 -2
- package/src/types/types.ts +18 -18
- package/src/util/index.ts +1 -1
- package/src/util/load-drawing.ts +48 -0
- package/dist/lib/chunk-load-sketch.mjs +0 -64
- package/dist/lib/chunk-load-sketch.mjs.map +0 -1
- package/dist/types/src/components/CreateSketchPanel.d.ts +0 -15
- package/dist/types/src/components/CreateSketchPanel.d.ts.map +0 -1
- package/dist/types/src/containers/SketchArticle/SketchArticle.d.ts +0 -11
- package/dist/types/src/containers/SketchArticle/SketchArticle.d.ts.map +0 -1
- package/dist/types/src/containers/SketchArticle/index.d.ts +0 -2
- package/dist/types/src/containers/SketchArticle/index.d.ts.map +0 -1
- package/dist/types/src/containers/SketchCard/SketchCard.d.ts +0 -10
- package/dist/types/src/containers/SketchCard/SketchCard.d.ts.map +0 -1
- package/dist/types/src/containers/SketchCard/index.d.ts +0 -2
- package/dist/types/src/containers/SketchCard/index.d.ts.map +0 -1
- package/dist/types/src/skills/sketch-skill.d.ts.map +0 -1
- package/dist/types/src/types/Sketch.d.ts +0 -50
- package/dist/types/src/types/Sketch.d.ts.map +0 -1
- package/dist/types/src/types/SketchOperation.d.ts.map +0 -1
- package/dist/types/src/util/load-sketch.d.ts +0 -37
- package/dist/types/src/util/load-sketch.d.ts.map +0 -1
- package/src/capabilities/react-surface.tsx +0 -37
- package/src/containers/SketchCard/SketchCard.tsx +0 -41
- package/src/types/Sketch.ts +0 -69
- package/src/util/load-sketch.ts +0 -74
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { Plugin } from "@dxos/app-framework";
|
|
2
|
-
import {
|
|
2
|
+
import { Drawing } from "#types";
|
|
3
3
|
import { meta } from "#meta";
|
|
4
4
|
import { AppPlugin } from "@dxos/app-toolkit";
|
|
5
|
-
import {
|
|
5
|
+
import { ClientEvents } from "@dxos/plugin-client";
|
|
6
|
+
import { CommentConfig, CreateObject, Migrations, OperationHandler, ReactSurface, SkillDefinition } from "#capabilities";
|
|
6
7
|
import { translations } from "#translations";
|
|
7
8
|
//#endregion
|
|
8
9
|
//#region src/IllustratorPlugin.tsx
|
|
9
|
-
var IllustratorPlugin = Plugin.define(meta).pipe(
|
|
10
|
+
var IllustratorPlugin = Plugin.define(meta).pipe(Plugin.addModule({
|
|
11
|
+
activatesOn: ClientEvents.SetupMigration,
|
|
12
|
+
activate: Migrations
|
|
13
|
+
}), AppPlugin.addCommentConfigModule({ activate: CommentConfig }), AppPlugin.addCreateObjectModule({ activate: CreateObject }), AppPlugin.addOperationHandlerModule({ activate: OperationHandler }), AppPlugin.addSchemaModule({ schema: [Drawing.Drawing, Drawing.Canvas] }), AppPlugin.addSkillDefinitionModule({ activate: SkillDefinition }), AppPlugin.addSurfaceModule({ activate: ReactSurface }), AppPlugin.addTranslationsModule({ translations }), AppPlugin.addPluginAssetModule({ asset: {
|
|
10
14
|
pluginId: meta.profile.key,
|
|
11
15
|
path: "PLUGIN.mdl",
|
|
12
16
|
content: "---\nid: org.dxos.plugin.illustrator\nname: IllustratorPlugin\nversion: 0.1.0\n---\n\nA headless diagramming host plugin for `DXOS` Composer. Owns the base `Sketch` ECHO type, the\nrenderer-neutral scene DSL and dialect registry, and the agent-facing sketch skill/operations.\nCanvas renderers (e.g. plugin-tldraw, plugin-excalidraw) contribute a `SketchVariant` capability\nsupplying their canvas schema, a builder that maps the scene DSL onto their records, and surface\ncomponents; plugin-illustrator resolves the variant at runtime and delegates.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype Sketch\n desc: Named handle around a renderer-specific canvas object.\n fields:\n name?: string\n canvas: Ref<Unknown> # reference to the renderer-specific canvas (e.g. Tldraw.Canvas)\n```\n\n## Capabilities\n\n```mdl\ncomponent VariantProvider\n desc: Contributed by renderer plugins; supplies the canvas type, a scene-DSL builder\n (read/apply), a create factory, and Article/Card surface components.\n```\n\n## Operations\n\n```mdl\nop create\n desc: Creates a Sketch with an empty canvas for the requested (or default) variant.\n\nop read\n desc: Returns the current scene of a sketch as world objects with object-local coordinates.\n\nop edit\n desc: Applies scene commands to a sketch via the variant's builder; returns the resulting scene.\n```\n",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IllustratorPlugin.mjs","names":[],"sources":["../../src/IllustratorPlugin.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport {
|
|
1
|
+
{"version":3,"file":"IllustratorPlugin.mjs","names":[],"sources":["../../src/IllustratorPlugin.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { ClientEvents } from '@dxos/plugin-client';\n\nimport {\n CommentConfig,\n CreateObject,\n Migrations,\n OperationHandler,\n ReactSurface,\n SkillDefinition,\n} from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { Drawing } from '#types';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const IllustratorPlugin = Plugin.define(meta).pipe(\n Plugin.addModule({\n activatesOn: ClientEvents.SetupMigration,\n activate: Migrations,\n }),\n AppPlugin.addCommentConfigModule({ activate: CommentConfig }),\n AppPlugin.addCreateObjectModule({ activate: CreateObject }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSchemaModule({ schema: [Drawing.Drawing, Drawing.Canvas] }),\n AppPlugin.addSkillDefinitionModule({ activate: SkillDefinition }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default IllustratorPlugin;\n"],"mappings":";;;;;;;;;AAuBA,IAAa,oBAAoB,OAAO,OAAO,IAAI,CAAC,CAAC,KACnD,OAAO,UAAU;CACf,aAAa,aAAa;CAC1B,UAAU;AACZ,CAAC,GACD,UAAU,uBAAuB,EAAE,UAAU,cAAc,CAAC,GAC5D,UAAU,sBAAsB,EAAE,UAAU,aAAa,CAAC,GAC1D,UAAU,0BAA0B,EAAE,UAAU,iBAAiB,CAAC,GAClE,UAAU,gBAAgB,EAAE,QAAQ,CAAC,QAAQ,SAAS,QAAQ,MAAM,EAAE,CAAC,GACvE,UAAU,yBAAyB,EAAE,UAAU,gBAAgB,CAAC,GAChE,UAAU,iBAAiB,EAAE,UAAU,aAAa,CAAC,GACrD,UAAU,sBAAsB,EAAE,aAAa,CAAC,GAChD,UAAU,qBAAqB,EAC7B,OAAO;CAAE,UAAU,KAAK,QAAQ;CAAK,MAAM;CAAc,SAAS;CAAY,UAAU;AAAoB,EAC9G,CAAC,GACD,OAAO,IACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from "@dxos/app-framework";
|
|
2
|
-
import {
|
|
2
|
+
import { Drawing } from "#types";
|
|
3
3
|
import { meta } from "#meta";
|
|
4
4
|
import { AppPlugin } from "@dxos/app-toolkit";
|
|
5
5
|
import { OperationHandler, SkillDefinition } from "#capabilities";
|
|
@@ -8,10 +8,10 @@ import { translations } from "#translations";
|
|
|
8
8
|
/**
|
|
9
9
|
* Headless variant of IllustratorPlugin (no React surfaces / CreateObject panel).
|
|
10
10
|
* Used in node contexts (CLI, agents, tests) where rendering is unavailable —
|
|
11
|
-
* the full variant lazy-loads `
|
|
11
|
+
* the full variant lazy-loads `CreateDrawingPanel` from `react-ui-search` which
|
|
12
12
|
* downstream bundlers don't resolve cleanly under nested pnpm symlinks.
|
|
13
13
|
*/
|
|
14
|
-
var IllustratorPlugin = Plugin.define(meta).pipe(AppPlugin.addOperationHandlerModule({ activate: OperationHandler }), AppPlugin.addSchemaModule({ schema: [
|
|
14
|
+
var IllustratorPlugin = Plugin.define(meta).pipe(AppPlugin.addOperationHandlerModule({ activate: OperationHandler }), AppPlugin.addSchemaModule({ schema: [Drawing.Drawing, Drawing.Canvas] }), AppPlugin.addSkillDefinitionModule({ activate: SkillDefinition }), AppPlugin.addTranslationsModule({ translations }), Plugin.make);
|
|
15
15
|
//#endregion
|
|
16
16
|
export { IllustratorPlugin, IllustratorPlugin as default };
|
|
17
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IllustratorPlugin.node.mjs","names":[],"sources":["../../src/IllustratorPlugin.node.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { OperationHandler, SkillDefinition } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport {
|
|
1
|
+
{"version":3,"file":"IllustratorPlugin.node.mjs","names":[],"sources":["../../src/IllustratorPlugin.node.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { OperationHandler, SkillDefinition } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { Drawing } from '#types';\n\n/**\n * Headless variant of IllustratorPlugin (no React surfaces / CreateObject panel).\n * Used in node contexts (CLI, agents, tests) where rendering is unavailable —\n * the full variant lazy-loads `CreateDrawingPanel` from `react-ui-search` which\n * downstream bundlers don't resolve cleanly under nested pnpm symlinks.\n */\nexport const IllustratorPlugin = Plugin.define(meta).pipe(\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSchemaModule({ schema: [Drawing.Drawing, Drawing.Canvas] }),\n AppPlugin.addSkillDefinitionModule({ activate: SkillDefinition }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.make,\n);\n\nexport default IllustratorPlugin;\n"],"mappings":";;;;;;;;;;;;;AAkBA,IAAa,oBAAoB,OAAO,OAAO,IAAI,CAAC,CAAC,KACnD,UAAU,0BAA0B,EAAE,UAAU,iBAAiB,CAAC,GAClE,UAAU,gBAAgB,EAAE,QAAQ,CAAC,QAAQ,SAAS,QAAQ,MAAM,EAAE,CAAC,GACvE,UAAU,yBAAyB,EAAE,UAAU,gBAAgB,CAAC,GAChE,UAAU,sBAAsB,EAAE,aAAa,CAAC,GAChD,OAAO,IACT"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Plugin } from "@dxos/app-framework";
|
|
2
|
-
import {
|
|
2
|
+
import { Drawing } from "#types";
|
|
3
3
|
import { meta } from "#meta";
|
|
4
4
|
import { AppPlugin } from "@dxos/app-toolkit";
|
|
5
5
|
//#region src/IllustratorPlugin.workerd.tsx
|
|
6
|
-
var IllustratorPlugin = Plugin.define(meta).pipe(AppPlugin.addSchemaModule({ schema: [
|
|
6
|
+
var IllustratorPlugin = Plugin.define(meta).pipe(AppPlugin.addSchemaModule({ schema: [Drawing.Drawing, Drawing.Canvas] }), Plugin.make);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { IllustratorPlugin, IllustratorPlugin as default };
|
|
9
9
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IllustratorPlugin.workerd.mjs","names":[],"sources":["../../src/IllustratorPlugin.workerd.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { meta } from '#meta';\nimport {
|
|
1
|
+
{"version":3,"file":"IllustratorPlugin.workerd.mjs","names":[],"sources":["../../src/IllustratorPlugin.workerd.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { meta } from '#meta';\nimport { Drawing } from '#types';\n\nexport const IllustratorPlugin = Plugin.define(meta).pipe(\n AppPlugin.addSchemaModule({ schema: [Drawing.Drawing, Drawing.Canvas] }),\n Plugin.make,\n);\n\nexport default IllustratorPlugin;\n"],"mappings":";;;;;AAUA,IAAa,oBAAoB,OAAO,OAAO,IAAI,CAAC,CAAC,KACnD,UAAU,gBAAgB,EAAE,QAAQ,CAAC,QAAQ,SAAS,QAAQ,MAAM,EAAE,CAAC,GACvE,OAAO,IACT"}
|
|
@@ -2,10 +2,11 @@ import { Capability } from "@dxos/app-framework";
|
|
|
2
2
|
//#region src/capabilities/index.ts
|
|
3
3
|
var CommentConfig = Capability.lazy("CommentConfig", () => import("./chunk-comment-config.mjs"));
|
|
4
4
|
var CreateObject = Capability.lazy("CreateObject", () => import("./chunk-create-object.mjs"));
|
|
5
|
+
var Migrations = Capability.lazy("IllustratorMigrations", () => import("./chunk-migrations.mjs"));
|
|
5
6
|
var OperationHandler = Capability.lazy("OperationHandler", () => import("./chunk-operation-handler.mjs"));
|
|
6
7
|
var ReactSurface = Capability.lazy("ReactSurface", () => import("./chunk-react-surface.mjs"));
|
|
7
8
|
var SkillDefinition = Capability.lazy("SkillDefinition", () => import("./chunk-skill-definition.mjs"));
|
|
8
9
|
//#endregion
|
|
9
|
-
export { CommentConfig, CreateObject, OperationHandler, ReactSurface, SkillDefinition };
|
|
10
|
+
export { CommentConfig, CreateObject, Migrations, OperationHandler, ReactSurface, SkillDefinition };
|
|
10
11
|
|
|
11
12
|
//# sourceMappingURL=capabilities.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const CommentConfig = Capability.lazy('CommentConfig', () => import('./comment-config'));\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\nexport const SkillDefinition = Capability.lazy('SkillDefinition', () => import('./skill-definition'));\n"],"mappings":";;AAOA,IAAa,gBAAgB,WAAW,KAAK,uBAAuB,OAAO,6BAAmB;AAC9F,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB;AAC3F,IAAa,mBAAmB,WAAW,KACzC,0BACM,OAAO,gCACf;AACA,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB;AAC3F,IAAa,kBAAkB,WAAW,KAAK,yBAAyB,OAAO,+BAAqB"}
|
|
1
|
+
{"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport const CommentConfig = Capability.lazy('CommentConfig', () => import('./comment-config'));\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const Migrations = Capability.lazy('IllustratorMigrations', () => import('./migrations'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\nexport const SkillDefinition = Capability.lazy('SkillDefinition', () => import('./skill-definition'));\n"],"mappings":";;AAOA,IAAa,gBAAgB,WAAW,KAAK,uBAAuB,OAAO,6BAAmB;AAC9F,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB;AAC3F,IAAa,aAAa,WAAW,KAAK,+BAA+B,OAAO,yBAAe;AAC/F,IAAa,mBAAmB,WAAW,KACzC,0BACM,OAAO,gCACf;AACA,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB;AAC3F,IAAa,kBAAkB,WAAW,KAAK,yBAAyB,OAAO,+BAAqB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
|
|
2
|
+
import { Annotation, DXN, Obj, Ref, Type } from "@dxos/echo";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import { FormInputAnnotation, HiddenAnnotation, LabelAnnotation } from "@dxos/echo/Annotation";
|
|
5
|
+
import { CardAnnotation, CollectionItemAnnotation } from "@dxos/schema";
|
|
6
|
+
//#region src/types/Drawing.ts
|
|
7
|
+
var Drawing_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
Canvas: () => Canvas,
|
|
9
|
+
Drawing: () => Drawing,
|
|
10
|
+
isCanvas: () => isCanvas,
|
|
11
|
+
isDrawing: () => isDrawing,
|
|
12
|
+
make: () => make,
|
|
13
|
+
makeCanvas: () => makeCanvas
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* Canvas content shared by every renderer: an opaque map of record id → record, managed by the
|
|
17
|
+
* renderer's store adapter and CRDT-merged by ECHO without knowing its shape. `schema` identifies
|
|
18
|
+
* the renderer dialect (e.g. `tldraw.com/2`, `excalidraw.com/2`) and is how a `Drawing` is matched
|
|
19
|
+
* to the variant that can render it.
|
|
20
|
+
*
|
|
21
|
+
* Hidden: reached through `Drawing.canvas`, never listed on its own.
|
|
22
|
+
*/
|
|
23
|
+
var Canvas = class extends Type.makeObject(DXN.make("org.dxos.type.canvas", "0.1.0"))(Schema.Struct({
|
|
24
|
+
schema: Schema.String.pipe(Schema.optional),
|
|
25
|
+
content: Schema.Record({
|
|
26
|
+
key: Schema.String,
|
|
27
|
+
value: Schema.Any
|
|
28
|
+
})
|
|
29
|
+
}).pipe(HiddenAnnotation.set(true))) {};
|
|
30
|
+
/** Creates a {@link Canvas} for the given renderer schema. */
|
|
31
|
+
var makeCanvas = ({ schema, content = {} }) => Obj.make(Canvas, {
|
|
32
|
+
schema,
|
|
33
|
+
content
|
|
34
|
+
});
|
|
35
|
+
/** Type guard for {@link Canvas} objects. */
|
|
36
|
+
var isCanvas = (object) => Obj.instanceOf(Canvas, object);
|
|
37
|
+
/**
|
|
38
|
+
* Base Drawing object. Renderer-specific behaviour lives in the variant that claims the canvas's
|
|
39
|
+
* `schema`, so all renderers (tldraw, excalidraw, ...) share one typename, graph node, create
|
|
40
|
+
* flow, and surface scaffolding.
|
|
41
|
+
*/
|
|
42
|
+
var Drawing = class extends Type.makeObject(DXN.make("org.dxos.type.drawing", "0.1.0"))(Schema.Struct({
|
|
43
|
+
name: Schema.optional(Schema.String),
|
|
44
|
+
canvas: Ref.Ref(Canvas).annotations({ description: "Reference to the canvas holding the renderer-specific content." }).pipe(FormInputAnnotation.set(false))
|
|
45
|
+
}).pipe(LabelAnnotation.set(["name"]), Annotation.IconAnnotation.set({
|
|
46
|
+
icon: "ph--compass-tool--regular",
|
|
47
|
+
hue: "indigo"
|
|
48
|
+
}), CardAnnotation.set(true), CollectionItemAnnotation.set(true))) {};
|
|
49
|
+
/**
|
|
50
|
+
* Build a `Drawing` referencing the given canvas.
|
|
51
|
+
*
|
|
52
|
+
* @param name Optional display name shown in the graph node and Properties form.
|
|
53
|
+
* @param canvas Canvas holding the renderer's content.
|
|
54
|
+
*/
|
|
55
|
+
var make = ({ name, canvas }) => Obj.make(Drawing, {
|
|
56
|
+
name,
|
|
57
|
+
canvas: Ref.make(canvas)
|
|
58
|
+
});
|
|
59
|
+
/** Type guard for {@link Drawing} objects. */
|
|
60
|
+
var isDrawing = (object) => Obj.instanceOf(Drawing, object);
|
|
61
|
+
//#endregion
|
|
62
|
+
export { makeCanvas as a, make as i, Drawing as n, Drawing_exports as r, Canvas as t };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=chunk-Drawing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-Drawing.mjs","names":[],"sources":["../../src/types/Drawing.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, DXN, Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation, HiddenAnnotation, LabelAnnotation } from '@dxos/echo/Annotation';\nimport { CardAnnotation, CollectionItemAnnotation } from '@dxos/schema';\n\n/**\n * Canvas content shared by every renderer: an opaque map of record id → record, managed by the\n * renderer's store adapter and CRDT-merged by ECHO without knowing its shape. `schema` identifies\n * the renderer dialect (e.g. `tldraw.com/2`, `excalidraw.com/2`) and is how a `Drawing` is matched\n * to the variant that can render it.\n *\n * Hidden: reached through `Drawing.canvas`, never listed on its own.\n */\nexport class Canvas extends Type.makeObject<Canvas>(DXN.make('org.dxos.type.canvas', '0.1.0'))(\n Schema.Struct({\n schema: Schema.String.pipe(Schema.optional),\n content: Schema.Record({ key: Schema.String, value: Schema.Any }),\n }).pipe(HiddenAnnotation.set(true)),\n) {}\n\nexport type MakeCanvasOptions = Omit<Partial<Obj.MakeProps<typeof Canvas>>, 'schema'> & {\n /** Required at construction: matches the canvas to a renderer variant. */\n schema: string;\n};\n\n/** Creates a {@link Canvas} for the given renderer schema. */\nexport const makeCanvas = ({ schema, content = {} }: MakeCanvasOptions): Canvas =>\n Obj.make(Canvas, { schema, content });\n\n/** Type guard for {@link Canvas} objects. */\nexport const isCanvas = (object: unknown): object is Canvas => Obj.instanceOf(Canvas, object);\n\n/**\n * Base Drawing object. Renderer-specific behaviour lives in the variant that claims the canvas's\n * `schema`, so all renderers (tldraw, excalidraw, ...) share one typename, graph node, create\n * flow, and surface scaffolding.\n */\nexport class Drawing extends Type.makeObject<Drawing>(DXN.make('org.dxos.type.drawing', '0.1.0'))(\n Schema.Struct({\n name: Schema.optional(Schema.String),\n canvas: Ref.Ref(Canvas)\n .annotations({ description: 'Reference to the canvas holding the renderer-specific content.' })\n .pipe(FormInputAnnotation.set(false)),\n }).pipe(\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({ icon: 'ph--compass-tool--regular', hue: 'indigo' }),\n CardAnnotation.set(true),\n CollectionItemAnnotation.set(true),\n ),\n) {}\n\n/**\n * Build a `Drawing` referencing the given canvas.\n *\n * @param name Optional display name shown in the graph node and Properties form.\n * @param canvas Canvas holding the renderer's content.\n */\nexport const make = ({ name, canvas }: { name?: string; canvas: Canvas }): Drawing =>\n Obj.make(Drawing, { name, canvas: Ref.make(canvas) });\n\n/** Type guard for {@link Drawing} objects. */\nexport const isDrawing = (object: unknown): object is Drawing => Obj.instanceOf(Drawing, object);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAa,SAAb,cAA4B,KAAK,WAAmB,IAAI,KAAK,wBAAwB,OAAO,CAAC,CAAC,CAC5F,OAAO,OAAO;CACZ,QAAQ,OAAO,OAAO,KAAK,OAAO,QAAQ;CAC1C,SAAS,OAAO,OAAO;EAAE,KAAK,OAAO;EAAQ,OAAO,OAAO;CAAI,CAAC;AAClE,CAAC,CAAC,CAAC,KAAK,iBAAiB,IAAI,IAAI,CAAC,CACpC,CAAC,CAAC,CAAC;;AAQH,IAAa,cAAc,EAAE,QAAQ,UAAU,CAAC,QAC9C,IAAI,KAAK,QAAQ;CAAE;CAAQ;AAAQ,CAAC;;AAGtC,IAAa,YAAY,WAAsC,IAAI,WAAW,QAAQ,MAAM;;;;;;AAO5F,IAAa,UAAb,cAA6B,KAAK,WAAoB,IAAI,KAAK,yBAAyB,OAAO,CAAC,CAAC,CAC/F,OAAO,OAAO;CACZ,MAAM,OAAO,SAAS,OAAO,MAAM;CACnC,QAAQ,IAAI,IAAI,MAAM,CAAA,CACnB,YAAY,EAAE,aAAa,iEAAiE,CAAC,CAAA,CAC7F,KAAK,oBAAoB,IAAI,KAAK,CAAC;AACxC,CAAC,CAAC,CAAC,KACD,gBAAgB,IAAI,CAAC,MAAM,CAAC,GAC5B,WAAW,eAAe,IAAI;CAAE,MAAM;CAA6B,KAAK;AAAS,CAAC,GAClF,eAAe,IAAI,IAAI,GACvB,yBAAyB,IAAI,IAAI,CACnC,CACF,CAAC,CAAC,CAAC;;;;;;;AAQH,IAAa,QAAQ,EAAE,MAAM,aAC3B,IAAI,KAAK,SAAS;CAAE;CAAM,QAAQ,IAAI,KAAK,MAAM;AAAE,CAAC;;AAGtD,IAAa,aAAa,WAAuC,IAAI,WAAW,SAAS,MAAM"}
|
|
@@ -4,8 +4,8 @@ import { meta } from "#meta";
|
|
|
4
4
|
//#region src/types/IllustratorCapabilities.ts
|
|
5
5
|
var IllustratorCapabilities_exports = /* @__PURE__ */ __exportAll({ VariantProvider: () => VariantProvider });
|
|
6
6
|
/**
|
|
7
|
-
* A
|
|
8
|
-
*
|
|
7
|
+
* A drawing variant contribution. Each renderer plugin (tldraw, excalidraw, ...) contributes one
|
|
8
|
+
* via `Capability.contributes(IllustratorCapabilities.VariantProvider, variant)`.
|
|
9
9
|
* Consumers iterate via `Capability.getAll(IllustratorCapabilities.VariantProvider)` (Effect) or
|
|
10
10
|
* `useCapabilities(IllustratorCapabilities.VariantProvider)` (React).
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-IllustratorCapabilities.mjs","names":[],"sources":["../../src/types/IllustratorCapabilities.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"chunk-IllustratorCapabilities.mjs","names":[],"sources":["../../src/types/IllustratorCapabilities.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nimport type { DrawingVariant } from './types';\n\n/**\n * A drawing variant contribution. Each renderer plugin (tldraw, excalidraw, ...) contributes one\n * via `Capability.contributes(IllustratorCapabilities.VariantProvider, variant)`.\n * Consumers iterate via `Capability.getAll(IllustratorCapabilities.VariantProvider)` (Effect) or\n * `useCapabilities(IllustratorCapabilities.VariantProvider)` (React).\n */\nexport const VariantProvider = Capability.make<DrawingVariant>(`${meta.profile.key}.capability.variant`);\n"],"mappings":";;;;;;;;;;;AAkBA,IAAa,kBAAkB,WAAW,KAAqB,GAAG,KAAK,QAAQ,IAAI,oBAAoB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Capability } from "@dxos/app-framework";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import { Sketch } from "#types";
|
|
4
2
|
import { Type } from "@dxos/echo";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import { Drawing } from "#types";
|
|
5
5
|
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
6
6
|
//#region src/capabilities/comment-config.ts
|
|
7
7
|
var activate = Effect.fnUntraced(function* () {
|
|
8
8
|
return Capability.contributes(AppCapabilities.CommentConfig, {
|
|
9
|
-
id: Type.getTypename(
|
|
9
|
+
id: Type.getTypename(Drawing.Drawing),
|
|
10
10
|
comments: "unanchored"
|
|
11
11
|
});
|
|
12
12
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-comment-config.mjs","names":[],"sources":["../../src/capabilities/comment-config.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Type } from '@dxos/echo';\n\nimport {
|
|
1
|
+
{"version":3,"file":"chunk-comment-config.mjs","names":[],"sources":["../../src/capabilities/comment-config.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Type } from '@dxos/echo';\n\nimport { Drawing } from '#types';\n\nconst activate = Effect.fnUntraced(function* () {\n return Capability.contributes(AppCapabilities.CommentConfig, {\n id: Type.getTypename(Drawing.Drawing),\n comments: 'unanchored',\n });\n});\n\nexport default activate;\n"],"mappings":";;;;;;AAYA,IAAM,WAAW,OAAO,WAAW,aAAa;CAC9C,OAAO,WAAW,YAAY,gBAAgB,eAAe;EAC3D,IAAI,KAAK,YAAY,QAAQ,OAAO;EACpC,UAAU;CACZ,CAAC;AACH,CAAC"}
|
|
@@ -1,39 +1,40 @@
|
|
|
1
|
+
import { a as makeCanvas, i as make, n as Drawing } from "./chunk-Drawing.mjs";
|
|
2
|
+
import "./chunk-types.mjs";
|
|
1
3
|
import { n as VariantProvider } from "./chunk-IllustratorCapabilities.mjs";
|
|
2
|
-
import { a as Sketch, s as make } from "./chunk-types.mjs";
|
|
3
4
|
import { Capability } from "@dxos/app-framework";
|
|
4
|
-
import
|
|
5
|
+
import { Database, Type } from "@dxos/echo";
|
|
5
6
|
import { invariant } from "@dxos/invariant";
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
6
8
|
import { Operation } from "@dxos/compute";
|
|
7
|
-
import { Database, Type } from "@dxos/echo";
|
|
8
9
|
import { SpaceCapabilities, SpaceOperation } from "@dxos/plugin-space";
|
|
9
|
-
import {
|
|
10
|
+
import { CreateDrawingPanel } from "#components";
|
|
10
11
|
//#region src/capabilities/create-object.ts
|
|
11
|
-
var __dxlog_file = "/
|
|
12
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-illustrator/src/capabilities/create-object.ts";
|
|
12
13
|
var create_object_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
13
14
|
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
14
|
-
id: Type.getTypename(
|
|
15
|
-
customPanel:
|
|
15
|
+
id: Type.getTypename(Drawing),
|
|
16
|
+
customPanel: CreateDrawingPanel,
|
|
16
17
|
createObject: ({ variantId, input }, options) => Effect.gen(function* () {
|
|
17
18
|
const variant = (yield* Capability.getAll(VariantProvider)).find((entry) => entry.id === variantId);
|
|
18
|
-
invariant(variant, `Unknown
|
|
19
|
+
invariant(variant, `Unknown drawing variant: ${variantId}`, {
|
|
19
20
|
"~LogMeta": "~LogMeta",
|
|
20
21
|
F: __dxlog_file,
|
|
21
22
|
L: 31,
|
|
22
23
|
S: this,
|
|
23
|
-
A: ["variant", "`Unknown
|
|
24
|
+
A: ["variant", "`Unknown drawing variant: ${variantId}`"]
|
|
24
25
|
});
|
|
25
|
-
const canvas = yield* variant.createCanvas(input ?? {}).pipe(Effect.provideService(Database.Service, Database.makeService(options.db)));
|
|
26
|
+
const canvas = variant.createCanvas ? yield* variant.createCanvas(input ?? {}).pipe(Effect.provideService(Database.Service, Database.makeService(options.db))) : makeCanvas({ schema: variant.id });
|
|
26
27
|
yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
27
28
|
object: canvas,
|
|
28
29
|
target: options.target,
|
|
29
30
|
targetNodeId: options.targetNodeId
|
|
30
31
|
});
|
|
31
|
-
const
|
|
32
|
+
const drawing = make({
|
|
32
33
|
name: typeof input?.name === "string" ? input.name : void 0,
|
|
33
34
|
canvas
|
|
34
35
|
});
|
|
35
36
|
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
36
|
-
object:
|
|
37
|
+
object: drawing,
|
|
37
38
|
target: options.target,
|
|
38
39
|
targetNodeId: options.targetNodeId
|
|
39
40
|
}).pipe(Effect.tapError(() => Operation.invoke(SpaceOperation.RemoveObjects, { objects: [canvas] }).pipe(Effect.ignore)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-create-object.mjs","names":[],"sources":["../../src/capabilities/create-object.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Database, Type } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceCapabilities, SpaceOperation } from '@dxos/plugin-space';\n\nimport {
|
|
1
|
+
{"version":3,"file":"chunk-create-object.mjs","names":[],"sources":["../../src/capabilities/create-object.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Database, Type } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceCapabilities, SpaceOperation } from '@dxos/plugin-space';\n\nimport { CreateDrawingPanel } from '#components';\n\nimport { Drawing, IllustratorCapabilities } from '../types';\n\ntype CreateOptions = Parameters<SpaceCapabilities.CreateObjectEntry['createObject']>[1];\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {\n id: Type.getTypename(Drawing.Drawing),\n customPanel: CreateDrawingPanel,\n createObject: (\n { variantId, input }: { variantId: string; input?: Record<string, any> },\n options: CreateOptions,\n ) =>\n Effect.gen(function* () {\n const variants = yield* Capability.getAll(IllustratorCapabilities.VariantProvider);\n const variant = variants.find((entry) => entry.id === variantId);\n invariant(variant, `Unknown drawing variant: ${variantId}`);\n\n // Build the canvas: variants only supply a factory when they extend the base type.\n const canvas = variant.createCanvas\n ? yield* variant\n .createCanvas(input ?? {})\n .pipe(Effect.provideService(Database.Service, Database.makeService(options.db)))\n : Drawing.makeCanvas({ schema: variant.id });\n\n // Add the canvas to the database. It carries HiddenAnnotation, so `CollectionModel.add`\n // persists it without filing it into the target collection.\n yield* Operation.invoke(SpaceOperation.AddObject, {\n object: canvas,\n target: options.target,\n targetNodeId: options.targetNodeId,\n });\n\n const drawing = Drawing.make({\n name: typeof input?.name === 'string' ? input.name : undefined,\n canvas,\n });\n\n // Add the user-facing Drawing wrapper. Not hidden — this is the object the user sees\n // and navigates to. If this second write fails, roll back the canvas so we don't\n // leak an orphaned object into the space.\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object: drawing,\n target: options.target,\n targetNodeId: options.targetNodeId,\n }).pipe(\n Effect.tapError(() =>\n Operation.invoke(SpaceOperation.RemoveObjects, { objects: [canvas] }).pipe(Effect.ignore),\n ),\n );\n }),\n });\n }),\n);\n"],"mappings":";;;;;;;;;;;;AAkBA,IAAA,wBAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,OAAO,WAAW,YAAY,kBAAkB,mBAAmB;EACjE,IAAI,KAAK,YAAY,OAAe;EACpC,aAAa;EACb,eACE,EAAE,WAAW,SACb,YAEA,OAAO,IAAI,aAAa;GAEtB,MAAM,WAAU,OADQ,WAAW,OAAO,eAAuC,EAAA,CACxD,MAAM,UAAU,MAAM,OAAO,SAAS;GAC/D,UAAU,SAAS,4BAA4B,aAAU;IAAA,YAAA;IAAA,GAAA;IAAA,GAAA;IAAA,GAAA;IAAA,GAAA,CAAA,WAAA,yCAAA;GAAA,CAAC;GAG1D,MAAM,SAAS,QAAQ,eACnB,OAAO,QACJ,aAAa,SAAS,CAAC,CAAC,CAAA,CACxB,KAAK,OAAO,eAAe,SAAS,SAAS,SAAS,YAAY,QAAQ,EAAE,CAAC,CAAC,IACjF,WAAmB,EAAE,QAAQ,QAAQ,GAAG,CAAC;GAI7C,OAAO,UAAU,OAAO,eAAe,WAAW;IAChD,QAAQ;IACR,QAAQ,QAAQ;IAChB,cAAc,QAAQ;GACxB,CAAC;GAED,MAAM,UAAU,KAAa;IAC3B,MAAM,OAAO,OAAO,SAAS,WAAW,MAAM,OAAO,KAAA;IACrD;GACF,CAAC;GAKD,OAAO,OAAO,UAAU,OAAO,eAAe,WAAW;IACvD,QAAQ;IACR,QAAQ,QAAQ;IAChB,cAAc,QAAQ;GACxB,CAAC,CAAC,CAAC,KACD,OAAO,eACL,UAAU,OAAO,eAAe,eAAe,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,CAC1F,CACF;EACF,CAAC;CACL,CAAC;AACH,CAAC,CACH"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { a as makeCanvas, i as make } from "./chunk-Drawing.mjs";
|
|
2
|
+
import { t as Create } from "./chunk-types.mjs";
|
|
1
3
|
import { n as VariantProvider } from "./chunk-IllustratorCapabilities.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { n as UnknownSketchVariantError } from "./chunk-load-sketch.mjs";
|
|
4
|
+
import { t as UnknownDrawingVariantError } from "./chunk-load-drawing.mjs";
|
|
4
5
|
import { Capability } from "@dxos/app-framework";
|
|
5
6
|
import * as Effect from "effect/Effect";
|
|
6
7
|
import { Operation } from "@dxos/compute";
|
|
@@ -8,10 +9,10 @@ import { Operation } from "@dxos/compute";
|
|
|
8
9
|
var handler = Create.pipe(Operation.withHandler(Effect.fn(function* ({ name, variant: variantId }) {
|
|
9
10
|
const variants = yield* Capability.getAll(VariantProvider);
|
|
10
11
|
const variant = variantId ? variants.find((entry) => entry.id === variantId) : variants[0];
|
|
11
|
-
if (!variant) return yield* Effect.fail(new
|
|
12
|
+
if (!variant) return yield* Effect.fail(new UnknownDrawingVariantError(variantId ?? "(none registered)"));
|
|
12
13
|
return { object: make({
|
|
13
14
|
name,
|
|
14
|
-
canvas: yield* variant.createCanvas()
|
|
15
|
+
canvas: variant.createCanvas ? yield* variant.createCanvas() : makeCanvas({ schema: variant.id })
|
|
15
16
|
}) };
|
|
16
17
|
})));
|
|
17
18
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-create.mjs","names":[],"sources":["../../src/operations/create.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\n\nimport {
|
|
1
|
+
{"version":3,"file":"chunk-create.mjs","names":[],"sources":["../../src/operations/create.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\n\nimport { Drawing, DrawingOperation, IllustratorCapabilities } from '../types';\nimport { UnknownDrawingVariantError } from '../util/load-drawing';\n\nconst handler: Operation.WithHandler<typeof DrawingOperation.Create> = DrawingOperation.Create.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ name, variant: variantId }) {\n const variants = yield* Capability.getAll(IllustratorCapabilities.VariantProvider);\n const variant = variantId ? variants.find((entry) => entry.id === variantId) : variants[0];\n if (!variant) {\n return yield* Effect.fail(new UnknownDrawingVariantError(variantId ?? '(none registered)'));\n }\n const canvas = variant.createCanvas ? yield* variant.createCanvas() : Drawing.makeCanvas({ schema: variant.id });\n return { object: Drawing.make({ name, canvas }) };\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;;;AAYA,IAAM,UAAA,OAAyF,KAC7F,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,MAAM,SAAS,aAAa;CACjD,MAAM,WAAW,OAAO,WAAW,OAAO,eAAuC;CACjF,MAAM,UAAU,YAAY,SAAS,MAAM,UAAU,MAAM,OAAO,SAAS,IAAI,SAAS;CACxF,IAAI,CAAC,SACH,OAAO,OAAO,OAAO,KAAK,IAAI,2BAA2B,aAAa,mBAAmB,CAAC;CAG5F,OAAO,EAAE,QAAQ,KAAa;EAAE;EAAM,QADvB,QAAQ,eAAe,OAAO,QAAQ,aAAa,IAAI,WAAmB,EAAE,QAAQ,QAAQ,GAAG,CAAC;CAClE,CAAC,EAAE;AAClD,CAAC,CACH,CACF"}
|
package/dist/lib/chunk-edit.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { r as Edit } from "./chunk-types.mjs";
|
|
2
|
+
import { r as resolveVariant } from "./chunk-load-drawing.mjs";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import { Operation } from "@dxos/compute";
|
|
5
5
|
//#region src/operations/edit.ts
|
|
6
|
-
var handler = Edit.pipe(Operation.withHandler(Effect.fn(function* ({
|
|
7
|
-
const { canvas, variant } = yield* resolveVariant(
|
|
6
|
+
var handler = Edit.pipe(Operation.withHandler(Effect.fn(function* ({ drawing, commands }) {
|
|
7
|
+
const { canvas, variant } = yield* resolveVariant(drawing);
|
|
8
8
|
const { upserted, removed } = variant.builder.apply(canvas, commands);
|
|
9
9
|
const { scene, unmanaged } = variant.builder.read(canvas);
|
|
10
10
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-edit.mjs","names":[],"sources":["../../src/operations/edit.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\n\nimport {
|
|
1
|
+
{"version":3,"file":"chunk-edit.mjs","names":[],"sources":["../../src/operations/edit.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\n\nimport { DrawingOperation } from '../types';\nimport { resolveVariant } from '../util/load-drawing';\n\nconst handler: Operation.WithHandler<typeof DrawingOperation.Edit> = DrawingOperation.Edit.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ drawing, commands }) {\n const { canvas, variant } = yield* resolveVariant(drawing);\n const { upserted, removed } = variant.builder.apply(canvas, commands);\n const { scene, unmanaged } = variant.builder.read(canvas);\n return { scene, unmanaged, upserted, removed };\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;AAWA,IAAM,UAAA,KAAqF,KACzF,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,SAAS,YAAY;CAC1C,MAAM,EAAE,QAAQ,YAAY,OAAO,eAAe,OAAO;CACzD,MAAM,EAAE,UAAU,YAAY,QAAQ,QAAQ,MAAM,QAAQ,QAAQ;CACpE,MAAM,EAAE,OAAO,cAAc,QAAQ,QAAQ,KAAK,MAAM;CACxD,OAAO;EAAE;EAAO;EAAW;EAAU;CAAQ;AAC/C,CAAC,CACH,CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { i as Generate } from "./chunk-types.mjs";
|
|
2
|
+
import { r as resolveVariant } from "./chunk-load-drawing.mjs";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import { Operation } from "@dxos/compute";
|
|
5
|
+
import { Mermaid } from "#model";
|
|
6
|
+
//#region src/operations/generate.ts
|
|
7
|
+
var handler = Generate.pipe(Operation.withHandler(Effect.fn(function* ({ drawing, source }) {
|
|
8
|
+
const { canvas, variant } = yield* resolveVariant(drawing);
|
|
9
|
+
const { upserted } = variant.builder.apply(canvas, Mermaid.compile(source));
|
|
10
|
+
const { scene, unmanaged } = variant.builder.read(canvas);
|
|
11
|
+
return {
|
|
12
|
+
scene,
|
|
13
|
+
unmanaged,
|
|
14
|
+
upserted
|
|
15
|
+
};
|
|
16
|
+
})));
|
|
17
|
+
//#endregion
|
|
18
|
+
export { handler as default };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=chunk-generate.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-generate.mjs","names":[],"sources":["../../src/operations/generate.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\n\nimport { Mermaid } from '#model';\n\nimport { DrawingOperation } from '../types';\nimport { resolveVariant } from '../util/load-drawing';\n\nconst handler: Operation.WithHandler<typeof DrawingOperation.Generate> = DrawingOperation.Generate.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ drawing, source }) {\n const { canvas, variant } = yield* resolveVariant(drawing);\n const { upserted } = variant.builder.apply(canvas, Mermaid.compile(source));\n const { scene, unmanaged } = variant.builder.read(canvas);\n return { scene, unmanaged, upserted };\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;AAaA,IAAM,UAAA,SAA6F,KACjG,UAAU,YACR,OAAO,GAAG,WAAW,EAAE,SAAS,UAAU;CACxC,MAAM,EAAE,QAAQ,YAAY,OAAO,eAAe,OAAO;CACzD,MAAM,EAAE,aAAa,QAAQ,QAAQ,MAAM,QAAQ,QAAQ,QAAQ,MAAM,CAAC;CAC1E,MAAM,EAAE,OAAO,cAAc,QAAQ,QAAQ,KAAK,MAAM;CACxD,OAAO;EAAE;EAAO;EAAW;CAAS;AACtC,CAAC,CACH,CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { n as VariantProvider } from "./chunk-IllustratorCapabilities.mjs";
|
|
2
|
+
import { Capability } from "@dxos/app-framework";
|
|
3
|
+
import { Database } from "@dxos/echo";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
//#region src/util/load-drawing.ts
|
|
6
|
+
var UnknownDrawingVariantError = class extends Error {
|
|
7
|
+
schema;
|
|
8
|
+
_tag = "UnknownDrawingVariantError";
|
|
9
|
+
constructor(schema) {
|
|
10
|
+
super(`No drawing variant registered for canvas schema: ${schema}.`);
|
|
11
|
+
this.schema = schema;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Loads a Drawing and resolves the variant claiming its canvas `schema`.
|
|
16
|
+
* Used by the renderer-agnostic read/edit operations.
|
|
17
|
+
*/
|
|
18
|
+
var resolveVariant = (ref) => Effect.gen(function* () {
|
|
19
|
+
const drawing = yield* Database.load(ref);
|
|
20
|
+
const canvas = yield* Database.load(drawing.canvas);
|
|
21
|
+
const schema = canvas.schema ?? "";
|
|
22
|
+
const variant = (yield* Capability.getAll(VariantProvider)).find((entry) => entry.id === schema);
|
|
23
|
+
if (!variant) return yield* Effect.fail(new UnknownDrawingVariantError(schema));
|
|
24
|
+
return {
|
|
25
|
+
drawing,
|
|
26
|
+
canvas,
|
|
27
|
+
variant
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
/** Resolve a variant by canvas schema, for callers that already hold the canvas. */
|
|
31
|
+
var findVariant = (variants, canvas) => variants.find((entry) => entry.id === (canvas?.schema ?? ""));
|
|
32
|
+
//#endregion
|
|
33
|
+
export { findVariant as n, resolveVariant as r, UnknownDrawingVariantError as t };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=chunk-load-drawing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-load-drawing.mjs","names":[],"sources":["../../src/util/load-drawing.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Database, type Ref } from '@dxos/echo';\n\nimport * as Drawing from '../types/Drawing';\nimport * as IllustratorCapabilities from '../types/IllustratorCapabilities';\nimport { type DrawingVariant } from '../types/types';\n\nexport class UnknownDrawingVariantError extends Error {\n readonly _tag = 'UnknownDrawingVariantError';\n constructor(readonly schema: string) {\n super(`No drawing variant registered for canvas schema: ${schema}.`);\n }\n}\n\n/**\n * Loads a Drawing and resolves the variant claiming its canvas `schema`.\n * Used by the renderer-agnostic read/edit operations.\n */\nexport const resolveVariant = (\n ref: Ref.Ref<Drawing.Drawing>,\n): Effect.Effect<\n { drawing: Drawing.Drawing; canvas: Drawing.Canvas; variant: DrawingVariant },\n Error,\n Database.Service | Capability.Service\n> =>\n Effect.gen(function* () {\n const drawing = yield* Database.load(ref);\n const canvas = yield* Database.load(drawing.canvas);\n const schema = canvas.schema ?? '';\n const variants = yield* Capability.getAll(IllustratorCapabilities.VariantProvider);\n const variant = variants.find((entry) => entry.id === schema);\n if (!variant) {\n return yield* Effect.fail(new UnknownDrawingVariantError(schema));\n }\n return { drawing, canvas, variant };\n });\n\n/** Resolve a variant by canvas schema, for callers that already hold the canvas. */\nexport const findVariant = (\n variants: readonly DrawingVariant[],\n canvas: Pick<Drawing.Canvas, 'schema'> | undefined,\n): DrawingVariant | undefined => variants.find((entry) => entry.id === (canvas?.schema ?? ''));\n"],"mappings":";;;;;AAaA,IAAa,6BAAb,cAAgD,MAAM;CAE/B;CADrB,OAAgB;CAChB,YAAY,QAAyB;EACnC,MAAM,oDAAoD,OAAO,EAAE;EADhD,KAAA,SAAA;CAErB;AACF;;;;;AAMA,IAAa,kBACX,QAMA,OAAO,IAAI,aAAa;CACtB,MAAM,UAAU,OAAO,SAAS,KAAK,GAAG;CACxC,MAAM,SAAS,OAAO,SAAS,KAAK,QAAQ,MAAM;CAClD,MAAM,SAAS,OAAO,UAAU;CAEhC,MAAM,WAAU,OADQ,WAAW,OAAO,eAAuC,EAAA,CACxD,MAAM,UAAU,MAAM,OAAO,MAAM;CAC5D,IAAI,CAAC,SACH,OAAO,OAAO,OAAO,KAAK,IAAI,2BAA2B,MAAM,CAAC;CAElE,OAAO;EAAE;EAAS;EAAQ;CAAQ;AACpC,CAAC;;AAGH,IAAa,eACX,UACA,WAC+B,SAAS,MAAM,UAAU,MAAM,QAAQ,QAAQ,UAAU,GAAG"}
|
package/dist/lib/chunk-meta.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-meta.mjs","names":[],"sources":["../../dx.config.ts","../../src/meta.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.illustrator',\n name: 'Illustrator',\n author: 'DXOS',\n description: trim`\n Headless diagramming host plugin that provides shared infrastructure for local-first\n drawing and diagramming inside DXOS Composer. The plugin owns the base \\`Sketch\\` ECHO\n type — a named handle referencing a renderer-specific canvas object — together with the\n renderer-neutral scene DSL, the diagram dialect registry, and the agent-facing sketch\n skill and operations (create, read, edit).\n\n Canvas renderers (tldraw, excalidraw, and others) are contributed by separate plugins\n via the \\`IllustratorCapabilities.VariantProvider\\` capability. Each variant supplies its\n own canvas schema, a builder that maps the scene DSL onto its records, and surface\n components (Article and Card). Plugin-illustrator resolves the correct variant at\n runtime and delegates rendering and DSL compilation, keeping the host layer fully\n decoupled from renderer internals.\n\n Canvas objects are stored as hidden ECHO objects alongside the top-level \\`Sketch\\`,\n ensuring they replicate to all peers but do not appear as independent items in the\n user's space graph.\n `,\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-illustrator',\n icon: { key: 'ph--compass-tool--regular', hue: 'indigo' },\n spec: 'PLUGIN.mdl',\n },\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport config from '../dx.config';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n"],"mappings":";;;;AAOA,IAAA,oBAAe,QAAQ,KAAK,EAC1B,QAAQ;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,aAAa,IAAI;;;;;;;;;;;;;;;;;;CAkBjB,QAAQ;CACR,MAAM;EAAE,KAAK;EAA6B,KAAK;CAAS;CACxD,MAAM;
|
|
1
|
+
{"version":3,"file":"chunk-meta.mjs","names":[],"sources":["../../dx.config.ts","../../src/meta.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.illustrator',\n name: 'Illustrator',\n author: 'DXOS',\n description: trim`\n Headless diagramming host plugin that provides shared infrastructure for local-first\n drawing and diagramming inside DXOS Composer. The plugin owns the base \\`Sketch\\` ECHO\n type — a named handle referencing a renderer-specific canvas object — together with the\n renderer-neutral scene DSL, the diagram dialect registry, and the agent-facing sketch\n skill and operations (create, read, edit).\n\n Canvas renderers (tldraw, excalidraw, and others) are contributed by separate plugins\n via the \\`IllustratorCapabilities.VariantProvider\\` capability. Each variant supplies its\n own canvas schema, a builder that maps the scene DSL onto its records, and surface\n components (Article and Card). Plugin-illustrator resolves the correct variant at\n runtime and delegates rendering and DSL compilation, keeping the host layer fully\n decoupled from renderer internals.\n\n Canvas objects are stored as hidden ECHO objects alongside the top-level \\`Sketch\\`,\n ensuring they replicate to all peers but do not appear as independent items in the\n user's space graph.\n `,\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-illustrator',\n icon: { key: 'ph--compass-tool--regular', hue: 'indigo' },\n spec: 'PLUGIN.mdl',\n tags: ['alpha'],\n },\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport config from '../dx.config';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n"],"mappings":";;;;AAOA,IAAA,oBAAe,QAAQ,KAAK,EAC1B,QAAQ;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,aAAa,IAAI;;;;;;;;;;;;;;;;;;CAkBjB,QAAQ;CACR,MAAM;EAAE,KAAK;EAA6B,KAAK;CAAS;CACxD,MAAM;CACN,MAAM,CAAC,OAAO;AAChB,EACF,CAAC;;;AC3BD,IAAa,OAAO,OAAO,kBAAkB,iBAAM"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { n as Drawing } from "./chunk-Drawing.mjs";
|
|
2
|
+
import { s as Sketch } from "./chunk-types.mjs";
|
|
3
|
+
import { Capability } from "@dxos/app-framework";
|
|
4
|
+
import { Migration } from "@dxos/echo";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
7
|
+
//#region src/capabilities/migrations.ts
|
|
8
|
+
var sketchToDrawing = Migration.define({
|
|
9
|
+
from: Sketch,
|
|
10
|
+
to: Drawing,
|
|
11
|
+
transform: async ({ name, canvas }) => ({
|
|
12
|
+
name,
|
|
13
|
+
canvas
|
|
14
|
+
})
|
|
15
|
+
});
|
|
16
|
+
var migrations = [sketchToDrawing];
|
|
17
|
+
var migrations_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
18
|
+
return Capability.contributes(ClientCapabilities.Migration, migrations);
|
|
19
|
+
}));
|
|
20
|
+
//#endregion
|
|
21
|
+
export { migrations_default as default, sketchToDrawing };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=chunk-migrations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-migrations.mjs","names":[],"sources":["../../src/capabilities/migrations.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Migration } from '@dxos/echo';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\nimport { Drawing, LegacySketch } from '../types';\n\n// `org.dxos.type.sketch` -> `org.dxos.type.drawing`. The shape is unchanged (name + canvas ref)\n// and the canvas keeps its typename, so the transform is a field copy; the runtime swaps the\n// object's type and retires the old one.\nexport const sketchToDrawing = Migration.define({\n from: LegacySketch.Sketch,\n to: Drawing.Drawing,\n transform: async ({ name, canvas }) => ({ name, canvas }),\n});\n\nconst migrations = [sketchToDrawing];\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(ClientCapabilities.Migration, migrations);\n }),\n);\n"],"mappings":";;;;;;;AAeA,IAAa,kBAAkB,UAAU,OAAO;CAC9C,MAAM;CACN,IAAI;CACJ,WAAW,OAAO,EAAE,MAAM,cAAc;EAAE;EAAM;CAAO;AACzD,CAAC;AAED,IAAM,aAAa,CAAC,eAAe;AAEnC,IAAA,qBAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,OAAO,WAAW,YAAY,mBAAmB,WAAW,UAAU;AACxE,CAAC,CACH"}
|