@zsviczian/excalidraw 0.17.1-obsidian-21 → 0.17.1-obsidian-22

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 (182) hide show
  1. package/dist/excalidraw.development.js +48 -37
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/dist/styles.development.css +10 -13
  4. package/dist/styles.production.css +3 -3
  5. package/package.json +1 -1
  6. package/types/excalidraw/actions/actionAlign.d.ts +2 -2
  7. package/types/excalidraw/actions/actionBoundText.d.ts +3 -3
  8. package/types/excalidraw/actions/actionCanvas.d.ts +3 -3
  9. package/types/excalidraw/actions/actionDeleteSelected.d.ts +2 -2
  10. package/types/excalidraw/actions/actionDistribute.d.ts +2 -2
  11. package/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
  12. package/types/excalidraw/actions/actionElementLock.d.ts +1 -1
  13. package/types/excalidraw/actions/actionExport.d.ts +1 -1
  14. package/types/excalidraw/actions/actionFinalize.d.ts +1 -1
  15. package/types/excalidraw/actions/actionFlip.d.ts +2 -2
  16. package/types/excalidraw/actions/actionFrame.d.ts +2 -2
  17. package/types/excalidraw/actions/actionGroup.d.ts +2 -2
  18. package/types/excalidraw/actions/actionHistory.d.ts +3 -3
  19. package/types/excalidraw/actions/actionLinearEditor.d.ts +4 -2
  20. package/types/excalidraw/actions/actionNavigate.d.ts +1 -1
  21. package/types/excalidraw/actions/actionProperties.d.ts +2 -2
  22. package/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
  23. package/types/excalidraw/actions/actionTextAutoResize.d.ts +17 -0
  24. package/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
  25. package/types/excalidraw/actions/actionZindex.d.ts +4 -0
  26. package/types/excalidraw/actions/manager.d.ts +3 -3
  27. package/types/excalidraw/actions/register.d.ts +1 -1
  28. package/types/excalidraw/actions/shortcuts.d.ts +2 -2
  29. package/types/excalidraw/actions/types.d.ts +6 -6
  30. package/types/excalidraw/align.d.ts +1 -1
  31. package/types/excalidraw/animated-trail.d.ts +2 -2
  32. package/types/excalidraw/appState.d.ts +1 -1
  33. package/types/excalidraw/change.d.ts +4 -4
  34. package/types/excalidraw/charts.d.ts +1 -1
  35. package/types/excalidraw/clients.d.ts +2 -2
  36. package/types/excalidraw/clipboard.d.ts +3 -3
  37. package/types/excalidraw/colors.d.ts +1 -1
  38. package/types/excalidraw/components/Actions.d.ts +3 -3
  39. package/types/excalidraw/components/App.d.ts +8 -8
  40. package/types/excalidraw/components/ColorPicker/ColorInput.d.ts +1 -1
  41. package/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +4 -4
  42. package/types/excalidraw/components/ColorPicker/Picker.d.ts +3 -3
  43. package/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +1 -1
  44. package/types/excalidraw/components/ColorPicker/PickerHeading.d.ts +1 -1
  45. package/types/excalidraw/components/ColorPicker/ShadeList.d.ts +1 -1
  46. package/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
  47. package/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +2 -2
  48. package/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -2
  49. package/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -1
  50. package/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -1
  51. package/types/excalidraw/components/CommandPalette/types.d.ts +3 -3
  52. package/types/excalidraw/components/ConfirmDialog.d.ts +1 -1
  53. package/types/excalidraw/components/ContextMenu.d.ts +2 -2
  54. package/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
  55. package/types/excalidraw/components/DefaultSidebar.d.ts +2 -2
  56. package/types/excalidraw/components/DialogActionButton.d.ts +1 -1
  57. package/types/excalidraw/components/EyeDropper.d.ts +2 -2
  58. package/types/excalidraw/components/FollowMode/FollowMode.d.ts +1 -1
  59. package/types/excalidraw/components/HintViewer.d.ts +1 -1
  60. package/types/excalidraw/components/ImageExportDialog.d.ts +1 -1
  61. package/types/excalidraw/components/InitializeApp.d.ts +2 -2
  62. package/types/excalidraw/components/JSONExportDialog.d.ts +3 -3
  63. package/types/excalidraw/components/LayerUI.d.ts +4 -4
  64. package/types/excalidraw/components/LibraryMenu.d.ts +2 -2
  65. package/types/excalidraw/components/LibraryMenuBrowseButton.d.ts +1 -1
  66. package/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
  67. package/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +2 -2
  68. package/types/excalidraw/components/LibraryMenuItems.d.ts +1 -1
  69. package/types/excalidraw/components/LibraryMenuSection.d.ts +5 -4
  70. package/types/excalidraw/components/LibraryUnit.d.ts +2 -2
  71. package/types/excalidraw/components/LoadingMessage.d.ts +1 -1
  72. package/types/excalidraw/components/MobileMenu.d.ts +3 -3
  73. package/types/excalidraw/components/Modal.d.ts +1 -1
  74. package/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
  75. package/types/excalidraw/components/PasteChartDialog.d.ts +1 -1
  76. package/types/excalidraw/components/PublishLibrary.d.ts +1 -1
  77. package/types/excalidraw/components/SVGLayer.d.ts +1 -1
  78. package/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -1
  79. package/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -1
  80. package/types/excalidraw/components/Sidebar/SidebarTrigger.d.ts +1 -1
  81. package/types/excalidraw/components/Sidebar/common.d.ts +1 -1
  82. package/types/excalidraw/components/Stats.d.ts +2 -2
  83. package/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +2 -2
  84. package/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +1 -1
  85. package/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +1 -1
  86. package/types/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +1 -1
  87. package/types/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +1 -1
  88. package/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -1
  89. package/types/excalidraw/components/TTDDialog/common.d.ts +4 -4
  90. package/types/excalidraw/components/TextField.d.ts +1 -1
  91. package/types/excalidraw/components/Toast.d.ts +1 -1
  92. package/types/excalidraw/components/ToolButton.d.ts +3 -2
  93. package/types/excalidraw/components/Trans.d.ts +1 -1
  94. package/types/excalidraw/components/UserList.d.ts +1 -1
  95. package/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -1
  96. package/types/excalidraw/components/canvases/StaticCanvas.d.ts +2 -2
  97. package/types/excalidraw/components/footer/Footer.d.ts +2 -2
  98. package/types/excalidraw/components/hyperlink/Hyperlink.d.ts +2 -2
  99. package/types/excalidraw/components/hyperlink/helpers.d.ts +3 -3
  100. package/types/excalidraw/components/icons.d.ts +3 -2
  101. package/types/excalidraw/constants.d.ts +2 -2
  102. package/types/excalidraw/context/ui-appState.d.ts +1 -1
  103. package/types/excalidraw/cursor.d.ts +1 -1
  104. package/types/excalidraw/data/EditorLocalStorage.d.ts +2 -2
  105. package/types/excalidraw/data/blob.d.ts +5 -5
  106. package/types/excalidraw/data/filesystem.d.ts +2 -1
  107. package/types/excalidraw/data/index.d.ts +4 -4
  108. package/types/excalidraw/data/json.d.ts +3 -3
  109. package/types/excalidraw/data/library.d.ts +3 -3
  110. package/types/excalidraw/data/magic.d.ts +3 -3
  111. package/types/excalidraw/data/reconcile.d.ts +3 -3
  112. package/types/excalidraw/data/resave.d.ts +2 -2
  113. package/types/excalidraw/data/restore.d.ts +3 -3
  114. package/types/excalidraw/data/transform.d.ts +3 -3
  115. package/types/excalidraw/data/types.d.ts +3 -3
  116. package/types/excalidraw/element/ElementCanvasButtons.d.ts +1 -1
  117. package/types/excalidraw/element/binding.d.ts +3 -3
  118. package/types/excalidraw/element/bounds.d.ts +3 -3
  119. package/types/excalidraw/element/collision.d.ts +3 -3
  120. package/types/excalidraw/element/containerCache.d.ts +1 -1
  121. package/types/excalidraw/element/dragElements.d.ts +3 -3
  122. package/types/excalidraw/element/embeddable.d.ts +3 -3
  123. package/types/excalidraw/element/image.d.ts +2 -2
  124. package/types/excalidraw/element/index.d.ts +2 -2
  125. package/types/excalidraw/element/linearElementEditor.d.ts +5 -5
  126. package/types/excalidraw/element/mutateElement.d.ts +3 -3
  127. package/types/excalidraw/element/newElement.d.ts +3 -10
  128. package/types/excalidraw/element/resizeElements.d.ts +3 -3
  129. package/types/excalidraw/element/resizeTest.d.ts +4 -4
  130. package/types/excalidraw/element/showSelectedShapeActions.d.ts +2 -2
  131. package/types/excalidraw/element/sizeHelpers.d.ts +2 -2
  132. package/types/excalidraw/element/sortElements.d.ts +1 -1
  133. package/types/excalidraw/element/textElement.d.ts +4 -4
  134. package/types/excalidraw/element/textWysiwyg.d.ts +10 -5
  135. package/types/excalidraw/element/transformHandles.d.ts +3 -3
  136. package/types/excalidraw/element/typeChecks.d.ts +3 -3
  137. package/types/excalidraw/element/types.d.ts +11 -4
  138. package/types/excalidraw/emitter.d.ts +1 -1
  139. package/types/excalidraw/fractionalIndex.d.ts +1 -1
  140. package/types/excalidraw/frame.d.ts +3 -3
  141. package/types/excalidraw/gatransforms.d.ts +1 -1
  142. package/types/excalidraw/gesture.d.ts +1 -1
  143. package/types/excalidraw/groups.d.ts +3 -3
  144. package/types/excalidraw/history.d.ts +4 -4
  145. package/types/excalidraw/hooks/useEmitter.d.ts +1 -1
  146. package/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  147. package/types/excalidraw/i18n.d.ts +1 -1
  148. package/types/excalidraw/index.d.ts +3 -1
  149. package/types/excalidraw/jotai.d.ts +1 -1
  150. package/types/excalidraw/laser-trails.d.ts +3 -2
  151. package/types/excalidraw/math.d.ts +2 -2
  152. package/types/excalidraw/points.d.ts +1 -1
  153. package/types/excalidraw/queue.d.ts +1 -1
  154. package/types/excalidraw/renderer/helpers.d.ts +2 -2
  155. package/types/excalidraw/renderer/interactiveScene.d.ts +1 -1
  156. package/types/excalidraw/renderer/renderElement.d.ts +3 -3
  157. package/types/excalidraw/renderer/renderSnaps.d.ts +1 -1
  158. package/types/excalidraw/renderer/staticScene.d.ts +1 -1
  159. package/types/excalidraw/renderer/staticSvgScene.d.ts +4 -4
  160. package/types/excalidraw/scene/Fonts.d.ts +2 -4
  161. package/types/excalidraw/scene/Renderer.d.ts +4 -4
  162. package/types/excalidraw/scene/Scene.d.ts +13 -7
  163. package/types/excalidraw/scene/Shape.d.ts +1 -1
  164. package/types/excalidraw/scene/ShapeCache.d.ts +4 -4
  165. package/types/excalidraw/scene/comparisons.d.ts +2 -2
  166. package/types/excalidraw/scene/export.d.ts +2 -2
  167. package/types/excalidraw/scene/scroll.d.ts +2 -2
  168. package/types/excalidraw/scene/scrollbars.d.ts +3 -3
  169. package/types/excalidraw/scene/selection.d.ts +2 -2
  170. package/types/excalidraw/scene/types.d.ts +4 -4
  171. package/types/excalidraw/scene/zoom.d.ts +1 -1
  172. package/types/excalidraw/snapping.d.ts +4 -4
  173. package/types/excalidraw/store.d.ts +2 -2
  174. package/types/excalidraw/types.d.ts +22 -18
  175. package/types/excalidraw/utils.d.ts +4 -4
  176. package/types/excalidraw/zindex.d.ts +2 -2
  177. package/types/utils/bbox.d.ts +2 -2
  178. package/types/utils/collision.d.ts +1 -1
  179. package/types/utils/export.d.ts +2 -2
  180. package/types/utils/geometry/geometry.d.ts +1 -1
  181. package/types/utils/geometry/shape.d.ts +1 -1
  182. package/types/utils/withinBounds.d.ts +1 -1
@@ -1,6 +1,6 @@
1
- import { ExcalidrawProps } from "../types";
2
- import { ExcalidrawElement, ExcalidrawIframeLikeElement, IframeData } from "./types";
3
- import { MarkRequired } from "../utility-types";
1
+ import type { ExcalidrawProps } from "../types";
2
+ import type { ExcalidrawElement, ExcalidrawIframeLikeElement, IframeData } from "./types";
3
+ import type { MarkRequired } from "../utility-types";
4
4
  type IframeDataWithSandbox = MarkRequired<IframeData, "sandbox">;
5
5
  export declare const createSrcDoc: (body: string) => string;
6
6
  export declare const getEmbedLink: (link: string | null | undefined) => IframeDataWithSandbox | null;
@@ -1,5 +1,5 @@
1
- import { AppClassProperties, DataURL, BinaryFiles } from "../types";
2
- import { ExcalidrawElement, FileId, InitializedExcalidrawImageElement } from "./types";
1
+ import type { AppClassProperties, DataURL, BinaryFiles } from "../types";
2
+ import type { ExcalidrawElement, FileId, InitializedExcalidrawImageElement } from "./types";
3
3
  export declare const loadHTMLImageElement: (dataURL: DataURL) => Promise<HTMLImageElement>;
4
4
  /** NOTE: updates cache even if already populated with given image. Thus,
5
5
  * you should filter out the images upstream if you want to optimize this. */
@@ -1,5 +1,5 @@
1
- import { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted } from "./types";
2
- export { newElement, newTextElement, updateTextElement, refreshTextDimensions, newLinearElement, newImageElement, duplicateElement, } from "./newElement";
1
+ import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted } from "./types";
2
+ export { newElement, newTextElement, refreshTextDimensions, newLinearElement, newImageElement, duplicateElement, } from "./newElement";
3
3
  export { getElementAbsoluteCoords, getElementBounds, getCommonBounds, getDiamondPoints, getArrowheadPoints, getClosestElementBounds, } from "./bounds";
4
4
  export { OMIT_SIDES_FOR_MULTIPLE_ELEMENTS, getTransformHandlesFromCoords, getTransformHandles, } from "./transformHandles";
5
5
  export { resizeTest, getCursorForResizingElement, getElementWithTransformHandleType, getTransformHandleTypeFromCoords, } from "./resizeTest";
@@ -1,7 +1,7 @@
1
- import { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap } from "./types";
2
- import { Bounds } from "./bounds";
3
- import { Point, AppState, PointerCoords, InteractiveCanvasAppState, AppClassProperties } from "../types";
4
- import { Store } from "../store";
1
+ import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap } from "./types";
2
+ import type { Bounds } from "./bounds";
3
+ import type { Point, AppState, PointerCoords, InteractiveCanvasAppState, AppClassProperties } from "../types";
4
+ import type { Store } from "../store";
5
5
  declare const editorMidPointsCache: {
6
6
  version: number | null;
7
7
  points: (Point | null)[];
@@ -238,7 +238,7 @@ export declare class LinearElementEditor {
238
238
  button?: "up" | "down" | undefined;
239
239
  selectedElementIds?: Readonly<{
240
240
  [id: string]: true;
241
- }> | undefined; /** index */
241
+ }> | undefined;
242
242
  username?: string | null | undefined;
243
243
  userState?: import("../types").UserIdleState | undefined;
244
244
  color?: {
@@ -1,8 +1,8 @@
1
- import { ExcalidrawElement } from "./types";
2
- import { Mutable } from "../utility-types";
1
+ import type { ExcalidrawElement } from "./types";
2
+ import type { Mutable } from "../utility-types";
3
3
  export type ElementUpdate<TElement extends ExcalidrawElement> = Omit<Partial<TElement>, "id" | "version" | "versionNonce" | "updated">;
4
4
  export declare const mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
5
- export declare const newElementWith: <TElement extends ExcalidrawElement>(element: TElement, updates: ElementUpdate<TElement>) => TElement;
5
+ export declare const newElementWith: <TElement extends ExcalidrawElement>(element: TElement, updates: ElementUpdate<TElement>, force?: boolean) => TElement;
6
6
  /**
7
7
  * Mutates element, bumping `version`, `versionNonce`, and `updated`.
8
8
  *
@@ -1,6 +1,6 @@
1
- import { ExcalidrawElement, ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, GroupId, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawIframeElement, ElementsMap } from "./types";
2
- import { AppState } from "../types";
3
- import { MarkOptional, Mutable } from "../utility-types";
1
+ import type { ExcalidrawElement, ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, GroupId, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawIframeElement, ElementsMap } from "./types";
2
+ import type { AppState } from "../types";
3
+ import type { MarkOptional, Mutable } from "../utility-types";
4
4
  export type ElementConstructorOpts = MarkOptional<Omit<ExcalidrawGenericElement, "id" | "type" | "isDeleted" | "updated">, "width" | "height" | "angle" | "groupIds" | "frameId" | "index" | "boundElements" | "seed" | "version" | "versionNonce" | "link" | "strokeStyle" | "fillStyle" | "strokeColor" | "backgroundColor" | "roughness" | "strokeWidth" | "roundness" | "locked" | "opacity" | "customData">;
5
5
  export declare const newElement: (opts: {
6
6
  type: ExcalidrawGenericElement["type"];
@@ -35,13 +35,6 @@ export declare const refreshTextDimensions: (textElement: ExcalidrawTextElement,
35
35
  height: number;
36
36
  text: string;
37
37
  } | undefined;
38
- export declare const updateTextElement: (textElement: ExcalidrawTextElement, container: ExcalidrawTextContainer | null, elementsMap: ElementsMap, { text, isDeleted, originalText, rawText, link, }: {
39
- text: string;
40
- isDeleted?: boolean | undefined;
41
- originalText: string;
42
- rawText?: string | undefined;
43
- link?: string | undefined;
44
- }) => ExcalidrawTextElement;
45
38
  export declare const newFreeDrawElement: (opts: {
46
39
  type: "freedraw";
47
40
  points?: ExcalidrawFreeDrawElement["points"];
@@ -1,6 +1,6 @@
1
- import { ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, ElementsMap } from "./types";
2
- import { MaybeTransformHandleType, TransformHandleDirection } from "./transformHandles";
3
- import { PointerDownState } from "../types";
1
+ import type { ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, ElementsMap } from "./types";
2
+ import type { MaybeTransformHandleType, TransformHandleDirection } from "./transformHandles";
3
+ import type { PointerDownState } from "../types";
4
4
  export declare const normalizeAngle: (angle: number) => number;
5
5
  export declare const transformElements: (originalElements: PointerDownState["originalElements"], transformHandleType: MaybeTransformHandleType, selectedElements: readonly NonDeletedExcalidrawElement[], elementsMap: ElementsMap, shouldRotateWithDiscreteAngle: boolean, shouldResizeFromCenter: boolean, shouldMaintainAspectRatio: boolean, pointerX: number, pointerY: number, centerX: number, centerY: number) => boolean;
6
6
  export declare const resizeSingleElement: (originalElements: PointerDownState["originalElements"], shouldMaintainAspectRatio: boolean, element: NonDeletedExcalidrawElement, elementsMap: ElementsMap, transformHandleDirection: TransformHandleDirection, shouldResizeFromCenter: boolean, pointerX: number, pointerY: number) => void;
@@ -1,7 +1,7 @@
1
- import { ExcalidrawElement, PointerType, NonDeletedExcalidrawElement, ElementsMap } from "./types";
2
- import { MaybeTransformHandleType } from "./transformHandles";
3
- import { AppState, Device, Zoom } from "../types";
4
- import { Bounds } from "./bounds";
1
+ import type { ExcalidrawElement, PointerType, NonDeletedExcalidrawElement, ElementsMap } from "./types";
2
+ import type { MaybeTransformHandleType } from "./transformHandles";
3
+ import type { AppState, Device, Zoom } from "../types";
4
+ import type { Bounds } from "./bounds";
5
5
  export declare const resizeTest: (element: NonDeletedExcalidrawElement, elementsMap: ElementsMap, appState: AppState, x: number, y: number, zoom: Zoom, pointerType: PointerType, device: Device) => MaybeTransformHandleType;
6
6
  export declare const getElementWithTransformHandleType: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, scenePointerX: number, scenePointerY: number, zoom: Zoom, pointerType: PointerType, elementsMap: ElementsMap, device: Device) => {
7
7
  element: NonDeletedExcalidrawElement;
@@ -1,3 +1,3 @@
1
- import { NonDeletedExcalidrawElement } from "./types";
2
- import { UIAppState } from "../types";
1
+ import type { NonDeletedExcalidrawElement } from "./types";
2
+ import type { UIAppState } from "../types";
3
3
  export declare const showSelectedShapeActions: (appState: UIAppState, elements: readonly NonDeletedExcalidrawElement[]) => boolean;
@@ -1,5 +1,5 @@
1
- import { ElementsMap, ExcalidrawElement } from "./types";
2
- import { AppState, Zoom } from "../types";
1
+ import type { ElementsMap, ExcalidrawElement } from "./types";
2
+ import type { AppState, Zoom } from "../types";
3
3
  export declare const isInvisiblySmallElement: (element: ExcalidrawElement) => boolean;
4
4
  export declare const isElementInViewport: (element: ExcalidrawElement, width: number, height: number, viewTransformations: {
5
5
  zoom: Zoom;
@@ -1,2 +1,2 @@
1
- import { ExcalidrawElement } from "./types";
1
+ import type { ExcalidrawElement } from "./types";
2
2
  export declare const normalizeElementOrder: (elements: readonly ExcalidrawElement[]) => readonly ExcalidrawElement[];
@@ -1,7 +1,7 @@
1
- import { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, FontFamilyValues, FontString, NonDeletedExcalidrawElement } from "./types";
2
- import { MaybeTransformHandleType } from "./transformHandles";
3
- import { AppState } from "../types";
4
- import { ExtractSetType, MakeBrand } from "../utility-types";
1
+ import type { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, FontFamilyValues, FontString, NonDeletedExcalidrawElement } from "./types";
2
+ import type { MaybeTransformHandleType } from "./transformHandles";
3
+ import type { AppState } from "../types";
4
+ import type { ExtractSetType, MakeBrand } from "../utility-types";
5
5
  export declare const normalizeText: (text: string) => string;
6
6
  export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null, elementsMap: ElementsMap, informMutation?: boolean) => void;
7
7
  export declare const bindTextToShapeAfterDuplication: (newElements: ExcalidrawElement[], oldElements: ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
@@ -1,12 +1,17 @@
1
- import { ExcalidrawElement, ExcalidrawTextElement } from "./types";
2
- import App from "../components/App";
1
+ import type { ExcalidrawElement, ExcalidrawTextElement } from "./types";
2
+ import type App from "../components/App";
3
3
  export declare const textWysiwyg: ({ id, onChange, onSubmit, getViewportCoords, element, canvas, excalidrawContainer, app, }: {
4
4
  id: ExcalidrawElement["id"];
5
- onChange?: ((text: string) => void) | undefined;
5
+ /**
6
+ * textWysiwyg only deals with `originalText`
7
+ *
8
+ * Note: `text`, which can be wrapped and therefore different from `originalText`,
9
+ * is derived from `originalText`
10
+ */
11
+ onChange?: ((nextOriginalText: string) => void) | undefined;
6
12
  onSubmit: (data: {
7
- text: string;
8
13
  viaKeyboard: boolean;
9
- originalText: string;
14
+ nextOriginalText: string;
10
15
  }) => void;
11
16
  getViewportCoords: (x: number, y: number) => [number, number];
12
17
  element: ExcalidrawTextElement;
@@ -1,6 +1,6 @@
1
- import { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement, PointerType } from "./types";
2
- import { Bounds } from "./bounds";
3
- import { Device, InteractiveCanvasAppState, Zoom } from "../types";
1
+ import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement, PointerType } from "./types";
2
+ import type { Bounds } from "./bounds";
3
+ import type { Device, InteractiveCanvasAppState, Zoom } from "../types";
4
4
  export type TransformHandleDirection = "n" | "s" | "w" | "e" | "nw" | "ne" | "sw" | "se";
5
5
  export type TransformHandleType = TransformHandleDirection | "rotation";
6
6
  export type TransformHandle = Bounds;
@@ -1,6 +1,6 @@
1
- import { ElementOrToolType } from "../types";
2
- import { MarkNonNullable } from "../utility-types";
3
- import { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement } from "./types";
1
+ import type { ElementOrToolType } from "../types";
2
+ import type { MarkNonNullable } from "../utility-types";
3
+ import type { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawEmbeddableElement, ExcalidrawLinearElement, ExcalidrawBindableElement, ExcalidrawFreeDrawElement, InitializedExcalidrawImageElement, ExcalidrawImageElement, ExcalidrawTextElementWithContainer, ExcalidrawTextContainer, ExcalidrawFrameElement, RoundnessType, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeElement, ExcalidrawIframeLikeElement, ExcalidrawMagicFrameElement, ExcalidrawArrowElement } from "./types";
4
4
  export declare const isInitializedImageElement: (element: ExcalidrawElement | null) => element is InitializedExcalidrawImageElement;
5
5
  export declare const isImageElement: (element: ExcalidrawElement | null) => element is ExcalidrawImageElement;
6
6
  export declare const isEmbeddableElement: (element: ExcalidrawElement | null | undefined) => element is ExcalidrawEmbeddableElement;
@@ -1,7 +1,7 @@
1
- import { Point } from "../types";
2
- import { FONT_FAMILY, ROUNDNESS, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "../constants";
3
- import { MakeBrand, MarkNonNullable, ValueOf } from "../utility-types";
4
- import { MagicCacheData } from "../data/magic";
1
+ import type { Point } from "../types";
2
+ import type { FONT_FAMILY, ROUNDNESS, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "../constants";
3
+ import type { MakeBrand, MarkNonNullable, ValueOf } from "../utility-types";
4
+ import type { MagicCacheData } from "../data/magic";
5
5
  export type ChartType = "bar" | "line";
6
6
  export type FillStyle = "hachure" | "cross-hatch" | "solid" | "zigzag";
7
7
  export type FontFamilyKeys = keyof typeof FONT_FAMILY;
@@ -157,6 +157,13 @@ export type ExcalidrawTextElement = _ExcalidrawElementBase & Readonly<{
157
157
  verticalAlign: VerticalAlign;
158
158
  containerId: ExcalidrawGenericElement["id"] | null;
159
159
  originalText: string;
160
+ /**
161
+ * If `true` the width will fit the text. If `false`, the text will
162
+ * wrap to fit the width.
163
+ *
164
+ * @default true
165
+ */
166
+ autoResize: boolean;
160
167
  /**
161
168
  * Unitless line height (aligned to W3C). To get line height in px, multiply
162
169
  * with font size (using `getLineHeightInPx` helper).
@@ -1,4 +1,4 @@
1
- import { UnsubscribeCallback } from "./types";
1
+ import type { UnsubscribeCallback } from "./types";
2
2
  type Subscriber<T extends any[]> = (...payload: T) => void;
3
3
  export declare class Emitter<T extends any[] = []> {
4
4
  subscribers: Subscriber<T>[];
@@ -1,4 +1,4 @@
1
- import { ExcalidrawElement, OrderedExcalidrawElement } from "./element/types";
1
+ import type { ExcalidrawElement, OrderedExcalidrawElement } from "./element/types";
2
2
  /**
3
3
  * Envisioned relation between array order and fractional indices:
4
4
  *
@@ -1,7 +1,7 @@
1
- import { ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted, NonDeletedExcalidrawElement } from "./element/types";
2
- import { AppClassProperties, AppState, StaticCanvasAppState } from "./types";
1
+ import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted, NonDeletedExcalidrawElement } from "./element/types";
2
+ import type { AppClassProperties, AppState, StaticCanvasAppState } from "./types";
3
3
  import type { ExcalidrawElementsIncludingDeleted } from "./scene/Scene";
4
- import { ReadonlySetLike } from "./utility-types";
4
+ import type { ReadonlySetLike } from "./utility-types";
5
5
  export declare const bindElementsToFramesAfterDuplication: (nextElements: readonly ExcalidrawElement[], oldElements: readonly ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
6
6
  export declare function isElementIntersectingFrame(element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap): boolean;
7
7
  export declare const getElementsCompletelyInFrame: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => ExcalidrawElement[];
@@ -1,4 +1,4 @@
1
- import { Line, Direction, Point } from "./ga";
1
+ import type { Line, Direction, Point } from "./ga";
2
2
  /**
3
3
  * TODO: docs
4
4
  */
@@ -1,4 +1,4 @@
1
- import { PointerCoords } from "./types";
1
+ import type { PointerCoords } from "./types";
2
2
  export declare const getCenter: (pointers: Map<number, PointerCoords>) => {
3
3
  x: number;
4
4
  y: number;
@@ -1,6 +1,6 @@
1
- import { GroupId, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ElementsMapOrArray, ElementsMap } from "./element/types";
2
- import { AppClassProperties, AppState, InteractiveCanvasAppState } from "./types";
3
- import { Mutable } from "./utility-types";
1
+ import type { GroupId, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ElementsMapOrArray, ElementsMap } from "./element/types";
2
+ import type { AppClassProperties, AppState, InteractiveCanvasAppState } from "./types";
3
+ import type { Mutable } from "./utility-types";
4
4
  export declare const selectGroup: (groupId: GroupId, appState: InteractiveCanvasAppState, elements: readonly NonDeleted<ExcalidrawElement>[]) => Pick<InteractiveCanvasAppState, "selectedGroupIds" | "selectedElementIds" | "editingGroupId">;
5
5
  export declare const selectGroupsForSelectedElements: {
6
6
  (appState: Pick<AppState, "selectedElementIds" | "editingGroupId">, elements: readonly NonDeletedExcalidrawElement[], prevAppState: InteractiveCanvasAppState, app: AppClassProperties | null): Mutable<Pick<InteractiveCanvasAppState, "selectedGroupIds" | "editingGroupId" | "selectedElementIds">>;
@@ -1,8 +1,8 @@
1
- import { AppStateChange, ElementsChange } from "./change";
2
- import { SceneElementsMap } from "./element/types";
1
+ import type { AppStateChange, ElementsChange } from "./change";
2
+ import type { SceneElementsMap } from "./element/types";
3
3
  import { Emitter } from "./emitter";
4
- import { Snapshot } from "./store";
5
- import { AppState } from "./types";
4
+ import type { Snapshot } from "./store";
5
+ import type { AppState } from "./types";
6
6
  export declare class HistoryChangedEvent {
7
7
  readonly isUndoStackEmpty: boolean;
8
8
  readonly isRedoStackEmpty: boolean;
@@ -1,2 +1,2 @@
1
- import { Emitter } from "../emitter";
1
+ import type { Emitter } from "../emitter";
2
2
  export declare const useEmitter: <TEvent extends unknown>(emitter: Emitter<[TEvent]>, initialState: TEvent) => TEvent;
@@ -1,4 +1,4 @@
1
- import { LibraryItem } from "../types";
1
+ import type { LibraryItem } from "../types";
2
2
  export type SvgCache = Map<LibraryItem["id"], SVGSVGElement>;
3
3
  export declare const libraryItemSvgsCache: import("jotai").PrimitiveAtom<SvgCache> & {
4
4
  init: SvgCache;
@@ -1,5 +1,5 @@
1
1
  import fallbackLangData from "./locales/en.json";
2
- import { NestedKeyOf } from "./utility-types";
2
+ import type { NestedKeyOf } from "./utility-types";
3
3
  export interface Language {
4
4
  code: string;
5
5
  label: string;
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import "./css/app.scss";
3
3
  import "./css/styles.scss";
4
4
  import "../../public/fonts/fonts.css";
5
- import { ExcalidrawProps } from "./types";
5
+ import type { ExcalidrawProps } from "./types";
6
6
  import Footer from "./components/footer/FooterCenter";
7
7
  import MainMenu from "./components/main-menu/MainMenu";
8
8
  import WelcomeScreen from "./components/welcome-screen/WelcomeScreen";
@@ -22,6 +22,8 @@ wrapText, //zsviczian
22
22
  getFontString, //zsviczian
23
23
  getBoundTextMaxWidth, //zsviczian
24
24
  mermaidToExcalidraw, } from "../utils/export";
25
+ export { refreshTextDimensions, } from "./element/newElement";
26
+ export { getContainerElement, } from "./element/textElement";
25
27
  export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
26
28
  export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "./data/blob";
27
29
  export { getFreeDrawSvgPath } from "./renderer/renderElement";
@@ -1,4 +1,4 @@
1
- import { PrimitiveAtom } from "jotai";
1
+ import type { PrimitiveAtom } from "jotai";
2
2
  export declare const jotaiScope: unique symbol;
3
3
  export declare const jotaiStore: {
4
4
  get: <Value>(atom: import("jotai").Atom<Value>) => Awaited<Value> | undefined;
@@ -1,5 +1,6 @@
1
- import { AnimatedTrail, Trail } from "./animated-trail";
2
- import { AnimationFrameHandler } from "./animation-frame-handler";
1
+ import type { Trail } from "./animated-trail";
2
+ import { AnimatedTrail } from "./animated-trail";
3
+ import type { AnimationFrameHandler } from "./animation-frame-handler";
3
4
  import type App from "./components/App";
4
5
  export declare class LaserTrails implements Trail {
5
6
  private animationFrameHandler;
@@ -1,5 +1,5 @@
1
- import { Point, Zoom } from "./types";
2
- import { ExcalidrawElement, ExcalidrawLinearElement, NonDeleted } from "./element/types";
1
+ import type { Point, Zoom } from "./types";
2
+ import type { ExcalidrawElement, ExcalidrawLinearElement, NonDeleted } from "./element/types";
3
3
  export declare const rotate: (x: number, y: number, cx: number, cy: number, angle: number) => [number, number];
4
4
  export declare const rotatePoint: (point: readonly [number, number], center: readonly [number, number], angle: number) => [number, number];
5
5
  export declare const adjustXYWithRotation: (sides: {
@@ -1,4 +1,4 @@
1
- import { Point } from "./types";
1
+ import type { Point } from "./types";
2
2
  export declare const getSizeFromPoints: (points: readonly Point[]) => {
3
3
  width: number;
4
4
  height: number;
@@ -1,4 +1,4 @@
1
- import { MaybePromise } from "./utility-types";
1
+ import type { MaybePromise } from "./utility-types";
2
2
  type Job<T, TArgs extends unknown[]> = (...args: TArgs) => MaybePromise<T>;
3
3
  export declare class Queue {
4
4
  private jobs;
@@ -1,5 +1,5 @@
1
- import { StaticCanvasAppState, AppState } from "../types";
2
- import { StaticCanvasRenderConfig } from "../scene/types";
1
+ import type { StaticCanvasAppState, AppState } from "../types";
2
+ import type { StaticCanvasRenderConfig } from "../scene/types";
3
3
  export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke?: boolean) => void;
4
4
  export declare const getNormalizedCanvasDimensions: (canvas: HTMLCanvasElement, scale: number) => [number, number];
5
5
  export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normalizedHeight, theme, isExporting, viewBackgroundColor, }: {
@@ -1,4 +1,4 @@
1
- import { InteractiveSceneRenderConfig, RenderableElementsMap } from "../scene/types";
1
+ import type { InteractiveSceneRenderConfig, RenderableElementsMap } from "../scene/types";
2
2
  /** throttled to animation framerate */
3
3
  export declare const renderInteractiveSceneThrottled: {
4
4
  (config: InteractiveSceneRenderConfig): void;
@@ -1,7 +1,7 @@
1
- import { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap } from "../element/types";
1
+ import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap } from "../element/types";
2
2
  import type { RoughCanvas } from "roughjs/bin/canvas";
3
- import { StaticCanvasRenderConfig, RenderableElementsMap } from "../scene/types";
4
- import { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure } from "../types";
3
+ import type { StaticCanvasRenderConfig, RenderableElementsMap } from "../scene/types";
4
+ import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure } from "../types";
5
5
  export declare const IMAGE_INVERT_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
6
6
  export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure) => number;
7
7
  export interface ExcalidrawElementWithCanvas {
@@ -1,2 +1,2 @@
1
- import { InteractiveCanvasAppState } from "../types";
1
+ import type { InteractiveCanvasAppState } from "../types";
2
2
  export declare const renderSnaps: (context: CanvasRenderingContext2D, appState: InteractiveCanvasAppState) => void;
@@ -1,4 +1,4 @@
1
- import { StaticSceneRenderConfig } from "../scene/types";
1
+ import type { StaticSceneRenderConfig } from "../scene/types";
2
2
  /** throttled to animation framerate */
3
3
  export declare const renderStaticSceneThrottled: {
4
4
  (config: StaticSceneRenderConfig): void;
@@ -1,5 +1,5 @@
1
- import { RoughSVG } from "roughjs/bin/svg";
2
- import { NonDeletedExcalidrawElement } from "../element/types";
3
- import { RenderableElementsMap, SVGRenderConfig } from "../scene/types";
4
- import { BinaryFiles } from "../types";
1
+ import type { RoughSVG } from "roughjs/bin/svg";
2
+ import type { NonDeletedExcalidrawElement } from "../element/types";
3
+ import type { RenderableElementsMap, SVGRenderConfig } from "../scene/types";
4
+ import type { BinaryFiles } from "../types";
5
5
  export declare const renderSceneToSvg: (elements: readonly NonDeletedExcalidrawElement[], elementsMap: RenderableElementsMap, rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, renderConfig: SVGRenderConfig) => void;
@@ -1,11 +1,9 @@
1
- import { ExcalidrawElement } from "../element/types";
1
+ import type { ExcalidrawElement } from "../element/types";
2
2
  import type Scene from "./Scene";
3
3
  export declare class Fonts {
4
4
  private scene;
5
- private onSceneUpdated;
6
- constructor({ scene, onSceneUpdated, }: {
5
+ constructor({ scene }: {
7
6
  scene: Scene;
8
- onSceneUpdated: () => void;
9
7
  });
10
8
  private static loadedFontFaces;
11
9
  /**
@@ -1,6 +1,6 @@
1
- import { NonDeletedExcalidrawElement } from "../element/types";
2
- import { AppState } from "../types";
3
- import Scene from "./Scene";
1
+ import type { NonDeletedExcalidrawElement } from "../element/types";
2
+ import type { AppState } from "../types";
3
+ import type Scene from "./Scene";
4
4
  export declare class Renderer {
5
5
  private scene;
6
6
  constructor(scene: Scene);
@@ -14,7 +14,7 @@ export declare class Renderer {
14
14
  width: AppState["width"];
15
15
  editingElement: AppState["editingElement"];
16
16
  pendingImageElementId: AppState["pendingImageElementId"];
17
- versionNonce: ReturnType<InstanceType<typeof Scene>["getVersionNonce"]>;
17
+ sceneNonce: ReturnType<InstanceType<typeof Scene>["getSceneNonce"]>;
18
18
  }) => {
19
19
  elementsMap: Map<string, NonDeletedExcalidrawElement> & import("../utility-types").MakeBrand<"NonDeletedElementsMap"> & import("../utility-types").MakeBrand<"RenderableElementsMap">;
20
20
  visibleElements: readonly NonDeletedExcalidrawElement[];
@@ -1,6 +1,6 @@
1
- import { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawFrameLikeElement, ElementsMapOrArray, OrderedExcalidrawElement, Ordered } from "../element/types";
2
- import { LinearElementEditor } from "../element/linearElementEditor";
3
- import { AppState } from "../types";
1
+ import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawFrameLikeElement, ElementsMapOrArray, OrderedExcalidrawElement, Ordered } from "../element/types";
2
+ import type { LinearElementEditor } from "../element/linearElementEditor";
3
+ import type { AppState } from "../types";
4
4
  type ElementIdKey = InstanceType<typeof LinearElementEditor>["elementId"];
5
5
  type ElementKey = ExcalidrawElement | ElementIdKey;
6
6
  type SceneStateCallback = () => void;
@@ -19,7 +19,14 @@ declare class Scene {
19
19
  private frames;
20
20
  private elementsMap;
21
21
  private selectedElementsCache;
22
- private versionNonce;
22
+ /**
23
+ * Random integer regenerated each scene update.
24
+ *
25
+ * Does not relate to elements versions, it's only a renderer
26
+ * cache-invalidation nonce at the moment.
27
+ */
28
+ private sceneNonce;
29
+ getSceneNonce(): number | undefined;
23
30
  getNonDeletedElementsMap(): Map<string, Ordered<NonDeletedExcalidrawElement>> & import("../utility-types").MakeBrand<"NonDeletedSceneElementsMap">;
24
31
  getElementsIncludingDeleted(): readonly OrderedExcalidrawElement[];
25
32
  getElementsMapIncludingDeleted(): Map<string, Ordered<ExcalidrawElement>> & import("../utility-types").MakeBrand<"SceneElementsMap">;
@@ -38,7 +45,6 @@ declare class Scene {
38
45
  }): NonDeleted<ExcalidrawElement>[];
39
46
  getNonDeletedFramesLikes(): readonly NonDeleted<ExcalidrawFrameLikeElement>[];
40
47
  getElement<T extends ExcalidrawElement>(id: T["id"]): T | null;
41
- getVersionNonce(): number | undefined;
42
48
  getNonDeletedElement(id: ExcalidrawElement["id"]): NonDeleted<ExcalidrawElement> | null;
43
49
  /**
44
50
  * A utility method to help with updating all scene elements, with the added
@@ -54,8 +60,8 @@ declare class Scene {
54
60
  */
55
61
  mapElements(iteratee: (element: ExcalidrawElement) => ExcalidrawElement): boolean;
56
62
  replaceAllElements(nextElements: ElementsMapOrArray): void;
57
- informMutation(): void;
58
- addCallback(cb: SceneStateCallback): SceneStateCallbackRemover;
63
+ triggerUpdate(): void;
64
+ onUpdate(cb: SceneStateCallback): SceneStateCallbackRemover;
59
65
  destroy(): void;
60
66
  insertElementAtIndex(element: ExcalidrawElement, index: number): void;
61
67
  insertElementsAtIndex(elements: ExcalidrawElement[], index: number): void;
@@ -1,7 +1,7 @@
1
1
  import type { Drawable, Options } from "roughjs/bin/core";
2
2
  import type { RoughGenerator } from "roughjs/bin/generator";
3
3
  import type { ExcalidrawElement, NonDeletedExcalidrawElement, ExcalidrawSelectionElement } from "../element/types";
4
- import { EmbedsValidationStatus } from "../types";
4
+ import type { EmbedsValidationStatus } from "../types";
5
5
  export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean) => Options;
6
6
  /**
7
7
  * Generates the roughjs shape for given element.
@@ -1,7 +1,7 @@
1
- import { Drawable } from "roughjs/bin/core";
2
- import { ExcalidrawElement } from "../element/types";
3
- import { ElementShape, ElementShapes } from "./types";
4
- import { AppState, EmbedsValidationStatus } from "../types";
1
+ import type { Drawable } from "roughjs/bin/core";
2
+ import type { ExcalidrawElement } from "../element/types";
3
+ import type { ElementShape, ElementShapes } from "./types";
4
+ import type { AppState, EmbedsValidationStatus } from "../types";
5
5
  export declare class ShapeCache {
6
6
  private static rg;
7
7
  private static cache;
@@ -1,5 +1,5 @@
1
- import { NonDeletedExcalidrawElement } from "../element/types";
2
- import { ElementOrToolType } from "../types";
1
+ import type { NonDeletedExcalidrawElement } from "../element/types";
2
+ import type { ElementOrToolType } from "../types";
3
3
  export declare const hasBackground: (type: ElementOrToolType) => boolean;
4
4
  export declare const hasStrokeColor: (type: ElementOrToolType) => boolean;
5
5
  export declare const hasStrokeWidth: (type: ElementOrToolType) => boolean;
@@ -1,5 +1,5 @@
1
- import { ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "../element/types";
2
- import { AppState, BinaryFiles } from "../types";
1
+ import type { ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "../element/types";
2
+ import type { AppState, BinaryFiles } from "../types";
3
3
  export declare const exportToCanvas: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, exportingFrame, }: {
4
4
  exportBackground: boolean;
5
5
  exportPadding?: number | undefined;
@@ -1,5 +1,5 @@
1
- import { AppState, PointerCoords, Zoom } from "../types";
2
- import { ExcalidrawElement } from "../element/types";
1
+ import type { AppState, PointerCoords, Zoom } from "../types";
2
+ import type { ExcalidrawElement } from "../element/types";
3
3
  export declare const centerScrollOn: ({ scenePoint, viewportDimensions, zoom, }: {
4
4
  scenePoint: PointerCoords;
5
5
  viewportDimensions: {
@@ -1,6 +1,6 @@
1
- import { InteractiveCanvasAppState } from "../types";
2
- import { ScrollBars } from "./types";
3
- import { ExcalidrawElement } from "../element/types";
1
+ import type { InteractiveCanvasAppState } from "../types";
2
+ import type { ScrollBars } from "./types";
3
+ import type { ExcalidrawElement } from "../element/types";
4
4
  export declare const SCROLLBAR_MARGIN = 4;
5
5
  export declare const SCROLLBAR_WIDTH = 6;
6
6
  export declare const SCROLLBAR_COLOR = "rgba(128,128,128,0.3)";
@@ -1,5 +1,5 @@
1
- import { ElementsMap, ElementsMapOrArray, ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
2
- import { AppState, InteractiveCanvasAppState } from "../types";
1
+ import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
2
+ import type { AppState, InteractiveCanvasAppState } from "../types";
3
3
  /**
4
4
  * Frames and their containing elements are not to be selected at the same time.
5
5
  * Given an array of selected elements, if there are frames and their containing elements
@@ -1,8 +1,8 @@
1
1
  import type { RoughCanvas } from "roughjs/bin/canvas";
2
- import { Drawable } from "roughjs/bin/core";
3
- import { ExcalidrawElement, ExcalidrawTextElement, NonDeletedElementsMap, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap } from "../element/types";
4
- import { AppClassProperties, AppState, EmbedsValidationStatus, ElementsPendingErasure, InteractiveCanvasAppState, StaticCanvasAppState, SocketId, UserIdleState, Device } from "../types";
5
- import { MakeBrand } from "../utility-types";
2
+ import type { Drawable } from "roughjs/bin/core";
3
+ import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedElementsMap, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap } from "../element/types";
4
+ import type { AppClassProperties, AppState, EmbedsValidationStatus, ElementsPendingErasure, InteractiveCanvasAppState, StaticCanvasAppState, SocketId, UserIdleState, Device } from "../types";
5
+ import type { MakeBrand } from "../utility-types";
6
6
  export type RenderableElementsMap = NonDeletedElementsMap & MakeBrand<"RenderableElementsMap">;
7
7
  export type StaticCanvasRenderConfig = {
8
8
  canvasBackgroundColor: AppState["viewBackgroundColor"];