Don't import from subpaths

This commit is contained in:
Marcel Mraz 2025-05-01 12:47:42 +02:00
parent 192c4e7658
commit 259017bc45
No known key found for this signature in database
GPG key ID: 4EBD6E62DC830CD2
113 changed files with 429 additions and 458 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,7 +3,7 @@ import {
createRedoAction, createRedoAction,
createUndoAction, createUndoAction,
} from "@excalidraw/excalidraw/actions/actionHistory"; } from "@excalidraw/excalidraw/actions/actionHistory";
import { syncInvalidIndices } from "@excalidraw/element/fractionalIndex"; import { syncInvalidIndices } from "@excalidraw/element";
import { API } from "@excalidraw/excalidraw/tests/helpers/api"; import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import { act, render, waitFor } from "@excalidraw/excalidraw/tests/test-utils"; import { act, render, waitFor } from "@excalidraw/excalidraw/tests/test-utils";
import { vi } from "vitest"; import { vi } from "vitest";

View file

@ -9,22 +9,19 @@ import {
isReadonlyArray, isReadonlyArray,
} from "@excalidraw/common"; } from "@excalidraw/common";
import { isNonDeletedElement } from "@excalidraw/element"; import { isNonDeletedElement } from "@excalidraw/element";
import { isFrameLikeElement } from "@excalidraw/element/typeChecks"; import { isFrameLikeElement } from "@excalidraw/element";
import { getElementsInGroup } from "@excalidraw/element/groups"; import { getElementsInGroup } from "@excalidraw/element";
import { import {
orderByFractionalIndex, orderByFractionalIndex,
syncInvalidIndices, syncInvalidIndices,
syncMovedIndices, syncMovedIndices,
validateFractionalIndices, validateFractionalIndices,
} from "@excalidraw/element/fractionalIndex"; } from "@excalidraw/element";
import { getSelectedElements } from "@excalidraw/element/selection"; import { getSelectedElements } from "@excalidraw/element";
import { import { mutateElement, type ElementUpdate } from "@excalidraw/element";
mutateElement,
type ElementUpdate,
} from "@excalidraw/element/mutateElement";
import type { import type {
ExcalidrawElement, ExcalidrawElement,
@ -109,7 +106,7 @@ const hashSelectionOpts = (
// in our codebase // in our codebase
export type ExcalidrawElementsIncludingDeleted = readonly ExcalidrawElement[]; export type ExcalidrawElementsIncludingDeleted = readonly ExcalidrawElement[];
class Scene { export class Scene {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// instance methods/props // instance methods/props
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@ -464,5 +461,3 @@ class Scene {
return element; return element;
} }
} }
export default Scene;

View file

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

View file

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

View file

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

View file

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

View file

@ -71,3 +71,45 @@ export const clearElementsForExport = (
export const clearElementsForLocalStorage = ( export const clearElementsForLocalStorage = (
elements: readonly ExcalidrawElement[], elements: readonly ExcalidrawElement[],
) => _clearElements(elements); ) => _clearElements(elements);
export * from "./align";
export * from "./binding";
export * from "./bounds";
export * from "./collision";
export * from "./comparisons";
export * from "./containerCache";
export * from "./cropElement";
export * from "./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";

View file

@ -67,7 +67,7 @@ import {
import { getLockedLinearCursorAlignSize } from "./sizeHelpers"; import { getLockedLinearCursorAlignSize } from "./sizeHelpers";
import type Scene from "./Scene"; import type { Scene } from "./Scene";
import type { Bounds } from "./bounds"; import type { Bounds } from "./bounds";
import type { import type {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,21 +1,21 @@
import { KEYS, updateActiveTool } from "@excalidraw/common"; import { KEYS, updateActiveTool } from "@excalidraw/common";
import { getNonDeletedElements } from "@excalidraw/element"; import { getNonDeletedElements } from "@excalidraw/element";
import { fixBindingsAfterDeletion } from "@excalidraw/element/binding"; import { fixBindingsAfterDeletion } 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 { getContainerElement } from "@excalidraw/element/textElement"; import { getContainerElement } from "@excalidraw/element";
import { import {
isBoundToContainer, isBoundToContainer,
isElbowArrow, isElbowArrow,
isFrameLikeElement, isFrameLikeElement,
} from "@excalidraw/element/typeChecks"; } from "@excalidraw/element";
import { getFrameChildren } from "@excalidraw/element/frame"; import { getFrameChildren } from "@excalidraw/element";
import { import {
getElementsInGroup, getElementsInGroup,
selectGroupsForSelectedElements, selectGroupsForSelectedElements,
} from "@excalidraw/element/groups"; } from "@excalidraw/element";
import type { ExcalidrawElement } from "@excalidraw/element/types"; import type { ExcalidrawElement } from "@excalidraw/element/types";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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"; import { arrayToMap } from "@excalidraw/common";

View file

@ -1,4 +1,4 @@
import { isEmbeddableElement } from "@excalidraw/element/typeChecks"; import { isEmbeddableElement } from "@excalidraw/element";
import { KEYS, getShortcutKey } from "@excalidraw/common"; import { KEYS, getShortcutKey } from "@excalidraw/common";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -12,36 +12,30 @@ import {
BindableElement, BindableElement,
bindingProperties, bindingProperties,
updateBoundElements, updateBoundElements,
} from "@excalidraw/element/binding"; } from "@excalidraw/element";
import { LinearElementEditor } from "@excalidraw/element/linearElementEditor"; import { LinearElementEditor } from "@excalidraw/element";
import { import { mutateElement, newElementWith } from "@excalidraw/element";
mutateElement,
newElementWith,
} from "@excalidraw/element/mutateElement";
import { import {
getBoundTextElementId, getBoundTextElementId,
redrawTextBoundingBox, redrawTextBoundingBox,
} from "@excalidraw/element/textElement"; } from "@excalidraw/element";
import { import {
hasBoundTextElement, hasBoundTextElement,
isBindableElement, isBindableElement,
isBoundToContainer, isBoundToContainer,
isImageElement, isImageElement,
isTextElement, isTextElement,
} from "@excalidraw/element/typeChecks"; } from "@excalidraw/element";
import { getNonDeletedGroupIds } from "@excalidraw/element/groups"; import { getNonDeletedGroupIds } from "@excalidraw/element";
import { import { orderByFractionalIndex, syncMovedIndices } from "@excalidraw/element";
orderByFractionalIndex,
syncMovedIndices,
} from "@excalidraw/element/fractionalIndex";
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 { import type {
ExcalidrawElement, ExcalidrawElement,

View file

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

View file

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

View file

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

View file

@ -103,10 +103,7 @@ import {
CLASSES, CLASSES,
} from "@excalidraw/common"; } from "@excalidraw/common";
import { import { getCommonBounds, getElementAbsoluteCoords } from "@excalidraw/element";
getCommonBounds,
getElementAbsoluteCoords,
} from "@excalidraw/element/bounds";
import { import {
bindOrUnbindLinearElement, bindOrUnbindLinearElement,
@ -119,11 +116,11 @@ import {
shouldEnableBindingForPointerEvent, shouldEnableBindingForPointerEvent,
updateBoundElements, updateBoundElements,
getSuggestedBindingsForArrows, getSuggestedBindingsForArrows,
} from "@excalidraw/element/binding"; } from "@excalidraw/element";
import { LinearElementEditor } from "@excalidraw/element/linearElementEditor"; import { LinearElementEditor } from "@excalidraw/element";
import { newElementWith } from "@excalidraw/element/mutateElement"; import { newElementWith } from "@excalidraw/element";
import { import {
newFrameElement, newFrameElement,
@ -137,12 +134,9 @@ import {
newLinearElement, newLinearElement,
newTextElement, newTextElement,
refreshTextDimensions, refreshTextDimensions,
} from "@excalidraw/element/newElement"; } from "@excalidraw/element";
import { import { deepCopyElement, duplicateElements } from "@excalidraw/element";
deepCopyElement,
duplicateElements,
} from "@excalidraw/element/duplicate";
import { import {
hasBoundTextElement, hasBoundTextElement,
@ -165,7 +159,7 @@ import {
isFlowchartNodeElement, isFlowchartNodeElement,
isBindableElement, isBindableElement,
isTextElement, isTextElement,
} from "@excalidraw/element/typeChecks"; } from "@excalidraw/element";
import { import {
getLockedLinearCursorAlignSize, getLockedLinearCursorAlignSize,
@ -173,28 +167,28 @@ import {
isElementCompletelyInViewport, isElementCompletelyInViewport,
isElementInViewport, isElementInViewport,
isInvisiblySmallElement, isInvisiblySmallElement,
} from "@excalidraw/element/sizeHelpers"; } from "@excalidraw/element";
import { import {
getBoundTextShape, getBoundTextShape,
getCornerRadius, getCornerRadius,
getElementShape, getElementShape,
isPathALoop, isPathALoop,
} from "@excalidraw/element/shapes"; } from "@excalidraw/element";
import { import {
createSrcDoc, createSrcDoc,
embeddableURLValidator, embeddableURLValidator,
maybeParseEmbedSrc, maybeParseEmbedSrc,
getEmbedLink, getEmbedLink,
} from "@excalidraw/element/embeddable"; } from "@excalidraw/element";
import { import {
getInitializedImageElements, getInitializedImageElements,
loadHTMLImageElement, loadHTMLImageElement,
normalizeSVG, normalizeSVG,
updateImageCache as _updateImageCache, updateImageCache as _updateImageCache,
} from "@excalidraw/element/image"; } from "@excalidraw/element";
import { import {
getBoundTextElement, getBoundTextElement,
@ -202,9 +196,9 @@ import {
getContainerElement, getContainerElement,
isValidTextContainer, isValidTextContainer,
redrawTextBoundingBox, redrawTextBoundingBox,
} from "@excalidraw/element/textElement"; } from "@excalidraw/element";
import { shouldShowBoundingBox } from "@excalidraw/element/transformHandles"; import { shouldShowBoundingBox } from "@excalidraw/element";
import { import {
getFrameChildren, getFrameChildren,
@ -221,30 +215,27 @@ import {
getFrameLikeTitle, getFrameLikeTitle,
getElementsOverlappingFrame, getElementsOverlappingFrame,
filterElementsEligibleAsFrameChildren, filterElementsEligibleAsFrameChildren,
} from "@excalidraw/element/frame"; } from "@excalidraw/element";
import { import {
hitElementBoundText, hitElementBoundText,
hitElementBoundingBoxOnly, hitElementBoundingBoxOnly,
hitElementItself, hitElementItself,
} from "@excalidraw/element/collision"; } from "@excalidraw/element";
import { getVisibleSceneBounds } from "@excalidraw/element/bounds"; import { getVisibleSceneBounds } from "@excalidraw/element";
import { import {
FlowChartCreator, FlowChartCreator,
FlowChartNavigator, FlowChartNavigator,
getLinkDirectionFromKey, getLinkDirectionFromKey,
} from "@excalidraw/element/flowchart"; } from "@excalidraw/element";
import { cropElement } from "@excalidraw/element/cropElement"; import { cropElement } from "@excalidraw/element";
import { wrapText } from "@excalidraw/element/textWrapping"; import { wrapText } from "@excalidraw/element";
import { import { isElementLink, parseElementLinkFromURL } from "@excalidraw/element";
isElementLink,
parseElementLinkFromURL,
} from "@excalidraw/element/elementLink";
import { import {
isMeasureTextSupported, isMeasureTextSupported,
@ -254,11 +245,11 @@ import {
getApproxMinLineWidth, getApproxMinLineWidth,
getApproxMinLineHeight, getApproxMinLineHeight,
getMinTextElementWidth, getMinTextElementWidth,
} from "@excalidraw/element/textMeasurements"; } from "@excalidraw/element";
import { ShapeCache } from "@excalidraw/element/ShapeCache"; import { ShapeCache } from "@excalidraw/element";
import { getRenderOpacity } from "@excalidraw/element/renderElement"; import { getRenderOpacity } from "@excalidraw/element";
import { import {
editGroupForSelectedElement, editGroupForSelectedElement,
@ -268,42 +259,39 @@ import {
isElementInGroup, isElementInGroup,
isSelectedViaGroup, isSelectedViaGroup,
selectGroupsForSelectedElements, selectGroupsForSelectedElements,
} from "@excalidraw/element/groups"; } from "@excalidraw/element";
import { import { syncInvalidIndices, syncMovedIndices } from "@excalidraw/element";
syncInvalidIndices,
syncMovedIndices,
} from "@excalidraw/element/fractionalIndex";
import { import {
excludeElementsInFramesFromSelection, excludeElementsInFramesFromSelection,
getSelectionStateForElements, getSelectionStateForElements,
makeNextSelectedElementIds, makeNextSelectedElementIds,
} from "@excalidraw/element/selection"; } from "@excalidraw/element";
import { import {
getResizeOffsetXY, getResizeOffsetXY,
getResizeArrowDirection, getResizeArrowDirection,
transformElements, transformElements,
} from "@excalidraw/element/resizeElements"; } from "@excalidraw/element";
import { import {
getCursorForResizingElement, getCursorForResizingElement,
getElementWithTransformHandleType, getElementWithTransformHandleType,
getTransformHandleTypeFromCoords, getTransformHandleTypeFromCoords,
} from "@excalidraw/element/resizeTest"; } from "@excalidraw/element";
import { import {
dragNewElement, dragNewElement,
dragSelectedElements, dragSelectedElements,
getDragOffsetXY, getDragOffsetXY,
} from "@excalidraw/element/dragElements"; } from "@excalidraw/element";
import { isNonDeletedElement } from "@excalidraw/element"; import { isNonDeletedElement } from "@excalidraw/element";
import Scene from "@excalidraw/element/Scene"; import { Scene } from "@excalidraw/element";
import type { ElementUpdate } from "@excalidraw/element/mutateElement"; import type { ElementUpdate } from "@excalidraw/element";
import type { LocalPoint, Radians } from "@excalidraw/math"; import type { LocalPoint, Radians } from "@excalidraw/math";

View file

@ -1,6 +1,6 @@
import { type ReactNode, useEffect, useMemo, useRef, useState } from "react"; import { type ReactNode, useEffect, useMemo, useRef, useState } from "react";
import { updateElbowArrowPoints } from "@excalidraw/element/elbowArrow"; import { updateElbowArrowPoints } from "@excalidraw/element";
import { pointFrom, pointRotateRads, type LocalPoint } from "@excalidraw/math"; import { pointFrom, pointRotateRads, type LocalPoint } from "@excalidraw/math";
@ -13,21 +13,21 @@ import {
isLinearElement, isLinearElement,
isSharpArrow, isSharpArrow,
isUsingAdaptiveRadius, isUsingAdaptiveRadius,
} from "@excalidraw/element/typeChecks"; } from "@excalidraw/element";
import { import {
getCommonBoundingBox, getCommonBoundingBox,
getElementAbsoluteCoords, getElementAbsoluteCoords,
} from "@excalidraw/element/bounds"; } from "@excalidraw/element";
import { import {
getBoundTextElement, getBoundTextElement,
getBoundTextMaxHeight, getBoundTextMaxHeight,
getBoundTextMaxWidth, getBoundTextMaxWidth,
redrawTextBoundingBox, redrawTextBoundingBox,
} from "@excalidraw/element/textElement"; } from "@excalidraw/element";
import { wrapText } from "@excalidraw/element/textWrapping"; import { wrapText } from "@excalidraw/element";
import { import {
assertNever, assertNever,
@ -37,17 +37,17 @@ import {
updateActiveTool, updateActiveTool,
} from "@excalidraw/common"; } from "@excalidraw/common";
import { measureText } from "@excalidraw/element/textMeasurements"; import { measureText } from "@excalidraw/element";
import { LinearElementEditor } from "@excalidraw/element/linearElementEditor"; import { LinearElementEditor } from "@excalidraw/element";
import { import {
newArrowElement, newArrowElement,
newElement, newElement,
newLinearElement, newLinearElement,
} from "@excalidraw/element/newElement"; } from "@excalidraw/element";
import { ShapeCache } from "@excalidraw/element/ShapeCache"; import { ShapeCache } from "@excalidraw/element";
import type { import type {
ConvertibleGenericTypes, ConvertibleGenericTypes,
@ -66,7 +66,7 @@ import type {
FixedSegment, FixedSegment,
} from "@excalidraw/element/types"; } from "@excalidraw/element/types";
import type Scene from "@excalidraw/element/Scene"; import type Scene from "@excalidraw/element";
import { import {
bumpVersion, bumpVersion,

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -5,9 +5,9 @@ import { Fragment, memo, useEffect, useRef, useState } from "react";
import { CLASSES, EVENT } from "@excalidraw/common"; 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 { import {
KEYS, KEYS,
@ -16,8 +16,8 @@ import {
getFontString, getFontString,
} from "@excalidraw/common"; } from "@excalidraw/common";
import { newTextElement } from "@excalidraw/element/newElement"; import { newTextElement } from "@excalidraw/element";
import { isTextElement } from "@excalidraw/element/typeChecks"; import { isTextElement } from "@excalidraw/element";
import type { ExcalidrawTextElement } from "@excalidraw/element/types"; import type { ExcalidrawTextElement } from "@excalidraw/element/types";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,16 +1,13 @@
import { pointFrom, pointRotateRads } from "@excalidraw/math"; import { pointFrom, pointRotateRads } from "@excalidraw/math";
import { getBoundTextElement } from "@excalidraw/element/textElement"; import { getBoundTextElement } from "@excalidraw/element";
import { import { isFrameLikeElement, isTextElement } from "@excalidraw/element";
isFrameLikeElement,
isTextElement,
} from "@excalidraw/element/typeChecks";
import { import {
getSelectedGroupIds, getSelectedGroupIds,
getElementsInGroup, getElementsInGroup,
isInGroup, isInGroup,
} from "@excalidraw/element/groups"; } from "@excalidraw/element";
import type { Radians } from "@excalidraw/math"; import type { Radians } from "@excalidraw/math";
@ -20,7 +17,7 @@ import type {
NonDeletedExcalidrawElement, NonDeletedExcalidrawElement,
} from "@excalidraw/element/types"; } from "@excalidraw/element/types";
import type Scene from "@excalidraw/element/Scene"; import type Scene from "@excalidraw/element";
import { updateBindings } from "../../../element/src/binding"; import { updateBindings } from "../../../element/src/binding";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -19,47 +19,44 @@ import {
BINDING_HIGHLIGHT_OFFSET, BINDING_HIGHLIGHT_OFFSET,
BINDING_HIGHLIGHT_THICKNESS, BINDING_HIGHLIGHT_THICKNESS,
maxBindingGap, maxBindingGap,
} from "@excalidraw/element/binding"; } from "@excalidraw/element";
import { LinearElementEditor } from "@excalidraw/element/linearElementEditor"; import { LinearElementEditor } from "@excalidraw/element";
import { import {
getOmitSidesForDevice, getOmitSidesForDevice,
getTransformHandles, getTransformHandles,
getTransformHandlesFromCoords, getTransformHandlesFromCoords,
shouldShowBoundingBox, shouldShowBoundingBox,
} from "@excalidraw/element/transformHandles"; } from "@excalidraw/element";
import { import {
isElbowArrow, isElbowArrow,
isFrameLikeElement, isFrameLikeElement,
isImageElement, isImageElement,
isLinearElement, isLinearElement,
isTextElement, isTextElement,
} from "@excalidraw/element/typeChecks"; } from "@excalidraw/element";
import { getCornerRadius } from "@excalidraw/element/shapes"; import { getCornerRadius } from "@excalidraw/element";
import { renderSelectionElement } from "@excalidraw/element/renderElement"; import { renderSelectionElement } from "@excalidraw/element";
import { import {
isSelectedViaGroup, isSelectedViaGroup,
getSelectedGroupIds, getSelectedGroupIds,
getElementsInGroup, getElementsInGroup,
selectGroupsFromGivenElements, selectGroupsFromGivenElements,
} from "@excalidraw/element/groups"; } from "@excalidraw/element";
import { import { getCommonBounds, getElementAbsoluteCoords } from "@excalidraw/element";
getCommonBounds,
getElementAbsoluteCoords,
} from "@excalidraw/element/bounds";
import type { import type {
SuggestedBinding, SuggestedBinding,
SuggestedPointBinding, SuggestedPointBinding,
} from "@excalidraw/element/binding"; } from "@excalidraw/element";
import type { import type {
TransformHandles, TransformHandles,
TransformHandleType, TransformHandleType,
} from "@excalidraw/element/transformHandles"; } from "@excalidraw/element";
import type { import type {
ElementsMap, ElementsMap,

View file

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

View file

@ -1,21 +1,21 @@
import { FRAME_STYLE, throttleRAF } from "@excalidraw/common"; import { FRAME_STYLE, throttleRAF } from "@excalidraw/common";
import { isElementLink } from "@excalidraw/element/elementLink"; import { isElementLink } from "@excalidraw/element";
import { createPlaceholderEmbeddableLabel } from "@excalidraw/element/embeddable"; import { createPlaceholderEmbeddableLabel } from "@excalidraw/element";
import { getBoundTextElement } from "@excalidraw/element/textElement"; import { getBoundTextElement } from "@excalidraw/element";
import { import {
isEmbeddableElement, isEmbeddableElement,
isIframeLikeElement, isIframeLikeElement,
isTextElement, isTextElement,
} from "@excalidraw/element/typeChecks"; } from "@excalidraw/element";
import { import {
elementOverlapsWithFrame, elementOverlapsWithFrame,
getTargetFrame, getTargetFrame,
shouldApplyFrameClip, 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 { import type {
ElementsMap, ElementsMap,

View file

@ -10,36 +10,30 @@ import {
} from "@excalidraw/common"; } from "@excalidraw/common";
import { normalizeLink, toValidURL } from "@excalidraw/common"; import { normalizeLink, toValidURL } from "@excalidraw/common";
import { hashString } from "@excalidraw/element"; import { hashString } from "@excalidraw/element";
import { getUncroppedWidthAndHeight } from "@excalidraw/element/cropElement"; import { getUncroppedWidthAndHeight } from "@excalidraw/element";
import { import {
createPlaceholderEmbeddableLabel, createPlaceholderEmbeddableLabel,
getEmbedLink, getEmbedLink,
} from "@excalidraw/element/embeddable"; } from "@excalidraw/element";
import { LinearElementEditor } from "@excalidraw/element/linearElementEditor"; import { LinearElementEditor } from "@excalidraw/element";
import { import { getBoundTextElement, getContainerElement } from "@excalidraw/element";
getBoundTextElement, import { getLineHeightInPx } from "@excalidraw/element";
getContainerElement,
} from "@excalidraw/element/textElement";
import { getLineHeightInPx } from "@excalidraw/element/textMeasurements";
import { import {
isArrowElement, isArrowElement,
isIframeLikeElement, isIframeLikeElement,
isInitializedImageElement, isInitializedImageElement,
isTextElement, 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 { import { getFreeDrawSvgPath, IMAGE_INVERT_FILTER } from "@excalidraw/element";
getFreeDrawSvgPath,
IMAGE_INVERT_FILTER,
} from "@excalidraw/element/renderElement";
import { getElementAbsoluteCoords } from "@excalidraw/element/bounds"; import { getElementAbsoluteCoords } from "@excalidraw/element";
import type { import type {
ExcalidrawElement, ExcalidrawElement,

View file

@ -1,5 +1,5 @@
import { isElementInViewport } from "@excalidraw/element/sizeHelpers"; import { isElementInViewport } from "@excalidraw/element";
import { isImageElement } from "@excalidraw/element/typeChecks"; import { isImageElement } from "@excalidraw/element";
import { memoize, toBrandedType } from "@excalidraw/common"; import { memoize, toBrandedType } from "@excalidraw/common";
@ -9,7 +9,7 @@ import type {
NonDeletedExcalidrawElement, NonDeletedExcalidrawElement,
} from "@excalidraw/element/types"; } from "@excalidraw/element/types";
import type Scene from "@excalidraw/element/Scene"; import type Scene from "@excalidraw/element";
import { renderInteractiveSceneThrottled } from "../renderer/interactiveScene"; import { renderInteractiveSceneThrottled } from "../renderer/interactiveScene";
import { renderStaticSceneThrottled } from "../renderer/staticScene"; import { renderStaticSceneThrottled } from "../renderer/staticScene";

View file

@ -15,34 +15,31 @@ import {
toBrandedType, toBrandedType,
} from "@excalidraw/common"; } from "@excalidraw/common";
import { import { getCommonBounds, getElementAbsoluteCoords } from "@excalidraw/element";
getCommonBounds,
getElementAbsoluteCoords,
} from "@excalidraw/element/bounds";
import { import {
getInitializedImageElements, getInitializedImageElements,
updateImageCache, 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 { import {
getElementsOverlappingFrame, getElementsOverlappingFrame,
getFrameLikeElements, getFrameLikeElements,
getFrameLikeTitle, getFrameLikeTitle,
getRootElements, 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 { 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 { import type {
ExcalidrawElement, ExcalidrawElement,

View file

@ -4,7 +4,7 @@ export {
getCommonAttributeOfSelectedElements, getCommonAttributeOfSelectedElements,
getSelectedElements, getSelectedElements,
getTargetElements, getTargetElements,
} from "@excalidraw/element/selection"; } from "@excalidraw/element";
export { calculateScrollCenter } from "./scroll"; export { calculateScrollCenter } from "./scroll";
export { export {
hasBackground, hasBackground,
@ -12,7 +12,7 @@ export {
hasStrokeStyle, hasStrokeStyle,
canHaveArrowheads, canHaveArrowheads,
canChangeRoundness, canChangeRoundness,
} from "@excalidraw/element/comparisons"; } from "@excalidraw/element";
export { export {
getNormalizedZoom, getNormalizedZoom,
getNormalizedGridSize, getNormalizedGridSize,

View file

@ -4,9 +4,9 @@ import {
viewportCoordsToSceneCoords, viewportCoordsToSceneCoords,
} from "@excalidraw/common"; } 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"; import type { ExcalidrawElement } from "@excalidraw/element/types";

View file

@ -1,6 +1,6 @@
import { getGlobalCSSVariable } from "@excalidraw/common"; import { getGlobalCSSVariable } from "@excalidraw/common";
import { getCommonBounds } from "@excalidraw/element/bounds"; import { getCommonBounds } from "@excalidraw/element";
import { getLanguage } from "../i18n"; import { getLanguage } from "../i18n";

View file

@ -12,23 +12,20 @@ import {
getCommonBounds, getCommonBounds,
getDraggedElementsBounds, getDraggedElementsBounds,
getElementAbsoluteCoords, getElementAbsoluteCoords,
} from "@excalidraw/element/bounds"; } from "@excalidraw/element";
import { import { isBoundToContainer, isFrameLikeElement } from "@excalidraw/element";
isBoundToContainer,
isFrameLikeElement,
} from "@excalidraw/element/typeChecks";
import { getMaximumGroups } from "@excalidraw/element/groups"; import { getMaximumGroups } from "@excalidraw/element";
import { import {
getSelectedElements, getSelectedElements,
getVisibleAndNonSelectedElements, getVisibleAndNonSelectedElements,
} from "@excalidraw/element/selection"; } from "@excalidraw/element";
import type { InclusiveRange } from "@excalidraw/math"; import type { InclusiveRange } from "@excalidraw/math";
import type { Bounds } from "@excalidraw/element/bounds"; import type { Bounds } from "@excalidraw/element";
import type { MaybeTransformHandleType } from "@excalidraw/element/transformHandles"; import type { MaybeTransformHandleType } from "@excalidraw/element";
import type { import type {
ElementsMap, ElementsMap,
ExcalidrawElement, ExcalidrawElement,

View file

@ -1,8 +1,8 @@
import { isDevEnv, isShallowEqual, isTestEnv } from "@excalidraw/common"; 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"; import type { OrderedExcalidrawElement } from "@excalidraw/element/types";

View file

@ -1,11 +1,11 @@
import React from "react"; import React from "react";
import { vi } from "vitest"; import { vi } from "vitest";
import { getLineHeightInPx } from "@excalidraw/element/textMeasurements"; import { getLineHeightInPx } from "@excalidraw/element";
import { KEYS, arrayToMap, getLineHeight } from "@excalidraw/common"; import { KEYS, arrayToMap, getLineHeight } from "@excalidraw/common";
import { getElementBounds } from "@excalidraw/element/bounds"; import { getElementBounds } from "@excalidraw/element";
import { createPasteEvent, serializeAsClipboardJSON } from "../clipboard"; import { createPasteEvent, serializeAsClipboardJSON } from "../clipboard";

View file

@ -3,7 +3,7 @@ import { vi } from "vitest";
import { KEYS, cloneJSON } from "@excalidraw/common"; import { KEYS, cloneJSON } from "@excalidraw/common";
import { duplicateElement } from "@excalidraw/element/duplicate"; import { duplicateElement } from "@excalidraw/element";
import type { import type {
ExcalidrawImageElement, ExcalidrawImageElement,

View file

@ -1,4 +1,4 @@
import { syncInvalidIndices } from "@excalidraw/element/fractionalIndex"; import { syncInvalidIndices } from "@excalidraw/element";
import { randomInteger, cloneJSON } from "@excalidraw/common"; import { randomInteger, cloneJSON } from "@excalidraw/common";

View file

@ -3,8 +3,8 @@ import { vi } from "vitest";
import { DEFAULT_SIDEBAR, FONT_FAMILY, ROUNDNESS } from "@excalidraw/common"; import { DEFAULT_SIDEBAR, FONT_FAMILY, ROUNDNESS } from "@excalidraw/common";
import { newElementWith } from "@excalidraw/element/mutateElement"; import { newElementWith } from "@excalidraw/element";
import * as sizeHelpers from "@excalidraw/element/sizeHelpers"; import * as sizeHelpers from "@excalidraw/element";
import type { import type {
ExcalidrawElement, ExcalidrawElement,

View file

@ -5,9 +5,9 @@ import { ROUNDNESS, KEYS, arrayToMap, cloneJSON } from "@excalidraw/common";
import { pointFrom, type Radians } from "@excalidraw/math"; import { pointFrom, type Radians } from "@excalidraw/math";
import { getBoundTextElementPosition } from "@excalidraw/element/textElement"; import { getBoundTextElementPosition } from "@excalidraw/element";
import { getElementAbsoluteCoords } from "@excalidraw/element/bounds"; import { getElementAbsoluteCoords } from "@excalidraw/element";
import { newLinearElement } from "@excalidraw/element/newElement"; import { newLinearElement } from "@excalidraw/element";
import type { LocalPoint } from "@excalidraw/math"; import type { LocalPoint } from "@excalidraw/math";

View file

@ -17,11 +17,11 @@ import {
newLinearElement, newLinearElement,
newMagicFrameElement, newMagicFrameElement,
newTextElement, newTextElement,
} from "@excalidraw/element/newElement"; } from "@excalidraw/element";
import { isLinearElementType } from "@excalidraw/element/typeChecks"; import { isLinearElementType } from "@excalidraw/element";
import { getSelectedElements } from "@excalidraw/element/selection"; import { getSelectedElements } from "@excalidraw/element";
import { selectGroupsForSelectedElements } from "@excalidraw/element/groups"; import { selectGroupsForSelectedElements } from "@excalidraw/element";
import type { import type {
ExcalidrawElement, ExcalidrawElement,

View file

@ -1,10 +1,7 @@
import { pointFrom, pointRotateRads } from "@excalidraw/math"; import { pointFrom, pointRotateRads } from "@excalidraw/math";
import { import { getCommonBounds, getElementPointsCoords } from "@excalidraw/element";
getCommonBounds, import { cropElement } from "@excalidraw/element";
getElementPointsCoords,
} from "@excalidraw/element/bounds";
import { cropElement } from "@excalidraw/element/cropElement";
import { import {
getTransformHandles, getTransformHandles,
getTransformHandlesFromCoords, getTransformHandlesFromCoords,
@ -12,18 +9,18 @@ import {
OMIT_SIDES_FOR_MULTIPLE_ELEMENTS, OMIT_SIDES_FOR_MULTIPLE_ELEMENTS,
type TransformHandle, type TransformHandle,
type TransformHandleDirection, type TransformHandleDirection,
} from "@excalidraw/element/transformHandles"; } from "@excalidraw/element";
import { import {
isLinearElement, isLinearElement,
isFreeDrawElement, isFreeDrawElement,
isTextElement, isTextElement,
isFrameLikeElement, isFrameLikeElement,
} from "@excalidraw/element/typeChecks"; } from "@excalidraw/element";
import { KEYS, arrayToMap, elementCenterPoint } from "@excalidraw/common"; import { KEYS, arrayToMap, elementCenterPoint } from "@excalidraw/common";
import type { GlobalPoint, LocalPoint, Radians } from "@excalidraw/math"; import type { GlobalPoint, LocalPoint, Radians } from "@excalidraw/math";
import type { TransformHandleType } from "@excalidraw/element/transformHandles"; import type { TransformHandleType } from "@excalidraw/element";
import type { import type {
ExcalidrawElement, ExcalidrawElement,
ExcalidrawLinearElement, ExcalidrawLinearElement,

View file

@ -8,7 +8,7 @@ import {
import { vi } from "vitest"; import { vi } from "vitest";
import { pointFrom } from "@excalidraw/math"; import { pointFrom } from "@excalidraw/math";
import { newElementWith } from "@excalidraw/element/mutateElement"; import { newElementWith } from "@excalidraw/element";
import { import {
EXPORT_DATA_TYPES, EXPORT_DATA_TYPES,

View file

@ -22,7 +22,7 @@ import {
type ElementsSegmentsMap, type ElementsSegmentsMap,
} from "@excalidraw/math"; } from "@excalidraw/math";
import { getElementLineSegments } from "@excalidraw/element/bounds"; import { getElementLineSegments } from "@excalidraw/element";
import type { ExcalidrawElement } from "@excalidraw/element/types"; import type { ExcalidrawElement } from "@excalidraw/element/types";

Some files were not shown because too many files have changed in this diff Show more