@excalidraw/math 0.18.0-1118751 → 0.18.0-1440f2d

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 (127) hide show
  1. package/dist/types/common/src/constants.d.ts +4 -0
  2. package/dist/types/common/src/utils.d.ts +12 -1
  3. package/dist/types/element/src/align.d.ts +4 -1
  4. package/dist/types/element/src/binding.d.ts +70 -0
  5. package/dist/types/element/src/bounds.d.ts +10 -2
  6. package/dist/types/element/src/collision.d.ts +13 -0
  7. package/dist/types/element/src/cropElement.d.ts +36 -4
  8. package/dist/types/element/src/delta.d.ts +7 -1
  9. package/dist/types/element/src/distribute.d.ts +4 -1
  10. package/dist/types/element/src/dragElements.d.ts +8 -3
  11. package/dist/types/element/src/elbowArrow.d.ts +5 -0
  12. package/dist/types/element/src/embeddable.d.ts +2 -1
  13. package/dist/types/element/src/flowchart.d.ts +1 -7
  14. package/dist/types/element/src/frame.d.ts +19 -1
  15. package/dist/types/element/src/groups.d.ts +1 -6
  16. package/dist/types/element/src/image.d.ts +5 -2
  17. package/dist/types/element/src/index.d.ts +2 -0
  18. package/dist/types/element/src/linearElementEditor.d.ts +4 -1
  19. package/dist/types/element/src/listMarker.d.ts +39 -0
  20. package/dist/types/element/src/newElement.d.ts +17 -1
  21. package/dist/types/element/src/renderElement.d.ts +10 -0
  22. package/dist/types/element/src/renderEnvironment.d.ts +66 -0
  23. package/dist/types/element/src/resizeElements.d.ts +15 -5
  24. package/dist/types/element/src/selection.d.ts +1 -7
  25. package/dist/types/element/src/shape.d.ts +2 -0
  26. package/dist/types/element/src/stickyNote.d.ts +8 -0
  27. package/dist/types/element/src/textElement.d.ts +10 -2
  28. package/dist/types/element/src/textMeasurements.d.ts +15 -11
  29. package/dist/types/element/src/textWrapping.d.ts +3 -2
  30. package/dist/types/element/src/transform.d.ts +5 -1
  31. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +30 -3
  32. package/dist/types/excalidraw/actions/actionBoundText.d.ts +56 -214
  33. package/dist/types/excalidraw/actions/actionCanvas.d.ts +76 -16
  34. package/dist/types/excalidraw/actions/actionClipboard.d.ts +20 -2
  35. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +10 -1
  36. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +4 -564
  37. package/dist/types/excalidraw/actions/actionDeselect.d.ts +14 -2
  38. package/dist/types/excalidraw/actions/actionElementLink.d.ts +10 -1
  39. package/dist/types/excalidraw/actions/actionElementLock.d.ts +20 -2
  40. package/dist/types/excalidraw/actions/actionExport.d.ts +27 -9
  41. package/dist/types/excalidraw/actions/actionFrame.d.ts +71 -528
  42. package/dist/types/excalidraw/actions/actionGroup.d.ts +22 -4
  43. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +10 -1
  44. package/dist/types/excalidraw/actions/actionLink.d.ts +10 -1
  45. package/dist/types/excalidraw/actions/actionMenu.d.ts +10 -1
  46. package/dist/types/excalidraw/actions/actionProperties.d.ts +20 -2
  47. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +11 -2
  48. package/dist/types/excalidraw/actions/actionStyles.d.ts +10 -1
  49. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +10 -1
  50. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +10 -1
  51. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +10 -1
  52. package/dist/types/excalidraw/actions/actionToggleMinimap.d.ts +201 -0
  53. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +10 -1
  54. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +10 -1
  55. package/dist/types/excalidraw/actions/actionToggleShowHints.d.ts +198 -0
  56. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +10 -1
  57. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +10 -1
  58. package/dist/types/excalidraw/actions/actionToggleWrap.d.ts +12 -0
  59. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +10 -1
  60. package/dist/types/excalidraw/actions/index.d.ts +3 -0
  61. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  62. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  63. package/dist/types/excalidraw/appState.d.ts +9 -7
  64. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -1
  65. package/dist/types/excalidraw/charts/charts.helpers.d.ts +6 -5
  66. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -1
  67. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -1
  68. package/dist/types/excalidraw/charts/index.d.ts +2 -1
  69. package/dist/types/excalidraw/components/Actions.d.ts +9 -2
  70. package/dist/types/excalidraw/components/App.arrowText.d.ts +5 -39
  71. package/dist/types/excalidraw/components/App.clipboard.d.ts +31 -0
  72. package/dist/types/excalidraw/components/App.d.ts +79 -264
  73. package/dist/types/excalidraw/components/App.duplicate.d.ts +52 -2
  74. package/dist/types/excalidraw/components/App.host.d.ts +102 -0
  75. package/dist/types/excalidraw/components/App.modifiers.d.ts +38 -0
  76. package/dist/types/excalidraw/components/App.pan.d.ts +8 -0
  77. package/dist/types/excalidraw/components/App.selection.d.ts +265 -0
  78. package/dist/types/excalidraw/components/App.selectionTool.d.ts +93 -0
  79. package/dist/types/excalidraw/components/App.text.d.ts +146 -0
  80. package/dist/types/excalidraw/components/App.textTool.d.ts +140 -0
  81. package/dist/types/excalidraw/components/App.viewport.d.ts +64 -4
  82. package/dist/types/excalidraw/components/App.wheel.d.ts +6 -2
  83. package/dist/types/excalidraw/components/App.wrap.d.ts +31 -0
  84. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -1
  85. package/dist/types/excalidraw/components/FileDropOverlay.d.ts +2 -0
  86. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +6 -2
  87. package/dist/types/excalidraw/components/LibraryUnit.d.ts +7 -2
  88. package/dist/types/excalidraw/components/Minimap/Minimap.d.ts +15 -0
  89. package/dist/types/excalidraw/components/Minimap/MinimapAnnouncementDot.d.ts +10 -0
  90. package/dist/types/excalidraw/components/Minimap/minimap-controller.chunk.d.ts +90 -0
  91. package/dist/types/excalidraw/components/Minimap/minimap-shared.chunk.d.ts +122 -0
  92. package/dist/types/excalidraw/components/Minimap/minimap-worker.chunk.d.ts +12 -0
  93. package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -2
  94. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +2 -1
  95. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -2
  96. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +5 -2
  97. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +2 -1
  98. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +4 -1
  99. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +3 -2
  100. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +14 -1
  101. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +16 -0
  102. package/dist/types/excalidraw/components/Tooltip.d.ts +26 -2
  103. package/dist/types/excalidraw/components/TopPicksDnD/topPicksDnD.d.ts +1 -1
  104. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +0 -1
  105. package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
  106. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
  107. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +13 -2
  108. package/dist/types/excalidraw/components/icons.d.ts +1 -0
  109. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +2 -0
  110. package/dist/types/excalidraw/data/blob.d.ts +34 -16
  111. package/dist/types/excalidraw/data/index.d.ts +3 -3
  112. package/dist/types/excalidraw/data/json.d.ts +17 -8
  113. package/dist/types/excalidraw/fonts/Fonts.d.ts +9 -6
  114. package/dist/types/excalidraw/history.d.ts +10 -4
  115. package/dist/types/excalidraw/mermaid.d.ts +7 -0
  116. package/dist/types/excalidraw/reactUtils.d.ts +1 -1
  117. package/dist/types/excalidraw/renderer/animation.d.ts +11 -4
  118. package/dist/types/excalidraw/renderer/staticScene.d.ts +11 -6
  119. package/dist/types/excalidraw/scene/Renderer.d.ts +1 -1
  120. package/dist/types/excalidraw/scene/export.d.ts +343 -20
  121. package/dist/types/excalidraw/scene/types.d.ts +23 -1
  122. package/dist/types/excalidraw/types.d.ts +83 -14
  123. package/dist/types/excalidraw/viewport.d.ts +23 -1
  124. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +12 -1
  125. package/dist/types/utils/src/index.d.ts +3 -1
  126. package/package.json +2 -2
  127. package/dist/types/utils/src/export.d.ts +0 -36
@@ -0,0 +1,198 @@
1
+ export declare const actionToggleShowHints: {
2
+ name: "showHints";
3
+ label: string;
4
+ icon: import("react/jsx-runtime").JSX.Element;
5
+ keywords: string[];
6
+ viewMode: false;
7
+ trackEvent: {
8
+ category: "canvas";
9
+ predicate: (appState: Readonly<import("../types").AppState>) => boolean;
10
+ };
11
+ perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
12
+ appState: {
13
+ showHints: boolean;
14
+ contextMenu: {
15
+ items: import("../components/ContextMenu").ContextMenuItems;
16
+ top: number;
17
+ left: number;
18
+ } | null;
19
+ showWelcomeScreen: boolean;
20
+ isLoading: boolean;
21
+ errorMessage: React.ReactNode;
22
+ activeEmbeddable: {
23
+ element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
24
+ state: "hover" | "active";
25
+ } | null;
26
+ newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
27
+ resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
28
+ multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
29
+ selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
30
+ isBindingEnabled: boolean;
31
+ boxSelectionMode: import("../types").BoxSelectionMode;
32
+ bindingPreference: "enabled" | "disabled";
33
+ isMidpointSnappingEnabled: boolean;
34
+ inputDevice: import("../types").InputDevice;
35
+ suggestedBinding: {
36
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
37
+ midPoint?: import("@excalidraw/math").GlobalPoint;
38
+ } | null;
39
+ textToolHover: {
40
+ type: "text";
41
+ elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
42
+ } | {
43
+ type: "container";
44
+ elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
45
+ } | {
46
+ type: "arrow";
47
+ elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
48
+ anchor: "start" | "end" | "label";
49
+ } | null;
50
+ frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
51
+ frameRendering: {
52
+ enabled: boolean;
53
+ name: boolean;
54
+ outline: boolean;
55
+ clip: boolean;
56
+ };
57
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
58
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
59
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
60
+ activeTool: {
61
+ lastActiveTool: import("../types").ActiveTool | null;
62
+ locked: boolean;
63
+ fromSelection: boolean;
64
+ } & import("../types").ActiveTool;
65
+ preferredSelectionTool: {
66
+ type: "selection" | "lasso";
67
+ initialized: boolean;
68
+ };
69
+ penMode: boolean;
70
+ penDetected: boolean;
71
+ exportBackground: boolean;
72
+ exportEmbedScene: boolean;
73
+ exportWithDarkMode: boolean;
74
+ exportScale: number;
75
+ currentItemStrokeColor: string;
76
+ currentItemStickynoteStrokeColor: string;
77
+ currentItemStickynoteBackgroundColor: string;
78
+ currentItemBackgroundColor: string;
79
+ currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
80
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
81
+ currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
82
+ currentItemRoughness: number;
83
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
84
+ currentItemOpacity: number;
85
+ currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
86
+ currentItemFontSize: number;
87
+ currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
88
+ currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
89
+ currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
90
+ currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
91
+ currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
92
+ currentItemArrowType: "sharp" | "round" | "elbow";
93
+ viewBackgroundColor: string;
94
+ scrollX: number;
95
+ scrollY: number;
96
+ scrollConstraints: import("../types").ScrollConstraints | null;
97
+ cursorButton: "up" | "down";
98
+ scrolledOutside: boolean;
99
+ name: string | null;
100
+ isResizing: boolean;
101
+ isRotating: boolean;
102
+ zoom: import("../types").Zoom;
103
+ openMenu: "canvas" | null;
104
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
105
+ openSidebar: {
106
+ name: import("../types").SidebarName;
107
+ tab?: import("../types").SidebarTabName;
108
+ } | null;
109
+ openDialog: null | {
110
+ name: "imageExport" | "help" | "jsonExport";
111
+ } | {
112
+ name: "ttd";
113
+ tab: "text-to-diagram" | "mermaid";
114
+ } | {
115
+ name: "commandPalette";
116
+ } | {
117
+ name: "settings";
118
+ } | {
119
+ name: "elementLinkSelector";
120
+ sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
121
+ } | {
122
+ name: "charts";
123
+ data: import("../charts").Spreadsheet;
124
+ rawText: string;
125
+ };
126
+ defaultSidebarDockedPreference: boolean;
127
+ lastPointerDownWith: import("@excalidraw/element/types").PointerType;
128
+ selectedElementIds: Readonly<{
129
+ [id: string]: true;
130
+ }>;
131
+ hoveredElementIds: Readonly<{
132
+ [id: string]: true;
133
+ }>;
134
+ previousSelectedElementIds: {
135
+ [id: string]: true;
136
+ };
137
+ selectedElementsAreBeingDragged: boolean;
138
+ shouldCacheIgnoreZoom: boolean;
139
+ toast: {
140
+ message: React.ReactNode;
141
+ closable?: boolean;
142
+ duration?: number;
143
+ } | null;
144
+ zenModeEnabled: boolean;
145
+ minimapEnabled: boolean;
146
+ theme: import("@excalidraw/element/types").Theme;
147
+ gridSize: number;
148
+ gridStep: number;
149
+ gridModeEnabled: boolean;
150
+ viewModeEnabled: boolean;
151
+ selectedGroupIds: {
152
+ [groupId: string]: boolean;
153
+ };
154
+ editingGroupId: import("@excalidraw/element/types").GroupId | null;
155
+ width: number;
156
+ height: number;
157
+ offsetTop: number;
158
+ offsetLeft: number;
159
+ fileHandle: FileSystemFileHandle | null;
160
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
161
+ stats: {
162
+ open: boolean;
163
+ panels: number;
164
+ };
165
+ showHyperlinkPopup: false | "info" | "editor";
166
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
167
+ snapLines: readonly import("../snapping").SnapLine[];
168
+ originSnapOffset: {
169
+ x: number;
170
+ y: number;
171
+ } | null;
172
+ objectsSnapModeEnabled: boolean;
173
+ isCropping: boolean;
174
+ croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
175
+ searchMatches: Readonly<{
176
+ focusedId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
177
+ matches: readonly import("../types").SearchMatch[];
178
+ }> | null;
179
+ activeLockedId: string | null;
180
+ lockedMultiSelections: {
181
+ [groupId: string]: true;
182
+ };
183
+ bindMode: import("@excalidraw/element/types").BindMode;
184
+ colorTopPicks: {
185
+ elementStroke: readonly string[] | null;
186
+ elementBackground: readonly string[] | null;
187
+ bucketFill: readonly string[] | null;
188
+ stickyNoteStroke: readonly string[] | null;
189
+ stickyNoteBackground: readonly string[] | null;
190
+ };
191
+ fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
192
+ };
193
+ captureUpdate: "NEVER";
194
+ };
195
+ checked: (appState: Readonly<import("../types").UIAppState>) => boolean;
196
+ } & {
197
+ keyTest?: undefined;
198
+ };
@@ -33,12 +33,20 @@ export declare const actionToggleStats: {
33
33
  boxSelectionMode: import("../types").BoxSelectionMode;
34
34
  bindingPreference: "enabled" | "disabled";
35
35
  isMidpointSnappingEnabled: boolean;
36
+ showHints: boolean;
36
37
  inputDevice: import("../types").InputDevice;
37
38
  suggestedBinding: {
38
39
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
39
40
  midPoint?: import("@excalidraw/math").GlobalPoint;
40
41
  } | null;
41
- hoveredArrowTextAnchor: {
42
+ textToolHover: {
43
+ type: "text";
44
+ elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
45
+ } | {
46
+ type: "container";
47
+ elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
48
+ } | {
49
+ type: "arrow";
42
50
  elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
43
51
  anchor: "start" | "end" | "label";
44
52
  } | null;
@@ -137,6 +145,7 @@ export declare const actionToggleStats: {
137
145
  duration?: number;
138
146
  } | null;
139
147
  zenModeEnabled: boolean;
148
+ minimapEnabled: boolean;
140
149
  theme: import("@excalidraw/element/types").Theme;
141
150
  gridSize: number;
142
151
  gridStep: number;
@@ -30,12 +30,20 @@ export declare const actionToggleViewMode: {
30
30
  boxSelectionMode: import("../types").BoxSelectionMode;
31
31
  bindingPreference: "enabled" | "disabled";
32
32
  isMidpointSnappingEnabled: boolean;
33
+ showHints: boolean;
33
34
  inputDevice: import("../types").InputDevice;
34
35
  suggestedBinding: {
35
36
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
36
37
  midPoint?: import("@excalidraw/math").GlobalPoint;
37
38
  } | null;
38
- hoveredArrowTextAnchor: {
39
+ textToolHover: {
40
+ type: "text";
41
+ elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
42
+ } | {
43
+ type: "container";
44
+ elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
45
+ } | {
46
+ type: "arrow";
39
47
  elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
40
48
  anchor: "start" | "end" | "label";
41
49
  } | null;
@@ -134,6 +142,7 @@ export declare const actionToggleViewMode: {
134
142
  duration?: number;
135
143
  } | null;
136
144
  zenModeEnabled: boolean;
145
+ minimapEnabled: boolean;
137
146
  theme: import("@excalidraw/element/types").Theme;
138
147
  gridSize: number;
139
148
  gridStep: number;
@@ -0,0 +1,12 @@
1
+ export declare const actionToggleWrap: {
2
+ name: "toggleWrap";
3
+ label: string;
4
+ trackEvent: {
5
+ category: "element";
6
+ };
7
+ predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, _: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
8
+ perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: import("../types").AppClassProperties) => import("./types").ActionResult;
9
+ keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>, appState: import("../types").AppState, elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], app: import("../types").AppClassProperties) => boolean;
10
+ } & {
11
+ keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>, appState: import("../types").AppState, elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], app: import("../types").AppClassProperties) => boolean) | undefined;
12
+ };
@@ -30,12 +30,20 @@ export declare const actionToggleZenMode: {
30
30
  boxSelectionMode: import("../types").BoxSelectionMode;
31
31
  bindingPreference: "enabled" | "disabled";
32
32
  isMidpointSnappingEnabled: boolean;
33
+ showHints: boolean;
33
34
  inputDevice: import("../types").InputDevice;
34
35
  suggestedBinding: {
35
36
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
36
37
  midPoint?: import("@excalidraw/math").GlobalPoint;
37
38
  } | null;
38
- hoveredArrowTextAnchor: {
39
+ textToolHover: {
40
+ type: "text";
41
+ elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
42
+ } | {
43
+ type: "container";
44
+ elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
45
+ } | {
46
+ type: "arrow";
39
47
  elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
40
48
  anchor: "start" | "end" | "label";
41
49
  } | null;
@@ -133,6 +141,7 @@ export declare const actionToggleZenMode: {
133
141
  closable?: boolean;
134
142
  duration?: number;
135
143
  } | null;
144
+ minimapEnabled: boolean;
136
145
  theme: import("@excalidraw/element/types").Theme;
137
146
  gridSize: number;
138
147
  gridStep: number;
@@ -21,8 +21,11 @@ export { actionToggleZenMode } from "./actionToggleZenMode";
21
21
  export { actionToggleObjectsSnapMode } from "./actionToggleObjectsSnapMode";
22
22
  export { actionToggleArrowBinding } from "./actionToggleArrowBinding";
23
23
  export { actionToggleMidpointSnapping } from "./actionToggleMidpointSnapping";
24
+ export { actionToggleShowHints } from "./actionToggleShowHints";
24
25
  export { actionToggleStats } from "./actionToggleStats";
26
+ export { actionToggleMinimap } from "./actionToggleMinimap";
25
27
  export { actionUnbindText, actionBindText } from "./actionBoundText";
28
+ export { actionToggleWrap } from "./actionToggleWrap";
26
29
  export { actionLink } from "./actionLink";
27
30
  export { actionToggleElementLock } from "./actionElementLock";
28
31
  export { actionToggleLinearEditor } from "./actionLinearEditor";
@@ -1,4 +1,4 @@
1
1
  import type { SubtypeOf } from "@excalidraw/common/utility-types";
2
2
  import type { ActionName } from "./types";
3
- export type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "clearCanvas" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "group" | "ungroup" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleElementLock" | "resetZoom" | "zoomOut" | "zoomIn" | "zoomToFit" | "zoomToFitSelectionInViewport" | "zoomToFitSelection" | "saveFileToDisk" | "saveToActiveFile" | "toggleShortcuts" | "wrapSelectionInFrame"> | "saveScene" | "imageExport" | "commandPalette" | "searchMenu" | "toolLock";
3
+ export type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "clearCanvas" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "group" | "ungroup" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleElementLock" | "resetZoom" | "zoomOut" | "zoomIn" | "zoomToFit" | "zoomToFitSelectionInViewport" | "zoomToFitSelection" | "saveFileToDisk" | "saveToActiveFile" | "toggleShortcuts" | "wrapSelectionInFrame" | "toggleWrap"> | "saveScene" | "imageExport" | "commandPalette" | "searchMenu" | "toolLock";
4
4
  export declare const getShortcutFromShortcutName: (name: ShortcutName, idx?: number) => string;
@@ -14,7 +14,7 @@ export type ActionResult = {
14
14
  type ActionFn<TData = any> = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: TData | undefined, 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" | "arrowBinding" | "midpointSnapping" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeBucketFillBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeSloppiness" | "changeFreedrawMode" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "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" | "deselect" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleShapeSwitch" | "togglePolygon";
17
+ export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "arrowBinding" | "midpointSnapping" | "showHints" | "stats" | "minimap" | "changeStrokeColor" | "changeBackgroundColor" | "changeBucketFillBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeSloppiness" | "changeFreedrawMode" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "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" | "deselect" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleWrap" | "toggleShapeSwitch" | "togglePolygon";
18
18
  export type PanelComponentProps = {
19
19
  elements: readonly ExcalidrawElement[];
20
20
  appState: UIAppState;
@@ -7,12 +7,14 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
7
7
  zoom?: Readonly<{
8
8
  value: NormalizedZoomValue;
9
9
  }> | undefined;
10
- scrollX?: number | undefined;
11
- scrollY?: number | undefined;
12
- editingGroupId?: string | null | undefined;
10
+ isBindingEnabled?: boolean | undefined;
11
+ isMidpointSnappingEnabled?: boolean | undefined;
13
12
  selectedElementIds?: Readonly<{
14
13
  [id: string]: true;
15
14
  }> | undefined;
15
+ scrollX?: number | undefined;
16
+ scrollY?: number | undefined;
17
+ editingGroupId?: string | null | undefined;
16
18
  activeTool?: ({
17
19
  lastActiveTool: import("./types").ActiveTool | null;
18
20
  locked: boolean;
@@ -22,18 +24,15 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
22
24
  [groupId: string]: boolean;
23
25
  } | undefined;
24
26
  selectedLinearElement?: import("@excalidraw/element").LinearElementEditor | null | undefined;
25
- isBindingEnabled?: boolean | undefined;
26
- isMidpointSnappingEnabled?: boolean | undefined;
27
27
  gridModeEnabled?: boolean | undefined;
28
28
  zenModeEnabled?: boolean | undefined;
29
29
  shouldCacheIgnoreZoom?: boolean | undefined;
30
30
  exportScale?: number | undefined;
31
31
  currentItemArrowType?: "round" | "sharp" | "elbow" | undefined;
32
- gridSize?: number | undefined;
33
- bindMode?: import("@excalidraw/element/types").BindMode | undefined;
34
32
  showWelcomeScreen?: boolean | undefined;
35
33
  boxSelectionMode?: import("./types").BoxSelectionMode | undefined;
36
34
  bindingPreference?: "enabled" | "disabled" | undefined;
35
+ showHints?: boolean | undefined;
37
36
  inputDevice?: InputDevice | undefined;
38
37
  preferredSelectionTool?: {
39
38
  type: "selection" | "lasso";
@@ -72,6 +71,8 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
72
71
  previousSelectedElementIds?: {
73
72
  [id: string]: true;
74
73
  } | undefined;
74
+ minimapEnabled?: boolean | undefined;
75
+ gridSize?: number | undefined;
75
76
  gridStep?: number | undefined;
76
77
  stats?: {
77
78
  open: boolean;
@@ -81,6 +82,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
81
82
  lockedMultiSelections?: {
82
83
  [groupId: string]: true;
83
84
  } | undefined;
85
+ bindMode?: import("@excalidraw/element/types").BindMode | undefined;
84
86
  colorTopPicks?: {
85
87
  elementStroke: readonly string[] | null;
86
88
  elementBackground: readonly string[] | null;
@@ -1,2 +1,3 @@
1
+ import type { RenderEnvironment } from "@excalidraw/element";
1
2
  import type { ChartElements, Spreadsheet } from "./charts.types";
2
- export declare const renderBarChart: (spreadsheet: Spreadsheet, x: number, y: number, colorSeed?: number) => ChartElements;
3
+ export declare const renderBarChart: (spreadsheet: Spreadsheet, x: number, y: number, colorSeed?: number, renderEnvironment?: RenderEnvironment) => ChartElements;
@@ -1,4 +1,5 @@
1
1
  import { getFontString } from "@excalidraw/common";
2
+ import type { RenderEnvironment } from "@excalidraw/element";
2
3
  import type { ChartType } from "@excalidraw/element/types";
3
4
  import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
4
5
  import { type CartesianChartLayout, type CartesianChartType } from "./charts.constants";
@@ -20,13 +21,13 @@ export declare const getRadarValueScale: (series: SpreadsheetSeries[], _labelsLe
20
21
  renderSteps: boolean;
21
22
  normalize: (value: number, _axisIndex: number) => number;
22
23
  };
23
- export declare const getRadarDisplayText: (text: string, fontString: ReturnType<typeof getFontString>, maxWidth: number) => string;
24
- export declare const createRadarAxisLabels: (labels: readonly string[], angles: readonly number[], centerX: number, centerY: number, radius: number, backgroundColor: string) => {
24
+ export declare const getRadarDisplayText: (text: string, fontString: ReturnType<typeof getFontString>, maxWidth: number, renderEnvironment?: RenderEnvironment) => string;
25
+ export declare const createRadarAxisLabels: (labels: readonly string[], angles: readonly number[], centerX: number, centerY: number, radius: number, backgroundColor: string, renderEnvironment?: RenderEnvironment) => {
25
26
  axisLabels: ChartElements;
26
27
  axisLabelTopY: number;
27
28
  axisLabelBottomY: number;
28
29
  };
29
- export declare const createSeriesLegend: (series: SpreadsheetSeries[], seriesColors: readonly string[], centerX: number, minLegendTopY: number, fallbackLegendY: number, backgroundColor: string) => ChartElements;
30
+ export declare const createSeriesLegend: (series: SpreadsheetSeries[], seriesColors: readonly string[], centerX: number, minLegendTopY: number, fallbackLegendY: number, backgroundColor: string, renderEnvironment?: RenderEnvironment) => ChartElements;
30
31
  export declare const getRotatedTextElementBottom: (element: NonDeletedExcalidrawElement) => number;
31
- export declare const chartXLabels: (spreadsheet: Spreadsheet, x: number, y: number, backgroundColor: string, layout: CartesianChartLayout) => ChartElements;
32
- export declare const chartBaseElements: (spreadsheet: Spreadsheet, x: number, y: number, backgroundColor: string, layout: CartesianChartLayout, maxValue?: number, debug?: boolean) => ChartElements;
32
+ export declare const chartXLabels: (spreadsheet: Spreadsheet, x: number, y: number, backgroundColor: string, layout: CartesianChartLayout, renderEnvironment?: RenderEnvironment) => ChartElements;
33
+ export declare const chartBaseElements: (spreadsheet: Spreadsheet, x: number, y: number, backgroundColor: string, layout: CartesianChartLayout, maxValue?: number, debug?: boolean, renderEnvironment?: RenderEnvironment) => ChartElements;
@@ -1,2 +1,3 @@
1
+ import type { RenderEnvironment } from "@excalidraw/element";
1
2
  import type { ChartElements, Spreadsheet } from "./charts.types";
2
- export declare const renderLineChart: (spreadsheet: Spreadsheet, x: number, y: number, colorSeed?: number) => ChartElements;
3
+ export declare const renderLineChart: (spreadsheet: Spreadsheet, x: number, y: number, colorSeed?: number, renderEnvironment?: RenderEnvironment) => ChartElements;
@@ -1,2 +1,3 @@
1
+ import type { RenderEnvironment } from "@excalidraw/element";
1
2
  import type { ChartElements, Spreadsheet } from "./charts.types";
2
- export declare const renderRadarChart: (spreadsheet: Spreadsheet, x: number, y: number, colorSeed?: number) => ChartElements | null;
3
+ export declare const renderRadarChart: (spreadsheet: Spreadsheet, x: number, y: number, colorSeed?: number, renderEnvironment?: RenderEnvironment) => ChartElements | null;
@@ -1,7 +1,8 @@
1
1
  import type { ChartType } from "@excalidraw/element/types";
2
+ import type { RenderEnvironment } from "@excalidraw/element";
2
3
  import { tryParseCells, tryParseNumber, tryParseSpreadsheet } from "./charts.parse";
3
4
  import type { ChartElements, Spreadsheet } from "./charts.types";
4
5
  export { type ParseSpreadsheetResult, type Spreadsheet, type SpreadsheetSeries, type ChartElements, } from "./charts.types";
5
6
  export { isSpreadsheetValidForChartType } from "./charts.helpers";
6
7
  export { tryParseCells, tryParseNumber, tryParseSpreadsheet };
7
- export declare const renderSpreadsheet: (chartType: ChartType, spreadsheet: Spreadsheet, x: number, y: number, colorSeed?: number) => ChartElements | null;
8
+ export declare const renderSpreadsheet: (chartType: ChartType, spreadsheet: Spreadsheet, x: number, y: number, colorSeed?: number, renderEnvironment?: RenderEnvironment) => ChartElements | null;
@@ -36,8 +36,15 @@ export declare const MobileShapeActions: ({ appState, elementsMap, renderAction,
36
36
  app: AppClassProperties;
37
37
  setAppState: React.Component<any, AppState>["setState"];
38
38
  }) => import("react/jsx-runtime").JSX.Element;
39
- export declare const ZoomActions: ({ renderAction, }: {
40
- renderAction: ActionManager["renderAction"];
39
+ /**
40
+ * The zoom level, opening a menu of the zoom actions, along with the minimap
41
+ * toggle.
42
+ */
43
+ export declare const ZoomActions: ({ actionManager, zoomUIEnabled, minimapUIEnabled, zenModeEnabled, }: {
44
+ actionManager: ActionManager;
45
+ zoomUIEnabled: boolean;
46
+ minimapUIEnabled: boolean;
47
+ zenModeEnabled: boolean;
41
48
  }) => import("react/jsx-runtime").JSX.Element;
42
49
  export declare const UndoRedoActions: ({ renderAction, className, }: {
43
50
  renderAction: ActionManager["renderAction"];
@@ -2,19 +2,16 @@ import { LinearElementEditor } from "@excalidraw/element";
2
2
  import type { ArrowEndpoint } from "@excalidraw/element";
3
3
  import type { ExcalidrawElement, ExcalidrawTextElement, FixedPoint, NonDeleted, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
4
4
  import type App from "./App";
5
- import type { AppState, PointerDownState } from "../types";
5
+ import type { PointerDownState } from "../types";
6
6
  /**
7
7
  * Text ↔ arrow interactions.
8
8
  *
9
- * With the text tool: the hover affordance showing where a click would attach
10
- * text to an arrow — a free endpoint (binds the arrow to a new text element
11
- * positioned against that endpoint) or the arrow's midpoint (adds a label
12
- * bound to the arrow) — and the endpoint-bound flavor of drag-sizing a new
13
- * text.
9
+ * With the text tool: the free endpoint a click would bind a new text to
10
+ * (`AppTextTool` resolves and shows it), the binding itself, and the
11
+ * endpoint-bound flavor of drag-sizing a new text.
14
12
  *
15
13
  * With the selection tool: dragging an arrow's existing label along the arrow
16
- * — the grab affordance, the drag itself, and where a double-click starts
17
- * editing a label the drag has moved.
14
+ * — the grab affordance and the drag itself.
18
15
  *
19
16
  * The scene-level logic lives in `@excalidraw/element`'s
20
17
  * `arrowEndpointText.ts` and `linearElementEditor.ts`.
@@ -22,34 +19,12 @@ import type { AppState, PointerDownState } from "../types";
22
19
  export declare class AppArrowText {
23
20
  private app;
24
21
  constructor(app: App);
25
- /**
26
- * With the text tool active, an arrow under the cursor is a target for
27
- * attaching text. Returns where the text would land (if anywhere), and keeps
28
- * `appState.hoveredArrowTextAnchor` — which drives the highlight — in sync.
29
- */
30
- updateHoveredAnchor: (scenePointer: {
31
- x: number;
32
- y: number;
33
- }) => AppState["hoveredArrowTextAnchor"];
34
- /**
35
- * Re-evaluates the hovered anchor at the last known pointer position — for
36
- * events that change what a click would do without the pointer moving,
37
- * i.e. the ctrl/cmd binding toggle. (Events that invalidate the anchor
38
- * wholesale — tool switches, finalize, deselect — clear it directly
39
- * instead.)
40
- */
41
- refresh: () => void;
42
22
  /**
43
23
  * A free arrow endpoint a new text could be bound to. Binding an endpoint is
44
24
  * an arrow binding, so it follows the binding toggle (ctrl/cmd) like every
45
25
  * other one — holding it makes the text tool drop plain text instead.
46
26
  */
47
27
  getBindableEndpointAtPosition(x: number, y: number): ArrowEndpoint | null;
48
- /**
49
- * Mirrors what `handleTextOnPointerDown` would do at this position, so the
50
- * highlight can't promise something the click won't deliver.
51
- */
52
- private getAnchorAtPosition;
53
28
  /**
54
29
  * How a text should be created to read as a label for this endpoint — the
55
30
  * side midpoint to bind, the alignment that pins it, and the scene position
@@ -92,13 +67,4 @@ export declare class AppArrowText {
92
67
  x: number;
93
68
  y: number;
94
69
  }): boolean;
95
- /**
96
- * Where a double-click on a labeled arrow should start text editing: the
97
- * center of the label itself, which a label drag may have moved away from
98
- * the arrow's midpoint. Null when the element is not a labeled arrow.
99
- */
100
- getLabelCenter(element: ExcalidrawElement): {
101
- x: number;
102
- y: number;
103
- } | null;
104
70
  }
@@ -0,0 +1,31 @@
1
+ import type React from "react";
2
+ import type App from "./App";
3
+ type AppClipboardDependencies = {
4
+ getContainer: () => HTMLDivElement | null;
5
+ };
6
+ /**
7
+ * The clipboard: cut and copy (through their actions), and paste — the
8
+ * pasted data parsed (`pasteFromClipboard`) and inserted as whatever it is
9
+ * (`insertClipboardContent`): images or SVG code, elements, a Mermaid
10
+ * definition, embeddable URLs, a spreadsheet (as a chart), mixed content,
11
+ * or text. Pasted elements go in through `app.addElementsFromPasteOrLibrary`,
12
+ * as a library item or a drop does.
13
+ */
14
+ export declare class AppClipboard {
15
+ private app;
16
+ private dependencies;
17
+ constructor(app: App, dependencies: AppClipboardDependencies);
18
+ onCut: (event: ClipboardEvent) => void;
19
+ onCopy: (event: ClipboardEvent) => void;
20
+ private insertClipboardContent;
21
+ /**
22
+ * Ctrl/Cmd+V: whether the paste event that follows is a plain one (with
23
+ * Shift)
24
+ */
25
+ onPasteShortcut: (event: React.KeyboardEvent | KeyboardEvent) => void;
26
+ clearPlainPaste: () => void;
27
+ pasteFromClipboard: (event: ClipboardEvent) => Promise<void>;
28
+ private addElementsFromMixedContentPaste;
29
+ private addTextFromPaste;
30
+ }
31
+ export {};