diff --git a/excalidraw-app/App.tsx b/excalidraw-app/App.tsx index bb62a0e96c..932743ddfd 100644 --- a/excalidraw-app/App.tsx +++ b/excalidraw-app/App.tsx @@ -47,10 +47,10 @@ import { share, youtubeIcon, } 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 { 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 { parseLibraryTokensFromUrl, diff --git a/excalidraw-app/collab/Collab.tsx b/excalidraw-app/collab/Collab.tsx index 98c66e4257..bed130e24a 100644 --- a/excalidraw-app/collab/Collab.tsx +++ b/excalidraw-app/collab/Collab.tsx @@ -19,12 +19,9 @@ import { throttleRAF, } from "@excalidraw/common"; 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 { t } from "@excalidraw/excalidraw/i18n"; import { withBatchedUpdates } from "@excalidraw/excalidraw/reactUtils"; diff --git a/excalidraw-app/collab/Portal.tsx b/excalidraw-app/collab/Portal.tsx index 26a7d0d9e0..2e076a661e 100644 --- a/excalidraw-app/collab/Portal.tsx +++ b/excalidraw-app/collab/Portal.tsx @@ -1,7 +1,7 @@ import { CaptureUpdateAction } from "@excalidraw/excalidraw"; import { trackEvent } from "@excalidraw/excalidraw/analytics"; import { encryptData } from "@excalidraw/excalidraw/data/encryption"; -import { newElementWith } from "@excalidraw/element/mutateElement"; +import { newElementWith } from "@excalidraw/element"; import throttle from "lodash.throttle"; import type { UserIdleState } from "@excalidraw/common"; diff --git a/excalidraw-app/components/ExportToExcalidrawPlus.tsx b/excalidraw-app/components/ExportToExcalidrawPlus.tsx index 60f1608b26..0e9703a107 100644 --- a/excalidraw-app/components/ExportToExcalidrawPlus.tsx +++ b/excalidraw-app/components/ExportToExcalidrawPlus.tsx @@ -12,7 +12,7 @@ import { generateEncryptionKey, } from "@excalidraw/excalidraw/data/encryption"; 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 type { diff --git a/excalidraw-app/data/FileManager.ts b/excalidraw-app/data/FileManager.ts index 5d134144fd..435d813252 100644 --- a/excalidraw-app/data/FileManager.ts +++ b/excalidraw-app/data/FileManager.ts @@ -1,7 +1,7 @@ import { CaptureUpdateAction } from "@excalidraw/excalidraw"; 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 type { diff --git a/excalidraw-app/data/index.ts b/excalidraw-app/data/index.ts index 7bb0f9d8d7..75aa278779 100644 --- a/excalidraw-app/data/index.ts +++ b/excalidraw-app/data/index.ts @@ -9,14 +9,14 @@ import { } from "@excalidraw/excalidraw/data/encryption"; import { serializeAsJSON } from "@excalidraw/excalidraw/data/json"; 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 { bytesToHexString } from "@excalidraw/common"; import type { UserIdleState } from "@excalidraw/common"; import type { ImportedDataState } from "@excalidraw/excalidraw/data/types"; -import type { SceneBounds } from "@excalidraw/element/bounds"; +import type { SceneBounds } from "@excalidraw/element"; import type { ExcalidrawElement, FileId, diff --git a/excalidraw-app/tests/collab.test.tsx b/excalidraw-app/tests/collab.test.tsx index 3572303f43..c22b83e53c 100644 --- a/excalidraw-app/tests/collab.test.tsx +++ b/excalidraw-app/tests/collab.test.tsx @@ -3,7 +3,7 @@ import { createRedoAction, createUndoAction, } 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 { act, render, waitFor } from "@excalidraw/excalidraw/tests/test-utils"; import { vi } from "vitest"; diff --git a/packages/element/src/Scene.ts b/packages/element/src/Scene.ts index b35c54cae1..26e15125db 100644 --- a/packages/element/src/Scene.ts +++ b/packages/element/src/Scene.ts @@ -9,22 +9,19 @@ import { isReadonlyArray, } from "@excalidraw/common"; 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 { orderByFractionalIndex, syncInvalidIndices, syncMovedIndices, 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 { ExcalidrawElement, @@ -109,7 +106,7 @@ const hashSelectionOpts = ( // in our codebase export type ExcalidrawElementsIncludingDeleted = readonly ExcalidrawElement[]; -class Scene { +export class Scene { // --------------------------------------------------------------------------- // instance methods/props // --------------------------------------------------------------------------- @@ -464,5 +461,3 @@ class Scene { return element; } } - -export default Scene; diff --git a/packages/element/src/align.ts b/packages/element/src/align.ts index b6dd4d4548..546bbbfa48 100644 --- a/packages/element/src/align.ts +++ b/packages/element/src/align.ts @@ -2,7 +2,7 @@ import { updateBoundElements } from "./binding"; import { getCommonBoundingBox } from "./bounds"; import { getMaximumGroups } from "./groups"; -import type Scene from "./Scene"; +import type { Scene } from "./Scene"; import type { BoundingBox } from "./bounds"; import type { ExcalidrawElement } from "./types"; diff --git a/packages/element/src/binding.ts b/packages/element/src/binding.ts index ee5d037a8c..49a30dde9d 100644 --- a/packages/element/src/binding.ts +++ b/packages/element/src/binding.ts @@ -66,7 +66,7 @@ import { import { aabbForElement, getElementShape, pointInsideBounds } from "./shapes"; import { updateElbowArrowPoints } from "./elbowArrow"; -import type Scene from "./Scene"; +import type { Scene } from "./Scene"; import type { Bounds } from "./bounds"; import type { ElementUpdate } from "./mutateElement"; diff --git a/packages/element/src/dragElements.ts b/packages/element/src/dragElements.ts index 4f9eb9ca4c..4b17ba20c3 100644 --- a/packages/element/src/dragElements.ts +++ b/packages/element/src/dragElements.ts @@ -26,7 +26,7 @@ import { isTextElement, } from "./typeChecks"; -import type Scene from "./Scene"; +import type { Scene } from "./Scene"; import type { Bounds } from "./bounds"; import type { ExcalidrawElement } from "./types"; diff --git a/packages/element/src/flowchart.ts b/packages/element/src/flowchart.ts index 62acd1c4ea..489c8f6d79 100644 --- a/packages/element/src/flowchart.ts +++ b/packages/element/src/flowchart.ts @@ -39,7 +39,7 @@ import { type OrderedExcalidrawElement, } from "./types"; -import type Scene from "./Scene"; +import type { Scene } from "./Scene"; type LinkDirection = "up" | "right" | "down" | "left"; diff --git a/packages/element/src/index.ts b/packages/element/src/index.ts index d7edec8ae9..6160fbf0d9 100644 --- a/packages/element/src/index.ts +++ b/packages/element/src/index.ts @@ -71,3 +71,45 @@ export const clearElementsForExport = ( export const clearElementsForLocalStorage = ( elements: readonly ExcalidrawElement[], ) => _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 "./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 "./textElement"; +export * from "./textMeasurements"; +export * from "./textWrapping"; +export * from "./transformHandles"; +export * from "./typeChecks"; +export * from "./utils"; +export * from "./zindex"; diff --git a/packages/element/src/linearElementEditor.ts b/packages/element/src/linearElementEditor.ts index 55e3f5c4f7..105a7bd925 100644 --- a/packages/element/src/linearElementEditor.ts +++ b/packages/element/src/linearElementEditor.ts @@ -67,7 +67,7 @@ import { import { getLockedLinearCursorAlignSize } from "./sizeHelpers"; -import type Scene from "./Scene"; +import type { Scene } from "./Scene"; import type { Bounds } from "./bounds"; import type { diff --git a/packages/element/src/resizeElements.ts b/packages/element/src/resizeElements.ts index 8a1702afac..3b6c4f9d9e 100644 --- a/packages/element/src/resizeElements.ts +++ b/packages/element/src/resizeElements.ts @@ -57,7 +57,7 @@ import { import { isInGroup } from "./groups"; -import type Scene from "./Scene"; +import type { Scene } from "./Scene"; import type { BoundingBox } from "./bounds"; import type { diff --git a/packages/element/src/textElement.ts b/packages/element/src/textElement.ts index 8ec0ef426a..46b728158d 100644 --- a/packages/element/src/textElement.ts +++ b/packages/element/src/textElement.ts @@ -30,7 +30,7 @@ import { isTextElement, } from "./typeChecks"; -import type Scene from "./Scene"; +import type { Scene } from "./Scene"; import type { MaybeTransformHandleType } from "./transformHandles"; import type { diff --git a/packages/element/src/zindex.ts b/packages/element/src/zindex.ts index b99cf833cc..fed9378253 100644 --- a/packages/element/src/zindex.ts +++ b/packages/element/src/zindex.ts @@ -10,7 +10,7 @@ import { syncMovedIndices } from "./fractionalIndex"; import { getSelectedElements } from "./selection"; -import type Scene from "./Scene"; +import type { Scene } from "./Scene"; import type { ExcalidrawElement, ExcalidrawFrameLikeElement } from "./types"; diff --git a/packages/element/tests/elbowArrow.test.tsx b/packages/element/tests/elbowArrow.test.tsx index 25f64072e7..b279e596c2 100644 --- a/packages/element/tests/elbowArrow.test.tsx +++ b/packages/element/tests/elbowArrow.test.tsx @@ -22,7 +22,7 @@ import type { LocalPoint } from "@excalidraw/math"; import { bindLinearElement } from "../src/binding"; -import Scene from "../src/Scene"; +import { Scene } from "../src/Scene"; import type { ExcalidrawArrowElement, diff --git a/packages/element/tests/fractionalIndex.test.ts b/packages/element/tests/fractionalIndex.test.ts index c8cc9ad2d1..1cc3ca5af3 100644 --- a/packages/element/tests/fractionalIndex.test.ts +++ b/packages/element/tests/fractionalIndex.test.ts @@ -7,9 +7,9 @@ import { syncInvalidIndices, syncMovedIndices, 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"; diff --git a/packages/element/tests/sortElements.test.ts b/packages/element/tests/sortElements.test.ts index 1735a6bece..0928b84f29 100644 --- a/packages/element/tests/sortElements.test.ts +++ b/packages/element/tests/sortElements.test.ts @@ -1,6 +1,6 @@ import { API } from "@excalidraw/excalidraw/tests/helpers/api"; -import { mutateElement } from "@excalidraw/element/mutateElement"; +import { mutateElement } from "@excalidraw/element"; import { normalizeElementOrder } from "../src/sortElements"; diff --git a/packages/excalidraw/actions/actionAddToLibrary.ts b/packages/excalidraw/actions/actionAddToLibrary.ts index 9216e52c23..e8ba3666d4 100644 --- a/packages/excalidraw/actions/actionAddToLibrary.ts +++ b/packages/excalidraw/actions/actionAddToLibrary.ts @@ -1,5 +1,5 @@ import { LIBRARY_DISABLED_TYPES, randomId } from "@excalidraw/common"; -import { deepCopyElement } from "@excalidraw/element/duplicate"; +import { deepCopyElement } from "@excalidraw/element"; import { t } from "../i18n"; import { CaptureUpdateAction } from "../store"; diff --git a/packages/excalidraw/actions/actionAlign.tsx b/packages/excalidraw/actions/actionAlign.tsx index 0ef938c67f..a9e6086dfa 100644 --- a/packages/excalidraw/actions/actionAlign.tsx +++ b/packages/excalidraw/actions/actionAlign.tsx @@ -1,16 +1,16 @@ 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 { alignElements } from "@excalidraw/element/align"; +import { alignElements } from "@excalidraw/element"; 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 { diff --git a/packages/excalidraw/actions/actionBoundText.tsx b/packages/excalidraw/actions/actionBoundText.tsx index c7843656cf..59b783e321 100644 --- a/packages/excalidraw/actions/actionBoundText.tsx +++ b/packages/excalidraw/actions/actionBoundText.tsx @@ -10,14 +10,14 @@ import { getOriginalContainerHeightFromCache, resetOriginalContainerCache, updateOriginalContainerCache, -} from "@excalidraw/element/containerCache"; +} from "@excalidraw/element"; import { computeBoundTextPosition, computeContainerDimensionForBoundText, getBoundTextElement, redrawTextBoundingBox, -} from "@excalidraw/element/textElement"; +} from "@excalidraw/element"; import { hasBoundTextElement, @@ -25,13 +25,13 @@ import { isTextBindableContainer, isTextElement, 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 type { ExcalidrawElement, diff --git a/packages/excalidraw/actions/actionCanvas.tsx b/packages/excalidraw/actions/actionCanvas.tsx index a8bd56e820..6548fa3d12 100644 --- a/packages/excalidraw/actions/actionCanvas.tsx +++ b/packages/excalidraw/actions/actionCanvas.tsx @@ -14,8 +14,8 @@ import { } from "@excalidraw/common"; 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 type { ExcalidrawElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/actions/actionClipboard.tsx b/packages/excalidraw/actions/actionClipboard.tsx index 9de6d70f47..232d6ee853 100644 --- a/packages/excalidraw/actions/actionClipboard.tsx +++ b/packages/excalidraw/actions/actionClipboard.tsx @@ -1,5 +1,5 @@ -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"; diff --git a/packages/excalidraw/actions/actionCropEditor.tsx b/packages/excalidraw/actions/actionCropEditor.tsx index 1a7b6da696..e496c642b9 100644 --- a/packages/excalidraw/actions/actionCropEditor.tsx +++ b/packages/excalidraw/actions/actionCropEditor.tsx @@ -1,4 +1,4 @@ -import { isImageElement } from "@excalidraw/element/typeChecks"; +import { isImageElement } from "@excalidraw/element"; import type { ExcalidrawImageElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/actions/actionDeleteSelected.tsx b/packages/excalidraw/actions/actionDeleteSelected.tsx index e183d05f49..4375ab5f39 100644 --- a/packages/excalidraw/actions/actionDeleteSelected.tsx +++ b/packages/excalidraw/actions/actionDeleteSelected.tsx @@ -1,21 +1,21 @@ import { KEYS, updateActiveTool } from "@excalidraw/common"; 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 { isBoundToContainer, isElbowArrow, isFrameLikeElement, -} from "@excalidraw/element/typeChecks"; -import { getFrameChildren } from "@excalidraw/element/frame"; +} from "@excalidraw/element"; +import { getFrameChildren } from "@excalidraw/element"; import { getElementsInGroup, selectGroupsForSelectedElements, -} from "@excalidraw/element/groups"; +} from "@excalidraw/element"; import type { ExcalidrawElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/actions/actionDistribute.tsx b/packages/excalidraw/actions/actionDistribute.tsx index 9f05ab6bfa..48d584cf07 100644 --- a/packages/excalidraw/actions/actionDistribute.tsx +++ b/packages/excalidraw/actions/actionDistribute.tsx @@ -1,16 +1,16 @@ 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 { updateFrameMembershipOfSelectedElements } from "@excalidraw/element/frame"; +import { updateFrameMembershipOfSelectedElements } from "@excalidraw/element"; -import { distributeElements } from "@excalidraw/element/distribute"; +import { distributeElements } from "@excalidraw/element"; 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 { diff --git a/packages/excalidraw/actions/actionDuplicateSelection.tsx b/packages/excalidraw/actions/actionDuplicateSelection.tsx index 034edf5438..99ead82242 100644 --- a/packages/excalidraw/actions/actionDuplicateSelection.tsx +++ b/packages/excalidraw/actions/actionDuplicateSelection.tsx @@ -7,16 +7,16 @@ import { import { getNonDeletedElements } from "@excalidraw/element"; -import { LinearElementEditor } from "@excalidraw/element/linearElementEditor"; +import { LinearElementEditor } from "@excalidraw/element"; import { getSelectedElements, 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 { ToolButton } from "../components/ToolButton"; import { DuplicateIcon } from "../components/icons"; diff --git a/packages/excalidraw/actions/actionElementLink.ts b/packages/excalidraw/actions/actionElementLink.ts index 24ea8bbd65..41b810c41d 100644 --- a/packages/excalidraw/actions/actionElementLink.ts +++ b/packages/excalidraw/actions/actionElementLink.ts @@ -2,7 +2,7 @@ import { canCreateLinkFromElements, defaultGetElementLinkFromSelection, getLinkIdAndTypeFromSelection, -} from "@excalidraw/element/elementLink"; +} from "@excalidraw/element"; import { copyTextToSystemClipboard } from "../clipboard"; import { copyIcon, elementLinkIcon } from "../components/icons"; diff --git a/packages/excalidraw/actions/actionElementLock.ts b/packages/excalidraw/actions/actionElementLock.ts index 6bc238a59b..76d5478f2f 100644 --- a/packages/excalidraw/actions/actionElementLock.ts +++ b/packages/excalidraw/actions/actionElementLock.ts @@ -1,8 +1,8 @@ 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 type { ExcalidrawElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/actions/actionFinalize.tsx b/packages/excalidraw/actions/actionFinalize.tsx index 22638ee917..545c8a53dd 100644 --- a/packages/excalidraw/actions/actionFinalize.tsx +++ b/packages/excalidraw/actions/actionFinalize.tsx @@ -3,18 +3,15 @@ import { pointFrom } from "@excalidraw/math"; import { maybeBindLinearElement, 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 { isPathALoop } from "@excalidraw/element/shapes"; +import { isPathALoop } from "@excalidraw/element"; -import { isInvisiblySmallElement } from "@excalidraw/element/sizeHelpers"; +import { isInvisiblySmallElement } from "@excalidraw/element"; import { t } from "../i18n"; import { resetCursor } from "../cursor"; diff --git a/packages/excalidraw/actions/actionFlip.ts b/packages/excalidraw/actions/actionFlip.ts index becc8a976d..7881fff1c3 100644 --- a/packages/excalidraw/actions/actionFlip.ts +++ b/packages/excalidraw/actions/actionFlip.ts @@ -2,17 +2,17 @@ import { getNonDeletedElements } from "@excalidraw/element"; import { bindOrUnbindLinearElements, 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 { isArrowElement, isElbowArrow, 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 type { diff --git a/packages/excalidraw/actions/actionFrame.ts b/packages/excalidraw/actions/actionFrame.ts index 7882d26f6f..4cc1a7ec47 100644 --- a/packages/excalidraw/actions/actionFrame.ts +++ b/packages/excalidraw/actions/actionFrame.ts @@ -1,18 +1,18 @@ 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 { addElementsToFrame, 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 { getElementsInGroup } from "@excalidraw/element/groups"; +import { getElementsInGroup } from "@excalidraw/element"; -import { getCommonBounds } from "@excalidraw/element/bounds"; +import { getCommonBounds } from "@excalidraw/element"; import type { ExcalidrawElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/actions/actionGroup.tsx b/packages/excalidraw/actions/actionGroup.tsx index 6b47ef969d..2eac90a721 100644 --- a/packages/excalidraw/actions/actionGroup.tsx +++ b/packages/excalidraw/actions/actionGroup.tsx @@ -1,8 +1,8 @@ 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 { frameAndChildrenSelectedTogether, @@ -12,7 +12,7 @@ import { groupByFrameLikes, removeElementsFromFrame, replaceAllElementsInFrame, -} from "@excalidraw/element/frame"; +} from "@excalidraw/element"; import { KEYS, randomId, arrayToMap, getShortcutKey } from "@excalidraw/common"; @@ -24,9 +24,9 @@ import { addToGroup, removeFromSelectedGroups, isElementInGroup, -} from "@excalidraw/element/groups"; +} from "@excalidraw/element"; -import { syncMovedIndices } from "@excalidraw/element/fractionalIndex"; +import { syncMovedIndices } from "@excalidraw/element"; import type { ExcalidrawElement, diff --git a/packages/excalidraw/actions/actionLinearEditor.tsx b/packages/excalidraw/actions/actionLinearEditor.tsx index 1645554bf7..4c77276ea6 100644 --- a/packages/excalidraw/actions/actionLinearEditor.tsx +++ b/packages/excalidraw/actions/actionLinearEditor.tsx @@ -1,6 +1,6 @@ -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"; diff --git a/packages/excalidraw/actions/actionLink.tsx b/packages/excalidraw/actions/actionLink.tsx index 71426267d1..a9ab5da401 100644 --- a/packages/excalidraw/actions/actionLink.tsx +++ b/packages/excalidraw/actions/actionLink.tsx @@ -1,4 +1,4 @@ -import { isEmbeddableElement } from "@excalidraw/element/typeChecks"; +import { isEmbeddableElement } from "@excalidraw/element"; import { KEYS, getShortcutKey } from "@excalidraw/common"; diff --git a/packages/excalidraw/actions/actionMenu.tsx b/packages/excalidraw/actions/actionMenu.tsx index 67863e0208..8449398773 100644 --- a/packages/excalidraw/actions/actionMenu.tsx +++ b/packages/excalidraw/actions/actionMenu.tsx @@ -2,7 +2,7 @@ import { KEYS } from "@excalidraw/common"; import { getNonDeletedElements } from "@excalidraw/element"; -import { showSelectedShapeActions } from "@excalidraw/element/showSelectedShapeActions"; +import { showSelectedShapeActions } from "@excalidraw/element"; import { ToolButton } from "../components/ToolButton"; import { HamburgerMenuIcon, HelpIconThin, palette } from "../components/icons"; diff --git a/packages/excalidraw/actions/actionProperties.tsx b/packages/excalidraw/actions/actionProperties.tsx index df07960aff..f3730d7be8 100644 --- a/packages/excalidraw/actions/actionProperties.tsx +++ b/packages/excalidraw/actions/actionProperties.tsx @@ -30,16 +30,16 @@ import { calculateFixedPointForElbowArrowBinding, getHoveredElementForBinding, 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 { getBoundTextElement, redrawTextBoundingBox, -} from "@excalidraw/element/textElement"; +} from "@excalidraw/element"; import { isArrowElement, @@ -48,11 +48,11 @@ import { isLinearElement, isTextElement, 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 type { LocalPoint } from "@excalidraw/math"; @@ -68,7 +68,7 @@ import type { VerticalAlign, } from "@excalidraw/element/types"; -import type Scene from "@excalidraw/element/Scene"; +import type Scene from "@excalidraw/element"; import { trackEvent } from "../analytics"; import { ButtonIconSelect } from "../components/ButtonIconSelect"; diff --git a/packages/excalidraw/actions/actionSelectAll.ts b/packages/excalidraw/actions/actionSelectAll.ts index ea13636b74..1ae4fbb26a 100644 --- a/packages/excalidraw/actions/actionSelectAll.ts +++ b/packages/excalidraw/actions/actionSelectAll.ts @@ -1,10 +1,10 @@ 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 { selectGroupsForSelectedElements } from "@excalidraw/element/groups"; +import { selectGroupsForSelectedElements } from "@excalidraw/element"; import type { ExcalidrawElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/actions/actionStyles.ts b/packages/excalidraw/actions/actionStyles.ts index 08b32e227f..29d074598e 100644 --- a/packages/excalidraw/actions/actionStyles.ts +++ b/packages/excalidraw/actions/actionStyles.ts @@ -7,7 +7,7 @@ import { getLineHeight, } from "@excalidraw/common"; -import { newElementWith } from "@excalidraw/element/mutateElement"; +import { newElementWith } from "@excalidraw/element"; import { hasBoundTextElement, @@ -17,12 +17,12 @@ import { isArrowElement, isExcalidrawElement, isTextElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; import { getBoundTextElement, redrawTextBoundingBox, -} from "@excalidraw/element/textElement"; +} from "@excalidraw/element"; import type { ExcalidrawTextElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/actions/actionTextAutoResize.ts b/packages/excalidraw/actions/actionTextAutoResize.ts index 4a36cab408..2f8e81ce5b 100644 --- a/packages/excalidraw/actions/actionTextAutoResize.ts +++ b/packages/excalidraw/actions/actionTextAutoResize.ts @@ -1,9 +1,9 @@ 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 { getSelectedElements } from "../scene"; import { CaptureUpdateAction } from "../store"; diff --git a/packages/excalidraw/actions/actionZindex.tsx b/packages/excalidraw/actions/actionZindex.tsx index 8eb5a50f27..89fa502029 100644 --- a/packages/excalidraw/actions/actionZindex.tsx +++ b/packages/excalidraw/actions/actionZindex.tsx @@ -5,7 +5,7 @@ import { moveOneRight, moveAllLeft, moveAllRight, -} from "@excalidraw/element/zindex"; +} from "@excalidraw/element"; import { BringForwardIcon, diff --git a/packages/excalidraw/change.ts b/packages/excalidraw/change.ts index e7ba76f603..a4a481c912 100644 --- a/packages/excalidraw/change.ts +++ b/packages/excalidraw/change.ts @@ -12,36 +12,30 @@ import { BindableElement, bindingProperties, updateBoundElements, -} from "@excalidraw/element/binding"; -import { LinearElementEditor } from "@excalidraw/element/linearElementEditor"; -import { - mutateElement, - newElementWith, -} from "@excalidraw/element/mutateElement"; +} from "@excalidraw/element"; +import { LinearElementEditor } from "@excalidraw/element"; +import { mutateElement, newElementWith } from "@excalidraw/element"; import { getBoundTextElementId, redrawTextBoundingBox, -} from "@excalidraw/element/textElement"; +} from "@excalidraw/element"; import { hasBoundTextElement, isBindableElement, isBoundToContainer, isImageElement, isTextElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; -import { getNonDeletedGroupIds } from "@excalidraw/element/groups"; +import { getNonDeletedGroupIds } from "@excalidraw/element"; -import { - orderByFractionalIndex, - syncMovedIndices, -} from "@excalidraw/element/fractionalIndex"; +import { orderByFractionalIndex, syncMovedIndices } from "@excalidraw/element"; -import Scene from "@excalidraw/element/Scene"; +import { Scene } from "@excalidraw/element"; -import type { BindableProp, BindingProp } from "@excalidraw/element/binding"; +import type { BindableProp, BindingProp } from "@excalidraw/element"; -import type { ElementUpdate } from "@excalidraw/element/mutateElement"; +import type { ElementUpdate } from "@excalidraw/element"; import type { ExcalidrawElement, diff --git a/packages/excalidraw/charts.ts b/packages/excalidraw/charts.ts index 7a221d5473..97ca081553 100644 --- a/packages/excalidraw/charts.ts +++ b/packages/excalidraw/charts.ts @@ -15,7 +15,7 @@ import { newTextElement, newLinearElement, newElement, -} from "@excalidraw/element/newElement"; +} from "@excalidraw/element"; import type { Radians } from "@excalidraw/math"; diff --git a/packages/excalidraw/clipboard.ts b/packages/excalidraw/clipboard.ts index c9ee92cacc..99b7d41f4a 100644 --- a/packages/excalidraw/clipboard.ts +++ b/packages/excalidraw/clipboard.ts @@ -7,14 +7,14 @@ import { isPromiseLike, } 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 { isFrameLikeElement, isInitializedImageElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; -import { getContainingFrame } from "@excalidraw/element/frame"; +import { getContainingFrame } from "@excalidraw/element"; import type { ExcalidrawElement, diff --git a/packages/excalidraw/components/Actions.tsx b/packages/excalidraw/components/Actions.tsx index 3a7df37a85..4f37820484 100644 --- a/packages/excalidraw/components/Actions.tsx +++ b/packages/excalidraw/components/Actions.tsx @@ -11,7 +11,7 @@ import { import { shouldAllowVerticalAlign, suppportsHorizontalAlign, -} from "@excalidraw/element/textElement"; +} from "@excalidraw/element"; import { hasBoundTextElement, @@ -19,9 +19,9 @@ import { isImageElement, isLinearElement, isTextElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; -import { hasStrokeColor, toolIsArrow } from "@excalidraw/element/comparisons"; +import { hasStrokeColor, toolIsArrow } from "@excalidraw/element"; import type { ExcalidrawElement, diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index ddb071981f..e12a1d909a 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -103,10 +103,7 @@ import { CLASSES, } from "@excalidraw/common"; -import { - getCommonBounds, - getElementAbsoluteCoords, -} from "@excalidraw/element/bounds"; +import { getCommonBounds, getElementAbsoluteCoords } from "@excalidraw/element"; import { bindOrUnbindLinearElement, @@ -119,11 +116,11 @@ import { shouldEnableBindingForPointerEvent, updateBoundElements, 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 { newFrameElement, @@ -137,12 +134,9 @@ import { newLinearElement, newTextElement, refreshTextDimensions, -} from "@excalidraw/element/newElement"; +} from "@excalidraw/element"; -import { - deepCopyElement, - duplicateElements, -} from "@excalidraw/element/duplicate"; +import { deepCopyElement, duplicateElements } from "@excalidraw/element"; import { hasBoundTextElement, @@ -165,7 +159,7 @@ import { isFlowchartNodeElement, isBindableElement, isTextElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; import { getLockedLinearCursorAlignSize, @@ -173,28 +167,28 @@ import { isElementCompletelyInViewport, isElementInViewport, isInvisiblySmallElement, -} from "@excalidraw/element/sizeHelpers"; +} from "@excalidraw/element"; import { getBoundTextShape, getCornerRadius, getElementShape, isPathALoop, -} from "@excalidraw/element/shapes"; +} from "@excalidraw/element"; import { createSrcDoc, embeddableURLValidator, maybeParseEmbedSrc, getEmbedLink, -} from "@excalidraw/element/embeddable"; +} from "@excalidraw/element"; import { getInitializedImageElements, loadHTMLImageElement, normalizeSVG, updateImageCache as _updateImageCache, -} from "@excalidraw/element/image"; +} from "@excalidraw/element"; import { getBoundTextElement, @@ -202,9 +196,9 @@ import { getContainerElement, isValidTextContainer, redrawTextBoundingBox, -} from "@excalidraw/element/textElement"; +} from "@excalidraw/element"; -import { shouldShowBoundingBox } from "@excalidraw/element/transformHandles"; +import { shouldShowBoundingBox } from "@excalidraw/element"; import { getFrameChildren, @@ -221,30 +215,27 @@ import { getFrameLikeTitle, getElementsOverlappingFrame, filterElementsEligibleAsFrameChildren, -} from "@excalidraw/element/frame"; +} from "@excalidraw/element"; import { hitElementBoundText, hitElementBoundingBoxOnly, hitElementItself, -} from "@excalidraw/element/collision"; +} from "@excalidraw/element"; -import { getVisibleSceneBounds } from "@excalidraw/element/bounds"; +import { getVisibleSceneBounds } from "@excalidraw/element"; import { FlowChartCreator, FlowChartNavigator, 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 { isMeasureTextSupported, @@ -254,11 +245,11 @@ import { getApproxMinLineWidth, getApproxMinLineHeight, 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 { editGroupForSelectedElement, @@ -268,42 +259,39 @@ import { isElementInGroup, isSelectedViaGroup, selectGroupsForSelectedElements, -} from "@excalidraw/element/groups"; +} from "@excalidraw/element"; -import { - syncInvalidIndices, - syncMovedIndices, -} from "@excalidraw/element/fractionalIndex"; +import { syncInvalidIndices, syncMovedIndices } from "@excalidraw/element"; import { excludeElementsInFramesFromSelection, getSelectionStateForElements, makeNextSelectedElementIds, -} from "@excalidraw/element/selection"; +} from "@excalidraw/element"; import { getResizeOffsetXY, getResizeArrowDirection, transformElements, -} from "@excalidraw/element/resizeElements"; +} from "@excalidraw/element"; import { getCursorForResizingElement, getElementWithTransformHandleType, getTransformHandleTypeFromCoords, -} from "@excalidraw/element/resizeTest"; +} from "@excalidraw/element"; import { dragNewElement, dragSelectedElements, getDragOffsetXY, -} from "@excalidraw/element/dragElements"; +} from "@excalidraw/element"; import { isNonDeletedElement } from "@excalidraw/element"; -import Scene from "@excalidraw/element/Scene"; +import { Scene } from "@excalidraw/element"; -import type { ElementUpdate } from "@excalidraw/element/mutateElement"; +import type { ElementUpdate } from "@excalidraw/element"; import type { LocalPoint, Radians } from "@excalidraw/math"; diff --git a/packages/excalidraw/components/ConvertElementTypePopup.tsx b/packages/excalidraw/components/ConvertElementTypePopup.tsx index 9ff1719880..e609329fec 100644 --- a/packages/excalidraw/components/ConvertElementTypePopup.tsx +++ b/packages/excalidraw/components/ConvertElementTypePopup.tsx @@ -1,6 +1,6 @@ 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"; @@ -13,21 +13,21 @@ import { isLinearElement, isSharpArrow, isUsingAdaptiveRadius, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; import { getCommonBoundingBox, getElementAbsoluteCoords, -} from "@excalidraw/element/bounds"; +} from "@excalidraw/element"; import { getBoundTextElement, getBoundTextMaxHeight, getBoundTextMaxWidth, redrawTextBoundingBox, -} from "@excalidraw/element/textElement"; +} from "@excalidraw/element"; -import { wrapText } from "@excalidraw/element/textWrapping"; +import { wrapText } from "@excalidraw/element"; import { assertNever, @@ -37,17 +37,17 @@ import { updateActiveTool, } 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 { newArrowElement, newElement, newLinearElement, -} from "@excalidraw/element/newElement"; +} from "@excalidraw/element"; -import { ShapeCache } from "@excalidraw/element/ShapeCache"; +import { ShapeCache } from "@excalidraw/element"; import type { ConvertibleGenericTypes, @@ -66,7 +66,7 @@ import type { FixedSegment, } from "@excalidraw/element/types"; -import type Scene from "@excalidraw/element/Scene"; +import type Scene from "@excalidraw/element"; import { bumpVersion, diff --git a/packages/excalidraw/components/ElementCanvasButtons.tsx b/packages/excalidraw/components/ElementCanvasButtons.tsx index 424c4f3b44..0069b327ef 100644 --- a/packages/excalidraw/components/ElementCanvasButtons.tsx +++ b/packages/excalidraw/components/ElementCanvasButtons.tsx @@ -1,5 +1,5 @@ import { sceneCoordsToViewportCoords } from "@excalidraw/common"; -import { getElementAbsoluteCoords } from "@excalidraw/element/bounds"; +import { getElementAbsoluteCoords } from "@excalidraw/element"; import type { ElementsMap, diff --git a/packages/excalidraw/components/ElementLinkDialog.tsx b/packages/excalidraw/components/ElementLinkDialog.tsx index e9766f3d7b..b4598ef5bf 100644 --- a/packages/excalidraw/components/ElementLinkDialog.tsx +++ b/packages/excalidraw/components/ElementLinkDialog.tsx @@ -5,11 +5,11 @@ import { normalizeLink, KEYS } from "@excalidraw/common"; import { defaultGetElementLinkFromSelection, getLinkIdAndTypeFromSelection, -} from "@excalidraw/element/elementLink"; +} from "@excalidraw/element"; 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 { getSelectedElements } from "../scene"; diff --git a/packages/excalidraw/components/HintViewer.tsx b/packages/excalidraw/components/HintViewer.tsx index 5072e4471f..b29aa06010 100644 --- a/packages/excalidraw/components/HintViewer.tsx +++ b/packages/excalidraw/components/HintViewer.tsx @@ -6,11 +6,11 @@ import { isLinearElement, isTextBindableContainer, isTextElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; import { getShortcutKey } from "@excalidraw/common"; -import { isNodeInFlowchart } from "@excalidraw/element/flowchart"; +import { isNodeInFlowchart } from "@excalidraw/element"; import { t } from "../i18n"; import { isEraserActive } from "../appState"; diff --git a/packages/excalidraw/components/LayerUI.tsx b/packages/excalidraw/components/LayerUI.tsx index b2e0d446fa..d216f1d46d 100644 --- a/packages/excalidraw/components/LayerUI.tsx +++ b/packages/excalidraw/components/LayerUI.tsx @@ -10,11 +10,11 @@ import { isShallowEqual, } 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"; diff --git a/packages/excalidraw/components/LibraryMenuItems.tsx b/packages/excalidraw/components/LibraryMenuItems.tsx index 160cc26405..8e06632aad 100644 --- a/packages/excalidraw/components/LibraryMenuItems.tsx +++ b/packages/excalidraw/components/LibraryMenuItems.tsx @@ -8,7 +8,7 @@ import React, { import { MIME_TYPES, arrayToMap } from "@excalidraw/common"; -import { duplicateElements } from "@excalidraw/element/duplicate"; +import { duplicateElements } from "@excalidraw/element"; import { serializeLibraryAsJSON } from "../data/json"; import { useLibraryCache } from "../hooks/useLibraryItemSvg"; diff --git a/packages/excalidraw/components/MobileMenu.tsx b/packages/excalidraw/components/MobileMenu.tsx index 6e75b5992c..454c0f64e5 100644 --- a/packages/excalidraw/components/MobileMenu.tsx +++ b/packages/excalidraw/components/MobileMenu.tsx @@ -1,6 +1,6 @@ import React from "react"; -import { showSelectedShapeActions } from "@excalidraw/element/showSelectedShapeActions"; +import { showSelectedShapeActions } from "@excalidraw/element"; import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/components/SearchMenu.tsx b/packages/excalidraw/components/SearchMenu.tsx index 3e0b31a699..6be7decbf1 100644 --- a/packages/excalidraw/components/SearchMenu.tsx +++ b/packages/excalidraw/components/SearchMenu.tsx @@ -5,9 +5,9 @@ import { Fragment, memo, useEffect, useRef, useState } from "react"; import { CLASSES, EVENT } 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 { KEYS, @@ -16,8 +16,8 @@ import { getFontString, } from "@excalidraw/common"; -import { newTextElement } from "@excalidraw/element/newElement"; -import { isTextElement } from "@excalidraw/element/typeChecks"; +import { newTextElement } from "@excalidraw/element"; +import { isTextElement } from "@excalidraw/element"; import type { ExcalidrawTextElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/components/Stats/Angle.tsx b/packages/excalidraw/components/Stats/Angle.tsx index 76cb4876d5..8328dcba0c 100644 --- a/packages/excalidraw/components/Stats/Angle.tsx +++ b/packages/excalidraw/components/Stats/Angle.tsx @@ -1,13 +1,13 @@ 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 type { Degrees } from "@excalidraw/math"; import type { ExcalidrawElement } from "@excalidraw/element/types"; -import type Scene from "@excalidraw/element/Scene"; +import type Scene from "@excalidraw/element"; import { angleIcon } from "../icons"; diff --git a/packages/excalidraw/components/Stats/CanvasGrid.tsx b/packages/excalidraw/components/Stats/CanvasGrid.tsx index 4766f82041..d7909b736e 100644 --- a/packages/excalidraw/components/Stats/CanvasGrid.tsx +++ b/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"; diff --git a/packages/excalidraw/components/Stats/Dimension.tsx b/packages/excalidraw/components/Stats/Dimension.tsx index c838b581f7..6356178d4d 100644 --- a/packages/excalidraw/components/Stats/Dimension.tsx +++ b/packages/excalidraw/components/Stats/Dimension.tsx @@ -4,13 +4,13 @@ import { MIN_WIDTH_OR_HEIGHT } from "@excalidraw/common"; import { MINIMAL_CROP_SIZE, 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 Scene from "@excalidraw/element/Scene"; +import type Scene from "@excalidraw/element"; import DragInput from "./DragInput"; import { getStepSizedValue, isPropertyEditable } from "./utils"; diff --git a/packages/excalidraw/components/Stats/DragInput.tsx b/packages/excalidraw/components/Stats/DragInput.tsx index 6fdf909b24..f2ba0ab5c6 100644 --- a/packages/excalidraw/components/Stats/DragInput.tsx +++ b/packages/excalidraw/components/Stats/DragInput.tsx @@ -3,11 +3,11 @@ import { useEffect, useRef, useState } from "react"; import { EVENT, KEYS, cloneJSON } from "@excalidraw/common"; -import { deepCopyElement } from "@excalidraw/element/duplicate"; +import { deepCopyElement } from "@excalidraw/element"; import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types"; -import type Scene from "@excalidraw/element/Scene"; +import type Scene from "@excalidraw/element"; import { CaptureUpdateAction } from "../../store"; import { useApp } from "../App"; diff --git a/packages/excalidraw/components/Stats/FontSize.tsx b/packages/excalidraw/components/Stats/FontSize.tsx index 635f2cd5a2..6d3a64d33b 100644 --- a/packages/excalidraw/components/Stats/FontSize.tsx +++ b/packages/excalidraw/components/Stats/FontSize.tsx @@ -1,18 +1,15 @@ import { getBoundTextElement, redrawTextBoundingBox, -} from "@excalidraw/element/textElement"; -import { - hasBoundTextElement, - isTextElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; +import { hasBoundTextElement, isTextElement } from "@excalidraw/element"; import type { ExcalidrawElement, ExcalidrawTextElement, } from "@excalidraw/element/types"; -import type Scene from "@excalidraw/element/Scene"; +import type Scene from "@excalidraw/element"; import { fontSizeIcon } from "../icons"; diff --git a/packages/excalidraw/components/Stats/MultiAngle.tsx b/packages/excalidraw/components/Stats/MultiAngle.tsx index a22a011477..a557bafccd 100644 --- a/packages/excalidraw/components/Stats/MultiAngle.tsx +++ b/packages/excalidraw/components/Stats/MultiAngle.tsx @@ -1,15 +1,15 @@ 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 { ExcalidrawElement } from "@excalidraw/element/types"; -import type Scene from "@excalidraw/element/Scene"; +import type Scene from "@excalidraw/element"; import { angleIcon } from "../icons"; diff --git a/packages/excalidraw/components/Stats/MultiDimension.tsx b/packages/excalidraw/components/Stats/MultiDimension.tsx index ddac0ee3f2..7bde820c2c 100644 --- a/packages/excalidraw/components/Stats/MultiDimension.tsx +++ b/packages/excalidraw/components/Stats/MultiDimension.tsx @@ -2,17 +2,14 @@ import { pointFrom, type GlobalPoint } from "@excalidraw/math"; import { useMemo } from "react"; import { MIN_WIDTH_OR_HEIGHT } from "@excalidraw/common"; -import { updateBoundElements } from "@excalidraw/element/binding"; +import { updateBoundElements } from "@excalidraw/element"; import { rescalePointsInElement, 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"; @@ -22,7 +19,7 @@ import type { NonDeletedSceneElementsMap, } from "@excalidraw/element/types"; -import type Scene from "@excalidraw/element/Scene"; +import type Scene from "@excalidraw/element"; import DragInput from "./DragInput"; import { getAtomicUnits, getStepSizedValue, isPropertyEditable } from "./utils"; diff --git a/packages/excalidraw/components/Stats/MultiFontSize.tsx b/packages/excalidraw/components/Stats/MultiFontSize.tsx index 075016ad19..f0659d58c1 100644 --- a/packages/excalidraw/components/Stats/MultiFontSize.tsx +++ b/packages/excalidraw/components/Stats/MultiFontSize.tsx @@ -1,13 +1,10 @@ import { getBoundTextElement, 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 { ExcalidrawElement, @@ -15,7 +12,7 @@ import type { NonDeletedSceneElementsMap, } from "@excalidraw/element/types"; -import type Scene from "@excalidraw/element/Scene"; +import type Scene from "@excalidraw/element"; import { fontSizeIcon } from "../icons"; diff --git a/packages/excalidraw/components/Stats/MultiPosition.tsx b/packages/excalidraw/components/Stats/MultiPosition.tsx index ae6b52296b..71518704a2 100644 --- a/packages/excalidraw/components/Stats/MultiPosition.tsx +++ b/packages/excalidraw/components/Stats/MultiPosition.tsx @@ -1,13 +1,13 @@ import { pointFrom, pointRotateRads } from "@excalidraw/math"; 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 Scene from "@excalidraw/element/Scene"; +import type Scene from "@excalidraw/element"; import StatsDragInput from "./DragInput"; import { getAtomicUnits, getStepSizedValue, isPropertyEditable } from "./utils"; diff --git a/packages/excalidraw/components/Stats/Position.tsx b/packages/excalidraw/components/Stats/Position.tsx index 5235385811..aa5c0796f3 100644 --- a/packages/excalidraw/components/Stats/Position.tsx +++ b/packages/excalidraw/components/Stats/Position.tsx @@ -3,12 +3,12 @@ import { clamp, pointFrom, pointRotateRads, round } from "@excalidraw/math"; import { getFlipAdjustedCropPosition, 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 Scene from "@excalidraw/element/Scene"; +import type Scene from "@excalidraw/element"; import StatsDragInput from "./DragInput"; import { getStepSizedValue, moveElement } from "./utils"; diff --git a/packages/excalidraw/components/Stats/index.tsx b/packages/excalidraw/components/Stats/index.tsx index 11a5d6b5d3..bcfab85206 100644 --- a/packages/excalidraw/components/Stats/index.tsx +++ b/packages/excalidraw/components/Stats/index.tsx @@ -4,13 +4,13 @@ import throttle from "lodash.throttle"; import { useEffect, useMemo, useState, memo } from "react"; 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"; diff --git a/packages/excalidraw/components/Stats/stats.test.tsx b/packages/excalidraw/components/Stats/stats.test.tsx index cfb2b4ee41..cc1cfce984 100644 --- a/packages/excalidraw/components/Stats/stats.test.tsx +++ b/packages/excalidraw/components/Stats/stats.test.tsx @@ -5,9 +5,9 @@ import { vi } from "vitest"; 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"; diff --git a/packages/excalidraw/components/Stats/utils.ts b/packages/excalidraw/components/Stats/utils.ts index 9aefa5544f..aee9ee5821 100644 --- a/packages/excalidraw/components/Stats/utils.ts +++ b/packages/excalidraw/components/Stats/utils.ts @@ -1,16 +1,13 @@ 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 { getSelectedGroupIds, getElementsInGroup, isInGroup, -} from "@excalidraw/element/groups"; +} from "@excalidraw/element"; import type { Radians } from "@excalidraw/math"; @@ -20,7 +17,7 @@ import type { NonDeletedExcalidrawElement, } from "@excalidraw/element/types"; -import type Scene from "@excalidraw/element/Scene"; +import type Scene from "@excalidraw/element"; import { updateBindings } from "../../../element/src/binding"; diff --git a/packages/excalidraw/components/hyperlink/Hyperlink.tsx b/packages/excalidraw/components/hyperlink/Hyperlink.tsx index 65883017ea..2cc9600c4f 100644 --- a/packages/excalidraw/components/hyperlink/Hyperlink.tsx +++ b/packages/excalidraw/components/hyperlink/Hyperlink.tsx @@ -10,16 +10,13 @@ import { 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 { sceneCoordsToViewportCoords, @@ -29,9 +26,9 @@ import { normalizeLink, } 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 { ElementsMap, diff --git a/packages/excalidraw/components/hyperlink/helpers.ts b/packages/excalidraw/components/hyperlink/helpers.ts index d1345db983..bdabbfc440 100644 --- a/packages/excalidraw/components/hyperlink/helpers.ts +++ b/packages/excalidraw/components/hyperlink/helpers.ts @@ -1,14 +1,14 @@ import { pointFrom, pointRotateRads } from "@excalidraw/math"; 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 { Bounds } from "@excalidraw/element/bounds"; +import type { Bounds } from "@excalidraw/element"; import type { ElementsMap, NonDeletedExcalidrawElement, diff --git a/packages/excalidraw/data/index.ts b/packages/excalidraw/data/index.ts index 93d5f5677e..f655e5e8e6 100644 --- a/packages/excalidraw/data/index.ts +++ b/packages/excalidraw/data/index.ts @@ -10,9 +10,9 @@ import { 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 { ExcalidrawElement, diff --git a/packages/excalidraw/data/library.ts b/packages/excalidraw/data/library.ts index 74252657e7..7348da7f90 100644 --- a/packages/excalidraw/data/library.ts +++ b/packages/excalidraw/data/library.ts @@ -18,7 +18,7 @@ import { import { hashElementsVersion, hashString } from "@excalidraw/element"; -import { getCommonBoundingBox } from "@excalidraw/element/bounds"; +import { getCommonBoundingBox } from "@excalidraw/element"; import type { ExcalidrawElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/data/reconcile.ts b/packages/excalidraw/data/reconcile.ts index a69ee2deed..d758796a78 100644 --- a/packages/excalidraw/data/reconcile.ts +++ b/packages/excalidraw/data/reconcile.ts @@ -6,7 +6,7 @@ import { orderByFractionalIndex, syncInvalidIndices, validateFractionalIndices, -} from "@excalidraw/element/fractionalIndex"; +} from "@excalidraw/element"; import type { OrderedExcalidrawElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/data/restore.ts b/packages/excalidraw/data/restore.ts index cafc0bdd6a..a1bcc46023 100644 --- a/packages/excalidraw/data/restore.ts +++ b/packages/excalidraw/data/restore.ts @@ -19,15 +19,15 @@ import { getLineHeight, } from "@excalidraw/common"; import { getNonDeletedElements } from "@excalidraw/element"; -import { normalizeFixedPoint } from "@excalidraw/element/binding"; +import { normalizeFixedPoint } from "@excalidraw/element"; import { updateElbowArrowPoints, 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 { isArrowBoundToElement, isArrowElement, @@ -36,15 +36,15 @@ import { isLinearElement, isTextElement, 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"; diff --git a/packages/excalidraw/data/transform.ts b/packages/excalidraw/data/transform.ts index 787f2489df..b94406f254 100644 --- a/packages/excalidraw/data/transform.ts +++ b/packages/excalidraw/data/transform.ts @@ -16,7 +16,7 @@ import { getLineHeight, } from "@excalidraw/common"; -import { bindLinearElement } from "@excalidraw/element/binding"; +import { bindLinearElement } from "@excalidraw/element"; import { newArrowElement, newElement, @@ -25,24 +25,21 @@ import { newLinearElement, newMagicFrameElement, 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 { ExcalidrawArrowElement, diff --git a/packages/excalidraw/eraser/index.ts b/packages/excalidraw/eraser/index.ts index 2ea668aef2..5e6c4e5171 100644 --- a/packages/excalidraw/eraser/index.ts +++ b/packages/excalidraw/eraser/index.ts @@ -1,21 +1,18 @@ import { arrayToMap, easeOut, THEME } from "@excalidraw/common"; -import { getElementLineSegments } from "@excalidraw/element/bounds"; +import { getElementLineSegments } from "@excalidraw/element"; import { lineSegment, lineSegmentIntersectionPoints, pointFrom, } 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 { - 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 { diff --git a/packages/excalidraw/fonts/Fonts.ts b/packages/excalidraw/fonts/Fonts.ts index a9419892b3..d4e3af0b0b 100644 --- a/packages/excalidraw/fonts/Fonts.ts +++ b/packages/excalidraw/fonts/Fonts.ts @@ -5,9 +5,9 @@ import { WINDOWS_EMOJI_FALLBACK_FONT, getFontFamilyFallbacks, } 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 { FONT_METADATA, @@ -17,9 +17,9 @@ import { promiseTry, } 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 { ExcalidrawElement, @@ -28,7 +28,7 @@ import type { 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 { ComicShannsFontFaces } from "./ComicShanns"; diff --git a/packages/excalidraw/index.tsx b/packages/excalidraw/index.tsx index 17c59a1b50..7a1c0faba4 100644 --- a/packages/excalidraw/index.tsx +++ b/packages/excalidraw/index.tsx @@ -220,8 +220,8 @@ export { getNonDeletedElements, } 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 { @@ -246,9 +246,9 @@ export { loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "./data/blob"; -export { getFreeDrawSvgPath } from "@excalidraw/element/renderElement"; +export { getFreeDrawSvgPath } from "@excalidraw/element"; export { mergeLibraryItems, getLibraryItemsHash } from "./data/library"; -export { isLinearElement } from "@excalidraw/element/typeChecks"; +export { isLinearElement } from "@excalidraw/element"; export { FONT_FAMILY, @@ -264,7 +264,7 @@ export { mutateElement, newElementWith, bumpVersion, -} from "@excalidraw/element/mutateElement"; +} from "@excalidraw/element"; export { CaptureUpdateAction } from "./store"; @@ -290,10 +290,7 @@ export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger"; export { zoomToFitBounds } from "./actions/actionCanvas"; export { convertToExcalidrawElements } from "./data/transform"; -export { - getCommonBounds, - getVisibleSceneBounds, -} from "@excalidraw/element/bounds"; +export { getCommonBounds, getVisibleSceneBounds } from "@excalidraw/element"; export { elementsOverlappingBBox, @@ -303,6 +300,6 @@ export { export { DiagramToCodePlugin } from "./components/DiagramToCodePlugin/DiagramToCodePlugin"; 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"; diff --git a/packages/excalidraw/lasso/index.ts b/packages/excalidraw/lasso/index.ts index f7e791665e..41e6b2080b 100644 --- a/packages/excalidraw/lasso/index.ts +++ b/packages/excalidraw/lasso/index.ts @@ -4,18 +4,18 @@ import { pointFrom, } 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 { isFrameLikeElement, isLinearElement, 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"; diff --git a/packages/excalidraw/renderer/interactiveScene.ts b/packages/excalidraw/renderer/interactiveScene.ts index 69c6a8196e..38d563237f 100644 --- a/packages/excalidraw/renderer/interactiveScene.ts +++ b/packages/excalidraw/renderer/interactiveScene.ts @@ -19,47 +19,44 @@ import { BINDING_HIGHLIGHT_OFFSET, BINDING_HIGHLIGHT_THICKNESS, maxBindingGap, -} from "@excalidraw/element/binding"; -import { LinearElementEditor } from "@excalidraw/element/linearElementEditor"; +} from "@excalidraw/element"; +import { LinearElementEditor } from "@excalidraw/element"; import { getOmitSidesForDevice, getTransformHandles, getTransformHandlesFromCoords, shouldShowBoundingBox, -} from "@excalidraw/element/transformHandles"; +} from "@excalidraw/element"; import { isElbowArrow, isFrameLikeElement, isImageElement, isLinearElement, isTextElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; -import { getCornerRadius } from "@excalidraw/element/shapes"; +import { getCornerRadius } from "@excalidraw/element"; -import { renderSelectionElement } from "@excalidraw/element/renderElement"; +import { renderSelectionElement } from "@excalidraw/element"; import { isSelectedViaGroup, getSelectedGroupIds, getElementsInGroup, selectGroupsFromGivenElements, -} from "@excalidraw/element/groups"; +} from "@excalidraw/element"; -import { - getCommonBounds, - getElementAbsoluteCoords, -} from "@excalidraw/element/bounds"; +import { getCommonBounds, getElementAbsoluteCoords } from "@excalidraw/element"; import type { SuggestedBinding, SuggestedPointBinding, -} from "@excalidraw/element/binding"; +} from "@excalidraw/element"; import type { TransformHandles, TransformHandleType, -} from "@excalidraw/element/transformHandles"; +} from "@excalidraw/element"; import type { ElementsMap, diff --git a/packages/excalidraw/renderer/renderNewElementScene.ts b/packages/excalidraw/renderer/renderNewElementScene.ts index bbc14654a8..69966687d1 100644 --- a/packages/excalidraw/renderer/renderNewElementScene.ts +++ b/packages/excalidraw/renderer/renderNewElementScene.ts @@ -1,6 +1,6 @@ import { throttleRAF } from "@excalidraw/common"; -import { renderElement } from "@excalidraw/element/renderElement"; +import { renderElement } from "@excalidraw/element"; import { bootstrapCanvas, getNormalizedCanvasDimensions } from "./helpers"; diff --git a/packages/excalidraw/renderer/staticScene.ts b/packages/excalidraw/renderer/staticScene.ts index 16743ff91d..d63779464a 100644 --- a/packages/excalidraw/renderer/staticScene.ts +++ b/packages/excalidraw/renderer/staticScene.ts @@ -1,21 +1,21 @@ import { FRAME_STYLE, throttleRAF } from "@excalidraw/common"; -import { isElementLink } from "@excalidraw/element/elementLink"; -import { createPlaceholderEmbeddableLabel } from "@excalidraw/element/embeddable"; -import { getBoundTextElement } from "@excalidraw/element/textElement"; +import { isElementLink } from "@excalidraw/element"; +import { createPlaceholderEmbeddableLabel } from "@excalidraw/element"; +import { getBoundTextElement } from "@excalidraw/element"; import { isEmbeddableElement, isIframeLikeElement, isTextElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; import { elementOverlapsWithFrame, getTargetFrame, shouldApplyFrameClip, -} from "@excalidraw/element/frame"; +} from "@excalidraw/element"; -import { renderElement } from "@excalidraw/element/renderElement"; +import { renderElement } from "@excalidraw/element"; -import { getElementAbsoluteCoords } from "@excalidraw/element/bounds"; +import { getElementAbsoluteCoords } from "@excalidraw/element"; import type { ElementsMap, diff --git a/packages/excalidraw/renderer/staticSvgScene.ts b/packages/excalidraw/renderer/staticSvgScene.ts index 0d3f5bad99..89af1dc724 100644 --- a/packages/excalidraw/renderer/staticSvgScene.ts +++ b/packages/excalidraw/renderer/staticSvgScene.ts @@ -10,36 +10,30 @@ import { } from "@excalidraw/common"; import { normalizeLink, toValidURL } from "@excalidraw/common"; import { hashString } from "@excalidraw/element"; -import { getUncroppedWidthAndHeight } from "@excalidraw/element/cropElement"; +import { getUncroppedWidthAndHeight } from "@excalidraw/element"; import { createPlaceholderEmbeddableLabel, getEmbedLink, -} from "@excalidraw/element/embeddable"; -import { LinearElementEditor } from "@excalidraw/element/linearElementEditor"; -import { - getBoundTextElement, - getContainerElement, -} from "@excalidraw/element/textElement"; -import { getLineHeightInPx } from "@excalidraw/element/textMeasurements"; +} from "@excalidraw/element"; +import { LinearElementEditor } from "@excalidraw/element"; +import { getBoundTextElement, getContainerElement } from "@excalidraw/element"; +import { getLineHeightInPx } from "@excalidraw/element"; import { isArrowElement, isIframeLikeElement, isInitializedImageElement, isTextElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; -import { getContainingFrame } from "@excalidraw/element/frame"; +import { getContainingFrame } from "@excalidraw/element"; -import { getCornerRadius, isPathALoop } from "@excalidraw/element/shapes"; +import { getCornerRadius, isPathALoop } from "@excalidraw/element"; -import { ShapeCache } from "@excalidraw/element/ShapeCache"; +import { ShapeCache } from "@excalidraw/element"; -import { - getFreeDrawSvgPath, - IMAGE_INVERT_FILTER, -} from "@excalidraw/element/renderElement"; +import { getFreeDrawSvgPath, IMAGE_INVERT_FILTER } from "@excalidraw/element"; -import { getElementAbsoluteCoords } from "@excalidraw/element/bounds"; +import { getElementAbsoluteCoords } from "@excalidraw/element"; import type { ExcalidrawElement, diff --git a/packages/excalidraw/scene/Renderer.ts b/packages/excalidraw/scene/Renderer.ts index 47d859cbf9..fc4e8c31aa 100644 --- a/packages/excalidraw/scene/Renderer.ts +++ b/packages/excalidraw/scene/Renderer.ts @@ -1,5 +1,5 @@ -import { isElementInViewport } from "@excalidraw/element/sizeHelpers"; -import { isImageElement } from "@excalidraw/element/typeChecks"; +import { isElementInViewport } from "@excalidraw/element"; +import { isImageElement } from "@excalidraw/element"; import { memoize, toBrandedType } from "@excalidraw/common"; @@ -9,7 +9,7 @@ import type { NonDeletedExcalidrawElement, } from "@excalidraw/element/types"; -import type Scene from "@excalidraw/element/Scene"; +import type Scene from "@excalidraw/element"; import { renderInteractiveSceneThrottled } from "../renderer/interactiveScene"; import { renderStaticSceneThrottled } from "../renderer/staticScene"; diff --git a/packages/excalidraw/scene/export.ts b/packages/excalidraw/scene/export.ts index 2299923542..f2e5b32df7 100644 --- a/packages/excalidraw/scene/export.ts +++ b/packages/excalidraw/scene/export.ts @@ -15,34 +15,31 @@ import { toBrandedType, } from "@excalidraw/common"; -import { - getCommonBounds, - getElementAbsoluteCoords, -} from "@excalidraw/element/bounds"; +import { getCommonBounds, getElementAbsoluteCoords } from "@excalidraw/element"; import { getInitializedImageElements, updateImageCache, -} from "@excalidraw/element/image"; +} from "@excalidraw/element"; -import { newElementWith } from "@excalidraw/element/mutateElement"; +import { newElementWith } from "@excalidraw/element"; -import { isFrameLikeElement } from "@excalidraw/element/typeChecks"; +import { isFrameLikeElement } from "@excalidraw/element"; import { getElementsOverlappingFrame, getFrameLikeElements, getFrameLikeTitle, getRootElements, -} from "@excalidraw/element/frame"; +} from "@excalidraw/element"; -import { syncInvalidIndices } from "@excalidraw/element/fractionalIndex"; +import { syncInvalidIndices } from "@excalidraw/element"; import { type Mutable } from "@excalidraw/common/utility-types"; -import { newTextElement } from "@excalidraw/element/newElement"; +import { newTextElement } from "@excalidraw/element"; -import type { Bounds } from "@excalidraw/element/bounds"; +import type { Bounds } from "@excalidraw/element"; import type { ExcalidrawElement, diff --git a/packages/excalidraw/scene/index.ts b/packages/excalidraw/scene/index.ts index 6f39a7fe24..ce2cb10fef 100644 --- a/packages/excalidraw/scene/index.ts +++ b/packages/excalidraw/scene/index.ts @@ -4,7 +4,7 @@ export { getCommonAttributeOfSelectedElements, getSelectedElements, getTargetElements, -} from "@excalidraw/element/selection"; +} from "@excalidraw/element"; export { calculateScrollCenter } from "./scroll"; export { hasBackground, @@ -12,7 +12,7 @@ export { hasStrokeStyle, canHaveArrowheads, canChangeRoundness, -} from "@excalidraw/element/comparisons"; +} from "@excalidraw/element"; export { getNormalizedZoom, getNormalizedGridSize, diff --git a/packages/excalidraw/scene/scroll.ts b/packages/excalidraw/scene/scroll.ts index a99ad075f8..f05a3c0a48 100644 --- a/packages/excalidraw/scene/scroll.ts +++ b/packages/excalidraw/scene/scroll.ts @@ -4,9 +4,9 @@ import { viewportCoordsToSceneCoords, } from "@excalidraw/common"; -import { getClosestElementBounds } from "@excalidraw/element/bounds"; +import { getClosestElementBounds } from "@excalidraw/element"; -import { getCommonBounds } from "@excalidraw/element/bounds"; +import { getCommonBounds } from "@excalidraw/element"; import type { ExcalidrawElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/scene/scrollbars.ts b/packages/excalidraw/scene/scrollbars.ts index 35fecba370..699d7eb72e 100644 --- a/packages/excalidraw/scene/scrollbars.ts +++ b/packages/excalidraw/scene/scrollbars.ts @@ -1,6 +1,6 @@ import { getGlobalCSSVariable } from "@excalidraw/common"; -import { getCommonBounds } from "@excalidraw/element/bounds"; +import { getCommonBounds } from "@excalidraw/element"; import { getLanguage } from "../i18n"; diff --git a/packages/excalidraw/snapping.ts b/packages/excalidraw/snapping.ts index 6ea23bd870..635ba065d0 100644 --- a/packages/excalidraw/snapping.ts +++ b/packages/excalidraw/snapping.ts @@ -12,23 +12,20 @@ import { getCommonBounds, getDraggedElementsBounds, getElementAbsoluteCoords, -} from "@excalidraw/element/bounds"; -import { - isBoundToContainer, - isFrameLikeElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; +import { isBoundToContainer, isFrameLikeElement } from "@excalidraw/element"; -import { getMaximumGroups } from "@excalidraw/element/groups"; +import { getMaximumGroups } from "@excalidraw/element"; import { getSelectedElements, getVisibleAndNonSelectedElements, -} from "@excalidraw/element/selection"; +} from "@excalidraw/element"; import type { InclusiveRange } from "@excalidraw/math"; -import type { Bounds } from "@excalidraw/element/bounds"; -import type { MaybeTransformHandleType } from "@excalidraw/element/transformHandles"; +import type { Bounds } from "@excalidraw/element"; +import type { MaybeTransformHandleType } from "@excalidraw/element"; import type { ElementsMap, ExcalidrawElement, diff --git a/packages/excalidraw/store.ts b/packages/excalidraw/store.ts index 7a5590e54d..ecf1f5c03d 100644 --- a/packages/excalidraw/store.ts +++ b/packages/excalidraw/store.ts @@ -1,8 +1,8 @@ import { isDevEnv, isShallowEqual, isTestEnv } from "@excalidraw/common"; -import { deepCopyElement } from "@excalidraw/element/duplicate"; +import { deepCopyElement } from "@excalidraw/element"; -import { newElementWith } from "@excalidraw/element/mutateElement"; +import { newElementWith } from "@excalidraw/element"; import type { OrderedExcalidrawElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/tests/clipboard.test.tsx b/packages/excalidraw/tests/clipboard.test.tsx index 7d0e3906c0..7386b360cd 100644 --- a/packages/excalidraw/tests/clipboard.test.tsx +++ b/packages/excalidraw/tests/clipboard.test.tsx @@ -1,11 +1,11 @@ import React from "react"; import { vi } from "vitest"; -import { getLineHeightInPx } from "@excalidraw/element/textMeasurements"; +import { getLineHeightInPx } from "@excalidraw/element"; import { KEYS, arrayToMap, getLineHeight } from "@excalidraw/common"; -import { getElementBounds } from "@excalidraw/element/bounds"; +import { getElementBounds } from "@excalidraw/element"; import { createPasteEvent, serializeAsClipboardJSON } from "../clipboard"; diff --git a/packages/excalidraw/tests/cropElement.test.tsx b/packages/excalidraw/tests/cropElement.test.tsx index 8764962fe4..9107a5f763 100644 --- a/packages/excalidraw/tests/cropElement.test.tsx +++ b/packages/excalidraw/tests/cropElement.test.tsx @@ -3,7 +3,7 @@ import { vi } from "vitest"; import { KEYS, cloneJSON } from "@excalidraw/common"; -import { duplicateElement } from "@excalidraw/element/duplicate"; +import { duplicateElement } from "@excalidraw/element"; import type { ExcalidrawImageElement, diff --git a/packages/excalidraw/tests/data/reconcile.test.ts b/packages/excalidraw/tests/data/reconcile.test.ts index 1c0bf13db5..362d167e4f 100644 --- a/packages/excalidraw/tests/data/reconcile.test.ts +++ b/packages/excalidraw/tests/data/reconcile.test.ts @@ -1,4 +1,4 @@ -import { syncInvalidIndices } from "@excalidraw/element/fractionalIndex"; +import { syncInvalidIndices } from "@excalidraw/element"; import { randomInteger, cloneJSON } from "@excalidraw/common"; diff --git a/packages/excalidraw/tests/data/restore.test.ts b/packages/excalidraw/tests/data/restore.test.ts index 4b414bbf1a..d06daafba6 100644 --- a/packages/excalidraw/tests/data/restore.test.ts +++ b/packages/excalidraw/tests/data/restore.test.ts @@ -3,8 +3,8 @@ import { vi } from "vitest"; import { DEFAULT_SIDEBAR, FONT_FAMILY, ROUNDNESS } from "@excalidraw/common"; -import { newElementWith } from "@excalidraw/element/mutateElement"; -import * as sizeHelpers from "@excalidraw/element/sizeHelpers"; +import { newElementWith } from "@excalidraw/element"; +import * as sizeHelpers from "@excalidraw/element"; import type { ExcalidrawElement, diff --git a/packages/excalidraw/tests/flip.test.tsx b/packages/excalidraw/tests/flip.test.tsx index 22a6c67f86..d9b2731cc5 100644 --- a/packages/excalidraw/tests/flip.test.tsx +++ b/packages/excalidraw/tests/flip.test.tsx @@ -5,9 +5,9 @@ import { ROUNDNESS, KEYS, arrayToMap, cloneJSON } from "@excalidraw/common"; import { pointFrom, type Radians } from "@excalidraw/math"; -import { getBoundTextElementPosition } from "@excalidraw/element/textElement"; -import { getElementAbsoluteCoords } from "@excalidraw/element/bounds"; -import { newLinearElement } from "@excalidraw/element/newElement"; +import { getBoundTextElementPosition } from "@excalidraw/element"; +import { getElementAbsoluteCoords } from "@excalidraw/element"; +import { newLinearElement } from "@excalidraw/element"; import type { LocalPoint } from "@excalidraw/math"; diff --git a/packages/excalidraw/tests/helpers/api.ts b/packages/excalidraw/tests/helpers/api.ts index 5ac1bca8cf..9c1ac99139 100644 --- a/packages/excalidraw/tests/helpers/api.ts +++ b/packages/excalidraw/tests/helpers/api.ts @@ -17,11 +17,11 @@ import { newLinearElement, newMagicFrameElement, newTextElement, -} from "@excalidraw/element/newElement"; +} from "@excalidraw/element"; -import { isLinearElementType } from "@excalidraw/element/typeChecks"; -import { getSelectedElements } from "@excalidraw/element/selection"; -import { selectGroupsForSelectedElements } from "@excalidraw/element/groups"; +import { isLinearElementType } from "@excalidraw/element"; +import { getSelectedElements } from "@excalidraw/element"; +import { selectGroupsForSelectedElements } from "@excalidraw/element"; import type { ExcalidrawElement, diff --git a/packages/excalidraw/tests/helpers/ui.ts b/packages/excalidraw/tests/helpers/ui.ts index d60d488f1f..abfadf3316 100644 --- a/packages/excalidraw/tests/helpers/ui.ts +++ b/packages/excalidraw/tests/helpers/ui.ts @@ -1,10 +1,7 @@ import { pointFrom, pointRotateRads } from "@excalidraw/math"; -import { - getCommonBounds, - getElementPointsCoords, -} from "@excalidraw/element/bounds"; -import { cropElement } from "@excalidraw/element/cropElement"; +import { getCommonBounds, getElementPointsCoords } from "@excalidraw/element"; +import { cropElement } from "@excalidraw/element"; import { getTransformHandles, getTransformHandlesFromCoords, @@ -12,18 +9,18 @@ import { OMIT_SIDES_FOR_MULTIPLE_ELEMENTS, type TransformHandle, type TransformHandleDirection, -} from "@excalidraw/element/transformHandles"; +} from "@excalidraw/element"; import { isLinearElement, isFreeDrawElement, isTextElement, isFrameLikeElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; import { KEYS, arrayToMap, elementCenterPoint } from "@excalidraw/common"; import type { GlobalPoint, LocalPoint, Radians } from "@excalidraw/math"; -import type { TransformHandleType } from "@excalidraw/element/transformHandles"; +import type { TransformHandleType } from "@excalidraw/element"; import type { ExcalidrawElement, ExcalidrawLinearElement, diff --git a/packages/excalidraw/tests/history.test.tsx b/packages/excalidraw/tests/history.test.tsx index 8dd65c7a5f..c413c16973 100644 --- a/packages/excalidraw/tests/history.test.tsx +++ b/packages/excalidraw/tests/history.test.tsx @@ -8,7 +8,7 @@ import { import { vi } from "vitest"; import { pointFrom } from "@excalidraw/math"; -import { newElementWith } from "@excalidraw/element/mutateElement"; +import { newElementWith } from "@excalidraw/element"; import { EXPORT_DATA_TYPES, diff --git a/packages/excalidraw/tests/lasso.test.tsx b/packages/excalidraw/tests/lasso.test.tsx index aa32b13d61..7e67d9b5b5 100644 --- a/packages/excalidraw/tests/lasso.test.tsx +++ b/packages/excalidraw/tests/lasso.test.tsx @@ -22,7 +22,7 @@ import { type ElementsSegmentsMap, } from "@excalidraw/math"; -import { getElementLineSegments } from "@excalidraw/element/bounds"; +import { getElementLineSegments } from "@excalidraw/element"; import type { ExcalidrawElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/tests/library.test.tsx b/packages/excalidraw/tests/library.test.tsx index d2b6c13c8f..1c9b7a53ac 100644 --- a/packages/excalidraw/tests/library.test.tsx +++ b/packages/excalidraw/tests/library.test.tsx @@ -4,7 +4,7 @@ import { vi } from "vitest"; import { MIME_TYPES, ORIG_ID } from "@excalidraw/common"; -import { getCommonBoundingBox } from "@excalidraw/element/bounds"; +import { getCommonBoundingBox } from "@excalidraw/element"; import type { ExcalidrawGenericElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/tests/move.test.tsx b/packages/excalidraw/tests/move.test.tsx index 71a489561f..1a02ba1db0 100644 --- a/packages/excalidraw/tests/move.test.tsx +++ b/packages/excalidraw/tests/move.test.tsx @@ -1,7 +1,7 @@ import React from "react"; import { vi } from "vitest"; -import { bindOrUnbindLinearElement } from "@excalidraw/element/binding"; +import { bindOrUnbindLinearElement } from "@excalidraw/element"; import { KEYS, reseed } from "@excalidraw/common"; diff --git a/packages/excalidraw/tests/test-utils.ts b/packages/excalidraw/tests/test-utils.ts index 894d748dd8..48a9d16484 100644 --- a/packages/excalidraw/tests/test-utils.ts +++ b/packages/excalidraw/tests/test-utils.ts @@ -11,7 +11,7 @@ import ansi from "ansicolor"; import { ORIG_ID, arrayToMap } from "@excalidraw/common"; -import { getSelectedElements } from "@excalidraw/element/selection"; +import { getSelectedElements } from "@excalidraw/element"; import type { ExcalidrawElement } from "@excalidraw/element/types"; diff --git a/packages/excalidraw/types.ts b/packages/excalidraw/types.ts index bd6e21fdc9..461546d011 100644 --- a/packages/excalidraw/types.ts +++ b/packages/excalidraw/types.ts @@ -5,11 +5,11 @@ import type { MIME_TYPES, } from "@excalidraw/common"; -import type { SuggestedBinding } from "@excalidraw/element/binding"; +import type { SuggestedBinding } from "@excalidraw/element"; -import type { LinearElementEditor } from "@excalidraw/element/linearElementEditor"; +import type { LinearElementEditor } from "@excalidraw/element"; -import type { MaybeTransformHandleType } from "@excalidraw/element/transformHandles"; +import type { MaybeTransformHandleType } from "@excalidraw/element"; import type { PointerType, diff --git a/packages/excalidraw/visualdebug.ts b/packages/excalidraw/visualdebug.ts index 9ad1490d1d..961fa919f2 100644 --- a/packages/excalidraw/visualdebug.ts +++ b/packages/excalidraw/visualdebug.ts @@ -6,12 +6,12 @@ import { type LocalPoint, } from "@excalidraw/math"; -import { isBounds } from "@excalidraw/element/typeChecks"; +import { isBounds } from "@excalidraw/element"; import type { Curve } from "@excalidraw/math"; import type { LineSegment } from "@excalidraw/utils"; -import type { Bounds } from "@excalidraw/element/bounds"; +import type { Bounds } from "@excalidraw/element"; // The global data holder to collect the debug operations declare global { diff --git a/packages/excalidraw/wysiwyg/textWysiwyg.test.tsx b/packages/excalidraw/wysiwyg/textWysiwyg.test.tsx index 0ba1960d6a..fb142057f3 100644 --- a/packages/excalidraw/wysiwyg/textWysiwyg.test.tsx +++ b/packages/excalidraw/wysiwyg/textWysiwyg.test.tsx @@ -1,7 +1,7 @@ import { queryByText } from "@testing-library/react"; import { pointFrom } from "@excalidraw/math"; -import { getOriginalContainerHeightFromCache } from "@excalidraw/element/containerCache"; +import { getOriginalContainerHeightFromCache } from "@excalidraw/element"; import { CODES, diff --git a/packages/excalidraw/wysiwyg/textWysiwyg.tsx b/packages/excalidraw/wysiwyg/textWysiwyg.tsx index f9c4536d62..2255d8a5a2 100644 --- a/packages/excalidraw/wysiwyg/textWysiwyg.tsx +++ b/packages/excalidraw/wysiwyg/textWysiwyg.tsx @@ -12,10 +12,10 @@ import { import { originalContainerCache, updateOriginalContainerCache, -} from "@excalidraw/element/containerCache"; +} from "@excalidraw/element"; -import { LinearElementEditor } from "@excalidraw/element/linearElementEditor"; -import { bumpVersion } from "@excalidraw/element/mutateElement"; +import { LinearElementEditor } from "@excalidraw/element"; +import { bumpVersion } from "@excalidraw/element"; import { getBoundTextElementId, getContainerElement, @@ -26,15 +26,15 @@ import { computeContainerDimensionForBoundText, computeBoundTextPosition, getBoundTextElement, -} from "@excalidraw/element/textElement"; -import { getTextWidth } from "@excalidraw/element/textMeasurements"; -import { normalizeText } from "@excalidraw/element/textMeasurements"; -import { wrapText } from "@excalidraw/element/textWrapping"; +} from "@excalidraw/element"; +import { getTextWidth } from "@excalidraw/element"; +import { normalizeText } from "@excalidraw/element"; +import { wrapText } from "@excalidraw/element"; import { isArrowElement, isBoundToContainer, isTextElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; import type { ExcalidrawElement, diff --git a/packages/math/src/curve.ts b/packages/math/src/curve.ts index a79fb43a19..ac77f76b59 100644 --- a/packages/math/src/curve.ts +++ b/packages/math/src/curve.ts @@ -1,4 +1,4 @@ -import type { Bounds } from "@excalidraw/element/bounds"; +import type { Bounds } from "@excalidraw/element"; import { isPoint, pointDistance, pointFrom } from "./point"; import { rectangle, rectangleIntersectLineSegment } from "./rectangle"; diff --git a/packages/utils/src/bbox.ts b/packages/utils/src/bbox.ts index a561281563..07dd8907ab 100644 --- a/packages/utils/src/bbox.ts +++ b/packages/utils/src/bbox.ts @@ -5,7 +5,7 @@ import { type LocalPoint, } from "@excalidraw/math"; -import type { Bounds } from "@excalidraw/element/bounds"; +import type { Bounds } from "@excalidraw/element"; export type LineSegment
= [P, P]; diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index 58830b356d..a6207e9c34 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -1,4 +1,4 @@ export * from "./export"; export * from "./withinBounds"; export * from "./bbox"; -export { getCommonBounds } from "@excalidraw/element/bounds"; +export { getCommonBounds } from "@excalidraw/element"; diff --git a/packages/utils/src/shape.ts b/packages/utils/src/shape.ts index b750c232e7..5d50f4b473 100644 --- a/packages/utils/src/shape.ts +++ b/packages/utils/src/shape.ts @@ -34,7 +34,7 @@ import { type LocalPoint, } from "@excalidraw/math"; -import { getElementAbsoluteCoords } from "@excalidraw/element/bounds"; +import { getElementAbsoluteCoords } from "@excalidraw/element"; import type { ElementsMap, diff --git a/packages/utils/src/withinBounds.ts b/packages/utils/src/withinBounds.ts index 0e1cf38a61..d635655fc8 100644 --- a/packages/utils/src/withinBounds.ts +++ b/packages/utils/src/withinBounds.ts @@ -1,12 +1,12 @@ import { arrayToMap } from "@excalidraw/common"; -import { getElementBounds } from "@excalidraw/element/bounds"; +import { getElementBounds } from "@excalidraw/element"; import { isArrowElement, isExcalidrawElement, isFreeDrawElement, isLinearElement, isTextElement, -} from "@excalidraw/element/typeChecks"; +} from "@excalidraw/element"; import { rangeIncludesValue, pointFrom, @@ -14,7 +14,7 @@ import { rangeInclusive, } from "@excalidraw/math"; -import type { Bounds } from "@excalidraw/element/bounds"; +import type { Bounds } from "@excalidraw/element"; import type { ExcalidrawElement, ExcalidrawFreeDrawElement, diff --git a/packages/utils/tests/withinBounds.test.ts b/packages/utils/tests/withinBounds.test.ts index d1af75de86..b05b5525b9 100644 --- a/packages/utils/tests/withinBounds.test.ts +++ b/packages/utils/tests/withinBounds.test.ts @@ -1,6 +1,6 @@ import { API } from "@excalidraw/excalidraw/tests/helpers/api"; -import type { Bounds } from "@excalidraw/element/bounds"; +import type { Bounds } from "@excalidraw/element"; import { elementPartiallyOverlapsWithOrContainsBBox,