@excalidraw/common 0.18.0-9ba0f5d → 0.18.0-a9ca16e

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 (128) hide show
  1. package/dist/dev/index.js +315 -21
  2. package/dist/dev/index.js.map +3 -3
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/debug.d.ts +21 -0
  5. package/dist/types/common/src/appEventBus.d.ts +27 -0
  6. package/dist/types/common/src/colors.d.ts +13 -13
  7. package/dist/types/common/src/constants.d.ts +4 -0
  8. package/dist/types/common/src/index.d.ts +3 -0
  9. package/dist/types/common/src/utils.d.ts +4 -7
  10. package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
  11. package/dist/types/element/src/Scene.d.ts +2 -0
  12. package/dist/types/element/src/arrowheads.d.ts +3 -0
  13. package/dist/types/element/src/arrows/focus.d.ts +27 -0
  14. package/dist/types/element/src/arrows/helpers.d.ts +5 -0
  15. package/dist/types/element/src/binding.d.ts +13 -8
  16. package/dist/types/element/src/bounds.d.ts +1 -1
  17. package/dist/types/element/src/collision.d.ts +4 -3
  18. package/dist/types/element/src/distribute.d.ts +2 -1
  19. package/dist/types/element/src/elbowArrow.d.ts +2 -0
  20. package/dist/types/element/src/index.d.ts +3 -0
  21. package/dist/types/element/src/linearElementEditor.d.ts +5 -0
  22. package/dist/types/element/src/mutateElement.d.ts +2 -0
  23. package/dist/types/element/src/selection.d.ts +6 -2
  24. package/dist/types/element/src/textElement.d.ts +1 -1
  25. package/dist/types/element/src/textWrapping.d.ts +26 -0
  26. package/dist/types/element/src/types.d.ts +5 -2
  27. package/dist/types/element/src/utils.d.ts +5 -3
  28. package/dist/types/element/src/zindex.d.ts +1 -1
  29. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +38 -35
  30. package/dist/types/excalidraw/actions/actionBoundText.d.ts +27 -25
  31. package/dist/types/excalidraw/actions/actionCanvas.d.ts +216 -204
  32. package/dist/types/excalidraw/actions/actionClipboard.d.ts +26 -24
  33. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +13 -12
  34. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +42 -37
  35. package/dist/types/excalidraw/actions/actionElementLink.d.ts +9 -12
  36. package/dist/types/excalidraw/actions/actionElementLock.d.ts +26 -24
  37. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +13 -12
  38. package/dist/types/excalidraw/actions/actionExport.d.ts +114 -386
  39. package/dist/types/excalidraw/actions/actionFrame.d.ts +52 -48
  40. package/dist/types/excalidraw/actions/actionGroup.d.ts +29 -27
  41. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +15 -12
  42. package/dist/types/excalidraw/actions/actionLink.d.ts +13 -12
  43. package/dist/types/excalidraw/actions/actionMenu.d.ts +9 -12
  44. package/dist/types/excalidraw/actions/actionProperties.d.ts +29 -27
  45. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +14 -13
  46. package/dist/types/excalidraw/actions/actionStyles.d.ts +13 -11
  47. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
  48. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +172 -0
  49. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +13 -12
  50. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +172 -0
  51. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +13 -12
  52. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +9 -12
  53. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +13 -12
  54. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +13 -12
  55. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +13 -12
  56. package/dist/types/excalidraw/actions/index.d.ts +2 -0
  57. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  58. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  59. package/dist/types/excalidraw/appState.d.ts +29 -27
  60. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
  61. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  62. package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
  63. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
  64. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  65. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
  66. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  67. package/dist/types/excalidraw/charts/index.d.ts +7 -0
  68. package/dist/types/excalidraw/clipboard.d.ts +8 -9
  69. package/dist/types/excalidraw/components/App.d.ts +53 -13
  70. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  71. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +1 -1
  72. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  73. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  74. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
  75. package/dist/types/excalidraw/components/Range.d.ts +10 -4
  76. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +2 -6
  77. package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +2 -1
  78. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  79. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +11 -7
  80. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  81. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +4 -1
  82. package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
  83. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +2 -1
  84. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  85. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +4 -0
  86. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  87. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
  88. package/dist/types/excalidraw/components/Toast.d.ts +8 -4
  89. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
  90. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +30 -16
  91. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +3 -2
  92. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +11 -12
  93. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  94. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +2 -1
  95. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  96. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  97. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  98. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
  99. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  100. package/dist/types/excalidraw/components/icons.d.ts +23 -9
  101. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +17 -0
  102. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +23 -14
  103. package/dist/types/excalidraw/components/shapes.d.ts +74 -1
  104. package/dist/types/excalidraw/data/blob.d.ts +167 -166
  105. package/dist/types/excalidraw/data/filesystem.d.ts +3 -5
  106. package/dist/types/excalidraw/data/index.d.ts +2 -3
  107. package/dist/types/excalidraw/data/json.d.ts +94 -85
  108. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  109. package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
  110. package/dist/types/excalidraw/types.d.ts +93 -16
  111. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +5 -1
  112. package/dist/types/math/src/point.d.ts +7 -2
  113. package/dist/types/math/src/types.d.ts +25 -1
  114. package/package.json +1 -1
  115. package/dist/types/excalidraw/charts.d.ts +0 -27
  116. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  117. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
  118. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  119. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
  120. package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +0 -24
  121. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  122. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -11
  123. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  124. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  125. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -84
  126. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  127. package/dist/types/excalidraw/index.d.ts +0 -46
  128. package/dist/types/excalidraw/polyfill.d.ts +0 -2
@@ -24,12 +24,15 @@ export type BindingStrategy = {
24
24
  *
25
25
  * IMPORTANT: currently must be > 0 (this also applies to the computed gap)
26
26
  */
27
- export declare const BASE_BINDING_GAP = 10;
27
+ export declare const BASE_BINDING_GAP = 5;
28
28
  export declare const BASE_BINDING_GAP_ELBOW = 5;
29
+ export declare const BASE_ARROW_MIN_LENGTH = 10;
30
+ export declare const FOCUS_POINT_SIZE: number;
29
31
  export declare const getBindingGap: (bindTarget: ExcalidrawBindableElement, opts: Pick<ExcalidrawArrowElement, "elbowed">) => number;
30
32
  export declare const maxBindingDistance_simple: (zoom?: AppState["zoom"]) => number;
31
- export declare const shouldEnableBindingForPointerEvent: (event: React.PointerEvent<HTMLElement>) => boolean;
32
- export declare const isBindingEnabled: (appState: AppState) => boolean;
33
+ export declare const isBindingEnabled: (appState: {
34
+ isBindingEnabled: AppState["isBindingEnabled"];
35
+ }) => boolean;
33
36
  export declare const bindOrUnbindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, draggingPoints: PointsPositionUpdates, scenePointerX: number, scenePointerY: number, scene: Scene, appState: AppState, opts?: {
34
37
  newArrow?: boolean;
35
38
  altKey?: boolean;
@@ -51,7 +54,7 @@ export declare const getBindingStrategyForDraggingBindingElementEndpoints: (arro
51
54
  end: BindingStrategy;
52
55
  };
53
56
  export declare const bindOrUnbindBindingElements: (selectedArrows: NonDeleted<ExcalidrawArrowElement>[], scene: Scene, appState: AppState) => void;
54
- export declare const bindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, hoveredElement: ExcalidrawBindableElement, mode: BindMode, startOrEnd: "start" | "end", scene: Scene, focusPoint?: GlobalPoint) => void;
57
+ export declare const bindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, hoveredElement: ExcalidrawBindableElement, mode: BindMode, startOrEnd: "start" | "end", scene: Scene, focusPoint?: GlobalPoint, shouldSnapToOutline?: boolean) => void;
55
58
  export declare const unbindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, startOrEnd: "start" | "end", scene: Scene) => ExcalidrawBindableElement["id"] | null;
56
59
  export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawElement, scene: Scene, options?: {
57
60
  simultaneouslyUpdated?: readonly ExcalidrawElement[];
@@ -65,10 +68,11 @@ export declare const updateBindings: (latestElement: ExcalidrawElement, scene: S
65
68
  };
66
69
  }) => void;
67
70
  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;
68
- export declare const bindPointToSnapToElementOutline: (arrowElement: ExcalidrawArrowElement, bindableElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, customIntersector?: LineSegment<GlobalPoint>) => GlobalPoint;
71
+ export declare const bindPointToSnapToElementOutline: (arrowElement: ExcalidrawArrowElement, bindableElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, customIntersector?: LineSegment<GlobalPoint>, isMidpointSnappingEnabled?: boolean) => GlobalPoint;
69
72
  export declare const avoidRectangularCorner: (arrowElement: ExcalidrawArrowElement, bindTarget: ExcalidrawBindableElement, elementsMap: ElementsMap, p: GlobalPoint) => GlobalPoint;
70
- export declare const updateBoundPoint: (arrow: NonDeleted<ExcalidrawArrowElement>, startOrEnd: "startBinding" | "endBinding", binding: FixedPointBinding | null | undefined, bindableElement: ExcalidrawBindableElement, elementsMap: ElementsMap, customIntersector?: LineSegment<GlobalPoint>) => LocalPoint | null;
71
- export declare const calculateFixedPointForElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawElbowArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap) => {
73
+ export declare const snapToMid: (bindTarget: ExcalidrawBindableElement, elementsMap: ElementsMap, p: GlobalPoint, tolerance?: number, arrowElement?: ExcalidrawArrowElement) => GlobalPoint | undefined;
74
+ export declare const updateBoundPoint: (arrow: NonDeleted<ExcalidrawArrowElement>, startOrEnd: "startBinding" | "endBinding", binding: FixedPointBinding | null | undefined, bindableElement: ExcalidrawBindableElement, elementsMap: ElementsMap, dragging?: boolean) => LocalPoint | null;
75
+ export declare const calculateFixedPointForElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawElbowArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, shouldSnapToOutline?: boolean, isMidpointSnappingEnabled?: boolean) => {
72
76
  fixedPoint: FixedPoint;
73
77
  };
74
78
  export declare const calculateFixedPointForNonElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, focusPoint?: GlobalPoint) => {
@@ -120,5 +124,6 @@ export declare class BindableElement {
120
124
  export declare const getGlobalFixedPointForBindableElement: (fixedPointRatio: FixedPoint, element: ExcalidrawBindableElement, elementsMap: ElementsMap) => GlobalPoint;
121
125
  export declare const getGlobalFixedPoints: (arrow: ExcalidrawArrowElement, elementsMap: ElementsMap) => [GlobalPoint, GlobalPoint];
122
126
  export declare const getArrowLocalFixedPoints: (arrow: ExcalidrawElbowArrowElement, elementsMap: ElementsMap) => LocalPoint[];
123
- export declare const normalizeFixedPoint: <T extends FixedPoint | null>(fixedPoint: T) => T extends null ? null : FixedPoint;
127
+ export declare const isFixedPoint: (fixedPoint: any) => fixedPoint is FixedPointBinding["fixedPoint"];
128
+ export declare const normalizeFixedPoint: <T extends FixedPoint>(fixedPoint: T) => FixedPoint;
124
129
  export declare const getBindingSideMidPoint: (binding: FixedPointBinding, elementsMap: ElementsMap) => GlobalPoint | LocalPoint | null;
@@ -43,7 +43,7 @@ export declare const getBoundsFromPoints: (points: ExcalidrawFreeDrawElement["po
43
43
  export declare const getArrowheadSize: (arrowhead: Arrowhead) => number;
44
44
  /** @returns number in degrees */
45
45
  export declare const getArrowheadAngle: (arrowhead: Arrowhead) => Degrees;
46
- export declare const getArrowheadPoints: (element: ExcalidrawLinearElement, shape: Drawable[], position: "start" | "end", arrowhead: Arrowhead) => number[] | null;
46
+ export declare const getArrowheadPoints: (element: ExcalidrawLinearElement, shape: Drawable[], position: "start" | "end", arrowhead: Arrowhead, offsetMultiplier?: number) => number[] | null;
47
47
  export declare const getElementBounds: (element: ExcalidrawElement, elementsMap: ElementsMap, nonRotated?: boolean) => Bounds;
48
48
  export declare const getCommonBounds: (elements: ElementsMapOrArray, elementsMap?: ElementsMap) => Bounds;
49
49
  export declare const getDraggedElementsBounds: (elements: ExcalidrawElement[], dragOffset: {
@@ -1,6 +1,6 @@
1
1
  import type { GlobalPoint, LineSegment } from "@excalidraw/math";
2
2
  import type { FrameNameBounds } from "@excalidraw/excalidraw/types";
3
- import type { ElementsMap, ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, Ordered } from "./types";
3
+ import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, Ordered } from "./types";
4
4
  export declare const shouldTestInside: (element: ExcalidrawElement) => boolean;
5
5
  export type HitTestArgs = {
6
6
  point: GlobalPoint;
@@ -14,8 +14,9 @@ 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
- export declare const getAllHoveredElementAtPoint: (point: Readonly<GlobalPoint>, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, toleranceFn?: (element: ExcalidrawBindableElement) => number) => NonDeleted<ExcalidrawBindableElement>[];
18
- export declare const getHoveredElementForBinding: (point: Readonly<GlobalPoint>, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, toleranceFn?: (element: ExcalidrawBindableElement) => number) => NonDeleted<ExcalidrawBindableElement> | null;
17
+ export declare const getAllHoveredElementAtPoint: (point: Readonly<GlobalPoint>, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, tolerance?: number) => NonDeleted<ExcalidrawBindableElement>[];
18
+ export declare const getHoveredElementForBinding: (point: Readonly<GlobalPoint>, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, tolerance?: number) => NonDeleted<ExcalidrawBindableElement> | null;
19
+ export declare const getHoveredElementForFocusPoint: (point: GlobalPoint, arrow: ExcalidrawArrowElement, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, tolerance?: number) => ExcalidrawBindableElement | null;
19
20
  /**
20
21
  * Intersect a line with an element for binding test
21
22
  *
@@ -1,7 +1,8 @@
1
1
  import type { AppState } from "@excalidraw/excalidraw/types";
2
+ import type { Scene } from "./Scene";
2
3
  import type { ElementsMap, ExcalidrawElement } from "./types";
3
4
  export interface Distribution {
4
5
  space: "between";
5
6
  axis: "x" | "y";
6
7
  }
7
- export declare const distributeElements: (selectedElements: ExcalidrawElement[], elementsMap: ElementsMap, distribution: Distribution, appState: Readonly<AppState>) => ExcalidrawElement[];
8
+ export declare const distributeElements: (selectedElements: ExcalidrawElement[], elementsMap: ElementsMap, distribution: Distribution, appState: Readonly<AppState>, scene: Scene) => ExcalidrawElement[];
@@ -13,5 +13,7 @@ export declare const updateElbowArrowPoints: (arrow: Readonly<ExcalidrawElbowArr
13
13
  endBinding?: FixedPointBinding | null;
14
14
  }, options?: {
15
15
  isDragging?: boolean;
16
+ isBindingEnabled?: boolean;
17
+ isMidpointSnappingEnabled?: boolean;
16
18
  }) => ElementUpdate<ExcalidrawElbowArrowElement>;
17
19
  export declare const validateElbowPoints: <P extends GlobalPoint | LocalPoint>(points: readonly P[], tolerance?: number) => boolean;
@@ -27,6 +27,7 @@ export * from "./elbowArrow";
27
27
  export * from "./elementLink";
28
28
  export * from "./embeddable";
29
29
  export * from "./flowchart";
30
+ export * from "./arrows/focus";
30
31
  export * from "./fractionalIndex";
31
32
  export * from "./frame";
32
33
  export * from "./groups";
@@ -54,3 +55,5 @@ export * from "./transformHandles";
54
55
  export * from "./typeChecks";
55
56
  export * from "./utils";
56
57
  export * from "./zindex";
58
+ export * from "./arrows/helpers";
59
+ export * from "./arrowheads";
@@ -33,6 +33,8 @@ export declare class LinearElementEditor {
33
33
  }>;
34
34
  readonly hoverPointIndex: number;
35
35
  readonly segmentMidPointHoveredCoords: GlobalPoint | null;
36
+ readonly hoveredFocusPointBinding: "start" | "end" | null;
37
+ readonly draggedFocusPointBinding: "start" | "end" | null;
36
38
  readonly elbowed: boolean;
37
39
  readonly customLineAngle: number | null;
38
40
  readonly isEditing: boolean;
@@ -94,6 +96,9 @@ export declare class LinearElementEditor {
94
96
  startBinding?: FixedPointBinding | null;
95
97
  endBinding?: FixedPointBinding | null;
96
98
  moveMidPointsWithElement?: boolean | null;
99
+ }, options?: {
100
+ isBindingEnabled?: boolean;
101
+ isMidpointSnappingEnabled?: boolean;
97
102
  }): void;
98
103
  static shouldAddMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, appState: AppState, elementsMap: ElementsMap): boolean;
99
104
  static addMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, app: AppClassProperties, snapToGrid: boolean, scene: Scene): {
@@ -11,6 +11,8 @@ export type ElementUpdate<TElement extends ExcalidrawElement> = Omit<Partial<TEl
11
11
  */
12
12
  export declare const mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, elementsMap: ElementsMap, updates: ElementUpdate<TElement>, options?: {
13
13
  isDragging?: boolean;
14
+ isBindingEnabled?: boolean;
15
+ isMidpointSnappingEnabled?: boolean;
14
16
  }) => TElement;
15
17
  export declare const newElementWith: <TElement extends ExcalidrawElement>(element: TElement, updates: ElementUpdate<TElement>,
16
18
  /** pass `true` to always regenerate */
@@ -1,6 +1,6 @@
1
1
  import type { AppState, InteractiveCanvasAppState } from "@excalidraw/excalidraw/types";
2
2
  import { LinearElementEditor } from "./linearElementEditor";
3
- import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, NonDeletedExcalidrawElement } from "./types";
3
+ import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement } from "./types";
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
@@ -27,8 +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: AppState["editingGroupId"];
31
30
  selectedElementIds: AppState["selectedElementIds"];
32
31
  selectedGroupIds: AppState["selectedGroupIds"];
32
+ editingGroupId: AppState["editingGroupId"];
33
33
  selectedLinearElement: LinearElementEditor | null;
34
34
  };
35
+ /**
36
+ * Returns editing or single-selected text element, if any.
37
+ */
38
+ export declare const getActiveTextElement: (selectedElements: readonly NonDeleted<ExcalidrawElement>[], appState: Pick<AppState, "editingTextElement">) => import("./types").ExcalidrawTextElement | null;
@@ -31,7 +31,7 @@ export declare const suppportsHorizontalAlign: (selectedElements: NonDeletedExca
31
31
  declare const VALID_CONTAINER_TYPES: Set<string>;
32
32
  export declare const isValidTextContainer: (element: {
33
33
  type: ExcalidrawElementType;
34
- }) => boolean;
34
+ }) => element is ExcalidrawTextContainer;
35
35
  export declare const computeContainerDimensionForBoundText: (dimension: number, containerType: ExtractSetType<typeof VALID_CONTAINER_TYPES>) => number;
36
36
  export declare const getBoundTextMaxWidth: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElement | null) => number;
37
37
  export declare const getBoundTextMaxHeight: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer) => number;
@@ -5,9 +5,35 @@ import type { FontString } from "./types";
5
5
  export declare const containsCJK: (text: string) => boolean;
6
6
  /**
7
7
  * Breaks the line into the tokens based on the found line break opporutnities.
8
+ *
9
+ * Note: tokenization normalizes to NFC first so decomposed graphemes are treated as
10
+ * their composed variants for wrapping. Any code that needs exact source offsets should
11
+ * keep in mind that this assumes the input text is already NFC-normalized.
8
12
  */
9
13
  export declare const parseTokens: (line: string) => string[];
10
14
  /**
11
15
  * Wraps the original text into the lines based on the given width.
16
+ *
17
+ * This is a convenience adapter over `getWrappedTextLines()` for call sites
18
+ * that only need the rendered wrapped string and not the source offsets.
12
19
  */
13
20
  export declare const wrapText: (text: string, font: FontString, maxWidth: number) => string;
21
+ /**
22
+ * A single rendered visual line produced from the original text.
23
+ *
24
+ * `start` and `end` are end-exclusive code-unit offsets into the original text, and do
25
+ * not include synthetic soft line breaks inserted by this module. If trailing whitespace
26
+ * was trimmed away at a wrap boundary, `end` points to the last rendered character.
27
+ */
28
+ export type WrappedTextLine = {
29
+ text: string;
30
+ start: number;
31
+ end: number;
32
+ };
33
+ /**
34
+ * Returns the rendered visual lines together with their source offsets.
35
+ *
36
+ * This is the source-of-truth wrapping pipeline for callers that need more than the
37
+ * final wrapped string, for example caret placement or future editor/rich-text mapping.
38
+ */
39
+ export declare const getWrappedTextLines: (text: string, font: FontString, maxWidth: number) => WrappedTextLine[];
@@ -1,7 +1,7 @@
1
1
  import type { LocalPoint, Radians } from "@excalidraw/math";
2
2
  import type { FONT_FAMILY, ROUNDNESS, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "@excalidraw/common";
3
3
  import type { MakeBrand, MarkNonNullable, Merge, ValueOf } from "@excalidraw/common/utility-types";
4
- export type ChartType = "bar" | "line";
4
+ export type ChartType = "bar" | "line" | "radar";
5
5
  export type FillStyle = "hachure" | "cross-hatch" | "solid" | "zigzag";
6
6
  export type FontFamilyKeys = keyof typeof FONT_FAMILY;
7
7
  export type FontFamilyValues = typeof FONT_FAMILY[FontFamilyKeys];
@@ -208,7 +208,10 @@ export type PointsPositionUpdates = Map<Index, {
208
208
  point: LocalPoint;
209
209
  isDragging?: boolean;
210
210
  }>;
211
- export type Arrowhead = "arrow" | "bar" | "dot" | "circle" | "circle_outline" | "triangle" | "triangle_outline" | "diamond" | "diamond_outline" | "crowfoot_one" | "crowfoot_many" | "crowfoot_one_or_many";
211
+ export type CardinalityArrowhead = "cardinality_one" | "cardinality_many" | "cardinality_one_or_many" | "cardinality_exactly_one" | "cardinality_zero_or_one" | "cardinality_zero_or_many";
212
+ export type ArrowheadLegacy = "dot" | "crowfoot_one" | "crowfoot_many" | "crowfoot_one_or_many";
213
+ export type Arrowhead = "arrow" | "bar" | "circle" | "circle_outline" | "triangle" | "triangle_outline" | "diamond" | "diamond_outline" | CardinalityArrowhead;
214
+ export type AnyArrowhead = Arrowhead | ArrowheadLegacy;
212
215
  export type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<{
213
216
  type: "line" | "arrow";
214
217
  points: readonly LocalPoint[];
@@ -1,7 +1,7 @@
1
1
  import { type GlobalPoint } from "@excalidraw/math";
2
2
  import type { Curve, LineSegment } from "@excalidraw/math";
3
- import type { Zoom } from "@excalidraw/excalidraw/types";
4
- import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawDiamondElement, ExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawLinearElement, ExcalidrawRectanguloidElement } from "./types";
3
+ import type { AppState, Zoom } from "@excalidraw/excalidraw/types";
4
+ import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, ExcalidrawDiamondElement, ExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawLinearElement, ExcalidrawRectanguloidElement } from "./types";
5
5
  /**
6
6
  * Returns the **rotated** components of freedraw, line or arrow elements.
7
7
  *
@@ -18,6 +18,7 @@ export declare function deconstructLinearOrFreeDrawElement(element: ExcalidrawLi
18
18
  * @returns Tuple of **unrotated** line segments (0) and curves (1)
19
19
  */
20
20
  export declare function deconstructRectanguloidElement(element: ExcalidrawRectanguloidElement, offset?: number): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
21
+ export declare function getDiamondBaseCorners(element: ExcalidrawDiamondElement, offset?: number): Curve<GlobalPoint>[];
21
22
  /**
22
23
  * Get the **unrotated** building components of a diamond element
23
24
  * in the form of line segments and curves as a tuple, in this order.
@@ -31,4 +32,5 @@ export declare const isPathALoop: (points: ExcalidrawLinearElement["points"],
31
32
  /** supply if you want the loop detection to account for current zoom */
32
33
  zoomValue?: Zoom["value"]) => boolean;
33
34
  export declare const getCornerRadius: (x: number, element: ExcalidrawElement) => number;
34
- export declare const projectFixedPointOntoDiagonal: (arrow: ExcalidrawArrowElement, point: GlobalPoint, element: ExcalidrawElement, startOrEnd: "start" | "end", elementsMap: ElementsMap) => GlobalPoint | null;
35
+ export declare const getSnapOutlineMidPoint: (point: GlobalPoint, element: ExcalidrawBindableElement, elementsMap: ElementsMap, zoom: AppState["zoom"]) => GlobalPoint | undefined;
36
+ export declare const projectFixedPointOntoDiagonal: (arrow: ExcalidrawArrowElement, point: GlobalPoint, element: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, zoom: AppState["zoom"], isMidpointSnappingEnabled?: boolean) => GlobalPoint | null;
@@ -6,7 +6,7 @@ import type { ExcalidrawArrowElement, ExcalidrawElement, NonDeletedExcalidrawEle
6
6
  * Moves the arrow element above any bindable elements it intersects with or
7
7
  * hovers over.
8
8
  */
9
- export declare const moveArrowAboveBindable: (point: GlobalPoint, arrow: ExcalidrawArrowElement, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, scene: Scene) => readonly OrderedExcalidrawElement[];
9
+ export declare const moveArrowAboveBindable: (point: GlobalPoint, arrow: ExcalidrawArrowElement, elements: readonly Ordered<NonDeletedExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, scene: Scene, hit?: NonDeletedExcalidrawElement) => readonly OrderedExcalidrawElement[];
10
10
  export declare const moveOneLeft: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
11
11
  export declare const moveOneRight: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
12
12
  export declare const moveAllLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) => readonly ExcalidrawElement[] | ExcalidrawElement[];
@@ -26,8 +26,13 @@ export declare const actionAddToLibrary: {
26
26
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
27
27
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
28
28
  isBindingEnabled: boolean;
29
+ bindingPreference: "enabled" | "disabled";
30
+ isMidpointSnappingEnabled: boolean;
29
31
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
30
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
32
+ suggestedBinding: {
33
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
34
+ midPoint?: import("@excalidraw/math").GlobalPoint;
35
+ } | null;
31
36
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
32
37
  frameRendering: {
33
38
  enabled: boolean;
@@ -37,7 +42,7 @@ export declare const actionAddToLibrary: {
37
42
  };
38
43
  editingFrame: string | null;
39
44
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
40
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
45
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
41
46
  activeTool: {
42
47
  lastActiveTool: import("../types").ActiveTool | null;
43
48
  locked: boolean;
@@ -95,6 +100,10 @@ export declare const actionAddToLibrary: {
95
100
  } | {
96
101
  name: "elementLinkSelector";
97
102
  sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
103
+ } | {
104
+ name: "charts";
105
+ data: import("../charts").Spreadsheet;
106
+ rawText: string;
98
107
  };
99
108
  defaultSidebarDockedPreference: boolean;
100
109
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
@@ -123,20 +132,12 @@ export declare const actionAddToLibrary: {
123
132
  height: number;
124
133
  offsetTop: number;
125
134
  offsetLeft: number;
126
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
135
+ fileHandle: FileSystemFileHandle | null;
127
136
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
128
137
  stats: {
129
138
  open: boolean;
130
139
  panels: number;
131
140
  };
132
- currentChartType: import("@excalidraw/element/types").ChartType;
133
- pasteDialog: {
134
- shown: false;
135
- data: null;
136
- } | {
137
- shown: true;
138
- data: import("../charts").Spreadsheet;
139
- };
140
141
  showHyperlinkPopup: false | "info" | "editor";
141
142
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
142
143
  snapLines: readonly import("../snapping").SnapLine[];
@@ -179,8 +180,13 @@ export declare const actionAddToLibrary: {
179
180
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
180
181
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
181
182
  isBindingEnabled: boolean;
183
+ bindingPreference: "enabled" | "disabled";
184
+ isMidpointSnappingEnabled: boolean;
182
185
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
183
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
186
+ suggestedBinding: {
187
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
188
+ midPoint?: import("@excalidraw/math").GlobalPoint;
189
+ } | null;
184
190
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
185
191
  frameRendering: {
186
192
  enabled: boolean;
@@ -190,7 +196,7 @@ export declare const actionAddToLibrary: {
190
196
  };
191
197
  editingFrame: string | null;
192
198
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
193
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
199
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
194
200
  activeTool: {
195
201
  lastActiveTool: import("../types").ActiveTool | null;
196
202
  locked: boolean;
@@ -248,6 +254,10 @@ export declare const actionAddToLibrary: {
248
254
  } | {
249
255
  name: "elementLinkSelector";
250
256
  sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
257
+ } | {
258
+ name: "charts";
259
+ data: import("../charts").Spreadsheet;
260
+ rawText: string;
251
261
  };
252
262
  defaultSidebarDockedPreference: boolean;
253
263
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
@@ -263,7 +273,7 @@ export declare const actionAddToLibrary: {
263
273
  selectedElementsAreBeingDragged: boolean;
264
274
  shouldCacheIgnoreZoom: boolean;
265
275
  toast: {
266
- message: string;
276
+ message: React.ReactNode;
267
277
  closable?: boolean;
268
278
  duration?: number;
269
279
  } | null;
@@ -281,20 +291,12 @@ export declare const actionAddToLibrary: {
281
291
  height: number;
282
292
  offsetTop: number;
283
293
  offsetLeft: number;
284
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
294
+ fileHandle: FileSystemFileHandle | null;
285
295
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
286
296
  stats: {
287
297
  open: boolean;
288
298
  panels: number;
289
299
  };
290
- currentChartType: import("@excalidraw/element/types").ChartType;
291
- pasteDialog: {
292
- shown: false;
293
- data: null;
294
- } | {
295
- shown: true;
296
- data: import("../charts").Spreadsheet;
297
- };
298
300
  showHyperlinkPopup: false | "info" | "editor";
299
301
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
300
302
  snapLines: readonly import("../snapping").SnapLine[];
@@ -337,8 +339,13 @@ export declare const actionAddToLibrary: {
337
339
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
338
340
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
339
341
  isBindingEnabled: boolean;
342
+ bindingPreference: "enabled" | "disabled";
343
+ isMidpointSnappingEnabled: boolean;
340
344
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
341
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
345
+ suggestedBinding: {
346
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
347
+ midPoint?: import("@excalidraw/math").GlobalPoint;
348
+ } | null;
342
349
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
343
350
  frameRendering: {
344
351
  enabled: boolean;
@@ -348,7 +355,7 @@ export declare const actionAddToLibrary: {
348
355
  };
349
356
  editingFrame: string | null;
350
357
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
351
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
358
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
352
359
  activeTool: {
353
360
  lastActiveTool: import("../types").ActiveTool | null;
354
361
  locked: boolean;
@@ -406,6 +413,10 @@ export declare const actionAddToLibrary: {
406
413
  } | {
407
414
  name: "elementLinkSelector";
408
415
  sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
416
+ } | {
417
+ name: "charts";
418
+ data: import("../charts").Spreadsheet;
419
+ rawText: string;
409
420
  };
410
421
  defaultSidebarDockedPreference: boolean;
411
422
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
@@ -421,7 +432,7 @@ export declare const actionAddToLibrary: {
421
432
  selectedElementsAreBeingDragged: boolean;
422
433
  shouldCacheIgnoreZoom: boolean;
423
434
  toast: {
424
- message: string;
435
+ message: React.ReactNode;
425
436
  closable?: boolean;
426
437
  duration?: number;
427
438
  } | null;
@@ -439,20 +450,12 @@ export declare const actionAddToLibrary: {
439
450
  height: number;
440
451
  offsetTop: number;
441
452
  offsetLeft: number;
442
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
453
+ fileHandle: FileSystemFileHandle | null;
443
454
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
444
455
  stats: {
445
456
  open: boolean;
446
457
  panels: number;
447
458
  };
448
- currentChartType: import("@excalidraw/element/types").ChartType;
449
- pasteDialog: {
450
- shown: false;
451
- data: null;
452
- } | {
453
- shown: true;
454
- data: import("../charts").Spreadsheet;
455
- };
456
459
  showHyperlinkPopup: false | "info" | "editor";
457
460
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
458
461
  snapLines: readonly import("../snapping").SnapLine[];
@@ -1,4 +1,4 @@
1
- import type { ExcalidrawElement, ExcalidrawLinearElement } from "@excalidraw/element/types";
1
+ import type { ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawTextElement } from "@excalidraw/element/types";
2
2
  import type { Mutable } from "@excalidraw/common/utility-types";
3
3
  import type { AppState } from "../types";
4
4
  export declare const actionUnbindText: {
@@ -46,8 +46,13 @@ export declare const actionBindText: {
46
46
  multiElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawLinearElement> | null;
47
47
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
48
48
  isBindingEnabled: boolean;
49
+ bindingPreference: "enabled" | "disabled";
50
+ isMidpointSnappingEnabled: boolean;
49
51
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
50
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
52
+ suggestedBinding: {
53
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
54
+ midPoint?: import("@excalidraw/math").GlobalPoint;
55
+ } | null;
51
56
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
52
57
  frameRendering: {
53
58
  enabled: boolean;
@@ -57,7 +62,7 @@ export declare const actionBindText: {
57
62
  };
58
63
  editingFrame: string | null;
59
64
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
60
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
65
+ editingTextElement: ExcalidrawTextElement | null;
61
66
  activeTool: {
62
67
  lastActiveTool: import("../types").ActiveTool | null;
63
68
  locked: boolean;
@@ -115,6 +120,10 @@ export declare const actionBindText: {
115
120
  } | {
116
121
  name: "elementLinkSelector";
117
122
  sourceElementId: ExcalidrawElement["id"];
123
+ } | {
124
+ name: "charts";
125
+ data: import("../charts").Spreadsheet;
126
+ rawText: string;
118
127
  };
119
128
  defaultSidebarDockedPreference: boolean;
120
129
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
@@ -127,7 +136,7 @@ export declare const actionBindText: {
127
136
  selectedElementsAreBeingDragged: boolean;
128
137
  shouldCacheIgnoreZoom: boolean;
129
138
  toast: {
130
- message: string;
139
+ message: React.ReactNode;
131
140
  closable?: boolean;
132
141
  duration?: number;
133
142
  } | null;
@@ -145,20 +154,12 @@ export declare const actionBindText: {
145
154
  height: number;
146
155
  offsetTop: number;
147
156
  offsetLeft: number;
148
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
157
+ fileHandle: FileSystemFileHandle | null;
149
158
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
150
159
  stats: {
151
160
  open: boolean;
152
161
  panels: number;
153
162
  };
154
- currentChartType: import("@excalidraw/element/types").ChartType;
155
- pasteDialog: {
156
- shown: false;
157
- data: null;
158
- } | {
159
- shown: true;
160
- data: import("../charts").Spreadsheet;
161
- };
162
163
  showHyperlinkPopup: false | "info" | "editor";
163
164
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
164
165
  snapLines: readonly import("../snapping").SnapLine[];
@@ -216,8 +217,13 @@ export declare const actionWrapTextInContainer: {
216
217
  multiElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawLinearElement> | null;
217
218
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
218
219
  isBindingEnabled: boolean;
220
+ bindingPreference: "enabled" | "disabled";
221
+ isMidpointSnappingEnabled: boolean;
219
222
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
220
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
223
+ suggestedBinding: {
224
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
225
+ midPoint?: import("@excalidraw/math").GlobalPoint;
226
+ } | null;
221
227
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
222
228
  frameRendering: {
223
229
  enabled: boolean;
@@ -227,7 +233,7 @@ export declare const actionWrapTextInContainer: {
227
233
  };
228
234
  editingFrame: string | null;
229
235
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
230
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
236
+ editingTextElement: ExcalidrawTextElement | null;
231
237
  activeTool: {
232
238
  lastActiveTool: import("../types").ActiveTool | null;
233
239
  locked: boolean;
@@ -285,6 +291,10 @@ export declare const actionWrapTextInContainer: {
285
291
  } | {
286
292
  name: "elementLinkSelector";
287
293
  sourceElementId: ExcalidrawElement["id"];
294
+ } | {
295
+ name: "charts";
296
+ data: import("../charts").Spreadsheet;
297
+ rawText: string;
288
298
  };
289
299
  defaultSidebarDockedPreference: boolean;
290
300
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
@@ -297,7 +307,7 @@ export declare const actionWrapTextInContainer: {
297
307
  selectedElementsAreBeingDragged: boolean;
298
308
  shouldCacheIgnoreZoom: boolean;
299
309
  toast: {
300
- message: string;
310
+ message: React.ReactNode;
301
311
  closable?: boolean;
302
312
  duration?: number;
303
313
  } | null;
@@ -315,20 +325,12 @@ export declare const actionWrapTextInContainer: {
315
325
  height: number;
316
326
  offsetTop: number;
317
327
  offsetLeft: number;
318
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
328
+ fileHandle: FileSystemFileHandle | null;
319
329
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
320
330
  stats: {
321
331
  open: boolean;
322
332
  panels: number;
323
333
  };
324
- currentChartType: import("@excalidraw/element/types").ChartType;
325
- pasteDialog: {
326
- shown: false;
327
- data: null;
328
- } | {
329
- shown: true;
330
- data: import("../charts").Spreadsheet;
331
- };
332
334
  showHyperlinkPopup: false | "info" | "editor";
333
335
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
334
336
  snapLines: readonly import("../snapping").SnapLine[];