diff --git a/excalidraw-app/App.tsx b/excalidraw-app/App.tsx index 7dd92fd6b..9956dc236 100644 --- a/excalidraw-app/App.tsx +++ b/excalidraw-app/App.tsx @@ -22,13 +22,6 @@ import { THEME, TITLE_TIMEOUT, VERSION_TIMEOUT, -} from "@excalidraw/common"; -import polyfill from "@excalidraw/excalidraw/polyfill"; -import { useCallback, useEffect, useRef, useState } from "react"; -import { loadFromBlob } from "@excalidraw/excalidraw/data/blob"; -import { useCallbackRefState } from "@excalidraw/excalidraw/hooks/useCallbackRefState"; -import { t } from "@excalidraw/excalidraw/i18n"; -import { debounce, getVersion, getFrame, @@ -37,6 +30,12 @@ import { resolvablePromise, isRunningInIframe, } from "@excalidraw/common"; +import polyfill from "@excalidraw/excalidraw/polyfill"; +import { useCallback, useEffect, useRef, useState } from "react"; +import { loadFromBlob } from "@excalidraw/excalidraw/data/blob"; +import { useCallbackRefState } from "@excalidraw/excalidraw/hooks/useCallbackRefState"; +import { t } from "@excalidraw/excalidraw/i18n"; + import { GithubIcon, XBrandIcon, @@ -72,7 +71,7 @@ import type { UIAppState, } from "@excalidraw/excalidraw/types"; import type { ResolutionType } from "@excalidraw/common/utility-types"; -import type { ResolvablePromise } from "@excalidraw/common"; +import type { ResolvablePromise } from "@excalidraw/common/utils"; import CustomStats from "./CustomStats"; import { diff --git a/excalidraw-app/CustomStats.tsx b/excalidraw-app/CustomStats.tsx index 978aa17a1..543af5cfd 100644 --- a/excalidraw-app/CustomStats.tsx +++ b/excalidraw-app/CustomStats.tsx @@ -1,8 +1,12 @@ import { Stats } from "@excalidraw/excalidraw"; import { copyTextToSystemClipboard } from "@excalidraw/excalidraw/clipboard"; -import { DEFAULT_VERSION } from "@excalidraw/common"; +import { + DEFAULT_VERSION, + debounce, + getVersion, + nFormatter, +} from "@excalidraw/common"; import { t } from "@excalidraw/excalidraw/i18n"; -import { debounce, getVersion, nFormatter } from "@excalidraw/common"; import { useEffect, useState } from "react"; import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types"; diff --git a/excalidraw-app/collab/Collab.tsx b/excalidraw-app/collab/Collab.tsx index fc4d08554..793f9e6ab 100644 --- a/excalidraw-app/collab/Collab.tsx +++ b/excalidraw-app/collab/Collab.tsx @@ -11,6 +11,10 @@ import { IDLE_THRESHOLD, ACTIVE_THRESHOLD, UserIdleState, + assertNever, + preventUnload, + resolvablePromise, + throttleRAF, } from "@excalidraw/common"; import { decryptData } from "@excalidraw/excalidraw/data/encryption"; import { getVisibleSceneBounds } from "@excalidraw/element/bounds"; @@ -22,12 +26,7 @@ import { import { AbortError } from "@excalidraw/excalidraw/errors"; import { t } from "@excalidraw/excalidraw/i18n"; import { withBatchedUpdates } from "@excalidraw/excalidraw/reactUtils"; -import { - assertNever, - preventUnload, - resolvablePromise, - throttleRAF, -} from "@excalidraw/common"; + import throttle from "lodash.throttle"; import { PureComponent } from "react"; diff --git a/excalidraw-app/components/ExportToExcalidrawPlus.tsx b/excalidraw-app/components/ExportToExcalidrawPlus.tsx index 785e23a1e..60f1608b2 100644 --- a/excalidraw-app/components/ExportToExcalidrawPlus.tsx +++ b/excalidraw-app/components/ExportToExcalidrawPlus.tsx @@ -1,8 +1,12 @@ +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 { MIME_TYPES } from "@excalidraw/common"; +import { MIME_TYPES, getFrame } from "@excalidraw/common"; import { encryptData, generateEncryptionKey, @@ -10,10 +14,6 @@ import { import { serializeAsJSON } from "@excalidraw/excalidraw/data/json"; import { isInitializedImageElement } from "@excalidraw/element/typeChecks"; import { useI18n } from "@excalidraw/excalidraw/i18n"; -import { getFrame } from "@excalidraw/common"; -import { uploadBytes, ref } from "firebase/storage"; -import { nanoid } from "nanoid"; -import React from "react"; import type { FileId, diff --git a/excalidraw-app/data/LocalData.ts b/excalidraw-app/data/LocalData.ts index 97ac559d3..9ad6dc925 100644 --- a/excalidraw-app/data/LocalData.ts +++ b/excalidraw-app/data/LocalData.ts @@ -11,9 +11,12 @@ */ import { clearAppStateForLocalStorage } from "@excalidraw/excalidraw/appState"; -import { CANVAS_SEARCH_TAB, DEFAULT_SIDEBAR } from "@excalidraw/common"; +import { + CANVAS_SEARCH_TAB, + DEFAULT_SIDEBAR, + debounce, +} from "@excalidraw/common"; import { clearElementsForLocalStorage } from "@excalidraw/element"; -import { debounce } from "@excalidraw/common"; import { createStore, entries, diff --git a/excalidraw-app/share/ShareDialog.tsx b/excalidraw-app/share/ShareDialog.tsx index 2dcce1409..884d64680 100644 --- a/excalidraw-app/share/ShareDialog.tsx +++ b/excalidraw-app/share/ShareDialog.tsx @@ -15,8 +15,7 @@ import { import { useUIAppState } from "@excalidraw/excalidraw/context/ui-appState"; import { useCopyStatus } from "@excalidraw/excalidraw/hooks/useCopiedIndicator"; import { useI18n } from "@excalidraw/excalidraw/i18n"; -import { KEYS } from "@excalidraw/common"; -import { getFrame } from "@excalidraw/common"; +import { KEYS, getFrame } from "@excalidraw/common"; import { useEffect, useRef, useState } from "react"; import { atom, useAtom, useAtomValue } from "../app-jotai"; diff --git a/excalidraw-app/useHandleAppTheme.ts b/excalidraw-app/useHandleAppTheme.ts index 5ae60f0b7..94f5a3e58 100644 --- a/excalidraw-app/useHandleAppTheme.ts +++ b/excalidraw-app/useHandleAppTheme.ts @@ -1,6 +1,5 @@ import { THEME } from "@excalidraw/excalidraw"; -import { EVENT } from "@excalidraw/common"; -import { CODES, KEYS } from "@excalidraw/common"; +import { EVENT, CODES, KEYS } from "@excalidraw/common"; import { useEffect, useLayoutEffect, useState } from "react"; import type { Theme } from "@excalidraw/element/types"; diff --git a/scripts/buildPackage.js b/scripts/buildPackage.js index d14e71614..bfe96ddc2 100644 --- a/scripts/buildPackage.js +++ b/scripts/buildPackage.js @@ -31,8 +31,8 @@ const getConfig = (outdir) => ({ "@excalidraw/common": path.resolve(__dirname, "../packages/common/src"), "@excalidraw/element": path.resolve(__dirname, "../packages/element/src"), "@excalidraw/excalidraw": path.resolve(__dirname, "../packages/excalidraw"), - "@excalidraw/utils": path.resolve(__dirname, "../packages/utils"), "@excalidraw/math": path.resolve(__dirname, "../packages/math/src"), + "@excalidraw/utils": path.resolve(__dirname, "../packages/utils"), }, loader: { ".woff2": "file", diff --git a/scripts/buildShared.js b/scripts/buildShared.js index 80ac715cc..19ac5d049 100644 --- a/scripts/buildShared.js +++ b/scripts/buildShared.js @@ -17,8 +17,8 @@ const getConfig = (outdir) => ({ "@excalidraw/common": path.resolve(__dirname, "../packages/common/src"), "@excalidraw/element": path.resolve(__dirname, "../packages/element/src"), "@excalidraw/excalidraw": path.resolve(__dirname, "../packages/excalidraw"), - "@excalidraw/utils": path.resolve(__dirname, "../packages/utils"), "@excalidraw/math": path.resolve(__dirname, "../packages/math/src"), + "@excalidraw/utils": path.resolve(__dirname, "../packages/utils"), }, });