mce 0.25.0 → 0.25.1

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/README.md CHANGED
@@ -67,7 +67,7 @@
67
67
  ## 📤 Import & export
68
68
 
69
69
  - **Export**: `PNG` · `JPEG` · `WebP` · `SVG` · `PDF` · `GIF` · `MP4` · `Lottie` · `PPTX` / `XLSX` / `DOCX` · `JSON`
70
- - **Import**: `PPTX` / `XLSX` / `DOCX` · `PSD` · `HTML` · images · `JSON`
70
+ - **Import**: `PPTX` / `XLSX` / `DOCX` · `PSD` · `SVG` · `HTML` · images · `JSON`
71
71
 
72
72
  These ship as optional plugins; their heavy encoders / parsers are lazy-loaded on first use:
73
73
 
@@ -76,7 +76,7 @@ These ship as optional plugins; their heavy encoders / parsers are lazy-loaded o
76
76
  | `@mce/gif` | GIF export |
77
77
  | `@mce/mp4` | MP4 export |
78
78
  | `@mce/pdf` | PDF export |
79
- | `@mce/svg` | SVG export |
79
+ | `@mce/svg` | SVG import & export |
80
80
  | `@mce/openxml` | PPTX / XLSX / DOCX import & export |
81
81
  | `@mce/psd` | PSD import (Photoshop layers → elements) |
82
82
  | `@mce/html` | HTML import |
@@ -267,6 +267,44 @@ editor.exec('applyAiActions', [
267
267
  ])
268
268
  ```
269
269
 
270
+ ## 🤖 AI
271
+
272
+ `@mce/ai` ships a **typed action layer**, not a model. It gives you a schema to
273
+ put in your prompt and a safe `applyAiActions` that validates / sanitizes a batch
274
+ of actions and applies them in a single undo step — wiring the LLM call is up to you.
275
+
276
+ **1. Register the plugin**
277
+
278
+ ```ts
279
+ import ai from '@mce/ai'
280
+ new Editor({ plugins: [ai()] })
281
+ ```
282
+
283
+ **2. Build the prompt — `getAiPrompt` assembles schema + node ids + request for you**
284
+
285
+ ```ts
286
+ const prompt = editor.exec('getAiPrompt', userInput)
287
+ // Already includes the action schema and every existing node id (so the model can
288
+ // reference current elements). Need the raw schema instead? editor.exec('getAiActionSchema').
289
+ ```
290
+
291
+ **3. Call your own model, then apply the returned actions**
292
+
293
+ ```ts
294
+ // ← your LLM / SDK; @mce/ai is model-agnostic
295
+ const text = await callYourLLM(prompt)
296
+ const actions = JSON.parse(text) // e.g. [{ type: 'createText', text: 'Hi', x: 40, y: 40 }]
297
+
298
+ const { created, errors } = editor.exec('applyAiActions', actions)
299
+ // created: ids of newly created elements
300
+ // errors: rejected actions + reasons (invalid fields / unknown node ids) — skipped, not applied
301
+ ```
302
+
303
+ - **Model-agnostic** — any LLM / SDK works as long as it emits schema-conforming JSON.
304
+ - **Safe** — invalid actions (bad fields, unknown ids) are rejected into `errors`, never written to the document.
305
+ - **One undo step** — the whole batch is a single undo entry.
306
+ - **Node ids included** — `getAiPrompt` embeds all current node ids, so actions referencing existing elements (`setStyle` / `move` / `delete` / `select` / `duplicate` / `align(ids)`) validate; building the prompt yourself means adding them manually.
307
+
270
308
  ## 🤝 Collaboration
271
309
 
272
310
  The CRDT document model (Yjs) lives in the **core** — undo / redo and offline
@@ -337,6 +375,31 @@ on the new document's `YDoc`; the transport is bound per-document.
337
375
  > Comments (`@mce/comments`) live on `element.comments` and are part of the
338
376
  > document model, so they sync over the same session automatically.
339
377
 
378
+ ## 📚 Packages
379
+
380
+ Every package ships as ESM and registers the same way (`new Editor({ plugins: [pkg()] })`).
381
+ The default export of each `@mce/*` package is its plugin function; commands it adds are
382
+ called via `editor.exec(name, …)` rather than imported.
383
+
384
+ | Package | Description | Key exports |
385
+ | --- | --- | --- |
386
+ | `mce` | Headless infinite-canvas editor core (WebGL; export to image / video / PPT). | `Editor`, `EditorLayout`, `EditorLayoutItem`, `EditorLayers`, `createShapeElement` / `createTextElement` / … factories, `useEditor` |
387
+ | `@mce/ai` | LLM-driven, typed canvas actions (`createText` / `createShape` / `setStyle` / `move` / `select` / `delete` / `duplicate` / `align`) applied in one undo step with automatic validation. | `plugin` (default); `validateAiActions`, `AI_ACTION_SCHEMA` (commands: `applyAiActions`, `getAiActionSchema`, `getAiPrompt`) |
388
+ | `@mce/bigesj` | Bigesj design-doc integration: font preloading, clipboard paste detection, and PPTX / XLSX / DOCX loading. | `plugin(options)` (default); `useFonts`, `bigeLoader`, `bidTidLoader`, `clipboardLoader` |
389
+ | `@mce/chart` | Bar / line / pie chart elements with a built-in data editor and toolbelt entry. | `plugin` (default); `createChartElement(type, options)` |
390
+ | `@mce/collaboration` | Real-time multi-user editing (Yjs CRDT) over a pluggable provider (built-in WebSocket, y-websocket compatible; swap for WebRTC / BroadcastChannel) plus presence (remote cursors / selection / avatars). | `plugin` (default, registers collaboration + presence); `collaborationPlugin`, `presencePlugin`, `AbstractProvider`, `WebsocketProvider` |
391
+ | `@mce/comments` | Anchored comments: pins anchored to elements that follow on move / scale / rotate, with thread replies / resolve / reopen / delete. | `plugin` (default); `useComments`, `createCommentsStore` |
392
+ | `@mce/gaoding` | Gaoding design-doc clipboard-paste support. | `plugin` (default); `clipboardLoader` |
393
+ | `@mce/gif` | GIF export (frame-by-frame render from timeline keyframes; `modern-gif` lazy-loaded). | `plugin` (default) |
394
+ | `@mce/html` | HTML file / MIME import — DOM converted into canvas elements. | `plugin` (default) |
395
+ | `@mce/mp4` | MP4 export (adaptive bitrate, 720p–2160p, 30fps; `modern-mp4` lazy-loaded). | `plugin` (default) |
396
+ | `@mce/openxml` | PPTX / XLSX / DOCX two-way import & export with smart layer & font mapping (`modern-openxml`). | `plugin` (default) |
397
+ | `@mce/pdf` | PDF export with page metadata (size / margins; `modern-pdf` lazy-loaded). | `plugin` (default) |
398
+ | `@mce/psd` | PSD import — Photoshop layers expanded into elements, layer canvases auto-uploaded as image assets. | `plugin` (default); `psdToFrame` |
399
+ | `@mce/svg` | SVG import & export (Path2D path sets + viewBox, multi-MIME copy). | `plugin` (default) |
400
+ | `@mce/table` | Table element + in-canvas editor (add / remove rows & columns, merge / split cells, style editing, zoom-aware grid, toolbelt entry). | `plugin` (default); `createTableElement(rows, cols, options)` |
401
+ | `@mce/workflow` | Node-graph editing mode (connectable nodes, templated node types, preset text / image / video generation nodes). | `plugin` (default); `getWorkflowPorts`, `toConnectionPoints`, `INPUT_PORT`, `OUTPUT_PORT` (commands: `addWorkflowNode`, `addWorkflowConnection`) |
402
+
340
403
  ## 🏗️ Architecture
341
404
 
342
405
  ```
@@ -345,7 +408,7 @@ packages/
345
408
  gif/ # GIF export (@mce/gif)
346
409
  mp4/ # MP4 export (@mce/mp4)
347
410
  pdf/ # PDF export (@mce/pdf)
348
- svg/ # SVG export (@mce/svg)
411
+ svg/ # SVG import & export (@mce/svg)
349
412
  openxml/ # PPTX/XLSX/DOCX import & export (@mce/openxml)
350
413
  psd/ # PSD import (@mce/psd)
351
414
  html/ # HTML import (@mce/html)
@@ -355,6 +418,8 @@ packages/
355
418
  workflow/ # node-graph mode (@mce/workflow)
356
419
  collaboration/ # real-time collaboration (@mce/collaboration)
357
420
  comments/ # comments (@mce/comments)
421
+ bigesj/ # Bigesj design-doc integration (@mce/bigesj)
422
+ gaoding/ # Gaoding clipboard paste (@mce/gaoding)
358
423
  playground/ # demo & test app
359
424
  ```
360
425
 
@@ -30,7 +30,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
30
30
  readonly lockAspectRatioStrategy?: "all" | "diagonal" | undefined;
31
31
  readonly handleStyle?: "8-points" | "4-points" | undefined;
32
32
  readonly handleShape?: "rect" | "circle" | undefined;
33
- readonly handles?: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[] | undefined;
33
+ readonly handles?: ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[] | undefined;
34
34
  readonly scale?: [number, number] | undefined;
35
35
  readonly offset?: [number, number] | undefined;
36
36
  readonly initialSize?: boolean | undefined;
@@ -69,7 +69,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
69
69
  lockAspectRatioStrategy?: "all" | "diagonal";
70
70
  handleStyle?: "8-points" | "4-points";
71
71
  handleShape?: "rect" | "circle";
72
- handles?: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
72
+ handles?: ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
73
73
  scale?: [number, number];
74
74
  offset?: [number, number];
75
75
  initialSize?: boolean;
@@ -85,7 +85,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
85
85
  "onUpdate:modelValue"?: ((value: Partial<Mce.TransformValue> | undefined) => any) | undefined;
86
86
  }>, {
87
87
  start: (event?: MouseEvent, index?: number) => boolean;
88
- activeHandle: import("vue").Ref<("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl") | undefined, ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl") | undefined>;
88
+ activeHandle: import("vue").Ref<("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl") | undefined, ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl") | undefined>;
89
89
  transforming: import("vue").Ref<boolean, boolean>;
90
90
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
91
91
  move: (context: Mce.TransformContext) => any;
@@ -97,14 +97,14 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
97
97
  scale: [number, number];
98
98
  threshold: number;
99
99
  ui: boolean;
100
+ resizeStrategy: "free" | "lockAspectRatio";
100
101
  movable: boolean;
101
102
  rotatable: boolean;
102
103
  resizable: boolean;
103
- resizeStrategy: "free" | "lockAspectRatio";
104
104
  tag: string | any;
105
105
  lockAspectRatioStrategy: "all" | "diagonal";
106
106
  handleShape: "rect" | "circle";
107
- handles: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
107
+ handles: ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
108
108
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
109
109
  beforeCreate?: (() => void) | (() => void)[];
110
110
  created?: (() => void) | (() => void)[];
@@ -130,14 +130,14 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
130
130
  scale: [number, number];
131
131
  threshold: number;
132
132
  ui: boolean;
133
+ resizeStrategy: "free" | "lockAspectRatio";
133
134
  movable: boolean;
134
135
  rotatable: boolean;
135
136
  resizable: boolean;
136
- resizeStrategy: "free" | "lockAspectRatio";
137
137
  tag: string | any;
138
138
  lockAspectRatioStrategy: "all" | "diagonal";
139
139
  handleShape: "rect" | "circle";
140
- handles: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
140
+ handles: ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
141
141
  }> & Omit<Readonly<{
142
142
  ui?: boolean;
143
143
  tag?: string | any;
@@ -152,7 +152,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
152
152
  lockAspectRatioStrategy?: "all" | "diagonal";
153
153
  handleStyle?: "8-points" | "4-points";
154
154
  handleShape?: "rect" | "circle";
155
- handles?: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
155
+ handles?: ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
156
156
  scale?: [number, number];
157
157
  offset?: [number, number];
158
158
  initialSize?: boolean;
@@ -166,9 +166,9 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
166
166
  onStart?: ((context: Mce.TransformContext) => any) | undefined;
167
167
  onEnd?: ((context: Mce.TransformContext) => any) | undefined;
168
168
  "onUpdate:modelValue"?: ((value: Partial<Mce.TransformValue> | undefined) => any) | undefined;
169
- }>, "transforming" | "start" | "activeHandle" | ("offset" | "scale" | "threshold" | "ui" | "movable" | "rotatable" | "resizable" | "resizeStrategy" | "tag" | "lockAspectRatioStrategy" | "handleShape" | "handles")> & {
169
+ }>, "transforming" | "start" | "activeHandle" | ("offset" | "scale" | "threshold" | "ui" | "resizeStrategy" | "movable" | "rotatable" | "resizable" | "tag" | "lockAspectRatioStrategy" | "handleShape" | "handles")> & {
170
170
  start: (event?: MouseEvent, index?: number) => boolean;
171
- activeHandle: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl") | undefined;
171
+ activeHandle: ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl") | undefined;
172
172
  transforming: boolean;
173
173
  } & {} & import("vue").ComponentCustomProperties & {} & {
174
174
  $slots: {
@@ -215,7 +215,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
215
215
  readonly lockAspectRatioStrategy?: "all" | "diagonal" | undefined;
216
216
  readonly handleStyle?: "8-points" | "4-points" | undefined;
217
217
  readonly handleShape?: "rect" | "circle" | undefined;
218
- readonly handles?: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[] | undefined;
218
+ readonly handles?: ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[] | undefined;
219
219
  readonly scale?: [number, number] | undefined;
220
220
  readonly offset?: [number, number] | undefined;
221
221
  readonly initialSize?: boolean | undefined;
@@ -254,7 +254,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
254
254
  lockAspectRatioStrategy?: "all" | "diagonal";
255
255
  handleStyle?: "8-points" | "4-points";
256
256
  handleShape?: "rect" | "circle";
257
- handles?: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
257
+ handles?: ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
258
258
  scale?: [number, number];
259
259
  offset?: [number, number];
260
260
  initialSize?: boolean;
@@ -270,7 +270,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
270
270
  "onUpdate:modelValue"?: ((value: Partial<Mce.TransformValue> | undefined) => any) | undefined;
271
271
  }>, {
272
272
  start: (event?: MouseEvent, index?: number) => boolean;
273
- activeHandle: import("vue").Ref<("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl") | undefined, ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl") | undefined>;
273
+ activeHandle: import("vue").Ref<("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl") | undefined, ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl") | undefined>;
274
274
  transforming: import("vue").Ref<boolean, boolean>;
275
275
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
276
276
  move: (context: Mce.TransformContext) => any;
@@ -282,14 +282,14 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
282
282
  scale: [number, number];
283
283
  threshold: number;
284
284
  ui: boolean;
285
+ resizeStrategy: "free" | "lockAspectRatio";
285
286
  movable: boolean;
286
287
  rotatable: boolean;
287
288
  resizable: boolean;
288
- resizeStrategy: "free" | "lockAspectRatio";
289
289
  tag: string | any;
290
290
  lockAspectRatioStrategy: "all" | "diagonal";
291
291
  handleShape: "rect" | "circle";
292
- handles: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
292
+ handles: ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
293
293
  }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
294
294
  beforeCreate?: (() => void) | (() => void)[];
295
295
  created?: (() => void) | (() => void)[];
@@ -315,14 +315,14 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
315
315
  scale: [number, number];
316
316
  threshold: number;
317
317
  ui: boolean;
318
+ resizeStrategy: "free" | "lockAspectRatio";
318
319
  movable: boolean;
319
320
  rotatable: boolean;
320
321
  resizable: boolean;
321
- resizeStrategy: "free" | "lockAspectRatio";
322
322
  tag: string | any;
323
323
  lockAspectRatioStrategy: "all" | "diagonal";
324
324
  handleShape: "rect" | "circle";
325
- handles: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
325
+ handles: ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
326
326
  }> & Omit<Readonly<{
327
327
  ui?: boolean;
328
328
  tag?: string | any;
@@ -337,7 +337,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
337
337
  lockAspectRatioStrategy?: "all" | "diagonal";
338
338
  handleStyle?: "8-points" | "4-points";
339
339
  handleShape?: "rect" | "circle";
340
- handles?: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
340
+ handles?: ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl")[];
341
341
  scale?: [number, number];
342
342
  offset?: [number, number];
343
343
  initialSize?: boolean;
@@ -351,9 +351,9 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
351
351
  onStart?: ((context: Mce.TransformContext) => any) | undefined;
352
352
  onEnd?: ((context: Mce.TransformContext) => any) | undefined;
353
353
  "onUpdate:modelValue"?: ((value: Partial<Mce.TransformValue> | undefined) => any) | undefined;
354
- }>, "transforming" | "start" | "activeHandle" | ("offset" | "scale" | "threshold" | "ui" | "movable" | "rotatable" | "resizable" | "resizeStrategy" | "tag" | "lockAspectRatioStrategy" | "handleShape" | "handles")> & {
354
+ }>, "transforming" | "start" | "activeHandle" | ("offset" | "scale" | "threshold" | "ui" | "resizeStrategy" | "movable" | "rotatable" | "resizable" | "tag" | "lockAspectRatioStrategy" | "handleShape" | "handles")> & {
355
355
  start: (event?: MouseEvent, index?: number) => boolean;
356
- activeHandle: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl") | undefined;
356
+ activeHandle: ("move" | "resize-b" | "resize-t" | "resize-r" | "resize-l" | "resize-br" | "resize-tr" | "resize-tl" | "resize-bl" | "rotate-br" | "rotate-tr" | "rotate-tl" | "rotate-bl" | "round-br" | "round-tr" | "round-tl" | "round-bl") | undefined;
357
357
  transforming: boolean;
358
358
  } & {} & import("vue").ComponentCustomProperties & {} & {
359
359
  $slots: {
@@ -73,10 +73,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
73
73
  scale: [number, number];
74
74
  threshold: number;
75
75
  ui: boolean;
76
+ resizeStrategy: "free" | "lockAspectRatio";
76
77
  movable: boolean;
77
78
  rotatable: boolean;
78
79
  resizable: boolean;
79
- resizeStrategy: "free" | "lockAspectRatio";
80
80
  tag: string | any;
81
81
  lockAspectRatioStrategy: "all" | "diagonal";
82
82
  handleShape: "rect" | "circle";
@@ -15,6 +15,18 @@ export declare const LOCAL_ORIGIN: unique symbol;
15
15
  * observe 回调据此跳过回写,避免本地↔yjs 回环。
16
16
  */
17
17
  export declare const INTERNAL_ORIGIN: unique symbol;
18
+ /**
19
+ * Element2D 上需要逐键代理同步的 CoreObject 子对象。
20
+ *
21
+ * **必须是「全集」而非按内容推导**:即便某子对象当前为空(如未连线的 connection),也要建好
22
+ * 代理,否则对端后续往该子对象写入将无法同步。漏一项即是一类静默 bug(connection 曾因漏列导致
23
+ * 连线在对端丢失)。
24
+ *
25
+ * **单一事实来源 = 引擎 Element2D.toJSON() 序列化的子对象集**(modern-canvas)。两处独立硬编码
26
+ * 会漂移,故此处集中定义,并由 YDoc.test.ts 的「子对象覆盖完整」用例对账:引擎新增子对象时测试失败,
27
+ * 提示在此补列。注:`filter` 在 TS 接口里但不被 toJSON 序列化、也非独立 CoreObject,故不在此列。
28
+ */
29
+ export declare const ELEMENT2D_SYNCED_SUBOBJECTS: readonly ["style", "background", "shape", "fill", "outline", "text", "foreground", "shadow", "table", "chart", "comments", "connection"];
18
30
  export type YNode = Y.Map<unknown> & {
19
31
  get: ((prop: 'id') => string) & ((prop: 'name') => string) & ((prop: 'parentId') => string) & ((prop: 'style') => Y.Map<unknown>) & ((prop: 'background') => Y.Map<unknown>) & ((prop: 'shape') => Y.Map<unknown>) & ((prop: 'fill') => Y.Map<unknown>) & ((prop: 'outline') => Y.Map<unknown>) & ((prop: 'text') => Y.Map<unknown>) & ((prop: 'foreground') => Y.Map<unknown>) & ((prop: 'shadow') => Y.Map<unknown>) & ((prop: 'comments') => Y.Map<unknown>) & ((prop: 'meta') => Y.Map<unknown>) & ((prop: 'childrenIds') => Y.Array<string>) & (<T = unknown>(prop: string) => T);
20
32
  };