@dwelle/excalidraw 0.3.54 → 0.3.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/excalidraw-assets-dev/{image-73be8b3c1837ea26950c.js → image-eddc6ed66acd3a3f3d46.js} +0 -0
- package/dist/excalidraw.development.js +63 -63
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +2 -2
- package/types/actions/actionAddToLibrary.d.ts +18 -6
- package/types/actions/actionAlign.d.ts +18 -0
- package/types/actions/actionBoundText.d.ts +116 -0
- package/types/actions/actionCanvas.d.ts +67 -18
- package/types/actions/actionClipboard.d.ts +37 -10
- package/types/actions/actionDeleteSelected.d.ts +19 -6
- package/types/actions/actionDistribute.d.ts +6 -0
- package/types/actions/actionDuplicateSelection.d.ts +3 -0
- package/types/actions/actionExport.d.ts +71 -18
- package/types/actions/actionFinalize.d.ts +11 -4
- package/types/actions/actionFlip.d.ts +6 -0
- package/types/actions/actionGroup.d.ts +6 -0
- package/types/actions/actionMenu.d.ts +29 -6
- package/types/actions/actionNavigate.d.ts +3 -0
- package/types/actions/actionProperties.d.ts +82 -26
- package/types/actions/actionSelectAll.d.ts +3 -0
- package/types/actions/actionStyles.d.ts +11 -2
- package/types/actions/actionToggleGridMode.d.ts +9 -2
- package/types/actions/actionToggleStats.d.ts +8 -2
- package/types/actions/actionToggleViewMode.d.ts +9 -2
- package/types/actions/actionToggleZenMode.d.ts +9 -2
- package/types/actions/actionZindex.d.ts +12 -0
- package/types/actions/index.d.ts +1 -1
- package/types/actions/manager.d.ts +3 -3
- package/types/actions/types.d.ts +7 -9
- package/types/appState.d.ts +9 -4
- package/types/components/Actions.d.ts +4 -4
- package/types/components/App.d.ts +3 -2
- package/types/components/ImageExportDialog.d.ts +2 -2
- package/types/components/JSONExportDialog.d.ts +2 -2
- package/types/components/ToolButton.d.ts +3 -0
- package/types/constants.d.ts +1 -0
- package/types/data/restore.d.ts +1 -1
- package/types/element/Hyperlink.d.ts +9 -3
- package/types/element/dragElements.d.ts +1 -1
- package/types/element/linearElementEditor.d.ts +5 -2
- package/types/element/sizeHelpers.d.ts +2 -1
- package/types/element/textElement.d.ts +1 -2
- package/types/element/typeChecks.d.ts +2 -2
- package/types/packages/excalidraw/dist/excalidraw-assets-dev/image-eddc6ed66acd3a3f3d46.d.ts +0 -0
- package/types/scene/Scene.d.ts +1 -1
- package/types/types.d.ts +10 -3
- package/types/utils.d.ts +2 -0
|
@@ -3,6 +3,7 @@ import { AppState } from "../../src/types";
|
|
|
3
3
|
import { Arrowhead, ExcalidrawElement, ExcalidrawLinearElement, TextAlign } from "../element/types";
|
|
4
4
|
export declare const actionChangeStrokeColor: {
|
|
5
5
|
name: "changeStrokeColor";
|
|
6
|
+
trackEvent: false;
|
|
6
7
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => any;
|
|
7
8
|
PanelComponent: ({ elements, appState, updateData }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
|
|
8
9
|
} & {
|
|
@@ -10,6 +11,7 @@ export declare const actionChangeStrokeColor: {
|
|
|
10
11
|
};
|
|
11
12
|
export declare const actionChangeBackgroundColor: {
|
|
12
13
|
name: "changeBackgroundColor";
|
|
14
|
+
trackEvent: false;
|
|
13
15
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => any;
|
|
14
16
|
PanelComponent: ({ elements, appState, updateData }: import("react").PropsWithChildren<import("./types").PanelComponentProps>) => JSX.Element;
|
|
15
17
|
} & {
|
|
@@ -17,6 +19,7 @@ export declare const actionChangeBackgroundColor: {
|
|
|
17
19
|
};
|
|
18
20
|
export declare const actionChangeFillStyle: {
|
|
19
21
|
name: "changeFillStyle";
|
|
22
|
+
trackEvent: false;
|
|
20
23
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
21
24
|
elements: ExcalidrawElement[];
|
|
22
25
|
appState: {
|
|
@@ -32,8 +35,11 @@ export declare const actionChangeFillStyle: {
|
|
|
32
35
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
33
36
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
34
37
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
activeTool: {
|
|
39
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
40
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
41
|
+
locked: boolean;
|
|
42
|
+
};
|
|
37
43
|
penMode: boolean;
|
|
38
44
|
penDetected: boolean;
|
|
39
45
|
exportBackground: boolean;
|
|
@@ -111,6 +117,7 @@ export declare const actionChangeFillStyle: {
|
|
|
111
117
|
};
|
|
112
118
|
export declare const actionChangeStrokeWidth: {
|
|
113
119
|
name: "changeStrokeWidth";
|
|
120
|
+
trackEvent: false;
|
|
114
121
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
115
122
|
elements: ExcalidrawElement[];
|
|
116
123
|
appState: {
|
|
@@ -126,8 +133,11 @@ export declare const actionChangeStrokeWidth: {
|
|
|
126
133
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
127
134
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
128
135
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
129
|
-
|
|
130
|
-
|
|
136
|
+
activeTool: {
|
|
137
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
138
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
139
|
+
locked: boolean;
|
|
140
|
+
};
|
|
131
141
|
penMode: boolean;
|
|
132
142
|
penDetected: boolean;
|
|
133
143
|
exportBackground: boolean;
|
|
@@ -205,6 +215,7 @@ export declare const actionChangeStrokeWidth: {
|
|
|
205
215
|
};
|
|
206
216
|
export declare const actionChangeSloppiness: {
|
|
207
217
|
name: "changeSloppiness";
|
|
218
|
+
trackEvent: false;
|
|
208
219
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
209
220
|
elements: ExcalidrawElement[];
|
|
210
221
|
appState: {
|
|
@@ -220,8 +231,11 @@ export declare const actionChangeSloppiness: {
|
|
|
220
231
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
221
232
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
222
233
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
223
|
-
|
|
224
|
-
|
|
234
|
+
activeTool: {
|
|
235
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
236
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
237
|
+
locked: boolean;
|
|
238
|
+
};
|
|
225
239
|
penMode: boolean;
|
|
226
240
|
penDetected: boolean;
|
|
227
241
|
exportBackground: boolean;
|
|
@@ -299,6 +313,7 @@ export declare const actionChangeSloppiness: {
|
|
|
299
313
|
};
|
|
300
314
|
export declare const actionChangeStrokeStyle: {
|
|
301
315
|
name: "changeStrokeStyle";
|
|
316
|
+
trackEvent: false;
|
|
302
317
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
303
318
|
elements: ExcalidrawElement[];
|
|
304
319
|
appState: {
|
|
@@ -314,8 +329,11 @@ export declare const actionChangeStrokeStyle: {
|
|
|
314
329
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
315
330
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
316
331
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
317
|
-
|
|
318
|
-
|
|
332
|
+
activeTool: {
|
|
333
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
334
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
335
|
+
locked: boolean;
|
|
336
|
+
};
|
|
319
337
|
penMode: boolean;
|
|
320
338
|
penDetected: boolean;
|
|
321
339
|
exportBackground: boolean;
|
|
@@ -393,6 +411,7 @@ export declare const actionChangeStrokeStyle: {
|
|
|
393
411
|
};
|
|
394
412
|
export declare const actionChangeOpacity: {
|
|
395
413
|
name: "changeOpacity";
|
|
414
|
+
trackEvent: false;
|
|
396
415
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
397
416
|
elements: ExcalidrawElement[];
|
|
398
417
|
appState: {
|
|
@@ -408,8 +427,11 @@ export declare const actionChangeOpacity: {
|
|
|
408
427
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
409
428
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
410
429
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
411
|
-
|
|
412
|
-
|
|
430
|
+
activeTool: {
|
|
431
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
432
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
433
|
+
locked: boolean;
|
|
434
|
+
};
|
|
413
435
|
penMode: boolean;
|
|
414
436
|
penDetected: boolean;
|
|
415
437
|
exportBackground: boolean;
|
|
@@ -487,6 +509,7 @@ export declare const actionChangeOpacity: {
|
|
|
487
509
|
};
|
|
488
510
|
export declare const actionChangeFontSize: {
|
|
489
511
|
name: "changeFontSize";
|
|
512
|
+
trackEvent: false;
|
|
490
513
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
491
514
|
elements: ExcalidrawElement[];
|
|
492
515
|
appState: {
|
|
@@ -502,8 +525,11 @@ export declare const actionChangeFontSize: {
|
|
|
502
525
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
503
526
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
504
527
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
505
|
-
|
|
506
|
-
|
|
528
|
+
activeTool: {
|
|
529
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
530
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
531
|
+
locked: boolean;
|
|
532
|
+
};
|
|
507
533
|
penMode: boolean;
|
|
508
534
|
penDetected: boolean;
|
|
509
535
|
exportBackground: boolean;
|
|
@@ -581,6 +607,7 @@ export declare const actionChangeFontSize: {
|
|
|
581
607
|
};
|
|
582
608
|
export declare const actionDecreaseFontSize: {
|
|
583
609
|
name: "decreaseFontSize";
|
|
610
|
+
trackEvent: false;
|
|
584
611
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
585
612
|
elements: ExcalidrawElement[];
|
|
586
613
|
appState: {
|
|
@@ -596,8 +623,11 @@ export declare const actionDecreaseFontSize: {
|
|
|
596
623
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
597
624
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
598
625
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
599
|
-
|
|
600
|
-
|
|
626
|
+
activeTool: {
|
|
627
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
628
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
629
|
+
locked: boolean;
|
|
630
|
+
};
|
|
601
631
|
penMode: boolean;
|
|
602
632
|
penDetected: boolean;
|
|
603
633
|
exportBackground: boolean;
|
|
@@ -675,6 +705,7 @@ export declare const actionDecreaseFontSize: {
|
|
|
675
705
|
};
|
|
676
706
|
export declare const actionIncreaseFontSize: {
|
|
677
707
|
name: "increaseFontSize";
|
|
708
|
+
trackEvent: false;
|
|
678
709
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
679
710
|
elements: ExcalidrawElement[];
|
|
680
711
|
appState: {
|
|
@@ -690,8 +721,11 @@ export declare const actionIncreaseFontSize: {
|
|
|
690
721
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
691
722
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
692
723
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
693
|
-
|
|
694
|
-
|
|
724
|
+
activeTool: {
|
|
725
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
726
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
727
|
+
locked: boolean;
|
|
728
|
+
};
|
|
695
729
|
penMode: boolean;
|
|
696
730
|
penDetected: boolean;
|
|
697
731
|
exportBackground: boolean;
|
|
@@ -769,6 +803,7 @@ export declare const actionIncreaseFontSize: {
|
|
|
769
803
|
};
|
|
770
804
|
export declare const actionChangeFontFamily: {
|
|
771
805
|
name: "changeFontFamily";
|
|
806
|
+
trackEvent: false;
|
|
772
807
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
773
808
|
elements: ExcalidrawElement[];
|
|
774
809
|
appState: {
|
|
@@ -784,8 +819,11 @@ export declare const actionChangeFontFamily: {
|
|
|
784
819
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
785
820
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
786
821
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
787
|
-
|
|
788
|
-
|
|
822
|
+
activeTool: {
|
|
823
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
824
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
825
|
+
locked: boolean;
|
|
826
|
+
};
|
|
789
827
|
penMode: boolean;
|
|
790
828
|
penDetected: boolean;
|
|
791
829
|
exportBackground: boolean;
|
|
@@ -863,6 +901,7 @@ export declare const actionChangeFontFamily: {
|
|
|
863
901
|
};
|
|
864
902
|
export declare const actionChangeTextAlign: {
|
|
865
903
|
name: "changeTextAlign";
|
|
904
|
+
trackEvent: false;
|
|
866
905
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
867
906
|
elements: ExcalidrawElement[];
|
|
868
907
|
appState: {
|
|
@@ -878,8 +917,11 @@ export declare const actionChangeTextAlign: {
|
|
|
878
917
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
879
918
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
880
919
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
881
|
-
|
|
882
|
-
|
|
920
|
+
activeTool: {
|
|
921
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
922
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
923
|
+
locked: boolean;
|
|
924
|
+
};
|
|
883
925
|
penMode: boolean;
|
|
884
926
|
penDetected: boolean;
|
|
885
927
|
exportBackground: boolean;
|
|
@@ -957,6 +999,9 @@ export declare const actionChangeTextAlign: {
|
|
|
957
999
|
};
|
|
958
1000
|
export declare const actionChangeVerticalAlign: {
|
|
959
1001
|
name: "changeVerticalAlign";
|
|
1002
|
+
trackEvent: {
|
|
1003
|
+
category: "element";
|
|
1004
|
+
};
|
|
960
1005
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
961
1006
|
elements: ExcalidrawElement[];
|
|
962
1007
|
appState: {
|
|
@@ -971,8 +1016,11 @@ export declare const actionChangeVerticalAlign: {
|
|
|
971
1016
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
972
1017
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
973
1018
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
974
|
-
|
|
975
|
-
|
|
1019
|
+
activeTool: {
|
|
1020
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
1021
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
1022
|
+
locked: boolean;
|
|
1023
|
+
};
|
|
976
1024
|
penMode: boolean;
|
|
977
1025
|
penDetected: boolean;
|
|
978
1026
|
exportBackground: boolean;
|
|
@@ -1051,6 +1099,7 @@ export declare const actionChangeVerticalAlign: {
|
|
|
1051
1099
|
};
|
|
1052
1100
|
export declare const actionChangeSharpness: {
|
|
1053
1101
|
name: "changeSharpness";
|
|
1102
|
+
trackEvent: false;
|
|
1054
1103
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
1055
1104
|
elements: ExcalidrawElement[];
|
|
1056
1105
|
appState: {
|
|
@@ -1067,8 +1116,11 @@ export declare const actionChangeSharpness: {
|
|
|
1067
1116
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
1068
1117
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1069
1118
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1070
|
-
|
|
1071
|
-
|
|
1119
|
+
activeTool: {
|
|
1120
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
1121
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
1122
|
+
locked: boolean;
|
|
1123
|
+
};
|
|
1072
1124
|
penMode: boolean;
|
|
1073
1125
|
penDetected: boolean;
|
|
1074
1126
|
exportBackground: boolean;
|
|
@@ -1145,6 +1197,7 @@ export declare const actionChangeSharpness: {
|
|
|
1145
1197
|
};
|
|
1146
1198
|
export declare const actionChangeArrowhead: {
|
|
1147
1199
|
name: "changeArrowhead";
|
|
1200
|
+
trackEvent: false;
|
|
1148
1201
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: {
|
|
1149
1202
|
position: "start" | "end";
|
|
1150
1203
|
type: Arrowhead;
|
|
@@ -1162,8 +1215,11 @@ export declare const actionChangeArrowhead: {
|
|
|
1162
1215
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
1163
1216
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
1164
1217
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1165
|
-
|
|
1166
|
-
|
|
1218
|
+
activeTool: {
|
|
1219
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
1220
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
1221
|
+
locked: boolean;
|
|
1222
|
+
};
|
|
1167
1223
|
penMode: boolean;
|
|
1168
1224
|
penDetected: boolean;
|
|
1169
1225
|
exportBackground: boolean;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const actionSelectAll: {
|
|
3
3
|
name: "selectAll";
|
|
4
|
+
trackEvent: {
|
|
5
|
+
category: "canvas";
|
|
6
|
+
};
|
|
4
7
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => false | {
|
|
5
8
|
appState: import("../types").AppState;
|
|
6
9
|
commitToHistory: true;
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
export declare let copiedStyles: string;
|
|
3
3
|
export declare const actionCopyStyles: {
|
|
4
4
|
name: "copyStyles";
|
|
5
|
+
trackEvent: {
|
|
6
|
+
category: "element";
|
|
7
|
+
};
|
|
5
8
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
6
9
|
appState: {
|
|
7
10
|
toastMessage: string;
|
|
@@ -16,8 +19,11 @@ export declare const actionCopyStyles: {
|
|
|
16
19
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
17
20
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
18
21
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
activeTool: {
|
|
23
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
24
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
25
|
+
locked: boolean;
|
|
26
|
+
};
|
|
21
27
|
penMode: boolean;
|
|
22
28
|
penDetected: boolean;
|
|
23
29
|
exportBackground: boolean;
|
|
@@ -96,6 +102,9 @@ export declare const actionCopyStyles: {
|
|
|
96
102
|
};
|
|
97
103
|
export declare const actionPasteStyles: {
|
|
98
104
|
name: "pasteStyles";
|
|
105
|
+
trackEvent: {
|
|
106
|
+
category: "element";
|
|
107
|
+
};
|
|
99
108
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
100
109
|
elements: readonly import("../element/types").ExcalidrawElement[];
|
|
101
110
|
commitToHistory: false;
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import { AppState } from "../types";
|
|
3
3
|
export declare const actionToggleGridMode: {
|
|
4
4
|
name: "gridMode";
|
|
5
|
+
trackEvent: {
|
|
6
|
+
category: "canvas";
|
|
7
|
+
predicate: (appState: Readonly<AppState>) => boolean;
|
|
8
|
+
};
|
|
5
9
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<AppState>): {
|
|
6
10
|
appState: {
|
|
7
11
|
gridSize: number | null;
|
|
@@ -16,8 +20,11 @@ export declare const actionToggleGridMode: {
|
|
|
16
20
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
17
21
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
18
22
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
activeTool: {
|
|
24
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
25
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
26
|
+
locked: boolean;
|
|
27
|
+
};
|
|
21
28
|
penMode: boolean;
|
|
22
29
|
penDetected: boolean;
|
|
23
30
|
exportBackground: boolean;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const actionToggleStats: {
|
|
3
3
|
name: "stats";
|
|
4
|
+
trackEvent: {
|
|
5
|
+
category: "menu";
|
|
6
|
+
};
|
|
4
7
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
5
8
|
appState: {
|
|
6
9
|
showStats: boolean;
|
|
@@ -15,8 +18,11 @@ export declare const actionToggleStats: {
|
|
|
15
18
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
16
19
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
17
20
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
activeTool: {
|
|
22
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
23
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
24
|
+
locked: boolean;
|
|
25
|
+
};
|
|
20
26
|
penMode: boolean;
|
|
21
27
|
penDetected: boolean;
|
|
22
28
|
exportBackground: boolean;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const actionToggleViewMode: {
|
|
3
3
|
name: "viewMode";
|
|
4
|
+
trackEvent: {
|
|
5
|
+
category: "canvas";
|
|
6
|
+
predicate: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
7
|
+
};
|
|
4
8
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
5
9
|
appState: {
|
|
6
10
|
viewModeEnabled: boolean;
|
|
@@ -15,8 +19,11 @@ export declare const actionToggleViewMode: {
|
|
|
15
19
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
16
20
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
17
21
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
activeTool: {
|
|
23
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
24
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
25
|
+
locked: boolean;
|
|
26
|
+
};
|
|
20
27
|
penMode: boolean;
|
|
21
28
|
penDetected: boolean;
|
|
22
29
|
exportBackground: boolean;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const actionToggleZenMode: {
|
|
3
3
|
name: "zenMode";
|
|
4
|
+
trackEvent: {
|
|
5
|
+
category: "canvas";
|
|
6
|
+
predicate: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
7
|
+
};
|
|
4
8
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
5
9
|
appState: {
|
|
6
10
|
zenModeEnabled: boolean;
|
|
@@ -15,8 +19,11 @@ export declare const actionToggleZenMode: {
|
|
|
15
19
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
16
20
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
17
21
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
18
|
-
|
|
19
|
-
|
|
22
|
+
activeTool: {
|
|
23
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
24
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
25
|
+
locked: boolean;
|
|
26
|
+
};
|
|
20
27
|
penMode: boolean;
|
|
21
28
|
penDetected: boolean;
|
|
22
29
|
exportBackground: boolean;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export declare const actionSendBackward: {
|
|
3
3
|
name: "sendBackward";
|
|
4
|
+
trackEvent: {
|
|
5
|
+
category: "element";
|
|
6
|
+
};
|
|
4
7
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
5
8
|
elements: (import("../element/types").ExcalidrawLinearElement | import("../element/types").ExcalidrawSelectionElement | import("../element/types").ExcalidrawRectangleElement | import("../element/types").ExcalidrawDiamondElement | import("../element/types").ExcalidrawEllipseElement | import("../element/types").ExcalidrawImageElement | import("../element/types").ExcalidrawTextElement | import("../element/types").ExcalidrawFreeDrawElement)[];
|
|
6
9
|
appState: Readonly<import("../types").AppState>;
|
|
@@ -15,6 +18,9 @@ export declare const actionSendBackward: {
|
|
|
15
18
|
};
|
|
16
19
|
export declare const actionBringForward: {
|
|
17
20
|
name: "bringForward";
|
|
21
|
+
trackEvent: {
|
|
22
|
+
category: "element";
|
|
23
|
+
};
|
|
18
24
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
19
25
|
elements: (import("../element/types").ExcalidrawLinearElement | import("../element/types").ExcalidrawSelectionElement | import("../element/types").ExcalidrawRectangleElement | import("../element/types").ExcalidrawDiamondElement | import("../element/types").ExcalidrawEllipseElement | import("../element/types").ExcalidrawImageElement | import("../element/types").ExcalidrawTextElement | import("../element/types").ExcalidrawFreeDrawElement)[];
|
|
20
26
|
appState: Readonly<import("../types").AppState>;
|
|
@@ -29,6 +35,9 @@ export declare const actionBringForward: {
|
|
|
29
35
|
};
|
|
30
36
|
export declare const actionSendToBack: {
|
|
31
37
|
name: "sendToBack";
|
|
38
|
+
trackEvent: {
|
|
39
|
+
category: "element";
|
|
40
|
+
};
|
|
32
41
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
33
42
|
elements: readonly import("../element/types").ExcalidrawElement[];
|
|
34
43
|
appState: Readonly<import("../types").AppState>;
|
|
@@ -42,6 +51,9 @@ export declare const actionSendToBack: {
|
|
|
42
51
|
};
|
|
43
52
|
export declare const actionBringToFront: {
|
|
44
53
|
name: "bringToFront";
|
|
54
|
+
trackEvent: {
|
|
55
|
+
category: "element";
|
|
56
|
+
};
|
|
45
57
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
46
58
|
elements: readonly import("../element/types").ExcalidrawElement[];
|
|
47
59
|
appState: Readonly<import("../types").AppState>;
|
package/types/actions/index.d.ts
CHANGED
|
@@ -18,5 +18,5 @@ export { actionCopy, actionCut, actionCopyAsPng, actionCopyAsSvg, } from "./acti
|
|
|
18
18
|
export { actionToggleGridMode } from "./actionToggleGridMode";
|
|
19
19
|
export { actionToggleZenMode } from "./actionToggleZenMode";
|
|
20
20
|
export { actionToggleStats } from "./actionToggleStats";
|
|
21
|
-
export { actionUnbindText } from "./
|
|
21
|
+
export { actionUnbindText, actionBindText } from "./actionBoundText";
|
|
22
22
|
export { actionLink } from "../element/Hyperlink";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Action,
|
|
2
|
+
import { Action, UpdaterFn, ActionName, ActionResult, PanelComponentProps, ActionSource } from "./types";
|
|
3
3
|
import { ExcalidrawElement } from "../element/types";
|
|
4
4
|
import { AppClassProperties, AppState } from "../types";
|
|
5
|
-
export declare class ActionManager
|
|
5
|
+
export declare class ActionManager {
|
|
6
6
|
actions: Record<ActionName, Action>;
|
|
7
7
|
updater: (actionResult: ActionResult | Promise<ActionResult>) => void;
|
|
8
8
|
getAppState: () => Readonly<AppState>;
|
|
@@ -12,7 +12,7 @@ export declare class ActionManager implements ActionsManagerInterface {
|
|
|
12
12
|
registerAction(action: Action): void;
|
|
13
13
|
registerAll(actions: readonly Action[]): void;
|
|
14
14
|
handleKeyDown(event: React.KeyboardEvent | KeyboardEvent): boolean;
|
|
15
|
-
executeAction(action: Action): void;
|
|
15
|
+
executeAction(action: Action, source?: ActionSource): void;
|
|
16
16
|
/**
|
|
17
17
|
* @param data additional data sent to the PanelComponent
|
|
18
18
|
*/
|
package/types/actions/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { ExcalidrawElement } from "../element/types";
|
|
3
3
|
import { AppClassProperties, AppState, ExcalidrawProps, BinaryFiles } from "../types";
|
|
4
4
|
import { ToolButtonSize } from "../components/ToolButton";
|
|
5
|
+
export declare type ActionSource = "ui" | "keyboard" | "contextMenu" | "api";
|
|
5
6
|
/** if false, the action should be prevented */
|
|
6
7
|
export declare type ActionResult = {
|
|
7
8
|
elements?: readonly ExcalidrawElement[] | null;
|
|
@@ -14,7 +15,7 @@ export declare type ActionResult = {
|
|
|
14
15
|
declare type ActionFn = (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
15
16
|
export declare type UpdaterFn = (res: ActionResult) => void;
|
|
16
17
|
export declare type ActionFilterFn = (action: Action) => void;
|
|
17
|
-
export declare type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToSelection" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeSharpness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "eraser";
|
|
18
|
+
export declare type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToSelection" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeSharpness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "eraser" | "bindText";
|
|
18
19
|
export declare type PanelComponentProps = {
|
|
19
20
|
elements: readonly ExcalidrawElement[];
|
|
20
21
|
appState: AppState;
|
|
@@ -34,13 +35,10 @@ export interface Action {
|
|
|
34
35
|
contextItemLabel?: string | ((elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => string);
|
|
35
36
|
contextItemPredicate?: (elements: readonly ExcalidrawElement[], appState: AppState) => boolean;
|
|
36
37
|
checked?: (appState: Readonly<AppState>) => boolean;
|
|
37
|
-
trackEvent
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
handleKeyDown: (event: React.KeyboardEvent | KeyboardEvent) => boolean;
|
|
43
|
-
renderAction: (name: ActionName) => React.ReactElement | null;
|
|
44
|
-
executeAction: (action: Action) => void;
|
|
38
|
+
trackEvent: false | {
|
|
39
|
+
category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink";
|
|
40
|
+
action?: string;
|
|
41
|
+
predicate?: (appState: Readonly<AppState>, elements: readonly ExcalidrawElement[], value: any) => boolean;
|
|
42
|
+
};
|
|
45
43
|
}
|
|
46
44
|
export {};
|
package/types/appState.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { AppState, NormalizedZoomValue } from "./types";
|
|
2
2
|
export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
3
3
|
export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
|
|
4
|
-
|
|
4
|
+
activeTool?: {
|
|
5
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
6
|
+
lastActiveToolBeforeEraser: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | null;
|
|
7
|
+
locked: boolean;
|
|
8
|
+
} | undefined;
|
|
5
9
|
scrollX?: number | undefined;
|
|
6
10
|
scrollY?: number | undefined;
|
|
7
11
|
viewBackgroundColor?: string | undefined;
|
|
@@ -11,7 +15,8 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
11
15
|
shouldCacheIgnoreZoom?: boolean | undefined;
|
|
12
16
|
theme?: string | undefined;
|
|
13
17
|
name?: string | undefined;
|
|
14
|
-
|
|
18
|
+
penMode?: boolean | undefined;
|
|
19
|
+
penDetected?: boolean | undefined;
|
|
15
20
|
exportBackground?: boolean | undefined;
|
|
16
21
|
exportEmbedScene?: boolean | undefined;
|
|
17
22
|
exportWithDarkMode?: boolean | undefined;
|
|
@@ -57,6 +62,6 @@ export declare const clearAppStateForDatabase: (appState: Partial<AppState>) =>
|
|
|
57
62
|
viewBackgroundColor?: string | undefined;
|
|
58
63
|
gridSize?: number | null | undefined;
|
|
59
64
|
};
|
|
60
|
-
export declare const isEraserActive: ({
|
|
61
|
-
|
|
65
|
+
export declare const isEraserActive: ({ activeTool, }: {
|
|
66
|
+
activeTool: AppState["activeTool"];
|
|
62
67
|
}) => boolean;
|
|
@@ -2,15 +2,15 @@ import React from "react";
|
|
|
2
2
|
import { ActionManager } from "../actions/manager";
|
|
3
3
|
import { ExcalidrawElement, PointerType } from "../element/types";
|
|
4
4
|
import { AppState, Zoom } from "../types";
|
|
5
|
-
export declare const SelectedShapeActions: ({ appState, elements, renderAction,
|
|
5
|
+
export declare const SelectedShapeActions: ({ appState, elements, renderAction, activeTool, }: {
|
|
6
6
|
appState: AppState;
|
|
7
7
|
elements: readonly ExcalidrawElement[];
|
|
8
8
|
renderAction: ActionManager["renderAction"];
|
|
9
|
-
|
|
9
|
+
activeTool: AppState["activeTool"]["type"];
|
|
10
10
|
}) => JSX.Element;
|
|
11
|
-
export declare const ShapesSwitcher: ({ canvas,
|
|
11
|
+
export declare const ShapesSwitcher: ({ canvas, activeTool, setAppState, onImageAction, appState, }: {
|
|
12
12
|
canvas: HTMLCanvasElement | null;
|
|
13
|
-
|
|
13
|
+
activeTool: AppState["activeTool"];
|
|
14
14
|
setAppState: React.Component<any, AppState>["setState"];
|
|
15
15
|
onImageAction: (data: {
|
|
16
16
|
pointerType: PointerType | null;
|