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

View File

@ -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 extends LocalPoint | GlobalPoint> = [P, P];

View File

@ -1,4 +1,4 @@
export * from "./export";
export * from "./withinBounds";
export * from "./bbox";
export { getCommonBounds } from "@excalidraw/element/bounds";
export { getCommonBounds } from "@excalidraw/element";

View File

@ -34,7 +34,7 @@ import {
type LocalPoint,
} from "@excalidraw/math";
import { getElementAbsoluteCoords } from "@excalidraw/element/bounds";
import { getElementAbsoluteCoords } from "@excalidraw/element";
import type {
ElementsMap,

View File

@ -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,

View File

@ -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,