microboard-temp 0.13.92 → 0.13.94

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 (69) hide show
  1. package/dist/cjs/browser.js +55356 -55286
  2. package/dist/cjs/index.js +55356 -55286
  3. package/dist/cjs/node.js +57671 -57601
  4. package/dist/esm/browser.js +55115 -55046
  5. package/dist/esm/index.js +55115 -55046
  6. package/dist/esm/node.js +57596 -57527
  7. package/dist/types/HTMLRender/HTMLRender.d.ts +5 -0
  8. package/dist/types/Items/AINode/AINode.d.ts +0 -6
  9. package/dist/types/Items/Audio/Audio.d.ts +0 -8
  10. package/dist/types/Items/Audio/audioOps.d.ts +5 -0
  11. package/dist/types/Items/BaseItem/BaseItem.d.ts +1 -3
  12. package/dist/types/Items/Comment/Comment.d.ts +1 -6
  13. package/dist/types/Items/Connector/Connector.d.ts +4 -22
  14. package/dist/types/Items/Connector/connectorOps.d.ts +20 -0
  15. package/dist/types/Items/Drawing/Drawing.d.ts +1 -11
  16. package/dist/types/Items/Drawing/DrawingOperation.d.ts +3 -3
  17. package/dist/types/Items/Drawing/drawingOps.d.ts +14 -0
  18. package/dist/types/Items/Drawing/index.d.ts +2 -0
  19. package/dist/types/Items/Examples/CardGame/Card/Card.d.ts +1 -4
  20. package/dist/types/Items/Examples/CardGame/Card/CardOperation.d.ts +2 -1
  21. package/dist/types/Items/Examples/CardGame/Deck/Deck.d.ts +1 -4
  22. package/dist/types/Items/Examples/CardGame/Deck/DeckOperation.d.ts +2 -1
  23. package/dist/types/Items/Examples/CardGame/Dice/Dice.d.ts +2 -3
  24. package/dist/types/Items/Examples/CardGame/Screen/Screen.d.ts +1 -4
  25. package/dist/types/Items/Examples/Counter/Counter.d.ts +0 -2
  26. package/dist/types/Items/Examples/Counter/CounterOperation.d.ts +2 -1
  27. package/dist/types/Items/Examples/Star/Star.d.ts +1 -4
  28. package/dist/types/Items/Frame/Frame.d.ts +1 -19
  29. package/dist/types/Items/Group/Group.d.ts +0 -6
  30. package/dist/types/Items/Image/Image.d.ts +1 -9
  31. package/dist/types/Items/Image/imageOps.d.ts +5 -0
  32. package/dist/types/Items/LinkTo/LinkTo.d.ts +0 -2
  33. package/dist/types/Items/Path/Path.d.ts +0 -2
  34. package/dist/types/Items/Path/Paths.d.ts +0 -2
  35. package/dist/types/Items/Placeholder/Placeholder.d.ts +0 -4
  36. package/dist/types/Items/Renderers/AINodeHTMLRenderer.d.ts +6 -0
  37. package/dist/types/Items/Renderers/AudioHTMLRenderer.d.ts +6 -0
  38. package/dist/types/Items/Renderers/CommentHTMLRenderer.d.ts +6 -0
  39. package/dist/types/Items/Renderers/ConnectorHTMLRenderer.d.ts +6 -0
  40. package/dist/types/Items/Renderers/DrawingHTMLRenderer.d.ts +7 -0
  41. package/dist/types/Items/Renderers/FrameHTMLRenderer.d.ts +6 -0
  42. package/dist/types/Items/Renderers/GroupHTMLRenderer.d.ts +6 -0
  43. package/dist/types/Items/Renderers/HTMLItemRenderer.d.ts +7 -0
  44. package/dist/types/Items/Renderers/ImageHTMLRenderer.d.ts +6 -0
  45. package/dist/types/Items/Renderers/PlaceholderHTMLRenderer.d.ts +6 -0
  46. package/dist/types/Items/Renderers/RichTextHTMLRenderer.d.ts +6 -0
  47. package/dist/types/Items/Renderers/ShapeHTMLRenderer.d.ts +6 -0
  48. package/dist/types/Items/Renderers/StickerHTMLRenderer.d.ts +6 -0
  49. package/dist/types/Items/Renderers/VideoHTMLRenderer.d.ts +7 -0
  50. package/dist/types/Items/Renderers/index.d.ts +13 -0
  51. package/dist/types/Items/RichText/RichText.d.ts +0 -2
  52. package/dist/types/Items/Shape/Shape.d.ts +1 -14
  53. package/dist/types/Items/Shape/Shapes.d.ts +330 -0
  54. package/dist/types/Items/Shape/index.d.ts +1 -0
  55. package/dist/types/Items/Shape/shapeOps.d.ts +19 -0
  56. package/dist/types/Items/Sticker/Sticker.d.ts +3 -7
  57. package/dist/types/Items/Sticker/index.d.ts +1 -0
  58. package/dist/types/Items/Sticker/stickerOps.d.ts +9 -0
  59. package/dist/types/Items/Transformation/Transformation.d.ts +37 -59
  60. package/dist/types/Items/Transformation/TransformationCommand.d.ts +2 -1
  61. package/dist/types/Items/Transformation/TransformationOperations.d.ts +3 -12
  62. package/dist/types/Items/Transformation/transformOps.d.ts +35 -0
  63. package/dist/types/Items/Video/Video.d.ts +3 -17
  64. package/dist/types/Items/Video/videoOps.d.ts +9 -0
  65. package/dist/types/Items/index.d.ts +4 -0
  66. package/dist/types/Selection/Selection.d.ts +11 -4
  67. package/dist/types/Selection/Transformer/TransformerHelpers/transformAINode.d.ts +1 -1
  68. package/dist/types/Selection/Transformer/TransformerHelpers/transformRichText.d.ts +1 -1
  69. package/package.json +1 -1
@@ -0,0 +1,330 @@
1
+ export declare const Shapes: {
2
+ BPMN_Gateway: {
3
+ name: string;
4
+ textBounds: import("..").Mbr;
5
+ path: import("..").Path;
6
+ anchorPoints: import("..").Point[];
7
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
8
+ useMbrUnderPointer: boolean;
9
+ };
10
+ BPMN_DataStore: {
11
+ name: string;
12
+ textBounds: import("..").Mbr;
13
+ path: import("..").Paths;
14
+ anchorPoints: import("..").Point[];
15
+ createPath: (mbr: import("..").Mbr) => import("..").Paths;
16
+ useMbrUnderPointer: boolean;
17
+ };
18
+ BPMN_GatewayParallel: {
19
+ name: string;
20
+ textBounds: import("..").Mbr;
21
+ path: import("..").Paths;
22
+ anchorPoints: import("..").Point[];
23
+ createPath: (mbr: import("..").Mbr) => import("..").Paths;
24
+ useMbrUnderPointer: boolean;
25
+ };
26
+ BPMN_GatewayXOR: {
27
+ name: string;
28
+ textBounds: import("..").Mbr;
29
+ path: import("..").Paths;
30
+ anchorPoints: import("..").Point[];
31
+ createPath: (mbr: import("..").Mbr) => import("..").Paths;
32
+ useMbrUnderPointer: boolean;
33
+ };
34
+ BPMN_EndEvent: {
35
+ name: string;
36
+ textBounds: import("..").Mbr;
37
+ path: import("..").Path;
38
+ anchorPoints: import("..").Point[];
39
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
40
+ useMbrUnderPointer: boolean;
41
+ };
42
+ BPMN_StartEvent: {
43
+ name: string;
44
+ textBounds: import("..").Mbr;
45
+ path: import("..").Path;
46
+ anchorPoints: import("..").Point[];
47
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
48
+ useMbrUnderPointer: boolean;
49
+ };
50
+ BPMN_StartEventNoneInterrupting: {
51
+ name: string;
52
+ textBounds: import("..").Mbr;
53
+ path: import("..").Path;
54
+ anchorPoints: import("..").Point[];
55
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
56
+ useMbrUnderPointer: boolean;
57
+ };
58
+ BPMN_IntermediateEvent: {
59
+ name: string;
60
+ textBounds: import("..").Mbr;
61
+ path: import("..").Paths;
62
+ anchorPoints: import("..").Point[];
63
+ createPath: (mbr: import("..").Mbr) => import("..").Paths;
64
+ useMbrUnderPointer: boolean;
65
+ };
66
+ BPMN_IntermediateEventNoneInterrupting: {
67
+ name: string;
68
+ textBounds: import("..").Mbr;
69
+ path: import("..").Paths;
70
+ anchorPoints: import("..").Point[];
71
+ createPath: (mbr: import("..").Mbr) => import("..").Paths;
72
+ useMbrUnderPointer: boolean;
73
+ };
74
+ BPMN_Group: {
75
+ name: string;
76
+ textBounds: import("..").Mbr;
77
+ path: import("..").Path;
78
+ anchorPoints: import("..").Point[];
79
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
80
+ useMbrUnderPointer: boolean;
81
+ };
82
+ BPMN_Participant: {
83
+ name: string;
84
+ textBounds: import("..").Mbr;
85
+ path: import("..").Paths;
86
+ anchorPoints: import("..").Point[];
87
+ createPath: (mbr: import("..").Mbr) => import("..").Paths;
88
+ useMbrUnderPointer: boolean;
89
+ };
90
+ BPMN_Task: {
91
+ name: string;
92
+ textBounds: import("..").Mbr;
93
+ path: import("..").Path;
94
+ anchorPoints: import("..").Point[];
95
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
96
+ useMbrUnderPointer: boolean;
97
+ };
98
+ BPMN_Transaction: {
99
+ name: string;
100
+ textBounds: import("..").Mbr;
101
+ path: import("..").Paths;
102
+ anchorPoints: import("..").Point[];
103
+ createPath: (mbr: import("..").Mbr) => import("..").Paths;
104
+ useMbrUnderPointer: boolean;
105
+ };
106
+ BPMN_EventSubprocess: {
107
+ name: string;
108
+ textBounds: import("..").Mbr;
109
+ path: import("..").Paths;
110
+ anchorPoints: import("..").Point[];
111
+ createPath: (mbr: import("..").Mbr) => import("..").Paths;
112
+ useMbrUnderPointer: boolean;
113
+ };
114
+ BPMN_Annotation: {
115
+ name: string;
116
+ textBounds: import("..").Mbr;
117
+ path: import("..").Paths;
118
+ anchorPoints: never[];
119
+ createPath: (mbr: import("..").Mbr) => import("..").Paths;
120
+ useMbrUnderPointer: boolean;
121
+ };
122
+ BPMN_DataObject: {
123
+ name: string;
124
+ textBounds: import("..").Mbr;
125
+ path: import("..").Paths;
126
+ anchorPoints: import("..").Point[];
127
+ createPath: (mbr: import("..").Mbr) => import("..").Paths;
128
+ useMbrUnderPointer: boolean;
129
+ };
130
+ Rectangle: {
131
+ name: string;
132
+ textBounds: import("..").Mbr;
133
+ path: import("..").Path;
134
+ anchorPoints: import("..").Point[];
135
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
136
+ useMbrUnderPointer: boolean;
137
+ };
138
+ Triangle: {
139
+ name: string;
140
+ textBounds: import("..").Mbr;
141
+ path: import("..").Path;
142
+ anchorPoints: import("..").Point[];
143
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
144
+ useMbrUnderPointer: boolean;
145
+ };
146
+ ReversedTriangle: {
147
+ name: string;
148
+ textBounds: import("..").Mbr;
149
+ path: import("..").Path;
150
+ anchorPoints: import("..").Point[];
151
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
152
+ useMbrUnderPointer: boolean;
153
+ };
154
+ Circle: {
155
+ name: string;
156
+ textBounds: import("..").Mbr;
157
+ path: import("..").Path;
158
+ anchorPoints: import("..").Point[];
159
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
160
+ useMbrUnderPointer: boolean;
161
+ };
162
+ ArrowLeft: {
163
+ name: string;
164
+ textBounds: import("..").Mbr;
165
+ path: import("..").Path;
166
+ anchorPoints: import("..").Point[];
167
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
168
+ useMbrUnderPointer: boolean;
169
+ };
170
+ ArrowLeftRight: {
171
+ name: string;
172
+ textBounds: import("..").Mbr;
173
+ path: import("..").Path;
174
+ anchorPoints: import("..").Point[];
175
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
176
+ useMbrUnderPointer: boolean;
177
+ };
178
+ ArrowRight: {
179
+ name: string;
180
+ textBounds: import("..").Mbr;
181
+ path: import("..").Path;
182
+ anchorPoints: import("..").Point[];
183
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
184
+ useMbrUnderPointer: boolean;
185
+ };
186
+ ArrowBlockLeft: {
187
+ name: string;
188
+ textBounds: import("..").Mbr;
189
+ path: import("..").Path;
190
+ anchorPoints: import("..").Point[];
191
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
192
+ useMbrUnderPointer: boolean;
193
+ };
194
+ ArrowBlockRight: {
195
+ name: string;
196
+ textBounds: import("..").Mbr;
197
+ path: import("..").Path;
198
+ anchorPoints: import("..").Point[];
199
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
200
+ useMbrUnderPointer: boolean;
201
+ };
202
+ BracesLeft: {
203
+ name: string;
204
+ textBounds: import("..").Mbr;
205
+ path: import("..").Path;
206
+ anchorPoints: never[];
207
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
208
+ useMbrUnderPointer: boolean;
209
+ };
210
+ BracesRight: {
211
+ name: string;
212
+ textBounds: import("..").Mbr;
213
+ path: import("..").Path;
214
+ anchorPoints: never[];
215
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
216
+ useMbrUnderPointer: boolean;
217
+ };
218
+ Cloud: {
219
+ name: string;
220
+ textBounds: import("..").Mbr;
221
+ path: import("..").Path;
222
+ anchorPoints: import("..").Point[];
223
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
224
+ useMbrUnderPointer: boolean;
225
+ };
226
+ Cross: {
227
+ name: string;
228
+ textBounds: import("..").Mbr;
229
+ path: import("..").Path;
230
+ anchorPoints: import("..").Point[];
231
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
232
+ useMbrUnderPointer: boolean;
233
+ };
234
+ Cylinder: {
235
+ name: string;
236
+ textBounds: import("..").Mbr;
237
+ path: import("..").Paths;
238
+ anchorPoints: import("..").Point[];
239
+ createPath: (mbr: import("..").Mbr) => import("..").Paths;
240
+ useMbrUnderPointer: boolean;
241
+ };
242
+ Hexagon: {
243
+ name: string;
244
+ textBounds: import("..").Mbr;
245
+ path: import("..").Path;
246
+ anchorPoints: import("..").Point[];
247
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
248
+ useMbrUnderPointer: boolean;
249
+ };
250
+ Octagon: {
251
+ name: string;
252
+ textBounds: import("..").Mbr;
253
+ path: import("..").Path;
254
+ anchorPoints: import("..").Point[];
255
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
256
+ useMbrUnderPointer: boolean;
257
+ };
258
+ Parallelogram: {
259
+ name: string;
260
+ textBounds: import("..").Mbr;
261
+ path: import("..").Path;
262
+ anchorPoints: import("..").Point[];
263
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
264
+ useMbrUnderPointer: boolean;
265
+ };
266
+ ReversedParallelogram: {
267
+ name: string;
268
+ textBounds: import("..").Mbr;
269
+ path: import("..").Path;
270
+ anchorPoints: import("..").Point[];
271
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
272
+ useMbrUnderPointer: boolean;
273
+ };
274
+ Pentagon: {
275
+ name: string;
276
+ textBounds: import("..").Mbr;
277
+ path: import("..").Path;
278
+ anchorPoints: import("..").Point[];
279
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
280
+ useMbrUnderPointer: boolean;
281
+ };
282
+ PredefinedProcess: {
283
+ name: string;
284
+ textBounds: import("..").Mbr;
285
+ path: import("..").Paths;
286
+ anchorPoints: import("..").Point[];
287
+ createPath: (mbr: import("..").Mbr) => import("..").Paths;
288
+ useMbrUnderPointer: boolean;
289
+ };
290
+ Rhombus: {
291
+ name: string;
292
+ textBounds: import("..").Mbr;
293
+ path: import("..").Path;
294
+ anchorPoints: import("..").Point[];
295
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
296
+ useMbrUnderPointer: boolean;
297
+ };
298
+ RoundedRectangle: {
299
+ name: string;
300
+ textBounds: import("..").Mbr;
301
+ path: import("..").Path;
302
+ anchorPoints: import("..").Point[];
303
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
304
+ useMbrUnderPointer: boolean;
305
+ };
306
+ SpeachBubble: {
307
+ name: string;
308
+ textBounds: import("..").Mbr;
309
+ path: import("..").Path;
310
+ anchorPoints: import("..").Point[];
311
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
312
+ useMbrUnderPointer: boolean;
313
+ };
314
+ Star: {
315
+ name: string;
316
+ textBounds: import("..").Mbr;
317
+ path: import("..").Path;
318
+ anchorPoints: import("..").Point[];
319
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
320
+ useMbrUnderPointer: boolean;
321
+ };
322
+ Trapezoid: {
323
+ name: string;
324
+ textBounds: import("..").Mbr;
325
+ path: import("..").Path;
326
+ anchorPoints: import("..").Point[];
327
+ createPath: (mbr: import("..").Mbr) => import("..").Path;
328
+ useMbrUnderPointer: boolean;
329
+ };
330
+ };
@@ -2,5 +2,6 @@ export { Shape, Shapes } from "./Shape";
2
2
  export { ShapeCommand } from "./ShapeCommand";
3
3
  export type { ShapeOperation } from "./ShapeOperation";
4
4
  export * from "./ShapeData";
5
+ export { shapeOps } from "./shapeOps";
5
6
  export type { ShapeType } from "./ShapeType";
6
7
  export { DefaultShapeData } from "./ShapeData";
@@ -0,0 +1,19 @@
1
+ import { ColorValue } from "../../Color";
2
+ import { BorderStyle } from "../Path";
3
+ import { ShapeOperation } from "./ShapeOperation";
4
+ import { ShapeType } from "./ShapeType";
5
+ type ItemLike = {
6
+ getId(): string;
7
+ getBorderWidth?(): number;
8
+ };
9
+ type ItemOrId = ItemLike | string;
10
+ export declare const shapeOps: {
11
+ setBackgroundColor(items: readonly ItemOrId[], backgroundColor: ColorValue): ShapeOperation;
12
+ setBackgroundOpacity(items: readonly ItemOrId[], backgroundOpacity: number): ShapeOperation;
13
+ setBorderColor(items: readonly ItemOrId[], borderColor: ColorValue): ShapeOperation;
14
+ setBorderOpacity(items: readonly ItemOrId[], borderOpacity: number): ShapeOperation;
15
+ setBorderStyle(items: readonly ItemOrId[], borderStyle: BorderStyle): ShapeOperation;
16
+ setBorderWidth(items: readonly ItemLike[], borderWidth: number): ShapeOperation;
17
+ setShapeType(items: readonly ItemOrId[], shapeType: ShapeType): ShapeOperation;
18
+ };
19
+ export {};
@@ -6,15 +6,12 @@ import { Mbr } from "../Mbr/Mbr";
6
6
  import { Path } from "../Path/Path";
7
7
  import { Paths } from "../Path/Paths";
8
8
  import { Point } from "../Point/Point";
9
- import { Transformation } from "../Transformation/Transformation";
10
9
  import { ResizeType } from "../../Selection/Transformer/TransformerHelpers/getResizeType";
11
10
  import { DrawingContext } from "../DrawingContext";
12
11
  import { GeometricNormal } from "../GeometricNormal";
13
12
  import { RichText } from "../RichText/RichText";
14
13
  import { StickerData, StickerOperation } from "./StickerOperation";
15
- import { LinkTo } from "../LinkTo/LinkTo";
16
14
  import { Board } from "../../Board";
17
- import { DocumentFactory } from "../../api/DocumentFactory";
18
15
  import { BaseItem } from "../BaseItem/BaseItem";
19
16
  import type { SerializedItemData } from "../BaseItem/BaseItem";
20
17
  import { ColorValue } from "../../..";
@@ -31,8 +28,6 @@ export declare class Sticker extends BaseItem<Sticker> {
31
28
  backgroundColor: ColorValue;
32
29
  parent: string;
33
30
  readonly itemType = "Sticker";
34
- readonly transformation: Transformation;
35
- readonly linkTo: LinkTo;
36
31
  private stickerPath;
37
32
  private textContainer;
38
33
  text: RichText;
@@ -48,10 +43,10 @@ export declare class Sticker extends BaseItem<Sticker> {
48
43
  protected onParentChanged(newParent: string): void;
49
44
  getId(): string;
50
45
  apply(op: Operation): void;
46
+ private applyStickerOperation;
51
47
  getBackgroundColor(): ColorValue;
52
48
  getWidth(): number;
53
49
  private applyBackgroundColor;
54
- setBackgroundColor(backgroundColor: ColorValue): void;
55
50
  getIntersectionPoints(segment: Line): Point[];
56
51
  getMbr(): Mbr;
57
52
  getNearestEdgePointTo(point: Point): Point;
@@ -63,13 +58,14 @@ export declare class Sticker extends BaseItem<Sticker> {
63
58
  isInView(rect: Mbr): boolean;
64
59
  getNormal(point: Point): GeometricNormal;
65
60
  render(context: DrawingContext): void;
66
- renderHTML(documentFactory: DocumentFactory): HTMLElement;
67
61
  renderShadow(context: DrawingContext): void;
68
62
  getPaths(): Path | Paths;
69
63
  isClosed(): boolean;
70
64
  getPath(): Path | Paths;
71
65
  getSnapAnchorPoints(): Point[];
66
+ /** Entry point for AddSticker tool during item creation */
72
67
  applyDiagonal(line: Line): void;
68
+ /** Entry point for AddSticker tool during item creation */
73
69
  applyTransformToCenter(pt: Point, newWidth?: number): void;
74
70
  doResize(resizeType: ResizeType, pointer: Point, mbr: Mbr, opposite: Point, startMbr: Mbr, timeStamp: number): {
75
71
  matrix: Matrix;
@@ -1,2 +1,3 @@
1
1
  export * from "./Sticker";
2
2
  export * from "./StickerOperation";
3
+ export * from "./stickerOps";
@@ -0,0 +1,9 @@
1
+ import { ColorValue } from "../../..";
2
+ import { Operation } from "../../Events";
3
+ interface ItemLike {
4
+ getId(): string;
5
+ }
6
+ export declare const stickerOps: {
7
+ setBackgroundColor(items: ItemLike[], backgroundColor: ColorValue): Operation;
8
+ };
9
+ export {};
@@ -1,13 +1,21 @@
1
- import { SubjectOperation } from '../../SubjectOperation';
2
- import { Events, Operation } from '../../Events';
3
- import { Point } from '../Point';
1
+ import type { Events } from '../../Events';
4
2
  import { Matrix } from './Matrix';
5
3
  import { TransformationData } from './TransformationData';
6
4
  import { MatrixData, TransformationOperation } from './TransformationOperations';
5
+ type LocalTransformationOperation = {
6
+ class: 'Transformation';
7
+ method: 'setLocalMatrix';
8
+ item: string[];
9
+ matrix: MatrixData;
10
+ } | {
11
+ class: 'Transformation';
12
+ method: 'setLocal';
13
+ item: string[];
14
+ data: Partial<MatrixData>;
15
+ };
7
16
  export declare class Transformation {
8
17
  private id;
9
18
  private events?;
10
- readonly subject: SubjectOperation<Transformation, TransformationOperation>;
11
19
  private _matrix;
12
20
  previous: Matrix;
13
21
  private rotate;
@@ -26,13 +34,8 @@ export declare class Transformation {
26
34
  y: number;
27
35
  };
28
36
  getRotation(): number;
29
- /**
30
- * Replaces the internal matrix entirely with `matrix` without emitting an operation.
31
- * Used by the nesting system to convert between world and local coordinate spaces.
32
- */
33
- setLocalMatrix(matrix: Matrix): void;
34
- setLocal(x: number, y: number, scaleX?: number, scaleY?: number): void;
35
- setLocal(data: Partial<MatrixData>): void;
37
+ private applyLocalMatrix;
38
+ private applyLocal;
36
39
  serialize(): TransformationData;
37
40
  deserialize(data: TransformationData & {
38
41
  dimension?: {
@@ -44,53 +47,28 @@ export declare class Transformation {
44
47
  getInverse(): Transformation;
45
48
  getId(): string;
46
49
  setId(id: string): void;
47
- emit(operation: TransformationOperation): void;
50
+ private emit;
48
51
  private emitMatrix;
49
- translateTo(x: number, y: number, timeStamp?: number): void;
50
- translateBy(x: number, y: number, timeStamp?: number): void;
51
- scaleTo(x: number, y: number, timeStamp?: number): void;
52
- scaleBy(x: number, y: number, timeStamp?: number): void;
53
- scaleByTranslateBy(scale: {
54
- x: number;
55
- y: number;
56
- }, translate: {
57
- x: number;
58
- y: number;
59
- }, timeStamp?: number): void;
60
- rotateTo(degree: number, timeStamp?: number): void;
61
- rotateBy(degree: number, timeStamp?: number): void;
62
- scaleToRelativeTo(x: number, y: number, _point: Point, timeStamp?: number): void;
63
- scaleByRelativeTo(x: number, y: number, point: Point, timeStamp?: number): void;
64
- applyMatrixSilent(matrixData: MatrixData): void;
65
- setIsLocked(isLocked: boolean, timestamp?: number): void;
66
- apply(op: Operation): void;
67
- /** @deprecated Only for replaying legacy events. Do not call directly. */
68
- applyTranslateTo(x: number, y: number): void;
69
- /** @deprecated Only for replaying legacy events. Do not call directly. */
70
- applyTranslateBy(x: number, y: number): void;
71
- /** @deprecated Only for replaying legacy events. Do not call directly. */
72
- applyScaleTo(x: number, y: number): void;
73
- /** @deprecated Only for replaying legacy events. Do not call directly. */
74
- applyScaleBy(x: number, y: number): void;
75
- /** @deprecated Only for replaying legacy events. Do not call directly. */
76
- applyScaleByTranslateBy(scale: {
77
- x: number;
78
- y: number;
79
- }, translate: {
80
- x: number;
81
- y: number;
82
- }): void;
83
- applyTransformMany(op: TransformationOperation): void;
84
- applyScaleByRelativeTo(x: number, y: number, point: {
85
- x: number;
86
- y: number;
87
- }): void;
88
- applyScaleToRelativeTo(x: number, y: number, point: {
89
- x: number;
90
- y: number;
91
- }): void;
92
- applyRotateTo(degree: number): void;
93
- applyRotateBy(degree: number): void;
94
- applyLocked(locked: boolean): void;
95
- applyUnlocked(locked: boolean): void;
52
+ private translateTo;
53
+ private translateBy;
54
+ private scaleTo;
55
+ private scaleBy;
56
+ private scaleByTranslateBy;
57
+ private rotateTo;
58
+ private rotateBy;
59
+ private scaleToRelativeTo;
60
+ private scaleByRelativeTo;
61
+ private applyMatrix;
62
+ private applyIsLocked;
63
+ apply(op: TransformationOperation | LocalTransformationOperation): void;
64
+ private applyTransformMany;
65
+ private applyTranslateTo;
66
+ private applyTranslateBy;
67
+ private applyScaleTo;
68
+ private applyScaleBy;
69
+ private applyScaleByRelativeTo;
70
+ private applyScaleToRelativeTo;
71
+ private applyRotateTo;
72
+ private applyRotateBy;
96
73
  }
74
+ export {};
@@ -1,6 +1,7 @@
1
1
  import { Transformation } from "./Transformation";
2
2
  import { TransformationOperation } from "./TransformationOperations";
3
- import { Command, Operation } from "../../Events";
3
+ import type { Command } from "../../Events/Command";
4
+ import type { Operation } from "../../Events/EventsOperations";
4
5
  /** Minimal interface to avoid circular import with BaseItem/Item */
5
6
  interface TransformableItem {
6
7
  apply(op: Operation): void;
@@ -3,6 +3,7 @@ interface TransformationBase {
3
3
  class: "Transformation";
4
4
  item: string[];
5
5
  timestamp?: number;
6
+ silent?: boolean;
6
7
  }
7
8
  /** @deprecated Use ApplyMatrixOperation instead. Kept for reading legacy events. */
8
9
  export interface TranslateOperation extends TransformationBase {
@@ -24,17 +25,6 @@ interface RotateOperation extends TransformationBase {
24
25
  timeStamp?: number;
25
26
  }
26
27
  /** @deprecated Use ApplyMatrixOperation instead. Kept for reading legacy events. */
27
- interface ScaleRelativeToOperation extends TransformationBase {
28
- method: "scaleToRelativeTo" | "scaleByRelativeTo";
29
- x: number;
30
- y: number;
31
- point: {
32
- x: number;
33
- y: number;
34
- };
35
- timeStamp?: number;
36
- }
37
- /** @deprecated Use ApplyMatrixOperation instead. Kept for reading legacy events. */
38
28
  export interface ScaleByTranslateByOperation extends TransformationBase {
39
29
  method: "scaleByTranslateBy";
40
30
  translate: {
@@ -79,6 +69,7 @@ export interface ApplyMatrixOperation {
79
69
  method: "applyMatrix";
80
70
  items: ApplyMatrixItem[];
81
71
  timeStamp?: number;
72
+ silent?: boolean;
82
73
  }
83
74
  export interface TransformManyItems {
84
75
  [key: string]: ApplyMatrixOperation | ScaleByTranslateByOperation | ScaleOperation | TranslateOperation;
@@ -89,5 +80,5 @@ export interface TransformMany {
89
80
  items: TransformManyItems;
90
81
  timeStamp?: number;
91
82
  }
92
- export type TransformationOperation = ApplyMatrixOperation | TranslateOperation | ScaleOperation | RotateOperation | ScaleRelativeToOperation | ScaleByTranslateByOperation | DeserializeOperation | TransformMany | Locked | Unlocked;
83
+ export type TransformationOperation = ApplyMatrixOperation | RotateOperation | DeserializeOperation | TransformMany | Locked | Unlocked | TranslateOperation | ScaleOperation | ScaleByTranslateByOperation;
93
84
  export {};
@@ -0,0 +1,35 @@
1
+ import { MatrixData, TransformationOperation } from "./TransformationOperations";
2
+ interface ItemLike {
3
+ getId(): string;
4
+ transformation: {
5
+ getTranslation(): {
6
+ x: number;
7
+ y: number;
8
+ };
9
+ getScale(): {
10
+ x: number;
11
+ y: number;
12
+ };
13
+ };
14
+ }
15
+ type ItemOrId = ItemLike | string;
16
+ export declare const transformOps: {
17
+ applyMatrix(items: readonly ItemOrId[] | ItemOrId, matrix: MatrixData, timeStamp?: number, silent?: boolean): TransformationOperation;
18
+ translateBy(items: readonly ItemOrId[] | ItemOrId, x: number, y: number, timeStamp?: number): TransformationOperation;
19
+ translateTo(item: ItemLike, x: number, y: number, timeStamp?: number): TransformationOperation;
20
+ scaleBy(items: readonly ItemOrId[] | ItemOrId, x: number, y: number, timeStamp?: number): TransformationOperation;
21
+ scaleTo(item: ItemLike, x: number, y: number, timeStamp?: number): TransformationOperation;
22
+ rotateBy(items: readonly ItemOrId[] | ItemOrId, degree: number, timeStamp?: number): TransformationOperation;
23
+ rotateTo(items: readonly ItemOrId[] | ItemOrId, degree: number, timeStamp?: number): TransformationOperation;
24
+ setLocalMatrix(item: ItemOrId, matrix: MatrixData): TransformationOperation;
25
+ scaleByTranslateBy(items: readonly ItemOrId[] | ItemOrId, scale: {
26
+ x: number;
27
+ y: number;
28
+ }, translate: {
29
+ x: number;
30
+ y: number;
31
+ }, timeStamp?: number): TransformationOperation;
32
+ setLocal(item: ItemOrId, data: Partial<MatrixData>): TransformationOperation;
33
+ lock(items: readonly ItemOrId[] | ItemOrId, locked: boolean): TransformationOperation;
34
+ };
35
+ export {};