@myoc/element 0.19.509 → 0.19.511
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 +0 -11
- package/dist/dev/index.js.map +2 -2
- package/dist/prod/index.js +8 -8
- package/dist/types/common/src/constants.d.ts +1 -16
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +0 -4
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +0 -22
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +0 -4
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +0 -6
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +0 -4
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionExport.d.ts +0 -4
- package/dist/types/excalidraw/actions/actionFrame.d.ts +0 -8
- package/dist/types/excalidraw/actions/actionGroup.d.ts +0 -4
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +0 -4
- package/dist/types/excalidraw/actions/actionLink.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionProperties.d.ts +0 -4
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionStyles.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +0 -2
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +0 -2
- package/dist/types/excalidraw/actions/index.d.ts +0 -1
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +2 -2
- package/dist/types/excalidraw/components/App.d.ts +2 -4
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +3 -1
- package/dist/types/excalidraw/components/icons.d.ts +0 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +0 -6
- package/dist/types/excalidraw/data/blob.d.ts +3 -184
- package/dist/types/excalidraw/data/json.d.ts +2 -7
- package/dist/types/excalidraw/data/restore.d.ts +1 -2
- package/dist/types/excalidraw/data/types.d.ts +1 -16
- package/dist/types/excalidraw/types.d.ts +3 -30
- package/package.json +4 -4
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +0 -512
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +0 -19
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +0 -19
- package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +0 -2
- package/dist/types/excalidraw/components/CommandPalette/types.d.ts +0 -24
- package/dist/types/excalidraw/components/ConfirmDialog.d.ts +0 -10
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +0 -10
- package/dist/types/excalidraw/components/LibraryMenuBrowseButton.d.ts +0 -7
- package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +0 -9
- package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +0 -17
- package/dist/types/excalidraw/components/LibraryMenuItems.d.ts +0 -14
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +0 -23
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +0 -14
- package/dist/types/excalidraw/components/PublishLibrary.d.ts +0 -17
- package/dist/types/excalidraw/data/EditorLocalStorage.d.ts +0 -8
- package/dist/types/excalidraw/data/library.d.ts +0 -127
- package/dist/types/excalidraw/deburr.d.ts +0 -1
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +0 -11
- package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +0 -1
- package/dist/types/excalidraw/hooks/useStableCallback.d.ts +0 -4
- package/dist/types/excalidraw/hooks/useTransition.d.ts +0 -2
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
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
|
-
import type { AppState, CompressImageFile, DataURL
|
|
5
|
-
import type { ImportedLibraryData } from "./types";
|
|
4
|
+
import type { AppState, CompressImageFile, DataURL } from "../types";
|
|
6
5
|
export declare const getMimeType: (blob: Blob | string) => string;
|
|
7
6
|
export declare const getFileHandleType: (handle: FileSystemFileHandle | null) => string | null;
|
|
8
7
|
export declare const isImageFileHandleType: (type: string | null) => type is "png" | "svg";
|
|
@@ -11,183 +10,7 @@ export declare const isSupportedImageFileType: (type: string | null | undefined)
|
|
|
11
10
|
export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
|
|
12
11
|
type: ValueOf<typeof IMAGE_MIME_TYPES>;
|
|
13
12
|
};
|
|
14
|
-
export declare const
|
|
15
|
-
/** @see restore.localAppState */
|
|
16
|
-
localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
|
|
17
|
-
/** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
|
|
18
|
-
fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
19
|
-
type: "application/vnd.excalidraw+json";
|
|
20
|
-
data: {
|
|
21
|
-
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
22
|
-
appState: {
|
|
23
|
-
viewBackgroundColor: string;
|
|
24
|
-
theme: import("@excalidraw/element/types").Theme;
|
|
25
|
-
frameRendering: {
|
|
26
|
-
enabled: boolean;
|
|
27
|
-
name: boolean;
|
|
28
|
-
outline: boolean;
|
|
29
|
-
clip: boolean;
|
|
30
|
-
};
|
|
31
|
-
name: string | null;
|
|
32
|
-
zoom: import("../types").Zoom;
|
|
33
|
-
scrollX: number;
|
|
34
|
-
scrollY: number;
|
|
35
|
-
viewModeEnabled: boolean;
|
|
36
|
-
openDialog: null | {
|
|
37
|
-
name: "imageExport" | "help" | "jsonExport";
|
|
38
|
-
} | {
|
|
39
|
-
name: "commandPalette";
|
|
40
|
-
} | {
|
|
41
|
-
name: "settings";
|
|
42
|
-
} | {
|
|
43
|
-
name: "elementLinkSelector";
|
|
44
|
-
sourceElementId: ExcalidrawElement["id"];
|
|
45
|
-
} | {
|
|
46
|
-
name: "charts";
|
|
47
|
-
data: import("../charts").Spreadsheet;
|
|
48
|
-
rawText: string;
|
|
49
|
-
};
|
|
50
|
-
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
51
|
-
selectedElementIds: Readonly<{
|
|
52
|
-
[id: string]: true;
|
|
53
|
-
}>;
|
|
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;
|
|
60
|
-
activeEmbeddable: {
|
|
61
|
-
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
62
|
-
state: "hover" | "active";
|
|
63
|
-
} | null;
|
|
64
|
-
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
65
|
-
selectedGroupIds: {
|
|
66
|
-
[groupId: string]: boolean;
|
|
67
|
-
};
|
|
68
|
-
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
69
|
-
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
70
|
-
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
71
|
-
isBindingEnabled: boolean;
|
|
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;
|
|
77
|
-
isRotating: boolean;
|
|
78
|
-
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
79
|
-
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
80
|
-
snapLines: readonly import("../snapping").SnapLine[];
|
|
81
|
-
zenModeEnabled: boolean;
|
|
82
|
-
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
83
|
-
isCropping: boolean;
|
|
84
|
-
croppingElementId: ExcalidrawElement["id"] | null;
|
|
85
|
-
searchMatches: Readonly<{
|
|
86
|
-
focusedId: ExcalidrawElement["id"] | null;
|
|
87
|
-
matches: readonly import("../types").SearchMatch[];
|
|
88
|
-
}> | null;
|
|
89
|
-
activeLockedId: string | null;
|
|
90
|
-
hoveredElementIds: Readonly<{
|
|
91
|
-
[id: string]: true;
|
|
92
|
-
}>;
|
|
93
|
-
shouldCacheIgnoreZoom: boolean;
|
|
94
|
-
exportScale: number;
|
|
95
|
-
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
96
|
-
bindMode: import("@excalidraw/element/types").BindMode;
|
|
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;
|
|
104
|
-
contextMenu: {
|
|
105
|
-
items: import("../components/ContextMenu").ContextMenuItems;
|
|
106
|
-
top: number;
|
|
107
|
-
left: number;
|
|
108
|
-
} | null;
|
|
109
|
-
showWelcomeScreen: boolean;
|
|
110
|
-
isLoading: boolean;
|
|
111
|
-
myocSimplifiedMode: boolean;
|
|
112
|
-
dontResizeLimitMBs: number;
|
|
113
|
-
hideMainMenus: boolean;
|
|
114
|
-
arrangeConfiguration: {
|
|
115
|
-
algorithm: import("@excalidraw/element/types").ArrangeAlgorithms;
|
|
116
|
-
gap: number;
|
|
117
|
-
};
|
|
118
|
-
normaliseConfiguration: {
|
|
119
|
-
mode: import("../types").NormaliseMode;
|
|
120
|
-
metric: import("../types").NormaliseMetric;
|
|
121
|
-
};
|
|
122
|
-
errorMessage: React.ReactNode;
|
|
123
|
-
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
124
|
-
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
125
|
-
bindingPreference: "enabled" | "disabled";
|
|
126
|
-
editingFrame: string | null;
|
|
127
|
-
preferredSelectionTool: {
|
|
128
|
-
type: "selection" | "lasso";
|
|
129
|
-
initialized: boolean;
|
|
130
|
-
};
|
|
131
|
-
penMode: boolean;
|
|
132
|
-
penDetected: boolean;
|
|
133
|
-
exportBackground: boolean;
|
|
134
|
-
exportEmbedScene: boolean;
|
|
135
|
-
exportWithDarkMode: boolean;
|
|
136
|
-
currentItemStrokeColor: string;
|
|
137
|
-
currentItemBackgroundColor: string;
|
|
138
|
-
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
139
|
-
currentItemStrokeWidth: number;
|
|
140
|
-
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
141
|
-
currentItemRoughness: number;
|
|
142
|
-
currentItemOpacity: number;
|
|
143
|
-
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
144
|
-
currentItemFontSize: number;
|
|
145
|
-
currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
|
|
146
|
-
currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
147
|
-
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
148
|
-
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
149
|
-
cursorButton: "up" | "down";
|
|
150
|
-
scrolledOutside: boolean;
|
|
151
|
-
isResizing: boolean;
|
|
152
|
-
openMenu: "canvas" | null;
|
|
153
|
-
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
154
|
-
openSidebar: {
|
|
155
|
-
name: import("../types").SidebarName;
|
|
156
|
-
tab?: import("../types").SidebarTabName;
|
|
157
|
-
} | null;
|
|
158
|
-
defaultSidebarDockedPreference: boolean;
|
|
159
|
-
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
160
|
-
previousSelectedElementIds: {
|
|
161
|
-
[id: string]: true;
|
|
162
|
-
};
|
|
163
|
-
toast: {
|
|
164
|
-
message: React.ReactNode;
|
|
165
|
-
closable?: boolean;
|
|
166
|
-
duration?: number;
|
|
167
|
-
} | null;
|
|
168
|
-
fileHandle: FileSystemFileHandle | null;
|
|
169
|
-
stats: {
|
|
170
|
-
open: boolean;
|
|
171
|
-
panels: number;
|
|
172
|
-
};
|
|
173
|
-
showHyperlinkPopup: false | "info" | "editor";
|
|
174
|
-
originSnapOffset: {
|
|
175
|
-
x: number;
|
|
176
|
-
y: number;
|
|
177
|
-
} | null;
|
|
178
|
-
userToFollow: import("../types").UserToFollow | null;
|
|
179
|
-
followedBy: Set<import("../types").SocketId>;
|
|
180
|
-
lockedMultiSelections: {
|
|
181
|
-
[groupId: string]: true;
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
files: import("../types").BinaryFiles;
|
|
185
|
-
};
|
|
186
|
-
} | {
|
|
187
|
-
type: "application/vnd.excalidrawlib+json";
|
|
188
|
-
data: ImportedLibraryData;
|
|
189
|
-
}>;
|
|
190
|
-
export declare const loadFromBlob: (blob: Blob,
|
|
13
|
+
export declare const loadFromBlob: (blob: Blob | File,
|
|
191
14
|
/** @see restore.localAppState */
|
|
192
15
|
localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
|
|
193
16
|
/** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
|
|
@@ -209,8 +32,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
209
32
|
viewModeEnabled: boolean;
|
|
210
33
|
openDialog: null | {
|
|
211
34
|
name: "imageExport" | "help" | "jsonExport";
|
|
212
|
-
} | {
|
|
213
|
-
name: "commandPalette";
|
|
214
35
|
} | {
|
|
215
36
|
name: "settings";
|
|
216
37
|
} | {
|
|
@@ -357,8 +178,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
357
178
|
};
|
|
358
179
|
files: import("../types").BinaryFiles;
|
|
359
180
|
}>;
|
|
360
|
-
export declare const parseLibraryJSON: (json: string, defaultStatus?: LibraryItem["status"]) => LibraryItem[];
|
|
361
|
-
export declare const loadLibraryFromBlob: (blob: Blob, defaultStatus?: LibraryItem["status"]) => Promise<LibraryItem[]>;
|
|
362
181
|
export declare const canvasToBlob: (canvas: HTMLCanvasElement | Promise<HTMLCanvasElement>) => Promise<Blob>;
|
|
363
182
|
/** generates SHA-1 digest from supplied file (if not supported, falls back
|
|
364
183
|
to a 40-char base64 random id) */
|
|
@@ -377,6 +196,6 @@ export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTr
|
|
|
377
196
|
export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: string, name: string | undefined) => File;
|
|
378
197
|
/** attempts to detect correct mimeType if none is set, or if an image
|
|
379
198
|
* has an incorrect extension.
|
|
380
|
-
* Note: doesn't handle missing .excalidraw
|
|
199
|
+
* Note: doesn't handle missing .excalidraw extension */
|
|
381
200
|
export declare const normalizeFile: (file: File) => Promise<File>;
|
|
382
201
|
export declare const blobToArrayBuffer: (blob: Blob) => Promise<ArrayBuffer>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExcalidrawElement, NonDeleted } from "@excalidraw/element/types";
|
|
2
2
|
import type { MaybePromise } from "@excalidraw/common/utility-types";
|
|
3
|
-
import type { AppState, BinaryFiles
|
|
4
|
-
import type { ImportedDataState
|
|
3
|
+
import type { AppState, BinaryFiles } from "../types";
|
|
4
|
+
import type { ImportedDataState } from "./types";
|
|
5
5
|
export type JSONExportData = {
|
|
6
6
|
elements: readonly NonDeleted<ExcalidrawElement>[];
|
|
7
7
|
appState: AppState;
|
|
@@ -33,8 +33,6 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
33
33
|
viewModeEnabled: boolean;
|
|
34
34
|
openDialog: null | {
|
|
35
35
|
name: "imageExport" | "help" | "jsonExport";
|
|
36
|
-
} | {
|
|
37
|
-
name: "commandPalette";
|
|
38
36
|
} | {
|
|
39
37
|
name: "settings";
|
|
40
38
|
} | {
|
|
@@ -186,6 +184,3 @@ export declare const isValidExcalidrawData: (data?: {
|
|
|
186
184
|
elements?: any;
|
|
187
185
|
appState?: any;
|
|
188
186
|
}) => data is ImportedDataState;
|
|
189
|
-
export declare const isValidLibrary: (json: any) => json is ImportedLibraryData;
|
|
190
|
-
export declare const serializeLibraryAsJSON: (libraryItems: LibraryItems) => string;
|
|
191
|
-
export declare const saveLibraryAsJSON: (libraryItems: LibraryItems) => Promise<void>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CombineBrandsIfNeeded } from "@excalidraw/common";
|
|
2
2
|
import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawSelectionElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
-
import type { AppState, BinaryFiles
|
|
3
|
+
import type { AppState, BinaryFiles } from "../types";
|
|
4
4
|
import type { ImportedDataState } from "./types";
|
|
5
5
|
type RestoredAppState = Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
6
6
|
export declare const AllowedExcalidrawActiveTools: Record<AppState["activeTool"]["type"], boolean>;
|
|
@@ -37,5 +37,4 @@ existingElements: Readonly<ElementsMapOrArray> | null | undefined, opts?: {
|
|
|
37
37
|
*/
|
|
38
38
|
export declare const bumpElementVersions: <T extends ExcalidrawElement>(targetElements: readonly T[], localElements: Readonly<ElementsMapOrArray> | null | undefined) => T[];
|
|
39
39
|
export declare const restoreAppState: (appState: ImportedDataState["appState"], localAppState: Partial<AppState> | null | undefined) => RestoredAppState;
|
|
40
|
-
export declare const restoreLibraryItems: (libraryItems: ImportedDataState["libraryItems"], defaultStatus: LibraryItem["status"]) => LibraryItem[];
|
|
41
40
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { VERSIONS } from "@excalidraw/common";
|
|
2
1
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
2
|
import type { cleanAppStateForExport } from "../appState";
|
|
4
|
-
import type { AppState, BinaryFiles
|
|
3
|
+
import type { AppState, BinaryFiles } from "../types";
|
|
5
4
|
export interface ExportedDataState {
|
|
6
5
|
type: string;
|
|
7
6
|
version: number;
|
|
@@ -30,19 +29,5 @@ export interface ImportedDataState {
|
|
|
30
29
|
[T in keyof LegacyAppState]: LegacyAppState[T][0];
|
|
31
30
|
}>> | null;
|
|
32
31
|
scrollToContent?: boolean;
|
|
33
|
-
libraryItems?: LibraryItems_anyVersion;
|
|
34
32
|
files?: BinaryFiles;
|
|
35
33
|
}
|
|
36
|
-
export interface ExportedLibraryData {
|
|
37
|
-
type: string;
|
|
38
|
-
version: typeof VERSIONS.excalidrawLibrary;
|
|
39
|
-
source: string;
|
|
40
|
-
libraryItems: LibraryItems;
|
|
41
|
-
}
|
|
42
|
-
export interface ImportedLibraryData extends Partial<ExportedLibraryData> {
|
|
43
|
-
/** @deprecated v1 */
|
|
44
|
-
library?: LibraryItems;
|
|
45
|
-
}
|
|
46
|
-
export type ExcalidrawLibraryIds = {
|
|
47
|
-
itemIds: LibraryItem["id"][];
|
|
48
|
-
};
|
|
@@ -9,7 +9,6 @@ import type { Action } from "./actions/types";
|
|
|
9
9
|
import type { Spreadsheet } from "./charts";
|
|
10
10
|
import type { ClipboardData } from "./clipboard";
|
|
11
11
|
import type App from "./components/App";
|
|
12
|
-
import type Library from "./data/library";
|
|
13
12
|
import type { ContextMenuItems } from "./components/ContextMenu";
|
|
14
13
|
import type { SnapLine } from "./snapping";
|
|
15
14
|
import type { ImportedDataState } from "./data/types";
|
|
@@ -322,8 +321,6 @@ export interface AppState {
|
|
|
322
321
|
} | null;
|
|
323
322
|
openDialog: null | {
|
|
324
323
|
name: "imageExport" | "help" | "jsonExport";
|
|
325
|
-
} | {
|
|
326
|
-
name: "commandPalette";
|
|
327
324
|
} | {
|
|
328
325
|
name: "settings";
|
|
329
326
|
} | {
|
|
@@ -446,26 +443,7 @@ export declare class GestureEvent extends UIEvent {
|
|
|
446
443
|
readonly rotation: number;
|
|
447
444
|
readonly scale: number;
|
|
448
445
|
}
|
|
449
|
-
|
|
450
|
-
export type LibraryItem_v1 = readonly NonDeleted<ExcalidrawElement>[];
|
|
451
|
-
/** @deprecated legacy: do not use outside of migration paths */
|
|
452
|
-
type LibraryItems_v1 = readonly LibraryItem_v1[];
|
|
453
|
-
/** v2 library item */
|
|
454
|
-
export type LibraryItem = {
|
|
455
|
-
id: string;
|
|
456
|
-
status: "published" | "unpublished";
|
|
457
|
-
elements: readonly NonDeleted<ExcalidrawElement>[];
|
|
458
|
-
/** timestamp in epoch (ms) */
|
|
459
|
-
created: number;
|
|
460
|
-
name?: string;
|
|
461
|
-
error?: string;
|
|
462
|
-
};
|
|
463
|
-
export type LibraryItems = readonly LibraryItem[];
|
|
464
|
-
export type LibraryItems_anyVersion = LibraryItems | LibraryItems_v1;
|
|
465
|
-
export type LibraryItemsSource = ((currentLibraryItems: LibraryItems) => MaybePromise<LibraryItems_anyVersion | Blob>) | MaybePromise<LibraryItems_anyVersion | Blob>;
|
|
466
|
-
export type ExcalidrawInitialDataState = Merge<ImportedDataState, {
|
|
467
|
-
libraryItems?: MaybePromise<Required<ImportedDataState>["libraryItems"]>;
|
|
468
|
-
}>;
|
|
446
|
+
export type ExcalidrawInitialDataState = ImportedDataState;
|
|
469
447
|
export type OnUserFollowedPayload = {
|
|
470
448
|
userToFollow: UserToFollow;
|
|
471
449
|
action: "FOLLOW" | "UNFOLLOW";
|
|
@@ -521,8 +499,7 @@ export interface ExcalidrawProps {
|
|
|
521
499
|
* Called when element(s) are duplicated so you can listen or modify as
|
|
522
500
|
* needed.
|
|
523
501
|
*
|
|
524
|
-
* Called when duplicating via mouse-drag, keyboard, paste,
|
|
525
|
-
* etc.
|
|
502
|
+
* Called when duplicating via mouse-drag, keyboard, paste, etc.
|
|
526
503
|
*
|
|
527
504
|
* Returned elements will be used in place of the next elements
|
|
528
505
|
* (you should return all elements, including deleted, and not mutate
|
|
@@ -538,7 +515,6 @@ export interface ExcalidrawProps {
|
|
|
538
515
|
zenModeEnabled?: boolean;
|
|
539
516
|
gridModeEnabled?: boolean;
|
|
540
517
|
objectsSnapModeEnabled?: boolean;
|
|
541
|
-
libraryReturnUrl?: string;
|
|
542
518
|
theme?: Theme;
|
|
543
519
|
name?: string;
|
|
544
520
|
renderCustomStats?: (elements: readonly NonDeletedExcalidrawElement[], appState: UIAppState) => JSX.Element;
|
|
@@ -547,7 +523,6 @@ export interface ExcalidrawProps {
|
|
|
547
523
|
UIOptions?: Partial<UIOptions>;
|
|
548
524
|
detectScroll?: boolean;
|
|
549
525
|
handleKeyboardGlobally?: boolean;
|
|
550
|
-
onLibraryChange?: (libraryItems: LibraryItems) => void | Promise<any>;
|
|
551
526
|
autoFocus?: boolean;
|
|
552
527
|
compressImageFile: CompressImageFile;
|
|
553
528
|
generateIdForFile?: (file: File) => string | Promise<string>;
|
|
@@ -647,7 +622,6 @@ export type AppClassProperties = {
|
|
|
647
622
|
/** static canvas */
|
|
648
623
|
canvas: HTMLCanvasElement;
|
|
649
624
|
focusContainer(): void;
|
|
650
|
-
library: Library;
|
|
651
625
|
imageCache: Map<FileId, {
|
|
652
626
|
image: HTMLImageElement | Promise<HTMLImageElement>;
|
|
653
627
|
mimeType: ValueOf<typeof IMAGE_MIME_TYPES>;
|
|
@@ -665,7 +639,7 @@ export type AppClassProperties = {
|
|
|
665
639
|
scrollToViewport: App["scrollToViewport"];
|
|
666
640
|
scrollToContent: App["scrollToContent"];
|
|
667
641
|
addFiles: App["addFiles"];
|
|
668
|
-
|
|
642
|
+
addElementsFromPaste: App["addElementsFromPaste"];
|
|
669
643
|
togglePenMode: App["togglePenMode"];
|
|
670
644
|
toggleLock: App["toggleLock"];
|
|
671
645
|
setActiveTool: App["setActiveTool"];
|
|
@@ -764,7 +738,6 @@ export interface ExcalidrawImperativeAPI {
|
|
|
764
738
|
updateScene: InstanceType<typeof App>["updateScene"];
|
|
765
739
|
applyDeltas: InstanceType<typeof App>["applyDeltas"];
|
|
766
740
|
mutateElement: InstanceType<typeof App>["mutateElement"];
|
|
767
|
-
updateLibrary: InstanceType<typeof Library>["updateLibrary"];
|
|
768
741
|
resetScene: InstanceType<typeof App>["resetScene"];
|
|
769
742
|
getSceneElementsIncludingDeleted: InstanceType<typeof App>["getSceneElementsIncludingDeleted"];
|
|
770
743
|
getSceneElementsMapIncludingDeleted: InstanceType<typeof App>["getSceneElementsMapIncludingDeleted"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myoc/element",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.511",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/types/element/src/index.d.ts",
|
|
6
6
|
"main": "./dist/prod/index.js",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@excalidraw/common": "npm:@myoc/common@0.19.
|
|
68
|
-
"@excalidraw/fractional-indexing": "npm:@myoc/fractional-indexing@0.19.
|
|
69
|
-
"@excalidraw/math": "npm:@myoc/math@0.19.
|
|
67
|
+
"@excalidraw/common": "npm:@myoc/common@0.19.511",
|
|
68
|
+
"@excalidraw/fractional-indexing": "npm:@myoc/fractional-indexing@0.19.511",
|
|
69
|
+
"@excalidraw/math": "npm:@myoc/math@0.19.511"
|
|
70
70
|
}
|
|
71
71
|
}
|