@myoc/common 0.19.502-d9d5eeb32 → 0.19.503
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 +313 -21
- package/dist/dev/index.js.map +3 -3
- package/dist/prod/index.js +3 -3
- 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 +13 -13
- 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/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 +3 -0
- package/dist/types/element/src/linearElementEditor.d.ts +5 -0
- package/dist/types/element/src/mutateElement.d.ts +2 -0
- package/dist/types/element/src/selection.d.ts +6 -2
- 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 +5 -2
- 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/actionBoundText.d.ts +27 -25
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +143 -132
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +26 -24
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +42 -37
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +9 -12
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +26 -24
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionExport.d.ts +112 -405
- package/dist/types/excalidraw/actions/actionFrame.d.ts +52 -48
- package/dist/types/excalidraw/actions/actionGroup.d.ts +29 -27
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +15 -12
- package/dist/types/excalidraw/actions/actionLink.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionMenu.d.ts +9 -12
- package/dist/types/excalidraw/actions/actionProperties.d.ts +29 -27
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +14 -13
- package/dist/types/excalidraw/actions/actionStyles.d.ts +13 -11
- 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 +13 -12
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +181 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +9 -12
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +13 -12
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +13 -12
- 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 +34 -32
- 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 +8 -9
- package/dist/types/excalidraw/components/App.d.ts +55 -13
- 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 +163 -162
- 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 +92 -83
- package/dist/types/excalidraw/data/resave.d.ts +7 -2
- package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
- package/dist/types/excalidraw/index.d.ts +25 -3
- package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
- package/dist/types/excalidraw/types.d.ts +93 -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 +1 -1
- package/dist/types/excalidraw/charts.d.ts +0 -27
|
@@ -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,73 +14,26 @@ 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[];
|
|
23
22
|
appState: {
|
|
24
|
-
viewBackgroundColor: string;
|
|
25
|
-
theme: import("@excalidraw/element/types").Theme;
|
|
26
|
-
frameRendering: {
|
|
27
|
-
enabled: boolean;
|
|
28
|
-
name: boolean;
|
|
29
|
-
outline: boolean;
|
|
30
|
-
clip: boolean;
|
|
31
|
-
};
|
|
32
|
-
name: string | null;
|
|
33
|
-
zoom: import("../types").Zoom;
|
|
34
|
-
scrollX: number;
|
|
35
|
-
scrollY: number;
|
|
36
23
|
viewModeEnabled: boolean;
|
|
37
|
-
openDialog: null | {
|
|
38
|
-
name: "imageExport" | "help" | "jsonExport";
|
|
39
|
-
} | {
|
|
40
|
-
name: "commandPalette";
|
|
41
|
-
} | {
|
|
42
|
-
name: "settings";
|
|
43
|
-
} | {
|
|
44
|
-
name: "elementLinkSelector";
|
|
45
|
-
sourceElementId: ExcalidrawElement["id"];
|
|
46
|
-
};
|
|
47
|
-
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
48
|
-
selectedElementIds: Readonly<{
|
|
49
|
-
[id: string]: true;
|
|
50
|
-
}>;
|
|
51
|
-
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
52
|
-
activeEmbeddable: {
|
|
53
|
-
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
54
|
-
state: "hover" | "active";
|
|
55
|
-
} | null;
|
|
56
|
-
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
57
|
-
selectedGroupIds: {
|
|
58
|
-
[groupId: string]: boolean;
|
|
59
|
-
};
|
|
60
|
-
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
61
|
-
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
62
|
-
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
63
|
-
isBindingEnabled: boolean;
|
|
64
|
-
suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
65
|
-
isRotating: boolean;
|
|
66
|
-
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
67
|
-
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
68
|
-
snapLines: readonly import("../snapping").SnapLine[];
|
|
69
24
|
zenModeEnabled: boolean;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}> | null;
|
|
77
|
-
activeLockedId: string | null;
|
|
78
|
-
hoveredElementIds: Readonly<{
|
|
79
|
-
[id: string]: true;
|
|
80
|
-
}>;
|
|
81
|
-
shouldCacheIgnoreZoom: boolean;
|
|
82
|
-
exportScale: number;
|
|
83
|
-
bindMode: import("@excalidraw/element/types").BindMode;
|
|
25
|
+
gridModeEnabled: boolean;
|
|
26
|
+
objectsSnapModeEnabled: boolean;
|
|
27
|
+
theme: import("@excalidraw/element/types").Theme;
|
|
28
|
+
name: string | null;
|
|
29
|
+
wheelZoomsOnDefault?: boolean | undefined;
|
|
30
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
84
31
|
gridSize: number;
|
|
32
|
+
activeTool: {
|
|
33
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
34
|
+
locked: boolean;
|
|
35
|
+
fromSelection: boolean;
|
|
36
|
+
} & import("../types").ActiveTool;
|
|
85
37
|
contextMenu: {
|
|
86
38
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
87
39
|
top: number;
|
|
@@ -92,7 +44,6 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
92
44
|
myocSimplifiedMode: boolean;
|
|
93
45
|
dontResizeLimitMBs: number;
|
|
94
46
|
hideMainMenus: boolean;
|
|
95
|
-
wheelZoomsOnDefault?: boolean | undefined;
|
|
96
47
|
arrangeConfiguration: {
|
|
97
48
|
algorithm: import("@excalidraw/element/types").ArrangeAlgorithms;
|
|
98
49
|
gap: number;
|
|
@@ -102,14 +53,32 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
102
53
|
metric: import("../types").NormaliseMetric;
|
|
103
54
|
};
|
|
104
55
|
errorMessage: React.ReactNode;
|
|
56
|
+
activeEmbeddable: {
|
|
57
|
+
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
58
|
+
state: "hover" | "active";
|
|
59
|
+
} | null;
|
|
60
|
+
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
105
61
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
62
|
+
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
63
|
+
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
64
|
+
isBindingEnabled: boolean;
|
|
65
|
+
bindingPreference: "enabled" | "disabled";
|
|
66
|
+
isMidpointSnappingEnabled: boolean;
|
|
106
67
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
68
|
+
suggestedBinding: {
|
|
69
|
+
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
70
|
+
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
71
|
+
} | null;
|
|
72
|
+
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
73
|
+
frameRendering: {
|
|
74
|
+
enabled: boolean;
|
|
75
|
+
name: boolean;
|
|
76
|
+
outline: boolean;
|
|
77
|
+
clip: boolean;
|
|
78
|
+
};
|
|
107
79
|
editingFrame: string | null;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
locked: boolean;
|
|
111
|
-
fromSelection: boolean;
|
|
112
|
-
} & import("../types").ActiveTool;
|
|
80
|
+
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
81
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
113
82
|
preferredSelectionTool: {
|
|
114
83
|
type: "selection" | "lasso";
|
|
115
84
|
initialized: boolean;
|
|
@@ -119,6 +88,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
119
88
|
exportBackground: boolean;
|
|
120
89
|
exportEmbedScene: boolean;
|
|
121
90
|
exportWithDarkMode: boolean;
|
|
91
|
+
exportScale: number;
|
|
122
92
|
currentItemStrokeColor: string;
|
|
123
93
|
currentItemBackgroundColor: string;
|
|
124
94
|
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
@@ -133,53 +103,83 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
133
103
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
134
104
|
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
135
105
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
136
|
-
|
|
106
|
+
viewBackgroundColor: string;
|
|
107
|
+
scrollX: number;
|
|
108
|
+
scrollY: number;
|
|
137
109
|
cursorButton: "up" | "down";
|
|
138
110
|
scrolledOutside: boolean;
|
|
139
111
|
isResizing: boolean;
|
|
112
|
+
isRotating: boolean;
|
|
113
|
+
zoom: import("../types").Zoom;
|
|
140
114
|
openMenu: "canvas" | null;
|
|
141
115
|
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
142
116
|
openSidebar: {
|
|
143
117
|
name: import("../types").SidebarName;
|
|
144
118
|
tab?: import("../types").SidebarTabName;
|
|
145
119
|
} | null;
|
|
120
|
+
openDialog: null | {
|
|
121
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
122
|
+
} | {
|
|
123
|
+
name: "commandPalette";
|
|
124
|
+
} | {
|
|
125
|
+
name: "settings";
|
|
126
|
+
} | {
|
|
127
|
+
name: "elementLinkSelector";
|
|
128
|
+
sourceElementId: ExcalidrawElement["id"];
|
|
129
|
+
} | {
|
|
130
|
+
name: "charts";
|
|
131
|
+
data: import("../charts").Spreadsheet;
|
|
132
|
+
rawText: string;
|
|
133
|
+
};
|
|
146
134
|
defaultSidebarDockedPreference: boolean;
|
|
147
135
|
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
136
|
+
selectedElementIds: Readonly<{
|
|
137
|
+
[id: string]: true;
|
|
138
|
+
}>;
|
|
139
|
+
hoveredElementIds: Readonly<{
|
|
140
|
+
[id: string]: true;
|
|
141
|
+
}>;
|
|
148
142
|
previousSelectedElementIds: {
|
|
149
143
|
[id: string]: true;
|
|
150
144
|
};
|
|
151
145
|
selectedElementsAreBeingDragged: boolean;
|
|
146
|
+
shouldCacheIgnoreZoom: boolean;
|
|
152
147
|
toast: {
|
|
153
|
-
message:
|
|
148
|
+
message: React.ReactNode;
|
|
154
149
|
closable?: boolean;
|
|
155
150
|
duration?: number;
|
|
156
151
|
} | null;
|
|
157
152
|
gridStep: number;
|
|
158
|
-
|
|
159
|
-
|
|
153
|
+
selectedGroupIds: {
|
|
154
|
+
[groupId: string]: boolean;
|
|
155
|
+
};
|
|
156
|
+
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
157
|
+
fileHandle: FileSystemFileHandle | null;
|
|
158
|
+
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
160
159
|
stats: {
|
|
161
160
|
open: boolean;
|
|
162
161
|
panels: number;
|
|
163
162
|
};
|
|
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
163
|
showHyperlinkPopup: false | "info" | "editor";
|
|
164
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
165
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
173
166
|
originSnapOffset: {
|
|
174
167
|
x: number;
|
|
175
168
|
y: number;
|
|
176
169
|
} | null;
|
|
177
|
-
objectsSnapModeEnabled: boolean;
|
|
178
170
|
userToFollow: import("../types").UserToFollow | null;
|
|
179
171
|
followedBy: Set<import("../types").SocketId>;
|
|
172
|
+
isCropping: boolean;
|
|
173
|
+
croppingElementId: ExcalidrawElement["id"] | null;
|
|
174
|
+
searchMatches: Readonly<{
|
|
175
|
+
focusedId: ExcalidrawElement["id"] | null;
|
|
176
|
+
matches: readonly import("../types").SearchMatch[];
|
|
177
|
+
}> | null;
|
|
178
|
+
activeLockedId: string | null;
|
|
180
179
|
lockedMultiSelections: {
|
|
181
180
|
[groupId: string]: true;
|
|
182
181
|
};
|
|
182
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
183
183
|
};
|
|
184
184
|
files: import("../types").BinaryFiles;
|
|
185
185
|
};
|
|
@@ -190,71 +190,24 @@ 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
|
-
viewBackgroundColor: string;
|
|
198
|
-
theme: import("@excalidraw/element/types").Theme;
|
|
199
|
-
frameRendering: {
|
|
200
|
-
enabled: boolean;
|
|
201
|
-
name: boolean;
|
|
202
|
-
outline: boolean;
|
|
203
|
-
clip: boolean;
|
|
204
|
-
};
|
|
205
|
-
name: string | null;
|
|
206
|
-
zoom: import("../types").Zoom;
|
|
207
|
-
scrollX: number;
|
|
208
|
-
scrollY: number;
|
|
209
197
|
viewModeEnabled: boolean;
|
|
210
|
-
openDialog: null | {
|
|
211
|
-
name: "imageExport" | "help" | "jsonExport";
|
|
212
|
-
} | {
|
|
213
|
-
name: "commandPalette";
|
|
214
|
-
} | {
|
|
215
|
-
name: "settings";
|
|
216
|
-
} | {
|
|
217
|
-
name: "elementLinkSelector";
|
|
218
|
-
sourceElementId: ExcalidrawElement["id"];
|
|
219
|
-
};
|
|
220
|
-
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
221
|
-
selectedElementIds: Readonly<{
|
|
222
|
-
[id: string]: true;
|
|
223
|
-
}>;
|
|
224
|
-
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
225
|
-
activeEmbeddable: {
|
|
226
|
-
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
227
|
-
state: "hover" | "active";
|
|
228
|
-
} | null;
|
|
229
|
-
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
230
|
-
selectedGroupIds: {
|
|
231
|
-
[groupId: string]: boolean;
|
|
232
|
-
};
|
|
233
|
-
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
234
|
-
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
235
|
-
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
236
|
-
isBindingEnabled: boolean;
|
|
237
|
-
suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
238
|
-
isRotating: boolean;
|
|
239
|
-
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
240
|
-
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
241
|
-
snapLines: readonly import("../snapping").SnapLine[];
|
|
242
198
|
zenModeEnabled: boolean;
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}> | null;
|
|
250
|
-
activeLockedId: string | null;
|
|
251
|
-
hoveredElementIds: Readonly<{
|
|
252
|
-
[id: string]: true;
|
|
253
|
-
}>;
|
|
254
|
-
shouldCacheIgnoreZoom: boolean;
|
|
255
|
-
exportScale: number;
|
|
256
|
-
bindMode: import("@excalidraw/element/types").BindMode;
|
|
199
|
+
gridModeEnabled: boolean;
|
|
200
|
+
objectsSnapModeEnabled: boolean;
|
|
201
|
+
theme: import("@excalidraw/element/types").Theme;
|
|
202
|
+
name: string | null;
|
|
203
|
+
wheelZoomsOnDefault?: boolean | undefined;
|
|
204
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
257
205
|
gridSize: number;
|
|
206
|
+
activeTool: {
|
|
207
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
208
|
+
locked: boolean;
|
|
209
|
+
fromSelection: boolean;
|
|
210
|
+
} & import("../types").ActiveTool;
|
|
258
211
|
contextMenu: {
|
|
259
212
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
260
213
|
top: number;
|
|
@@ -265,7 +218,6 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
265
218
|
myocSimplifiedMode: boolean;
|
|
266
219
|
dontResizeLimitMBs: number;
|
|
267
220
|
hideMainMenus: boolean;
|
|
268
|
-
wheelZoomsOnDefault?: boolean | undefined;
|
|
269
221
|
arrangeConfiguration: {
|
|
270
222
|
algorithm: import("@excalidraw/element/types").ArrangeAlgorithms;
|
|
271
223
|
gap: number;
|
|
@@ -275,14 +227,32 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
275
227
|
metric: import("../types").NormaliseMetric;
|
|
276
228
|
};
|
|
277
229
|
errorMessage: React.ReactNode;
|
|
230
|
+
activeEmbeddable: {
|
|
231
|
+
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
232
|
+
state: "hover" | "active";
|
|
233
|
+
} | null;
|
|
234
|
+
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
278
235
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
236
|
+
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
237
|
+
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
238
|
+
isBindingEnabled: boolean;
|
|
239
|
+
bindingPreference: "enabled" | "disabled";
|
|
240
|
+
isMidpointSnappingEnabled: boolean;
|
|
279
241
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
242
|
+
suggestedBinding: {
|
|
243
|
+
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
244
|
+
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
245
|
+
} | null;
|
|
246
|
+
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
247
|
+
frameRendering: {
|
|
248
|
+
enabled: boolean;
|
|
249
|
+
name: boolean;
|
|
250
|
+
outline: boolean;
|
|
251
|
+
clip: boolean;
|
|
252
|
+
};
|
|
280
253
|
editingFrame: string | null;
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
locked: boolean;
|
|
284
|
-
fromSelection: boolean;
|
|
285
|
-
} & import("../types").ActiveTool;
|
|
254
|
+
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
255
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
286
256
|
preferredSelectionTool: {
|
|
287
257
|
type: "selection" | "lasso";
|
|
288
258
|
initialized: boolean;
|
|
@@ -292,6 +262,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
292
262
|
exportBackground: boolean;
|
|
293
263
|
exportEmbedScene: boolean;
|
|
294
264
|
exportWithDarkMode: boolean;
|
|
265
|
+
exportScale: number;
|
|
295
266
|
currentItemStrokeColor: string;
|
|
296
267
|
currentItemBackgroundColor: string;
|
|
297
268
|
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
@@ -306,53 +277,83 @@ fileHandle?: FileSystemHandle | null) => Promise<{
|
|
|
306
277
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
307
278
|
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
308
279
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
309
|
-
|
|
280
|
+
viewBackgroundColor: string;
|
|
281
|
+
scrollX: number;
|
|
282
|
+
scrollY: number;
|
|
310
283
|
cursorButton: "up" | "down";
|
|
311
284
|
scrolledOutside: boolean;
|
|
312
285
|
isResizing: boolean;
|
|
286
|
+
isRotating: boolean;
|
|
287
|
+
zoom: import("../types").Zoom;
|
|
313
288
|
openMenu: "canvas" | null;
|
|
314
289
|
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
315
290
|
openSidebar: {
|
|
316
291
|
name: import("../types").SidebarName;
|
|
317
292
|
tab?: import("../types").SidebarTabName;
|
|
318
293
|
} | null;
|
|
294
|
+
openDialog: null | {
|
|
295
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
296
|
+
} | {
|
|
297
|
+
name: "commandPalette";
|
|
298
|
+
} | {
|
|
299
|
+
name: "settings";
|
|
300
|
+
} | {
|
|
301
|
+
name: "elementLinkSelector";
|
|
302
|
+
sourceElementId: ExcalidrawElement["id"];
|
|
303
|
+
} | {
|
|
304
|
+
name: "charts";
|
|
305
|
+
data: import("../charts").Spreadsheet;
|
|
306
|
+
rawText: string;
|
|
307
|
+
};
|
|
319
308
|
defaultSidebarDockedPreference: boolean;
|
|
320
309
|
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
310
|
+
selectedElementIds: Readonly<{
|
|
311
|
+
[id: string]: true;
|
|
312
|
+
}>;
|
|
313
|
+
hoveredElementIds: Readonly<{
|
|
314
|
+
[id: string]: true;
|
|
315
|
+
}>;
|
|
321
316
|
previousSelectedElementIds: {
|
|
322
317
|
[id: string]: true;
|
|
323
318
|
};
|
|
324
319
|
selectedElementsAreBeingDragged: boolean;
|
|
320
|
+
shouldCacheIgnoreZoom: boolean;
|
|
325
321
|
toast: {
|
|
326
|
-
message:
|
|
322
|
+
message: React.ReactNode;
|
|
327
323
|
closable?: boolean;
|
|
328
324
|
duration?: number;
|
|
329
325
|
} | null;
|
|
330
326
|
gridStep: number;
|
|
331
|
-
|
|
332
|
-
|
|
327
|
+
selectedGroupIds: {
|
|
328
|
+
[groupId: string]: boolean;
|
|
329
|
+
};
|
|
330
|
+
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
331
|
+
fileHandle: FileSystemFileHandle | null;
|
|
332
|
+
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
333
333
|
stats: {
|
|
334
334
|
open: boolean;
|
|
335
335
|
panels: number;
|
|
336
336
|
};
|
|
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
337
|
showHyperlinkPopup: false | "info" | "editor";
|
|
338
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
339
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
346
340
|
originSnapOffset: {
|
|
347
341
|
x: number;
|
|
348
342
|
y: number;
|
|
349
343
|
} | null;
|
|
350
|
-
objectsSnapModeEnabled: boolean;
|
|
351
344
|
userToFollow: import("../types").UserToFollow | null;
|
|
352
345
|
followedBy: Set<import("../types").SocketId>;
|
|
346
|
+
isCropping: boolean;
|
|
347
|
+
croppingElementId: ExcalidrawElement["id"] | null;
|
|
348
|
+
searchMatches: Readonly<{
|
|
349
|
+
focusedId: ExcalidrawElement["id"] | null;
|
|
350
|
+
matches: readonly import("../types").SearchMatch[];
|
|
351
|
+
}> | null;
|
|
352
|
+
activeLockedId: string | null;
|
|
353
353
|
lockedMultiSelections: {
|
|
354
354
|
[groupId: string]: true;
|
|
355
355
|
};
|
|
356
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
356
357
|
};
|
|
357
358
|
files: import("../types").BinaryFiles;
|
|
358
359
|
}>;
|
|
@@ -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>;
|