@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateDrawingPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/CreateDrawingPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAK5D,OAAO,EAAE,KAAK,cAAc,EAA2B,MAAM,QAAQ,CAAC;AAEtE,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC,4BAA4B,GAAG;IACrF,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,+CAAgD,uBAAuB,sBA0CrG,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './CreateDrawingPanel';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
3
|
+
import { type Drawing } from '#types';
|
|
4
|
+
export type DrawingArticleProps = AppSurface.ObjectArticleProps<Drawing.Drawing> & {
|
|
5
|
+
extrinsic?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function DrawingArticle({ role, attendableId, subject: drawing, extrinsic }: DrawingArticleProps): React.JSX.Element | null;
|
|
8
|
+
export declare namespace DrawingArticle {
|
|
9
|
+
var displayName: string;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=DrawingArticle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawingArticle.d.ts","sourceRoot":"","sources":["../../../../../src/containers/DrawingArticle/DrawingArticle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAKvD,OAAO,EAAE,KAAK,OAAO,EAA2B,MAAM,QAAQ,CAAC;AAG/D,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG;IACjF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;uCAG6B,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,mBAAmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/DrawingArticle/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
3
|
+
import { type Drawing } from '#types';
|
|
4
|
+
export type DrawingCardProps = AppSurface.ObjectCardProps<Drawing.Drawing>;
|
|
5
|
+
export declare function DrawingCard({ role, subject: drawing, editable }: DrawingCardProps): React.JSX.Element | null;
|
|
6
|
+
export declare namespace DrawingCard {
|
|
7
|
+
var displayName: string;
|
|
8
|
+
}
|
|
9
|
+
export default DrawingCard;
|
|
10
|
+
//# sourceMappingURL=DrawingCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawingCard.d.ts","sourceRoot":"","sources":["../../../../../src/containers/DrawingCard/DrawingCard.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,KAAK,OAAO,EAA2B,MAAM,QAAQ,CAAC;AAG/D,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;oCAG/C,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,gBAAgB;;;;eAqBnE,WAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/DrawingCard/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './DrawingArticle';
|
|
2
|
+
export * from './DrawingCard';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/containers/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/containers/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Drawing from '../types/Drawing';
|
|
2
|
+
import { type ApplyResult, type ContentHandler, type ReadResult } from './content';
|
|
2
3
|
import type * as Scene from './scene';
|
|
3
|
-
/** A world object as derived from the canvas: placement is always resolved. */
|
|
4
|
-
export type ReadWorldObject = Scene.WorldObject & {
|
|
5
|
-
origin: Scene.Point;
|
|
6
|
-
scale: number;
|
|
7
|
-
};
|
|
8
|
-
export type ReadResult = {
|
|
9
|
-
scene: {
|
|
10
|
-
objects: ReadWorldObject[];
|
|
11
|
-
};
|
|
12
|
-
/** Shapes on the canvas not managed by the DSL (hand-drawn by users). */
|
|
13
|
-
unmanaged: number;
|
|
14
|
-
};
|
|
15
|
-
export type ApplyResult = {
|
|
16
|
-
/** Object ids created or modified. */
|
|
17
|
-
upserted: string[];
|
|
18
|
-
/** Shape records removed. */
|
|
19
|
-
removed: number;
|
|
20
|
-
};
|
|
21
4
|
/**
|
|
22
|
-
* Maps the scene DSL onto a
|
|
23
|
-
*
|
|
24
|
-
* coherent after users drag or resize shapes in the renderer's UI.
|
|
5
|
+
* Maps the scene DSL onto a canvas. Geometry is derived from the live records — not a stored
|
|
6
|
+
* copy — so the model stays coherent after users drag or resize shapes in the renderer's UI.
|
|
25
7
|
*/
|
|
26
|
-
export type
|
|
8
|
+
export type DrawingBuilder = {
|
|
9
|
+
/** Renderer dialect this builder handles; matched against `Canvas.schema`. */
|
|
10
|
+
readonly schema: string;
|
|
27
11
|
/** Derive the neutral scene from the canvas. */
|
|
28
|
-
read: (canvas:
|
|
29
|
-
/** Apply a batch of edit commands atomically
|
|
30
|
-
apply: (canvas:
|
|
12
|
+
read: (canvas: Drawing.Canvas) => ReadResult;
|
|
13
|
+
/** Apply a batch of edit commands atomically. */
|
|
14
|
+
apply: (canvas: Drawing.Canvas, commands: readonly Scene.Command[]) => ApplyResult;
|
|
31
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* Builds a {@link DrawingBuilder} from the renderer's {@link ContentHandler}, so a variant only
|
|
18
|
+
* supplies its record encoding and inherits the ECHO write semantics and command bookkeeping.
|
|
19
|
+
*/
|
|
20
|
+
export declare const makeBuilder: ({ schema, handler }: {
|
|
21
|
+
schema: string;
|
|
22
|
+
handler: ContentHandler;
|
|
23
|
+
}) => DrawingBuilder;
|
|
32
24
|
//# sourceMappingURL=builder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../../src/model/builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../../src/model/builder.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAmB,KAAK,UAAU,EAAiB,MAAM,WAAW,CAAC;AACnH,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,gDAAgD;IAChD,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,KAAK,UAAU,CAAC;IAC7C,iDAAiD;IACjD,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,KAAK,CAAC,OAAO,EAAE,KAAK,WAAW,CAAC;CACpF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,wBAAyB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,cAAc,CAAA;CAAE,KAAG,cAc7F,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type * as Scene from './scene';
|
|
2
|
+
/** Opaque map of record id → renderer record. */
|
|
3
|
+
export type ContentMap = Record<string, any>;
|
|
4
|
+
/** DSL identity stamped onto a managed record. */
|
|
5
|
+
export type Identity = {
|
|
6
|
+
object: string;
|
|
7
|
+
element: string;
|
|
8
|
+
/** Set on companion records that belong to an element rather than being one (e.g. arrow labels). */
|
|
9
|
+
part?: string;
|
|
10
|
+
};
|
|
11
|
+
/** Where an object sits on the canvas: `canvas = origin + local * scale`. */
|
|
12
|
+
export type Placement = {
|
|
13
|
+
origin: Scene.Point;
|
|
14
|
+
scale: number;
|
|
15
|
+
};
|
|
16
|
+
/** An object as accepted by the renderer's compiler; `upsert-elements` supplies only a subset. */
|
|
17
|
+
export type ObjectInput = Scene.WorldObject | {
|
|
18
|
+
id: string;
|
|
19
|
+
elements: readonly Scene.Element[];
|
|
20
|
+
};
|
|
21
|
+
/** A world object as derived from the canvas: placement is always resolved. */
|
|
22
|
+
export type ReadWorldObject = Scene.WorldObject & Placement;
|
|
23
|
+
export type ReadResult = {
|
|
24
|
+
scene: {
|
|
25
|
+
objects: ReadWorldObject[];
|
|
26
|
+
};
|
|
27
|
+
/** Records on the canvas not managed by the DSL (drawn by hand). */
|
|
28
|
+
unmanaged: number;
|
|
29
|
+
};
|
|
30
|
+
export type ApplyResult = {
|
|
31
|
+
/** Object ids created or modified. */
|
|
32
|
+
upserted: string[];
|
|
33
|
+
/** Records removed. */
|
|
34
|
+
removed: number;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The renderer-specific half of command application: how records carry identity, how objects
|
|
38
|
+
* compile to records, and any bookkeeping the renderer's store requires.
|
|
39
|
+
*/
|
|
40
|
+
export type ContentHandler = {
|
|
41
|
+
/** DSL identity for a record, or undefined when the record isn't managed by the DSL. */
|
|
42
|
+
identify: (record: any) => Identity | undefined;
|
|
43
|
+
/** Compile an object's elements into records keyed by record id. */
|
|
44
|
+
render: (object: ObjectInput, placement: Placement, content: ContentMap) => ContentMap;
|
|
45
|
+
/** Derive the scene from the content map. */
|
|
46
|
+
read: (content: ContentMap) => ReadResult;
|
|
47
|
+
/** Translate an object move into a per-record mutation. */
|
|
48
|
+
translate: (record: any, delta: Scene.Point) => void;
|
|
49
|
+
/** Create any scaffolding the renderer needs before its first record (e.g. a page). */
|
|
50
|
+
scaffold?: (content: ContentMap) => void;
|
|
51
|
+
/** Merge compiled records into the content map; defaults to a plain assign. */
|
|
52
|
+
merge?: (content: ContentMap, records: ContentMap) => void;
|
|
53
|
+
/** Clean up after deletions (e.g. drop bindings left dangling). */
|
|
54
|
+
prune?: (content: ContentMap) => void;
|
|
55
|
+
};
|
|
56
|
+
/** Apply a batch of edit commands to the canvas content (mutates `content`). */
|
|
57
|
+
export declare const applyCommands: (content: ContentMap, commands: readonly Scene.Command[], handler: ContentHandler) => ApplyResult;
|
|
58
|
+
/** Seed a fractional-index counter past any existing `a<n>` indexes. */
|
|
59
|
+
export declare const nextIndex: (content: ContentMap, isCounted?: (record: any) => boolean) => number;
|
|
60
|
+
//# sourceMappingURL=content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../../src/model/content.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAEtC,iDAAiD;AACjD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE7C,kDAAkD;AAClD,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,oGAAoG;IACpG,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,SAAS,GAAG;IACtB,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,kGAAkG;AAClG,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,KAAK,CAAC,OAAO,EAAE,CAAA;CAAE,CAAC;AAEjG,+EAA+E;AAC/E,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE;QAAE,OAAO,EAAE,eAAe,EAAE,CAAA;KAAE,CAAC;IACtC,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,sCAAsC;IACtC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,wFAAwF;IACxF,QAAQ,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,QAAQ,GAAG,SAAS,CAAC;IAChD,oEAAoE;IACpE,MAAM,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,KAAK,UAAU,CAAC;IACvF,6CAA6C;IAC7C,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,UAAU,CAAC;IAC1C,2DAA2D;IAC3D,SAAS,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,KAAK,IAAI,CAAC;IACrD,uFAAuF;IACvF,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC;IACzC,+EAA+E;IAC/E,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC;IAC3D,mEAAmE;IACnE,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,aAAa,YACf,UAAU,YACT,SAAS,KAAK,CAAC,OAAO,EAAE,WACzB,cAAc,KACtB,WAqFF,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,SAAS,YAAa,UAAU,cAAa,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,KAAgB,MAcjG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/model/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/model/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type * as Scene from './scene';
|
|
2
|
+
export type Direction = 'TB' | 'BT' | 'LR' | 'RL';
|
|
3
|
+
export type MermaidNode = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Enclosing subgraph id, when declared inside one. */
|
|
7
|
+
group?: string;
|
|
8
|
+
};
|
|
9
|
+
export type MermaidGroup = {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
children: string[];
|
|
13
|
+
};
|
|
14
|
+
export type MermaidEdge = {
|
|
15
|
+
from: string;
|
|
16
|
+
to: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
};
|
|
19
|
+
export type MermaidGraph = {
|
|
20
|
+
direction: Direction;
|
|
21
|
+
nodes: MermaidNode[];
|
|
22
|
+
groups: MermaidGroup[];
|
|
23
|
+
edges: MermaidEdge[];
|
|
24
|
+
};
|
|
25
|
+
/** Parse a mermaid flowchart into a neutral graph. Unrecognised lines are ignored. */
|
|
26
|
+
export declare const parse: (source: string) => MermaidGraph;
|
|
27
|
+
export type CompileOptions = {
|
|
28
|
+
/** Canvas position of the diagram's top-left, in canvas px. */
|
|
29
|
+
origin?: Scene.Point;
|
|
30
|
+
/** Canvas px per scene unit. */
|
|
31
|
+
scale?: number;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Compile a mermaid flowchart into scene commands: one world object per node (element `box`),
|
|
35
|
+
* one per subgraph frame, and an `edges` object holding the connectors as bound arrows.
|
|
36
|
+
*/
|
|
37
|
+
export declare const compile: (source: string, options?: CompileOptions) => Scene.Command[];
|
|
38
|
+
//# sourceMappingURL=mermaid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mermaid.d.ts","sourceRoot":"","sources":["../../../../src/model/mermaid.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAEtC,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAElD,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB,CAAC;AAYF,sFAAsF;AACtF,eAAO,MAAM,KAAK,WAAY,MAAM,KAAG,YAuEtC,CAAC;AAyEF,MAAM,MAAM,cAAc,GAAG;IAC3B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC;IACrB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,WAAY,MAAM,YAAW,cAAc,KAAQ,KAAK,CAAC,OAAO,EA4FnF,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Exercises node declarations, a labelled-blank subgraph, fan-out, and a `C <-> Y` cycle. */
|
|
2
|
+
export declare const FLOWCHART = "\nflowchart TB\n X[X]\n\n subgraph CORE[\" \"]\n A[A]\n B[B]\n C[C]\n\n A --> B\n A --> C\n end\n\n Y[Y]\n\n X --> A\n X --> B\n X --> C\n C --> Y\n Y --> C\n";
|
|
3
|
+
//# sourceMappingURL=mermaid.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mermaid.test.d.ts","sourceRoot":"","sources":["../../../../src/model/mermaid.test.ts"],"names":[],"mappings":"AASA,8FAA8F;AAC9F,eAAO,MAAM,SAAS,iOAoBrB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Operation } from '@dxos/compute';
|
|
2
|
-
import {
|
|
3
|
-
declare const handler: Operation.WithHandler<typeof
|
|
2
|
+
import { DrawingOperation } from '../types';
|
|
3
|
+
declare const handler: Operation.WithHandler<typeof DrawingOperation.Create>;
|
|
4
4
|
export default handler;
|
|
5
5
|
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/operations/create.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/operations/create.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAW,gBAAgB,EAA2B,MAAM,UAAU,CAAC;AAG9E,QAAA,MAAM,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,gBAAgB,CAAC,MAAM,CAYlE,CAAC;eAEa,OAAO"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Operation } from '@dxos/compute';
|
|
2
|
-
import {
|
|
3
|
-
declare const handler: Operation.WithHandler<typeof
|
|
2
|
+
import { DrawingOperation } from '../types';
|
|
3
|
+
declare const handler: Operation.WithHandler<typeof DrawingOperation.Edit>;
|
|
4
4
|
export default handler;
|
|
5
5
|
//# sourceMappingURL=edit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/operations/edit.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../../src/operations/edit.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,QAAA,MAAM,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAShE,CAAC;eAEa,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../../src/operations/generate.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,QAAA,MAAM,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CASpE,CAAC;eAEa,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/operations/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,eAAO,MAAM,8BAA8B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/operations/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,eAAO,MAAM,8BAA8B,yCAK1C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Operation } from '@dxos/compute';
|
|
2
|
-
import {
|
|
3
|
-
declare const handler: Operation.WithHandler<typeof
|
|
2
|
+
import { DrawingOperation } from '../types';
|
|
3
|
+
declare const handler: Operation.WithHandler<typeof DrawingOperation.Read>;
|
|
4
4
|
export default handler;
|
|
5
5
|
//# sourceMappingURL=read.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../../src/operations/read.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../../src/operations/read.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,QAAA,MAAM,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAOhE,CAAC;eAEa,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawing-skill.d.ts","sourceRoot":"","sources":["../../../../src/skills/drawing-skill.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAY,MAAM,eAAe,CAAC;AA4DhD,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,UAGlB,CAAC;eAEa,KAAK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as DrawingSkill } from './drawing-skill';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/skills/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/skills/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export declare const translations: [{
|
|
2
2
|
readonly 'en-US': {
|
|
3
3
|
readonly [x: string]: {
|
|
4
|
-
readonly 'typename.label': '
|
|
5
|
-
readonly 'typename.label_zero': '
|
|
6
|
-
readonly 'typename.label_one': '
|
|
7
|
-
readonly 'typename.label_other': '
|
|
8
|
-
readonly 'object-name.placeholder': 'New
|
|
9
|
-
readonly 'add-object.label': 'Add
|
|
10
|
-
readonly 'rename-object.label': 'Rename
|
|
11
|
-
readonly 'delete-object.label': 'Delete
|
|
12
|
-
readonly 'object-deleted.label': '
|
|
4
|
+
readonly 'typename.label': 'Drawing';
|
|
5
|
+
readonly 'typename.label_zero': 'Drawings';
|
|
6
|
+
readonly 'typename.label_one': 'Drawing';
|
|
7
|
+
readonly 'typename.label_other': 'Drawings';
|
|
8
|
+
readonly 'object-name.placeholder': 'New drawing';
|
|
9
|
+
readonly 'add-object.label': 'Add drawing';
|
|
10
|
+
readonly 'rename-object.label': 'Rename drawing';
|
|
11
|
+
readonly 'delete-object.label': 'Delete drawing';
|
|
12
|
+
readonly 'object-deleted.label': 'Drawing deleted';
|
|
13
13
|
readonly 'plugin.name'?: undefined;
|
|
14
14
|
readonly 'create-panel.variant.label'?: undefined;
|
|
15
15
|
readonly 'create-panel.variant.placeholder'?: undefined;
|
|
@@ -27,7 +27,7 @@ export declare const translations: [{
|
|
|
27
27
|
readonly 'plugin.name': 'Illustrator';
|
|
28
28
|
readonly 'create-panel.variant.label': 'Select renderer';
|
|
29
29
|
readonly 'create-panel.variant.placeholder': 'Search renderers...';
|
|
30
|
-
readonly 'unsupported-variant.label': 'Unsupported
|
|
30
|
+
readonly 'unsupported-variant.label': 'Unsupported drawing variant';
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY;;;uCAIC,
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY;;;uCAIC,SAAS;4CACJ,UAAU;2CACX,SAAS;6CACP,UAAU;gDACP,aAAa;yCACpB,aAAa;4CACV,gBAAgB;4CAChB,gBAAgB;6CACf,iBAAiB;;;;;;;;;;;;;;;oCAG1B,aAAa;mDACE,iBAAiB;yDACX,qBAAqB;kDAC5B,6BAA6B;;;EAInC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Obj, Type } from '@dxos/echo';
|
|
2
|
+
declare const Canvas_base: Type.ObjClass<Canvas, {
|
|
3
|
+
readonly schema?: string | undefined;
|
|
4
|
+
readonly content: {
|
|
5
|
+
readonly [x: string]: any;
|
|
6
|
+
};
|
|
7
|
+
}, {}>;
|
|
8
|
+
/**
|
|
9
|
+
* Canvas content shared by every renderer: an opaque map of record id → record, managed by the
|
|
10
|
+
* renderer's store adapter and CRDT-merged by ECHO without knowing its shape. `schema` identifies
|
|
11
|
+
* the renderer dialect (e.g. `tldraw.com/2`, `excalidraw.com/2`) and is how a `Drawing` is matched
|
|
12
|
+
* to the variant that can render it.
|
|
13
|
+
*
|
|
14
|
+
* Hidden: reached through `Drawing.canvas`, never listed on its own.
|
|
15
|
+
*/
|
|
16
|
+
export declare class Canvas extends Canvas_base {
|
|
17
|
+
}
|
|
18
|
+
export type MakeCanvasOptions = Omit<Partial<Obj.MakeProps<typeof Canvas>>, 'schema'> & {
|
|
19
|
+
/** Required at construction: matches the canvas to a renderer variant. */
|
|
20
|
+
schema: string;
|
|
21
|
+
};
|
|
22
|
+
/** Creates a {@link Canvas} for the given renderer schema. */
|
|
23
|
+
export declare const makeCanvas: ({ schema, content }: MakeCanvasOptions) => Canvas;
|
|
24
|
+
/** Type guard for {@link Canvas} objects. */
|
|
25
|
+
export declare const isCanvas: (object: unknown) => object is Canvas;
|
|
26
|
+
declare const Drawing_base: Type.ObjClass<Drawing, {
|
|
27
|
+
readonly name?: string | undefined;
|
|
28
|
+
readonly canvas: import("@dxos/echo/internal").Ref<Canvas & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & Obj.Unknown>;
|
|
29
|
+
}, {}>;
|
|
30
|
+
/**
|
|
31
|
+
* Base Drawing object. Renderer-specific behaviour lives in the variant that claims the canvas's
|
|
32
|
+
* `schema`, so all renderers (tldraw, excalidraw, ...) share one typename, graph node, create
|
|
33
|
+
* flow, and surface scaffolding.
|
|
34
|
+
*/
|
|
35
|
+
export declare class Drawing extends Drawing_base {
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Build a `Drawing` referencing the given canvas.
|
|
39
|
+
*
|
|
40
|
+
* @param name Optional display name shown in the graph node and Properties form.
|
|
41
|
+
* @param canvas Canvas holding the renderer's content.
|
|
42
|
+
*/
|
|
43
|
+
export declare const make: ({ name, canvas }: {
|
|
44
|
+
name?: string;
|
|
45
|
+
canvas: Canvas;
|
|
46
|
+
}) => Drawing;
|
|
47
|
+
/** Type guard for {@link Drawing} objects. */
|
|
48
|
+
export declare const isDrawing: (object: unknown) => object is Drawing;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=Drawing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Drawing.d.ts","sourceRoot":"","sources":["../../../../src/types/Drawing.ts"],"names":[],"mappings":"AAQA,OAAO,EAAmB,GAAG,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;;;;;;;AAI7D;;;;;;;GAOG;AACH,qBAAa,MAAO,SAAQ,WAK3B;CAAG;AAEJ,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG;IACtF,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,UAAU,wBAA8B,iBAAiB,KAAG,MAClC,CAAC;AAExC,6CAA6C;AAC7C,eAAO,MAAM,QAAQ,WAAY,OAAO,KAAG,MAAM,IAAI,MAAwC,CAAC;;;;;AAE9F;;;;GAIG;AACH,qBAAa,OAAQ,SAAQ,YAY5B;CAAG;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,IAAI,qBAAsB;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,KAAG,OACpB,CAAC;AAExD,8CAA8C;AAC9C,eAAO,MAAM,SAAS,WAAY,OAAO,KAAG,MAAM,IAAI,OAA0C,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Capability } from '@dxos/app-framework';
|
|
2
2
|
import { Operation } from '@dxos/compute';
|
|
3
3
|
import { Database } from '@dxos/echo';
|
|
4
|
-
import * as
|
|
4
|
+
import * as Drawing from './Drawing';
|
|
5
5
|
export declare const Create: Operation.Definition<{
|
|
6
6
|
readonly name?: string | undefined;
|
|
7
7
|
readonly variant?: string | undefined;
|
|
8
8
|
}, {
|
|
9
|
-
readonly object:
|
|
9
|
+
readonly object: Drawing.Drawing & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object>;
|
|
10
10
|
}, Database.Service | Capability.Service>;
|
|
11
11
|
export declare const Read: Operation.Definition<{
|
|
12
|
-
readonly
|
|
12
|
+
readonly drawing: import("@dxos/echo/internal").Ref<Drawing.Drawing & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>;
|
|
13
13
|
}, {
|
|
14
14
|
readonly scene: {
|
|
15
15
|
readonly objects: readonly {
|
|
@@ -113,7 +113,7 @@ export declare const Read: Operation.Definition<{
|
|
|
113
113
|
readonly unmanaged: number;
|
|
114
114
|
}, Database.Service | Capability.Service>;
|
|
115
115
|
export declare const Edit: Operation.Definition<{
|
|
116
|
-
readonly
|
|
116
|
+
readonly drawing: import("@dxos/echo/internal").Ref<Drawing.Drawing & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>;
|
|
117
117
|
readonly commands: readonly ({
|
|
118
118
|
readonly op: "upsert-object";
|
|
119
119
|
readonly object: {
|
|
@@ -424,4 +424,110 @@ export declare const Edit: Operation.Definition<{
|
|
|
424
424
|
readonly upserted: readonly string[];
|
|
425
425
|
readonly removed: number;
|
|
426
426
|
}, Database.Service | Capability.Service>;
|
|
427
|
-
|
|
427
|
+
export declare const Generate: Operation.Definition<{
|
|
428
|
+
readonly drawing: import("@dxos/echo/internal").Ref<Drawing.Drawing & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown>;
|
|
429
|
+
readonly source: string;
|
|
430
|
+
}, {
|
|
431
|
+
readonly scene: {
|
|
432
|
+
readonly objects: readonly {
|
|
433
|
+
readonly id: string;
|
|
434
|
+
readonly origin?: {
|
|
435
|
+
readonly x: number;
|
|
436
|
+
readonly y: number;
|
|
437
|
+
} | undefined;
|
|
438
|
+
readonly scale?: number | undefined;
|
|
439
|
+
readonly elements: readonly ({
|
|
440
|
+
readonly color?: "black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "white" | "yellow" | undefined;
|
|
441
|
+
readonly fill?: "none" | "pattern" | "solid" | undefined;
|
|
442
|
+
readonly stroke?: "dashed" | "dotted" | "sketchy" | "solid" | undefined;
|
|
443
|
+
readonly weight?: "l" | "m" | "s" | "xl" | undefined;
|
|
444
|
+
readonly kind: "diamond" | "ellipse" | "rect" | "triangle";
|
|
445
|
+
readonly id: string;
|
|
446
|
+
readonly x: number;
|
|
447
|
+
readonly y: number;
|
|
448
|
+
readonly w: number;
|
|
449
|
+
readonly h: number;
|
|
450
|
+
readonly rotation?: number | undefined;
|
|
451
|
+
readonly text?: string | undefined;
|
|
452
|
+
} | {
|
|
453
|
+
readonly color?: "black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "white" | "yellow" | undefined;
|
|
454
|
+
readonly fill?: "none" | "pattern" | "solid" | undefined;
|
|
455
|
+
readonly stroke?: "dashed" | "dotted" | "sketchy" | "solid" | undefined;
|
|
456
|
+
readonly weight?: "l" | "m" | "s" | "xl" | undefined;
|
|
457
|
+
readonly kind: "circle";
|
|
458
|
+
readonly id: string;
|
|
459
|
+
readonly cx: number;
|
|
460
|
+
readonly cy: number;
|
|
461
|
+
readonly r: number;
|
|
462
|
+
readonly text?: string | undefined;
|
|
463
|
+
} | {
|
|
464
|
+
readonly color?: "black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "white" | "yellow" | undefined;
|
|
465
|
+
readonly fill?: "none" | "pattern" | "solid" | undefined;
|
|
466
|
+
readonly stroke?: "dashed" | "dotted" | "sketchy" | "solid" | undefined;
|
|
467
|
+
readonly weight?: "l" | "m" | "s" | "xl" | undefined;
|
|
468
|
+
readonly kind: "line";
|
|
469
|
+
readonly id: string;
|
|
470
|
+
readonly points: readonly {
|
|
471
|
+
readonly x: number;
|
|
472
|
+
readonly y: number;
|
|
473
|
+
}[];
|
|
474
|
+
readonly closed?: boolean | undefined;
|
|
475
|
+
} | {
|
|
476
|
+
readonly color?: "black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "white" | "yellow" | undefined;
|
|
477
|
+
readonly fill?: "none" | "pattern" | "solid" | undefined;
|
|
478
|
+
readonly stroke?: "dashed" | "dotted" | "sketchy" | "solid" | undefined;
|
|
479
|
+
readonly weight?: "l" | "m" | "s" | "xl" | undefined;
|
|
480
|
+
readonly kind: "curve";
|
|
481
|
+
readonly id: string;
|
|
482
|
+
readonly points: readonly {
|
|
483
|
+
readonly x: number;
|
|
484
|
+
readonly y: number;
|
|
485
|
+
}[];
|
|
486
|
+
} | {
|
|
487
|
+
readonly color?: "black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "white" | "yellow" | undefined;
|
|
488
|
+
readonly fill?: "none" | "pattern" | "solid" | undefined;
|
|
489
|
+
readonly stroke?: "dashed" | "dotted" | "sketchy" | "solid" | undefined;
|
|
490
|
+
readonly weight?: "l" | "m" | "s" | "xl" | undefined;
|
|
491
|
+
readonly kind: "arc";
|
|
492
|
+
readonly id: string;
|
|
493
|
+
readonly cx: number;
|
|
494
|
+
readonly cy: number;
|
|
495
|
+
readonly r: number;
|
|
496
|
+
readonly startAngle: number;
|
|
497
|
+
readonly endAngle: number;
|
|
498
|
+
} | {
|
|
499
|
+
readonly color?: "black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "white" | "yellow" | undefined;
|
|
500
|
+
readonly fill?: "none" | "pattern" | "solid" | undefined;
|
|
501
|
+
readonly stroke?: "dashed" | "dotted" | "sketchy" | "solid" | undefined;
|
|
502
|
+
readonly weight?: "l" | "m" | "s" | "xl" | undefined;
|
|
503
|
+
readonly kind: "text";
|
|
504
|
+
readonly id: string;
|
|
505
|
+
readonly x: number;
|
|
506
|
+
readonly y: number;
|
|
507
|
+
readonly w?: number | undefined;
|
|
508
|
+
readonly text: string;
|
|
509
|
+
} | {
|
|
510
|
+
readonly color?: "black" | "blue" | "green" | "grey" | "light-blue" | "light-green" | "light-red" | "light-violet" | "orange" | "red" | "violet" | "white" | "yellow" | undefined;
|
|
511
|
+
readonly fill?: "none" | "pattern" | "solid" | undefined;
|
|
512
|
+
readonly stroke?: "dashed" | "dotted" | "sketchy" | "solid" | undefined;
|
|
513
|
+
readonly weight?: "l" | "m" | "s" | "xl" | undefined;
|
|
514
|
+
readonly kind: "arrow";
|
|
515
|
+
readonly id: string;
|
|
516
|
+
readonly from?: string | undefined;
|
|
517
|
+
readonly to?: string | undefined;
|
|
518
|
+
readonly start?: {
|
|
519
|
+
readonly x: number;
|
|
520
|
+
readonly y: number;
|
|
521
|
+
} | undefined;
|
|
522
|
+
readonly end?: {
|
|
523
|
+
readonly x: number;
|
|
524
|
+
readonly y: number;
|
|
525
|
+
} | undefined;
|
|
526
|
+
readonly text?: string | undefined;
|
|
527
|
+
})[];
|
|
528
|
+
}[];
|
|
529
|
+
};
|
|
530
|
+
readonly unmanaged: number;
|
|
531
|
+
readonly upserted: readonly string[];
|
|
532
|
+
}, Database.Service | Capability.Service>;
|
|
533
|
+
//# sourceMappingURL=DrawingOperation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DrawingOperation.d.ts","sourceRoot":"","sources":["../../../../src/types/DrawingOperation.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAa,MAAM,YAAY,CAAC;AAMjD,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AAIrC,eAAO,MAAM,MAAM;;;;;yCAYjB,CAAC;AAUH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCAaf,CAAC;AAEH,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCAkBf,CAAC;AAEH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCAiBnB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Capability } from '@dxos/app-framework';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DrawingVariant } from './types';
|
|
3
3
|
/**
|
|
4
|
-
* A
|
|
5
|
-
*
|
|
4
|
+
* A drawing variant contribution. Each renderer plugin (tldraw, excalidraw, ...) contributes one
|
|
5
|
+
* via `Capability.contributes(IllustratorCapabilities.VariantProvider, variant)`.
|
|
6
6
|
* Consumers iterate via `Capability.getAll(IllustratorCapabilities.VariantProvider)` (Effect) or
|
|
7
7
|
* `useCapabilities(IllustratorCapabilities.VariantProvider)` (React).
|
|
8
8
|
*/
|
|
9
|
-
export declare const VariantProvider: Capability.InterfaceDef<
|
|
9
|
+
export declare const VariantProvider: Capability.InterfaceDef<DrawingVariant>;
|
|
10
10
|
//# sourceMappingURL=IllustratorCapabilities.d.ts.map
|