@netless/appliance-plugin 1.1.43 → 1.1.44-beta.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.
Files changed (63) hide show
  1. package/dist/appliance-plugin.js +1 -1
  2. package/dist/appliance-plugin.mjs +12 -12
  3. package/dist/{bridge-GmRa7-tp.js → bridge-CskJoX5M.js} +1 -1
  4. package/dist/{bridge-D30E9dr6.mjs → bridge-rKHCYJ6m.mjs} +1 -1
  5. package/dist/bridge.js +1 -1
  6. package/dist/bridge.mjs +1 -1
  7. package/dist/collector/types.d.ts +3 -0
  8. package/dist/component/textEditor/types.d.ts +5 -0
  9. package/dist/core/mainEngine.d.ts +10 -2
  10. package/dist/core/mainThread/snapshotThread.d.ts +3 -2
  11. package/dist/core/mainThread/subLocalThread.d.ts +5 -2
  12. package/dist/core/mainThread/subServiceThread.d.ts +1 -0
  13. package/dist/core/mainThread/subTopThread.d.ts +2 -2
  14. package/dist/core/tools/arrow.d.ts +423 -1
  15. package/dist/core/tools/base.d.ts +444 -2
  16. package/dist/core/tools/ellipse.d.ts +423 -1
  17. package/dist/core/tools/eraser.d.ts +846 -2
  18. package/dist/core/tools/eraserFaces.d.ts +2 -0
  19. package/dist/core/tools/laserPen.d.ts +846 -2
  20. package/dist/core/tools/pencil.d.ts +848 -2
  21. package/dist/core/tools/pencilEraser.d.ts +1692 -4
  22. package/dist/core/tools/pencilEraserBitMap.d.ts +2115 -5
  23. package/dist/core/tools/polygon.d.ts +423 -1
  24. package/dist/core/tools/rectangle.d.ts +423 -1
  25. package/dist/core/tools/selector.d.ts +2121 -7
  26. package/dist/core/tools/speechBalloon.d.ts +423 -1
  27. package/dist/core/tools/star.d.ts +423 -1
  28. package/dist/core/tools/straight.d.ts +423 -1
  29. package/dist/core/tools/text.d.ts +3 -3
  30. package/dist/core/tools/utils.d.ts +2 -2
  31. package/dist/core/types.d.ts +9 -0
  32. package/dist/core/utils/affineMatrix.d.ts +33 -0
  33. package/dist/core/utils/fontFamily.d.ts +8 -0
  34. package/dist/core/utils/index.d.ts +2 -0
  35. package/dist/core/utils/selectorMatrix.d.ts +4 -0
  36. package/dist/core/utils/selectorRefresh.d.ts +8 -0
  37. package/dist/core/utils/textRaster.d.ts +2 -0
  38. package/dist/core/vNodeManager.d.ts +1 -1
  39. package/dist/core/worker/base.d.ts +1 -1
  40. package/dist/core/worker/fullWorkerLocal.d.ts +1 -0
  41. package/dist/core/worker/fullWorkerService.d.ts +2 -1
  42. package/dist/core/worker/simpleWorker.d.ts +1 -1
  43. package/dist/core/worker/subWorkerTopLayer.d.ts +2 -2
  44. package/dist/fullWorker.js +148 -147
  45. package/dist/index-B0SB7Efu.js +570 -0
  46. package/dist/index-BIVRfc_x.js +570 -0
  47. package/dist/{index-CQuJ6lL1.mjs → index-BbBSxLGe.mjs} +473 -442
  48. package/dist/index-Bzg5OMdP.js +1 -0
  49. package/dist/{index-Ct5ShjRI.js → index-C-tBYq0K.js} +1 -1
  50. package/dist/{index-CatWUcZt.mjs → index-Ca2t53R7.mjs} +1 -1
  51. package/dist/{index-rDe1jjPM.mjs → index-ConirzkM.mjs} +1 -1
  52. package/dist/index-CsNG_bzI.js +1 -0
  53. package/dist/{index-C-pO2InQ.mjs → index-DWevrjrE.mjs} +12001 -11664
  54. package/dist/{index-DYDy0dd5.mjs → index-LcCU1tMV.mjs} +473 -442
  55. package/dist/{index-DGdruTPt.js → index-ZMuKk-bl.js} +1 -1
  56. package/dist/{index-CrJWLjuD.mjs → index-_3yxgNoj.mjs} +19490 -19158
  57. package/dist/plugin/baseApplianceManager.d.ts +2 -2
  58. package/dist/subWorker.js +133 -132
  59. package/package.json +58 -56
  60. package/dist/index-B44Av4kp.js +0 -1
  61. package/dist/index-CKtpWZ9L.js +0 -1
  62. package/dist/index-DLzvL8jo.js +0 -570
  63. package/dist/index-LmgcnMI8.js +0 -570
@@ -40,7 +40,429 @@ export declare class StraightShape extends BaseShapeTool {
40
40
  };
41
41
  workId: string;
42
42
  toolsType: EToolsKey;
43
- opt: import("./utils").ShapeOptions;
43
+ opt: {
44
+ matrix: import("../utils").AffineMatrix;
45
+ fontColor: string;
46
+ fontSize: number;
47
+ text: string;
48
+ textAlign: import("../../component/textEditor").TextAlignType;
49
+ verticalAlign: import("../../component/textEditor").VerticalAlignType;
50
+ lineHeight?: number;
51
+ fontFamily?: string;
52
+ bold?: import("../../component/textEditor").FontWeightType;
53
+ italic?: import("../../component/textEditor").FontStyleType;
54
+ fontBgColor?: string;
55
+ underline?: boolean;
56
+ lineThrough?: boolean;
57
+ boxPoint?: [number, number];
58
+ boxSize?: [number, number];
59
+ workState?: EventWorkState;
60
+ uid?: string;
61
+ isOpacity?: boolean;
62
+ strokeColor?: string;
63
+ fillColor?: string;
64
+ vertex?: string;
65
+ fragment?: string;
66
+ syncUnitTime?: number;
67
+ zIndex?: number;
68
+ scale?: [number, number];
69
+ rotate?: number;
70
+ thickness?: number;
71
+ textOpt?: import("../../component/textEditor").TextOptions;
72
+ translate?: [number, number];
73
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
74
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
75
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
76
+ lineCap?: "square" | "round";
77
+ lineDash?: [number, number];
78
+ } | {
79
+ matrix: import("../utils").AffineMatrix;
80
+ thickness: number;
81
+ strokeColor: string;
82
+ strokeType: EStrokeType;
83
+ autoShape?: boolean;
84
+ previewLocalOnly?: boolean;
85
+ isOpacity?: boolean;
86
+ fontColor?: string;
87
+ fontBgColor?: string;
88
+ fillColor?: string;
89
+ vertex?: string;
90
+ fragment?: string;
91
+ syncUnitTime?: number;
92
+ zIndex?: number;
93
+ scale?: [number, number];
94
+ rotate?: number;
95
+ textOpt?: import("../../component/textEditor").TextOptions;
96
+ translate?: [number, number];
97
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
98
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
99
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
100
+ lineCap?: "square" | "round";
101
+ lineDash?: [number, number];
102
+ } | {
103
+ matrix: import("../utils").AffineMatrix;
104
+ thickness: number;
105
+ duration: number;
106
+ strokeColor: string;
107
+ strokeType: Omit<EStrokeType, "Stroke">;
108
+ isOpacity?: boolean;
109
+ fontColor?: string;
110
+ fontBgColor?: string;
111
+ fillColor?: string;
112
+ vertex?: string;
113
+ fragment?: string;
114
+ syncUnitTime?: number;
115
+ zIndex?: number;
116
+ scale?: [number, number];
117
+ rotate?: number;
118
+ textOpt?: import("../../component/textEditor").TextOptions;
119
+ translate?: [number, number];
120
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
121
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
122
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
123
+ lineCap?: "square" | "round";
124
+ lineDash?: [number, number];
125
+ } | {
126
+ matrix: import("../utils").AffineMatrix;
127
+ thickness: number;
128
+ isOpacity?: boolean;
129
+ fontColor?: string;
130
+ fontBgColor?: string;
131
+ strokeColor?: string;
132
+ fillColor?: string;
133
+ vertex?: string;
134
+ fragment?: string;
135
+ syncUnitTime?: number;
136
+ zIndex?: number;
137
+ scale?: [number, number];
138
+ rotate?: number;
139
+ textOpt?: import("../../component/textEditor").TextOptions;
140
+ translate?: [number, number];
141
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
142
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
143
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
144
+ lineCap?: "square" | "round";
145
+ lineDash?: [number, number];
146
+ } | {
147
+ matrix: import("../utils").AffineMatrix;
148
+ thickness: number;
149
+ maxImageWidth?: number;
150
+ maxImageHeight?: number;
151
+ removeOnDone?: boolean;
152
+ isOpacity?: boolean;
153
+ fontColor?: string;
154
+ fontBgColor?: string;
155
+ strokeColor?: string;
156
+ fillColor?: string;
157
+ vertex?: string;
158
+ fragment?: string;
159
+ syncUnitTime?: number;
160
+ zIndex?: number;
161
+ scale?: [number, number];
162
+ rotate?: number;
163
+ textOpt?: import("../../component/textEditor").TextOptions;
164
+ translate?: [number, number];
165
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
166
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
167
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
168
+ lineCap?: "square" | "round";
169
+ lineDash?: [number, number];
170
+ } | {
171
+ matrix: import("../utils").AffineMatrix;
172
+ thickness: number;
173
+ isOpacity?: boolean;
174
+ fontColor?: string;
175
+ fontBgColor?: string;
176
+ strokeColor?: string;
177
+ fillColor?: string;
178
+ vertex?: string;
179
+ fragment?: string;
180
+ syncUnitTime?: number;
181
+ zIndex?: number;
182
+ scale?: [number, number];
183
+ rotate?: number;
184
+ textOpt?: import("../../component/textEditor").TextOptions;
185
+ translate?: [number, number];
186
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
187
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
188
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
189
+ lineCap?: "square" | "round";
190
+ lineDash?: [number, number];
191
+ } | {
192
+ matrix: import("../utils").AffineMatrix;
193
+ thickness: number;
194
+ vertices: number;
195
+ innerVerticeStep: number;
196
+ innerRatio: number;
197
+ strokeColor: string;
198
+ fillColor: string;
199
+ strokeType: EStrokeType;
200
+ isOpacity?: boolean;
201
+ fontColor?: string;
202
+ fontBgColor?: string;
203
+ vertex?: string;
204
+ fragment?: string;
205
+ syncUnitTime?: number;
206
+ zIndex?: number;
207
+ scale?: [number, number];
208
+ rotate?: number;
209
+ textOpt?: import("../../component/textEditor").TextOptions;
210
+ translate?: [number, number];
211
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
212
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
213
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
214
+ lineCap?: "square" | "round";
215
+ lineDash?: [number, number];
216
+ } | {
217
+ matrix: import("../utils").AffineMatrix;
218
+ isOpacity?: boolean;
219
+ fontColor?: string;
220
+ fontBgColor?: string;
221
+ strokeColor?: string;
222
+ fillColor?: string;
223
+ vertex?: string;
224
+ fragment?: string;
225
+ syncUnitTime?: number;
226
+ zIndex?: number;
227
+ scale?: [number, number];
228
+ rotate?: number;
229
+ thickness?: number;
230
+ textOpt?: import("../../component/textEditor").TextOptions;
231
+ translate?: [number, number];
232
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
233
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
234
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
235
+ lineCap?: "square" | "round";
236
+ lineDash?: [number, number];
237
+ } | {
238
+ matrix: import("../utils").AffineMatrix;
239
+ thickness: number;
240
+ strokeColor: string;
241
+ strokeType: EStrokeType;
242
+ isOpacity?: boolean;
243
+ fontColor?: string;
244
+ fontBgColor?: string;
245
+ fillColor?: string;
246
+ vertex?: string;
247
+ fragment?: string;
248
+ syncUnitTime?: number;
249
+ zIndex?: number;
250
+ scale?: [number, number];
251
+ rotate?: number;
252
+ textOpt?: import("../../component/textEditor").TextOptions;
253
+ translate?: [number, number];
254
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
255
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
256
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
257
+ lineCap?: "square" | "round";
258
+ lineDash?: [number, number];
259
+ } | {
260
+ matrix: import("../utils").AffineMatrix;
261
+ thickness: number;
262
+ strokeColor: string;
263
+ fillColor: string;
264
+ strokeType: EStrokeType;
265
+ isOpacity?: boolean;
266
+ fontColor?: string;
267
+ fontBgColor?: string;
268
+ vertex?: string;
269
+ fragment?: string;
270
+ syncUnitTime?: number;
271
+ zIndex?: number;
272
+ scale?: [number, number];
273
+ rotate?: number;
274
+ textOpt?: import("../../component/textEditor").TextOptions;
275
+ translate?: [number, number];
276
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
277
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
278
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
279
+ lineCap?: "square" | "round";
280
+ lineDash?: [number, number];
281
+ } | {
282
+ matrix: import("../utils").AffineMatrix;
283
+ thickness: number;
284
+ strokeColor: string;
285
+ fillColor: string;
286
+ strokeType: EStrokeType;
287
+ isOpacity?: boolean;
288
+ fontColor?: string;
289
+ fontBgColor?: string;
290
+ vertex?: string;
291
+ fragment?: string;
292
+ syncUnitTime?: number;
293
+ zIndex?: number;
294
+ scale?: [number, number];
295
+ rotate?: number;
296
+ textOpt?: import("../../component/textEditor").TextOptions;
297
+ translate?: [number, number];
298
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
299
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
300
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
301
+ lineCap?: "square" | "round";
302
+ lineDash?: [number, number];
303
+ } | {
304
+ matrix: import("../utils").AffineMatrix;
305
+ thickness: number;
306
+ vertices: number;
307
+ strokeColor: string;
308
+ fillColor: string;
309
+ strokeType: EStrokeType;
310
+ isOpacity?: boolean;
311
+ fontColor?: string;
312
+ fontBgColor?: string;
313
+ vertex?: string;
314
+ fragment?: string;
315
+ syncUnitTime?: number;
316
+ zIndex?: number;
317
+ scale?: [number, number];
318
+ rotate?: number;
319
+ textOpt?: import("../../component/textEditor").TextOptions;
320
+ translate?: [number, number];
321
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
322
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
323
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
324
+ lineCap?: "square" | "round";
325
+ lineDash?: [number, number];
326
+ } | {
327
+ matrix: import("../utils").AffineMatrix;
328
+ thickness: number;
329
+ strokeColor: string;
330
+ strokeType: EStrokeType;
331
+ isOpacity?: boolean;
332
+ fontColor?: string;
333
+ fontBgColor?: string;
334
+ fillColor?: string;
335
+ vertex?: string;
336
+ fragment?: string;
337
+ syncUnitTime?: number;
338
+ zIndex?: number;
339
+ scale?: [number, number];
340
+ rotate?: number;
341
+ textOpt?: import("../../component/textEditor").TextOptions;
342
+ translate?: [number, number];
343
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
344
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
345
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
346
+ lineCap?: "square" | "round";
347
+ lineDash?: [number, number];
348
+ } | {
349
+ matrix: import("../utils").AffineMatrix;
350
+ thickness: number;
351
+ placement: import("../..").SpeechBalloonPlacement;
352
+ strokeColor: string;
353
+ fillColor: string;
354
+ strokeType: EStrokeType;
355
+ isOpacity?: boolean;
356
+ fontColor?: string;
357
+ fontBgColor?: string;
358
+ vertex?: string;
359
+ fragment?: string;
360
+ syncUnitTime?: number;
361
+ zIndex?: number;
362
+ scale?: [number, number];
363
+ rotate?: number;
364
+ textOpt?: import("../../component/textEditor").TextOptions;
365
+ translate?: [number, number];
366
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
367
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
368
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
369
+ lineCap?: "square" | "round";
370
+ lineDash?: [number, number];
371
+ } | {
372
+ matrix: import("../utils").AffineMatrix;
373
+ src: string;
374
+ type: import("..").EImageType;
375
+ uuid: string;
376
+ centerX: number;
377
+ centerY: number;
378
+ width: number;
379
+ height: number;
380
+ locked: boolean;
381
+ uniformScale?: boolean;
382
+ crossOrigin?: boolean | string;
383
+ isOpacity?: boolean;
384
+ fontColor?: string;
385
+ fontBgColor?: string;
386
+ strokeColor?: string;
387
+ fillColor?: string;
388
+ vertex?: string;
389
+ fragment?: string;
390
+ syncUnitTime?: number;
391
+ zIndex?: number;
392
+ scale?: [number, number];
393
+ rotate?: number;
394
+ thickness?: number;
395
+ textOpt?: import("../../component/textEditor").TextOptions;
396
+ translate?: [number, number];
397
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
398
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
399
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
400
+ lineCap?: "square" | "round";
401
+ lineDash?: [number, number];
402
+ } | {
403
+ matrix: import("../utils").AffineMatrix;
404
+ type: import("..").ESVGType.url;
405
+ src: string;
406
+ crossOrigin: boolean | string;
407
+ uuid: string;
408
+ centerX: number;
409
+ centerY: number;
410
+ width: number;
411
+ height: number;
412
+ locked: boolean;
413
+ uniformScale: boolean;
414
+ state?: unknown;
415
+ isOpacity?: boolean;
416
+ fontColor?: string;
417
+ fontBgColor?: string;
418
+ strokeColor?: string;
419
+ fillColor?: string;
420
+ vertex?: string;
421
+ fragment?: string;
422
+ syncUnitTime?: number;
423
+ zIndex?: number;
424
+ scale?: [number, number];
425
+ rotate?: number;
426
+ thickness?: number;
427
+ textOpt?: import("../../component/textEditor").TextOptions;
428
+ translate?: [number, number];
429
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
430
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
431
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
432
+ lineCap?: "square" | "round";
433
+ lineDash?: [number, number];
434
+ } | {
435
+ matrix: import("../utils").AffineMatrix;
436
+ type: import("..").ESVGType.markmap;
437
+ data: string;
438
+ uuid: string;
439
+ centerX: number;
440
+ centerY: number;
441
+ width: number;
442
+ height: number;
443
+ locked: boolean;
444
+ uniformScale: boolean;
445
+ state?: unknown;
446
+ isOpacity?: boolean;
447
+ fontColor?: string;
448
+ fontBgColor?: string;
449
+ strokeColor?: string;
450
+ fillColor?: string;
451
+ vertex?: string;
452
+ fragment?: string;
453
+ syncUnitTime?: number;
454
+ zIndex?: number;
455
+ scale?: [number, number];
456
+ rotate?: number;
457
+ thickness?: number;
458
+ textOpt?: import("../../component/textEditor").TextOptions;
459
+ translate?: [number, number];
460
+ eraserlines?: import("./pencilEraserBitMap").SerializerEraserLines;
461
+ eraserFaces?: import("./eraserFaces").SerializedEraserFaces | null;
462
+ doingLines?: import("./pencilEraserBitMap").SerializerEraserLines;
463
+ lineCap?: "square" | "round";
464
+ lineDash?: [number, number];
465
+ };
44
466
  rect: IRectType;
45
467
  type: EPostMessageType;
46
468
  dataType: EDataType;
@@ -4,8 +4,8 @@ import { EPostMessageType, EScaleType, EToolsKey } from "../enum";
4
4
  import { Point2d } from "../utils/primitives/Point2d";
5
5
  import { BaseShapeTool, BaseShapeToolProps } from "./base";
6
6
  import { TextOptions } from "../../component/textEditor";
7
- import { ShapeNodes } from "./utils";
8
- import { VNodeManager } from "../vNodeManager";
7
+ import type { ShapeNodes } from "./utils";
8
+ import type { VNodeManager } from "../vNodeManager";
9
9
  import type { BaseCollectorReducerAction } from "../../collector/types";
10
10
  export declare class TextShape extends BaseShapeTool {
11
11
  static normalizeStorageData(storage: BaseCollectorReducerAction): Promise<{
@@ -51,6 +51,7 @@ export declare class TextShape extends BaseShapeTool {
51
51
  isDrawLabel?: boolean;
52
52
  boxRect?: IRectType;
53
53
  isActive?: () => boolean;
54
+ previewMatrix?: BaseNodeMapItem["previewMatrix"];
54
55
  }): Promise<IRectType | undefined>;
55
56
  updataOptService(): IRectType | undefined;
56
57
  updataOptServiceAsync(updateNodeOpt: IUpdateNodeOpt, isDrawLabel?: boolean, boxRect?: IRectType): Promise<IRectType | undefined>;
@@ -59,7 +60,6 @@ export declare class TextShape extends BaseShapeTool {
59
60
  static getSafetySnippetFontLength(fontSize: number): number;
60
61
  static createLabels(textOpt: TextOptions, layer: Group, groupRect: IRectType, isActive?: () => boolean): Promise<{
61
62
  labels: (Group | Polyline | Sprite | Label)[];
62
- maxWidth: number;
63
63
  }>;
64
64
  static updateNodeOpt(param: {
65
65
  node: ShapeNodes;
@@ -35,7 +35,7 @@ export interface CombineConsumeResult {
35
35
  rect: IRectType | undefined;
36
36
  consumeIndex: number;
37
37
  }
38
- export declare function getShapeTools(toolsType: EToolsKey): typeof TextShape | typeof ArrowShape | typeof PencilShape | typeof StraightShape | typeof EllipseShape | typeof PolygonShape | typeof StarShape | typeof RectangleShape | typeof SpeechBalloonShape | typeof LaserPenShape | typeof EraserShape | typeof BitMapEraserShape | typeof PencilEraserShape | typeof SelectorShape | typeof ImageShape | typeof ISvgShadowShape | undefined;
38
+ export declare function getShapeTools(toolsType: EToolsKey): typeof TextShape | typeof ArrowShape | typeof PencilShape | typeof StraightShape | typeof EllipseShape | typeof PolygonShape | typeof StarShape | typeof RectangleShape | typeof SpeechBalloonShape | typeof LaserPenShape | typeof EraserShape | typeof PencilEraserShape | typeof BitMapEraserShape | typeof SelectorShape | typeof ImageShape | typeof ISvgShadowShape | undefined;
39
39
  export declare function normalizeStorageDataByTool(storage: BaseCollectorReducerAction): Promise<StorageNormalizationResult>;
40
40
  export declare function normalizeStorageDataByToolSync(storage: BaseCollectorReducerAction): StorageNormalizationResult;
41
41
  export declare function getShapeInstance(param: {
@@ -45,5 +45,5 @@ export declare function getShapeInstance(param: {
45
45
  vNodes?: VNodeManager;
46
46
  fullLayer: Group;
47
47
  drawLayer?: Group;
48
- }, serviceWork?: ServiceThreadSubWork): TextShape | ArrowShape | PencilShape | StraightShape | EllipseShape | PolygonShape | StarShape | RectangleShape | SpeechBalloonShape | LaserPenShape | EraserShape | BitMapEraserShape | PencilEraserShape | SelectorShape | ImageShape | ISvgShadowShape | undefined;
48
+ }, serviceWork?: ServiceThreadSubWork): TextShape | ArrowShape | PencilShape | StraightShape | EllipseShape | PolygonShape | StarShape | RectangleShape | SpeechBalloonShape | LaserPenShape | EraserShape | PencilEraserShape | BitMapEraserShape | SelectorShape | ImageShape | ISvgShadowShape | undefined;
49
49
  export declare function findShapeBody(nodes: ShapeNodes[]): ShapeNodes[];
@@ -8,6 +8,7 @@ import type { Direction } from "re-resizable/lib/resizer";
8
8
  import type { ShapeOptType } from "../displayer/types";
9
9
  import type { AutoShapeResult } from "./autoShape/types";
10
10
  import type { RenderProbeProfile, WorkerRenderCapabilities } from "./worker/renderCapabilityProbe";
11
+ import type { AffineMatrix } from "./utils/affineMatrix";
11
12
  export type PickOne<T> = {
12
13
  [P in keyof T]: Record<P, T[P]> & Partial<Record<Exclude<keyof T, P>, undefined>>;
13
14
  }[keyof T];
@@ -102,6 +103,8 @@ export interface IUpdateNodeOpt {
102
103
  willRefresh?: boolean;
103
104
  /** 最新操作用户 */
104
105
  uid?: string;
106
+ matrixDelta?: AffineMatrix;
107
+ previewMatrix?: AffineMatrix;
105
108
  [key: string]: any;
106
109
  }
107
110
  export interface EraserGeometryDelta {
@@ -151,6 +154,8 @@ export type IWorkerMessage = Omit<Partial<BaseCollectorReducerAction>, "op"> & {
151
154
  /** Camera 最后一帧相关的延迟重渲染已完成。 */
152
155
  cameraSettledTaskId?: number;
153
156
  textUpdateForWoker?: boolean;
157
+ /** Live selector transform for the text editor overlay. */
158
+ previewMatrix?: AffineMatrix;
154
159
  tasksqueue?: Map<string, IWorkerMessage>;
155
160
  point?: [number, number];
156
161
  disableEraseImage?: boolean;
@@ -375,6 +380,7 @@ export interface IUpdateSelectorCallbackPropsType {
375
380
  opt: BaseShapeOptions;
376
381
  toolsType: EToolsKey;
377
382
  ops?: string;
383
+ previewMatrix?: AffineMatrix;
378
384
  }>;
379
385
  /** 平滑同步 */
380
386
  smoothSync?: boolean;
@@ -437,6 +443,9 @@ export type BaseNodeMapItem = {
437
443
  isSelected: boolean;
438
444
  /** 是否是影子模型,影子模型不会被绘制 */
439
445
  isShadow?: boolean;
446
+ matrix?: AffineMatrix;
447
+ /** Local transform used only while a selector gesture is in progress. */
448
+ previewMatrix?: AffineMatrix;
440
449
  };
441
450
  export type Size = {
442
451
  /**
@@ -0,0 +1,33 @@
1
+ /** Scene-space 2D affine matrix in SVG/CSS order: [a, b, c, d, e, f]. */
2
+ export type AffineMatrix = [number, number, number, number, number, number];
3
+ export interface AffineRect {
4
+ x: number;
5
+ y: number;
6
+ w: number;
7
+ h: number;
8
+ }
9
+ export declare const IDENTITY_AFFINE_MATRIX: AffineMatrix;
10
+ /** Read the Group-local origin used by SpriteJS before applying its transform. */
11
+ export declare function getNodeLocalPosition(node: unknown, fallback: [number, number]): [number, number];
12
+ export declare function normalizeAffineMatrix(value?: unknown): AffineMatrix;
13
+ /** Compose matrices so the left matrix is applied after the right matrix. */
14
+ export declare function multiplyAffineMatrix(left: AffineMatrix, right: AffineMatrix): AffineMatrix;
15
+ export declare function translateAffineMatrix(x: number, y: number): AffineMatrix;
16
+ export declare function scaleAffineMatrix(x: number, y: number): AffineMatrix;
17
+ export declare function rotateAffineMatrix(degrees: number): AffineMatrix;
18
+ export declare function aroundAffineMatrix(transform: AffineMatrix, x: number, y: number): AffineMatrix;
19
+ export declare function invertAffineMatrix(matrix: AffineMatrix): AffineMatrix | undefined;
20
+ export declare function transformAffinePoint(matrix: AffineMatrix, point: [number, number]): [number, number];
21
+ /** Calculate the screen-space bounds of a Group-local box. */
22
+ export declare function getTransformedLocalBoxRect(localOrigin: [number, number], size: [number, number], matrix: unknown, worldPosition: readonly [number, number], worldScaling: readonly [number, number], extraSize?: number): AffineRect;
23
+ export declare function affineMatrixToTransform(matrix?: unknown): string | undefined;
24
+ /**
25
+ * Convert a scene-space matrix to the local matrix of a Group positioned at
26
+ * `center`. SpriteJS applies `transform` before the Group position, so a
27
+ * scene-space gesture must be conjugated by that position to preserve its
28
+ * world-space anchor.
29
+ */
30
+ export declare function sceneMatrixToLocalMatrix(matrix: unknown, center?: [number, number]): AffineMatrix;
31
+ /** Convert a Group-local matrix into the equivalent scene-space matrix. */
32
+ export declare function localMatrixToSceneMatrix(matrix: unknown, center?: [number, number]): AffineMatrix;
33
+ export declare function transformAffinePoints(points: number[], matrix: AffineMatrix, stride?: number): number[];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Keep multi-word font families intact for mesh.js' font parser.
3
+ *
4
+ * mesh.js parses an unquoted family name only up to its first space. The
5
+ * browser accepts the same family name without quotes, so quote each family
6
+ * item before it is used to build a Canvas font string.
7
+ */
8
+ export declare function normalizeCanvasFontFamily(fontFamily?: string): string | undefined;
@@ -4,6 +4,8 @@ import { Box2d } from "./primitives/Box2d";
4
4
  import { Vec2d, VecLike } from "./primitives/Vec2d";
5
5
  export * from "./math";
6
6
  export * from "./spriteNode";
7
+ export * from "./affineMatrix";
8
+ export * from "./selectorMatrix";
7
9
  /** @public */
8
10
  export declare function precise(A: VecLike): string;
9
11
  /** @public */
@@ -0,0 +1,4 @@
1
+ import type { IUpdateNodeOpt } from "../types";
2
+ import type { AffineMatrix } from "./affineMatrix";
3
+ /** Build one scene-space gesture delta shared by every selected object. */
4
+ export declare function getSelectorMatrixDelta(opt: IUpdateNodeOpt, objectCenter?: [number, number], selectorCenter?: [number, number]): AffineMatrix | undefined;
@@ -0,0 +1,8 @@
1
+ import { EToolsKey } from "../enum";
2
+ import type { BaseNodeMapItem } from "../types";
3
+ import type { TextOptions } from "../../component/textEditor/types";
4
+ export declare function shouldRefreshTextSelectorFrame(toolsType: EToolsKey, nodeName: string, textInfos?: {
5
+ has: (key: string) => boolean;
6
+ }): boolean;
7
+ /** Keep text position canonical; selector movement is represented by matrix. */
8
+ export declare function mergeTextSelectorGeometry(targetNode: BaseNodeMapItem, textInfo?: Partial<TextOptions>): BaseNodeMapItem;
@@ -0,0 +1,2 @@
1
+ export declare const TEXT_IMAGE_MAX_TEXTURE_SIZE = 2048;
2
+ export declare function getTextSnippetLength(fontSize: number): number;
@@ -47,7 +47,7 @@ export declare class VNodeManager {
47
47
  rectRange: IRectType | undefined;
48
48
  nodeRange: Map<string, BaseNodeMapItem>;
49
49
  };
50
- getNodeRectFormShape(name: string, value: BaseNodeMapItem): IRectType | undefined;
50
+ getNodeRectFormShape(name: string, value: BaseNodeMapItem | undefined, matrixOverride?: unknown): import("./utils").AffineRect | undefined;
51
51
  updateNodeRect(key: string): void;
52
52
  updateHighLevelNodesRect(highLevelIds: Set<string>): void;
53
53
  updateLowLevelNodesRect(): void;
@@ -185,7 +185,7 @@ export declare abstract class LocalWork {
185
185
  setWorkOptions(workId: string, opt: BaseShapeOptions): void;
186
186
  createWorkShapeNode(opt: IActiveToolsDataType & {
187
187
  workId: string;
188
- }): import("../tools/text").TextShape | import("../tools").ArrowShape | import("../tools").PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools").BitMapEraserShape | import("../tools/pencilEraser").PencilEraserShape | import("../tools").SelectorShape | import("../tools").ImageShape | import("../tools/shadowSvg").ISvgShadowShape | undefined;
188
+ }): import("../tools/text").TextShape | import("../tools").ArrowShape | import("../tools").PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools").LaserPenShape | import("../tools").EraserShape | import("../tools/pencilEraser").PencilEraserShape | import("../tools").BitMapEraserShape | import("../tools").SelectorShape | import("../tools").ImageShape | import("../tools/shadowSvg").ISvgShadowShape | undefined;
189
189
  setToolsOpt(opt: IActiveToolsDataType): void;
190
190
  getToolsOpt(): IActiveToolsDataType | undefined;
191
191
  clearWorkShapeNodeCache(workId: string): void;
@@ -46,6 +46,7 @@ export declare class LocalWorkForFullWorker extends LocalWork {
46
46
  opt: BaseShapeOptions;
47
47
  toolsType: EToolsKey;
48
48
  ops?: string;
49
+ previewMatrix?: BaseNodeMapItem["previewMatrix"];
49
50
  }>;
50
51
  smoothSync?: boolean;
51
52
  needUndoTicker?: number;
@@ -3,7 +3,7 @@ import { ISubWorkerInitOption } from "./base";
3
3
  import { VNodeManager } from "../vNodeManager";
4
4
  import { IBatchMainMessage, IRectType, IServiceWorkItem, IWorkerMessage } from "../types";
5
5
  import { EToolsKey } from "../enum";
6
- import { BaseShapeOptions } from "../tools";
6
+ import { BaseShapeOptions, BaseShapeTool } from "../tools";
7
7
  import { WorkThreadEngineForFullWorker } from "./workerManager";
8
8
  export interface ServiceWork {
9
9
  readonly viewId: string;
@@ -53,6 +53,7 @@ export declare class ServiceWorkForFullWorker implements ServiceWork {
53
53
  private activeWorkShape;
54
54
  private hasDiffData;
55
55
  protected animationDraw(): Promise<void>;
56
+ protected syncMatrixRect(key: string, node: BaseShapeTool | undefined, rect?: IRectType): IRectType | undefined;
56
57
  protected runAnimation(immediate?: boolean): void;
57
58
  protected computNextAnimationIndex(workShape: IServiceWorkItem, pointUnit: number): number;
58
59
  protected runEffect(): void;
@@ -12,7 +12,7 @@ export declare class LocalWorkForSimpleWorker extends LocalWorkForFullWorker {
12
12
  constructor(opt: ISubWorkerInitOption);
13
13
  createWorkShapeNode(opt: IActiveToolsDataType & {
14
14
  workId: string;
15
- }): TextShape | ArrowShape | import("../tools").PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools").LaserPenShape | import("../tools").EraserShape | BitMapEraserShape | PencilEraserShape | SelectorShape | ImageShape | ISvgShadowShape | undefined;
15
+ }): TextShape | ArrowShape | import("../tools").PencilShape | import("../tools/straight").StraightShape | import("../tools").EllipseShape | import("../tools").PolygonShape | import("../tools").StarShape | import("../tools").RectangleShape | import("../tools").SpeechBalloonShape | import("../tools").LaserPenShape | import("../tools").EraserShape | PencilEraserShape | BitMapEraserShape | SelectorShape | ImageShape | ISvgShadowShape | undefined;
16
16
  protected drawPencil(res: IMainMessage, workId?: string): Promise<void>;
17
17
  protected drawShape(res: IMainMessage): Promise<void>;
18
18
  protected drawSelector(res: IMainMessage, workState: EventWorkState, isLockSentEventCursor?: boolean, render?: IMainMessageRenderData[]): Promise<void>;