@excalidraw/excalidraw 0.18.0-c4c0649 → 0.18.0-d2463f87d
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-CBGOW5JB.js +5669 -0
- package/dist/dev/chunk-CBGOW5JB.js.map +7 -0
- package/dist/dev/chunk-CP5DND7P.js +7 -0
- package/dist/dev/chunk-CP5DND7P.js.map +7 -0
- package/dist/dev/{chunk-JCUIYZXF.js → chunk-QF5FRM6O.js} +6 -2
- package/dist/dev/chunk-QF5FRM6O.js.map +7 -0
- package/dist/dev/data/{image-SLEZBMLG.js → image-SURZSZNX.js} +3 -3
- package/dist/dev/index.css +47 -20
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +5873 -3369
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-ZDTPSZNL.js → en-SMAPCEOQ.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-A66AFZZU.js +7 -0
- package/dist/prod/{chunk-GCFVWREF.js → chunk-I4UNSFV6.js} +4 -4
- package/dist/prod/chunk-IRHK23LL.js +4 -0
- package/dist/prod/data/image-HXEZYJPQ.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +25 -18
- package/dist/prod/locales/{en-MHZ26NAR.js → en-TYY6KWIJ.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 +18 -3
- package/dist/types/common/src/utils.d.ts +3 -5
- package/dist/types/element/src/Scene.d.ts +1 -1
- package/dist/types/element/src/binding.d.ts +10 -7
- package/dist/types/element/src/bounds.d.ts +11 -3
- package/dist/types/element/src/collision.d.ts +18 -12
- package/dist/types/element/src/cropElement.d.ts +1 -1
- package/dist/types/element/src/delta.d.ts +26 -6
- package/dist/types/element/src/distance.d.ts +2 -2
- package/dist/types/element/src/fractionalIndex.d.ts +8 -2
- package/dist/types/element/src/frame.d.ts +2 -2
- package/dist/types/element/src/index.d.ts +1 -3
- package/dist/types/element/src/linearElementEditor.d.ts +12 -22
- package/dist/types/element/src/mutateElement.d.ts +1 -1
- package/dist/types/element/src/newElement.d.ts +2 -1
- package/dist/types/element/src/resizeElements.d.ts +1 -0
- package/dist/types/element/src/selection.d.ts +1 -1
- package/dist/types/element/src/shape.d.ts +42 -0
- package/dist/types/element/src/sizeHelpers.d.ts +2 -1
- package/dist/types/element/src/store.d.ts +12 -8
- package/dist/types/element/src/transformHandles.d.ts +4 -4
- package/dist/types/element/src/typeChecks.d.ts +15 -1
- package/dist/types/element/src/types.d.ts +8 -3
- package/dist/types/element/src/utils.d.ts +16 -6
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +21 -12
- package/dist/types/excalidraw/actions/actionAlign.d.ts +8 -8
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +14 -8
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +181 -142
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +47 -28
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +7 -4
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +24 -14
- 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 +6 -3
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +29 -24
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +7 -4
- package/dist/types/excalidraw/actions/actionExport.d.ts +148 -121
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +63 -17
- package/dist/types/excalidraw/actions/actionFlip.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionFrame.d.ts +78 -66
- package/dist/types/excalidraw/actions/actionGroup.d.ts +20 -14
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +500 -4
- package/dist/types/excalidraw/actions/actionLink.d.ts +8 -5
- package/dist/types/excalidraw/actions/actionMenu.d.ts +22 -13
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +14 -8
- package/dist/types/excalidraw/actions/actionProperties.d.ts +119 -66
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +10 -7
- package/dist/types/excalidraw/actions/actionStyles.d.ts +11 -8
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +9 -6
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +9 -6
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +8 -5
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +9 -6
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +9 -6
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +9 -6
- package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -8
- package/dist/types/excalidraw/actions/types.d.ts +2 -1
- package/dist/types/excalidraw/appState.d.ts +29 -20
- package/dist/types/excalidraw/components/App.d.ts +13 -16
- package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -0
- package/dist/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +11 -1
- package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +1 -0
- package/dist/types/excalidraw/components/icons.d.ts +2 -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/eraser/index.d.ts +0 -2
- package/dist/types/excalidraw/history.d.ts +21 -5
- 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 +4 -4
- package/dist/types/excalidraw/scene/Renderer.d.ts +0 -1
- package/dist/types/excalidraw/types.d.ts +10 -4
- package/dist/types/math/src/angle.d.ts +2 -0
- package/dist/types/math/src/constants.d.ts +3 -0
- package/dist/types/math/src/curve.d.ts +32 -0
- package/dist/types/math/src/index.d.ts +1 -0
- package/dist/types/math/src/point.d.ts +1 -1
- package/dist/types/math/src/rectangle.d.ts +2 -0
- package/dist/types/math/src/vector.d.ts +4 -2
- package/history.ts +108 -45
- package/package.json +12 -9
- package/dist/dev/chunk-HNRFOURL.js +0 -23482
- package/dist/dev/chunk-HNRFOURL.js.map +0 -7
- package/dist/dev/chunk-JCUIYZXF.js.map +0 -7
- package/dist/dev/chunk-VKWYDXFZ.js +0 -7
- package/dist/dev/chunk-VKWYDXFZ.js.map +0 -7
- package/dist/prod/chunk-G6SRO7HP.js +0 -7
- package/dist/prod/chunk-M3D5LUUK.js +0 -33
- package/dist/prod/data/image-PMKVN4IF.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/element/src/shapes.d.ts +0 -23
- package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
- package/dist/types/excalidraw/visualdebug.d.ts +0 -41
- package/dist/types/utils/src/collision.d.ts +0 -8
- /package/dist/dev/data/{image-SLEZBMLG.js.map → image-SURZSZNX.js.map} +0 -0
- /package/dist/dev/locales/{en-ZDTPSZNL.js.map → en-SMAPCEOQ.js.map} +0 -0
|
@@ -22,7 +22,7 @@ export declare const actionCopyStyles: {
|
|
|
22
22
|
errorMessage: import("react").ReactNode;
|
|
23
23
|
activeEmbeddable: {
|
|
24
24
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
25
|
-
state: "
|
|
25
|
+
state: "active" | "hover";
|
|
26
26
|
} | null;
|
|
27
27
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
28
28
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
@@ -89,7 +89,7 @@ export declare const actionCopyStyles: {
|
|
|
89
89
|
name: "imageExport" | "help" | "jsonExport";
|
|
90
90
|
} | {
|
|
91
91
|
name: "ttd";
|
|
92
|
-
tab: "text-to-diagram"
|
|
92
|
+
tab: "mermaid" | "text-to-diagram";
|
|
93
93
|
} | {
|
|
94
94
|
name: "commandPalette";
|
|
95
95
|
} | {
|
|
@@ -156,8 +156,7 @@ export declare const actionCopyStyles: {
|
|
|
156
156
|
shown: true;
|
|
157
157
|
data: import("../charts").Spreadsheet;
|
|
158
158
|
};
|
|
159
|
-
|
|
160
|
-
showHyperlinkPopup: false | "info" | "editor";
|
|
159
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
161
160
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
162
161
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
163
162
|
originSnapOffset: {
|
|
@@ -173,12 +172,16 @@ export declare const actionCopyStyles: {
|
|
|
173
172
|
focusedId: string | null;
|
|
174
173
|
matches: readonly import("../types").SearchMatch[];
|
|
175
174
|
}> | null;
|
|
175
|
+
activeLockedId: string | null;
|
|
176
|
+
lockedMultiSelections: {
|
|
177
|
+
[groupId: string]: true;
|
|
178
|
+
};
|
|
176
179
|
};
|
|
177
180
|
captureUpdate: "EVENTUALLY";
|
|
178
181
|
};
|
|
179
|
-
keyTest: (event: import("react").KeyboardEvent<Element>
|
|
182
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
180
183
|
} & {
|
|
181
|
-
keyTest?: ((event: import("react").KeyboardEvent<Element>
|
|
184
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
182
185
|
};
|
|
183
186
|
export declare const actionPasteStyles: {
|
|
184
187
|
name: "pasteStyles";
|
|
@@ -194,7 +197,7 @@ export declare const actionPasteStyles: {
|
|
|
194
197
|
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
195
198
|
captureUpdate: "IMMEDIATELY";
|
|
196
199
|
};
|
|
197
|
-
keyTest: (event: import("react").KeyboardEvent<Element>
|
|
200
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
198
201
|
} & {
|
|
199
|
-
keyTest?: ((event: import("react").KeyboardEvent<Element>
|
|
202
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
200
203
|
};
|
|
@@ -24,7 +24,7 @@ export declare const actionToggleGridMode: {
|
|
|
24
24
|
errorMessage: import("react").ReactNode;
|
|
25
25
|
activeEmbeddable: {
|
|
26
26
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
27
|
-
state: "
|
|
27
|
+
state: "active" | "hover";
|
|
28
28
|
} | null;
|
|
29
29
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
30
30
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
@@ -91,7 +91,7 @@ export declare const actionToggleGridMode: {
|
|
|
91
91
|
name: "imageExport" | "help" | "jsonExport";
|
|
92
92
|
} | {
|
|
93
93
|
name: "ttd";
|
|
94
|
-
tab: "text-to-diagram"
|
|
94
|
+
tab: "mermaid" | "text-to-diagram";
|
|
95
95
|
} | {
|
|
96
96
|
name: "commandPalette";
|
|
97
97
|
} | {
|
|
@@ -162,8 +162,7 @@ export declare const actionToggleGridMode: {
|
|
|
162
162
|
shown: true;
|
|
163
163
|
data: import("../charts").Spreadsheet;
|
|
164
164
|
};
|
|
165
|
-
|
|
166
|
-
showHyperlinkPopup: false | "info" | "editor";
|
|
165
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
167
166
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
168
167
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
169
168
|
originSnapOffset: {
|
|
@@ -178,12 +177,16 @@ export declare const actionToggleGridMode: {
|
|
|
178
177
|
focusedId: string | null;
|
|
179
178
|
matches: readonly import("../types").SearchMatch[];
|
|
180
179
|
}> | null;
|
|
180
|
+
activeLockedId: string | null;
|
|
181
|
+
lockedMultiSelections: {
|
|
182
|
+
[groupId: string]: true;
|
|
183
|
+
};
|
|
181
184
|
};
|
|
182
185
|
captureUpdate: "EVENTUALLY";
|
|
183
186
|
};
|
|
184
187
|
checked: (appState: AppState) => boolean;
|
|
185
188
|
predicate: (element: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps) => boolean;
|
|
186
|
-
keyTest: (event: import("react").KeyboardEvent<Element>
|
|
189
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
187
190
|
} & {
|
|
188
|
-
keyTest?: ((event: import("react").KeyboardEvent<Element>
|
|
191
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
189
192
|
};
|
|
@@ -22,7 +22,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
22
22
|
errorMessage: import("react").ReactNode;
|
|
23
23
|
activeEmbeddable: {
|
|
24
24
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
25
|
-
state: "
|
|
25
|
+
state: "active" | "hover";
|
|
26
26
|
} | null;
|
|
27
27
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
28
28
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
@@ -89,7 +89,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
89
89
|
name: "imageExport" | "help" | "jsonExport";
|
|
90
90
|
} | {
|
|
91
91
|
name: "ttd";
|
|
92
|
-
tab: "text-to-diagram"
|
|
92
|
+
tab: "mermaid" | "text-to-diagram";
|
|
93
93
|
} | {
|
|
94
94
|
name: "commandPalette";
|
|
95
95
|
} | {
|
|
@@ -160,8 +160,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
160
160
|
shown: true;
|
|
161
161
|
data: import("../charts").Spreadsheet;
|
|
162
162
|
};
|
|
163
|
-
|
|
164
|
-
showHyperlinkPopup: false | "info" | "editor";
|
|
163
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
165
164
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
166
165
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
167
166
|
originSnapOffset: {
|
|
@@ -176,12 +175,16 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
176
175
|
focusedId: string | null;
|
|
177
176
|
matches: readonly import("../types").SearchMatch[];
|
|
178
177
|
}> | null;
|
|
178
|
+
activeLockedId: string | null;
|
|
179
|
+
lockedMultiSelections: {
|
|
180
|
+
[groupId: string]: true;
|
|
181
|
+
};
|
|
179
182
|
};
|
|
180
183
|
captureUpdate: "EVENTUALLY";
|
|
181
184
|
};
|
|
182
185
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
183
186
|
predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
184
|
-
keyTest: (event: import("react").KeyboardEvent<Element>
|
|
187
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
185
188
|
} & {
|
|
186
|
-
keyTest?: ((event: import("react").KeyboardEvent<Element>
|
|
189
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
187
190
|
};
|
|
@@ -28,7 +28,7 @@ export declare const actionToggleSearchMenu: {
|
|
|
28
28
|
errorMessage: import("react").ReactNode;
|
|
29
29
|
activeEmbeddable: {
|
|
30
30
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
31
|
-
state: "
|
|
31
|
+
state: "active" | "hover";
|
|
32
32
|
} | null;
|
|
33
33
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
34
34
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
@@ -152,8 +152,7 @@ export declare const actionToggleSearchMenu: {
|
|
|
152
152
|
shown: true;
|
|
153
153
|
data: import("../charts").Spreadsheet;
|
|
154
154
|
};
|
|
155
|
-
|
|
156
|
-
showHyperlinkPopup: false | "info" | "editor";
|
|
155
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
157
156
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
158
157
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
159
158
|
originSnapOffset: {
|
|
@@ -169,12 +168,16 @@ export declare const actionToggleSearchMenu: {
|
|
|
169
168
|
focusedId: string | null;
|
|
170
169
|
matches: readonly import("../types").SearchMatch[];
|
|
171
170
|
}> | null;
|
|
171
|
+
activeLockedId: string | null;
|
|
172
|
+
lockedMultiSelections: {
|
|
173
|
+
[groupId: string]: true;
|
|
174
|
+
};
|
|
172
175
|
};
|
|
173
176
|
captureUpdate: "EVENTUALLY";
|
|
174
177
|
};
|
|
175
178
|
checked: (appState: AppState) => boolean;
|
|
176
179
|
predicate: (element: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps) => boolean;
|
|
177
|
-
keyTest: (event: import("react").KeyboardEvent<Element>
|
|
180
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
178
181
|
} & {
|
|
179
|
-
keyTest?: ((event: import("react").KeyboardEvent<Element>
|
|
182
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
180
183
|
};
|
|
@@ -24,7 +24,7 @@ export declare const actionToggleStats: {
|
|
|
24
24
|
errorMessage: import("react").ReactNode;
|
|
25
25
|
activeEmbeddable: {
|
|
26
26
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
27
|
-
state: "
|
|
27
|
+
state: "active" | "hover";
|
|
28
28
|
} | null;
|
|
29
29
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
30
30
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
@@ -91,7 +91,7 @@ export declare const actionToggleStats: {
|
|
|
91
91
|
name: "imageExport" | "help" | "jsonExport";
|
|
92
92
|
} | {
|
|
93
93
|
name: "ttd";
|
|
94
|
-
tab: "text-to-diagram"
|
|
94
|
+
tab: "mermaid" | "text-to-diagram";
|
|
95
95
|
} | {
|
|
96
96
|
name: "commandPalette";
|
|
97
97
|
} | {
|
|
@@ -159,8 +159,7 @@ export declare const actionToggleStats: {
|
|
|
159
159
|
shown: true;
|
|
160
160
|
data: import("../charts").Spreadsheet;
|
|
161
161
|
};
|
|
162
|
-
|
|
163
|
-
showHyperlinkPopup: false | "info" | "editor";
|
|
162
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
164
163
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
165
164
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
166
165
|
originSnapOffset: {
|
|
@@ -176,11 +175,15 @@ export declare const actionToggleStats: {
|
|
|
176
175
|
focusedId: string | null;
|
|
177
176
|
matches: readonly import("../types").SearchMatch[];
|
|
178
177
|
}> | null;
|
|
178
|
+
activeLockedId: string | null;
|
|
179
|
+
lockedMultiSelections: {
|
|
180
|
+
[groupId: string]: true;
|
|
181
|
+
};
|
|
179
182
|
};
|
|
180
183
|
captureUpdate: "EVENTUALLY";
|
|
181
184
|
};
|
|
182
185
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
183
|
-
keyTest: (event: import("react").KeyboardEvent<Element>
|
|
186
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
184
187
|
} & {
|
|
185
|
-
keyTest?: ((event: import("react").KeyboardEvent<Element>
|
|
188
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
186
189
|
};
|
|
@@ -21,7 +21,7 @@ export declare const actionToggleViewMode: {
|
|
|
21
21
|
errorMessage: import("react").ReactNode;
|
|
22
22
|
activeEmbeddable: {
|
|
23
23
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
24
|
-
state: "
|
|
24
|
+
state: "active" | "hover";
|
|
25
25
|
} | null;
|
|
26
26
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
27
27
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
@@ -88,7 +88,7 @@ export declare const actionToggleViewMode: {
|
|
|
88
88
|
name: "imageExport" | "help" | "jsonExport";
|
|
89
89
|
} | {
|
|
90
90
|
name: "ttd";
|
|
91
|
-
tab: "text-to-diagram"
|
|
91
|
+
tab: "mermaid" | "text-to-diagram";
|
|
92
92
|
} | {
|
|
93
93
|
name: "commandPalette";
|
|
94
94
|
} | {
|
|
@@ -159,8 +159,7 @@ export declare const actionToggleViewMode: {
|
|
|
159
159
|
shown: true;
|
|
160
160
|
data: import("../charts").Spreadsheet;
|
|
161
161
|
};
|
|
162
|
-
|
|
163
|
-
showHyperlinkPopup: false | "info" | "editor";
|
|
162
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
164
163
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
165
164
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
166
165
|
originSnapOffset: {
|
|
@@ -176,12 +175,16 @@ export declare const actionToggleViewMode: {
|
|
|
176
175
|
focusedId: string | null;
|
|
177
176
|
matches: readonly import("../types").SearchMatch[];
|
|
178
177
|
}> | null;
|
|
178
|
+
activeLockedId: string | null;
|
|
179
|
+
lockedMultiSelections: {
|
|
180
|
+
[groupId: string]: true;
|
|
181
|
+
};
|
|
179
182
|
};
|
|
180
183
|
captureUpdate: "EVENTUALLY";
|
|
181
184
|
};
|
|
182
185
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
183
186
|
predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
184
|
-
keyTest: (event: import("react").KeyboardEvent<Element>
|
|
187
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
185
188
|
} & {
|
|
186
|
-
keyTest?: ((event: import("react").KeyboardEvent<Element>
|
|
189
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
187
190
|
};
|
|
@@ -21,7 +21,7 @@ export declare const actionToggleZenMode: {
|
|
|
21
21
|
errorMessage: import("react").ReactNode;
|
|
22
22
|
activeEmbeddable: {
|
|
23
23
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
24
|
-
state: "
|
|
24
|
+
state: "active" | "hover";
|
|
25
25
|
} | null;
|
|
26
26
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
27
27
|
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
@@ -88,7 +88,7 @@ export declare const actionToggleZenMode: {
|
|
|
88
88
|
name: "imageExport" | "help" | "jsonExport";
|
|
89
89
|
} | {
|
|
90
90
|
name: "ttd";
|
|
91
|
-
tab: "text-to-diagram"
|
|
91
|
+
tab: "mermaid" | "text-to-diagram";
|
|
92
92
|
} | {
|
|
93
93
|
name: "commandPalette";
|
|
94
94
|
} | {
|
|
@@ -159,8 +159,7 @@ export declare const actionToggleZenMode: {
|
|
|
159
159
|
shown: true;
|
|
160
160
|
data: import("../charts").Spreadsheet;
|
|
161
161
|
};
|
|
162
|
-
|
|
163
|
-
showHyperlinkPopup: false | "info" | "editor";
|
|
162
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
164
163
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
165
164
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
166
165
|
originSnapOffset: {
|
|
@@ -176,12 +175,16 @@ export declare const actionToggleZenMode: {
|
|
|
176
175
|
focusedId: string | null;
|
|
177
176
|
matches: readonly import("../types").SearchMatch[];
|
|
178
177
|
}> | null;
|
|
178
|
+
activeLockedId: string | null;
|
|
179
|
+
lockedMultiSelections: {
|
|
180
|
+
[groupId: string]: true;
|
|
181
|
+
};
|
|
179
182
|
};
|
|
180
183
|
captureUpdate: "EVENTUALLY";
|
|
181
184
|
};
|
|
182
185
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
183
186
|
predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
184
|
-
keyTest: (event: import("react").KeyboardEvent<Element>
|
|
187
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
185
188
|
} & {
|
|
186
|
-
keyTest?: ((event: import("react").KeyboardEvent<Element>
|
|
189
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
187
190
|
};
|
|
@@ -13,10 +13,10 @@ export declare const actionSendBackward: {
|
|
|
13
13
|
captureUpdate: "IMMEDIATELY";
|
|
14
14
|
};
|
|
15
15
|
keyPriority: number;
|
|
16
|
-
keyTest: (event: import("react").KeyboardEvent<Element>
|
|
16
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
17
17
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
} & {
|
|
19
|
-
keyTest?: ((event: import("react").KeyboardEvent<Element>
|
|
19
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => 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: import("react").KeyboardEvent<Element>
|
|
35
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
36
36
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
37
|
} & {
|
|
38
|
-
keyTest?: ((event: import("react").KeyboardEvent<Element>
|
|
38
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => 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: import("react").KeyboardEvent<Element>
|
|
53
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
54
54
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
55
|
} & {
|
|
56
|
-
keyTest?: ((event: import("react").KeyboardEvent<Element>
|
|
56
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => 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: import("react").KeyboardEvent<Element>
|
|
71
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
72
72
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
73
73
|
} & {
|
|
74
|
-
keyTest?: ((event: import("react").KeyboardEvent<Element>
|
|
74
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
75
75
|
};
|
|
@@ -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" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "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" | "toggleLassoTool" | "toggleShapeSwitch";
|
|
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" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "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" | "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;
|
|
@@ -1,14 +1,23 @@
|
|
|
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
|
-
cursorButton?: "up" | "down" | undefined;
|
|
4
|
+
viewBackgroundColor?: string | undefined;
|
|
5
|
+
name?: string | null | undefined;
|
|
6
|
+
zoom?: Readonly<{
|
|
7
|
+
value: NormalizedZoomValue;
|
|
8
|
+
}> | undefined;
|
|
10
9
|
scrollX?: number | undefined;
|
|
11
10
|
scrollY?: number | undefined;
|
|
11
|
+
editingGroupId?: string | null | undefined;
|
|
12
|
+
selectedElementIds?: Readonly<{
|
|
13
|
+
[id: string]: true;
|
|
14
|
+
}> | undefined;
|
|
15
|
+
theme?: import("@excalidraw/element/types").Theme | undefined;
|
|
16
|
+
selectedGroupIds?: {
|
|
17
|
+
[groupId: string]: boolean;
|
|
18
|
+
} | undefined;
|
|
19
|
+
selectedLinearElement?: import("@excalidraw/element").LinearElementEditor | null | undefined;
|
|
20
|
+
zenModeEnabled?: boolean | undefined;
|
|
12
21
|
showWelcomeScreen?: boolean | undefined;
|
|
13
22
|
activeTool?: ({
|
|
14
23
|
lastActiveTool: import("./types").ActiveTool | null;
|
|
@@ -19,6 +28,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
19
28
|
penDetected?: boolean | undefined;
|
|
20
29
|
exportBackground?: boolean | undefined;
|
|
21
30
|
exportEmbedScene?: boolean | undefined;
|
|
31
|
+
exportWithDarkMode?: boolean | undefined;
|
|
22
32
|
exportScale?: number | undefined;
|
|
23
33
|
currentItemStrokeColor?: string | undefined;
|
|
24
34
|
currentItemBackgroundColor?: string | undefined;
|
|
@@ -34,12 +44,8 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
34
44
|
currentItemEndArrowhead?: import("@excalidraw/element/types").Arrowhead | null | undefined;
|
|
35
45
|
currentItemRoundness?: import("@excalidraw/element/types").StrokeRoundness | undefined;
|
|
36
46
|
currentItemArrowType?: "round" | "sharp" | "elbow" | undefined;
|
|
37
|
-
|
|
47
|
+
cursorButton?: "up" | "down" | undefined;
|
|
38
48
|
scrolledOutside?: boolean | undefined;
|
|
39
|
-
name?: string | null | undefined;
|
|
40
|
-
zoom?: Readonly<{
|
|
41
|
-
value: NormalizedZoomValue;
|
|
42
|
-
}> | undefined;
|
|
43
49
|
openMenu?: "canvas" | "shape" | null | undefined;
|
|
44
50
|
openSidebar?: {
|
|
45
51
|
name: string;
|
|
@@ -47,37 +53,40 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
47
53
|
} | null | undefined;
|
|
48
54
|
defaultSidebarDockedPreference?: boolean | undefined;
|
|
49
55
|
lastPointerDownWith?: import("@excalidraw/element/types").PointerType | undefined;
|
|
50
|
-
selectedElementIds?: Readonly<{
|
|
51
|
-
[id: string]: true;
|
|
52
|
-
}> | undefined;
|
|
53
56
|
previousSelectedElementIds?: {
|
|
54
57
|
[id: string]: true;
|
|
55
58
|
} | undefined;
|
|
56
59
|
shouldCacheIgnoreZoom?: boolean | undefined;
|
|
57
|
-
zenModeEnabled?: boolean | undefined;
|
|
58
|
-
theme?: import("@excalidraw/element/types").Theme | undefined;
|
|
59
60
|
gridSize?: number | undefined;
|
|
60
61
|
gridStep?: number | undefined;
|
|
61
62
|
gridModeEnabled?: boolean | undefined;
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
stats?: {
|
|
64
|
+
open: boolean;
|
|
65
|
+
panels: number;
|
|
64
66
|
} | undefined;
|
|
65
|
-
editingGroupId?: string | null | undefined;
|
|
66
67
|
currentChartType?: import("@excalidraw/element/types").ChartType | undefined;
|
|
67
|
-
selectedLinearElement?: import("@excalidraw/element").LinearElementEditor | null | undefined;
|
|
68
68
|
objectsSnapModeEnabled?: boolean | undefined;
|
|
69
|
+
lockedMultiSelections?: {
|
|
70
|
+
[groupId: string]: true;
|
|
71
|
+
} | undefined;
|
|
69
72
|
};
|
|
70
73
|
export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
|
|
71
74
|
viewBackgroundColor?: string | undefined;
|
|
72
75
|
gridSize?: number | undefined;
|
|
73
76
|
gridStep?: number | undefined;
|
|
74
77
|
gridModeEnabled?: boolean | undefined;
|
|
78
|
+
lockedMultiSelections?: {
|
|
79
|
+
[groupId: string]: true;
|
|
80
|
+
} | undefined;
|
|
75
81
|
};
|
|
76
82
|
export declare const clearAppStateForDatabase: (appState: Partial<AppState>) => {
|
|
77
83
|
viewBackgroundColor?: string | undefined;
|
|
78
84
|
gridSize?: number | undefined;
|
|
79
85
|
gridStep?: number | undefined;
|
|
80
86
|
gridModeEnabled?: boolean | undefined;
|
|
87
|
+
lockedMultiSelections?: {
|
|
88
|
+
[groupId: string]: true;
|
|
89
|
+
} | undefined;
|
|
81
90
|
};
|
|
82
91
|
export declare const isEraserActive: ({ activeTool, }: {
|
|
83
92
|
activeTool: AppState["activeTool"];
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type EXPORT_IMAGE_TYPES, Emitter } from "@excalidraw/common";
|
|
3
|
-
import { LinearElementEditor } from "@excalidraw/element";
|
|
4
|
-
import {
|
|
5
|
-
import { Scene } from "@excalidraw/element";
|
|
6
|
-
import { Store } from "@excalidraw/element";
|
|
7
|
-
import type { ElementUpdate } from "@excalidraw/element";
|
|
8
|
-
import type { ExcalidrawElement, NonDeleted, InitializedExcalidrawImageElement, ExcalidrawImageElement, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered } from "@excalidraw/element/types";
|
|
3
|
+
import { LinearElementEditor, FlowChartCreator, Scene, Store, type ElementUpdate } from "@excalidraw/element";
|
|
4
|
+
import type { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered } from "@excalidraw/element/types";
|
|
9
5
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
10
6
|
import { ActionManager } from "../actions/manager";
|
|
11
7
|
import { AnimationFrameHandler } from "../animation-frame-handler";
|
|
@@ -415,12 +411,9 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
415
411
|
private onKeyDown;
|
|
416
412
|
private onKeyUp;
|
|
417
413
|
private isToolSupported;
|
|
418
|
-
setActiveTool: (tool: (
|
|
419
|
-
type:
|
|
414
|
+
setActiveTool: (tool: ({
|
|
415
|
+
type: ToolType;
|
|
420
416
|
} | {
|
|
421
|
-
type: Extract<ToolType, "image">;
|
|
422
|
-
insertOnCanvasDirectly?: boolean;
|
|
423
|
-
}) | {
|
|
424
417
|
type: "custom";
|
|
425
418
|
customType: string;
|
|
426
419
|
}) & {
|
|
@@ -446,7 +439,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
446
439
|
private getTextElementAtPosition;
|
|
447
440
|
private getElementAtPosition;
|
|
448
441
|
private getElementsAtPosition;
|
|
449
|
-
getElementHitThreshold(): number;
|
|
442
|
+
getElementHitThreshold(element: ExcalidrawElement): number;
|
|
450
443
|
private hitElement;
|
|
451
444
|
private getTextBindableContainerAtPosition;
|
|
452
445
|
private startTextEditing;
|
|
@@ -509,13 +502,18 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
509
502
|
private restoreReadyToEraseElements;
|
|
510
503
|
private eraseElements;
|
|
511
504
|
private initializeImage;
|
|
505
|
+
/**
|
|
506
|
+
* use during async image initialization,
|
|
507
|
+
* when the placeholder image could have been modified in the meantime,
|
|
508
|
+
* and when you don't want to loose those modifications
|
|
509
|
+
*/
|
|
510
|
+
private getLatestInitializedImageElement;
|
|
512
511
|
/**
|
|
513
512
|
* inserts image into elements array and rerenders
|
|
514
513
|
*/
|
|
515
|
-
insertImageElement
|
|
516
|
-
private setImagePreviewCursor;
|
|
514
|
+
private insertImageElement;
|
|
517
515
|
private onImageAction;
|
|
518
|
-
|
|
516
|
+
private getImageNaturalDimensions;
|
|
519
517
|
/** updates image cache, refreshing updated elements and/or setting status
|
|
520
518
|
to error for images that fail during <img> element creation */
|
|
521
519
|
private updateImageCache;
|
|
@@ -526,7 +524,6 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
526
524
|
private scheduleImageRefresh;
|
|
527
525
|
private updateBindingEnabledOnPointerMove;
|
|
528
526
|
private maybeSuggestBindingAtCursor;
|
|
529
|
-
private maybeSuggestBindingsForLinearElementAtCoords;
|
|
530
527
|
private clearSelection;
|
|
531
528
|
private handleInteractiveCanvasRef;
|
|
532
529
|
private handleAppOnDrop;
|
|
@@ -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 {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
3
|
import type { Scene } from "@excalidraw/element";
|
|
4
|
+
import { useApp, useExcalidrawSetAppState } from "../App";
|
|
4
5
|
import "./DragInput.scss";
|
|
5
6
|
import type { StatsInputProperty } from "./utils";
|
|
6
7
|
import type { AppState } from "../../types";
|
|
@@ -16,6 +17,14 @@ export type DragInputCallbackType<P extends StatsInputProperty, E = ExcalidrawEl
|
|
|
16
17
|
property: P;
|
|
17
18
|
originalAppState: AppState;
|
|
18
19
|
setInputValue: (value: number) => void;
|
|
20
|
+
app: ReturnType<typeof useApp>;
|
|
21
|
+
setAppState: ReturnType<typeof useExcalidrawSetAppState>;
|
|
22
|
+
}) => void;
|
|
23
|
+
export type DragFinishedCallbackType<E = ExcalidrawElement> = (props: {
|
|
24
|
+
app: ReturnType<typeof useApp>;
|
|
25
|
+
setAppState: ReturnType<typeof useExcalidrawSetAppState>;
|
|
26
|
+
originalElements: readonly E[] | null;
|
|
27
|
+
originalAppState: AppState;
|
|
19
28
|
}) => void;
|
|
20
29
|
interface StatsDragInputProps<T extends StatsInputProperty, E = ExcalidrawElement> {
|
|
21
30
|
label: string | React.ReactNode;
|
|
@@ -30,6 +39,7 @@ interface StatsDragInputProps<T extends StatsInputProperty, E = ExcalidrawElemen
|
|
|
30
39
|
appState: AppState;
|
|
31
40
|
/** how many px you need to drag to get 1 unit change */
|
|
32
41
|
sensitivity?: number;
|
|
42
|
+
dragFinishedCallback?: DragFinishedCallbackType;
|
|
33
43
|
}
|
|
34
|
-
declare const StatsDragInput: <T extends StatsInputProperty, E extends ExcalidrawElement = ExcalidrawElement>({ label, icon, dragInputCallback, value, elements, editable, shouldKeepAspectRatio, property, scene, appState, sensitivity, }: StatsDragInputProps<T, E>) => import("react/jsx-runtime").JSX.Element | null;
|
|
44
|
+
declare const StatsDragInput: <T extends StatsInputProperty, E extends ExcalidrawElement = ExcalidrawElement>({ label, icon, dragInputCallback, value, elements, editable, shouldKeepAspectRatio, property, scene, appState, sensitivity, dragFinishedCallback, }: StatsDragInputProps<T, E>) => import("react/jsx-runtime").JSX.Element | null;
|
|
35
45
|
export default StatsDragInput;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./UnlockPopup.scss";
|
|
2
|
+
import type App from "./App";
|
|
3
|
+
import type { AppState } from "../types";
|
|
4
|
+
declare const UnlockPopup: ({ app, activeLockedId, }: {
|
|
5
|
+
app: App;
|
|
6
|
+
activeLockedId: NonNullable<AppState["activeLockedId"]>;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export default UnlockPopup;
|