@excalidraw/common 0.18.0-2874f9e → 0.18.0-2a82821
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 +173 -25
- package/dist/dev/index.js.map +3 -3
- package/dist/prod/index.js +3 -3
- package/dist/types/common/src/appEventBus.d.ts +27 -0
- package/dist/types/common/src/colors.d.ts +14 -14
- package/dist/types/common/src/constants.d.ts +9 -7
- package/dist/types/common/src/index.d.ts +2 -0
- package/dist/types/common/src/utils.d.ts +1 -3
- package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
- package/dist/types/element/src/Scene.d.ts +7 -3
- package/dist/types/element/src/arrowheads.d.ts +3 -0
- package/dist/types/element/src/binding.d.ts +3 -4
- package/dist/types/element/src/bounds.d.ts +22 -3
- package/dist/types/element/src/comparisons.d.ts +1 -0
- package/dist/types/element/src/duplicate.d.ts +1 -0
- package/dist/types/element/src/elbowArrow.d.ts +2 -0
- package/dist/types/element/src/frame.d.ts +7 -6
- package/dist/types/element/src/index.d.ts +1 -0
- package/dist/types/element/src/linearElementEditor.d.ts +5 -2
- package/dist/types/element/src/mutateElement.d.ts +2 -0
- package/dist/types/element/src/newElement.d.ts +1 -0
- package/dist/types/element/src/selection.d.ts +8 -4
- package/dist/types/element/src/shape.d.ts +1 -1
- 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/typeChecks.d.ts +1 -0
- package/dist/types/element/src/types.d.ts +11 -2
- package/dist/types/element/src/utils.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +35 -38
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +25 -27
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +207 -219
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +24 -26
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +12 -13
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +37 -40
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +160 -0
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +8 -13
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +24 -26
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +12 -13
- package/dist/types/excalidraw/actions/actionExport.d.ts +112 -394
- package/dist/types/excalidraw/actions/actionFrame.d.ts +49 -52
- package/dist/types/excalidraw/actions/actionGroup.d.ts +27 -29
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +13 -13
- package/dist/types/excalidraw/actions/actionLink.d.ts +12 -13
- package/dist/types/excalidraw/actions/actionMenu.d.ts +8 -13
- package/dist/types/excalidraw/actions/actionProperties.d.ts +37 -30
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +13 -14
- package/dist/types/excalidraw/actions/actionStyles.d.ts +12 -12
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +173 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +12 -13
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +173 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +12 -13
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +8 -13
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +12 -13
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +12 -13
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +12 -13
- package/dist/types/excalidraw/actions/index.d.ts +4 -1
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
- package/dist/types/excalidraw/appState.d.ts +32 -28
- 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 +4 -7
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/App.d.ts +54 -14
- package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
- package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
- package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
- package/dist/types/excalidraw/components/Range.d.ts +10 -4
- package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
- package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +4 -4
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +4 -1
- package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
- package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +3 -3
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
- package/dist/types/excalidraw/components/Toast.d.ts +8 -4
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -1
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -1
- package/dist/types/excalidraw/components/icons.d.ts +19 -8
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +9 -3
- package/dist/types/excalidraw/components/shapes.d.ts +7 -0
- package/dist/types/excalidraw/data/blob.d.ts +163 -166
- 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 -85
- package/dist/types/excalidraw/data/library.d.ts +1 -1
- package/dist/types/excalidraw/data/resave.d.ts +7 -2
- package/dist/types/excalidraw/eraser/index.d.ts +2 -3
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
- package/dist/types/excalidraw/lasso/index.d.ts +2 -3
- package/dist/types/excalidraw/renderer/animation.d.ts +4 -1
- package/dist/types/excalidraw/scene/Renderer.d.ts +426 -19
- package/dist/types/excalidraw/scene/index.d.ts +1 -1
- package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
- package/dist/types/excalidraw/types.d.ts +110 -18
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +5 -1
- package/dist/types/fractional-indexing/src/index.d.ts +29 -0
- package/dist/types/laser-pointer/src/index.d.ts +2 -0
- package/dist/types/laser-pointer/src/math.d.ts +16 -0
- package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
- package/dist/types/laser-pointer/src/state.d.ts +35 -0
- package/dist/types/math/src/constants.d.ts +0 -1
- package/dist/types/math/src/curve.d.ts +4 -1
- package/dist/types/math/src/point.d.ts +2 -1
- package/dist/types/utils/src/index.d.ts +1 -2
- package/package.json +1 -1
- package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
- 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/TTDDialog/TTDDialogTrigger.d.ts +0 -8
- package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +0 -24
- 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 -47
- package/dist/types/excalidraw/polyfill.d.ts +0 -2
- package/dist/types/utils/src/bbox.d.ts +0 -9
- package/dist/types/utils/src/withinBounds.d.ts +0 -19
|
@@ -1,88 +1,36 @@
|
|
|
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[];
|
|
12
20
|
appState: {
|
|
13
|
-
|
|
21
|
+
viewModeEnabled: boolean;
|
|
22
|
+
zenModeEnabled: boolean;
|
|
23
|
+
gridModeEnabled: boolean;
|
|
24
|
+
objectsSnapModeEnabled: boolean;
|
|
14
25
|
theme: import("@excalidraw/element/types").Theme;
|
|
15
|
-
frameRendering: {
|
|
16
|
-
enabled: boolean;
|
|
17
|
-
name: boolean;
|
|
18
|
-
outline: boolean;
|
|
19
|
-
clip: boolean;
|
|
20
|
-
};
|
|
21
26
|
name: string | null;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
scrollY: number;
|
|
25
|
-
viewModeEnabled: boolean;
|
|
26
|
-
openDialog: null | {
|
|
27
|
-
name: "imageExport" | "help" | "jsonExport";
|
|
28
|
-
} | {
|
|
29
|
-
name: "ttd";
|
|
30
|
-
tab: "text-to-diagram" | "mermaid";
|
|
31
|
-
} | {
|
|
32
|
-
name: "commandPalette";
|
|
33
|
-
} | {
|
|
34
|
-
name: "settings";
|
|
35
|
-
} | {
|
|
36
|
-
name: "elementLinkSelector";
|
|
37
|
-
sourceElementId: ExcalidrawElement["id"];
|
|
38
|
-
};
|
|
39
|
-
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
40
|
-
selectedElementIds: Readonly<{
|
|
41
|
-
[id: string]: true;
|
|
42
|
-
}>;
|
|
43
|
-
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
27
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
28
|
+
gridSize: number;
|
|
44
29
|
activeTool: {
|
|
45
30
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
46
31
|
locked: boolean;
|
|
47
32
|
fromSelection: boolean;
|
|
48
33
|
} & import("../types").ActiveTool;
|
|
49
|
-
activeEmbeddable: {
|
|
50
|
-
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
51
|
-
state: "hover" | "active";
|
|
52
|
-
} | null;
|
|
53
|
-
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
54
|
-
selectedGroupIds: {
|
|
55
|
-
[groupId: string]: boolean;
|
|
56
|
-
};
|
|
57
|
-
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
58
|
-
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
59
|
-
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
60
|
-
isBindingEnabled: boolean;
|
|
61
|
-
suggestedBinding: {
|
|
62
|
-
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
63
|
-
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
64
|
-
} | 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
|
-
zenModeEnabled: boolean;
|
|
70
|
-
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
71
|
-
isCropping: boolean;
|
|
72
|
-
croppingElementId: ExcalidrawElement["id"] | null;
|
|
73
|
-
searchMatches: Readonly<{
|
|
74
|
-
focusedId: ExcalidrawElement["id"] | null;
|
|
75
|
-
matches: readonly import("../types").SearchMatch[];
|
|
76
|
-
}> | null;
|
|
77
|
-
activeLockedId: string | null;
|
|
78
|
-
hoveredElementIds: Readonly<{
|
|
79
|
-
[id: string]: true;
|
|
80
|
-
}>;
|
|
81
|
-
shouldCacheIgnoreZoom: boolean;
|
|
82
|
-
exportScale: number;
|
|
83
|
-
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
84
|
-
bindMode: import("@excalidraw/element/types").BindMode;
|
|
85
|
-
gridSize: number;
|
|
86
34
|
contextMenu: {
|
|
87
35
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
88
36
|
top: number;
|
|
@@ -91,9 +39,32 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
91
39
|
showWelcomeScreen: boolean;
|
|
92
40
|
isLoading: boolean;
|
|
93
41
|
errorMessage: React.ReactNode;
|
|
42
|
+
activeEmbeddable: {
|
|
43
|
+
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
44
|
+
state: "hover" | "active";
|
|
45
|
+
} | null;
|
|
46
|
+
newElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
94
47
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
95
|
-
|
|
48
|
+
multiElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
49
|
+
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
50
|
+
isBindingEnabled: boolean;
|
|
51
|
+
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
52
|
+
bindingPreference: "enabled" | "disabled";
|
|
53
|
+
isMidpointSnappingEnabled: boolean;
|
|
54
|
+
suggestedBinding: {
|
|
55
|
+
element: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
56
|
+
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
57
|
+
} | null;
|
|
58
|
+
frameToHighlight: NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
59
|
+
frameRendering: {
|
|
60
|
+
enabled: boolean;
|
|
61
|
+
name: boolean;
|
|
62
|
+
outline: boolean;
|
|
63
|
+
clip: boolean;
|
|
64
|
+
};
|
|
96
65
|
editingFrame: string | null;
|
|
66
|
+
elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
|
|
67
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
97
68
|
preferredSelectionTool: {
|
|
98
69
|
type: "selection" | "lasso";
|
|
99
70
|
initialized: boolean;
|
|
@@ -103,12 +74,14 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
103
74
|
exportBackground: boolean;
|
|
104
75
|
exportEmbedScene: boolean;
|
|
105
76
|
exportWithDarkMode: boolean;
|
|
77
|
+
exportScale: number;
|
|
106
78
|
currentItemStrokeColor: string;
|
|
107
79
|
currentItemBackgroundColor: string;
|
|
108
80
|
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
109
|
-
|
|
81
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
110
82
|
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
111
83
|
currentItemRoughness: number;
|
|
84
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
112
85
|
currentItemOpacity: number;
|
|
113
86
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
114
87
|
currentItemFontSize: number;
|
|
@@ -117,52 +90,86 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
117
90
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
118
91
|
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
119
92
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
93
|
+
viewBackgroundColor: string;
|
|
94
|
+
scrollX: number;
|
|
95
|
+
scrollY: number;
|
|
120
96
|
cursorButton: "up" | "down";
|
|
121
97
|
scrolledOutside: boolean;
|
|
122
98
|
isResizing: boolean;
|
|
99
|
+
isRotating: boolean;
|
|
100
|
+
zoom: import("../types").Zoom;
|
|
123
101
|
openMenu: "canvas" | null;
|
|
124
102
|
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
125
103
|
openSidebar: {
|
|
126
104
|
name: import("../types").SidebarName;
|
|
127
105
|
tab?: import("../types").SidebarTabName;
|
|
128
106
|
} | null;
|
|
107
|
+
openDialog: null | {
|
|
108
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
109
|
+
} | {
|
|
110
|
+
name: "ttd";
|
|
111
|
+
tab: "text-to-diagram" | "mermaid";
|
|
112
|
+
} | {
|
|
113
|
+
name: "commandPalette";
|
|
114
|
+
} | {
|
|
115
|
+
name: "settings";
|
|
116
|
+
} | {
|
|
117
|
+
name: "elementLinkSelector";
|
|
118
|
+
sourceElementId: ExcalidrawElement["id"];
|
|
119
|
+
} | {
|
|
120
|
+
name: "charts";
|
|
121
|
+
data: import("../charts").Spreadsheet;
|
|
122
|
+
rawText: string;
|
|
123
|
+
};
|
|
129
124
|
defaultSidebarDockedPreference: boolean;
|
|
130
125
|
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
126
|
+
selectedElementIds: Readonly<{
|
|
127
|
+
[id: string]: true;
|
|
128
|
+
}>;
|
|
129
|
+
hoveredElementIds: Readonly<{
|
|
130
|
+
[id: string]: true;
|
|
131
|
+
}>;
|
|
131
132
|
previousSelectedElementIds: {
|
|
132
133
|
[id: string]: true;
|
|
133
134
|
};
|
|
134
135
|
selectedElementsAreBeingDragged: boolean;
|
|
136
|
+
shouldCacheIgnoreZoom: boolean;
|
|
135
137
|
toast: {
|
|
136
|
-
message:
|
|
138
|
+
message: React.ReactNode;
|
|
137
139
|
closable?: boolean;
|
|
138
140
|
duration?: number;
|
|
139
141
|
} | null;
|
|
140
142
|
gridStep: number;
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
selectedGroupIds: {
|
|
144
|
+
[groupId: string]: boolean;
|
|
145
|
+
};
|
|
146
|
+
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
147
|
+
fileHandle: FileSystemFileHandle | null;
|
|
148
|
+
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
143
149
|
stats: {
|
|
144
150
|
open: boolean;
|
|
145
151
|
panels: number;
|
|
146
152
|
};
|
|
147
|
-
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
148
|
-
pasteDialog: {
|
|
149
|
-
shown: false;
|
|
150
|
-
data: null;
|
|
151
|
-
} | {
|
|
152
|
-
shown: true;
|
|
153
|
-
data: import("../charts").Spreadsheet;
|
|
154
|
-
};
|
|
155
153
|
showHyperlinkPopup: false | "info" | "editor";
|
|
154
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
155
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
156
156
|
originSnapOffset: {
|
|
157
157
|
x: number;
|
|
158
158
|
y: number;
|
|
159
159
|
} | null;
|
|
160
|
-
objectsSnapModeEnabled: boolean;
|
|
161
160
|
userToFollow: import("../types").UserToFollow | null;
|
|
162
161
|
followedBy: Set<import("../types").SocketId>;
|
|
162
|
+
isCropping: boolean;
|
|
163
|
+
croppingElementId: ExcalidrawElement["id"] | null;
|
|
164
|
+
searchMatches: Readonly<{
|
|
165
|
+
focusedId: ExcalidrawElement["id"] | null;
|
|
166
|
+
matches: readonly import("../types").SearchMatch[];
|
|
167
|
+
}> | null;
|
|
168
|
+
activeLockedId: string | null;
|
|
163
169
|
lockedMultiSelections: {
|
|
164
170
|
[groupId: string]: true;
|
|
165
171
|
};
|
|
172
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
166
173
|
};
|
|
167
174
|
files: BinaryFiles;
|
|
168
175
|
}>;
|
|
@@ -37,7 +37,7 @@ export interface LibraryMigrationAdapter {
|
|
|
37
37
|
/** clears entire storage afterwards */
|
|
38
38
|
clear(): MaybePromise<void>;
|
|
39
39
|
}
|
|
40
|
-
export declare const libraryItemsAtom: import("jotai
|
|
40
|
+
export declare const libraryItemsAtom: import("jotai").PrimitiveAtom<{
|
|
41
41
|
status: "loading" | "loaded";
|
|
42
42
|
/** indicates whether library is initialized with library items (has gone
|
|
43
43
|
* through at least one update). Used in UI. Specific to this atom only. */
|
|
@@ -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
|
}>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { AnimatedTrail } from "../
|
|
2
|
-
import type { AnimationFrameHandler } from "../animation-frame-handler";
|
|
1
|
+
import { AnimatedTrail } from "../animatedTrail";
|
|
3
2
|
import type App from "../components/App";
|
|
4
3
|
export declare class EraserTrail extends AnimatedTrail {
|
|
5
4
|
private elementsToErase;
|
|
6
5
|
private groupsToErase;
|
|
7
|
-
constructor(
|
|
6
|
+
constructor(app: App);
|
|
8
7
|
startPath(x: number, y: number): void;
|
|
9
8
|
addPointToPath(x: number, y: number, restore?: boolean): string[];
|
|
10
9
|
private updateElementsToBeErased;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LibraryItem } from "../types";
|
|
2
2
|
export type SvgCache = Map<LibraryItem["id"], SVGSVGElement>;
|
|
3
|
-
export declare const libraryItemSvgsCache: import("jotai
|
|
3
|
+
export declare const libraryItemSvgsCache: import("jotai").PrimitiveAtom<SvgCache> & {
|
|
4
4
|
init: SvgCache;
|
|
5
5
|
};
|
|
6
6
|
export declare const useLibraryItemSvg: (id: LibraryItem["id"] | null, elements: LibraryItem["elements"] | undefined, svgCache: SvgCache, ref: React.RefObject<HTMLDivElement | null>) => SVGSVGElement | undefined;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { AnimatedTrail } from "./
|
|
2
|
-
import type { Trail } from "./
|
|
3
|
-
import type { AnimationFrameHandler } from "./animation-frame-handler";
|
|
1
|
+
import { AnimatedTrail } from "./animatedTrail";
|
|
2
|
+
import type { Trail } from "./animatedTrail";
|
|
4
3
|
import type App from "./components/App";
|
|
5
4
|
export declare class LaserTrails implements Trail {
|
|
6
|
-
private animationFrameHandler;
|
|
7
5
|
private app;
|
|
8
6
|
localTrail: AnimatedTrail;
|
|
9
7
|
private collabTrails;
|
|
10
8
|
private container?;
|
|
11
|
-
constructor(
|
|
9
|
+
constructor(app: App);
|
|
12
10
|
private getTrailOptions;
|
|
13
11
|
startPath(x: number, y: number): void;
|
|
14
12
|
addPointToPath(x: number, y: number): void;
|
|
15
13
|
endPath(): void;
|
|
16
14
|
start(container: SVGSVGElement): void;
|
|
17
15
|
stop(): void;
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
private stopCollabTrails;
|
|
17
|
+
updateCollabTrails(collaborators: App["state"]["collaborators"]): void;
|
|
20
18
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AnimatedTrail } from "../animated-trail";
|
|
1
|
+
import { AnimatedTrail } from "../animatedTrail";
|
|
3
2
|
import type App from "../components/App";
|
|
4
3
|
export declare class LassoTrail extends AnimatedTrail {
|
|
5
4
|
private intersectedElements;
|
|
@@ -7,7 +6,7 @@ export declare class LassoTrail extends AnimatedTrail {
|
|
|
7
6
|
private elementsSegments;
|
|
8
7
|
private canvasTranslate;
|
|
9
8
|
private keepPreviousSelection;
|
|
10
|
-
constructor(
|
|
9
|
+
constructor(app: App);
|
|
11
10
|
startPath(x: number, y: number, keepPreviousSelection?: boolean): void;
|
|
12
11
|
selectElementsFromIds: (ids: string[]) => void;
|
|
13
12
|
addPointToPath: (x: number, y: number, keepPreviousSelection?: boolean) => void;
|
|
@@ -3,9 +3,12 @@ export type Animation<R extends object> = (params: {
|
|
|
3
3
|
state?: R;
|
|
4
4
|
}) => R | null | undefined;
|
|
5
5
|
export declare class AnimationController {
|
|
6
|
-
private static
|
|
6
|
+
private static scheduledFrame;
|
|
7
7
|
private static animations;
|
|
8
8
|
static start<R extends object>(key: string, animation: Animation<R>): void;
|
|
9
|
+
private static scheduleNextFrame;
|
|
10
|
+
private static cancelScheduledFrame;
|
|
11
|
+
private static cancelScheduledFrameIfIdle;
|
|
9
12
|
private static tick;
|
|
10
13
|
static running(key: string): boolean;
|
|
11
14
|
static cancel(key: string): void;
|