@zsviczian/excalidraw 0.18.0-6 → 0.18.0-60
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/excalidraw.development.js +757 -504
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +0 -2
- package/dist/styles.development.css +1080 -437
- package/dist/styles.production.css +26 -22
- package/package.json +15 -4
- package/types/common/src/commonObsidianUtils.d.ts +20 -0
- package/types/common/src/constants.d.ts +42 -18
- package/types/common/src/editorInterface.d.ts +35 -0
- package/types/{excalidraw → common/src}/emitter.d.ts +1 -1
- package/types/common/src/font-metadata.d.ts +4 -2
- package/types/common/src/index.d.ts +4 -0
- package/types/common/src/utility-types.d.ts +5 -0
- package/types/common/src/utils.d.ts +25 -6
- package/types/{excalidraw → common/src}/visualdebug.d.ts +2 -2
- package/types/{excalidraw/scene → element/src}/Scene.d.ts +16 -15
- package/types/element/src/align.d.ts +4 -3
- package/types/element/src/binding.d.ts +62 -41
- package/types/element/src/bounds.d.ts +14 -6
- package/types/element/src/collision.d.ts +23 -13
- package/types/element/src/cropElement.d.ts +1 -1
- package/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +77 -40
- package/types/element/src/distance.d.ts +2 -2
- package/types/element/src/distribute.d.ts +2 -1
- package/types/element/src/dragElements.d.ts +3 -2
- package/types/element/src/duplicate.d.ts +10 -13
- package/types/element/src/elbowArrow.d.ts +1 -1
- package/types/element/src/flowchart.d.ts +3 -2
- package/types/element/src/fractionalIndex.d.ts +9 -3
- package/types/element/src/frame.d.ts +5 -4
- package/types/element/src/groups.d.ts +1 -0
- package/types/element/src/index.d.ts +44 -5
- package/types/element/src/linearElementEditor.d.ts +34 -50
- package/types/element/src/mutateElement.d.ts +11 -3
- package/types/element/src/newElement.d.ts +6 -4
- package/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/types/element/src/renderElement.d.ts +5 -2
- package/types/element/src/resizeElements.d.ts +6 -5
- package/types/element/src/resizeTest.d.ts +5 -4
- package/types/element/src/selection.d.ts +11 -5
- package/types/element/src/shape.d.ts +42 -0
- package/types/element/src/sizeHelpers.d.ts +2 -2
- package/types/element/src/store.d.ts +237 -0
- package/types/element/src/textElement.d.ts +4 -3
- package/types/element/src/transformHandles.d.ts +5 -4
- package/types/element/src/typeChecks.d.ts +20 -3
- package/types/element/src/types.d.ts +31 -12
- package/types/element/src/utils.d.ts +17 -6
- package/types/element/src/zindex.d.ts +8 -2
- package/types/excalidraw/actions/actionAddToLibrary.d.ts +88 -58
- package/types/excalidraw/actions/actionAlign.d.ts +6 -6
- package/types/excalidraw/actions/actionBoundText.d.ts +61 -41
- package/types/excalidraw/actions/actionCanvas.d.ts +430 -519
- package/types/excalidraw/actions/actionClipboard.d.ts +81 -944
- package/types/excalidraw/actions/actionCropEditor.d.ts +30 -20
- package/types/excalidraw/actions/actionDeleteSelected.d.ts +97 -68
- package/types/excalidraw/actions/actionDistribute.d.ts +2 -2
- package/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
- package/types/excalidraw/actions/actionElementLink.d.ts +28 -20
- package/types/excalidraw/actions/actionElementLock.d.ts +73 -54
- package/types/excalidraw/actions/actionEmbeddable.d.ts +30 -20
- package/types/excalidraw/actions/actionExport.d.ts +142 -1185
- package/types/excalidraw/actions/actionFinalize.d.ts +10 -424
- package/types/excalidraw/actions/actionFlip.d.ts +2 -2
- package/types/excalidraw/actions/actionFrame.d.ts +176 -129
- package/types/excalidraw/actions/actionGroup.d.ts +60 -40
- package/types/excalidraw/actions/actionHistory.d.ts +1 -2
- package/types/excalidraw/actions/actionLinearEditor.d.ts +564 -22
- package/types/excalidraw/actions/actionLink.d.ts +27 -17
- package/types/excalidraw/actions/actionMenu.d.ts +27 -457
- package/types/excalidraw/actions/actionNavigate.d.ts +21 -431
- package/types/excalidraw/actions/actionProperties.d.ts +169 -2702
- package/types/excalidraw/actions/actionSelectAll.d.ts +30 -20
- package/types/excalidraw/actions/actionStyles.d.ts +31 -21
- package/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
- package/types/excalidraw/actions/actionToggleGridMode.d.ts +29 -19
- package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +29 -19
- package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +27 -224
- package/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/types/excalidraw/actions/actionToggleStats.d.ts +29 -19
- package/types/excalidraw/actions/actionToggleViewMode.d.ts +30 -20
- package/types/excalidraw/actions/actionToggleZenMode.d.ts +30 -20
- package/types/excalidraw/actions/actionTrayMenu.d.ts +229 -0
- package/types/excalidraw/actions/actionZindex.d.ts +2 -2
- package/types/excalidraw/actions/index.d.ts +4 -2
- package/types/excalidraw/actions/manager.d.ts +1 -1
- package/types/excalidraw/actions/register.d.ts +1 -1
- package/types/excalidraw/actions/types.d.ts +7 -6
- package/types/excalidraw/appState.d.ts +22 -7
- package/types/excalidraw/clipboard.d.ts +68 -5
- package/types/excalidraw/components/Actions.d.ts +20 -7
- package/types/excalidraw/components/App.d.ts +68 -46
- package/types/excalidraw/components/ButtonIcon.d.ts +1 -0
- package/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
- package/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +5 -1
- package/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
- package/types/excalidraw/components/ColorPicker/Picker.d.ts +4 -3
- package/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +3 -3
- package/types/excalidraw/components/ColorPicker/ShadeList.d.ts +3 -2
- package/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
- package/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
- package/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
- package/types/excalidraw/components/CommandPalette/types.d.ts +1 -2
- package/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
- package/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
- package/types/excalidraw/components/Ellipsify.d.ts +3 -0
- package/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
- package/types/excalidraw/components/FilledButton.d.ts +1 -1
- package/types/excalidraw/components/FixedSideContainer.d.ts +2 -1
- package/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
- package/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
- package/types/excalidraw/components/HintViewer.d.ts +4 -3
- package/types/excalidraw/components/InlineIcon.d.ts +3 -1
- package/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
- package/types/excalidraw/components/LinkButton.d.ts +4 -0
- package/types/excalidraw/components/MobileMenu.d.ts +4 -5
- package/types/excalidraw/components/MobileToolBar.d.ts +10 -0
- package/types/excalidraw/components/Popover.d.ts +2 -1
- package/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
- package/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
- package/types/excalidraw/components/Range.d.ts +3 -3
- package/types/excalidraw/components/Section.d.ts +1 -0
- package/types/excalidraw/components/Stats/Angle.d.ts +1 -1
- package/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
- package/types/excalidraw/components/Stats/CanvasGridSize.d.ts +1 -1
- package/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
- package/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
- package/types/excalidraw/components/Stats/DragInput.d.ts +12 -2
- package/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
- package/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
- package/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
- package/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
- package/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
- package/types/excalidraw/components/Stats/Position.d.ts +1 -1
- package/types/excalidraw/components/Stats/utils.d.ts +4 -11
- package/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
- package/types/excalidraw/components/TextField.d.ts +1 -0
- package/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/types/excalidraw/components/TrayMenu.d.ts +26 -0
- package/types/excalidraw/components/UnlockPopup.d.ts +8 -0
- package/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +7 -3
- package/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
- package/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
- package/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
- package/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
- package/types/excalidraw/components/icons.d.ts +17 -0
- package/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +14 -1
- package/types/excalidraw/components/main-menu/MainMenu.d.ts +0 -3
- package/types/excalidraw/components/shapes.d.ts +115 -5
- package/types/excalidraw/data/blob.d.ts +3 -7
- package/types/excalidraw/data/reconcile.d.ts +1 -0
- package/types/excalidraw/data/restore.d.ts +7 -2
- package/types/excalidraw/data/transform.d.ts +1 -1
- package/types/excalidraw/data/types.d.ts +4 -1
- package/types/excalidraw/editor-jotai.d.ts +6 -6
- package/types/excalidraw/eraser/index.d.ts +0 -2
- package/types/excalidraw/fonts/Fonts.d.ts +1 -1
- package/types/excalidraw/history.d.ts +30 -22
- package/types/excalidraw/hooks/useEmitter.d.ts +1 -1
- package/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/types/excalidraw/hooks/useOutsideClick.d.ts +3 -1
- package/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/types/excalidraw/index.d.ts +16 -15
- package/types/excalidraw/lasso/index.d.ts +1 -0
- package/types/excalidraw/lasso/utils.d.ts +2 -1
- package/types/excalidraw/obsidianUtils.d.ts +22 -9
- package/types/excalidraw/renderer/animation.d.ts +12 -0
- package/types/excalidraw/renderer/helpers.d.ts +3 -2
- package/types/excalidraw/renderer/interactiveScene.d.ts +5 -13
- package/types/excalidraw/renderer/staticScene.d.ts +4 -1
- package/types/excalidraw/scene/Renderer.d.ts +1 -2
- package/types/excalidraw/scene/index.d.ts +2 -2
- package/types/excalidraw/scene/scrollbars.d.ts +2 -3
- package/types/excalidraw/scene/types.d.ts +17 -3
- package/types/excalidraw/shortcut.d.ts +1 -0
- package/types/excalidraw/snapping.d.ts +2 -2
- package/types/excalidraw/types.d.ts +83 -33
- package/types/excalidraw/webpack.dev.config.d.ts +2 -0
- package/types/excalidraw/webpack.prod.config.d.ts +2 -0
- package/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
- package/types/math/src/angle.d.ts +2 -0
- package/types/math/src/constants.d.ts +3 -0
- package/types/math/src/curve.d.ts +34 -0
- package/types/math/src/index.d.ts +1 -0
- package/types/math/src/point.d.ts +1 -1
- package/types/math/src/rectangle.d.ts +2 -0
- package/types/math/src/segment.d.ts +1 -0
- package/types/math/src/vector.d.ts +8 -2
- package/types/utils/src/bbox.d.ts +1 -1
- package/types/utils/src/index.d.ts +1 -1
- package/types/utils/src/withinBounds.d.ts +1 -1
- package/types/element/src/Shape.d.ts +0 -17
- package/types/element/src/ShapeCache.d.ts +0 -25
- package/types/element/src/shapes.d.ts +0 -23
- package/types/excalidraw/components/ButtonSelect.d.ts +0 -9
- package/types/excalidraw/store.d.ts +0 -129
- package/types/utils/src/collision.d.ts +0 -8
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AppClassProperties } from "../types";
|
|
1
2
|
export declare const SHAPES: readonly [{
|
|
2
3
|
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
readonly value: "selection";
|
|
@@ -48,9 +49,58 @@ export declare const SHAPES: readonly [{
|
|
|
48
49
|
readonly fillable: false;
|
|
49
50
|
}, {
|
|
50
51
|
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
51
|
-
readonly value: "
|
|
52
|
-
readonly key:
|
|
53
|
-
readonly numericKey: "
|
|
52
|
+
readonly value: "eraser";
|
|
53
|
+
readonly key: "e";
|
|
54
|
+
readonly numericKey: "0";
|
|
55
|
+
readonly fillable: false;
|
|
56
|
+
}];
|
|
57
|
+
export declare const getToolbarTools: (app: AppClassProperties) => readonly [{
|
|
58
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
readonly value: "selection";
|
|
60
|
+
readonly key: "v";
|
|
61
|
+
readonly numericKey: "1";
|
|
62
|
+
readonly fillable: true;
|
|
63
|
+
}, {
|
|
64
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
readonly value: "rectangle";
|
|
66
|
+
readonly key: "r";
|
|
67
|
+
readonly numericKey: "2";
|
|
68
|
+
readonly fillable: true;
|
|
69
|
+
}, {
|
|
70
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
71
|
+
readonly value: "diamond";
|
|
72
|
+
readonly key: "d";
|
|
73
|
+
readonly numericKey: "3";
|
|
74
|
+
readonly fillable: true;
|
|
75
|
+
}, {
|
|
76
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
readonly value: "ellipse";
|
|
78
|
+
readonly key: "o";
|
|
79
|
+
readonly numericKey: "4";
|
|
80
|
+
readonly fillable: true;
|
|
81
|
+
}, {
|
|
82
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
readonly value: "arrow";
|
|
84
|
+
readonly key: "a";
|
|
85
|
+
readonly numericKey: "5";
|
|
86
|
+
readonly fillable: true;
|
|
87
|
+
}, {
|
|
88
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
readonly value: "line";
|
|
90
|
+
readonly key: "l";
|
|
91
|
+
readonly numericKey: "6";
|
|
92
|
+
readonly fillable: true;
|
|
93
|
+
}, {
|
|
94
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
95
|
+
readonly value: "freedraw";
|
|
96
|
+
readonly key: readonly ["p", "x"];
|
|
97
|
+
readonly numericKey: "7";
|
|
98
|
+
readonly fillable: false;
|
|
99
|
+
}, {
|
|
100
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
readonly value: "text";
|
|
102
|
+
readonly key: "t";
|
|
103
|
+
readonly numericKey: "8";
|
|
54
104
|
readonly fillable: false;
|
|
55
105
|
}, {
|
|
56
106
|
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -58,5 +108,65 @@ export declare const SHAPES: readonly [{
|
|
|
58
108
|
readonly key: "e";
|
|
59
109
|
readonly numericKey: "0";
|
|
60
110
|
readonly fillable: false;
|
|
61
|
-
}]
|
|
62
|
-
|
|
111
|
+
}] | readonly [{
|
|
112
|
+
readonly value: "lasso";
|
|
113
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
114
|
+
readonly key: "v";
|
|
115
|
+
readonly numericKey: "1";
|
|
116
|
+
readonly fillable: true;
|
|
117
|
+
}, ...({
|
|
118
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
119
|
+
readonly value: "selection";
|
|
120
|
+
readonly key: "v";
|
|
121
|
+
readonly numericKey: "1";
|
|
122
|
+
readonly fillable: true;
|
|
123
|
+
} | {
|
|
124
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
125
|
+
readonly value: "rectangle";
|
|
126
|
+
readonly key: "r";
|
|
127
|
+
readonly numericKey: "2";
|
|
128
|
+
readonly fillable: true;
|
|
129
|
+
} | {
|
|
130
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
131
|
+
readonly value: "diamond";
|
|
132
|
+
readonly key: "d";
|
|
133
|
+
readonly numericKey: "3";
|
|
134
|
+
readonly fillable: true;
|
|
135
|
+
} | {
|
|
136
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
137
|
+
readonly value: "ellipse";
|
|
138
|
+
readonly key: "o";
|
|
139
|
+
readonly numericKey: "4";
|
|
140
|
+
readonly fillable: true;
|
|
141
|
+
} | {
|
|
142
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
143
|
+
readonly value: "arrow";
|
|
144
|
+
readonly key: "a";
|
|
145
|
+
readonly numericKey: "5";
|
|
146
|
+
readonly fillable: true;
|
|
147
|
+
} | {
|
|
148
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
149
|
+
readonly value: "line";
|
|
150
|
+
readonly key: "l";
|
|
151
|
+
readonly numericKey: "6";
|
|
152
|
+
readonly fillable: true;
|
|
153
|
+
} | {
|
|
154
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
155
|
+
readonly value: "freedraw";
|
|
156
|
+
readonly key: readonly ["p", "x"];
|
|
157
|
+
readonly numericKey: "7";
|
|
158
|
+
readonly fillable: false;
|
|
159
|
+
} | {
|
|
160
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
161
|
+
readonly value: "text";
|
|
162
|
+
readonly key: "t";
|
|
163
|
+
readonly numericKey: "8";
|
|
164
|
+
readonly fillable: false;
|
|
165
|
+
} | {
|
|
166
|
+
readonly icon: import("react/jsx-runtime").JSX.Element;
|
|
167
|
+
readonly value: "eraser";
|
|
168
|
+
readonly key: "e";
|
|
169
|
+
readonly numericKey: "0";
|
|
170
|
+
readonly fillable: false;
|
|
171
|
+
})[]];
|
|
172
|
+
export declare const findShapeByKey: (key: string, app: AppClassProperties) => "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "freedraw" | "lasso" | "eraser" | null;
|
|
@@ -2,7 +2,7 @@ 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 "
|
|
5
|
+
import type { FileSystemHandle } from "browser-fs-access";
|
|
6
6
|
import type { ImportedLibraryData } from "./types";
|
|
7
7
|
export declare const getMimeType: (blob: Blob | string) => string;
|
|
8
8
|
export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
|
|
@@ -40,12 +40,8 @@ export declare const SVGStringToFile: (SVGString: string, filename?: string) =>
|
|
|
40
40
|
type: typeof MIME_TYPES.svg;
|
|
41
41
|
};
|
|
42
42
|
export declare const ImageURLToFile: (imageUrl: string, filename?: string) => Promise<File | undefined>;
|
|
43
|
-
export declare const
|
|
44
|
-
|
|
45
|
-
fileHandle: FileSystemHandle | null;
|
|
46
|
-
}>;
|
|
47
|
-
export declare const getFileHandle: (event: React.DragEvent<HTMLDivElement>) => Promise<FileSystemHandle | null>;
|
|
48
|
-
export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: ValueOf<typeof MIME_TYPES>, name: string | undefined) => File;
|
|
43
|
+
export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemHandle | null>;
|
|
44
|
+
export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: string, name: string | undefined) => File;
|
|
49
45
|
/** attempts to detect correct mimeType if none is set, or if an image
|
|
50
46
|
* has an incorrect extension.
|
|
51
47
|
* Note: doesn't handle missing .excalidraw/.excalidrawlib extension */
|
|
@@ -3,4 +3,5 @@ import type { MakeBrand } from "@excalidraw/common/utility-types";
|
|
|
3
3
|
import type { AppState } from "../types";
|
|
4
4
|
export type ReconciledExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"ReconciledElement">;
|
|
5
5
|
export type RemoteExcalidrawElement = OrderedExcalidrawElement & MakeBrand<"RemoteExcalidrawElement">;
|
|
6
|
+
export declare const shouldDiscardRemoteElement: (localAppState: AppState, local: OrderedExcalidrawElement | undefined, remote: RemoteExcalidrawElement) => boolean;
|
|
6
7
|
export declare const reconcileElements: (localElements: readonly OrderedExcalidrawElement[], remoteElements: readonly RemoteExcalidrawElement[], localAppState: AppState) => ReconciledExcalidrawElement[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExcalidrawElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
1
|
+
import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawSelectionElement, ExcalidrawTextElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
2
|
import type { AppState, BinaryFiles, LibraryItem } from "../types";
|
|
3
3
|
import type { ImportedDataState } from "./types";
|
|
4
4
|
type RestoredAppState = Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
@@ -8,14 +8,19 @@ export type RestoredDataState = {
|
|
|
8
8
|
appState: RestoredAppState;
|
|
9
9
|
files: BinaryFiles;
|
|
10
10
|
};
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const restoreElement: (element: Exclude<ExcalidrawElement, ExcalidrawSelectionElement>, elementsMap: Readonly<ElementsMap>, opts?: {
|
|
12
|
+
deleteInvisibleElements?: boolean;
|
|
13
|
+
}) => ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement | ExcalidrawArrowElement | null;
|
|
14
|
+
export declare const restoreElements: (targetElements: ImportedDataState["elements"], localElements: readonly ExcalidrawElement[] | null | undefined, opts?: {
|
|
12
15
|
refreshDimensions?: boolean;
|
|
13
16
|
repairBindings?: boolean;
|
|
17
|
+
deleteInvisibleElements?: boolean;
|
|
14
18
|
} | undefined) => OrderedExcalidrawElement[];
|
|
15
19
|
export declare const restoreAppState: (appState: ImportedDataState["appState"], localAppState: Partial<AppState> | null | undefined) => RestoredAppState;
|
|
16
20
|
export declare const restore: (data: Pick<ImportedDataState, "appState" | "elements" | "files"> | null, localAppState: Partial<AppState> | null | undefined, localElements: readonly ExcalidrawElement[] | null | undefined, elementsConfig?: {
|
|
17
21
|
refreshDimensions?: boolean;
|
|
18
22
|
repairBindings?: boolean;
|
|
23
|
+
deleteInvisibleElements?: boolean;
|
|
19
24
|
}) => RestoredDataState;
|
|
20
25
|
export declare const restoreLibraryItems: (libraryItems: ImportedDataState["libraryItems"], defaultStatus: LibraryItem["status"]) => LibraryItem[];
|
|
21
26
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ElementConstructorOpts } from "@excalidraw/element
|
|
1
|
+
import type { ElementConstructorOpts } from "@excalidraw/element";
|
|
2
2
|
import type { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawIframeLikeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawMagicFrameElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FileId, FontFamilyValues, TextAlign, VerticalAlign } from "@excalidraw/element/types";
|
|
3
3
|
import type { MarkOptional } from "@excalidraw/common/utility-types";
|
|
4
4
|
export type ValidLinearElement = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { VERSIONS } from "@excalidraw/common";
|
|
2
2
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
3
|
import type { cleanAppStateForExport } from "../appState";
|
|
4
|
-
import type { AppState, BinaryFiles, LibraryItems, LibraryItems_anyVersion } from "../types";
|
|
4
|
+
import type { AppState, BinaryFiles, LibraryItem, LibraryItems, LibraryItems_anyVersion } from "../types";
|
|
5
5
|
export interface ExportedDataState {
|
|
6
6
|
type: string;
|
|
7
7
|
version: number;
|
|
@@ -43,3 +43,6 @@ export interface ImportedLibraryData extends Partial<ExportedLibraryData> {
|
|
|
43
43
|
/** @deprecated v1 */
|
|
44
44
|
library?: LibraryItems;
|
|
45
45
|
}
|
|
46
|
+
export type ExcalidrawLibraryIds = {
|
|
47
|
+
itemIds: LibraryItem["id"][];
|
|
48
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { atom, createStore, type PrimitiveAtom } from "jotai";
|
|
1
|
+
import { atom, createStore, type PrimitiveAtom, type WritableAtom } from "jotai";
|
|
2
2
|
import { createIsolation } from "jotai-scope";
|
|
3
|
-
export { atom, PrimitiveAtom };
|
|
3
|
+
export { atom, PrimitiveAtom, WritableAtom };
|
|
4
4
|
export declare const useAtom: typeof import("jotai").useAtom, useSetAtom: typeof import("jotai").useSetAtom, useAtomValue: typeof import("jotai").useAtomValue, useStore: (options?: {
|
|
5
5
|
store?: {
|
|
6
6
|
get: <Value>(atom: import("jotai").Atom<Value>) => Value;
|
|
7
|
-
set: <Value_1, Args extends unknown[], Result>(atom:
|
|
7
|
+
set: <Value_1, Args extends unknown[], Result>(atom: WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
|
|
8
8
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
9
9
|
} | ({
|
|
10
10
|
get: <Value_2>(atom: import("jotai").Atom<Value_2>) => Value_2;
|
|
11
|
-
set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom:
|
|
11
|
+
set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom: WritableAtom<Value_1_1, Args_1, Result_1>, ...args: Args_1) => Result_1;
|
|
12
12
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
13
13
|
} & {
|
|
14
14
|
dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
|
|
@@ -29,11 +29,11 @@ export declare const useAtom: typeof import("jotai").useAtom, useSetAtom: typeof
|
|
|
29
29
|
}) | undefined;
|
|
30
30
|
} | undefined) => {
|
|
31
31
|
get: <Value_3>(atom: import("jotai").Atom<Value_3>) => Value_3;
|
|
32
|
-
set: <Value_1_2, Args_2 extends unknown[], Result_2>(atom:
|
|
32
|
+
set: <Value_1_2, Args_2 extends unknown[], Result_2>(atom: WritableAtom<Value_1_2, Args_2, Result_2>, ...args: Args_2) => Result_2;
|
|
33
33
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
34
34
|
} | ({
|
|
35
35
|
get: <Value_4>(atom: import("jotai").Atom<Value_4>) => Value_4;
|
|
36
|
-
set: <Value_1_3, Args_3 extends unknown[], Result_3>(atom:
|
|
36
|
+
set: <Value_1_3, Args_3 extends unknown[], Result_3>(atom: WritableAtom<Value_1_3, Args_3, Result_3>, ...args: Args_3) => Result_3;
|
|
37
37
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
38
38
|
} & {
|
|
39
39
|
dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
|
|
@@ -4,8 +4,6 @@ import type App from "../components/App";
|
|
|
4
4
|
export declare class EraserTrail extends AnimatedTrail {
|
|
5
5
|
private elementsToErase;
|
|
6
6
|
private groupsToErase;
|
|
7
|
-
private segmentsCache;
|
|
8
|
-
private geometricShapesCache;
|
|
9
7
|
constructor(animationFrameHandler: AnimationFrameHandler, app: App);
|
|
10
8
|
startPath(x: number, y: number): void;
|
|
11
9
|
addPointToPath(x: number, y: number, restore?: boolean): string[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type FontMetadata } from "@excalidraw/common";
|
|
2
2
|
import type { ExcalidrawElement, ExcalidrawTextElement } from "@excalidraw/element/types";
|
|
3
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
4
|
import { ExcalidrawFontFace } from "./ExcalidrawFontFace";
|
|
4
|
-
import type Scene from "../scene/Scene";
|
|
5
5
|
export declare class Fonts {
|
|
6
6
|
static readonly loadedFontsCache: Set<string>;
|
|
7
7
|
private static _registered;
|
|
@@ -1,40 +1,48 @@
|
|
|
1
|
+
import { Emitter } from "@excalidraw/common";
|
|
2
|
+
import { StoreDelta } from "@excalidraw/element";
|
|
3
|
+
import type { StoreSnapshot, Store } from "@excalidraw/element";
|
|
1
4
|
import type { SceneElementsMap } from "@excalidraw/element/types";
|
|
2
|
-
import { Emitter } from "./emitter";
|
|
3
|
-
import type { AppStateChange, ElementsChange } from "./change";
|
|
4
|
-
import type { Snapshot } from "./store";
|
|
5
5
|
import type { AppState } from "./types";
|
|
6
|
+
export declare class HistoryDelta extends StoreDelta {
|
|
7
|
+
/**
|
|
8
|
+
* Apply the delta to the passed elements and appState, does not modify the snapshot.
|
|
9
|
+
*/
|
|
10
|
+
applyTo(elements: SceneElementsMap, appState: AppState, snapshot: StoreSnapshot): [SceneElementsMap, AppState, boolean];
|
|
11
|
+
/**
|
|
12
|
+
* Overriding once to avoid type casting everywhere.
|
|
13
|
+
*/
|
|
14
|
+
static calculate(prevSnapshot: StoreSnapshot, nextSnapshot: StoreSnapshot): HistoryDelta;
|
|
15
|
+
/**
|
|
16
|
+
* Overriding once to avoid type casting everywhere.
|
|
17
|
+
*/
|
|
18
|
+
static inverse(delta: StoreDelta): HistoryDelta;
|
|
19
|
+
/**
|
|
20
|
+
* Overriding once to avoid type casting everywhere.
|
|
21
|
+
*/
|
|
22
|
+
static applyLatestChanges(delta: StoreDelta, prevElements: SceneElementsMap, nextElements: SceneElementsMap, modifierOptions?: "deleted" | "inserted"): HistoryDelta;
|
|
23
|
+
}
|
|
6
24
|
export declare class HistoryChangedEvent {
|
|
7
25
|
readonly isUndoStackEmpty: boolean;
|
|
8
26
|
readonly isRedoStackEmpty: boolean;
|
|
9
27
|
constructor(isUndoStackEmpty?: boolean, isRedoStackEmpty?: boolean);
|
|
10
28
|
}
|
|
11
29
|
export declare class History {
|
|
30
|
+
private readonly store;
|
|
12
31
|
readonly onHistoryChangedEmitter: Emitter<[HistoryChangedEvent]>;
|
|
13
|
-
|
|
14
|
-
|
|
32
|
+
readonly undoStack: HistoryDelta[];
|
|
33
|
+
readonly redoStack: HistoryDelta[];
|
|
15
34
|
get isUndoStackEmpty(): boolean;
|
|
16
35
|
get isRedoStackEmpty(): boolean;
|
|
36
|
+
constructor(store: Store);
|
|
17
37
|
clear(): void;
|
|
18
38
|
/**
|
|
19
|
-
* Record a local
|
|
39
|
+
* Record a non-empty local durable increment, which will go into the undo stack..
|
|
40
|
+
* Do not re-record history entries, which were already pushed to undo / redo stack, as part of history action.
|
|
20
41
|
*/
|
|
21
|
-
record(
|
|
22
|
-
undo(elements: SceneElementsMap, appState: AppState
|
|
23
|
-
redo(elements: SceneElementsMap, appState: AppState
|
|
42
|
+
record(delta: StoreDelta): void;
|
|
43
|
+
undo(elements: SceneElementsMap, appState: AppState): void | [SceneElementsMap, AppState];
|
|
44
|
+
redo(elements: SceneElementsMap, appState: AppState): void | [SceneElementsMap, AppState];
|
|
24
45
|
private perform;
|
|
25
46
|
private static pop;
|
|
26
47
|
private static push;
|
|
27
48
|
}
|
|
28
|
-
export declare class HistoryEntry {
|
|
29
|
-
readonly appStateChange: AppStateChange;
|
|
30
|
-
readonly elementsChange: ElementsChange;
|
|
31
|
-
private constructor();
|
|
32
|
-
static create(appStateChange: AppStateChange, elementsChange: ElementsChange): HistoryEntry;
|
|
33
|
-
inverse(): HistoryEntry;
|
|
34
|
-
applyTo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly<Snapshot>): [SceneElementsMap, AppState, boolean];
|
|
35
|
-
/**
|
|
36
|
-
* Apply latest (remote) changes to the history entry, creates new instance of `HistoryEntry`.
|
|
37
|
-
*/
|
|
38
|
-
applyLatestChanges(elements: SceneElementsMap): HistoryEntry;
|
|
39
|
-
isEmpty(): boolean;
|
|
40
|
-
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Emitter } from "
|
|
1
|
+
import type { Emitter } from "@excalidraw/common";
|
|
2
2
|
export declare const useEmitter: <TEvent extends unknown>(emitter: Emitter<[TEvent]>, initialState: TEvent) => TEvent;
|
|
@@ -3,7 +3,7 @@ export type SvgCache = Map<LibraryItem["id"], SVGSVGElement>;
|
|
|
3
3
|
export declare const libraryItemSvgsCache: import("jotai/vanilla/atom").PrimitiveAtom<SvgCache> & {
|
|
4
4
|
init: SvgCache;
|
|
5
5
|
};
|
|
6
|
-
export declare const useLibraryItemSvg: (id: LibraryItem["id"] | null, elements: LibraryItem["elements"] | undefined, svgCache: SvgCache) => SVGSVGElement | undefined;
|
|
6
|
+
export declare const useLibraryItemSvg: (id: LibraryItem["id"] | null, elements: LibraryItem["elements"] | undefined, svgCache: SvgCache, ref: React.RefObject<HTMLDivElement | null>) => SVGSVGElement | undefined;
|
|
7
7
|
export declare const useLibraryCache: () => {
|
|
8
8
|
clearLibraryCache: () => void;
|
|
9
9
|
deleteItemsFromLibraryCache: (items: LibraryItem["id"][]) => void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare function useOutsideClick<T extends HTMLElement>(ref: React.RefObject<T | null>,
|
|
2
2
|
/** if performance is of concern, memoize the callback */
|
|
3
|
-
callback: (event: Event
|
|
3
|
+
callback: (event: Event & {
|
|
4
|
+
target: T;
|
|
5
|
+
}) => void,
|
|
4
6
|
/**
|
|
5
7
|
* Optional callback which is called on every click.
|
|
6
8
|
*
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type CaretPosition = {
|
|
2
|
+
start: number;
|
|
3
|
+
end: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const saveCaretPosition: () => CaretPosition | null;
|
|
6
|
+
export declare const restoreCaretPosition: (position: CaretPosition | null) => void;
|
|
7
|
+
export declare const withCaretPositionPreservation: (callback: () => void, isCompactMode: boolean, isEditingText: boolean, onPreventClose?: () => void) => void;
|
|
8
|
+
export declare const useTextEditorFocus: () => {
|
|
9
|
+
saveCaretPosition: () => void;
|
|
10
|
+
restoreCaretPosition: () => void;
|
|
11
|
+
clearSavedPosition: () => void;
|
|
12
|
+
hasSavedPosition: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const temporarilyDisableTextEditorBlur: (duration?: number) => void;
|
|
@@ -9,40 +9,41 @@ import "./fonts/fonts.css";
|
|
|
9
9
|
import type { ExcalidrawProps } from "./types";
|
|
10
10
|
export declare const Excalidraw: React.MemoExoticComponent<(props: ExcalidrawProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
11
|
export { getSceneVersion, hashElementsVersion, hashString, getNonDeletedElements, } from "@excalidraw/element";
|
|
12
|
-
export { getTextFromElements } from "@excalidraw/element
|
|
13
|
-
export { isInvisiblySmallElement } from "@excalidraw/element
|
|
12
|
+
export { getTextFromElements } from "@excalidraw/element";
|
|
13
|
+
export { isInvisiblySmallElement } from "@excalidraw/element";
|
|
14
14
|
export { defaultLang, useI18n, languages } from "./i18n";
|
|
15
|
-
export { restore, restoreAppState, restoreElements, restoreLibraryItems, } from "./data/restore";
|
|
15
|
+
export { restore, restoreAppState, restoreElement, restoreElements, restoreLibraryItems, } from "./data/restore";
|
|
16
16
|
export { reconcileElements } from "./data/reconcile";
|
|
17
17
|
export { exportToCanvas, exportToBlob, exportToSvg, exportToClipboard, } from "@excalidraw/utils/export";
|
|
18
18
|
export { getCommonBoundingBox } from "@excalidraw/element/bounds";
|
|
19
19
|
export { getMaximumGroups } from "@excalidraw/element/groups";
|
|
20
|
-
export { determineFocusDistance } from "@excalidraw/element/binding";
|
|
21
20
|
export { measureText } from "@excalidraw/element/textMeasurements";
|
|
22
21
|
export { wrapText } from "@excalidraw/element/textWrapping";
|
|
23
22
|
export { getLineHeight } from "@excalidraw/common";
|
|
24
23
|
export { getFontString, getFontFamilyString } from "@excalidraw/common";
|
|
25
24
|
export { getBoundTextMaxWidth } from "@excalidraw/element/textElement";
|
|
26
25
|
export { mermaidToExcalidraw } from "./components/TTDDialog/MermaidToExcalidrawLib";
|
|
27
|
-
export {
|
|
26
|
+
export { registerLocalFont, getFontMetrics, getFontFamilies, registerFontsInCSS, getCSSFontDefinition, loadSceneFonts, getSharedMermaidInstance, loadMermaid, intersectElementWithLine, } from "../excalidraw/obsidianUtils";
|
|
28
27
|
export { refreshTextDimensions } from "@excalidraw/element/newElement";
|
|
28
|
+
export { syncMovedIndices, syncInvalidIndices } from "@excalidraw/element";
|
|
29
29
|
export { getContainerElement } from "@excalidraw/element/textElement";
|
|
30
30
|
export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
|
|
31
31
|
export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "./data/blob";
|
|
32
|
-
export { getFreeDrawSvgPath } from "@excalidraw/element
|
|
32
|
+
export { getFreeDrawSvgPath } from "@excalidraw/element";
|
|
33
33
|
export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
|
|
34
|
-
export { isLinearElement } from "@excalidraw/element
|
|
35
|
-
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, normalizeLink,
|
|
36
|
-
|
|
37
|
-
export {
|
|
34
|
+
export { isLinearElement } from "@excalidraw/element";
|
|
35
|
+
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, normalizeLink, sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, getFormFactor, safelyParseJSON, //zsviczian
|
|
36
|
+
destroyObsidianUtils, } from "@excalidraw/common";
|
|
37
|
+
export { mutateElement, newElementWith, bumpVersion, } from "@excalidraw/element";
|
|
38
|
+
export { CaptureUpdateAction } from "@excalidraw/element";
|
|
38
39
|
export { parseLibraryTokensFromUrl, useHandleLibrary } from "./data/library";
|
|
39
|
-
export { sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, safelyParseJSON, } from "@excalidraw/common";
|
|
40
40
|
export { getEmbedLink } from "@excalidraw/element/embeddable";
|
|
41
41
|
export { Sidebar } from "./components/Sidebar/Sidebar";
|
|
42
42
|
export { Button } from "./components/Button";
|
|
43
43
|
export { Footer };
|
|
44
44
|
export { MainMenu };
|
|
45
|
-
export {
|
|
45
|
+
export { Ellipsify } from "./components/Ellipsify";
|
|
46
|
+
export { useEditorInterface, useStylesPanelMode } from "./components/App";
|
|
46
47
|
export { WelcomeScreen };
|
|
47
48
|
export { LiveCollaborationTrigger };
|
|
48
49
|
export { Stats } from "./components/Stats";
|
|
@@ -51,9 +52,9 @@ export { TTDDialog } from "./components/TTDDialog/TTDDialog";
|
|
|
51
52
|
export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger";
|
|
52
53
|
export { zoomToFitBounds } from "./actions/actionCanvas";
|
|
53
54
|
export { convertToExcalidrawElements } from "./data/transform";
|
|
54
|
-
export { getCommonBounds, getVisibleSceneBounds
|
|
55
|
+
export { getCommonBounds, getVisibleSceneBounds } from "@excalidraw/element";
|
|
55
56
|
export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "@excalidraw/utils/withinBounds";
|
|
56
57
|
export { DiagramToCodePlugin } from "./components/DiagramToCodePlugin/DiagramToCodePlugin";
|
|
57
58
|
export { getDataURL } from "./data/blob";
|
|
58
|
-
export { isElementLink } from "@excalidraw/element
|
|
59
|
-
export { setCustomTextMetricsProvider } from "@excalidraw/element
|
|
59
|
+
export { isElementLink } from "@excalidraw/element";
|
|
60
|
+
export { setCustomTextMetricsProvider } from "@excalidraw/element";
|
|
@@ -5,6 +5,7 @@ export declare class LassoTrail extends AnimatedTrail {
|
|
|
5
5
|
private intersectedElements;
|
|
6
6
|
private enclosedElements;
|
|
7
7
|
private elementsSegments;
|
|
8
|
+
private canvasTranslate;
|
|
8
9
|
private keepPreviousSelection;
|
|
9
10
|
constructor(animationFrameHandler: AnimationFrameHandler, app: App);
|
|
10
11
|
startPath(x: number, y: number, keepPreviousSelection?: boolean): void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ElementsSegmentsMap, GlobalPoint } from "@excalidraw/math/types";
|
|
2
|
-
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
3
|
export declare const getLassoSelectedElementIds: (input: {
|
|
4
4
|
lassoPath: GlobalPoint[];
|
|
5
5
|
elements: readonly ExcalidrawElement[];
|
|
6
|
+
elementsMap: ElementsMap;
|
|
6
7
|
elementsSegments: ElementsSegmentsMap;
|
|
7
8
|
intersectedElements: Set<ExcalidrawElement["id"]>;
|
|
8
9
|
enclosedElements: Set<ExcalidrawElement["id"]>;
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import { GlobalPoint } from "@excalidraw/math/types";
|
|
2
|
-
import type { MermaidToExcalidrawLibProps } from "./components/TTDDialog/common";
|
|
3
|
-
import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
1
|
+
import { type GlobalPoint } from "@excalidraw/math/types";
|
|
4
2
|
import type { FontMetadata } from "@excalidraw/common";
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare function initializeObsidianUtils(): void;
|
|
9
|
-
export declare function getAreaLimit(): any;
|
|
10
|
-
export declare function getWidthHeightLimit(): any;
|
|
3
|
+
import type { ElementsMap, ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
4
|
+
import type { AppClassProperties, AppState } from "./types";
|
|
5
|
+
import type { MermaidToExcalidrawLibProps } from "./components/TTDDialog/common";
|
|
11
6
|
export declare function allowDoubleTapEraser(): any;
|
|
7
|
+
export declare function isPanWithRightMouseEnabled(): boolean;
|
|
12
8
|
export declare function getMaxZoom(): number;
|
|
13
9
|
export declare function isExcaliBrainView(): any;
|
|
14
10
|
export declare function getExcalidrawContentEl(): HTMLElement;
|
|
15
11
|
export declare function hideFreedrawPenmodeCursor(): boolean;
|
|
16
12
|
export declare function getOpenAIDefaultVisionModel(): any;
|
|
13
|
+
export declare function getFontMetrics(fontFamily: ExcalidrawTextElement["fontFamily"], fontSize?: number): {
|
|
14
|
+
unitsPerEm: number;
|
|
15
|
+
ascender: number;
|
|
16
|
+
descender: number;
|
|
17
|
+
lineHeight: number;
|
|
18
|
+
baseline: number;
|
|
19
|
+
fontString: string;
|
|
20
|
+
};
|
|
17
21
|
export declare function registerLocalFont(fontMetrics: FontMetadata & {
|
|
18
22
|
name: string;
|
|
19
23
|
}, uri: string): void;
|
|
@@ -26,3 +30,12 @@ export declare function isTouchInPenMode(appState: AppState, event: React.Pointe
|
|
|
26
30
|
export declare function getSharedMermaidInstance(): Promise<MermaidToExcalidrawLibProps>;
|
|
27
31
|
export declare function loadMermaid(): Promise<MermaidToExcalidrawLibProps>;
|
|
28
32
|
export declare const intersectElementWithLine: (element: ExcalidrawElement, a: GlobalPoint, b: GlobalPoint, gap: number | undefined, elementsMap: ElementsMap) => GlobalPoint[] | undefined;
|
|
33
|
+
export declare const disableDoubleClickTextEditing: () => any;
|
|
34
|
+
export declare const getZoomStep: () => any;
|
|
35
|
+
export declare const getZoomMin: () => any;
|
|
36
|
+
export declare const getZoomMax: () => any;
|
|
37
|
+
export declare const runAction: (action: string) => void;
|
|
38
|
+
export declare const t2: (key: string) => string;
|
|
39
|
+
export declare const shouldDisableZoom: (appState: AppState) => boolean;
|
|
40
|
+
export declare const isFullPanelMode: (app: AppClassProperties) => boolean;
|
|
41
|
+
export declare const isContextMenuDisabled: () => boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type Animation<R extends object> = (params: {
|
|
2
|
+
deltaTime: number;
|
|
3
|
+
state?: R;
|
|
4
|
+
}) => R | null | undefined;
|
|
5
|
+
export declare class AnimationController {
|
|
6
|
+
private static isRunning;
|
|
7
|
+
private static animations;
|
|
8
|
+
static start<R extends object>(key: string, animation: Animation<R>): void;
|
|
9
|
+
private static tick;
|
|
10
|
+
static running(key: string): boolean;
|
|
11
|
+
static cancel(key: string): void;
|
|
12
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { StaticCanvasRenderConfig } from "../scene/types";
|
|
2
|
-
import type {
|
|
3
|
-
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke?: boolean) => void;
|
|
2
|
+
import type { AppState, StaticCanvasAppState } from "../types";
|
|
3
|
+
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke: boolean, fill?: boolean) => void;
|
|
4
4
|
export declare const getNormalizedCanvasDimensions: (canvas: HTMLCanvasElement, scale: number) => [number, number];
|
|
5
5
|
export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normalizedHeight, theme, isExporting, viewBackgroundColor, }: {
|
|
6
6
|
canvas: HTMLCanvasElement;
|
|
@@ -11,3 +11,4 @@ export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normali
|
|
|
11
11
|
isExporting?: boolean | undefined;
|
|
12
12
|
viewBackgroundColor?: string | null | undefined;
|
|
13
13
|
}) => CanvasRenderingContext2D;
|
|
14
|
+
export declare const strokeRectWithRotation_simple: (context: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, cx: number, cy: number, angle: number, fill?: boolean, radius?: number) => void;
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
+
import { getScrollBars } from "../scene/scrollbars";
|
|
1
2
|
import type { InteractiveSceneRenderConfig, RenderableElementsMap } from "../scene/types";
|
|
2
|
-
/** throttled to animation framerate */
|
|
3
|
-
export declare const renderInteractiveSceneThrottled: {
|
|
4
|
-
(config: InteractiveSceneRenderConfig): void;
|
|
5
|
-
flush(): void;
|
|
6
|
-
cancel(): void;
|
|
7
|
-
};
|
|
8
3
|
/**
|
|
9
4
|
* Interactive scene is the ui-canvas where we render bounding boxes, selections
|
|
10
5
|
* and other ui stuff.
|
|
11
6
|
*/
|
|
12
|
-
export declare const renderInteractiveScene: <U extends ({ canvas, elementsMap, visibleElements, selectedElements, allElementsMap, scale, appState, renderConfig,
|
|
7
|
+
export declare const renderInteractiveScene: <U extends ({ app, canvas, elementsMap, visibleElements, selectedElements, allElementsMap, scale, appState, renderConfig, editorInterface, animationState, deltaTime, }: InteractiveSceneRenderConfig) => {
|
|
8
|
+
scrollBars?: import("../scene/types").ScrollBars | undefined;
|
|
13
9
|
atLeastOneVisibleElement: boolean;
|
|
14
10
|
elementsMap: RenderableElementsMap;
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
scrollBars: import("../scene/types").ScrollBars | undefined;
|
|
18
|
-
atLeastOneVisibleElement: boolean;
|
|
19
|
-
elementsMap: RenderableElementsMap;
|
|
20
|
-
}, T extends boolean = false>(renderConfig: InteractiveSceneRenderConfig, throttle?: T | undefined) => T extends true ? void : ReturnType<U>;
|
|
11
|
+
animationState?: import("../scene/types").InteractiveSceneRenderAnimationState | undefined;
|
|
12
|
+
}>(renderConfig: InteractiveSceneRenderConfig) => ReturnType<U>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExcalidrawFrameLikeElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { StaticCanvasRenderConfig, StaticSceneRenderConfig } from "../scene/types";
|
|
3
|
+
import type { StaticCanvasAppState } from "../types";
|
|
4
|
+
export declare const frameClip: (frame: ExcalidrawFrameLikeElement, context: CanvasRenderingContext2D, renderConfig: StaticCanvasRenderConfig, appState: StaticCanvasAppState) => void;
|
|
2
5
|
/** throttled to animation framerate */
|
|
3
6
|
export declare const renderStaticSceneThrottled: {
|
|
4
7
|
(config: StaticSceneRenderConfig): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../types";
|
|
4
4
|
export declare class Renderer {
|
|
5
5
|
private scene;
|
|
@@ -16,7 +16,6 @@ export declare class Renderer {
|
|
|
16
16
|
/** note: first render of newElement will always bust the cache
|
|
17
17
|
* (we'd have to prefilter elements outside of this function) */
|
|
18
18
|
newElementId: ExcalidrawElement["id"] | undefined;
|
|
19
|
-
pendingImageElementId: AppState["pendingImageElementId"];
|
|
20
19
|
sceneNonce: ReturnType<InstanceType<typeof Scene>["getSceneNonce"]>;
|
|
21
20
|
}) => {
|
|
22
21
|
elementsMap: Map<string, NonDeletedExcalidrawElement> & import("@excalidraw/common/utility-types").MakeBrand<"NonDeletedElementsMap"> & import("@excalidraw/common/utility-types").MakeBrand<"RenderableElementsMap">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { isSomeElementSelected, getElementsWithinSelection,
|
|
1
|
+
export { isSomeElementSelected, getElementsWithinSelection, getSelectedElements, getTargetElements, } from "@excalidraw/element";
|
|
2
2
|
export { calculateScrollCenter } from "./scroll";
|
|
3
|
-
export { hasBackground, hasStrokeWidth, hasStrokeStyle, canHaveArrowheads, canChangeRoundness, } from "@excalidraw/element
|
|
3
|
+
export { hasBackground, hasStrokeWidth, hasStrokeStyle, canHaveArrowheads, canChangeRoundness, } from "@excalidraw/element";
|
|
4
4
|
export { getNormalizedZoom, getNormalizedGridSize, getNormalizedGridStep, } from "./normalize";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
1
|
import type { InteractiveCanvasAppState } from "../types";
|
|
3
|
-
import type { ScrollBars } from "./types";
|
|
2
|
+
import type { RenderableElementsMap, ScrollBars } from "./types";
|
|
4
3
|
export declare const SCROLLBAR_MARGIN = 4;
|
|
5
4
|
export declare const SCROLLBAR_WIDTH = 6;
|
|
6
5
|
export declare const SCROLLBAR_COLOR = "rgba(128,128,128,0.3)";
|
|
7
|
-
export declare const getScrollBars: (elements:
|
|
6
|
+
export declare const getScrollBars: (elements: RenderableElementsMap, viewportWidth: number, viewportHeight: number, appState: InteractiveCanvasAppState) => ScrollBars;
|
|
8
7
|
export declare const isOverScrollBars: (scrollBars: ScrollBars, x: number, y: number) => {
|
|
9
8
|
isOverEither: boolean;
|
|
10
9
|
isOverHorizontal: boolean;
|