Move actions folder in src

This commit is contained in:
Deepen Timalsina 2025-04-15 17:57:27 +05:45
parent ce8542c6f9
commit c9c6c47081
79 changed files with 276 additions and 261 deletions

View file

@ -2,7 +2,7 @@ import { CaptureUpdateAction, newElementWith } from "@excalidraw/excalidraw";
import { import {
createRedoAction, createRedoAction,
createUndoAction, createUndoAction,
} from "@excalidraw/excalidraw/actions/actionHistory"; } from "@excalidraw/excalidraw/src/actions/actionHistory";
import { syncInvalidIndices } from "@excalidraw/element/fractionalIndex"; import { syncInvalidIndices } from "@excalidraw/element/fractionalIndex";
import { API } from "@excalidraw/excalidraw/tests/helpers/api"; import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import { act, render, waitFor } from "@excalidraw/excalidraw/tests/test-utils"; import { act, render, waitFor } from "@excalidraw/excalidraw/tests/test-utils";

View file

@ -8,7 +8,7 @@ import {
actionAlignBottom, actionAlignBottom,
actionAlignLeft, actionAlignLeft,
actionAlignRight, actionAlignRight,
} from "@excalidraw/excalidraw/actions"; } from "@excalidraw/excalidraw/src/actions";
import { defaultLang, setLanguage } from "@excalidraw/excalidraw/i18n"; import { defaultLang, setLanguage } from "@excalidraw/excalidraw/i18n";
import { Excalidraw } from "@excalidraw/excalidraw"; import { Excalidraw } from "@excalidraw/excalidraw";

View file

@ -2,7 +2,7 @@ import { KEYS, arrayToMap } from "@excalidraw/common";
import { pointFrom } from "@excalidraw/math"; 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"; import { Excalidraw, isLinearElement } from "@excalidraw/excalidraw";

View file

@ -10,7 +10,7 @@ import {
import { Excalidraw } from "@excalidraw/excalidraw"; 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"; import { API } from "@excalidraw/excalidraw/tests/helpers/api";

View file

@ -3,8 +3,8 @@ import { pointFrom } from "@excalidraw/math";
import { Excalidraw, mutateElement } from "@excalidraw/excalidraw"; import { Excalidraw, mutateElement } from "@excalidraw/excalidraw";
import Scene from "@excalidraw/excalidraw/src/scene/Scene"; import Scene from "@excalidraw/excalidraw/src/scene/Scene";
import { actionSelectAll } from "@excalidraw/excalidraw/actions"; import { actionSelectAll } from "@excalidraw/excalidraw/src/actions";
import { actionDuplicateSelection } from "@excalidraw/excalidraw/actions/actionDuplicateSelection"; import { actionDuplicateSelection } from "@excalidraw/excalidraw/src/actions/actionDuplicateSelection";
import { API } from "@excalidraw/excalidraw/tests/helpers/api"; import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import { Pointer, UI } from "@excalidraw/excalidraw/tests/helpers/ui"; import { Pointer, UI } from "@excalidraw/excalidraw/tests/helpers/ui";

View file

@ -6,7 +6,7 @@ import {
actionBringToFront, actionBringToFront,
actionSendToBack, actionSendToBack,
actionDuplicateSelection, actionDuplicateSelection,
} from "@excalidraw/excalidraw/actions"; } from "@excalidraw/excalidraw/src/actions";
import { Excalidraw } from "@excalidraw/excalidraw"; import { Excalidraw } from "@excalidraw/excalidraw";

View file

@ -30,9 +30,9 @@ import type {
NonDeletedSceneElementsMap, NonDeletedSceneElementsMap,
} from "@excalidraw/element/types"; } 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 { trackEvent } from "../analytics";
import { useTunnels } from "../src/context/tunnels"; import { useTunnels } from "../src/context/tunnels";
@ -66,7 +66,7 @@ import {
} from "./icons"; } from "./icons";
import type { AppClassProperties, AppProps, UIAppState, Zoom } from "../types"; import type { AppClassProperties, AppProps, UIAppState, Zoom } from "../types";
import type { ActionManager } from "../actions/manager"; import type { ActionManager } from "../src/actions/manager";
export const canChangeStrokeColor = ( export const canChangeStrokeColor = (
appState: UIAppState, appState: UIAppState,

View file

@ -1,4 +1,4 @@
import { actionClearCanvas } from "../actions"; import { actionClearCanvas } from "../src/actions";
import { atom, useAtom } from "../editor-jotai"; import { atom, useAtom } from "../editor-jotai";
import { t } from "../i18n"; import { t } from "../i18n";

View file

@ -362,23 +362,26 @@ import {
actionToggleLinearEditor, actionToggleLinearEditor,
actionToggleObjectsSnapMode, actionToggleObjectsSnapMode,
actionToggleCropEditor, actionToggleCropEditor,
} from "../actions"; } from "../src/actions";
import { actionWrapTextInContainer } from "../actions/actionBoundText"; import { actionWrapTextInContainer } from "../src/actions/actionBoundText";
import { actionToggleHandTool, zoomToFit } from "../actions/actionCanvas"; import { actionToggleHandTool, zoomToFit } from "../src/actions/actionCanvas";
import { actionPaste } from "../actions/actionClipboard"; import { actionPaste } from "../src/actions/actionClipboard";
import { actionCopyElementLink } from "../actions/actionElementLink"; import { actionCopyElementLink } from "../src/actions/actionElementLink";
import { actionUnlockAllElements } from "../actions/actionElementLock"; import { actionUnlockAllElements } from "../src/actions/actionElementLock";
import { import {
actionRemoveAllElementsFromFrame, actionRemoveAllElementsFromFrame,
actionSelectAllElementsInFrame, actionSelectAllElementsInFrame,
actionWrapSelectionInFrame, actionWrapSelectionInFrame,
} from "../actions/actionFrame"; } from "../src/actions/actionFrame";
import { createRedoAction, createUndoAction } from "../actions/actionHistory"; import {
import { actionTextAutoResize } from "../actions/actionTextAutoResize"; createRedoAction,
import { actionToggleViewMode } from "../actions/actionToggleViewMode"; createUndoAction,
import { ActionManager } from "../actions/manager"; } from "../src/actions/actionHistory";
import { actions } from "../actions/register"; import { actionTextAutoResize } from "../src/actions/actionTextAutoResize";
import { getShortcutFromShortcutName } from "../actions/shortcuts"; 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 { trackEvent } from "../analytics";
import { AnimationFrameHandler } from "../src/animation-frame-handler"; import { AnimationFrameHandler } from "../src/animation-frame-handler";
import { import {
@ -527,7 +530,7 @@ import type {
Offsets, Offsets,
} from "../types"; } from "../types";
import type { RoughCanvas } from "roughjs/bin/canvas"; 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<AppClassProperties>(null!); const AppContext = React.createContext<AppClassProperties>(null!);
const AppPropsContext = React.createContext<AppProps>(null!); const AppPropsContext = React.createContext<AppProps>(null!);

View file

@ -17,12 +17,12 @@ import {
actionClearCanvas, actionClearCanvas,
actionLink, actionLink,
actionToggleSearchMenu, actionToggleSearchMenu,
} from "../../actions"; } from "../../src/actions";
import { import {
actionCopyElementLink, actionCopyElementLink,
actionLinkToElement, actionLinkToElement,
} from "../../actions/actionElementLink"; } from "../../src/actions/actionElementLink";
import { getShortcutFromShortcutName } from "../../actions/shortcuts"; import { getShortcutFromShortcutName } from "../../src/actions/shortcuts";
import { trackEvent } from "../../analytics"; import { trackEvent } from "../../analytics";
import { useUIAppState } from "../../src/context/ui-appState"; import { useUIAppState } from "../../src/context/ui-appState";
import { deburr } from "../../deburr"; import { deburr } from "../../deburr";
@ -63,9 +63,9 @@ import "./CommandPalette.scss";
import type { CommandPaletteItem } from "./types"; import type { CommandPaletteItem } from "./types";
import type { AppProps, AppState, UIAppState } 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 { TranslationKeys } from "../../i18n";
import type { Action } from "../../actions/types"; import type { Action } from "../../src/actions/types";
const lastUsedPaletteItem = atom<CommandPaletteItem | null>(null); const lastUsedPaletteItem = atom<CommandPaletteItem | null>(null);

View file

@ -1,4 +1,4 @@
import { actionToggleTheme } from "../../actions"; import { actionToggleTheme } from "../../src/actions";
import type { CommandPaletteItem } from "./types"; import type { CommandPaletteItem } from "./types";

View file

@ -1,5 +1,5 @@
import type { ActionManager } from "../../actions/manager"; import type { ActionManager } from "../../src/actions/manager";
import type { Action } from "../../actions/types"; import type { Action } from "../../src/actions/types";
import type { UIAppState } from "../../types"; import type { UIAppState } from "../../types";
export type CommandPaletteItem = { export type CommandPaletteItem = {

View file

@ -1,7 +1,7 @@
import clsx from "clsx"; import clsx from "clsx";
import React from "react"; import React from "react";
import { getShortcutFromShortcutName } from "../actions/shortcuts"; import { getShortcutFromShortcutName } from "../src/actions/shortcuts";
import { t } from "../i18n"; import { t } from "../i18n";
import { useExcalidrawAppState, useExcalidrawElements } from "./App"; import { useExcalidrawAppState, useExcalidrawElements } from "./App";
@ -10,9 +10,9 @@ import { Popover } from "./Popover";
import "./ContextMenu.scss"; import "./ContextMenu.scss";
import type { ActionManager } from "../actions/manager"; import type { ActionManager } from "../src/actions/manager";
import type { ShortcutName } from "../actions/shortcuts"; import type { ShortcutName } from "../src/actions/shortcuts";
import type { Action } from "../actions/types"; import type { Action } from "../src/actions/types";
import type { TranslationKeys } from "../i18n"; import type { TranslationKeys } from "../i18n";

View file

@ -4,7 +4,7 @@ import { isDarwin, isFirefox, isWindows } from "@excalidraw/common";
import { KEYS, getShortcutKey } 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 { probablySupportsClipboardBlob } from "../clipboard";
import { t } from "../i18n"; import { t } from "../i18n";

View file

@ -17,7 +17,7 @@ import {
actionChangeExportEmbedScene, actionChangeExportEmbedScene,
actionChangeExportScale, actionChangeExportScale,
actionChangeProjectName, actionChangeProjectName,
} from "../actions/actionExport"; } from "../src/actions/actionExport";
import { probablySupportsClipboardBlob } from "../clipboard"; import { probablySupportsClipboardBlob } from "../clipboard";
import { prepareElementsForExport } from "../src/data"; import { prepareElementsForExport } from "../src/data";
import { canvasToBlob } from "../src/data/blob"; import { canvasToBlob } from "../src/data/blob";
@ -36,7 +36,7 @@ import { FilledButton } from "./FilledButton";
import "./ImageExportDialog.scss"; import "./ImageExportDialog.scss";
import type { ActionManager } from "../actions/manager"; import type { ActionManager } from "../src/actions/manager";
import type { AppClassProperties, BinaryFiles, UIAppState } from "../types"; import type { AppClassProperties, BinaryFiles, UIAppState } from "../types";

View file

@ -4,7 +4,7 @@ import { getFrame } from "@excalidraw/common";
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types"; import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
import { actionSaveFileToDisk } from "../actions/actionExport"; import { actionSaveFileToDisk } from "../src/actions/actionExport";
import { trackEvent } from "../analytics"; import { trackEvent } from "../analytics";
import { nativeFileSystemSupported } from "../src/data/filesystem"; import { nativeFileSystemSupported } from "../src/data/filesystem";
@ -17,7 +17,7 @@ import { exportToFileIcon, LinkIcon } from "./icons";
import "./ExportDialog.scss"; import "./ExportDialog.scss";
import type { ActionManager } from "../actions/manager"; import type { ActionManager } from "../src/actions/manager";
import type { ExportOpts, BinaryFiles, UIAppState } from "../types"; import type { ExportOpts, BinaryFiles, UIAppState } from "../types";

View file

@ -18,7 +18,7 @@ import { ShapeCache } from "@excalidraw/element/ShapeCache";
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types"; import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
import Scene from "../src/scene/Scene"; import Scene from "../src/scene/Scene";
import { actionToggleStats } from "../actions"; import { actionToggleStats } from "../src/actions";
import { trackEvent } from "../analytics"; import { trackEvent } from "../analytics";
import { isHandToolActive } from "../appState"; import { isHandToolActive } from "../appState";
import { TunnelsContext, useInitializeTunnels } from "../src/context/tunnels"; import { TunnelsContext, useInitializeTunnels } from "../src/context/tunnels";
@ -62,7 +62,7 @@ import { LaserPointerButton } from "./LaserPointerButton";
import "./LayerUI.scss"; import "./LayerUI.scss";
import "./Toolbar.scss"; import "./Toolbar.scss";
import type { ActionManager } from "../actions/manager"; import type { ActionManager } from "../src/actions/manager";
import type { Language } from "../i18n"; import type { Language } from "../i18n";
import type { import type {

View file

@ -20,7 +20,7 @@ import { PenModeButton } from "./PenModeButton";
import { Section } from "./Section"; import { Section } from "./Section";
import Stack from "./Stack"; import Stack from "./Stack";
import type { ActionManager } from "../actions/manager"; import type { ActionManager } from "../src/actions/manager";
import type { import type {
AppClassProperties, AppClassProperties,
AppProps, AppProps,

View file

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
import { actionSaveFileToDisk } from "../../actions"; import { actionSaveFileToDisk } from "../../src/actions";
import { actionChangeExportEmbedScene } from "../../actions/actionExport"; import { actionChangeExportEmbedScene } from "../../src/actions/actionExport";
import { useI18n } from "../../i18n"; import { useI18n } from "../../i18n";
import { useExcalidrawActionManager, useExcalidrawSetAppState } from "../App"; import { useExcalidrawActionManager, useExcalidrawSetAppState } from "../App";
import { FilledButton } from "../FilledButton"; import { FilledButton } from "../FilledButton";

View file

@ -1,6 +1,6 @@
import React, { useEffect } from "react"; import React, { useEffect } from "react";
import { getFormValue } from "../actions/actionProperties"; import { getFormValue } from "../src/actions/actionProperties";
import { t } from "../i18n"; import { t } from "../i18n";
import "./Range.scss"; import "./Range.scss";

View file

@ -18,7 +18,7 @@ import type {
} from "@excalidraw/element/types"; } from "@excalidraw/element/types";
import { Excalidraw, getCommonBounds, mutateElement } from "../.."; import { Excalidraw, getCommonBounds, mutateElement } from "../..";
import { actionGroup } from "../../actions"; import { actionGroup } from "../../src/actions";
import { t } from "../../i18n"; import { t } from "../../i18n";
import * as StaticScene from "../../src/renderer/staticScene"; import * as StaticScene from "../../src/renderer/staticScene";
import { API } from "../../tests/helpers/api"; import { API } from "../../tests/helpers/api";

View file

@ -16,7 +16,7 @@ import { Tooltip } from "./Tooltip";
import "./UserList.scss"; import "./UserList.scss";
import type { ActionManager } from "../actions/manager"; import type { ActionManager } from "../src/actions/manager";
import type { Collaborator, SocketId } from "../types"; import type { Collaborator, SocketId } from "../types";
export type GoToCollaboratorComponentProps = { export type GoToCollaboratorComponentProps = {

View file

@ -1,6 +1,6 @@
import clsx from "clsx"; import clsx from "clsx";
import { actionShortcuts } from "../../actions"; import { actionShortcuts } from "../../src/actions";
import { useTunnels } from "../../src/context/tunnels"; import { useTunnels } from "../../src/context/tunnels";
import { import {
ExitZenModeAction, ExitZenModeAction,
@ -13,7 +13,7 @@ import { HelpButton } from "../HelpButton";
import { Section } from "../Section"; import { Section } from "../Section";
import Stack from "../Stack"; import Stack from "../Stack";
import type { ActionManager } from "../../actions/manager"; import type { ActionManager } from "../../src/actions/manager";
import type { UIAppState } from "../../types"; import type { UIAppState } from "../../types";
const Footer = ({ const Footer = ({

View file

@ -11,8 +11,8 @@ import {
actionShortcuts, actionShortcuts,
actionToggleSearchMenu, actionToggleSearchMenu,
actionToggleTheme, actionToggleTheme,
} from "../../actions"; } from "../../src/actions";
import { getShortcutFromShortcutName } from "../../actions/shortcuts"; import { getShortcutFromShortcutName } from "../../src/actions/shortcuts";
import { trackEvent } from "../../analytics"; import { trackEvent } from "../../analytics";
import { useUIAppState } from "../../src/context/ui-appState"; import { useUIAppState } from "../../src/context/ui-appState";
import { useSetAtom } from "../../editor-jotai"; import { useSetAtom } from "../../editor-jotai";

View file

@ -1,5 +1,5 @@
import { actionLoadScene, actionShortcuts } from "../../actions"; import { actionLoadScene, actionShortcuts } from "../../src/actions";
import { getShortcutFromShortcutName } from "../../actions/shortcuts"; import { getShortcutFromShortcutName } from "../../src/actions/shortcuts";
import { useTunnels } from "../../src/context/tunnels"; import { useTunnels } from "../../src/context/tunnels";
import { useUIAppState } from "../../src/context/ui-appState"; import { useUIAppState } from "../../src/context/ui-appState";
import { t, useI18n } from "../../i18n"; import { t, useI18n } from "../../i18n";

View file

@ -289,7 +289,7 @@ export { DefaultSidebar } from "./components/DefaultSidebar";
export { TTDDialog } from "./components/TTDDialog/TTDDialog"; export { TTDDialog } from "./components/TTDDialog/TTDDialog";
export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger"; export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger";
export { zoomToFitBounds } from "./actions/actionCanvas"; export { zoomToFitBounds } from "./src/actions/actionCanvas";
export { convertToExcalidrawElements } from "./src/data/transform"; export { convertToExcalidrawElements } from "./src/data/transform";
export { export {
getCommonBounds, getCommonBounds,

View file

@ -1,8 +1,8 @@
import { LIBRARY_DISABLED_TYPES, randomId } from "@excalidraw/common"; import { LIBRARY_DISABLED_TYPES, randomId } from "@excalidraw/common";
import { deepCopyElement } from "@excalidraw/element/duplicate"; import { deepCopyElement } from "@excalidraw/element/duplicate";
import { t } from "../i18n"; import { t } from "../../i18n";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -12,7 +12,7 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
import type { Alignment } from "@excalidraw/element/align"; import type { Alignment } from "@excalidraw/element/align";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../../components/ToolButton";
import { import {
AlignBottomIcon, AlignBottomIcon,
AlignLeftIcon, AlignLeftIcon,
@ -20,16 +20,16 @@ import {
AlignTopIcon, AlignTopIcon,
CenterHorizontallyIcon, CenterHorizontallyIcon,
CenterVerticallyIcon, CenterVerticallyIcon,
} from "../components/icons"; } from "../../components/icons";
import { t } from "../i18n"; import { t } from "../../i18n";
import { isSomeElementSelected } from "../src/scene"; import { isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";
import type { AppClassProperties, AppState, UIAppState } from "../types"; import type { AppClassProperties, AppState, UIAppState } from "../../types";
export const alignActionsPredicate = ( export const alignActionsPredicate = (
appState: UIAppState, appState: UIAppState,

View file

@ -43,13 +43,13 @@ import type {
import type { Mutable } from "@excalidraw/common/utility-types"; import type { Mutable } from "@excalidraw/common/utility-types";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; 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({ export const actionUnbindText = register({
name: "unbindText", name: "unbindText",

View file

@ -23,10 +23,10 @@ import {
getDefaultAppState, getDefaultAppState,
isEraserActive, isEraserActive,
isHandToolActive, isHandToolActive,
} from "../appState"; } from "../../appState";
import { ColorPicker } from "../components/ColorPicker/ColorPicker"; import { ColorPicker } from "../../components/ColorPicker/ColorPicker";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../../components/ToolButton";
import { Tooltip } from "../components/Tooltip"; import { Tooltip } from "../../components/Tooltip";
import { import {
handIcon, handIcon,
LassoIcon, LassoIcon,
@ -37,18 +37,18 @@ import {
ZoomInIcon, ZoomInIcon,
ZoomOutIcon, ZoomOutIcon,
ZoomResetIcon, ZoomResetIcon,
} from "../components/icons"; } from "../../components/icons";
import { setCursor } from "../cursor"; import { setCursor } from "../../cursor";
import { t } from "../i18n"; import { t } from "../../i18n";
import { getNormalizedZoom } from "../src/scene"; import { getNormalizedZoom } from "../scene";
import { centerScrollOn } from "../src/scene/scroll"; import { centerScrollOn } from "../scene/scroll";
import { getStateForZoom } from "../src/scene/zoom"; import { getStateForZoom } from "../scene/zoom";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";
import type { AppState, Offsets } from "../types"; import type { AppState, Offsets } from "../../types";
export const actionChangeViewBackgroundColor = register({ export const actionChangeViewBackgroundColor = register({
name: "changeViewBackgroundColor", name: "changeViewBackgroundColor",

View file

@ -10,12 +10,17 @@ import {
probablySupportsClipboardBlob, probablySupportsClipboardBlob,
probablySupportsClipboardWriteText, probablySupportsClipboardWriteText,
readSystemClipboard, readSystemClipboard,
} from "../clipboard"; } from "../../clipboard";
import { DuplicateIcon, cutIcon, pngIcon, svgIcon } from "../components/icons"; import {
import { exportCanvas, prepareElementsForExport } from "../src/data/index"; DuplicateIcon,
import { t } from "../i18n"; 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 { actionDeleteSelected } from "./actionDeleteSelected";
import { register } from "./register"; import { register } from "./register";

View file

@ -2,10 +2,10 @@ import { isImageElement } from "@excalidraw/element/typeChecks";
import type { ExcalidrawImageElement } from "@excalidraw/element/types"; import type { ExcalidrawImageElement } from "@excalidraw/element/types";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../../components/ToolButton";
import { cropIcon } from "../components/icons"; import { cropIcon } from "../../components/icons";
import { t } from "../i18n"; import { t } from "../../i18n";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -1,8 +1,8 @@
import React from "react"; import React from "react";
import { Excalidraw, mutateElement } from "../index"; import { Excalidraw, mutateElement } from "../../index";
import { API } from "../tests/helpers/api"; import { API } from "../../tests/helpers/api";
import { act, assertElements, render } from "../tests/test-utils"; import { act, assertElements, render } from "../../tests/test-utils";
import { actionDeleteSelected } from "./actionDeleteSelected"; import { actionDeleteSelected } from "./actionDeleteSelected";

View file

@ -22,15 +22,15 @@ import {
import type { ExcalidrawElement } from "@excalidraw/element/types"; import type { ExcalidrawElement } from "@excalidraw/element/types";
import { t } from "../i18n"; import { t } from "../../i18n";
import { getSelectedElements, isSomeElementSelected } from "../src/scene"; import { getSelectedElements, isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { TrashIcon } from "../components/icons"; import { TrashIcon } from "../../components/icons";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../../components/ToolButton";
import { register } from "./register"; import { register } from "./register";
import type { AppClassProperties, AppState } from "../types"; import type { AppClassProperties, AppState } from "../../types";
const deleteSelectedElements = ( const deleteSelectedElements = (
elements: readonly ExcalidrawElement[], elements: readonly ExcalidrawElement[],

View file

@ -12,20 +12,20 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
import type { Distribution } from "@excalidraw/element/distribute"; import type { Distribution } from "@excalidraw/element/distribute";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../../components/ToolButton";
import { import {
DistributeHorizontallyIcon, DistributeHorizontallyIcon,
DistributeVerticallyIcon, DistributeVerticallyIcon,
} from "../components/icons"; } from "../../components/icons";
import { t } from "../i18n"; import { t } from "../../i18n";
import { isSomeElementSelected } from "../src/scene"; import { isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";
import type { AppClassProperties, AppState } from "../types"; import type { AppClassProperties, AppState } from "../../types";
const enableActionGroup = (appState: AppState, app: AppClassProperties) => { const enableActionGroup = (appState: AppState, app: AppClassProperties) => {
const selectedElements = app.scene.getSelectedElements(appState); const selectedElements = app.scene.getSelectedElements(appState);

View file

@ -1,13 +1,13 @@
import { ORIG_ID } from "@excalidraw/common"; import { ORIG_ID } from "@excalidraw/common";
import { Excalidraw } from "../index"; import { Excalidraw } from "../../index";
import { API } from "../tests/helpers/api"; import { API } from "../../tests/helpers/api";
import { import {
act, act,
assertElements, assertElements,
getCloneByOrigId, getCloneByOrigId,
render, render,
} from "../tests/test-utils"; } from "../../tests/test-utils";
import { actionDuplicateSelection } from "./actionDuplicateSelection"; import { actionDuplicateSelection } from "./actionDuplicateSelection";

View file

@ -27,12 +27,12 @@ import { duplicateElements } from "@excalidraw/element/duplicate";
import type { ExcalidrawElement } from "@excalidraw/element/types"; import type { ExcalidrawElement } from "@excalidraw/element/types";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../../components/ToolButton";
import { DuplicateIcon } from "../components/icons"; import { DuplicateIcon } from "../../components/icons";
import { t } from "../i18n"; import { t } from "../../i18n";
import { isSomeElementSelected } from "../src/scene"; import { isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -4,11 +4,11 @@ import {
getLinkIdAndTypeFromSelection, getLinkIdAndTypeFromSelection,
} from "@excalidraw/element/elementLink"; } from "@excalidraw/element/elementLink";
import { copyTextToSystemClipboard } from "../clipboard"; import { copyTextToSystemClipboard } from "../../clipboard";
import { copyIcon, elementLinkIcon } from "../components/icons"; import { copyIcon, elementLinkIcon } from "../../components/icons";
import { t } from "../i18n"; import { t } from "../../i18n";
import { getSelectedElements } from "../src/scene"; import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -1,10 +1,10 @@
import { queryByTestId, fireEvent } from "@testing-library/react"; import { queryByTestId, fireEvent } from "@testing-library/react";
import React from "react"; import React from "react";
import { Excalidraw } from "../index"; import { Excalidraw } from "../../index";
import { API } from "../tests/helpers/api"; import { API } from "../../tests/helpers/api";
import { Pointer, UI } from "../tests/helpers/ui"; import { Pointer, UI } from "../../tests/helpers/ui";
import { render } from "../tests/test-utils"; import { render } from "../../tests/test-utils";
const { h } = window; const { h } = window;
const mouse = new Pointer("mouse"); const mouse = new Pointer("mouse");

View file

@ -6,10 +6,10 @@ import { isFrameLikeElement } from "@excalidraw/element/typeChecks";
import type { ExcalidrawElement } from "@excalidraw/element/types"; 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 { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -1,7 +1,7 @@
import { updateActiveTool } from "@excalidraw/common"; import { updateActiveTool } from "@excalidraw/common";
import { setCursorForShape } from "../cursor"; import { setCursorForShape } from "../../cursor";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -9,24 +9,24 @@ import { getNonDeletedElements } from "@excalidraw/element";
import type { Theme } from "@excalidraw/element/types"; import type { Theme } from "@excalidraw/element/types";
import { useDevice } from "../components/App"; import { useDevice } from "../../components/App";
import { CheckboxItem } from "../components/CheckboxItem"; import { CheckboxItem } from "../../components/CheckboxItem";
import { DarkModeToggle } from "../components/DarkModeToggle"; import { DarkModeToggle } from "../../components/DarkModeToggle";
import { ProjectName } from "../components/ProjectName"; import { ProjectName } from "../../components/ProjectName";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../../components/ToolButton";
import { Tooltip } from "../components/Tooltip"; import { Tooltip } from "../../components/Tooltip";
import { ExportIcon, questionCircle, saveAs } from "../components/icons"; import { ExportIcon, questionCircle, saveAs } from "../../components/icons";
import { loadFromJSON, saveAsJSON } from "../src/data"; import { loadFromJSON, saveAsJSON } from "../data";
import { isImageFileHandle } from "../src/data/blob"; import { isImageFileHandle } from "../data/blob";
import { nativeFileSystemSupported } from "../src/data/filesystem"; import { nativeFileSystemSupported } from "../data/filesystem";
import { resaveAsImageWithScene } from "../src/data/resave"; import { resaveAsImageWithScene } from "../data/resave";
import { t } from "../i18n"; import { t } from "../../i18n";
import { getSelectedElements, isSomeElementSelected } from "../src/scene"; import { getSelectedElements, isSomeElementSelected } from "../scene";
import { getExportSize } from "../src/scene/export"; import { getExportSize } from "../scene/export";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import "../components/ToolIcon.scss"; import "../../components/ToolIcon.scss";
import { register } from "./register"; import { register } from "./register";

View file

@ -16,15 +16,15 @@ import { isPathALoop } from "@excalidraw/element/shapes";
import { isInvisiblySmallElement } from "@excalidraw/element/sizeHelpers"; import { isInvisiblySmallElement } from "@excalidraw/element/sizeHelpers";
import { t } from "../i18n"; import { t } from "../../i18n";
import { resetCursor } from "../cursor"; import { resetCursor } from "../../cursor";
import { done } from "../components/icons"; import { done } from "../../components/icons";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../../components/ToolButton";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";
import type { AppState } from "../types"; import type { AppState } from "../../types";
export const actionFinalize = register({ export const actionFinalize = register({
name: "finalize", name: "finalize",

View file

@ -1,8 +1,8 @@
import { pointFrom } from "@excalidraw/math"; import { pointFrom } from "@excalidraw/math";
import { Excalidraw } from "../index"; import { Excalidraw } from "../../index";
import { API } from "../tests/helpers/api"; import { API } from "../../tests/helpers/api";
import { render } from "../tests/test-utils"; import { render } from "../../tests/test-utils";
import { actionFlipHorizontal, actionFlipVertical } from "./actionFlip"; import { actionFlipHorizontal, actionFlipVertical } from "./actionFlip";

View file

@ -26,14 +26,14 @@ import type {
NonDeletedSceneElementsMap, NonDeletedSceneElementsMap,
} from "@excalidraw/element/types"; } from "@excalidraw/element/types";
import { getSelectedElements } from "../src/scene"; import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { flipHorizontal, flipVertical } from "../components/icons"; import { flipHorizontal, flipVertical } from "../../components/icons";
import { register } from "./register"; import { register } from "./register";
import type { AppClassProperties, AppState } from "../types"; import type { AppClassProperties, AppState } from "../../types";
export const actionFlipHorizontal = register({ export const actionFlipHorizontal = register({
name: "flipHorizontal", name: "flipHorizontal",

View file

@ -16,14 +16,14 @@ import { getCommonBounds } from "@excalidraw/element/bounds";
import type { ExcalidrawElement } from "@excalidraw/element/types"; import type { ExcalidrawElement } from "@excalidraw/element/types";
import { setCursorForShape } from "../cursor"; import { setCursorForShape } from "../../cursor";
import { frameToolIcon } from "../components/icons"; import { frameToolIcon } from "../../components/icons";
import { getSelectedElements } from "../src/scene"; import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";
import type { AppClassProperties, AppState, UIAppState } from "../types"; import type { AppClassProperties, AppState, UIAppState } from "../../types";
const isSingleFrameSelected = ( const isSingleFrameSelected = (
appState: UIAppState, appState: UIAppState,

View file

@ -34,17 +34,17 @@ import type {
OrderedExcalidrawElement, OrderedExcalidrawElement,
} from "@excalidraw/element/types"; } from "@excalidraw/element/types";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../../components/ToolButton";
import { UngroupIcon, GroupIcon } from "../components/icons"; import { UngroupIcon, GroupIcon } from "../../components/icons";
import { t } from "../i18n"; import { t } from "../../i18n";
import { isSomeElementSelected } from "../src/scene"; import { isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";
import type { AppClassProperties, AppState } from "../types"; import type { AppClassProperties, AppState } from "../../types";
const allElementsInSameGroup = (elements: readonly ExcalidrawElement[]) => { const allElementsInSameGroup = (elements: readonly ExcalidrawElement[]) => {
if (elements.length >= 2) { if (elements.length >= 2) {

View file

@ -2,16 +2,16 @@ import { isWindows, KEYS, matchKey, arrayToMap } from "@excalidraw/common";
import type { SceneElementsMap } from "@excalidraw/element/types"; import type { SceneElementsMap } from "@excalidraw/element/types";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../../components/ToolButton";
import { UndoIcon, RedoIcon } from "../components/icons"; import { UndoIcon, RedoIcon } from "../../components/icons";
import { HistoryChangedEvent } from "../history"; import { HistoryChangedEvent } from "../../history";
import { useEmitter } from "../src/hooks/useEmitter"; import { useEmitter } from "../hooks/useEmitter";
import { t } from "../i18n"; import { t } from "../../i18n";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import type { History } from "../history"; import type { History } from "../../history";
import type { Store } from "../store"; import type { Store } from "../../store";
import type { AppClassProperties, AppState } from "../types"; import type { AppClassProperties, AppState } from "../../types";
import type { Action, ActionResult } from "./types"; import type { Action, ActionResult } from "./types";
const executeHistoryAction = ( const executeHistoryAction = (

View file

@ -4,12 +4,12 @@ import { isElbowArrow, isLinearElement } from "@excalidraw/element/typeChecks";
import type { ExcalidrawLinearElement } from "@excalidraw/element/types"; import type { ExcalidrawLinearElement } from "@excalidraw/element/types";
import { DEFAULT_CATEGORIES } from "../components/CommandPalette/CommandPalette"; import { DEFAULT_CATEGORIES } from "../../components/CommandPalette/CommandPalette";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../../components/ToolButton";
import { lineEditorIcon } from "../components/icons"; import { lineEditorIcon } from "../../components/icons";
import { t } from "../i18n"; import { t } from "../../i18n";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -2,13 +2,13 @@ import { isEmbeddableElement } from "@excalidraw/element/typeChecks";
import { KEYS, getShortcutKey } from "@excalidraw/common"; import { KEYS, getShortcutKey } from "@excalidraw/common";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../../components/ToolButton";
import { getContextMenuLabel } from "../components/hyperlink/Hyperlink"; import { getContextMenuLabel } from "../../components/hyperlink/Hyperlink";
import { LinkIcon } from "../components/icons"; import { LinkIcon } from "../../components/icons";
import { t } from "../i18n"; import { t } from "../../i18n";
import { getSelectedElements } from "../src/scene"; import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -4,11 +4,15 @@ import { getNonDeletedElements } from "@excalidraw/element";
import { showSelectedShapeActions } from "@excalidraw/element/showSelectedShapeActions"; import { showSelectedShapeActions } from "@excalidraw/element/showSelectedShapeActions";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../../components/ToolButton";
import { HamburgerMenuIcon, HelpIconThin, palette } from "../components/icons"; import {
import { t } from "../i18n"; HamburgerMenuIcon,
HelpIconThin,
palette,
} from "../../components/icons";
import { t } from "../../i18n";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -1,19 +1,19 @@
import clsx from "clsx"; import clsx from "clsx";
import { getClientColor } from "../clients"; import { getClientColor } from "../../clients";
import { Avatar } from "../components/Avatar"; import { Avatar } from "../../components/Avatar";
import { import {
eyeIcon, eyeIcon,
microphoneIcon, microphoneIcon,
microphoneMutedIcon, microphoneMutedIcon,
} from "../components/icons"; } from "../../components/icons";
import { t } from "../i18n"; import { t } from "../../i18n";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";
import type { GoToCollaboratorComponentProps } from "../components/UserList"; import type { GoToCollaboratorComponentProps } from "../../components/UserList";
import type { Collaborator } from "../types"; import type { Collaborator } from "../../types";
export const actionGoToCollaborator = register({ export const actionGoToCollaborator = register({
name: "goToCollaborator", name: "goToCollaborator",

View file

@ -7,10 +7,10 @@ import {
STROKE_WIDTH, STROKE_WIDTH,
} from "@excalidraw/common"; } from "@excalidraw/common";
import { Excalidraw } from "../index"; import { Excalidraw } from "../../index";
import { API } from "../tests/helpers/api"; import { API } from "../../tests/helpers/api";
import { UI } from "../tests/helpers/ui"; import { UI } from "../../tests/helpers/ui";
import { render } from "../tests/test-utils"; import { render } from "../../tests/test-utils";
describe("element locking", () => { describe("element locking", () => {
beforeEach(async () => { beforeEach(async () => {

View file

@ -71,15 +71,15 @@ import type {
NonDeletedSceneElementsMap, NonDeletedSceneElementsMap,
} from "@excalidraw/element/types"; } from "@excalidraw/element/types";
import { trackEvent } from "../analytics"; import { trackEvent } from "../../analytics";
import { ButtonIconSelect } from "../components/ButtonIconSelect"; import { ButtonIconSelect } from "../../components/ButtonIconSelect";
import { ColorPicker } from "../components/ColorPicker/ColorPicker"; import { ColorPicker } from "../../components/ColorPicker/ColorPicker";
import { FontPicker } from "../components/FontPicker/FontPicker"; import { FontPicker } from "../../components/FontPicker/FontPicker";
import { IconPicker } from "../components/IconPicker"; import { IconPicker } from "../../components/IconPicker";
// TODO barnabasmolnar/editor-redesign // TODO barnabasmolnar/editor-redesign
// TextAlignTopIcon, TextAlignBottomIcon,TextAlignMiddleIcon, // TextAlignTopIcon, TextAlignBottomIcon,TextAlignMiddleIcon,
// ArrowHead icons // ArrowHead icons
import { Range } from "../components/Range"; import { Range } from "../../components/Range";
import { import {
ArrowheadArrowIcon, ArrowheadArrowIcon,
ArrowheadBarIcon, ArrowheadBarIcon,
@ -121,23 +121,23 @@ import {
ArrowheadCrowfootIcon, ArrowheadCrowfootIcon,
ArrowheadCrowfootOneIcon, ArrowheadCrowfootOneIcon,
ArrowheadCrowfootOneOrManyIcon, ArrowheadCrowfootOneOrManyIcon,
} from "../components/icons"; } from "../../components/icons";
import { Fonts } from "../fonts"; import { Fonts } from "../../fonts";
import { getLanguage, t } from "../i18n"; import { getLanguage, t } from "../../i18n";
import { import {
canHaveArrowheads, canHaveArrowheads,
getCommonAttributeOfSelectedElements, getCommonAttributeOfSelectedElements,
getSelectedElements, getSelectedElements,
getTargetElements, getTargetElements,
isSomeElementSelected, isSomeElementSelected,
} from "../src/scene"; } from "../scene";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";
import type { CaptureUpdateActionType } from "../store"; import type { CaptureUpdateActionType } from "../../store";
import type { AppClassProperties, AppState, Primitive } from "../types"; import type { AppClassProperties, AppState, Primitive } from "../../types";
const FONT_SIZE_RELATIVE_INCREASE_STEP = 0.1; const FONT_SIZE_RELATIVE_INCREASE_STEP = 0.1;

View file

@ -8,9 +8,9 @@ import { selectGroupsForSelectedElements } from "@excalidraw/element/groups";
import type { ExcalidrawElement } from "@excalidraw/element/types"; 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"; import { register } from "./register";

View file

@ -26,11 +26,11 @@ import {
import type { ExcalidrawTextElement } from "@excalidraw/element/types"; import type { ExcalidrawTextElement } from "@excalidraw/element/types";
import { paintIcon } from "../components/icons"; import { paintIcon } from "../../components/icons";
import { t } from "../i18n"; import { t } from "../../i18n";
import { getSelectedElements } from "../src/scene"; import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -5,12 +5,12 @@ import { measureText } from "@excalidraw/element/textMeasurements";
import { isTextElement } from "@excalidraw/element/typeChecks"; import { isTextElement } from "@excalidraw/element/typeChecks";
import { getSelectedElements } from "../src/scene"; import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";
import type { AppClassProperties } from "../types"; import type { AppClassProperties } from "../../types";
export const actionTextAutoResize = register({ export const actionTextAutoResize = register({
name: "autoResize", name: "autoResize",

View file

@ -1,11 +1,11 @@
import { CODES, KEYS } from "@excalidraw/common"; import { CODES, KEYS } from "@excalidraw/common";
import { gridIcon } from "../components/icons"; import { gridIcon } from "../../components/icons";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";
import type { AppState } from "../types"; import type { AppState } from "../../types";
export const actionToggleGridMode = register({ export const actionToggleGridMode = register({
name: "gridMode", name: "gridMode",

View file

@ -1,7 +1,7 @@
import { CODES, KEYS } from "@excalidraw/common"; import { CODES, KEYS } from "@excalidraw/common";
import { magnetIcon } from "../components/icons"; import { magnetIcon } from "../../components/icons";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -5,12 +5,12 @@ import {
DEFAULT_SIDEBAR, DEFAULT_SIDEBAR,
} from "@excalidraw/common"; } from "@excalidraw/common";
import { searchIcon } from "../components/icons"; import { searchIcon } from "../../components/icons";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";
import type { AppState } from "../types"; import type { AppState } from "../../types";
export const actionToggleSearchMenu = register({ export const actionToggleSearchMenu = register({
name: "searchMenu", name: "searchMenu",

View file

@ -1,7 +1,7 @@
import { CODES, KEYS } from "@excalidraw/common"; import { CODES, KEYS } from "@excalidraw/common";
import { abacusIcon } from "../components/icons"; import { abacusIcon } from "../../components/icons";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -1,7 +1,7 @@
import { CODES, KEYS } from "@excalidraw/common"; import { CODES, KEYS } from "@excalidraw/common";
import { eyeIcon } from "../components/icons"; import { eyeIcon } from "../../components/icons";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -1,7 +1,7 @@
import { CODES, KEYS } from "@excalidraw/common"; import { CODES, KEYS } from "@excalidraw/common";
import { coffeeIcon } from "../components/icons"; import { coffeeIcon } from "../../components/icons";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -12,9 +12,9 @@ import {
BringToFrontIcon, BringToFrontIcon,
SendBackwardIcon, SendBackwardIcon,
SendToBackIcon, SendToBackIcon,
} from "../components/icons"; } from "../../components/icons";
import { t } from "../i18n"; import { t } from "../../i18n";
import { CaptureUpdateAction } from "../store"; import { CaptureUpdateAction } from "../../store";
import { register } from "./register"; import { register } from "./register";

View file

@ -7,9 +7,9 @@ import type {
OrderedExcalidrawElement, OrderedExcalidrawElement,
} from "@excalidraw/element/types"; } 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 { import type {
Action, Action,
UpdaterFn, UpdaterFn,

View file

@ -2,7 +2,7 @@ import { isDarwin, getShortcutKey } from "@excalidraw/common";
import type { SubtypeOf } from "@excalidraw/common/utility-types"; import type { SubtypeOf } from "@excalidraw/common/utility-types";
import { t } from "../i18n"; import { t } from "../../i18n";
import type { ActionName } from "./types"; import type { ActionName } from "./types";

View file

@ -3,14 +3,14 @@ import type {
OrderedExcalidrawElement, OrderedExcalidrawElement,
} from "@excalidraw/element/types"; } from "@excalidraw/element/types";
import type { CaptureUpdateActionType } from "../store"; import type { CaptureUpdateActionType } from "../../store";
import type { import type {
AppClassProperties, AppClassProperties,
AppState, AppState,
ExcalidrawProps, ExcalidrawProps,
BinaryFiles, BinaryFiles,
UIAppState, UIAppState,
} from "../types"; } from "../../types";
import type React from "react"; import type React from "react";
export type ActionSource = export type ActionSource =

View file

@ -31,7 +31,7 @@ import {
mockBoundingClientRect, mockBoundingClientRect,
restoreOriginalGetBoundingClientRect, restoreOriginalGetBoundingClientRect,
} from "../../tests/test-utils"; } from "../../tests/test-utils";
import { actionBindText } from "../../actions"; import { actionBindText } from "../actions";
unmountComponent(); unmountComponent();

View file

@ -43,19 +43,19 @@ import type {
ExcalidrawTextElement, ExcalidrawTextElement,
} from "@excalidraw/element/types"; } from "@excalidraw/element/types";
import { actionSaveToActiveFile } from "../../actions"; import { actionSaveToActiveFile } from "../actions";
import Scene from "../scene/Scene"; import Scene from "../scene/Scene";
import { parseClipboard } from "../../clipboard"; import { parseClipboard } from "../../clipboard";
import { import {
actionDecreaseFontSize, actionDecreaseFontSize,
actionIncreaseFontSize, actionIncreaseFontSize,
} from "../../actions/actionProperties"; } from "../actions/actionProperties";
import { import {
actionResetZoom, actionResetZoom,
actionZoomIn, actionZoomIn,
actionZoomOut, actionZoomOut,
} from "../../actions/actionCanvas"; } from "../actions/actionCanvas";
import type App from "../../components/App"; import type App from "../../components/App";
import type { AppState } from "../../types"; import type { AppState } from "../../types";

View file

@ -2,7 +2,7 @@ import React from "react";
import { CODES } from "@excalidraw/common"; import { CODES } from "@excalidraw/common";
import { copiedStyles } from "../actions/actionStyles"; import { copiedStyles } from "../src/actions/actionStyles";
import { Excalidraw } from "../index"; import { Excalidraw } from "../index";
import { API } from "../tests/helpers/api"; import { API } from "../tests/helpers/api";
import { Keyboard, Pointer, UI } from "../tests/helpers/ui"; import { Keyboard, Pointer, UI } from "../tests/helpers/ui";

View file

@ -5,7 +5,7 @@ import { KEYS, reseed } from "@excalidraw/common";
import { setDateTimeForTests } from "@excalidraw/common"; import { setDateTimeForTests } from "@excalidraw/common";
import { copiedStyles } from "../actions/actionStyles"; import { copiedStyles } from "../src/actions/actionStyles";
import { Excalidraw } from "../index"; import { Excalidraw } from "../index";
import * as StaticScene from "../src/renderer/staticScene"; import * as StaticScene from "../src/renderer/staticScene";
@ -25,8 +25,8 @@ import {
unmountComponent, unmountComponent,
} from "./test-utils"; } from "./test-utils";
import type { ShortcutName } from "../actions/shortcuts"; import type { ShortcutName } from "../src/actions/shortcuts";
import type { ActionName } from "../actions/types"; import type { ActionName } from "../src/actions/types";
const checkpoint = (name: string) => { const checkpoint = (name: string) => {
expect(renderStaticScene.mock.calls.length).toMatchSnapshot( expect(renderStaticScene.mock.calls.length).toMatchSnapshot(

View file

@ -11,7 +11,7 @@ import type {
} from "@excalidraw/element/types"; } from "@excalidraw/element/types";
import { Excalidraw, exportToCanvas, exportToSvg } from ".."; import { Excalidraw, exportToCanvas, exportToSvg } from "..";
import { actionFlipHorizontal, actionFlipVertical } from "../actions"; import { actionFlipHorizontal, actionFlipVertical } from "../src/actions";
import { API } from "./helpers/api"; import { API } from "./helpers/api";
import { Keyboard, Pointer, UI } from "./helpers/ui"; import { Keyboard, Pointer, UI } from "./helpers/ui";

View file

@ -4,7 +4,7 @@ import { mutateElement } from "@excalidraw/element/mutateElement";
import { KEYS } from "@excalidraw/common"; import { KEYS } from "@excalidraw/common";
import { actionSelectAll } from "../actions"; import { actionSelectAll } from "../src/actions";
import { t } from "../i18n"; import { t } from "../i18n";
import { Excalidraw } from "../index"; import { Excalidraw } from "../index";

View file

@ -19,7 +19,7 @@ import type {
FileId, FileId,
} from "@excalidraw/element/types"; } from "@excalidraw/element/types";
import { actionFlipHorizontal, actionFlipVertical } from "../actions"; import { actionFlipHorizontal, actionFlipVertical } from "../src/actions";
import { createPasteEvent } from "../clipboard"; import { createPasteEvent } from "../clipboard";
import { Excalidraw } from "../index"; import { Excalidraw } from "../index";

View file

@ -47,7 +47,7 @@ import { createTestHook } from "../../components/App";
import { getDefaultAppState } from "../../appState"; import { getDefaultAppState } from "../../appState";
import { GlobalTestState, createEvent, fireEvent, act } from "../test-utils"; 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 App from "../../components/App";
import type { AppState } from "../../types"; import type { AppState } from "../../types";

View file

@ -42,9 +42,12 @@ import {
actionSendBackward, actionSendBackward,
actionBringForward, actionBringForward,
actionSendToBack, actionSendToBack,
} from "../actions"; } from "../src/actions/index.js";
import { createUndoAction, createRedoAction } from "../actions/actionHistory"; import {
import { actionToggleViewMode } from "../actions/actionToggleViewMode"; createUndoAction,
createRedoAction,
} from "../src/actions/actionHistory.js";
import { actionToggleViewMode } from "../src/actions/actionToggleViewMode.js";
import { getDefaultAppState } from "../appState"; import { getDefaultAppState } from "../appState";
import { HistoryEntry } from "../history"; import { HistoryEntry } from "../history";
import { Excalidraw } from "../index"; import { Excalidraw } from "../index";

View file

@ -43,7 +43,7 @@ import type {
MakeBrand, MakeBrand,
} from "@excalidraw/common/utility-types"; } 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 { Spreadsheet } from "./charts";
import type { ClipboardData } from "./clipboard"; import type { ClipboardData } from "./clipboard";
import type App from "./components/App"; import type App from "./components/App";