@myoc/common 0.19.519 → 0.19.520

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 (60) hide show
  1. package/dist/dev/index.js +29 -64
  2. package/dist/dev/index.js.map +3 -3
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/src/constants.d.ts +8 -5
  5. package/dist/types/common/src/utils.d.ts +0 -42
  6. package/dist/types/element/src/comparisons.d.ts +1 -0
  7. package/dist/types/element/src/image.d.ts +5 -0
  8. package/dist/types/element/src/newElement.d.ts +2 -0
  9. package/dist/types/element/src/types.d.ts +8 -0
  10. package/dist/types/excalidraw/actions/actionBoundText.d.ts +4 -2
  11. package/dist/types/excalidraw/actions/actionCanvas.d.ts +22 -11
  12. package/dist/types/excalidraw/actions/actionClipboard.d.ts +4 -2
  13. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +2 -1
  14. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +6 -3
  15. package/dist/types/excalidraw/actions/actionDeselect.d.ts +2 -1
  16. package/dist/types/excalidraw/actions/actionElementLink.d.ts +2 -1
  17. package/dist/types/excalidraw/actions/actionElementLock.d.ts +4 -2
  18. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +2 -1
  19. package/dist/types/excalidraw/actions/actionExport.d.ts +4 -2
  20. package/dist/types/excalidraw/actions/actionFrame.d.ts +10 -4
  21. package/dist/types/excalidraw/actions/actionGroup.d.ts +4 -2
  22. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +4 -1
  23. package/dist/types/excalidraw/actions/actionLink.d.ts +2 -1
  24. package/dist/types/excalidraw/actions/actionMenu.d.ts +2 -1
  25. package/dist/types/excalidraw/actions/actionProperties.d.ts +16 -5
  26. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +2 -1
  27. package/dist/types/excalidraw/actions/actionStyles.d.ts +2 -1
  28. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +2 -1
  29. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +2 -1
  30. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +2 -1
  31. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +2 -1
  32. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +2 -1
  33. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +2 -1
  34. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +2 -1
  35. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +2 -1
  36. package/dist/types/excalidraw/actions/index.d.ts +1 -1
  37. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  38. package/dist/types/excalidraw/appState.d.ts +2 -1
  39. package/dist/types/excalidraw/components/App.d.ts +12 -28
  40. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  41. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
  42. package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
  43. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
  44. package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
  45. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
  46. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +2 -1
  47. package/dist/types/excalidraw/components/icons.d.ts +2 -0
  48. package/dist/types/excalidraw/data/blob.d.ts +2 -1
  49. package/dist/types/excalidraw/data/json.d.ts +2 -1
  50. package/dist/types/excalidraw/renderer/animation.d.ts +1 -0
  51. package/dist/types/excalidraw/scene/Renderer.d.ts +2 -0
  52. package/dist/types/excalidraw/scene/index.d.ts +1 -1
  53. package/dist/types/excalidraw/scene/types.d.ts +1 -0
  54. package/dist/types/excalidraw/scroll.d.ts +46 -0
  55. package/dist/types/excalidraw/types.d.ts +16 -3
  56. package/dist/types/laser-pointer/src/index.d.ts +2 -0
  57. package/dist/types/laser-pointer/src/math.d.ts +16 -0
  58. package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
  59. package/dist/types/laser-pointer/src/state.d.ts +35 -0
  60. package/package.json +1 -1
@@ -74,9 +74,10 @@ export declare const actionPaste: {
74
74
  currentItemStrokeColor: string;
75
75
  currentItemBackgroundColor: string;
76
76
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
77
- currentItemStrokeWidth: number;
77
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
78
78
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
79
79
  currentItemRoughness: number;
80
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
80
81
  currentItemOpacity: number;
81
82
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
82
83
  currentItemFontSize: number;
@@ -291,9 +292,10 @@ export declare const actionCopyAsPng: {
291
292
  currentItemStrokeColor: string;
292
293
  currentItemBackgroundColor: string;
293
294
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
294
- currentItemStrokeWidth: number;
295
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
295
296
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
296
297
  currentItemRoughness: number;
298
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
297
299
  currentItemOpacity: number;
298
300
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
299
301
  currentItemFontSize: number;
@@ -75,9 +75,10 @@ export declare const actionToggleCropEditor: {
75
75
  currentItemStrokeColor: string;
76
76
  currentItemBackgroundColor: string;
77
77
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
78
- currentItemStrokeWidth: number;
78
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
79
79
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
80
80
  currentItemRoughness: number;
81
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
81
82
  currentItemOpacity: number;
82
83
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
83
84
  currentItemFontSize: number;
@@ -76,9 +76,10 @@ export declare const actionDeleteSelected: {
76
76
  currentItemStrokeColor: string;
77
77
  currentItemBackgroundColor: string;
78
78
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
79
- currentItemStrokeWidth: number;
79
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
80
80
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
81
81
  currentItemRoughness: number;
82
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
82
83
  currentItemOpacity: number;
83
84
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
84
85
  currentItemFontSize: number;
@@ -276,9 +277,10 @@ export declare const actionDeleteSelected: {
276
277
  currentItemStrokeColor: string;
277
278
  currentItemBackgroundColor: string;
278
279
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
279
- currentItemStrokeWidth: number;
280
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
280
281
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
281
282
  currentItemRoughness: number;
283
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
282
284
  currentItemOpacity: number;
283
285
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
284
286
  currentItemFontSize: number;
@@ -444,9 +446,10 @@ export declare const actionDeleteSelected: {
444
446
  currentItemStrokeColor: string;
445
447
  currentItemBackgroundColor: string;
446
448
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
447
- currentItemStrokeWidth: number;
449
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
448
450
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
449
451
  currentItemRoughness: number;
452
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
450
453
  currentItemOpacity: number;
451
454
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
452
455
  currentItemFontSize: number;
@@ -68,9 +68,10 @@ export declare const actionDeselect: {
68
68
  currentItemStrokeColor: string;
69
69
  currentItemBackgroundColor: string;
70
70
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
71
- currentItemStrokeWidth: number;
71
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
72
72
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
73
73
  currentItemRoughness: number;
74
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
74
75
  currentItemOpacity: number;
75
76
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
76
77
  currentItemFontSize: number;
@@ -104,9 +104,10 @@ export declare const actionLinkToElement: {
104
104
  currentItemStrokeColor: string;
105
105
  currentItemBackgroundColor: string;
106
106
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
107
- currentItemStrokeWidth: number;
107
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
108
108
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
109
109
  currentItemRoughness: number;
110
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
110
111
  currentItemOpacity: number;
111
112
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
112
113
  currentItemFontSize: number;
@@ -86,9 +86,10 @@ export declare const actionToggleElementLock: {
86
86
  currentItemStrokeColor: string;
87
87
  currentItemBackgroundColor: string;
88
88
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
89
- currentItemStrokeWidth: number;
89
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
90
90
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
91
91
  currentItemRoughness: number;
92
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
92
93
  currentItemOpacity: number;
93
94
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
94
95
  currentItemFontSize: number;
@@ -264,9 +265,10 @@ export declare const actionUnlockAllElements: {
264
265
  currentItemStrokeColor: string;
265
266
  currentItemBackgroundColor: string;
266
267
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
267
- currentItemStrokeWidth: number;
268
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
268
269
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
269
270
  currentItemRoughness: number;
271
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
270
272
  currentItemOpacity: number;
271
273
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
272
274
  currentItemFontSize: number;
@@ -72,9 +72,10 @@ export declare const actionSetEmbeddableAsActiveTool: {
72
72
  currentItemStrokeColor: string;
73
73
  currentItemBackgroundColor: string;
74
74
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
75
- currentItemStrokeWidth: number;
75
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
76
76
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
77
77
  currentItemRoughness: number;
78
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
78
79
  currentItemOpacity: number;
79
80
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
80
81
  currentItemFontSize: number;
@@ -155,9 +155,10 @@ export declare const actionLoadScene: {
155
155
  currentItemStrokeColor: string;
156
156
  currentItemBackgroundColor: string;
157
157
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
158
- currentItemStrokeWidth: number;
158
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
159
159
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
160
160
  currentItemRoughness: number;
161
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
161
162
  currentItemOpacity: number;
162
163
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
163
164
  currentItemFontSize: number;
@@ -311,9 +312,10 @@ export declare const actionLoadScene: {
311
312
  currentItemStrokeColor: string;
312
313
  currentItemBackgroundColor: string;
313
314
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
314
- currentItemStrokeWidth: number;
315
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
315
316
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
316
317
  currentItemRoughness: number;
318
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
317
319
  currentItemOpacity: number;
318
320
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
319
321
  currentItemFontSize: number;
@@ -74,9 +74,10 @@ export declare const actionSelectAllElementsInFrame: {
74
74
  currentItemStrokeColor: string;
75
75
  currentItemBackgroundColor: string;
76
76
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
77
- currentItemStrokeWidth: number;
77
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
78
78
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
79
79
  currentItemRoughness: number;
80
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
80
81
  currentItemOpacity: number;
81
82
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
82
83
  currentItemFontSize: number;
@@ -257,9 +258,10 @@ export declare const actionRemoveAllElementsFromFrame: {
257
258
  currentItemStrokeColor: string;
258
259
  currentItemBackgroundColor: string;
259
260
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
260
- currentItemStrokeWidth: number;
261
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
261
262
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
262
263
  currentItemRoughness: number;
264
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
263
265
  currentItemOpacity: number;
264
266
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
265
267
  currentItemFontSize: number;
@@ -438,9 +440,10 @@ export declare const actionupdateFrameRendering: {
438
440
  currentItemStrokeColor: string;
439
441
  currentItemBackgroundColor: string;
440
442
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
441
- currentItemStrokeWidth: number;
443
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
442
444
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
443
445
  currentItemRoughness: number;
446
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
444
447
  currentItemOpacity: number;
445
448
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
446
449
  currentItemFontSize: number;
@@ -619,9 +622,10 @@ export declare const actionSetFrameAsActiveTool: {
619
622
  currentItemStrokeColor: string;
620
623
  currentItemBackgroundColor: string;
621
624
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
622
- currentItemStrokeWidth: number;
625
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
623
626
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
624
627
  currentItemRoughness: number;
628
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
625
629
  currentItemOpacity: number;
626
630
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
627
631
  currentItemFontSize: number;
@@ -1013,6 +1017,7 @@ export declare const actionWrapSelectionInFrame: {
1013
1017
  type: "image";
1014
1018
  fileId: import("@excalidraw/element/types").FileId | null;
1015
1019
  fileName: string | null;
1020
+ thumbHash: string | null;
1016
1021
  status: "pending" | "saved" | "error";
1017
1022
  scale: [number, number];
1018
1023
  crop: import("@excalidraw/element/types").ImageCrop | null;
@@ -1168,6 +1173,7 @@ export declare const actionWrapSelectionInFrame: {
1168
1173
  points: readonly import("@excalidraw/math").LocalPoint[];
1169
1174
  pressures: readonly number[];
1170
1175
  simulatePressure: boolean;
1176
+ strokeOptions: import("@excalidraw/element/types").StrokeOptions;
1171
1177
  }> & {
1172
1178
  index: import("@excalidraw/element/types").FractionalIndex;
1173
1179
  }) | import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameElement>)[];
@@ -80,9 +80,10 @@ export declare const actionGroup: {
80
80
  currentItemStrokeColor: string;
81
81
  currentItemBackgroundColor: string;
82
82
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
83
- currentItemStrokeWidth: number;
83
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
84
84
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
85
85
  currentItemRoughness: number;
86
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
86
87
  currentItemOpacity: number;
87
88
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
88
89
  currentItemFontSize: number;
@@ -262,9 +263,10 @@ export declare const actionUngroup: {
262
263
  currentItemStrokeColor: string;
263
264
  currentItemBackgroundColor: string;
264
265
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
265
- currentItemStrokeWidth: number;
266
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
266
267
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
267
268
  currentItemRoughness: number;
269
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
268
270
  currentItemOpacity: number;
269
271
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
270
272
  currentItemFontSize: number;
@@ -106,9 +106,10 @@ export declare const actionToggleLinearEditor: {
106
106
  currentItemStrokeColor: string;
107
107
  currentItemBackgroundColor: string;
108
108
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
109
- currentItemStrokeWidth: number;
109
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
110
110
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
111
111
  currentItemRoughness: number;
112
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
112
113
  currentItemOpacity: number;
113
114
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
114
115
  currentItemFontSize: number;
@@ -501,6 +502,7 @@ export declare const actionTogglePolygon: {
501
502
  type: "image";
502
503
  fileId: import("@excalidraw/element/types").FileId | null;
503
504
  fileName: string | null;
505
+ thumbHash: string | null;
504
506
  status: "pending" | "saved" | "error";
505
507
  scale: [number, number];
506
508
  crop: import("@excalidraw/element/types").ImageCrop | null;
@@ -656,6 +658,7 @@ export declare const actionTogglePolygon: {
656
658
  points: readonly import("@excalidraw/math").LocalPoint[];
657
659
  pressures: readonly number[];
658
660
  simulatePressure: boolean;
661
+ strokeOptions: import("@excalidraw/element/types").StrokeOptions;
659
662
  }> & {
660
663
  index: import("@excalidraw/element/types").FractionalIndex;
661
664
  }))[];
@@ -71,9 +71,10 @@ export declare const actionLink: {
71
71
  currentItemStrokeColor: string;
72
72
  currentItemBackgroundColor: string;
73
73
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
74
- currentItemStrokeWidth: number;
74
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
75
75
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
76
76
  currentItemRoughness: number;
77
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
77
78
  currentItemOpacity: number;
78
79
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
79
80
  currentItemFontSize: number;
@@ -78,9 +78,10 @@ export declare const actionShortcuts: {
78
78
  currentItemStrokeColor: string;
79
79
  currentItemBackgroundColor: string;
80
80
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
81
- currentItemStrokeWidth: number;
81
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
82
82
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
83
83
  currentItemRoughness: number;
84
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
84
85
  currentItemOpacity: number;
85
86
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
86
87
  currentItemFontSize: number;
@@ -1,8 +1,14 @@
1
+ import { type StrokeWidthKey } from "@excalidraw/common";
1
2
  import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
2
- import type { Arrowhead, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawTextElement, FontFamilyValues, TextAlign } from "@excalidraw/element/types";
3
+ import type { Arrowhead, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawTextElement, FontFamilyValues, StrokeVariability, TextAlign } from "@excalidraw/element/types";
3
4
  import type { AppClassProperties, AppState, Primitive } from "../types";
4
5
  export declare const changeProperty: (elements: readonly ExcalidrawElement[], appState: AppState, callback: (element: ExcalidrawElement) => ExcalidrawElement, includeBoundText?: boolean) => ExcalidrawElement[];
5
- export declare const getFormValue: <T extends Primitive>(elements: readonly ExcalidrawElement[], app: AppClassProperties, getAttribute: (element: ExcalidrawElement) => T, elementPredicate: true | ((element: ExcalidrawElement) => boolean), defaultValue: T | ((isSomeElementSelected: boolean) => T)) => T;
6
+ export declare const getFormValue: <T extends Primitive>(elements: readonly ExcalidrawElement[], app: AppClassProperties,
7
+ /**
8
+ * input value (usually the element attribute value,
9
+ * but depends on what the action's PanelComponent input expects)
10
+ */
11
+ getValue: (element: ExcalidrawElement) => T, elementPredicate: true | ((element: ExcalidrawElement) => boolean), defaultValue: T | ((isSomeElementSelected: boolean) => T)) => T;
6
12
  export declare const actionChangeStrokeColor: import("./types").Action<Pick<AppState, "currentItemStrokeColor">> & {
7
13
  keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean) | undefined;
8
14
  };
@@ -12,12 +18,15 @@ export declare const actionChangeBackgroundColor: import("./types").Action<Pick<
12
18
  export declare const actionChangeFillStyle: import("./types").Action<import("@excalidraw/element/types").FillStyle> & {
13
19
  keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean) | undefined;
14
20
  };
15
- export declare const actionChangeStrokeWidth: import("./types").Action<number> & {
21
+ export declare const actionChangeStrokeWidth: import("./types").Action<StrokeWidthKey> & {
16
22
  keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean) | undefined;
17
23
  };
18
24
  export declare const actionChangeSloppiness: import("./types").Action<number> & {
19
25
  keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean) | undefined;
20
26
  };
27
+ export declare const actionChangeFreedrawMode: import("./types").Action<StrokeVariability> & {
28
+ keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean) | undefined;
29
+ };
21
30
  export declare const actionChangeStrokeStyle: import("./types").Action<import("@excalidraw/element/types").StrokeStyle> & {
22
31
  keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean) | undefined;
23
32
  };
@@ -100,9 +109,10 @@ export declare const actionDecreaseFontSize: {
100
109
  currentItemStrokeColor: string;
101
110
  currentItemBackgroundColor: string;
102
111
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
103
- currentItemStrokeWidth: number;
112
+ currentItemStrokeWidthKey: StrokeWidthKey;
104
113
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
105
114
  currentItemRoughness: number;
115
+ currentItemStrokeVariability: StrokeVariability;
106
116
  currentItemOpacity: number;
107
117
  currentItemFontFamily: FontFamilyValues;
108
118
  currentItemTextAlign: TextAlign;
@@ -278,9 +288,10 @@ export declare const actionIncreaseFontSize: {
278
288
  currentItemStrokeColor: string;
279
289
  currentItemBackgroundColor: string;
280
290
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
281
- currentItemStrokeWidth: number;
291
+ currentItemStrokeWidthKey: StrokeWidthKey;
282
292
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
283
293
  currentItemRoughness: number;
294
+ currentItemStrokeVariability: StrokeVariability;
284
295
  currentItemOpacity: number;
285
296
  currentItemFontFamily: FontFamilyValues;
286
297
  currentItemTextAlign: TextAlign;
@@ -78,9 +78,10 @@ export declare const actionSelectAll: {
78
78
  currentItemStrokeColor: string;
79
79
  currentItemBackgroundColor: string;
80
80
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
81
- currentItemStrokeWidth: number;
81
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
82
82
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
83
83
  currentItemRoughness: number;
84
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
84
85
  currentItemOpacity: number;
85
86
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
86
87
  currentItemFontSize: number;
@@ -76,9 +76,10 @@ export declare const actionCopyStyles: {
76
76
  currentItemStrokeColor: string;
77
77
  currentItemBackgroundColor: string;
78
78
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
79
- currentItemStrokeWidth: number;
79
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
80
80
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
81
81
  currentItemRoughness: number;
82
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
82
83
  currentItemOpacity: number;
83
84
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
84
85
  currentItemFontSize: number;
@@ -72,9 +72,10 @@ export declare const actionToggleArrowBinding: {
72
72
  currentItemStrokeColor: string;
73
73
  currentItemBackgroundColor: string;
74
74
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
75
- currentItemStrokeWidth: number;
75
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
76
76
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
77
77
  currentItemRoughness: number;
78
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
78
79
  currentItemOpacity: number;
79
80
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
80
81
  currentItemFontSize: number;
@@ -77,9 +77,10 @@ export declare const actionToggleGridMode: {
77
77
  currentItemStrokeColor: string;
78
78
  currentItemBackgroundColor: string;
79
79
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
80
- currentItemStrokeWidth: number;
80
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
81
81
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
82
82
  currentItemRoughness: number;
83
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
83
84
  currentItemOpacity: number;
84
85
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
85
86
  currentItemFontSize: number;
@@ -72,9 +72,10 @@ export declare const actionToggleMidpointSnapping: {
72
72
  currentItemStrokeColor: string;
73
73
  currentItemBackgroundColor: string;
74
74
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
75
- currentItemStrokeWidth: number;
75
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
76
76
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
77
77
  currentItemRoughness: number;
78
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
78
79
  currentItemOpacity: number;
79
80
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
80
81
  currentItemFontSize: number;
@@ -75,9 +75,10 @@ export declare const actionToggleObjectsSnapMode: {
75
75
  currentItemStrokeColor: string;
76
76
  currentItemBackgroundColor: string;
77
77
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
78
- currentItemStrokeWidth: number;
78
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
79
79
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
80
80
  currentItemRoughness: number;
81
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
81
82
  currentItemOpacity: number;
82
83
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
83
84
  currentItemFontSize: number;
@@ -81,9 +81,10 @@ export declare const actionToggleSearchMenu: {
81
81
  currentItemStrokeColor: string;
82
82
  currentItemBackgroundColor: string;
83
83
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
84
- currentItemStrokeWidth: number;
84
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
85
85
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
86
86
  currentItemRoughness: number;
87
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
87
88
  currentItemOpacity: number;
88
89
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
89
90
  currentItemFontSize: number;
@@ -77,9 +77,10 @@ export declare const actionToggleStats: {
77
77
  currentItemStrokeColor: string;
78
78
  currentItemBackgroundColor: string;
79
79
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
80
- currentItemStrokeWidth: number;
80
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
81
81
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
82
82
  currentItemRoughness: number;
83
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
83
84
  currentItemOpacity: number;
84
85
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
85
86
  currentItemFontSize: number;
@@ -74,9 +74,10 @@ export declare const actionToggleViewMode: {
74
74
  currentItemStrokeColor: string;
75
75
  currentItemBackgroundColor: string;
76
76
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
77
- currentItemStrokeWidth: number;
77
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
78
78
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
79
79
  currentItemRoughness: number;
80
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
80
81
  currentItemOpacity: number;
81
82
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
82
83
  currentItemFontSize: number;
@@ -74,9 +74,10 @@ export declare const actionToggleZenMode: {
74
74
  currentItemStrokeColor: string;
75
75
  currentItemBackgroundColor: string;
76
76
  currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
77
- currentItemStrokeWidth: number;
77
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
78
78
  currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
79
79
  currentItemRoughness: number;
80
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
80
81
  currentItemOpacity: number;
81
82
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
82
83
  currentItemFontSize: number;
@@ -2,7 +2,7 @@ export { actionDeleteSelected } from "./actionDeleteSelected";
2
2
  export { actionBringForward, actionBringToFront, actionSendBackward, actionSendToBack, } from "./actionZindex";
3
3
  export { actionSelectAll } from "./actionSelectAll";
4
4
  export { actionDuplicateSelection } from "./actionDuplicateSelection";
5
- export { actionChangeStrokeColor, actionChangeBackgroundColor, actionChangeStrokeWidth, actionChangeFillStyle, actionChangeSloppiness, actionChangeOpacity, actionChangeFontSize, actionChangeFontFamily, actionChangeTextAlign, actionChangeVerticalAlign, actionChangeArrowProperties, } from "./actionProperties";
5
+ export { actionChangeStrokeColor, actionChangeBackgroundColor, actionChangeStrokeWidth, actionChangeFillStyle, actionChangeSloppiness, actionChangeFreedrawMode, actionChangeOpacity, actionChangeFontSize, actionChangeFontFamily, actionChangeTextAlign, actionChangeVerticalAlign, actionChangeArrowProperties, } from "./actionProperties";
6
6
  export { actionChangeViewBackgroundColor, actionZoomIn, actionZoomOut, actionResetZoom, actionZoomToFit, actionToggleTheme, } from "./actionCanvas";
7
7
  export { actionSetEmbeddableAsActiveTool } from "./actionEmbeddable";
8
8
  export { actionFinalize } from "./actionFinalize";
@@ -14,7 +14,7 @@ export type ActionResult = {
14
14
  type ActionFn<TData = any> = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: TData | undefined, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
15
15
  export type UpdaterFn = (res: ActionResult) => void;
16
16
  export type ActionFilterFn = (action: Action) => void;
17
- export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "arrowBinding" | "midpointSnapping" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "arrangeElements" | "normaliseElements" | "flipHorizontal" | "flipVertical" | "deselect" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "smartZoom" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
17
+ export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "arrowBinding" | "midpointSnapping" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeFreedrawMode" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "arrangeElements" | "normaliseElements" | "flipHorizontal" | "flipVertical" | "deselect" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "smartZoom" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
18
18
  export type PanelComponentProps = {
19
19
  elements: readonly ExcalidrawElement[];
20
20
  appState: AppState;
@@ -43,9 +43,10 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
43
43
  currentItemStrokeColor?: string | undefined;
44
44
  currentItemBackgroundColor?: string | undefined;
45
45
  currentItemFillStyle?: import("@excalidraw/element/types").FillStyle | undefined;
46
- currentItemStrokeWidth?: number | undefined;
46
+ currentItemStrokeWidthKey?: import("@excalidraw/common").StrokeWidthKey | undefined;
47
47
  currentItemStrokeStyle?: import("@excalidraw/element/types").StrokeStyle | undefined;
48
48
  currentItemRoughness?: number | undefined;
49
+ currentItemStrokeVariability?: import("@excalidraw/element/types").StrokeVariability | undefined;
49
50
  currentItemOpacity?: number | undefined;
50
51
  currentItemFontFamily?: number | undefined;
51
52
  currentItemFontSize?: number | undefined;