@myoc/excalidraw 0.18.16 → 0.18.18
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/{chunk-3HLOFB5F.js → chunk-MAGRVBVM.js} +13453 -10629
- package/dist/dev/chunk-MAGRVBVM.js.map +7 -0
- package/dist/dev/{chunk-PEI7EPYO.js → chunk-QO4EFL6B.js} +15 -5
- package/dist/dev/chunk-QO4EFL6B.js.map +7 -0
- package/dist/dev/chunk-WUH7JFG4.js +7 -0
- package/dist/dev/chunk-WUH7JFG4.js.map +7 -0
- package/dist/dev/data/{image-XPEIZ6XQ.js → image-BBHDGXQ3.js} +3 -3
- package/dist/dev/index.css +101 -24
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +6587 -7610
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-R455UJTM.js → en-2WXBKZE2.js} +2 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-4Z2WWUCC.js +7 -0
- package/dist/prod/chunk-KZXLT4YB.js +12 -0
- package/dist/prod/chunk-YBT3HBS6.js +33 -0
- package/dist/prod/data/image-JFILZTP3.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +18 -17
- package/dist/prod/locales/{en-YWERZJD6.js → en-XFR6MADM.js} +1 -1
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/constants.d.ts +19 -2
- package/dist/types/{excalidraw → common/src}/emitter.d.ts +1 -1
- package/dist/types/common/src/font-metadata.d.ts +4 -2
- package/dist/types/common/src/index.d.ts +1 -0
- package/dist/types/common/src/points.d.ts +1 -1
- package/dist/types/common/src/utility-types.d.ts +5 -0
- package/dist/types/common/src/utils.d.ts +17 -7
- package/dist/types/{excalidraw/scene → element/src}/Scene.d.ts +11 -14
- package/dist/types/element/src/align.d.ts +3 -3
- package/dist/types/element/src/arrange.d.ts +2 -1
- package/dist/types/element/src/binding.d.ts +21 -14
- package/dist/types/element/src/bounds.d.ts +11 -5
- package/dist/types/element/src/collision.d.ts +18 -12
- package/dist/types/element/src/cropElement.d.ts +1 -1
- package/dist/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +63 -38
- package/dist/types/element/src/distance.d.ts +2 -2
- package/dist/types/element/src/dragElements.d.ts +3 -2
- package/dist/types/element/src/elbowArrow.d.ts +2 -2
- package/dist/types/element/src/flowchart.d.ts +3 -2
- package/dist/types/element/src/fractionalIndex.d.ts +9 -3
- package/dist/types/element/src/frame.d.ts +4 -3
- package/dist/types/element/src/heading.d.ts +2 -2
- package/dist/types/element/src/index.d.ts +43 -2
- package/dist/types/element/src/linearElementEditor.d.ts +21 -32
- package/dist/types/element/src/mutateElement.d.ts +11 -3
- package/dist/types/element/src/newElement.d.ts +4 -3
- package/dist/types/element/src/resizeElements.d.ts +5 -4
- package/dist/types/element/src/resizeTest.d.ts +2 -2
- package/dist/types/element/src/selection.d.ts +1 -6
- package/dist/types/element/src/shape.d.ts +42 -0
- package/dist/types/element/src/shapes.d.ts +10 -10
- package/dist/types/element/src/sizeHelpers.d.ts +2 -2
- package/dist/types/element/src/store.d.ts +231 -0
- package/dist/types/element/src/textElement.d.ts +4 -3
- package/dist/types/element/src/typeChecks.d.ts +19 -1
- package/dist/types/element/src/types.d.ts +15 -2
- package/dist/types/element/src/utils.d.ts +5 -1
- package/dist/types/element/src/zindex.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +42 -51
- package/dist/types/excalidraw/actions/actionAlign.d.ts +8 -8
- package/dist/types/excalidraw/actions/actionArrange.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +28 -34
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +187 -223
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +87 -104
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +14 -17
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +41 -49
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +14 -17
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +43 -50
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +14 -17
- package/dist/types/excalidraw/actions/actionExport.d.ts +219 -246
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +74 -40
- package/dist/types/excalidraw/actions/actionFlip.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionFrame.d.ts +100 -112
- package/dist/types/excalidraw/actions/actionGroup.d.ts +34 -40
- package/dist/types/excalidraw/actions/actionHistory.d.ts +1 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +506 -16
- package/dist/types/excalidraw/actions/actionLink.d.ts +14 -17
- package/dist/types/excalidraw/actions/actionMenu.d.ts +42 -51
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +27 -33
- package/dist/types/excalidraw/actions/actionProperties.d.ts +206 -243
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +16 -19
- package/dist/types/excalidraw/actions/actionSmartZoom.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionStyles.d.ts +18 -21
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +16 -19
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +16 -19
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +16 -200
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +16 -19
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +16 -19
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +16 -19
- package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -8
- package/dist/types/excalidraw/actions/types.d.ts +4 -3
- package/dist/types/excalidraw/appState.d.ts +40 -31
- package/dist/types/excalidraw/components/App.d.ts +15 -17
- package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +5 -1
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -3
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -3
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
- package/dist/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
- package/dist/types/excalidraw/components/Range.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -11
- package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
- package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
- package/dist/types/excalidraw/components/icons.d.ts +3 -0
- package/dist/types/excalidraw/components/shapes.d.ts +1 -1
- package/dist/types/excalidraw/data/blob.d.ts +1 -1
- package/dist/types/excalidraw/data/transform.d.ts +1 -1
- package/dist/types/excalidraw/editor-jotai.d.ts +6 -6
- package/dist/types/excalidraw/eraser/index.d.ts +0 -2
- package/dist/types/excalidraw/fonts/Fonts.d.ts +1 -1
- package/dist/types/excalidraw/history.d.ts +30 -22
- package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
- package/dist/types/excalidraw/index.d.ts +9 -9
- package/dist/types/excalidraw/lasso/index.d.ts +1 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +2 -1
- package/dist/types/excalidraw/renderer/helpers.d.ts +7 -2
- package/dist/types/excalidraw/scene/Renderer.d.ts +1 -2
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/snapping.d.ts +2 -2
- package/dist/types/excalidraw/types.d.ts +25 -10
- package/dist/types/excalidraw/visualdebug.d.ts +1 -1
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
- package/dist/types/math/src/angle.d.ts +3 -1
- package/dist/types/math/src/constants.d.ts +3 -0
- package/dist/types/math/src/curve.d.ts +34 -0
- package/dist/types/math/src/ellipse.d.ts +3 -3
- package/dist/types/math/src/index.d.ts +1 -0
- package/dist/types/math/src/point.d.ts +3 -3
- package/dist/types/math/src/polygon.d.ts +2 -2
- package/dist/types/math/src/segment.d.ts +5 -5
- package/dist/types/math/src/utils.d.ts +2 -0
- package/dist/types/math/src/vector.d.ts +8 -2
- package/dist/types/utils/src/bbox.d.ts +1 -1
- package/dist/types/utils/src/index.d.ts +1 -1
- package/dist/types/utils/src/shape.d.ts +12 -12
- package/dist/types/utils/src/withinBounds.d.ts +1 -1
- package/history.ts +147 -110
- package/package.json +4 -4
- package/dist/dev/chunk-3HLOFB5F.js.map +0 -7
- package/dist/dev/chunk-PEI7EPYO.js.map +0 -7
- package/dist/dev/chunk-QQGTICP4.js +0 -7
- package/dist/dev/chunk-QQGTICP4.js.map +0 -7
- package/dist/prod/chunk-7HNFGNL7.js +0 -7
- package/dist/prod/chunk-KKQVTSHB.js +0 -33
- package/dist/prod/chunk-KZWZ7WHC.js +0 -12
- package/dist/prod/data/image-QD7FUQED.js +0 -1
- package/dist/types/element/src/Shape.d.ts +0 -17
- package/dist/types/element/src/ShapeCache.d.ts +0 -25
- package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
- package/dist/types/excalidraw/store.d.ts +0 -129
- package/dist/types/utils/src/collision.d.ts +0 -8
- /package/dist/dev/data/{image-XPEIZ6XQ.js.map → image-BBHDGXQ3.js.map} +0 -0
- /package/dist/dev/locales/{en-R455UJTM.js.map → en-2WXBKZE2.js.map} +0 -0
|
@@ -40,7 +40,7 @@ export declare const actionToggleStats: {
|
|
|
40
40
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
41
41
|
isBindingEnabled: boolean;
|
|
42
42
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
43
|
-
suggestedBindings: import("@excalidraw/element
|
|
43
|
+
suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
|
|
44
44
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
45
45
|
frameRendering: {
|
|
46
46
|
enabled: boolean;
|
|
@@ -51,7 +51,7 @@ export declare const actionToggleStats: {
|
|
|
51
51
|
editingFrame: string | null;
|
|
52
52
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
53
53
|
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
54
|
-
editingLinearElement: import("@excalidraw/element
|
|
54
|
+
editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
55
55
|
activeTool: {
|
|
56
56
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
57
57
|
locked: boolean;
|
|
@@ -77,7 +77,7 @@ export declare const actionToggleStats: {
|
|
|
77
77
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
78
78
|
currentHoveredFontFamily: number | null;
|
|
79
79
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
80
|
-
currentItemArrowType: "
|
|
80
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
81
81
|
viewBackgroundColor: string;
|
|
82
82
|
scrollX: number;
|
|
83
83
|
scrollY: number;
|
|
@@ -89,7 +89,7 @@ export declare const actionToggleStats: {
|
|
|
89
89
|
zoom: Readonly<{
|
|
90
90
|
value: import("../types").NormalizedZoomValue;
|
|
91
91
|
}>;
|
|
92
|
-
openMenu: "
|
|
92
|
+
openMenu: "canvas" | "shape" | null;
|
|
93
93
|
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
94
94
|
openSidebar: {
|
|
95
95
|
name: string;
|
|
@@ -167,9 +167,8 @@ export declare const actionToggleStats: {
|
|
|
167
167
|
shown: true;
|
|
168
168
|
data: import("../charts").Spreadsheet;
|
|
169
169
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
selectedLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
|
|
170
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
171
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
173
172
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
174
173
|
originSnapOffset: {
|
|
175
174
|
x: number;
|
|
@@ -180,21 +179,19 @@ export declare const actionToggleStats: {
|
|
|
180
179
|
followedBy: Set<import("../types").SocketId>;
|
|
181
180
|
isCropping: boolean;
|
|
182
181
|
croppingElementId: string | null;
|
|
183
|
-
searchMatches:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}[];
|
|
192
|
-
}[];
|
|
182
|
+
searchMatches: Readonly<{
|
|
183
|
+
focusedId: string | null;
|
|
184
|
+
matches: readonly import("../types").SearchMatch[];
|
|
185
|
+
}> | null;
|
|
186
|
+
activeLockedId: string | null;
|
|
187
|
+
lockedMultiSelections: {
|
|
188
|
+
[groupId: string]: true;
|
|
189
|
+
};
|
|
193
190
|
};
|
|
194
191
|
captureUpdate: "EVENTUALLY";
|
|
195
192
|
};
|
|
196
193
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
197
|
-
keyTest: (event:
|
|
194
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
198
195
|
} & {
|
|
199
|
-
keyTest?: ((event:
|
|
196
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
200
197
|
};
|
|
@@ -37,7 +37,7 @@ export declare const actionToggleViewMode: {
|
|
|
37
37
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
38
38
|
isBindingEnabled: boolean;
|
|
39
39
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
40
|
-
suggestedBindings: import("@excalidraw/element
|
|
40
|
+
suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
|
|
41
41
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
42
42
|
frameRendering: {
|
|
43
43
|
enabled: boolean;
|
|
@@ -48,7 +48,7 @@ export declare const actionToggleViewMode: {
|
|
|
48
48
|
editingFrame: string | null;
|
|
49
49
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
50
50
|
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
51
|
-
editingLinearElement: import("@excalidraw/element
|
|
51
|
+
editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
52
52
|
activeTool: {
|
|
53
53
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
54
54
|
locked: boolean;
|
|
@@ -74,7 +74,7 @@ export declare const actionToggleViewMode: {
|
|
|
74
74
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
75
75
|
currentHoveredFontFamily: number | null;
|
|
76
76
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
77
|
-
currentItemArrowType: "
|
|
77
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
78
78
|
viewBackgroundColor: string;
|
|
79
79
|
scrollX: number;
|
|
80
80
|
scrollY: number;
|
|
@@ -86,7 +86,7 @@ export declare const actionToggleViewMode: {
|
|
|
86
86
|
zoom: Readonly<{
|
|
87
87
|
value: import("../types").NormalizedZoomValue;
|
|
88
88
|
}>;
|
|
89
|
-
openMenu: "
|
|
89
|
+
openMenu: "canvas" | "shape" | null;
|
|
90
90
|
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
91
91
|
openSidebar: {
|
|
92
92
|
name: string;
|
|
@@ -167,9 +167,8 @@ export declare const actionToggleViewMode: {
|
|
|
167
167
|
shown: true;
|
|
168
168
|
data: import("../charts").Spreadsheet;
|
|
169
169
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
selectedLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
|
|
170
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
171
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
173
172
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
174
173
|
originSnapOffset: {
|
|
175
174
|
x: number;
|
|
@@ -180,23 +179,21 @@ export declare const actionToggleViewMode: {
|
|
|
180
179
|
followedBy: Set<import("../types").SocketId>;
|
|
181
180
|
isCropping: boolean;
|
|
182
181
|
croppingElementId: string | null;
|
|
183
|
-
searchMatches:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}[];
|
|
192
|
-
}[];
|
|
182
|
+
searchMatches: Readonly<{
|
|
183
|
+
focusedId: string | null;
|
|
184
|
+
matches: readonly import("../types").SearchMatch[];
|
|
185
|
+
}> | null;
|
|
186
|
+
activeLockedId: string | null;
|
|
187
|
+
lockedMultiSelections: {
|
|
188
|
+
[groupId: string]: true;
|
|
189
|
+
};
|
|
193
190
|
};
|
|
194
191
|
captureUpdate: "EVENTUALLY";
|
|
195
192
|
};
|
|
196
193
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
197
194
|
predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
198
|
-
keyTest: (event:
|
|
195
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
199
196
|
PanelComponent: ({ data, updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
200
197
|
} & {
|
|
201
|
-
keyTest?: ((event:
|
|
198
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
202
199
|
};
|
|
@@ -37,7 +37,7 @@ export declare const actionToggleZenMode: {
|
|
|
37
37
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
38
38
|
isBindingEnabled: boolean;
|
|
39
39
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
40
|
-
suggestedBindings: import("@excalidraw/element
|
|
40
|
+
suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
|
|
41
41
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
42
42
|
frameRendering: {
|
|
43
43
|
enabled: boolean;
|
|
@@ -48,7 +48,7 @@ export declare const actionToggleZenMode: {
|
|
|
48
48
|
editingFrame: string | null;
|
|
49
49
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
50
50
|
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
51
|
-
editingLinearElement: import("@excalidraw/element
|
|
51
|
+
editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
52
52
|
activeTool: {
|
|
53
53
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
54
54
|
locked: boolean;
|
|
@@ -74,7 +74,7 @@ export declare const actionToggleZenMode: {
|
|
|
74
74
|
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
75
75
|
currentHoveredFontFamily: number | null;
|
|
76
76
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
77
|
-
currentItemArrowType: "
|
|
77
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
78
78
|
viewBackgroundColor: string;
|
|
79
79
|
scrollX: number;
|
|
80
80
|
scrollY: number;
|
|
@@ -86,7 +86,7 @@ export declare const actionToggleZenMode: {
|
|
|
86
86
|
zoom: Readonly<{
|
|
87
87
|
value: import("../types").NormalizedZoomValue;
|
|
88
88
|
}>;
|
|
89
|
-
openMenu: "
|
|
89
|
+
openMenu: "canvas" | "shape" | null;
|
|
90
90
|
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
91
91
|
openSidebar: {
|
|
92
92
|
name: string;
|
|
@@ -167,9 +167,8 @@ export declare const actionToggleZenMode: {
|
|
|
167
167
|
shown: true;
|
|
168
168
|
data: import("../charts").Spreadsheet;
|
|
169
169
|
};
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
selectedLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
|
|
170
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
171
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
173
172
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
174
173
|
originSnapOffset: {
|
|
175
174
|
x: number;
|
|
@@ -180,22 +179,20 @@ export declare const actionToggleZenMode: {
|
|
|
180
179
|
followedBy: Set<import("../types").SocketId>;
|
|
181
180
|
isCropping: boolean;
|
|
182
181
|
croppingElementId: string | null;
|
|
183
|
-
searchMatches:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}[];
|
|
192
|
-
}[];
|
|
182
|
+
searchMatches: Readonly<{
|
|
183
|
+
focusedId: string | null;
|
|
184
|
+
matches: readonly import("../types").SearchMatch[];
|
|
185
|
+
}> | null;
|
|
186
|
+
activeLockedId: string | null;
|
|
187
|
+
lockedMultiSelections: {
|
|
188
|
+
[groupId: string]: true;
|
|
189
|
+
};
|
|
193
190
|
};
|
|
194
191
|
captureUpdate: "EVENTUALLY";
|
|
195
192
|
};
|
|
196
193
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
197
194
|
predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
198
|
-
keyTest: (event:
|
|
195
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
199
196
|
} & {
|
|
200
|
-
keyTest?: ((event:
|
|
197
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
201
198
|
};
|
|
@@ -13,10 +13,10 @@ export declare const actionSendBackward: {
|
|
|
13
13
|
captureUpdate: "IMMEDIATELY";
|
|
14
14
|
};
|
|
15
15
|
keyPriority: number;
|
|
16
|
-
keyTest: (event:
|
|
16
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
17
17
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
} & {
|
|
19
|
-
keyTest?: ((event:
|
|
19
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
20
20
|
};
|
|
21
21
|
export declare const actionBringForward: {
|
|
22
22
|
name: "bringForward";
|
|
@@ -32,10 +32,10 @@ export declare const actionBringForward: {
|
|
|
32
32
|
captureUpdate: "IMMEDIATELY";
|
|
33
33
|
};
|
|
34
34
|
keyPriority: number;
|
|
35
|
-
keyTest: (event:
|
|
35
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
36
36
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
37
|
} & {
|
|
38
|
-
keyTest?: ((event:
|
|
38
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
39
39
|
};
|
|
40
40
|
export declare const actionSendToBack: {
|
|
41
41
|
name: "sendToBack";
|
|
@@ -50,10 +50,10 @@ export declare const actionSendToBack: {
|
|
|
50
50
|
appState: Readonly<import("../types").AppState>;
|
|
51
51
|
captureUpdate: "IMMEDIATELY";
|
|
52
52
|
};
|
|
53
|
-
keyTest: (event:
|
|
53
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
54
54
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
55
|
} & {
|
|
56
|
-
keyTest?: ((event:
|
|
56
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
57
57
|
};
|
|
58
58
|
export declare const actionBringToFront: {
|
|
59
59
|
name: "bringToFront";
|
|
@@ -68,8 +68,8 @@ export declare const actionBringToFront: {
|
|
|
68
68
|
appState: Readonly<import("../types").AppState>;
|
|
69
69
|
captureUpdate: "IMMEDIATELY";
|
|
70
70
|
};
|
|
71
|
-
keyTest: (event:
|
|
71
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
72
72
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
73
73
|
} & {
|
|
74
|
-
keyTest?: ((event:
|
|
74
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
75
75
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExcalidrawElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type { CaptureUpdateActionType } from "
|
|
2
|
+
import type { CaptureUpdateActionType } from "@excalidraw/element";
|
|
3
3
|
import type { AppClassProperties, AppState, ExcalidrawProps, BinaryFiles, UIAppState } from "../types";
|
|
4
4
|
import type React from "react";
|
|
5
5
|
export type ActionSource = "ui" | "keyboard" | "contextMenu" | "api" | "commandPalette";
|
|
@@ -14,7 +14,7 @@ export type ActionResult = {
|
|
|
14
14
|
type ActionFn = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
15
15
|
export type UpdaterFn = (res: ActionResult) => void;
|
|
16
16
|
export type ActionFilterFn = (action: Action) => void;
|
|
17
|
-
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "arrangeElements" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "smartZoom" | "toggleLassoTool";
|
|
17
|
+
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "arrangeElements" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "smartZoom" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
|
|
18
18
|
export type PanelComponentProps = {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
20
|
appState: AppState;
|
|
@@ -22,6 +22,7 @@ export type PanelComponentProps = {
|
|
|
22
22
|
appProps: ExcalidrawProps;
|
|
23
23
|
data?: Record<string, any>;
|
|
24
24
|
app: AppClassProperties;
|
|
25
|
+
renderAction: (name: ActionName, data?: PanelComponentProps["data"]) => React.JSX.Element | null;
|
|
25
26
|
};
|
|
26
27
|
export interface Action {
|
|
27
28
|
name: ActionName;
|
|
@@ -35,7 +36,7 @@ export interface Action {
|
|
|
35
36
|
predicate?: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: ExcalidrawProps, app: AppClassProperties) => boolean;
|
|
36
37
|
checked?: (appState: Readonly<AppState>) => boolean;
|
|
37
38
|
trackEvent: false | {
|
|
38
|
-
category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink" | "search_menu";
|
|
39
|
+
category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink" | "search_menu" | "shape_switch";
|
|
39
40
|
action?: string;
|
|
40
41
|
predicate?: (appState: Readonly<AppState>, elements: readonly ExcalidrawElement[], value: any) => boolean;
|
|
41
42
|
};
|
|
@@ -1,34 +1,19 @@
|
|
|
1
1
|
import type { AppState, NormalizedZoomValue } from "./types";
|
|
2
2
|
export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
3
3
|
export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
stats?: {
|
|
5
|
+
open: boolean;
|
|
6
|
+
panels: number;
|
|
7
|
+
} | undefined;
|
|
8
|
+
exportWithDarkMode?: boolean | undefined;
|
|
9
|
+
cursorButton?: "up" | "down" | undefined;
|
|
10
10
|
scrollX?: number | undefined;
|
|
11
11
|
scrollY?: number | undefined;
|
|
12
|
-
editingGroupId?: string | null | undefined;
|
|
13
|
-
selectedElementIds?: Readonly<{
|
|
14
|
-
[id: string]: true;
|
|
15
|
-
}> | undefined;
|
|
16
|
-
selectedGroupIds?: {
|
|
17
|
-
[groupId: string]: boolean;
|
|
18
|
-
} | undefined;
|
|
19
|
-
selectedLinearElement?: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null | undefined;
|
|
20
|
-
zenModeEnabled?: boolean | undefined;
|
|
21
|
-
gridModeEnabled?: boolean | undefined;
|
|
22
|
-
objectsSnapModeEnabled?: boolean | undefined;
|
|
23
|
-
wheelZoomsOnDefault?: boolean | undefined;
|
|
24
|
-
shouldCacheIgnoreZoom?: boolean | undefined;
|
|
25
|
-
exportScale?: number | undefined;
|
|
26
|
-
gridSize?: number | undefined;
|
|
27
|
-
gridStep?: number | undefined;
|
|
28
12
|
showWelcomeScreen?: boolean | undefined;
|
|
29
13
|
myocSimplifiedMode?: boolean | undefined;
|
|
30
14
|
dontResizeLimitMBs?: number | undefined;
|
|
31
15
|
hideMainMenus?: boolean | undefined;
|
|
16
|
+
wheelZoomsOnDefault?: boolean | undefined;
|
|
32
17
|
arrangeConfiguration?: {
|
|
33
18
|
algorithm: "bin-packing";
|
|
34
19
|
gap: number;
|
|
@@ -42,7 +27,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
42
27
|
penDetected?: boolean | undefined;
|
|
43
28
|
exportBackground?: boolean | undefined;
|
|
44
29
|
exportEmbedScene?: boolean | undefined;
|
|
45
|
-
|
|
30
|
+
exportScale?: number | undefined;
|
|
46
31
|
currentItemStrokeColor?: string | undefined;
|
|
47
32
|
currentItemBackgroundColor?: string | undefined;
|
|
48
33
|
currentItemFillStyle?: import("@excalidraw/element/types").FillStyle | undefined;
|
|
@@ -56,36 +41,60 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
56
41
|
currentItemStartArrowhead?: import("@excalidraw/element/types").Arrowhead | null | undefined;
|
|
57
42
|
currentItemEndArrowhead?: import("@excalidraw/element/types").Arrowhead | null | undefined;
|
|
58
43
|
currentItemRoundness?: import("@excalidraw/element/types").StrokeRoundness | undefined;
|
|
59
|
-
currentItemArrowType?: "
|
|
60
|
-
|
|
44
|
+
currentItemArrowType?: "sharp" | "round" | "elbow" | undefined;
|
|
45
|
+
viewBackgroundColor?: string | undefined;
|
|
61
46
|
scrolledOutside?: boolean | undefined;
|
|
62
|
-
|
|
47
|
+
name?: string | null | undefined;
|
|
48
|
+
zoom?: Readonly<{
|
|
49
|
+
value: NormalizedZoomValue;
|
|
50
|
+
}> | undefined;
|
|
51
|
+
openMenu?: "canvas" | "shape" | null | undefined;
|
|
63
52
|
openSidebar?: {
|
|
64
53
|
name: string;
|
|
65
54
|
tab?: string | undefined;
|
|
66
55
|
} | null | undefined;
|
|
67
56
|
defaultSidebarDockedPreference?: boolean | undefined;
|
|
68
57
|
lastPointerDownWith?: import("@excalidraw/element/types").PointerType | undefined;
|
|
58
|
+
selectedElementIds?: Readonly<{
|
|
59
|
+
[id: string]: true;
|
|
60
|
+
}> | undefined;
|
|
69
61
|
previousSelectedElementIds?: {
|
|
70
62
|
[id: string]: true;
|
|
71
63
|
} | undefined;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
shouldCacheIgnoreZoom?: boolean | undefined;
|
|
65
|
+
zenModeEnabled?: boolean | undefined;
|
|
66
|
+
theme?: import("@excalidraw/element/types").Theme | undefined;
|
|
67
|
+
gridSize?: number | undefined;
|
|
68
|
+
gridStep?: number | undefined;
|
|
69
|
+
gridModeEnabled?: boolean | undefined;
|
|
70
|
+
selectedGroupIds?: {
|
|
71
|
+
[groupId: string]: boolean;
|
|
75
72
|
} | undefined;
|
|
73
|
+
editingGroupId?: string | null | undefined;
|
|
76
74
|
currentChartType?: import("@excalidraw/element/types").ChartType | undefined;
|
|
75
|
+
selectedLinearElement?: import("@excalidraw/element").LinearElementEditor | null | undefined;
|
|
76
|
+
objectsSnapModeEnabled?: boolean | undefined;
|
|
77
|
+
lockedMultiSelections?: {
|
|
78
|
+
[groupId: string]: true;
|
|
79
|
+
} | undefined;
|
|
77
80
|
};
|
|
78
81
|
export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
|
|
79
82
|
viewBackgroundColor?: string | undefined;
|
|
80
|
-
gridModeEnabled?: boolean | undefined;
|
|
81
83
|
gridSize?: number | undefined;
|
|
82
84
|
gridStep?: number | undefined;
|
|
85
|
+
gridModeEnabled?: boolean | undefined;
|
|
86
|
+
lockedMultiSelections?: {
|
|
87
|
+
[groupId: string]: true;
|
|
88
|
+
} | undefined;
|
|
83
89
|
};
|
|
84
90
|
export declare const clearAppStateForDatabase: (appState: Partial<AppState>) => {
|
|
85
91
|
viewBackgroundColor?: string | undefined;
|
|
86
|
-
gridModeEnabled?: boolean | undefined;
|
|
87
92
|
gridSize?: number | undefined;
|
|
88
93
|
gridStep?: number | undefined;
|
|
94
|
+
gridModeEnabled?: boolean | undefined;
|
|
95
|
+
lockedMultiSelections?: {
|
|
96
|
+
[groupId: string]: true;
|
|
97
|
+
} | undefined;
|
|
89
98
|
};
|
|
90
99
|
export declare const isEraserActive: ({ activeTool, }: {
|
|
91
100
|
activeTool: AppState["activeTool"];
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { type EXPORT_IMAGE_TYPES } from "@excalidraw/common";
|
|
3
|
-
import { LinearElementEditor } from "@excalidraw/element
|
|
4
|
-
import { FlowChartCreator } from "@excalidraw/element/flowchart";
|
|
2
|
+
import { type EXPORT_IMAGE_TYPES, Emitter } from "@excalidraw/common";
|
|
3
|
+
import { LinearElementEditor, FlowChartCreator, Scene, Store, type ElementUpdate } from "@excalidraw/element";
|
|
5
4
|
import type { ExcalidrawElement, NonDeleted, InitializedExcalidrawImageElement, ExcalidrawImageElement, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered } from "@excalidraw/element/types";
|
|
5
|
+
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
6
6
|
import { ActionManager } from "../actions/manager";
|
|
7
7
|
import { AnimationFrameHandler } from "../animation-frame-handler";
|
|
8
8
|
import { History } from "../history";
|
|
9
|
-
import Scene from "../scene/Scene";
|
|
10
9
|
import { Fonts } from "../fonts";
|
|
10
|
+
import { type WritableAtom } from "../editor-jotai";
|
|
11
11
|
import { Renderer } from "../scene/Renderer";
|
|
12
|
-
import { Emitter } from "../emitter";
|
|
13
|
-
import { Store } from "../store";
|
|
14
12
|
import { LaserTrails } from "../laser-trails";
|
|
15
13
|
import { LassoTrail } from "../lasso";
|
|
16
14
|
import { EraserTrail } from "../eraser";
|
|
@@ -124,7 +122,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
124
122
|
};
|
|
125
123
|
originalElements: Map<string, NonDeleted<ExcalidrawElement>>;
|
|
126
124
|
resize: {
|
|
127
|
-
handleType: import("@excalidraw/element
|
|
125
|
+
handleType: import("@excalidraw/element").MaybeTransformHandleType;
|
|
128
126
|
isResizing: boolean;
|
|
129
127
|
offset: {
|
|
130
128
|
x: number;
|
|
@@ -193,7 +191,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
193
191
|
};
|
|
194
192
|
originalElements: Map<string, NonDeleted<ExcalidrawElement>>;
|
|
195
193
|
resize: {
|
|
196
|
-
handleType: import("@excalidraw/element
|
|
194
|
+
handleType: import("@excalidraw/element").MaybeTransformHandleType;
|
|
197
195
|
isResizing: boolean;
|
|
198
196
|
offset: {
|
|
199
197
|
x: number;
|
|
@@ -245,6 +243,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
245
243
|
missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
|
|
246
244
|
onRemoveEventListenersEmitter: Emitter<[]>;
|
|
247
245
|
constructor(props: AppProps);
|
|
246
|
+
updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
|
|
248
247
|
private onWindowMessage;
|
|
249
248
|
private cacheEmbeddableRef;
|
|
250
249
|
/**
|
|
@@ -266,6 +265,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
266
265
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
267
266
|
focusContainer: AppClassProperties["focusContainer"];
|
|
268
267
|
getSceneElementsIncludingDeleted: () => readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
268
|
+
getSceneElementsMapIncludingDeleted: () => Map<string, Ordered<ExcalidrawElement>> & import("@excalidraw/common/utility-types").MakeBrand<"SceneElementsMap">;
|
|
269
269
|
getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
|
|
270
270
|
onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
271
271
|
onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
|
|
@@ -402,6 +402,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
402
402
|
*/
|
|
403
403
|
captureUpdate?: SceneData["captureUpdate"];
|
|
404
404
|
}) => void;
|
|
405
|
+
mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
|
|
405
406
|
private triggerRender;
|
|
406
407
|
/**
|
|
407
408
|
* @returns whether the menu was toggled on or off
|
|
@@ -416,12 +417,9 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
416
417
|
private onKeyDown;
|
|
417
418
|
private onKeyUp;
|
|
418
419
|
private isToolSupported;
|
|
419
|
-
setActiveTool: (tool: (
|
|
420
|
-
type:
|
|
420
|
+
setActiveTool: (tool: ({
|
|
421
|
+
type: ToolType;
|
|
421
422
|
} | {
|
|
422
|
-
type: Extract<ToolType, "image">;
|
|
423
|
-
insertOnCanvasDirectly?: boolean;
|
|
424
|
-
}) | {
|
|
425
423
|
type: "custom";
|
|
426
424
|
customType: string;
|
|
427
425
|
}) & {
|
|
@@ -447,7 +445,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
447
445
|
private getTextElementAtPosition;
|
|
448
446
|
private getElementAtPosition;
|
|
449
447
|
private getElementsAtPosition;
|
|
450
|
-
getElementHitThreshold(): number;
|
|
448
|
+
getElementHitThreshold(element: ExcalidrawElement): number;
|
|
451
449
|
private hitElement;
|
|
452
450
|
private getTextBindableContainerAtPosition;
|
|
453
451
|
private startTextEditing;
|
|
@@ -513,10 +511,10 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
513
511
|
/**
|
|
514
512
|
* inserts image into elements array and rerenders
|
|
515
513
|
*/
|
|
516
|
-
insertImageElement: (imageElement: ExcalidrawImageElement, imageFile: File
|
|
517
|
-
private setImagePreviewCursor;
|
|
514
|
+
insertImageElement: (imageElement: ExcalidrawImageElement, imageFile: File) => Promise<NonDeleted<InitializedExcalidrawImageElement> | null | undefined>;
|
|
518
515
|
private onImageAction;
|
|
519
|
-
initializeImageDimensions: (imageElement: ExcalidrawImageElement
|
|
516
|
+
initializeImageDimensions: (imageElement: ExcalidrawImageElement) => void;
|
|
517
|
+
private getImageNaturalDimensions;
|
|
520
518
|
/** updates image cache, refreshing updated elements and/or setting status
|
|
521
519
|
to error for images that fail during <img> element creation */
|
|
522
520
|
private updateImageCache;
|
|
@@ -10,6 +10,7 @@ interface ButtonIconProps {
|
|
|
10
10
|
/** include standalone style (could interfere with parent styles) */
|
|
11
11
|
standalone?: boolean;
|
|
12
12
|
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
13
|
+
style?: React.CSSProperties;
|
|
13
14
|
}
|
|
14
15
|
export declare const ButtonIcon: import("react").ForwardRefExoticComponent<ButtonIconProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
15
16
|
export {};
|
|
@@ -4,6 +4,7 @@ interface ColorInputProps {
|
|
|
4
4
|
onChange: (color: string) => void;
|
|
5
5
|
label: string;
|
|
6
6
|
colorPickerType: ColorPickerType;
|
|
7
|
+
placeholder?: string;
|
|
7
8
|
}
|
|
8
|
-
export declare const ColorInput: ({ color, onChange, label, colorPickerType, }: ColorInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const ColorInput: ({ color, onChange, label, colorPickerType, placeholder, }: ColorInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -6,7 +6,11 @@ import type { AppState } from "../../types";
|
|
|
6
6
|
export declare const getColor: (color: string) => string | null;
|
|
7
7
|
interface ColorPickerProps {
|
|
8
8
|
type: ColorPickerType;
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* null indicates no color should be displayed as active
|
|
11
|
+
* (e.g. when multiple shapes selected with different colors)
|
|
12
|
+
*/
|
|
13
|
+
color: string | null;
|
|
10
14
|
onChange: (color: string) => void;
|
|
11
15
|
label: string;
|
|
12
16
|
elements: readonly ExcalidrawElement[];
|
|
@@ -3,9 +3,8 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
|
3
3
|
import type { ColorPaletteCustom } from "@excalidraw/common";
|
|
4
4
|
import type { ColorPickerType } from "./colorPickerUtils";
|
|
5
5
|
interface PickerProps {
|
|
6
|
-
color: string;
|
|
6
|
+
color: string | null;
|
|
7
7
|
onChange: (color: string) => void;
|
|
8
|
-
label: string;
|
|
9
8
|
type: ColorPickerType;
|
|
10
9
|
elements: readonly ExcalidrawElement[];
|
|
11
10
|
palette: ColorPaletteCustom;
|
|
@@ -14,5 +13,5 @@ interface PickerProps {
|
|
|
14
13
|
onEyeDropperToggle: (force?: boolean) => void;
|
|
15
14
|
onEscape: (event: React.KeyboardEvent | KeyboardEvent) => void;
|
|
16
15
|
}
|
|
17
|
-
export declare const Picker:
|
|
16
|
+
export declare const Picker: React.ForwardRefExoticComponent<PickerProps & React.RefAttributes<unknown>>;
|
|
18
17
|
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { ColorPaletteCustom } from "@excalidraw/common";
|
|
2
2
|
interface PickerColorListProps {
|
|
3
3
|
palette: ColorPaletteCustom;
|
|
4
|
-
color: string;
|
|
4
|
+
color: string | null;
|
|
5
5
|
onChange: (color: string) => void;
|
|
6
|
-
label: string;
|
|
7
6
|
activeShade: number;
|
|
8
7
|
}
|
|
9
|
-
declare const PickerColorList: ({ palette, color, onChange,
|
|
8
|
+
declare const PickerColorList: ({ palette, color, onChange, activeShade, }: PickerColorListProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export default PickerColorList;
|