From 18a187e4709a7960506edd4230defc3fd8ab2bdb Mon Sep 17 00:00:00 2001 From: Deepen Timalsina Date: Mon, 14 Apr 2025 22:50:46 +0545 Subject: [PATCH] refactor: old paths updated to reflect new path for files in excalidraw package --- .../components/ExampleApp.tsx | 2 +- .../with-script-in-browser/initialData.tsx | 2 +- excalidraw-app/App.tsx | 6 ++-- excalidraw-app/ExcalidrawPlusIframeExport.tsx | 2 +- excalidraw-app/collab/Collab.tsx | 8 ++--- excalidraw-app/collab/CollabError.tsx | 4 +-- excalidraw-app/collab/Portal.tsx | 4 +-- excalidraw-app/components/AI.tsx | 2 +- excalidraw-app/components/AppMainMenu.tsx | 2 +- .../components/AppWelcomeScreen.tsx | 2 +- excalidraw-app/components/DebugCanvas.tsx | 4 +-- excalidraw-app/components/EncryptedIcon.tsx | 4 +-- .../components/ExportToExcalidrawPlus.tsx | 12 +++---- .../components/TopErrorBoundary.tsx | 2 +- excalidraw-app/data/FileManager.ts | 2 +- excalidraw-app/data/LocalData.ts | 6 ++-- excalidraw-app/data/firebase.ts | 8 ++--- excalidraw-app/data/index.ts | 10 +++--- excalidraw-app/data/localStorage.ts | 2 +- excalidraw-app/share/ShareDialog.tsx | 14 ++++---- excalidraw-app/tests/collab.test.tsx | 2 +- packages/element/tests/align.test.tsx | 2 +- packages/element/tests/binding.test.tsx | 2 +- packages/element/tests/duplicate.test.tsx | 2 +- packages/element/tests/elbowArrow.test.tsx | 6 ++-- packages/element/tests/zindex.test.tsx | 2 +- .../excalidraw/src/actions/actionCanvas.tsx | 2 +- .../src/actions/actionDeleteSelected.test.tsx | 8 +++-- .../actions/actionDuplicateSelection.test.tsx | 4 +-- .../src/actions/actionElementLock.test.tsx | 6 ++-- .../src/actions/actionFlip.test.tsx | 4 +-- .../excalidraw/src/actions/actionHistory.tsx | 6 ++-- .../src/actions/actionProperties.test.tsx | 8 +++-- .../src/actions/actionProperties.tsx | 4 +-- packages/excalidraw/src/actions/manager.tsx | 2 +- packages/excalidraw/src/animated-trail.ts | 3 +- packages/excalidraw/src/clipboard.test.ts | 2 +- .../excalidraw/src/components/Actions.tsx | 2 +- packages/excalidraw/src/components/App.tsx | 28 ++++++++-------- .../CommandPalette/CommandPalette.tsx | 2 +- .../src/components/DefaultSidebar.test.tsx | 2 +- .../components/FontPicker/FontPickerList.tsx | 2 +- .../excalidraw/src/components/HintViewer.tsx | 2 +- .../src/components/JSONExportDialog.tsx | 2 +- .../excalidraw/src/components/LayerUI.tsx | 4 +-- .../excalidraw/src/components/LibraryMenu.tsx | 2 +- .../excalidraw/src/components/MobileMenu.tsx | 2 +- .../src/components/PasteChartDialog.tsx | 2 +- .../excalidraw/src/components/SVGLayer.tsx | 2 +- .../src/components/Sidebar/Sidebar.test.tsx | 5 +-- .../Sidebar/siderbar.test.helpers.tsx | 5 +-- .../src/components/Stats/stats.test.tsx | 25 +++++++++----- .../src/components/TTDDialog/TTDDialog.tsx | 2 +- .../components/TTDDialog/TTDDialogTrigger.tsx | 2 +- .../dropdownMenu/DropdownMenu.test.tsx | 9 +++-- .../hoc/withInternalFallback.test.tsx | 6 ++-- .../src/components/hyperlink/Hyperlink.tsx | 2 +- .../src/components/main-menu/DefaultItems.tsx | 2 +- packages/excalidraw/src/data/blob.ts | 2 +- packages/excalidraw/src/data/json.ts | 2 +- packages/excalidraw/src/data/library.ts | 2 +- packages/excalidraw/src/data/restore.ts | 2 +- packages/excalidraw/src/data/types.ts | 2 +- packages/excalidraw/src/fonts/Fonts.ts | 2 +- packages/excalidraw/src/history.ts | 2 +- .../src/hooks/useCreatePortalContainer.ts | 2 +- packages/excalidraw/src/renderer/helpers.ts | 2 +- .../src/renderer/interactiveScene.ts | 4 +-- .../src/renderer/renderNewElementScene.ts | 2 +- .../excalidraw/src/renderer/staticScene.ts | 2 +- .../excalidraw/src/renderer/staticSvgScene.ts | 6 ++-- packages/excalidraw/src/scene/Renderer.ts | 4 +-- packages/excalidraw/src/scene/export.ts | 8 ++--- .../src/wysiwyg/textWysiwyg.test.tsx | 33 +++++++++++-------- .../excalidraw/src/wysiwyg/textWysiwyg.tsx | 10 +++--- packages/excalidraw/tests/App.test.tsx | 2 +- .../excalidraw/tests/actionStyles.test.tsx | 2 +- packages/excalidraw/tests/appState.test.tsx | 2 +- packages/excalidraw/tests/clients.test.ts | 2 +- packages/excalidraw/tests/clipboard.test.tsx | 1 - .../excalidraw/tests/contextmenu.test.tsx | 8 ++--- .../excalidraw/tests/cropElement.test.tsx | 2 +- .../excalidraw/tests/data/reconcile.test.ts | 4 +-- .../excalidraw/tests/data/restore.test.ts | 6 ++-- packages/excalidraw/tests/dragCreate.test.tsx | 4 +-- .../excalidraw/tests/elementLocking.test.tsx | 2 +- packages/excalidraw/tests/export.test.tsx | 10 +++--- packages/excalidraw/tests/flip.test.tsx | 4 +-- packages/excalidraw/tests/helpers/api.ts | 10 +++--- packages/excalidraw/tests/helpers/ui.ts | 2 +- packages/excalidraw/tests/history.test.tsx | 17 ++++++---- packages/excalidraw/tests/lasso.test.tsx | 6 ++-- packages/excalidraw/tests/library.test.tsx | 6 ++-- .../tests/linearElementEditor.test.tsx | 4 +-- packages/excalidraw/tests/move.test.tsx | 6 ++-- .../tests/multiPointCreate.test.tsx | 5 ++- .../excalidraw/tests/regressionTests.test.tsx | 3 +- packages/excalidraw/tests/rotate.test.tsx | 1 - .../excalidraw/tests/scene/export.test.ts | 4 +-- packages/excalidraw/tests/scroll.test.tsx | 2 -- packages/excalidraw/tests/search.test.tsx | 2 -- packages/excalidraw/tests/selection.test.tsx | 7 ++-- packages/excalidraw/tests/shortcuts.test.tsx | 2 -- packages/excalidraw/tests/test-utils.ts | 2 +- packages/utils/src/export.ts | 2 +- packages/utils/tests/export.test.ts | 2 +- packages/utils/tests/utils.unmocked.test.ts | 6 ++-- 107 files changed, 256 insertions(+), 242 deletions(-) diff --git a/examples/with-script-in-browser/components/ExampleApp.tsx b/examples/with-script-in-browser/components/ExampleApp.tsx index 976004f04..7983a1fcc 100644 --- a/examples/with-script-in-browser/components/ExampleApp.tsx +++ b/examples/with-script-in-browser/components/ExampleApp.tsx @@ -9,7 +9,7 @@ import React, { } from "react"; import type * as TExcalidraw from "@excalidraw/excalidraw"; -import type { ImportedLibraryData } from "@excalidraw/excalidraw/data/types"; +import type { ImportedLibraryData } from "@excalidraw/excalidraw/src/data/types"; import type { NonDeletedExcalidrawElement, Theme, diff --git a/examples/with-script-in-browser/initialData.tsx b/examples/with-script-in-browser/initialData.tsx index 0db23d5f2..40580b086 100644 --- a/examples/with-script-in-browser/initialData.tsx +++ b/examples/with-script-in-browser/initialData.tsx @@ -1,4 +1,4 @@ -import type { ExcalidrawElementSkeleton } from "@excalidraw/excalidraw/data/transform"; +import type { ExcalidrawElementSkeleton } from "@excalidraw/excalidraw/src/data/transform"; import type { FileId } from "@excalidraw/excalidraw/element/types"; const elements: ExcalidrawElementSkeleton[] = [ diff --git a/excalidraw-app/App.tsx b/excalidraw-app/App.tsx index 3ef31a49e..1c62bcd80 100644 --- a/excalidraw-app/App.tsx +++ b/excalidraw-app/App.tsx @@ -31,11 +31,11 @@ import { isRunningInIframe, isDevEnv, } from "@excalidraw/common"; -import polyfill from "@excalidraw/excalidraw/src/src/polyfill"; +import polyfill from "@excalidraw/excalidraw/src/polyfill"; import { useCallback, useEffect, useRef, useState } from "react"; import { loadFromBlob } from "@excalidraw/excalidraw/src/data/blob"; import { useCallbackRefState } from "@excalidraw/excalidraw/src/hooks/useCallbackRefState"; -import { t } from "@excalidraw/excalidraw/src/src/i18n"; +import { t } from "@excalidraw/excalidraw/src/i18n"; import { GithubIcon, @@ -73,7 +73,7 @@ import type { BinaryFiles, ExcalidrawInitialDataState, UIAppState, -} from "@excalidraw/excalidraw/src/src/types"; +} from "@excalidraw/excalidraw/src/types"; import type { ResolutionType } from "@excalidraw/common/utility-types"; import type { ResolvablePromise } from "@excalidraw/common/utils"; diff --git a/excalidraw-app/ExcalidrawPlusIframeExport.tsx b/excalidraw-app/ExcalidrawPlusIframeExport.tsx index 898d67dde..737373768 100644 --- a/excalidraw-app/ExcalidrawPlusIframeExport.tsx +++ b/excalidraw-app/ExcalidrawPlusIframeExport.tsx @@ -1,4 +1,4 @@ -import { base64urlToString } from "@excalidraw/excalidraw/data/encode"; +import { base64urlToString } from "@excalidraw/excalidraw/src/data/encode"; import { ExcalidrawError } from "@excalidraw/excalidraw/src/errors"; import { useLayoutEffect, useRef } from "react"; diff --git a/excalidraw-app/collab/Collab.tsx b/excalidraw-app/collab/Collab.tsx index 76f56464f..0c5472fc0 100644 --- a/excalidraw-app/collab/Collab.tsx +++ b/excalidraw-app/collab/Collab.tsx @@ -5,7 +5,7 @@ import { zoomToFitBounds, reconcileElements, } from "@excalidraw/excalidraw/src"; -import { ErrorDialog } from "@excalidraw/excalidraw/components/ErrorDialog"; +import { ErrorDialog } from "@excalidraw/excalidraw/src/components/ErrorDialog"; import { APP_NAME, EVENT } from "@excalidraw/common"; import { IDLE_THRESHOLD, @@ -18,7 +18,7 @@ import { resolvablePromise, throttleRAF, } from "@excalidraw/common"; -import { decryptData } from "@excalidraw/excalidraw/data/encryption"; +import { decryptData } from "@excalidraw/excalidraw/src/data/encryption"; import { getVisibleSceneBounds } from "@excalidraw/element/bounds"; import { newElementWith } from "@excalidraw/element/mutateElement"; import { @@ -35,8 +35,8 @@ import { PureComponent } from "react"; import type { ReconciledExcalidrawElement, RemoteExcalidrawElement, -} from "@excalidraw/excalidraw/data/reconcile"; -import type { ImportedDataState } from "@excalidraw/excalidraw/data/types"; +} from "@excalidraw/excalidraw/src/data/reconcile"; +import type { ImportedDataState } from "@excalidraw/excalidraw/src/data/types"; import type { ExcalidrawElement, FileId, diff --git a/excalidraw-app/collab/CollabError.tsx b/excalidraw-app/collab/CollabError.tsx index eb6f391bc..0e725bd2e 100644 --- a/excalidraw-app/collab/CollabError.tsx +++ b/excalidraw-app/collab/CollabError.tsx @@ -1,5 +1,5 @@ -import { Tooltip } from "@excalidraw/excalidraw/components/Tooltip"; -import { warning } from "@excalidraw/excalidraw/components/icons"; +import { Tooltip } from "@excalidraw/excalidraw/src/components/Tooltip"; +import { warning } from "@excalidraw/excalidraw/src/components/icons"; import clsx from "clsx"; import { useEffect, useRef, useState } from "react"; diff --git a/excalidraw-app/collab/Portal.tsx b/excalidraw-app/collab/Portal.tsx index af8a10123..a2a2f1227 100644 --- a/excalidraw-app/collab/Portal.tsx +++ b/excalidraw-app/collab/Portal.tsx @@ -1,6 +1,6 @@ import { CaptureUpdateAction } from "@excalidraw/excalidraw/src"; -import { trackEvent } from "@excalidraw/excalidraw/analytics"; -import { encryptData } from "@excalidraw/excalidraw/data/encryption"; +import { trackEvent } from "@excalidraw/excalidraw/src/analytics"; +import { encryptData } from "@excalidraw/excalidraw/src/data/encryption"; import { newElementWith } from "@excalidraw/element/mutateElement"; import throttle from "lodash.throttle"; diff --git a/excalidraw-app/components/AI.tsx b/excalidraw-app/components/AI.tsx index fe370051a..d513c1b1a 100644 --- a/excalidraw-app/components/AI.tsx +++ b/excalidraw-app/components/AI.tsx @@ -5,7 +5,7 @@ import { MIME_TYPES, TTDDialog, } from "@excalidraw/excalidraw/src"; -import { getDataURL } from "@excalidraw/excalidraw/data/blob"; +import { getDataURL } from "@excalidraw/excalidraw/src/data/blob"; import { safelyParseJSON } from "@excalidraw/common"; import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/src/types"; diff --git a/excalidraw-app/components/AppMainMenu.tsx b/excalidraw-app/components/AppMainMenu.tsx index 92c415452..fd24191c4 100644 --- a/excalidraw-app/components/AppMainMenu.tsx +++ b/excalidraw-app/components/AppMainMenu.tsx @@ -2,7 +2,7 @@ import { loginIcon, ExcalLogo, eyeIcon, -} from "@excalidraw/excalidraw/components/icons"; +} from "@excalidraw/excalidraw/src/components/icons"; import { MainMenu } from "@excalidraw/excalidraw/src/index"; import React from "react"; diff --git a/excalidraw-app/components/AppWelcomeScreen.tsx b/excalidraw-app/components/AppWelcomeScreen.tsx index 88eb0118f..f0690e235 100644 --- a/excalidraw-app/components/AppWelcomeScreen.tsx +++ b/excalidraw-app/components/AppWelcomeScreen.tsx @@ -1,4 +1,4 @@ -import { loginIcon } from "@excalidraw/excalidraw/components/icons"; +import { loginIcon } from "@excalidraw/excalidraw/src/components/icons"; import { POINTER_EVENTS } from "@excalidraw/common"; import { useI18n } from "@excalidraw/excalidraw/src/i18n"; import { WelcomeScreen } from "@excalidraw/excalidraw/src/index"; diff --git a/excalidraw-app/components/DebugCanvas.tsx b/excalidraw-app/components/DebugCanvas.tsx index 8f7251310..7df85fd23 100644 --- a/excalidraw-app/components/DebugCanvas.tsx +++ b/excalidraw-app/components/DebugCanvas.tsx @@ -2,11 +2,11 @@ import { ArrowheadArrowIcon, CloseIcon, TrashIcon, -} from "@excalidraw/excalidraw/components/icons"; +} from "@excalidraw/excalidraw/src/components/icons"; import { bootstrapCanvas, getNormalizedCanvasDimensions, -} from "@excalidraw/excalidraw/renderer/helpers"; +} from "@excalidraw/excalidraw/src/renderer/helpers"; import { type AppState } from "@excalidraw/excalidraw/src/types"; import { throttleRAF } from "@excalidraw/common"; import { useCallback, useImperativeHandle, useRef } from "react"; diff --git a/excalidraw-app/components/EncryptedIcon.tsx b/excalidraw-app/components/EncryptedIcon.tsx index ada9af4d2..634afa0ef 100644 --- a/excalidraw-app/components/EncryptedIcon.tsx +++ b/excalidraw-app/components/EncryptedIcon.tsx @@ -1,5 +1,5 @@ -import { Tooltip } from "@excalidraw/excalidraw/components/Tooltip"; -import { shield } from "@excalidraw/excalidraw/components/icons"; +import { Tooltip } from "@excalidraw/excalidraw/src/components/Tooltip"; +import { shield } from "@excalidraw/excalidraw/src/components/icons"; import { useI18n } from "@excalidraw/excalidraw/src/i18n"; export const EncryptedIcon = () => { diff --git a/excalidraw-app/components/ExportToExcalidrawPlus.tsx b/excalidraw-app/components/ExportToExcalidrawPlus.tsx index d11dfcd60..d816c486e 100644 --- a/excalidraw-app/components/ExportToExcalidrawPlus.tsx +++ b/excalidraw-app/components/ExportToExcalidrawPlus.tsx @@ -2,16 +2,16 @@ import React from "react"; import { uploadBytes, ref } from "firebase/storage"; import { nanoid } from "nanoid"; -import { trackEvent } from "@excalidraw/excalidraw/analytics"; -import { Card } from "@excalidraw/excalidraw/components/Card"; -import { ExcalidrawLogo } from "@excalidraw/excalidraw/components/ExcalidrawLogo"; -import { ToolButton } from "@excalidraw/excalidraw/components/ToolButton"; +import { trackEvent } from "@excalidraw/excalidraw/src/analytics"; +import { Card } from "@excalidraw/excalidraw/src/components/Card"; +import { ExcalidrawLogo } from "@excalidraw/excalidraw/src/components/ExcalidrawLogo"; +import { ToolButton } from "@excalidraw/excalidraw/src/components/ToolButton"; import { MIME_TYPES, getFrame } from "@excalidraw/common"; import { encryptData, generateEncryptionKey, -} from "@excalidraw/excalidraw/data/encryption"; -import { serializeAsJSON } from "@excalidraw/excalidraw/data/json"; +} from "@excalidraw/excalidraw/src/data/encryption"; +import { serializeAsJSON } from "@excalidraw/excalidraw/src/data/json"; import { isInitializedImageElement } from "@excalidraw/element/typeChecks"; import { useI18n } from "@excalidraw/excalidraw/src/i18n"; diff --git a/excalidraw-app/components/TopErrorBoundary.tsx b/excalidraw-app/components/TopErrorBoundary.tsx index 81fd15f98..81f9cb61d 100644 --- a/excalidraw-app/components/TopErrorBoundary.tsx +++ b/excalidraw-app/components/TopErrorBoundary.tsx @@ -1,4 +1,4 @@ -import Trans from "@excalidraw/excalidraw/components/Trans"; +import Trans from "@excalidraw/excalidraw/src/components/Trans"; import { t } from "@excalidraw/excalidraw/src/i18n"; import * as Sentry from "@sentry/browser"; import React from "react"; diff --git a/excalidraw-app/data/FileManager.ts b/excalidraw-app/data/FileManager.ts index a00154d13..1c77c9ef5 100644 --- a/excalidraw-app/data/FileManager.ts +++ b/excalidraw-app/data/FileManager.ts @@ -1,5 +1,5 @@ import { CaptureUpdateAction } from "@excalidraw/excalidraw/src"; -import { compressData } from "@excalidraw/excalidraw/data/encode"; +import { compressData } from "@excalidraw/excalidraw/src/data/encode"; import { newElementWith } from "@excalidraw/element/mutateElement"; import { isInitializedImageElement } from "@excalidraw/element/typeChecks"; import { t } from "@excalidraw/excalidraw/src/i18n"; diff --git a/excalidraw-app/data/LocalData.ts b/excalidraw-app/data/LocalData.ts index 685d0b13c..664338b80 100644 --- a/excalidraw-app/data/LocalData.ts +++ b/excalidraw-app/data/LocalData.ts @@ -10,7 +10,7 @@ * (localStorage, indexedDB). */ -import { clearAppStateForLocalStorage } from "@excalidraw/excalidraw/appState"; +import { clearAppStateForLocalStorage } from "@excalidraw/excalidraw/src/appState"; import { CANVAS_SEARCH_TAB, DEFAULT_SIDEBAR, @@ -27,8 +27,8 @@ import { get, } from "idb-keyval"; -import type { LibraryPersistedData } from "@excalidraw/excalidraw/data/library"; -import type { ImportedDataState } from "@excalidraw/excalidraw/data/types"; +import type { LibraryPersistedData } from "@excalidraw/excalidraw/src/data/library"; +import type { ImportedDataState } from "@excalidraw/excalidraw/src/data/types"; import type { ExcalidrawElement, FileId } from "@excalidraw/element/types"; import type { AppState, diff --git a/excalidraw-app/data/firebase.ts b/excalidraw-app/data/firebase.ts index 7ef6e96fe..0f38e0d66 100644 --- a/excalidraw-app/data/firebase.ts +++ b/excalidraw-app/data/firebase.ts @@ -1,11 +1,11 @@ import { reconcileElements } from "@excalidraw/excalidraw/src"; import { MIME_TYPES } from "@excalidraw/common"; -import { decompressData } from "@excalidraw/excalidraw/data/encode"; +import { decompressData } from "@excalidraw/excalidraw/src/data/encode"; import { encryptData, decryptData, -} from "@excalidraw/excalidraw/data/encryption"; -import { restoreElements } from "@excalidraw/excalidraw/data/restore"; +} from "@excalidraw/excalidraw/src/data/encryption"; +import { restoreElements } from "@excalidraw/excalidraw/src/data/restore"; import { getSceneVersion } from "@excalidraw/element"; import { initializeApp } from "firebase/app"; import { @@ -17,7 +17,7 @@ import { } from "firebase/firestore"; import { getStorage, ref, uploadBytes } from "firebase/storage"; -import type { RemoteExcalidrawElement } from "@excalidraw/excalidraw/data/reconcile"; +import type { RemoteExcalidrawElement } from "@excalidraw/excalidraw/src/data/reconcile"; import type { ExcalidrawElement, FileId, diff --git a/excalidraw-app/data/index.ts b/excalidraw-app/data/index.ts index 7d5a22762..07e203650 100644 --- a/excalidraw-app/data/index.ts +++ b/excalidraw-app/data/index.ts @@ -1,21 +1,21 @@ import { compressData, decompressData, -} from "@excalidraw/excalidraw/data/encode"; +} from "@excalidraw/excalidraw/src/data/encode"; import { decryptData, generateEncryptionKey, IV_LENGTH_BYTES, -} from "@excalidraw/excalidraw/data/encryption"; -import { serializeAsJSON } from "@excalidraw/excalidraw/data/json"; -import { restore } from "@excalidraw/excalidraw/data/restore"; +} from "@excalidraw/excalidraw/src/data/encryption"; +import { serializeAsJSON } from "@excalidraw/excalidraw/src/data/json"; +import { restore } from "@excalidraw/excalidraw/src/data/restore"; import { isInvisiblySmallElement } from "@excalidraw/element/sizeHelpers"; import { isInitializedImageElement } from "@excalidraw/element/typeChecks"; import { t } from "@excalidraw/excalidraw/src/i18n"; import { bytesToHexString } from "@excalidraw/common"; import type { UserIdleState } from "@excalidraw/common"; -import type { ImportedDataState } from "@excalidraw/excalidraw/data/types"; +import type { ImportedDataState } from "@excalidraw/excalidraw/src/data/types"; import type { SceneBounds } from "@excalidraw/element/bounds"; import type { ExcalidrawElement, diff --git a/excalidraw-app/data/localStorage.ts b/excalidraw-app/data/localStorage.ts index 2bdfc272c..5ad479222 100644 --- a/excalidraw-app/data/localStorage.ts +++ b/excalidraw-app/data/localStorage.ts @@ -1,7 +1,7 @@ import { clearAppStateForLocalStorage, getDefaultAppState, -} from "@excalidraw/excalidraw/appState"; +} from "@excalidraw/excalidraw/src/appState"; import { clearElementsForLocalStorage } from "@excalidraw/element"; import type { ExcalidrawElement } from "@excalidraw/element/types"; diff --git a/excalidraw-app/share/ShareDialog.tsx b/excalidraw-app/share/ShareDialog.tsx index c3137c666..15b457399 100644 --- a/excalidraw-app/share/ShareDialog.tsx +++ b/excalidraw-app/share/ShareDialog.tsx @@ -1,8 +1,8 @@ -import { trackEvent } from "@excalidraw/excalidraw/analytics"; +import { trackEvent } from "@excalidraw/excalidraw/src/analytics"; import { copyTextToSystemClipboard } from "@excalidraw/excalidraw/src/clipboard"; -import { Dialog } from "@excalidraw/excalidraw/components/Dialog"; -import { FilledButton } from "@excalidraw/excalidraw/components/FilledButton"; -import { TextField } from "@excalidraw/excalidraw/components/TextField"; +import { Dialog } from "@excalidraw/excalidraw/src/components/Dialog"; +import { FilledButton } from "@excalidraw/excalidraw/src/components/FilledButton"; +import { TextField } from "@excalidraw/excalidraw/src/components/TextField"; import { copyIcon, LinkIcon, @@ -11,9 +11,9 @@ import { share, shareIOS, shareWindows, -} from "@excalidraw/excalidraw/components/icons"; -import { useUIAppState } from "@excalidraw/excalidraw/context/ui-appState"; -import { useCopyStatus } from "@excalidraw/excalidraw/hooks/useCopiedIndicator"; +} from "@excalidraw/excalidraw/src/components/icons"; +import { useUIAppState } from "@excalidraw/excalidraw/src/context/ui-appState"; +import { useCopyStatus } from "@excalidraw/excalidraw/src/hooks/useCopiedIndicator"; import { useI18n } from "@excalidraw/excalidraw/src/i18n"; import { KEYS, getFrame } from "@excalidraw/common"; import { useEffect, useRef, useState } from "react"; diff --git a/excalidraw-app/tests/collab.test.tsx b/excalidraw-app/tests/collab.test.tsx index 4f1d2ad8b..42214faa0 100644 --- a/excalidraw-app/tests/collab.test.tsx +++ b/excalidraw-app/tests/collab.test.tsx @@ -5,7 +5,7 @@ import { import { createRedoAction, createUndoAction, -} from "@excalidraw/excalidraw/actions/actionHistory"; +} from "@excalidraw/excalidraw/src/actions/actionHistory"; import { syncInvalidIndices } from "@excalidraw/element/fractionalIndex"; import { API } from "@excalidraw/excalidraw/tests/helpers/api"; import { act, render, waitFor } from "@excalidraw/excalidraw/tests/test-utils"; diff --git a/packages/element/tests/align.test.tsx b/packages/element/tests/align.test.tsx index 8115e4599..efa82bcea 100644 --- a/packages/element/tests/align.test.tsx +++ b/packages/element/tests/align.test.tsx @@ -8,7 +8,7 @@ import { actionAlignBottom, actionAlignLeft, actionAlignRight, -} from "@excalidraw/excalidraw/actions"; +} from "@excalidraw/excalidraw/src/actions"; import { defaultLang, setLanguage } from "@excalidraw/excalidraw/src/i18n"; import { Excalidraw } from "@excalidraw/excalidraw/src"; diff --git a/packages/element/tests/binding.test.tsx b/packages/element/tests/binding.test.tsx index 59310eb15..11c1fbe82 100644 --- a/packages/element/tests/binding.test.tsx +++ b/packages/element/tests/binding.test.tsx @@ -2,7 +2,7 @@ import { KEYS, arrayToMap } from "@excalidraw/common"; import { pointFrom } from "@excalidraw/math"; -import { actionWrapTextInContainer } from "@excalidraw/excalidraw/actions/actionBoundText"; +import { actionWrapTextInContainer } from "@excalidraw/excalidraw/src/actions/actionBoundText"; import { Excalidraw, isLinearElement } from "@excalidraw/excalidraw/src"; diff --git a/packages/element/tests/duplicate.test.tsx b/packages/element/tests/duplicate.test.tsx index b6c772480..461f729f4 100644 --- a/packages/element/tests/duplicate.test.tsx +++ b/packages/element/tests/duplicate.test.tsx @@ -10,7 +10,7 @@ import { import { Excalidraw } from "@excalidraw/excalidraw/src"; -import { actionDuplicateSelection } from "@excalidraw/excalidraw/actions"; +import { actionDuplicateSelection } from "@excalidraw/excalidraw/src/actions"; import { API } from "@excalidraw/excalidraw/tests/helpers/api"; diff --git a/packages/element/tests/elbowArrow.test.tsx b/packages/element/tests/elbowArrow.test.tsx index 55b36d7fc..4a29cb736 100644 --- a/packages/element/tests/elbowArrow.test.tsx +++ b/packages/element/tests/elbowArrow.test.tsx @@ -2,9 +2,9 @@ import { ARROW_TYPE } from "@excalidraw/common"; import { pointFrom } from "@excalidraw/math"; import { Excalidraw, mutateElement } from "@excalidraw/excalidraw/src"; -import Scene from "@excalidraw/excalidraw/scene/Scene"; -import { actionSelectAll } from "@excalidraw/excalidraw/actions"; -import { actionDuplicateSelection } from "@excalidraw/excalidraw/actions/actionDuplicateSelection"; +import Scene from "@excalidraw/excalidraw/src/scene/Scene"; +import { actionSelectAll } from "@excalidraw/excalidraw/src/actions"; +import { actionDuplicateSelection } from "@excalidraw/excalidraw/src/actions/actionDuplicateSelection"; import { API } from "@excalidraw/excalidraw/tests/helpers/api"; import { Pointer, UI } from "@excalidraw/excalidraw/tests/helpers/ui"; diff --git a/packages/element/tests/zindex.test.tsx b/packages/element/tests/zindex.test.tsx index 085c45803..6facf3747 100644 --- a/packages/element/tests/zindex.test.tsx +++ b/packages/element/tests/zindex.test.tsx @@ -6,7 +6,7 @@ import { actionBringToFront, actionSendToBack, actionDuplicateSelection, -} from "@excalidraw/excalidraw/actions"; +} from "@excalidraw/excalidraw/src/actions"; import { Excalidraw } from "@excalidraw/excalidraw/src"; diff --git a/packages/excalidraw/src/actions/actionCanvas.tsx b/packages/excalidraw/src/actions/actionCanvas.tsx index c771a98a5..e5ab82b64 100644 --- a/packages/excalidraw/src/actions/actionCanvas.tsx +++ b/packages/excalidraw/src/actions/actionCanvas.tsx @@ -23,7 +23,7 @@ import { getDefaultAppState, isEraserActive, isHandToolActive, -} from "../../appState"; +} from "../../src/appState"; import { ColorPicker } from "../components/ColorPicker/ColorPicker"; import { ToolButton } from "../components/ToolButton"; import { Tooltip } from "../components/Tooltip"; diff --git a/packages/excalidraw/src/actions/actionDeleteSelected.test.tsx b/packages/excalidraw/src/actions/actionDeleteSelected.test.tsx index 090c81941..27d89ccd9 100644 --- a/packages/excalidraw/src/actions/actionDeleteSelected.test.tsx +++ b/packages/excalidraw/src/actions/actionDeleteSelected.test.tsx @@ -1,8 +1,12 @@ import React from "react"; import { Excalidraw, mutateElement } from "../index"; -import { API } from "../tests/helpers/api"; -import { act, assertElements, render } from "../tests/test-utils"; +import { API } from "@excalidraw/excalidraw/tests/helpers/api"; +import { + act, + assertElements, + render, +} from "@excalidraw/excalidraw/tests/test-utils"; import { actionDeleteSelected } from "./actionDeleteSelected"; diff --git a/packages/excalidraw/src/actions/actionDuplicateSelection.test.tsx b/packages/excalidraw/src/actions/actionDuplicateSelection.test.tsx index 71559fe47..b0c362352 100644 --- a/packages/excalidraw/src/actions/actionDuplicateSelection.test.tsx +++ b/packages/excalidraw/src/actions/actionDuplicateSelection.test.tsx @@ -1,13 +1,13 @@ import { ORIG_ID } from "@excalidraw/common"; import { Excalidraw } from "../index"; -import { API } from "../tests/helpers/api"; +import { API } from "@excalidraw/excalidraw/tests/helpers/api"; import { act, assertElements, getCloneByOrigId, render, -} from "../tests/test-utils"; +} from "@excalidraw/excalidraw/tests/test-utils"; import { actionDuplicateSelection } from "./actionDuplicateSelection"; diff --git a/packages/excalidraw/src/actions/actionElementLock.test.tsx b/packages/excalidraw/src/actions/actionElementLock.test.tsx index ec45ab9b2..9ca4f528a 100644 --- a/packages/excalidraw/src/actions/actionElementLock.test.tsx +++ b/packages/excalidraw/src/actions/actionElementLock.test.tsx @@ -2,9 +2,9 @@ import { queryByTestId, fireEvent } from "@testing-library/react"; import React from "react"; import { Excalidraw } from "../index"; -import { API } from "../tests/helpers/api"; -import { Pointer, UI } from "../tests/helpers/ui"; -import { render } from "../tests/test-utils"; +import { API } from "@excalidraw/excalidraw/tests/helpers/api"; +import { Pointer, UI } from "@excalidraw/excalidraw/tests/helpers/ui"; +import { render } from "@excalidraw/excalidraw/tests/test-utils"; const { h } = window; const mouse = new Pointer("mouse"); diff --git a/packages/excalidraw/src/actions/actionFlip.test.tsx b/packages/excalidraw/src/actions/actionFlip.test.tsx index 23e4ffc12..2342e9924 100644 --- a/packages/excalidraw/src/actions/actionFlip.test.tsx +++ b/packages/excalidraw/src/actions/actionFlip.test.tsx @@ -1,8 +1,8 @@ import { pointFrom } from "@excalidraw/math"; import { Excalidraw } from "../index"; -import { API } from "../tests/helpers/api"; -import { render } from "../tests/test-utils"; +import { API } from "@excalidraw/excalidraw/tests/helpers/api"; +import { render } from "@excalidraw/excalidraw/tests/test-utils"; import { actionFlipHorizontal, actionFlipVertical } from "./actionFlip"; diff --git a/packages/excalidraw/src/actions/actionHistory.tsx b/packages/excalidraw/src/actions/actionHistory.tsx index 7ddc2c701..7d722046f 100644 --- a/packages/excalidraw/src/actions/actionHistory.tsx +++ b/packages/excalidraw/src/actions/actionHistory.tsx @@ -4,12 +4,12 @@ import type { SceneElementsMap } from "@excalidraw/element/types"; import { ToolButton } from "../components/ToolButton"; import { UndoIcon, RedoIcon } from "../components/icons"; -import { HistoryChangedEvent } from "../../history"; -import { useEmitter } from "../../hooks/useEmitter"; +import { HistoryChangedEvent } from "../../src/history"; +import { useEmitter } from "../../src/hooks/useEmitter"; import { t } from "../i18n"; import { CaptureUpdateAction } from "../store"; -import type { History } from "../../history"; +import type { History } from "../../src/history"; import type { Store } from "../store"; import type { AppClassProperties, AppState } from "../types"; import type { Action, ActionResult } from "./types"; diff --git a/packages/excalidraw/src/actions/actionProperties.test.tsx b/packages/excalidraw/src/actions/actionProperties.test.tsx index 38419ce82..152d3c8cf 100644 --- a/packages/excalidraw/src/actions/actionProperties.test.tsx +++ b/packages/excalidraw/src/actions/actionProperties.test.tsx @@ -7,10 +7,12 @@ import { STROKE_WIDTH, } from "@excalidraw/common"; + +import { API } from "@excalidraw/excalidraw/tests/helpers/api"; +import { render } from "@excalidraw/excalidraw/tests/test-utils"; +import { UI } from "@excalidraw/excalidraw/tests/helpers/ui"; + import { Excalidraw } from "../index"; -import { API } from "../tests/helpers/api"; -import { UI } from "../tests/helpers/ui"; -import { render } from "../tests/test-utils"; describe("element locking", () => { beforeEach(async () => { diff --git a/packages/excalidraw/src/actions/actionProperties.tsx b/packages/excalidraw/src/actions/actionProperties.tsx index ca1cd08b6..91dac3d5e 100644 --- a/packages/excalidraw/src/actions/actionProperties.tsx +++ b/packages/excalidraw/src/actions/actionProperties.tsx @@ -71,7 +71,7 @@ import type { NonDeletedSceneElementsMap, } from "@excalidraw/element/types"; -import { trackEvent } from "../../analytics"; +import { trackEvent } from "../../src/analytics"; import { ButtonIconSelect } from "../components/ButtonIconSelect"; import { ColorPicker } from "../components/ColorPicker/ColorPicker"; import { FontPicker } from "../components/FontPicker/FontPicker"; @@ -123,7 +123,7 @@ import { ArrowheadCrowfootOneOrManyIcon, } from "../components/icons"; -import { Fonts } from "../../fonts"; +import { Fonts } from "../../src/fonts"; import { getLanguage, t } from "../i18n"; import { canHaveArrowheads, diff --git a/packages/excalidraw/src/actions/manager.tsx b/packages/excalidraw/src/actions/manager.tsx index 896122520..6cbf24323 100644 --- a/packages/excalidraw/src/actions/manager.tsx +++ b/packages/excalidraw/src/actions/manager.tsx @@ -7,7 +7,7 @@ import type { OrderedExcalidrawElement, } from "@excalidraw/element/types"; -import { trackEvent } from "../../analytics"; +import { trackEvent } from "../../src/analytics"; import type { AppClassProperties, AppState } from "../types"; import type { diff --git a/packages/excalidraw/src/animated-trail.ts b/packages/excalidraw/src/animated-trail.ts index f128e8176..725448188 100644 --- a/packages/excalidraw/src/animated-trail.ts +++ b/packages/excalidraw/src/animated-trail.ts @@ -9,9 +9,10 @@ import { import type { LaserPointerOptions } from "@excalidraw/laser-pointer"; import type { AnimationFrameHandler } from "./animation-frame-handler"; -import type App from "./src/components/App"; import type { AppState } from "./types"; +import type App from "./components/App"; + export interface Trail { start(container: SVGSVGElement): void; stop(): void; diff --git a/packages/excalidraw/src/clipboard.test.ts b/packages/excalidraw/src/clipboard.test.ts index 3c7a60186..867403e24 100644 --- a/packages/excalidraw/src/clipboard.test.ts +++ b/packages/excalidraw/src/clipboard.test.ts @@ -3,7 +3,7 @@ import { parseClipboard, serializeAsClipboardJSON, } from "./clipboard"; -import { API } from "../tests/helpers/api"; +import { API } from "@excalidraw/excalidraw/tests/helpers/api"; describe("parseClipboard()", () => { it("should parse JSON as plaintext if not excalidraw-api/clipboard data", async () => { diff --git a/packages/excalidraw/src/components/Actions.tsx b/packages/excalidraw/src/components/Actions.tsx index 97b199a14..739e127a6 100644 --- a/packages/excalidraw/src/components/Actions.tsx +++ b/packages/excalidraw/src/components/Actions.tsx @@ -33,7 +33,7 @@ import type { import { actionToggleZenMode } from "../actions"; import { alignActionsPredicate } from "../actions/actionAlign"; -import { trackEvent } from "../../analytics"; +import { trackEvent } from "../../src/analytics"; import { useTunnels } from "../context/tunnels"; import { t } from "../i18n"; diff --git a/packages/excalidraw/src/components/App.tsx b/packages/excalidraw/src/components/App.tsx index cb42ba703..f4de50433 100644 --- a/packages/excalidraw/src/components/App.tsx +++ b/packages/excalidraw/src/components/App.tsx @@ -379,19 +379,19 @@ import { actionToggleViewMode } from "../actions/actionToggleViewMode"; import { ActionManager } from "../actions/manager"; import { actions } from "../actions/register"; import { getShortcutFromShortcutName } from "../actions/shortcuts"; -import { trackEvent } from "../../analytics"; -import { AnimationFrameHandler } from "../../animation-frame-handler"; +import { trackEvent } from "../../src/analytics"; +import { AnimationFrameHandler } from "../../src/animation-frame-handler"; import { getDefaultAppState, isEraserActive, isHandToolActive, -} from "../../appState"; +} from "../../src/appState"; import { copyTextToSystemClipboard, parseClipboard } from "../clipboard"; import { exportCanvas, loadFromBlob } from "../data"; import Library, { distributeLibraryItemsOnSquareGrid } from "../data/library"; import { restore, restoreElements } from "../data/restore"; import { getCenter, getDistance } from "../gesture"; -import { History } from "../../history"; +import { History } from "../../src/history"; import { defaultLang, getLanguage, languages, setLanguage, t } from "../i18n"; import { @@ -422,13 +422,8 @@ import { } from "../data/blob"; import { fileOpen } from "../data/filesystem"; -import { - showHyperlinkTooltip, - hideHyperlinkToolip, - Hyperlink, -} from "./hyperlink/Hyperlink"; -import { Fonts } from "../../fonts"; +import { Fonts } from "../../src/fonts"; import { editorJotaiStore } from "../editor-jotai"; import { ImageSceneDataError } from "../errors"; import { @@ -452,18 +447,25 @@ import { setCursorForShape, } from "../cursor"; import { Emitter } from "../emitter"; -import { ElementCanvasButtons } from "./ElementCanvasButtons"; + import { Store, CaptureUpdateAction } from "../store"; -import { AnimatedTrail } from "../../animated-trail"; +import { AnimatedTrail } from "../../src/animated-trail"; import { LaserTrails } from "../laser-trails"; import { withBatchedUpdates, withBatchedUpdatesThrottled } from "../reactUtils"; -import { textWysiwyg } from "../../wysiwyg/textWysiwyg"; +import { textWysiwyg } from "../../src/wysiwyg/textWysiwyg"; import { isOverScrollBars } from "../scene/scrollbars"; import { isMaybeMermaidDefinition } from "../mermaid"; import { LassoTrail } from "../lasso"; +import { ElementCanvasButtons } from "./ElementCanvasButtons"; +import { + showHyperlinkTooltip, + hideHyperlinkToolip, + Hyperlink, +} from "./hyperlink/Hyperlink"; + import { activeConfirmDialogAtom } from "./ActiveConfirmDialog"; import BraveMeasureTextError from "./BraveMeasureTextError"; import { ContextMenu, CONTEXT_MENU_SEPARATOR } from "./ContextMenu"; diff --git a/packages/excalidraw/src/components/CommandPalette/CommandPalette.tsx b/packages/excalidraw/src/components/CommandPalette/CommandPalette.tsx index 7e92cf32c..438dfe7e1 100644 --- a/packages/excalidraw/src/components/CommandPalette/CommandPalette.tsx +++ b/packages/excalidraw/src/components/CommandPalette/CommandPalette.tsx @@ -23,7 +23,7 @@ import { actionLinkToElement, } from "../../actions/actionElementLink"; import { getShortcutFromShortcutName } from "../../actions/shortcuts"; -import { trackEvent } from "../../../analytics"; +import { trackEvent } from "../../../src/analytics"; import { useUIAppState } from "../../context/ui-appState"; import { deburr } from "../../deburr"; import { atom, useAtom, editorJotaiStore } from "../../editor-jotai"; diff --git a/packages/excalidraw/src/components/DefaultSidebar.test.tsx b/packages/excalidraw/src/components/DefaultSidebar.test.tsx index 1b3f1cac9..8dd5dc7dc 100644 --- a/packages/excalidraw/src/components/DefaultSidebar.test.tsx +++ b/packages/excalidraw/src/components/DefaultSidebar.test.tsx @@ -7,7 +7,7 @@ import { fireEvent, waitFor, withExcalidrawDimensions, -} from "../tests/test-utils"; +} from "@excalidraw/excalidraw/tests/test-utils"; import { assertExcalidrawWithSidebar, diff --git a/packages/excalidraw/src/components/FontPicker/FontPickerList.tsx b/packages/excalidraw/src/components/FontPicker/FontPickerList.tsx index 8397ded57..7796608ce 100644 --- a/packages/excalidraw/src/components/FontPicker/FontPickerList.tsx +++ b/packages/excalidraw/src/components/FontPicker/FontPickerList.tsx @@ -18,7 +18,7 @@ import { import type { ValueOf } from "@excalidraw/common/utility-types"; -import { Fonts } from "../../../fonts"; +import { Fonts } from "../../../src/fonts"; import { t } from "../../i18n"; import { useApp, useAppProps, useExcalidrawContainer } from "../App"; import { PropertiesPopover } from "../PropertiesPopover"; diff --git a/packages/excalidraw/src/components/HintViewer.tsx b/packages/excalidraw/src/components/HintViewer.tsx index 602c42718..7fbf212b0 100644 --- a/packages/excalidraw/src/components/HintViewer.tsx +++ b/packages/excalidraw/src/components/HintViewer.tsx @@ -13,7 +13,7 @@ import { getShortcutKey } from "@excalidraw/common"; import { isNodeInFlowchart } from "@excalidraw/element/flowchart"; import { t } from "../i18n"; -import { isEraserActive } from "../../appState"; +import { isEraserActive } from "../../src/appState"; import { isGridModeEnabled } from "../snapping"; import "./HintViewer.scss"; diff --git a/packages/excalidraw/src/components/JSONExportDialog.tsx b/packages/excalidraw/src/components/JSONExportDialog.tsx index b9c8d9577..7062d52db 100644 --- a/packages/excalidraw/src/components/JSONExportDialog.tsx +++ b/packages/excalidraw/src/components/JSONExportDialog.tsx @@ -6,7 +6,7 @@ import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types"; import { actionSaveFileToDisk } from "../actions/actionExport"; -import { trackEvent } from "../../analytics"; +import { trackEvent } from "../../src/analytics"; import { nativeFileSystemSupported } from "../data/filesystem"; import { t } from "../i18n"; diff --git a/packages/excalidraw/src/components/LayerUI.tsx b/packages/excalidraw/src/components/LayerUI.tsx index b710acf41..d116a92c3 100644 --- a/packages/excalidraw/src/components/LayerUI.tsx +++ b/packages/excalidraw/src/components/LayerUI.tsx @@ -19,8 +19,8 @@ import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types"; import Scene from "../scene/Scene"; import { actionToggleStats } from "../actions"; -import { trackEvent } from "../../analytics"; -import { isHandToolActive } from "../../appState"; +import { trackEvent } from "../../src/analytics"; +import { isHandToolActive } from "../../src/appState"; import { TunnelsContext, useInitializeTunnels } from "../context/tunnels"; import { UIAppStateContext } from "../context/ui-appState"; import { useAtom, useAtomValue } from "../editor-jotai"; diff --git a/packages/excalidraw/src/components/LibraryMenu.tsx b/packages/excalidraw/src/components/LibraryMenu.tsx index 35d0af4bf..7c3bbc907 100644 --- a/packages/excalidraw/src/components/LibraryMenu.tsx +++ b/packages/excalidraw/src/components/LibraryMenu.tsx @@ -18,7 +18,7 @@ import type { NonDeletedExcalidrawElement, } from "@excalidraw/element/types"; -import { trackEvent } from "../../analytics"; +import { trackEvent } from "../../src/analytics"; import { useUIAppState } from "../context/ui-appState"; import { distributeLibraryItemsOnSquareGrid, diff --git a/packages/excalidraw/src/components/MobileMenu.tsx b/packages/excalidraw/src/components/MobileMenu.tsx index 641e9d96d..21bb2d1c0 100644 --- a/packages/excalidraw/src/components/MobileMenu.tsx +++ b/packages/excalidraw/src/components/MobileMenu.tsx @@ -4,7 +4,7 @@ import { showSelectedShapeActions } from "@excalidraw/element/showSelectedShapeA import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types"; -import { isHandToolActive } from "../../appState"; +import { isHandToolActive } from "../../src/appState"; import { useTunnels } from "../context/tunnels"; import { t } from "../i18n"; import { calculateScrollCenter } from "../scene"; diff --git a/packages/excalidraw/src/components/PasteChartDialog.tsx b/packages/excalidraw/src/components/PasteChartDialog.tsx index abac47d0a..a1c73e2a0 100644 --- a/packages/excalidraw/src/components/PasteChartDialog.tsx +++ b/packages/excalidraw/src/components/PasteChartDialog.tsx @@ -3,7 +3,7 @@ import React, { useLayoutEffect, useRef, useState } from "react"; import type { ChartType } from "@excalidraw/element/types"; -import { trackEvent } from "../../analytics"; +import { trackEvent } from "../../src/analytics"; import { renderSpreadsheet } from "../charts"; import { t } from "../i18n"; import { exportToSvg } from "../scene/export"; diff --git a/packages/excalidraw/src/components/SVGLayer.tsx b/packages/excalidraw/src/components/SVGLayer.tsx index a0e867565..c3448ef97 100644 --- a/packages/excalidraw/src/components/SVGLayer.tsx +++ b/packages/excalidraw/src/components/SVGLayer.tsx @@ -2,7 +2,7 @@ import { useEffect, useRef } from "react"; import "./SVGLayer.scss"; -import type { Trail } from "../../animated-trail"; +import type { Trail } from "../../src/animated-trail"; type SVGLayerProps = { trails: Trail[]; diff --git a/packages/excalidraw/src/components/Sidebar/Sidebar.test.tsx b/packages/excalidraw/src/components/Sidebar/Sidebar.test.tsx index dd52fdb11..247d120f6 100644 --- a/packages/excalidraw/src/components/Sidebar/Sidebar.test.tsx +++ b/packages/excalidraw/src/components/Sidebar/Sidebar.test.tsx @@ -3,7 +3,6 @@ import { vi } from "vitest"; import { DEFAULT_SIDEBAR } from "@excalidraw/common"; -import { Excalidraw, Sidebar } from "../../index"; import { act, fireEvent, @@ -12,7 +11,9 @@ import { render, waitFor, withExcalidrawDimensions, -} from "../../tests/test-utils"; +} from "@excalidraw/excalidraw/tests/test-utils"; + +import { Excalidraw, Sidebar } from "../../index"; import { assertExcalidrawWithSidebar, diff --git a/packages/excalidraw/src/components/Sidebar/siderbar.test.helpers.tsx b/packages/excalidraw/src/components/Sidebar/siderbar.test.helpers.tsx index 650eca6b0..138c8ee3d 100644 --- a/packages/excalidraw/src/components/Sidebar/siderbar.test.helpers.tsx +++ b/packages/excalidraw/src/components/Sidebar/siderbar.test.helpers.tsx @@ -1,12 +1,13 @@ import React from "react"; -import { Excalidraw } from "../.."; import { GlobalTestState, queryByTestId, render, withExcalidrawDimensions, -} from "../../tests/test-utils"; +} from "@excalidraw/excalidraw/tests/test-utils"; + +import { Excalidraw } from "../.."; export const assertSidebarDockButton = async ( hasDockButton: T, diff --git a/packages/excalidraw/src/components/Stats/stats.test.tsx b/packages/excalidraw/src/components/Stats/stats.test.tsx index fc94da056..3e909eb5e 100644 --- a/packages/excalidraw/src/components/Stats/stats.test.tsx +++ b/packages/excalidraw/src/components/Stats/stats.test.tsx @@ -9,6 +9,22 @@ import { isInGroup } from "@excalidraw/element/groups"; import { isTextElement } from "@excalidraw/element/typeChecks"; +import { API } from "@excalidraw/excalidraw/tests/helpers/api"; + +import { Keyboard, Pointer, UI } from "@excalidraw/excalidraw/tests/helpers/ui"; + +import { + getTextEditor, + updateTextEditor, +} from "@excalidraw/excalidraw/tests/queries/dom"; + +import { + GlobalTestState, + mockBoundingClientRect, + render, + restoreOriginalGetBoundingClientRect, +} from "@excalidraw/excalidraw/tests/test-utils"; + import type { Degrees } from "@excalidraw/math"; import type { @@ -21,15 +37,6 @@ import { Excalidraw, getCommonBounds, mutateElement } from "../.."; import { actionGroup } from "../../actions"; import { t } from "../../i18n"; import * as StaticScene from "../../renderer/staticScene"; -import { API } from "../../tests/helpers/api"; -import { Keyboard, Pointer, UI } from "../../tests/helpers/ui"; -import { getTextEditor, updateTextEditor } from "../../tests/queries/dom"; -import { - GlobalTestState, - mockBoundingClientRect, - render, - restoreOriginalGetBoundingClientRect, -} from "../../tests/test-utils"; import { getStepSizedValue } from "./utils"; diff --git a/packages/excalidraw/src/components/TTDDialog/TTDDialog.tsx b/packages/excalidraw/src/components/TTDDialog/TTDDialog.tsx index e50e87cc9..dc35056a8 100644 --- a/packages/excalidraw/src/components/TTDDialog/TTDDialog.tsx +++ b/packages/excalidraw/src/components/TTDDialog/TTDDialog.tsx @@ -4,7 +4,7 @@ import { isFiniteNumber } from "@excalidraw/math"; import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types"; -import { trackEvent } from "../../../analytics"; +import { trackEvent } from "../../../src/analytics"; import { useUIAppState } from "../../context/ui-appState"; import { atom, useAtom } from "../../editor-jotai"; import { t } from "../../i18n"; diff --git a/packages/excalidraw/src/components/TTDDialog/TTDDialogTrigger.tsx b/packages/excalidraw/src/components/TTDDialog/TTDDialogTrigger.tsx index a0e8a4865..b749247e8 100644 --- a/packages/excalidraw/src/components/TTDDialog/TTDDialogTrigger.tsx +++ b/packages/excalidraw/src/components/TTDDialog/TTDDialogTrigger.tsx @@ -1,4 +1,4 @@ -import { trackEvent } from "../../../analytics"; +import { trackEvent } from "../../../src/analytics"; import { useTunnels } from "../../context/tunnels"; import { t } from "../../i18n"; import { useExcalidrawSetAppState } from "../App"; diff --git a/packages/excalidraw/src/components/dropdownMenu/DropdownMenu.test.tsx b/packages/excalidraw/src/components/dropdownMenu/DropdownMenu.test.tsx index 5be65b100..4140e405a 100644 --- a/packages/excalidraw/src/components/dropdownMenu/DropdownMenu.test.tsx +++ b/packages/excalidraw/src/components/dropdownMenu/DropdownMenu.test.tsx @@ -1,15 +1,14 @@ -import React from "react"; - import { KEYS } from "@excalidraw/common"; -import { Excalidraw } from "../../index"; -import { Keyboard } from "../../tests/helpers/ui"; +import { Keyboard } from "@excalidraw/excalidraw/tests/helpers/ui"; import { render, waitFor, getByTestId, fireEvent, -} from "../../tests/test-utils"; +} from "@excalidraw/excalidraw/tests/test-utils"; + +import { Excalidraw } from "../../index"; describe("Test ", () => { it("should", async () => { diff --git a/packages/excalidraw/src/components/hoc/withInternalFallback.test.tsx b/packages/excalidraw/src/components/hoc/withInternalFallback.test.tsx index 1f30a64c4..12533cecc 100644 --- a/packages/excalidraw/src/components/hoc/withInternalFallback.test.tsx +++ b/packages/excalidraw/src/components/hoc/withInternalFallback.test.tsx @@ -1,7 +1,9 @@ -import React from "react"; +import { + render, + queryAllByTestId, +} from "@excalidraw/excalidraw/tests/test-utils"; import { Excalidraw, MainMenu } from "../../index"; -import { render, queryAllByTestId } from "../../tests/test-utils"; describe("Test internal component fallback rendering", () => { it("should render only one menu per excalidraw instance (custom menu first scenario)", async () => { diff --git a/packages/excalidraw/src/components/hyperlink/Hyperlink.tsx b/packages/excalidraw/src/components/hyperlink/Hyperlink.tsx index 063444a58..fe0696fa6 100644 --- a/packages/excalidraw/src/components/hyperlink/Hyperlink.tsx +++ b/packages/excalidraw/src/components/hyperlink/Hyperlink.tsx @@ -39,7 +39,7 @@ import type { NonDeletedExcalidrawElement, } from "@excalidraw/element/types"; -import { trackEvent } from "../../../analytics"; +import { trackEvent } from "../../../src/analytics"; import { getTooltipDiv, updateTooltipPosition } from "../Tooltip"; import { t } from "../../i18n"; diff --git a/packages/excalidraw/src/components/main-menu/DefaultItems.tsx b/packages/excalidraw/src/components/main-menu/DefaultItems.tsx index a0a7259c4..318e3ec01 100644 --- a/packages/excalidraw/src/components/main-menu/DefaultItems.tsx +++ b/packages/excalidraw/src/components/main-menu/DefaultItems.tsx @@ -13,7 +13,7 @@ import { actionToggleTheme, } from "../../actions"; import { getShortcutFromShortcutName } from "../../actions/shortcuts"; -import { trackEvent } from "../../../analytics"; +import { trackEvent } from "../../../src/analytics"; import { useUIAppState } from "../../context/ui-appState"; import { useSetAtom } from "../../editor-jotai"; import { useI18n } from "../../i18n"; diff --git a/packages/excalidraw/src/data/blob.ts b/packages/excalidraw/src/data/blob.ts index 1cf054446..d71b9272d 100644 --- a/packages/excalidraw/src/data/blob.ts +++ b/packages/excalidraw/src/data/blob.ts @@ -12,7 +12,7 @@ import { clearElementsForExport } from "@excalidraw/element"; import type { ValueOf } from "@excalidraw/common/utility-types"; import type { ExcalidrawElement, FileId } from "@excalidraw/element/types"; -import { cleanAppStateForExport } from "../../appState"; +import { cleanAppStateForExport } from "../../src/appState"; import { CanvasError, ImageSceneDataError } from "../errors"; import { calculateScrollCenter } from "../scene"; diff --git a/packages/excalidraw/src/data/json.ts b/packages/excalidraw/src/data/json.ts index c21fbfcd3..e27032afc 100644 --- a/packages/excalidraw/src/data/json.ts +++ b/packages/excalidraw/src/data/json.ts @@ -16,7 +16,7 @@ import type { ExcalidrawElement } from "@excalidraw/element/types"; import { cleanAppStateForExport, clearAppStateForDatabase, -} from "../../appState"; +} from "../../src/appState"; import { isImageFileHandle, loadFromBlob, normalizeFile } from "./blob"; import { fileOpen, fileSave } from "./filesystem"; diff --git a/packages/excalidraw/src/data/library.ts b/packages/excalidraw/src/data/library.ts index dcd416f24..19ae6c09b 100644 --- a/packages/excalidraw/src/data/library.ts +++ b/packages/excalidraw/src/data/library.ts @@ -28,7 +28,7 @@ import { atom, editorJotaiStore } from "../editor-jotai"; import { Emitter } from "../emitter"; import { AbortError } from "../errors"; -import { libraryItemSvgsCache } from "../../hooks/useLibraryItemSvg"; +import { libraryItemSvgsCache } from "../../src/hooks/useLibraryItemSvg"; import { t } from "../i18n"; import { loadLibraryFromBlob } from "./blob"; diff --git a/packages/excalidraw/src/data/restore.ts b/packages/excalidraw/src/data/restore.ts index fc2a42e59..783f61467 100644 --- a/packages/excalidraw/src/data/restore.ts +++ b/packages/excalidraw/src/data/restore.ts @@ -65,7 +65,7 @@ import type { import type { MarkOptional, Mutable } from "@excalidraw/common/utility-types"; -import { getDefaultAppState } from "../../appState"; +import { getDefaultAppState } from "../../src/appState"; import { getNormalizedGridSize, diff --git a/packages/excalidraw/src/data/types.ts b/packages/excalidraw/src/data/types.ts index fe472beef..159fc2c72 100644 --- a/packages/excalidraw/src/data/types.ts +++ b/packages/excalidraw/src/data/types.ts @@ -2,7 +2,7 @@ import type { VERSIONS } from "@excalidraw/common"; import type { ExcalidrawElement } from "@excalidraw/element/types"; -import type { cleanAppStateForExport } from "../../appState"; +import type { cleanAppStateForExport } from "../../src/appState"; import type { AppState, BinaryFiles, diff --git a/packages/excalidraw/src/fonts/Fonts.ts b/packages/excalidraw/src/fonts/Fonts.ts index 2ae3821ea..79b5ea1af 100644 --- a/packages/excalidraw/src/fonts/Fonts.ts +++ b/packages/excalidraw/src/fonts/Fonts.ts @@ -40,7 +40,7 @@ import { NunitoFontFaces } from "./Nunito"; import { VirgilFontFaces } from "./Virgil"; import { XiaolaiFontFaces } from "./Xiaolai"; -import type Scene from "../src/scene/Scene"; +import type Scene from "../scene/Scene"; export class Fonts { // it's ok to track fonts across multiple instances only once, so let's use diff --git a/packages/excalidraw/src/history.ts b/packages/excalidraw/src/history.ts index a7d3ba757..bf43b83c8 100644 --- a/packages/excalidraw/src/history.ts +++ b/packages/excalidraw/src/history.ts @@ -1,6 +1,6 @@ import type { SceneElementsMap } from "@excalidraw/element/types"; -import { Emitter } from "./src/emitter"; +import { Emitter } from "../src/emitter"; import type { AppStateChange, ElementsChange } from "./change"; import type { Snapshot } from "./store"; diff --git a/packages/excalidraw/src/hooks/useCreatePortalContainer.ts b/packages/excalidraw/src/hooks/useCreatePortalContainer.ts index 781d7b644..fb0d24bc3 100644 --- a/packages/excalidraw/src/hooks/useCreatePortalContainer.ts +++ b/packages/excalidraw/src/hooks/useCreatePortalContainer.ts @@ -3,7 +3,7 @@ import { useState, useLayoutEffect } from "react"; import { THEME } from "@excalidraw/common"; import { useDevice, useExcalidrawContainer } from "../components/App"; -import { useUIAppState } from "../src/context/ui-appState"; +import { useUIAppState } from "../context/ui-appState"; export const useCreatePortalContainer = (opts?: { className?: string; diff --git a/packages/excalidraw/src/renderer/helpers.ts b/packages/excalidraw/src/renderer/helpers.ts index e1fee07e9..92f0d0725 100644 --- a/packages/excalidraw/src/renderer/helpers.ts +++ b/packages/excalidraw/src/renderer/helpers.ts @@ -1,7 +1,7 @@ import { THEME, THEME_FILTER } from "@excalidraw/common"; -import type { StaticCanvasRenderConfig } from "../src/scene/types"; import type { StaticCanvasAppState, AppState } from "../types"; +import type { StaticCanvasRenderConfig } from "../scene/types"; export const fillCircle = ( context: CanvasRenderingContext2D, diff --git a/packages/excalidraw/src/renderer/interactiveScene.ts b/packages/excalidraw/src/renderer/interactiveScene.ts index 385d34d90..3000c206c 100644 --- a/packages/excalidraw/src/renderer/interactiveScene.ts +++ b/packages/excalidraw/src/renderer/interactiveScene.ts @@ -79,7 +79,7 @@ import { getScrollBars, SCROLLBAR_COLOR, SCROLLBAR_WIDTH, -} from "../src/scene/scrollbars"; +} from "../scene/scrollbars"; import { type InteractiveCanvasAppState } from "../types"; import { getClientColor, renderRemoteCursors } from "../clients"; @@ -94,7 +94,7 @@ import type { InteractiveCanvasRenderConfig, InteractiveSceneRenderConfig, RenderableElementsMap, -} from "../src/scene/types"; +} from "../scene/types"; const renderElbowArrowMidPointHighlight = ( context: CanvasRenderingContext2D, diff --git a/packages/excalidraw/src/renderer/renderNewElementScene.ts b/packages/excalidraw/src/renderer/renderNewElementScene.ts index d0ade99cf..bbc14654a 100644 --- a/packages/excalidraw/src/renderer/renderNewElementScene.ts +++ b/packages/excalidraw/src/renderer/renderNewElementScene.ts @@ -4,7 +4,7 @@ import { renderElement } from "@excalidraw/element/renderElement"; import { bootstrapCanvas, getNormalizedCanvasDimensions } from "./helpers"; -import type { NewElementSceneRenderConfig } from "../src/scene/types"; +import type { NewElementSceneRenderConfig } from "../scene/types"; const _renderNewElementScene = ({ canvas, diff --git a/packages/excalidraw/src/renderer/staticScene.ts b/packages/excalidraw/src/renderer/staticScene.ts index a46e02542..16743ff91 100644 --- a/packages/excalidraw/src/renderer/staticScene.ts +++ b/packages/excalidraw/src/renderer/staticScene.ts @@ -34,7 +34,7 @@ import { bootstrapCanvas, getNormalizedCanvasDimensions } from "./helpers"; import type { StaticCanvasRenderConfig, StaticSceneRenderConfig, -} from "../src/scene/types"; +} from "../scene/types"; import type { StaticCanvasAppState, Zoom } from "../types"; const GridLineColor = { diff --git a/packages/excalidraw/src/renderer/staticSvgScene.ts b/packages/excalidraw/src/renderer/staticSvgScene.ts index 6912f0fb9..a6b630ab3 100644 --- a/packages/excalidraw/src/renderer/staticSvgScene.ts +++ b/packages/excalidraw/src/renderer/staticSvgScene.ts @@ -47,10 +47,8 @@ import type { NonDeletedExcalidrawElement, } from "@excalidraw/element/types"; -import type { - RenderableElementsMap, - SVGRenderConfig, -} from "../src/scene/types"; +import type { RenderableElementsMap, SVGRenderConfig } from "../scene/types"; + import type { AppState, BinaryFiles } from "../types"; import type { Drawable } from "roughjs/bin/core"; import type { RoughSVG } from "roughjs/bin/svg"; diff --git a/packages/excalidraw/src/scene/Renderer.ts b/packages/excalidraw/src/scene/Renderer.ts index 95528dce3..8a3d3750c 100644 --- a/packages/excalidraw/src/scene/Renderer.ts +++ b/packages/excalidraw/src/scene/Renderer.ts @@ -9,8 +9,8 @@ import type { NonDeletedExcalidrawElement, } from "@excalidraw/element/types"; -import { renderInteractiveSceneThrottled } from "../../renderer/interactiveScene"; -import { renderStaticSceneThrottled } from "../../renderer/staticScene"; +import { renderInteractiveSceneThrottled } from "../../src/renderer/interactiveScene"; +import { renderStaticSceneThrottled } from "../../src/renderer/staticScene"; import type Scene from "./Scene"; import type { RenderableElementsMap } from "./types"; diff --git a/packages/excalidraw/src/scene/export.ts b/packages/excalidraw/src/scene/export.ts index 581e92b94..be7dfd122 100644 --- a/packages/excalidraw/src/scene/export.ts +++ b/packages/excalidraw/src/scene/export.ts @@ -52,14 +52,14 @@ import type { NonDeletedSceneElementsMap, } from "@excalidraw/element/types"; -import { getDefaultAppState } from "../../appState"; +import { getDefaultAppState } from "../../src/appState"; import { base64ToString, decode, encode, stringToBase64 } from "../data/encode"; import { serializeAsJSON } from "../data/json"; -import { Fonts } from "../../fonts"; +import { Fonts } from "../../src/fonts"; -import { renderStaticScene } from "../../renderer/staticScene"; -import { renderSceneToSvg } from "../../renderer/staticSvgScene"; +import { renderStaticScene } from "../../src/renderer/staticScene"; +import { renderSceneToSvg } from "../../src/renderer/staticSvgScene"; import type { RenderableElementsMap } from "./types"; diff --git a/packages/excalidraw/src/wysiwyg/textWysiwyg.test.tsx b/packages/excalidraw/src/wysiwyg/textWysiwyg.test.tsx index 0ba1960d6..19fcf9de1 100644 --- a/packages/excalidraw/src/wysiwyg/textWysiwyg.test.tsx +++ b/packages/excalidraw/src/wysiwyg/textWysiwyg.test.tsx @@ -11,26 +11,31 @@ import { VERTICAL_ALIGN, } from "@excalidraw/common"; +import { Keyboard, Pointer, UI } from "@excalidraw/excalidraw/tests/helpers/ui"; +import { + getTextEditor, + updateTextEditor, +} from "@excalidraw/excalidraw/tests/queries/dom"; +import { + GlobalTestState, + render, + screen, + unmountComponent, +} from "@excalidraw/excalidraw/tests/test-utils"; +import { + fireEvent, + mockBoundingClientRect, + restoreOriginalGetBoundingClientRect, +} from "@excalidraw/excalidraw/tests/test-utils"; + +import { API } from "@excalidraw/excalidraw/tests/helpers/api"; + import type { ExcalidrawTextElement, ExcalidrawTextElementWithContainer, } from "@excalidraw/element/types"; import { Excalidraw } from "../index"; -import { API } from "../tests/helpers/api"; -import { Keyboard, Pointer, UI } from "../tests/helpers/ui"; -import { getTextEditor, updateTextEditor } from "../tests/queries/dom"; -import { - GlobalTestState, - render, - screen, - unmountComponent, -} from "../tests/test-utils"; -import { - fireEvent, - mockBoundingClientRect, - restoreOriginalGetBoundingClientRect, -} from "../tests/test-utils"; import { actionBindText } from "../actions"; unmountComponent(); diff --git a/packages/excalidraw/src/wysiwyg/textWysiwyg.tsx b/packages/excalidraw/src/wysiwyg/textWysiwyg.tsx index 077f8db5a..b1610125f 100644 --- a/packages/excalidraw/src/wysiwyg/textWysiwyg.tsx +++ b/packages/excalidraw/src/wysiwyg/textWysiwyg.tsx @@ -43,21 +43,21 @@ import type { ExcalidrawTextElement, } from "@excalidraw/element/types"; -import { actionSaveToActiveFile } from "../src/actions"; +import { actionSaveToActiveFile } from "../actions"; -import Scene from "../src/scene/Scene"; +import Scene from "../scene/Scene"; import { parseClipboard } from "../clipboard"; import { actionDecreaseFontSize, actionIncreaseFontSize, -} from "../src/actions/actionProperties"; +} from "../actions/actionProperties"; import { actionResetZoom, actionZoomIn, actionZoomOut, -} from "../src/actions/actionCanvas"; +} from "../actions/actionCanvas"; -import type App from "../src/components/App"; +import type App from "../components/App"; import type { AppState } from "../types"; const getTransform = ( diff --git a/packages/excalidraw/tests/App.test.tsx b/packages/excalidraw/tests/App.test.tsx index 9a362d1a4..a12efca3f 100644 --- a/packages/excalidraw/tests/App.test.tsx +++ b/packages/excalidraw/tests/App.test.tsx @@ -4,7 +4,7 @@ import { vi } from "vitest"; import { reseed } from "@excalidraw/common"; import { Excalidraw } from "../src/index"; -import * as StaticScene from "../renderer/staticScene"; +import * as StaticScene from "../src/renderer/staticScene"; import { render, queryByTestId, unmountComponent } from "../tests/test-utils"; const renderStaticScene = vi.spyOn(StaticScene, "renderStaticScene"); diff --git a/packages/excalidraw/tests/actionStyles.test.tsx b/packages/excalidraw/tests/actionStyles.test.tsx index ff1a0f05b..aadccaed1 100644 --- a/packages/excalidraw/tests/actionStyles.test.tsx +++ b/packages/excalidraw/tests/actionStyles.test.tsx @@ -2,7 +2,7 @@ import React from "react"; import { CODES } from "@excalidraw/common"; -import { copiedStyles } from "../actions/actionStyles"; +import { copiedStyles } from "../src/actions/actionStyles"; import { Excalidraw } from "../src/index"; import { API } from "../tests/helpers/api"; import { Keyboard, Pointer, UI } from "../tests/helpers/ui"; diff --git a/packages/excalidraw/tests/appState.test.tsx b/packages/excalidraw/tests/appState.test.tsx index 286934627..4287e905b 100644 --- a/packages/excalidraw/tests/appState.test.tsx +++ b/packages/excalidraw/tests/appState.test.tsx @@ -4,7 +4,7 @@ import { EXPORT_DATA_TYPES, MIME_TYPES } from "@excalidraw/common"; import type { ExcalidrawTextElement } from "@excalidraw/element/types"; -import { getDefaultAppState } from "../appState"; +import { getDefaultAppState } from "../src/appState"; import { Excalidraw } from "../src/index"; import { API } from "./helpers/api"; diff --git a/packages/excalidraw/tests/clients.test.ts b/packages/excalidraw/tests/clients.test.ts index e78cf1864..456cb7101 100644 --- a/packages/excalidraw/tests/clients.test.ts +++ b/packages/excalidraw/tests/clients.test.ts @@ -1,4 +1,4 @@ -import { getNameInitial } from "../clients"; +import { getNameInitial } from "../src/clients"; describe("getClientInitials", () => { it("returns substring if one name provided", () => { diff --git a/packages/excalidraw/tests/clipboard.test.tsx b/packages/excalidraw/tests/clipboard.test.tsx index 77fba4b02..f7ab390b9 100644 --- a/packages/excalidraw/tests/clipboard.test.tsx +++ b/packages/excalidraw/tests/clipboard.test.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { vi } from "vitest"; import { getLineHeightInPx } from "@excalidraw/element/textMeasurements"; diff --git a/packages/excalidraw/tests/contextmenu.test.tsx b/packages/excalidraw/tests/contextmenu.test.tsx index e3d14b5c2..eb2ec2e33 100644 --- a/packages/excalidraw/tests/contextmenu.test.tsx +++ b/packages/excalidraw/tests/contextmenu.test.tsx @@ -5,9 +5,9 @@ import { KEYS, reseed } from "@excalidraw/common"; import { setDateTimeForTests } from "@excalidraw/common"; -import { copiedStyles } from "../actions/actionStyles"; +import { copiedStyles } from "../src/actions/actionStyles"; import { Excalidraw } from "../src/index"; -import * as StaticScene from "../renderer/staticScene"; +import * as StaticScene from "../src/renderer/staticScene"; import { API } from "./helpers/api"; import { UI, Pointer, Keyboard } from "./helpers/ui"; @@ -25,8 +25,8 @@ import { unmountComponent, } from "./test-utils"; -import type { ShortcutName } from "../actions/shortcuts"; -import type { ActionName } from "../actions/types"; +import type { ShortcutName } from "../src/actions/shortcuts"; +import type { ActionName } from "../src/actions/types"; const checkpoint = (name: string) => { expect(renderStaticScene.mock.calls.length).toMatchSnapshot( diff --git a/packages/excalidraw/tests/cropElement.test.tsx b/packages/excalidraw/tests/cropElement.test.tsx index 249898006..56b9e2643 100644 --- a/packages/excalidraw/tests/cropElement.test.tsx +++ b/packages/excalidraw/tests/cropElement.test.tsx @@ -11,7 +11,7 @@ import type { } from "@excalidraw/element/types"; import { Excalidraw, exportToCanvas, exportToSvg } from "../src"; -import { actionFlipHorizontal, actionFlipVertical } from "../actions"; +import { actionFlipHorizontal, actionFlipVertical } from "../src/actions"; import { API } from "./helpers/api"; import { Keyboard, Pointer, UI } from "./helpers/ui"; diff --git a/packages/excalidraw/tests/data/reconcile.test.ts b/packages/excalidraw/tests/data/reconcile.test.ts index dfb1e6b63..87e59c5c7 100644 --- a/packages/excalidraw/tests/data/reconcile.test.ts +++ b/packages/excalidraw/tests/data/reconcile.test.ts @@ -7,9 +7,9 @@ import type { OrderedExcalidrawElement, } from "@excalidraw/element/types"; -import { reconcileElements } from "../../data/reconcile"; +import { reconcileElements } from "../../src/data/reconcile"; -import type { RemoteExcalidrawElement } from "../../data/reconcile"; +import type { RemoteExcalidrawElement } from "../../src/data/reconcile"; import type { AppState } from "../../src/types"; diff --git a/packages/excalidraw/tests/data/restore.test.ts b/packages/excalidraw/tests/data/restore.test.ts index 6928715bd..8e12ef255 100644 --- a/packages/excalidraw/tests/data/restore.test.ts +++ b/packages/excalidraw/tests/data/restore.test.ts @@ -15,10 +15,10 @@ import type { import type { NormalizedZoomValue } from "@excalidraw/excalidraw/src/types"; import { API } from "../helpers/api"; -import * as restore from "../../data/restore"; -import { getDefaultAppState } from "../../appState"; +import * as restore from "../../src/data/restore"; +import { getDefaultAppState } from "../../src/appState"; -import type { ImportedDataState } from "../../data/types"; +import type { ImportedDataState } from "../../src/data/types"; describe("restoreElements", () => { const mockSizeHelper = vi.spyOn(sizeHelpers, "isInvisiblySmallElement"); diff --git a/packages/excalidraw/tests/dragCreate.test.tsx b/packages/excalidraw/tests/dragCreate.test.tsx index b48efc3cd..2377491de 100644 --- a/packages/excalidraw/tests/dragCreate.test.tsx +++ b/packages/excalidraw/tests/dragCreate.test.tsx @@ -6,8 +6,8 @@ import { KEYS, reseed } from "@excalidraw/common"; import type { ExcalidrawLinearElement } from "@excalidraw/element/types"; import { Excalidraw } from "../src/index"; -import * as InteractiveScene from "../renderer/interactiveScene"; -import * as StaticScene from "../renderer/staticScene"; +import * as InteractiveScene from "../src/renderer/interactiveScene"; +import * as StaticScene from "../src/renderer/staticScene"; import { render, diff --git a/packages/excalidraw/tests/elementLocking.test.tsx b/packages/excalidraw/tests/elementLocking.test.tsx index b8be03f17..1973dfafc 100644 --- a/packages/excalidraw/tests/elementLocking.test.tsx +++ b/packages/excalidraw/tests/elementLocking.test.tsx @@ -4,7 +4,7 @@ import { mutateElement } from "@excalidraw/element/mutateElement"; import { KEYS } from "@excalidraw/common"; -import { actionSelectAll } from "../actions"; +import { actionSelectAll } from "../src/actions"; import { t } from "../src/i18n"; import { Excalidraw } from "../src/index"; diff --git a/packages/excalidraw/tests/export.test.tsx b/packages/excalidraw/tests/export.test.tsx index 7da68c46f..542e8beb2 100644 --- a/packages/excalidraw/tests/export.test.tsx +++ b/packages/excalidraw/tests/export.test.tsx @@ -4,16 +4,16 @@ import { SVG_NS } from "@excalidraw/common"; import type { FileId } from "@excalidraw/element/types"; -import { getDefaultAppState } from "../appState"; -import { getDataURL } from "../data/blob"; -import { encodePngMetadata } from "../data/image"; -import { serializeAsJSON } from "../data/json"; +import { getDefaultAppState } from "../src/appState"; +import { getDataURL } from "../src/data/blob"; +import { encodePngMetadata } from "../src/data/image"; +import { serializeAsJSON } from "../src/data/json"; import { Excalidraw } from "../src/index"; import { decodeSvgBase64Payload, encodeSvgBase64Payload, exportToSvg, -} from "../scene/export"; +} from "../src/scene/export"; import { API } from "./helpers/api"; import { render, waitFor } from "./test-utils"; diff --git a/packages/excalidraw/tests/flip.test.tsx b/packages/excalidraw/tests/flip.test.tsx index b214753c7..175290274 100644 --- a/packages/excalidraw/tests/flip.test.tsx +++ b/packages/excalidraw/tests/flip.test.tsx @@ -19,12 +19,12 @@ import type { FileId, } from "@excalidraw/element/types"; -import { actionFlipHorizontal, actionFlipVertical } from "../actions"; +import { actionFlipHorizontal, actionFlipVertical } from "../src/actions"; import { createPasteEvent } from "../src/clipboard"; import { Excalidraw } from "../src/index"; // Importing to spy on it and mock the implementation (mocking does not work with simple vi.mock for some reason) -import * as blobModule from "../data/blob"; +import * as blobModule from "../src/data/blob"; import { API } from "./helpers/api"; import { UI, Pointer, Keyboard } from "./helpers/ui"; diff --git a/packages/excalidraw/tests/helpers/api.ts b/packages/excalidraw/tests/helpers/api.ts index 5cc96db66..e94d6d23a 100644 --- a/packages/excalidraw/tests/helpers/api.ts +++ b/packages/excalidraw/tests/helpers/api.ts @@ -42,13 +42,13 @@ import type { import type { Mutable } from "@excalidraw/common/utility-types"; -import { getMimeType } from "../../data/blob"; -import { createTestHook } from "../../components/App"; -import { getDefaultAppState } from "../../appState"; +import { getMimeType } from "../../src/data/blob"; +import { createTestHook } from "../../src/components/App"; +import { getDefaultAppState } from "../../src/appState"; import { GlobalTestState, createEvent, fireEvent, act } from "../test-utils"; -import type { Action } from "../../actions/types"; -import type App from "../../components/App"; +import type { Action } from "../../src/actions/types"; +import type App from "../../src/components/App"; import type { AppState } from "../../src/types"; diff --git a/packages/excalidraw/tests/helpers/ui.ts b/packages/excalidraw/tests/helpers/ui.ts index 8271eebb1..426ce6c99 100644 --- a/packages/excalidraw/tests/helpers/ui.ts +++ b/packages/excalidraw/tests/helpers/ui.ts @@ -38,7 +38,7 @@ import type { ExcalidrawImageElement, } from "@excalidraw/element/types"; -import { createTestHook } from "../../components/App"; +import { createTestHook } from "../../src/components/App"; import { getTextEditor } from "../queries/dom"; import { act, fireEvent, GlobalTestState, screen } from "../test-utils"; diff --git a/packages/excalidraw/tests/history.test.tsx b/packages/excalidraw/tests/history.test.tsx index afbe65ead..712e874ae 100644 --- a/packages/excalidraw/tests/history.test.tsx +++ b/packages/excalidraw/tests/history.test.tsx @@ -42,15 +42,18 @@ import { actionSendBackward, actionBringForward, actionSendToBack, -} from "../actions"; -import { createUndoAction, createRedoAction } from "../actions/actionHistory"; -import { actionToggleViewMode } from "../actions/actionToggleViewMode"; -import { getDefaultAppState } from "../appState"; -import { HistoryEntry } from "../history"; +} from "../src/actions"; +import { + createUndoAction, + createRedoAction, +} from "../src/actions/actionHistory"; +import { actionToggleViewMode } from "../src/actions/actionToggleViewMode"; +import { getDefaultAppState } from "../src/appState"; +import { HistoryEntry } from "../src/history"; import { Excalidraw } from "../src/index"; -import * as StaticScene from "../renderer/staticScene"; +import * as StaticScene from "../src/renderer/staticScene"; import { Snapshot, CaptureUpdateAction } from "../src/store.js"; -import { AppStateChange, ElementsChange } from "../change"; +import { AppStateChange, ElementsChange } from "../src/change"; import { API } from "./helpers/api"; import { Keyboard, Pointer, UI } from "./helpers/ui"; diff --git a/packages/excalidraw/tests/lasso.test.tsx b/packages/excalidraw/tests/lasso.test.tsx index 83c152713..e3f429db1 100644 --- a/packages/excalidraw/tests/lasso.test.tsx +++ b/packages/excalidraw/tests/lasso.test.tsx @@ -27,13 +27,13 @@ import type { ExcalidrawElement } from "@excalidraw/element/types"; import { Excalidraw } from "../src/index"; -import { getSelectedElements } from "../scene"; +import { getSelectedElements } from "../src/scene"; -import { getLassoSelectedElementIds } from "../lasso/utils"; +import { getLassoSelectedElementIds } from "../src/lasso/utils"; import { act, render } from "./test-utils"; -import type { ElementsSegmentsMap } from "../lasso/utils"; +import type { ElementsSegmentsMap } from "../src/lasso/utils"; const { h } = window; diff --git a/packages/excalidraw/tests/library.test.tsx b/packages/excalidraw/tests/library.test.tsx index 6f1af466e..653c1c5dd 100644 --- a/packages/excalidraw/tests/library.test.tsx +++ b/packages/excalidraw/tests/library.test.tsx @@ -8,9 +8,9 @@ import { getCommonBoundingBox } from "@excalidraw/element/bounds"; import type { ExcalidrawGenericElement } from "@excalidraw/element/types"; -import { parseLibraryJSON } from "../data/blob"; -import { serializeLibraryAsJSON } from "../data/json"; -import { distributeLibraryItemsOnSquareGrid } from "../data/library"; +import { parseLibraryJSON } from "../src/data/blob"; +import { serializeLibraryAsJSON } from "../src/data/json"; +import { distributeLibraryItemsOnSquareGrid } from "../src/data/library"; import { Excalidraw } from "../src/index"; import { API } from "./helpers/api"; diff --git a/packages/excalidraw/tests/linearElementEditor.test.tsx b/packages/excalidraw/tests/linearElementEditor.test.tsx index b0eb5b3d5..3e352aa52 100644 --- a/packages/excalidraw/tests/linearElementEditor.test.tsx +++ b/packages/excalidraw/tests/linearElementEditor.test.tsx @@ -31,8 +31,8 @@ import type { } from "@excalidraw/element/types"; import { Excalidraw, mutateElement } from "../src/index"; -import * as InteractiveCanvas from "../renderer/interactiveScene"; -import * as StaticScene from "../renderer/staticScene"; +import * as InteractiveCanvas from "../src/renderer/interactiveScene"; +import * as StaticScene from "../src/renderer/staticScene"; import { API } from "../tests/helpers/api"; import { Keyboard, Pointer, UI } from "./helpers/ui"; diff --git a/packages/excalidraw/tests/move.test.tsx b/packages/excalidraw/tests/move.test.tsx index 10f81bb6e..4dbd9fad5 100644 --- a/packages/excalidraw/tests/move.test.tsx +++ b/packages/excalidraw/tests/move.test.tsx @@ -13,11 +13,11 @@ import type { ExcalidrawRectangleElement, } from "@excalidraw/element/types"; -import type Scene from "@excalidraw/excalidraw/scene/Scene"; +import type Scene from "@excalidraw/excalidraw/src/scene/Scene"; import { Excalidraw } from "../src/index"; -import * as InteractiveCanvas from "../renderer/interactiveScene"; -import * as StaticScene from "../renderer/staticScene"; +import * as InteractiveCanvas from "../src/renderer/interactiveScene"; +import * as StaticScene from "../src/renderer/staticScene"; import { UI, Pointer, Keyboard } from "./helpers/ui"; import { render, fireEvent, act, unmountComponent } from "./test-utils"; diff --git a/packages/excalidraw/tests/multiPointCreate.test.tsx b/packages/excalidraw/tests/multiPointCreate.test.tsx index 23ec002b6..4668aa554 100644 --- a/packages/excalidraw/tests/multiPointCreate.test.tsx +++ b/packages/excalidraw/tests/multiPointCreate.test.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { vi } from "vitest"; import { KEYS, reseed } from "@excalidraw/common"; @@ -7,8 +6,8 @@ import type { ExcalidrawLinearElement } from "@excalidraw/element/types"; import { Excalidraw } from "../src/index"; -import * as InteractiveCanvas from "../renderer/interactiveScene"; -import * as StaticScene from "../renderer/staticScene"; +import * as InteractiveCanvas from "../src/renderer/interactiveScene"; +import * as StaticScene from "../src/renderer/staticScene"; import { render, diff --git a/packages/excalidraw/tests/regressionTests.test.tsx b/packages/excalidraw/tests/regressionTests.test.tsx index daf198359..b857b699f 100644 --- a/packages/excalidraw/tests/regressionTests.test.tsx +++ b/packages/excalidraw/tests/regressionTests.test.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { vi } from "vitest"; import { FONT_FAMILY, CODES, KEYS, reseed } from "@excalidraw/common"; @@ -8,7 +7,7 @@ import { setDateTimeForTests } from "@excalidraw/common"; import type { ExcalidrawElement } from "@excalidraw/element/types"; import { Excalidraw } from "../src/index"; -import * as StaticScene from "../renderer/staticScene"; +import * as StaticScene from "../src/renderer/staticScene"; import { API } from "./helpers/api"; import { Keyboard, Pointer, UI } from "./helpers/ui"; diff --git a/packages/excalidraw/tests/rotate.test.tsx b/packages/excalidraw/tests/rotate.test.tsx index 8176bc39d..3f01542ad 100644 --- a/packages/excalidraw/tests/rotate.test.tsx +++ b/packages/excalidraw/tests/rotate.test.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { expect } from "vitest"; import { reseed } from "@excalidraw/common"; diff --git a/packages/excalidraw/tests/scene/export.test.ts b/packages/excalidraw/tests/scene/export.test.ts index 3187e2c40..609241f9f 100644 --- a/packages/excalidraw/tests/scene/export.test.ts +++ b/packages/excalidraw/tests/scene/export.test.ts @@ -8,8 +8,8 @@ import type { NonDeletedExcalidrawElement, } from "@excalidraw/element/types"; -import { prepareElementsForExport } from "../../data"; -import * as exportUtils from "../../scene/export"; +import { prepareElementsForExport } from "../../src/data"; +import * as exportUtils from "../../src/scene/export"; import { diamondFixture, ellipseFixture, diff --git a/packages/excalidraw/tests/scroll.test.tsx b/packages/excalidraw/tests/scroll.test.tsx index dbda58380..1f19fd6ed 100644 --- a/packages/excalidraw/tests/scroll.test.tsx +++ b/packages/excalidraw/tests/scroll.test.tsx @@ -1,5 +1,3 @@ -import React from "react"; - import { KEYS } from "@excalidraw/common"; import { Excalidraw } from "../src/index"; diff --git a/packages/excalidraw/tests/search.test.tsx b/packages/excalidraw/tests/search.test.tsx index 487386b4c..625b479dc 100644 --- a/packages/excalidraw/tests/search.test.tsx +++ b/packages/excalidraw/tests/search.test.tsx @@ -1,5 +1,3 @@ -import React from "react"; - import { CANVAS_SEARCH_TAB, CLASSES, diff --git a/packages/excalidraw/tests/selection.test.tsx b/packages/excalidraw/tests/selection.test.tsx index f71002855..b0a83c8b0 100644 --- a/packages/excalidraw/tests/selection.test.tsx +++ b/packages/excalidraw/tests/selection.test.tsx @@ -1,13 +1,12 @@ -import React from "react"; import { vi } from "vitest"; import { KEYS, reseed } from "@excalidraw/common"; -import { SHAPES } from "../components/shapes"; +import { SHAPES } from "../src/components/shapes"; import { Excalidraw } from "../src/index"; -import * as InteractiveCanvas from "../renderer/interactiveScene"; -import * as StaticScene from "../renderer/staticScene"; +import * as InteractiveCanvas from "../src/renderer/interactiveScene"; +import * as StaticScene from "../src/renderer/staticScene"; import { API } from "./helpers/api"; import { Keyboard, Pointer, UI } from "./helpers/ui"; diff --git a/packages/excalidraw/tests/shortcuts.test.tsx b/packages/excalidraw/tests/shortcuts.test.tsx index f0215706c..3d1c50035 100644 --- a/packages/excalidraw/tests/shortcuts.test.tsx +++ b/packages/excalidraw/tests/shortcuts.test.tsx @@ -1,5 +1,3 @@ -import React from "react"; - import { KEYS } from "@excalidraw/common"; import { Excalidraw } from "../src/index"; diff --git a/packages/excalidraw/tests/test-utils.ts b/packages/excalidraw/tests/test-utils.ts index b2b8aff9c..db500c4c4 100644 --- a/packages/excalidraw/tests/test-utils.ts +++ b/packages/excalidraw/tests/test-utils.ts @@ -24,7 +24,7 @@ import * as toolQueries from "./queries/toolQueries"; import type { RenderResult, RenderOptions } from "@testing-library/react"; -import type { ImportedDataState } from "../data/types"; +import type { ImportedDataState } from "../src/data/types"; export { cleanup as unmountComponent }; diff --git a/packages/utils/src/export.ts b/packages/utils/src/export.ts index 4670511c9..983f774e3 100644 --- a/packages/utils/src/export.ts +++ b/packages/utils/src/export.ts @@ -1,5 +1,5 @@ import { MIME_TYPES } from "@excalidraw/common"; -import { getDefaultAppState } from "@excalidraw/excalidraw/appState"; +import { getDefaultAppState } from "@excalidraw/excalidraw/src/appState"; import { copyBlobToClipboardAsPng, copyTextToSystemClipboard, diff --git a/packages/utils/tests/export.test.ts b/packages/utils/tests/export.test.ts index 47b9398ab..57cb338ee 100644 --- a/packages/utils/tests/export.test.ts +++ b/packages/utils/tests/export.test.ts @@ -1,5 +1,5 @@ import { MIME_TYPES } from "@excalidraw/common"; -import * as mockedSceneExportUtils from "@excalidraw/excalidraw/scene/export"; +import * as mockedSceneExportUtils from "@excalidraw/excalidraw/src/scene/export"; import { diagramFactory } from "@excalidraw/excalidraw/tests/fixtures/diagramFixture"; import { vi } from "vitest"; diff --git a/packages/utils/tests/utils.unmocked.test.ts b/packages/utils/tests/utils.unmocked.test.ts index b77bc37d1..7f5850a7b 100644 --- a/packages/utils/tests/utils.unmocked.test.ts +++ b/packages/utils/tests/utils.unmocked.test.ts @@ -1,8 +1,8 @@ -import { decodePngMetadata } from "@excalidraw/excalidraw/data/image"; -import { decodeSvgBase64Payload } from "@excalidraw/excalidraw/scene/export"; +import { decodePngMetadata } from "@excalidraw/excalidraw/src/data/image"; +import { decodeSvgBase64Payload } from "@excalidraw/excalidraw/src/scene/export"; import { API } from "@excalidraw/excalidraw/tests/helpers/api"; -import type { ImportedDataState } from "@excalidraw/excalidraw/data/types"; +import type { ImportedDataState } from "@excalidraw/excalidraw/src/data/types"; import * as utils from "../src";