Jelajahi Sumber

refactor: export everything from `@excalidraw/element`, don't import from subpaths (#9466)

* Don't import from subpaths

* Fix tests, move related tests to element
Marcel Mraz 4 bulan lalu
induk
melakukan
7e41026812
100 mengubah file dengan 432 tambahan dan 441 penghapusan
  1. 3 3
      excalidraw-app/App.tsx
  2. 3 6
      excalidraw-app/collab/Collab.tsx
  3. 1 1
      excalidraw-app/collab/Portal.tsx
  4. 1 1
      excalidraw-app/components/ExportToExcalidrawPlus.tsx
  5. 2 2
      excalidraw-app/data/FileManager.ts
  6. 3 3
      excalidraw-app/data/index.ts
  7. 3 6
      excalidraw-app/tests/collab.test.tsx
  8. 6 11
      packages/element/src/Scene.ts
  9. 1 1
      packages/element/src/align.ts
  10. 1 1
      packages/element/src/binding.ts
  11. 1 1
      packages/element/src/delta.ts
  12. 1 1
      packages/element/src/dragElements.ts
  13. 1 1
      packages/element/src/flowchart.ts
  14. 44 0
      packages/element/src/index.ts
  15. 2 2
      packages/element/src/linearElementEditor.ts
  16. 1 1
      packages/element/src/resizeElements.ts
  17. 1 1
      packages/element/src/textElement.ts
  18. 1 1
      packages/element/src/zindex.ts
  19. 0 0
      packages/element/tests/__snapshots__/linearElementEditor.test.tsx.snap
  20. 24 15
      packages/element/tests/cropElement.test.tsx
  21. 1 1
      packages/element/tests/delta.test.tsx
  22. 1 1
      packages/element/tests/elbowArrow.test.tsx
  23. 2 2
      packages/element/tests/fractionalIndex.test.ts
  24. 19 23
      packages/element/tests/linearElementEditor.test.tsx
  25. 1 1
      packages/element/tests/sortElements.test.ts
  26. 2 2
      packages/excalidraw/actions/actionAddToLibrary.ts
  27. 5 5
      packages/excalidraw/actions/actionAlign.tsx
  28. 7 7
      packages/excalidraw/actions/actionBoundText.tsx
  29. 3 3
      packages/excalidraw/actions/actionCanvas.tsx
  30. 3 3
      packages/excalidraw/actions/actionClipboard.tsx
  31. 2 2
      packages/excalidraw/actions/actionCropEditor.tsx
  32. 8 8
      packages/excalidraw/actions/actionDeleteSelected.tsx
  33. 5 5
      packages/excalidraw/actions/actionDistribute.tsx
  34. 5 5
      packages/excalidraw/actions/actionDuplicateSelection.tsx
  35. 2 2
      packages/excalidraw/actions/actionElementLink.ts
  36. 3 3
      packages/excalidraw/actions/actionElementLock.ts
  37. 1 1
      packages/excalidraw/actions/actionEmbeddable.ts
  38. 1 1
      packages/excalidraw/actions/actionExport.tsx
  39. 6 9
      packages/excalidraw/actions/actionFinalize.tsx
  40. 8 8
      packages/excalidraw/actions/actionFlip.ts
  41. 8 8
      packages/excalidraw/actions/actionFrame.ts
  42. 6 6
      packages/excalidraw/actions/actionGroup.tsx
  43. 2 2
      packages/excalidraw/actions/actionHistory.tsx
  44. 3 3
      packages/excalidraw/actions/actionLinearEditor.tsx
  45. 2 2
      packages/excalidraw/actions/actionLink.tsx
  46. 2 2
      packages/excalidraw/actions/actionMenu.tsx
  47. 1 1
      packages/excalidraw/actions/actionNavigate.tsx
  48. 10 10
      packages/excalidraw/actions/actionProperties.tsx
  49. 4 4
      packages/excalidraw/actions/actionSelectAll.ts
  50. 4 4
      packages/excalidraw/actions/actionStyles.ts
  51. 4 4
      packages/excalidraw/actions/actionTextAutoResize.ts
  52. 1 1
      packages/excalidraw/actions/actionToggleGridMode.tsx
  53. 1 1
      packages/excalidraw/actions/actionToggleObjectsSnapMode.tsx
  54. 1 1
      packages/excalidraw/actions/actionToggleSearchMenu.ts
  55. 1 1
      packages/excalidraw/actions/actionToggleShapeSwitch.tsx
  56. 1 1
      packages/excalidraw/actions/actionToggleStats.tsx
  57. 1 1
      packages/excalidraw/actions/actionToggleViewMode.tsx
  58. 1 1
      packages/excalidraw/actions/actionToggleZenMode.tsx
  59. 2 2
      packages/excalidraw/actions/actionZindex.tsx
  60. 1 1
      packages/excalidraw/actions/types.ts
  61. 1 1
      packages/excalidraw/charts.ts
  62. 4 4
      packages/excalidraw/clipboard.ts
  63. 3 3
      packages/excalidraw/components/Actions.tsx
  64. 32 44
      packages/excalidraw/components/App.tsx
  65. 12 11
      packages/excalidraw/components/ConvertElementTypePopup.tsx
  66. 1 1
      packages/excalidraw/components/ElementCanvasButtons.tsx
  67. 2 2
      packages/excalidraw/components/ElementLinkDialog.tsx
  68. 2 2
      packages/excalidraw/components/HintViewer.tsx
  69. 3 3
      packages/excalidraw/components/LayerUI.tsx
  70. 1 1
      packages/excalidraw/components/LibraryMenuItems.tsx
  71. 1 1
      packages/excalidraw/components/MobileMenu.tsx
  72. 4 7
      packages/excalidraw/components/SearchMenu.tsx
  73. 5 5
      packages/excalidraw/components/Stats/Angle.tsx
  74. 1 1
      packages/excalidraw/components/Stats/CanvasGrid.tsx
  75. 4 4
      packages/excalidraw/components/Stats/Dimension.tsx
  76. 3 3
      packages/excalidraw/components/Stats/DragInput.tsx
  77. 3 6
      packages/excalidraw/components/Stats/FontSize.tsx
  78. 4 4
      packages/excalidraw/components/Stats/MultiAngle.tsx
  79. 5 8
      packages/excalidraw/components/Stats/MultiDimension.tsx
  80. 4 7
      packages/excalidraw/components/Stats/MultiFontSize.tsx
  81. 3 3
      packages/excalidraw/components/Stats/MultiPosition.tsx
  82. 3 3
      packages/excalidraw/components/Stats/Position.tsx
  83. 5 5
      packages/excalidraw/components/Stats/index.tsx
  84. 2 2
      packages/excalidraw/components/Stats/stats.test.tsx
  85. 7 10
      packages/excalidraw/components/Stats/utils.ts
  86. 6 9
      packages/excalidraw/components/hyperlink/Hyperlink.tsx
  87. 4 4
      packages/excalidraw/components/hyperlink/helpers.ts
  88. 2 2
      packages/excalidraw/data/index.ts
  89. 1 1
      packages/excalidraw/data/library.ts
  90. 1 1
      packages/excalidraw/data/reconcile.ts
  91. 11 11
      packages/excalidraw/data/restore.ts
  92. 10 13
      packages/excalidraw/data/transform.ts
  93. 6 9
      packages/excalidraw/eraser/index.ts
  94. 6 6
      packages/excalidraw/fonts/Fonts.ts
  95. 1 1
      packages/excalidraw/history.ts
  96. 9 12
      packages/excalidraw/index.tsx
  97. 6 6
      packages/excalidraw/lasso/index.ts
  98. 3 3
      packages/excalidraw/renderer/helpers.ts
  99. 9 15
      packages/excalidraw/renderer/interactiveScene.ts
  100. 1 1
      packages/excalidraw/renderer/renderNewElementScene.ts

+ 3 - 3
excalidraw-app/App.tsx

@@ -47,10 +47,10 @@ import {
   share,
   share,
   youtubeIcon,
   youtubeIcon,
 } from "@excalidraw/excalidraw/components/icons";
 } from "@excalidraw/excalidraw/components/icons";
-import { isElementLink } from "@excalidraw/element/elementLink";
+import { isElementLink } from "@excalidraw/element";
 import { restore, restoreAppState } from "@excalidraw/excalidraw/data/restore";
 import { restore, restoreAppState } from "@excalidraw/excalidraw/data/restore";
-import { newElementWith } from "@excalidraw/element/mutateElement";
-import { isInitializedImageElement } from "@excalidraw/element/typeChecks";
+import { newElementWith } from "@excalidraw/element";
+import { isInitializedImageElement } from "@excalidraw/element";
 import clsx from "clsx";
 import clsx from "clsx";
 import {
 import {
   parseLibraryTokensFromUrl,
   parseLibraryTokensFromUrl,

+ 3 - 6
excalidraw-app/collab/Collab.tsx

@@ -19,12 +19,9 @@ import {
   throttleRAF,
   throttleRAF,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 import { decryptData } from "@excalidraw/excalidraw/data/encryption";
 import { decryptData } from "@excalidraw/excalidraw/data/encryption";
-import { getVisibleSceneBounds } from "@excalidraw/element/bounds";
-import { newElementWith } from "@excalidraw/element/mutateElement";
-import {
-  isImageElement,
-  isInitializedImageElement,
-} from "@excalidraw/element/typeChecks";
+import { getVisibleSceneBounds } from "@excalidraw/element";
+import { newElementWith } from "@excalidraw/element";
+import { isImageElement, isInitializedImageElement } from "@excalidraw/element";
 import { AbortError } from "@excalidraw/excalidraw/errors";
 import { AbortError } from "@excalidraw/excalidraw/errors";
 import { t } from "@excalidraw/excalidraw/i18n";
 import { t } from "@excalidraw/excalidraw/i18n";
 import { withBatchedUpdates } from "@excalidraw/excalidraw/reactUtils";
 import { withBatchedUpdates } from "@excalidraw/excalidraw/reactUtils";

+ 1 - 1
excalidraw-app/collab/Portal.tsx

@@ -1,7 +1,7 @@
 import { CaptureUpdateAction } from "@excalidraw/excalidraw";
 import { CaptureUpdateAction } from "@excalidraw/excalidraw";
 import { trackEvent } from "@excalidraw/excalidraw/analytics";
 import { trackEvent } from "@excalidraw/excalidraw/analytics";
 import { encryptData } from "@excalidraw/excalidraw/data/encryption";
 import { encryptData } from "@excalidraw/excalidraw/data/encryption";
-import { newElementWith } from "@excalidraw/element/mutateElement";
+import { newElementWith } from "@excalidraw/element";
 import throttle from "lodash.throttle";
 import throttle from "lodash.throttle";
 
 
 import type { UserIdleState } from "@excalidraw/common";
 import type { UserIdleState } from "@excalidraw/common";

+ 1 - 1
excalidraw-app/components/ExportToExcalidrawPlus.tsx

@@ -12,7 +12,7 @@ import {
   generateEncryptionKey,
   generateEncryptionKey,
 } from "@excalidraw/excalidraw/data/encryption";
 } from "@excalidraw/excalidraw/data/encryption";
 import { serializeAsJSON } from "@excalidraw/excalidraw/data/json";
 import { serializeAsJSON } from "@excalidraw/excalidraw/data/json";
-import { isInitializedImageElement } from "@excalidraw/element/typeChecks";
+import { isInitializedImageElement } from "@excalidraw/element";
 import { useI18n } from "@excalidraw/excalidraw/i18n";
 import { useI18n } from "@excalidraw/excalidraw/i18n";
 
 
 import type {
 import type {

+ 2 - 2
excalidraw-app/data/FileManager.ts

@@ -1,7 +1,7 @@
 import { CaptureUpdateAction } from "@excalidraw/excalidraw";
 import { CaptureUpdateAction } from "@excalidraw/excalidraw";
 import { compressData } from "@excalidraw/excalidraw/data/encode";
 import { compressData } from "@excalidraw/excalidraw/data/encode";
-import { newElementWith } from "@excalidraw/element/mutateElement";
-import { isInitializedImageElement } from "@excalidraw/element/typeChecks";
+import { newElementWith } from "@excalidraw/element";
+import { isInitializedImageElement } from "@excalidraw/element";
 import { t } from "@excalidraw/excalidraw/i18n";
 import { t } from "@excalidraw/excalidraw/i18n";
 
 
 import type {
 import type {

+ 3 - 3
excalidraw-app/data/index.ts

@@ -9,14 +9,14 @@ import {
 } from "@excalidraw/excalidraw/data/encryption";
 } from "@excalidraw/excalidraw/data/encryption";
 import { serializeAsJSON } from "@excalidraw/excalidraw/data/json";
 import { serializeAsJSON } from "@excalidraw/excalidraw/data/json";
 import { restore } from "@excalidraw/excalidraw/data/restore";
 import { restore } from "@excalidraw/excalidraw/data/restore";
-import { isInvisiblySmallElement } from "@excalidraw/element/sizeHelpers";
-import { isInitializedImageElement } from "@excalidraw/element/typeChecks";
+import { isInvisiblySmallElement } from "@excalidraw/element";
+import { isInitializedImageElement } from "@excalidraw/element";
 import { t } from "@excalidraw/excalidraw/i18n";
 import { t } from "@excalidraw/excalidraw/i18n";
 import { bytesToHexString } from "@excalidraw/common";
 import { bytesToHexString } from "@excalidraw/common";
 
 
 import type { UserIdleState } from "@excalidraw/common";
 import type { UserIdleState } from "@excalidraw/common";
 import type { ImportedDataState } from "@excalidraw/excalidraw/data/types";
 import type { ImportedDataState } from "@excalidraw/excalidraw/data/types";
-import type { SceneBounds } from "@excalidraw/element/bounds";
+import type { SceneBounds } from "@excalidraw/element";
 import type {
 import type {
   ExcalidrawElement,
   ExcalidrawElement,
   FileId,
   FileId,

+ 3 - 6
excalidraw-app/tests/collab.test.tsx

@@ -3,17 +3,14 @@ import {
   createRedoAction,
   createRedoAction,
   createUndoAction,
   createUndoAction,
 } from "@excalidraw/excalidraw/actions/actionHistory";
 } from "@excalidraw/excalidraw/actions/actionHistory";
-import { syncInvalidIndices } from "@excalidraw/element/fractionalIndex";
+import { syncInvalidIndices } from "@excalidraw/element";
 import { API } from "@excalidraw/excalidraw/tests/helpers/api";
 import { API } from "@excalidraw/excalidraw/tests/helpers/api";
 import { act, render, waitFor } from "@excalidraw/excalidraw/tests/test-utils";
 import { act, render, waitFor } from "@excalidraw/excalidraw/tests/test-utils";
 import { vi } from "vitest";
 import { vi } from "vitest";
 
 
-import { StoreIncrement } from "@excalidraw/element/store";
+import { StoreIncrement } from "@excalidraw/element";
 
 
-import type {
-  DurableIncrement,
-  EphemeralIncrement,
-} from "@excalidraw/element/store";
+import type { DurableIncrement, EphemeralIncrement } from "@excalidraw/element";
 
 
 import ExcalidrawApp from "../App";
 import ExcalidrawApp from "../App";
 
 

+ 6 - 11
packages/element/src/Scene.ts

@@ -9,21 +9,18 @@ import {
   toArray,
   toArray,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 import { isNonDeletedElement } from "@excalidraw/element";
 import { isNonDeletedElement } from "@excalidraw/element";
-import { isFrameLikeElement } from "@excalidraw/element/typeChecks";
-import { getElementsInGroup } from "@excalidraw/element/groups";
+import { isFrameLikeElement } from "@excalidraw/element";
+import { getElementsInGroup } from "@excalidraw/element";
 
 
 import {
 import {
   syncInvalidIndices,
   syncInvalidIndices,
   syncMovedIndices,
   syncMovedIndices,
   validateFractionalIndices,
   validateFractionalIndices,
-} from "@excalidraw/element/fractionalIndex";
+} from "@excalidraw/element";
 
 
-import { getSelectedElements } from "@excalidraw/element/selection";
+import { getSelectedElements } from "@excalidraw/element";
 
 
-import {
-  mutateElement,
-  type ElementUpdate,
-} from "@excalidraw/element/mutateElement";
+import { mutateElement, type ElementUpdate } from "@excalidraw/element";
 
 
 import type {
 import type {
   ExcalidrawElement,
   ExcalidrawElement,
@@ -108,7 +105,7 @@ const hashSelectionOpts = (
 // in our codebase
 // in our codebase
 export type ExcalidrawElementsIncludingDeleted = readonly ExcalidrawElement[];
 export type ExcalidrawElementsIncludingDeleted = readonly ExcalidrawElement[];
 
 
-class Scene {
+export class Scene {
   // ---------------------------------------------------------------------------
   // ---------------------------------------------------------------------------
   // instance methods/props
   // instance methods/props
   // ---------------------------------------------------------------------------
   // ---------------------------------------------------------------------------
@@ -457,5 +454,3 @@ class Scene {
     return element;
     return element;
   }
   }
 }
 }
-
-export default Scene;

+ 1 - 1
packages/element/src/align.ts

@@ -2,7 +2,7 @@ import { updateBoundElements } from "./binding";
 import { getCommonBoundingBox } from "./bounds";
 import { getCommonBoundingBox } from "./bounds";
 import { getMaximumGroups } from "./groups";
 import { getMaximumGroups } from "./groups";
 
 
-import type Scene from "./Scene";
+import type { Scene } from "./Scene";
 
 
 import type { BoundingBox } from "./bounds";
 import type { BoundingBox } from "./bounds";
 import type { ExcalidrawElement } from "./types";
 import type { ExcalidrawElement } from "./types";

+ 1 - 1
packages/element/src/binding.ts

@@ -66,7 +66,7 @@ import {
 import { aabbForElement, getElementShape, pointInsideBounds } from "./shapes";
 import { aabbForElement, getElementShape, pointInsideBounds } from "./shapes";
 import { updateElbowArrowPoints } from "./elbowArrow";
 import { updateElbowArrowPoints } from "./elbowArrow";
 
 
-import type Scene from "./Scene";
+import type { Scene } from "./Scene";
 
 
 import type { Bounds } from "./bounds";
 import type { Bounds } from "./bounds";
 import type { ElementUpdate } from "./mutateElement";
 import type { ElementUpdate } from "./mutateElement";

+ 1 - 1
packages/element/src/delta.ts

@@ -49,7 +49,7 @@ import { getNonDeletedGroupIds } from "./groups";
 
 
 import { orderByFractionalIndex, syncMovedIndices } from "./fractionalIndex";
 import { orderByFractionalIndex, syncMovedIndices } from "./fractionalIndex";
 
 
-import Scene from "./Scene";
+import { Scene } from "./Scene";
 
 
 import type { BindableProp, BindingProp } from "./binding";
 import type { BindableProp, BindingProp } from "./binding";
 
 

+ 1 - 1
packages/element/src/dragElements.ts

@@ -26,7 +26,7 @@ import {
   isTextElement,
   isTextElement,
 } from "./typeChecks";
 } from "./typeChecks";
 
 
-import type Scene from "./Scene";
+import type { Scene } from "./Scene";
 
 
 import type { Bounds } from "./bounds";
 import type { Bounds } from "./bounds";
 import type { ExcalidrawElement } from "./types";
 import type { ExcalidrawElement } from "./types";

+ 1 - 1
packages/element/src/flowchart.ts

@@ -39,7 +39,7 @@ import {
   type OrderedExcalidrawElement,
   type OrderedExcalidrawElement,
 } from "./types";
 } from "./types";
 
 
-import type Scene from "./Scene";
+import type { Scene } from "./Scene";
 
 
 type LinkDirection = "up" | "right" | "down" | "left";
 type LinkDirection = "up" | "right" | "down" | "left";
 
 

+ 44 - 0
packages/element/src/index.ts

@@ -72,3 +72,47 @@ export const clearElementsForExport = (
 export const clearElementsForLocalStorage = (
 export const clearElementsForLocalStorage = (
   elements: readonly ExcalidrawElement[],
   elements: readonly ExcalidrawElement[],
 ) => _clearElements(elements);
 ) => _clearElements(elements);
+
+export * from "./align";
+export * from "./binding";
+export * from "./bounds";
+export * from "./collision";
+export * from "./comparisons";
+export * from "./containerCache";
+export * from "./cropElement";
+export * from "./delta";
+export * from "./distance";
+export * from "./distribute";
+export * from "./dragElements";
+export * from "./duplicate";
+export * from "./elbowArrow";
+export * from "./elementLink";
+export * from "./embeddable";
+export * from "./flowchart";
+export * from "./fractionalIndex";
+export * from "./frame";
+export * from "./groups";
+export * from "./heading";
+export * from "./image";
+export * from "./linearElementEditor";
+export * from "./mutateElement";
+export * from "./newElement";
+export * from "./renderElement";
+export * from "./resizeElements";
+export * from "./resizeTest";
+export * from "./Scene";
+export * from "./selection";
+export * from "./Shape";
+export * from "./ShapeCache";
+export * from "./shapes";
+export * from "./showSelectedShapeActions";
+export * from "./sizeHelpers";
+export * from "./sortElements";
+export * from "./store";
+export * from "./textElement";
+export * from "./textMeasurements";
+export * from "./textWrapping";
+export * from "./transformHandles";
+export * from "./typeChecks";
+export * from "./utils";
+export * from "./zindex";

+ 2 - 2
packages/element/src/linearElementEditor.ts

@@ -20,7 +20,7 @@ import {
   tupleToCoors,
   tupleToCoors,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import type { Store } from "@excalidraw/element/store";
+import type { Store } from "@excalidraw/element";
 
 
 import type { Radians } from "@excalidraw/math";
 import type { Radians } from "@excalidraw/math";
 
 
@@ -67,7 +67,7 @@ import {
 
 
 import { getLockedLinearCursorAlignSize } from "./sizeHelpers";
 import { getLockedLinearCursorAlignSize } from "./sizeHelpers";
 
 
-import type Scene from "./Scene";
+import type { Scene } from "./Scene";
 
 
 import type { Bounds } from "./bounds";
 import type { Bounds } from "./bounds";
 import type {
 import type {

+ 1 - 1
packages/element/src/resizeElements.ts

@@ -57,7 +57,7 @@ import {
 
 
 import { isInGroup } from "./groups";
 import { isInGroup } from "./groups";
 
 
-import type Scene from "./Scene";
+import type { Scene } from "./Scene";
 
 
 import type { BoundingBox } from "./bounds";
 import type { BoundingBox } from "./bounds";
 import type {
 import type {

+ 1 - 1
packages/element/src/textElement.ts

@@ -30,7 +30,7 @@ import {
   isTextElement,
   isTextElement,
 } from "./typeChecks";
 } from "./typeChecks";
 
 
-import type Scene from "./Scene";
+import type { Scene } from "./Scene";
 
 
 import type { MaybeTransformHandleType } from "./transformHandles";
 import type { MaybeTransformHandleType } from "./transformHandles";
 import type {
 import type {

+ 1 - 1
packages/element/src/zindex.ts

@@ -10,7 +10,7 @@ import { syncMovedIndices } from "./fractionalIndex";
 
 
 import { getSelectedElements } from "./selection";
 import { getSelectedElements } from "./selection";
 
 
-import type Scene from "./Scene";
+import type { Scene } from "./Scene";
 
 
 import type { ExcalidrawElement, ExcalidrawFrameLikeElement } from "./types";
 import type { ExcalidrawElement, ExcalidrawFrameLikeElement } from "./types";
 
 

+ 0 - 0
packages/excalidraw/tests/__snapshots__/linearElementEditor.test.tsx.snap → packages/element/tests/__snapshots__/linearElementEditor.test.tsx.snap


+ 24 - 15
packages/excalidraw/tests/cropElement.test.tsx → packages/element/tests/cropElement.test.tsx

@@ -3,21 +3,30 @@ import { vi } from "vitest";
 
 
 import { KEYS, cloneJSON } from "@excalidraw/common";
 import { KEYS, cloneJSON } from "@excalidraw/common";
 
 
-import { duplicateElement } from "@excalidraw/element/duplicate";
-
-import type {
-  ExcalidrawImageElement,
-  ImageCrop,
-} from "@excalidraw/element/types";
-
-import { Excalidraw, exportToCanvas, exportToSvg } from "..";
-import { actionFlipHorizontal, actionFlipVertical } from "../actions";
-
-import { API } from "./helpers/api";
-import { Keyboard, Pointer, UI } from "./helpers/ui";
-import { act, GlobalTestState, render, unmountComponent } from "./test-utils";
-
-import type { NormalizedZoomValue } from "../types";
+import {
+  Excalidraw,
+  exportToCanvas,
+  exportToSvg,
+} from "@excalidraw/excalidraw";
+import {
+  actionFlipHorizontal,
+  actionFlipVertical,
+} from "@excalidraw/excalidraw/actions";
+
+import { API } from "@excalidraw/excalidraw/tests/helpers/api";
+import { Keyboard, Pointer, UI } from "@excalidraw/excalidraw/tests/helpers/ui";
+import {
+  act,
+  GlobalTestState,
+  render,
+  unmountComponent,
+} from "@excalidraw/excalidraw/tests/test-utils";
+
+import type { NormalizedZoomValue } from "@excalidraw/excalidraw/types";
+
+import { duplicateElement } from "../src/duplicate";
+
+import type { ExcalidrawImageElement, ImageCrop } from "../src/types";
 
 
 const { h } = window;
 const { h } = window;
 const mouse = new Pointer("mouse");
 const mouse = new Pointer("mouse");

+ 1 - 1
packages/element/tests/delta.test.tsx

@@ -1,5 +1,5 @@
 import type { ObservedAppState } from "@excalidraw/excalidraw/types";
 import type { ObservedAppState } from "@excalidraw/excalidraw/types";
-import type { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
+import type { LinearElementEditor } from "@excalidraw/element";
 
 
 import { AppStateDelta } from "../src/delta";
 import { AppStateDelta } from "../src/delta";
 
 

+ 1 - 1
packages/element/tests/elbowArrow.test.tsx

@@ -22,7 +22,7 @@ import type { LocalPoint } from "@excalidraw/math";
 
 
 import { bindLinearElement } from "../src/binding";
 import { bindLinearElement } from "../src/binding";
 
 
-import Scene from "../src/Scene";
+import { Scene } from "../src/Scene";
 
 
 import type {
 import type {
   ExcalidrawArrowElement,
   ExcalidrawArrowElement,

+ 2 - 2
packages/element/tests/fractionalIndex.test.ts

@@ -7,9 +7,9 @@ import {
   syncInvalidIndices,
   syncInvalidIndices,
   syncMovedIndices,
   syncMovedIndices,
   validateFractionalIndices,
   validateFractionalIndices,
-} from "@excalidraw/element/fractionalIndex";
+} from "@excalidraw/element";
 
 
-import { deepCopyElement } from "@excalidraw/element/duplicate";
+import { deepCopyElement } from "@excalidraw/element";
 
 
 import { API } from "@excalidraw/excalidraw/tests/helpers/api";
 import { API } from "@excalidraw/excalidraw/tests/helpers/api";
 
 

+ 19 - 23
packages/excalidraw/tests/linearElementEditor.test.tsx → packages/element/tests/linearElementEditor.test.tsx

@@ -1,5 +1,3 @@
-import { newArrowElement } from "@excalidraw/element/newElement";
-
 import { pointCenter, pointFrom } from "@excalidraw/math";
 import { pointCenter, pointFrom } from "@excalidraw/math";
 import { act, queryByTestId, queryByText } from "@testing-library/react";
 import { act, queryByTestId, queryByText } from "@testing-library/react";
 import React from "react";
 import React from "react";
@@ -13,36 +11,34 @@ import {
   arrayToMap,
   arrayToMap,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
+import { Excalidraw } from "@excalidraw/excalidraw";
+import * as InteractiveCanvas from "@excalidraw/excalidraw/renderer/interactiveScene";
+import * as StaticScene from "@excalidraw/excalidraw/renderer/staticScene";
+import { API } from "@excalidraw/excalidraw/tests/helpers/api";
+
+import { Keyboard, Pointer, UI } from "@excalidraw/excalidraw/tests/helpers/ui";
 import {
 import {
-  getBoundTextElementPosition,
-  getBoundTextMaxWidth,
-} from "@excalidraw/element/textElement";
-import * as textElementUtils from "@excalidraw/element/textElement";
-import { wrapText } from "@excalidraw/element/textWrapping";
+  screen,
+  render,
+  fireEvent,
+  GlobalTestState,
+  unmountComponent,
+} from "@excalidraw/excalidraw/tests/test-utils";
 
 
 import type { GlobalPoint, LocalPoint } from "@excalidraw/math";
 import type { GlobalPoint, LocalPoint } from "@excalidraw/math";
 
 
+import { wrapText } from "../src";
+import * as textElementUtils from "../src/textElement";
+import { getBoundTextElementPosition, getBoundTextMaxWidth } from "../src";
+import { LinearElementEditor } from "../src";
+import { newArrowElement } from "../src";
+
 import type {
 import type {
   ExcalidrawElement,
   ExcalidrawElement,
   ExcalidrawLinearElement,
   ExcalidrawLinearElement,
   ExcalidrawTextElementWithContainer,
   ExcalidrawTextElementWithContainer,
   FontString,
   FontString,
-} from "@excalidraw/element/types";
-
-import { Excalidraw } from "../index";
-import * as InteractiveCanvas from "../renderer/interactiveScene";
-import * as StaticScene from "../renderer/staticScene";
-import { API } from "../tests/helpers/api";
-
-import { Keyboard, Pointer, UI } from "./helpers/ui";
-import {
-  screen,
-  render,
-  fireEvent,
-  GlobalTestState,
-  unmountComponent,
-} from "./test-utils";
+} from "../src/types";
 
 
 const renderInteractiveScene = vi.spyOn(
 const renderInteractiveScene = vi.spyOn(
   InteractiveCanvas,
   InteractiveCanvas,

+ 1 - 1
packages/element/tests/sortElements.test.ts

@@ -1,6 +1,6 @@
 import { API } from "@excalidraw/excalidraw/tests/helpers/api";
 import { API } from "@excalidraw/excalidraw/tests/helpers/api";
 
 
-import { mutateElement } from "@excalidraw/element/mutateElement";
+import { mutateElement } from "@excalidraw/element";
 
 
 import { normalizeElementOrder } from "../src/sortElements";
 import { normalizeElementOrder } from "../src/sortElements";
 
 

+ 2 - 2
packages/excalidraw/actions/actionAddToLibrary.ts

@@ -1,7 +1,7 @@
 import { LIBRARY_DISABLED_TYPES, randomId } from "@excalidraw/common";
 import { LIBRARY_DISABLED_TYPES, randomId } from "@excalidraw/common";
-import { deepCopyElement } from "@excalidraw/element/duplicate";
+import { deepCopyElement } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { t } from "../i18n";
 import { t } from "../i18n";
 
 

+ 5 - 5
packages/excalidraw/actions/actionAlign.tsx

@@ -1,18 +1,18 @@
 import { getNonDeletedElements } from "@excalidraw/element";
 import { getNonDeletedElements } from "@excalidraw/element";
 
 
-import { isFrameLikeElement } from "@excalidraw/element/typeChecks";
+import { isFrameLikeElement } from "@excalidraw/element";
 
 
-import { updateFrameMembershipOfSelectedElements } from "@excalidraw/element/frame";
+import { updateFrameMembershipOfSelectedElements } from "@excalidraw/element";
 
 
 import { KEYS, arrayToMap, getShortcutKey } from "@excalidraw/common";
 import { KEYS, arrayToMap, getShortcutKey } from "@excalidraw/common";
 
 
-import { alignElements } from "@excalidraw/element/align";
+import { alignElements } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 
 
-import type { Alignment } from "@excalidraw/element/align";
+import type { Alignment } from "@excalidraw/element";
 
 
 import { ToolButton } from "../components/ToolButton";
 import { ToolButton } from "../components/ToolButton";
 import {
 import {

+ 7 - 7
packages/excalidraw/actions/actionBoundText.tsx

@@ -10,14 +10,14 @@ import {
   getOriginalContainerHeightFromCache,
   getOriginalContainerHeightFromCache,
   resetOriginalContainerCache,
   resetOriginalContainerCache,
   updateOriginalContainerCache,
   updateOriginalContainerCache,
-} from "@excalidraw/element/containerCache";
+} from "@excalidraw/element";
 
 
 import {
 import {
   computeBoundTextPosition,
   computeBoundTextPosition,
   computeContainerDimensionForBoundText,
   computeContainerDimensionForBoundText,
   getBoundTextElement,
   getBoundTextElement,
   redrawTextBoundingBox,
   redrawTextBoundingBox,
-} from "@excalidraw/element/textElement";
+} from "@excalidraw/element";
 
 
 import {
 import {
   hasBoundTextElement,
   hasBoundTextElement,
@@ -25,15 +25,15 @@ import {
   isTextBindableContainer,
   isTextBindableContainer,
   isTextElement,
   isTextElement,
   isUsingAdaptiveRadius,
   isUsingAdaptiveRadius,
-} from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
 
 
-import { measureText } from "@excalidraw/element/textMeasurements";
+import { measureText } from "@excalidraw/element";
 
 
-import { syncMovedIndices } from "@excalidraw/element/fractionalIndex";
+import { syncMovedIndices } from "@excalidraw/element";
 
 
-import { newElement } from "@excalidraw/element/newElement";
+import { newElement } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type {
 import type {
   ExcalidrawElement,
   ExcalidrawElement,

+ 3 - 3
packages/excalidraw/actions/actionCanvas.tsx

@@ -14,10 +14,10 @@ import {
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
 import { getNonDeletedElements } from "@excalidraw/element";
 import { getNonDeletedElements } from "@excalidraw/element";
-import { newElementWith } from "@excalidraw/element/mutateElement";
-import { getCommonBounds, type SceneBounds } from "@excalidraw/element/bounds";
+import { newElementWith } from "@excalidraw/element";
+import { getCommonBounds, type SceneBounds } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 
 

+ 3 - 3
packages/excalidraw/actions/actionClipboard.tsx

@@ -1,9 +1,9 @@
-import { isTextElement } from "@excalidraw/element/typeChecks";
-import { getTextFromElements } from "@excalidraw/element/textElement";
+import { isTextElement } from "@excalidraw/element";
+import { getTextFromElements } from "@excalidraw/element";
 
 
 import { CODES, KEYS, isFirefox } from "@excalidraw/common";
 import { CODES, KEYS, isFirefox } from "@excalidraw/common";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import {
 import {
   copyTextToSystemClipboard,
   copyTextToSystemClipboard,

+ 2 - 2
packages/excalidraw/actions/actionCropEditor.tsx

@@ -1,6 +1,6 @@
-import { isImageElement } from "@excalidraw/element/typeChecks";
+import { isImageElement } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { ExcalidrawImageElement } from "@excalidraw/element/types";
 import type { ExcalidrawImageElement } from "@excalidraw/element/types";
 
 

+ 8 - 8
packages/excalidraw/actions/actionDeleteSelected.tsx

@@ -1,23 +1,23 @@
 import { KEYS, updateActiveTool } from "@excalidraw/common";
 import { KEYS, updateActiveTool } from "@excalidraw/common";
 
 
 import { getNonDeletedElements } from "@excalidraw/element";
 import { getNonDeletedElements } from "@excalidraw/element";
-import { fixBindingsAfterDeletion } from "@excalidraw/element/binding";
-import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
-import { newElementWith } from "@excalidraw/element/mutateElement";
-import { getContainerElement } from "@excalidraw/element/textElement";
+import { fixBindingsAfterDeletion } from "@excalidraw/element";
+import { LinearElementEditor } from "@excalidraw/element";
+import { newElementWith } from "@excalidraw/element";
+import { getContainerElement } from "@excalidraw/element";
 import {
 import {
   isBoundToContainer,
   isBoundToContainer,
   isElbowArrow,
   isElbowArrow,
   isFrameLikeElement,
   isFrameLikeElement,
-} from "@excalidraw/element/typeChecks";
-import { getFrameChildren } from "@excalidraw/element/frame";
+} from "@excalidraw/element";
+import { getFrameChildren } from "@excalidraw/element";
 
 
 import {
 import {
   getElementsInGroup,
   getElementsInGroup,
   selectGroupsForSelectedElements,
   selectGroupsForSelectedElements,
-} from "@excalidraw/element/groups";
+} from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 
 

+ 5 - 5
packages/excalidraw/actions/actionDistribute.tsx

@@ -1,18 +1,18 @@
 import { getNonDeletedElements } from "@excalidraw/element";
 import { getNonDeletedElements } from "@excalidraw/element";
 
 
-import { isFrameLikeElement } from "@excalidraw/element/typeChecks";
+import { isFrameLikeElement } from "@excalidraw/element";
 
 
 import { CODES, KEYS, arrayToMap, getShortcutKey } from "@excalidraw/common";
 import { CODES, KEYS, arrayToMap, getShortcutKey } from "@excalidraw/common";
 
 
-import { updateFrameMembershipOfSelectedElements } from "@excalidraw/element/frame";
+import { updateFrameMembershipOfSelectedElements } from "@excalidraw/element";
 
 
-import { distributeElements } from "@excalidraw/element/distribute";
+import { distributeElements } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 
 
-import type { Distribution } from "@excalidraw/element/distribute";
+import type { Distribution } from "@excalidraw/element";
 
 
 import { ToolButton } from "../components/ToolButton";
 import { ToolButton } from "../components/ToolButton";
 import {
 import {

+ 5 - 5
packages/excalidraw/actions/actionDuplicateSelection.tsx

@@ -7,18 +7,18 @@ import {
 
 
 import { getNonDeletedElements } from "@excalidraw/element";
 import { getNonDeletedElements } from "@excalidraw/element";
 
 
-import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
+import { LinearElementEditor } from "@excalidraw/element";
 
 
 import {
 import {
   getSelectedElements,
   getSelectedElements,
   getSelectionStateForElements,
   getSelectionStateForElements,
-} from "@excalidraw/element/selection";
+} from "@excalidraw/element";
 
 
-import { syncMovedIndices } from "@excalidraw/element/fractionalIndex";
+import { syncMovedIndices } from "@excalidraw/element";
 
 
-import { duplicateElements } from "@excalidraw/element/duplicate";
+import { duplicateElements } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { ToolButton } from "../components/ToolButton";
 import { ToolButton } from "../components/ToolButton";
 import { DuplicateIcon } from "../components/icons";
 import { DuplicateIcon } from "../components/icons";

+ 2 - 2
packages/excalidraw/actions/actionElementLink.ts

@@ -2,9 +2,9 @@ import {
   canCreateLinkFromElements,
   canCreateLinkFromElements,
   defaultGetElementLinkFromSelection,
   defaultGetElementLinkFromSelection,
   getLinkIdAndTypeFromSelection,
   getLinkIdAndTypeFromSelection,
-} from "@excalidraw/element/elementLink";
+} from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { copyTextToSystemClipboard } from "../clipboard";
 import { copyTextToSystemClipboard } from "../clipboard";
 import { copyIcon, elementLinkIcon } from "../components/icons";
 import { copyIcon, elementLinkIcon } from "../components/icons";

+ 3 - 3
packages/excalidraw/actions/actionElementLock.ts

@@ -1,10 +1,10 @@
 import { KEYS, arrayToMap } from "@excalidraw/common";
 import { KEYS, arrayToMap } from "@excalidraw/common";
 
 
-import { newElementWith } from "@excalidraw/element/mutateElement";
+import { newElementWith } from "@excalidraw/element";
 
 
-import { isFrameLikeElement } from "@excalidraw/element/typeChecks";
+import { isFrameLikeElement } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 
 

+ 1 - 1
packages/excalidraw/actions/actionEmbeddable.ts

@@ -1,6 +1,6 @@
 import { updateActiveTool } from "@excalidraw/common";
 import { updateActiveTool } from "@excalidraw/common";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { setCursorForShape } from "../cursor";
 import { setCursorForShape } from "../cursor";
 
 

+ 1 - 1
packages/excalidraw/actions/actionExport.tsx

@@ -7,7 +7,7 @@ import {
 
 
 import { getNonDeletedElements } from "@excalidraw/element";
 import { getNonDeletedElements } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { Theme } from "@excalidraw/element/types";
 import type { Theme } from "@excalidraw/element/types";
 
 

+ 6 - 9
packages/excalidraw/actions/actionFinalize.tsx

@@ -3,20 +3,17 @@ import { pointFrom } from "@excalidraw/math";
 import {
 import {
   maybeBindLinearElement,
   maybeBindLinearElement,
   bindOrUnbindLinearElement,
   bindOrUnbindLinearElement,
-} from "@excalidraw/element/binding";
-import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
+} from "@excalidraw/element";
+import { LinearElementEditor } from "@excalidraw/element";
 
 
-import {
-  isBindingElement,
-  isLinearElement,
-} from "@excalidraw/element/typeChecks";
+import { isBindingElement, isLinearElement } from "@excalidraw/element";
 
 
 import { KEYS, arrayToMap, updateActiveTool } from "@excalidraw/common";
 import { KEYS, arrayToMap, updateActiveTool } from "@excalidraw/common";
-import { isPathALoop } from "@excalidraw/element/shapes";
+import { isPathALoop } from "@excalidraw/element";
 
 
-import { isInvisiblySmallElement } from "@excalidraw/element/sizeHelpers";
+import { isInvisiblySmallElement } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { t } from "../i18n";
 import { t } from "../i18n";
 import { resetCursor } from "../cursor";
 import { resetCursor } from "../cursor";

+ 8 - 8
packages/excalidraw/actions/actionFlip.ts

@@ -2,20 +2,20 @@ import { getNonDeletedElements } from "@excalidraw/element";
 import {
 import {
   bindOrUnbindLinearElements,
   bindOrUnbindLinearElements,
   isBindingEnabled,
   isBindingEnabled,
-} from "@excalidraw/element/binding";
-import { getCommonBoundingBox } from "@excalidraw/element/bounds";
-import { newElementWith } from "@excalidraw/element/mutateElement";
-import { deepCopyElement } from "@excalidraw/element/duplicate";
-import { resizeMultipleElements } from "@excalidraw/element/resizeElements";
+} from "@excalidraw/element";
+import { getCommonBoundingBox } from "@excalidraw/element";
+import { newElementWith } from "@excalidraw/element";
+import { deepCopyElement } from "@excalidraw/element";
+import { resizeMultipleElements } from "@excalidraw/element";
 import {
 import {
   isArrowElement,
   isArrowElement,
   isElbowArrow,
   isElbowArrow,
   isLinearElement,
   isLinearElement,
-} from "@excalidraw/element/typeChecks";
-import { updateFrameMembershipOfSelectedElements } from "@excalidraw/element/frame";
+} from "@excalidraw/element";
+import { updateFrameMembershipOfSelectedElements } from "@excalidraw/element";
 import { CODES, KEYS, arrayToMap } from "@excalidraw/common";
 import { CODES, KEYS, arrayToMap } from "@excalidraw/common";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type {
 import type {
   ExcalidrawArrowElement,
   ExcalidrawArrowElement,

+ 8 - 8
packages/excalidraw/actions/actionFrame.ts

@@ -1,20 +1,20 @@
 import { getNonDeletedElements } from "@excalidraw/element";
 import { getNonDeletedElements } from "@excalidraw/element";
-import { mutateElement } from "@excalidraw/element/mutateElement";
-import { newFrameElement } from "@excalidraw/element/newElement";
-import { isFrameLikeElement } from "@excalidraw/element/typeChecks";
+import { mutateElement } from "@excalidraw/element";
+import { newFrameElement } from "@excalidraw/element";
+import { isFrameLikeElement } from "@excalidraw/element";
 import {
 import {
   addElementsToFrame,
   addElementsToFrame,
   removeAllElementsFromFrame,
   removeAllElementsFromFrame,
-} from "@excalidraw/element/frame";
-import { getFrameChildren } from "@excalidraw/element/frame";
+} from "@excalidraw/element";
+import { getFrameChildren } from "@excalidraw/element";
 
 
 import { KEYS, updateActiveTool } from "@excalidraw/common";
 import { KEYS, updateActiveTool } from "@excalidraw/common";
 
 
-import { getElementsInGroup } from "@excalidraw/element/groups";
+import { getElementsInGroup } from "@excalidraw/element";
 
 
-import { getCommonBounds } from "@excalidraw/element/bounds";
+import { getCommonBounds } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 
 

+ 6 - 6
packages/excalidraw/actions/actionGroup.tsx

@@ -1,8 +1,8 @@
 import { getNonDeletedElements } from "@excalidraw/element";
 import { getNonDeletedElements } from "@excalidraw/element";
 
 
-import { newElementWith } from "@excalidraw/element/mutateElement";
+import { newElementWith } from "@excalidraw/element";
 
 
-import { isBoundToContainer } from "@excalidraw/element/typeChecks";
+import { isBoundToContainer } from "@excalidraw/element";
 
 
 import {
 import {
   frameAndChildrenSelectedTogether,
   frameAndChildrenSelectedTogether,
@@ -12,7 +12,7 @@ import {
   groupByFrameLikes,
   groupByFrameLikes,
   removeElementsFromFrame,
   removeElementsFromFrame,
   replaceAllElementsInFrame,
   replaceAllElementsInFrame,
-} from "@excalidraw/element/frame";
+} from "@excalidraw/element";
 
 
 import { KEYS, randomId, arrayToMap, getShortcutKey } from "@excalidraw/common";
 import { KEYS, randomId, arrayToMap, getShortcutKey } from "@excalidraw/common";
 
 
@@ -24,11 +24,11 @@ import {
   addToGroup,
   addToGroup,
   removeFromSelectedGroups,
   removeFromSelectedGroups,
   isElementInGroup,
   isElementInGroup,
-} from "@excalidraw/element/groups";
+} from "@excalidraw/element";
 
 
-import { syncMovedIndices } from "@excalidraw/element/fractionalIndex";
+import { syncMovedIndices } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type {
 import type {
   ExcalidrawElement,
   ExcalidrawElement,

+ 2 - 2
packages/excalidraw/actions/actionHistory.tsx

@@ -1,8 +1,8 @@
 import { isWindows, KEYS, matchKey, arrayToMap } from "@excalidraw/common";
 import { isWindows, KEYS, matchKey, arrayToMap } from "@excalidraw/common";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
-import { orderByFractionalIndex } from "@excalidraw/element/fractionalIndex";
+import { orderByFractionalIndex } from "@excalidraw/element";
 
 
 import type { SceneElementsMap } from "@excalidraw/element/types";
 import type { SceneElementsMap } from "@excalidraw/element/types";
 
 

+ 3 - 3
packages/excalidraw/actions/actionLinearEditor.tsx

@@ -1,10 +1,10 @@
-import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
+import { LinearElementEditor } from "@excalidraw/element";
 
 
-import { isElbowArrow, isLinearElement } from "@excalidraw/element/typeChecks";
+import { isElbowArrow, isLinearElement } from "@excalidraw/element";
 
 
 import { arrayToMap } from "@excalidraw/common";
 import { arrayToMap } from "@excalidraw/common";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { ExcalidrawLinearElement } from "@excalidraw/element/types";
 import type { ExcalidrawLinearElement } from "@excalidraw/element/types";
 
 

+ 2 - 2
packages/excalidraw/actions/actionLink.tsx

@@ -1,8 +1,8 @@
-import { isEmbeddableElement } from "@excalidraw/element/typeChecks";
+import { isEmbeddableElement } from "@excalidraw/element";
 
 
 import { KEYS, getShortcutKey } from "@excalidraw/common";
 import { KEYS, getShortcutKey } from "@excalidraw/common";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { ToolButton } from "../components/ToolButton";
 import { ToolButton } from "../components/ToolButton";
 import { getContextMenuLabel } from "../components/hyperlink/Hyperlink";
 import { getContextMenuLabel } from "../components/hyperlink/Hyperlink";

+ 2 - 2
packages/excalidraw/actions/actionMenu.tsx

@@ -2,9 +2,9 @@ import { KEYS } from "@excalidraw/common";
 
 
 import { getNonDeletedElements } from "@excalidraw/element";
 import { getNonDeletedElements } from "@excalidraw/element";
 
 
-import { showSelectedShapeActions } from "@excalidraw/element/showSelectedShapeActions";
+import { showSelectedShapeActions } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { ToolButton } from "../components/ToolButton";
 import { ToolButton } from "../components/ToolButton";
 import { HamburgerMenuIcon, HelpIconThin, palette } from "../components/icons";
 import { HamburgerMenuIcon, HelpIconThin, palette } from "../components/icons";

+ 1 - 1
packages/excalidraw/actions/actionNavigate.tsx

@@ -1,6 +1,6 @@
 import clsx from "clsx";
 import clsx from "clsx";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { getClientColor } from "../clients";
 import { getClientColor } from "../clients";
 import { Avatar } from "../components/Avatar";
 import { Avatar } from "../components/Avatar";

+ 10 - 10
packages/excalidraw/actions/actionProperties.tsx

@@ -30,16 +30,16 @@ import {
   calculateFixedPointForElbowArrowBinding,
   calculateFixedPointForElbowArrowBinding,
   getHoveredElementForBinding,
   getHoveredElementForBinding,
   updateBoundElements,
   updateBoundElements,
-} from "@excalidraw/element/binding";
+} from "@excalidraw/element";
 
 
-import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
+import { LinearElementEditor } from "@excalidraw/element";
 
 
-import { newElementWith } from "@excalidraw/element/mutateElement";
+import { newElementWith } from "@excalidraw/element";
 
 
 import {
 import {
   getBoundTextElement,
   getBoundTextElement,
   redrawTextBoundingBox,
   redrawTextBoundingBox,
-} from "@excalidraw/element/textElement";
+} from "@excalidraw/element";
 
 
 import {
 import {
   isArrowElement,
   isArrowElement,
@@ -48,13 +48,13 @@ import {
   isLinearElement,
   isLinearElement,
   isTextElement,
   isTextElement,
   isUsingAdaptiveRadius,
   isUsingAdaptiveRadius,
-} from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
 
 
-import { hasStrokeColor } from "@excalidraw/element/comparisons";
+import { hasStrokeColor } from "@excalidraw/element";
 
 
-import { updateElbowArrowPoints } from "@excalidraw/element/elbowArrow";
+import { updateElbowArrowPoints } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { LocalPoint } from "@excalidraw/math";
 import type { LocalPoint } from "@excalidraw/math";
 
 
@@ -70,9 +70,9 @@ import type {
   VerticalAlign,
   VerticalAlign,
 } from "@excalidraw/element/types";
 } from "@excalidraw/element/types";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
-import type { CaptureUpdateActionType } from "@excalidraw/element/store";
+import type { CaptureUpdateActionType } from "@excalidraw/element";
 
 
 import { trackEvent } from "../analytics";
 import { trackEvent } from "../analytics";
 import { ButtonIconSelect } from "../components/ButtonIconSelect";
 import { ButtonIconSelect } from "../components/ButtonIconSelect";

+ 4 - 4
packages/excalidraw/actions/actionSelectAll.ts

@@ -1,12 +1,12 @@
 import { getNonDeletedElements } from "@excalidraw/element";
 import { getNonDeletedElements } from "@excalidraw/element";
-import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
-import { isLinearElement, isTextElement } from "@excalidraw/element/typeChecks";
+import { LinearElementEditor } from "@excalidraw/element";
+import { isLinearElement, isTextElement } from "@excalidraw/element";
 
 
 import { arrayToMap, KEYS } from "@excalidraw/common";
 import { arrayToMap, KEYS } from "@excalidraw/common";
 
 
-import { selectGroupsForSelectedElements } from "@excalidraw/element/groups";
+import { selectGroupsForSelectedElements } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 
 

+ 4 - 4
packages/excalidraw/actions/actionStyles.ts

@@ -7,7 +7,7 @@ import {
   getLineHeight,
   getLineHeight,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import { newElementWith } from "@excalidraw/element/mutateElement";
+import { newElementWith } from "@excalidraw/element";
 
 
 import {
 import {
   hasBoundTextElement,
   hasBoundTextElement,
@@ -17,14 +17,14 @@ import {
   isArrowElement,
   isArrowElement,
   isExcalidrawElement,
   isExcalidrawElement,
   isTextElement,
   isTextElement,
-} from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
 
 
 import {
 import {
   getBoundTextElement,
   getBoundTextElement,
   redrawTextBoundingBox,
   redrawTextBoundingBox,
-} from "@excalidraw/element/textElement";
+} from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { ExcalidrawTextElement } from "@excalidraw/element/types";
 import type { ExcalidrawTextElement } from "@excalidraw/element/types";
 
 

+ 4 - 4
packages/excalidraw/actions/actionTextAutoResize.ts

@@ -1,11 +1,11 @@
 import { getFontString } from "@excalidraw/common";
 import { getFontString } from "@excalidraw/common";
 
 
-import { newElementWith } from "@excalidraw/element/mutateElement";
-import { measureText } from "@excalidraw/element/textMeasurements";
+import { newElementWith } from "@excalidraw/element";
+import { measureText } from "@excalidraw/element";
 
 
-import { isTextElement } from "@excalidraw/element/typeChecks";
+import { isTextElement } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { getSelectedElements } from "../scene";
 import { getSelectedElements } from "../scene";
 
 

+ 1 - 1
packages/excalidraw/actions/actionToggleGridMode.tsx

@@ -1,6 +1,6 @@
 import { CODES, KEYS } from "@excalidraw/common";
 import { CODES, KEYS } from "@excalidraw/common";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { gridIcon } from "../components/icons";
 import { gridIcon } from "../components/icons";
 
 

+ 1 - 1
packages/excalidraw/actions/actionToggleObjectsSnapMode.tsx

@@ -1,6 +1,6 @@
 import { CODES, KEYS } from "@excalidraw/common";
 import { CODES, KEYS } from "@excalidraw/common";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { magnetIcon } from "../components/icons";
 import { magnetIcon } from "../components/icons";
 
 

+ 1 - 1
packages/excalidraw/actions/actionToggleSearchMenu.ts

@@ -5,7 +5,7 @@ import {
   DEFAULT_SIDEBAR,
   DEFAULT_SIDEBAR,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { searchIcon } from "../components/icons";
 import { searchIcon } from "../components/icons";
 
 

+ 1 - 1
packages/excalidraw/actions/actionToggleShapeSwitch.tsx

@@ -1,4 +1,4 @@
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 
 

+ 1 - 1
packages/excalidraw/actions/actionToggleStats.tsx

@@ -1,6 +1,6 @@
 import { CODES, KEYS } from "@excalidraw/common";
 import { CODES, KEYS } from "@excalidraw/common";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { abacusIcon } from "../components/icons";
 import { abacusIcon } from "../components/icons";
 
 

+ 1 - 1
packages/excalidraw/actions/actionToggleViewMode.tsx

@@ -1,6 +1,6 @@
 import { CODES, KEYS } from "@excalidraw/common";
 import { CODES, KEYS } from "@excalidraw/common";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { eyeIcon } from "../components/icons";
 import { eyeIcon } from "../components/icons";
 
 

+ 1 - 1
packages/excalidraw/actions/actionToggleZenMode.tsx

@@ -1,6 +1,6 @@
 import { CODES, KEYS } from "@excalidraw/common";
 import { CODES, KEYS } from "@excalidraw/common";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import { coffeeIcon } from "../components/icons";
 import { coffeeIcon } from "../components/icons";
 
 

+ 2 - 2
packages/excalidraw/actions/actionZindex.tsx

@@ -5,9 +5,9 @@ import {
   moveOneRight,
   moveOneRight,
   moveAllLeft,
   moveAllLeft,
   moveAllRight,
   moveAllRight,
-} from "@excalidraw/element/zindex";
+} from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import {
 import {
   BringForwardIcon,
   BringForwardIcon,

+ 1 - 1
packages/excalidraw/actions/types.ts

@@ -3,7 +3,7 @@ import type {
   OrderedExcalidrawElement,
   OrderedExcalidrawElement,
 } from "@excalidraw/element/types";
 } from "@excalidraw/element/types";
 
 
-import type { CaptureUpdateActionType } from "@excalidraw/element/store";
+import type { CaptureUpdateActionType } from "@excalidraw/element";
 
 
 import type {
 import type {
   AppClassProperties,
   AppClassProperties,

+ 1 - 1
packages/excalidraw/charts.ts

@@ -15,7 +15,7 @@ import {
   newTextElement,
   newTextElement,
   newLinearElement,
   newLinearElement,
   newElement,
   newElement,
-} from "@excalidraw/element/newElement";
+} from "@excalidraw/element";
 
 
 import type { Radians } from "@excalidraw/math";
 import type { Radians } from "@excalidraw/math";
 
 

+ 4 - 4
packages/excalidraw/clipboard.ts

@@ -7,14 +7,14 @@ import {
   isPromiseLike,
   isPromiseLike,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import { mutateElement } from "@excalidraw/element/mutateElement";
-import { deepCopyElement } from "@excalidraw/element/duplicate";
+import { mutateElement } from "@excalidraw/element";
+import { deepCopyElement } from "@excalidraw/element";
 import {
 import {
   isFrameLikeElement,
   isFrameLikeElement,
   isInitializedImageElement,
   isInitializedImageElement,
-} from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
 
 
-import { getContainingFrame } from "@excalidraw/element/frame";
+import { getContainingFrame } from "@excalidraw/element";
 
 
 import type {
 import type {
   ExcalidrawElement,
   ExcalidrawElement,

+ 3 - 3
packages/excalidraw/components/Actions.tsx

@@ -11,7 +11,7 @@ import {
 import {
 import {
   shouldAllowVerticalAlign,
   shouldAllowVerticalAlign,
   suppportsHorizontalAlign,
   suppportsHorizontalAlign,
-} from "@excalidraw/element/textElement";
+} from "@excalidraw/element";
 
 
 import {
 import {
   hasBoundTextElement,
   hasBoundTextElement,
@@ -19,9 +19,9 @@ import {
   isImageElement,
   isImageElement,
   isLinearElement,
   isLinearElement,
   isTextElement,
   isTextElement,
-} from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
 
 
-import { hasStrokeColor, toolIsArrow } from "@excalidraw/element/comparisons";
+import { hasStrokeColor, toolIsArrow } from "@excalidraw/element";
 
 
 import type {
 import type {
   ExcalidrawElement,
   ExcalidrawElement,

+ 32 - 44
packages/excalidraw/components/App.tsx

@@ -104,10 +104,7 @@ import {
   Emitter,
   Emitter,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import {
-  getCommonBounds,
-  getElementAbsoluteCoords,
-} from "@excalidraw/element/bounds";
+import { getCommonBounds, getElementAbsoluteCoords } from "@excalidraw/element";
 
 
 import {
 import {
   bindOrUnbindLinearElement,
   bindOrUnbindLinearElement,
@@ -120,11 +117,11 @@ import {
   shouldEnableBindingForPointerEvent,
   shouldEnableBindingForPointerEvent,
   updateBoundElements,
   updateBoundElements,
   getSuggestedBindingsForArrows,
   getSuggestedBindingsForArrows,
-} from "@excalidraw/element/binding";
+} from "@excalidraw/element";
 
 
-import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
+import { LinearElementEditor } from "@excalidraw/element";
 
 
-import { newElementWith } from "@excalidraw/element/mutateElement";
+import { newElementWith } from "@excalidraw/element";
 
 
 import {
 import {
   newFrameElement,
   newFrameElement,
@@ -138,12 +135,9 @@ import {
   newLinearElement,
   newLinearElement,
   newTextElement,
   newTextElement,
   refreshTextDimensions,
   refreshTextDimensions,
-} from "@excalidraw/element/newElement";
+} from "@excalidraw/element";
 
 
-import {
-  deepCopyElement,
-  duplicateElements,
-} from "@excalidraw/element/duplicate";
+import { deepCopyElement, duplicateElements } from "@excalidraw/element";
 
 
 import {
 import {
   hasBoundTextElement,
   hasBoundTextElement,
@@ -166,7 +160,7 @@ import {
   isFlowchartNodeElement,
   isFlowchartNodeElement,
   isBindableElement,
   isBindableElement,
   isTextElement,
   isTextElement,
-} from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
 
 
 import {
 import {
   getLockedLinearCursorAlignSize,
   getLockedLinearCursorAlignSize,
@@ -174,28 +168,28 @@ import {
   isElementCompletelyInViewport,
   isElementCompletelyInViewport,
   isElementInViewport,
   isElementInViewport,
   isInvisiblySmallElement,
   isInvisiblySmallElement,
-} from "@excalidraw/element/sizeHelpers";
+} from "@excalidraw/element";
 
 
 import {
 import {
   getBoundTextShape,
   getBoundTextShape,
   getCornerRadius,
   getCornerRadius,
   getElementShape,
   getElementShape,
   isPathALoop,
   isPathALoop,
-} from "@excalidraw/element/shapes";
+} from "@excalidraw/element";
 
 
 import {
 import {
   createSrcDoc,
   createSrcDoc,
   embeddableURLValidator,
   embeddableURLValidator,
   maybeParseEmbedSrc,
   maybeParseEmbedSrc,
   getEmbedLink,
   getEmbedLink,
-} from "@excalidraw/element/embeddable";
+} from "@excalidraw/element";
 
 
 import {
 import {
   getInitializedImageElements,
   getInitializedImageElements,
   loadHTMLImageElement,
   loadHTMLImageElement,
   normalizeSVG,
   normalizeSVG,
   updateImageCache as _updateImageCache,
   updateImageCache as _updateImageCache,
-} from "@excalidraw/element/image";
+} from "@excalidraw/element";
 
 
 import {
 import {
   getBoundTextElement,
   getBoundTextElement,
@@ -203,9 +197,9 @@ import {
   getContainerElement,
   getContainerElement,
   isValidTextContainer,
   isValidTextContainer,
   redrawTextBoundingBox,
   redrawTextBoundingBox,
-} from "@excalidraw/element/textElement";
+} from "@excalidraw/element";
 
 
-import { shouldShowBoundingBox } from "@excalidraw/element/transformHandles";
+import { shouldShowBoundingBox } from "@excalidraw/element";
 
 
 import {
 import {
   getFrameChildren,
   getFrameChildren,
@@ -222,30 +216,27 @@ import {
   getFrameLikeTitle,
   getFrameLikeTitle,
   getElementsOverlappingFrame,
   getElementsOverlappingFrame,
   filterElementsEligibleAsFrameChildren,
   filterElementsEligibleAsFrameChildren,
-} from "@excalidraw/element/frame";
+} from "@excalidraw/element";
 
 
 import {
 import {
   hitElementBoundText,
   hitElementBoundText,
   hitElementBoundingBoxOnly,
   hitElementBoundingBoxOnly,
   hitElementItself,
   hitElementItself,
-} from "@excalidraw/element/collision";
+} from "@excalidraw/element";
 
 
-import { getVisibleSceneBounds } from "@excalidraw/element/bounds";
+import { getVisibleSceneBounds } from "@excalidraw/element";
 
 
 import {
 import {
   FlowChartCreator,
   FlowChartCreator,
   FlowChartNavigator,
   FlowChartNavigator,
   getLinkDirectionFromKey,
   getLinkDirectionFromKey,
-} from "@excalidraw/element/flowchart";
+} from "@excalidraw/element";
 
 
-import { cropElement } from "@excalidraw/element/cropElement";
+import { cropElement } from "@excalidraw/element";
 
 
-import { wrapText } from "@excalidraw/element/textWrapping";
+import { wrapText } from "@excalidraw/element";
 
 
-import {
-  isElementLink,
-  parseElementLinkFromURL,
-} from "@excalidraw/element/elementLink";
+import { isElementLink, parseElementLinkFromURL } from "@excalidraw/element";
 
 
 import {
 import {
   isMeasureTextSupported,
   isMeasureTextSupported,
@@ -255,11 +246,11 @@ import {
   getApproxMinLineWidth,
   getApproxMinLineWidth,
   getApproxMinLineHeight,
   getApproxMinLineHeight,
   getMinTextElementWidth,
   getMinTextElementWidth,
-} from "@excalidraw/element/textMeasurements";
+} from "@excalidraw/element";
 
 
-import { ShapeCache } from "@excalidraw/element/ShapeCache";
+import { ShapeCache } from "@excalidraw/element";
 
 
-import { getRenderOpacity } from "@excalidraw/element/renderElement";
+import { getRenderOpacity } from "@excalidraw/element";
 
 
 import {
 import {
   editGroupForSelectedElement,
   editGroupForSelectedElement,
@@ -269,44 +260,41 @@ import {
   isElementInGroup,
   isElementInGroup,
   isSelectedViaGroup,
   isSelectedViaGroup,
   selectGroupsForSelectedElements,
   selectGroupsForSelectedElements,
-} from "@excalidraw/element/groups";
+} from "@excalidraw/element";
 
 
-import {
-  syncInvalidIndices,
-  syncMovedIndices,
-} from "@excalidraw/element/fractionalIndex";
+import { syncInvalidIndices, syncMovedIndices } from "@excalidraw/element";
 
 
 import {
 import {
   excludeElementsInFramesFromSelection,
   excludeElementsInFramesFromSelection,
   getSelectionStateForElements,
   getSelectionStateForElements,
   makeNextSelectedElementIds,
   makeNextSelectedElementIds,
-} from "@excalidraw/element/selection";
+} from "@excalidraw/element";
 
 
 import {
 import {
   getResizeOffsetXY,
   getResizeOffsetXY,
   getResizeArrowDirection,
   getResizeArrowDirection,
   transformElements,
   transformElements,
-} from "@excalidraw/element/resizeElements";
+} from "@excalidraw/element";
 
 
 import {
 import {
   getCursorForResizingElement,
   getCursorForResizingElement,
   getElementWithTransformHandleType,
   getElementWithTransformHandleType,
   getTransformHandleTypeFromCoords,
   getTransformHandleTypeFromCoords,
-} from "@excalidraw/element/resizeTest";
+} from "@excalidraw/element";
 
 
 import {
 import {
   dragNewElement,
   dragNewElement,
   dragSelectedElements,
   dragSelectedElements,
   getDragOffsetXY,
   getDragOffsetXY,
-} from "@excalidraw/element/dragElements";
+} from "@excalidraw/element";
 
 
 import { isNonDeletedElement } from "@excalidraw/element";
 import { isNonDeletedElement } from "@excalidraw/element";
 
 
-import Scene from "@excalidraw/element/Scene";
+import { Scene } from "@excalidraw/element";
 
 
-import { Store, CaptureUpdateAction } from "@excalidraw/element/store";
+import { Store, CaptureUpdateAction } from "@excalidraw/element";
 
 
-import type { ElementUpdate } from "@excalidraw/element/mutateElement";
+import type { ElementUpdate } from "@excalidraw/element";
 
 
 import type { LocalPoint, Radians } from "@excalidraw/math";
 import type { LocalPoint, Radians } from "@excalidraw/math";
 
 

+ 12 - 11
packages/excalidraw/components/ConvertElementTypePopup.tsx

@@ -1,6 +1,6 @@
 import { type ReactNode, useEffect, useMemo, useRef, useState } from "react";
 import { type ReactNode, useEffect, useMemo, useRef, useState } from "react";
 
 
-import { updateElbowArrowPoints } from "@excalidraw/element/elbowArrow";
+import { updateElbowArrowPoints } from "@excalidraw/element";
 
 
 import { pointFrom, pointRotateRads, type LocalPoint } from "@excalidraw/math";
 import { pointFrom, pointRotateRads, type LocalPoint } from "@excalidraw/math";
 
 
@@ -13,21 +13,21 @@ import {
   isLinearElement,
   isLinearElement,
   isSharpArrow,
   isSharpArrow,
   isUsingAdaptiveRadius,
   isUsingAdaptiveRadius,
-} from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
 
 
 import {
 import {
   getCommonBoundingBox,
   getCommonBoundingBox,
   getElementAbsoluteCoords,
   getElementAbsoluteCoords,
-} from "@excalidraw/element/bounds";
+} from "@excalidraw/element";
 
 
 import {
 import {
   getBoundTextElement,
   getBoundTextElement,
   getBoundTextMaxHeight,
   getBoundTextMaxHeight,
   getBoundTextMaxWidth,
   getBoundTextMaxWidth,
   redrawTextBoundingBox,
   redrawTextBoundingBox,
-} from "@excalidraw/element/textElement";
+} from "@excalidraw/element";
 
 
-import { wrapText } from "@excalidraw/element/textWrapping";
+import { wrapText } from "@excalidraw/element";
 
 
 import {
 import {
   assertNever,
   assertNever,
@@ -37,17 +37,19 @@ import {
   updateActiveTool,
   updateActiveTool,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import { measureText } from "@excalidraw/element/textMeasurements";
+import { measureText } from "@excalidraw/element";
 
 
-import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
+import { LinearElementEditor } from "@excalidraw/element";
 
 
 import {
 import {
   newArrowElement,
   newArrowElement,
   newElement,
   newElement,
   newLinearElement,
   newLinearElement,
-} from "@excalidraw/element/newElement";
+} from "@excalidraw/element";
 
 
-import { ShapeCache } from "@excalidraw/element/ShapeCache";
+import { ShapeCache } from "@excalidraw/element";
+
+import { updateBindings } from "@excalidraw/element";
 
 
 import type {
 import type {
   ConvertibleGenericTypes,
   ConvertibleGenericTypes,
@@ -66,7 +68,7 @@ import type {
   FixedSegment,
   FixedSegment,
 } from "@excalidraw/element/types";
 } from "@excalidraw/element/types";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import {
 import {
   bumpVersion,
   bumpVersion,
@@ -76,7 +78,6 @@ import {
 } from "..";
 } from "..";
 import { trackEvent } from "../analytics";
 import { trackEvent } from "../analytics";
 import { atom, editorJotaiStore, useSetAtom } from "../editor-jotai";
 import { atom, editorJotaiStore, useSetAtom } from "../editor-jotai";
-import { updateBindings } from "../../element/src/binding";
 
 
 import "./ConvertElementTypePopup.scss";
 import "./ConvertElementTypePopup.scss";
 import { ToolButton } from "./ToolButton";
 import { ToolButton } from "./ToolButton";

+ 1 - 1
packages/excalidraw/components/ElementCanvasButtons.tsx

@@ -1,5 +1,5 @@
 import { sceneCoordsToViewportCoords } from "@excalidraw/common";
 import { sceneCoordsToViewportCoords } from "@excalidraw/common";
-import { getElementAbsoluteCoords } from "@excalidraw/element/bounds";
+import { getElementAbsoluteCoords } from "@excalidraw/element";
 
 
 import type {
 import type {
   ElementsMap,
   ElementsMap,

+ 2 - 2
packages/excalidraw/components/ElementLinkDialog.tsx

@@ -5,11 +5,11 @@ import { normalizeLink, KEYS } from "@excalidraw/common";
 import {
 import {
   defaultGetElementLinkFromSelection,
   defaultGetElementLinkFromSelection,
   getLinkIdAndTypeFromSelection,
   getLinkIdAndTypeFromSelection,
-} from "@excalidraw/element/elementLink";
+} from "@excalidraw/element";
 
 
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import { t } from "../i18n";
 import { t } from "../i18n";
 import { getSelectedElements } from "../scene";
 import { getSelectedElements } from "../scene";

+ 2 - 2
packages/excalidraw/components/HintViewer.tsx

@@ -6,11 +6,11 @@ import {
   isLinearElement,
   isLinearElement,
   isTextBindableContainer,
   isTextBindableContainer,
   isTextElement,
   isTextElement,
-} from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
 
 
 import { getShortcutKey } from "@excalidraw/common";
 import { getShortcutKey } from "@excalidraw/common";
 
 
-import { isNodeInFlowchart } from "@excalidraw/element/flowchart";
+import { isNodeInFlowchart } from "@excalidraw/element";
 
 
 import { t } from "../i18n";
 import { t } from "../i18n";
 import { isEraserActive } from "../appState";
 import { isEraserActive } from "../appState";

+ 3 - 3
packages/excalidraw/components/LayerUI.tsx

@@ -10,11 +10,11 @@ import {
   isShallowEqual,
   isShallowEqual,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import { mutateElement } from "@excalidraw/element/mutateElement";
+import { mutateElement } from "@excalidraw/element";
 
 
-import { showSelectedShapeActions } from "@excalidraw/element/showSelectedShapeActions";
+import { showSelectedShapeActions } from "@excalidraw/element";
 
 
-import { ShapeCache } from "@excalidraw/element/ShapeCache";
+import { ShapeCache } from "@excalidraw/element";
 
 
 import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
 import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
 
 

+ 1 - 1
packages/excalidraw/components/LibraryMenuItems.tsx

@@ -8,7 +8,7 @@ import React, {
 
 
 import { MIME_TYPES, arrayToMap } from "@excalidraw/common";
 import { MIME_TYPES, arrayToMap } from "@excalidraw/common";
 
 
-import { duplicateElements } from "@excalidraw/element/duplicate";
+import { duplicateElements } from "@excalidraw/element";
 
 
 import { serializeLibraryAsJSON } from "../data/json";
 import { serializeLibraryAsJSON } from "../data/json";
 import { useLibraryCache } from "../hooks/useLibraryItemSvg";
 import { useLibraryCache } from "../hooks/useLibraryItemSvg";

+ 1 - 1
packages/excalidraw/components/MobileMenu.tsx

@@ -1,6 +1,6 @@
 import React from "react";
 import React from "react";
 
 
-import { showSelectedShapeActions } from "@excalidraw/element/showSelectedShapeActions";
+import { showSelectedShapeActions } from "@excalidraw/element";
 
 
 import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
 import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
 
 

+ 4 - 7
packages/excalidraw/components/SearchMenu.tsx

@@ -11,9 +11,9 @@ import {
   getLineHeight,
   getLineHeight,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import { isElementCompletelyInViewport } from "@excalidraw/element/sizeHelpers";
+import { isElementCompletelyInViewport } from "@excalidraw/element";
 
 
-import { measureText } from "@excalidraw/element/textMeasurements";
+import { measureText } from "@excalidraw/element";
 
 
 import {
 import {
   KEYS,
   KEYS,
@@ -22,11 +22,8 @@ import {
   getFontString,
   getFontString,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import { newTextElement } from "@excalidraw/element/newElement";
-import {
-  isFrameLikeElement,
-  isTextElement,
-} from "@excalidraw/element/typeChecks";
+import { newTextElement } from "@excalidraw/element";
+import { isTextElement, isFrameLikeElement } from "@excalidraw/element";
 
 
 import { getDefaultFrameName } from "@excalidraw/element/frame";
 import { getDefaultFrameName } from "@excalidraw/element/frame";
 
 

+ 5 - 5
packages/excalidraw/components/Stats/Angle.tsx

@@ -1,18 +1,18 @@
 import { degreesToRadians, radiansToDegrees } from "@excalidraw/math";
 import { degreesToRadians, radiansToDegrees } from "@excalidraw/math";
 
 
-import { getBoundTextElement } from "@excalidraw/element/textElement";
-import { isArrowElement, isElbowArrow } from "@excalidraw/element/typeChecks";
+import { getBoundTextElement } from "@excalidraw/element";
+import { isArrowElement, isElbowArrow } from "@excalidraw/element";
+
+import { updateBindings } from "@excalidraw/element";
 
 
 import type { Degrees } from "@excalidraw/math";
 import type { Degrees } from "@excalidraw/math";
 
 
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import { angleIcon } from "../icons";
 import { angleIcon } from "../icons";
 
 
-import { updateBindings } from "../../../element/src/binding";
-
 import DragInput from "./DragInput";
 import DragInput from "./DragInput";
 import { getStepSizedValue, isPropertyEditable } from "./utils";
 import { getStepSizedValue, isPropertyEditable } from "./utils";
 
 

+ 1 - 1
packages/excalidraw/components/Stats/CanvasGrid.tsx

@@ -1,4 +1,4 @@
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import { getNormalizedGridStep } from "../../scene";
 import { getNormalizedGridStep } from "../../scene";
 
 

+ 4 - 4
packages/excalidraw/components/Stats/Dimension.tsx

@@ -4,13 +4,13 @@ import { MIN_WIDTH_OR_HEIGHT } from "@excalidraw/common";
 import {
 import {
   MINIMAL_CROP_SIZE,
   MINIMAL_CROP_SIZE,
   getUncroppedWidthAndHeight,
   getUncroppedWidthAndHeight,
-} from "@excalidraw/element/cropElement";
-import { resizeSingleElement } from "@excalidraw/element/resizeElements";
-import { isImageElement } from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
+import { resizeSingleElement } from "@excalidraw/element";
+import { isImageElement } from "@excalidraw/element";
 
 
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import DragInput from "./DragInput";
 import DragInput from "./DragInput";
 import { getStepSizedValue, isPropertyEditable } from "./utils";
 import { getStepSizedValue, isPropertyEditable } from "./utils";

+ 3 - 3
packages/excalidraw/components/Stats/DragInput.tsx

@@ -3,13 +3,13 @@ import { useEffect, useRef, useState } from "react";
 
 
 import { EVENT, KEYS, cloneJSON } from "@excalidraw/common";
 import { EVENT, KEYS, cloneJSON } from "@excalidraw/common";
 
 
-import { deepCopyElement } from "@excalidraw/element/duplicate";
+import { deepCopyElement } from "@excalidraw/element";
 
 
-import { CaptureUpdateAction } from "@excalidraw/element/store";
+import { CaptureUpdateAction } from "@excalidraw/element";
 
 
 import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
 import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import { useApp } from "../App";
 import { useApp } from "../App";
 import { InlineIcon } from "../InlineIcon";
 import { InlineIcon } from "../InlineIcon";

+ 3 - 6
packages/excalidraw/components/Stats/FontSize.tsx

@@ -1,18 +1,15 @@
 import {
 import {
   getBoundTextElement,
   getBoundTextElement,
   redrawTextBoundingBox,
   redrawTextBoundingBox,
-} from "@excalidraw/element/textElement";
-import {
-  hasBoundTextElement,
-  isTextElement,
-} from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
+import { hasBoundTextElement, isTextElement } from "@excalidraw/element";
 
 
 import type {
 import type {
   ExcalidrawElement,
   ExcalidrawElement,
   ExcalidrawTextElement,
   ExcalidrawTextElement,
 } from "@excalidraw/element/types";
 } from "@excalidraw/element/types";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import { fontSizeIcon } from "../icons";
 import { fontSizeIcon } from "../icons";
 
 

+ 4 - 4
packages/excalidraw/components/Stats/MultiAngle.tsx

@@ -1,15 +1,15 @@
 import { degreesToRadians, radiansToDegrees } from "@excalidraw/math";
 import { degreesToRadians, radiansToDegrees } from "@excalidraw/math";
 
 
-import { getBoundTextElement } from "@excalidraw/element/textElement";
-import { isArrowElement } from "@excalidraw/element/typeChecks";
+import { getBoundTextElement } from "@excalidraw/element";
+import { isArrowElement } from "@excalidraw/element";
 
 
-import { isInGroup } from "@excalidraw/element/groups";
+import { isInGroup } from "@excalidraw/element";
 
 
 import type { Degrees } from "@excalidraw/math";
 import type { Degrees } from "@excalidraw/math";
 
 
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import { angleIcon } from "../icons";
 import { angleIcon } from "../icons";
 
 

+ 5 - 8
packages/excalidraw/components/Stats/MultiDimension.tsx

@@ -2,17 +2,14 @@ import { pointFrom, type GlobalPoint } from "@excalidraw/math";
 import { useMemo } from "react";
 import { useMemo } from "react";
 
 
 import { MIN_WIDTH_OR_HEIGHT } from "@excalidraw/common";
 import { MIN_WIDTH_OR_HEIGHT } from "@excalidraw/common";
-import { updateBoundElements } from "@excalidraw/element/binding";
+import { updateBoundElements } from "@excalidraw/element";
 import {
 import {
   rescalePointsInElement,
   rescalePointsInElement,
   resizeSingleElement,
   resizeSingleElement,
-} from "@excalidraw/element/resizeElements";
-import {
-  getBoundTextElement,
-  handleBindTextResize,
-} from "@excalidraw/element/textElement";
+} from "@excalidraw/element";
+import { getBoundTextElement, handleBindTextResize } from "@excalidraw/element";
 
 
-import { isTextElement } from "@excalidraw/element/typeChecks";
+import { isTextElement } from "@excalidraw/element";
 
 
 import { getCommonBounds } from "@excalidraw/utils";
 import { getCommonBounds } from "@excalidraw/utils";
 
 
@@ -22,7 +19,7 @@ import type {
   NonDeletedSceneElementsMap,
   NonDeletedSceneElementsMap,
 } from "@excalidraw/element/types";
 } from "@excalidraw/element/types";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import DragInput from "./DragInput";
 import DragInput from "./DragInput";
 import { getAtomicUnits, getStepSizedValue, isPropertyEditable } from "./utils";
 import { getAtomicUnits, getStepSizedValue, isPropertyEditable } from "./utils";

+ 4 - 7
packages/excalidraw/components/Stats/MultiFontSize.tsx

@@ -1,13 +1,10 @@
 import {
 import {
   getBoundTextElement,
   getBoundTextElement,
   redrawTextBoundingBox,
   redrawTextBoundingBox,
-} from "@excalidraw/element/textElement";
-import {
-  hasBoundTextElement,
-  isTextElement,
-} from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
+import { hasBoundTextElement, isTextElement } from "@excalidraw/element";
 
 
-import { isInGroup } from "@excalidraw/element/groups";
+import { isInGroup } from "@excalidraw/element";
 
 
 import type {
 import type {
   ExcalidrawElement,
   ExcalidrawElement,
@@ -15,7 +12,7 @@ import type {
   NonDeletedSceneElementsMap,
   NonDeletedSceneElementsMap,
 } from "@excalidraw/element/types";
 } from "@excalidraw/element/types";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import { fontSizeIcon } from "../icons";
 import { fontSizeIcon } from "../icons";
 
 

+ 3 - 3
packages/excalidraw/components/Stats/MultiPosition.tsx

@@ -1,13 +1,13 @@
 import { pointFrom, pointRotateRads } from "@excalidraw/math";
 import { pointFrom, pointRotateRads } from "@excalidraw/math";
 import { useMemo } from "react";
 import { useMemo } from "react";
 
 
-import { isTextElement } from "@excalidraw/element/typeChecks";
+import { isTextElement } from "@excalidraw/element";
 
 
-import { getCommonBounds } from "@excalidraw/element/bounds";
+import { getCommonBounds } from "@excalidraw/element";
 
 
 import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
 import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import StatsDragInput from "./DragInput";
 import StatsDragInput from "./DragInput";
 import {
 import {

+ 3 - 3
packages/excalidraw/components/Stats/Position.tsx

@@ -3,12 +3,12 @@ import { clamp, pointFrom, pointRotateRads, round } from "@excalidraw/math";
 import {
 import {
   getFlipAdjustedCropPosition,
   getFlipAdjustedCropPosition,
   getUncroppedWidthAndHeight,
   getUncroppedWidthAndHeight,
-} from "@excalidraw/element/cropElement";
-import { isImageElement } from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
+import { isImageElement } from "@excalidraw/element";
 
 
 import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
 import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import StatsDragInput from "./DragInput";
 import StatsDragInput from "./DragInput";
 import { getStepSizedValue, moveElement, STEP_SIZE } from "./utils";
 import { getStepSizedValue, moveElement, STEP_SIZE } from "./utils";

+ 5 - 5
packages/excalidraw/components/Stats/index.tsx

@@ -4,13 +4,13 @@ import throttle from "lodash.throttle";
 import { useEffect, useMemo, useState, memo } from "react";
 import { useEffect, useMemo, useState, memo } from "react";
 
 
 import { STATS_PANELS } from "@excalidraw/common";
 import { STATS_PANELS } from "@excalidraw/common";
-import { getCommonBounds } from "@excalidraw/element/bounds";
-import { getUncroppedWidthAndHeight } from "@excalidraw/element/cropElement";
-import { isElbowArrow, isImageElement } from "@excalidraw/element/typeChecks";
+import { getCommonBounds } from "@excalidraw/element";
+import { getUncroppedWidthAndHeight } from "@excalidraw/element";
+import { isElbowArrow, isImageElement } from "@excalidraw/element";
 
 
-import { frameAndChildrenSelectedTogether } from "@excalidraw/element/frame";
+import { frameAndChildrenSelectedTogether } from "@excalidraw/element";
 
 
-import { elementsAreInSameGroup } from "@excalidraw/element/groups";
+import { elementsAreInSameGroup } from "@excalidraw/element";
 
 
 import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
 import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
 
 

+ 2 - 2
packages/excalidraw/components/Stats/stats.test.tsx

@@ -5,9 +5,9 @@ import { vi } from "vitest";
 
 
 import { setDateTimeForTests, reseed } from "@excalidraw/common";
 import { setDateTimeForTests, reseed } from "@excalidraw/common";
 
 
-import { isInGroup } from "@excalidraw/element/groups";
+import { isInGroup } from "@excalidraw/element";
 
 
-import { isTextElement } from "@excalidraw/element/typeChecks";
+import { isTextElement } from "@excalidraw/element";
 
 
 import type { Degrees } from "@excalidraw/math";
 import type { Degrees } from "@excalidraw/math";
 
 

+ 7 - 10
packages/excalidraw/components/Stats/utils.ts

@@ -1,18 +1,17 @@
 import { pointFrom, pointRotateRads } from "@excalidraw/math";
 import { pointFrom, pointRotateRads } from "@excalidraw/math";
 
 
-import { getBoundTextElement } from "@excalidraw/element/textElement";
-import {
-  isFrameLikeElement,
-  isTextElement,
-} from "@excalidraw/element/typeChecks";
+import { getBoundTextElement } from "@excalidraw/element";
+import { isFrameLikeElement, isTextElement } from "@excalidraw/element";
 
 
 import {
 import {
   getSelectedGroupIds,
   getSelectedGroupIds,
   getElementsInGroup,
   getElementsInGroup,
   isInGroup,
   isInGroup,
-} from "@excalidraw/element/groups";
+} from "@excalidraw/element";
+
+import { getFrameChildren } from "@excalidraw/element";
 
 
-import { getFrameChildren } from "@excalidraw/element/frame";
+import { updateBindings } from "@excalidraw/element";
 
 
 import type { Radians } from "@excalidraw/math";
 import type { Radians } from "@excalidraw/math";
 
 
@@ -22,9 +21,7 @@ import type {
   NonDeletedExcalidrawElement,
   NonDeletedExcalidrawElement,
 } from "@excalidraw/element/types";
 } from "@excalidraw/element/types";
 
 
-import type Scene from "@excalidraw/element/Scene";
-
-import { updateBindings } from "../../../element/src/binding";
+import type { Scene } from "@excalidraw/element";
 
 
 import type { AppState } from "../../types";
 import type { AppState } from "../../types";
 
 

+ 6 - 9
packages/excalidraw/components/hyperlink/Hyperlink.tsx

@@ -10,16 +10,13 @@ import {
 
 
 import { EVENT, HYPERLINK_TOOLTIP_DELAY, KEYS } from "@excalidraw/common";
 import { EVENT, HYPERLINK_TOOLTIP_DELAY, KEYS } from "@excalidraw/common";
 
 
-import { getElementAbsoluteCoords } from "@excalidraw/element/bounds";
+import { getElementAbsoluteCoords } from "@excalidraw/element";
 
 
-import { hitElementBoundingBox } from "@excalidraw/element/collision";
+import { hitElementBoundingBox } from "@excalidraw/element";
 
 
-import { isElementLink } from "@excalidraw/element/elementLink";
+import { isElementLink } from "@excalidraw/element";
 
 
-import {
-  getEmbedLink,
-  embeddableURLValidator,
-} from "@excalidraw/element/embeddable";
+import { getEmbedLink, embeddableURLValidator } from "@excalidraw/element";
 
 
 import {
 import {
   sceneCoordsToViewportCoords,
   sceneCoordsToViewportCoords,
@@ -29,9 +26,9 @@ import {
   normalizeLink,
   normalizeLink,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import { isEmbeddableElement } from "@excalidraw/element/typeChecks";
+import { isEmbeddableElement } from "@excalidraw/element";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import type {
 import type {
   ElementsMap,
   ElementsMap,

+ 4 - 4
packages/excalidraw/components/hyperlink/helpers.ts

@@ -1,14 +1,14 @@
 import { pointFrom, pointRotateRads } from "@excalidraw/math";
 import { pointFrom, pointRotateRads } from "@excalidraw/math";
 
 
 import { MIME_TYPES } from "@excalidraw/common";
 import { MIME_TYPES } from "@excalidraw/common";
-import { getElementAbsoluteCoords } from "@excalidraw/element/bounds";
-import { hitElementBoundingBox } from "@excalidraw/element/collision";
+import { getElementAbsoluteCoords } from "@excalidraw/element";
+import { hitElementBoundingBox } from "@excalidraw/element";
 
 
-import { DEFAULT_LINK_SIZE } from "@excalidraw/element/renderElement";
+import { DEFAULT_LINK_SIZE } from "@excalidraw/element";
 
 
 import type { GlobalPoint, Radians } from "@excalidraw/math";
 import type { GlobalPoint, Radians } from "@excalidraw/math";
 
 
-import type { Bounds } from "@excalidraw/element/bounds";
+import type { Bounds } from "@excalidraw/element";
 import type {
 import type {
   ElementsMap,
   ElementsMap,
   NonDeletedExcalidrawElement,
   NonDeletedExcalidrawElement,

+ 2 - 2
packages/excalidraw/data/index.ts

@@ -10,9 +10,9 @@ import {
 
 
 import { getNonDeletedElements } from "@excalidraw/element";
 import { getNonDeletedElements } from "@excalidraw/element";
 
 
-import { isFrameLikeElement } from "@excalidraw/element/typeChecks";
+import { isFrameLikeElement } from "@excalidraw/element";
 
 
-import { getElementsOverlappingFrame } from "@excalidraw/element/frame";
+import { getElementsOverlappingFrame } from "@excalidraw/element";
 
 
 import type {
 import type {
   ExcalidrawElement,
   ExcalidrawElement,

+ 1 - 1
packages/excalidraw/data/library.ts

@@ -19,7 +19,7 @@ import {
 
 
 import { hashElementsVersion, hashString } from "@excalidraw/element";
 import { hashElementsVersion, hashString } from "@excalidraw/element";
 
 
-import { getCommonBoundingBox } from "@excalidraw/element/bounds";
+import { getCommonBoundingBox } from "@excalidraw/element";
 
 
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 import type { ExcalidrawElement } from "@excalidraw/element/types";
 
 

+ 1 - 1
packages/excalidraw/data/reconcile.ts

@@ -6,7 +6,7 @@ import {
   orderByFractionalIndex,
   orderByFractionalIndex,
   syncInvalidIndices,
   syncInvalidIndices,
   validateFractionalIndices,
   validateFractionalIndices,
-} from "@excalidraw/element/fractionalIndex";
+} from "@excalidraw/element";
 
 
 import type { OrderedExcalidrawElement } from "@excalidraw/element/types";
 import type { OrderedExcalidrawElement } from "@excalidraw/element/types";
 
 

+ 11 - 11
packages/excalidraw/data/restore.ts

@@ -19,15 +19,15 @@ import {
   getLineHeight,
   getLineHeight,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 import { getNonDeletedElements } from "@excalidraw/element";
 import { getNonDeletedElements } from "@excalidraw/element";
-import { normalizeFixedPoint } from "@excalidraw/element/binding";
+import { normalizeFixedPoint } from "@excalidraw/element";
 import {
 import {
   updateElbowArrowPoints,
   updateElbowArrowPoints,
   validateElbowPoints,
   validateElbowPoints,
-} from "@excalidraw/element/elbowArrow";
-import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
-import { bumpVersion } from "@excalidraw/element/mutateElement";
-import { getContainerElement } from "@excalidraw/element/textElement";
-import { detectLineHeight } from "@excalidraw/element/textMeasurements";
+} from "@excalidraw/element";
+import { LinearElementEditor } from "@excalidraw/element";
+import { bumpVersion } from "@excalidraw/element";
+import { getContainerElement } from "@excalidraw/element";
+import { detectLineHeight } from "@excalidraw/element";
 import {
 import {
   isArrowBoundToElement,
   isArrowBoundToElement,
   isArrowElement,
   isArrowElement,
@@ -36,15 +36,15 @@ import {
   isLinearElement,
   isLinearElement,
   isTextElement,
   isTextElement,
   isUsingAdaptiveRadius,
   isUsingAdaptiveRadius,
-} from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
 
 
-import { syncInvalidIndices } from "@excalidraw/element/fractionalIndex";
+import { syncInvalidIndices } from "@excalidraw/element";
 
 
-import { refreshTextDimensions } from "@excalidraw/element/newElement";
+import { refreshTextDimensions } from "@excalidraw/element";
 
 
-import { getNormalizedDimensions } from "@excalidraw/element/sizeHelpers";
+import { getNormalizedDimensions } from "@excalidraw/element";
 
 
-import { isInvisiblySmallElement } from "@excalidraw/element/sizeHelpers";
+import { isInvisiblySmallElement } from "@excalidraw/element";
 
 
 import type { LocalPoint, Radians } from "@excalidraw/math";
 import type { LocalPoint, Radians } from "@excalidraw/math";
 
 

+ 10 - 13
packages/excalidraw/data/transform.ts

@@ -16,7 +16,7 @@ import {
   getLineHeight,
   getLineHeight,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import { bindLinearElement } from "@excalidraw/element/binding";
+import { bindLinearElement } from "@excalidraw/element";
 import {
 import {
   newArrowElement,
   newArrowElement,
   newElement,
   newElement,
@@ -25,24 +25,21 @@ import {
   newLinearElement,
   newLinearElement,
   newMagicFrameElement,
   newMagicFrameElement,
   newTextElement,
   newTextElement,
-} from "@excalidraw/element/newElement";
-import {
-  measureText,
-  normalizeText,
-} from "@excalidraw/element/textMeasurements";
-import { isArrowElement } from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
+import { measureText, normalizeText } from "@excalidraw/element";
+import { isArrowElement } from "@excalidraw/element";
 
 
-import { syncInvalidIndices } from "@excalidraw/element/fractionalIndex";
+import { syncInvalidIndices } from "@excalidraw/element";
 
 
-import { redrawTextBoundingBox } from "@excalidraw/element/textElement";
+import { redrawTextBoundingBox } from "@excalidraw/element";
 
 
-import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
+import { LinearElementEditor } from "@excalidraw/element";
 
 
-import { getCommonBounds } from "@excalidraw/element/bounds";
+import { getCommonBounds } from "@excalidraw/element";
 
 
-import Scene from "@excalidraw/element/Scene";
+import { Scene } from "@excalidraw/element";
 
 
-import type { ElementConstructorOpts } from "@excalidraw/element/newElement";
+import type { ElementConstructorOpts } from "@excalidraw/element";
 
 
 import type {
 import type {
   ExcalidrawArrowElement,
   ExcalidrawArrowElement,

+ 6 - 9
packages/excalidraw/eraser/index.ts

@@ -1,21 +1,18 @@
 import { arrayToMap, easeOut, THEME } from "@excalidraw/common";
 import { arrayToMap, easeOut, THEME } from "@excalidraw/common";
-import { getElementLineSegments } from "@excalidraw/element/bounds";
+import { getElementLineSegments } from "@excalidraw/element";
 import {
 import {
   lineSegment,
   lineSegment,
   lineSegmentIntersectionPoints,
   lineSegmentIntersectionPoints,
   pointFrom,
   pointFrom,
 } from "@excalidraw/math";
 } from "@excalidraw/math";
 
 
-import { getElementsInGroup } from "@excalidraw/element/groups";
+import { getElementsInGroup } from "@excalidraw/element";
 
 
-import { getElementShape } from "@excalidraw/element/shapes";
-import { shouldTestInside } from "@excalidraw/element/collision";
+import { getElementShape } from "@excalidraw/element";
+import { shouldTestInside } from "@excalidraw/element";
 import { isPointInShape } from "@excalidraw/utils/collision";
 import { isPointInShape } from "@excalidraw/utils/collision";
-import {
-  hasBoundTextElement,
-  isBoundToContainer,
-} from "@excalidraw/element/typeChecks";
-import { getBoundTextElementId } from "@excalidraw/element/textElement";
+import { hasBoundTextElement, isBoundToContainer } from "@excalidraw/element";
+import { getBoundTextElementId } from "@excalidraw/element";
 
 
 import type { GeometricShape } from "@excalidraw/utils/shape";
 import type { GeometricShape } from "@excalidraw/utils/shape";
 import type {
 import type {

+ 6 - 6
packages/excalidraw/fonts/Fonts.ts

@@ -5,9 +5,9 @@ import {
   WINDOWS_EMOJI_FALLBACK_FONT,
   WINDOWS_EMOJI_FALLBACK_FONT,
   getFontFamilyFallbacks,
   getFontFamilyFallbacks,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
-import { getContainerElement } from "@excalidraw/element/textElement";
-import { charWidth } from "@excalidraw/element/textMeasurements";
-import { containsCJK } from "@excalidraw/element/textWrapping";
+import { getContainerElement } from "@excalidraw/element";
+import { charWidth } from "@excalidraw/element";
+import { containsCJK } from "@excalidraw/element";
 
 
 import {
 import {
   FONT_METADATA,
   FONT_METADATA,
@@ -17,9 +17,9 @@ import {
   promiseTry,
   promiseTry,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import { ShapeCache } from "@excalidraw/element/ShapeCache";
+import { ShapeCache } from "@excalidraw/element";
 
 
-import { isTextElement } from "@excalidraw/element/typeChecks";
+import { isTextElement } from "@excalidraw/element";
 
 
 import type {
 import type {
   ExcalidrawElement,
   ExcalidrawElement,
@@ -28,7 +28,7 @@ import type {
 
 
 import type { ValueOf } from "@excalidraw/common/utility-types";
 import type { ValueOf } from "@excalidraw/common/utility-types";
 
 
-import type Scene from "@excalidraw/element/Scene";
+import type { Scene } from "@excalidraw/element";
 
 
 import { CascadiaFontFaces } from "./Cascadia";
 import { CascadiaFontFaces } from "./Cascadia";
 import { ComicShannsFontFaces } from "./ComicShanns";
 import { ComicShannsFontFaces } from "./ComicShanns";

+ 1 - 1
packages/excalidraw/history.ts

@@ -5,7 +5,7 @@ import {
   StoreChange,
   StoreChange,
   StoreDelta,
   StoreDelta,
   type Store,
   type Store,
-} from "@excalidraw/element/store";
+} from "@excalidraw/element";
 
 
 import type { SceneElementsMap } from "@excalidraw/element/types";
 import type { SceneElementsMap } from "@excalidraw/element/types";
 
 

+ 9 - 12
packages/excalidraw/index.tsx

@@ -222,8 +222,8 @@ export {
   getNonDeletedElements,
   getNonDeletedElements,
 } from "@excalidraw/element";
 } from "@excalidraw/element";
 
 
-export { getTextFromElements } from "@excalidraw/element/textElement";
-export { isInvisiblySmallElement } from "@excalidraw/element/sizeHelpers";
+export { getTextFromElements } from "@excalidraw/element";
+export { isInvisiblySmallElement } from "@excalidraw/element";
 
 
 export { defaultLang, useI18n, languages } from "./i18n";
 export { defaultLang, useI18n, languages } from "./i18n";
 export {
 export {
@@ -248,9 +248,9 @@ export {
   loadSceneOrLibraryFromBlob,
   loadSceneOrLibraryFromBlob,
   loadLibraryFromBlob,
   loadLibraryFromBlob,
 } from "./data/blob";
 } from "./data/blob";
-export { getFreeDrawSvgPath } from "@excalidraw/element/renderElement";
+export { getFreeDrawSvgPath } from "@excalidraw/element";
 export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
 export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
-export { isLinearElement } from "@excalidraw/element/typeChecks";
+export { isLinearElement } from "@excalidraw/element";
 
 
 export {
 export {
   FONT_FAMILY,
   FONT_FAMILY,
@@ -266,9 +266,9 @@ export {
   mutateElement,
   mutateElement,
   newElementWith,
   newElementWith,
   bumpVersion,
   bumpVersion,
-} from "@excalidraw/element/mutateElement";
+} from "@excalidraw/element";
 
 
-export { CaptureUpdateAction } from "@excalidraw/element/store";
+export { CaptureUpdateAction } from "@excalidraw/element";
 
 
 export { parseLibraryTokensFromUrl, useHandleLibrary } from "./data/library";
 export { parseLibraryTokensFromUrl, useHandleLibrary } from "./data/library";
 
 
@@ -292,10 +292,7 @@ export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger";
 
 
 export { zoomToFitBounds } from "./actions/actionCanvas";
 export { zoomToFitBounds } from "./actions/actionCanvas";
 export { convertToExcalidrawElements } from "./data/transform";
 export { convertToExcalidrawElements } from "./data/transform";
-export {
-  getCommonBounds,
-  getVisibleSceneBounds,
-} from "@excalidraw/element/bounds";
+export { getCommonBounds, getVisibleSceneBounds } from "@excalidraw/element";
 
 
 export {
 export {
   elementsOverlappingBBox,
   elementsOverlappingBBox,
@@ -305,6 +302,6 @@ export {
 
 
 export { DiagramToCodePlugin } from "./components/DiagramToCodePlugin/DiagramToCodePlugin";
 export { DiagramToCodePlugin } from "./components/DiagramToCodePlugin/DiagramToCodePlugin";
 export { getDataURL } from "./data/blob";
 export { getDataURL } from "./data/blob";
-export { isElementLink } from "@excalidraw/element/elementLink";
+export { isElementLink } from "@excalidraw/element";
 
 
-export { setCustomTextMetricsProvider } from "@excalidraw/element/textMeasurements";
+export { setCustomTextMetricsProvider } from "@excalidraw/element";

+ 6 - 6
packages/excalidraw/lasso/index.ts

@@ -4,18 +4,18 @@ import {
   pointFrom,
   pointFrom,
 } from "@excalidraw/math";
 } from "@excalidraw/math";
 
 
-import { getElementLineSegments } from "@excalidraw/element/bounds";
-import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
+import { getElementLineSegments } from "@excalidraw/element";
+import { LinearElementEditor } from "@excalidraw/element";
 import {
 import {
   isFrameLikeElement,
   isFrameLikeElement,
   isLinearElement,
   isLinearElement,
   isTextElement,
   isTextElement,
-} from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
 
 
-import { getFrameChildren } from "@excalidraw/element/frame";
-import { selectGroupsForSelectedElements } from "@excalidraw/element/groups";
+import { getFrameChildren } from "@excalidraw/element";
+import { selectGroupsForSelectedElements } from "@excalidraw/element";
 
 
-import { getContainerElement } from "@excalidraw/element/textElement";
+import { getContainerElement } from "@excalidraw/element";
 
 
 import { arrayToMap, easeOut } from "@excalidraw/common";
 import { arrayToMap, easeOut } from "@excalidraw/common";
 
 

+ 3 - 3
packages/excalidraw/renderer/helpers.ts

@@ -1,8 +1,8 @@
 import { elementCenterPoint, THEME, THEME_FILTER } from "@excalidraw/common";
 import { elementCenterPoint, THEME, THEME_FILTER } from "@excalidraw/common";
 
 
-import { FIXED_BINDING_DISTANCE } from "@excalidraw/element/binding";
-import { getDiamondPoints } from "@excalidraw/element/bounds";
-import { getCornerRadius } from "@excalidraw/element/shapes";
+import { FIXED_BINDING_DISTANCE } from "@excalidraw/element";
+import { getDiamondPoints } from "@excalidraw/element";
+import { getCornerRadius } from "@excalidraw/element";
 
 
 import {
 import {
   bezierEquation,
   bezierEquation,

+ 9 - 15
packages/excalidraw/renderer/interactiveScene.ts

@@ -15,48 +15,42 @@ import {
   throttleRAF,
   throttleRAF,
 } from "@excalidraw/common";
 } from "@excalidraw/common";
 
 
-import {
-  FIXED_BINDING_DISTANCE,
-  maxBindingGap,
-} from "@excalidraw/element/binding";
-import { LinearElementEditor } from "@excalidraw/element/linearElementEditor";
+import { FIXED_BINDING_DISTANCE, maxBindingGap } from "@excalidraw/element";
+import { LinearElementEditor } from "@excalidraw/element";
 import {
 import {
   getOmitSidesForDevice,
   getOmitSidesForDevice,
   getTransformHandles,
   getTransformHandles,
   getTransformHandlesFromCoords,
   getTransformHandlesFromCoords,
   shouldShowBoundingBox,
   shouldShowBoundingBox,
-} from "@excalidraw/element/transformHandles";
+} from "@excalidraw/element";
 import {
 import {
   isElbowArrow,
   isElbowArrow,
   isFrameLikeElement,
   isFrameLikeElement,
   isImageElement,
   isImageElement,
   isLinearElement,
   isLinearElement,
   isTextElement,
   isTextElement,
-} from "@excalidraw/element/typeChecks";
+} from "@excalidraw/element";
 
 
-import { renderSelectionElement } from "@excalidraw/element/renderElement";
+import { renderSelectionElement } from "@excalidraw/element";
 
 
 import {
 import {
   getElementsInGroup,
   getElementsInGroup,
   getSelectedGroupIds,
   getSelectedGroupIds,
   isSelectedViaGroup,
   isSelectedViaGroup,
   selectGroupsFromGivenElements,
   selectGroupsFromGivenElements,
-} from "@excalidraw/element/groups";
+} from "@excalidraw/element";
 
 
-import {
-  getCommonBounds,
-  getElementAbsoluteCoords,
-} from "@excalidraw/element/bounds";
+import { getCommonBounds, getElementAbsoluteCoords } from "@excalidraw/element";
 
 
 import type {
 import type {
   SuggestedBinding,
   SuggestedBinding,
   SuggestedPointBinding,
   SuggestedPointBinding,
-} from "@excalidraw/element/binding";
+} from "@excalidraw/element";
 
 
 import type {
 import type {
   TransformHandles,
   TransformHandles,
   TransformHandleType,
   TransformHandleType,
-} from "@excalidraw/element/transformHandles";
+} from "@excalidraw/element";
 
 
 import type {
 import type {
   ElementsMap,
   ElementsMap,

+ 1 - 1
packages/excalidraw/renderer/renderNewElementScene.ts

@@ -1,6 +1,6 @@
 import { throttleRAF } from "@excalidraw/common";
 import { throttleRAF } from "@excalidraw/common";
 
 
-import { renderElement } from "@excalidraw/element/renderElement";
+import { renderElement } from "@excalidraw/element";
 
 
 import { bootstrapCanvas, getNormalizedCanvasDimensions } from "./helpers";
 import { bootstrapCanvas, getNormalizedCanvasDimensions } from "./helpers";
 
 

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini