@dwelle/excalidraw 0.4.0-cfd6fb7 → 0.4.0-d68dd48
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 +316 -544
- package/README.md +16 -1364
- package/dist/excalidraw-assets/Assistant-Bold.woff2 +0 -0
- package/dist/excalidraw-assets/Assistant-Medium.woff2 +0 -0
- package/dist/excalidraw-assets/Assistant-Regular.woff2 +0 -0
- package/dist/excalidraw-assets/Assistant-SemiBold.woff2 +0 -0
- package/dist/excalidraw-assets/vendor-2002fe1b8862917b36c1.js +2 -0
- package/dist/excalidraw-assets-dev/Assistant-Bold.woff2 +0 -0
- package/dist/excalidraw-assets-dev/Assistant-Medium.woff2 +0 -0
- package/dist/excalidraw-assets-dev/Assistant-Regular.woff2 +0 -0
- package/dist/excalidraw-assets-dev/Assistant-SemiBold.woff2 +0 -0
- package/dist/excalidraw-assets-dev/{vendor-c0592035c3911af79359.js → vendor-e6df8519da951026ff69.js} +1 -1
- package/dist/excalidraw.development.js +1155 -489
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +20 -7
- package/package.json +2 -2
- package/types/actions/actionAddToLibrary.d.ts +47 -34
- package/types/actions/actionBoundText.d.ts +143 -19
- package/types/actions/actionCanvas.d.ts +362 -108
- package/types/actions/actionClipboard.d.ts +107 -60
- package/types/actions/actionDeleteSelected.d.ts +60 -39
- package/types/actions/actionDuplicateSelection.d.ts +1 -1
- package/types/actions/actionExport.d.ts +155 -118
- package/types/actions/actionFinalize.d.ts +32 -24
- package/types/actions/actionFlip.d.ts +2 -2
- package/types/actions/actionGroup.d.ts +2 -2
- package/types/actions/actionLinearEditor.d.ts +119 -0
- package/types/actions/actionMenu.d.ts +50 -37
- package/types/actions/actionNavigate.d.ts +1 -0
- package/types/actions/actionProperties.d.ts +211 -159
- package/types/actions/actionStyles.d.ts +16 -12
- package/types/actions/actionToggleGridMode.d.ts +18 -12
- package/types/actions/actionToggleLock.d.ts +16 -12
- package/types/actions/actionToggleStats.d.ts +17 -12
- package/types/actions/actionToggleViewMode.d.ts +18 -12
- package/types/actions/actionToggleZenMode.d.ts +18 -12
- package/types/actions/index.d.ts +1 -0
- package/types/actions/manager.d.ts +1 -0
- package/types/actions/shortcuts.d.ts +2 -1
- package/types/actions/types.d.ts +6 -2
- package/types/appState.d.ts +23 -21
- package/types/clients.d.ts +1 -1
- package/types/clipboard.d.ts +6 -1
- package/types/components/Actions.d.ts +13 -0
- package/types/components/ActiveConfirmDialog.d.ts +24 -0
- package/types/components/App.d.ts +36 -17
- package/types/components/Avatar.d.ts +1 -1
- package/types/components/BraveMeasureTextError.d.ts +2 -0
- package/types/components/Button.d.ts +15 -0
- package/types/components/ButtonIconSelect.d.ts +11 -3
- package/types/components/ContextMenu.d.ts +8 -21
- package/types/components/DialogActionButton.d.ts +10 -0
- package/types/components/ErrorDialog.d.ts +3 -2
- package/types/components/HandButton.d.ts +10 -0
- package/types/components/HelpButton.d.ts +7 -0
- package/types/components/HintViewer.d.ts +3 -2
- package/types/components/HomeButton.d.ts +5 -0
- package/types/components/ImageExportDialog.d.ts +3 -1
- package/types/components/InitializeApp.d.ts +2 -0
- package/types/components/JSONExportDialog.d.ts +5 -3
- package/types/components/LayerUI.d.ts +6 -6
- package/types/components/LibraryButton.d.ts +1 -0
- package/types/components/LibraryMenu.d.ts +14 -5
- package/types/components/LibraryMenuBrowseButton.d.ts +7 -0
- package/types/components/LibraryMenuHeaderContent.d.ts +35 -0
- package/types/components/LibraryMenuItems.d.ts +5 -14
- package/types/components/LibraryUnit.d.ts +2 -3
- package/types/components/LoadingMessage.d.ts +2 -0
- package/types/components/LockButton.d.ts +0 -1
- package/types/components/MobileMenu.d.ts +9 -11
- 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 +16 -0
- package/types/components/Stats.d.ts +1 -1
- package/types/components/ToolButton.d.ts +1 -1
- package/types/components/UserList.d.ts +0 -3
- package/types/components/context/tunnels.d.ts +16 -0
- 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 +12 -0
- package/types/components/footer/FooterCenter.d.ts +8 -0
- package/types/components/hoc/withInternalFallback.d.ts +4 -0
- package/types/components/hoc/withUpstreamOverride.d.ts +10 -0
- package/types/components/icons.d.ts +83 -122
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +10 -0
- package/types/components/main-menu/DefaultItems.d.ts +47 -0
- package/types/components/main-menu/MainMenu.d.ts +60 -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 +45 -16
- package/types/data/blob.d.ts +2 -1
- package/types/data/index.d.ts +1 -1
- package/types/data/restore.d.ts +8 -2
- package/types/data/types.d.ts +16 -1
- package/types/element/Hyperlink.d.ts +17 -13
- package/types/element/bounds.d.ts +3 -2
- package/types/element/image.d.ts +1 -1
- package/types/element/index.d.ts +1 -1
- package/types/element/linearElementEditor.d.ts +65 -22
- package/types/element/mutateElement.d.ts +1 -0
- package/types/element/newElement.d.ts +42 -10
- package/types/element/resizeElements.d.ts +0 -1
- package/types/element/sortElements.d.ts +2 -0
- package/types/element/textElement.d.ts +61 -8
- package/types/element/textWysiwyg.d.ts +6 -1
- package/types/element/transformHandles.d.ts +3 -4
- package/types/element/typeChecks.d.ts +12 -2
- package/types/element/types.d.ts +21 -6
- package/types/hooks/useOutsideClick.d.ts +2 -0
- package/types/i18n.d.ts +6 -0
- package/types/jotai.d.ts +5 -5
- package/types/keys.d.ts +15 -6
- package/types/math.d.ts +10 -1
- package/types/packages/excalidraw/example/App.d.ts +9 -2
- package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/sidebar/{Sidebar.d.ts → ExampleSidebar.d.ts} +1 -1
- package/types/packages/excalidraw/index.d.ts +16 -2
- package/types/packages/utils.d.ts +26 -22
- package/types/renderer/renderElement.d.ts +6 -4
- package/types/renderer/renderScene.d.ts +2 -4
- package/types/scene/Fonts.d.ts +21 -0
- package/types/scene/Scene.d.ts +15 -0
- package/types/scene/comparisons.d.ts +2 -3
- package/types/scene/export.d.ts +156 -10
- package/types/scene/index.d.ts +1 -1
- package/types/scene/types.d.ts +10 -1
- package/types/shapes.d.ts +27 -3
- package/types/types.d.ts +68 -40
- package/types/utility-types.d.ts +22 -0
- package/types/utils.d.ts +30 -4
- package/dist/excalidraw-assets/vendor-52b1f3361986b6c6a4fe.js +0 -2
- package/types/components/ActiveFile.d.ts +0 -7
- package/types/components/BackgroundPickerAndDarkModeToggle.d.ts +0 -9
- package/types/components/ClearCanvas.d.ts +0 -4
- package/types/components/CollabButton.d.ts +0 -7
- package/types/components/HelpIcon.d.ts +0 -8
- package/types/components/SidebarLockButton.d.ts +0 -8
- package/types/components/SingleLibraryItem.d.ts +0 -10
- /package/dist/excalidraw-assets/{vendor-52b1f3361986b6c6a4fe.js.LICENSE.txt → vendor-2002fe1b8862917b36c1.js.LICENSE.txt} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-52b1f3361986b6c6a4fe.d.ts → vendor-2002fe1b8862917b36c1.d.ts} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-c0592035c3911af79359.d.ts → vendor-e6df8519da951026ff69.d.ts} +0 -0
|
@@ -4,6 +4,7 @@ import { AppState, NormalizedZoomValue } from "../types";
|
|
|
4
4
|
export declare const actionChangeViewBackgroundColor: {
|
|
5
5
|
name: "changeViewBackgroundColor";
|
|
6
6
|
trackEvent: false;
|
|
7
|
+
predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
|
|
7
8
|
perform: (_: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
8
9
|
appState: any;
|
|
9
10
|
commitToHistory: boolean;
|
|
@@ -17,6 +18,7 @@ export declare const actionClearCanvas: {
|
|
|
17
18
|
trackEvent: {
|
|
18
19
|
category: "canvas";
|
|
19
20
|
};
|
|
21
|
+
predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
|
|
20
22
|
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
|
|
21
23
|
elements: ExcalidrawElement[];
|
|
22
24
|
appState: {
|
|
@@ -36,25 +38,24 @@ export declare const actionClearCanvas: {
|
|
|
36
38
|
data: import("../charts").Spreadsheet;
|
|
37
39
|
};
|
|
38
40
|
activeTool: {
|
|
39
|
-
|
|
40
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
41
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
41
42
|
locked: boolean;
|
|
43
|
+
} & ({
|
|
44
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
42
45
|
customType: null;
|
|
43
46
|
} | {
|
|
44
47
|
type: "custom";
|
|
45
48
|
customType: string;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}>;
|
|
55
|
-
shouldCacheIgnoreZoom: boolean;
|
|
49
|
+
});
|
|
50
|
+
name: string;
|
|
51
|
+
contextMenu: {
|
|
52
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
53
|
+
top: number;
|
|
54
|
+
left: number;
|
|
55
|
+
} | null;
|
|
56
|
+
showWelcomeScreen: boolean;
|
|
56
57
|
isLoading: boolean;
|
|
57
|
-
errorMessage:
|
|
58
|
+
errorMessage: import("react").ReactNode;
|
|
58
59
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
59
60
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
60
61
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -75,18 +76,25 @@ export declare const actionClearCanvas: {
|
|
|
75
76
|
currentItemOpacity: number;
|
|
76
77
|
currentItemFontFamily: number;
|
|
77
78
|
currentItemFontSize: number;
|
|
78
|
-
currentItemTextAlign:
|
|
79
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
79
|
+
currentItemTextAlign: string;
|
|
80
80
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
81
81
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
82
|
-
|
|
82
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
83
|
+
viewBackgroundColor: string;
|
|
84
|
+
scrollX: number;
|
|
85
|
+
scrollY: number;
|
|
83
86
|
cursorButton: "up" | "down";
|
|
84
87
|
scrolledOutside: boolean;
|
|
85
|
-
name: string;
|
|
86
88
|
isResizing: boolean;
|
|
87
89
|
isRotating: boolean;
|
|
90
|
+
zoom: Readonly<{
|
|
91
|
+
value: NormalizedZoomValue;
|
|
92
|
+
}>;
|
|
88
93
|
openMenu: "canvas" | "shape" | null;
|
|
89
94
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
95
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
96
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
97
|
+
isSidebarDocked: boolean;
|
|
90
98
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
91
99
|
selectedElementIds: {
|
|
92
100
|
[id: string]: boolean;
|
|
@@ -94,7 +102,7 @@ export declare const actionClearCanvas: {
|
|
|
94
102
|
previousSelectedElementIds: {
|
|
95
103
|
[id: string]: boolean;
|
|
96
104
|
};
|
|
97
|
-
|
|
105
|
+
shouldCacheIgnoreZoom: boolean;
|
|
98
106
|
toast: {
|
|
99
107
|
message: string;
|
|
100
108
|
closable?: boolean | undefined;
|
|
@@ -106,8 +114,6 @@ export declare const actionClearCanvas: {
|
|
|
106
114
|
[groupId: string]: boolean;
|
|
107
115
|
};
|
|
108
116
|
editingGroupId: string | null;
|
|
109
|
-
isLibraryOpen: boolean;
|
|
110
|
-
isLibraryMenuDocked: boolean;
|
|
111
117
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
112
118
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
113
119
|
currentChartType: import("../element/types").ChartType;
|
|
@@ -117,12 +123,12 @@ export declare const actionClearCanvas: {
|
|
|
117
123
|
};
|
|
118
124
|
commitToHistory: true;
|
|
119
125
|
};
|
|
120
|
-
PanelComponent: ({ updateData }: import("./types").PanelComponentProps) => JSX.Element;
|
|
121
126
|
} & {
|
|
122
127
|
keyTest?: undefined;
|
|
123
128
|
};
|
|
124
129
|
export declare const actionZoomIn: {
|
|
125
130
|
name: "zoomIn";
|
|
131
|
+
viewMode: true;
|
|
126
132
|
trackEvent: {
|
|
127
133
|
category: "canvas";
|
|
128
134
|
};
|
|
@@ -133,8 +139,14 @@ export declare const actionZoomIn: {
|
|
|
133
139
|
zoom: {
|
|
134
140
|
value: NormalizedZoomValue;
|
|
135
141
|
};
|
|
142
|
+
contextMenu: {
|
|
143
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
144
|
+
top: number;
|
|
145
|
+
left: number;
|
|
146
|
+
} | null;
|
|
147
|
+
showWelcomeScreen: boolean;
|
|
136
148
|
isLoading: boolean;
|
|
137
|
-
errorMessage:
|
|
149
|
+
errorMessage: import("react").ReactNode;
|
|
138
150
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
139
151
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
140
152
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -145,16 +157,15 @@ export declare const actionZoomIn: {
|
|
|
145
157
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
146
158
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
147
159
|
activeTool: {
|
|
148
|
-
|
|
149
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
160
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
150
161
|
locked: boolean;
|
|
162
|
+
} & ({
|
|
163
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
151
164
|
customType: null;
|
|
152
165
|
} | {
|
|
153
166
|
type: "custom";
|
|
154
167
|
customType: string;
|
|
155
|
-
|
|
156
|
-
locked: boolean;
|
|
157
|
-
};
|
|
168
|
+
});
|
|
158
169
|
penMode: boolean;
|
|
159
170
|
penDetected: boolean;
|
|
160
171
|
exportBackground: boolean;
|
|
@@ -170,11 +181,10 @@ export declare const actionZoomIn: {
|
|
|
170
181
|
currentItemOpacity: number;
|
|
171
182
|
currentItemFontFamily: number;
|
|
172
183
|
currentItemFontSize: number;
|
|
173
|
-
currentItemTextAlign:
|
|
174
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
184
|
+
currentItemTextAlign: string;
|
|
175
185
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
176
186
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
177
|
-
|
|
187
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
178
188
|
viewBackgroundColor: string;
|
|
179
189
|
cursorButton: "up" | "down";
|
|
180
190
|
scrolledOutside: boolean;
|
|
@@ -183,6 +193,9 @@ export declare const actionZoomIn: {
|
|
|
183
193
|
isRotating: boolean;
|
|
184
194
|
openMenu: "canvas" | "shape" | null;
|
|
185
195
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
196
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
197
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
198
|
+
isSidebarDocked: boolean;
|
|
186
199
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
187
200
|
selectedElementIds: {
|
|
188
201
|
[id: string]: boolean;
|
|
@@ -191,7 +204,6 @@ export declare const actionZoomIn: {
|
|
|
191
204
|
[id: string]: boolean;
|
|
192
205
|
};
|
|
193
206
|
shouldCacheIgnoreZoom: boolean;
|
|
194
|
-
showHelpDialog: boolean;
|
|
195
207
|
toast: {
|
|
196
208
|
message: string;
|
|
197
209
|
closable?: boolean | undefined;
|
|
@@ -209,8 +221,6 @@ export declare const actionZoomIn: {
|
|
|
209
221
|
height: number;
|
|
210
222
|
offsetTop: number;
|
|
211
223
|
offsetLeft: number;
|
|
212
|
-
isLibraryOpen: boolean;
|
|
213
|
-
isLibraryMenuDocked: boolean;
|
|
214
224
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
215
225
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
216
226
|
showStats: boolean;
|
|
@@ -235,6 +245,7 @@ export declare const actionZoomIn: {
|
|
|
235
245
|
};
|
|
236
246
|
export declare const actionZoomOut: {
|
|
237
247
|
name: "zoomOut";
|
|
248
|
+
viewMode: true;
|
|
238
249
|
trackEvent: {
|
|
239
250
|
category: "canvas";
|
|
240
251
|
};
|
|
@@ -245,8 +256,14 @@ export declare const actionZoomOut: {
|
|
|
245
256
|
zoom: {
|
|
246
257
|
value: NormalizedZoomValue;
|
|
247
258
|
};
|
|
259
|
+
contextMenu: {
|
|
260
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
261
|
+
top: number;
|
|
262
|
+
left: number;
|
|
263
|
+
} | null;
|
|
264
|
+
showWelcomeScreen: boolean;
|
|
248
265
|
isLoading: boolean;
|
|
249
|
-
errorMessage:
|
|
266
|
+
errorMessage: import("react").ReactNode;
|
|
250
267
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
251
268
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
252
269
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -257,16 +274,15 @@ export declare const actionZoomOut: {
|
|
|
257
274
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
258
275
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
259
276
|
activeTool: {
|
|
260
|
-
|
|
261
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
277
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
262
278
|
locked: boolean;
|
|
279
|
+
} & ({
|
|
280
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
263
281
|
customType: null;
|
|
264
282
|
} | {
|
|
265
283
|
type: "custom";
|
|
266
284
|
customType: string;
|
|
267
|
-
|
|
268
|
-
locked: boolean;
|
|
269
|
-
};
|
|
285
|
+
});
|
|
270
286
|
penMode: boolean;
|
|
271
287
|
penDetected: boolean;
|
|
272
288
|
exportBackground: boolean;
|
|
@@ -282,11 +298,10 @@ export declare const actionZoomOut: {
|
|
|
282
298
|
currentItemOpacity: number;
|
|
283
299
|
currentItemFontFamily: number;
|
|
284
300
|
currentItemFontSize: number;
|
|
285
|
-
currentItemTextAlign:
|
|
286
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
301
|
+
currentItemTextAlign: string;
|
|
287
302
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
288
303
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
289
|
-
|
|
304
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
290
305
|
viewBackgroundColor: string;
|
|
291
306
|
cursorButton: "up" | "down";
|
|
292
307
|
scrolledOutside: boolean;
|
|
@@ -295,6 +310,9 @@ export declare const actionZoomOut: {
|
|
|
295
310
|
isRotating: boolean;
|
|
296
311
|
openMenu: "canvas" | "shape" | null;
|
|
297
312
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
313
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
314
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
315
|
+
isSidebarDocked: boolean;
|
|
298
316
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
299
317
|
selectedElementIds: {
|
|
300
318
|
[id: string]: boolean;
|
|
@@ -303,7 +321,6 @@ export declare const actionZoomOut: {
|
|
|
303
321
|
[id: string]: boolean;
|
|
304
322
|
};
|
|
305
323
|
shouldCacheIgnoreZoom: boolean;
|
|
306
|
-
showHelpDialog: boolean;
|
|
307
324
|
toast: {
|
|
308
325
|
message: string;
|
|
309
326
|
closable?: boolean | undefined;
|
|
@@ -321,8 +338,6 @@ export declare const actionZoomOut: {
|
|
|
321
338
|
height: number;
|
|
322
339
|
offsetTop: number;
|
|
323
340
|
offsetLeft: number;
|
|
324
|
-
isLibraryOpen: boolean;
|
|
325
|
-
isLibraryMenuDocked: boolean;
|
|
326
341
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
327
342
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
328
343
|
showStats: boolean;
|
|
@@ -347,6 +362,7 @@ export declare const actionZoomOut: {
|
|
|
347
362
|
};
|
|
348
363
|
export declare const actionResetZoom: {
|
|
349
364
|
name: "resetZoom";
|
|
365
|
+
viewMode: true;
|
|
350
366
|
trackEvent: {
|
|
351
367
|
category: "canvas";
|
|
352
368
|
};
|
|
@@ -357,8 +373,14 @@ export declare const actionResetZoom: {
|
|
|
357
373
|
zoom: {
|
|
358
374
|
value: NormalizedZoomValue;
|
|
359
375
|
};
|
|
376
|
+
contextMenu: {
|
|
377
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
378
|
+
top: number;
|
|
379
|
+
left: number;
|
|
380
|
+
} | null;
|
|
381
|
+
showWelcomeScreen: boolean;
|
|
360
382
|
isLoading: boolean;
|
|
361
|
-
errorMessage:
|
|
383
|
+
errorMessage: import("react").ReactNode;
|
|
362
384
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
363
385
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
364
386
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -369,16 +391,15 @@ export declare const actionResetZoom: {
|
|
|
369
391
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
370
392
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
371
393
|
activeTool: {
|
|
372
|
-
|
|
373
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
394
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
374
395
|
locked: boolean;
|
|
396
|
+
} & ({
|
|
397
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
375
398
|
customType: null;
|
|
376
399
|
} | {
|
|
377
400
|
type: "custom";
|
|
378
401
|
customType: string;
|
|
379
|
-
|
|
380
|
-
locked: boolean;
|
|
381
|
-
};
|
|
402
|
+
});
|
|
382
403
|
penMode: boolean;
|
|
383
404
|
penDetected: boolean;
|
|
384
405
|
exportBackground: boolean;
|
|
@@ -394,11 +415,10 @@ export declare const actionResetZoom: {
|
|
|
394
415
|
currentItemOpacity: number;
|
|
395
416
|
currentItemFontFamily: number;
|
|
396
417
|
currentItemFontSize: number;
|
|
397
|
-
currentItemTextAlign:
|
|
398
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
418
|
+
currentItemTextAlign: string;
|
|
399
419
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
400
420
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
401
|
-
|
|
421
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
402
422
|
viewBackgroundColor: string;
|
|
403
423
|
cursorButton: "up" | "down";
|
|
404
424
|
scrolledOutside: boolean;
|
|
@@ -407,6 +427,9 @@ export declare const actionResetZoom: {
|
|
|
407
427
|
isRotating: boolean;
|
|
408
428
|
openMenu: "canvas" | "shape" | null;
|
|
409
429
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
430
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
431
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
432
|
+
isSidebarDocked: boolean;
|
|
410
433
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
411
434
|
selectedElementIds: {
|
|
412
435
|
[id: string]: boolean;
|
|
@@ -415,7 +438,6 @@ export declare const actionResetZoom: {
|
|
|
415
438
|
[id: string]: boolean;
|
|
416
439
|
};
|
|
417
440
|
shouldCacheIgnoreZoom: boolean;
|
|
418
|
-
showHelpDialog: boolean;
|
|
419
441
|
toast: {
|
|
420
442
|
message: string;
|
|
421
443
|
closable?: boolean | undefined;
|
|
@@ -433,8 +455,6 @@ export declare const actionResetZoom: {
|
|
|
433
455
|
height: number;
|
|
434
456
|
offsetTop: number;
|
|
435
457
|
offsetLeft: number;
|
|
436
|
-
isLibraryOpen: boolean;
|
|
437
|
-
isLibraryMenuDocked: boolean;
|
|
438
458
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
439
459
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
440
460
|
showStats: boolean;
|
|
@@ -457,6 +477,112 @@ export declare const actionResetZoom: {
|
|
|
457
477
|
} & {
|
|
458
478
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
459
479
|
};
|
|
480
|
+
export declare const zoomToFitElements: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, zoomToSelection: boolean) => {
|
|
481
|
+
appState: {
|
|
482
|
+
zoom: {
|
|
483
|
+
value: NormalizedZoomValue;
|
|
484
|
+
};
|
|
485
|
+
scrollX: number;
|
|
486
|
+
scrollY: number;
|
|
487
|
+
contextMenu: {
|
|
488
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
489
|
+
top: number;
|
|
490
|
+
left: number;
|
|
491
|
+
} | null;
|
|
492
|
+
showWelcomeScreen: boolean;
|
|
493
|
+
isLoading: boolean;
|
|
494
|
+
errorMessage: import("react").ReactNode;
|
|
495
|
+
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
496
|
+
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
497
|
+
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
498
|
+
selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
499
|
+
isBindingEnabled: boolean;
|
|
500
|
+
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
501
|
+
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
502
|
+
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
503
|
+
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
504
|
+
activeTool: {
|
|
505
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
506
|
+
locked: boolean;
|
|
507
|
+
} & ({
|
|
508
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
509
|
+
customType: null;
|
|
510
|
+
} | {
|
|
511
|
+
type: "custom";
|
|
512
|
+
customType: string;
|
|
513
|
+
});
|
|
514
|
+
penMode: boolean;
|
|
515
|
+
penDetected: boolean;
|
|
516
|
+
exportBackground: boolean;
|
|
517
|
+
exportEmbedScene: boolean;
|
|
518
|
+
exportWithDarkMode: boolean;
|
|
519
|
+
exportScale: number;
|
|
520
|
+
currentItemStrokeColor: string;
|
|
521
|
+
currentItemBackgroundColor: string;
|
|
522
|
+
currentItemFillStyle: import("../element/types").FillStyle;
|
|
523
|
+
currentItemStrokeWidth: number;
|
|
524
|
+
currentItemStrokeStyle: import("../element/types").StrokeStyle;
|
|
525
|
+
currentItemRoughness: number;
|
|
526
|
+
currentItemOpacity: number;
|
|
527
|
+
currentItemFontFamily: number;
|
|
528
|
+
currentItemFontSize: number;
|
|
529
|
+
currentItemTextAlign: string;
|
|
530
|
+
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
531
|
+
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
532
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
533
|
+
viewBackgroundColor: string;
|
|
534
|
+
cursorButton: "up" | "down";
|
|
535
|
+
scrolledOutside: boolean;
|
|
536
|
+
name: string;
|
|
537
|
+
isResizing: boolean;
|
|
538
|
+
isRotating: boolean;
|
|
539
|
+
openMenu: "canvas" | "shape" | null;
|
|
540
|
+
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
541
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
542
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
543
|
+
isSidebarDocked: boolean;
|
|
544
|
+
lastPointerDownWith: import("../element/types").PointerType;
|
|
545
|
+
selectedElementIds: {
|
|
546
|
+
[id: string]: boolean;
|
|
547
|
+
};
|
|
548
|
+
previousSelectedElementIds: {
|
|
549
|
+
[id: string]: boolean;
|
|
550
|
+
};
|
|
551
|
+
shouldCacheIgnoreZoom: boolean;
|
|
552
|
+
toast: {
|
|
553
|
+
message: string;
|
|
554
|
+
closable?: boolean | undefined;
|
|
555
|
+
duration?: number | undefined;
|
|
556
|
+
} | null;
|
|
557
|
+
zenModeEnabled: boolean;
|
|
558
|
+
theme: string;
|
|
559
|
+
gridSize: number | null;
|
|
560
|
+
viewModeEnabled: boolean;
|
|
561
|
+
selectedGroupIds: {
|
|
562
|
+
[groupId: string]: boolean;
|
|
563
|
+
};
|
|
564
|
+
editingGroupId: string | null;
|
|
565
|
+
width: number;
|
|
566
|
+
height: number;
|
|
567
|
+
offsetTop: number;
|
|
568
|
+
offsetLeft: number;
|
|
569
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
570
|
+
collaborators: Map<string, import("../types").Collaborator>;
|
|
571
|
+
showStats: boolean;
|
|
572
|
+
currentChartType: import("../element/types").ChartType;
|
|
573
|
+
pasteDialog: {
|
|
574
|
+
shown: false;
|
|
575
|
+
data: null;
|
|
576
|
+
} | {
|
|
577
|
+
shown: true;
|
|
578
|
+
data: import("../charts").Spreadsheet;
|
|
579
|
+
};
|
|
580
|
+
pendingImageElementId: string | null;
|
|
581
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
582
|
+
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
583
|
+
};
|
|
584
|
+
commitToHistory: boolean;
|
|
585
|
+
};
|
|
460
586
|
export declare const actionZoomToSelected: {
|
|
461
587
|
name: "zoomToSelection";
|
|
462
588
|
trackEvent: {
|
|
@@ -469,8 +595,14 @@ export declare const actionZoomToSelected: {
|
|
|
469
595
|
};
|
|
470
596
|
scrollX: number;
|
|
471
597
|
scrollY: number;
|
|
598
|
+
contextMenu: {
|
|
599
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
600
|
+
top: number;
|
|
601
|
+
left: number;
|
|
602
|
+
} | null;
|
|
603
|
+
showWelcomeScreen: boolean;
|
|
472
604
|
isLoading: boolean;
|
|
473
|
-
errorMessage:
|
|
605
|
+
errorMessage: import("react").ReactNode;
|
|
474
606
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
475
607
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
476
608
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -481,16 +613,15 @@ export declare const actionZoomToSelected: {
|
|
|
481
613
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
482
614
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
483
615
|
activeTool: {
|
|
484
|
-
|
|
485
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
616
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
486
617
|
locked: boolean;
|
|
618
|
+
} & ({
|
|
619
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
487
620
|
customType: null;
|
|
488
621
|
} | {
|
|
489
622
|
type: "custom";
|
|
490
623
|
customType: string;
|
|
491
|
-
|
|
492
|
-
locked: boolean;
|
|
493
|
-
};
|
|
624
|
+
});
|
|
494
625
|
penMode: boolean;
|
|
495
626
|
penDetected: boolean;
|
|
496
627
|
exportBackground: boolean;
|
|
@@ -506,11 +637,10 @@ export declare const actionZoomToSelected: {
|
|
|
506
637
|
currentItemOpacity: number;
|
|
507
638
|
currentItemFontFamily: number;
|
|
508
639
|
currentItemFontSize: number;
|
|
509
|
-
currentItemTextAlign:
|
|
510
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
640
|
+
currentItemTextAlign: string;
|
|
511
641
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
512
642
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
513
|
-
|
|
643
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
514
644
|
viewBackgroundColor: string;
|
|
515
645
|
cursorButton: "up" | "down";
|
|
516
646
|
scrolledOutside: boolean;
|
|
@@ -519,6 +649,9 @@ export declare const actionZoomToSelected: {
|
|
|
519
649
|
isRotating: boolean;
|
|
520
650
|
openMenu: "canvas" | "shape" | null;
|
|
521
651
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
652
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
653
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
654
|
+
isSidebarDocked: boolean;
|
|
522
655
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
523
656
|
selectedElementIds: {
|
|
524
657
|
[id: string]: boolean;
|
|
@@ -527,7 +660,6 @@ export declare const actionZoomToSelected: {
|
|
|
527
660
|
[id: string]: boolean;
|
|
528
661
|
};
|
|
529
662
|
shouldCacheIgnoreZoom: boolean;
|
|
530
|
-
showHelpDialog: boolean;
|
|
531
663
|
toast: {
|
|
532
664
|
message: string;
|
|
533
665
|
closable?: boolean | undefined;
|
|
@@ -545,8 +677,6 @@ export declare const actionZoomToSelected: {
|
|
|
545
677
|
height: number;
|
|
546
678
|
offsetTop: number;
|
|
547
679
|
offsetLeft: number;
|
|
548
|
-
isLibraryOpen: boolean;
|
|
549
|
-
isLibraryMenuDocked: boolean;
|
|
550
680
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
551
681
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
552
682
|
showStats: boolean;
|
|
@@ -570,6 +700,7 @@ export declare const actionZoomToSelected: {
|
|
|
570
700
|
};
|
|
571
701
|
export declare const actionZoomToFit: {
|
|
572
702
|
name: "zoomToFit";
|
|
703
|
+
viewMode: true;
|
|
573
704
|
trackEvent: {
|
|
574
705
|
category: "canvas";
|
|
575
706
|
};
|
|
@@ -580,8 +711,14 @@ export declare const actionZoomToFit: {
|
|
|
580
711
|
};
|
|
581
712
|
scrollX: number;
|
|
582
713
|
scrollY: number;
|
|
714
|
+
contextMenu: {
|
|
715
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
716
|
+
top: number;
|
|
717
|
+
left: number;
|
|
718
|
+
} | null;
|
|
719
|
+
showWelcomeScreen: boolean;
|
|
583
720
|
isLoading: boolean;
|
|
584
|
-
errorMessage:
|
|
721
|
+
errorMessage: import("react").ReactNode;
|
|
585
722
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
586
723
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
587
724
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -592,16 +729,15 @@ export declare const actionZoomToFit: {
|
|
|
592
729
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
593
730
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
594
731
|
activeTool: {
|
|
595
|
-
|
|
596
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
732
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
597
733
|
locked: boolean;
|
|
734
|
+
} & ({
|
|
735
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
598
736
|
customType: null;
|
|
599
737
|
} | {
|
|
600
738
|
type: "custom";
|
|
601
739
|
customType: string;
|
|
602
|
-
|
|
603
|
-
locked: boolean;
|
|
604
|
-
};
|
|
740
|
+
});
|
|
605
741
|
penMode: boolean;
|
|
606
742
|
penDetected: boolean;
|
|
607
743
|
exportBackground: boolean;
|
|
@@ -617,11 +753,10 @@ export declare const actionZoomToFit: {
|
|
|
617
753
|
currentItemOpacity: number;
|
|
618
754
|
currentItemFontFamily: number;
|
|
619
755
|
currentItemFontSize: number;
|
|
620
|
-
currentItemTextAlign:
|
|
621
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
756
|
+
currentItemTextAlign: string;
|
|
622
757
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
623
758
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
624
|
-
|
|
759
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
625
760
|
viewBackgroundColor: string;
|
|
626
761
|
cursorButton: "up" | "down";
|
|
627
762
|
scrolledOutside: boolean;
|
|
@@ -630,6 +765,9 @@ export declare const actionZoomToFit: {
|
|
|
630
765
|
isRotating: boolean;
|
|
631
766
|
openMenu: "canvas" | "shape" | null;
|
|
632
767
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
768
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
769
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
770
|
+
isSidebarDocked: boolean;
|
|
633
771
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
634
772
|
selectedElementIds: {
|
|
635
773
|
[id: string]: boolean;
|
|
@@ -638,7 +776,6 @@ export declare const actionZoomToFit: {
|
|
|
638
776
|
[id: string]: boolean;
|
|
639
777
|
};
|
|
640
778
|
shouldCacheIgnoreZoom: boolean;
|
|
641
|
-
showHelpDialog: boolean;
|
|
642
779
|
toast: {
|
|
643
780
|
message: string;
|
|
644
781
|
closable?: boolean | undefined;
|
|
@@ -656,8 +793,6 @@ export declare const actionZoomToFit: {
|
|
|
656
793
|
height: number;
|
|
657
794
|
offsetTop: number;
|
|
658
795
|
offsetLeft: number;
|
|
659
|
-
isLibraryOpen: boolean;
|
|
660
|
-
isLibraryMenuDocked: boolean;
|
|
661
796
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
662
797
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
663
798
|
showStats: boolean;
|
|
@@ -681,14 +816,21 @@ export declare const actionZoomToFit: {
|
|
|
681
816
|
};
|
|
682
817
|
export declare const actionToggleTheme: {
|
|
683
818
|
name: "toggleTheme";
|
|
819
|
+
viewMode: true;
|
|
684
820
|
trackEvent: {
|
|
685
821
|
category: "canvas";
|
|
686
822
|
};
|
|
687
823
|
perform: (_: readonly ExcalidrawElement[], appState: Readonly<AppState>, value: any) => {
|
|
688
824
|
appState: {
|
|
689
825
|
theme: any;
|
|
826
|
+
contextMenu: {
|
|
827
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
828
|
+
top: number;
|
|
829
|
+
left: number;
|
|
830
|
+
} | null;
|
|
831
|
+
showWelcomeScreen: boolean;
|
|
690
832
|
isLoading: boolean;
|
|
691
|
-
errorMessage:
|
|
833
|
+
errorMessage: import("react").ReactNode;
|
|
692
834
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
693
835
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
694
836
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -699,16 +841,15 @@ export declare const actionToggleTheme: {
|
|
|
699
841
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
700
842
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
701
843
|
activeTool: {
|
|
702
|
-
|
|
703
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
844
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
704
845
|
locked: boolean;
|
|
846
|
+
} & ({
|
|
847
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
705
848
|
customType: null;
|
|
706
849
|
} | {
|
|
707
850
|
type: "custom";
|
|
708
851
|
customType: string;
|
|
709
|
-
|
|
710
|
-
locked: boolean;
|
|
711
|
-
};
|
|
852
|
+
});
|
|
712
853
|
penMode: boolean;
|
|
713
854
|
penDetected: boolean;
|
|
714
855
|
exportBackground: boolean;
|
|
@@ -724,11 +865,10 @@ export declare const actionToggleTheme: {
|
|
|
724
865
|
currentItemOpacity: number;
|
|
725
866
|
currentItemFontFamily: number;
|
|
726
867
|
currentItemFontSize: number;
|
|
727
|
-
currentItemTextAlign:
|
|
728
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
868
|
+
currentItemTextAlign: string;
|
|
729
869
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
730
870
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
731
|
-
|
|
871
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
732
872
|
viewBackgroundColor: string;
|
|
733
873
|
scrollX: number;
|
|
734
874
|
scrollY: number;
|
|
@@ -742,6 +882,9 @@ export declare const actionToggleTheme: {
|
|
|
742
882
|
}>;
|
|
743
883
|
openMenu: "canvas" | "shape" | null;
|
|
744
884
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
885
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
886
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
887
|
+
isSidebarDocked: boolean;
|
|
745
888
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
746
889
|
selectedElementIds: {
|
|
747
890
|
[id: string]: boolean;
|
|
@@ -750,7 +893,6 @@ export declare const actionToggleTheme: {
|
|
|
750
893
|
[id: string]: boolean;
|
|
751
894
|
};
|
|
752
895
|
shouldCacheIgnoreZoom: boolean;
|
|
753
|
-
showHelpDialog: boolean;
|
|
754
896
|
toast: {
|
|
755
897
|
message: string;
|
|
756
898
|
closable?: boolean | undefined;
|
|
@@ -767,8 +909,6 @@ export declare const actionToggleTheme: {
|
|
|
767
909
|
height: number;
|
|
768
910
|
offsetTop: number;
|
|
769
911
|
offsetLeft: number;
|
|
770
|
-
isLibraryOpen: boolean;
|
|
771
|
-
isLibraryMenuDocked: boolean;
|
|
772
912
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
773
913
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
774
914
|
showStats: boolean;
|
|
@@ -786,13 +926,13 @@ export declare const actionToggleTheme: {
|
|
|
786
926
|
};
|
|
787
927
|
commitToHistory: false;
|
|
788
928
|
};
|
|
789
|
-
PanelComponent: ({ appState, updateData }: import("./types").PanelComponentProps) => JSX.Element;
|
|
790
929
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
930
|
+
predicate: (elements: readonly ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
|
|
791
931
|
} & {
|
|
792
932
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
793
933
|
};
|
|
794
|
-
export declare const
|
|
795
|
-
name: "
|
|
934
|
+
export declare const actionToggleEraserTool: {
|
|
935
|
+
name: "toggleEraserTool";
|
|
796
936
|
trackEvent: {
|
|
797
937
|
category: "toolbar";
|
|
798
938
|
};
|
|
@@ -801,18 +941,134 @@ export declare const actionErase: {
|
|
|
801
941
|
selectedElementIds: {};
|
|
802
942
|
selectedGroupIds: {};
|
|
803
943
|
activeTool: {
|
|
804
|
-
|
|
805
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
944
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
806
945
|
locked: boolean;
|
|
946
|
+
} & ({
|
|
947
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
807
948
|
customType: null;
|
|
808
949
|
} | {
|
|
809
950
|
type: "custom";
|
|
810
951
|
customType: string;
|
|
811
|
-
|
|
812
|
-
|
|
952
|
+
});
|
|
953
|
+
contextMenu: {
|
|
954
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
955
|
+
top: number;
|
|
956
|
+
left: number;
|
|
957
|
+
} | null;
|
|
958
|
+
showWelcomeScreen: boolean;
|
|
959
|
+
isLoading: boolean;
|
|
960
|
+
errorMessage: import("react").ReactNode;
|
|
961
|
+
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
962
|
+
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
963
|
+
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
964
|
+
selectionElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
965
|
+
isBindingEnabled: boolean;
|
|
966
|
+
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
967
|
+
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
968
|
+
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
969
|
+
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
970
|
+
penMode: boolean;
|
|
971
|
+
penDetected: boolean;
|
|
972
|
+
exportBackground: boolean;
|
|
973
|
+
exportEmbedScene: boolean;
|
|
974
|
+
exportWithDarkMode: boolean;
|
|
975
|
+
exportScale: number;
|
|
976
|
+
currentItemStrokeColor: string;
|
|
977
|
+
currentItemBackgroundColor: string;
|
|
978
|
+
currentItemFillStyle: import("../element/types").FillStyle;
|
|
979
|
+
currentItemStrokeWidth: number;
|
|
980
|
+
currentItemStrokeStyle: import("../element/types").StrokeStyle;
|
|
981
|
+
currentItemRoughness: number;
|
|
982
|
+
currentItemOpacity: number;
|
|
983
|
+
currentItemFontFamily: number;
|
|
984
|
+
currentItemFontSize: number;
|
|
985
|
+
currentItemTextAlign: string;
|
|
986
|
+
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
987
|
+
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
988
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
989
|
+
viewBackgroundColor: string;
|
|
990
|
+
scrollX: number;
|
|
991
|
+
scrollY: number;
|
|
992
|
+
cursorButton: "up" | "down";
|
|
993
|
+
scrolledOutside: boolean;
|
|
994
|
+
name: string;
|
|
995
|
+
isResizing: boolean;
|
|
996
|
+
isRotating: boolean;
|
|
997
|
+
zoom: Readonly<{
|
|
998
|
+
value: NormalizedZoomValue;
|
|
999
|
+
}>;
|
|
1000
|
+
openMenu: "canvas" | "shape" | null;
|
|
1001
|
+
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
1002
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
1003
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
1004
|
+
isSidebarDocked: boolean;
|
|
1005
|
+
lastPointerDownWith: import("../element/types").PointerType;
|
|
1006
|
+
previousSelectedElementIds: {
|
|
1007
|
+
[id: string]: boolean;
|
|
1008
|
+
};
|
|
1009
|
+
shouldCacheIgnoreZoom: boolean;
|
|
1010
|
+
toast: {
|
|
1011
|
+
message: string;
|
|
1012
|
+
closable?: boolean | undefined;
|
|
1013
|
+
duration?: number | undefined;
|
|
1014
|
+
} | null;
|
|
1015
|
+
zenModeEnabled: boolean;
|
|
1016
|
+
theme: string;
|
|
1017
|
+
gridSize: number | null;
|
|
1018
|
+
viewModeEnabled: boolean;
|
|
1019
|
+
editingGroupId: string | null;
|
|
1020
|
+
width: number;
|
|
1021
|
+
height: number;
|
|
1022
|
+
offsetTop: number;
|
|
1023
|
+
offsetLeft: number;
|
|
1024
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
1025
|
+
collaborators: Map<string, import("../types").Collaborator>;
|
|
1026
|
+
showStats: boolean;
|
|
1027
|
+
currentChartType: import("../element/types").ChartType;
|
|
1028
|
+
pasteDialog: {
|
|
1029
|
+
shown: false;
|
|
1030
|
+
data: null;
|
|
1031
|
+
} | {
|
|
1032
|
+
shown: true;
|
|
1033
|
+
data: import("../charts").Spreadsheet;
|
|
813
1034
|
};
|
|
1035
|
+
pendingImageElementId: string | null;
|
|
1036
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
1037
|
+
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
1038
|
+
};
|
|
1039
|
+
commitToHistory: true;
|
|
1040
|
+
};
|
|
1041
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
1042
|
+
} & {
|
|
1043
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
1044
|
+
};
|
|
1045
|
+
export declare const actionToggleHandTool: {
|
|
1046
|
+
name: "toggleHandTool";
|
|
1047
|
+
trackEvent: {
|
|
1048
|
+
category: "toolbar";
|
|
1049
|
+
};
|
|
1050
|
+
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties) => {
|
|
1051
|
+
appState: {
|
|
1052
|
+
selectedElementIds: {};
|
|
1053
|
+
selectedGroupIds: {};
|
|
1054
|
+
activeTool: {
|
|
1055
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
1056
|
+
locked: boolean;
|
|
1057
|
+
} & ({
|
|
1058
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
1059
|
+
customType: null;
|
|
1060
|
+
} | {
|
|
1061
|
+
type: "custom";
|
|
1062
|
+
customType: string;
|
|
1063
|
+
});
|
|
1064
|
+
contextMenu: {
|
|
1065
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
1066
|
+
top: number;
|
|
1067
|
+
left: number;
|
|
1068
|
+
} | null;
|
|
1069
|
+
showWelcomeScreen: boolean;
|
|
814
1070
|
isLoading: boolean;
|
|
815
|
-
errorMessage:
|
|
1071
|
+
errorMessage: import("react").ReactNode;
|
|
816
1072
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
817
1073
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
818
1074
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -837,11 +1093,10 @@ export declare const actionErase: {
|
|
|
837
1093
|
currentItemOpacity: number;
|
|
838
1094
|
currentItemFontFamily: number;
|
|
839
1095
|
currentItemFontSize: number;
|
|
840
|
-
currentItemTextAlign:
|
|
841
|
-
currentItemStrokeSharpness: import("../element/types").StrokeSharpness;
|
|
1096
|
+
currentItemTextAlign: string;
|
|
842
1097
|
currentItemStartArrowhead: import("../element/types").Arrowhead | null;
|
|
843
1098
|
currentItemEndArrowhead: import("../element/types").Arrowhead | null;
|
|
844
|
-
|
|
1099
|
+
currentItemRoundness: import("../element/types").StrokeRoundness;
|
|
845
1100
|
viewBackgroundColor: string;
|
|
846
1101
|
scrollX: number;
|
|
847
1102
|
scrollY: number;
|
|
@@ -855,12 +1110,14 @@ export declare const actionErase: {
|
|
|
855
1110
|
}>;
|
|
856
1111
|
openMenu: "canvas" | "shape" | null;
|
|
857
1112
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
1113
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
1114
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
1115
|
+
isSidebarDocked: boolean;
|
|
858
1116
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
859
1117
|
previousSelectedElementIds: {
|
|
860
1118
|
[id: string]: boolean;
|
|
861
1119
|
};
|
|
862
1120
|
shouldCacheIgnoreZoom: boolean;
|
|
863
|
-
showHelpDialog: boolean;
|
|
864
1121
|
toast: {
|
|
865
1122
|
message: string;
|
|
866
1123
|
closable?: boolean | undefined;
|
|
@@ -875,8 +1132,6 @@ export declare const actionErase: {
|
|
|
875
1132
|
height: number;
|
|
876
1133
|
offsetTop: number;
|
|
877
1134
|
offsetLeft: number;
|
|
878
|
-
isLibraryOpen: boolean;
|
|
879
|
-
isLibraryMenuDocked: boolean;
|
|
880
1135
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
881
1136
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
882
1137
|
showStats: boolean;
|
|
@@ -895,7 +1150,6 @@ export declare const actionErase: {
|
|
|
895
1150
|
commitToHistory: true;
|
|
896
1151
|
};
|
|
897
1152
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
898
|
-
PanelComponent: ({ elements, appState, updateData, data }: import("./types").PanelComponentProps) => JSX.Element;
|
|
899
1153
|
} & {
|
|
900
1154
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
901
1155
|
};
|