@excalidraw/excalidraw 0.18.0-58f7d33 → 0.18.0-6d75c4b34

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 (167) hide show
  1. package/dist/dev/chunk-CBGOW5JB.js +5669 -0
  2. package/dist/dev/chunk-CBGOW5JB.js.map +7 -0
  3. package/dist/dev/chunk-CP5DND7P.js +7 -0
  4. package/dist/dev/chunk-CP5DND7P.js.map +7 -0
  5. package/dist/dev/{chunk-X3RYHLJU.js → chunk-QF5FRM6O.js} +15 -5
  6. package/dist/dev/chunk-QF5FRM6O.js.map +7 -0
  7. package/dist/dev/data/{image-U2IPNUKJ.js → image-SURZSZNX.js} +3 -3
  8. package/dist/dev/index.css +100 -22
  9. package/dist/dev/index.css.map +3 -3
  10. package/dist/dev/index.js +8406 -9312
  11. package/dist/dev/index.js.map +4 -4
  12. package/dist/dev/locales/{en-CKWC2GMK.js → en-SMAPCEOQ.js} +2 -2
  13. package/dist/dev/subset-shared.chunk.js +1 -1
  14. package/dist/dev/subset-worker.chunk.js +1 -1
  15. package/dist/prod/chunk-A66AFZZU.js +7 -0
  16. package/dist/prod/chunk-I4UNSFV6.js +12 -0
  17. package/dist/prod/chunk-IRHK23LL.js +4 -0
  18. package/dist/prod/data/image-HXEZYJPQ.js +1 -0
  19. package/dist/prod/index.css +1 -1
  20. package/dist/prod/index.js +25 -17
  21. package/dist/prod/locales/{en-SBO6ZHT2.js → en-TYY6KWIJ.js} +1 -1
  22. package/dist/prod/subset-shared.chunk.js +1 -1
  23. package/dist/prod/subset-worker.chunk.js +1 -1
  24. package/dist/types/common/src/constants.d.ts +20 -3
  25. package/dist/types/{excalidraw → common/src}/emitter.d.ts +1 -1
  26. package/dist/types/common/src/font-metadata.d.ts +4 -2
  27. package/dist/types/common/src/index.d.ts +1 -0
  28. package/dist/types/common/src/utility-types.d.ts +5 -0
  29. package/dist/types/common/src/utils.d.ts +17 -4
  30. package/dist/types/{excalidraw/scene → element/src}/Scene.d.ts +11 -14
  31. package/dist/types/element/src/align.d.ts +3 -3
  32. package/dist/types/element/src/binding.d.ts +26 -16
  33. package/dist/types/element/src/bounds.d.ts +13 -5
  34. package/dist/types/element/src/collision.d.ts +18 -12
  35. package/dist/types/element/src/cropElement.d.ts +1 -1
  36. package/dist/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +63 -38
  37. package/dist/types/element/src/distance.d.ts +2 -2
  38. package/dist/types/element/src/dragElements.d.ts +3 -2
  39. package/dist/types/element/src/duplicate.d.ts +10 -13
  40. package/dist/types/element/src/elbowArrow.d.ts +1 -1
  41. package/dist/types/element/src/flowchart.d.ts +3 -2
  42. package/dist/types/element/src/fractionalIndex.d.ts +9 -3
  43. package/dist/types/element/src/frame.d.ts +5 -4
  44. package/dist/types/element/src/index.d.ts +43 -2
  45. package/dist/types/element/src/linearElementEditor.d.ts +22 -36
  46. package/dist/types/element/src/mutateElement.d.ts +11 -3
  47. package/dist/types/element/src/newElement.d.ts +4 -3
  48. package/dist/types/element/src/resizeElements.d.ts +5 -4
  49. package/dist/types/element/src/selection.d.ts +11 -5
  50. package/dist/types/element/src/shape.d.ts +42 -0
  51. package/dist/types/element/src/sizeHelpers.d.ts +2 -2
  52. package/dist/types/element/src/store.d.ts +232 -0
  53. package/dist/types/element/src/textElement.d.ts +4 -3
  54. package/dist/types/element/src/typeChecks.d.ts +19 -1
  55. package/dist/types/element/src/types.d.ts +15 -2
  56. package/dist/types/element/src/utils.d.ts +16 -6
  57. package/dist/types/element/src/zindex.d.ts +1 -1
  58. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +42 -51
  59. package/dist/types/excalidraw/actions/actionBoundText.d.ts +28 -34
  60. package/dist/types/excalidraw/actions/actionCanvas.d.ts +188 -227
  61. package/dist/types/excalidraw/actions/actionClipboard.d.ts +81 -98
  62. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +14 -17
  63. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +37 -45
  64. package/dist/types/excalidraw/actions/actionElementLink.d.ts +13 -16
  65. package/dist/types/excalidraw/actions/actionElementLock.d.ts +43 -50
  66. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +14 -17
  67. package/dist/types/excalidraw/actions/actionExport.d.ts +136 -163
  68. package/dist/types/excalidraw/actions/actionFinalize.d.ts +71 -37
  69. package/dist/types/excalidraw/actions/actionFrame.d.ts +103 -115
  70. package/dist/types/excalidraw/actions/actionGroup.d.ts +28 -34
  71. package/dist/types/excalidraw/actions/actionHistory.d.ts +1 -2
  72. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +506 -16
  73. package/dist/types/excalidraw/actions/actionLink.d.ts +13 -16
  74. package/dist/types/excalidraw/actions/actionMenu.d.ts +39 -48
  75. package/dist/types/excalidraw/actions/actionNavigate.d.ts +27 -33
  76. package/dist/types/excalidraw/actions/actionProperties.d.ts +203 -240
  77. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +13 -16
  78. package/dist/types/excalidraw/actions/actionStyles.d.ts +14 -17
  79. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +14 -17
  80. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +14 -17
  81. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +13 -189
  82. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
  83. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +14 -17
  84. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +14 -17
  85. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +14 -17
  86. package/dist/types/excalidraw/actions/types.d.ts +4 -3
  87. package/dist/types/excalidraw/appState.d.ts +19 -10
  88. package/dist/types/excalidraw/components/App.d.ts +30 -19
  89. package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -0
  90. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
  91. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +5 -1
  92. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
  93. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -3
  94. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -3
  95. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -2
  96. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
  97. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  98. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
  99. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
  100. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
  101. package/dist/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
  102. package/dist/types/excalidraw/components/Range.d.ts +3 -3
  103. package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -1
  104. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
  105. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
  106. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
  107. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +12 -2
  108. package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
  109. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
  110. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
  111. package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
  112. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
  113. package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -1
  114. package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -11
  115. package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
  116. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
  117. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
  118. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
  119. package/dist/types/excalidraw/components/icons.d.ts +3 -0
  120. package/dist/types/excalidraw/components/shapes.d.ts +1 -1
  121. package/dist/types/excalidraw/data/transform.d.ts +1 -1
  122. package/dist/types/excalidraw/editor-jotai.d.ts +6 -6
  123. package/dist/types/excalidraw/eraser/index.d.ts +0 -2
  124. package/dist/types/excalidraw/fonts/Fonts.d.ts +1 -1
  125. package/dist/types/excalidraw/history.d.ts +30 -22
  126. package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
  127. package/dist/types/excalidraw/index.d.ts +9 -9
  128. package/dist/types/excalidraw/lasso/index.d.ts +1 -0
  129. package/dist/types/excalidraw/lasso/utils.d.ts +2 -1
  130. package/dist/types/excalidraw/renderer/helpers.d.ts +7 -2
  131. package/dist/types/excalidraw/scene/Renderer.d.ts +1 -2
  132. package/dist/types/excalidraw/scene/index.d.ts +2 -2
  133. package/dist/types/excalidraw/scene/scrollbars.d.ts +2 -3
  134. package/dist/types/excalidraw/scene/types.d.ts +2 -0
  135. package/dist/types/excalidraw/snapping.d.ts +2 -2
  136. package/dist/types/excalidraw/types.d.ts +30 -10
  137. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
  138. package/dist/types/math/src/angle.d.ts +2 -0
  139. package/dist/types/math/src/constants.d.ts +3 -0
  140. package/dist/types/math/src/curve.d.ts +34 -0
  141. package/dist/types/math/src/index.d.ts +1 -0
  142. package/dist/types/math/src/point.d.ts +1 -1
  143. package/dist/types/math/src/rectangle.d.ts +2 -0
  144. package/dist/types/math/src/vector.d.ts +8 -2
  145. package/dist/types/utils/src/bbox.d.ts +1 -1
  146. package/dist/types/utils/src/index.d.ts +1 -1
  147. package/dist/types/utils/src/withinBounds.d.ts +1 -1
  148. package/history.ts +147 -110
  149. package/package.json +12 -9
  150. package/dist/dev/chunk-KKJLIRJU.js +0 -7
  151. package/dist/dev/chunk-KKJLIRJU.js.map +0 -7
  152. package/dist/dev/chunk-LEJJ2YZY.js +0 -18711
  153. package/dist/dev/chunk-LEJJ2YZY.js.map +0 -7
  154. package/dist/dev/chunk-X3RYHLJU.js.map +0 -7
  155. package/dist/prod/chunk-IUH5AXLB.js +0 -12
  156. package/dist/prod/chunk-QUX7WTVH.js +0 -7
  157. package/dist/prod/chunk-RQK6WG4F.js +0 -33
  158. package/dist/prod/data/image-UQDATCXC.js +0 -1
  159. package/dist/types/element/src/Shape.d.ts +0 -17
  160. package/dist/types/element/src/ShapeCache.d.ts +0 -25
  161. package/dist/types/element/src/shapes.d.ts +0 -23
  162. package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
  163. package/dist/types/excalidraw/store.d.ts +0 -129
  164. package/dist/types/excalidraw/visualdebug.d.ts +0 -41
  165. package/dist/types/utils/src/collision.d.ts +0 -8
  166. /package/dist/dev/data/{image-U2IPNUKJ.js.map → image-SURZSZNX.js.map} +0 -0
  167. /package/dist/dev/locales/{en-CKWC2GMK.js.map → en-SMAPCEOQ.js.map} +0 -0
@@ -0,0 +1,232 @@
1
+ import { Emitter } from "@excalidraw/common";
2
+ import type App from "@excalidraw/excalidraw/components/App";
3
+ import type { DTO, ValueOf } from "@excalidraw/common/utility-types";
4
+ import type { AppState, ObservedAppState } from "@excalidraw/excalidraw/types";
5
+ import { ElementsDelta, AppStateDelta } from "./delta";
6
+ import type { ApplyToOptions } from "./delta";
7
+ import type { ExcalidrawElement, OrderedExcalidrawElement, SceneElementsMap } from "./types";
8
+ export declare const CaptureUpdateAction: {
9
+ /**
10
+ * Immediately undoable.
11
+ *
12
+ * Use for updates which should be captured.
13
+ * Should be used for most of the local updates, except ephemerals such as dragging or resizing.
14
+ *
15
+ * These updates will _immediately_ make it to the local undo / redo stacks.
16
+ */
17
+ readonly IMMEDIATELY: "IMMEDIATELY";
18
+ /**
19
+ * Never undoable.
20
+ *
21
+ * Use for updates which should never be recorded, such as remote updates
22
+ * or scene initialization.
23
+ *
24
+ * These updates will _never_ make it to the local undo / redo stacks.
25
+ */
26
+ readonly NEVER: "NEVER";
27
+ /**
28
+ * Eventually undoable.
29
+ *
30
+ * Use for updates which should not be captured immediately - likely
31
+ * exceptions which are part of some async multi-step process. Otherwise, all
32
+ * such updates would end up being captured with the next
33
+ * `CaptureUpdateAction.IMMEDIATELY` - triggered either by the next `updateScene`
34
+ * or internally by the editor.
35
+ *
36
+ * These updates will _eventually_ make it to the local undo / redo stacks.
37
+ */
38
+ readonly EVENTUALLY: "EVENTUALLY";
39
+ };
40
+ export type CaptureUpdateActionType = ValueOf<typeof CaptureUpdateAction>;
41
+ /**
42
+ * Store which captures the observed changes and emits them as `StoreIncrement` events.
43
+ */
44
+ export declare class Store {
45
+ private readonly app;
46
+ readonly onDurableIncrementEmitter: Emitter<[DurableIncrement]>;
47
+ readonly onStoreIncrementEmitter: Emitter<[DurableIncrement | EphemeralIncrement]>;
48
+ private scheduledMacroActions;
49
+ private scheduledMicroActions;
50
+ private _snapshot;
51
+ get snapshot(): StoreSnapshot;
52
+ set snapshot(snapshot: StoreSnapshot);
53
+ constructor(app: App);
54
+ scheduleAction(action: CaptureUpdateActionType): void;
55
+ /**
56
+ * Use to schedule a delta calculation, which will consquentially be emitted as `DurableStoreIncrement` and pushed in the undo stack.
57
+ */
58
+ scheduleCapture(): void;
59
+ /**
60
+ * Schedule special "micro" actions, to-be executed before the next commit, before it executes a scheduled "macro" action.
61
+ */
62
+ scheduleMicroAction(params: {
63
+ action: CaptureUpdateActionType;
64
+ elements: readonly ExcalidrawElement[] | undefined;
65
+ appState: AppState | ObservedAppState | undefined;
66
+ } | {
67
+ action: typeof CaptureUpdateAction.IMMEDIATELY;
68
+ change: StoreChange;
69
+ delta: StoreDelta;
70
+ } | {
71
+ action: typeof CaptureUpdateAction.NEVER | typeof CaptureUpdateAction.EVENTUALLY;
72
+ change: StoreChange;
73
+ }): void;
74
+ /**
75
+ * Performs the incoming `CaptureUpdateAction` and emits the corresponding `StoreIncrement`.
76
+ * Emits `DurableStoreIncrement` when action is "capture", emits `EphemeralStoreIncrement` otherwise.
77
+ *
78
+ * @emits StoreIncrement
79
+ */
80
+ commit(elements: SceneElementsMap | undefined, appState: AppState | ObservedAppState | undefined): void;
81
+ /**
82
+ * Clears the store instance.
83
+ */
84
+ clear(): void;
85
+ /**
86
+ * Performs delta & change calculation and emits a durable increment.
87
+ *
88
+ * @emits StoreIncrement.
89
+ */
90
+ private emitDurableIncrement;
91
+ /**
92
+ * Performs change calculation and emits an ephemeral increment.
93
+ *
94
+ * @emits EphemeralStoreIncrement
95
+ */
96
+ private emitEphemeralIncrement;
97
+ private applyChangeToSnapshot;
98
+ /**
99
+ * Clones the snapshot if there are changes detected.
100
+ */
101
+ private maybeCloneSnapshot;
102
+ private flushMicroActions;
103
+ private processAction;
104
+ /**
105
+ * Returns the scheduled macro action.
106
+ */
107
+ private getScheduledMacroAction;
108
+ /**
109
+ * Ensures that the scheduled actions invariant is satisfied.
110
+ */
111
+ private satisfiesScheduledActionsInvariant;
112
+ }
113
+ /**
114
+ * Repsents a change to the store containing changed elements and appState.
115
+ */
116
+ export declare class StoreChange {
117
+ readonly elements: Record<string, OrderedExcalidrawElement>;
118
+ readonly appState: Partial<ObservedAppState>;
119
+ private constructor();
120
+ static create(prevSnapshot: StoreSnapshot, nextSnapshot: StoreSnapshot): StoreChange;
121
+ }
122
+ /**
123
+ * Encpasulates any change to the store (durable or ephemeral).
124
+ */
125
+ export declare abstract class StoreIncrement {
126
+ readonly type: "durable" | "ephemeral";
127
+ readonly change: StoreChange;
128
+ protected constructor(type: "durable" | "ephemeral", change: StoreChange);
129
+ static isDurable(increment: StoreIncrement): increment is DurableIncrement;
130
+ static isEphemeral(increment: StoreIncrement): increment is EphemeralIncrement;
131
+ }
132
+ /**
133
+ * Represents a durable change to the store.
134
+ */
135
+ export declare class DurableIncrement extends StoreIncrement {
136
+ readonly change: StoreChange;
137
+ readonly delta: StoreDelta;
138
+ constructor(change: StoreChange, delta: StoreDelta);
139
+ }
140
+ /**
141
+ * Represents an ephemeral change to the store.
142
+ */
143
+ export declare class EphemeralIncrement extends StoreIncrement {
144
+ readonly change: StoreChange;
145
+ constructor(change: StoreChange);
146
+ }
147
+ /**
148
+ * Represents a captured delta by the Store.
149
+ */
150
+ export declare class StoreDelta {
151
+ readonly id: string;
152
+ readonly elements: ElementsDelta;
153
+ readonly appState: AppStateDelta;
154
+ protected constructor(id: string, elements: ElementsDelta, appState: AppStateDelta);
155
+ /**
156
+ * Create a new instance of `StoreDelta`.
157
+ */
158
+ static create(elements: ElementsDelta, appState: AppStateDelta, opts?: {
159
+ id: string;
160
+ }): StoreDelta;
161
+ /**
162
+ * Calculate the delta between the previous and next snapshot.
163
+ */
164
+ static calculate(prevSnapshot: StoreSnapshot, nextSnapshot: StoreSnapshot): StoreDelta;
165
+ /**
166
+ * Restore a store delta instance from a DTO.
167
+ */
168
+ static restore(storeDeltaDTO: DTO<StoreDelta>): StoreDelta;
169
+ /**
170
+ * Parse and load the delta from the remote payload.
171
+ */
172
+ static load({ id, elements: { added, removed, updated }, }: DTO<StoreDelta>): StoreDelta;
173
+ /**
174
+ * Inverse store delta, creates new instance of `StoreDelta`.
175
+ */
176
+ static inverse(delta: StoreDelta): StoreDelta;
177
+ /**
178
+ * Apply the delta to the passed elements and appState, does not modify the snapshot.
179
+ */
180
+ static applyTo(delta: StoreDelta, elements: SceneElementsMap, appState: AppState, options?: ApplyToOptions): [SceneElementsMap, AppState, boolean];
181
+ /**
182
+ * Apply latest (remote) changes to the delta, creates new instance of `StoreDelta`.
183
+ */
184
+ static applyLatestChanges(delta: StoreDelta, prevElements: SceneElementsMap, nextElements: SceneElementsMap, modifierOptions?: "deleted" | "inserted"): StoreDelta;
185
+ isEmpty(): boolean;
186
+ }
187
+ /**
188
+ * Represents a snapshot of the captured or updated changes in the store,
189
+ * used for producing deltas and emitting `DurableStoreIncrement`s.
190
+ */
191
+ export declare class StoreSnapshot {
192
+ readonly elements: SceneElementsMap;
193
+ readonly appState: ObservedAppState;
194
+ readonly metadata: {
195
+ didElementsChange: boolean;
196
+ didAppStateChange: boolean;
197
+ isEmpty?: boolean;
198
+ };
199
+ private _lastChangedElementsHash;
200
+ private _lastChangedAppStateHash;
201
+ private constructor();
202
+ static create(elements: SceneElementsMap, appState: AppState | ObservedAppState, metadata?: {
203
+ didElementsChange: boolean;
204
+ didAppStateChange: boolean;
205
+ }): StoreSnapshot;
206
+ static empty(): StoreSnapshot;
207
+ getChangedElements(prevSnapshot: StoreSnapshot): Record<string, OrderedExcalidrawElement>;
208
+ getChangedAppState(prevSnapshot: StoreSnapshot): Partial<ObservedAppState>;
209
+ isEmpty(): boolean | undefined;
210
+ /**
211
+ * Apply the change and return a new snapshot instance.
212
+ */
213
+ applyChange(change: StoreChange): StoreSnapshot;
214
+ /**
215
+ * Efficiently clone the existing snapshot, only if we detected changes.
216
+ *
217
+ * @returns same instance if there are no changes detected, new instance otherwise.
218
+ */
219
+ maybeClone(action: CaptureUpdateActionType, elements: SceneElementsMap | undefined, appState: AppState | ObservedAppState | undefined): StoreSnapshot;
220
+ private maybeCreateAppStateSnapshot;
221
+ private maybeCreateElementsSnapshot;
222
+ private detectChangedAppState;
223
+ /**
224
+ * Detect if there are any changed elements.
225
+ */
226
+ private detectChangedElements;
227
+ /**
228
+ * Perform structural clone, deep cloning only elements that changed.
229
+ */
230
+ private createElementsSnapshot;
231
+ }
232
+ export declare const getObservedAppState: (appState: AppState | ObservedAppState) => ObservedAppState;
@@ -1,10 +1,11 @@
1
1
  import type { AppState } from "@excalidraw/excalidraw/types";
2
2
  import type { ExtractSetType } from "@excalidraw/common/utility-types";
3
- import type { Radians } from "../../math/src";
3
+ import type { Radians } from "@excalidraw/math";
4
+ import type { Scene } from "./Scene";
4
5
  import type { MaybeTransformHandleType } from "./transformHandles";
5
6
  import type { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, NonDeletedExcalidrawElement } from "./types";
6
- export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null, elementsMap: ElementsMap, informMutation?: boolean) => void;
7
- export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, elementsMap: ElementsMap, transformHandleType: MaybeTransformHandleType, shouldMaintainAspectRatio?: boolean) => void;
7
+ export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null, scene: Scene) => void;
8
+ export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, scene: Scene, transformHandleType: MaybeTransformHandleType, shouldMaintainAspectRatio?: boolean) => void;
8
9
  export declare const computeBoundTextPosition: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer, elementsMap: ElementsMap) => {
9
10
  x: number;
10
11
  y: number;
@@ -1,7 +1,7 @@
1
1
  import type { ElementOrToolType } from "@excalidraw/excalidraw/types";
2
2
  import type { MarkNonNullable } from "@excalidraw/common/utility-types";
3
3
  import type { Bounds } from "./bounds";
4
- import type { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, PointBinding, FixedPointBinding, ExcalidrawFlowchartNodeElement } from "./types";
4
+ import type { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement, ExcalidrawElbowArrowElement, ExcalidrawLineElement, PointBinding, FixedPointBinding, ExcalidrawFlowchartNodeElement, ExcalidrawLinearElementSubType } from "./types";
5
5
  export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
6
6
  export declare const isImageElement: (element: ExcalidrawElement | null) => element is ExcalidrawImageElement;
7
7
  export declare const isEmbeddableElement: (element: ExcalidrawElement | null | undefined) => element is ExcalidrawEmbeddableElement;
@@ -14,8 +14,15 @@ export declare const isFrameLikeElement: (element: ExcalidrawElement | null) =>
14
14
  export declare const isFreeDrawElement: (element?: ExcalidrawElement | null) => element is ExcalidrawFreeDrawElement;
15
15
  export declare const isFreeDrawElementType: (elementType: ExcalidrawElementType) => boolean;
16
16
  export declare const isLinearElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLinearElement;
17
+ export declare const isLineElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLineElement;
17
18
  export declare const isArrowElement: (element?: ExcalidrawElement | null) => element is ExcalidrawArrowElement;
18
19
  export declare const isElbowArrow: (element?: ExcalidrawElement) => element is ExcalidrawElbowArrowElement;
20
+ /**
21
+ * sharp or curved arrow, but not elbow
22
+ */
23
+ export declare const isSimpleArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
24
+ export declare const isSharpArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
25
+ export declare const isCurvedArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
19
26
  export declare const isLinearElementType: (elementType: ElementOrToolType) => boolean;
20
27
  export declare const isBindingElement: (element?: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawLinearElement;
21
28
  export declare const isBindingElementType: (elementType: ElementOrToolType) => boolean;
@@ -27,6 +34,7 @@ export declare const isExcalidrawElement: (element: any) => element is Excalidra
27
34
  export declare const isFlowchartNodeElement: (element: ExcalidrawElement) => element is ExcalidrawFlowchartNodeElement;
28
35
  export declare const hasBoundTextElement: (element: ExcalidrawElement | null) => element is MarkNonNullable<ExcalidrawBindableElement, "boundElements">;
29
36
  export declare const isBoundToContainer: (element: ExcalidrawElement | null) => element is ExcalidrawTextElementWithContainer;
37
+ export declare const isArrowBoundToElement: (element: ExcalidrawArrowElement) => boolean;
30
38
  export declare const isUsingAdaptiveRadius: (type: string) => boolean;
31
39
  export declare const isUsingProportionalRadius: (type: string) => boolean;
32
40
  export declare const canApplyRoundnessTypeToElement: (roundnessType: RoundnessType, element: ExcalidrawElement) => boolean;
@@ -37,3 +45,13 @@ export declare const getDefaultRoundnessTypeForElement: (element: ExcalidrawElem
37
45
  } | null;
38
46
  export declare const isFixedPointBinding: (binding: PointBinding | FixedPointBinding) => binding is FixedPointBinding;
39
47
  export declare const isBounds: (box: unknown) => box is Bounds;
48
+ export declare const getLinearElementSubType: (element: ExcalidrawLinearElement) => ExcalidrawLinearElementSubType;
49
+ /**
50
+ * Checks if current element points meet all the conditions for polygon=true
51
+ * (this isn't a element type check, for that use isLineElement).
52
+ *
53
+ * If you want to check if points *can* be turned into a polygon, use
54
+ * canBecomePolygon(points).
55
+ */
56
+ export declare const isValidPolygon: (points: ExcalidrawLineElement["points"]) => boolean;
57
+ export declare const canBecomePolygon: (points: ExcalidrawLineElement["points"]) => boolean;
@@ -151,7 +151,7 @@ export type ExcalidrawFrameLikeElement = ExcalidrawFrameElement | ExcalidrawMagi
151
151
  */
152
152
  export type ExcalidrawGenericElement = ExcalidrawSelectionElement | ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
153
153
  export type ExcalidrawFlowchartNodeElement = ExcalidrawRectangleElement | ExcalidrawDiamondElement | ExcalidrawEllipseElement;
154
- export type ExcalidrawRectanguloidElement = ExcalidrawRectangleElement | ExcalidrawImageElement | ExcalidrawTextElement | ExcalidrawFreeDrawElement | ExcalidrawIframeLikeElement | ExcalidrawFrameLikeElement | ExcalidrawEmbeddableElement;
154
+ export type ExcalidrawRectanguloidElement = ExcalidrawRectangleElement | ExcalidrawImageElement | ExcalidrawTextElement | ExcalidrawFreeDrawElement | ExcalidrawIframeLikeElement | ExcalidrawFrameLikeElement | ExcalidrawEmbeddableElement | ExcalidrawSelectionElement;
155
155
  /**
156
156
  * ExcalidrawElement should be JSON serializable and (eventually) contain
157
157
  * no computed data. The list of all ExcalidrawElements should be shareable
@@ -205,6 +205,11 @@ export type PointBinding = {
205
205
  export type FixedPointBinding = Merge<PointBinding, {
206
206
  fixedPoint: FixedPoint;
207
207
  }>;
208
+ type Index = number;
209
+ export type PointsPositionUpdates = Map<Index, {
210
+ point: LocalPoint;
211
+ isDragging?: boolean;
212
+ }>;
208
213
  export type Arrowhead = "arrow" | "bar" | "dot" | "circle" | "circle_outline" | "triangle" | "triangle_outline" | "diamond" | "diamond_outline" | "crowfoot_one" | "crowfoot_many" | "crowfoot_one_or_many";
209
214
  export type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<{
210
215
  type: "line" | "arrow";
@@ -215,10 +220,14 @@ export type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<{
215
220
  startArrowhead: Arrowhead | null;
216
221
  endArrowhead: Arrowhead | null;
217
222
  }>;
223
+ export type ExcalidrawLineElement = ExcalidrawLinearElement & Readonly<{
224
+ type: "line";
225
+ polygon: boolean;
226
+ }>;
218
227
  export type FixedSegment = {
219
228
  start: LocalPoint;
220
229
  end: LocalPoint;
221
- index: number;
230
+ index: Index;
222
231
  };
223
232
  export type ExcalidrawArrowElement = ExcalidrawLinearElement & Readonly<{
224
233
  type: "arrow";
@@ -279,4 +288,8 @@ export type SceneElementsMap = Map<ExcalidrawElement["id"], Ordered<ExcalidrawEl
279
288
  */
280
289
  export type NonDeletedSceneElementsMap = Map<ExcalidrawElement["id"], Ordered<NonDeletedExcalidrawElement>> & MakeBrand<"NonDeletedSceneElementsMap">;
281
290
  export type ElementsMapOrArray = readonly ExcalidrawElement[] | Readonly<ElementsMap>;
291
+ export type ExcalidrawLinearElementSubType = "line" | "sharpArrow" | "curvedArrow" | "elbowArrow";
292
+ export type ConvertibleGenericTypes = "rectangle" | "diamond" | "ellipse";
293
+ export type ConvertibleLinearTypes = ExcalidrawLinearElementSubType;
294
+ export type ConvertibleTypes = ConvertibleGenericTypes | ConvertibleLinearTypes;
282
295
  export {};
@@ -1,21 +1,31 @@
1
1
  import { type GlobalPoint } from "@excalidraw/math";
2
2
  import type { Curve, LineSegment } from "@excalidraw/math";
3
- import type { ExcalidrawDiamondElement, ExcalidrawRectanguloidElement } from "./types";
3
+ import type { Zoom } from "@excalidraw/excalidraw/types";
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
+ */
11
+ export declare function deconstructLinearOrFreeDrawElement(element: ExcalidrawLinearElement | ExcalidrawFreeDrawElement): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
4
12
  /**
5
13
  * Get the building components of a rectanguloid element in the form of
6
- * line segments and curves.
14
+ * line segments and curves **unrotated**.
7
15
  *
8
16
  * @param element Target rectanguloid element
9
17
  * @param offset Optional offset to expand the rectanguloid shape
10
- * @returns Tuple of line segments (0) and curves (1)
18
+ * @returns Tuple of **unrotated** line segments (0) and curves (1)
11
19
  */
12
20
  export declare function deconstructRectanguloidElement(element: ExcalidrawRectanguloidElement, offset?: number): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
13
21
  /**
14
- * Get the building components of a diamond element in the form of
15
- * 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.
16
24
  *
17
25
  * @param element The element to deconstruct
18
26
  * @param offset An optional offset
19
- * @returns Tuple of line segments (0) and curves (1)
27
+ * @returns Tuple of line **unrotated** segments (0) and curves (1)
20
28
  */
21
29
  export declare function deconstructDiamondElement(element: ExcalidrawDiamondElement, offset?: number): [LineSegment<GlobalPoint>[], Curve<GlobalPoint>[]];
30
+ export declare const isPathALoop: (points: ExcalidrawLinearElement["points"], zoomValue?: Zoom["value"]) => boolean;
31
+ export declare const getCornerRadius: (x: number, element: ExcalidrawElement) => number;
@@ -1,5 +1,5 @@
1
1
  import type { AppState } from "@excalidraw/excalidraw/types";
2
- import type Scene from "@excalidraw/excalidraw/scene/Scene";
2
+ import type { Scene } from "./Scene";
3
3
  import type { ExcalidrawElement } from "./types";
4
4
  export declare const moveOneLeft: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
5
5
  export declare const moveOneRight: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
@@ -20,7 +20,7 @@ export declare const actionAddToLibrary: {
20
20
  errorMessage: import("react").ReactNode;
21
21
  activeEmbeddable: {
22
22
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
23
- state: "hover" | "active";
23
+ state: "active" | "hover";
24
24
  } | null;
25
25
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
26
26
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -28,7 +28,7 @@ export declare const actionAddToLibrary: {
28
28
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
29
29
  isBindingEnabled: boolean;
30
30
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
31
- suggestedBindings: import("@excalidraw/element/binding").SuggestedBinding[];
31
+ suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
32
32
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
33
33
  frameRendering: {
34
34
  enabled: boolean;
@@ -39,7 +39,7 @@ export declare const actionAddToLibrary: {
39
39
  editingFrame: string | null;
40
40
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
41
41
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
42
- editingLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
42
+ editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
43
43
  activeTool: {
44
44
  lastActiveTool: import("../types").ActiveTool | null;
45
45
  locked: boolean;
@@ -77,7 +77,7 @@ export declare const actionAddToLibrary: {
77
77
  zoom: Readonly<{
78
78
  value: import("../types").NormalizedZoomValue;
79
79
  }>;
80
- openMenu: "shape" | "canvas" | null;
80
+ openMenu: "canvas" | "shape" | null;
81
81
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
82
82
  openSidebar: {
83
83
  name: string;
@@ -87,7 +87,7 @@ export declare const actionAddToLibrary: {
87
87
  name: "imageExport" | "help" | "jsonExport";
88
88
  } | {
89
89
  name: "ttd";
90
- tab: "text-to-diagram" | "mermaid";
90
+ tab: "mermaid" | "text-to-diagram";
91
91
  } | {
92
92
  name: "commandPalette";
93
93
  } | {
@@ -154,9 +154,8 @@ export declare const actionAddToLibrary: {
154
154
  shown: true;
155
155
  data: import("../charts").Spreadsheet;
156
156
  };
157
- pendingImageElementId: string | null;
158
157
  showHyperlinkPopup: false | "editor" | "info";
159
- selectedLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
158
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
160
159
  snapLines: readonly import("../snapping").SnapLine[];
161
160
  originSnapOffset: {
162
161
  x: number;
@@ -167,16 +166,14 @@ export declare const actionAddToLibrary: {
167
166
  followedBy: Set<import("../types").SocketId>;
168
167
  isCropping: boolean;
169
168
  croppingElementId: string | null;
170
- searchMatches: readonly {
171
- id: string;
172
- focus: boolean;
173
- matchedLines: {
174
- offsetX: number;
175
- offsetY: number;
176
- width: number;
177
- height: number;
178
- }[];
179
- }[];
169
+ searchMatches: Readonly<{
170
+ focusedId: string | null;
171
+ matches: readonly import("../types").SearchMatch[];
172
+ }> | null;
173
+ activeLockedId: string | null;
174
+ lockedMultiSelections: {
175
+ [groupId: string]: true;
176
+ };
180
177
  };
181
178
  } | {
182
179
  captureUpdate: "EVENTUALLY";
@@ -191,7 +188,7 @@ export declare const actionAddToLibrary: {
191
188
  isLoading: boolean;
192
189
  activeEmbeddable: {
193
190
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
194
- state: "hover" | "active";
191
+ state: "active" | "hover";
195
192
  } | null;
196
193
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
197
194
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -199,7 +196,7 @@ export declare const actionAddToLibrary: {
199
196
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
200
197
  isBindingEnabled: boolean;
201
198
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
202
- suggestedBindings: import("@excalidraw/element/binding").SuggestedBinding[];
199
+ suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
203
200
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
204
201
  frameRendering: {
205
202
  enabled: boolean;
@@ -210,7 +207,7 @@ export declare const actionAddToLibrary: {
210
207
  editingFrame: string | null;
211
208
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
212
209
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
213
- editingLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
210
+ editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
214
211
  activeTool: {
215
212
  lastActiveTool: import("../types").ActiveTool | null;
216
213
  locked: boolean;
@@ -248,7 +245,7 @@ export declare const actionAddToLibrary: {
248
245
  zoom: Readonly<{
249
246
  value: import("../types").NormalizedZoomValue;
250
247
  }>;
251
- openMenu: "shape" | "canvas" | null;
248
+ openMenu: "canvas" | "shape" | null;
252
249
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
253
250
  openSidebar: {
254
251
  name: string;
@@ -258,7 +255,7 @@ export declare const actionAddToLibrary: {
258
255
  name: "imageExport" | "help" | "jsonExport";
259
256
  } | {
260
257
  name: "ttd";
261
- tab: "text-to-diagram" | "mermaid";
258
+ tab: "mermaid" | "text-to-diagram";
262
259
  } | {
263
260
  name: "commandPalette";
264
261
  } | {
@@ -330,9 +327,8 @@ export declare const actionAddToLibrary: {
330
327
  shown: true;
331
328
  data: import("../charts").Spreadsheet;
332
329
  };
333
- pendingImageElementId: string | null;
334
330
  showHyperlinkPopup: false | "editor" | "info";
335
- selectedLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
331
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
336
332
  snapLines: readonly import("../snapping").SnapLine[];
337
333
  originSnapOffset: {
338
334
  x: number;
@@ -343,16 +339,14 @@ export declare const actionAddToLibrary: {
343
339
  followedBy: Set<import("../types").SocketId>;
344
340
  isCropping: boolean;
345
341
  croppingElementId: string | null;
346
- searchMatches: readonly {
347
- id: string;
348
- focus: boolean;
349
- matchedLines: {
350
- offsetX: number;
351
- offsetY: number;
352
- width: number;
353
- height: number;
354
- }[];
355
- }[];
342
+ searchMatches: Readonly<{
343
+ focusedId: string | null;
344
+ matches: readonly import("../types").SearchMatch[];
345
+ }> | null;
346
+ activeLockedId: string | null;
347
+ lockedMultiSelections: {
348
+ [groupId: string]: true;
349
+ };
356
350
  };
357
351
  }> | {
358
352
  captureUpdate: "EVENTUALLY";
@@ -367,7 +361,7 @@ export declare const actionAddToLibrary: {
367
361
  isLoading: boolean;
368
362
  activeEmbeddable: {
369
363
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
370
- state: "hover" | "active";
364
+ state: "active" | "hover";
371
365
  } | null;
372
366
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
373
367
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -375,7 +369,7 @@ export declare const actionAddToLibrary: {
375
369
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
376
370
  isBindingEnabled: boolean;
377
371
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
378
- suggestedBindings: import("@excalidraw/element/binding").SuggestedBinding[];
372
+ suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
379
373
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
380
374
  frameRendering: {
381
375
  enabled: boolean;
@@ -386,7 +380,7 @@ export declare const actionAddToLibrary: {
386
380
  editingFrame: string | null;
387
381
  elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
388
382
  editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
389
- editingLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
383
+ editingLinearElement: import("@excalidraw/element").LinearElementEditor | null;
390
384
  activeTool: {
391
385
  lastActiveTool: import("../types").ActiveTool | null;
392
386
  locked: boolean;
@@ -424,7 +418,7 @@ export declare const actionAddToLibrary: {
424
418
  zoom: Readonly<{
425
419
  value: import("../types").NormalizedZoomValue;
426
420
  }>;
427
- openMenu: "shape" | "canvas" | null;
421
+ openMenu: "canvas" | "shape" | null;
428
422
  openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
429
423
  openSidebar: {
430
424
  name: string;
@@ -434,7 +428,7 @@ export declare const actionAddToLibrary: {
434
428
  name: "imageExport" | "help" | "jsonExport";
435
429
  } | {
436
430
  name: "ttd";
437
- tab: "text-to-diagram" | "mermaid";
431
+ tab: "mermaid" | "text-to-diagram";
438
432
  } | {
439
433
  name: "commandPalette";
440
434
  } | {
@@ -506,9 +500,8 @@ export declare const actionAddToLibrary: {
506
500
  shown: true;
507
501
  data: import("../charts").Spreadsheet;
508
502
  };
509
- pendingImageElementId: string | null;
510
503
  showHyperlinkPopup: false | "editor" | "info";
511
- selectedLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
504
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
512
505
  snapLines: readonly import("../snapping").SnapLine[];
513
506
  originSnapOffset: {
514
507
  x: number;
@@ -519,16 +512,14 @@ export declare const actionAddToLibrary: {
519
512
  followedBy: Set<import("../types").SocketId>;
520
513
  isCropping: boolean;
521
514
  croppingElementId: string | null;
522
- searchMatches: readonly {
523
- id: string;
524
- focus: boolean;
525
- matchedLines: {
526
- offsetX: number;
527
- offsetY: number;
528
- width: number;
529
- height: number;
530
- }[];
531
- }[];
515
+ searchMatches: Readonly<{
516
+ focusedId: string | null;
517
+ matches: readonly import("../types").SearchMatch[];
518
+ }> | null;
519
+ activeLockedId: string | null;
520
+ lockedMultiSelections: {
521
+ [groupId: string]: true;
522
+ };
532
523
  };
533
524
  };
534
525
  label: string;