@zsviczian/excalidraw 0.18.0-22 → 0.18.0-24

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 (67) hide show
  1. package/dist/excalidraw.development.js +23 -23
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/package.json +1 -1
  4. package/types/common/src/constants.d.ts +1 -1
  5. package/types/common/src/points.d.ts +1 -1
  6. package/types/common/src/utils.d.ts +2 -2
  7. package/types/element/src/Scene.d.ts +1 -1
  8. package/types/element/src/binding.d.ts +4 -0
  9. package/types/element/src/bounds.d.ts +3 -1
  10. package/types/element/src/elbowArrow.d.ts +1 -1
  11. package/types/element/src/frame.d.ts +2 -2
  12. package/types/element/src/heading.d.ts +2 -2
  13. package/types/element/src/linearElementEditor.d.ts +1 -4
  14. package/types/element/src/resizeTest.d.ts +2 -2
  15. package/types/element/src/selection.d.ts +1 -1
  16. package/types/element/src/shape.d.ts +2 -2
  17. package/types/element/src/store.d.ts +1 -1
  18. package/types/element/src/transformHandles.d.ts +4 -4
  19. package/types/element/src/utils.d.ts +11 -5
  20. package/types/excalidraw/actions/actionAddToLibrary.d.ts +6 -6
  21. package/types/excalidraw/actions/actionAlign.d.ts +8 -8
  22. package/types/excalidraw/actions/actionBoundText.d.ts +4 -4
  23. package/types/excalidraw/actions/actionCanvas.d.ts +137 -137
  24. package/types/excalidraw/actions/actionClipboard.d.ts +17 -17
  25. package/types/excalidraw/actions/actionCropEditor.d.ts +2 -2
  26. package/types/excalidraw/actions/actionDeleteSelected.d.ts +9 -9
  27. package/types/excalidraw/actions/actionDistribute.d.ts +4 -4
  28. package/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
  29. package/types/excalidraw/actions/actionElementLink.d.ts +2 -2
  30. package/types/excalidraw/actions/actionElementLock.d.ts +6 -6
  31. package/types/excalidraw/actions/actionEmbeddable.d.ts +2 -2
  32. package/types/excalidraw/actions/actionExport.d.ts +121 -121
  33. package/types/excalidraw/actions/actionFinalize.d.ts +8 -8
  34. package/types/excalidraw/actions/actionFlip.d.ts +4 -4
  35. package/types/excalidraw/actions/actionFrame.d.ts +61 -61
  36. package/types/excalidraw/actions/actionGroup.d.ts +10 -10
  37. package/types/excalidraw/actions/actionLinearEditor.d.ts +53 -53
  38. package/types/excalidraw/actions/actionLink.d.ts +3 -3
  39. package/types/excalidraw/actions/actionMenu.d.ts +8 -8
  40. package/types/excalidraw/actions/actionNavigate.d.ts +4 -4
  41. package/types/excalidraw/actions/actionProperties.d.ts +33 -33
  42. package/types/excalidraw/actions/actionSelectAll.d.ts +5 -5
  43. package/types/excalidraw/actions/actionStyles.d.ts +6 -6
  44. package/types/excalidraw/actions/actionToggleGridMode.d.ts +4 -4
  45. package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +4 -4
  46. package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +4 -4
  47. package/types/excalidraw/actions/actionToggleStats.d.ts +4 -4
  48. package/types/excalidraw/actions/actionToggleViewMode.d.ts +4 -4
  49. package/types/excalidraw/actions/actionToggleZenMode.d.ts +4 -4
  50. package/types/excalidraw/actions/actionZindex.d.ts +8 -8
  51. package/types/excalidraw/appState.d.ts +21 -21
  52. package/types/excalidraw/components/App.d.ts +8 -4
  53. package/types/excalidraw/components/Stats/DragInput.d.ts +11 -1
  54. package/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
  55. package/types/excalidraw/components/shapes.d.ts +1 -1
  56. package/types/excalidraw/data/blob.d.ts +1 -1
  57. package/types/excalidraw/data/library.d.ts +1 -1
  58. package/types/math/src/angle.d.ts +1 -1
  59. package/types/math/src/curve.d.ts +1 -1
  60. package/types/math/src/ellipse.d.ts +3 -3
  61. package/types/math/src/point.d.ts +2 -2
  62. package/types/math/src/polygon.d.ts +2 -2
  63. package/types/math/src/rectangle.d.ts +2 -0
  64. package/types/math/src/segment.d.ts +5 -5
  65. package/types/math/src/utils.d.ts +0 -2
  66. package/types/utils/src/shape.d.ts +12 -12
  67. package/types/excalidraw/visualdebug.d.ts +0 -41
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zsviczian/excalidraw",
3
- "version": "0.18.0-22",
3
+ "version": "0.18.0-24",
4
4
  "main": "main.js",
5
5
  "module": "./dist/prod/index.js",
6
6
  "types": "types/excalidraw/index.d.ts",
@@ -299,7 +299,7 @@ export declare const DEFAULT_SIDEBAR: {
299
299
  readonly name: "default";
300
300
  readonly defaultTab: "library";
301
301
  };
302
- export declare const LIBRARY_DISABLED_TYPES: Set<"embeddable" | "image" | "iframe">;
302
+ export declare const LIBRARY_DISABLED_TYPES: Set<"embeddable" | "iframe" | "image">;
303
303
  export declare const TOOL_TYPE: {
304
304
  readonly selection: "selection";
305
305
  readonly lasso: "lasso";
@@ -5,5 +5,5 @@ export declare const getSizeFromPoints: (points: readonly (GlobalPoint | LocalPo
5
5
  height: number;
6
6
  };
7
7
  /** @arg dimension, 0 for rescaling only x, 1 for y */
8
- export declare const rescalePoints: <Point extends LocalPoint | GlobalPoint>(dimension: 0 | 1, newSize: number, points: readonly Point[], normalize: boolean) => Point[];
8
+ export declare const rescalePoints: <Point extends GlobalPoint | LocalPoint>(dimension: 0 | 1, newSize: number, points: readonly Point[], normalize: boolean) => Point[];
9
9
  export declare const getGridPoint: (x: number, y: number, gridSize: NullableGridSize) => [number, number];
@@ -6,9 +6,9 @@ export declare const setDateTimeForTests: (dateTime: string) => void;
6
6
  export declare const getDateTime: () => string;
7
7
  export declare const capitalizeString: (str: string) => string;
8
8
  export declare const isToolIcon: (target: Element | EventTarget | null) => target is HTMLElement;
9
- export declare const isInputLike: (target: Element | EventTarget | null) => target is HTMLInputElement | HTMLDivElement | HTMLTextAreaElement | HTMLSelectElement | HTMLBRElement;
9
+ export declare const isInputLike: (target: Element | EventTarget | null) => target is HTMLBRElement | HTMLDivElement | HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
10
10
  export declare const isInteractive: (target: Element | EventTarget | null) => boolean;
11
- export declare const isWritableElement: (target: Element | EventTarget | null) => target is HTMLInputElement | HTMLDivElement | HTMLTextAreaElement | HTMLBRElement;
11
+ export declare const isWritableElement: (target: Element | EventTarget | null) => target is HTMLBRElement | HTMLDivElement | HTMLInputElement | HTMLTextAreaElement;
12
12
  export declare const getFontFamilyString: ({ fontFamily, }: {
13
13
  fontFamily: FontFamilyValues;
14
14
  }) => string;
@@ -66,7 +66,7 @@ export declare class Scene {
66
66
  getElementIndex(elementId: string): number;
67
67
  getContainerElement: (element: (ExcalidrawElement & {
68
68
  containerId: ExcalidrawElement["id"] | null;
69
- }) | null) => import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | null;
69
+ }) | null) => import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement | null;
70
70
  getElementsFromId: (id: string) => ExcalidrawElement[];
71
71
  mutateElement<TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, options?: {
72
72
  informMutation: boolean;
@@ -19,6 +19,10 @@ export declare const BINDING_HIGHLIGHT_THICKNESS = 10;
19
19
  export declare const bindOrUnbindLinearElement: (linearElement: NonDeleted<ExcalidrawLinearElement>, startBindingElement: ExcalidrawBindableElement | null | "keep", endBindingElement: ExcalidrawBindableElement | null | "keep", scene: Scene) => void;
20
20
  export declare const bindOrUnbindLinearElements: (selectedElements: NonDeleted<ExcalidrawLinearElement>[], isBindingEnabled: boolean, draggingPoints: readonly number[] | null, scene: Scene, zoom?: AppState["zoom"]) => void;
21
21
  export declare const getSuggestedBindingsForArrows: (selectedElements: NonDeleted<ExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, zoom: AppState["zoom"]) => SuggestedBinding[];
22
+ export declare const maybeSuggestBindingsForLinearElementAtCoords: (linearElement: NonDeleted<ExcalidrawLinearElement>, pointerCoords: {
23
+ x: number;
24
+ y: number;
25
+ }[], scene: Scene, zoom: AppState["zoom"], oppositeBindingBoundElement?: ExcalidrawBindableElement | null) => ExcalidrawBindableElement[];
22
26
  export declare const maybeBindLinearElement: (linearElement: NonDeleted<ExcalidrawLinearElement>, appState: AppState, pointerCoords: {
23
27
  x: number;
24
28
  y: number;
@@ -44,6 +44,7 @@ export declare const getElementLineSegments: (element: ExcalidrawElement, elemen
44
44
  */
45
45
  export declare const getRectangleBoxAbsoluteCoords: (boxSceneCoords: RectangleBox) => number[];
46
46
  export declare const getDiamondPoints: (element: ExcalidrawElement) => number[];
47
+ export declare const getCubicBezierCurveBound: (p0: GlobalPoint, p1: GlobalPoint, p2: GlobalPoint, p3: GlobalPoint) => Bounds;
47
48
  export declare const getMinMaxXYFromCurvePathOps: (ops: Op[], transformXY?: ((p: GlobalPoint) => GlobalPoint) | undefined) => Bounds;
48
49
  export declare const getBoundsFromPoints: (points: ExcalidrawFreeDrawElement["points"]) => Bounds;
49
50
  /** @returns number in pixels */
@@ -83,5 +84,6 @@ export declare const getCenterForBounds: (bounds: Bounds) => GlobalPoint;
83
84
  * Get the axis-aligned bounding box for a given element
84
85
  */
85
86
  export declare const aabbForElement: (element: Readonly<ExcalidrawElement>, elementsMap: ElementsMap, offset?: [number, number, number, number]) => Bounds;
86
- export declare const pointInsideBounds: <P extends LocalPoint | GlobalPoint>(p: P, bounds: Bounds) => boolean;
87
+ export declare const pointInsideBounds: <P extends GlobalPoint | LocalPoint>(p: P, bounds: Bounds) => boolean;
88
+ export declare const doBoundsIntersect: (bounds1: Bounds | null, bounds2: Bounds | null) => boolean;
87
89
  export declare const elementCenterPoint: (element: ExcalidrawElement, elementsMap: ElementsMap, xOffset?: number, yOffset?: number) => GlobalPoint;
@@ -14,4 +14,4 @@ export declare const updateElbowArrowPoints: (arrow: Readonly<ExcalidrawElbowArr
14
14
  }, options?: {
15
15
  isDragging?: boolean;
16
16
  }) => ElementUpdate<ExcalidrawElbowArrowElement>;
17
- export declare const validateElbowPoints: <P extends LocalPoint | GlobalPoint>(points: readonly P[], tolerance?: number) => boolean;
17
+ export declare const validateElbowPoints: <P extends GlobalPoint | LocalPoint>(points: readonly P[], tolerance?: number) => boolean;
@@ -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").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawFreeDrawElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawEmbeddableElement)[];
35
- export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, allElementsMap: ElementsMap) => (import("./types").ExcalidrawSelectionElement | import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawFreeDrawElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawEmbeddableElement)[];
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)[];
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[];
@@ -6,8 +6,8 @@ export declare const HEADING_LEFT: Heading;
6
6
  export declare const HEADING_UP: Heading;
7
7
  export type Heading = [1, 0] | [0, 1] | [-1, 0] | [0, -1];
8
8
  export declare const vectorToHeading: (vec: Vector) => Heading;
9
- export declare const headingForPoint: <P extends LocalPoint | GlobalPoint>(p: P, o: P) => Heading;
10
- export declare const headingForPointIsHorizontal: <P extends LocalPoint | GlobalPoint>(p: P, o: P) => boolean;
9
+ export declare const headingForPoint: <P extends GlobalPoint | LocalPoint>(p: P, o: P) => Heading;
10
+ export declare const headingForPointIsHorizontal: <P extends GlobalPoint | LocalPoint>(p: P, o: P) => boolean;
11
11
  export declare const compareHeading: (a: Heading, b: Heading) => boolean;
12
12
  export declare const headingIsHorizontal: (a: Heading) => boolean;
13
13
  export declare const headingIsVertical: (a: Heading) => boolean;
@@ -49,10 +49,7 @@ export declare class LinearElementEditor {
49
49
  /**
50
50
  * @returns whether point was dragged
51
51
  */
52
- static handlePointDragging(event: PointerEvent, app: AppClassProperties, scenePointerX: number, scenePointerY: number, maybeSuggestBinding: (element: NonDeleted<ExcalidrawLinearElement>, pointSceneCoords: {
53
- x: number;
54
- y: number;
55
- }[]) => void, linearElementEditor: LinearElementEditor, scene: Scene): LinearElementEditor | null;
52
+ static handlePointDragging(event: PointerEvent, app: AppClassProperties, scenePointerX: number, scenePointerY: number, linearElementEditor: LinearElementEditor): Pick<AppState, keyof AppState> | null;
56
53
  static handlePointerUp(event: PointerEvent, editingLinearElement: LinearElementEditor, appState: AppState, scene: Scene): LinearElementEditor;
57
54
  static getEditorMidPoints: (element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap, appState: InteractiveCanvasAppState) => (GlobalPoint | null)[];
58
55
  static getSegmentMidpointHitCoords: (linearElementEditor: LinearElementEditor, scenePointer: {
@@ -3,12 +3,12 @@ import type { AppState, Device, Zoom } from "@excalidraw/excalidraw/types";
3
3
  import type { Bounds } from "./bounds";
4
4
  import type { MaybeTransformHandleType } from "./transformHandles";
5
5
  import type { ExcalidrawElement, PointerType, NonDeletedExcalidrawElement, ElementsMap } from "./types";
6
- export declare const resizeTest: <Point extends LocalPoint | GlobalPoint>(element: NonDeletedExcalidrawElement, elementsMap: ElementsMap, appState: AppState, x: number, y: number, zoom: Zoom, pointerType: PointerType, device: Device) => MaybeTransformHandleType;
6
+ export declare const resizeTest: <Point extends GlobalPoint | LocalPoint>(element: NonDeletedExcalidrawElement, elementsMap: ElementsMap, appState: AppState, x: number, y: number, zoom: Zoom, pointerType: PointerType, device: Device) => MaybeTransformHandleType;
7
7
  export declare const getElementWithTransformHandleType: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, scenePointerX: number, scenePointerY: number, zoom: Zoom, pointerType: PointerType, elementsMap: ElementsMap, device: Device) => {
8
8
  element: NonDeletedExcalidrawElement;
9
9
  transformHandleType: MaybeTransformHandleType;
10
10
  } | null;
11
- export declare const getTransformHandleTypeFromCoords: <Point extends LocalPoint | GlobalPoint>([x1, y1, x2, y2]: Bounds, scenePointerX: number, scenePointerY: number, zoom: Zoom, pointerType: PointerType, device: Device) => MaybeTransformHandleType;
11
+ export declare const getTransformHandleTypeFromCoords: <Point extends GlobalPoint | LocalPoint>([x1, y1, x2, y2]: Bounds, scenePointerX: number, scenePointerY: number, zoom: Zoom, pointerType: PointerType, device: Device) => MaybeTransformHandleType;
12
12
  export declare const getCursorForResizingElement: (resizingElement: {
13
13
  element?: ExcalidrawElement;
14
14
  transformHandleType: MaybeTransformHandleType;
@@ -27,12 +27,12 @@ export declare const makeNextSelectedElementIds: (nextSelectedElementIds: AppSta
27
27
  [id: string]: true;
28
28
  }>;
29
29
  export declare const getSelectionStateForElements: (targetElements: readonly ExcalidrawElement[], allElements: readonly NonDeletedExcalidrawElement[], appState: AppState) => {
30
+ editingGroupId: string | null;
30
31
  selectedElementIds: Readonly<{
31
32
  [id: string]: true;
32
33
  }>;
33
34
  selectedGroupIds: {
34
35
  [groupId: string]: boolean;
35
36
  };
36
- editingGroupId: string | null;
37
37
  selectedLinearElement: LinearElementEditor | null;
38
38
  };
@@ -20,7 +20,7 @@ export declare class ShapeCache {
20
20
  * Generates & caches shape for element if not already cached, otherwise
21
21
  * returns cached shape.
22
22
  */
23
- static generateElementShape: <T extends import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawTextElement | ExcalidrawLinearElement | import("./types").ExcalidrawArrowElement | ExcalidrawFreeDrawElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawEmbeddableElement>(element: T, renderConfig: {
23
+ static generateElementShape: <T extends ExcalidrawLinearElement | 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 | ExcalidrawFreeDrawElement | import("./types").ExcalidrawArrowElement>(element: T, renderConfig: {
24
24
  isExporting: boolean;
25
25
  canvasBackgroundColor: AppState["viewBackgroundColor"];
26
26
  embedsValidationStatus: EmbedsValidationStatus;
@@ -35,7 +35,7 @@ export declare const generateLinearCollisionShape: (element: ExcalidrawLinearEle
35
35
  * get the pure geometric shape of an excalidraw elementw
36
36
  * which is then used for hit detection
37
37
  */
38
- export declare const getElementShape: <Point extends LocalPoint | GlobalPoint>(element: ExcalidrawElement, elementsMap: ElementsMap) => GeometricShape<Point>;
38
+ export declare const getElementShape: <Point extends GlobalPoint | LocalPoint>(element: ExcalidrawElement, elementsMap: ElementsMap) => GeometricShape<Point>;
39
39
  export declare const toggleLinePolygonState: (element: ExcalidrawLineElement, nextPolygonState: boolean) => {
40
40
  polygon: ExcalidrawLineElement["polygon"];
41
41
  points: ExcalidrawLineElement["points"];
@@ -220,7 +220,7 @@ export declare class StoreSnapshot {
220
220
  private maybeCreateElementsSnapshot;
221
221
  private detectChangedAppState;
222
222
  /**
223
- * Detect if there any changed elements.
223
+ * Detect if there are any changed elements.
224
224
  */
225
225
  private detectChangedElements;
226
226
  /**
@@ -31,10 +31,10 @@ export declare const OMIT_SIDES_FOR_FRAME: {
31
31
  export declare const canResizeFromSides: (device: Device) => boolean;
32
32
  export declare const getOmitSidesForDevice: (device: Device) => {};
33
33
  export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2, cx, cy]: [number, number, number, number, number, number], angle: Radians, zoom: Zoom, pointerType: PointerType, omitSides?: {
34
- e?: boolean | undefined;
35
34
  s?: boolean | undefined;
36
- w?: boolean | undefined;
37
35
  n?: boolean | undefined;
36
+ w?: boolean | undefined;
37
+ e?: boolean | undefined;
38
38
  nw?: boolean | undefined;
39
39
  ne?: boolean | undefined;
40
40
  sw?: boolean | undefined;
@@ -42,10 +42,10 @@ export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2, cx, cy]: [
42
42
  rotation?: boolean | undefined;
43
43
  }, margin?: number, spacing?: number) => TransformHandles;
44
44
  export declare const getTransformHandles: (element: ExcalidrawElement, zoom: Zoom, elementsMap: ElementsMap, pointerType?: PointerType, omitSides?: {
45
- e?: boolean | undefined;
46
45
  s?: boolean | undefined;
47
- w?: boolean | undefined;
48
46
  n?: boolean | undefined;
47
+ w?: boolean | undefined;
48
+ e?: boolean | undefined;
49
49
  nw?: boolean | undefined;
50
50
  ne?: boolean | undefined;
51
51
  sw?: boolean | undefined;
@@ -2,23 +2,29 @@ import { type GlobalPoint } from "@excalidraw/math";
2
2
  import type { Curve, LineSegment } from "@excalidraw/math";
3
3
  import type { Zoom } from "@excalidraw/excalidraw/types";
4
4
  import type { ExcalidrawDiamondElement, ExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawLinearElement, ExcalidrawRectanguloidElement } from "./types";
5
+ /**
6
+ * Returns the **rotated** components of freedraw, line or arrow elements.
7
+ *
8
+ * @param element The linear element to deconstruct
9
+ * @returns The rotated in components.
10
+ */
5
11
  export declare function deconstructLinearOrFreeDrawElement(element: ExcalidrawLinearElement | ExcalidrawFreeDrawElement): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
6
12
  /**
7
13
  * Get the building components of a rectanguloid element in the form of
8
- * line segments and curves.
14
+ * line segments and curves **unrotated**.
9
15
  *
10
16
  * @param element Target rectanguloid element
11
17
  * @param offset Optional offset to expand the rectanguloid shape
12
- * @returns Tuple of line segments (0) and curves (1)
18
+ * @returns Tuple of **unrotated** line segments (0) and curves (1)
13
19
  */
14
20
  export declare function deconstructRectanguloidElement(element: ExcalidrawRectanguloidElement, offset?: number): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
15
21
  /**
16
- * Get the building components of a diamond element in the form of
17
- * line segments and curves as a tuple, in this order.
22
+ * Get the **unrotated** building components of a diamond element
23
+ * in the form of line segments and curves as a tuple, in this order.
18
24
  *
19
25
  * @param element The element to deconstruct
20
26
  * @param offset An optional offset
21
- * @returns Tuple of line segments (0) and curves (1)
27
+ * @returns Tuple of line **unrotated** segments (0) and curves (1)
22
28
  */
23
29
  export declare function deconstructDiamondElement(element: ExcalidrawDiamondElement, offset?: number): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
24
30
  export declare const isPathALoop: (points: ExcalidrawLinearElement["points"], zoomValue?: Zoom["value"]) => boolean;
@@ -64,7 +64,7 @@ export declare const actionAddToLibrary: {
64
64
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
65
65
  currentHoveredFontFamily: number | null;
66
66
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
67
- currentItemArrowType: "sharp" | "round" | "elbow";
67
+ currentItemArrowType: "round" | "sharp" | "elbow";
68
68
  viewBackgroundColor: string;
69
69
  scrollX: number;
70
70
  scrollY: number;
@@ -153,7 +153,7 @@ export declare const actionAddToLibrary: {
153
153
  shown: true;
154
154
  data: import("../charts").Spreadsheet;
155
155
  };
156
- showHyperlinkPopup: false | "info" | "editor";
156
+ showHyperlinkPopup: false | "editor" | "info";
157
157
  linkOpacity: number;
158
158
  trayModeEnabled: boolean;
159
159
  colorPalette?: {
@@ -268,7 +268,7 @@ export declare const actionAddToLibrary: {
268
268
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
269
269
  currentHoveredFontFamily: number | null;
270
270
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
271
- currentItemArrowType: "sharp" | "round" | "elbow";
271
+ currentItemArrowType: "round" | "sharp" | "elbow";
272
272
  viewBackgroundColor: string;
273
273
  scrollX: number;
274
274
  scrollY: number;
@@ -362,7 +362,7 @@ export declare const actionAddToLibrary: {
362
362
  shown: true;
363
363
  data: import("../charts").Spreadsheet;
364
364
  };
365
- showHyperlinkPopup: false | "info" | "editor";
365
+ showHyperlinkPopup: false | "editor" | "info";
366
366
  linkOpacity: number;
367
367
  trayModeEnabled: boolean;
368
368
  colorPalette?: {
@@ -477,7 +477,7 @@ export declare const actionAddToLibrary: {
477
477
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
478
478
  currentHoveredFontFamily: number | null;
479
479
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
480
- currentItemArrowType: "sharp" | "round" | "elbow";
480
+ currentItemArrowType: "round" | "sharp" | "elbow";
481
481
  viewBackgroundColor: string;
482
482
  scrollX: number;
483
483
  scrollY: number;
@@ -571,7 +571,7 @@ export declare const actionAddToLibrary: {
571
571
  shown: true;
572
572
  data: import("../charts").Spreadsheet;
573
573
  };
574
- showHyperlinkPopup: false | "info" | "editor";
574
+ showHyperlinkPopup: false | "editor" | "info";
575
575
  linkOpacity: number;
576
576
  trayModeEnabled: boolean;
577
577
  colorPalette?: {
@@ -14,10 +14,10 @@ export declare const actionAlignTop: {
14
14
  elements: ExcalidrawElement[];
15
15
  captureUpdate: "IMMEDIATELY";
16
16
  };
17
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
17
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
18
18
  PanelComponent: ({ elements, appState, updateData, app }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
19
19
  } & {
20
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
20
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
21
21
  };
22
22
  export declare const actionAlignBottom: {
23
23
  name: "alignBottom";
@@ -32,10 +32,10 @@ export declare const actionAlignBottom: {
32
32
  elements: ExcalidrawElement[];
33
33
  captureUpdate: "IMMEDIATELY";
34
34
  };
35
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
35
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
36
36
  PanelComponent: ({ elements, appState, updateData, app }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
37
37
  } & {
38
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
38
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
39
39
  };
40
40
  export declare const actionAlignLeft: {
41
41
  name: "alignLeft";
@@ -50,10 +50,10 @@ export declare const actionAlignLeft: {
50
50
  elements: ExcalidrawElement[];
51
51
  captureUpdate: "IMMEDIATELY";
52
52
  };
53
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
53
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
54
54
  PanelComponent: ({ elements, appState, updateData, app }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
55
55
  } & {
56
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
56
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
57
57
  };
58
58
  export declare const actionAlignRight: {
59
59
  name: "alignRight";
@@ -68,10 +68,10 @@ export declare const actionAlignRight: {
68
68
  elements: ExcalidrawElement[];
69
69
  captureUpdate: "IMMEDIATELY";
70
70
  };
71
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
71
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
72
72
  PanelComponent: ({ elements, appState, updateData, app }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
73
73
  } & {
74
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
74
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
75
75
  };
76
76
  export declare const actionAlignVerticallyCentered: {
77
77
  name: "alignVerticallyCentered";
@@ -84,7 +84,7 @@ export declare const actionBindText: {
84
84
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
85
85
  currentHoveredFontFamily: number | null;
86
86
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
87
- currentItemArrowType: "sharp" | "round" | "elbow";
87
+ currentItemArrowType: "round" | "sharp" | "elbow";
88
88
  viewBackgroundColor: string;
89
89
  scrollX: number;
90
90
  scrollY: number;
@@ -175,7 +175,7 @@ export declare const actionBindText: {
175
175
  shown: true;
176
176
  data: import("../charts").Spreadsheet;
177
177
  };
178
- showHyperlinkPopup: false | "info" | "editor";
178
+ showHyperlinkPopup: false | "editor" | "info";
179
179
  linkOpacity: number;
180
180
  trayModeEnabled: boolean;
181
181
  colorPalette?: {
@@ -305,7 +305,7 @@ export declare const actionWrapTextInContainer: {
305
305
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
306
306
  currentHoveredFontFamily: number | null;
307
307
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
308
- currentItemArrowType: "sharp" | "round" | "elbow";
308
+ currentItemArrowType: "round" | "sharp" | "elbow";
309
309
  viewBackgroundColor: string;
310
310
  scrollX: number;
311
311
  scrollY: number;
@@ -396,7 +396,7 @@ export declare const actionWrapTextInContainer: {
396
396
  shown: true;
397
397
  data: import("../charts").Spreadsheet;
398
398
  };
399
- showHyperlinkPopup: false | "info" | "editor";
399
+ showHyperlinkPopup: false | "editor" | "info";
400
400
  linkOpacity: number;
401
401
  trayModeEnabled: boolean;
402
402
  colorPalette?: {