@excalidraw/math 0.18.0-143b5b6 → 0.18.0-17d8904
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/types/element/src/bounds.d.ts +3 -1
- package/dist/types/element/src/cropElement.d.ts +36 -4
- package/dist/types/element/src/groups.d.ts +1 -6
- package/dist/types/element/src/resizeElements.d.ts +8 -1
- package/dist/types/element/src/selection.d.ts +1 -7
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +46 -221
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +4 -588
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionExport.d.ts +7 -7
- package/dist/types/excalidraw/actions/actionFrame.d.ts +41 -525
- package/dist/types/excalidraw/actions/actionGroup.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleWrap.d.ts +12 -0
- package/dist/types/excalidraw/actions/index.d.ts +1 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +7 -7
- package/dist/types/excalidraw/components/App.d.ts +13 -7
- package/dist/types/excalidraw/components/App.selection.d.ts +265 -0
- package/dist/types/excalidraw/components/App.selectionTool.d.ts +42 -6
- package/dist/types/excalidraw/components/App.wrap.d.ts +31 -0
- package/dist/types/excalidraw/data/blob.d.ts +14 -14
- package/dist/types/excalidraw/data/index.d.ts +1 -3
- package/dist/types/excalidraw/data/json.d.ts +7 -7
- package/dist/types/excalidraw/scene/export.d.ts +308 -20
- package/dist/types/excalidraw/scene/types.d.ts +3 -1
- package/dist/types/excalidraw/types.d.ts +20 -0
- package/dist/types/utils/src/index.d.ts +2 -1
- package/package.json +2 -2
- package/dist/types/utils/src/export.d.ts +0 -36
|
@@ -81,7 +81,7 @@ export declare const boundsContainBounds: (outerBounds: Bounds, innerBounds: Bou
|
|
|
81
81
|
* It can be used to get elements overlapping a selection box, for example.
|
|
82
82
|
*
|
|
83
83
|
*/
|
|
84
|
-
export declare const elementsOverlappingBBox: <T extends ExcalidrawElement>({ elements, elementsMap, bounds, type, excludeElementsInFrames, shouldIgnoreElementFromSelection, }: {
|
|
84
|
+
export declare const elementsOverlappingBBox: <T extends ExcalidrawElement>({ elements, elementsMap, bounds, type, excludeElementsInFrames, shouldIgnoreElementFromSelection, includeStroke, }: {
|
|
85
85
|
elements: readonly T[];
|
|
86
86
|
elementsMap?: ElementsMap;
|
|
87
87
|
bounds: Bounds | ExcalidrawElement;
|
|
@@ -92,5 +92,7 @@ export declare const elementsOverlappingBBox: <T extends ExcalidrawElement>({ el
|
|
|
92
92
|
type: "contain" | "overlap";
|
|
93
93
|
excludeElementsInFrames?: boolean;
|
|
94
94
|
shouldIgnoreElementFromSelection?: (element: T) => boolean;
|
|
95
|
+
/** whether elements extend by their stroke, as they render */
|
|
96
|
+
includeStroke?: boolean;
|
|
95
97
|
}) => T[];
|
|
96
98
|
export declare const elementCenterPoint: (element: ExcalidrawElement, elementsMap: ElementsMap, xOffset?: number, yOffset?: number) => GlobalPoint;
|
|
@@ -1,13 +1,45 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ElementsMap, ExcalidrawImageElement
|
|
1
|
+
import type { TransformHandleDirection } from "./transformHandles";
|
|
2
|
+
import type { ElementsMap, ExcalidrawImageElement } from "./types";
|
|
3
3
|
export declare const MINIMAL_CROP_SIZE = 10;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Crops the image (as it was at the drag's start) as resizing it would
|
|
6
|
+
* resize it, as far as the image reaches.
|
|
7
|
+
*/
|
|
8
|
+
export declare const cropElement: (element: ExcalidrawImageElement, elementsMap: ElementsMap, transformHandle: TransformHandleDirection, naturalWidth: number, naturalHeight: number, pointerX: number, pointerY: number, { shouldMaintainAspectRatio, shouldResizeFromCenter, }?: {
|
|
9
|
+
shouldMaintainAspectRatio?: boolean;
|
|
10
|
+
shouldResizeFromCenter?: boolean;
|
|
11
|
+
}) => {
|
|
5
12
|
x: number;
|
|
6
13
|
y: number;
|
|
7
14
|
width: number;
|
|
8
15
|
height: number;
|
|
9
|
-
crop:
|
|
16
|
+
crop: {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
naturalWidth: number;
|
|
22
|
+
naturalHeight: number;
|
|
23
|
+
} | null;
|
|
10
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Uncrops the image on the handle's side (a corner's two); mirrored, on the
|
|
27
|
+
* opposite side(s) too.
|
|
28
|
+
*/
|
|
29
|
+
export declare const uncropElementSides: (element: ExcalidrawImageElement, elementsMap: ElementsMap, handle: TransformHandleDirection, mirrored?: boolean) => {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
crop: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
naturalWidth: number;
|
|
40
|
+
naturalHeight: number;
|
|
41
|
+
} | null;
|
|
42
|
+
} | null;
|
|
11
43
|
export declare const getUncroppedImageElement: (element: ExcalidrawImageElement, elementsMap: ElementsMap) => ExcalidrawImageElement;
|
|
12
44
|
export declare const getUncroppedWidthAndHeight: (element: ExcalidrawImageElement) => {
|
|
13
45
|
width: number;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
1
|
+
import type { AppState, InteractiveCanvasAppState } from "@excalidraw/excalidraw/types";
|
|
3
2
|
import type { GroupId, ExcalidrawElement, NonDeleted, ElementsMapOrArray, ElementsMap, NonDeletedExcalidrawElement, NonDeletedElementsMapOrArray } from "./types";
|
|
4
3
|
export declare const selectGroup: (groupId: GroupId, appState: InteractiveCanvasAppState, elements: readonly NonDeletedExcalidrawElement[]) => Pick<InteractiveCanvasAppState, "selectedGroupIds" | "selectedElementIds" | "editingGroupId">;
|
|
5
|
-
export declare const selectGroupsForSelectedElements: {
|
|
6
|
-
(appState: Pick<AppState, "selectedElementIds" | "editingGroupId">, elements: readonly NonDeletedExcalidrawElement[], prevAppState: InteractiveCanvasAppState, app: AppClassProperties | null): Mutable<Pick<InteractiveCanvasAppState, "selectedGroupIds" | "editingGroupId" | "selectedElementIds">>;
|
|
7
|
-
clearCache(): void;
|
|
8
|
-
};
|
|
9
4
|
/**
|
|
10
5
|
* If the element's group is selected, don't render an individual
|
|
11
6
|
* selection border around it.
|
|
@@ -3,7 +3,7 @@ import type { PointerDownState } from "@excalidraw/excalidraw/types";
|
|
|
3
3
|
import type { Scene } from "./Scene";
|
|
4
4
|
import type { BoundingBox } from "./bounds";
|
|
5
5
|
import type { MaybeTransformHandleType, TransformHandleDirection } from "./transformHandles";
|
|
6
|
-
import type { ExcalidrawLinearElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, NonDeleted, ElementsMap } from "./types";
|
|
6
|
+
import type { ExcalidrawLinearElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawElement, ElementsMap } from "./types";
|
|
7
7
|
export declare const transformElements: (originalElements: PointerDownState["originalElements"], transformHandleType: MaybeTransformHandleType, selectedElements: readonly NonDeletedExcalidrawElement[], scene: Scene, shouldRotateWithDiscreteAngle: boolean, shouldResizeFromCenter: boolean, shouldMaintainAspectRatio: boolean, pointerX: number, pointerY: number, centerX: number, centerY: number) => boolean;
|
|
8
8
|
export declare const rescalePointsInElement: (element: NonDeletedExcalidrawElement, width: number, height: number, normalizePoints: boolean) => {
|
|
9
9
|
points: LocalPoint[];
|
|
@@ -21,6 +21,13 @@ export declare const resizeSingleElement: (nextWidth: number, nextHeight: number
|
|
|
21
21
|
shouldResizeFromCenter?: boolean;
|
|
22
22
|
shouldInformMutation?: boolean;
|
|
23
23
|
}) => void;
|
|
24
|
+
export declare const getNextSingleWidthAndHeightFromPointer: (latestElement: ExcalidrawElement, origElement: ExcalidrawElement, handleDirection: TransformHandleDirection, pointerX: number, pointerY: number, { shouldMaintainAspectRatio, shouldResizeFromCenter, }?: {
|
|
25
|
+
shouldMaintainAspectRatio?: boolean;
|
|
26
|
+
shouldResizeFromCenter?: boolean;
|
|
27
|
+
}) => {
|
|
28
|
+
nextWidth: number;
|
|
29
|
+
nextHeight: number;
|
|
30
|
+
};
|
|
24
31
|
export declare const resizeMultipleElements: (selectedElements: readonly NonDeletedExcalidrawElement[], elementsMap: ElementsMap, handleDirection: TransformHandleDirection, scene: Scene, originalElementsMap: ElementsMap, { shouldMaintainAspectRatio, shouldResizeFromCenter, flipByX, flipByY, nextHeight, nextWidth, originalBoundingBox, }?: {
|
|
25
32
|
nextWidth?: number;
|
|
26
33
|
nextHeight?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AppState, BoxSelectionMode, InteractiveCanvasAppState } from "@excalidraw/excalidraw/types";
|
|
2
|
-
import { LinearElementEditor } from "./linearElementEditor";
|
|
3
2
|
import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement } from "./types";
|
|
3
|
+
export declare const shouldIgnoreElementFromSelection: (element: ExcalidrawElement) => boolean;
|
|
4
4
|
/**
|
|
5
5
|
* Frames and their containing elements are not to be selected at the same time.
|
|
6
6
|
* Given an array of selected elements, if there are frames and their containing elements
|
|
@@ -26,12 +26,6 @@ export declare const getTargetElements: (elements: ElementsMapOrArray, appState:
|
|
|
26
26
|
export declare const makeNextSelectedElementIds: (nextSelectedElementIds: AppState["selectedElementIds"], prevState: Pick<AppState, "selectedElementIds">) => Readonly<{
|
|
27
27
|
[id: string]: true;
|
|
28
28
|
}>;
|
|
29
|
-
export declare const getSelectionStateForElements: (targetElements: readonly NonDeletedExcalidrawElement[], allElements: readonly NonDeletedExcalidrawElement[], appState: AppState) => {
|
|
30
|
-
editingGroupId: AppState["editingGroupId"];
|
|
31
|
-
selectedElementIds: AppState["selectedElementIds"];
|
|
32
|
-
selectedGroupIds: AppState["selectedGroupIds"];
|
|
33
|
-
selectedLinearElement: LinearElementEditor | null;
|
|
34
|
-
};
|
|
35
29
|
/**
|
|
36
30
|
* Returns editing or single-selected text element, if any.
|
|
37
31
|
*/
|
|
@@ -1,34 +1,26 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { Scene } from "@excalidraw/element";
|
|
2
|
+
import type { ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, NonDeleted, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
import type { ActionResult } from "./types";
|
|
4
|
+
import type { AppClassProperties, AppState } from "../types";
|
|
5
|
+
/**
|
|
6
|
+
* Frees the container's text as it rendered: wrapped the same, at a fixed
|
|
7
|
+
* width.
|
|
8
|
+
*/
|
|
9
|
+
export declare const unbindTextFromContainer: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer, scene: Scene) => void;
|
|
4
10
|
export declare const actionUnbindText: {
|
|
5
11
|
name: "unbindText";
|
|
6
12
|
label: string;
|
|
7
13
|
trackEvent: {
|
|
8
14
|
category: "element";
|
|
9
15
|
};
|
|
10
|
-
predicate: (elements: readonly ExcalidrawElement[], appState: AppState, _: import("../types").ExcalidrawProps, app:
|
|
11
|
-
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app:
|
|
16
|
+
predicate: (elements: readonly ExcalidrawElement[], appState: AppState, _: import("../types").ExcalidrawProps, app: AppClassProperties) => boolean;
|
|
17
|
+
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: AppClassProperties) => {
|
|
12
18
|
elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
13
|
-
appState: Readonly<AppState>;
|
|
14
|
-
captureUpdate: "IMMEDIATELY";
|
|
15
|
-
};
|
|
16
|
-
} & {
|
|
17
|
-
keyTest?: undefined;
|
|
18
|
-
};
|
|
19
|
-
export declare const actionBindText: {
|
|
20
|
-
name: "bindText";
|
|
21
|
-
label: string;
|
|
22
|
-
trackEvent: {
|
|
23
|
-
category: "element";
|
|
24
|
-
};
|
|
25
|
-
predicate: (elements: readonly ExcalidrawElement[], appState: AppState, _: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
|
|
26
|
-
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: import("../types").AppClassProperties) => {
|
|
27
|
-
elements: ExcalidrawElement[];
|
|
28
19
|
appState: {
|
|
29
|
-
selectedElementIds:
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
selectedElementIds: AppState["selectedElementIds"];
|
|
21
|
+
editingGroupId: AppState["editingGroupId"];
|
|
22
|
+
selectedGroupIds: AppState["selectedGroupIds"];
|
|
23
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
32
24
|
contextMenu: {
|
|
33
25
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
34
26
|
top: number;
|
|
@@ -38,13 +30,13 @@ export declare const actionBindText: {
|
|
|
38
30
|
isLoading: boolean;
|
|
39
31
|
errorMessage: React.ReactNode;
|
|
40
32
|
activeEmbeddable: {
|
|
41
|
-
element:
|
|
33
|
+
element: NonDeletedExcalidrawElement;
|
|
42
34
|
state: "hover" | "active";
|
|
43
35
|
} | null;
|
|
44
|
-
newElement:
|
|
45
|
-
resizingElement:
|
|
46
|
-
multiElement:
|
|
47
|
-
selectionElement:
|
|
36
|
+
newElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
37
|
+
resizingElement: NonDeletedExcalidrawElement | null;
|
|
38
|
+
multiElement: NonDeleted<ExcalidrawLinearElement> | null;
|
|
39
|
+
selectionElement: NonDeletedExcalidrawElement | null;
|
|
48
40
|
isBindingEnabled: boolean;
|
|
49
41
|
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
50
42
|
bindingPreference: "enabled" | "disabled";
|
|
@@ -52,7 +44,7 @@ export declare const actionBindText: {
|
|
|
52
44
|
showHints: boolean;
|
|
53
45
|
inputDevice: import("../types").InputDevice;
|
|
54
46
|
suggestedBinding: {
|
|
55
|
-
element:
|
|
47
|
+
element: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
56
48
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
57
49
|
} | null;
|
|
58
50
|
textToolHover: {
|
|
@@ -66,7 +58,7 @@ export declare const actionBindText: {
|
|
|
66
58
|
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
67
59
|
anchor: "start" | "end" | "label";
|
|
68
60
|
} | null;
|
|
69
|
-
frameToHighlight:
|
|
61
|
+
frameToHighlight: NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
70
62
|
frameRendering: {
|
|
71
63
|
enabled: boolean;
|
|
72
64
|
name: boolean;
|
|
@@ -74,7 +66,7 @@ export declare const actionBindText: {
|
|
|
74
66
|
clip: boolean;
|
|
75
67
|
};
|
|
76
68
|
editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
|
|
77
|
-
elementsToHighlight: readonly
|
|
69
|
+
elementsToHighlight: readonly NonDeletedExcalidrawElement[] | null;
|
|
78
70
|
editingTextElement: ExcalidrawTextElement | null;
|
|
79
71
|
activeTool: {
|
|
80
72
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
@@ -163,10 +155,6 @@ export declare const actionBindText: {
|
|
|
163
155
|
gridStep: number;
|
|
164
156
|
gridModeEnabled: boolean;
|
|
165
157
|
viewModeEnabled: boolean;
|
|
166
|
-
selectedGroupIds: {
|
|
167
|
-
[groupId: string]: boolean;
|
|
168
|
-
};
|
|
169
|
-
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
170
158
|
width: number;
|
|
171
159
|
height: number;
|
|
172
160
|
offsetTop: number;
|
|
@@ -178,7 +166,6 @@ export declare const actionBindText: {
|
|
|
178
166
|
panels: number;
|
|
179
167
|
};
|
|
180
168
|
showHyperlinkPopup: false | "info" | "editor";
|
|
181
|
-
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
182
169
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
183
170
|
originSnapOffset: {
|
|
184
171
|
x: number;
|
|
@@ -210,197 +197,35 @@ export declare const actionBindText: {
|
|
|
210
197
|
} & {
|
|
211
198
|
keyTest?: undefined;
|
|
212
199
|
};
|
|
200
|
+
export declare const actionBindText: {
|
|
201
|
+
name: "bindText";
|
|
202
|
+
label: string;
|
|
203
|
+
trackEvent: {
|
|
204
|
+
category: "element";
|
|
205
|
+
};
|
|
206
|
+
predicate: (elements: readonly ExcalidrawElement[], appState: AppState, _: import("../types").ExcalidrawProps, app: AppClassProperties) => boolean;
|
|
207
|
+
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: AppClassProperties) => ActionResult;
|
|
208
|
+
} & {
|
|
209
|
+
keyTest?: undefined;
|
|
210
|
+
};
|
|
211
|
+
/**
|
|
212
|
+
* A note and its label share one ink: the text the user styled wins, unless it
|
|
213
|
+
* is transparent (a note's label never is).
|
|
214
|
+
*/
|
|
215
|
+
export declare const getStickyNoteInk: (textElement: ExcalidrawTextElement, container: ExcalidrawElement) => string | null;
|
|
216
|
+
/** binds the text to the (label-less) container, selecting the container */
|
|
217
|
+
export declare const bindTextToContainer: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, textElement: ExcalidrawTextElement, container: NonDeleted<ExcalidrawTextContainer>, app: AppClassProperties) => ActionResult;
|
|
218
|
+
export declare const pushContainerBelowText: (elements: readonly ExcalidrawElement[], container: ExcalidrawElement, textElement: ExcalidrawTextElement) => ExcalidrawElement[];
|
|
213
219
|
export declare const actionWrapTextInContainer: {
|
|
214
220
|
name: "wrapTextInContainer";
|
|
215
221
|
label: string;
|
|
216
222
|
trackEvent: {
|
|
217
223
|
category: "element";
|
|
218
224
|
};
|
|
219
|
-
predicate: (elements: readonly ExcalidrawElement[], appState: AppState, _: import("../types").ExcalidrawProps, app:
|
|
220
|
-
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app:
|
|
221
|
-
elements: readonly ExcalidrawElement[];
|
|
222
|
-
appState: {
|
|
223
|
-
selectedElementIds: Mutable<Readonly<{
|
|
224
|
-
[id: string]: true;
|
|
225
|
-
}>>;
|
|
226
|
-
contextMenu: {
|
|
227
|
-
items: import("../components/ContextMenu").ContextMenuItems;
|
|
228
|
-
top: number;
|
|
229
|
-
left: number;
|
|
230
|
-
} | null;
|
|
231
|
-
showWelcomeScreen: boolean;
|
|
232
|
-
isLoading: boolean;
|
|
233
|
-
errorMessage: React.ReactNode;
|
|
234
|
-
activeEmbeddable: {
|
|
235
|
-
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
236
|
-
state: "hover" | "active";
|
|
237
|
-
} | null;
|
|
238
|
-
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
239
|
-
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
240
|
-
multiElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
241
|
-
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
242
|
-
isBindingEnabled: boolean;
|
|
243
|
-
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
244
|
-
bindingPreference: "enabled" | "disabled";
|
|
245
|
-
isMidpointSnappingEnabled: boolean;
|
|
246
|
-
showHints: boolean;
|
|
247
|
-
inputDevice: import("../types").InputDevice;
|
|
248
|
-
suggestedBinding: {
|
|
249
|
-
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
250
|
-
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
251
|
-
} | null;
|
|
252
|
-
textToolHover: {
|
|
253
|
-
type: "text";
|
|
254
|
-
elementId: ExcalidrawElement["id"];
|
|
255
|
-
} | {
|
|
256
|
-
type: "container";
|
|
257
|
-
elementId: ExcalidrawElement["id"];
|
|
258
|
-
} | {
|
|
259
|
-
type: "arrow";
|
|
260
|
-
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
261
|
-
anchor: "start" | "end" | "label";
|
|
262
|
-
} | null;
|
|
263
|
-
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
264
|
-
frameRendering: {
|
|
265
|
-
enabled: boolean;
|
|
266
|
-
name: boolean;
|
|
267
|
-
outline: boolean;
|
|
268
|
-
clip: boolean;
|
|
269
|
-
};
|
|
270
|
-
editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
|
|
271
|
-
elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
|
|
272
|
-
editingTextElement: ExcalidrawTextElement | null;
|
|
273
|
-
activeTool: {
|
|
274
|
-
lastActiveTool: import("../types").ActiveTool | null;
|
|
275
|
-
locked: boolean;
|
|
276
|
-
fromSelection: boolean;
|
|
277
|
-
} & import("../types").ActiveTool;
|
|
278
|
-
preferredSelectionTool: {
|
|
279
|
-
type: "selection" | "lasso";
|
|
280
|
-
initialized: boolean;
|
|
281
|
-
};
|
|
282
|
-
penMode: boolean;
|
|
283
|
-
penDetected: boolean;
|
|
284
|
-
exportBackground: boolean;
|
|
285
|
-
exportEmbedScene: boolean;
|
|
286
|
-
exportWithDarkMode: boolean;
|
|
287
|
-
exportScale: number;
|
|
288
|
-
currentItemStrokeColor: string;
|
|
289
|
-
currentItemStickynoteStrokeColor: string;
|
|
290
|
-
currentItemStickynoteBackgroundColor: string;
|
|
291
|
-
currentItemBackgroundColor: string;
|
|
292
|
-
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
293
|
-
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
294
|
-
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
295
|
-
currentItemRoughness: number;
|
|
296
|
-
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
297
|
-
currentItemOpacity: number;
|
|
298
|
-
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
299
|
-
currentItemFontSize: number;
|
|
300
|
-
currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
|
|
301
|
-
currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
302
|
-
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
303
|
-
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
304
|
-
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
305
|
-
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
306
|
-
viewBackgroundColor: string;
|
|
307
|
-
scrollX: number;
|
|
308
|
-
scrollY: number;
|
|
309
|
-
scrollConstraints: import("../types").ScrollConstraints | null;
|
|
310
|
-
cursorButton: "up" | "down";
|
|
311
|
-
scrolledOutside: boolean;
|
|
312
|
-
name: string | null;
|
|
313
|
-
isResizing: boolean;
|
|
314
|
-
isRotating: boolean;
|
|
315
|
-
zoom: import("../types").Zoom;
|
|
316
|
-
openMenu: "canvas" | null;
|
|
317
|
-
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
318
|
-
openSidebar: {
|
|
319
|
-
name: import("../types").SidebarName;
|
|
320
|
-
tab?: import("../types").SidebarTabName;
|
|
321
|
-
} | null;
|
|
322
|
-
openDialog: null | {
|
|
323
|
-
name: "imageExport" | "help" | "jsonExport";
|
|
324
|
-
} | {
|
|
325
|
-
name: "ttd";
|
|
326
|
-
tab: "text-to-diagram" | "mermaid";
|
|
327
|
-
} | {
|
|
328
|
-
name: "commandPalette";
|
|
329
|
-
} | {
|
|
330
|
-
name: "settings";
|
|
331
|
-
} | {
|
|
332
|
-
name: "elementLinkSelector";
|
|
333
|
-
sourceElementId: ExcalidrawElement["id"];
|
|
334
|
-
} | {
|
|
335
|
-
name: "charts";
|
|
336
|
-
data: import("../charts").Spreadsheet;
|
|
337
|
-
rawText: string;
|
|
338
|
-
};
|
|
339
|
-
defaultSidebarDockedPreference: boolean;
|
|
340
|
-
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
341
|
-
hoveredElementIds: Readonly<{
|
|
342
|
-
[id: string]: true;
|
|
343
|
-
}>;
|
|
344
|
-
previousSelectedElementIds: {
|
|
345
|
-
[id: string]: true;
|
|
346
|
-
};
|
|
347
|
-
selectedElementsAreBeingDragged: boolean;
|
|
348
|
-
shouldCacheIgnoreZoom: boolean;
|
|
349
|
-
toast: {
|
|
350
|
-
message: React.ReactNode;
|
|
351
|
-
closable?: boolean;
|
|
352
|
-
duration?: number;
|
|
353
|
-
} | null;
|
|
354
|
-
zenModeEnabled: boolean;
|
|
355
|
-
theme: import("@excalidraw/element/types").Theme;
|
|
356
|
-
gridSize: number;
|
|
357
|
-
gridStep: number;
|
|
358
|
-
gridModeEnabled: boolean;
|
|
359
|
-
viewModeEnabled: boolean;
|
|
360
|
-
selectedGroupIds: {
|
|
361
|
-
[groupId: string]: boolean;
|
|
362
|
-
};
|
|
363
|
-
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
364
|
-
width: number;
|
|
365
|
-
height: number;
|
|
366
|
-
offsetTop: number;
|
|
367
|
-
offsetLeft: number;
|
|
368
|
-
fileHandle: FileSystemFileHandle | null;
|
|
369
|
-
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
370
|
-
stats: {
|
|
371
|
-
open: boolean;
|
|
372
|
-
panels: number;
|
|
373
|
-
};
|
|
374
|
-
showHyperlinkPopup: false | "info" | "editor";
|
|
375
|
-
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
376
|
-
snapLines: readonly import("../snapping").SnapLine[];
|
|
377
|
-
originSnapOffset: {
|
|
378
|
-
x: number;
|
|
379
|
-
y: number;
|
|
380
|
-
} | null;
|
|
381
|
-
objectsSnapModeEnabled: boolean;
|
|
382
|
-
isCropping: boolean;
|
|
383
|
-
croppingElementId: ExcalidrawElement["id"] | null;
|
|
384
|
-
searchMatches: Readonly<{
|
|
385
|
-
focusedId: ExcalidrawElement["id"] | null;
|
|
386
|
-
matches: readonly import("../types").SearchMatch[];
|
|
387
|
-
}> | null;
|
|
388
|
-
activeLockedId: string | null;
|
|
389
|
-
lockedMultiSelections: {
|
|
390
|
-
[groupId: string]: true;
|
|
391
|
-
};
|
|
392
|
-
bindMode: import("@excalidraw/element/types").BindMode;
|
|
393
|
-
colorTopPicks: {
|
|
394
|
-
elementStroke: readonly string[] | null;
|
|
395
|
-
elementBackground: readonly string[] | null;
|
|
396
|
-
bucketFill: readonly string[] | null;
|
|
397
|
-
stickyNoteStroke: readonly string[] | null;
|
|
398
|
-
stickyNoteBackground: readonly string[] | null;
|
|
399
|
-
};
|
|
400
|
-
fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
|
|
401
|
-
};
|
|
402
|
-
captureUpdate: "IMMEDIATELY";
|
|
403
|
-
};
|
|
225
|
+
predicate: (elements: readonly ExcalidrawElement[], appState: AppState, _: import("../types").ExcalidrawProps, app: AppClassProperties) => boolean;
|
|
226
|
+
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: AppClassProperties) => ActionResult;
|
|
404
227
|
} & {
|
|
405
228
|
keyTest?: undefined;
|
|
406
229
|
};
|
|
230
|
+
/** wraps each (unbound) text in a new container, selecting the containers */
|
|
231
|
+
export declare const wrapTextsInContainers: (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, textElements: readonly ExcalidrawTextElement[], app: AppClassProperties) => ActionResult;
|
|
@@ -48,6 +48,11 @@ export declare const actionClearCanvas: {
|
|
|
48
48
|
};
|
|
49
49
|
name: string | null;
|
|
50
50
|
zoom: import("../types").Zoom;
|
|
51
|
+
isBindingEnabled: boolean;
|
|
52
|
+
isMidpointSnappingEnabled: boolean;
|
|
53
|
+
selectedElementIds: Readonly<{
|
|
54
|
+
[id: string]: true;
|
|
55
|
+
}>;
|
|
51
56
|
scrollX: number;
|
|
52
57
|
scrollY: number;
|
|
53
58
|
viewModeEnabled: boolean;
|
|
@@ -69,9 +74,6 @@ export declare const actionClearCanvas: {
|
|
|
69
74
|
rawText: string;
|
|
70
75
|
};
|
|
71
76
|
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
72
|
-
selectedElementIds: Readonly<{
|
|
73
|
-
[id: string]: true;
|
|
74
|
-
}>;
|
|
75
77
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
76
78
|
activeEmbeddable: {
|
|
77
79
|
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
@@ -84,8 +86,6 @@ export declare const actionClearCanvas: {
|
|
|
84
86
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
85
87
|
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
86
88
|
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
87
|
-
isBindingEnabled: boolean;
|
|
88
|
-
isMidpointSnappingEnabled: boolean;
|
|
89
89
|
suggestedBinding: {
|
|
90
90
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
91
91
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
@@ -120,7 +120,6 @@ export declare const actionClearCanvas: {
|
|
|
120
120
|
shouldCacheIgnoreZoom: boolean;
|
|
121
121
|
exportScale: number;
|
|
122
122
|
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
123
|
-
bindMode: import("@excalidraw/element/types").BindMode;
|
|
124
123
|
contextMenu: {
|
|
125
124
|
items: import("../components/ContextMenu").ContextMenuItems;
|
|
126
125
|
top: number;
|
|
@@ -188,6 +187,7 @@ export declare const actionClearCanvas: {
|
|
|
188
187
|
lockedMultiSelections: {
|
|
189
188
|
[groupId: string]: true;
|
|
190
189
|
};
|
|
190
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
191
191
|
};
|
|
192
192
|
captureUpdate: "IMMEDIATELY";
|
|
193
193
|
};
|