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
+2 -2
View File
@@ -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,
+1 -1
View File
@@ -19,7 +19,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";
+1 -1
View File
@@ -6,7 +6,7 @@ import {
orderByFractionalIndex,
syncInvalidIndices,
validateFractionalIndices,
} from "@excalidraw/element/fractionalIndex";
} from "@excalidraw/element";
import type { OrderedExcalidrawElement } from "@excalidraw/element/types";
+11 -11
View File
@@ -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";
+10 -13
View File
@@ -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,