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

* Don't import from subpaths

* Fix tests, move related tests to element
This commit is contained in:
Marcel Mraz
2025-05-09 23:01:33 +02:00
committed by GitHub
parent a8ebe514da
commit 7e41026812
129 changed files with 517 additions and 541 deletions
+3 -3
View File
@@ -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";
+8 -11
View File
@@ -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,
+2 -2
View File
@@ -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,
+2 -2
View File
@@ -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";
+1 -1
View File
@@ -1,6 +1,6 @@
import { getGlobalCSSVariable } from "@excalidraw/common";
import { getCommonBounds } from "@excalidraw/element/bounds";
import { getCommonBounds } from "@excalidraw/element";
import { getLanguage } from "../i18n";