@excalidraw/excalidraw 0.18.0-a18b139 → 0.18.0-a30e1b2

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 (97) hide show
  1. package/dist/dev/{chunk-X3RYHLJU.js → chunk-CARD3WJZ.js} +9 -4
  2. package/dist/dev/chunk-CARD3WJZ.js.map +7 -0
  3. package/dist/dev/{chunk-U3G3LY5D.js → chunk-ETWEPOFC.js} +7284 -6864
  4. package/dist/dev/chunk-ETWEPOFC.js.map +7 -0
  5. package/dist/dev/{chunk-MJMGTOVG.js → chunk-RS23HYC4.js} +2 -2
  6. package/dist/dev/data/{image-Y366K5SN.js → image-AYLHSOBV.js} +3 -3
  7. package/dist/dev/index.css +43 -2
  8. package/dist/dev/index.css.map +3 -3
  9. package/dist/dev/index.js +2959 -1807
  10. package/dist/dev/index.js.map +4 -4
  11. package/dist/dev/locales/{en-CKWC2GMK.js → en-E3O5XSXJ.js} +2 -2
  12. package/dist/dev/subset-shared.chunk.js +1 -1
  13. package/dist/dev/subset-worker.chunk.js +1 -1
  14. package/dist/prod/chunk-6BSJPDKJ.js +33 -0
  15. package/dist/prod/{chunk-IUH5AXLB.js → chunk-FGHASORR.js} +4 -4
  16. package/dist/prod/{chunk-VQA74LVG.js → chunk-SBKTMZM7.js} +1 -1
  17. package/dist/prod/data/image-VAYKYPXV.js +1 -0
  18. package/dist/prod/index.css +1 -1
  19. package/dist/prod/index.js +19 -18
  20. package/dist/prod/locales/{en-SBO6ZHT2.js → en-44IKVKYT.js} +1 -1
  21. package/dist/prod/subset-shared.chunk.js +1 -1
  22. package/dist/prod/subset-worker.chunk.js +1 -1
  23. package/dist/types/common/src/constants.d.ts +2 -0
  24. package/dist/types/{excalidraw → common/src}/emitter.d.ts +1 -1
  25. package/dist/types/common/src/font-metadata.d.ts +4 -2
  26. package/dist/types/common/src/index.d.ts +1 -0
  27. package/dist/types/common/src/utility-types.d.ts +5 -0
  28. package/dist/types/common/src/utils.d.ts +9 -0
  29. package/dist/types/element/src/binding.d.ts +10 -2
  30. package/dist/types/element/src/bounds.d.ts +1 -1
  31. package/dist/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +40 -35
  32. package/dist/types/element/src/frame.d.ts +1 -0
  33. package/dist/types/element/src/index.d.ts +2 -2
  34. package/dist/types/element/src/linearElementEditor.d.ts +3 -7
  35. package/dist/types/element/src/newElement.d.ts +2 -2
  36. package/dist/types/element/src/store.d.ts +227 -0
  37. package/dist/types/element/src/transformHandles.d.ts +2 -2
  38. package/dist/types/element/src/typeChecks.d.ts +3 -0
  39. package/dist/types/element/src/types.d.ts +7 -0
  40. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +18 -36
  41. package/dist/types/excalidraw/actions/actionAlign.d.ts +8 -8
  42. package/dist/types/excalidraw/actions/actionBoundText.d.ts +12 -24
  43. package/dist/types/excalidraw/actions/actionCanvas.d.ts +107 -185
  44. package/dist/types/excalidraw/actions/actionClipboard.d.ts +39 -75
  45. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +6 -12
  46. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +19 -37
  47. package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -4
  48. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
  49. package/dist/types/excalidraw/actions/actionElementLink.d.ts +5 -11
  50. package/dist/types/excalidraw/actions/actionElementLock.d.ts +14 -26
  51. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +6 -12
  52. package/dist/types/excalidraw/actions/actionExport.d.ts +81 -135
  53. package/dist/types/excalidraw/actions/actionFinalize.d.ts +13 -25
  54. package/dist/types/excalidraw/actions/actionFlip.d.ts +4 -4
  55. package/dist/types/excalidraw/actions/actionFrame.d.ts +26 -50
  56. package/dist/types/excalidraw/actions/actionGroup.d.ts +16 -28
  57. package/dist/types/excalidraw/actions/actionHistory.d.ts +1 -2
  58. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +6 -12
  59. package/dist/types/excalidraw/actions/actionLink.d.ts +8 -14
  60. package/dist/types/excalidraw/actions/actionMenu.d.ts +19 -37
  61. package/dist/types/excalidraw/actions/actionNavigate.d.ts +12 -24
  62. package/dist/types/excalidraw/actions/actionProperties.d.ts +96 -186
  63. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +8 -14
  64. package/dist/types/excalidraw/actions/actionStyles.d.ts +10 -16
  65. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +8 -14
  66. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +8 -14
  67. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +7 -186
  68. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
  69. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +8 -14
  70. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +8 -14
  71. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +8 -14
  72. package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -8
  73. package/dist/types/excalidraw/actions/types.d.ts +3 -3
  74. package/dist/types/excalidraw/appState.d.ts +14 -14
  75. package/dist/types/excalidraw/components/App.d.ts +5 -3
  76. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +49 -0
  77. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
  78. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -8
  79. package/dist/types/excalidraw/editor-jotai.d.ts +6 -6
  80. package/dist/types/excalidraw/history.d.ts +14 -22
  81. package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
  82. package/dist/types/excalidraw/index.d.ts +1 -1
  83. package/dist/types/excalidraw/renderer/helpers.d.ts +6 -1
  84. package/dist/types/excalidraw/types.d.ts +11 -3
  85. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
  86. package/dist/types/math/src/curve.d.ts +2 -0
  87. package/dist/types/math/src/vector.d.ts +4 -0
  88. package/history.ts +68 -94
  89. package/package.json +3 -3
  90. package/dist/dev/chunk-U3G3LY5D.js.map +0 -7
  91. package/dist/dev/chunk-X3RYHLJU.js.map +0 -7
  92. package/dist/prod/chunk-PUQLEN73.js +0 -33
  93. package/dist/prod/data/image-WY2VMQLG.js +0 -1
  94. package/dist/types/excalidraw/store.d.ts +0 -129
  95. /package/dist/dev/{chunk-MJMGTOVG.js.map → chunk-RS23HYC4.js.map} +0 -0
  96. /package/dist/dev/data/{image-Y366K5SN.js.map → image-AYLHSOBV.js.map} +0 -0
  97. /package/dist/dev/locales/{en-CKWC2GMK.js.map → en-E3O5XSXJ.js.map} +0 -0
@@ -22,7 +22,7 @@ export declare const actionCopyStyles: {
22
22
  errorMessage: import("react").ReactNode;
23
23
  activeEmbeddable: {
24
24
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
25
- state: "hover" | "active";
25
+ state: "active" | "hover";
26
26
  } | null;
27
27
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
28
28
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -89,7 +89,7 @@ export declare const actionCopyStyles: {
89
89
  name: "imageExport" | "help" | "jsonExport";
90
90
  } | {
91
91
  name: "ttd";
92
- tab: "text-to-diagram" | "mermaid";
92
+ tab: "mermaid" | "text-to-diagram";
93
93
  } | {
94
94
  name: "commandPalette";
95
95
  } | {
@@ -169,22 +169,16 @@ export declare const actionCopyStyles: {
169
169
  followedBy: Set<import("../types").SocketId>;
170
170
  isCropping: boolean;
171
171
  croppingElementId: string | null;
172
- searchMatches: readonly {
173
- id: string;
174
- focus: boolean;
175
- matchedLines: {
176
- offsetX: number;
177
- offsetY: number;
178
- width: number;
179
- height: number;
180
- }[];
181
- }[];
172
+ searchMatches: Readonly<{
173
+ focusedId: string | null;
174
+ matches: readonly import("../types").SearchMatch[];
175
+ }> | null;
182
176
  };
183
177
  captureUpdate: "EVENTUALLY";
184
178
  };
185
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
179
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
186
180
  } & {
187
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
181
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
188
182
  };
189
183
  export declare const actionPasteStyles: {
190
184
  name: "pasteStyles";
@@ -200,7 +194,7 @@ export declare const actionPasteStyles: {
200
194
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
201
195
  captureUpdate: "IMMEDIATELY";
202
196
  };
203
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
197
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
204
198
  } & {
205
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
199
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
206
200
  };
@@ -24,7 +24,7 @@ export declare const actionToggleGridMode: {
24
24
  errorMessage: import("react").ReactNode;
25
25
  activeEmbeddable: {
26
26
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
27
- state: "hover" | "active";
27
+ state: "active" | "hover";
28
28
  } | null;
29
29
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
30
30
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -91,7 +91,7 @@ export declare const actionToggleGridMode: {
91
91
  name: "imageExport" | "help" | "jsonExport";
92
92
  } | {
93
93
  name: "ttd";
94
- tab: "text-to-diagram" | "mermaid";
94
+ tab: "mermaid" | "text-to-diagram";
95
95
  } | {
96
96
  name: "commandPalette";
97
97
  } | {
@@ -174,22 +174,16 @@ export declare const actionToggleGridMode: {
174
174
  followedBy: Set<import("../types").SocketId>;
175
175
  isCropping: boolean;
176
176
  croppingElementId: string | null;
177
- searchMatches: readonly {
178
- id: string;
179
- focus: boolean;
180
- matchedLines: {
181
- offsetX: number;
182
- offsetY: number;
183
- width: number;
184
- height: number;
185
- }[];
186
- }[];
177
+ searchMatches: Readonly<{
178
+ focusedId: string | null;
179
+ matches: readonly import("../types").SearchMatch[];
180
+ }> | null;
187
181
  };
188
182
  captureUpdate: "EVENTUALLY";
189
183
  };
190
184
  checked: (appState: AppState) => boolean;
191
185
  predicate: (element: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps) => boolean;
192
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
186
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
193
187
  } & {
194
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
188
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
195
189
  };
@@ -22,7 +22,7 @@ export declare const actionToggleObjectsSnapMode: {
22
22
  errorMessage: import("react").ReactNode;
23
23
  activeEmbeddable: {
24
24
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
25
- state: "hover" | "active";
25
+ state: "active" | "hover";
26
26
  } | null;
27
27
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
28
28
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -89,7 +89,7 @@ export declare const actionToggleObjectsSnapMode: {
89
89
  name: "imageExport" | "help" | "jsonExport";
90
90
  } | {
91
91
  name: "ttd";
92
- tab: "text-to-diagram" | "mermaid";
92
+ tab: "mermaid" | "text-to-diagram";
93
93
  } | {
94
94
  name: "commandPalette";
95
95
  } | {
@@ -172,22 +172,16 @@ export declare const actionToggleObjectsSnapMode: {
172
172
  followedBy: Set<import("../types").SocketId>;
173
173
  isCropping: boolean;
174
174
  croppingElementId: string | null;
175
- searchMatches: readonly {
176
- id: string;
177
- focus: boolean;
178
- matchedLines: {
179
- offsetX: number;
180
- offsetY: number;
181
- width: number;
182
- height: number;
183
- }[];
184
- }[];
175
+ searchMatches: Readonly<{
176
+ focusedId: string | null;
177
+ matches: readonly import("../types").SearchMatch[];
178
+ }> | null;
185
179
  };
186
180
  captureUpdate: "EVENTUALLY";
187
181
  };
188
182
  checked: (appState: Readonly<import("../types").AppState>) => boolean;
189
183
  predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
190
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
184
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
191
185
  } & {
192
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
186
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
193
187
  };
@@ -12,179 +12,6 @@ export declare const actionToggleSearchMenu: {
12
12
  predicate: (appState: Readonly<AppState>) => boolean;
13
13
  };
14
14
  perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: any, app: import("../types").AppClassProperties): false | {
15
- appState: {
16
- openSidebar: null;
17
- contextMenu: {
18
- items: import("../components/ContextMenu").ContextMenuItems;
19
- top: number;
20
- left: number;
21
- } | null;
22
- showWelcomeScreen: boolean;
23
- isLoading: boolean;
24
- errorMessage: import("react").ReactNode;
25
- activeEmbeddable: {
26
- element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
27
- state: "hover" | "active";
28
- } | null;
29
- newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
30
- resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
31
- multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
32
- selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
33
- isBindingEnabled: boolean;
34
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
35
- suggestedBindings: import("@excalidraw/element/binding").SuggestedBinding[];
36
- frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
37
- frameRendering: {
38
- enabled: boolean;
39
- name: boolean;
40
- outline: boolean;
41
- clip: boolean;
42
- };
43
- editingFrame: string | null;
44
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
45
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
46
- editingLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
47
- activeTool: {
48
- lastActiveTool: import("../types").ActiveTool | null;
49
- locked: boolean;
50
- fromSelection: boolean;
51
- } & import("../types").ActiveTool;
52
- penMode: boolean;
53
- penDetected: boolean;
54
- exportBackground: boolean;
55
- exportEmbedScene: boolean;
56
- exportWithDarkMode: boolean;
57
- exportScale: number;
58
- currentItemStrokeColor: string;
59
- currentItemBackgroundColor: string;
60
- currentItemFillStyle: import("@excalidraw/element/types").FillStyle;
61
- currentItemStrokeWidth: number;
62
- currentItemStrokeStyle: import("@excalidraw/element/types").StrokeStyle;
63
- currentItemRoughness: number;
64
- currentItemOpacity: number;
65
- currentItemFontFamily: number;
66
- currentItemFontSize: number;
67
- currentItemTextAlign: string;
68
- currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
69
- currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
70
- currentHoveredFontFamily: number | null;
71
- currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
72
- currentItemArrowType: "round" | "sharp" | "elbow";
73
- viewBackgroundColor: string;
74
- scrollX: number;
75
- scrollY: number;
76
- cursorButton: "up" | "down";
77
- scrolledOutside: boolean;
78
- name: string | null;
79
- isResizing: boolean;
80
- isRotating: boolean;
81
- zoom: Readonly<{
82
- value: import("../types").NormalizedZoomValue;
83
- }>;
84
- openMenu: "canvas" | "shape" | null;
85
- openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
86
- openDialog: {
87
- name: "imageExport" | "help" | "jsonExport";
88
- } | {
89
- name: "ttd";
90
- tab: "text-to-diagram" | "mermaid";
91
- } | {
92
- name: "commandPalette";
93
- } | {
94
- name: "elementLinkSelector";
95
- sourceElementId: string;
96
- } | null;
97
- defaultSidebarDockedPreference: boolean;
98
- lastPointerDownWith: import("@excalidraw/element/types").PointerType;
99
- selectedElementIds: Readonly<{
100
- [id: string]: true;
101
- }>;
102
- hoveredElementIds: Readonly<{
103
- [id: string]: true;
104
- }>;
105
- previousSelectedElementIds: {
106
- [id: string]: true;
107
- };
108
- selectedElementsAreBeingDragged: boolean;
109
- shouldCacheIgnoreZoom: boolean;
110
- toast: {
111
- message: string;
112
- closable?: boolean | undefined;
113
- duration?: number | undefined;
114
- } | null;
115
- zenModeEnabled: boolean;
116
- theme: import("@excalidraw/element/types").Theme;
117
- gridSize: number;
118
- gridStep: number;
119
- gridModeEnabled: boolean;
120
- viewModeEnabled: boolean;
121
- selectedGroupIds: {
122
- [groupId: string]: boolean;
123
- };
124
- editingGroupId: string | null;
125
- width: number;
126
- height: number;
127
- offsetTop: number;
128
- offsetLeft: number;
129
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
130
- collaborators: Map<import("../types").SocketId, Readonly<{
131
- pointer?: import("../types").CollaboratorPointer | undefined;
132
- button?: "up" | "down" | undefined;
133
- selectedElementIds?: Readonly<{
134
- [id: string]: true;
135
- }> | undefined;
136
- username?: string | null | undefined;
137
- userState?: import("@excalidraw/common").UserIdleState | undefined;
138
- color?: {
139
- background: string;
140
- stroke: string;
141
- } | undefined;
142
- avatarUrl?: string | undefined;
143
- id?: string | undefined;
144
- socketId?: import("../types").SocketId | undefined;
145
- isCurrentUser?: boolean | undefined;
146
- isInCall?: boolean | undefined;
147
- isSpeaking?: boolean | undefined;
148
- isMuted?: boolean | undefined;
149
- }>>;
150
- stats: {
151
- open: boolean;
152
- panels: number;
153
- };
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
- pendingImageElementId: string | null;
163
- showHyperlinkPopup: false | "editor" | "info";
164
- selectedLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
165
- snapLines: readonly import("../snapping").SnapLine[];
166
- originSnapOffset: {
167
- x: number;
168
- y: number;
169
- } | null;
170
- objectsSnapModeEnabled: boolean;
171
- userToFollow: import("../types").UserToFollow | null;
172
- followedBy: Set<import("../types").SocketId>;
173
- isCropping: boolean;
174
- croppingElementId: string | null;
175
- searchMatches: readonly {
176
- id: string;
177
- focus: boolean;
178
- matchedLines: {
179
- offsetX: number;
180
- offsetY: number;
181
- width: number;
182
- height: number;
183
- }[];
184
- }[];
185
- };
186
- captureUpdate: "EVENTUALLY";
187
- } | {
188
15
  appState: {
189
16
  openSidebar: {
190
17
  name: "default";
@@ -201,7 +28,7 @@ export declare const actionToggleSearchMenu: {
201
28
  errorMessage: import("react").ReactNode;
202
29
  activeEmbeddable: {
203
30
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
204
- state: "hover" | "active";
31
+ state: "active" | "hover";
205
32
  } | null;
206
33
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
207
34
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -338,22 +165,16 @@ export declare const actionToggleSearchMenu: {
338
165
  followedBy: Set<import("../types").SocketId>;
339
166
  isCropping: boolean;
340
167
  croppingElementId: string | null;
341
- searchMatches: readonly {
342
- id: string;
343
- focus: boolean;
344
- matchedLines: {
345
- offsetX: number;
346
- offsetY: number;
347
- width: number;
348
- height: number;
349
- }[];
350
- }[];
168
+ searchMatches: Readonly<{
169
+ focusedId: string | null;
170
+ matches: readonly import("../types").SearchMatch[];
171
+ }> | null;
351
172
  };
352
173
  captureUpdate: "EVENTUALLY";
353
174
  };
354
175
  checked: (appState: AppState) => boolean;
355
176
  predicate: (element: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps) => boolean;
356
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
177
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
357
178
  } & {
358
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
179
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
359
180
  };
@@ -0,0 +1,19 @@
1
+ import type { ExcalidrawElement } from "@excalidraw/element/types";
2
+ export declare const actionToggleShapeSwitch: {
3
+ name: "toggleShapeSwitch";
4
+ label: string;
5
+ icon: () => null;
6
+ viewMode: true;
7
+ trackEvent: {
8
+ category: "shape_switch";
9
+ action: string;
10
+ };
11
+ keywords: string[];
12
+ perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: any, app: import("../types").AppClassProperties): {
13
+ captureUpdate: "NEVER";
14
+ };
15
+ checked: (appState: Readonly<import("../types").AppState>) => boolean;
16
+ predicate: (elements: readonly ExcalidrawElement[], appState: import("../types").AppState, props: import("../types").ExcalidrawProps) => boolean;
17
+ } & {
18
+ keyTest?: undefined;
19
+ };
@@ -24,7 +24,7 @@ export declare const actionToggleStats: {
24
24
  errorMessage: import("react").ReactNode;
25
25
  activeEmbeddable: {
26
26
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
27
- state: "hover" | "active";
27
+ state: "active" | "hover";
28
28
  } | null;
29
29
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
30
30
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -91,7 +91,7 @@ export declare const actionToggleStats: {
91
91
  name: "imageExport" | "help" | "jsonExport";
92
92
  } | {
93
93
  name: "ttd";
94
- tab: "text-to-diagram" | "mermaid";
94
+ tab: "mermaid" | "text-to-diagram";
95
95
  } | {
96
96
  name: "commandPalette";
97
97
  } | {
@@ -172,21 +172,15 @@ export declare const actionToggleStats: {
172
172
  followedBy: Set<import("../types").SocketId>;
173
173
  isCropping: boolean;
174
174
  croppingElementId: string | null;
175
- searchMatches: readonly {
176
- id: string;
177
- focus: boolean;
178
- matchedLines: {
179
- offsetX: number;
180
- offsetY: number;
181
- width: number;
182
- height: number;
183
- }[];
184
- }[];
175
+ searchMatches: Readonly<{
176
+ focusedId: string | null;
177
+ matches: readonly import("../types").SearchMatch[];
178
+ }> | null;
185
179
  };
186
180
  captureUpdate: "EVENTUALLY";
187
181
  };
188
182
  checked: (appState: Readonly<import("../types").AppState>) => boolean;
189
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
183
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
190
184
  } & {
191
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
185
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
192
186
  };
@@ -21,7 +21,7 @@ export declare const actionToggleViewMode: {
21
21
  errorMessage: import("react").ReactNode;
22
22
  activeEmbeddable: {
23
23
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
24
- state: "hover" | "active";
24
+ state: "active" | "hover";
25
25
  } | null;
26
26
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
27
27
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -88,7 +88,7 @@ export declare const actionToggleViewMode: {
88
88
  name: "imageExport" | "help" | "jsonExport";
89
89
  } | {
90
90
  name: "ttd";
91
- tab: "text-to-diagram" | "mermaid";
91
+ tab: "mermaid" | "text-to-diagram";
92
92
  } | {
93
93
  name: "commandPalette";
94
94
  } | {
@@ -172,22 +172,16 @@ export declare const actionToggleViewMode: {
172
172
  followedBy: Set<import("../types").SocketId>;
173
173
  isCropping: boolean;
174
174
  croppingElementId: string | null;
175
- searchMatches: readonly {
176
- id: string;
177
- focus: boolean;
178
- matchedLines: {
179
- offsetX: number;
180
- offsetY: number;
181
- width: number;
182
- height: number;
183
- }[];
184
- }[];
175
+ searchMatches: Readonly<{
176
+ focusedId: string | null;
177
+ matches: readonly import("../types").SearchMatch[];
178
+ }> | null;
185
179
  };
186
180
  captureUpdate: "EVENTUALLY";
187
181
  };
188
182
  checked: (appState: Readonly<import("../types").AppState>) => boolean;
189
183
  predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
190
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
184
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
191
185
  } & {
192
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
186
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
193
187
  };
@@ -21,7 +21,7 @@ export declare const actionToggleZenMode: {
21
21
  errorMessage: import("react").ReactNode;
22
22
  activeEmbeddable: {
23
23
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
24
- state: "hover" | "active";
24
+ state: "active" | "hover";
25
25
  } | null;
26
26
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
27
27
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
@@ -88,7 +88,7 @@ export declare const actionToggleZenMode: {
88
88
  name: "imageExport" | "help" | "jsonExport";
89
89
  } | {
90
90
  name: "ttd";
91
- tab: "text-to-diagram" | "mermaid";
91
+ tab: "mermaid" | "text-to-diagram";
92
92
  } | {
93
93
  name: "commandPalette";
94
94
  } | {
@@ -172,22 +172,16 @@ export declare const actionToggleZenMode: {
172
172
  followedBy: Set<import("../types").SocketId>;
173
173
  isCropping: boolean;
174
174
  croppingElementId: string | null;
175
- searchMatches: readonly {
176
- id: string;
177
- focus: boolean;
178
- matchedLines: {
179
- offsetX: number;
180
- offsetY: number;
181
- width: number;
182
- height: number;
183
- }[];
184
- }[];
175
+ searchMatches: Readonly<{
176
+ focusedId: string | null;
177
+ matches: readonly import("../types").SearchMatch[];
178
+ }> | null;
185
179
  };
186
180
  captureUpdate: "EVENTUALLY";
187
181
  };
188
182
  checked: (appState: Readonly<import("../types").AppState>) => boolean;
189
183
  predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
190
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
184
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
191
185
  } & {
192
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
186
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
193
187
  };
@@ -13,10 +13,10 @@ export declare const actionSendBackward: {
13
13
  captureUpdate: "IMMEDIATELY";
14
14
  };
15
15
  keyPriority: number;
16
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
16
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
17
17
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
18
18
  } & {
19
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
19
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
20
20
  };
21
21
  export declare const actionBringForward: {
22
22
  name: "bringForward";
@@ -32,10 +32,10 @@ export declare const actionBringForward: {
32
32
  captureUpdate: "IMMEDIATELY";
33
33
  };
34
34
  keyPriority: number;
35
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
35
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
36
36
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
37
37
  } & {
38
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
38
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
39
39
  };
40
40
  export declare const actionSendToBack: {
41
41
  name: "sendToBack";
@@ -50,10 +50,10 @@ export declare const actionSendToBack: {
50
50
  appState: Readonly<import("../types").AppState>;
51
51
  captureUpdate: "IMMEDIATELY";
52
52
  };
53
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
53
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
54
54
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
55
55
  } & {
56
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
56
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
57
57
  };
58
58
  export declare const actionBringToFront: {
59
59
  name: "bringToFront";
@@ -68,8 +68,8 @@ export declare const actionBringToFront: {
68
68
  appState: Readonly<import("../types").AppState>;
69
69
  captureUpdate: "IMMEDIATELY";
70
70
  };
71
- keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
71
+ keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
72
72
  PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
73
73
  } & {
74
- keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
74
+ keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
75
75
  };
@@ -1,5 +1,5 @@
1
1
  import type { ExcalidrawElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
2
- import type { CaptureUpdateActionType } from "../store";
2
+ import type { CaptureUpdateActionType } from "@excalidraw/element/store";
3
3
  import type { AppClassProperties, AppState, ExcalidrawProps, BinaryFiles, UIAppState } from "../types";
4
4
  import type React from "react";
5
5
  export type ActionSource = "ui" | "keyboard" | "contextMenu" | "api" | "commandPalette";
@@ -14,7 +14,7 @@ export type ActionResult = {
14
14
  type ActionFn = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
15
15
  export type UpdaterFn = (res: ActionResult) => void;
16
16
  export type ActionFilterFn = (action: Action) => void;
17
- export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool";
17
+ export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool" | "toggleShapeSwitch";
18
18
  export type PanelComponentProps = {
19
19
  elements: readonly ExcalidrawElement[];
20
20
  appState: AppState;
@@ -35,7 +35,7 @@ export interface Action {
35
35
  predicate?: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: ExcalidrawProps, app: AppClassProperties) => boolean;
36
36
  checked?: (appState: Readonly<AppState>) => boolean;
37
37
  trackEvent: false | {
38
- category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink" | "search_menu";
38
+ category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink" | "search_menu" | "shape_switch";
39
39
  action?: string;
40
40
  predicate?: (appState: Readonly<AppState>, elements: readonly ExcalidrawElement[], value: any) => boolean;
41
41
  };