@zsviczian/excalidraw 0.18.0-6 → 0.18.0-60

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 (199) hide show
  1. package/dist/excalidraw.development.js +757 -504
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/dist/excalidraw.production.min.js.LICENSE.txt +0 -2
  4. package/dist/styles.development.css +1080 -437
  5. package/dist/styles.production.css +26 -22
  6. package/package.json +15 -4
  7. package/types/common/src/commonObsidianUtils.d.ts +20 -0
  8. package/types/common/src/constants.d.ts +42 -18
  9. package/types/common/src/editorInterface.d.ts +35 -0
  10. package/types/{excalidraw → common/src}/emitter.d.ts +1 -1
  11. package/types/common/src/font-metadata.d.ts +4 -2
  12. package/types/common/src/index.d.ts +4 -0
  13. package/types/common/src/utility-types.d.ts +5 -0
  14. package/types/common/src/utils.d.ts +25 -6
  15. package/types/{excalidraw → common/src}/visualdebug.d.ts +2 -2
  16. package/types/{excalidraw/scene → element/src}/Scene.d.ts +16 -15
  17. package/types/element/src/align.d.ts +4 -3
  18. package/types/element/src/binding.d.ts +62 -41
  19. package/types/element/src/bounds.d.ts +14 -6
  20. package/types/element/src/collision.d.ts +23 -13
  21. package/types/element/src/cropElement.d.ts +1 -1
  22. package/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +77 -40
  23. package/types/element/src/distance.d.ts +2 -2
  24. package/types/element/src/distribute.d.ts +2 -1
  25. package/types/element/src/dragElements.d.ts +3 -2
  26. package/types/element/src/duplicate.d.ts +10 -13
  27. package/types/element/src/elbowArrow.d.ts +1 -1
  28. package/types/element/src/flowchart.d.ts +3 -2
  29. package/types/element/src/fractionalIndex.d.ts +9 -3
  30. package/types/element/src/frame.d.ts +5 -4
  31. package/types/element/src/groups.d.ts +1 -0
  32. package/types/element/src/index.d.ts +44 -5
  33. package/types/element/src/linearElementEditor.d.ts +34 -50
  34. package/types/element/src/mutateElement.d.ts +11 -3
  35. package/types/element/src/newElement.d.ts +6 -4
  36. package/types/element/src/positionElementsOnGrid.d.ts +2 -0
  37. package/types/element/src/renderElement.d.ts +5 -2
  38. package/types/element/src/resizeElements.d.ts +6 -5
  39. package/types/element/src/resizeTest.d.ts +5 -4
  40. package/types/element/src/selection.d.ts +11 -5
  41. package/types/element/src/shape.d.ts +42 -0
  42. package/types/element/src/sizeHelpers.d.ts +2 -2
  43. package/types/element/src/store.d.ts +237 -0
  44. package/types/element/src/textElement.d.ts +4 -3
  45. package/types/element/src/transformHandles.d.ts +5 -4
  46. package/types/element/src/typeChecks.d.ts +20 -3
  47. package/types/element/src/types.d.ts +31 -12
  48. package/types/element/src/utils.d.ts +17 -6
  49. package/types/element/src/zindex.d.ts +8 -2
  50. package/types/excalidraw/actions/actionAddToLibrary.d.ts +88 -58
  51. package/types/excalidraw/actions/actionAlign.d.ts +6 -6
  52. package/types/excalidraw/actions/actionBoundText.d.ts +61 -41
  53. package/types/excalidraw/actions/actionCanvas.d.ts +430 -519
  54. package/types/excalidraw/actions/actionClipboard.d.ts +81 -944
  55. package/types/excalidraw/actions/actionCropEditor.d.ts +30 -20
  56. package/types/excalidraw/actions/actionDeleteSelected.d.ts +97 -68
  57. package/types/excalidraw/actions/actionDistribute.d.ts +2 -2
  58. package/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
  59. package/types/excalidraw/actions/actionElementLink.d.ts +28 -20
  60. package/types/excalidraw/actions/actionElementLock.d.ts +73 -54
  61. package/types/excalidraw/actions/actionEmbeddable.d.ts +30 -20
  62. package/types/excalidraw/actions/actionExport.d.ts +142 -1185
  63. package/types/excalidraw/actions/actionFinalize.d.ts +10 -424
  64. package/types/excalidraw/actions/actionFlip.d.ts +2 -2
  65. package/types/excalidraw/actions/actionFrame.d.ts +176 -129
  66. package/types/excalidraw/actions/actionGroup.d.ts +60 -40
  67. package/types/excalidraw/actions/actionHistory.d.ts +1 -2
  68. package/types/excalidraw/actions/actionLinearEditor.d.ts +564 -22
  69. package/types/excalidraw/actions/actionLink.d.ts +27 -17
  70. package/types/excalidraw/actions/actionMenu.d.ts +27 -457
  71. package/types/excalidraw/actions/actionNavigate.d.ts +21 -431
  72. package/types/excalidraw/actions/actionProperties.d.ts +169 -2702
  73. package/types/excalidraw/actions/actionSelectAll.d.ts +30 -20
  74. package/types/excalidraw/actions/actionStyles.d.ts +31 -21
  75. package/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
  76. package/types/excalidraw/actions/actionToggleGridMode.d.ts +29 -19
  77. package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +29 -19
  78. package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +27 -224
  79. package/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
  80. package/types/excalidraw/actions/actionToggleStats.d.ts +29 -19
  81. package/types/excalidraw/actions/actionToggleViewMode.d.ts +30 -20
  82. package/types/excalidraw/actions/actionToggleZenMode.d.ts +30 -20
  83. package/types/excalidraw/actions/actionTrayMenu.d.ts +229 -0
  84. package/types/excalidraw/actions/actionZindex.d.ts +2 -2
  85. package/types/excalidraw/actions/index.d.ts +4 -2
  86. package/types/excalidraw/actions/manager.d.ts +1 -1
  87. package/types/excalidraw/actions/register.d.ts +1 -1
  88. package/types/excalidraw/actions/types.d.ts +7 -6
  89. package/types/excalidraw/appState.d.ts +22 -7
  90. package/types/excalidraw/clipboard.d.ts +68 -5
  91. package/types/excalidraw/components/Actions.d.ts +20 -7
  92. package/types/excalidraw/components/App.d.ts +68 -46
  93. package/types/excalidraw/components/ButtonIcon.d.ts +1 -0
  94. package/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
  95. package/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +5 -1
  96. package/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
  97. package/types/excalidraw/components/ColorPicker/Picker.d.ts +4 -3
  98. package/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +3 -3
  99. package/types/excalidraw/components/ColorPicker/ShadeList.d.ts +3 -2
  100. package/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
  101. package/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  102. package/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
  103. package/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
  104. package/types/excalidraw/components/CommandPalette/types.d.ts +1 -2
  105. package/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
  106. package/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
  107. package/types/excalidraw/components/Ellipsify.d.ts +3 -0
  108. package/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
  109. package/types/excalidraw/components/FilledButton.d.ts +1 -1
  110. package/types/excalidraw/components/FixedSideContainer.d.ts +2 -1
  111. package/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
  112. package/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
  113. package/types/excalidraw/components/HintViewer.d.ts +4 -3
  114. package/types/excalidraw/components/InlineIcon.d.ts +3 -1
  115. package/types/excalidraw/components/LayerUI.d.ts +2 -1
  116. package/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
  117. package/types/excalidraw/components/LinkButton.d.ts +4 -0
  118. package/types/excalidraw/components/MobileMenu.d.ts +4 -5
  119. package/types/excalidraw/components/MobileToolBar.d.ts +10 -0
  120. package/types/excalidraw/components/Popover.d.ts +2 -1
  121. package/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
  122. package/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
  123. package/types/excalidraw/components/Range.d.ts +3 -3
  124. package/types/excalidraw/components/Section.d.ts +1 -0
  125. package/types/excalidraw/components/Stats/Angle.d.ts +1 -1
  126. package/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
  127. package/types/excalidraw/components/Stats/CanvasGridSize.d.ts +1 -1
  128. package/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
  129. package/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
  130. package/types/excalidraw/components/Stats/DragInput.d.ts +12 -2
  131. package/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
  132. package/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
  133. package/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
  134. package/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
  135. package/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
  136. package/types/excalidraw/components/Stats/Position.d.ts +1 -1
  137. package/types/excalidraw/components/Stats/utils.d.ts +4 -11
  138. package/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
  139. package/types/excalidraw/components/TextField.d.ts +1 -0
  140. package/types/excalidraw/components/ToolPopover.d.ts +25 -0
  141. package/types/excalidraw/components/TrayMenu.d.ts +26 -0
  142. package/types/excalidraw/components/UnlockPopup.d.ts +8 -0
  143. package/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +7 -3
  144. package/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
  145. package/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
  146. package/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
  147. package/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
  148. package/types/excalidraw/components/icons.d.ts +17 -0
  149. package/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +14 -1
  150. package/types/excalidraw/components/main-menu/MainMenu.d.ts +0 -3
  151. package/types/excalidraw/components/shapes.d.ts +115 -5
  152. package/types/excalidraw/data/blob.d.ts +3 -7
  153. package/types/excalidraw/data/reconcile.d.ts +1 -0
  154. package/types/excalidraw/data/restore.d.ts +7 -2
  155. package/types/excalidraw/data/transform.d.ts +1 -1
  156. package/types/excalidraw/data/types.d.ts +4 -1
  157. package/types/excalidraw/editor-jotai.d.ts +6 -6
  158. package/types/excalidraw/eraser/index.d.ts +0 -2
  159. package/types/excalidraw/fonts/Fonts.d.ts +1 -1
  160. package/types/excalidraw/history.d.ts +30 -22
  161. package/types/excalidraw/hooks/useEmitter.d.ts +1 -1
  162. package/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  163. package/types/excalidraw/hooks/useOutsideClick.d.ts +3 -1
  164. package/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  165. package/types/excalidraw/index.d.ts +16 -15
  166. package/types/excalidraw/lasso/index.d.ts +1 -0
  167. package/types/excalidraw/lasso/utils.d.ts +2 -1
  168. package/types/excalidraw/obsidianUtils.d.ts +22 -9
  169. package/types/excalidraw/renderer/animation.d.ts +12 -0
  170. package/types/excalidraw/renderer/helpers.d.ts +3 -2
  171. package/types/excalidraw/renderer/interactiveScene.d.ts +5 -13
  172. package/types/excalidraw/renderer/staticScene.d.ts +4 -1
  173. package/types/excalidraw/scene/Renderer.d.ts +1 -2
  174. package/types/excalidraw/scene/index.d.ts +2 -2
  175. package/types/excalidraw/scene/scrollbars.d.ts +2 -3
  176. package/types/excalidraw/scene/types.d.ts +17 -3
  177. package/types/excalidraw/shortcut.d.ts +1 -0
  178. package/types/excalidraw/snapping.d.ts +2 -2
  179. package/types/excalidraw/types.d.ts +83 -33
  180. package/types/excalidraw/webpack.dev.config.d.ts +2 -0
  181. package/types/excalidraw/webpack.prod.config.d.ts +2 -0
  182. package/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
  183. package/types/math/src/angle.d.ts +2 -0
  184. package/types/math/src/constants.d.ts +3 -0
  185. package/types/math/src/curve.d.ts +34 -0
  186. package/types/math/src/index.d.ts +1 -0
  187. package/types/math/src/point.d.ts +1 -1
  188. package/types/math/src/rectangle.d.ts +2 -0
  189. package/types/math/src/segment.d.ts +1 -0
  190. package/types/math/src/vector.d.ts +8 -2
  191. package/types/utils/src/bbox.d.ts +1 -1
  192. package/types/utils/src/index.d.ts +1 -1
  193. package/types/utils/src/withinBounds.d.ts +1 -1
  194. package/types/element/src/Shape.d.ts +0 -17
  195. package/types/element/src/ShapeCache.d.ts +0 -25
  196. package/types/element/src/shapes.d.ts +0 -23
  197. package/types/excalidraw/components/ButtonSelect.d.ts +0 -9
  198. package/types/excalidraw/store.d.ts +0 -129
  199. package/types/utils/src/collision.d.ts +0 -8
@@ -1,5 +1,8 @@
1
1
  import { ALLOWED_PASTE_MIME_TYPES } from "@excalidraw/common";
2
+ import type { ValueOf } from "@excalidraw/common/utility-types";
3
+ import type { IMAGE_MIME_TYPES, STRING_MIME_TYPES } from "@excalidraw/common";
2
4
  import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
5
+ import type { FileSystemHandle } from "./data/filesystem";
3
6
  import type { Spreadsheet } from "./charts";
4
7
  import type { BinaryFiles } from "./types";
5
8
  export type PastedMixedContent = {
@@ -21,9 +24,9 @@ export declare const probablySupportsClipboardWriteText: boolean;
21
24
  export declare const probablySupportsClipboardBlob: boolean;
22
25
  export declare const createPasteEvent: ({ types, files, }: {
23
26
  types?: {
24
- "image/svg+xml"?: string | File | undefined;
25
- "text/html"?: string | File | undefined;
26
27
  "text/plain"?: string | File | undefined;
28
+ "text/html"?: string | File | undefined;
29
+ "image/svg+xml"?: string | File | undefined;
27
30
  "image/png"?: string | File | undefined;
28
31
  "image/jpeg"?: string | File | undefined;
29
32
  "image/gif"?: string | File | undefined;
@@ -45,9 +48,9 @@ export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawEl
45
48
  * Will prompt user for permission if not granted.
46
49
  */
47
50
  export declare const readSystemClipboard: () => Promise<{
48
- "image/svg+xml"?: string | File | undefined;
49
- "text/html"?: string | File | undefined;
50
51
  "text/plain"?: string | File | undefined;
52
+ "text/html"?: string | File | undefined;
53
+ "image/svg+xml"?: string | File | undefined;
51
54
  "image/png"?: string | File | undefined;
52
55
  "image/jpeg"?: string | File | undefined;
53
56
  "image/gif"?: string | File | undefined;
@@ -57,10 +60,70 @@ export declare const readSystemClipboard: () => Promise<{
57
60
  "image/avif"?: string | File | undefined;
58
61
  "image/jfif"?: string | File | undefined;
59
62
  }>;
63
+ type AllowedParsedDataTransferItem = {
64
+ type: ValueOf<typeof IMAGE_MIME_TYPES>;
65
+ kind: "file";
66
+ file: File;
67
+ fileHandle: FileSystemHandle | null;
68
+ } | {
69
+ type: ValueOf<typeof STRING_MIME_TYPES>;
70
+ kind: "string";
71
+ value: string;
72
+ };
73
+ type ParsedDataTransferItem = {
74
+ type: string;
75
+ kind: "file";
76
+ file: File;
77
+ fileHandle: FileSystemHandle | null;
78
+ } | {
79
+ type: string;
80
+ kind: "string";
81
+ value: string;
82
+ };
83
+ type ParsedDataTransferItemType<T extends AllowedParsedDataTransferItem["type"]> = AllowedParsedDataTransferItem & {
84
+ type: T;
85
+ };
86
+ export type ParsedDataTransferFile = Extract<AllowedParsedDataTransferItem, {
87
+ kind: "file";
88
+ }>;
89
+ type ParsedDataTranferList = ParsedDataTransferItem[] & {
90
+ /**
91
+ * Only allows filtering by known `string` data types, since `file`
92
+ * types can have multiple items of the same type (e.g. multiple image files)
93
+ * unlike `string` data transfer items.
94
+ */
95
+ findByType: typeof findDataTransferItemType;
96
+ /**
97
+ * Only allows filtering by known `string` data types, since `file`
98
+ * types can have multiple items of the same type (e.g. multiple image files)
99
+ * unlike `string` data transfer items.
100
+ */
101
+ getData: typeof getDataTransferItemData;
102
+ getFiles: typeof getDataTransferFiles;
103
+ };
104
+ declare const findDataTransferItemType: <T extends ValueOf<{
105
+ readonly text: "text/plain";
106
+ readonly html: "text/html";
107
+ readonly json: "application/json";
108
+ readonly excalidraw: "application/vnd.excalidraw+json";
109
+ readonly excalidrawlib: "application/vnd.excalidrawlib+json";
110
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
111
+ }>>(this: ParsedDataTranferList, type: T) => ParsedDataTransferItemType<T> | null;
112
+ declare const getDataTransferItemData: <T extends ValueOf<{
113
+ readonly text: "text/plain";
114
+ readonly html: "text/html";
115
+ readonly json: "application/json";
116
+ readonly excalidraw: "application/vnd.excalidraw+json";
117
+ readonly excalidrawlib: "application/vnd.excalidrawlib+json";
118
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
119
+ }>>(this: ParsedDataTranferList, type: T) => ParsedDataTransferItemType<ValueOf<typeof STRING_MIME_TYPES>>["value"] | null;
120
+ declare const getDataTransferFiles: (this: ParsedDataTranferList) => ParsedDataTransferFile[];
121
+ export declare const parseDataTransferEvent: (event: ClipboardEvent | DragEvent | React.DragEvent<HTMLDivElement>) => Promise<ParsedDataTranferList>;
60
122
  /**
61
123
  * Attempts to parse clipboard event.
62
124
  */
63
- export declare const parseClipboard: (event: ClipboardEvent, isPlainPaste?: boolean) => Promise<ClipboardData>;
125
+ export declare const parseClipboard: (dataList: ParsedDataTranferList, isPlainPaste?: boolean) => Promise<ClipboardData>;
64
126
  export declare const copyBlobToClipboardAsPng: (blob: Blob | Promise<Blob>) => Promise<void>;
65
127
  export declare const copyTextToSystemClipboard: (text: string | null, clipboardEvent?: ClipboardEvent | null) => Promise<void>;
128
+ export declare const isClipboardEvent: (event: React.SyntheticEvent | Event) => event is ClipboardEvent;
66
129
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { ExcalidrawElement, NonDeletedElementsMap, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
2
2
  import "./Actions.scss";
3
- import type { AppClassProperties, AppProps, UIAppState, Zoom } from "../types";
3
+ import type { AppClassProperties, AppProps, UIAppState, Zoom, AppState } from "../types";
4
4
  import type { ActionManager } from "../actions/manager";
5
5
  export declare const canChangeStrokeColor: (appState: UIAppState, targetElements: ExcalidrawElement[]) => boolean;
6
6
  export declare const canChangeBackgroundColor: (appState: UIAppState, targetElements: ExcalidrawElement[]) => boolean;
@@ -10,9 +10,23 @@ export declare const SelectedShapeActions: ({ appState, elementsMap, renderActio
10
10
  renderAction: ActionManager["renderAction"];
11
11
  app: AppClassProperties;
12
12
  }) => import("react/jsx-runtime").JSX.Element;
13
- export declare const ShapesSwitcher: ({ activeTool, appState, app, UIOptions, }: {
14
- activeTool: UIAppState["activeTool"];
13
+ export declare const CompactShapeActions: ({ appState, elementsMap, renderAction, app, setAppState, }: {
15
14
  appState: UIAppState;
15
+ elementsMap: NonDeletedElementsMap | NonDeletedSceneElementsMap;
16
+ renderAction: ActionManager["renderAction"];
17
+ app: AppClassProperties;
18
+ setAppState: React.Component<any, AppState>["setState"];
19
+ }) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const MobileShapeActions: ({ appState, elementsMap, renderAction, app, setAppState, }: {
21
+ appState: UIAppState;
22
+ elementsMap: NonDeletedElementsMap | NonDeletedSceneElementsMap;
23
+ renderAction: ActionManager["renderAction"];
24
+ app: AppClassProperties;
25
+ setAppState: React.Component<any, AppState>["setState"];
26
+ }) => import("react/jsx-runtime").JSX.Element;
27
+ export declare const ShapesSwitcher: ({ activeTool, setAppState, app, UIOptions, }: {
28
+ activeTool: UIAppState["activeTool"];
29
+ setAppState: React.Component<any, AppState>["setState"];
16
30
  app: AppClassProperties;
17
31
  UIOptions: AppProps["UIOptions"];
18
32
  }) => import("react/jsx-runtime").JSX.Element;
@@ -25,11 +39,10 @@ export declare const UndoRedoActions: ({ renderAction, className, }: {
25
39
  renderAction: ActionManager["renderAction"];
26
40
  className?: string | undefined;
27
41
  }) => import("react/jsx-runtime").JSX.Element;
28
- export declare const ExitZenModeAction: ({ actionManager, showExitZenModeBtn, }: {
42
+ export declare const ExitZenModeButton: ({ actionManager, showExitZenModeBtn, }: {
29
43
  actionManager: ActionManager;
30
44
  showExitZenModeBtn: boolean;
31
45
  }) => import("react/jsx-runtime").JSX.Element;
32
- export declare const FinalizeAction: ({ renderAction, className, }: {
33
- renderAction: ActionManager["renderAction"];
34
- className?: string | undefined;
46
+ export declare const ExitViewModeButton: ({ actionManager, }: {
47
+ actionManager: ActionManager;
35
48
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,20 +1,19 @@
1
1
  import React from "react";
2
- import { type EXPORT_IMAGE_TYPES } from "@excalidraw/common";
3
- import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
4
- import { FlowChartCreator } from "@excalidraw/element/flowchart";
5
- import type { ExcalidrawElement, ExcalidrawLinearElement, NonDeleted, InitializedExcalidrawImageElement, ExcalidrawImageElement, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered } from "@excalidraw/element/types";
2
+ import { type EXPORT_IMAGE_TYPES, Emitter, type EditorInterface, type StylesPanelMode } from "@excalidraw/common";
3
+ import { LinearElementEditor, FlowChartCreator, Scene, type ElementUpdate, StoreDelta, type ApplyToOptions } from "@excalidraw/element";
4
+ import type { ExcalidrawElement, ExcalidrawLinearElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
5
+ import type { Mutable } from "@excalidraw/common/utility-types";
6
6
  import { ActionManager } from "../actions/manager";
7
7
  import { AnimationFrameHandler } from "../animation-frame-handler";
8
- import Scene from "../scene/Scene";
9
8
  import { Fonts } from "../fonts";
9
+ import { type WritableAtom } from "../editor-jotai";
10
10
  import { Renderer } from "../scene/Renderer";
11
- import { Emitter } from "../emitter";
12
11
  import { LaserTrails } from "../laser-trails";
13
12
  import { LassoTrail } from "../lasso";
14
13
  import { EraserTrail } from "../eraser";
15
14
  import type { ExportedElements } from "../data";
16
15
  import type { FileSystemHandle } from "../data/filesystem";
17
- import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
16
+ import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
18
17
  import type { RoughCanvas } from "roughjs/bin/canvas";
19
18
  import type { ActionResult } from "../actions/types";
20
19
  export declare const ExcalidrawContainerContext: React.Context<{
@@ -23,17 +22,19 @@ export declare const ExcalidrawContainerContext: React.Context<{
23
22
  }>;
24
23
  export declare const useApp: () => AppClassProperties;
25
24
  export declare const useAppProps: () => AppProps;
26
- export declare const useDevice: () => Readonly<{
27
- viewport: {
28
- isMobile: boolean;
29
- isLandscape: boolean;
30
- };
31
- editor: {
32
- isMobile: boolean;
33
- canFitSidebar: boolean;
34
- };
25
+ export declare const useEditorInterface: () => Readonly<{
26
+ formFactor: "phone" | "tablet" | "desktop";
27
+ desktopUIMode: "tray" | "full" | "compact";
28
+ userAgent: Readonly<{
29
+ isMobileDevice: boolean;
30
+ platform: "other" | "unknown" | "ios" | "android";
31
+ }>;
35
32
  isTouchScreen: boolean;
33
+ canFitSidebar: boolean;
34
+ isLandscape: boolean;
35
+ preferTrayMode: boolean;
36
36
  }>;
37
+ export declare const useStylesPanelMode: () => StylesPanelMode;
37
38
  export declare const useExcalidrawContainer: () => {
38
39
  container: HTMLDivElement | null;
39
40
  id: string | null;
@@ -48,19 +49,20 @@ declare class App extends React.Component<AppProps, AppState> {
48
49
  rc: RoughCanvas;
49
50
  unmounted: boolean;
50
51
  actionManager: ActionManager;
51
- device: Device;
52
+ editorInterface: EditorInterface;
53
+ private stylesPanelMode;
52
54
  private excalidrawContainerRef;
53
55
  scene: Scene;
54
56
  fonts: Fonts;
55
57
  renderer: Renderer;
56
58
  visibleElements: readonly NonDeletedExcalidrawElement[];
57
59
  private resizeObserver;
58
- private nearestScrollableContainer;
59
60
  library: AppClassProperties["library"];
60
61
  libraryItemsFromStorage: LibraryItems | undefined;
61
62
  id: string;
62
63
  private store;
63
64
  private history;
65
+ private shouldRenderAllEmbeddables;
64
66
  excalidrawContainerValue: {
65
67
  container: HTMLDivElement | null;
66
68
  id: string;
@@ -78,9 +80,11 @@ declare class App extends React.Component<AppProps, AppState> {
78
80
  /** embeds that have been inserted to DOM (as a perf optim, we don't want to
79
81
  * insert to DOM before user initially scrolls to them) */
80
82
  private initializedEmbeds;
83
+ private handleToastClose;
81
84
  private elementsPendingErasure;
82
85
  flowChartCreator: FlowChartCreator;
83
86
  private flowChartNavigator;
87
+ bindModeHandler: ReturnType<typeof setTimeout> | null;
84
88
  hitLinkElement?: NonDeletedExcalidrawElement;
85
89
  lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
86
90
  lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
@@ -123,7 +127,7 @@ declare class App extends React.Component<AppProps, AppState> {
123
127
  };
124
128
  originalElements: Map<string, NonDeleted<ExcalidrawElement>>;
125
129
  resize: {
126
- handleType: import("@excalidraw/element/transformHandles").MaybeTransformHandleType;
130
+ handleType: import("@excalidraw/element").MaybeTransformHandleType;
127
131
  isResizing: boolean;
128
132
  offset: {
129
133
  x: number;
@@ -138,10 +142,6 @@ declare class App extends React.Component<AppProps, AppState> {
138
142
  hit: {
139
143
  element: NonDeleted<ExcalidrawElement> | null;
140
144
  allHitElements: NonDeleted<ExcalidrawElement>[];
141
- /**
142
- * Returns gridSize taking into account `gridModeEnabled`.
143
- * If disabled, returns null.
144
- */
145
145
  wasAddedToSelection: boolean;
146
146
  hasBeenDuplicated: boolean;
147
147
  hasHitCommonBoundingBoxOfSelectedElements: boolean;
@@ -153,6 +153,11 @@ declare class App extends React.Component<AppProps, AppState> {
153
153
  x: number;
154
154
  y: number;
155
155
  } | null;
156
+ origin: {
157
+ x: number;
158
+ y: number;
159
+ };
160
+ blockDragging: boolean;
156
161
  };
157
162
  eventListeners: {
158
163
  onMove: {
@@ -192,7 +197,7 @@ declare class App extends React.Component<AppProps, AppState> {
192
197
  };
193
198
  originalElements: Map<string, NonDeleted<ExcalidrawElement>>;
194
199
  resize: {
195
- handleType: import("@excalidraw/element/transformHandles").MaybeTransformHandleType;
200
+ handleType: import("@excalidraw/element").MaybeTransformHandleType;
196
201
  isResizing: boolean;
197
202
  offset: {
198
203
  x: number;
@@ -207,10 +212,6 @@ declare class App extends React.Component<AppProps, AppState> {
207
212
  hit: {
208
213
  element: NonDeleted<ExcalidrawElement> | null;
209
214
  allHitElements: NonDeleted<ExcalidrawElement>[];
210
- /**
211
- * Returns gridSize taking into account `gridModeEnabled`.
212
- * If disabled, returns null.
213
- */
214
215
  wasAddedToSelection: boolean;
215
216
  hasBeenDuplicated: boolean;
216
217
  hasHitCommonBoundingBoxOfSelectedElements: boolean;
@@ -222,6 +223,11 @@ declare class App extends React.Component<AppProps, AppState> {
222
223
  x: number;
223
224
  y: number;
224
225
  } | null;
226
+ origin: {
227
+ x: number;
228
+ y: number;
229
+ };
230
+ blockDragging: boolean;
225
231
  };
226
232
  eventListeners: {
227
233
  onMove: {
@@ -244,7 +250,12 @@ declare class App extends React.Component<AppProps, AppState> {
244
250
  missingPointerEventCleanupEmitter: Emitter<[event: PointerEvent | null]>;
245
251
  onRemoveEventListenersEmitter: Emitter<[]>;
246
252
  constructor(props: AppProps);
253
+ updateEditorAtom: <Value, Args extends unknown[], Result>(atom: WritableAtom<Value, Args, Result>, ...args: Args) => Result;
247
254
  private onWindowMessage;
255
+ private handleSkipBindMode;
256
+ private resetDelayedBindMode;
257
+ private previousHoveredBindableElement;
258
+ private handleDelayedBindModeChange;
248
259
  private cacheEmbeddableRef;
249
260
  /**
250
261
  * Returns gridSize taking into account `gridModeEnabled`.
@@ -265,6 +276,7 @@ declare class App extends React.Component<AppProps, AppState> {
265
276
  render(): import("react/jsx-runtime").JSX.Element;
266
277
  focusContainer: AppClassProperties["focusContainer"];
267
278
  getSceneElementsIncludingDeleted: () => readonly import("@excalidraw/element/types").OrderedExcalidrawElement[];
279
+ getSceneElementsMapIncludingDeleted: () => Map<string, Ordered<ExcalidrawElement>> & import("@excalidraw/common/utility-types").MakeBrand<"SceneElementsMap">;
268
280
  getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
269
281
  onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
270
282
  onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
@@ -295,9 +307,14 @@ declare class App extends React.Component<AppProps, AppState> {
295
307
  */
296
308
  private resetScene;
297
309
  private initializeScene;
298
- private isMobileBreakpoint;
299
- private refreshViewportBreakpoints;
300
- private refreshEditorBreakpoints;
310
+ private getFormFactor;
311
+ refreshEditorInterface: (preferTrayMode?: boolean) => void;
312
+ private reconcileStylesPanelMode;
313
+ /** TO BE USED LATER */
314
+ private setDesktopUIMode;
315
+ private isTouchScreen;
316
+ private setTrayModeEnabled;
317
+ isTrayModeEnabled: () => boolean;
301
318
  private clearImageShapeCache;
302
319
  componentDidMount(): Promise<void>;
303
320
  componentWillUnmount(): void;
@@ -314,6 +331,7 @@ declare class App extends React.Component<AppProps, AppState> {
314
331
  private static resetTapTwice;
315
332
  private onTouchStart;
316
333
  private onTouchEnd;
334
+ private insertClipboardContent;
317
335
  pasteFromClipboard: (event: ClipboardEvent) => Promise<void>;
318
336
  addElementsFromPasteOrLibrary: (opts: {
319
337
  elements: readonly ExcalidrawElement[];
@@ -335,6 +353,8 @@ declare class App extends React.Component<AppProps, AppState> {
335
353
  name: boolean;
336
354
  outline: boolean;
337
355
  clip: boolean;
356
+ markerName: boolean;
357
+ markerEnabled: boolean;
338
358
  }> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
339
359
  togglePenMode: (force: boolean | null) => void;
340
360
  onHandToolToggle: () => void;
@@ -366,6 +386,7 @@ declare class App extends React.Component<AppProps, AppState> {
366
386
  private maybeUnfollowRemoteUser;
367
387
  /** use when changing scrollX/scrollY/zoom based on user interaction */
368
388
  private translateCanvas;
389
+ setForceRenderAllEmbeddables: (force: boolean) => void;
369
390
  zoomToFit: (target?: readonly ExcalidrawElement[], maxZoom?: number, margin?: number) => void;
370
391
  getColorAtScenePoint: ({ sceneX, sceneY, }: {
371
392
  sceneX: number;
@@ -384,7 +405,7 @@ declare class App extends React.Component<AppProps, AppState> {
384
405
  * NOTE if file already exists in editor state, the file data is not updated
385
406
  * */
386
407
  addFiles: ExcalidrawImperativeAPI["addFiles"];
387
- setMobileModeAllowed: ExcalidrawImperativeAPI["setMobileModeAllowed"];
408
+ setMobileModeAllowed: (allow: boolean) => void;
388
409
  private debounceClearHighlightSearchResults;
389
410
  selectElements: ExcalidrawImperativeAPI["selectElements"];
390
411
  bringToFront: ExcalidrawImperativeAPI["bringToFront"];
@@ -410,6 +431,8 @@ declare class App extends React.Component<AppProps, AppState> {
410
431
  captureUpdate?: SceneData["captureUpdate"];
411
432
  forceFlushSync?: boolean | undefined;
412
433
  }) => void;
434
+ applyDeltas: (deltas: StoreDelta[], options?: ApplyToOptions) => [SceneElementsMap, AppState, boolean];
435
+ mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
413
436
  private triggerRender;
414
437
  /**
415
438
  * @returns whether the menu was toggled on or off
@@ -424,12 +447,9 @@ declare class App extends React.Component<AppProps, AppState> {
424
447
  private onKeyDown;
425
448
  private onKeyUp;
426
449
  private isToolSupported;
427
- setActiveTool: (tool: (({
428
- type: Exclude<ToolType, "image">;
450
+ setActiveTool: (tool: ({
451
+ type: ToolType;
429
452
  } | {
430
- type: Extract<ToolType, "image">;
431
- insertOnCanvasDirectly?: boolean;
432
- }) | {
433
453
  type: "custom";
434
454
  customType: string;
435
455
  }) & {
@@ -455,7 +475,7 @@ declare class App extends React.Component<AppProps, AppState> {
455
475
  private getTextElementAtPosition;
456
476
  private getElementAtPosition;
457
477
  private getElementsAtPosition;
458
- getElementHitThreshold(): number;
478
+ getElementHitThreshold(element: ExcalidrawElement): number;
459
479
  private hitElement;
460
480
  private getTextBindableContainerAtPosition;
461
481
  private startTextEditing;
@@ -481,6 +501,7 @@ declare class App extends React.Component<AppProps, AppState> {
481
501
  */
482
502
  private maybeCleanupAfterMissingPointerUp;
483
503
  handleCanvasPanUsingWheelOrSpaceDrag: (event: React.PointerEvent<HTMLElement> | MouseEvent) => boolean;
504
+ private startRightClickPanning;
484
505
  private updateGestureOnPointerDown;
485
506
  private initialPointerDownState;
486
507
  private handleDraggingScrollBar;
@@ -504,7 +525,7 @@ declare class App extends React.Component<AppProps, AppState> {
504
525
  sceneY: number;
505
526
  link: string;
506
527
  }) => NonDeleted<ExcalidrawEmbeddableElement> | undefined;
507
- private createImageElement;
528
+ private newImagePlaceholder;
508
529
  private handleLinearElementOnPointerDown;
509
530
  private getCurrentItemRoundness;
510
531
  private createGenericElementOnPointerDown;
@@ -520,12 +541,13 @@ declare class App extends React.Component<AppProps, AppState> {
520
541
  private eraseElements;
521
542
  private initializeImage;
522
543
  /**
523
- * inserts image into elements array and rerenders
544
+ * use during async image initialization,
545
+ * when the placeholder image could have been modified in the meantime,
546
+ * and when you don't want to loose those modifications
524
547
  */
525
- insertImageElement: (imageElement: ExcalidrawImageElement, imageFile: File, showCursorImagePreview?: boolean) => Promise<NonDeleted<InitializedExcalidrawImageElement> | null | undefined>;
526
- private setImagePreviewCursor;
527
- private onImageAction;
528
- initializeImageDimensions: (imageElement: ExcalidrawImageElement, forceNaturalSize?: boolean) => void;
548
+ private getLatestInitializedImageElement;
549
+ private onImageToolbarButtonClick;
550
+ private getImageNaturalDimensions;
529
551
  /** updates image cache, refreshing updated elements and/or setting status
530
552
  to error for images that fail during <img> element creation */
531
553
  private updateImageCache;
@@ -535,11 +557,10 @@ declare class App extends React.Component<AppProps, AppState> {
535
557
  * to render new images. This is just a failsafe */
536
558
  private scheduleImageRefresh;
537
559
  private updateBindingEnabledOnPointerMove;
538
- private maybeSuggestBindingAtCursor;
539
- private maybeSuggestBindingsForLinearElementAtCoords;
540
560
  setSelection(elements: readonly NonDeletedExcalidrawElement[]): void;
541
561
  private clearSelection;
542
562
  private handleInteractiveCanvasRef;
563
+ private insertImages;
543
564
  private handleAppOnDrop;
544
565
  loadFileToCanvas: (file: File, fileHandle: FileSystemHandle | null) => Promise<void>;
545
566
  private handleCanvasContextMenu;
@@ -554,6 +575,7 @@ declare class App extends React.Component<AppProps, AppState> {
554
575
  private updateDOMRect;
555
576
  refresh: () => void;
556
577
  private getCanvasOffsets;
578
+ watchState: () => void;
557
579
  private updateLanguage;
558
580
  }
559
581
  export default App;
@@ -10,6 +10,7 @@ interface ButtonIconProps {
10
10
  /** include standalone style (could interfere with parent styles) */
11
11
  standalone?: boolean;
12
12
  onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
13
+ style?: React.CSSProperties;
13
14
  }
14
15
  export declare const ButtonIcon: import("react").ForwardRefExoticComponent<ButtonIconProps & import("react").RefAttributes<HTMLButtonElement>>;
15
16
  export {};
@@ -4,6 +4,7 @@ interface ColorInputProps {
4
4
  onChange: (color: string) => void;
5
5
  label: string;
6
6
  colorPickerType: ColorPickerType;
7
+ placeholder?: string;
7
8
  }
8
- export declare const ColorInput: ({ color, onChange, label, colorPickerType, }: ColorInputProps) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const ColorInput: ({ color, onChange, label, colorPickerType, placeholder, }: ColorInputProps) => import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -6,7 +6,11 @@ import type { AppState } from "../../types";
6
6
  export declare const getColor: (color: string) => string | null;
7
7
  interface ColorPickerProps {
8
8
  type: ColorPickerType;
9
- color: string;
9
+ /**
10
+ * null indicates no color should be displayed as active
11
+ * (e.g. when multiple shapes selected with different colors)
12
+ */
13
+ color: string | null;
10
14
  onChange: (color: string) => void;
11
15
  label: string;
12
16
  elements: readonly ExcalidrawElement[];
@@ -1,6 +1,6 @@
1
1
  interface CustomColorListProps {
2
2
  colors: string[];
3
- color: string;
3
+ color: string | null;
4
4
  onChange: (color: string) => void;
5
5
  label: string;
6
6
  }
@@ -3,16 +3,17 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
3
3
  import type { ColorPaletteCustom } from "@excalidraw/common";
4
4
  import type { ColorPickerType } from "./colorPickerUtils";
5
5
  interface PickerProps {
6
- color: string;
6
+ color: string | null;
7
7
  onChange: (color: string) => void;
8
- label: string;
9
8
  type: ColorPickerType;
10
9
  elements: readonly ExcalidrawElement[];
11
10
  palette: ColorPaletteCustom;
12
11
  updateData: (formData?: any) => void;
13
12
  children?: React.ReactNode;
13
+ showTitle?: boolean;
14
14
  onEyeDropperToggle: (force?: boolean) => void;
15
15
  onEscape: (event: React.KeyboardEvent | KeyboardEvent) => void;
16
+ showHotKey?: boolean;
16
17
  }
17
- export declare const Picker: ({ color, onChange, label, type, elements, palette, updateData, children, onEyeDropperToggle, onEscape, }: PickerProps) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const Picker: React.ForwardRefExoticComponent<PickerProps & React.RefAttributes<unknown>>;
18
19
  export {};
@@ -1,10 +1,10 @@
1
1
  import type { ColorPaletteCustom } from "@excalidraw/common";
2
2
  interface PickerColorListProps {
3
3
  palette: ColorPaletteCustom;
4
- color: string;
4
+ color: string | null;
5
5
  onChange: (color: string) => void;
6
- label: string;
7
6
  activeShade: number;
7
+ showHotKey?: boolean;
8
8
  }
9
- declare const PickerColorList: ({ palette, color, onChange, label, activeShade, }: PickerColorListProps) => import("react/jsx-runtime").JSX.Element;
9
+ declare const PickerColorList: ({ palette, color, onChange, activeShade, showHotKey, }: PickerColorListProps) => import("react/jsx-runtime").JSX.Element;
10
10
  export default PickerColorList;
@@ -1,8 +1,9 @@
1
1
  import type { ColorPaletteCustom } from "@excalidraw/common";
2
2
  interface ShadeListProps {
3
- hex: string;
3
+ color: string | null;
4
4
  onChange: (color: string) => void;
5
5
  palette: ColorPaletteCustom;
6
+ showHotKey?: boolean;
6
7
  }
7
- export declare const ShadeList: ({ hex, onChange, palette }: ShadeListProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const ShadeList: ({ color, onChange, palette, showHotKey, }: ShadeListProps) => import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -2,7 +2,7 @@ import type { ColorPickerType } from "./colorPickerUtils";
2
2
  interface TopPicksProps {
3
3
  onChange: (color: string) => void;
4
4
  type: ColorPickerType;
5
- activeColor: string;
5
+ activeColor: string | null;
6
6
  topPicks?: readonly string[];
7
7
  }
8
8
  export declare const TopPicks: ({ onChange, type, activeColor, topPicks, }: TopPicksProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -2,7 +2,7 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
2
2
  import type { ColorPickerColor, ColorPaletteCustom } from "@excalidraw/common";
3
3
  export declare const getColorNameAndShadeFromColor: ({ palette, color, }: {
4
4
  palette: ColorPaletteCustom;
5
- color: string;
5
+ color: string | null;
6
6
  }) => {
7
7
  colorName: ColorPickerColor;
8
8
  shade: number | null;
@@ -4,7 +4,7 @@ interface ColorPickerKeyNavHandlerProps {
4
4
  event: React.KeyboardEvent;
5
5
  activeColorPickerSection: ActiveColorPickerSectionAtomType;
6
6
  palette: ColorPaletteCustom;
7
- color: string;
7
+ color: string | null;
8
8
  onChange: (color: string) => void;
9
9
  customColors: string[];
10
10
  setActiveColorPickerSection: (update: React.SetStateAction<ActiveColorPickerSectionAtomType>) => void;
@@ -8,6 +8,7 @@ export declare const DEFAULT_CATEGORIES: {
8
8
  editor: string;
9
9
  elements: string;
10
10
  links: string;
11
+ library: string;
11
12
  };
12
13
  type CommandPaletteProps = {
13
14
  customCommandPaletteItems?: CommandPaletteItem[];
@@ -1,6 +1,5 @@
1
1
  import type { ActionManager } from "../../actions/manager";
2
2
  import type { Action } from "../../actions/types";
3
- import type { UIAppState } from "../../types";
4
3
  export type CommandPaletteItem = {
5
4
  label: string;
6
5
  /** additional keywords to match against
@@ -11,7 +10,7 @@ export type CommandPaletteItem = {
11
10
  * (deburred name + keywords)
12
11
  */
13
12
  haystack?: string;
14
- icon?: React.ReactNode | ((appState: UIAppState) => React.ReactNode);
13
+ icon?: Action["icon"];
15
14
  category: string;
16
15
  order?: number;
17
16
  predicate?: boolean | Action["predicate"];
@@ -0,0 +1,23 @@
1
+ import type { ConvertibleTypes, ExcalidrawElement, ExcalidrawTextContainer, ExcalidrawTextElementWithContainer } from "@excalidraw/element/types";
2
+ import type { Scene } from "@excalidraw/element";
3
+ import "./ConvertElementTypePopup.scss";
4
+ import type App from "./App";
5
+ export declare const convertElementTypePopupAtom: import("jotai/vanilla/atom").PrimitiveAtom<{
6
+ type: "panel";
7
+ } | null> & {
8
+ init: {
9
+ type: "panel";
10
+ } | null;
11
+ };
12
+ declare const ConvertElementTypePopup: ({ app }: {
13
+ app: App;
14
+ }) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const adjustBoundTextSize: (container: ExcalidrawTextContainer, boundText: ExcalidrawTextElementWithContainer, scene: Scene) => void;
16
+ type ConversionType = "generic" | "linear" | null;
17
+ export declare const convertElementTypes: (app: App, { conversionType, nextType, direction, }: {
18
+ conversionType: ConversionType;
19
+ nextType?: ConvertibleTypes | undefined;
20
+ direction?: "left" | "right" | undefined;
21
+ }) => boolean;
22
+ export declare const getConversionTypeFromElements: (elements: ExcalidrawElement[]) => ConversionType;
23
+ export default ConvertElementTypePopup;
@@ -1,10 +1,11 @@
1
- import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
1
+ import type { ExcalidrawElement } from "@excalidraw/element/types";
2
+ import type { Scene } from "@excalidraw/element";
2
3
  import "./ElementLinkDialog.scss";
3
4
  import type { AppProps, UIAppState } from "../types";
4
- declare const ElementLinkDialog: ({ sourceElementId, onClose, elementsMap, appState, generateLinkForSelection, }: {
5
+ declare const ElementLinkDialog: ({ sourceElementId, onClose, appState, scene, generateLinkForSelection, }: {
5
6
  sourceElementId: ExcalidrawElement["id"];
6
- elementsMap: ElementsMap;
7
7
  appState: UIAppState;
8
+ scene: Scene;
8
9
  onClose?: (() => void) | undefined;
9
10
  generateLinkForSelection: AppProps["generateLinkForSelection"];
10
11
  }) => import("react/jsx-runtime").JSX.Element;