@zsviczian/excalidraw 0.13.0-obsidian-2 → 0.14.1-obsidian
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/README.md +417 -19
- package/dist/excalidraw.development.js +581 -1153
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +0 -102
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +39 -18
- package/types/actions/actionAlign.d.ts +6 -18
- package/types/actions/actionBoundText.d.ts +15 -8
- package/types/actions/actionCanvas.d.ts +246 -76
- package/types/actions/actionClipboard.d.ts +84 -31
- package/types/actions/actionDeleteSelected.d.ts +40 -21
- package/types/actions/actionDistribute.d.ts +2 -6
- package/types/actions/actionDuplicateSelection.d.ts +1 -3
- package/types/actions/actionExport.d.ts +125 -78
- package/types/actions/actionFinalize.d.ts +27 -15
- package/types/actions/actionFlip.d.ts +2 -2
- package/types/actions/actionGroup.d.ts +4 -8
- package/types/actions/actionLinearEditor.d.ts +14 -7
- package/types/actions/actionMenu.d.ts +40 -26
- package/types/actions/actionNavigate.d.ts +1 -3
- package/types/actions/actionProperties.d.ts +182 -117
- package/types/actions/actionStyles.d.ts +13 -6
- package/types/actions/actionToggleGridMode.d.ts +14 -6
- package/types/actions/actionToggleLock.d.ts +13 -6
- package/types/actions/actionToggleStats.d.ts +13 -6
- package/types/actions/actionToggleViewMode.d.ts +14 -6
- package/types/actions/actionToggleZenMode.d.ts +14 -6
- package/types/actions/actionZindex.d.ts +4 -12
- package/types/actions/manager.d.ts +2 -1
- package/types/actions/types.d.ts +3 -5
- package/types/appState.d.ts +8 -6
- package/types/components/ActiveConfirmDialog.d.ts +24 -0
- package/types/components/App.d.ts +8 -50
- package/types/components/Button.d.ts +15 -0
- package/types/components/CollabButton.d.ts +1 -2
- package/types/components/ContextMenu.d.ts +8 -20
- package/types/components/HandButton.d.ts +10 -0
- package/types/components/JSONExportDialog.d.ts +3 -1
- package/types/components/LayerUI.d.ts +3 -3
- package/types/components/LibraryMenuHeaderContent.d.ts +23 -0
- package/types/components/LockButton.d.ts +0 -1
- package/types/components/MobileMenu.d.ts +5 -6
- package/types/components/ToolButton.d.ts +1 -1
- package/types/components/UserList.d.ts +0 -2
- package/types/components/dropdownMenu/DropdownMenu.d.ts +66 -0
- package/types/components/dropdownMenu/DropdownMenuContent.d.ts +15 -0
- package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +12 -0
- package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +13 -0
- package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +9 -0
- package/types/components/dropdownMenu/common.d.ts +6 -0
- package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
- package/types/components/footer/Footer.d.ts +13 -0
- package/types/components/footer/FooterCenter.d.ts +8 -0
- package/types/components/icons.d.ts +2 -1
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +10 -0
- package/types/components/main-menu/DefaultItems.d.ts +44 -0
- package/types/components/main-menu/MainMenu.d.ts +60 -0
- package/types/components/mainMenu/DefaultItems.d.ts +44 -0
- package/types/components/mainMenu/MainMenu.d.ts +63 -0
- package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +58 -0
- package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
- package/types/components/welcome-screen/WelcomeScreen.d.ts +85 -0
- package/types/constants.d.ts +6 -4
- package/types/element/Hyperlink.d.ts +15 -10
- package/types/element/linearElementEditor.d.ts +14 -6
- package/types/element/textElement.d.ts +7 -0
- package/types/element/textWysiwyg.d.ts +6 -1
- package/types/excalidraw-app/data/index.d.ts +5 -0
- package/types/excalidraw-app/data/localStorage.d.ts +5 -0
- package/types/keys.d.ts +2 -3
- package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
- package/types/packages/excalidraw/index.d.ts +10 -0
- package/types/renderer/easingFunctions.d.ts +6 -0
- package/types/types.d.ts +54 -26
- package/types/utils.d.ts +23 -3
|
@@ -10,6 +10,11 @@ export declare const actionCopyStyles: {
|
|
|
10
10
|
toast: {
|
|
11
11
|
message: string;
|
|
12
12
|
};
|
|
13
|
+
contextMenu: {
|
|
14
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
15
|
+
top: number;
|
|
16
|
+
left: number;
|
|
17
|
+
} | null;
|
|
13
18
|
showWelcomeScreen: boolean;
|
|
14
19
|
isLoading: boolean;
|
|
15
20
|
errorMessage: string | null;
|
|
@@ -23,16 +28,15 @@ export declare const actionCopyStyles: {
|
|
|
23
28
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
24
29
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
25
30
|
activeTool: {
|
|
26
|
-
|
|
27
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
31
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
28
32
|
locked: boolean;
|
|
33
|
+
} & ({
|
|
34
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
29
35
|
customType: null;
|
|
30
36
|
} | {
|
|
31
37
|
type: "custom";
|
|
32
38
|
customType: string;
|
|
33
|
-
|
|
34
|
-
locked: boolean;
|
|
35
|
-
};
|
|
39
|
+
});
|
|
36
40
|
penMode: boolean;
|
|
37
41
|
penDetected: boolean;
|
|
38
42
|
exportBackground: boolean;
|
|
@@ -66,7 +70,7 @@ export declare const actionCopyStyles: {
|
|
|
66
70
|
openMenu: "canvas" | "shape" | null;
|
|
67
71
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
68
72
|
openSidebar: "library" | "customSidebar" | null;
|
|
69
|
-
openDialog: "imageExport" | "help" | null;
|
|
73
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
70
74
|
isSidebarDocked: boolean;
|
|
71
75
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
72
76
|
selectedElementIds: {
|
|
@@ -79,6 +83,7 @@ export declare const actionCopyStyles: {
|
|
|
79
83
|
zenModeEnabled: boolean;
|
|
80
84
|
theme: string;
|
|
81
85
|
gridSize: number | null;
|
|
86
|
+
previousGridSize: number | null;
|
|
82
87
|
viewModeEnabled: boolean;
|
|
83
88
|
selectedGroupIds: {
|
|
84
89
|
[groupId: string]: boolean;
|
|
@@ -108,6 +113,8 @@ export declare const actionCopyStyles: {
|
|
|
108
113
|
elementBackground?: string[] | undefined;
|
|
109
114
|
elementStroke?: string[] | undefined;
|
|
110
115
|
};
|
|
116
|
+
allowWheelZoom?: boolean | undefined;
|
|
117
|
+
allowPinchZoom?: boolean | undefined;
|
|
111
118
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
112
119
|
};
|
|
113
120
|
commitToHistory: false;
|
|
@@ -10,6 +10,11 @@ export declare const actionToggleGridMode: {
|
|
|
10
10
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<AppState>): {
|
|
11
11
|
appState: {
|
|
12
12
|
gridSize: number | null;
|
|
13
|
+
contextMenu: {
|
|
14
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
15
|
+
top: number;
|
|
16
|
+
left: number;
|
|
17
|
+
} | null;
|
|
13
18
|
showWelcomeScreen: boolean;
|
|
14
19
|
isLoading: boolean;
|
|
15
20
|
errorMessage: string | null;
|
|
@@ -23,16 +28,15 @@ export declare const actionToggleGridMode: {
|
|
|
23
28
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
24
29
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
25
30
|
activeTool: {
|
|
26
|
-
|
|
27
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
31
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
28
32
|
locked: boolean;
|
|
33
|
+
} & ({
|
|
34
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
29
35
|
customType: null;
|
|
30
36
|
} | {
|
|
31
37
|
type: "custom";
|
|
32
38
|
customType: string;
|
|
33
|
-
|
|
34
|
-
locked: boolean;
|
|
35
|
-
};
|
|
39
|
+
});
|
|
36
40
|
penMode: boolean;
|
|
37
41
|
penDetected: boolean;
|
|
38
42
|
exportBackground: boolean;
|
|
@@ -66,7 +70,7 @@ export declare const actionToggleGridMode: {
|
|
|
66
70
|
openMenu: "canvas" | "shape" | null;
|
|
67
71
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
68
72
|
openSidebar: "library" | "customSidebar" | null;
|
|
69
|
-
openDialog: "imageExport" | "help" | null;
|
|
73
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
70
74
|
isSidebarDocked: boolean;
|
|
71
75
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
72
76
|
selectedElementIds: {
|
|
@@ -83,6 +87,7 @@ export declare const actionToggleGridMode: {
|
|
|
83
87
|
} | null;
|
|
84
88
|
zenModeEnabled: boolean;
|
|
85
89
|
theme: string;
|
|
90
|
+
previousGridSize: number | null;
|
|
86
91
|
viewModeEnabled: boolean;
|
|
87
92
|
selectedGroupIds: {
|
|
88
93
|
[groupId: string]: boolean;
|
|
@@ -112,11 +117,14 @@ export declare const actionToggleGridMode: {
|
|
|
112
117
|
elementBackground?: string[] | undefined;
|
|
113
118
|
elementStroke?: string[] | undefined;
|
|
114
119
|
};
|
|
120
|
+
allowWheelZoom?: boolean | undefined;
|
|
121
|
+
allowPinchZoom?: boolean | undefined;
|
|
115
122
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
116
123
|
};
|
|
117
124
|
commitToHistory: false;
|
|
118
125
|
};
|
|
119
126
|
checked: (appState: AppState) => boolean;
|
|
127
|
+
predicate: (element: readonly import("../element/types").ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps) => boolean;
|
|
120
128
|
contextItemLabel: string;
|
|
121
129
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
122
130
|
} & {
|
|
@@ -9,6 +9,11 @@ export declare const actionToggleLock: {
|
|
|
9
9
|
elements: ExcalidrawElement[];
|
|
10
10
|
appState: {
|
|
11
11
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
12
|
+
contextMenu: {
|
|
13
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
14
|
+
top: number;
|
|
15
|
+
left: number;
|
|
16
|
+
} | null;
|
|
12
17
|
showWelcomeScreen: boolean;
|
|
13
18
|
isLoading: boolean;
|
|
14
19
|
errorMessage: string | null;
|
|
@@ -22,16 +27,15 @@ export declare const actionToggleLock: {
|
|
|
22
27
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
23
28
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
24
29
|
activeTool: {
|
|
25
|
-
|
|
26
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
30
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
27
31
|
locked: boolean;
|
|
32
|
+
} & ({
|
|
33
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
28
34
|
customType: null;
|
|
29
35
|
} | {
|
|
30
36
|
type: "custom";
|
|
31
37
|
customType: string;
|
|
32
|
-
|
|
33
|
-
locked: boolean;
|
|
34
|
-
};
|
|
38
|
+
});
|
|
35
39
|
penMode: boolean;
|
|
36
40
|
penDetected: boolean;
|
|
37
41
|
exportBackground: boolean;
|
|
@@ -65,7 +69,7 @@ export declare const actionToggleLock: {
|
|
|
65
69
|
openMenu: "canvas" | "shape" | null;
|
|
66
70
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
67
71
|
openSidebar: "library" | "customSidebar" | null;
|
|
68
|
-
openDialog: "imageExport" | "help" | null;
|
|
72
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
69
73
|
isSidebarDocked: boolean;
|
|
70
74
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
71
75
|
selectedElementIds: {
|
|
@@ -83,6 +87,7 @@ export declare const actionToggleLock: {
|
|
|
83
87
|
zenModeEnabled: boolean;
|
|
84
88
|
theme: string;
|
|
85
89
|
gridSize: number | null;
|
|
90
|
+
previousGridSize: number | null;
|
|
86
91
|
viewModeEnabled: boolean;
|
|
87
92
|
selectedGroupIds: {
|
|
88
93
|
[groupId: string]: boolean;
|
|
@@ -112,6 +117,8 @@ export declare const actionToggleLock: {
|
|
|
112
117
|
elementBackground?: string[] | undefined;
|
|
113
118
|
elementStroke?: string[] | undefined;
|
|
114
119
|
};
|
|
120
|
+
allowWheelZoom?: boolean | undefined;
|
|
121
|
+
allowPinchZoom?: boolean | undefined;
|
|
115
122
|
};
|
|
116
123
|
commitToHistory: true;
|
|
117
124
|
};
|
|
@@ -8,6 +8,11 @@ export declare const actionToggleStats: {
|
|
|
8
8
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
9
9
|
appState: {
|
|
10
10
|
showStats: boolean;
|
|
11
|
+
contextMenu: {
|
|
12
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
13
|
+
top: number;
|
|
14
|
+
left: number;
|
|
15
|
+
} | null;
|
|
11
16
|
showWelcomeScreen: boolean;
|
|
12
17
|
isLoading: boolean;
|
|
13
18
|
errorMessage: string | null;
|
|
@@ -21,16 +26,15 @@ export declare const actionToggleStats: {
|
|
|
21
26
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
22
27
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
23
28
|
activeTool: {
|
|
24
|
-
|
|
25
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
29
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
26
30
|
locked: boolean;
|
|
31
|
+
} & ({
|
|
32
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
27
33
|
customType: null;
|
|
28
34
|
} | {
|
|
29
35
|
type: "custom";
|
|
30
36
|
customType: string;
|
|
31
|
-
|
|
32
|
-
locked: boolean;
|
|
33
|
-
};
|
|
37
|
+
});
|
|
34
38
|
penMode: boolean;
|
|
35
39
|
penDetected: boolean;
|
|
36
40
|
exportBackground: boolean;
|
|
@@ -64,7 +68,7 @@ export declare const actionToggleStats: {
|
|
|
64
68
|
openMenu: "canvas" | "shape" | null;
|
|
65
69
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
66
70
|
openSidebar: "library" | "customSidebar" | null;
|
|
67
|
-
openDialog: "imageExport" | "help" | null;
|
|
71
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
68
72
|
isSidebarDocked: boolean;
|
|
69
73
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
70
74
|
selectedElementIds: {
|
|
@@ -82,6 +86,7 @@ export declare const actionToggleStats: {
|
|
|
82
86
|
zenModeEnabled: boolean;
|
|
83
87
|
theme: string;
|
|
84
88
|
gridSize: number | null;
|
|
89
|
+
previousGridSize: number | null;
|
|
85
90
|
viewModeEnabled: boolean;
|
|
86
91
|
selectedGroupIds: {
|
|
87
92
|
[groupId: string]: boolean;
|
|
@@ -110,6 +115,8 @@ export declare const actionToggleStats: {
|
|
|
110
115
|
elementBackground?: string[] | undefined;
|
|
111
116
|
elementStroke?: string[] | undefined;
|
|
112
117
|
};
|
|
118
|
+
allowWheelZoom?: boolean | undefined;
|
|
119
|
+
allowPinchZoom?: boolean | undefined;
|
|
113
120
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
114
121
|
};
|
|
115
122
|
commitToHistory: false;
|
|
@@ -9,6 +9,11 @@ export declare const actionToggleViewMode: {
|
|
|
9
9
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: any, app: import("../types").AppClassProperties): {
|
|
10
10
|
appState: {
|
|
11
11
|
viewModeEnabled: boolean;
|
|
12
|
+
contextMenu: {
|
|
13
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
14
|
+
top: number;
|
|
15
|
+
left: number;
|
|
16
|
+
} | null;
|
|
12
17
|
showWelcomeScreen: boolean;
|
|
13
18
|
isLoading: boolean;
|
|
14
19
|
errorMessage: string | null;
|
|
@@ -22,16 +27,15 @@ export declare const actionToggleViewMode: {
|
|
|
22
27
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
23
28
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
24
29
|
activeTool: {
|
|
25
|
-
|
|
26
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
30
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
27
31
|
locked: boolean;
|
|
32
|
+
} & ({
|
|
33
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
28
34
|
customType: null;
|
|
29
35
|
} | {
|
|
30
36
|
type: "custom";
|
|
31
37
|
customType: string;
|
|
32
|
-
|
|
33
|
-
locked: boolean;
|
|
34
|
-
};
|
|
38
|
+
});
|
|
35
39
|
penMode: boolean;
|
|
36
40
|
penDetected: boolean;
|
|
37
41
|
exportBackground: boolean;
|
|
@@ -65,7 +69,7 @@ export declare const actionToggleViewMode: {
|
|
|
65
69
|
openMenu: "canvas" | "shape" | null;
|
|
66
70
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
67
71
|
openSidebar: "library" | "customSidebar" | null;
|
|
68
|
-
openDialog: "imageExport" | "help" | null;
|
|
72
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
69
73
|
isSidebarDocked: boolean;
|
|
70
74
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
71
75
|
selectedElementIds: {
|
|
@@ -83,6 +87,7 @@ export declare const actionToggleViewMode: {
|
|
|
83
87
|
zenModeEnabled: boolean;
|
|
84
88
|
theme: string;
|
|
85
89
|
gridSize: number | null;
|
|
90
|
+
previousGridSize: number | null;
|
|
86
91
|
selectedGroupIds: {
|
|
87
92
|
[groupId: string]: boolean;
|
|
88
93
|
};
|
|
@@ -111,11 +116,14 @@ export declare const actionToggleViewMode: {
|
|
|
111
116
|
elementBackground?: string[] | undefined;
|
|
112
117
|
elementStroke?: string[] | undefined;
|
|
113
118
|
};
|
|
119
|
+
allowWheelZoom?: boolean | undefined;
|
|
120
|
+
allowPinchZoom?: boolean | undefined;
|
|
114
121
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
115
122
|
};
|
|
116
123
|
commitToHistory: false;
|
|
117
124
|
};
|
|
118
125
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
126
|
+
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
119
127
|
contextItemLabel: string;
|
|
120
128
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
121
129
|
} & {
|
|
@@ -9,6 +9,11 @@ export declare const actionToggleZenMode: {
|
|
|
9
9
|
perform(elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
10
10
|
appState: {
|
|
11
11
|
zenModeEnabled: boolean;
|
|
12
|
+
contextMenu: {
|
|
13
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
14
|
+
top: number;
|
|
15
|
+
left: number;
|
|
16
|
+
} | null;
|
|
12
17
|
showWelcomeScreen: boolean;
|
|
13
18
|
isLoading: boolean;
|
|
14
19
|
errorMessage: string | null;
|
|
@@ -22,16 +27,15 @@ export declare const actionToggleZenMode: {
|
|
|
22
27
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
23
28
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
24
29
|
activeTool: {
|
|
25
|
-
|
|
26
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
30
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
27
31
|
locked: boolean;
|
|
32
|
+
} & ({
|
|
33
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
28
34
|
customType: null;
|
|
29
35
|
} | {
|
|
30
36
|
type: "custom";
|
|
31
37
|
customType: string;
|
|
32
|
-
|
|
33
|
-
locked: boolean;
|
|
34
|
-
};
|
|
38
|
+
});
|
|
35
39
|
penMode: boolean;
|
|
36
40
|
penDetected: boolean;
|
|
37
41
|
exportBackground: boolean;
|
|
@@ -65,7 +69,7 @@ export declare const actionToggleZenMode: {
|
|
|
65
69
|
openMenu: "canvas" | "shape" | null;
|
|
66
70
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
67
71
|
openSidebar: "library" | "customSidebar" | null;
|
|
68
|
-
openDialog: "imageExport" | "help" | null;
|
|
72
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
69
73
|
isSidebarDocked: boolean;
|
|
70
74
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
71
75
|
selectedElementIds: {
|
|
@@ -82,6 +86,7 @@ export declare const actionToggleZenMode: {
|
|
|
82
86
|
} | null;
|
|
83
87
|
theme: string;
|
|
84
88
|
gridSize: number | null;
|
|
89
|
+
previousGridSize: number | null;
|
|
85
90
|
viewModeEnabled: boolean;
|
|
86
91
|
selectedGroupIds: {
|
|
87
92
|
[groupId: string]: boolean;
|
|
@@ -111,11 +116,14 @@ export declare const actionToggleZenMode: {
|
|
|
111
116
|
elementBackground?: string[] | undefined;
|
|
112
117
|
elementStroke?: string[] | undefined;
|
|
113
118
|
};
|
|
119
|
+
allowWheelZoom?: boolean | undefined;
|
|
120
|
+
allowPinchZoom?: boolean | undefined;
|
|
114
121
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
115
122
|
};
|
|
116
123
|
commitToHistory: false;
|
|
117
124
|
};
|
|
118
125
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
126
|
+
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
119
127
|
contextItemLabel: string;
|
|
120
128
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
121
129
|
} & {
|
|
@@ -12,9 +12,7 @@ export declare const actionSendBackward: {
|
|
|
12
12
|
contextItemLabel: string;
|
|
13
13
|
keyPriority: number;
|
|
14
14
|
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
15
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
16
|
-
isInHamburgerMenu: boolean;
|
|
17
|
-
}) => JSX.Element;
|
|
15
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
18
16
|
} & {
|
|
19
17
|
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
20
18
|
};
|
|
@@ -31,9 +29,7 @@ export declare const actionBringForward: {
|
|
|
31
29
|
contextItemLabel: string;
|
|
32
30
|
keyPriority: number;
|
|
33
31
|
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
34
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
35
|
-
isInHamburgerMenu: boolean;
|
|
36
|
-
}) => JSX.Element;
|
|
32
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
37
33
|
} & {
|
|
38
34
|
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
39
35
|
};
|
|
@@ -49,9 +45,7 @@ export declare const actionSendToBack: {
|
|
|
49
45
|
};
|
|
50
46
|
contextItemLabel: string;
|
|
51
47
|
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
52
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
53
|
-
isInHamburgerMenu: boolean;
|
|
54
|
-
}) => JSX.Element;
|
|
48
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
55
49
|
} & {
|
|
56
50
|
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
57
51
|
};
|
|
@@ -67,9 +61,7 @@ export declare const actionBringToFront: {
|
|
|
67
61
|
};
|
|
68
62
|
contextItemLabel: string;
|
|
69
63
|
keyTest: (event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean;
|
|
70
|
-
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps
|
|
71
|
-
isInHamburgerMenu: boolean;
|
|
72
|
-
}) => JSX.Element;
|
|
64
|
+
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
73
65
|
} & {
|
|
74
66
|
keyTest?: ((event: KeyboardEvent | React.KeyboardEvent<Element>) => boolean) | undefined;
|
|
75
67
|
};
|
|
@@ -16,5 +16,6 @@ export declare class ActionManager {
|
|
|
16
16
|
/**
|
|
17
17
|
* @param data additional data sent to the PanelComponent
|
|
18
18
|
*/
|
|
19
|
-
renderAction: (name: ActionName, data?: PanelComponentProps["data"]
|
|
19
|
+
renderAction: (name: ActionName, data?: PanelComponentProps["data"]) => JSX.Element | null;
|
|
20
|
+
isActionEnabled: (action: Action) => boolean;
|
|
20
21
|
}
|
package/types/actions/types.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare type ActionResult = {
|
|
|
14
14
|
declare type ActionFn = (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
15
15
|
export declare type UpdaterFn = (res: ActionResult) => void;
|
|
16
16
|
export declare type ActionFilterFn = (action: Action) => void;
|
|
17
|
-
export declare type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "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" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "
|
|
17
|
+
export declare type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "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" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "toggleLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool";
|
|
18
18
|
export declare type PanelComponentProps = {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
20
|
appState: AppState;
|
|
@@ -24,14 +24,12 @@ export declare type PanelComponentProps = {
|
|
|
24
24
|
};
|
|
25
25
|
export interface Action {
|
|
26
26
|
name: ActionName;
|
|
27
|
-
PanelComponent?: React.FC<PanelComponentProps
|
|
28
|
-
isInHamburgerMenu: boolean;
|
|
29
|
-
}>;
|
|
27
|
+
PanelComponent?: React.FC<PanelComponentProps>;
|
|
30
28
|
perform: ActionFn;
|
|
31
29
|
keyPriority?: number;
|
|
32
30
|
keyTest?: (event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[]) => boolean;
|
|
33
31
|
contextItemLabel?: string | ((elements: readonly ExcalidrawElement[], appState: Readonly<AppState>) => string);
|
|
34
|
-
|
|
32
|
+
predicate?: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: ExcalidrawProps, app: AppClassProperties) => boolean;
|
|
35
33
|
checked?: (appState: Readonly<AppState>) => boolean;
|
|
36
34
|
trackEvent: false | {
|
|
37
35
|
category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink";
|
package/types/appState.d.ts
CHANGED
|
@@ -3,17 +3,16 @@ export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "off
|
|
|
3
3
|
export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
|
|
4
4
|
theme?: string | undefined;
|
|
5
5
|
name?: string | undefined;
|
|
6
|
-
activeTool?: {
|
|
7
|
-
|
|
8
|
-
lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser;
|
|
6
|
+
activeTool?: ({
|
|
7
|
+
lastActiveTool: import("./types").LastActiveTool;
|
|
9
8
|
locked: boolean;
|
|
9
|
+
} & ({
|
|
10
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
10
11
|
customType: null;
|
|
11
12
|
} | {
|
|
12
13
|
type: "custom";
|
|
13
14
|
customType: string;
|
|
14
|
-
|
|
15
|
-
locked: boolean;
|
|
16
|
-
} | undefined;
|
|
15
|
+
})) | undefined;
|
|
17
16
|
showWelcomeScreen?: boolean | undefined;
|
|
18
17
|
penMode?: boolean | undefined;
|
|
19
18
|
penDetected?: boolean | undefined;
|
|
@@ -74,3 +73,6 @@ export declare const clearAppStateForDatabase: (appState: Partial<AppState>) =>
|
|
|
74
73
|
export declare const isEraserActive: ({ activeTool, }: {
|
|
75
74
|
activeTool: AppState["activeTool"];
|
|
76
75
|
}) => boolean;
|
|
76
|
+
export declare const isHandToolActive: ({ activeTool, }: {
|
|
77
|
+
activeTool: AppState["activeTool"];
|
|
78
|
+
}) => boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const activeConfirmDialogAtom: import("jotai").Atom<"clearCanvas" | null> & {
|
|
2
|
+
write: (get: {
|
|
3
|
+
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
4
|
+
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
5
|
+
<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;
|
|
6
|
+
} & {
|
|
7
|
+
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
8
|
+
unstable_promise: true;
|
|
9
|
+
}): Value_3 | Promise<Value_3>;
|
|
10
|
+
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
11
|
+
unstable_promise: true;
|
|
12
|
+
}): Value_4 | Promise<Value_4>;
|
|
13
|
+
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
14
|
+
unstable_promise: true;
|
|
15
|
+
}): (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>;
|
|
16
|
+
}, set: {
|
|
17
|
+
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
18
|
+
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
19
|
+
}, update: "clearCanvas" | ((prev: "clearCanvas" | null) => "clearCanvas" | null) | null) => void;
|
|
20
|
+
onMount?: (<S extends (update: "clearCanvas" | ((prev: "clearCanvas" | null) => "clearCanvas" | null) | null) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
21
|
+
} & {
|
|
22
|
+
init: "clearCanvas" | null;
|
|
23
|
+
};
|
|
24
|
+
export declare const ActiveConfirmDialog: () => JSX.Element | null;
|
|
@@ -9,53 +9,11 @@ import Scene from "../scene/Scene";
|
|
|
9
9
|
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device } from "../types";
|
|
10
10
|
import { FileSystemHandle } from "../data/filesystem";
|
|
11
11
|
import { ImportedDataState } from "../data/types";
|
|
12
|
-
export declare const isMenuOpenAtom: import("jotai").Atom<boolean> & {
|
|
13
|
-
write: (get: {
|
|
14
|
-
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
15
|
-
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
16
|
-
<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;
|
|
17
|
-
} & {
|
|
18
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
19
|
-
unstable_promise: true;
|
|
20
|
-
}): Value_3 | Promise<Value_3>;
|
|
21
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
22
|
-
unstable_promise: true;
|
|
23
|
-
}): Value_4 | Promise<Value_4>;
|
|
24
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
25
|
-
unstable_promise: true;
|
|
26
|
-
}): (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>;
|
|
27
|
-
}, set: {
|
|
28
|
-
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
29
|
-
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
30
|
-
}, update: boolean | ((prev: boolean) => boolean)) => void;
|
|
31
|
-
onMount?: (<S extends (update: boolean | ((prev: boolean) => boolean)) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
32
|
-
} & {
|
|
33
|
-
init: boolean;
|
|
34
|
-
};
|
|
35
|
-
export declare const isDropdownOpenAtom: import("jotai").Atom<boolean> & {
|
|
36
|
-
write: (get: {
|
|
37
|
-
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
38
|
-
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
39
|
-
<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;
|
|
40
|
-
} & {
|
|
41
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
42
|
-
unstable_promise: true;
|
|
43
|
-
}): Value_3 | Promise<Value_3>;
|
|
44
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
45
|
-
unstable_promise: true;
|
|
46
|
-
}): Value_4 | Promise<Value_4>;
|
|
47
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
48
|
-
unstable_promise: true;
|
|
49
|
-
}): (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>;
|
|
50
|
-
}, set: {
|
|
51
|
-
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
52
|
-
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
53
|
-
}, update: boolean | ((prev: boolean) => boolean)) => void;
|
|
54
|
-
onMount?: (<S extends (update: boolean | ((prev: boolean) => boolean)) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
55
|
-
} & {
|
|
56
|
-
init: boolean;
|
|
57
|
-
};
|
|
58
12
|
export declare let showFourthFont: boolean;
|
|
13
|
+
export declare const ExcalidrawContainerContext: React.Context<{
|
|
14
|
+
container: HTMLDivElement | null;
|
|
15
|
+
id: string | null;
|
|
16
|
+
}>;
|
|
59
17
|
export declare const useDevice: () => Readonly<{
|
|
60
18
|
isSmScreen: boolean;
|
|
61
19
|
isMobile: boolean;
|
|
@@ -69,6 +27,7 @@ export declare const useExcalidrawContainer: () => {
|
|
|
69
27
|
export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawElement[];
|
|
70
28
|
export declare const useExcalidrawAppState: () => AppState;
|
|
71
29
|
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;
|
|
30
|
+
export declare const useExcalidrawActionManager: () => ActionManager;
|
|
72
31
|
declare class App extends React.Component<AppProps, AppState> {
|
|
73
32
|
canvas: AppClassProperties["canvas"];
|
|
74
33
|
rc: RoughCanvas | null;
|
|
@@ -92,7 +51,6 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
92
51
|
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
93
52
|
lastPointerDown: React.PointerEvent<HTMLCanvasElement> | null;
|
|
94
53
|
lastPointerUp: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
95
|
-
contextMenuOpen: boolean;
|
|
96
54
|
lastScenePointer: {
|
|
97
55
|
x: number;
|
|
98
56
|
y: number;
|
|
@@ -131,13 +89,14 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
131
89
|
private static resetTapTwice;
|
|
132
90
|
private onTapStart;
|
|
133
91
|
private onTapEnd;
|
|
134
|
-
|
|
92
|
+
pasteFromClipboard: (event: ClipboardEvent | null) => Promise<void>;
|
|
135
93
|
private addElementsFromPasteOrLibrary;
|
|
136
94
|
private addTextFromPaste;
|
|
137
95
|
setAppState: React.Component<any, AppState>["setState"];
|
|
138
96
|
removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
|
|
139
97
|
toggleLock: (source?: "keyboard" | "ui") => void;
|
|
140
98
|
togglePenMode: () => void;
|
|
99
|
+
onHandToolToggle: () => void;
|
|
141
100
|
scrollToContent: (target?: ExcalidrawElement | readonly ExcalidrawElement[]) => void;
|
|
142
101
|
zoomToFit: (target?: readonly ExcalidrawElement[], maxZoom?: number, margin?: number) => void;
|
|
143
102
|
updateContainerSize: (containers: NonDeletedExcalidrawElement[]) => void;
|
|
@@ -253,8 +212,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
253
212
|
private handleCanvasContextMenu;
|
|
254
213
|
private maybeDragNewGenericElement;
|
|
255
214
|
private maybeHandleResize;
|
|
256
|
-
|
|
257
|
-
private _openContextMenu;
|
|
215
|
+
private getContextMenuItems;
|
|
258
216
|
private handleWheel;
|
|
259
217
|
private getTextWysiwygSnappedToCenterPosition;
|
|
260
218
|
private savePointer;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./Button.scss";
|
|
3
|
+
interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
type?: "button" | "submit" | "reset";
|
|
5
|
+
onSelect: () => any;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A generic button component that follows Excalidraw's design system.
|
|
11
|
+
* Style can be customised using `className` or `style` prop.
|
|
12
|
+
* Accepts all props that a regular `button` element accepts.
|
|
13
|
+
*/
|
|
14
|
+
export declare const Button: ({ type, onSelect, children, className, ...rest }: ButtonProps) => JSX.Element;
|
|
15
|
+
export {};
|