@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
package/src/operations/create.ts
CHANGED
|
@@ -7,19 +7,19 @@ import * as Effect from 'effect/Effect';
|
|
|
7
7
|
import { Capability } from '@dxos/app-framework';
|
|
8
8
|
import { Operation } from '@dxos/compute';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { Drawing, DrawingOperation, IllustratorCapabilities } from '../types';
|
|
11
|
+
import { UnknownDrawingVariantError } from '../util/load-drawing';
|
|
12
12
|
|
|
13
|
-
const handler: Operation.WithHandler<typeof
|
|
13
|
+
const handler: Operation.WithHandler<typeof DrawingOperation.Create> = DrawingOperation.Create.pipe(
|
|
14
14
|
Operation.withHandler(
|
|
15
15
|
Effect.fn(function* ({ name, variant: variantId }) {
|
|
16
16
|
const variants = yield* Capability.getAll(IllustratorCapabilities.VariantProvider);
|
|
17
17
|
const variant = variantId ? variants.find((entry) => entry.id === variantId) : variants[0];
|
|
18
18
|
if (!variant) {
|
|
19
|
-
return yield* Effect.fail(new
|
|
19
|
+
return yield* Effect.fail(new UnknownDrawingVariantError(variantId ?? '(none registered)'));
|
|
20
20
|
}
|
|
21
|
-
const canvas = yield* variant.createCanvas();
|
|
22
|
-
return { object:
|
|
21
|
+
const canvas = variant.createCanvas ? yield* variant.createCanvas() : Drawing.makeCanvas({ schema: variant.id });
|
|
22
|
+
return { object: Drawing.make({ name, canvas }) };
|
|
23
23
|
}),
|
|
24
24
|
),
|
|
25
25
|
);
|
package/src/operations/edit.ts
CHANGED
|
@@ -6,13 +6,13 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Operation } from '@dxos/compute';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import { resolveVariant } from '../util/load-
|
|
9
|
+
import { DrawingOperation } from '../types';
|
|
10
|
+
import { resolveVariant } from '../util/load-drawing';
|
|
11
11
|
|
|
12
|
-
const handler: Operation.WithHandler<typeof
|
|
12
|
+
const handler: Operation.WithHandler<typeof DrawingOperation.Edit> = DrawingOperation.Edit.pipe(
|
|
13
13
|
Operation.withHandler(
|
|
14
|
-
Effect.fn(function* ({
|
|
15
|
-
const { canvas, variant } = yield* resolveVariant(
|
|
14
|
+
Effect.fn(function* ({ drawing, commands }) {
|
|
15
|
+
const { canvas, variant } = yield* resolveVariant(drawing);
|
|
16
16
|
const { upserted, removed } = variant.builder.apply(canvas, commands);
|
|
17
17
|
const { scene, unmanaged } = variant.builder.read(canvas);
|
|
18
18
|
return { scene, unmanaged, upserted, removed };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
|
|
9
|
+
import { Mermaid } from '#model';
|
|
10
|
+
|
|
11
|
+
import { DrawingOperation } from '../types';
|
|
12
|
+
import { resolveVariant } from '../util/load-drawing';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof DrawingOperation.Generate> = DrawingOperation.Generate.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fn(function* ({ drawing, source }) {
|
|
17
|
+
const { canvas, variant } = yield* resolveVariant(drawing);
|
|
18
|
+
const { upserted } = variant.builder.apply(canvas, Mermaid.compile(source));
|
|
19
|
+
const { scene, unmanaged } = variant.builder.read(canvas);
|
|
20
|
+
return { scene, unmanaged, upserted };
|
|
21
|
+
}),
|
|
22
|
+
),
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export default handler;
|
package/src/operations/index.ts
CHANGED
package/src/operations/read.ts
CHANGED
|
@@ -6,13 +6,13 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
|
|
7
7
|
import { Operation } from '@dxos/compute';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import { resolveVariant } from '../util/load-
|
|
9
|
+
import { DrawingOperation } from '../types';
|
|
10
|
+
import { resolveVariant } from '../util/load-drawing';
|
|
11
11
|
|
|
12
|
-
const handler: Operation.WithHandler<typeof
|
|
12
|
+
const handler: Operation.WithHandler<typeof DrawingOperation.Read> = DrawingOperation.Read.pipe(
|
|
13
13
|
Operation.withHandler(
|
|
14
|
-
Effect.fn(function* ({
|
|
15
|
-
const { canvas, variant } = yield* resolveVariant(
|
|
14
|
+
Effect.fn(function* ({ drawing }) {
|
|
15
|
+
const { canvas, variant } = yield* resolveVariant(drawing);
|
|
16
16
|
return variant.builder.read(canvas);
|
|
17
17
|
}),
|
|
18
18
|
),
|
|
@@ -5,20 +5,20 @@
|
|
|
5
5
|
import { Skill, Template } from '@dxos/compute';
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { DrawingOperation } from '#types';
|
|
9
9
|
|
|
10
|
-
const SKILL_KEY = 'org.dxos.skill.
|
|
10
|
+
const SKILL_KEY = 'org.dxos.skill.drawing';
|
|
11
11
|
|
|
12
|
-
const operations = [
|
|
12
|
+
const operations = [DrawingOperation.Create, DrawingOperation.Read, DrawingOperation.Edit];
|
|
13
13
|
|
|
14
14
|
const make = () =>
|
|
15
15
|
Skill.make({
|
|
16
16
|
key: SKILL_KEY,
|
|
17
|
-
name: '
|
|
17
|
+
name: 'Drawing',
|
|
18
18
|
tools: Skill.toolDefinitions({ operations }),
|
|
19
19
|
instructions: Template.make({
|
|
20
20
|
source: trim`
|
|
21
|
-
{{!
|
|
21
|
+
{{! Drawing }}
|
|
22
22
|
|
|
23
23
|
You can draw and edit diagrams on a shared canvas using a scene DSL.
|
|
24
24
|
|
|
@@ -44,8 +44,8 @@ const make = () =>
|
|
|
44
44
|
|
|
45
45
|
## Workflow
|
|
46
46
|
|
|
47
|
-
1. If no
|
|
48
|
-
2. ALWAYS call read before editing an existing
|
|
47
|
+
1. If no drawing exists in context, create one first.
|
|
48
|
+
2. ALWAYS call read before editing an existing drawing — it returns the scene as you
|
|
49
49
|
(or the user) last left it, with origins derived from the live canvas, so it stays
|
|
50
50
|
correct even after the user drags shapes around. Note "unmanaged" counts shapes the
|
|
51
51
|
user drew by hand that are not part of the scene.
|
package/src/skills/index.ts
CHANGED
package/src/translations.ts
CHANGED
|
@@ -6,27 +6,27 @@ import { Type } from '@dxos/echo';
|
|
|
6
6
|
import { type Resource } from '@dxos/react-ui';
|
|
7
7
|
|
|
8
8
|
import { meta } from '#meta';
|
|
9
|
-
import {
|
|
9
|
+
import { Drawing } from '#types';
|
|
10
10
|
|
|
11
11
|
export const translations = [
|
|
12
12
|
{
|
|
13
13
|
'en-US': {
|
|
14
|
-
[Type.getTypename(
|
|
15
|
-
'typename.label': '
|
|
16
|
-
'typename.label_zero': '
|
|
17
|
-
'typename.label_one': '
|
|
18
|
-
'typename.label_other': '
|
|
19
|
-
'object-name.placeholder': 'New
|
|
20
|
-
'add-object.label': 'Add
|
|
21
|
-
'rename-object.label': 'Rename
|
|
22
|
-
'delete-object.label': 'Delete
|
|
23
|
-
'object-deleted.label': '
|
|
14
|
+
[Type.getTypename(Drawing.Drawing)]: {
|
|
15
|
+
'typename.label': 'Drawing',
|
|
16
|
+
'typename.label_zero': 'Drawings',
|
|
17
|
+
'typename.label_one': 'Drawing',
|
|
18
|
+
'typename.label_other': 'Drawings',
|
|
19
|
+
'object-name.placeholder': 'New drawing',
|
|
20
|
+
'add-object.label': 'Add drawing',
|
|
21
|
+
'rename-object.label': 'Rename drawing',
|
|
22
|
+
'delete-object.label': 'Delete drawing',
|
|
23
|
+
'object-deleted.label': 'Drawing deleted',
|
|
24
24
|
},
|
|
25
25
|
[meta.profile.key]: {
|
|
26
26
|
'plugin.name': 'Illustrator',
|
|
27
27
|
'create-panel.variant.label': 'Select renderer',
|
|
28
28
|
'create-panel.variant.placeholder': 'Search renderers...',
|
|
29
|
-
'unsupported-variant.label': 'Unsupported
|
|
29
|
+
'unsupported-variant.label': 'Unsupported drawing variant',
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
32
|
},
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
import { Annotation, DXN, Obj, Ref, Type } from '@dxos/echo';
|
|
10
|
+
import { FormInputAnnotation, HiddenAnnotation, LabelAnnotation } from '@dxos/echo/Annotation';
|
|
11
|
+
import { CardAnnotation, CollectionItemAnnotation } from '@dxos/schema';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Canvas content shared by every renderer: an opaque map of record id → record, managed by the
|
|
15
|
+
* renderer's store adapter and CRDT-merged by ECHO without knowing its shape. `schema` identifies
|
|
16
|
+
* the renderer dialect (e.g. `tldraw.com/2`, `excalidraw.com/2`) and is how a `Drawing` is matched
|
|
17
|
+
* to the variant that can render it.
|
|
18
|
+
*
|
|
19
|
+
* Hidden: reached through `Drawing.canvas`, never listed on its own.
|
|
20
|
+
*/
|
|
21
|
+
export class Canvas extends Type.makeObject<Canvas>(DXN.make('org.dxos.type.canvas', '0.1.0'))(
|
|
22
|
+
Schema.Struct({
|
|
23
|
+
schema: Schema.String.pipe(Schema.optional),
|
|
24
|
+
content: Schema.Record({ key: Schema.String, value: Schema.Any }),
|
|
25
|
+
}).pipe(HiddenAnnotation.set(true)),
|
|
26
|
+
) {}
|
|
27
|
+
|
|
28
|
+
export type MakeCanvasOptions = Omit<Partial<Obj.MakeProps<typeof Canvas>>, 'schema'> & {
|
|
29
|
+
/** Required at construction: matches the canvas to a renderer variant. */
|
|
30
|
+
schema: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** Creates a {@link Canvas} for the given renderer schema. */
|
|
34
|
+
export const makeCanvas = ({ schema, content = {} }: MakeCanvasOptions): Canvas =>
|
|
35
|
+
Obj.make(Canvas, { schema, content });
|
|
36
|
+
|
|
37
|
+
/** Type guard for {@link Canvas} objects. */
|
|
38
|
+
export const isCanvas = (object: unknown): object is Canvas => Obj.instanceOf(Canvas, object);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Base Drawing object. Renderer-specific behaviour lives in the variant that claims the canvas's
|
|
42
|
+
* `schema`, so all renderers (tldraw, excalidraw, ...) share one typename, graph node, create
|
|
43
|
+
* flow, and surface scaffolding.
|
|
44
|
+
*/
|
|
45
|
+
export class Drawing extends Type.makeObject<Drawing>(DXN.make('org.dxos.type.drawing', '0.1.0'))(
|
|
46
|
+
Schema.Struct({
|
|
47
|
+
name: Schema.optional(Schema.String),
|
|
48
|
+
canvas: Ref.Ref(Canvas)
|
|
49
|
+
.annotations({ description: 'Reference to the canvas holding the renderer-specific content.' })
|
|
50
|
+
.pipe(FormInputAnnotation.set(false)),
|
|
51
|
+
}).pipe(
|
|
52
|
+
LabelAnnotation.set(['name']),
|
|
53
|
+
Annotation.IconAnnotation.set({ icon: 'ph--compass-tool--regular', hue: 'indigo' }),
|
|
54
|
+
CardAnnotation.set(true),
|
|
55
|
+
CollectionItemAnnotation.set(true),
|
|
56
|
+
),
|
|
57
|
+
) {}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Build a `Drawing` referencing the given canvas.
|
|
61
|
+
*
|
|
62
|
+
* @param name Optional display name shown in the graph node and Properties form.
|
|
63
|
+
* @param canvas Canvas holding the renderer's content.
|
|
64
|
+
*/
|
|
65
|
+
export const make = ({ name, canvas }: { name?: string; canvas: Canvas }): Drawing =>
|
|
66
|
+
Obj.make(Drawing, { name, canvas: Ref.make(canvas) });
|
|
67
|
+
|
|
68
|
+
/** Type guard for {@link Drawing} objects. */
|
|
69
|
+
export const isDrawing = (object: unknown): object is Drawing => Obj.instanceOf(Drawing, object);
|
|
@@ -14,12 +14,12 @@ import { DXN } from '@dxos/keys';
|
|
|
14
14
|
import { meta } from '#meta';
|
|
15
15
|
import { Scene } from '#model';
|
|
16
16
|
|
|
17
|
-
import * as
|
|
17
|
+
import * as Drawing from './Drawing';
|
|
18
18
|
|
|
19
19
|
const makeKey = (name: string) => DXN.make(`${meta.profile.key}.operation.${name}`);
|
|
20
20
|
|
|
21
21
|
export const Create = Operation.make({
|
|
22
|
-
meta: { key: makeKey('create'), name: 'Create
|
|
22
|
+
meta: { key: makeKey('create'), name: 'Create Drawing', icon: 'ph--pencil-simple--regular' },
|
|
23
23
|
input: Schema.Struct({
|
|
24
24
|
name: Schema.optional(Schema.String),
|
|
25
25
|
variant: Schema.optional(Schema.String).annotations({
|
|
@@ -27,7 +27,7 @@ export const Create = Operation.make({
|
|
|
27
27
|
}),
|
|
28
28
|
}),
|
|
29
29
|
output: Schema.Struct({
|
|
30
|
-
object: Type.getSchema(
|
|
30
|
+
object: Type.getSchema(Drawing.Drawing),
|
|
31
31
|
}),
|
|
32
32
|
services: [Capability.Service, Database.Service],
|
|
33
33
|
});
|
|
@@ -43,13 +43,13 @@ const SceneOutput = {
|
|
|
43
43
|
export const Read = Operation.make({
|
|
44
44
|
meta: {
|
|
45
45
|
key: makeKey('read'),
|
|
46
|
-
name: 'Read
|
|
46
|
+
name: 'Read Drawing',
|
|
47
47
|
description:
|
|
48
|
-
'Returns the current scene of a
|
|
48
|
+
'Returns the current scene of a drawing: world objects (by id) with their elements in object-local units. Call before editing an existing drawing.',
|
|
49
49
|
icon: 'ph--eye--regular',
|
|
50
50
|
},
|
|
51
51
|
input: Schema.Struct({
|
|
52
|
-
|
|
52
|
+
drawing: Ref.Ref(Drawing.Drawing).annotations({ description: 'The drawing to read.' }),
|
|
53
53
|
}),
|
|
54
54
|
output: Schema.Struct(SceneOutput),
|
|
55
55
|
services: [Capability.Service, Database.Service],
|
|
@@ -58,13 +58,13 @@ export const Read = Operation.make({
|
|
|
58
58
|
export const Edit = Operation.make({
|
|
59
59
|
meta: {
|
|
60
60
|
key: makeKey('edit'),
|
|
61
|
-
name: 'Edit
|
|
61
|
+
name: 'Edit Drawing',
|
|
62
62
|
description:
|
|
63
|
-
'Applies scene commands to a
|
|
63
|
+
'Applies scene commands to a drawing: upsert/move/remove world objects or individual elements by id. Returns the resulting scene.',
|
|
64
64
|
icon: 'ph--pencil-simple-line--regular',
|
|
65
65
|
},
|
|
66
66
|
input: Schema.Struct({
|
|
67
|
-
|
|
67
|
+
drawing: Ref.Ref(Drawing.Drawing).annotations({ description: 'The drawing to edit.' }),
|
|
68
68
|
commands: Schema.Array(Scene.Command).annotations({ description: 'Commands applied in order, atomically.' }),
|
|
69
69
|
}),
|
|
70
70
|
output: Schema.Struct({
|
|
@@ -74,3 +74,22 @@ export const Edit = Operation.make({
|
|
|
74
74
|
}),
|
|
75
75
|
services: [Capability.Service, Database.Service],
|
|
76
76
|
});
|
|
77
|
+
|
|
78
|
+
export const Generate = Operation.make({
|
|
79
|
+
meta: {
|
|
80
|
+
key: makeKey('generate'),
|
|
81
|
+
name: 'Generate Drawing',
|
|
82
|
+
description:
|
|
83
|
+
'Replaces a drawing with a diagram compiled from a mermaid flowchart description. The dialect owns layout, so no coordinates are supplied.',
|
|
84
|
+
icon: 'ph--graph--regular',
|
|
85
|
+
},
|
|
86
|
+
input: Schema.Struct({
|
|
87
|
+
drawing: Ref.Ref(Drawing.Drawing).annotations({ description: 'The drawing to generate into.' }),
|
|
88
|
+
source: Schema.String.annotations({ description: 'Mermaid flowchart source.' }),
|
|
89
|
+
}),
|
|
90
|
+
output: Schema.Struct({
|
|
91
|
+
...SceneOutput,
|
|
92
|
+
upserted: Schema.Array(Schema.String).annotations({ description: 'Object ids created or modified.' }),
|
|
93
|
+
}),
|
|
94
|
+
services: [Capability.Service, Database.Service],
|
|
95
|
+
});
|
|
@@ -8,12 +8,12 @@ import { Capability } from '@dxos/app-framework';
|
|
|
8
8
|
|
|
9
9
|
import { meta } from '#meta';
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type { DrawingVariant } from './types';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* A
|
|
15
|
-
*
|
|
14
|
+
* A drawing variant contribution. Each renderer plugin (tldraw, excalidraw, ...) contributes one
|
|
15
|
+
* via `Capability.contributes(IllustratorCapabilities.VariantProvider, variant)`.
|
|
16
16
|
* Consumers iterate via `Capability.getAll(IllustratorCapabilities.VariantProvider)` (Effect) or
|
|
17
17
|
* `useCapabilities(IllustratorCapabilities.VariantProvider)` (React).
|
|
18
18
|
*/
|
|
19
|
-
export const VariantProvider = Capability.make<
|
|
19
|
+
export const VariantProvider = Capability.make<DrawingVariant>(`${meta.profile.key}.capability.variant`);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
import { DXN, Ref, Type } from '@dxos/echo';
|
|
10
|
+
|
|
11
|
+
import * as Drawing from './Drawing';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The pre-rename `Sketch` object, kept solely so `Migration.define` can read existing data and
|
|
15
|
+
* convert it to {@link Drawing}. Never constructed by this plugin.
|
|
16
|
+
*
|
|
17
|
+
* Its canvas already points at `org.dxos.type.canvas` carrying `schema: 'tldraw.com/2'`, which is
|
|
18
|
+
* exactly the base `Drawing.Canvas` — so only the wrapper needs migrating.
|
|
19
|
+
*/
|
|
20
|
+
export class Sketch extends Type.makeObject<Sketch>(DXN.make('org.dxos.type.sketch', '0.1.0'))(
|
|
21
|
+
Schema.Struct({
|
|
22
|
+
name: Schema.optional(Schema.String),
|
|
23
|
+
canvas: Ref.Ref(Drawing.Canvas),
|
|
24
|
+
}),
|
|
25
|
+
) {}
|
package/src/types/index.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
export * from './types';
|
|
6
6
|
|
|
7
|
+
export * as Drawing from './Drawing';
|
|
8
|
+
export * as LegacySketch from './LegacySketch';
|
|
9
|
+
export * as DrawingOperation from './DrawingOperation';
|
|
7
10
|
export * as IllustratorCapabilities from './IllustratorCapabilities';
|
|
8
|
-
export * as Sketch from './Sketch';
|
|
9
|
-
export * as SketchOperation from './SketchOperation';
|
package/src/types/types.ts
CHANGED
|
@@ -7,41 +7,41 @@ import type { ComponentType } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import type { Database, Obj, Type } from '@dxos/echo';
|
|
9
9
|
|
|
10
|
-
import { type
|
|
10
|
+
import { type DrawingBuilder } from '#model';
|
|
11
11
|
|
|
12
|
-
import type * as
|
|
12
|
+
import type * as Drawing from './Drawing';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Contribution from a
|
|
16
|
-
* Defines how a
|
|
15
|
+
* Contribution from a renderer plugin (e.g. plugin-tldraw, plugin-excalidraw).
|
|
16
|
+
* Defines how a drawing variant is created, rendered, and how the scene DSL maps onto it.
|
|
17
17
|
*/
|
|
18
|
-
export type
|
|
19
|
-
/**
|
|
18
|
+
export type DrawingVariant = {
|
|
19
|
+
/** Renderer dialect claimed by this variant; matched against `Canvas.schema` (e.g. 'tldraw.com/2'). */
|
|
20
20
|
id: string;
|
|
21
21
|
/** Human-readable variant name (e.g. 'tldraw'). */
|
|
22
22
|
label: string;
|
|
23
23
|
/** Optional Phosphor icon name (e.g. 'ph--compass-tool--regular'). */
|
|
24
24
|
icon?: string;
|
|
25
|
-
/** ECHO Type entity of the canvas object referenced by `Sketch.canvas`. */
|
|
26
|
-
canvasType: Type.AnyObj;
|
|
27
25
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
26
|
+
* Canvas type, when the renderer extends the base `Drawing.Canvas` with its own fields.
|
|
27
|
+
* Omit to use the base type — the common case, since `schema` already discriminates.
|
|
30
28
|
*/
|
|
31
|
-
|
|
29
|
+
canvasType?: Type.AnyObj;
|
|
30
|
+
/** Build an empty canvas. Defaults to a base `Drawing.Canvas` stamped with `id` as its schema. */
|
|
31
|
+
createCanvas?: (input?: Record<string, any>) => Effect.Effect<Drawing.Canvas, Error, Database.Service>;
|
|
32
32
|
/** Maps the scene DSL onto this variant's canvas records. */
|
|
33
|
-
builder:
|
|
33
|
+
builder: DrawingBuilder;
|
|
34
34
|
/** Optional Card surface component for this variant. */
|
|
35
|
-
card?: ComponentType<
|
|
35
|
+
card?: ComponentType<DrawingVariantSurfaceProps>;
|
|
36
36
|
/** Optional Article/Section/Slide surface component for this variant. */
|
|
37
|
-
article?: ComponentType<
|
|
37
|
+
article?: ComponentType<DrawingVariantSurfaceProps>;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
export type
|
|
41
|
-
/** The base
|
|
42
|
-
|
|
40
|
+
export type DrawingVariantSurfaceProps = {
|
|
41
|
+
/** The base Drawing object (may be a snapshot from useObject/Surface). */
|
|
42
|
+
drawing: Obj.Snapshot<Drawing.Drawing> | Drawing.Drawing;
|
|
43
43
|
/** The resolved LIVE canvas object — variant store adapters need `Doc.createAccessor`. */
|
|
44
|
-
canvas:
|
|
44
|
+
canvas: Drawing.Canvas;
|
|
45
45
|
/** Surface role passed through from the host. */
|
|
46
46
|
role?: string;
|
|
47
47
|
/** Attendable id passed through from the host. */
|
package/src/util/index.ts
CHANGED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Database, type Ref } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
import * as Drawing from '../types/Drawing';
|
|
11
|
+
import * as IllustratorCapabilities from '../types/IllustratorCapabilities';
|
|
12
|
+
import { type DrawingVariant } from '../types/types';
|
|
13
|
+
|
|
14
|
+
export class UnknownDrawingVariantError extends Error {
|
|
15
|
+
readonly _tag = 'UnknownDrawingVariantError';
|
|
16
|
+
constructor(readonly schema: string) {
|
|
17
|
+
super(`No drawing variant registered for canvas schema: ${schema}.`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Loads a Drawing and resolves the variant claiming its canvas `schema`.
|
|
23
|
+
* Used by the renderer-agnostic read/edit operations.
|
|
24
|
+
*/
|
|
25
|
+
export const resolveVariant = (
|
|
26
|
+
ref: Ref.Ref<Drawing.Drawing>,
|
|
27
|
+
): Effect.Effect<
|
|
28
|
+
{ drawing: Drawing.Drawing; canvas: Drawing.Canvas; variant: DrawingVariant },
|
|
29
|
+
Error,
|
|
30
|
+
Database.Service | Capability.Service
|
|
31
|
+
> =>
|
|
32
|
+
Effect.gen(function* () {
|
|
33
|
+
const drawing = yield* Database.load(ref);
|
|
34
|
+
const canvas = yield* Database.load(drawing.canvas);
|
|
35
|
+
const schema = canvas.schema ?? '';
|
|
36
|
+
const variants = yield* Capability.getAll(IllustratorCapabilities.VariantProvider);
|
|
37
|
+
const variant = variants.find((entry) => entry.id === schema);
|
|
38
|
+
if (!variant) {
|
|
39
|
+
return yield* Effect.fail(new UnknownDrawingVariantError(schema));
|
|
40
|
+
}
|
|
41
|
+
return { drawing, canvas, variant };
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/** Resolve a variant by canvas schema, for callers that already hold the canvas. */
|
|
45
|
+
export const findVariant = (
|
|
46
|
+
variants: readonly DrawingVariant[],
|
|
47
|
+
canvas: Pick<Drawing.Canvas, 'schema'> | undefined,
|
|
48
|
+
): DrawingVariant | undefined => variants.find((entry) => entry.id === (canvas?.schema ?? ''));
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { n as VariantProvider } from "./chunk-IllustratorCapabilities.mjs";
|
|
2
|
-
import { Capability } from "@dxos/app-framework";
|
|
3
|
-
import * as Effect from "effect/Effect";
|
|
4
|
-
import { Database, Obj, Type } from "@dxos/echo";
|
|
5
|
-
//#region src/util/load-sketch.ts
|
|
6
|
-
var SketchVariantMismatchError = class extends Error {
|
|
7
|
-
sketchId;
|
|
8
|
-
expectedTypename;
|
|
9
|
-
actualTypename;
|
|
10
|
-
_tag = "SketchVariantMismatchError";
|
|
11
|
-
constructor(sketchId, expectedTypename, actualTypename) {
|
|
12
|
-
super(`Sketch ${sketchId} canvas typename mismatch: expected ${expectedTypename}, got ${actualTypename}.`);
|
|
13
|
-
this.sketchId = sketchId;
|
|
14
|
-
this.expectedTypename = expectedTypename;
|
|
15
|
-
this.actualTypename = actualTypename;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
var UnknownSketchVariantError = class extends Error {
|
|
19
|
-
typename;
|
|
20
|
-
_tag = "UnknownSketchVariantError";
|
|
21
|
-
constructor(typename) {
|
|
22
|
-
super(`No sketch variant registered for canvas type: ${typename}.`);
|
|
23
|
-
this.typename = typename;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Loads a Sketch from a Ref and resolves its canvas, asserting the canvas matches
|
|
28
|
-
* the expected type. Returns the typed pair.
|
|
29
|
-
*
|
|
30
|
-
* Use in operation handlers that declare `input.sketch: SketchRef<MyCanvas>`.
|
|
31
|
-
*/
|
|
32
|
-
var loadSketch = (ref, canvasType) => Effect.gen(function* () {
|
|
33
|
-
const sketch = yield* Database.load(ref);
|
|
34
|
-
const canvas = yield* Database.load(sketch.canvas);
|
|
35
|
-
if (!Obj.instanceOf(canvasType, canvas)) {
|
|
36
|
-
const expected = Type.getTypename(canvasType) ?? "unknown";
|
|
37
|
-
const actual = Obj.getTypename(canvas) ?? "unknown";
|
|
38
|
-
return yield* Effect.fail(new SketchVariantMismatchError(sketch.id, expected, actual));
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
sketch,
|
|
42
|
-
canvas
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
/**
|
|
46
|
-
* Loads a Sketch and resolves the variant provider matching its canvas typename.
|
|
47
|
-
* Used by the renderer-agnostic read/edit operations.
|
|
48
|
-
*/
|
|
49
|
-
var resolveVariant = (ref) => Effect.gen(function* () {
|
|
50
|
-
const sketch = yield* Database.load(ref);
|
|
51
|
-
const canvas = yield* Database.load(sketch.canvas);
|
|
52
|
-
const typename = Obj.getTypename(canvas) ?? "unknown";
|
|
53
|
-
const variant = (yield* Capability.getAll(VariantProvider)).find((entry) => entry.id === typename);
|
|
54
|
-
if (!variant) return yield* Effect.fail(new UnknownSketchVariantError(typename));
|
|
55
|
-
return {
|
|
56
|
-
sketch,
|
|
57
|
-
canvas,
|
|
58
|
-
variant
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
//#endregion
|
|
62
|
-
export { resolveVariant as i, UnknownSketchVariantError as n, loadSketch as r, SketchVariantMismatchError as t };
|
|
63
|
-
|
|
64
|
-
//# sourceMappingURL=chunk-load-sketch.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-load-sketch.mjs","names":[],"sources":["../../src/util/load-sketch.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Database, Obj, type Ref, Type } from '@dxos/echo';\n\nimport * as IllustratorCapabilities from '../types/IllustratorCapabilities';\nimport * as Sketch from '../types/Sketch';\nimport { type SketchVariant } from '../types/types';\n\nexport class SketchVariantMismatchError extends Error {\n readonly _tag = 'SketchVariantMismatchError';\n constructor(\n readonly sketchId: string,\n readonly expectedTypename: string,\n readonly actualTypename: string,\n ) {\n super(`Sketch ${sketchId} canvas typename mismatch: expected ${expectedTypename}, got ${actualTypename}.`);\n }\n}\n\nexport class UnknownSketchVariantError extends Error {\n readonly _tag = 'UnknownSketchVariantError';\n constructor(readonly typename: string) {\n super(`No sketch variant registered for canvas type: ${typename}.`);\n }\n}\n\n/**\n * Loads a Sketch from a Ref and resolves its canvas, asserting the canvas matches\n * the expected type. Returns the typed pair.\n *\n * Use in operation handlers that declare `input.sketch: SketchRef<MyCanvas>`.\n */\nexport const loadSketch = <S extends Type.AnyObj>(\n ref: Ref.Ref<Sketch.Sketch>,\n canvasType: S,\n): Effect.Effect<{ sketch: Sketch.Sketch; canvas: Type.InstanceType<S> }, Error, Database.Service> =>\n Effect.gen(function* () {\n const sketch = yield* Database.load(ref);\n const canvas = yield* Database.load(sketch.canvas);\n if (!Obj.instanceOf(canvasType, canvas)) {\n const expected = Type.getTypename(canvasType) ?? 'unknown';\n const actual = Obj.getTypename(canvas as Obj.Any) ?? 'unknown';\n return yield* Effect.fail(new SketchVariantMismatchError(sketch.id, expected, actual));\n }\n return { sketch, canvas: canvas as Type.InstanceType<S> };\n });\n\n/**\n * Loads a Sketch and resolves the variant provider matching its canvas typename.\n * Used by the renderer-agnostic read/edit operations.\n */\nexport const resolveVariant = (\n ref: Ref.Ref<Sketch.Sketch>,\n): Effect.Effect<\n { sketch: Sketch.Sketch; canvas: Obj.Any; variant: SketchVariant },\n Error,\n Database.Service | Capability.Service\n> =>\n Effect.gen(function* () {\n const sketch = yield* Database.load(ref);\n const canvas = (yield* Database.load(sketch.canvas)) as Obj.Any;\n const typename = Obj.getTypename(canvas) ?? 'unknown';\n const variants = yield* Capability.getAll(IllustratorCapabilities.VariantProvider);\n const variant = variants.find((entry) => entry.id === typename);\n if (!variant) {\n return yield* Effect.fail(new UnknownSketchVariantError(typename));\n }\n return { sketch, canvas, variant };\n });\n"],"mappings":";;;;;AAaA,IAAa,6BAAb,cAAgD,MAAM;CAGzC;CACA;CACA;CAJX,OAAgB;CAChB,YACE,UACA,kBACA,gBACA;EACA,MAAM,UAAU,SAAS,sCAAsC,iBAAiB,QAAQ,eAAe,EAAE;EAJhG,KAAA,WAAA;EACA,KAAA,mBAAA;EACA,KAAA,iBAAA;CAGX;AACF;AAEA,IAAa,4BAAb,cAA+C,MAAM;CAE9B;CADrB,OAAgB;CAChB,YAAY,UAA2B;EACrC,MAAM,iDAAiD,SAAS,EAAE;EAD/C,KAAA,WAAA;CAErB;AACF;;;;;;;AAQA,IAAa,cACX,KACA,eAEA,OAAO,IAAI,aAAa;CACtB,MAAM,SAAS,OAAO,SAAS,KAAK,GAAG;CACvC,MAAM,SAAS,OAAO,SAAS,KAAK,OAAO,MAAM;CACjD,IAAI,CAAC,IAAI,WAAW,YAAY,MAAM,GAAG;EACvC,MAAM,WAAW,KAAK,YAAY,UAAU,KAAK;EACjD,MAAM,SAAS,IAAI,YAAY,MAAiB,KAAK;EACrD,OAAO,OAAO,OAAO,KAAK,IAAI,2BAA2B,OAAO,IAAI,UAAU,MAAM,CAAC;CACvF;CACA,OAAO;EAAE;EAAgB;CAA+B;AAC1D,CAAC;;;;;AAMH,IAAa,kBACX,QAMA,OAAO,IAAI,aAAa;CACtB,MAAM,SAAS,OAAO,SAAS,KAAK,GAAG;CACvC,MAAM,SAAU,OAAO,SAAS,KAAK,OAAO,MAAM;CAClD,MAAM,WAAW,IAAI,YAAY,MAAM,KAAK;CAE5C,MAAM,WAAU,OADQ,WAAW,OAAO,eAAuC,EAAA,CACxD,MAAM,UAAU,MAAM,OAAO,QAAQ;CAC9D,IAAI,CAAC,SACH,OAAO,OAAO,OAAO,KAAK,IAAI,0BAA0B,QAAQ,CAAC;CAEnE,OAAO;EAAE;EAAQ;EAAQ;CAAQ;AACnC,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type SpaceCapabilities } from '@dxos/plugin-space';
|
|
3
|
-
import { type SketchVariant } from '#types';
|
|
4
|
-
export type CreateSketchPanelProps = SpaceCapabilities.CreateObjectCustomPanelProps & {
|
|
5
|
-
/** Optional override (primarily for stories/tests). Defaults to IllustratorCapabilities.VariantProvider. */
|
|
6
|
-
variants?: SketchVariant[];
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* Variant picker for sketches (SearchList over contributed `SketchVariant[]`).
|
|
10
|
-
* On select, calls `onCreateObject({ variantId })`; plugin-illustrator's
|
|
11
|
-
* CreateObjectEntry.createObject resolves the variantId, builds the canvas via
|
|
12
|
-
* variant.createCanvas, then wraps it in a Sketch.
|
|
13
|
-
*/
|
|
14
|
-
export declare const CreateSketchPanel: ({ onCreateObject, variants: variantsProp }: CreateSketchPanelProps) => React.JSX.Element;
|
|
15
|
-
//# sourceMappingURL=CreateSketchPanel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CreateSketchPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/CreateSketchPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAK5D,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC,4BAA4B,GAAG;IACpF,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC5B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,+CAAgD,sBAAsB,sBA0CnG,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
3
|
-
import { type Sketch } from '#types';
|
|
4
|
-
export type SketchArticleProps = AppSurface.ObjectArticleProps<Sketch.Sketch> & {
|
|
5
|
-
extrinsic?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare function SketchArticle({ role, attendableId, subject: sketch, extrinsic }: SketchArticleProps): React.JSX.Element | null;
|
|
8
|
-
export declare namespace SketchArticle {
|
|
9
|
-
var displayName: string;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=SketchArticle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SketchArticle.d.ts","sourceRoot":"","sources":["../../../../../src/containers/SketchArticle/SketchArticle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAMvD,OAAO,EAA2B,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9D,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG;IAC9E,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;sCAG4B,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,kBAAkB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/SketchArticle/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
3
|
-
import { type Sketch } from '#types';
|
|
4
|
-
export type SketchCardProps = AppSurface.ObjectCardProps<Sketch.Sketch>;
|
|
5
|
-
export declare function SketchCard({ role, subject: sketch, editable }: SketchCardProps): React.JSX.Element | null;
|
|
6
|
-
export declare namespace SketchCard {
|
|
7
|
-
var displayName: string;
|
|
8
|
-
}
|
|
9
|
-
export default SketchCard;
|
|
10
|
-
//# sourceMappingURL=SketchCard.d.ts.map
|