@myoc/element 0.19.502-ff5a131b0 → 0.19.504
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/dist/dev/index.js +16104 -10410
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/index.js +45 -20
- package/dist/types/common/debug.d.ts +21 -0
- package/dist/types/common/src/appEventBus.d.ts +27 -0
- package/dist/types/common/src/colors.d.ts +1 -1
- package/dist/types/common/src/constants.d.ts +3 -0
- package/dist/types/common/src/index.d.ts +3 -0
- package/dist/types/common/src/utils.d.ts +4 -7
- package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
- package/dist/types/element/src/Scene.d.ts +2 -0
- package/dist/types/element/src/arrange-algorithms/maxRects.d.ts +16 -0
- package/dist/types/element/src/arrowheads.d.ts +3 -0
- package/dist/types/element/src/arrows/focus.d.ts +27 -0
- package/dist/types/element/src/arrows/helpers.d.ts +5 -0
- package/dist/types/element/src/binding.d.ts +13 -8
- package/dist/types/element/src/bounds.d.ts +1 -1
- package/dist/types/element/src/collision.d.ts +4 -3
- package/dist/types/element/src/distribute.d.ts +2 -1
- package/dist/types/element/src/elbowArrow.d.ts +2 -0
- package/dist/types/element/src/index.d.ts +4 -0
- package/dist/types/element/src/linearElementEditor.d.ts +6 -1
- package/dist/types/element/src/mutateElement.d.ts +2 -0
- package/dist/types/element/src/selection.d.ts +5 -1
- package/dist/types/element/src/shapes.d.ts +2 -22
- package/dist/types/element/src/textElement.d.ts +1 -1
- package/dist/types/element/src/textWrapping.d.ts +26 -0
- package/dist/types/element/src/types.d.ts +6 -3
- package/dist/types/element/src/utils.d.ts +5 -3
- package/dist/types/element/src/zindex.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +38 -35
- package/dist/types/excalidraw/actions/actionAlign.d.ts +8 -8
- package/dist/types/excalidraw/actions/actionArrange.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +27 -25
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +159 -148
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +28 -26
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +43 -38
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +9 -12
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +28 -26
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionExport.d.ts +87 -380
- package/dist/types/excalidraw/actions/actionFlip.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionFrame.d.ts +54 -50
- package/dist/types/excalidraw/actions/actionGroup.d.ts +31 -29
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +15 -12
- package/dist/types/excalidraw/actions/actionLink.d.ts +15 -14
- package/dist/types/excalidraw/actions/actionMenu.d.ts +11 -14
- package/dist/types/excalidraw/actions/actionProperties.d.ts +33 -31
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +16 -15
- package/dist/types/excalidraw/actions/actionSmartZoom.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionStyles.d.ts +17 -15
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +181 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +15 -14
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +181 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +15 -14
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +11 -14
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +15 -14
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +15 -14
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +15 -14
- package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -8
- package/dist/types/excalidraw/actions/index.d.ts +2 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +15 -13
- package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
- package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
- package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
- package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
- package/dist/types/excalidraw/charts/index.d.ts +7 -0
- package/dist/types/excalidraw/clipboard.d.ts +6 -7
- package/dist/types/excalidraw/components/App.d.ts +57 -14
- package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
- package/dist/types/excalidraw/components/CommandPalette/types.d.ts +1 -1
- package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
- package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
- package/dist/types/excalidraw/components/Range.d.ts +10 -4
- package/dist/types/excalidraw/components/Toast.d.ts +8 -4
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +30 -17
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +3 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +11 -13
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
- package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
- package/dist/types/excalidraw/components/icons.d.ts +23 -9
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +17 -0
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +23 -13
- package/dist/types/excalidraw/data/blob.d.ts +57 -56
- package/dist/types/excalidraw/data/filesystem.d.ts +3 -5
- package/dist/types/excalidraw/data/index.d.ts +2 -3
- package/dist/types/excalidraw/data/json.d.ts +43 -34
- package/dist/types/excalidraw/data/resave.d.ts +7 -2
- package/dist/types/excalidraw/editorPreferences.d.ts +11 -0
- package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
- package/dist/types/excalidraw/types.d.ts +114 -16
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +5 -1
- package/dist/types/math/src/point.d.ts +7 -2
- package/dist/types/math/src/types.d.ts +25 -1
- package/package.json +3 -3
- package/dist/types/excalidraw/charts.d.ts +0 -27
- package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
- package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
- package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -11
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -84
- package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
- package/dist/types/excalidraw/index.d.ts +0 -42
- package/dist/types/excalidraw/polyfill.d.ts +0 -2
|
@@ -2,12 +2,11 @@ import { IMAGE_MIME_TYPES, MIME_TYPES } from "@excalidraw/common";
|
|
|
2
2
|
import type { ValueOf } from "@excalidraw/common/utility-types";
|
|
3
3
|
import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
|
|
4
4
|
import type { AppState, DataURL, LibraryItem } from "../types";
|
|
5
|
-
import type { FileSystemHandle } from "browser-fs-access";
|
|
6
5
|
import type { ImportedLibraryData } from "./types";
|
|
7
6
|
export declare const getMimeType: (blob: Blob | string) => string;
|
|
8
|
-
export declare const getFileHandleType: (handle:
|
|
7
|
+
export declare const getFileHandleType: (handle: FileSystemFileHandle | null) => string | null;
|
|
9
8
|
export declare const isImageFileHandleType: (type: string | null) => type is "png" | "svg";
|
|
10
|
-
export declare const isImageFileHandle: (handle:
|
|
9
|
+
export declare const isImageFileHandle: (handle: FileSystemFileHandle | null) => handle is FileSystemFileHandle;
|
|
11
10
|
export declare const isSupportedImageFileType: (type: string | null | undefined) => boolean;
|
|
12
11
|
export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
|
|
13
12
|
type: ValueOf<typeof IMAGE_MIME_TYPES>;
|
|
@@ -15,8 +14,8 @@ export declare const isSupportedImageFile: (blob: Blob | null | undefined) => bl
|
|
|
15
14
|
export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File,
|
|
16
15
|
/** @see restore.localAppState */
|
|
17
16
|
localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
|
|
18
|
-
/**
|
|
19
|
-
fileHandle?:
|
|
17
|
+
/** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
|
|
18
|
+
fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
20
19
|
type: "application/vnd.excalidraw+json";
|
|
21
20
|
data: {
|
|
22
21
|
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
@@ -43,12 +42,21 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
43
42
|
} | {
|
|
44
43
|
name: "elementLinkSelector";
|
|
45
44
|
sourceElementId: ExcalidrawElement["id"];
|
|
45
|
+
} | {
|
|
46
|
+
name: "charts";
|
|
47
|
+
data: import("../charts").Spreadsheet;
|
|
48
|
+
rawText: string;
|
|
46
49
|
};
|
|
47
50
|
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
48
51
|
selectedElementIds: Readonly<{
|
|
49
52
|
[id: string]: true;
|
|
50
53
|
}>;
|
|
51
54
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
55
|
+
activeTool: {
|
|
56
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
57
|
+
locked: boolean;
|
|
58
|
+
fromSelection: boolean;
|
|
59
|
+
} & import("../types").ActiveTool;
|
|
52
60
|
activeEmbeddable: {
|
|
53
61
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
54
62
|
state: "hover" | "active";
|
|
@@ -61,13 +69,17 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
61
69
|
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
62
70
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
63
71
|
isBindingEnabled: boolean;
|
|
64
|
-
|
|
72
|
+
isMidpointSnappingEnabled: boolean;
|
|
73
|
+
suggestedBinding: {
|
|
74
|
+
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
75
|
+
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
76
|
+
} | null;
|
|
65
77
|
isRotating: boolean;
|
|
66
78
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
67
79
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
68
80
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
69
81
|
zenModeEnabled: boolean;
|
|
70
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
82
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
71
83
|
isCropping: boolean;
|
|
72
84
|
croppingElementId: ExcalidrawElement["id"] | null;
|
|
73
85
|
searchMatches: Readonly<{
|
|
@@ -80,8 +92,15 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
80
92
|
}>;
|
|
81
93
|
shouldCacheIgnoreZoom: boolean;
|
|
82
94
|
exportScale: number;
|
|
95
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
83
96
|
bindMode: import("@excalidraw/element/types").BindMode;
|
|
84
97
|
gridSize: number;
|
|
98
|
+
gridModeEnabled: boolean;
|
|
99
|
+
objectsSnapModeEnabled: boolean;
|
|
100
|
+
wheelZoomsOnDefault?: boolean | undefined;
|
|
101
|
+
selectedElementsAreBeingDragged: boolean;
|
|
102
|
+
gridStep: number;
|
|
103
|
+
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
85
104
|
contextMenu: {
|
|
86
105
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
87
106
|
top: number;
|
|
@@ -92,7 +111,6 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
92
111
|
myocSimplifiedMode: boolean;
|
|
93
112
|
dontResizeLimitMBs: number;
|
|
94
113
|
hideMainMenus: boolean;
|
|
95
|
-
wheelZoomsOnDefault?: boolean | undefined;
|
|
96
114
|
arrangeConfiguration: {
|
|
97
115
|
algorithm: import("@excalidraw/element/types").ArrangeAlgorithms;
|
|
98
116
|
gap: number;
|
|
@@ -103,13 +121,9 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
103
121
|
};
|
|
104
122
|
errorMessage: React.ReactNode;
|
|
105
123
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
124
|
+
bindingPreference: "enabled" | "disabled";
|
|
106
125
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
107
126
|
editingFrame: string | null;
|
|
108
|
-
activeTool: {
|
|
109
|
-
lastActiveTool: import("../types").ActiveTool | null;
|
|
110
|
-
locked: boolean;
|
|
111
|
-
fromSelection: boolean;
|
|
112
|
-
} & import("../types").ActiveTool;
|
|
113
127
|
preferredSelectionTool: {
|
|
114
128
|
type: "selection" | "lasso";
|
|
115
129
|
initialized: boolean;
|
|
@@ -131,9 +145,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
131
145
|
currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
|
|
132
146
|
currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
133
147
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
134
|
-
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
135
148
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
136
|
-
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
137
149
|
cursorButton: "up" | "down";
|
|
138
150
|
scrolledOutside: boolean;
|
|
139
151
|
isResizing: boolean;
|
|
@@ -148,33 +160,21 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
148
160
|
previousSelectedElementIds: {
|
|
149
161
|
[id: string]: true;
|
|
150
162
|
};
|
|
151
|
-
selectedElementsAreBeingDragged: boolean;
|
|
152
163
|
toast: {
|
|
153
|
-
message:
|
|
164
|
+
message: React.ReactNode;
|
|
154
165
|
closable?: boolean;
|
|
155
166
|
duration?: number;
|
|
156
167
|
} | null;
|
|
157
|
-
|
|
158
|
-
gridModeEnabled: boolean;
|
|
159
|
-
fileHandle: FileSystemHandle | null;
|
|
168
|
+
fileHandle: FileSystemFileHandle | null;
|
|
160
169
|
stats: {
|
|
161
170
|
open: boolean;
|
|
162
171
|
panels: number;
|
|
163
172
|
};
|
|
164
|
-
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
165
|
-
pasteDialog: {
|
|
166
|
-
shown: false;
|
|
167
|
-
data: null;
|
|
168
|
-
} | {
|
|
169
|
-
shown: true;
|
|
170
|
-
data: import("../charts").Spreadsheet;
|
|
171
|
-
};
|
|
172
173
|
showHyperlinkPopup: false | "info" | "editor";
|
|
173
174
|
originSnapOffset: {
|
|
174
175
|
x: number;
|
|
175
176
|
y: number;
|
|
176
177
|
} | null;
|
|
177
|
-
objectsSnapModeEnabled: boolean;
|
|
178
178
|
userToFollow: import("../types").UserToFollow | null;
|
|
179
179
|
followedBy: Set<import("../types").SocketId>;
|
|
180
180
|
lockedMultiSelections: {
|
|
@@ -190,8 +190,8 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
190
190
|
export declare const loadFromBlob: (blob: Blob,
|
|
191
191
|
/** @see restore.localAppState */
|
|
192
192
|
localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
|
|
193
|
-
/**
|
|
194
|
-
fileHandle?:
|
|
193
|
+
/** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
|
|
194
|
+
fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
195
195
|
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
196
196
|
appState: {
|
|
197
197
|
viewBackgroundColor: string;
|
|
@@ -216,12 +216,21 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
216
216
|
} | {
|
|
217
217
|
name: "elementLinkSelector";
|
|
218
218
|
sourceElementId: ExcalidrawElement["id"];
|
|
219
|
+
} | {
|
|
220
|
+
name: "charts";
|
|
221
|
+
data: import("../charts").Spreadsheet;
|
|
222
|
+
rawText: string;
|
|
219
223
|
};
|
|
220
224
|
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
221
225
|
selectedElementIds: Readonly<{
|
|
222
226
|
[id: string]: true;
|
|
223
227
|
}>;
|
|
224
228
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
229
|
+
activeTool: {
|
|
230
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
231
|
+
locked: boolean;
|
|
232
|
+
fromSelection: boolean;
|
|
233
|
+
} & import("../types").ActiveTool;
|
|
225
234
|
activeEmbeddable: {
|
|
226
235
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
227
236
|
state: "hover" | "active";
|
|
@@ -234,13 +243,17 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
234
243
|
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
235
244
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
236
245
|
isBindingEnabled: boolean;
|
|
237
|
-
|
|
246
|
+
isMidpointSnappingEnabled: boolean;
|
|
247
|
+
suggestedBinding: {
|
|
248
|
+
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
249
|
+
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
250
|
+
} | null;
|
|
238
251
|
isRotating: boolean;
|
|
239
252
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
240
253
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
241
254
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
242
255
|
zenModeEnabled: boolean;
|
|
243
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
256
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
244
257
|
isCropping: boolean;
|
|
245
258
|
croppingElementId: ExcalidrawElement["id"] | null;
|
|
246
259
|
searchMatches: Readonly<{
|
|
@@ -253,8 +266,15 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
253
266
|
}>;
|
|
254
267
|
shouldCacheIgnoreZoom: boolean;
|
|
255
268
|
exportScale: number;
|
|
269
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
256
270
|
bindMode: import("@excalidraw/element/types").BindMode;
|
|
257
271
|
gridSize: number;
|
|
272
|
+
gridModeEnabled: boolean;
|
|
273
|
+
objectsSnapModeEnabled: boolean;
|
|
274
|
+
wheelZoomsOnDefault?: boolean | undefined;
|
|
275
|
+
selectedElementsAreBeingDragged: boolean;
|
|
276
|
+
gridStep: number;
|
|
277
|
+
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
258
278
|
contextMenu: {
|
|
259
279
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
260
280
|
top: number;
|
|
@@ -265,7 +285,6 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
265
285
|
myocSimplifiedMode: boolean;
|
|
266
286
|
dontResizeLimitMBs: number;
|
|
267
287
|
hideMainMenus: boolean;
|
|
268
|
-
wheelZoomsOnDefault?: boolean | undefined;
|
|
269
288
|
arrangeConfiguration: {
|
|
270
289
|
algorithm: import("@excalidraw/element/types").ArrangeAlgorithms;
|
|
271
290
|
gap: number;
|
|
@@ -276,13 +295,9 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
276
295
|
};
|
|
277
296
|
errorMessage: React.ReactNode;
|
|
278
297
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
298
|
+
bindingPreference: "enabled" | "disabled";
|
|
279
299
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
280
300
|
editingFrame: string | null;
|
|
281
|
-
activeTool: {
|
|
282
|
-
lastActiveTool: import("../types").ActiveTool | null;
|
|
283
|
-
locked: boolean;
|
|
284
|
-
fromSelection: boolean;
|
|
285
|
-
} & import("../types").ActiveTool;
|
|
286
301
|
preferredSelectionTool: {
|
|
287
302
|
type: "selection" | "lasso";
|
|
288
303
|
initialized: boolean;
|
|
@@ -304,9 +319,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
304
319
|
currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
|
|
305
320
|
currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
306
321
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
307
|
-
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
308
322
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
309
|
-
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
310
323
|
cursorButton: "up" | "down";
|
|
311
324
|
scrolledOutside: boolean;
|
|
312
325
|
isResizing: boolean;
|
|
@@ -321,33 +334,21 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
321
334
|
previousSelectedElementIds: {
|
|
322
335
|
[id: string]: true;
|
|
323
336
|
};
|
|
324
|
-
selectedElementsAreBeingDragged: boolean;
|
|
325
337
|
toast: {
|
|
326
|
-
message:
|
|
338
|
+
message: React.ReactNode;
|
|
327
339
|
closable?: boolean;
|
|
328
340
|
duration?: number;
|
|
329
341
|
} | null;
|
|
330
|
-
|
|
331
|
-
gridModeEnabled: boolean;
|
|
332
|
-
fileHandle: FileSystemHandle | null;
|
|
342
|
+
fileHandle: FileSystemFileHandle | null;
|
|
333
343
|
stats: {
|
|
334
344
|
open: boolean;
|
|
335
345
|
panels: number;
|
|
336
346
|
};
|
|
337
|
-
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
338
|
-
pasteDialog: {
|
|
339
|
-
shown: false;
|
|
340
|
-
data: null;
|
|
341
|
-
} | {
|
|
342
|
-
shown: true;
|
|
343
|
-
data: import("../charts").Spreadsheet;
|
|
344
|
-
};
|
|
345
347
|
showHyperlinkPopup: false | "info" | "editor";
|
|
346
348
|
originSnapOffset: {
|
|
347
349
|
x: number;
|
|
348
350
|
y: number;
|
|
349
351
|
} | null;
|
|
350
|
-
objectsSnapModeEnabled: boolean;
|
|
351
352
|
userToFollow: import("../types").UserToFollow | null;
|
|
352
353
|
followedBy: Set<import("../types").SocketId>;
|
|
353
354
|
lockedMultiSelections: {
|
|
@@ -376,7 +377,7 @@ export declare const SVGStringToFile: (SVGString: string, filename?: string) =>
|
|
|
376
377
|
type: typeof MIME_TYPES.svg;
|
|
377
378
|
};
|
|
378
379
|
export declare const ImageURLToFile: (imageUrl: string, filename?: string) => Promise<File | undefined>;
|
|
379
|
-
export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<
|
|
380
|
+
export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemFileHandle | null>;
|
|
380
381
|
export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: string, name: string | undefined) => File;
|
|
381
382
|
/** attempts to detect correct mimeType if none is set, or if an image
|
|
382
383
|
* has an incorrect extension.
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { supported as nativeFileSystemSupported } from "browser-fs-access";
|
|
2
2
|
import { MIME_TYPES } from "@excalidraw/common";
|
|
3
|
-
import type { FileSystemHandle } from "browser-fs-access";
|
|
4
3
|
type FILE_EXTENSION = Exclude<keyof typeof MIME_TYPES, "binary">;
|
|
5
4
|
export declare const fileOpen: <M extends boolean | undefined = false>(opts: {
|
|
6
5
|
extensions?: FILE_EXTENSION[];
|
|
@@ -14,8 +13,7 @@ export declare const fileSave: (blob: Blob | Promise<Blob>, opts: {
|
|
|
14
13
|
extension: FILE_EXTENSION;
|
|
15
14
|
mimeTypes?: string[];
|
|
16
15
|
description: string;
|
|
17
|
-
/** existing
|
|
18
|
-
fileHandle?:
|
|
19
|
-
}) => Promise<
|
|
16
|
+
/** existing FileSystemFileHandle */
|
|
17
|
+
fileHandle?: FileSystemFileHandle | null;
|
|
18
|
+
}) => Promise<FileSystemFileHandle | null>;
|
|
20
19
|
export { nativeFileSystemSupported };
|
|
21
|
-
export type { FileSystemHandle };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type { FileSystemHandle } from "./filesystem";
|
|
3
2
|
import type { ExportType } from "../scene/types";
|
|
4
3
|
import type { AppState, BinaryFiles } from "../types";
|
|
5
4
|
export { loadFromBlob } from "./blob";
|
|
@@ -17,6 +16,6 @@ export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements:
|
|
|
17
16
|
viewBackgroundColor: string;
|
|
18
17
|
/** filename, if applicable */
|
|
19
18
|
name?: string;
|
|
20
|
-
fileHandle?:
|
|
19
|
+
fileHandle?: FileSystemFileHandle | null;
|
|
21
20
|
exportingFrame: ExcalidrawFrameLikeElement | null;
|
|
22
|
-
}) => Promise<
|
|
21
|
+
}) => Promise<FileSystemFileHandle | null | undefined>;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
1
|
+
import type { ExcalidrawElement, NonDeleted } from "@excalidraw/element/types";
|
|
2
|
+
import type { MaybePromise } from "@excalidraw/common/utility-types";
|
|
2
3
|
import type { AppState, BinaryFiles, LibraryItems } from "../types";
|
|
3
4
|
import type { ImportedDataState, ImportedLibraryData } from "./types";
|
|
5
|
+
export type JSONExportData = {
|
|
6
|
+
elements: readonly NonDeleted<ExcalidrawElement>[];
|
|
7
|
+
appState: AppState;
|
|
8
|
+
files: BinaryFiles;
|
|
9
|
+
};
|
|
4
10
|
export declare const serializeAsJSON: (elements: readonly ExcalidrawElement[], appState: Partial<AppState>, files: BinaryFiles, type: "local" | "database") => string;
|
|
5
|
-
export declare const saveAsJSON: (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
fileHandle:
|
|
11
|
+
export declare const saveAsJSON: ({ data, filename, fileHandle, }: {
|
|
12
|
+
data: MaybePromise<JSONExportData>;
|
|
13
|
+
filename: string;
|
|
14
|
+
fileHandle: AppState["fileHandle"];
|
|
15
|
+
}) => Promise<{
|
|
16
|
+
fileHandle: FileSystemFileHandle | null;
|
|
9
17
|
}>;
|
|
10
18
|
export declare const loadFromJSON: (localAppState: AppState, localElements: readonly ExcalidrawElement[] | null) => Promise<{
|
|
11
19
|
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
@@ -32,12 +40,21 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
32
40
|
} | {
|
|
33
41
|
name: "elementLinkSelector";
|
|
34
42
|
sourceElementId: ExcalidrawElement["id"];
|
|
43
|
+
} | {
|
|
44
|
+
name: "charts";
|
|
45
|
+
data: import("../charts").Spreadsheet;
|
|
46
|
+
rawText: string;
|
|
35
47
|
};
|
|
36
48
|
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
37
49
|
selectedElementIds: Readonly<{
|
|
38
50
|
[id: string]: true;
|
|
39
51
|
}>;
|
|
40
|
-
frameToHighlight:
|
|
52
|
+
frameToHighlight: NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
53
|
+
activeTool: {
|
|
54
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
55
|
+
locked: boolean;
|
|
56
|
+
fromSelection: boolean;
|
|
57
|
+
} & import("../types").ActiveTool;
|
|
41
58
|
activeEmbeddable: {
|
|
42
59
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
43
60
|
state: "hover" | "active";
|
|
@@ -47,16 +64,20 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
47
64
|
[groupId: string]: boolean;
|
|
48
65
|
};
|
|
49
66
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
50
|
-
multiElement:
|
|
51
|
-
newElement:
|
|
67
|
+
multiElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
68
|
+
newElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
52
69
|
isBindingEnabled: boolean;
|
|
53
|
-
|
|
70
|
+
isMidpointSnappingEnabled: boolean;
|
|
71
|
+
suggestedBinding: {
|
|
72
|
+
element: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
73
|
+
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
74
|
+
} | null;
|
|
54
75
|
isRotating: boolean;
|
|
55
|
-
elementsToHighlight:
|
|
76
|
+
elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
|
|
56
77
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
57
78
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
58
79
|
zenModeEnabled: boolean;
|
|
59
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
80
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
60
81
|
isCropping: boolean;
|
|
61
82
|
croppingElementId: ExcalidrawElement["id"] | null;
|
|
62
83
|
searchMatches: Readonly<{
|
|
@@ -69,8 +90,15 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
69
90
|
}>;
|
|
70
91
|
shouldCacheIgnoreZoom: boolean;
|
|
71
92
|
exportScale: number;
|
|
93
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
72
94
|
bindMode: import("@excalidraw/element/types").BindMode;
|
|
73
95
|
gridSize: number;
|
|
96
|
+
gridModeEnabled: boolean;
|
|
97
|
+
objectsSnapModeEnabled: boolean;
|
|
98
|
+
wheelZoomsOnDefault?: boolean | undefined;
|
|
99
|
+
selectedElementsAreBeingDragged: boolean;
|
|
100
|
+
gridStep: number;
|
|
101
|
+
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
74
102
|
contextMenu: {
|
|
75
103
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
76
104
|
top: number;
|
|
@@ -81,7 +109,6 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
81
109
|
myocSimplifiedMode: boolean;
|
|
82
110
|
dontResizeLimitMBs: number;
|
|
83
111
|
hideMainMenus: boolean;
|
|
84
|
-
wheelZoomsOnDefault?: boolean | undefined;
|
|
85
112
|
arrangeConfiguration: {
|
|
86
113
|
algorithm: import("@excalidraw/element/types").ArrangeAlgorithms;
|
|
87
114
|
gap: number;
|
|
@@ -92,13 +119,9 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
92
119
|
};
|
|
93
120
|
errorMessage: React.ReactNode;
|
|
94
121
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
95
|
-
|
|
122
|
+
bindingPreference: "enabled" | "disabled";
|
|
123
|
+
startBoundElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
96
124
|
editingFrame: string | null;
|
|
97
|
-
activeTool: {
|
|
98
|
-
lastActiveTool: import("../types").ActiveTool | null;
|
|
99
|
-
locked: boolean;
|
|
100
|
-
fromSelection: boolean;
|
|
101
|
-
} & import("../types").ActiveTool;
|
|
102
125
|
preferredSelectionTool: {
|
|
103
126
|
type: "selection" | "lasso";
|
|
104
127
|
initialized: boolean;
|
|
@@ -120,9 +143,7 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
120
143
|
currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
|
|
121
144
|
currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
122
145
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
123
|
-
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
124
146
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
125
|
-
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
126
147
|
cursorButton: "up" | "down";
|
|
127
148
|
scrolledOutside: boolean;
|
|
128
149
|
isResizing: boolean;
|
|
@@ -137,33 +158,21 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
137
158
|
previousSelectedElementIds: {
|
|
138
159
|
[id: string]: true;
|
|
139
160
|
};
|
|
140
|
-
selectedElementsAreBeingDragged: boolean;
|
|
141
161
|
toast: {
|
|
142
|
-
message:
|
|
162
|
+
message: React.ReactNode;
|
|
143
163
|
closable?: boolean;
|
|
144
164
|
duration?: number;
|
|
145
165
|
} | null;
|
|
146
|
-
|
|
147
|
-
gridModeEnabled: boolean;
|
|
148
|
-
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
166
|
+
fileHandle: FileSystemFileHandle | null;
|
|
149
167
|
stats: {
|
|
150
168
|
open: boolean;
|
|
151
169
|
panels: number;
|
|
152
170
|
};
|
|
153
|
-
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
154
|
-
pasteDialog: {
|
|
155
|
-
shown: false;
|
|
156
|
-
data: null;
|
|
157
|
-
} | {
|
|
158
|
-
shown: true;
|
|
159
|
-
data: import("../charts").Spreadsheet;
|
|
160
|
-
};
|
|
161
171
|
showHyperlinkPopup: false | "info" | "editor";
|
|
162
172
|
originSnapOffset: {
|
|
163
173
|
x: number;
|
|
164
174
|
y: number;
|
|
165
175
|
} | null;
|
|
166
|
-
objectsSnapModeEnabled: boolean;
|
|
167
176
|
userToFollow: import("../types").UserToFollow | null;
|
|
168
177
|
followedBy: Set<import("../types").SocketId>;
|
|
169
178
|
lockedMultiSelections: {
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import type { MaybePromise } from "@excalidraw/common/utility-types";
|
|
1
2
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
3
|
import type { AppState, BinaryFiles } from "../types";
|
|
3
|
-
export declare const resaveAsImageWithScene: (
|
|
4
|
-
|
|
4
|
+
export declare const resaveAsImageWithScene: (data: MaybePromise<{
|
|
5
|
+
elements: readonly ExcalidrawElement[];
|
|
6
|
+
appState: AppState;
|
|
7
|
+
files: BinaryFiles;
|
|
8
|
+
}>, fileHandle: FileSystemFileHandle, filename: string) => Promise<{
|
|
9
|
+
fileHandle: FileSystemFileHandle;
|
|
5
10
|
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AppState, ArrangePreferences, EditorPreferences, NormalisePreferences, SmartZoomPreferences } from "./types";
|
|
2
|
+
export type ResolvedSmartZoomPreferences = Required<SmartZoomPreferences>;
|
|
3
|
+
export type ResolvedArrangePreferences = Required<ArrangePreferences>;
|
|
4
|
+
export type ResolvedNormalisePreferences = Required<NormalisePreferences>;
|
|
5
|
+
export type ResolvedEditorPreferences = {
|
|
6
|
+
smartZoom: ResolvedSmartZoomPreferences;
|
|
7
|
+
arrange: ResolvedArrangePreferences;
|
|
8
|
+
normalise: ResolvedNormalisePreferences;
|
|
9
|
+
};
|
|
10
|
+
export declare const DEFAULT_SMART_ZOOM_PREFERENCES: ResolvedSmartZoomPreferences;
|
|
11
|
+
export declare const getEffectiveEditorPreferences: (appState: Readonly<Pick<AppState, "arrangeConfiguration" | "normaliseConfiguration">>, editorPreferences?: EditorPreferences) => ResolvedEditorPreferences;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type GlobalPoint } from "@excalidraw/math";
|
|
2
|
+
import type { EditorInterface } from "@excalidraw/common";
|
|
3
|
+
import type { ExcalidrawTextElement } from "@excalidraw/element/types";
|
|
4
|
+
export declare const getTextBoxPadding: (zoomValue: number) => number;
|
|
5
|
+
export declare const getTextAutoResizeHandle: (textElement: ExcalidrawTextElement, zoomValue: number, formFactor: EditorInterface["formFactor"]) => {
|
|
6
|
+
center: GlobalPoint | import("@excalidraw/math").LocalPoint;
|
|
7
|
+
start: GlobalPoint;
|
|
8
|
+
end: GlobalPoint;
|
|
9
|
+
hitboxWidth: number;
|
|
10
|
+
hitboxHeight: number;
|
|
11
|
+
} | null;
|
|
12
|
+
export declare const isPointHittingTextAutoResizeHandle: (point: Readonly<{
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
}>, textElement: ExcalidrawTextElement, zoomValue: number, formFactor: EditorInterface["formFactor"]) => boolean;
|