From c9c6c47081b06604ba3b0a498804e0fddca60a30 Mon Sep 17 00:00:00 2001 From: Deepen Timalsina Date: Tue, 15 Apr 2025 17:57:27 +0545 Subject: [PATCH] Move actions folder in src --- 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 | 4 +-- packages/element/tests/zindex.test.tsx | 2 +- packages/excalidraw/components/Actions.tsx | 6 ++-- .../components/ActiveConfirmDialog.tsx | 2 +- packages/excalidraw/components/App.tsx | 31 ++++++++++-------- .../CommandPalette/CommandPalette.tsx | 10 +++--- .../defaultCommandPaletteItems.ts | 2 +- .../components/CommandPalette/types.ts | 4 +-- .../excalidraw/components/ContextMenu.tsx | 8 ++--- packages/excalidraw/components/HelpDialog.tsx | 2 +- .../components/ImageExportDialog.tsx | 4 +-- .../components/JSONExportDialog.tsx | 4 +-- packages/excalidraw/components/LayerUI.tsx | 4 +-- packages/excalidraw/components/MobileMenu.tsx | 2 +- .../OverwriteConfirmActions.tsx | 4 +-- packages/excalidraw/components/Range.tsx | 2 +- .../components/Stats/stats.test.tsx | 2 +- packages/excalidraw/components/UserList.tsx | 2 +- .../excalidraw/components/footer/Footer.tsx | 4 +-- .../components/main-menu/DefaultItems.tsx | 4 +-- .../welcome-screen/WelcomeScreen.Center.tsx | 4 +-- packages/excalidraw/index.tsx | 2 +- .../{ => src}/actions/actionAddToLibrary.ts | 4 +-- .../{ => src}/actions/actionAlign.tsx | 12 +++---- .../{ => src}/actions/actionBoundText.tsx | 6 ++-- .../{ => src}/actions/actionCanvas.tsx | 24 +++++++------- .../{ => src}/actions/actionClipboard.tsx | 15 ++++++--- .../{ => src}/actions/actionCropEditor.tsx | 8 ++--- .../actions/actionDeleteSelected.test.tsx | 6 ++-- .../actions/actionDeleteSelected.tsx | 12 +++---- .../{ => src}/actions/actionDistribute.tsx | 12 +++---- .../actions/actionDuplicateSelection.test.tsx | 6 ++-- .../actions/actionDuplicateSelection.tsx | 10 +++--- .../{ => src}/actions/actionElementLink.ts | 10 +++--- .../actions/actionElementLock.test.tsx | 8 ++--- .../{ => src}/actions/actionElementLock.ts | 6 ++-- .../{ => src}/actions/actionEmbeddable.ts | 4 +-- .../{ => src}/actions/actionExport.tsx | 32 +++++++++---------- .../{ => src}/actions/actionFinalize.tsx | 12 +++---- .../{ => src}/actions/actionFlip.test.tsx | 6 ++-- .../{ => src}/actions/actionFlip.ts | 8 ++--- .../{ => src}/actions/actionFrame.ts | 10 +++--- .../{ => src}/actions/actionGroup.tsx | 12 +++---- .../{ => src}/actions/actionHistory.tsx | 18 +++++------ .../{ => src}/actions/actionLinearEditor.tsx | 10 +++--- .../{ => src}/actions/actionLink.tsx | 12 +++---- .../{ => src}/actions/actionMenu.tsx | 12 ++++--- .../{ => src}/actions/actionNavigate.tsx | 14 ++++---- .../actions/actionProperties.test.tsx | 8 ++--- .../{ => src}/actions/actionProperties.tsx | 26 +++++++-------- .../{ => src}/actions/actionSelectAll.ts | 4 +-- .../{ => src}/actions/actionStyles.ts | 8 ++--- .../{ => src}/actions/actionTextAutoResize.ts | 6 ++-- .../actions/actionToggleGridMode.tsx | 6 ++-- .../actions/actionToggleObjectsSnapMode.tsx | 4 +-- .../actions/actionToggleSearchMenu.ts | 6 ++-- .../{ => src}/actions/actionToggleStats.tsx | 4 +-- .../actions/actionToggleViewMode.tsx | 4 +-- .../{ => src}/actions/actionToggleZenMode.tsx | 4 +-- .../{ => src}/actions/actionZindex.tsx | 6 ++-- .../excalidraw/{ => src}/actions/index.ts | 0 .../excalidraw/{ => src}/actions/manager.tsx | 4 +-- .../excalidraw/{ => src}/actions/register.ts | 0 .../excalidraw/{ => src}/actions/shortcuts.ts | 2 +- .../excalidraw/{ => src}/actions/types.ts | 4 +-- .../src/wysiwyg/textWysiwyg.test.tsx | 2 +- .../excalidraw/src/wysiwyg/textWysiwyg.tsx | 6 ++-- .../excalidraw/tests/actionStyles.test.tsx | 2 +- .../excalidraw/tests/contextmenu.test.tsx | 6 ++-- .../excalidraw/tests/cropElement.test.tsx | 2 +- .../excalidraw/tests/elementLocking.test.tsx | 2 +- packages/excalidraw/tests/flip.test.tsx | 2 +- packages/excalidraw/tests/helpers/api.ts | 2 +- packages/excalidraw/tests/history.test.tsx | 9 ++++-- packages/excalidraw/types.ts | 2 +- 79 files changed, 276 insertions(+), 261 deletions(-) rename packages/excalidraw/{ => src}/actions/actionAddToLibrary.ts (95%) rename packages/excalidraw/{ => src}/actions/actionAlign.tsx (97%) rename packages/excalidraw/{ => src}/actions/actionBoundText.tsx (98%) rename packages/excalidraw/{ => src}/actions/actionCanvas.tsx (96%) rename packages/excalidraw/{ => src}/actions/actionClipboard.tsx (96%) rename packages/excalidraw/{ => src}/actions/actionCropEditor.tsx (88%) rename packages/excalidraw/{ => src}/actions/actionDeleteSelected.test.tsx (96%) rename packages/excalidraw/{ => src}/actions/actionDeleteSelected.tsx (97%) rename packages/excalidraw/{ => src}/actions/actionDistribute.tsx (92%) rename packages/excalidraw/{ => src}/actions/actionDuplicateSelection.test.tsx (99%) rename packages/excalidraw/{ => src}/actions/actionDuplicateSelection.tsx (94%) rename packages/excalidraw/{ => src}/actions/actionElementLink.ts (91%) rename packages/excalidraw/{ => src}/actions/actionElementLock.test.tsx (90%) rename packages/excalidraw/{ => src}/actions/actionElementLock.ts (95%) rename packages/excalidraw/{ => src}/actions/actionEmbeddable.ts (88%) rename packages/excalidraw/{ => src}/actions/actionExport.tsx (91%) rename packages/excalidraw/{ => src}/actions/actionFinalize.tsx (96%) rename packages/excalidraw/{ => src}/actions/actionFlip.test.tsx (97%) rename packages/excalidraw/{ => src}/actions/actionFlip.ts (95%) rename packages/excalidraw/{ => src}/actions/actionFrame.ts (96%) rename packages/excalidraw/{ => src}/actions/actionGroup.tsx (96%) rename packages/excalidraw/{ => src}/actions/actionHistory.tsx (88%) rename packages/excalidraw/{ => src}/actions/actionLinearEditor.tsx (88%) rename packages/excalidraw/{ => src}/actions/actionLink.tsx (82%) rename packages/excalidraw/{ => src}/actions/actionMenu.tsx (90%) rename packages/excalidraw/{ => src}/actions/actionNavigate.tsx (91%) rename packages/excalidraw/{ => src}/actions/actionProperties.test.tsx (96%) rename packages/excalidraw/{ => src}/actions/actionProperties.tsx (98%) rename packages/excalidraw/{ => src}/actions/actionSelectAll.ts (94%) rename packages/excalidraw/{ => src}/actions/actionStyles.ts (96%) rename packages/excalidraw/{ => src}/actions/actionTextAutoResize.ts (90%) rename packages/excalidraw/{ => src}/actions/actionToggleGridMode.tsx (85%) rename packages/excalidraw/{ => src}/actions/actionToggleObjectsSnapMode.tsx (89%) rename packages/excalidraw/{ => src}/actions/actionToggleSearchMenu.ts (91%) rename packages/excalidraw/{ => src}/actions/actionToggleStats.tsx (86%) rename packages/excalidraw/{ => src}/actions/actionToggleViewMode.tsx (88%) rename packages/excalidraw/{ => src}/actions/actionToggleZenMode.tsx (88%) rename packages/excalidraw/{ => src}/actions/actionZindex.tsx (97%) rename packages/excalidraw/{ => src}/actions/index.ts (100%) rename packages/excalidraw/{ => src}/actions/manager.tsx (97%) rename packages/excalidraw/{ => src}/actions/register.ts (100%) rename packages/excalidraw/{ => src}/actions/shortcuts.ts (99%) rename packages/excalidraw/{ => src}/actions/types.ts (98%) diff --git a/excalidraw-app/tests/collab.test.tsx b/excalidraw-app/tests/collab.test.tsx index 3572303f4..12e7de669 100644 --- a/excalidraw-app/tests/collab.test.tsx +++ b/excalidraw-app/tests/collab.test.tsx @@ -2,7 +2,7 @@ import { CaptureUpdateAction, newElementWith } from "@excalidraw/excalidraw"; 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 2dcafc65b..d307dc84b 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/i18n"; import { Excalidraw } from "@excalidraw/excalidraw"; diff --git a/packages/element/tests/binding.test.tsx b/packages/element/tests/binding.test.tsx index f57d7793a..69de847af 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"; diff --git a/packages/element/tests/duplicate.test.tsx b/packages/element/tests/duplicate.test.tsx index 7492bcc58..c5c04cf44 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"; -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 88ff65813..1e70181f9 100644 --- a/packages/element/tests/elbowArrow.test.tsx +++ b/packages/element/tests/elbowArrow.test.tsx @@ -3,8 +3,8 @@ import { pointFrom } from "@excalidraw/math"; import { Excalidraw, mutateElement } from "@excalidraw/excalidraw"; import Scene from "@excalidraw/excalidraw/src/scene/Scene"; -import { actionSelectAll } from "@excalidraw/excalidraw/actions"; -import { actionDuplicateSelection } from "@excalidraw/excalidraw/actions/actionDuplicateSelection"; +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 997cb56f8..50acab846 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"; diff --git a/packages/excalidraw/components/Actions.tsx b/packages/excalidraw/components/Actions.tsx index 3026f3f95..3246707eb 100644 --- a/packages/excalidraw/components/Actions.tsx +++ b/packages/excalidraw/components/Actions.tsx @@ -30,9 +30,9 @@ import type { NonDeletedSceneElementsMap, } from "@excalidraw/element/types"; -import { actionToggleZenMode } from "../actions"; +import { actionToggleZenMode } from "../src/actions"; -import { alignActionsPredicate } from "../actions/actionAlign"; +import { alignActionsPredicate } from "../src/actions/actionAlign"; import { trackEvent } from "../analytics"; import { useTunnels } from "../src/context/tunnels"; @@ -66,7 +66,7 @@ import { } from "./icons"; import type { AppClassProperties, AppProps, UIAppState, Zoom } from "../types"; -import type { ActionManager } from "../actions/manager"; +import type { ActionManager } from "../src/actions/manager"; export const canChangeStrokeColor = ( appState: UIAppState, diff --git a/packages/excalidraw/components/ActiveConfirmDialog.tsx b/packages/excalidraw/components/ActiveConfirmDialog.tsx index 00c6ad579..5d66365ac 100644 --- a/packages/excalidraw/components/ActiveConfirmDialog.tsx +++ b/packages/excalidraw/components/ActiveConfirmDialog.tsx @@ -1,4 +1,4 @@ -import { actionClearCanvas } from "../actions"; +import { actionClearCanvas } from "../src/actions"; import { atom, useAtom } from "../editor-jotai"; import { t } from "../i18n"; diff --git a/packages/excalidraw/components/App.tsx b/packages/excalidraw/components/App.tsx index 384050637..866075ded 100644 --- a/packages/excalidraw/components/App.tsx +++ b/packages/excalidraw/components/App.tsx @@ -362,23 +362,26 @@ import { actionToggleLinearEditor, actionToggleObjectsSnapMode, actionToggleCropEditor, -} from "../actions"; -import { actionWrapTextInContainer } from "../actions/actionBoundText"; -import { actionToggleHandTool, zoomToFit } from "../actions/actionCanvas"; -import { actionPaste } from "../actions/actionClipboard"; -import { actionCopyElementLink } from "../actions/actionElementLink"; -import { actionUnlockAllElements } from "../actions/actionElementLock"; +} from "../src/actions"; +import { actionWrapTextInContainer } from "../src/actions/actionBoundText"; +import { actionToggleHandTool, zoomToFit } from "../src/actions/actionCanvas"; +import { actionPaste } from "../src/actions/actionClipboard"; +import { actionCopyElementLink } from "../src/actions/actionElementLink"; +import { actionUnlockAllElements } from "../src/actions/actionElementLock"; import { actionRemoveAllElementsFromFrame, actionSelectAllElementsInFrame, actionWrapSelectionInFrame, -} from "../actions/actionFrame"; -import { createRedoAction, createUndoAction } from "../actions/actionHistory"; -import { actionTextAutoResize } from "../actions/actionTextAutoResize"; -import { actionToggleViewMode } from "../actions/actionToggleViewMode"; -import { ActionManager } from "../actions/manager"; -import { actions } from "../actions/register"; -import { getShortcutFromShortcutName } from "../actions/shortcuts"; +} from "../src/actions/actionFrame"; +import { + createRedoAction, + createUndoAction, +} from "../src/actions/actionHistory"; +import { actionTextAutoResize } from "../src/actions/actionTextAutoResize"; +import { actionToggleViewMode } from "../src/actions/actionToggleViewMode"; +import { ActionManager } from "../src/actions/manager"; +import { actions } from "../src/actions/register"; +import { getShortcutFromShortcutName } from "../src/actions/shortcuts"; import { trackEvent } from "../analytics"; import { AnimationFrameHandler } from "../src/animation-frame-handler"; import { @@ -527,7 +530,7 @@ import type { Offsets, } from "../types"; import type { RoughCanvas } from "roughjs/bin/canvas"; -import type { Action, ActionResult } from "../actions/types"; +import type { Action, ActionResult } from "../src/actions/types"; const AppContext = React.createContext(null!); const AppPropsContext = React.createContext(null!); diff --git a/packages/excalidraw/components/CommandPalette/CommandPalette.tsx b/packages/excalidraw/components/CommandPalette/CommandPalette.tsx index 4e59e797f..fabe0133c 100644 --- a/packages/excalidraw/components/CommandPalette/CommandPalette.tsx +++ b/packages/excalidraw/components/CommandPalette/CommandPalette.tsx @@ -17,12 +17,12 @@ import { actionClearCanvas, actionLink, actionToggleSearchMenu, -} from "../../actions"; +} from "../../src/actions"; import { actionCopyElementLink, actionLinkToElement, -} from "../../actions/actionElementLink"; -import { getShortcutFromShortcutName } from "../../actions/shortcuts"; +} from "../../src/actions/actionElementLink"; +import { getShortcutFromShortcutName } from "../../src/actions/shortcuts"; import { trackEvent } from "../../analytics"; import { useUIAppState } from "../../src/context/ui-appState"; import { deburr } from "../../deburr"; @@ -63,9 +63,9 @@ import "./CommandPalette.scss"; import type { CommandPaletteItem } from "./types"; import type { AppProps, AppState, UIAppState } from "../../types"; -import type { ShortcutName } from "../../actions/shortcuts"; +import type { ShortcutName } from "../../src/actions/shortcuts"; import type { TranslationKeys } from "../../i18n"; -import type { Action } from "../../actions/types"; +import type { Action } from "../../src/actions/types"; const lastUsedPaletteItem = atom(null); diff --git a/packages/excalidraw/components/CommandPalette/defaultCommandPaletteItems.ts b/packages/excalidraw/components/CommandPalette/defaultCommandPaletteItems.ts index 485e1767c..7e8a2d12f 100644 --- a/packages/excalidraw/components/CommandPalette/defaultCommandPaletteItems.ts +++ b/packages/excalidraw/components/CommandPalette/defaultCommandPaletteItems.ts @@ -1,4 +1,4 @@ -import { actionToggleTheme } from "../../actions"; +import { actionToggleTheme } from "../../src/actions"; import type { CommandPaletteItem } from "./types"; diff --git a/packages/excalidraw/components/CommandPalette/types.ts b/packages/excalidraw/components/CommandPalette/types.ts index 957d69927..b2c89b98e 100644 --- a/packages/excalidraw/components/CommandPalette/types.ts +++ b/packages/excalidraw/components/CommandPalette/types.ts @@ -1,5 +1,5 @@ -import type { ActionManager } from "../../actions/manager"; -import type { Action } from "../../actions/types"; +import type { ActionManager } from "../../src/actions/manager"; +import type { Action } from "../../src/actions/types"; import type { UIAppState } from "../../types"; export type CommandPaletteItem = { diff --git a/packages/excalidraw/components/ContextMenu.tsx b/packages/excalidraw/components/ContextMenu.tsx index 3295d1d09..45f3c1330 100644 --- a/packages/excalidraw/components/ContextMenu.tsx +++ b/packages/excalidraw/components/ContextMenu.tsx @@ -1,7 +1,7 @@ import clsx from "clsx"; import React from "react"; -import { getShortcutFromShortcutName } from "../actions/shortcuts"; +import { getShortcutFromShortcutName } from "../src/actions/shortcuts"; import { t } from "../i18n"; import { useExcalidrawAppState, useExcalidrawElements } from "./App"; @@ -10,9 +10,9 @@ import { Popover } from "./Popover"; import "./ContextMenu.scss"; -import type { ActionManager } from "../actions/manager"; -import type { ShortcutName } from "../actions/shortcuts"; -import type { Action } from "../actions/types"; +import type { ActionManager } from "../src/actions/manager"; +import type { ShortcutName } from "../src/actions/shortcuts"; +import type { Action } from "../src/actions/types"; import type { TranslationKeys } from "../i18n"; diff --git a/packages/excalidraw/components/HelpDialog.tsx b/packages/excalidraw/components/HelpDialog.tsx index 60fc40372..f832e1345 100644 --- a/packages/excalidraw/components/HelpDialog.tsx +++ b/packages/excalidraw/components/HelpDialog.tsx @@ -4,7 +4,7 @@ import { isDarwin, isFirefox, isWindows } from "@excalidraw/common"; import { KEYS, getShortcutKey } from "@excalidraw/common"; -import { getShortcutFromShortcutName } from "../actions/shortcuts"; +import { getShortcutFromShortcutName } from "../src/actions/shortcuts"; import { probablySupportsClipboardBlob } from "../clipboard"; import { t } from "../i18n"; diff --git a/packages/excalidraw/components/ImageExportDialog.tsx b/packages/excalidraw/components/ImageExportDialog.tsx index ac9179387..189d63de6 100644 --- a/packages/excalidraw/components/ImageExportDialog.tsx +++ b/packages/excalidraw/components/ImageExportDialog.tsx @@ -17,7 +17,7 @@ import { actionChangeExportEmbedScene, actionChangeExportScale, actionChangeProjectName, -} from "../actions/actionExport"; +} from "../src/actions/actionExport"; import { probablySupportsClipboardBlob } from "../clipboard"; import { prepareElementsForExport } from "../src/data"; import { canvasToBlob } from "../src/data/blob"; @@ -36,7 +36,7 @@ import { FilledButton } from "./FilledButton"; import "./ImageExportDialog.scss"; -import type { ActionManager } from "../actions/manager"; +import type { ActionManager } from "../src/actions/manager"; import type { AppClassProperties, BinaryFiles, UIAppState } from "../types"; diff --git a/packages/excalidraw/components/JSONExportDialog.tsx b/packages/excalidraw/components/JSONExportDialog.tsx index 11847d493..ed1a60e18 100644 --- a/packages/excalidraw/components/JSONExportDialog.tsx +++ b/packages/excalidraw/components/JSONExportDialog.tsx @@ -4,7 +4,7 @@ import { getFrame } from "@excalidraw/common"; import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types"; -import { actionSaveFileToDisk } from "../actions/actionExport"; +import { actionSaveFileToDisk } from "../src/actions/actionExport"; import { trackEvent } from "../analytics"; import { nativeFileSystemSupported } from "../src/data/filesystem"; @@ -17,7 +17,7 @@ import { exportToFileIcon, LinkIcon } from "./icons"; import "./ExportDialog.scss"; -import type { ActionManager } from "../actions/manager"; +import type { ActionManager } from "../src/actions/manager"; import type { ExportOpts, BinaryFiles, UIAppState } from "../types"; diff --git a/packages/excalidraw/components/LayerUI.tsx b/packages/excalidraw/components/LayerUI.tsx index fff84f641..29ca5dd81 100644 --- a/packages/excalidraw/components/LayerUI.tsx +++ b/packages/excalidraw/components/LayerUI.tsx @@ -18,7 +18,7 @@ import { ShapeCache } from "@excalidraw/element/ShapeCache"; import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types"; import Scene from "../src/scene/Scene"; -import { actionToggleStats } from "../actions"; +import { actionToggleStats } from "../src/actions"; import { trackEvent } from "../analytics"; import { isHandToolActive } from "../appState"; import { TunnelsContext, useInitializeTunnels } from "../src/context/tunnels"; @@ -62,7 +62,7 @@ import { LaserPointerButton } from "./LaserPointerButton"; import "./LayerUI.scss"; import "./Toolbar.scss"; -import type { ActionManager } from "../actions/manager"; +import type { ActionManager } from "../src/actions/manager"; import type { Language } from "../i18n"; import type { diff --git a/packages/excalidraw/components/MobileMenu.tsx b/packages/excalidraw/components/MobileMenu.tsx index 0469779d9..705b69f09 100644 --- a/packages/excalidraw/components/MobileMenu.tsx +++ b/packages/excalidraw/components/MobileMenu.tsx @@ -20,7 +20,7 @@ import { PenModeButton } from "./PenModeButton"; import { Section } from "./Section"; import Stack from "./Stack"; -import type { ActionManager } from "../actions/manager"; +import type { ActionManager } from "../src/actions/manager"; import type { AppClassProperties, AppProps, diff --git a/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.tsx b/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.tsx index e5fb56d85..754320c4c 100644 --- a/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.tsx +++ b/packages/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.tsx @@ -1,7 +1,7 @@ import React from "react"; -import { actionSaveFileToDisk } from "../../actions"; -import { actionChangeExportEmbedScene } from "../../actions/actionExport"; +import { actionSaveFileToDisk } from "../../src/actions"; +import { actionChangeExportEmbedScene } from "../../src/actions/actionExport"; import { useI18n } from "../../i18n"; import { useExcalidrawActionManager, useExcalidrawSetAppState } from "../App"; import { FilledButton } from "../FilledButton"; diff --git a/packages/excalidraw/components/Range.tsx b/packages/excalidraw/components/Range.tsx index 3ab9ede15..5304bcc0c 100644 --- a/packages/excalidraw/components/Range.tsx +++ b/packages/excalidraw/components/Range.tsx @@ -1,6 +1,6 @@ import React, { useEffect } from "react"; -import { getFormValue } from "../actions/actionProperties"; +import { getFormValue } from "../src/actions/actionProperties"; import { t } from "../i18n"; import "./Range.scss"; diff --git a/packages/excalidraw/components/Stats/stats.test.tsx b/packages/excalidraw/components/Stats/stats.test.tsx index 9b62711ef..0726898ad 100644 --- a/packages/excalidraw/components/Stats/stats.test.tsx +++ b/packages/excalidraw/components/Stats/stats.test.tsx @@ -18,7 +18,7 @@ import type { } from "@excalidraw/element/types"; import { Excalidraw, getCommonBounds, mutateElement } from "../.."; -import { actionGroup } from "../../actions"; +import { actionGroup } from "../../src/actions"; import { t } from "../../i18n"; import * as StaticScene from "../../src/renderer/staticScene"; import { API } from "../../tests/helpers/api"; diff --git a/packages/excalidraw/components/UserList.tsx b/packages/excalidraw/components/UserList.tsx index 811289329..31f03e5b2 100644 --- a/packages/excalidraw/components/UserList.tsx +++ b/packages/excalidraw/components/UserList.tsx @@ -16,7 +16,7 @@ import { Tooltip } from "./Tooltip"; import "./UserList.scss"; -import type { ActionManager } from "../actions/manager"; +import type { ActionManager } from "../src/actions/manager"; import type { Collaborator, SocketId } from "../types"; export type GoToCollaboratorComponentProps = { diff --git a/packages/excalidraw/components/footer/Footer.tsx b/packages/excalidraw/components/footer/Footer.tsx index dfb604c30..208bea916 100644 --- a/packages/excalidraw/components/footer/Footer.tsx +++ b/packages/excalidraw/components/footer/Footer.tsx @@ -1,6 +1,6 @@ import clsx from "clsx"; -import { actionShortcuts } from "../../actions"; +import { actionShortcuts } from "../../src/actions"; import { useTunnels } from "../../src/context/tunnels"; import { ExitZenModeAction, @@ -13,7 +13,7 @@ import { HelpButton } from "../HelpButton"; import { Section } from "../Section"; import Stack from "../Stack"; -import type { ActionManager } from "../../actions/manager"; +import type { ActionManager } from "../../src/actions/manager"; import type { UIAppState } from "../../types"; const Footer = ({ diff --git a/packages/excalidraw/components/main-menu/DefaultItems.tsx b/packages/excalidraw/components/main-menu/DefaultItems.tsx index 2c3dad52b..b74553367 100644 --- a/packages/excalidraw/components/main-menu/DefaultItems.tsx +++ b/packages/excalidraw/components/main-menu/DefaultItems.tsx @@ -11,8 +11,8 @@ import { actionShortcuts, actionToggleSearchMenu, actionToggleTheme, -} from "../../actions"; -import { getShortcutFromShortcutName } from "../../actions/shortcuts"; +} from "../../src/actions"; +import { getShortcutFromShortcutName } from "../../src/actions/shortcuts"; import { trackEvent } from "../../analytics"; import { useUIAppState } from "../../src/context/ui-appState"; import { useSetAtom } from "../../editor-jotai"; diff --git a/packages/excalidraw/components/welcome-screen/WelcomeScreen.Center.tsx b/packages/excalidraw/components/welcome-screen/WelcomeScreen.Center.tsx index fb54692f7..644f94eee 100644 --- a/packages/excalidraw/components/welcome-screen/WelcomeScreen.Center.tsx +++ b/packages/excalidraw/components/welcome-screen/WelcomeScreen.Center.tsx @@ -1,5 +1,5 @@ -import { actionLoadScene, actionShortcuts } from "../../actions"; -import { getShortcutFromShortcutName } from "../../actions/shortcuts"; +import { actionLoadScene, actionShortcuts } from "../../src/actions"; +import { getShortcutFromShortcutName } from "../../src/actions/shortcuts"; import { useTunnels } from "../../src/context/tunnels"; import { useUIAppState } from "../../src/context/ui-appState"; import { t, useI18n } from "../../i18n"; diff --git a/packages/excalidraw/index.tsx b/packages/excalidraw/index.tsx index 91b4443c9..dd26ef9e4 100644 --- a/packages/excalidraw/index.tsx +++ b/packages/excalidraw/index.tsx @@ -289,7 +289,7 @@ export { DefaultSidebar } from "./components/DefaultSidebar"; export { TTDDialog } from "./components/TTDDialog/TTDDialog"; export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger"; -export { zoomToFitBounds } from "./actions/actionCanvas"; +export { zoomToFitBounds } from "./src/actions/actionCanvas"; export { convertToExcalidrawElements } from "./src/data/transform"; export { getCommonBounds, diff --git a/packages/excalidraw/actions/actionAddToLibrary.ts b/packages/excalidraw/src/actions/actionAddToLibrary.ts similarity index 95% rename from packages/excalidraw/actions/actionAddToLibrary.ts rename to packages/excalidraw/src/actions/actionAddToLibrary.ts index 9216e52c2..01c14342e 100644 --- a/packages/excalidraw/actions/actionAddToLibrary.ts +++ b/packages/excalidraw/src/actions/actionAddToLibrary.ts @@ -1,8 +1,8 @@ import { LIBRARY_DISABLED_TYPES, randomId } from "@excalidraw/common"; import { deepCopyElement } from "@excalidraw/element/duplicate"; -import { t } from "../i18n"; -import { CaptureUpdateAction } from "../store"; +import { t } from "../../i18n"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionAlign.tsx b/packages/excalidraw/src/actions/actionAlign.tsx similarity index 97% rename from packages/excalidraw/actions/actionAlign.tsx rename to packages/excalidraw/src/actions/actionAlign.tsx index c85f501a1..4ef561a19 100644 --- a/packages/excalidraw/actions/actionAlign.tsx +++ b/packages/excalidraw/src/actions/actionAlign.tsx @@ -12,7 +12,7 @@ import type { ExcalidrawElement } from "@excalidraw/element/types"; import type { Alignment } from "@excalidraw/element/align"; -import { ToolButton } from "../components/ToolButton"; +import { ToolButton } from "../../components/ToolButton"; import { AlignBottomIcon, AlignLeftIcon, @@ -20,16 +20,16 @@ import { AlignTopIcon, CenterHorizontallyIcon, CenterVerticallyIcon, -} from "../components/icons"; +} from "../../components/icons"; -import { t } from "../i18n"; +import { t } from "../../i18n"; -import { isSomeElementSelected } from "../src/scene"; -import { CaptureUpdateAction } from "../store"; +import { isSomeElementSelected } from "../scene"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; -import type { AppClassProperties, AppState, UIAppState } from "../types"; +import type { AppClassProperties, AppState, UIAppState } from "../../types"; export const alignActionsPredicate = ( appState: UIAppState, diff --git a/packages/excalidraw/actions/actionBoundText.tsx b/packages/excalidraw/src/actions/actionBoundText.tsx similarity index 98% rename from packages/excalidraw/actions/actionBoundText.tsx rename to packages/excalidraw/src/actions/actionBoundText.tsx index d08ad341e..2a0da3d48 100644 --- a/packages/excalidraw/actions/actionBoundText.tsx +++ b/packages/excalidraw/src/actions/actionBoundText.tsx @@ -43,13 +43,13 @@ import type { import type { Mutable } from "@excalidraw/common/utility-types"; -import { CaptureUpdateAction } from "../store"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; -import type { Radians } from "../../math/src"; +import type { Radians } from "../../../math/src"; -import type { AppState } from "../types"; +import type { AppState } from "../../types"; export const actionUnbindText = register({ name: "unbindText", diff --git a/packages/excalidraw/actions/actionCanvas.tsx b/packages/excalidraw/src/actions/actionCanvas.tsx similarity index 96% rename from packages/excalidraw/actions/actionCanvas.tsx rename to packages/excalidraw/src/actions/actionCanvas.tsx index 34ecae1c6..38d9b4dfb 100644 --- a/packages/excalidraw/actions/actionCanvas.tsx +++ b/packages/excalidraw/src/actions/actionCanvas.tsx @@ -23,10 +23,10 @@ import { getDefaultAppState, isEraserActive, isHandToolActive, -} from "../appState"; -import { ColorPicker } from "../components/ColorPicker/ColorPicker"; -import { ToolButton } from "../components/ToolButton"; -import { Tooltip } from "../components/Tooltip"; +} from "../../appState"; +import { ColorPicker } from "../../components/ColorPicker/ColorPicker"; +import { ToolButton } from "../../components/ToolButton"; +import { Tooltip } from "../../components/Tooltip"; import { handIcon, LassoIcon, @@ -37,18 +37,18 @@ import { ZoomInIcon, ZoomOutIcon, ZoomResetIcon, -} from "../components/icons"; -import { setCursor } from "../cursor"; +} from "../../components/icons"; +import { setCursor } from "../../cursor"; -import { t } from "../i18n"; -import { getNormalizedZoom } from "../src/scene"; -import { centerScrollOn } from "../src/scene/scroll"; -import { getStateForZoom } from "../src/scene/zoom"; -import { CaptureUpdateAction } from "../store"; +import { t } from "../../i18n"; +import { getNormalizedZoom } from "../scene"; +import { centerScrollOn } from "../scene/scroll"; +import { getStateForZoom } from "../scene/zoom"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; -import type { AppState, Offsets } from "../types"; +import type { AppState, Offsets } from "../../types"; export const actionChangeViewBackgroundColor = register({ name: "changeViewBackgroundColor", diff --git a/packages/excalidraw/actions/actionClipboard.tsx b/packages/excalidraw/src/actions/actionClipboard.tsx similarity index 96% rename from packages/excalidraw/actions/actionClipboard.tsx rename to packages/excalidraw/src/actions/actionClipboard.tsx index 14c73b11e..bd58eea32 100644 --- a/packages/excalidraw/actions/actionClipboard.tsx +++ b/packages/excalidraw/src/actions/actionClipboard.tsx @@ -10,12 +10,17 @@ import { probablySupportsClipboardBlob, probablySupportsClipboardWriteText, readSystemClipboard, -} from "../clipboard"; -import { DuplicateIcon, cutIcon, pngIcon, svgIcon } from "../components/icons"; -import { exportCanvas, prepareElementsForExport } from "../src/data/index"; -import { t } from "../i18n"; +} from "../../clipboard"; +import { + DuplicateIcon, + cutIcon, + pngIcon, + svgIcon, +} from "../../components/icons"; +import { exportCanvas, prepareElementsForExport } from "../data/index"; +import { t } from "../../i18n"; -import { CaptureUpdateAction } from "../store"; +import { CaptureUpdateAction } from "../../store"; import { actionDeleteSelected } from "./actionDeleteSelected"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionCropEditor.tsx b/packages/excalidraw/src/actions/actionCropEditor.tsx similarity index 88% rename from packages/excalidraw/actions/actionCropEditor.tsx rename to packages/excalidraw/src/actions/actionCropEditor.tsx index 1a7b6da69..802618876 100644 --- a/packages/excalidraw/actions/actionCropEditor.tsx +++ b/packages/excalidraw/src/actions/actionCropEditor.tsx @@ -2,10 +2,10 @@ import { isImageElement } from "@excalidraw/element/typeChecks"; import type { ExcalidrawImageElement } from "@excalidraw/element/types"; -import { ToolButton } from "../components/ToolButton"; -import { cropIcon } from "../components/icons"; -import { t } from "../i18n"; -import { CaptureUpdateAction } from "../store"; +import { ToolButton } from "../../components/ToolButton"; +import { cropIcon } from "../../components/icons"; +import { t } from "../../i18n"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionDeleteSelected.test.tsx b/packages/excalidraw/src/actions/actionDeleteSelected.test.tsx similarity index 96% rename from packages/excalidraw/actions/actionDeleteSelected.test.tsx rename to packages/excalidraw/src/actions/actionDeleteSelected.test.tsx index 090c81941..e6f190b45 100644 --- a/packages/excalidraw/actions/actionDeleteSelected.test.tsx +++ b/packages/excalidraw/src/actions/actionDeleteSelected.test.tsx @@ -1,8 +1,8 @@ import React from "react"; -import { Excalidraw, mutateElement } from "../index"; -import { API } from "../tests/helpers/api"; -import { act, assertElements, render } from "../tests/test-utils"; +import { Excalidraw, mutateElement } from "../../index"; +import { API } from "../../tests/helpers/api"; +import { act, assertElements, render } from "../../tests/test-utils"; import { actionDeleteSelected } from "./actionDeleteSelected"; diff --git a/packages/excalidraw/actions/actionDeleteSelected.tsx b/packages/excalidraw/src/actions/actionDeleteSelected.tsx similarity index 97% rename from packages/excalidraw/actions/actionDeleteSelected.tsx rename to packages/excalidraw/src/actions/actionDeleteSelected.tsx index 5221984cc..adf2a8ccd 100644 --- a/packages/excalidraw/actions/actionDeleteSelected.tsx +++ b/packages/excalidraw/src/actions/actionDeleteSelected.tsx @@ -22,15 +22,15 @@ import { import type { ExcalidrawElement } from "@excalidraw/element/types"; -import { t } from "../i18n"; -import { getSelectedElements, isSomeElementSelected } from "../src/scene"; -import { CaptureUpdateAction } from "../store"; -import { TrashIcon } from "../components/icons"; -import { ToolButton } from "../components/ToolButton"; +import { t } from "../../i18n"; +import { getSelectedElements, isSomeElementSelected } from "../scene"; +import { CaptureUpdateAction } from "../../store"; +import { TrashIcon } from "../../components/icons"; +import { ToolButton } from "../../components/ToolButton"; import { register } from "./register"; -import type { AppClassProperties, AppState } from "../types"; +import type { AppClassProperties, AppState } from "../../types"; const deleteSelectedElements = ( elements: readonly ExcalidrawElement[], diff --git a/packages/excalidraw/actions/actionDistribute.tsx b/packages/excalidraw/src/actions/actionDistribute.tsx similarity index 92% rename from packages/excalidraw/actions/actionDistribute.tsx rename to packages/excalidraw/src/actions/actionDistribute.tsx index 3b23d4fd8..a3ad4336f 100644 --- a/packages/excalidraw/actions/actionDistribute.tsx +++ b/packages/excalidraw/src/actions/actionDistribute.tsx @@ -12,20 +12,20 @@ import type { ExcalidrawElement } from "@excalidraw/element/types"; import type { Distribution } from "@excalidraw/element/distribute"; -import { ToolButton } from "../components/ToolButton"; +import { ToolButton } from "../../components/ToolButton"; import { DistributeHorizontallyIcon, DistributeVerticallyIcon, -} from "../components/icons"; +} from "../../components/icons"; -import { t } from "../i18n"; +import { t } from "../../i18n"; -import { isSomeElementSelected } from "../src/scene"; -import { CaptureUpdateAction } from "../store"; +import { isSomeElementSelected } from "../scene"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; -import type { AppClassProperties, AppState } from "../types"; +import type { AppClassProperties, AppState } from "../../types"; const enableActionGroup = (appState: AppState, app: AppClassProperties) => { const selectedElements = app.scene.getSelectedElements(appState); diff --git a/packages/excalidraw/actions/actionDuplicateSelection.test.tsx b/packages/excalidraw/src/actions/actionDuplicateSelection.test.tsx similarity index 99% rename from packages/excalidraw/actions/actionDuplicateSelection.test.tsx rename to packages/excalidraw/src/actions/actionDuplicateSelection.test.tsx index 71559fe47..98d1946f7 100644 --- a/packages/excalidraw/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 { Excalidraw } from "../../index"; +import { API } from "../../tests/helpers/api"; import { act, assertElements, getCloneByOrigId, render, -} from "../tests/test-utils"; +} from "../../tests/test-utils"; import { actionDuplicateSelection } from "./actionDuplicateSelection"; diff --git a/packages/excalidraw/actions/actionDuplicateSelection.tsx b/packages/excalidraw/src/actions/actionDuplicateSelection.tsx similarity index 94% rename from packages/excalidraw/actions/actionDuplicateSelection.tsx rename to packages/excalidraw/src/actions/actionDuplicateSelection.tsx index 9f011bf61..6bd2466ff 100644 --- a/packages/excalidraw/actions/actionDuplicateSelection.tsx +++ b/packages/excalidraw/src/actions/actionDuplicateSelection.tsx @@ -27,12 +27,12 @@ import { duplicateElements } from "@excalidraw/element/duplicate"; import type { ExcalidrawElement } from "@excalidraw/element/types"; -import { ToolButton } from "../components/ToolButton"; -import { DuplicateIcon } from "../components/icons"; +import { ToolButton } from "../../components/ToolButton"; +import { DuplicateIcon } from "../../components/icons"; -import { t } from "../i18n"; -import { isSomeElementSelected } from "../src/scene"; -import { CaptureUpdateAction } from "../store"; +import { t } from "../../i18n"; +import { isSomeElementSelected } from "../scene"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionElementLink.ts b/packages/excalidraw/src/actions/actionElementLink.ts similarity index 91% rename from packages/excalidraw/actions/actionElementLink.ts rename to packages/excalidraw/src/actions/actionElementLink.ts index bf6ea34ab..0d6b61810 100644 --- a/packages/excalidraw/actions/actionElementLink.ts +++ b/packages/excalidraw/src/actions/actionElementLink.ts @@ -4,11 +4,11 @@ import { getLinkIdAndTypeFromSelection, } from "@excalidraw/element/elementLink"; -import { copyTextToSystemClipboard } from "../clipboard"; -import { copyIcon, elementLinkIcon } from "../components/icons"; -import { t } from "../i18n"; -import { getSelectedElements } from "../src/scene"; -import { CaptureUpdateAction } from "../store"; +import { copyTextToSystemClipboard } from "../../clipboard"; +import { copyIcon, elementLinkIcon } from "../../components/icons"; +import { t } from "../../i18n"; +import { getSelectedElements } from "../scene"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionElementLock.test.tsx b/packages/excalidraw/src/actions/actionElementLock.test.tsx similarity index 90% rename from packages/excalidraw/actions/actionElementLock.test.tsx rename to packages/excalidraw/src/actions/actionElementLock.test.tsx index ec45ab9b2..fdae2f2c3 100644 --- a/packages/excalidraw/actions/actionElementLock.test.tsx +++ b/packages/excalidraw/src/actions/actionElementLock.test.tsx @@ -1,10 +1,10 @@ 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 { Excalidraw } from "../../index"; +import { API } from "../../tests/helpers/api"; +import { Pointer, UI } from "../../tests/helpers/ui"; +import { render } from "../../tests/test-utils"; const { h } = window; const mouse = new Pointer("mouse"); diff --git a/packages/excalidraw/actions/actionElementLock.ts b/packages/excalidraw/src/actions/actionElementLock.ts similarity index 95% rename from packages/excalidraw/actions/actionElementLock.ts rename to packages/excalidraw/src/actions/actionElementLock.ts index 0e60b196a..7c81cdb4a 100644 --- a/packages/excalidraw/actions/actionElementLock.ts +++ b/packages/excalidraw/src/actions/actionElementLock.ts @@ -6,10 +6,10 @@ import { isFrameLikeElement } from "@excalidraw/element/typeChecks"; import type { ExcalidrawElement } from "@excalidraw/element/types"; -import { LockedIcon, UnlockedIcon } from "../components/icons"; +import { LockedIcon, UnlockedIcon } from "../../components/icons"; -import { getSelectedElements } from "../src/scene"; -import { CaptureUpdateAction } from "../store"; +import { getSelectedElements } from "../scene"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionEmbeddable.ts b/packages/excalidraw/src/actions/actionEmbeddable.ts similarity index 88% rename from packages/excalidraw/actions/actionEmbeddable.ts rename to packages/excalidraw/src/actions/actionEmbeddable.ts index 556652240..4d22659db 100644 --- a/packages/excalidraw/actions/actionEmbeddable.ts +++ b/packages/excalidraw/src/actions/actionEmbeddable.ts @@ -1,7 +1,7 @@ import { updateActiveTool } from "@excalidraw/common"; -import { setCursorForShape } from "../cursor"; -import { CaptureUpdateAction } from "../store"; +import { setCursorForShape } from "../../cursor"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionExport.tsx b/packages/excalidraw/src/actions/actionExport.tsx similarity index 91% rename from packages/excalidraw/actions/actionExport.tsx rename to packages/excalidraw/src/actions/actionExport.tsx index 3f09b40b8..3382bb9b2 100644 --- a/packages/excalidraw/actions/actionExport.tsx +++ b/packages/excalidraw/src/actions/actionExport.tsx @@ -9,24 +9,24 @@ import { getNonDeletedElements } from "@excalidraw/element"; import type { Theme } from "@excalidraw/element/types"; -import { useDevice } from "../components/App"; -import { CheckboxItem } from "../components/CheckboxItem"; -import { DarkModeToggle } from "../components/DarkModeToggle"; -import { ProjectName } from "../components/ProjectName"; -import { ToolButton } from "../components/ToolButton"; -import { Tooltip } from "../components/Tooltip"; -import { ExportIcon, questionCircle, saveAs } from "../components/icons"; -import { loadFromJSON, saveAsJSON } from "../src/data"; -import { isImageFileHandle } from "../src/data/blob"; -import { nativeFileSystemSupported } from "../src/data/filesystem"; -import { resaveAsImageWithScene } from "../src/data/resave"; +import { useDevice } from "../../components/App"; +import { CheckboxItem } from "../../components/CheckboxItem"; +import { DarkModeToggle } from "../../components/DarkModeToggle"; +import { ProjectName } from "../../components/ProjectName"; +import { ToolButton } from "../../components/ToolButton"; +import { Tooltip } from "../../components/Tooltip"; +import { ExportIcon, questionCircle, saveAs } from "../../components/icons"; +import { loadFromJSON, saveAsJSON } from "../data"; +import { isImageFileHandle } from "../data/blob"; +import { nativeFileSystemSupported } from "../data/filesystem"; +import { resaveAsImageWithScene } from "../data/resave"; -import { t } from "../i18n"; -import { getSelectedElements, isSomeElementSelected } from "../src/scene"; -import { getExportSize } from "../src/scene/export"; -import { CaptureUpdateAction } from "../store"; +import { t } from "../../i18n"; +import { getSelectedElements, isSomeElementSelected } from "../scene"; +import { getExportSize } from "../scene/export"; +import { CaptureUpdateAction } from "../../store"; -import "../components/ToolIcon.scss"; +import "../../components/ToolIcon.scss"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionFinalize.tsx b/packages/excalidraw/src/actions/actionFinalize.tsx similarity index 96% rename from packages/excalidraw/actions/actionFinalize.tsx rename to packages/excalidraw/src/actions/actionFinalize.tsx index 984961656..9f9659d42 100644 --- a/packages/excalidraw/actions/actionFinalize.tsx +++ b/packages/excalidraw/src/actions/actionFinalize.tsx @@ -16,15 +16,15 @@ import { isPathALoop } from "@excalidraw/element/shapes"; import { isInvisiblySmallElement } from "@excalidraw/element/sizeHelpers"; -import { t } from "../i18n"; -import { resetCursor } from "../cursor"; -import { done } from "../components/icons"; -import { ToolButton } from "../components/ToolButton"; -import { CaptureUpdateAction } from "../store"; +import { t } from "../../i18n"; +import { resetCursor } from "../../cursor"; +import { done } from "../../components/icons"; +import { ToolButton } from "../../components/ToolButton"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; -import type { AppState } from "../types"; +import type { AppState } from "../../types"; export const actionFinalize = register({ name: "finalize", diff --git a/packages/excalidraw/actions/actionFlip.test.tsx b/packages/excalidraw/src/actions/actionFlip.test.tsx similarity index 97% rename from packages/excalidraw/actions/actionFlip.test.tsx rename to packages/excalidraw/src/actions/actionFlip.test.tsx index 23e4ffc12..2c22db3b9 100644 --- a/packages/excalidraw/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 { Excalidraw } from "../../index"; +import { API } from "../../tests/helpers/api"; +import { render } from "../../tests/test-utils"; import { actionFlipHorizontal, actionFlipVertical } from "./actionFlip"; diff --git a/packages/excalidraw/actions/actionFlip.ts b/packages/excalidraw/src/actions/actionFlip.ts similarity index 95% rename from packages/excalidraw/actions/actionFlip.ts rename to packages/excalidraw/src/actions/actionFlip.ts index 8e0ea5b7b..e3e289189 100644 --- a/packages/excalidraw/actions/actionFlip.ts +++ b/packages/excalidraw/src/actions/actionFlip.ts @@ -26,14 +26,14 @@ import type { NonDeletedSceneElementsMap, } from "@excalidraw/element/types"; -import { getSelectedElements } from "../src/scene"; -import { CaptureUpdateAction } from "../store"; +import { getSelectedElements } from "../scene"; +import { CaptureUpdateAction } from "../../store"; -import { flipHorizontal, flipVertical } from "../components/icons"; +import { flipHorizontal, flipVertical } from "../../components/icons"; import { register } from "./register"; -import type { AppClassProperties, AppState } from "../types"; +import type { AppClassProperties, AppState } from "../../types"; export const actionFlipHorizontal = register({ name: "flipHorizontal", diff --git a/packages/excalidraw/actions/actionFrame.ts b/packages/excalidraw/src/actions/actionFrame.ts similarity index 96% rename from packages/excalidraw/actions/actionFrame.ts rename to packages/excalidraw/src/actions/actionFrame.ts index 4b9ffe4c4..017df3e64 100644 --- a/packages/excalidraw/actions/actionFrame.ts +++ b/packages/excalidraw/src/actions/actionFrame.ts @@ -16,14 +16,14 @@ import { getCommonBounds } from "@excalidraw/element/bounds"; import type { ExcalidrawElement } from "@excalidraw/element/types"; -import { setCursorForShape } from "../cursor"; -import { frameToolIcon } from "../components/icons"; -import { getSelectedElements } from "../src/scene"; -import { CaptureUpdateAction } from "../store"; +import { setCursorForShape } from "../../cursor"; +import { frameToolIcon } from "../../components/icons"; +import { getSelectedElements } from "../scene"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; -import type { AppClassProperties, AppState, UIAppState } from "../types"; +import type { AppClassProperties, AppState, UIAppState } from "../../types"; const isSingleFrameSelected = ( appState: UIAppState, diff --git a/packages/excalidraw/actions/actionGroup.tsx b/packages/excalidraw/src/actions/actionGroup.tsx similarity index 96% rename from packages/excalidraw/actions/actionGroup.tsx rename to packages/excalidraw/src/actions/actionGroup.tsx index 6bcc0d9a4..36a38c25f 100644 --- a/packages/excalidraw/actions/actionGroup.tsx +++ b/packages/excalidraw/src/actions/actionGroup.tsx @@ -34,17 +34,17 @@ import type { OrderedExcalidrawElement, } from "@excalidraw/element/types"; -import { ToolButton } from "../components/ToolButton"; -import { UngroupIcon, GroupIcon } from "../components/icons"; +import { ToolButton } from "../../components/ToolButton"; +import { UngroupIcon, GroupIcon } from "../../components/icons"; -import { t } from "../i18n"; +import { t } from "../../i18n"; -import { isSomeElementSelected } from "../src/scene"; -import { CaptureUpdateAction } from "../store"; +import { isSomeElementSelected } from "../scene"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; -import type { AppClassProperties, AppState } from "../types"; +import type { AppClassProperties, AppState } from "../../types"; const allElementsInSameGroup = (elements: readonly ExcalidrawElement[]) => { if (elements.length >= 2) { diff --git a/packages/excalidraw/actions/actionHistory.tsx b/packages/excalidraw/src/actions/actionHistory.tsx similarity index 88% rename from packages/excalidraw/actions/actionHistory.tsx rename to packages/excalidraw/src/actions/actionHistory.tsx index 48f50ba2e..412fe30db 100644 --- a/packages/excalidraw/actions/actionHistory.tsx +++ b/packages/excalidraw/src/actions/actionHistory.tsx @@ -2,16 +2,16 @@ import { isWindows, KEYS, matchKey, arrayToMap } from "@excalidraw/common"; 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 "../src/hooks/useEmitter"; -import { t } from "../i18n"; -import { CaptureUpdateAction } from "../store"; +import { ToolButton } from "../../components/ToolButton"; +import { UndoIcon, RedoIcon } from "../../components/icons"; +import { HistoryChangedEvent } from "../../history"; +import { useEmitter } from "../hooks/useEmitter"; +import { t } from "../../i18n"; +import { CaptureUpdateAction } from "../../store"; -import type { History } from "../history"; -import type { Store } from "../store"; -import type { AppClassProperties, AppState } from "../types"; +import type { History } from "../../history"; +import type { Store } from "../../store"; +import type { AppClassProperties, AppState } from "../../types"; import type { Action, ActionResult } from "./types"; const executeHistoryAction = ( diff --git a/packages/excalidraw/actions/actionLinearEditor.tsx b/packages/excalidraw/src/actions/actionLinearEditor.tsx similarity index 88% rename from packages/excalidraw/actions/actionLinearEditor.tsx rename to packages/excalidraw/src/actions/actionLinearEditor.tsx index 56e327bd2..d52878f09 100644 --- a/packages/excalidraw/actions/actionLinearEditor.tsx +++ b/packages/excalidraw/src/actions/actionLinearEditor.tsx @@ -4,12 +4,12 @@ import { isElbowArrow, isLinearElement } from "@excalidraw/element/typeChecks"; import type { ExcalidrawLinearElement } from "@excalidraw/element/types"; -import { DEFAULT_CATEGORIES } from "../components/CommandPalette/CommandPalette"; -import { ToolButton } from "../components/ToolButton"; -import { lineEditorIcon } from "../components/icons"; +import { DEFAULT_CATEGORIES } from "../../components/CommandPalette/CommandPalette"; +import { ToolButton } from "../../components/ToolButton"; +import { lineEditorIcon } from "../../components/icons"; -import { t } from "../i18n"; -import { CaptureUpdateAction } from "../store"; +import { t } from "../../i18n"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionLink.tsx b/packages/excalidraw/src/actions/actionLink.tsx similarity index 82% rename from packages/excalidraw/actions/actionLink.tsx rename to packages/excalidraw/src/actions/actionLink.tsx index e1028d230..d16a861e9 100644 --- a/packages/excalidraw/actions/actionLink.tsx +++ b/packages/excalidraw/src/actions/actionLink.tsx @@ -2,13 +2,13 @@ import { isEmbeddableElement } from "@excalidraw/element/typeChecks"; import { KEYS, getShortcutKey } from "@excalidraw/common"; -import { ToolButton } from "../components/ToolButton"; -import { getContextMenuLabel } from "../components/hyperlink/Hyperlink"; -import { LinkIcon } from "../components/icons"; -import { t } from "../i18n"; +import { ToolButton } from "../../components/ToolButton"; +import { getContextMenuLabel } from "../../components/hyperlink/Hyperlink"; +import { LinkIcon } from "../../components/icons"; +import { t } from "../../i18n"; -import { getSelectedElements } from "../src/scene"; -import { CaptureUpdateAction } from "../store"; +import { getSelectedElements } from "../scene"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionMenu.tsx b/packages/excalidraw/src/actions/actionMenu.tsx similarity index 90% rename from packages/excalidraw/actions/actionMenu.tsx rename to packages/excalidraw/src/actions/actionMenu.tsx index 67863e020..afb114262 100644 --- a/packages/excalidraw/actions/actionMenu.tsx +++ b/packages/excalidraw/src/actions/actionMenu.tsx @@ -4,11 +4,15 @@ import { getNonDeletedElements } from "@excalidraw/element"; import { showSelectedShapeActions } from "@excalidraw/element/showSelectedShapeActions"; -import { ToolButton } from "../components/ToolButton"; -import { HamburgerMenuIcon, HelpIconThin, palette } from "../components/icons"; -import { t } from "../i18n"; +import { ToolButton } from "../../components/ToolButton"; +import { + HamburgerMenuIcon, + HelpIconThin, + palette, +} from "../../components/icons"; +import { t } from "../../i18n"; -import { CaptureUpdateAction } from "../store"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionNavigate.tsx b/packages/excalidraw/src/actions/actionNavigate.tsx similarity index 91% rename from packages/excalidraw/actions/actionNavigate.tsx rename to packages/excalidraw/src/actions/actionNavigate.tsx index 738386839..6ee14dc3b 100644 --- a/packages/excalidraw/actions/actionNavigate.tsx +++ b/packages/excalidraw/src/actions/actionNavigate.tsx @@ -1,19 +1,19 @@ import clsx from "clsx"; -import { getClientColor } from "../clients"; -import { Avatar } from "../components/Avatar"; +import { getClientColor } from "../../clients"; +import { Avatar } from "../../components/Avatar"; import { eyeIcon, microphoneIcon, microphoneMutedIcon, -} from "../components/icons"; -import { t } from "../i18n"; -import { CaptureUpdateAction } from "../store"; +} from "../../components/icons"; +import { t } from "../../i18n"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; -import type { GoToCollaboratorComponentProps } from "../components/UserList"; -import type { Collaborator } from "../types"; +import type { GoToCollaboratorComponentProps } from "../../components/UserList"; +import type { Collaborator } from "../../types"; export const actionGoToCollaborator = register({ name: "goToCollaborator", diff --git a/packages/excalidraw/actions/actionProperties.test.tsx b/packages/excalidraw/src/actions/actionProperties.test.tsx similarity index 96% rename from packages/excalidraw/actions/actionProperties.test.tsx rename to packages/excalidraw/src/actions/actionProperties.test.tsx index 38419ce82..ce3504820 100644 --- a/packages/excalidraw/actions/actionProperties.test.tsx +++ b/packages/excalidraw/src/actions/actionProperties.test.tsx @@ -7,10 +7,10 @@ import { STROKE_WIDTH, } from "@excalidraw/common"; -import { Excalidraw } from "../index"; -import { API } from "../tests/helpers/api"; -import { UI } from "../tests/helpers/ui"; -import { render } from "../tests/test-utils"; +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/actions/actionProperties.tsx b/packages/excalidraw/src/actions/actionProperties.tsx similarity index 98% rename from packages/excalidraw/actions/actionProperties.tsx rename to packages/excalidraw/src/actions/actionProperties.tsx index d172e0bc3..12f44b550 100644 --- a/packages/excalidraw/actions/actionProperties.tsx +++ b/packages/excalidraw/src/actions/actionProperties.tsx @@ -71,15 +71,15 @@ import type { NonDeletedSceneElementsMap, } from "@excalidraw/element/types"; -import { trackEvent } from "../analytics"; -import { ButtonIconSelect } from "../components/ButtonIconSelect"; -import { ColorPicker } from "../components/ColorPicker/ColorPicker"; -import { FontPicker } from "../components/FontPicker/FontPicker"; -import { IconPicker } from "../components/IconPicker"; +import { trackEvent } from "../../analytics"; +import { ButtonIconSelect } from "../../components/ButtonIconSelect"; +import { ColorPicker } from "../../components/ColorPicker/ColorPicker"; +import { FontPicker } from "../../components/FontPicker/FontPicker"; +import { IconPicker } from "../../components/IconPicker"; // TODO barnabasmolnar/editor-redesign // TextAlignTopIcon, TextAlignBottomIcon,TextAlignMiddleIcon, // ArrowHead icons -import { Range } from "../components/Range"; +import { Range } from "../../components/Range"; import { ArrowheadArrowIcon, ArrowheadBarIcon, @@ -121,23 +121,23 @@ import { ArrowheadCrowfootIcon, ArrowheadCrowfootOneIcon, ArrowheadCrowfootOneOrManyIcon, -} from "../components/icons"; +} from "../../components/icons"; -import { Fonts } from "../fonts"; -import { getLanguage, t } from "../i18n"; +import { Fonts } from "../../fonts"; +import { getLanguage, t } from "../../i18n"; import { canHaveArrowheads, getCommonAttributeOfSelectedElements, getSelectedElements, getTargetElements, isSomeElementSelected, -} from "../src/scene"; -import { CaptureUpdateAction } from "../store"; +} from "../scene"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; -import type { CaptureUpdateActionType } from "../store"; -import type { AppClassProperties, AppState, Primitive } from "../types"; +import type { CaptureUpdateActionType } from "../../store"; +import type { AppClassProperties, AppState, Primitive } from "../../types"; const FONT_SIZE_RELATIVE_INCREASE_STEP = 0.1; diff --git a/packages/excalidraw/actions/actionSelectAll.ts b/packages/excalidraw/src/actions/actionSelectAll.ts similarity index 94% rename from packages/excalidraw/actions/actionSelectAll.ts rename to packages/excalidraw/src/actions/actionSelectAll.ts index d7775774a..7e09ff90f 100644 --- a/packages/excalidraw/actions/actionSelectAll.ts +++ b/packages/excalidraw/src/actions/actionSelectAll.ts @@ -8,9 +8,9 @@ import { selectGroupsForSelectedElements } from "@excalidraw/element/groups"; import type { ExcalidrawElement } from "@excalidraw/element/types"; -import { CaptureUpdateAction } from "../store"; +import { CaptureUpdateAction } from "../../store"; -import { selectAllIcon } from "../components/icons"; +import { selectAllIcon } from "../../components/icons"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionStyles.ts b/packages/excalidraw/src/actions/actionStyles.ts similarity index 96% rename from packages/excalidraw/actions/actionStyles.ts rename to packages/excalidraw/src/actions/actionStyles.ts index e6ee5b621..96c133536 100644 --- a/packages/excalidraw/actions/actionStyles.ts +++ b/packages/excalidraw/src/actions/actionStyles.ts @@ -26,11 +26,11 @@ import { import type { ExcalidrawTextElement } from "@excalidraw/element/types"; -import { paintIcon } from "../components/icons"; +import { paintIcon } from "../../components/icons"; -import { t } from "../i18n"; -import { getSelectedElements } from "../src/scene"; -import { CaptureUpdateAction } from "../store"; +import { t } from "../../i18n"; +import { getSelectedElements } from "../scene"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionTextAutoResize.ts b/packages/excalidraw/src/actions/actionTextAutoResize.ts similarity index 90% rename from packages/excalidraw/actions/actionTextAutoResize.ts rename to packages/excalidraw/src/actions/actionTextAutoResize.ts index e3ef62292..8f3891f92 100644 --- a/packages/excalidraw/actions/actionTextAutoResize.ts +++ b/packages/excalidraw/src/actions/actionTextAutoResize.ts @@ -5,12 +5,12 @@ import { measureText } from "@excalidraw/element/textMeasurements"; import { isTextElement } from "@excalidraw/element/typeChecks"; -import { getSelectedElements } from "../src/scene"; -import { CaptureUpdateAction } from "../store"; +import { getSelectedElements } from "../scene"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; -import type { AppClassProperties } from "../types"; +import type { AppClassProperties } from "../../types"; export const actionTextAutoResize = register({ name: "autoResize", diff --git a/packages/excalidraw/actions/actionToggleGridMode.tsx b/packages/excalidraw/src/actions/actionToggleGridMode.tsx similarity index 85% rename from packages/excalidraw/actions/actionToggleGridMode.tsx rename to packages/excalidraw/src/actions/actionToggleGridMode.tsx index 9415051f3..ca1efa34d 100644 --- a/packages/excalidraw/actions/actionToggleGridMode.tsx +++ b/packages/excalidraw/src/actions/actionToggleGridMode.tsx @@ -1,11 +1,11 @@ import { CODES, KEYS } from "@excalidraw/common"; -import { gridIcon } from "../components/icons"; -import { CaptureUpdateAction } from "../store"; +import { gridIcon } from "../../components/icons"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; -import type { AppState } from "../types"; +import type { AppState } from "../../types"; export const actionToggleGridMode = register({ name: "gridMode", diff --git a/packages/excalidraw/actions/actionToggleObjectsSnapMode.tsx b/packages/excalidraw/src/actions/actionToggleObjectsSnapMode.tsx similarity index 89% rename from packages/excalidraw/actions/actionToggleObjectsSnapMode.tsx rename to packages/excalidraw/src/actions/actionToggleObjectsSnapMode.tsx index ba092bff8..bf2c65744 100644 --- a/packages/excalidraw/actions/actionToggleObjectsSnapMode.tsx +++ b/packages/excalidraw/src/actions/actionToggleObjectsSnapMode.tsx @@ -1,7 +1,7 @@ import { CODES, KEYS } from "@excalidraw/common"; -import { magnetIcon } from "../components/icons"; -import { CaptureUpdateAction } from "../store"; +import { magnetIcon } from "../../components/icons"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionToggleSearchMenu.ts b/packages/excalidraw/src/actions/actionToggleSearchMenu.ts similarity index 91% rename from packages/excalidraw/actions/actionToggleSearchMenu.ts rename to packages/excalidraw/src/actions/actionToggleSearchMenu.ts index ce384fc66..86450df46 100644 --- a/packages/excalidraw/actions/actionToggleSearchMenu.ts +++ b/packages/excalidraw/src/actions/actionToggleSearchMenu.ts @@ -5,12 +5,12 @@ import { DEFAULT_SIDEBAR, } from "@excalidraw/common"; -import { searchIcon } from "../components/icons"; -import { CaptureUpdateAction } from "../store"; +import { searchIcon } from "../../components/icons"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; -import type { AppState } from "../types"; +import type { AppState } from "../../types"; export const actionToggleSearchMenu = register({ name: "searchMenu", diff --git a/packages/excalidraw/actions/actionToggleStats.tsx b/packages/excalidraw/src/actions/actionToggleStats.tsx similarity index 86% rename from packages/excalidraw/actions/actionToggleStats.tsx rename to packages/excalidraw/src/actions/actionToggleStats.tsx index ffa812e96..f897702d3 100644 --- a/packages/excalidraw/actions/actionToggleStats.tsx +++ b/packages/excalidraw/src/actions/actionToggleStats.tsx @@ -1,7 +1,7 @@ import { CODES, KEYS } from "@excalidraw/common"; -import { abacusIcon } from "../components/icons"; -import { CaptureUpdateAction } from "../store"; +import { abacusIcon } from "../../components/icons"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionToggleViewMode.tsx b/packages/excalidraw/src/actions/actionToggleViewMode.tsx similarity index 88% rename from packages/excalidraw/actions/actionToggleViewMode.tsx rename to packages/excalidraw/src/actions/actionToggleViewMode.tsx index e42a7a102..9234ab836 100644 --- a/packages/excalidraw/actions/actionToggleViewMode.tsx +++ b/packages/excalidraw/src/actions/actionToggleViewMode.tsx @@ -1,7 +1,7 @@ import { CODES, KEYS } from "@excalidraw/common"; -import { eyeIcon } from "../components/icons"; -import { CaptureUpdateAction } from "../store"; +import { eyeIcon } from "../../components/icons"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionToggleZenMode.tsx b/packages/excalidraw/src/actions/actionToggleZenMode.tsx similarity index 88% rename from packages/excalidraw/actions/actionToggleZenMode.tsx rename to packages/excalidraw/src/actions/actionToggleZenMode.tsx index e56e02ca7..81cd2dfcf 100644 --- a/packages/excalidraw/actions/actionToggleZenMode.tsx +++ b/packages/excalidraw/src/actions/actionToggleZenMode.tsx @@ -1,7 +1,7 @@ import { CODES, KEYS } from "@excalidraw/common"; -import { coffeeIcon } from "../components/icons"; -import { CaptureUpdateAction } from "../store"; +import { coffeeIcon } from "../../components/icons"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/actionZindex.tsx b/packages/excalidraw/src/actions/actionZindex.tsx similarity index 97% rename from packages/excalidraw/actions/actionZindex.tsx rename to packages/excalidraw/src/actions/actionZindex.tsx index 8eb5a50f2..5ae1f0c25 100644 --- a/packages/excalidraw/actions/actionZindex.tsx +++ b/packages/excalidraw/src/actions/actionZindex.tsx @@ -12,9 +12,9 @@ import { BringToFrontIcon, SendBackwardIcon, SendToBackIcon, -} from "../components/icons"; -import { t } from "../i18n"; -import { CaptureUpdateAction } from "../store"; +} from "../../components/icons"; +import { t } from "../../i18n"; +import { CaptureUpdateAction } from "../../store"; import { register } from "./register"; diff --git a/packages/excalidraw/actions/index.ts b/packages/excalidraw/src/actions/index.ts similarity index 100% rename from packages/excalidraw/actions/index.ts rename to packages/excalidraw/src/actions/index.ts diff --git a/packages/excalidraw/actions/manager.tsx b/packages/excalidraw/src/actions/manager.tsx similarity index 97% rename from packages/excalidraw/actions/manager.tsx rename to packages/excalidraw/src/actions/manager.tsx index 171bb5df7..696dd2341 100644 --- a/packages/excalidraw/actions/manager.tsx +++ b/packages/excalidraw/src/actions/manager.tsx @@ -7,9 +7,9 @@ import type { OrderedExcalidrawElement, } from "@excalidraw/element/types"; -import { trackEvent } from "../analytics"; +import { trackEvent } from "../../analytics"; -import type { AppClassProperties, AppState } from "../types"; +import type { AppClassProperties, AppState } from "../../types"; import type { Action, UpdaterFn, diff --git a/packages/excalidraw/actions/register.ts b/packages/excalidraw/src/actions/register.ts similarity index 100% rename from packages/excalidraw/actions/register.ts rename to packages/excalidraw/src/actions/register.ts diff --git a/packages/excalidraw/actions/shortcuts.ts b/packages/excalidraw/src/actions/shortcuts.ts similarity index 99% rename from packages/excalidraw/actions/shortcuts.ts rename to packages/excalidraw/src/actions/shortcuts.ts index 1a13f1703..c7ef33245 100644 --- a/packages/excalidraw/actions/shortcuts.ts +++ b/packages/excalidraw/src/actions/shortcuts.ts @@ -2,7 +2,7 @@ import { isDarwin, getShortcutKey } from "@excalidraw/common"; import type { SubtypeOf } from "@excalidraw/common/utility-types"; -import { t } from "../i18n"; +import { t } from "../../i18n"; import type { ActionName } from "./types"; diff --git a/packages/excalidraw/actions/types.ts b/packages/excalidraw/src/actions/types.ts similarity index 98% rename from packages/excalidraw/actions/types.ts rename to packages/excalidraw/src/actions/types.ts index c63a122e0..89b7db670 100644 --- a/packages/excalidraw/actions/types.ts +++ b/packages/excalidraw/src/actions/types.ts @@ -3,14 +3,14 @@ import type { OrderedExcalidrawElement, } from "@excalidraw/element/types"; -import type { CaptureUpdateActionType } from "../store"; +import type { CaptureUpdateActionType } from "../../store"; import type { AppClassProperties, AppState, ExcalidrawProps, BinaryFiles, UIAppState, -} from "../types"; +} from "../../types"; import type React from "react"; export type ActionSource = diff --git a/packages/excalidraw/src/wysiwyg/textWysiwyg.test.tsx b/packages/excalidraw/src/wysiwyg/textWysiwyg.test.tsx index a15512c3a..a8582b311 100644 --- a/packages/excalidraw/src/wysiwyg/textWysiwyg.test.tsx +++ b/packages/excalidraw/src/wysiwyg/textWysiwyg.test.tsx @@ -31,7 +31,7 @@ import { mockBoundingClientRect, restoreOriginalGetBoundingClientRect, } from "../../tests/test-utils"; -import { actionBindText } from "../../actions"; +import { actionBindText } from "../actions"; unmountComponent(); diff --git a/packages/excalidraw/src/wysiwyg/textWysiwyg.tsx b/packages/excalidraw/src/wysiwyg/textWysiwyg.tsx index c0615b619..9d05ca4d2 100644 --- a/packages/excalidraw/src/wysiwyg/textWysiwyg.tsx +++ b/packages/excalidraw/src/wysiwyg/textWysiwyg.tsx @@ -43,19 +43,19 @@ import type { ExcalidrawTextElement, } from "@excalidraw/element/types"; -import { actionSaveToActiveFile } from "../../actions"; +import { actionSaveToActiveFile } from "../actions"; import Scene from "../scene/Scene"; import { parseClipboard } from "../../clipboard"; import { actionDecreaseFontSize, actionIncreaseFontSize, -} from "../../actions/actionProperties"; +} from "../actions/actionProperties"; import { actionResetZoom, actionZoomIn, actionZoomOut, -} from "../../actions/actionCanvas"; +} from "../actions/actionCanvas"; import type App from "../../components/App"; import type { AppState } from "../../types"; diff --git a/packages/excalidraw/tests/actionStyles.test.tsx b/packages/excalidraw/tests/actionStyles.test.tsx index e81e9e4e4..68bb49d68 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 "../index"; import { API } from "../tests/helpers/api"; import { Keyboard, Pointer, UI } from "../tests/helpers/ui"; diff --git a/packages/excalidraw/tests/contextmenu.test.tsx b/packages/excalidraw/tests/contextmenu.test.tsx index 1a24147e2..795b38d50 100644 --- a/packages/excalidraw/tests/contextmenu.test.tsx +++ b/packages/excalidraw/tests/contextmenu.test.tsx @@ -5,7 +5,7 @@ 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 "../index"; import * as StaticScene from "../src/renderer/staticScene"; @@ -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 8011483fa..1d31e4687 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 ".."; -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/elementLocking.test.tsx b/packages/excalidraw/tests/elementLocking.test.tsx index 45e370ed8..79c68c0a3 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 "../i18n"; import { Excalidraw } from "../index"; diff --git a/packages/excalidraw/tests/flip.test.tsx b/packages/excalidraw/tests/flip.test.tsx index 65d28d809..86eed0b29 100644 --- a/packages/excalidraw/tests/flip.test.tsx +++ b/packages/excalidraw/tests/flip.test.tsx @@ -19,7 +19,7 @@ import type { FileId, } from "@excalidraw/element/types"; -import { actionFlipHorizontal, actionFlipVertical } from "../actions"; +import { actionFlipHorizontal, actionFlipVertical } from "../src/actions"; import { createPasteEvent } from "../clipboard"; import { Excalidraw } from "../index"; diff --git a/packages/excalidraw/tests/helpers/api.ts b/packages/excalidraw/tests/helpers/api.ts index cc3f92b24..b802c9403 100644 --- a/packages/excalidraw/tests/helpers/api.ts +++ b/packages/excalidraw/tests/helpers/api.ts @@ -47,7 +47,7 @@ import { createTestHook } from "../../components/App"; import { getDefaultAppState } from "../../appState"; import { GlobalTestState, createEvent, fireEvent, act } from "../test-utils"; -import type { Action } from "../../actions/types"; +import type { Action } from "../../src/actions/types"; import type App from "../../components/App"; import type { AppState } from "../../types"; diff --git a/packages/excalidraw/tests/history.test.tsx b/packages/excalidraw/tests/history.test.tsx index b5f888191..8e3f82d60 100644 --- a/packages/excalidraw/tests/history.test.tsx +++ b/packages/excalidraw/tests/history.test.tsx @@ -42,9 +42,12 @@ import { actionSendBackward, actionBringForward, actionSendToBack, -} from "../actions"; -import { createUndoAction, createRedoAction } from "../actions/actionHistory"; -import { actionToggleViewMode } from "../actions/actionToggleViewMode"; +} from "../src/actions/index.js"; +import { + createUndoAction, + createRedoAction, +} from "../src/actions/actionHistory.js"; +import { actionToggleViewMode } from "../src/actions/actionToggleViewMode.js"; import { getDefaultAppState } from "../appState"; import { HistoryEntry } from "../history"; import { Excalidraw } from "../index"; diff --git a/packages/excalidraw/types.ts b/packages/excalidraw/types.ts index b952dbeef..35cae7409 100644 --- a/packages/excalidraw/types.ts +++ b/packages/excalidraw/types.ts @@ -43,7 +43,7 @@ import type { MakeBrand, } from "@excalidraw/common/utility-types"; -import type { Action } from "./actions/types"; +import type { Action } from "./src/actions/types"; import type { Spreadsheet } from "./charts"; import type { ClipboardData } from "./clipboard"; import type App from "./components/App";