Move actions folder into src

This commit is contained in:
Deepen Timalsina 2025-04-14 21:01:33 +05:45
parent 01304aac49
commit ee3d81aa07
66 changed files with 237 additions and 225 deletions

View file

@ -72,7 +72,7 @@
"fix:other": "yarn prettier --write",
"fix": "yarn fix:other && yarn fix:code",
"locales-coverage": "node scripts/build-locales-coverage.js",
"locales-coverage:description": "node scripts/locales-coverage-description.js",
"locales-coverage:description": "node scripts/locales-cov+erage-description.js",
"prepare": "husky install",
"prettier": "prettier \"**/*.{css,scss,json,md,html,yml}\" --ignore-path=.eslintignore",
"autorelease": "node scripts/autorelease.js",

View file

@ -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 "../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,

View file

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

View file

@ -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 "../animation-frame-handler";
import {
@ -525,7 +528,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<AppClassProperties>(null!);
const AppPropsContext = React.createContext<AppProps>(null!);

View file

@ -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 "../../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<CommandPaletteItem | null>(null);

View file

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

View file

@ -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 = {

View file

@ -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";

View file

@ -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";

View file

@ -17,7 +17,7 @@ import {
actionChangeExportEmbedScene,
actionChangeExportScale,
actionChangeProjectName,
} from "../actions/actionExport";
} from "../src/actions/actionExport";
import { probablySupportsClipboardBlob } from "../clipboard";
import { prepareElementsForExport } from "../data";
import { canvasToBlob } from "../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";

View file

@ -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 "../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";

View file

@ -18,7 +18,7 @@ import { ShapeCache } from "@excalidraw/element/ShapeCache";
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
import Scene from "../scene/Scene";
import { actionToggleStats } from "../actions";
import { actionToggleStats } from "../src/actions";
import { trackEvent } from "../analytics";
import { isHandToolActive } from "../appState";
import { TunnelsContext, useInitializeTunnels } from "../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 {

View file

@ -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,

View file

@ -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";

View file

@ -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";

View file

@ -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 = {

View file

@ -1,6 +1,6 @@
import clsx from "clsx";
import { actionShortcuts } from "../../actions";
import { actionShortcuts } from "../../src/actions";
import { useTunnels } from "../../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 = ({

View file

@ -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 "../../context/ui-appState";
import { useSetAtom } from "../../editor-jotai";

View file

@ -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 "../../context/tunnels";
import { useUIAppState } from "../../context/ui-appState";
import { t, useI18n } from "../../i18n";

View file

@ -286,7 +286,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 "./data/transform";
export {
getCommonBounds,

View file

@ -130,6 +130,6 @@
"homepage": "https://github.com/excalidraw/excalidraw/tree/master/packages/excalidraw",
"scripts": {
"gen:types": "rm -rf types && tsc",
"build:esm": "rm -rf dist && node ../../scripts/buildPackage.js && yarn gen:types"
"build:esm": "cross-env rimraf dist && node ../../scripts/buildPackage.js && yarn gen:types"
}
}

View file

@ -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";

View file

@ -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 "../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,

View file

@ -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",

View file

@ -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 "../scene";
import { centerScrollOn } from "../scene/scroll";
import { getStateForZoom } from "../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",

View file

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

View file

@ -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";

View file

@ -22,15 +22,15 @@ import {
import type { ExcalidrawElement } from "@excalidraw/element/types";
import { t } from "../i18n";
import { getSelectedElements, isSomeElementSelected } from "../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[],

View file

@ -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 "../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);

View file

@ -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 "../scene";
import { CaptureUpdateAction } from "../store";
import { t } from "../../i18n";
import { isSomeElementSelected } from "../../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -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 "../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";

View file

@ -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 "../scene";
import { CaptureUpdateAction } from "../store";
import { getSelectedElements } from "../../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -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";

View file

@ -9,22 +9,22 @@ 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 "../data";
import { isImageFileHandle } from "../data/blob";
import { nativeFileSystemSupported } from "../data/filesystem";
import { resaveAsImageWithScene } from "../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 "../scene";
import { getExportSize } from "../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";

View file

@ -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",

View file

@ -26,14 +26,14 @@ import type {
NonDeletedSceneElementsMap,
} from "@excalidraw/element/types";
import { getSelectedElements } from "../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",

View file

@ -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 "../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,

View file

@ -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 "../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) {

View file

@ -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 "../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 = (

View file

@ -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";

View file

@ -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 "../scene";
import { CaptureUpdateAction } from "../store";
import { getSelectedElements } from "../../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -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";

View file

@ -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",

View file

@ -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 "../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;

View file

@ -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";

View file

@ -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 "../scene";
import { CaptureUpdateAction } from "../store";
import { t } from "../../i18n";
import { getSelectedElements } from "../../scene";
import { CaptureUpdateAction } from "../../store";
import { register } from "./register";

View file

@ -5,12 +5,12 @@ import { measureText } from "@excalidraw/element/textMeasurements";
import { isTextElement } from "@excalidraw/element/typeChecks";
import { getSelectedElements } from "../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",

View file

@ -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",

View file

@ -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";

View file

@ -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",

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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,

View file

@ -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";

View file

@ -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 =

View file

@ -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";

View file

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