@excalidraw/excalidraw 0.12.0-76cf560 → 0.12.0-78e254f
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 +2 -0
- package/README.md +56 -12
- package/dist/excalidraw.development.js +87 -43
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +6 -6
- package/types/actions/actionBoundText.d.ts +2 -2
- package/types/actions/actionCanvas.d.ts +16 -16
- package/types/actions/actionClipboard.d.ts +10 -10
- package/types/actions/actionDeleteSelected.d.ts +6 -6
- package/types/actions/actionExport.d.ts +18 -18
- package/types/actions/actionFinalize.d.ts +4 -4
- package/types/actions/actionLinearEditor.d.ts +2 -2
- package/types/actions/actionMenu.d.ts +6 -6
- package/types/actions/actionProperties.d.ts +26 -26
- package/types/actions/actionStyles.d.ts +2 -2
- package/types/actions/actionToggleGridMode.d.ts +2 -2
- package/types/actions/actionToggleLock.d.ts +2 -2
- package/types/actions/actionToggleStats.d.ts +2 -2
- package/types/actions/actionToggleViewMode.d.ts +2 -2
- package/types/actions/actionToggleZenMode.d.ts +2 -2
- package/types/appState.d.ts +2 -2
- package/types/components/App.d.ts +6 -1
- package/types/components/HintViewer.d.ts +3 -2
- package/types/components/LayerUI.d.ts +2 -1
- package/types/components/LibraryMenu.d.ts +14 -5
- package/types/components/LibraryMenuHeaderContent.d.ts +12 -0
- package/types/components/LibraryMenuItems.d.ts +2 -14
- package/types/components/LibraryUnit.d.ts +2 -3
- package/types/components/MobileMenu.d.ts +4 -3
- package/types/components/Sidebar/Sidebar.d.ts +73 -0
- package/types/components/Sidebar/SidebarHeader.d.ts +20 -0
- package/types/components/Sidebar/common.d.ts +15 -0
- package/types/components/hoc/withUpstreamOverride.d.ts +10 -0
- package/types/constants.d.ts +7 -1
- package/types/data/types.d.ts +16 -1
- package/types/element/Hyperlink.d.ts +2 -2
- package/types/element/image.d.ts +1 -1
- package/types/element/linearElementEditor.d.ts +3 -3
- package/types/keys.d.ts +3 -3
- package/types/packages/excalidraw/example/App.d.ts +2 -1
- package/types/packages/excalidraw/example/sidebar/{Sidebar.d.ts → ExampleSidebar.d.ts} +1 -1
- package/types/packages/excalidraw/index.d.ts +1 -0
- package/types/types.d.ts +8 -2
- package/types/components/SidebarLockButton.d.ts +0 -8
|
@@ -78,6 +78,8 @@ export declare const actionChangeFillStyle: {
|
|
|
78
78
|
}>;
|
|
79
79
|
openMenu: "canvas" | "shape" | null;
|
|
80
80
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
81
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
82
|
+
isSidebarDocked: boolean;
|
|
81
83
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
82
84
|
selectedElementIds: {
|
|
83
85
|
[id: string]: boolean;
|
|
@@ -104,8 +106,6 @@ export declare const actionChangeFillStyle: {
|
|
|
104
106
|
height: number;
|
|
105
107
|
offsetTop: number;
|
|
106
108
|
offsetLeft: number;
|
|
107
|
-
isLibraryOpen: boolean;
|
|
108
|
-
isLibraryMenuDocked: boolean;
|
|
109
109
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
110
110
|
collaborators: Map<string, import("../../src/types").Collaborator>;
|
|
111
111
|
showStats: boolean;
|
|
@@ -188,6 +188,8 @@ export declare const actionChangeStrokeWidth: {
|
|
|
188
188
|
}>;
|
|
189
189
|
openMenu: "canvas" | "shape" | null;
|
|
190
190
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
191
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
192
|
+
isSidebarDocked: boolean;
|
|
191
193
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
192
194
|
selectedElementIds: {
|
|
193
195
|
[id: string]: boolean;
|
|
@@ -214,8 +216,6 @@ export declare const actionChangeStrokeWidth: {
|
|
|
214
216
|
height: number;
|
|
215
217
|
offsetTop: number;
|
|
216
218
|
offsetLeft: number;
|
|
217
|
-
isLibraryOpen: boolean;
|
|
218
|
-
isLibraryMenuDocked: boolean;
|
|
219
219
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
220
220
|
collaborators: Map<string, import("../../src/types").Collaborator>;
|
|
221
221
|
showStats: boolean;
|
|
@@ -298,6 +298,8 @@ export declare const actionChangeSloppiness: {
|
|
|
298
298
|
}>;
|
|
299
299
|
openMenu: "canvas" | "shape" | null;
|
|
300
300
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
301
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
302
|
+
isSidebarDocked: boolean;
|
|
301
303
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
302
304
|
selectedElementIds: {
|
|
303
305
|
[id: string]: boolean;
|
|
@@ -324,8 +326,6 @@ export declare const actionChangeSloppiness: {
|
|
|
324
326
|
height: number;
|
|
325
327
|
offsetTop: number;
|
|
326
328
|
offsetLeft: number;
|
|
327
|
-
isLibraryOpen: boolean;
|
|
328
|
-
isLibraryMenuDocked: boolean;
|
|
329
329
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
330
330
|
collaborators: Map<string, import("../../src/types").Collaborator>;
|
|
331
331
|
showStats: boolean;
|
|
@@ -408,6 +408,8 @@ export declare const actionChangeStrokeStyle: {
|
|
|
408
408
|
}>;
|
|
409
409
|
openMenu: "canvas" | "shape" | null;
|
|
410
410
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
411
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
412
|
+
isSidebarDocked: boolean;
|
|
411
413
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
412
414
|
selectedElementIds: {
|
|
413
415
|
[id: string]: boolean;
|
|
@@ -434,8 +436,6 @@ export declare const actionChangeStrokeStyle: {
|
|
|
434
436
|
height: number;
|
|
435
437
|
offsetTop: number;
|
|
436
438
|
offsetLeft: number;
|
|
437
|
-
isLibraryOpen: boolean;
|
|
438
|
-
isLibraryMenuDocked: boolean;
|
|
439
439
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
440
440
|
collaborators: Map<string, import("../../src/types").Collaborator>;
|
|
441
441
|
showStats: boolean;
|
|
@@ -518,6 +518,8 @@ export declare const actionChangeOpacity: {
|
|
|
518
518
|
}>;
|
|
519
519
|
openMenu: "canvas" | "shape" | null;
|
|
520
520
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
521
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
522
|
+
isSidebarDocked: boolean;
|
|
521
523
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
522
524
|
selectedElementIds: {
|
|
523
525
|
[id: string]: boolean;
|
|
@@ -544,8 +546,6 @@ export declare const actionChangeOpacity: {
|
|
|
544
546
|
height: number;
|
|
545
547
|
offsetTop: number;
|
|
546
548
|
offsetLeft: number;
|
|
547
|
-
isLibraryOpen: boolean;
|
|
548
|
-
isLibraryMenuDocked: boolean;
|
|
549
549
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
550
550
|
collaborators: Map<string, import("../../src/types").Collaborator>;
|
|
551
551
|
showStats: boolean;
|
|
@@ -628,6 +628,8 @@ export declare const actionChangeFontSize: {
|
|
|
628
628
|
}>;
|
|
629
629
|
openMenu: "canvas" | "shape" | null;
|
|
630
630
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
631
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
632
|
+
isSidebarDocked: boolean;
|
|
631
633
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
632
634
|
selectedElementIds: {
|
|
633
635
|
[id: string]: boolean;
|
|
@@ -654,8 +656,6 @@ export declare const actionChangeFontSize: {
|
|
|
654
656
|
height: number;
|
|
655
657
|
offsetTop: number;
|
|
656
658
|
offsetLeft: number;
|
|
657
|
-
isLibraryOpen: boolean;
|
|
658
|
-
isLibraryMenuDocked: boolean;
|
|
659
659
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
660
660
|
collaborators: Map<string, import("../../src/types").Collaborator>;
|
|
661
661
|
showStats: boolean;
|
|
@@ -738,6 +738,8 @@ export declare const actionDecreaseFontSize: {
|
|
|
738
738
|
}>;
|
|
739
739
|
openMenu: "canvas" | "shape" | null;
|
|
740
740
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
741
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
742
|
+
isSidebarDocked: boolean;
|
|
741
743
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
742
744
|
selectedElementIds: {
|
|
743
745
|
[id: string]: boolean;
|
|
@@ -764,8 +766,6 @@ export declare const actionDecreaseFontSize: {
|
|
|
764
766
|
height: number;
|
|
765
767
|
offsetTop: number;
|
|
766
768
|
offsetLeft: number;
|
|
767
|
-
isLibraryOpen: boolean;
|
|
768
|
-
isLibraryMenuDocked: boolean;
|
|
769
769
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
770
770
|
collaborators: Map<string, import("../../src/types").Collaborator>;
|
|
771
771
|
showStats: boolean;
|
|
@@ -848,6 +848,8 @@ export declare const actionIncreaseFontSize: {
|
|
|
848
848
|
}>;
|
|
849
849
|
openMenu: "canvas" | "shape" | null;
|
|
850
850
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
851
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
852
|
+
isSidebarDocked: boolean;
|
|
851
853
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
852
854
|
selectedElementIds: {
|
|
853
855
|
[id: string]: boolean;
|
|
@@ -874,8 +876,6 @@ export declare const actionIncreaseFontSize: {
|
|
|
874
876
|
height: number;
|
|
875
877
|
offsetTop: number;
|
|
876
878
|
offsetLeft: number;
|
|
877
|
-
isLibraryOpen: boolean;
|
|
878
|
-
isLibraryMenuDocked: boolean;
|
|
879
879
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
880
880
|
collaborators: Map<string, import("../../src/types").Collaborator>;
|
|
881
881
|
showStats: boolean;
|
|
@@ -958,6 +958,8 @@ export declare const actionChangeFontFamily: {
|
|
|
958
958
|
}>;
|
|
959
959
|
openMenu: "canvas" | "shape" | null;
|
|
960
960
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
961
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
962
|
+
isSidebarDocked: boolean;
|
|
961
963
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
962
964
|
selectedElementIds: {
|
|
963
965
|
[id: string]: boolean;
|
|
@@ -984,8 +986,6 @@ export declare const actionChangeFontFamily: {
|
|
|
984
986
|
height: number;
|
|
985
987
|
offsetTop: number;
|
|
986
988
|
offsetLeft: number;
|
|
987
|
-
isLibraryOpen: boolean;
|
|
988
|
-
isLibraryMenuDocked: boolean;
|
|
989
989
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
990
990
|
collaborators: Map<string, import("../../src/types").Collaborator>;
|
|
991
991
|
showStats: boolean;
|
|
@@ -1068,6 +1068,8 @@ export declare const actionChangeTextAlign: {
|
|
|
1068
1068
|
}>;
|
|
1069
1069
|
openMenu: "canvas" | "shape" | null;
|
|
1070
1070
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
1071
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
1072
|
+
isSidebarDocked: boolean;
|
|
1071
1073
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
1072
1074
|
selectedElementIds: {
|
|
1073
1075
|
[id: string]: boolean;
|
|
@@ -1094,8 +1096,6 @@ export declare const actionChangeTextAlign: {
|
|
|
1094
1096
|
height: number;
|
|
1095
1097
|
offsetTop: number;
|
|
1096
1098
|
offsetLeft: number;
|
|
1097
|
-
isLibraryOpen: boolean;
|
|
1098
|
-
isLibraryMenuDocked: boolean;
|
|
1099
1099
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
1100
1100
|
collaborators: Map<string, import("../../src/types").Collaborator>;
|
|
1101
1101
|
showStats: boolean;
|
|
@@ -1180,6 +1180,8 @@ export declare const actionChangeVerticalAlign: {
|
|
|
1180
1180
|
}>;
|
|
1181
1181
|
openMenu: "canvas" | "shape" | null;
|
|
1182
1182
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
1183
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
1184
|
+
isSidebarDocked: boolean;
|
|
1183
1185
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
1184
1186
|
selectedElementIds: {
|
|
1185
1187
|
[id: string]: boolean;
|
|
@@ -1206,8 +1208,6 @@ export declare const actionChangeVerticalAlign: {
|
|
|
1206
1208
|
height: number;
|
|
1207
1209
|
offsetTop: number;
|
|
1208
1210
|
offsetLeft: number;
|
|
1209
|
-
isLibraryOpen: boolean;
|
|
1210
|
-
isLibraryMenuDocked: boolean;
|
|
1211
1211
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
1212
1212
|
collaborators: Map<string, import("../../src/types").Collaborator>;
|
|
1213
1213
|
showStats: boolean;
|
|
@@ -1290,6 +1290,8 @@ export declare const actionChangeSharpness: {
|
|
|
1290
1290
|
}>;
|
|
1291
1291
|
openMenu: "canvas" | "shape" | null;
|
|
1292
1292
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
1293
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
1294
|
+
isSidebarDocked: boolean;
|
|
1293
1295
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
1294
1296
|
selectedElementIds: {
|
|
1295
1297
|
[id: string]: boolean;
|
|
@@ -1316,8 +1318,6 @@ export declare const actionChangeSharpness: {
|
|
|
1316
1318
|
height: number;
|
|
1317
1319
|
offsetTop: number;
|
|
1318
1320
|
offsetLeft: number;
|
|
1319
|
-
isLibraryOpen: boolean;
|
|
1320
|
-
isLibraryMenuDocked: boolean;
|
|
1321
1321
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
1322
1322
|
collaborators: Map<string, import("../../src/types").Collaborator>;
|
|
1323
1323
|
showStats: boolean;
|
|
@@ -1403,6 +1403,8 @@ export declare const actionChangeArrowhead: {
|
|
|
1403
1403
|
}>;
|
|
1404
1404
|
openMenu: "canvas" | "shape" | null;
|
|
1405
1405
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
1406
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
1407
|
+
isSidebarDocked: boolean;
|
|
1406
1408
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
1407
1409
|
selectedElementIds: {
|
|
1408
1410
|
[id: string]: boolean;
|
|
@@ -1429,8 +1431,6 @@ export declare const actionChangeArrowhead: {
|
|
|
1429
1431
|
height: number;
|
|
1430
1432
|
offsetTop: number;
|
|
1431
1433
|
offsetLeft: number;
|
|
1432
|
-
isLibraryOpen: boolean;
|
|
1433
|
-
isLibraryMenuDocked: boolean;
|
|
1434
1434
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
1435
1435
|
collaborators: Map<string, import("../../src/types").Collaborator>;
|
|
1436
1436
|
showStats: boolean;
|
|
@@ -65,6 +65,8 @@ export declare const actionCopyStyles: {
|
|
|
65
65
|
}>;
|
|
66
66
|
openMenu: "canvas" | "shape" | null;
|
|
67
67
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
68
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
69
|
+
isSidebarDocked: boolean;
|
|
68
70
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
69
71
|
selectedElementIds: {
|
|
70
72
|
[id: string]: boolean;
|
|
@@ -86,8 +88,6 @@ export declare const actionCopyStyles: {
|
|
|
86
88
|
height: number;
|
|
87
89
|
offsetTop: number;
|
|
88
90
|
offsetLeft: number;
|
|
89
|
-
isLibraryOpen: boolean;
|
|
90
|
-
isLibraryMenuDocked: boolean;
|
|
91
91
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
92
92
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
93
93
|
showStats: boolean;
|
|
@@ -64,6 +64,8 @@ export declare const actionToggleGridMode: {
|
|
|
64
64
|
}>;
|
|
65
65
|
openMenu: "canvas" | "shape" | null;
|
|
66
66
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
67
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
68
|
+
isSidebarDocked: boolean;
|
|
67
69
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
68
70
|
selectedElementIds: {
|
|
69
71
|
[id: string]: boolean;
|
|
@@ -89,8 +91,6 @@ export declare const actionToggleGridMode: {
|
|
|
89
91
|
height: number;
|
|
90
92
|
offsetTop: number;
|
|
91
93
|
offsetLeft: number;
|
|
92
|
-
isLibraryOpen: boolean;
|
|
93
|
-
isLibraryMenuDocked: boolean;
|
|
94
94
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
95
95
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
96
96
|
showStats: boolean;
|
|
@@ -64,6 +64,8 @@ export declare const actionToggleLock: {
|
|
|
64
64
|
}>;
|
|
65
65
|
openMenu: "canvas" | "shape" | null;
|
|
66
66
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
67
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
68
|
+
isSidebarDocked: boolean;
|
|
67
69
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
68
70
|
selectedElementIds: {
|
|
69
71
|
[id: string]: boolean;
|
|
@@ -90,8 +92,6 @@ export declare const actionToggleLock: {
|
|
|
90
92
|
height: number;
|
|
91
93
|
offsetTop: number;
|
|
92
94
|
offsetLeft: number;
|
|
93
|
-
isLibraryOpen: boolean;
|
|
94
|
-
isLibraryMenuDocked: boolean;
|
|
95
95
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
96
96
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
97
97
|
showStats: boolean;
|
|
@@ -62,6 +62,8 @@ export declare const actionToggleStats: {
|
|
|
62
62
|
}>;
|
|
63
63
|
openMenu: "canvas" | "shape" | null;
|
|
64
64
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
65
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
66
|
+
isSidebarDocked: boolean;
|
|
65
67
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
66
68
|
selectedElementIds: {
|
|
67
69
|
[id: string]: boolean;
|
|
@@ -88,8 +90,6 @@ export declare const actionToggleStats: {
|
|
|
88
90
|
height: number;
|
|
89
91
|
offsetTop: number;
|
|
90
92
|
offsetLeft: number;
|
|
91
|
-
isLibraryOpen: boolean;
|
|
92
|
-
isLibraryMenuDocked: boolean;
|
|
93
93
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
94
94
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
95
95
|
currentChartType: import("../element/types").ChartType;
|
|
@@ -63,6 +63,8 @@ export declare const actionToggleViewMode: {
|
|
|
63
63
|
}>;
|
|
64
64
|
openMenu: "canvas" | "shape" | null;
|
|
65
65
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
66
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
67
|
+
isSidebarDocked: boolean;
|
|
66
68
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
67
69
|
selectedElementIds: {
|
|
68
70
|
[id: string]: boolean;
|
|
@@ -88,8 +90,6 @@ export declare const actionToggleViewMode: {
|
|
|
88
90
|
height: number;
|
|
89
91
|
offsetTop: number;
|
|
90
92
|
offsetLeft: number;
|
|
91
|
-
isLibraryOpen: boolean;
|
|
92
|
-
isLibraryMenuDocked: boolean;
|
|
93
93
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
94
94
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
95
95
|
showStats: boolean;
|
|
@@ -63,6 +63,8 @@ export declare const actionToggleZenMode: {
|
|
|
63
63
|
}>;
|
|
64
64
|
openMenu: "canvas" | "shape" | null;
|
|
65
65
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
66
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
67
|
+
isSidebarDocked: boolean;
|
|
66
68
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
67
69
|
selectedElementIds: {
|
|
68
70
|
[id: string]: boolean;
|
|
@@ -88,8 +90,6 @@ export declare const actionToggleZenMode: {
|
|
|
88
90
|
height: number;
|
|
89
91
|
offsetTop: number;
|
|
90
92
|
offsetLeft: number;
|
|
91
|
-
isLibraryOpen: boolean;
|
|
92
|
-
isLibraryMenuDocked: boolean;
|
|
93
93
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
94
94
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
95
95
|
showStats: boolean;
|
package/types/appState.d.ts
CHANGED
|
@@ -44,6 +44,8 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
44
44
|
scrolledOutside?: boolean | undefined;
|
|
45
45
|
name?: string | undefined;
|
|
46
46
|
openMenu?: "canvas" | "shape" | null | undefined;
|
|
47
|
+
openSidebar?: "library" | "customSidebar" | null | undefined;
|
|
48
|
+
isSidebarDocked?: boolean | undefined;
|
|
47
49
|
lastPointerDownWith?: import("./element/types").PointerType | undefined;
|
|
48
50
|
selectedElementIds?: {
|
|
49
51
|
[id: string]: boolean;
|
|
@@ -57,8 +59,6 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
57
59
|
[groupId: string]: boolean;
|
|
58
60
|
} | undefined;
|
|
59
61
|
editingGroupId?: string | null | undefined;
|
|
60
|
-
isLibraryOpen?: boolean | undefined;
|
|
61
|
-
isLibraryMenuDocked?: boolean | undefined;
|
|
62
62
|
showStats?: boolean | undefined;
|
|
63
63
|
currentChartType?: import("./element/types").ChartType | undefined;
|
|
64
64
|
selectedLinearElement?: import("./element/linearElementEditor").LinearElementEditor | null | undefined;
|
|
@@ -19,6 +19,7 @@ export declare const useExcalidrawContainer: () => {
|
|
|
19
19
|
};
|
|
20
20
|
export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawElement[];
|
|
21
21
|
export declare const useExcalidrawAppState: () => AppState;
|
|
22
|
+
export declare const useExcalidrawSetAppState: () => <K extends keyof AppState>(state: AppState | ((prevState: Readonly<AppState>, props: Readonly<any>) => AppState | Pick<AppState, K> | null) | Pick<AppState, K> | null, callback?: (() => void) | undefined) => void;
|
|
22
23
|
declare class App extends React.Component<AppProps, AppState> {
|
|
23
24
|
canvas: AppClassProperties["canvas"];
|
|
24
25
|
rc: RoughCanvas | null;
|
|
@@ -83,7 +84,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
83
84
|
private pasteFromClipboard;
|
|
84
85
|
private addElementsFromPasteOrLibrary;
|
|
85
86
|
private addTextFromPaste;
|
|
86
|
-
setAppState:
|
|
87
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
87
88
|
removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
|
|
88
89
|
toggleLock: (source?: "keyboard" | "ui") => void;
|
|
89
90
|
togglePenMode: () => void;
|
|
@@ -103,6 +104,10 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
103
104
|
commitToHistory?: SceneData["commitToHistory"];
|
|
104
105
|
}) => void;
|
|
105
106
|
private onSceneUpdated;
|
|
107
|
+
/**
|
|
108
|
+
* @returns whether the menu was toggled on or off
|
|
109
|
+
*/
|
|
110
|
+
toggleMenu: (type: "library" | "customSidebar", force?: boolean) => boolean;
|
|
106
111
|
private updateCurrentCursorPosition;
|
|
107
112
|
private onKeyDown;
|
|
108
113
|
private onWheel;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
2
2
|
import "./HintViewer.scss";
|
|
3
|
-
import { AppState } from "../types";
|
|
3
|
+
import { AppState, Device } from "../types";
|
|
4
4
|
interface HintViewerProps {
|
|
5
5
|
appState: AppState;
|
|
6
6
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
7
7
|
isMobile: boolean;
|
|
8
|
+
device: Device;
|
|
8
9
|
}
|
|
9
|
-
export declare const HintViewer: ({ appState, elements, isMobile, }: HintViewerProps) => JSX.Element | null;
|
|
10
|
+
export declare const HintViewer: ({ appState, elements, isMobile, device, }: HintViewerProps) => JSX.Element | null;
|
|
10
11
|
export {};
|
|
@@ -23,6 +23,7 @@ interface LayerUIProps {
|
|
|
23
23
|
renderTopRightUI?: ExcalidrawProps["renderTopRightUI"];
|
|
24
24
|
renderCustomFooter?: ExcalidrawProps["renderFooter"];
|
|
25
25
|
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
26
|
+
renderCustomSidebar?: ExcalidrawProps["renderSidebar"];
|
|
26
27
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
27
28
|
UIOptions: AppProps["UIOptions"];
|
|
28
29
|
focusContainer: () => void;
|
|
@@ -32,5 +33,5 @@ interface LayerUIProps {
|
|
|
32
33
|
insertOnCanvasDirectly: boolean;
|
|
33
34
|
}) => void;
|
|
34
35
|
}
|
|
35
|
-
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onCollabButtonClick, onLockToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, isCollaborating, renderTopRightUI, renderCustomFooter, renderCustomStats, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, }: LayerUIProps) => JSX.Element>;
|
|
36
|
+
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onCollabButtonClick, onLockToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, isCollaborating, renderTopRightUI, renderCustomFooter, renderCustomStats, renderCustomSidebar, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, }: LayerUIProps) => JSX.Element>;
|
|
36
37
|
export default _default;
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import Library from "../data/library";
|
|
2
|
-
import { LibraryItems, LibraryItem, AppState,
|
|
3
|
+
import { LibraryItems, LibraryItem, AppState, ExcalidrawProps } from "../types";
|
|
3
4
|
import "./LibraryMenu.scss";
|
|
4
|
-
|
|
5
|
+
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
6
|
+
export declare const LibraryMenuContent: ({ onInsertLibraryItems, pendingElements, onAddToLibrary, setAppState, libraryReturnUrl, library, id, appState, selectedItems, onSelectItems, }: {
|
|
5
7
|
pendingElements: LibraryItem["elements"];
|
|
6
|
-
onClose: () => void;
|
|
7
8
|
onInsertLibraryItems: (libraryItems: LibraryItems) => void;
|
|
8
9
|
onAddToLibrary: () => void;
|
|
9
|
-
files: BinaryFiles;
|
|
10
10
|
setAppState: React.Component<any, AppState>["setState"];
|
|
11
11
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
12
|
-
focusContainer: () => void;
|
|
13
12
|
library: Library;
|
|
14
13
|
id: string;
|
|
15
14
|
appState: AppState;
|
|
15
|
+
selectedItems: LibraryItem["id"][];
|
|
16
|
+
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
16
17
|
}) => JSX.Element;
|
|
18
|
+
export declare const LibraryMenu: React.FC<{
|
|
19
|
+
appState: AppState;
|
|
20
|
+
onInsertElements: (elements: readonly NonDeletedExcalidrawElement[]) => void;
|
|
21
|
+
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
22
|
+
focusContainer: () => void;
|
|
23
|
+
library: Library;
|
|
24
|
+
id: string;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Library from "../data/library";
|
|
3
|
+
import { AppState, LibraryItem } from "../types";
|
|
4
|
+
export declare const LibraryMenuHeader: React.FC<{
|
|
5
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
6
|
+
selectedItems: LibraryItem["id"][];
|
|
7
|
+
library: Library;
|
|
8
|
+
onRemoveFromLibrary: () => void;
|
|
9
|
+
resetLibrary: () => void;
|
|
10
|
+
onSelectItems: (items: LibraryItem["id"][]) => void;
|
|
11
|
+
appState: AppState;
|
|
12
|
+
}>;
|
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Library from "../data/library";
|
|
3
|
-
import { AppState, BinaryFiles, ExcalidrawProps, LibraryItem, LibraryItems } from "../types";
|
|
1
|
+
import { LibraryItem, LibraryItems } from "../types";
|
|
4
2
|
import "./LibraryMenuItems.scss";
|
|
5
|
-
declare const LibraryMenuItems: ({ isLoading, libraryItems,
|
|
3
|
+
declare const LibraryMenuItems: ({ isLoading, libraryItems, onAddToLibrary, onInsertLibraryItems, pendingElements, selectedItems, onSelectItems, }: {
|
|
6
4
|
isLoading: boolean;
|
|
7
5
|
libraryItems: LibraryItems;
|
|
8
6
|
pendingElements: LibraryItem["elements"];
|
|
9
|
-
onRemoveFromLibrary: () => void;
|
|
10
7
|
onInsertLibraryItems: (libraryItems: LibraryItems) => void;
|
|
11
8
|
onAddToLibrary: (elements: LibraryItem["elements"]) => void;
|
|
12
|
-
theme: AppState["theme"];
|
|
13
|
-
files: BinaryFiles;
|
|
14
|
-
setAppState: React.Component<any, AppState>["setState"];
|
|
15
|
-
appState: AppState;
|
|
16
|
-
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
17
|
-
library: Library;
|
|
18
|
-
id: string;
|
|
19
9
|
selectedItems: LibraryItem["id"][];
|
|
20
10
|
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
21
|
-
onPublish: () => void;
|
|
22
|
-
resetLibrary: () => void;
|
|
23
11
|
}) => JSX.Element;
|
|
24
12
|
export default LibraryMenuItems;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LibraryItem } from "../types";
|
|
2
2
|
import "./LibraryUnit.scss";
|
|
3
|
-
export declare const LibraryUnit: ({ id, elements,
|
|
3
|
+
export declare const LibraryUnit: ({ id, elements, isPending, onClick, selected, onToggle, onDrag, }: {
|
|
4
4
|
id: LibraryItem["id"] | /** for pending item */ null;
|
|
5
5
|
elements?: readonly import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | undefined;
|
|
6
|
-
files: BinaryFiles;
|
|
7
6
|
isPending?: boolean | undefined;
|
|
8
7
|
onClick: () => void;
|
|
9
8
|
selected: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AppState, ExcalidrawProps } from "../types";
|
|
2
|
+
import { AppState, Device, ExcalidrawProps } from "../types";
|
|
3
3
|
import { ActionManager } from "../actions/manager";
|
|
4
4
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
declare type MobileMenuProps = {
|
|
@@ -9,7 +9,6 @@ declare type MobileMenuProps = {
|
|
|
9
9
|
renderImageExportDialog: () => React.ReactNode;
|
|
10
10
|
setAppState: React.Component<any, AppState>["setState"];
|
|
11
11
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
12
|
-
libraryMenu: JSX.Element | null;
|
|
13
12
|
onCollabButtonClick?: () => void;
|
|
14
13
|
onLockToggle: () => void;
|
|
15
14
|
onPenModeToggle: () => void;
|
|
@@ -21,6 +20,8 @@ declare type MobileMenuProps = {
|
|
|
21
20
|
}) => void;
|
|
22
21
|
renderTopRightUI?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
|
|
23
22
|
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
23
|
+
renderSidebars: () => JSX.Element | null;
|
|
24
|
+
device: Device;
|
|
24
25
|
};
|
|
25
|
-
export declare const MobileMenu: ({ appState, elements,
|
|
26
|
+
export declare const MobileMenu: ({ appState, elements, actionManager, renderJSONExportDialog, renderImageExportDialog, setAppState, onCollabButtonClick, onLockToggle, onPenModeToggle, canvas, isCollaborating, renderCustomFooter, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, }: MobileMenuProps) => JSX.Element;
|
|
26
27
|
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./Sidebar.scss";
|
|
3
|
+
/** using a counter instead of boolean to handle race conditions where
|
|
4
|
+
* the host app may render (mount/unmount) multiple different sidebar */
|
|
5
|
+
export declare const hostSidebarCountersAtom: import("jotai").Atom<{
|
|
6
|
+
rendered: number;
|
|
7
|
+
docked: number;
|
|
8
|
+
}> & {
|
|
9
|
+
write: (get: {
|
|
10
|
+
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
11
|
+
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
12
|
+
<Value_2>(atom: import("jotai").Atom<Value_2>): Value_2 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_2;
|
|
13
|
+
} & {
|
|
14
|
+
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
15
|
+
unstable_promise: true;
|
|
16
|
+
}): Value_3 | Promise<Value_3>;
|
|
17
|
+
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
18
|
+
unstable_promise: true;
|
|
19
|
+
}): Value_4 | Promise<Value_4>;
|
|
20
|
+
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
21
|
+
unstable_promise: true;
|
|
22
|
+
}): (Value_5 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_5) | Promise<Value_5 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_5>;
|
|
23
|
+
}, set: {
|
|
24
|
+
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
25
|
+
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
26
|
+
}, update: {
|
|
27
|
+
rendered: number;
|
|
28
|
+
docked: number;
|
|
29
|
+
} | ((prev: {
|
|
30
|
+
rendered: number;
|
|
31
|
+
docked: number;
|
|
32
|
+
}) => {
|
|
33
|
+
rendered: number;
|
|
34
|
+
docked: number;
|
|
35
|
+
})) => void;
|
|
36
|
+
onMount?: (<S extends (update: {
|
|
37
|
+
rendered: number;
|
|
38
|
+
docked: number;
|
|
39
|
+
} | ((prev: {
|
|
40
|
+
rendered: number;
|
|
41
|
+
docked: number;
|
|
42
|
+
}) => {
|
|
43
|
+
rendered: number;
|
|
44
|
+
docked: number;
|
|
45
|
+
})) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
46
|
+
} & {
|
|
47
|
+
/** @private internal */
|
|
48
|
+
init: {
|
|
49
|
+
rendered: number;
|
|
50
|
+
docked: number;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export declare const Sidebar: import("react").ForwardRefExoticComponent<{
|
|
54
|
+
children: import("react").ReactNode;
|
|
55
|
+
onClose?: (() => boolean | void) | undefined;
|
|
56
|
+
onDock?: ((docked: boolean) => void) | undefined;
|
|
57
|
+
docked?: boolean | undefined;
|
|
58
|
+
dockable?: boolean | undefined;
|
|
59
|
+
className?: string | undefined;
|
|
60
|
+
} & {
|
|
61
|
+
/** @private internal */
|
|
62
|
+
__isInternal?: boolean | undefined;
|
|
63
|
+
} & import("react").RefAttributes<HTMLDivElement>> & {
|
|
64
|
+
Header: {
|
|
65
|
+
(props: {
|
|
66
|
+
children?: import("react").ReactNode;
|
|
67
|
+
className?: string | undefined;
|
|
68
|
+
} & {
|
|
69
|
+
__isFallback?: boolean | undefined;
|
|
70
|
+
}): JSX.Element | null;
|
|
71
|
+
displayName: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const SidebarDockButton: (props: {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
onChange?(): void;
|
|
5
|
+
}) => JSX.Element;
|
|
6
|
+
/** @private */
|
|
7
|
+
export declare const SidebarHeaderComponents: {
|
|
8
|
+
Context: import("react").FC<{
|
|
9
|
+
children: import("react").ReactNode;
|
|
10
|
+
}>;
|
|
11
|
+
Component: {
|
|
12
|
+
(props: {
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
} & {
|
|
16
|
+
__isFallback?: boolean | undefined;
|
|
17
|
+
}): JSX.Element | null;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare type SidebarProps<P = {}> = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Called on sidebar close (either by user action or by the editor).
|
|
6
|
+
*/
|
|
7
|
+
onClose?: () => void | boolean;
|
|
8
|
+
/** if not supplied, sidebar won't be dockable */
|
|
9
|
+
onDock?: (docked: boolean) => void;
|
|
10
|
+
docked?: boolean;
|
|
11
|
+
dockable?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
} & P;
|
|
14
|
+
export declare type SidebarPropsContextValue = Pick<SidebarProps, "onClose" | "onDock" | "docked" | "dockable">;
|
|
15
|
+
export declare const SidebarPropsContext: React.Context<SidebarPropsContextValue>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const withUpstreamOverride: <P>(Component: React.ComponentType<P>) => readonly [React.FC<{
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}>, {
|
|
5
|
+
(props: P & {
|
|
6
|
+
/** @private internal */
|
|
7
|
+
__isFallback?: boolean | undefined;
|
|
8
|
+
}): JSX.Element | null;
|
|
9
|
+
displayName: string;
|
|
10
|
+
}];
|