diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index 7b703ce9b..752cb251f 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -364,7 +364,7 @@ import { hitElementBoundingBoxOnly, hitElementItself, } from "../element/collision"; -import { textWysiwyg } from "../element/textWysiwyg"; +import { textWysiwyg } from "../wysiwyg/textWysiwyg"; import { isOverScrollBars } from "../scene/scrollbars"; import { syncInvalidIndices, syncMovedIndices } from "../fractionalIndex"; import { getVisibleSceneBounds } from "../element/bounds"; diff --git a/packages/element/textWysiwyg.test.tsx b/packages/excalidraw/wysiwyg/textWysiwyg.test.tsx similarity index 99% rename from packages/element/textWysiwyg.test.tsx rename to packages/excalidraw/wysiwyg/textWysiwyg.test.tsx index 11c700e33..cae3d4069 100644 --- a/packages/element/textWysiwyg.test.tsx +++ b/packages/excalidraw/wysiwyg/textWysiwyg.test.tsx @@ -1,6 +1,11 @@ import { pointFrom } from "@excalidraw/math"; +import { getOriginalContainerHeightFromCache } from "@excalidraw/element/containerCache"; import { queryByText } from "@testing-library/react"; -import React from "react"; + +import type { + ExcalidrawTextElement, + ExcalidrawTextElementWithContainer, +} from "@excalidraw/element/types"; import { FONT_FAMILY, TEXT_ALIGN, VERTICAL_ALIGN } from "../constants"; import { Excalidraw } from "../index"; @@ -20,13 +25,6 @@ import { restoreOriginalGetBoundingClientRect, } from "../tests/test-utils"; -import { getOriginalContainerHeightFromCache } from "./containerCache"; - -import type { - ExcalidrawTextElement, - ExcalidrawTextElementWithContainer, -} from "./types"; - unmountComponent(); const tab = " "; diff --git a/packages/element/textWysiwyg.tsx b/packages/excalidraw/wysiwyg/textWysiwyg.tsx similarity index 97% rename from packages/element/textWysiwyg.tsx rename to packages/excalidraw/wysiwyg/textWysiwyg.tsx index 1d0c19de3..773c0be43 100644 --- a/packages/element/textWysiwyg.tsx +++ b/packages/excalidraw/wysiwyg/textWysiwyg.tsx @@ -1,29 +1,10 @@ -import { - actionResetZoom, - actionZoomIn, - actionZoomOut, -} from "../actions/actionCanvas"; -import { - actionDecreaseFontSize, - actionIncreaseFontSize, -} from "../actions/actionProperties"; -import { parseClipboard } from "../clipboard"; -import { CLASSES, POINTER_BUTTON } from "../constants"; -import { CODES, KEYS } from "../keys"; -import Scene from "../scene/Scene"; -import { - isWritableElement, - getFontString, - getFontFamilyString, - isTestEnv, -} from "../utils"; - import { originalContainerCache, updateOriginalContainerCache, -} from "./containerCache"; -import { LinearElementEditor } from "./linearElementEditor"; -import { bumpVersion, mutateElement } from "./mutateElement"; +} from "@excalidraw/element/containerCache"; + +import { LinearElementEditor } from "@excalidraw/element/linearElementEditor"; +import { bumpVersion, mutateElement } from "@excalidraw/element/mutateElement"; import { getBoundTextElementId, getContainerElement, @@ -34,22 +15,43 @@ import { computeContainerDimensionForBoundText, computeBoundTextPosition, getBoundTextElement, -} from "./textElement"; -import { getTextWidth } from "./textMeasurements"; -import { normalizeText } from "./textMeasurements"; -import { wrapText } from "./textWrapping"; +} from "@excalidraw/element/textElement"; +import { getTextWidth } from "@excalidraw/element/textMeasurements"; +import { normalizeText } from "@excalidraw/element/textMeasurements"; +import { wrapText } from "@excalidraw/element/textWrapping"; import { isArrowElement, isBoundToContainer, isTextElement, -} from "./typeChecks"; +} from "@excalidraw/element/typeChecks"; import type { ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawTextElementWithContainer, ExcalidrawTextElement, -} from "./types"; +} from "@excalidraw/element/types"; + +import { + isWritableElement, + getFontString, + getFontFamilyString, + isTestEnv, +} from "../utils"; +import Scene from "../scene/Scene"; +import { CODES, KEYS } from "../keys"; +import { CLASSES, POINTER_BUTTON } from "../constants"; +import { parseClipboard } from "../clipboard"; +import { + actionDecreaseFontSize, + actionIncreaseFontSize, +} from "../actions/actionProperties"; +import { + actionResetZoom, + actionZoomIn, + actionZoomOut, +} from "../actions/actionCanvas"; + import type App from "../components/App"; import type { AppState } from "../types";