@excalidraw/math 0.18.0-1118751 → 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/common/src/constants.d.ts +3 -0
- package/dist/types/common/src/utils.d.ts +5 -0
- package/dist/types/element/src/binding.d.ts +8 -0
- package/dist/types/element/src/bounds.d.ts +3 -1
- package/dist/types/element/src/collision.d.ts +6 -0
- 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/index.d.ts +1 -0
- package/dist/types/element/src/listMarker.d.ts +34 -0
- package/dist/types/element/src/newElement.d.ts +15 -1
- package/dist/types/element/src/resizeElements.d.ts +8 -1
- package/dist/types/element/src/selection.d.ts +1 -7
- package/dist/types/element/src/textElement.d.ts +7 -0
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +27 -3
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +55 -214
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +69 -13
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +18 -2
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +9 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +4 -564
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +13 -2
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +9 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +18 -2
- package/dist/types/excalidraw/actions/actionExport.d.ts +25 -9
- package/dist/types/excalidraw/actions/actionFrame.d.ts +68 -528
- package/dist/types/excalidraw/actions/actionGroup.d.ts +20 -4
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +9 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +9 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +9 -1
- package/dist/types/excalidraw/actions/actionProperties.d.ts +18 -2
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +10 -2
- package/dist/types/excalidraw/actions/actionStyles.d.ts +9 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +9 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +9 -1
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +9 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +9 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +9 -1
- package/dist/types/excalidraw/actions/actionToggleShowHints.d.ts +197 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +9 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +9 -1
- package/dist/types/excalidraw/actions/actionToggleWrap.d.ts +12 -0
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +9 -1
- package/dist/types/excalidraw/actions/index.d.ts +2 -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 +8 -7
- package/dist/types/excalidraw/components/App.arrowText.d.ts +5 -39
- package/dist/types/excalidraw/components/App.clipboard.d.ts +31 -0
- package/dist/types/excalidraw/components/App.d.ts +70 -264
- package/dist/types/excalidraw/components/App.duplicate.d.ts +52 -2
- package/dist/types/excalidraw/components/App.modifiers.d.ts +38 -0
- package/dist/types/excalidraw/components/App.pan.d.ts +8 -0
- package/dist/types/excalidraw/components/App.selection.d.ts +265 -0
- package/dist/types/excalidraw/components/App.selectionTool.d.ts +93 -0
- package/dist/types/excalidraw/components/App.text.d.ts +146 -0
- package/dist/types/excalidraw/components/App.textTool.d.ts +140 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +41 -1
- package/dist/types/excalidraw/components/App.wrap.d.ts +31 -0
- package/dist/types/excalidraw/components/FileDropOverlay.d.ts +2 -0
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +6 -2
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +7 -2
- package/dist/types/excalidraw/components/Tooltip.d.ts +15 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -0
- package/dist/types/excalidraw/data/blob.d.ts +32 -16
- package/dist/types/excalidraw/data/index.d.ts +1 -3
- package/dist/types/excalidraw/data/json.d.ts +16 -8
- 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 +55 -13
- package/dist/types/excalidraw/viewport.d.ts +22 -1
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +12 -1
- 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
|
@@ -4,6 +4,8 @@ export { DEFAULT_STICKY_NOTE_BG } from "./colors";
|
|
|
4
4
|
export declare const supportsResizeObserver: boolean;
|
|
5
5
|
export declare const APP_NAME = "Excalidraw";
|
|
6
6
|
export declare const TEXT_AUTOWRAP_THRESHOLD = 36;
|
|
7
|
+
export declare const TEXT_VIEWPORT_PADDING = 20;
|
|
8
|
+
export declare const TEXT_MAX_WRAP_WIDTH = 800;
|
|
7
9
|
export declare const DRAGGING_THRESHOLD = 10;
|
|
8
10
|
export declare const MINIMUM_ARROW_SIZE = 20;
|
|
9
11
|
export declare const LINE_CONFIRM_THRESHOLD = 8;
|
|
@@ -272,6 +274,7 @@ export declare const TOUCH_CTX_MENU_TIMEOUT = 500;
|
|
|
272
274
|
export declare const TITLE_TIMEOUT = 10000;
|
|
273
275
|
export declare const VERSION_TIMEOUT = 30000;
|
|
274
276
|
export declare const SCROLL_TIMEOUT = 100;
|
|
277
|
+
export declare const ZEN_MODE_TRANSITION_DURATION = 250;
|
|
275
278
|
export declare const ZOOM_STEP = 0.1;
|
|
276
279
|
export declare const MIN_ZOOM = 0.1;
|
|
277
280
|
export declare const MAX_ZOOM = 30;
|
|
@@ -87,6 +87,11 @@ export declare const getGlobalCSSVariable: (name: string) => string;
|
|
|
87
87
|
* See https://github.com/excalidraw/excalidraw/pull/1722#discussion_r436340171
|
|
88
88
|
*/
|
|
89
89
|
export declare const isRTL: (text: string) => boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Checks whether the text has any RTL character, i.e. whether it may be laid
|
|
92
|
+
* out bidirectionally.
|
|
93
|
+
*/
|
|
94
|
+
export declare const hasRTLChars: (text: string) => boolean;
|
|
90
95
|
export declare const tupleToCoors: (xyTuple: readonly [number, number]) => {
|
|
91
96
|
x: number;
|
|
92
97
|
y: number;
|
|
@@ -58,6 +58,7 @@ export declare const bindBindingElement: (arrow: NonDeleted<ExcalidrawArrowEleme
|
|
|
58
58
|
export declare const unbindBindingElement: (arrow: ExcalidrawArrowElement, startOrEnd: "start" | "end", scene: Scene) => ExcalidrawBindableElement["id"] | null;
|
|
59
59
|
export declare const reanchorBindingsToOutline: (changedElement: NonDeleted<ExcalidrawBindableElement>, scene: Scene, zoom: AppState["zoom"]) => void;
|
|
60
60
|
export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawElement, scene: Scene, options?: {
|
|
61
|
+
/** see `getSimultaneouslyUpdatedElementIds` for how to pass it */
|
|
61
62
|
simultaneouslyUpdated?: readonly NonDeletedExcalidrawElement[];
|
|
62
63
|
changedElements?: Map<string, ExcalidrawElement>;
|
|
63
64
|
}) => void;
|
|
@@ -68,6 +69,13 @@ export declare const updateBindings: (latestElement: NonDeletedExcalidrawElement
|
|
|
68
69
|
height: number;
|
|
69
70
|
};
|
|
70
71
|
}) => void;
|
|
72
|
+
/**
|
|
73
|
+
* The id set of `simultaneouslyUpdated`, shared by every `updateBoundElements()`
|
|
74
|
+
* call given the same array. Pass one array instance for all elements of an
|
|
75
|
+
* operation, and don't change its membership after the first lookup, or the
|
|
76
|
+
* cached ids go stale.
|
|
77
|
+
*/
|
|
78
|
+
export declare const getSimultaneouslyUpdatedElementIds: (simultaneouslyUpdated: readonly ExcalidrawElement[] | undefined) => ReadonlySet<ExcalidrawElement["id"]>;
|
|
71
79
|
export declare const getHeadingForElbowArrowSnap: (p: Readonly<GlobalPoint>, otherPoint: Readonly<GlobalPoint>, bindableElement: ExcalidrawBindableElement | undefined | null, aabb: Bounds | undefined | null, origPoint: GlobalPoint, elementsMap: ElementsMap, zoom?: AppState["zoom"]) => Heading;
|
|
72
80
|
export declare const bindPointToSnapToElementOutline: (arrowElement: ExcalidrawArrowElement, bindableElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, zoom: AppState["zoom"], customIntersector?: LineSegment<GlobalPoint>, isMidpointSnappingEnabled?: boolean) => GlobalPoint;
|
|
73
81
|
export declare const avoidRectangularCorner: (arrowElement: ExcalidrawArrowElement, bindTarget: ExcalidrawBindableElement, elementsMap: ElementsMap, p: GlobalPoint) => GlobalPoint;
|
|
@@ -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;
|
|
@@ -14,6 +14,12 @@ export declare const hitElementItself: ({ point, element, threshold, elementsMap
|
|
|
14
14
|
export declare const hitElementBoundingBox: (point: GlobalPoint, element: ExcalidrawElement, elementsMap: ElementsMap, tolerance?: number) => boolean;
|
|
15
15
|
export declare const hitElementBoundingBoxOnly: (hitArgs: HitTestArgs, elementsMap: ElementsMap) => boolean;
|
|
16
16
|
export declare const hitElementBoundText: (point: GlobalPoint, element: ExcalidrawElement, elementsMap: ElementsMap) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Whether the element hides what is behind it from binding — an arrow's or a
|
|
19
|
+
* text label's. Images count as opaque, and frames once they support a
|
|
20
|
+
* background.
|
|
21
|
+
*/
|
|
22
|
+
export declare const isOpaqueForBinding: (element: ExcalidrawElement) => boolean;
|
|
17
23
|
/**
|
|
18
24
|
* All elements an arrow endpoint at the point could bind to. Always includes
|
|
19
25
|
* the result of `getHoveredElementForBinding` for the same arguments.
|
|
@@ -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.
|
|
@@ -36,6 +36,7 @@ export * from "./groups";
|
|
|
36
36
|
export * from "./heading";
|
|
37
37
|
export * from "./image";
|
|
38
38
|
export * from "./linearElementEditor";
|
|
39
|
+
export * from "./listMarker";
|
|
39
40
|
export * from "./mutateElement";
|
|
40
41
|
export * from "./newElement";
|
|
41
42
|
export * from "./positionElementsOnGrid";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Scene } from "./Scene";
|
|
2
|
+
import type { ExcalidrawElement, ExcalidrawTextElement } from "./types";
|
|
3
|
+
/** a list marker advanced by duplication, to go back and forth */
|
|
4
|
+
export type ListMarkerAdvance = {
|
|
5
|
+
elementId: ExcalidrawTextElement["id"];
|
|
6
|
+
prevOriginalText: string;
|
|
7
|
+
nextOriginalText: string;
|
|
8
|
+
/**
|
|
9
|
+
* where the item's text (after the marker and whitespace) starts in
|
|
10
|
+
* `nextOriginalText` (its length if there's none)
|
|
11
|
+
*/
|
|
12
|
+
contentStart: number;
|
|
13
|
+
/** the label's container before the label (may have) grown it */
|
|
14
|
+
prevContainerSize: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
} | null;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Advances the list markers of the duplicated texts and labels, so that
|
|
21
|
+
* duplicating `1. foo` gives `2. foo` (and `1` gives `2`).
|
|
22
|
+
*
|
|
23
|
+
* Duplicating several list items at once continues the list from the
|
|
24
|
+
* highest of them: duplicating `1.`, `3.`, `5.` gives `6.`, `7.`, `8.` (only
|
|
25
|
+
* if they're just markers, i.e. without text).
|
|
26
|
+
*
|
|
27
|
+
* Only if nothing but list items (texts, or containers with list item labels)
|
|
28
|
+
* is duplicated.
|
|
29
|
+
*/
|
|
30
|
+
export declare const advanceDuplicatedListMarkers: (duplicatedElements: readonly ExcalidrawElement[], scene: Scene) => ListMarkerAdvance[];
|
|
31
|
+
/**
|
|
32
|
+
* Sets the advanced list markers back (`"prev"`), or forth again (`"next"`).
|
|
33
|
+
*/
|
|
34
|
+
export declare const applyListMarkerAdvances: (advances: readonly ListMarkerAdvance[], direction: "prev" | "next", scene: Scene) => void;
|
|
@@ -62,7 +62,21 @@ export declare const newTextElement: (opts: {
|
|
|
62
62
|
labelPosition?: ExcalidrawTextElement["labelPosition"];
|
|
63
63
|
baseFontSize?: ExcalidrawTextElement["baseFontSize"];
|
|
64
64
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawTextElement>;
|
|
65
|
-
export declare const refreshTextDimensions: (textElement: ExcalidrawTextElement, container: ExcalidrawTextContainer | null, elementsMap: ElementsMap, text?: string
|
|
65
|
+
export declare const refreshTextDimensions: (textElement: ExcalidrawTextElement, container: ExcalidrawTextContainer | null, elementsMap: ElementsMap, text?: string,
|
|
66
|
+
/**
|
|
67
|
+
* For a free text that grows with its content (`autoResize`): the widest
|
|
68
|
+
* it may grow to. Crossing it, the text stops growing and wraps at this
|
|
69
|
+
* width from then on (`autoResize: false`), anchored as its growth was. A
|
|
70
|
+
* text that is already wider keeps growing.
|
|
71
|
+
*/
|
|
72
|
+
maxWidth?: number) => {
|
|
73
|
+
x: number;
|
|
74
|
+
y: number;
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
text: string;
|
|
78
|
+
autoResize: boolean;
|
|
79
|
+
} | {
|
|
66
80
|
x: number;
|
|
67
81
|
y: number;
|
|
68
82
|
width: number;
|
|
@@ -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
|
*/
|
|
@@ -29,6 +29,13 @@ export declare const getBoundTextElementPosition: (container: ExcalidrawElement,
|
|
|
29
29
|
x: number;
|
|
30
30
|
y: number;
|
|
31
31
|
} | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the text element with its accurate coords. An arrow label's
|
|
34
|
+
* position is derived from the arrow at render time rather than kept in
|
|
35
|
+
* sync on the element itself (see getBoundTextElementPosition), so
|
|
36
|
+
* consumers reading a label's coords directly must go through this helper.
|
|
37
|
+
*/
|
|
38
|
+
export declare const getTextElementWithAccuratePosition: <T extends ExcalidrawTextElement>(textElement: T, elementsMap: ElementsMap) => T;
|
|
32
39
|
export declare const shouldAllowVerticalAlign: (selectedElements: readonly ExcalidrawElement[], elementsMap: ElementsMap) => boolean;
|
|
33
40
|
export declare const suppportsHorizontalAlign: (selectedElements: readonly ExcalidrawElement[], elementsMap: ElementsMap) => boolean;
|
|
34
41
|
declare const VALID_CONTAINER_TYPES: Set<string>;
|
|
@@ -29,12 +29,20 @@ export declare const actionAddToLibrary: {
|
|
|
29
29
|
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
30
30
|
bindingPreference: "enabled" | "disabled";
|
|
31
31
|
isMidpointSnappingEnabled: boolean;
|
|
32
|
+
showHints: boolean;
|
|
32
33
|
inputDevice: import("../types").InputDevice;
|
|
33
34
|
suggestedBinding: {
|
|
34
35
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
35
36
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
36
37
|
} | null;
|
|
37
|
-
|
|
38
|
+
textToolHover: {
|
|
39
|
+
type: "text";
|
|
40
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
41
|
+
} | {
|
|
42
|
+
type: "container";
|
|
43
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
44
|
+
} | {
|
|
45
|
+
type: "arrow";
|
|
38
46
|
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
39
47
|
anchor: "start" | "end" | "label";
|
|
40
48
|
} | null;
|
|
@@ -198,12 +206,20 @@ export declare const actionAddToLibrary: {
|
|
|
198
206
|
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
199
207
|
bindingPreference: "enabled" | "disabled";
|
|
200
208
|
isMidpointSnappingEnabled: boolean;
|
|
209
|
+
showHints: boolean;
|
|
201
210
|
inputDevice: import("../types").InputDevice;
|
|
202
211
|
suggestedBinding: {
|
|
203
212
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
204
213
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
205
214
|
} | null;
|
|
206
|
-
|
|
215
|
+
textToolHover: {
|
|
216
|
+
type: "text";
|
|
217
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
218
|
+
} | {
|
|
219
|
+
type: "container";
|
|
220
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
221
|
+
} | {
|
|
222
|
+
type: "arrow";
|
|
207
223
|
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
208
224
|
anchor: "start" | "end" | "label";
|
|
209
225
|
} | null;
|
|
@@ -372,12 +388,20 @@ export declare const actionAddToLibrary: {
|
|
|
372
388
|
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
373
389
|
bindingPreference: "enabled" | "disabled";
|
|
374
390
|
isMidpointSnappingEnabled: boolean;
|
|
391
|
+
showHints: boolean;
|
|
375
392
|
inputDevice: import("../types").InputDevice;
|
|
376
393
|
suggestedBinding: {
|
|
377
394
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
378
395
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
379
396
|
} | null;
|
|
380
|
-
|
|
397
|
+
textToolHover: {
|
|
398
|
+
type: "text";
|
|
399
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
400
|
+
} | {
|
|
401
|
+
type: "container";
|
|
402
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
403
|
+
} | {
|
|
404
|
+
type: "arrow";
|
|
381
405
|
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
382
406
|
anchor: "start" | "end" | "label";
|
|
383
407
|
} | null;
|