@excalidraw/excalidraw 0.15.2-2a4799d → 0.15.2-6213-0f92339
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 +16 -0
- package/dist/excalidraw.development.js +368 -137
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +15 -6
- package/types/actions/actionBoundText.d.ts +10 -4
- package/types/actions/actionCanvas.d.ts +50 -20
- package/types/actions/actionClipboard.d.ts +25 -10
- package/types/actions/actionDeleteSelected.d.ts +15 -6
- package/types/actions/actionExport.d.ts +45 -18
- package/types/actions/actionFinalize.d.ts +10 -4
- package/types/actions/actionLinearEditor.d.ts +5 -2
- package/types/actions/actionMenu.d.ts +15 -6
- package/types/actions/actionProperties.d.ts +65 -26
- package/types/actions/actionStyles.d.ts +5 -2
- package/types/actions/actionToggleGridMode.d.ts +5 -2
- package/types/actions/actionToggleLock.d.ts +5 -2
- package/types/actions/actionToggleStats.d.ts +5 -2
- package/types/actions/actionToggleViewMode.d.ts +5 -2
- package/types/actions/actionToggleZenMode.d.ts +5 -2
- package/types/appState.d.ts +5 -2
- package/types/clipboard.d.ts +2 -2
- package/types/components/App.d.ts +10 -3
- package/types/components/Button.d.ts +3 -1
- package/types/components/DefaultSidebar.d.ts +30 -0
- package/types/components/LayerUI.d.ts +1 -8
- package/types/components/LibraryMenu.d.ts +29 -10
- package/types/components/LibraryMenuControlButtons.d.ts +9 -0
- package/types/components/LibraryMenuHeaderContent.d.ts +7 -26
- package/types/components/PasteChartDialog.d.ts +2 -3
- package/types/components/Sidebar/Sidebar.d.ts +68 -45
- package/types/components/Sidebar/SidebarHeader.d.ts +6 -19
- package/types/components/Sidebar/SidebarTab.d.ts +9 -0
- package/types/components/Sidebar/SidebarTabTrigger.d.ts +10 -0
- package/types/components/Sidebar/SidebarTabTriggers.d.ts +7 -0
- package/types/components/Sidebar/SidebarTabs.d.ts +7 -0
- package/types/components/Sidebar/SidebarTrigger.d.ts +6 -0
- package/types/components/Sidebar/common.d.ts +23 -6
- package/types/components/main-menu/MainMenu.d.ts +3 -1
- package/types/constants.d.ts +23 -6
- package/types/context/tunnels.d.ts +18 -0
- package/types/context/ui-appState.d.ts +4 -0
- package/types/data/blob.d.ts +2 -2
- package/types/data/filesystem.d.ts +2 -1
- package/types/data/types.d.ts +2 -4
- package/types/element/Hyperlink.d.ts +5 -2
- package/types/element/image.d.ts +11 -1
- package/types/element/linearElementEditor.d.ts +5 -2
- package/types/element/newElement.d.ts +6 -1
- package/types/element/textElement.d.ts +2 -2
- package/types/hooks/useOutsideClick.d.ts +1 -1
- package/types/packages/excalidraw/index.d.ts +1 -0
- package/types/types.d.ts +21 -11
- package/types/utils.d.ts +1 -1
- package/types/components/LibraryButton.d.ts +0 -8
- package/types/components/context/tunnels.d.ts +0 -16
- package/types/components/hoc/withUpstreamOverride.d.ts +0 -10
|
@@ -82,9 +82,12 @@ export declare const actionChangeFillStyle: {
|
|
|
82
82
|
}>;
|
|
83
83
|
openMenu: "canvas" | "shape" | null;
|
|
84
84
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
85
|
-
openSidebar:
|
|
85
|
+
openSidebar: {
|
|
86
|
+
name: string;
|
|
87
|
+
tab?: string | undefined;
|
|
88
|
+
} | null;
|
|
86
89
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
87
|
-
|
|
90
|
+
defaultSidebarDockedPreference: boolean;
|
|
88
91
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
89
92
|
selectedElementIds: {
|
|
90
93
|
[id: string]: boolean;
|
|
@@ -196,9 +199,12 @@ export declare const actionChangeStrokeWidth: {
|
|
|
196
199
|
}>;
|
|
197
200
|
openMenu: "canvas" | "shape" | null;
|
|
198
201
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
199
|
-
openSidebar:
|
|
202
|
+
openSidebar: {
|
|
203
|
+
name: string;
|
|
204
|
+
tab?: string | undefined;
|
|
205
|
+
} | null;
|
|
200
206
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
201
|
-
|
|
207
|
+
defaultSidebarDockedPreference: boolean;
|
|
202
208
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
203
209
|
selectedElementIds: {
|
|
204
210
|
[id: string]: boolean;
|
|
@@ -310,9 +316,12 @@ export declare const actionChangeSloppiness: {
|
|
|
310
316
|
}>;
|
|
311
317
|
openMenu: "canvas" | "shape" | null;
|
|
312
318
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
313
|
-
openSidebar:
|
|
319
|
+
openSidebar: {
|
|
320
|
+
name: string;
|
|
321
|
+
tab?: string | undefined;
|
|
322
|
+
} | null;
|
|
314
323
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
315
|
-
|
|
324
|
+
defaultSidebarDockedPreference: boolean;
|
|
316
325
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
317
326
|
selectedElementIds: {
|
|
318
327
|
[id: string]: boolean;
|
|
@@ -424,9 +433,12 @@ export declare const actionChangeStrokeStyle: {
|
|
|
424
433
|
}>;
|
|
425
434
|
openMenu: "canvas" | "shape" | null;
|
|
426
435
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
427
|
-
openSidebar:
|
|
436
|
+
openSidebar: {
|
|
437
|
+
name: string;
|
|
438
|
+
tab?: string | undefined;
|
|
439
|
+
} | null;
|
|
428
440
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
429
|
-
|
|
441
|
+
defaultSidebarDockedPreference: boolean;
|
|
430
442
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
431
443
|
selectedElementIds: {
|
|
432
444
|
[id: string]: boolean;
|
|
@@ -538,9 +550,12 @@ export declare const actionChangeOpacity: {
|
|
|
538
550
|
}>;
|
|
539
551
|
openMenu: "canvas" | "shape" | null;
|
|
540
552
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
541
|
-
openSidebar:
|
|
553
|
+
openSidebar: {
|
|
554
|
+
name: string;
|
|
555
|
+
tab?: string | undefined;
|
|
556
|
+
} | null;
|
|
542
557
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
543
|
-
|
|
558
|
+
defaultSidebarDockedPreference: boolean;
|
|
544
559
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
545
560
|
selectedElementIds: {
|
|
546
561
|
[id: string]: boolean;
|
|
@@ -652,9 +667,12 @@ export declare const actionChangeFontSize: {
|
|
|
652
667
|
}>;
|
|
653
668
|
openMenu: "canvas" | "shape" | null;
|
|
654
669
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
655
|
-
openSidebar:
|
|
670
|
+
openSidebar: {
|
|
671
|
+
name: string;
|
|
672
|
+
tab?: string | undefined;
|
|
673
|
+
} | null;
|
|
656
674
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
657
|
-
|
|
675
|
+
defaultSidebarDockedPreference: boolean;
|
|
658
676
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
659
677
|
selectedElementIds: {
|
|
660
678
|
[id: string]: boolean;
|
|
@@ -766,9 +784,12 @@ export declare const actionDecreaseFontSize: {
|
|
|
766
784
|
}>;
|
|
767
785
|
openMenu: "canvas" | "shape" | null;
|
|
768
786
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
769
|
-
openSidebar:
|
|
787
|
+
openSidebar: {
|
|
788
|
+
name: string;
|
|
789
|
+
tab?: string | undefined;
|
|
790
|
+
} | null;
|
|
770
791
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
771
|
-
|
|
792
|
+
defaultSidebarDockedPreference: boolean;
|
|
772
793
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
773
794
|
selectedElementIds: {
|
|
774
795
|
[id: string]: boolean;
|
|
@@ -880,9 +901,12 @@ export declare const actionIncreaseFontSize: {
|
|
|
880
901
|
}>;
|
|
881
902
|
openMenu: "canvas" | "shape" | null;
|
|
882
903
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
883
|
-
openSidebar:
|
|
904
|
+
openSidebar: {
|
|
905
|
+
name: string;
|
|
906
|
+
tab?: string | undefined;
|
|
907
|
+
} | null;
|
|
884
908
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
885
|
-
|
|
909
|
+
defaultSidebarDockedPreference: boolean;
|
|
886
910
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
887
911
|
selectedElementIds: {
|
|
888
912
|
[id: string]: boolean;
|
|
@@ -994,9 +1018,12 @@ export declare const actionChangeFontFamily: {
|
|
|
994
1018
|
}>;
|
|
995
1019
|
openMenu: "canvas" | "shape" | null;
|
|
996
1020
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
997
|
-
openSidebar:
|
|
1021
|
+
openSidebar: {
|
|
1022
|
+
name: string;
|
|
1023
|
+
tab?: string | undefined;
|
|
1024
|
+
} | null;
|
|
998
1025
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
999
|
-
|
|
1026
|
+
defaultSidebarDockedPreference: boolean;
|
|
1000
1027
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
1001
1028
|
selectedElementIds: {
|
|
1002
1029
|
[id: string]: boolean;
|
|
@@ -1108,9 +1135,12 @@ export declare const actionChangeTextAlign: {
|
|
|
1108
1135
|
}>;
|
|
1109
1136
|
openMenu: "canvas" | "shape" | null;
|
|
1110
1137
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
1111
|
-
openSidebar:
|
|
1138
|
+
openSidebar: {
|
|
1139
|
+
name: string;
|
|
1140
|
+
tab?: string | undefined;
|
|
1141
|
+
} | null;
|
|
1112
1142
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
1113
|
-
|
|
1143
|
+
defaultSidebarDockedPreference: boolean;
|
|
1114
1144
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
1115
1145
|
selectedElementIds: {
|
|
1116
1146
|
[id: string]: boolean;
|
|
@@ -1224,9 +1254,12 @@ export declare const actionChangeVerticalAlign: {
|
|
|
1224
1254
|
}>;
|
|
1225
1255
|
openMenu: "canvas" | "shape" | null;
|
|
1226
1256
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
1227
|
-
openSidebar:
|
|
1257
|
+
openSidebar: {
|
|
1258
|
+
name: string;
|
|
1259
|
+
tab?: string | undefined;
|
|
1260
|
+
} | null;
|
|
1228
1261
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
1229
|
-
|
|
1262
|
+
defaultSidebarDockedPreference: boolean;
|
|
1230
1263
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
1231
1264
|
selectedElementIds: {
|
|
1232
1265
|
[id: string]: boolean;
|
|
@@ -1338,9 +1371,12 @@ export declare const actionChangeRoundness: {
|
|
|
1338
1371
|
}>;
|
|
1339
1372
|
openMenu: "canvas" | "shape" | null;
|
|
1340
1373
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
1341
|
-
openSidebar:
|
|
1374
|
+
openSidebar: {
|
|
1375
|
+
name: string;
|
|
1376
|
+
tab?: string | undefined;
|
|
1377
|
+
} | null;
|
|
1342
1378
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
1343
|
-
|
|
1379
|
+
defaultSidebarDockedPreference: boolean;
|
|
1344
1380
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
1345
1381
|
selectedElementIds: {
|
|
1346
1382
|
[id: string]: boolean;
|
|
@@ -1455,9 +1491,12 @@ export declare const actionChangeArrowhead: {
|
|
|
1455
1491
|
}>;
|
|
1456
1492
|
openMenu: "canvas" | "shape" | null;
|
|
1457
1493
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
1458
|
-
openSidebar:
|
|
1494
|
+
openSidebar: {
|
|
1495
|
+
name: string;
|
|
1496
|
+
tab?: string | undefined;
|
|
1497
|
+
} | null;
|
|
1459
1498
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
1460
|
-
|
|
1499
|
+
defaultSidebarDockedPreference: boolean;
|
|
1461
1500
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
1462
1501
|
selectedElementIds: {
|
|
1463
1502
|
[id: string]: boolean;
|
|
@@ -69,9 +69,12 @@ export declare const actionCopyStyles: {
|
|
|
69
69
|
}>;
|
|
70
70
|
openMenu: "canvas" | "shape" | null;
|
|
71
71
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
72
|
-
openSidebar:
|
|
72
|
+
openSidebar: {
|
|
73
|
+
name: string;
|
|
74
|
+
tab?: string | undefined;
|
|
75
|
+
} | null;
|
|
73
76
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
74
|
-
|
|
77
|
+
defaultSidebarDockedPreference: boolean;
|
|
75
78
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
76
79
|
selectedElementIds: {
|
|
77
80
|
[id: string]: boolean;
|
|
@@ -69,9 +69,12 @@ export declare const actionToggleGridMode: {
|
|
|
69
69
|
}>;
|
|
70
70
|
openMenu: "canvas" | "shape" | null;
|
|
71
71
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
72
|
-
openSidebar:
|
|
72
|
+
openSidebar: {
|
|
73
|
+
name: string;
|
|
74
|
+
tab?: string | undefined;
|
|
75
|
+
} | null;
|
|
73
76
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
74
|
-
|
|
77
|
+
defaultSidebarDockedPreference: boolean;
|
|
75
78
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
76
79
|
selectedElementIds: {
|
|
77
80
|
[id: string]: boolean;
|
|
@@ -68,9 +68,12 @@ export declare const actionToggleLock: {
|
|
|
68
68
|
}>;
|
|
69
69
|
openMenu: "canvas" | "shape" | null;
|
|
70
70
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
71
|
-
openSidebar:
|
|
71
|
+
openSidebar: {
|
|
72
|
+
name: string;
|
|
73
|
+
tab?: string | undefined;
|
|
74
|
+
} | null;
|
|
72
75
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
73
|
-
|
|
76
|
+
defaultSidebarDockedPreference: boolean;
|
|
74
77
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
75
78
|
selectedElementIds: {
|
|
76
79
|
[id: string]: boolean;
|
|
@@ -67,9 +67,12 @@ export declare const actionToggleStats: {
|
|
|
67
67
|
}>;
|
|
68
68
|
openMenu: "canvas" | "shape" | null;
|
|
69
69
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
70
|
-
openSidebar:
|
|
70
|
+
openSidebar: {
|
|
71
|
+
name: string;
|
|
72
|
+
tab?: string | undefined;
|
|
73
|
+
} | null;
|
|
71
74
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
72
|
-
|
|
75
|
+
defaultSidebarDockedPreference: boolean;
|
|
73
76
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
74
77
|
selectedElementIds: {
|
|
75
78
|
[id: string]: boolean;
|
|
@@ -68,9 +68,12 @@ export declare const actionToggleViewMode: {
|
|
|
68
68
|
}>;
|
|
69
69
|
openMenu: "canvas" | "shape" | null;
|
|
70
70
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
71
|
-
openSidebar:
|
|
71
|
+
openSidebar: {
|
|
72
|
+
name: string;
|
|
73
|
+
tab?: string | undefined;
|
|
74
|
+
} | null;
|
|
72
75
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
73
|
-
|
|
76
|
+
defaultSidebarDockedPreference: boolean;
|
|
74
77
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
75
78
|
selectedElementIds: {
|
|
76
79
|
[id: string]: boolean;
|
|
@@ -68,9 +68,12 @@ export declare const actionToggleZenMode: {
|
|
|
68
68
|
}>;
|
|
69
69
|
openMenu: "canvas" | "shape" | null;
|
|
70
70
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
71
|
-
openSidebar:
|
|
71
|
+
openSidebar: {
|
|
72
|
+
name: string;
|
|
73
|
+
tab?: string | undefined;
|
|
74
|
+
} | null;
|
|
72
75
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
73
|
-
|
|
76
|
+
defaultSidebarDockedPreference: boolean;
|
|
74
77
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
75
78
|
selectedElementIds: {
|
|
76
79
|
[id: string]: boolean;
|
package/types/appState.d.ts
CHANGED
|
@@ -42,8 +42,11 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
42
42
|
value: NormalizedZoomValue;
|
|
43
43
|
}> | undefined;
|
|
44
44
|
openMenu?: "canvas" | "shape" | null | undefined;
|
|
45
|
-
openSidebar?:
|
|
46
|
-
|
|
45
|
+
openSidebar?: {
|
|
46
|
+
name: string;
|
|
47
|
+
tab?: string | undefined;
|
|
48
|
+
} | null | undefined;
|
|
49
|
+
defaultSidebarDockedPreference?: boolean | undefined;
|
|
47
50
|
lastPointerDownWith?: import("./element/types").PointerType | undefined;
|
|
48
51
|
selectedElementIds?: {
|
|
49
52
|
[id: string]: boolean;
|
package/types/clipboard.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExcalidrawElement, NonDeletedExcalidrawElement } from "./element/types";
|
|
2
|
-
import {
|
|
2
|
+
import { BinaryFiles } from "./types";
|
|
3
3
|
import { Spreadsheet } from "./charts";
|
|
4
4
|
export interface ClipboardData {
|
|
5
5
|
spreadsheet?: Spreadsheet;
|
|
@@ -11,7 +11,7 @@ export interface ClipboardData {
|
|
|
11
11
|
export declare const probablySupportsClipboardReadText: boolean;
|
|
12
12
|
export declare const probablySupportsClipboardWriteText: boolean;
|
|
13
13
|
export declare const probablySupportsClipboardBlob: boolean;
|
|
14
|
-
export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawElement[],
|
|
14
|
+
export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawElement[], files: BinaryFiles | null) => Promise<string | undefined>;
|
|
15
15
|
/**
|
|
16
16
|
* Retrieves content from system clipboard (either from ClipboardEvent or
|
|
17
17
|
* via async clipboard API if supported)
|
|
@@ -5,12 +5,14 @@ import { LinearElementEditor } from "../element/linearElementEditor";
|
|
|
5
5
|
import { ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
|
|
6
6
|
import History from "../history";
|
|
7
7
|
import Scene from "../scene/Scene";
|
|
8
|
-
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device } from "../types";
|
|
8
|
+
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, SidebarName, SidebarTabName } from "../types";
|
|
9
9
|
import { FileSystemHandle } from "../data/filesystem";
|
|
10
10
|
export declare const ExcalidrawContainerContext: React.Context<{
|
|
11
11
|
container: HTMLDivElement | null;
|
|
12
12
|
id: string | null;
|
|
13
13
|
}>;
|
|
14
|
+
export declare const useApp: () => AppClassProperties;
|
|
15
|
+
export declare const useAppProps: () => AppProps;
|
|
14
16
|
export declare const useDevice: () => Readonly<{
|
|
15
17
|
isSmScreen: boolean;
|
|
16
18
|
isMobile: boolean;
|
|
@@ -40,7 +42,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
40
42
|
private nearestScrollableContainer;
|
|
41
43
|
library: AppClassProperties["library"];
|
|
42
44
|
libraryItemsFromStorage: LibraryItems | undefined;
|
|
43
|
-
|
|
45
|
+
id: string;
|
|
44
46
|
private history;
|
|
45
47
|
private excalidrawContainerValue;
|
|
46
48
|
files: BinaryFiles;
|
|
@@ -58,6 +60,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
58
60
|
focusContainer: AppClassProperties["focusContainer"];
|
|
59
61
|
getSceneElementsIncludingDeleted: () => readonly ExcalidrawElement[];
|
|
60
62
|
getSceneElements: () => readonly NonDeletedExcalidrawElement[];
|
|
63
|
+
onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
61
64
|
private syncActionResult;
|
|
62
65
|
private onBlur;
|
|
63
66
|
private onUnload;
|
|
@@ -123,7 +126,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
123
126
|
/**
|
|
124
127
|
* @returns whether the menu was toggled on or off
|
|
125
128
|
*/
|
|
126
|
-
|
|
129
|
+
toggleSidebar: ({ name, tab, force, }: {
|
|
130
|
+
name: SidebarName;
|
|
131
|
+
tab?: string | undefined;
|
|
132
|
+
force?: boolean | undefined;
|
|
133
|
+
}) => boolean;
|
|
127
134
|
private updateCurrentCursorPosition;
|
|
128
135
|
private onKeyDown;
|
|
129
136
|
private onWheel;
|
|
@@ -3,6 +3,8 @@ import "./Button.scss";
|
|
|
3
3
|
interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
4
4
|
type?: "button" | "submit" | "reset";
|
|
5
5
|
onSelect: () => any;
|
|
6
|
+
/** whether button is in active state */
|
|
7
|
+
selected?: boolean;
|
|
6
8
|
children: React.ReactNode;
|
|
7
9
|
className?: string;
|
|
8
10
|
}
|
|
@@ -11,5 +13,5 @@ interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
11
13
|
* Style can be customised using `className` or `style` prop.
|
|
12
14
|
* Accepts all props that a regular `button` element accepts.
|
|
13
15
|
*/
|
|
14
|
-
export declare const Button: ({ type, onSelect, children, className, ...rest }: ButtonProps) => JSX.Element;
|
|
16
|
+
export declare const Button: ({ type, onSelect, selected, children, className, ...rest }: ButtonProps) => JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MarkOptional } from "../utility-types";
|
|
3
|
+
import { SidebarProps, SidebarTriggerProps } from "./Sidebar/common";
|
|
4
|
+
export declare const DefaultSidebar: import("react").FC<Omit<MarkOptional<Omit<{
|
|
5
|
+
name: string;
|
|
6
|
+
children: import("react").ReactNode;
|
|
7
|
+
onStateChange?: ((state: {
|
|
8
|
+
name: string;
|
|
9
|
+
tab?: string | undefined;
|
|
10
|
+
} | null) => void) | undefined;
|
|
11
|
+
onDock?: ((docked: boolean) => void) | undefined;
|
|
12
|
+
docked?: boolean | undefined;
|
|
13
|
+
className?: string | undefined;
|
|
14
|
+
__fallback?: boolean | undefined;
|
|
15
|
+
}, "name">, "children">, "onDock"> & {
|
|
16
|
+
/** pass `false` to disable docking */
|
|
17
|
+
onDock?: SidebarProps["onDock"] | false;
|
|
18
|
+
} & {
|
|
19
|
+
__fallback?: boolean | undefined;
|
|
20
|
+
}> & {
|
|
21
|
+
Trigger: import("react").FC<Omit<SidebarTriggerProps, "name"> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
22
|
+
__fallback?: boolean | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
TabTriggers: {
|
|
25
|
+
({ children, ...rest }: {
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
} & import("react").HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -3,7 +3,6 @@ import { ActionManager } from "../actions/manager";
|
|
|
3
3
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
4
4
|
import { Language } from "../i18n";
|
|
5
5
|
import { AppProps, AppState, ExcalidrawProps, BinaryFiles } from "../types";
|
|
6
|
-
import Library from "../data/library";
|
|
7
6
|
import "./LayerUI.scss";
|
|
8
7
|
import "./Toolbar.scss";
|
|
9
8
|
interface LayerUIProps {
|
|
@@ -16,22 +15,16 @@ interface LayerUIProps {
|
|
|
16
15
|
onLockToggle: () => void;
|
|
17
16
|
onHandToolToggle: () => void;
|
|
18
17
|
onPenModeToggle: () => void;
|
|
19
|
-
onInsertElements: (elements: readonly NonDeletedExcalidrawElement[]) => void;
|
|
20
18
|
showExitZenModeBtn: boolean;
|
|
21
19
|
langCode: Language["code"];
|
|
22
20
|
renderTopRightUI?: ExcalidrawProps["renderTopRightUI"];
|
|
23
21
|
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
24
|
-
renderCustomSidebar?: ExcalidrawProps["renderSidebar"];
|
|
25
|
-
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
26
22
|
UIOptions: AppProps["UIOptions"];
|
|
27
|
-
focusContainer: () => void;
|
|
28
|
-
library: Library;
|
|
29
|
-
id: string;
|
|
30
23
|
onImageAction: (data: {
|
|
31
24
|
insertOnCanvasDirectly: boolean;
|
|
32
25
|
}) => void;
|
|
33
26
|
renderWelcomeScreen: boolean;
|
|
34
27
|
children?: React.ReactNode;
|
|
35
28
|
}
|
|
36
|
-
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle,
|
|
29
|
+
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onImageAction, renderWelcomeScreen, children, }: LayerUIProps) => JSX.Element>;
|
|
37
30
|
export default _default;
|
|
@@ -1,8 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import Library from "../data/library";
|
|
3
3
|
import { LibraryItems, LibraryItem, AppState, ExcalidrawProps } from "../types";
|
|
4
4
|
import "./LibraryMenu.scss";
|
|
5
|
-
|
|
5
|
+
export declare const isLibraryMenuOpenAtom: import("jotai").Atom<boolean> & {
|
|
6
|
+
write: (get: {
|
|
7
|
+
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
8
|
+
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
9
|
+
<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;
|
|
10
|
+
} & {
|
|
11
|
+
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
12
|
+
unstable_promise: true;
|
|
13
|
+
}): Value_3 | Promise<Value_3>;
|
|
14
|
+
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
15
|
+
unstable_promise: true;
|
|
16
|
+
}): Value_4 | Promise<Value_4>;
|
|
17
|
+
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
18
|
+
unstable_promise: true;
|
|
19
|
+
}): (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>;
|
|
20
|
+
}, set: {
|
|
21
|
+
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
22
|
+
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
23
|
+
}, update: boolean | ((prev: boolean) => boolean)) => void;
|
|
24
|
+
onMount?: (<S extends (update: boolean | ((prev: boolean) => boolean)) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
25
|
+
} & {
|
|
26
|
+
init: boolean;
|
|
27
|
+
};
|
|
6
28
|
export declare const LibraryMenuContent: ({ onInsertLibraryItems, pendingElements, onAddToLibrary, setAppState, libraryReturnUrl, library, id, appState, selectedItems, onSelectItems, }: {
|
|
7
29
|
pendingElements: LibraryItem["elements"];
|
|
8
30
|
onInsertLibraryItems: (libraryItems: LibraryItems) => void;
|
|
@@ -15,11 +37,8 @@ export declare const LibraryMenuContent: ({ onInsertLibraryItems, pendingElement
|
|
|
15
37
|
selectedItems: LibraryItem["id"][];
|
|
16
38
|
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
17
39
|
}) => JSX.Element;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
library: Library;
|
|
24
|
-
id: string;
|
|
25
|
-
}>;
|
|
40
|
+
/**
|
|
41
|
+
* This component is meant to be rendered inside <Sidebar.Tab/> inside our
|
|
42
|
+
* <DefaultSidebar/> or host apps Sidebar components.
|
|
43
|
+
*/
|
|
44
|
+
export declare const LibraryMenu: () => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LibraryItem, ExcalidrawProps, AppState } from "../types";
|
|
2
|
+
export declare const LibraryMenuControlButtons: ({ selectedItems, onSelectItems, libraryReturnUrl, theme, id, style, }: {
|
|
3
|
+
selectedItems: LibraryItem["id"][];
|
|
4
|
+
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
5
|
+
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
6
|
+
theme: AppState["theme"];
|
|
7
|
+
id: string;
|
|
8
|
+
style: React.CSSProperties;
|
|
9
|
+
}) => JSX.Element;
|
|
@@ -1,30 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import Library from "../data/library";
|
|
1
|
+
/// <reference types="react" />
|
|
3
2
|
import { AppState, LibraryItem } from "../types";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
7
|
-
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
8
|
-
<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;
|
|
9
|
-
} & {
|
|
10
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
11
|
-
unstable_promise: true;
|
|
12
|
-
}): Value_3 | Promise<Value_3>;
|
|
13
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
14
|
-
unstable_promise: true;
|
|
15
|
-
}): Value_4 | Promise<Value_4>;
|
|
16
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
17
|
-
unstable_promise: true;
|
|
18
|
-
}): (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>;
|
|
19
|
-
}, set: {
|
|
20
|
-
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
21
|
-
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
22
|
-
}, update: boolean | ((prev: boolean) => boolean)) => void;
|
|
23
|
-
onMount?: (<S extends (update: boolean | ((prev: boolean) => boolean)) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
24
|
-
} & {
|
|
25
|
-
init: boolean;
|
|
26
|
-
};
|
|
27
|
-
export declare const LibraryMenuHeader: React.FC<{
|
|
3
|
+
import Library from "../data/library";
|
|
4
|
+
export declare const LibraryDropdownMenuButton: React.FC<{
|
|
28
5
|
setAppState: React.Component<any, AppState>["setState"];
|
|
29
6
|
selectedItems: LibraryItem["id"][];
|
|
30
7
|
library: Library;
|
|
@@ -33,3 +10,7 @@ export declare const LibraryMenuHeader: React.FC<{
|
|
|
33
10
|
onSelectItems: (items: LibraryItem["id"][]) => void;
|
|
34
11
|
appState: AppState;
|
|
35
12
|
}>;
|
|
13
|
+
export declare const LibraryDropdownMenu: ({ selectedItems, onSelectItems, }: {
|
|
14
|
+
selectedItems: LibraryItem["id"][];
|
|
15
|
+
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
16
|
+
}) => JSX.Element;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AppState
|
|
2
|
+
import { AppState } from "../types";
|
|
3
3
|
import "./PasteChartDialog.scss";
|
|
4
|
-
export declare const PasteChartDialog: ({ setAppState, appState, onClose,
|
|
4
|
+
export declare const PasteChartDialog: ({ setAppState, appState, onClose, }: {
|
|
5
5
|
appState: AppState;
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
setAppState: React.Component<any, AppState>["setState"];
|
|
8
|
-
onInsertChart: (elements: LibraryItem["elements"]) => void;
|
|
9
8
|
}) => JSX.Element;
|