@nous-excalidraw/math 0.18.4 → 0.18.5-beta.5

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.
Files changed (53) hide show
  1. package/dist/types/common/src/constants.d.ts +1 -0
  2. package/dist/types/common/src/fontSize.d.ts +22 -0
  3. package/dist/types/common/src/index.d.ts +2 -0
  4. package/dist/types/common/src/strokeWidth.d.ts +14 -0
  5. package/dist/types/element/src/Scene.d.ts +1 -1
  6. package/dist/types/element/src/bounds.d.ts +5 -0
  7. package/dist/types/element/src/comparisons.d.ts +5 -5
  8. package/dist/types/element/src/frame.d.ts +2 -2
  9. package/dist/types/element/src/typeChecks.d.ts +3 -1
  10. package/dist/types/element/src/types.d.ts +8 -5
  11. package/dist/types/element/src/utils.d.ts +3 -1
  12. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +6 -0
  13. package/dist/types/excalidraw/actions/actionBoundText.d.ts +4 -0
  14. package/dist/types/excalidraw/actions/actionCanvas.d.ts +31 -7
  15. package/dist/types/excalidraw/actions/actionClipboard.d.ts +4 -0
  16. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +2 -0
  17. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +6 -0
  18. package/dist/types/excalidraw/actions/actionDeselect.d.ts +2 -0
  19. package/dist/types/excalidraw/actions/actionElementLink.d.ts +2 -0
  20. package/dist/types/excalidraw/actions/actionElementLock.d.ts +4 -0
  21. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +2 -0
  22. package/dist/types/excalidraw/actions/actionExport.d.ts +5 -1
  23. package/dist/types/excalidraw/actions/actionFrame.d.ts +42 -0
  24. package/dist/types/excalidraw/actions/actionGroup.d.ts +4 -0
  25. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +36 -0
  26. package/dist/types/excalidraw/actions/actionLink.d.ts +2 -0
  27. package/dist/types/excalidraw/actions/actionMenu.d.ts +2 -0
  28. package/dist/types/excalidraw/actions/actionProperties.d.ts +4 -0
  29. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +2 -0
  30. package/dist/types/excalidraw/actions/actionStyles.d.ts +2 -0
  31. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +2 -0
  32. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +2 -0
  33. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +2 -0
  34. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +2 -0
  35. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +2 -0
  36. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +2 -0
  37. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +2 -0
  38. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +2 -0
  39. package/dist/types/excalidraw/components/App.d.ts +13 -0
  40. package/dist/types/excalidraw/components/FrameResizeDimensionLabel.d.ts +8 -0
  41. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
  42. package/dist/types/excalidraw/components/icons.d.ts +1 -0
  43. package/dist/types/excalidraw/components/shapes.d.ts +22 -1
  44. package/dist/types/excalidraw/data/blob.d.ts +6 -2
  45. package/dist/types/excalidraw/data/json.d.ts +3 -1
  46. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +1 -1
  47. package/dist/types/excalidraw/scene/types.d.ts +3 -0
  48. package/dist/types/excalidraw/scene/zoom.d.ts +2 -0
  49. package/dist/types/excalidraw/snapping.d.ts +1 -1
  50. package/dist/types/excalidraw/types.d.ts +12 -1
  51. package/dist/types/utils/src/shape.d.ts +2 -2
  52. package/package.json +2 -2
  53. package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -5
@@ -317,6 +317,7 @@ export declare const TOOL_TYPE: {
317
317
  readonly lasso: "lasso";
318
318
  readonly rectangle: "rectangle";
319
319
  readonly diamond: "diamond";
320
+ readonly triangle: "triangle";
320
321
  readonly ellipse: "ellipse";
321
322
  readonly arrow: "arrow";
322
323
  readonly line: "line";
@@ -0,0 +1,22 @@
1
+ /** Target screen font sizes at 100% zoom (matches FONT_SIZES). */
2
+ export declare const FONT_SIZE_SCREEN: {
3
+ readonly sm: 16;
4
+ readonly md: 20;
5
+ readonly lg: 28;
6
+ readonly xl: 36;
7
+ };
8
+ export declare const getSceneFontSizeForZoom: (screenFontSize: number, zoom: number) => number;
9
+ export declare const getFontSizePresetsForZoom: (zoom: number) => {
10
+ sm: number;
11
+ md: number;
12
+ lg: number;
13
+ xl: number;
14
+ };
15
+ /** When zoom changes, scale scene fontSize to keep the same screen size. */
16
+ export declare const scaleFontSizeForZoomChange: (fontSize: number, fromZoom: number, toZoom: number) => number;
17
+ /**
18
+ * Normalize fontSize when entering a low-zoom canvas.
19
+ * Legacy values (FONT_SIZES range) stored at low zoom were scene coords and
20
+ * render tiny; treat them as intended screen pixels instead.
21
+ */
22
+ export declare const normalizeSceneFontSizeForZoom: (fontSize: number, fromZoom: number, toZoom: number) => number;
@@ -2,6 +2,8 @@ export * from "./binary-heap";
2
2
  export * from "./bounds";
3
3
  export * from "./colors";
4
4
  export * from "./constants";
5
+ export * from "./strokeWidth";
6
+ export * from "./fontSize";
5
7
  export * from "./font-metadata";
6
8
  export * from "./queue";
7
9
  export * from "./keys";
@@ -0,0 +1,14 @@
1
+ /** Target screen pixel stroke widths at 100% zoom. */
2
+ export declare const STROKE_WIDTH_SCREEN: {
3
+ readonly thin: 2;
4
+ readonly bold: 3;
5
+ readonly extraBold: 4;
6
+ };
7
+ export declare const getSceneStrokeWidthForZoom: (screenWidth: number, zoom: number) => number;
8
+ export declare const getStrokeWidthPresetsForZoom: (zoom: number) => {
9
+ thin: number;
10
+ bold: number;
11
+ extraBold: number;
12
+ };
13
+ /** When zoom changes from `fromZoom` to `toZoom`, scale scene strokeWidth to keep the same screen thickness. */
14
+ export declare const scaleStrokeWidthForZoomChange: (strokeWidth: number, fromZoom: number, toZoom: number) => number;
@@ -70,7 +70,7 @@ export declare class Scene {
70
70
  getElementIndex(elementId: string): number;
71
71
  getContainerElement: (element: (ExcalidrawElement & {
72
72
  containerId: ExcalidrawElement["id"] | null;
73
- }) | null) => import("@nous-excalidraw/element/types").ExcalidrawLinearElement | import("@nous-excalidraw/element/types").ExcalidrawSelectionElement | import("@nous-excalidraw/element/types").ExcalidrawRectangleElement | import("@nous-excalidraw/element/types").ExcalidrawDiamondElement | import("@nous-excalidraw/element/types").ExcalidrawEllipseElement | import("@nous-excalidraw/element/types").ExcalidrawEmbeddableElement | import("@nous-excalidraw/element/types").ExcalidrawIframeElement | import("@nous-excalidraw/element/types").ExcalidrawImageElement | import("@nous-excalidraw/element/types").ExcalidrawFrameElement | import("@nous-excalidraw/element/types").ExcalidrawMagicFrameElement | import("@nous-excalidraw/element/types").ExcalidrawTextElement | import("@nous-excalidraw/element/types").ExcalidrawFreeDrawElement | null;
73
+ }) | null) => import("@nous-excalidraw/element/types").ExcalidrawLinearElement | import("@nous-excalidraw/element/types").ExcalidrawSelectionElement | import("@nous-excalidraw/element/types").ExcalidrawRectangleElement | import("@nous-excalidraw/element/types").ExcalidrawDiamondElement | import("@nous-excalidraw/element/types").ExcalidrawTriangleElement | import("@nous-excalidraw/element/types").ExcalidrawEllipseElement | import("@nous-excalidraw/element/types").ExcalidrawEmbeddableElement | import("@nous-excalidraw/element/types").ExcalidrawIframeElement | import("@nous-excalidraw/element/types").ExcalidrawImageElement | import("@nous-excalidraw/element/types").ExcalidrawFrameElement | import("@nous-excalidraw/element/types").ExcalidrawMagicFrameElement | import("@nous-excalidraw/element/types").ExcalidrawTextElement | import("@nous-excalidraw/element/types").ExcalidrawFreeDrawElement | null;
74
74
  getElementsFromId: (id: string) => ExcalidrawElement[];
75
75
  mutateElement<TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, options?: {
76
76
  informMutation: boolean;
@@ -36,6 +36,7 @@ export declare const getElementLineSegments: (element: ExcalidrawElement, elemen
36
36
  */
37
37
  export declare const getRectangleBoxAbsoluteCoords: (boxSceneCoords: RectangleBox) => number[];
38
38
  export declare const getDiamondPoints: (element: ExcalidrawElement) => number[];
39
+ export declare const getTrianglePoints: (element: ExcalidrawElement) => number[];
39
40
  export declare const getCubicBezierCurveBound: (p0: GlobalPoint, p1: GlobalPoint, p2: GlobalPoint, p3: GlobalPoint) => Bounds;
40
41
  export declare const getMinMaxXYFromCurvePathOps: (ops: Op[], transformXY?: (p: GlobalPoint) => GlobalPoint) => Bounds;
41
42
  export declare const getBoundsFromPoints: <P extends GlobalPoint | LocalPoint>(points: readonly P[], padding?: number) => Bounds;
@@ -43,6 +44,10 @@ export declare const getBoundsFromPoints: <P extends GlobalPoint | LocalPoint>(p
43
44
  export declare const getArrowheadSize: (arrowhead: Arrowhead) => number;
44
45
  /** @returns number in degrees */
45
46
  export declare const getArrowheadAngle: (arrowhead: Arrowhead) => Degrees;
47
+ /** Scale arrowhead to stay visible when strokeWidth is zoom-compensated. */
48
+ export declare const getScaledArrowheadSize: (arrowhead: Arrowhead, strokeWidth: ExcalidrawLinearElement["strokeWidth"]) => number;
49
+ /** Canvas padding for arrows/lines so scaled arrowheads aren't clipped. */
50
+ export declare const getArrowCanvasPadding: (element: ExcalidrawLinearElement) => number;
46
51
  export declare const getArrowheadPoints: (element: ExcalidrawLinearElement, shape: Drawable[], position: "start" | "end", arrowhead: Arrowhead, offsetMultiplier?: number) => number[] | null;
47
52
  export declare const getElementBounds: (element: ExcalidrawElement, elementsMap: ElementsMap, nonRotated?: boolean) => Bounds;
48
53
  export declare const getCommonBounds: (elements: ElementsMapOrArray, elementsMap?: ElementsMap) => Bounds;
@@ -1,8 +1,8 @@
1
1
  import type { ElementOrToolType } from "@nous-excalidraw/excalidraw/types";
2
- export declare const hasBackground: (type: ElementOrToolType) => type is "line" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "iframe" | "freedraw";
3
- export declare const hasStrokeColor: (type: ElementOrToolType) => type is "line" | "arrow" | "text" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "freedraw";
4
- export declare const hasStrokeWidth: (type: ElementOrToolType) => type is "line" | "arrow" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "iframe" | "freedraw";
5
- export declare const hasStrokeStyle: (type: ElementOrToolType) => type is "line" | "arrow" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "iframe";
6
- export declare const canChangeRoundness: (type: ElementOrToolType) => type is "line" | "rectangle" | "diamond" | "embeddable" | "iframe" | "image";
2
+ export declare const hasBackground: (type: ElementOrToolType) => type is "line" | "rectangle" | "diamond" | "triangle" | "ellipse" | "embeddable" | "iframe" | "freedraw";
3
+ export declare const hasStrokeColor: (type: ElementOrToolType) => type is "line" | "arrow" | "text" | "rectangle" | "diamond" | "triangle" | "ellipse" | "embeddable" | "freedraw";
4
+ export declare const hasStrokeWidth: (type: ElementOrToolType) => type is "line" | "arrow" | "rectangle" | "diamond" | "triangle" | "ellipse" | "embeddable" | "iframe" | "freedraw";
5
+ export declare const hasStrokeStyle: (type: ElementOrToolType) => type is "line" | "arrow" | "rectangle" | "diamond" | "triangle" | "ellipse" | "embeddable" | "iframe";
6
+ export declare const canChangeRoundness: (type: ElementOrToolType) => type is "line" | "rectangle" | "diamond" | "triangle" | "embeddable" | "iframe" | "image";
7
7
  export declare const toolIsArrow: (type: ElementOrToolType) => type is "arrow";
8
8
  export declare const canHaveArrowheads: (type: ElementOrToolType) => type is "arrow";
@@ -31,8 +31,8 @@ export declare const getFrameLikeElements: (allElements: ExcalidrawElementsInclu
31
31
  */
32
32
  export declare const getRootElements: (allElements: ExcalidrawElementsIncludingDeleted) => ExcalidrawElement[];
33
33
  export declare const getElementsInResizingFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, appState: AppState, elementsMap: ElementsMap) => ExcalidrawElement[];
34
- export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawFreeDrawElement)[];
35
- export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, allElementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawFreeDrawElement)[];
34
+ export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawTriangleElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawFreeDrawElement)[];
35
+ export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, allElementsMap: ElementsMap) => (import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawTriangleElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawFreeDrawElement)[];
36
36
  export declare const getContainingFrame: (element: ExcalidrawElement, elementsMap: ElementsMap) => ExcalidrawFrameLikeElement | null;
37
37
  /** */
38
38
  export declare const filterElementsEligibleAsFrameChildren: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => ExcalidrawElement[];
@@ -31,11 +31,13 @@ export declare const isRectangularElement: (element?: ExcalidrawElement | null)
31
31
  export declare const isTextBindableContainer: (element: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawTextContainer;
32
32
  export declare const isExcalidrawElement: (element: any) => element is ExcalidrawElement;
33
33
  export declare const isFlowchartNodeElement: (element: ExcalidrawElement) => element is ExcalidrawFlowchartNodeElement;
34
+ /** Elements that support an interactive hover outline along their geometry (not frame/image/embed). */
35
+ export declare const isHoverNativeOutlineShapeElement: (element: ExcalidrawElement | null | undefined) => boolean;
34
36
  export declare const hasBoundTextElement: (element: ExcalidrawElement | null) => element is MarkNonNullable<ExcalidrawBindableElement, "boundElements">;
35
37
  export declare const isBoundToContainer: (element: ExcalidrawElement | null) => element is ExcalidrawTextElementWithContainer;
36
38
  export declare const isArrowBoundToElement: (element: ExcalidrawArrowElement) => boolean;
37
39
  export declare const isUsingAdaptiveRadius: (type: string) => type is "rectangle" | "embeddable" | "iframe" | "image";
38
- export declare const isUsingProportionalRadius: (type: string) => type is "line" | "arrow" | "diamond";
40
+ export declare const isUsingProportionalRadius: (type: string) => type is "line" | "arrow" | "diamond" | "triangle";
39
41
  export declare const canApplyRoundnessTypeToElement: (roundnessType: RoundnessType, element: ExcalidrawElement) => boolean;
40
42
  export declare const getDefaultRoundnessTypeForElement: (element: ExcalidrawElement) => {
41
43
  type: 2;
@@ -79,6 +79,9 @@ export type ExcalidrawRectangleElement = _ExcalidrawElementBase & {
79
79
  export type ExcalidrawDiamondElement = _ExcalidrawElementBase & {
80
80
  type: "diamond";
81
81
  };
82
+ export type ExcalidrawTriangleElement = _ExcalidrawElementBase & {
83
+ type: "triangle";
84
+ };
82
85
  export type ExcalidrawEllipseElement = _ExcalidrawElementBase & {
83
86
  type: "ellipse";
84
87
  };
@@ -149,8 +152,8 @@ export type ExcalidrawFrameLikeElement = ExcalidrawFrameElement | ExcalidrawMagi
149
152
  /**
150
153
  * These are elements that don't have any additional properties.
151
154
  */
152
- export type ExcalidrawGenericElement = ExcalidrawSelectionElement | ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
153
- export type ExcalidrawFlowchartNodeElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
155
+ export type ExcalidrawGenericElement = ExcalidrawSelectionElement | ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawTriangleElement | ExcalidrawEllipseElement;
156
+ export type ExcalidrawFlowchartNodeElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawTriangleElement | ExcalidrawEllipseElement;
154
157
  export type ExcalidrawRectanguloidElement = ExcalidrawRectangleElement | ExcalidrawImageElement | ExcalidrawTextElement | ExcalidrawFreeDrawElement | ExcalidrawIframeLikeElement | ExcalidrawFrameLikeElement | ExcalidrawEmbeddableElement | ExcalidrawSelectionElement;
155
158
  /**
156
159
  * ExcalidrawElement should be JSON serializable and (eventually) contain
@@ -191,8 +194,8 @@ export type ExcalidrawTextElement = _ExcalidrawElementBase & Readonly<{
191
194
  _brand: "unitlessLineHeight";
192
195
  };
193
196
  }>;
194
- export type ExcalidrawBindableElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawTextElement | ExcalidrawImageElement | ExcalidrawIframeElement | ExcalidrawEmbeddableElement | ExcalidrawFrameElement | ExcalidrawMagicFrameElement;
195
- export type ExcalidrawTextContainer = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement | ExcalidrawArrowElement;
197
+ export type ExcalidrawBindableElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawTriangleElement | ExcalidrawEllipseElement | ExcalidrawTextElement | ExcalidrawImageElement | ExcalidrawIframeElement | ExcalidrawEmbeddableElement | ExcalidrawFrameElement | ExcalidrawMagicFrameElement;
198
+ export type ExcalidrawTextContainer = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawTriangleElement | ExcalidrawEllipseElement | ExcalidrawArrowElement;
196
199
  export type ExcalidrawTextElementWithContainer = {
197
200
  containerId: ExcalidrawTextContainer["id"];
198
201
  } & ExcalidrawTextElement;
@@ -288,7 +291,7 @@ export type SceneElementsMap = Map<ExcalidrawElement["id"], Ordered<ExcalidrawEl
288
291
  export type NonDeletedSceneElementsMap = Map<ExcalidrawElement["id"], Ordered<NonDeletedExcalidrawElement>> & MakeBrand<"NonDeletedSceneElementsMap">;
289
292
  export type ElementsMapOrArray = readonly ExcalidrawElement[] | Readonly<ElementsMap>;
290
293
  export type ExcalidrawLinearElementSubType = "line" | "sharpArrow" | "curvedArrow" | "elbowArrow";
291
- export type ConvertibleGenericTypes = "rectangle" | "diamond" | "ellipse";
294
+ export type ConvertibleGenericTypes = "rectangle" | "diamond" | "triangle" | "ellipse";
292
295
  export type ConvertibleLinearTypes = ExcalidrawLinearElementSubType;
293
296
  export type ConvertibleTypes = ConvertibleGenericTypes | ConvertibleLinearTypes;
294
297
  export {};
@@ -1,7 +1,7 @@
1
1
  import { type GlobalPoint } from "@nous-excalidraw/math";
2
2
  import type { Curve, LineSegment } from "@nous-excalidraw/math";
3
3
  import type { AppState, Zoom } from "@nous-excalidraw/excalidraw/types";
4
- import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, ExcalidrawDiamondElement, ExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawLinearElement, ExcalidrawRectanguloidElement } from "./types";
4
+ import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, ExcalidrawDiamondElement, ExcalidrawTriangleElement, ExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawLinearElement, ExcalidrawRectanguloidElement } from "./types";
5
5
  /**
6
6
  * Returns the **rotated** components of freedraw, line or arrow elements.
7
7
  *
@@ -28,6 +28,8 @@ export declare function getDiamondBaseCorners(element: ExcalidrawDiamondElement,
28
28
  * @returns Tuple of line **unrotated** segments (0) and curves (1)
29
29
  */
30
30
  export declare function deconstructDiamondElement(element: ExcalidrawDiamondElement, offset?: number): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
31
+ export declare function getTriangleBaseCorners(element: ExcalidrawTriangleElement, offset?: number): Curve<GlobalPoint>[];
32
+ export declare function deconstructTriangleElement(element: ExcalidrawTriangleElement, offset?: number): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
31
33
  export declare const isPathALoop: (points: ExcalidrawLinearElement["points"],
32
34
  /** supply if you want the loop detection to account for current zoom */
33
35
  zoomValue?: Zoom["value"]) => boolean;
@@ -35,6 +35,8 @@ export declare const actionAddToLibrary: {
35
35
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
36
36
  } | null;
37
37
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
38
+ hoverOutlineElementId: string | null;
39
+ hoveredFrameId: string | null;
38
40
  frameRendering: {
39
41
  enabled: boolean;
40
42
  name: boolean;
@@ -190,6 +192,8 @@ export declare const actionAddToLibrary: {
190
192
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
191
193
  } | null;
192
194
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
195
+ hoverOutlineElementId: string | null;
196
+ hoveredFrameId: string | null;
193
197
  frameRendering: {
194
198
  enabled: boolean;
195
199
  name: boolean;
@@ -350,6 +354,8 @@ export declare const actionAddToLibrary: {
350
354
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
351
355
  } | null;
352
356
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
357
+ hoverOutlineElementId: string | null;
358
+ hoveredFrameId: string | null;
353
359
  frameRendering: {
354
360
  enabled: boolean;
355
361
  name: boolean;
@@ -55,6 +55,8 @@ export declare const actionBindText: {
55
55
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
56
56
  } | null;
57
57
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
58
+ hoverOutlineElementId: string | null;
59
+ hoveredFrameId: string | null;
58
60
  frameRendering: {
59
61
  enabled: boolean;
60
62
  name: boolean;
@@ -227,6 +229,8 @@ export declare const actionWrapTextInContainer: {
227
229
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
228
230
  } | null;
229
231
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
232
+ hoverOutlineElementId: string | null;
233
+ hoveredFrameId: string | null;
230
234
  frameRendering: {
231
235
  enabled: boolean;
232
236
  name: boolean;
@@ -67,6 +67,7 @@ export declare const actionClearCanvas: {
67
67
  [id: string]: true;
68
68
  }>;
69
69
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
70
+ hoverOutlineElementId: string | null;
70
71
  activeEmbeddable: {
71
72
  element: import("@nous-excalidraw/element/types").NonDeletedExcalidrawElement;
72
73
  state: "hover" | "active";
@@ -103,6 +104,7 @@ export declare const actionClearCanvas: {
103
104
  shouldCacheIgnoreZoom: boolean;
104
105
  exportScale: number;
105
106
  currentItemArrowType: "sharp" | "round" | "elbow";
107
+ selectedElementsAreBeingDragged: boolean;
106
108
  bindMode: import("@nous-excalidraw/element/types").BindMode;
107
109
  contextMenu: {
108
110
  items: import("../components/ContextMenu").ContextMenuItems;
@@ -116,6 +118,7 @@ export declare const actionClearCanvas: {
116
118
  boxSelectionMode: import("../types").BoxSelectionMode;
117
119
  bindingPreference: "enabled" | "disabled";
118
120
  startBoundElement: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawBindableElement> | null;
121
+ hoveredFrameId: string | null;
119
122
  editingFrame: string | null;
120
123
  preferredSelectionTool: {
121
124
  type: "selection" | "lasso";
@@ -150,7 +153,6 @@ export declare const actionClearCanvas: {
150
153
  previousSelectedElementIds: {
151
154
  [id: string]: true;
152
155
  };
153
- selectedElementsAreBeingDragged: boolean;
154
156
  toast: {
155
157
  message: React.ReactNode;
156
158
  closable?: boolean;
@@ -190,6 +192,8 @@ export declare const actionZoomIn: {
190
192
  zoom: {
191
193
  value: import("../types").NormalizedZoomValue;
192
194
  };
195
+ currentItemStrokeWidth: number;
196
+ currentItemFontSize: number;
193
197
  contextMenu: {
194
198
  items: import("../components/ContextMenu").ContextMenuItems;
195
199
  top: number;
@@ -216,6 +220,8 @@ export declare const actionZoomIn: {
216
220
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
217
221
  } | null;
218
222
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
223
+ hoverOutlineElementId: string | null;
224
+ hoveredFrameId: string | null;
219
225
  frameRendering: {
220
226
  enabled: boolean;
221
227
  name: boolean;
@@ -243,12 +249,10 @@ export declare const actionZoomIn: {
243
249
  currentItemStrokeColor: string;
244
250
  currentItemBackgroundColor: string;
245
251
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
246
- currentItemStrokeWidth: number;
247
252
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
248
253
  currentItemRoughness: number;
249
254
  currentItemOpacity: number;
250
255
  currentItemFontFamily: import("@nous-excalidraw/element/types").FontFamilyValues;
251
- currentItemFontSize: number;
252
256
  currentItemTextAlign: import("@nous-excalidraw/element/types").TextAlign;
253
257
  currentItemStartArrowhead: import("@nous-excalidraw/element/types").Arrowhead | null;
254
258
  currentItemEndArrowhead: import("@nous-excalidraw/element/types").Arrowhead | null;
@@ -366,6 +370,8 @@ export declare const actionZoomOut: {
366
370
  zoom: {
367
371
  value: import("../types").NormalizedZoomValue;
368
372
  };
373
+ currentItemStrokeWidth: number;
374
+ currentItemFontSize: number;
369
375
  contextMenu: {
370
376
  items: import("../components/ContextMenu").ContextMenuItems;
371
377
  top: number;
@@ -392,6 +398,8 @@ export declare const actionZoomOut: {
392
398
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
393
399
  } | null;
394
400
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
401
+ hoverOutlineElementId: string | null;
402
+ hoveredFrameId: string | null;
395
403
  frameRendering: {
396
404
  enabled: boolean;
397
405
  name: boolean;
@@ -419,12 +427,10 @@ export declare const actionZoomOut: {
419
427
  currentItemStrokeColor: string;
420
428
  currentItemBackgroundColor: string;
421
429
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
422
- currentItemStrokeWidth: number;
423
430
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
424
431
  currentItemRoughness: number;
425
432
  currentItemOpacity: number;
426
433
  currentItemFontFamily: import("@nous-excalidraw/element/types").FontFamilyValues;
427
- currentItemFontSize: number;
428
434
  currentItemTextAlign: import("@nous-excalidraw/element/types").TextAlign;
429
435
  currentItemStartArrowhead: import("@nous-excalidraw/element/types").Arrowhead | null;
430
436
  currentItemEndArrowhead: import("@nous-excalidraw/element/types").Arrowhead | null;
@@ -542,6 +548,8 @@ export declare const actionResetZoom: {
542
548
  zoom: {
543
549
  value: import("../types").NormalizedZoomValue;
544
550
  };
551
+ currentItemStrokeWidth: number;
552
+ currentItemFontSize: number;
545
553
  contextMenu: {
546
554
  items: import("../components/ContextMenu").ContextMenuItems;
547
555
  top: number;
@@ -568,6 +576,8 @@ export declare const actionResetZoom: {
568
576
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
569
577
  } | null;
570
578
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
579
+ hoverOutlineElementId: string | null;
580
+ hoveredFrameId: string | null;
571
581
  frameRendering: {
572
582
  enabled: boolean;
573
583
  name: boolean;
@@ -595,12 +605,10 @@ export declare const actionResetZoom: {
595
605
  currentItemStrokeColor: string;
596
606
  currentItemBackgroundColor: string;
597
607
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
598
- currentItemStrokeWidth: number;
599
608
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
600
609
  currentItemRoughness: number;
601
610
  currentItemOpacity: number;
602
611
  currentItemFontFamily: import("@nous-excalidraw/element/types").FontFamilyValues;
603
- currentItemFontSize: number;
604
612
  currentItemTextAlign: import("@nous-excalidraw/element/types").TextAlign;
605
613
  currentItemStartArrowhead: import("@nous-excalidraw/element/types").Arrowhead | null;
606
614
  currentItemEndArrowhead: import("@nous-excalidraw/element/types").Arrowhead | null;
@@ -745,6 +753,8 @@ export declare const zoomToFitBounds: ({ bounds, appState, canvasOffsets, fitToV
745
753
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
746
754
  } | null;
747
755
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
756
+ hoverOutlineElementId: string | null;
757
+ hoveredFrameId: string | null;
748
758
  frameRendering: {
749
759
  enabled: boolean;
750
760
  name: boolean;
@@ -918,6 +928,8 @@ export declare const zoomToFit: ({ canvasOffsets, targetElements, appState, fitT
918
928
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
919
929
  } | null;
920
930
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
931
+ hoverOutlineElementId: string | null;
932
+ hoveredFrameId: string | null;
921
933
  frameRendering: {
922
934
  enabled: boolean;
923
935
  name: boolean;
@@ -1088,6 +1100,8 @@ export declare const actionZoomToFitSelectionInViewport: {
1088
1100
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
1089
1101
  } | null;
1090
1102
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
1103
+ hoverOutlineElementId: string | null;
1104
+ hoveredFrameId: string | null;
1091
1105
  frameRendering: {
1092
1106
  enabled: boolean;
1093
1107
  name: boolean;
@@ -1262,6 +1276,8 @@ export declare const actionZoomToFitSelection: {
1262
1276
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
1263
1277
  } | null;
1264
1278
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
1279
+ hoverOutlineElementId: string | null;
1280
+ hoveredFrameId: string | null;
1265
1281
  frameRendering: {
1266
1282
  enabled: boolean;
1267
1283
  name: boolean;
@@ -1437,6 +1453,8 @@ export declare const actionZoomToFit: {
1437
1453
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
1438
1454
  } | null;
1439
1455
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
1456
+ hoverOutlineElementId: string | null;
1457
+ hoveredFrameId: string | null;
1440
1458
  frameRendering: {
1441
1459
  enabled: boolean;
1442
1460
  name: boolean;
@@ -1612,6 +1630,8 @@ export declare const actionToggleEraserTool: {
1612
1630
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
1613
1631
  } | null;
1614
1632
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
1633
+ hoverOutlineElementId: string | null;
1634
+ hoveredFrameId: string | null;
1615
1635
  frameRendering: {
1616
1636
  enabled: boolean;
1617
1637
  name: boolean;
@@ -1778,6 +1798,8 @@ export declare const actionToggleLassoTool: {
1778
1798
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
1779
1799
  } | null;
1780
1800
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
1801
+ hoverOutlineElementId: string | null;
1802
+ hoveredFrameId: string | null;
1781
1803
  frameRendering: {
1782
1804
  enabled: boolean;
1783
1805
  name: boolean;
@@ -1943,6 +1965,8 @@ export declare const actionToggleHandTool: {
1943
1965
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
1944
1966
  } | null;
1945
1967
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
1968
+ hoverOutlineElementId: string | null;
1969
+ hoveredFrameId: string | null;
1946
1970
  frameRendering: {
1947
1971
  enabled: boolean;
1948
1972
  name: boolean;
@@ -36,6 +36,8 @@ export declare const actionPaste: {
36
36
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
37
37
  } | null;
38
38
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
39
+ hoverOutlineElementId: string | null;
40
+ hoveredFrameId: string | null;
39
41
  frameRendering: {
40
42
  enabled: boolean;
41
43
  name: boolean;
@@ -246,6 +248,8 @@ export declare const actionCopyAsPng: {
246
248
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
247
249
  } | null;
248
250
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
251
+ hoverOutlineElementId: string | null;
252
+ hoveredFrameId: string | null;
249
253
  frameRendering: {
250
254
  enabled: boolean;
251
255
  name: boolean;
@@ -37,6 +37,8 @@ export declare const actionToggleCropEditor: {
37
37
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
38
38
  } | null;
39
39
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
40
+ hoverOutlineElementId: string | null;
41
+ hoveredFrameId: string | null;
40
42
  frameRendering: {
41
43
  enabled: boolean;
42
44
  name: boolean;
@@ -38,6 +38,8 @@ export declare const actionDeleteSelected: {
38
38
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
39
39
  } | null;
40
40
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
41
+ hoverOutlineElementId: string | null;
42
+ hoveredFrameId: string | null;
41
43
  frameRendering: {
42
44
  enabled: boolean;
43
45
  name: boolean;
@@ -231,6 +233,8 @@ export declare const actionDeleteSelected: {
231
233
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
232
234
  } | null;
233
235
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
236
+ hoverOutlineElementId: string | null;
237
+ hoveredFrameId: string | null;
234
238
  frameRendering: {
235
239
  enabled: boolean;
236
240
  name: boolean;
@@ -397,6 +401,8 @@ export declare const actionDeleteSelected: {
397
401
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
398
402
  } | null;
399
403
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
404
+ hoverOutlineElementId: string | null;
405
+ hoveredFrameId: string | null;
400
406
  frameRendering: {
401
407
  enabled: boolean;
402
408
  name: boolean;
@@ -35,6 +35,8 @@ export declare const actionDeselect: {
35
35
  isMidpointSnappingEnabled: boolean;
36
36
  startBoundElement: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawBindableElement> | null;
37
37
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
38
+ hoverOutlineElementId: string | null;
39
+ hoveredFrameId: string | null;
38
40
  frameRendering: {
39
41
  enabled: boolean;
40
42
  name: boolean;
@@ -66,6 +66,8 @@ export declare const actionLinkToElement: {
66
66
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
67
67
  } | null;
68
68
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
69
+ hoverOutlineElementId: string | null;
70
+ hoveredFrameId: string | null;
69
71
  frameRendering: {
70
72
  enabled: boolean;
71
73
  name: boolean;
@@ -48,6 +48,8 @@ export declare const actionToggleElementLock: {
48
48
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
49
49
  } | null;
50
50
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
51
+ hoverOutlineElementId: string | null;
52
+ hoveredFrameId: string | null;
51
53
  frameRendering: {
52
54
  enabled: boolean;
53
55
  name: boolean;
@@ -219,6 +221,8 @@ export declare const actionUnlockAllElements: {
219
221
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
220
222
  } | null;
221
223
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
224
+ hoverOutlineElementId: string | null;
225
+ hoveredFrameId: string | null;
222
226
  frameRendering: {
223
227
  enabled: boolean;
224
228
  name: boolean;
@@ -39,6 +39,8 @@ export declare const actionSetEmbeddableAsActiveTool: {
39
39
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
40
40
  } | null;
41
41
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
42
+ hoverOutlineElementId: string | null;
43
+ hoveredFrameId: string | null;
42
44
  frameRendering: {
43
45
  enabled: boolean;
44
46
  name: boolean;
@@ -117,6 +117,7 @@ export declare const actionLoadScene: {
117
117
  [id: string]: true;
118
118
  }>;
119
119
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
120
+ hoverOutlineElementId: string | null;
120
121
  activeTool: {
121
122
  lastActiveTool: import("../types").ActiveTool | null;
122
123
  locked: boolean;
@@ -158,6 +159,7 @@ export declare const actionLoadScene: {
158
159
  shouldCacheIgnoreZoom: boolean;
159
160
  exportScale: number;
160
161
  currentItemArrowType: "sharp" | "round" | "elbow";
162
+ selectedElementsAreBeingDragged: boolean;
161
163
  bindMode: import("@nous-excalidraw/element/types").BindMode;
162
164
  gridSize: number;
163
165
  contextMenu: {
@@ -172,6 +174,7 @@ export declare const actionLoadScene: {
172
174
  boxSelectionMode: import("../types").BoxSelectionMode;
173
175
  bindingPreference: "enabled" | "disabled";
174
176
  startBoundElement: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawBindableElement> | null;
177
+ hoveredFrameId: string | null;
175
178
  editingFrame: string | null;
176
179
  preferredSelectionTool: {
177
180
  type: "selection" | "lasso";
@@ -210,7 +213,6 @@ export declare const actionLoadScene: {
210
213
  previousSelectedElementIds: {
211
214
  [id: string]: true;
212
215
  };
213
- selectedElementsAreBeingDragged: boolean;
214
216
  toast: {
215
217
  message: React.ReactNode;
216
218
  closable?: boolean;
@@ -266,6 +268,8 @@ export declare const actionLoadScene: {
266
268
  midPoint?: import("@nous-excalidraw/math").GlobalPoint;
267
269
  } | null;
268
270
  frameToHighlight: import("@nous-excalidraw/element/types").NonDeleted<import("@nous-excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
271
+ hoverOutlineElementId: string | null;
272
+ hoveredFrameId: string | null;
269
273
  frameRendering: {
270
274
  enabled: boolean;
271
275
  name: boolean;