@excalidraw/math 0.18.0-a9ca16e → 0.18.0-abeeaeb
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 +297 -99
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/index.js +1 -1
- package/dist/types/common/src/colors.d.ts +15 -1
- package/dist/types/common/src/constants.d.ts +12 -7
- package/dist/types/common/src/keys.d.ts +2 -0
- package/dist/types/common/src/points.d.ts +1 -1
- package/dist/types/common/src/utils.d.ts +1 -43
- package/dist/types/element/src/Scene.d.ts +6 -4
- package/dist/types/element/src/align.d.ts +2 -2
- package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
- package/dist/types/element/src/arrows/focus.d.ts +5 -2
- package/dist/types/element/src/binding.d.ts +17 -8
- package/dist/types/element/src/bounds.d.ts +22 -7
- package/dist/types/element/src/bucketFill.d.ts +110 -0
- package/dist/types/element/src/collision.d.ts +1 -1
- package/dist/types/element/src/comparisons.d.ts +5 -4
- package/dist/types/element/src/convertToShape.d.ts +23 -0
- package/dist/types/element/src/distribute.d.ts +2 -2
- package/dist/types/element/src/dragElements.d.ts +27 -0
- package/dist/types/element/src/duplicate.d.ts +4 -3
- package/dist/types/element/src/embeddable.d.ts +2 -2
- package/dist/types/element/src/flowchart.d.ts +7 -7
- package/dist/types/element/src/fractionalIndex.d.ts +2 -2
- package/dist/types/element/src/frame.d.ts +9 -8
- package/dist/types/element/src/groups.d.ts +9 -9
- package/dist/types/element/src/index.d.ts +4 -1
- package/dist/types/element/src/linearElementEditor.d.ts +17 -10
- package/dist/types/element/src/newElement.d.ts +14 -0
- package/dist/types/element/src/renderElement.d.ts +0 -3
- package/dist/types/element/src/resizeElements.d.ts +2 -2
- package/dist/types/element/src/selection.d.ts +6 -6
- package/dist/types/element/src/shape.d.ts +13 -1
- package/dist/types/element/src/sortElements.d.ts +10 -0
- package/dist/types/element/src/textElement.d.ts +12 -9
- package/dist/types/element/src/transform.d.ts +2 -2
- package/dist/types/element/src/typeChecks.d.ts +26 -25
- package/dist/types/element/src/types.d.ts +8 -1
- package/dist/types/element/src/utils.d.ts +1 -1
- package/dist/types/element/src/zindex.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +45 -18
- package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +30 -12
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +167 -940
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +30 -12
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +15 -6
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +47 -19
- package/dist/types/excalidraw/actions/{actionEmbeddable.d.ts → actionDeselect.d.ts} +29 -35
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +15 -6
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +31 -13
- package/dist/types/excalidraw/actions/actionExport.d.ts +32 -14
- package/dist/types/excalidraw/actions/actionFrame.d.ts +57 -202
- package/dist/types/excalidraw/actions/actionGroup.d.ts +45 -27
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +19 -8
- package/dist/types/excalidraw/actions/actionLink.d.ts +16 -7
- package/dist/types/excalidraw/actions/actionMenu.d.ts +15 -6
- package/dist/types/excalidraw/actions/actionProperties.d.ts +60 -30
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +20 -11
- package/dist/types/excalidraw/actions/actionStyles.d.ts +15 -6
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +16 -7
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +19 -11
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +16 -7
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +16 -7
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +19 -11
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +16 -7
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +17 -8
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +16 -7
- package/dist/types/excalidraw/actions/index.d.ts +2 -2
- package/dist/types/excalidraw/actions/manager.d.ts +1 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +8 -4
- package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
- package/dist/types/excalidraw/appState.d.ts +12 -5
- package/dist/types/excalidraw/components/Actions.d.ts +17 -12
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/App.arrowText.d.ts +72 -0
- package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
- package/dist/types/excalidraw/components/App.cursor.d.ts +30 -0
- package/dist/types/excalidraw/components/App.d.ts +363 -66
- package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
- package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -3
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +9 -2
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +31 -0
- package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -2
- package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
- package/dist/types/excalidraw/components/{ToolButton.d.ts → IconButton.d.ts} +16 -19
- package/dist/types/excalidraw/components/Island.d.ts +7 -0
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
- package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
- package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
- package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
- package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
- package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
- package/dist/types/excalidraw/components/Popover.d.ts +1 -3
- package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
- 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/Stats/Angle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +4 -4
- package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +3 -3
- package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
- package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
- package/dist/types/excalidraw/components/Tools.d.ts +146 -0
- package/dist/types/excalidraw/components/UserList.d.ts +3 -2
- package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +3 -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/footer/Footer.d.ts +3 -1
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -2
- package/dist/types/excalidraw/components/icons.d.ts +6 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +8 -4
- package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
- package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
- package/dist/types/excalidraw/data/blob.d.ts +34 -16
- package/dist/types/excalidraw/data/index.d.ts +4 -4
- package/dist/types/excalidraw/data/json.d.ts +23 -14
- package/dist/types/excalidraw/data/library.d.ts +1 -1
- package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
- package/dist/types/excalidraw/eraser/index.d.ts +2 -3
- package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
- 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/lasso/utils.d.ts +2 -0
- package/dist/types/excalidraw/renderer/animation.d.ts +5 -1
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +1 -3
- package/dist/types/excalidraw/scene/Renderer.d.ts +426 -19
- package/dist/types/excalidraw/scene/export.d.ts +3 -3
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/scene/types.d.ts +4 -3
- package/dist/types/excalidraw/snapping.d.ts +7 -7
- package/dist/types/excalidraw/types.d.ts +415 -23
- package/dist/types/excalidraw/viewport.d.ts +275 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +2 -3
- 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 +36 -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/index.d.ts +1 -0
- package/dist/types/math/src/pca.d.ts +79 -0
- package/dist/types/math/src/point.d.ts +1 -0
- package/dist/types/math/src/polygon.d.ts +25 -1
- package/dist/types/utils/src/export.d.ts +3 -3
- package/dist/types/utils/src/index.d.ts +1 -2
- package/package.json +2 -2
- package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
- package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -10
- package/dist/types/excalidraw/components/shapes.d.ts +0 -263
- package/dist/types/excalidraw/cursor.d.ts +0 -5
- package/dist/types/excalidraw/scene/scroll.d.ts +0 -18
- package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
- package/dist/types/utils/src/bbox.d.ts +0 -9
- package/dist/types/utils/src/withinBounds.d.ts +0 -19
|
@@ -73,12 +73,17 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
73
73
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
74
74
|
isBindingEnabled: boolean;
|
|
75
75
|
isMidpointSnappingEnabled: boolean;
|
|
76
|
+
gridModeEnabled: boolean;
|
|
76
77
|
suggestedBinding: {
|
|
77
78
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
78
79
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
79
80
|
} | null;
|
|
81
|
+
hoveredArrowTextAnchor: {
|
|
82
|
+
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
83
|
+
anchor: "start" | "end" | "label";
|
|
84
|
+
} | null;
|
|
80
85
|
isRotating: boolean;
|
|
81
|
-
elementsToHighlight: import("@excalidraw/element/types").
|
|
86
|
+
elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
|
|
82
87
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
83
88
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
84
89
|
zenModeEnabled: boolean;
|
|
@@ -96,8 +101,8 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
96
101
|
shouldCacheIgnoreZoom: boolean;
|
|
97
102
|
exportScale: number;
|
|
98
103
|
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
99
|
-
bindMode: import("@excalidraw/element/types").BindMode;
|
|
100
104
|
gridSize: number;
|
|
105
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
101
106
|
contextMenu: {
|
|
102
107
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
103
108
|
top: number;
|
|
@@ -107,9 +112,9 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
107
112
|
isLoading: boolean;
|
|
108
113
|
errorMessage: React.ReactNode;
|
|
109
114
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
115
|
+
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
110
116
|
bindingPreference: "enabled" | "disabled";
|
|
111
|
-
|
|
112
|
-
editingFrame: string | null;
|
|
117
|
+
editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
|
|
113
118
|
preferredSelectionTool: {
|
|
114
119
|
type: "selection" | "lasso";
|
|
115
120
|
initialized: boolean;
|
|
@@ -122,9 +127,10 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
122
127
|
currentItemStrokeColor: string;
|
|
123
128
|
currentItemBackgroundColor: string;
|
|
124
129
|
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
125
|
-
|
|
130
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
126
131
|
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
127
132
|
currentItemRoughness: number;
|
|
133
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
128
134
|
currentItemOpacity: number;
|
|
129
135
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
130
136
|
currentItemFontSize: number;
|
|
@@ -133,6 +139,7 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
133
139
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
134
140
|
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
135
141
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
142
|
+
scrollConstraints: import("../types").ScrollConstraints | null;
|
|
136
143
|
cursorButton: "up" | "down";
|
|
137
144
|
scrolledOutside: boolean;
|
|
138
145
|
isResizing: boolean;
|
|
@@ -154,7 +161,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
154
161
|
duration?: number;
|
|
155
162
|
} | null;
|
|
156
163
|
gridStep: number;
|
|
157
|
-
gridModeEnabled: boolean;
|
|
158
164
|
fileHandle: FileSystemFileHandle | null;
|
|
159
165
|
stats: {
|
|
160
166
|
open: boolean;
|
|
@@ -166,11 +172,14 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
166
172
|
y: number;
|
|
167
173
|
} | null;
|
|
168
174
|
objectsSnapModeEnabled: boolean;
|
|
169
|
-
userToFollow: import("../types").UserToFollow | null;
|
|
170
|
-
followedBy: Set<import("../types").SocketId>;
|
|
171
175
|
lockedMultiSelections: {
|
|
172
176
|
[groupId: string]: true;
|
|
173
177
|
};
|
|
178
|
+
colorTopPicks: {
|
|
179
|
+
elementStroke: readonly string[] | null;
|
|
180
|
+
elementBackground: readonly string[] | null;
|
|
181
|
+
bucketFill: readonly string[] | null;
|
|
182
|
+
};
|
|
174
183
|
};
|
|
175
184
|
files: import("../types").BinaryFiles;
|
|
176
185
|
};
|
|
@@ -238,12 +247,17 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
238
247
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
239
248
|
isBindingEnabled: boolean;
|
|
240
249
|
isMidpointSnappingEnabled: boolean;
|
|
250
|
+
gridModeEnabled: boolean;
|
|
241
251
|
suggestedBinding: {
|
|
242
252
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
243
253
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
244
254
|
} | null;
|
|
255
|
+
hoveredArrowTextAnchor: {
|
|
256
|
+
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
257
|
+
anchor: "start" | "end" | "label";
|
|
258
|
+
} | null;
|
|
245
259
|
isRotating: boolean;
|
|
246
|
-
elementsToHighlight: import("@excalidraw/element/types").
|
|
260
|
+
elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
|
|
247
261
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
248
262
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
249
263
|
zenModeEnabled: boolean;
|
|
@@ -261,8 +275,8 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
261
275
|
shouldCacheIgnoreZoom: boolean;
|
|
262
276
|
exportScale: number;
|
|
263
277
|
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
264
|
-
bindMode: import("@excalidraw/element/types").BindMode;
|
|
265
278
|
gridSize: number;
|
|
279
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
266
280
|
contextMenu: {
|
|
267
281
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
268
282
|
top: number;
|
|
@@ -272,9 +286,9 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
272
286
|
isLoading: boolean;
|
|
273
287
|
errorMessage: React.ReactNode;
|
|
274
288
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
289
|
+
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
275
290
|
bindingPreference: "enabled" | "disabled";
|
|
276
|
-
|
|
277
|
-
editingFrame: string | null;
|
|
291
|
+
editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
|
|
278
292
|
preferredSelectionTool: {
|
|
279
293
|
type: "selection" | "lasso";
|
|
280
294
|
initialized: boolean;
|
|
@@ -287,9 +301,10 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
287
301
|
currentItemStrokeColor: string;
|
|
288
302
|
currentItemBackgroundColor: string;
|
|
289
303
|
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
290
|
-
|
|
304
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
291
305
|
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
292
306
|
currentItemRoughness: number;
|
|
307
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
293
308
|
currentItemOpacity: number;
|
|
294
309
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
295
310
|
currentItemFontSize: number;
|
|
@@ -298,6 +313,7 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
298
313
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
299
314
|
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
300
315
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
316
|
+
scrollConstraints: import("../types").ScrollConstraints | null;
|
|
301
317
|
cursorButton: "up" | "down";
|
|
302
318
|
scrolledOutside: boolean;
|
|
303
319
|
isResizing: boolean;
|
|
@@ -319,7 +335,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
319
335
|
duration?: number;
|
|
320
336
|
} | null;
|
|
321
337
|
gridStep: number;
|
|
322
|
-
gridModeEnabled: boolean;
|
|
323
338
|
fileHandle: FileSystemFileHandle | null;
|
|
324
339
|
stats: {
|
|
325
340
|
open: boolean;
|
|
@@ -331,11 +346,14 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
331
346
|
y: number;
|
|
332
347
|
} | null;
|
|
333
348
|
objectsSnapModeEnabled: boolean;
|
|
334
|
-
userToFollow: import("../types").UserToFollow | null;
|
|
335
|
-
followedBy: Set<import("../types").SocketId>;
|
|
336
349
|
lockedMultiSelections: {
|
|
337
350
|
[groupId: string]: true;
|
|
338
351
|
};
|
|
352
|
+
colorTopPicks: {
|
|
353
|
+
elementStroke: readonly string[] | null;
|
|
354
|
+
elementBackground: readonly string[] | null;
|
|
355
|
+
bucketFill: readonly string[] | null;
|
|
356
|
+
};
|
|
339
357
|
};
|
|
340
358
|
files: import("../types").BinaryFiles;
|
|
341
359
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
1
|
+
import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
2
|
import type { ExportType } from "../scene/types";
|
|
3
3
|
import type { AppState, BinaryFiles } from "../types";
|
|
4
4
|
export { loadFromBlob } from "./blob";
|
|
@@ -6,8 +6,8 @@ export { loadFromJSON, saveAsJSON } from "./json";
|
|
|
6
6
|
export type ExportedElements = readonly NonDeletedExcalidrawElement[] & {
|
|
7
7
|
_brand: "exportedElements";
|
|
8
8
|
};
|
|
9
|
-
export declare const prepareElementsForExport: (
|
|
10
|
-
exportingFrame: ExcalidrawFrameLikeElement | null;
|
|
9
|
+
export declare const prepareElementsForExport: (allElements: readonly ExcalidrawElement[], { selectedElementIds }: Pick<AppState, "selectedElementIds">, exportSelectionOnly: boolean) => {
|
|
10
|
+
exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
11
11
|
exportedElements: ExportedElements;
|
|
12
12
|
};
|
|
13
13
|
export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements: ExportedElements, appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, name, fileHandle, exportingFrame, }: {
|
|
@@ -17,5 +17,5 @@ export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements:
|
|
|
17
17
|
/** filename, if applicable */
|
|
18
18
|
name?: string;
|
|
19
19
|
fileHandle?: FileSystemFileHandle | null;
|
|
20
|
-
exportingFrame: ExcalidrawFrameLikeElement | null;
|
|
20
|
+
exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
21
21
|
}) => Promise<FileSystemFileHandle | null | undefined>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ExcalidrawElement
|
|
1
|
+
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
2
|
import type { MaybePromise } from "@excalidraw/common/utility-types";
|
|
3
3
|
import type { AppState, BinaryFiles, LibraryItems } from "../types";
|
|
4
4
|
import type { ImportedDataState, ImportedLibraryData } from "./types";
|
|
5
5
|
export type JSONExportData = {
|
|
6
|
-
elements: readonly
|
|
6
|
+
elements: readonly ExcalidrawElement[];
|
|
7
7
|
appState: AppState;
|
|
8
8
|
files: BinaryFiles;
|
|
9
9
|
};
|
|
@@ -52,7 +52,7 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
52
52
|
selectedElementIds: Readonly<{
|
|
53
53
|
[id: string]: true;
|
|
54
54
|
}>;
|
|
55
|
-
frameToHighlight: NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
55
|
+
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
56
56
|
activeTool: {
|
|
57
57
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
58
58
|
locked: boolean;
|
|
@@ -67,16 +67,21 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
67
67
|
[groupId: string]: boolean;
|
|
68
68
|
};
|
|
69
69
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
70
|
-
multiElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
71
|
-
newElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
70
|
+
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
71
|
+
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
72
72
|
isBindingEnabled: boolean;
|
|
73
73
|
isMidpointSnappingEnabled: boolean;
|
|
74
|
+
gridModeEnabled: boolean;
|
|
74
75
|
suggestedBinding: {
|
|
75
|
-
element: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
76
|
+
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
76
77
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
77
78
|
} | null;
|
|
79
|
+
hoveredArrowTextAnchor: {
|
|
80
|
+
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
81
|
+
anchor: "start" | "end" | "label";
|
|
82
|
+
} | null;
|
|
78
83
|
isRotating: boolean;
|
|
79
|
-
elementsToHighlight:
|
|
84
|
+
elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
|
|
80
85
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
81
86
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
82
87
|
zenModeEnabled: boolean;
|
|
@@ -94,8 +99,8 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
94
99
|
shouldCacheIgnoreZoom: boolean;
|
|
95
100
|
exportScale: number;
|
|
96
101
|
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
97
|
-
bindMode: import("@excalidraw/element/types").BindMode;
|
|
98
102
|
gridSize: number;
|
|
103
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
99
104
|
contextMenu: {
|
|
100
105
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
101
106
|
top: number;
|
|
@@ -105,9 +110,9 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
105
110
|
isLoading: boolean;
|
|
106
111
|
errorMessage: React.ReactNode;
|
|
107
112
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
113
|
+
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
108
114
|
bindingPreference: "enabled" | "disabled";
|
|
109
|
-
|
|
110
|
-
editingFrame: string | null;
|
|
115
|
+
editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
|
|
111
116
|
preferredSelectionTool: {
|
|
112
117
|
type: "selection" | "lasso";
|
|
113
118
|
initialized: boolean;
|
|
@@ -120,9 +125,10 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
120
125
|
currentItemStrokeColor: string;
|
|
121
126
|
currentItemBackgroundColor: string;
|
|
122
127
|
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
123
|
-
|
|
128
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
124
129
|
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
125
130
|
currentItemRoughness: number;
|
|
131
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
126
132
|
currentItemOpacity: number;
|
|
127
133
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
128
134
|
currentItemFontSize: number;
|
|
@@ -131,6 +137,7 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
131
137
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
132
138
|
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
133
139
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
140
|
+
scrollConstraints: import("../types").ScrollConstraints | null;
|
|
134
141
|
cursorButton: "up" | "down";
|
|
135
142
|
scrolledOutside: boolean;
|
|
136
143
|
isResizing: boolean;
|
|
@@ -152,7 +159,6 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
152
159
|
duration?: number;
|
|
153
160
|
} | null;
|
|
154
161
|
gridStep: number;
|
|
155
|
-
gridModeEnabled: boolean;
|
|
156
162
|
fileHandle: FileSystemFileHandle | null;
|
|
157
163
|
stats: {
|
|
158
164
|
open: boolean;
|
|
@@ -164,11 +170,14 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
164
170
|
y: number;
|
|
165
171
|
} | null;
|
|
166
172
|
objectsSnapModeEnabled: boolean;
|
|
167
|
-
userToFollow: import("../types").UserToFollow | null;
|
|
168
|
-
followedBy: Set<import("../types").SocketId>;
|
|
169
173
|
lockedMultiSelections: {
|
|
170
174
|
[groupId: string]: true;
|
|
171
175
|
};
|
|
176
|
+
colorTopPicks: {
|
|
177
|
+
elementStroke: readonly string[] | null;
|
|
178
|
+
elementBackground: readonly string[] | null;
|
|
179
|
+
bucketFill: readonly string[] | null;
|
|
180
|
+
};
|
|
172
181
|
};
|
|
173
182
|
files: BinaryFiles;
|
|
174
183
|
}>;
|
|
@@ -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. */
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GlobalPoint } from "@excalidraw/math";
|
|
2
|
+
import type App from "./components/App";
|
|
3
|
+
import type { Trail } from "./animatedTrail";
|
|
4
|
+
export declare class DrawShapeTrail implements Trail {
|
|
5
|
+
private app;
|
|
6
|
+
private trail;
|
|
7
|
+
constructor(app: App);
|
|
8
|
+
private getTrailOptions;
|
|
9
|
+
startPath(x: number, y: number): void;
|
|
10
|
+
addPointToPath(x: number, y: number): void;
|
|
11
|
+
endPath(): void;
|
|
12
|
+
clearTrails(): void;
|
|
13
|
+
getCurrentPoints(): GlobalPoint[];
|
|
14
|
+
start(container: SVGSVGElement): void;
|
|
15
|
+
stop(): void;
|
|
16
|
+
}
|
|
@@ -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;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AppState } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Subscribes to specific appState changes. The component re-renders
|
|
4
|
+
* only when the specified prop(s) change — not on every appState update.
|
|
5
|
+
*
|
|
6
|
+
* Works both inside and outside the <Excalidraw> tree, as long as
|
|
7
|
+
* ExcalidrawAPIContext.Provider is an ancestor (automatically provided
|
|
8
|
+
* inside <Excalidraw>, or manually by the host app).
|
|
9
|
+
*
|
|
10
|
+
* Returns the narrowed value depending on prop form:
|
|
11
|
+
* - `keyof AppState` → `AppState[K]`
|
|
12
|
+
* - `(keyof AppState)[]` → whole `AppState`
|
|
13
|
+
* - selector function → selector's return type `T`
|
|
14
|
+
*
|
|
15
|
+
* If excalidrawAPI is not ready yet (host apps), hook is rerendered with latest
|
|
16
|
+
* value once available.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useAppStateValue<K extends keyof AppState>(prop: K, _internal?: boolean): AppState[K];
|
|
19
|
+
export declare function useAppStateValue(props: (keyof AppState)[], _internal?: boolean): AppState;
|
|
20
|
+
export declare function useAppStateValue<T>(selector: (appState: AppState) => T, _internal?: boolean): T;
|
|
21
|
+
/**
|
|
22
|
+
* Subscribes to specific appState changes without causing component rerenders.
|
|
23
|
+
*
|
|
24
|
+
* The callback is called on every matching change, but also on initial render
|
|
25
|
+
* so you can initialize your state.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useOnAppStateChange<K extends keyof AppState>(prop: K, callback: (value: AppState[K], appState: AppState) => void): undefined;
|
|
28
|
+
export declare function useOnAppStateChange(props: (keyof AppState)[], callback: (props: AppState, appState: AppState) => void): undefined;
|
|
29
|
+
export declare function useOnAppStateChange<T>(selector: (appState: AppState) => T, callback: (value: T, appState: AppState) => void): undefined;
|
|
@@ -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;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ElementsSegmentsMap, GlobalPoint } from "@excalidraw/math/types";
|
|
2
2
|
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
import type { BoxSelectionMode } from "../types";
|
|
3
4
|
export declare const getLassoSelectedElementIds: (input: {
|
|
4
5
|
lassoPath: GlobalPoint[];
|
|
5
6
|
elements: readonly ExcalidrawElement[];
|
|
@@ -8,6 +9,7 @@ export declare const getLassoSelectedElementIds: (input: {
|
|
|
8
9
|
intersectedElements: Set<ExcalidrawElement["id"]>;
|
|
9
10
|
enclosedElements: Set<ExcalidrawElement["id"]>;
|
|
10
11
|
simplifyDistance?: number;
|
|
12
|
+
mode?: BoxSelectionMode;
|
|
11
13
|
}) => {
|
|
12
14
|
selectedElementIds: string[];
|
|
13
15
|
};
|
|
@@ -3,10 +3,14 @@ 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;
|
|
15
|
+
static reset(): void;
|
|
12
16
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { getScrollBars } from "../scene/scrollbars";
|
|
2
|
-
import type { InteractiveSceneRenderConfig
|
|
2
|
+
import type { InteractiveSceneRenderConfig } from "../scene/types";
|
|
3
3
|
declare const _renderInteractiveScene: ({ app, canvas, elementsMap, visibleElements, selectedElements, allElementsMap, scale, appState, renderConfig, editorInterface, animationState, deltaTime, }: InteractiveSceneRenderConfig) => {
|
|
4
4
|
scrollBars?: ReturnType<typeof getScrollBars>;
|
|
5
|
-
atLeastOneVisibleElement: boolean;
|
|
6
|
-
elementsMap: RenderableElementsMap;
|
|
7
5
|
animationState?: typeof animationState;
|
|
8
6
|
};
|
|
9
7
|
/**
|