@myoc/common 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 +4 -27
- package/dist/dev/index.js.map +2 -2
- package/dist/prod/index.js +3 -3
- 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 +1 -1
- 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
|
@@ -103,8 +103,6 @@ export declare const actionSelectAllElementsInFrame: {
|
|
|
103
103
|
} | null;
|
|
104
104
|
openDialog: null | {
|
|
105
105
|
name: "imageExport" | "help" | "jsonExport";
|
|
106
|
-
} | {
|
|
107
|
-
name: "commandPalette";
|
|
108
106
|
} | {
|
|
109
107
|
name: "settings";
|
|
110
108
|
} | {
|
|
@@ -287,8 +285,6 @@ export declare const actionRemoveAllElementsFromFrame: {
|
|
|
287
285
|
} | null;
|
|
288
286
|
openDialog: null | {
|
|
289
287
|
name: "imageExport" | "help" | "jsonExport";
|
|
290
|
-
} | {
|
|
291
|
-
name: "commandPalette";
|
|
292
288
|
} | {
|
|
293
289
|
name: "settings";
|
|
294
290
|
} | {
|
|
@@ -469,8 +465,6 @@ export declare const actionupdateFrameRendering: {
|
|
|
469
465
|
} | null;
|
|
470
466
|
openDialog: null | {
|
|
471
467
|
name: "imageExport" | "help" | "jsonExport";
|
|
472
|
-
} | {
|
|
473
|
-
name: "commandPalette";
|
|
474
468
|
} | {
|
|
475
469
|
name: "settings";
|
|
476
470
|
} | {
|
|
@@ -651,8 +645,6 @@ export declare const actionSetFrameAsActiveTool: {
|
|
|
651
645
|
} | null;
|
|
652
646
|
openDialog: null | {
|
|
653
647
|
name: "imageExport" | "help" | "jsonExport";
|
|
654
|
-
} | {
|
|
655
|
-
name: "commandPalette";
|
|
656
648
|
} | {
|
|
657
649
|
name: "settings";
|
|
658
650
|
} | {
|
|
@@ -109,8 +109,6 @@ export declare const actionGroup: {
|
|
|
109
109
|
} | null;
|
|
110
110
|
openDialog: null | {
|
|
111
111
|
name: "imageExport" | "help" | "jsonExport";
|
|
112
|
-
} | {
|
|
113
|
-
name: "commandPalette";
|
|
114
112
|
} | {
|
|
115
113
|
name: "settings";
|
|
116
114
|
} | {
|
|
@@ -292,8 +290,6 @@ export declare const actionUngroup: {
|
|
|
292
290
|
} | null;
|
|
293
291
|
openDialog: null | {
|
|
294
292
|
name: "imageExport" | "help" | "jsonExport";
|
|
295
|
-
} | {
|
|
296
|
-
name: "commandPalette";
|
|
297
293
|
} | {
|
|
298
294
|
name: "settings";
|
|
299
295
|
} | {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ExcalidrawLinearElement } from "@excalidraw/element/types";
|
|
2
2
|
export declare const actionToggleLinearEditor: {
|
|
3
3
|
name: "toggleLinearEditor";
|
|
4
|
-
category: string;
|
|
5
4
|
label: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>, app: import("../types").AppClassProperties) => "labels.lineEditor.editArrow" | "labels.lineEditor.edit";
|
|
6
5
|
keywords: string[];
|
|
7
6
|
trackEvent: {
|
|
@@ -136,8 +135,6 @@ export declare const actionToggleLinearEditor: {
|
|
|
136
135
|
} | null;
|
|
137
136
|
openDialog: null | {
|
|
138
137
|
name: "imageExport" | "help" | "jsonExport";
|
|
139
|
-
} | {
|
|
140
|
-
name: "commandPalette";
|
|
141
138
|
} | {
|
|
142
139
|
name: "settings";
|
|
143
140
|
} | {
|
|
@@ -215,7 +212,6 @@ export declare const actionToggleLinearEditor: {
|
|
|
215
212
|
};
|
|
216
213
|
export declare const actionTogglePolygon: {
|
|
217
214
|
name: "togglePolygon";
|
|
218
|
-
category: string;
|
|
219
215
|
icon: import("react/jsx-runtime").JSX.Element;
|
|
220
216
|
keywords: string[];
|
|
221
217
|
label: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>, app: import("../types").AppClassProperties) => "labels.polygon.breakPolygon" | "labels.polygon.convertToPolygon";
|
|
@@ -128,8 +128,6 @@ export declare const actionDecreaseFontSize: {
|
|
|
128
128
|
} | null;
|
|
129
129
|
openDialog: null | {
|
|
130
130
|
name: "imageExport" | "help" | "jsonExport";
|
|
131
|
-
} | {
|
|
132
|
-
name: "commandPalette";
|
|
133
131
|
} | {
|
|
134
132
|
name: "settings";
|
|
135
133
|
} | {
|
|
@@ -307,8 +305,6 @@ export declare const actionIncreaseFontSize: {
|
|
|
307
305
|
} | null;
|
|
308
306
|
openDialog: null | {
|
|
309
307
|
name: "imageExport" | "help" | "jsonExport";
|
|
310
|
-
} | {
|
|
311
|
-
name: "commandPalette";
|
|
312
308
|
} | {
|
|
313
309
|
name: "settings";
|
|
314
310
|
} | {
|
|
@@ -12,7 +12,6 @@ export { actionCopyStyles, actionPasteStyles } from "./actionStyles";
|
|
|
12
12
|
export { actionShortcuts } from "./actionMenu";
|
|
13
13
|
export { actionGroup, actionUngroup } from "./actionGroup";
|
|
14
14
|
export { actionGoToCollaborator } from "./actionNavigate";
|
|
15
|
-
export { actionAddToLibrary } from "./actionAddToLibrary";
|
|
16
15
|
export { actionAlignTop, actionAlignBottom, actionAlignLeft, actionAlignRight, actionAlignVerticallyCentered, actionAlignHorizontallyCentered, } from "./actionAlign";
|
|
17
16
|
export { distributeHorizontally, distributeVertically, } from "./actionDistribute";
|
|
18
17
|
export { actionArrangeElements } from "./actionArrange";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SubtypeOf } from "@excalidraw/common/utility-types";
|
|
2
2
|
import type { ActionName } from "./types";
|
|
3
|
-
export type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "group" | "ungroup" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "
|
|
3
|
+
export type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "group" | "ungroup" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleElementLock" | "resetZoom" | "zoomOut" | "zoomIn" | "zoomToFit" | "zoomToFitSelectionInViewport" | "zoomToFitSelection" | "toggleEraserTool" | "toggleHandTool" | "setFrameAsActiveTool" | "saveFileToDisk" | "saveToActiveFile" | "toggleShortcuts" | "wrapSelectionInFrame" | "arrangeElements"> | "saveScene" | "imageExport" | "searchMenu" | "toolLock";
|
|
4
4
|
export declare const getShortcutFromShortcutName: (name: ShortcutName, idx?: number) => string;
|
|
@@ -2,7 +2,7 @@ import type { ExcalidrawElement, OrderedExcalidrawElement } from "@excalidraw/el
|
|
|
2
2
|
import type { CaptureUpdateActionType } from "@excalidraw/element";
|
|
3
3
|
import type { AppClassProperties, AppState, ExcalidrawProps, BinaryFiles, UIAppState } from "../types";
|
|
4
4
|
import type React from "react";
|
|
5
|
-
export type ActionSource = "ui" | "keyboard" | "contextMenu" | "api"
|
|
5
|
+
export type ActionSource = "ui" | "keyboard" | "contextMenu" | "api";
|
|
6
6
|
/** if false, the action should be prevented */
|
|
7
7
|
export type ActionResult = {
|
|
8
8
|
elements?: readonly ExcalidrawElement[] | null;
|
|
@@ -14,7 +14,7 @@ export type ActionResult = {
|
|
|
14
14
|
type ActionFn<TData = any> = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: TData | undefined, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
15
15
|
export type UpdaterFn = (res: ActionResult) => void;
|
|
16
16
|
export type ActionFilterFn = (action: Action) => void;
|
|
17
|
-
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "arrowBinding" | "midpointSnapping" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "
|
|
17
|
+
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "arrowBinding" | "midpointSnapping" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "arrangeElements" | "normaliseElements" | "flipHorizontal" | "flipVertical" | "deselect" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "smartZoom" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
|
|
18
18
|
export type PanelComponentProps = {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
20
|
appState: AppState;
|
|
@@ -16,7 +16,7 @@ import { LassoTrail } from "../lasso";
|
|
|
16
16
|
import { EraserTrail } from "../eraser";
|
|
17
17
|
import { type OnStateChange } from "./AppStateObserver";
|
|
18
18
|
import type { ExportedElements } from "../data";
|
|
19
|
-
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles,
|
|
19
|
+
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
|
|
20
20
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
21
21
|
import type { ActionResult } from "../actions/types";
|
|
22
22
|
declare const editorLifecycleEventBehavior: {
|
|
@@ -80,8 +80,6 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
80
80
|
renderer: Renderer;
|
|
81
81
|
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
82
82
|
private resizeObserver;
|
|
83
|
-
library: AppClassProperties["library"];
|
|
84
|
-
libraryItemsFromStorage: LibraryItems | undefined;
|
|
85
83
|
id: string;
|
|
86
84
|
private store;
|
|
87
85
|
private history;
|
|
@@ -354,7 +352,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
354
352
|
private onTouchEnd;
|
|
355
353
|
private insertClipboardContent;
|
|
356
354
|
pasteFromClipboard: (event: ClipboardEvent) => Promise<void>;
|
|
357
|
-
|
|
355
|
+
addElementsFromPaste: (opts: {
|
|
358
356
|
elements: readonly ExcalidrawElement[];
|
|
359
357
|
files: BinaryFiles | null;
|
|
360
358
|
position: {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import "./ToolIcon.scss";
|
|
2
2
|
import "./MobileToolBar.scss";
|
|
3
|
+
import type { ActionManager } from "../actions/manager";
|
|
3
4
|
import type { AppClassProperties, UIAppState } from "../types";
|
|
4
5
|
type MobileToolBarProps = {
|
|
5
6
|
app: AppClassProperties;
|
|
7
|
+
actionManager: ActionManager;
|
|
6
8
|
onHandToolToggle: () => void;
|
|
7
9
|
setAppState: React.Component<any, UIAppState>["setState"];
|
|
8
10
|
};
|
|
9
|
-
export declare const MobileToolBar: ({ app, onHandToolToggle, setAppState, }: MobileToolBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const MobileToolBar: ({ app, actionManager, onHandToolToggle, setAppState, }: MobileToolBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -8,7 +8,6 @@ type Opts = {
|
|
|
8
8
|
} & React.SVGProps<SVGSVGElement>;
|
|
9
9
|
export declare const createIcon: (d: string | React.ReactNode, opts?: number | Opts) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export declare const PlusPromoIcon: import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export declare const LibraryIcon: import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export declare const PlusIcon: import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export declare const DotsIcon: import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export declare const DotsHorizontalIcon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,12 +12,6 @@ export declare const SaveAsImage: {
|
|
|
12
12
|
(): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
displayName: string;
|
|
14
14
|
};
|
|
15
|
-
export declare const CommandPalette: {
|
|
16
|
-
(opts?: {
|
|
17
|
-
className?: string;
|
|
18
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
displayName: string;
|
|
20
|
-
};
|
|
21
15
|
export declare const SearchMenu: {
|
|
22
16
|
(opts?: {
|
|
23
17
|
className?: string;
|
|
@@ -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
|
-
viewModeEnabled: boolean;
|
|
24
|
-
zenModeEnabled: boolean;
|
|
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";
|
|
31
|
-
gridSize: number;
|
|
32
|
-
activeTool: {
|
|
33
|
-
lastActiveTool: import("../types").ActiveTool | null;
|
|
34
|
-
locked: boolean;
|
|
35
|
-
fromSelection: boolean;
|
|
36
|
-
} & import("../types").ActiveTool;
|
|
37
|
-
contextMenu: {
|
|
38
|
-
items: import("../components/ContextMenu").ContextMenuItems;
|
|
39
|
-
top: number;
|
|
40
|
-
left: number;
|
|
41
|
-
} | null;
|
|
42
|
-
showWelcomeScreen: boolean;
|
|
43
|
-
isLoading: boolean;
|
|
44
|
-
myocSimplifiedMode: boolean;
|
|
45
|
-
dontResizeLimitMBs: number;
|
|
46
|
-
hideMainMenus: boolean;
|
|
47
|
-
arrangeConfiguration: {
|
|
48
|
-
algorithm: import("@excalidraw/element/types").ArrangeAlgorithms;
|
|
49
|
-
gap: number;
|
|
50
|
-
};
|
|
51
|
-
normaliseConfiguration: {
|
|
52
|
-
mode: import("../types").NormaliseMode;
|
|
53
|
-
metric: import("../types").NormaliseMetric;
|
|
54
|
-
};
|
|
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;
|
|
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
|
-
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
66
|
-
bindingPreference: "enabled" | "disabled";
|
|
67
|
-
isMidpointSnappingEnabled: boolean;
|
|
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
|
-
};
|
|
79
|
-
editingFrame: string | null;
|
|
80
|
-
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
81
|
-
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
82
|
-
preferredSelectionTool: {
|
|
83
|
-
type: "selection" | "lasso";
|
|
84
|
-
initialized: boolean;
|
|
85
|
-
};
|
|
86
|
-
penMode: boolean;
|
|
87
|
-
penDetected: boolean;
|
|
88
|
-
exportBackground: boolean;
|
|
89
|
-
exportEmbedScene: boolean;
|
|
90
|
-
exportWithDarkMode: boolean;
|
|
91
|
-
exportScale: number;
|
|
92
|
-
currentItemStrokeColor: string;
|
|
93
|
-
currentItemBackgroundColor: string;
|
|
94
|
-
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
95
|
-
currentItemStrokeWidth: number;
|
|
96
|
-
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
97
|
-
currentItemRoughness: number;
|
|
98
|
-
currentItemOpacity: number;
|
|
99
|
-
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
100
|
-
currentItemFontSize: number;
|
|
101
|
-
currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
|
|
102
|
-
currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
103
|
-
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
104
|
-
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
105
|
-
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
106
|
-
viewBackgroundColor: string;
|
|
107
|
-
scrollX: number;
|
|
108
|
-
scrollY: number;
|
|
109
|
-
cursorButton: "up" | "down";
|
|
110
|
-
scrolledOutside: boolean;
|
|
111
|
-
isResizing: boolean;
|
|
112
|
-
isRotating: boolean;
|
|
113
|
-
zoom: import("../types").Zoom;
|
|
114
|
-
openMenu: "canvas" | null;
|
|
115
|
-
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
116
|
-
openSidebar: {
|
|
117
|
-
name: import("../types").SidebarName;
|
|
118
|
-
tab?: import("../types").SidebarTabName;
|
|
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
|
-
};
|
|
134
|
-
defaultSidebarDockedPreference: boolean;
|
|
135
|
-
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
136
|
-
selectedElementIds: Readonly<{
|
|
137
|
-
[id: string]: true;
|
|
138
|
-
}>;
|
|
139
|
-
hoveredElementIds: Readonly<{
|
|
140
|
-
[id: string]: true;
|
|
141
|
-
}>;
|
|
142
|
-
previousSelectedElementIds: {
|
|
143
|
-
[id: string]: true;
|
|
144
|
-
};
|
|
145
|
-
selectedElementsAreBeingDragged: boolean;
|
|
146
|
-
shouldCacheIgnoreZoom: boolean;
|
|
147
|
-
toast: {
|
|
148
|
-
message: React.ReactNode;
|
|
149
|
-
closable?: boolean;
|
|
150
|
-
duration?: number;
|
|
151
|
-
} | null;
|
|
152
|
-
gridStep: number;
|
|
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>;
|
|
159
|
-
stats: {
|
|
160
|
-
open: boolean;
|
|
161
|
-
panels: number;
|
|
162
|
-
};
|
|
163
|
-
showHyperlinkPopup: false | "info" | "editor";
|
|
164
|
-
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
165
|
-
snapLines: readonly import("../snapping").SnapLine[];
|
|
166
|
-
originSnapOffset: {
|
|
167
|
-
x: number;
|
|
168
|
-
y: number;
|
|
169
|
-
} | null;
|
|
170
|
-
userToFollow: import("../types").UserToFollow | null;
|
|
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;
|
|
179
|
-
lockedMultiSelections: {
|
|
180
|
-
[groupId: string]: true;
|
|
181
|
-
};
|
|
182
|
-
bindMode: import("@excalidraw/element/types").BindMode;
|
|
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. */
|
|
@@ -293,8 +116,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
293
116
|
} | null;
|
|
294
117
|
openDialog: null | {
|
|
295
118
|
name: "imageExport" | "help" | "jsonExport";
|
|
296
|
-
} | {
|
|
297
|
-
name: "commandPalette";
|
|
298
119
|
} | {
|
|
299
120
|
name: "settings";
|
|
300
121
|
} | {
|
|
@@ -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;
|
|
@@ -117,8 +117,6 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
117
117
|
} | null;
|
|
118
118
|
openDialog: null | {
|
|
119
119
|
name: "imageExport" | "help" | "jsonExport";
|
|
120
|
-
} | {
|
|
121
|
-
name: "commandPalette";
|
|
122
120
|
} | {
|
|
123
121
|
name: "settings";
|
|
124
122
|
} | {
|
|
@@ -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
|
-
};
|