From d214404244e6c6a36dc997da49d7dcee5a40e04d Mon Sep 17 00:00:00 2001 From: Mark Tolmacs Date: Thu, 15 May 2025 12:53:44 +0200 Subject: [PATCH] Fix circular reference --- packages/excalidraw/components/App.tsx | 104 ++++++------------------- 1 file changed, 24 insertions(+), 80 deletions(-) diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index 2766f36b8..3ef3ce84a 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -17,7 +17,6 @@ import { vectorDot, vectorNormalize, } from "@excalidraw/math"; -import { isPointInShape } from "@excalidraw/element/collision"; import { COLOR_PALETTE, @@ -103,9 +102,9 @@ import { Emitter, } from "@excalidraw/common"; -import { getCommonBounds, getElementAbsoluteCoords } from "@excalidraw/element"; - import { + getCommonBounds, + getElementAbsoluteCoords, bindOrUnbindLinearElement, bindOrUnbindLinearElements, fixBindingsAfterDeletion, @@ -116,13 +115,8 @@ import { shouldEnableBindingForPointerEvent, updateBoundElements, getSuggestedBindingsForArrows, -} from "@excalidraw/element"; - -import { LinearElementEditor } from "@excalidraw/element"; - -import { newElementWith } from "@excalidraw/element"; - -import { + LinearElementEditor, + newElementWith, newFrameElement, newFreeDrawElement, newEmbeddableElement, @@ -134,11 +128,9 @@ import { newLinearElement, newTextElement, refreshTextDimensions, -} from "@excalidraw/element"; - -import { deepCopyElement, duplicateElements } from "@excalidraw/element"; - -import { + deepCopyElement, + duplicateElements, + isPointInShape, hasBoundTextElement, isArrowElement, isBindingElement, @@ -159,43 +151,27 @@ import { isFlowchartNodeElement, isBindableElement, isTextElement, -} from "@excalidraw/element"; - -import { getLockedLinearCursorAlignSize, getNormalizedDimensions, isElementCompletelyInViewport, isElementInViewport, isInvisiblySmallElement, -} from "@excalidraw/element"; - -import { getCornerRadius, isPathALoop } from "@excalidraw/element"; - -import { + getCornerRadius, + isPathALoop, createSrcDoc, embeddableURLValidator, maybeParseEmbedSrc, getEmbedLink, -} from "@excalidraw/element"; - -import { getInitializedImageElements, loadHTMLImageElement, normalizeSVG, updateImageCache as _updateImageCache, -} from "@excalidraw/element"; - -import { getBoundTextElement, getContainerCenter, getContainerElement, isValidTextContainer, redrawTextBoundingBox, -} from "@excalidraw/element"; - -import { shouldShowBoundingBox } from "@excalidraw/element"; - -import { + shouldShowBoundingBox, getFrameChildren, isCursorInFrame, addElementsToFrame, @@ -210,29 +186,17 @@ import { getFrameLikeTitle, getElementsOverlappingFrame, filterElementsEligibleAsFrameChildren, -} from "@excalidraw/element"; - -import { hitElementBoundText, hitElementBoundingBoxOnly, hitElementItself, -} from "@excalidraw/element"; - -import { getVisibleSceneBounds } from "@excalidraw/element"; - -import { + getVisibleSceneBounds, FlowChartCreator, FlowChartNavigator, getLinkDirectionFromKey, -} from "@excalidraw/element"; - -import { cropElement } from "@excalidraw/element"; - -import { wrapText } from "@excalidraw/element"; - -import { isElementLink, parseElementLinkFromURL } from "@excalidraw/element"; - -import { + cropElement, + wrapText, + isElementLink, + parseElementLinkFromURL, isMeasureTextSupported, normalizeText, measureText, @@ -240,13 +204,8 @@ import { getApproxMinLineWidth, getApproxMinLineHeight, getMinTextElementWidth, -} from "@excalidraw/element"; - -import { ShapeCache } from "@excalidraw/element"; - -import { getRenderOpacity } from "@excalidraw/element"; - -import { + ShapeCache, + getRenderOpacity, editGroupForSelectedElement, getElementsInGroup, getSelectedGroupIdForElement, @@ -254,42 +213,27 @@ import { isElementInGroup, isSelectedViaGroup, selectGroupsForSelectedElements, -} from "@excalidraw/element"; - -import { syncInvalidIndices, syncMovedIndices } from "@excalidraw/element"; - -import { + syncInvalidIndices, + syncMovedIndices, excludeElementsInFramesFromSelection, getSelectionStateForElements, makeNextSelectedElementIds, -} from "@excalidraw/element"; - -import { getResizeOffsetXY, getResizeArrowDirection, transformElements, -} from "@excalidraw/element"; - -import { getCursorForResizingElement, getElementWithTransformHandleType, getTransformHandleTypeFromCoords, -} from "@excalidraw/element"; - -import { dragNewElement, dragSelectedElements, getDragOffsetXY, + isNonDeletedElement, + Scene, + Store, + CaptureUpdateAction, + type ElementUpdate, } from "@excalidraw/element"; -import { isNonDeletedElement } from "@excalidraw/element"; - -import { Scene } from "@excalidraw/element"; - -import { Store, CaptureUpdateAction } from "@excalidraw/element"; - -import type { ElementUpdate } from "@excalidraw/element"; - import type { LocalPoint, Radians } from "@excalidraw/math"; import type {