Move all remaining files in src

This commit is contained in:
Deepen Timalsina 2025-04-15 20:54:26 +05:45
parent e75a7b45d6
commit c48d847f62
524 changed files with 538 additions and 547 deletions

View file

@ -2,7 +2,7 @@ import type {
ExcalidrawElement,
FontFamilyValues,
} from "@excalidraw/element/types";
import type { AppProps, AppState } from "@excalidraw/excalidraw/types";
import type { AppProps, AppState } from "@excalidraw/excalidraw/src/types";
import { COLOR_PALETTE } from "./colors";

View file

@ -4,7 +4,7 @@ import {
type LocalPoint,
} from "@excalidraw/math";
import type { NullableGridSize } from "@excalidraw/excalidraw/types";
import type { NullableGridSize } from "@excalidraw/excalidraw/src/types";
export const getSizeFromPoints = (
points: readonly (GlobalPoint | LocalPoint)[],

View file

@ -13,7 +13,7 @@ import type {
ToolType,
UnsubscribeCallback,
Zoom,
} from "@excalidraw/excalidraw/types";
} from "@excalidraw/excalidraw/src/types";
import { COLOR_PALETTE } from "./colors";
import {

View file

@ -5,7 +5,7 @@ import { ROUGHNESS, isTransparent, assertNever } from "@excalidraw/common";
import type { Mutable } from "@excalidraw/common/utility-types";
import type { EmbedsValidationStatus } from "@excalidraw/excalidraw/types";
import type { EmbedsValidationStatus } from "@excalidraw/excalidraw/src/types";
import type { ElementShapes } from "@excalidraw/excalidraw/src/scene/types";
import {

View file

@ -5,7 +5,7 @@ import { COLOR_PALETTE } from "@excalidraw/common";
import type {
AppState,
EmbedsValidationStatus,
} from "@excalidraw/excalidraw/types";
} from "@excalidraw/excalidraw/src/types";
import type {
ElementShape,
ElementShapes,

View file

@ -33,7 +33,7 @@ import type { LocalPoint, Radians } from "@excalidraw/math";
import type Scene from "@excalidraw/excalidraw/src/scene/Scene";
import type { AppState } from "@excalidraw/excalidraw/types";
import type { AppState } from "@excalidraw/excalidraw/src/types";
import type { Mutable } from "@excalidraw/common/utility-types";

View file

@ -24,7 +24,7 @@ import type {
Radians,
} from "@excalidraw/math";
import type { AppState } from "@excalidraw/excalidraw/types";
import type { AppState } from "@excalidraw/excalidraw/src/types";
import type { Mutable } from "@excalidraw/common/utility-types";

View file

@ -26,7 +26,7 @@ import type {
Radians,
} from "@excalidraw/math";
import type { FrameNameBounds } from "@excalidraw/excalidraw/types";
import type { FrameNameBounds } from "@excalidraw/excalidraw/src/types";
import { getBoundTextShape, isPathALoop } from "./shapes";
import { getElementBounds } from "./bounds";

View file

@ -1,4 +1,4 @@
import type { ElementOrToolType } from "@excalidraw/excalidraw/types";
import type { ElementOrToolType } from "@excalidraw/excalidraw/src/types";
export const hasBackground = (type: ElementOrToolType) =>
type === "rectangle" ||

View file

@ -9,7 +9,7 @@ import type {
NormalizedZoomValue,
NullableGridSize,
PointerDownState,
} from "@excalidraw/excalidraw/types";
} from "@excalidraw/excalidraw/src/types";
import type Scene from "@excalidraw/excalidraw/src/scene/Scene";

View file

@ -11,7 +11,7 @@ import {
import type { Mutable } from "@excalidraw/common/utility-types";
import type { AppState } from "@excalidraw/excalidraw/types";
import type { AppState } from "@excalidraw/excalidraw/src/types";
import {
getElementsInGroup,

View file

@ -22,7 +22,7 @@ import {
isDevEnv,
} from "@excalidraw/common";
import type { AppState } from "@excalidraw/excalidraw/types";
import type { AppState } from "@excalidraw/excalidraw/src/types";
import {
bindPointToSnapToElementOutline,

View file

@ -4,7 +4,7 @@
import { ELEMENT_LINK_KEY, normalizeLink } from "@excalidraw/common";
import type { AppProps, AppState } from "@excalidraw/excalidraw/types";
import type { AppProps, AppState } from "@excalidraw/excalidraw/src/types";
import { elementsAreInSameGroup } from "./groups";

View file

@ -5,7 +5,7 @@ import {
getFontString,
} from "@excalidraw/common";
import type { ExcalidrawProps } from "@excalidraw/excalidraw/types";
import type { ExcalidrawProps } from "@excalidraw/excalidraw/src/types";
import type { MarkRequired } from "@excalidraw/common/utility-types";
import { newTextElement } from "./newElement";

View file

@ -5,7 +5,7 @@ import { type GlobalPoint, pointFrom, type LocalPoint } from "@excalidraw/math";
import type {
AppState,
PendingExcalidrawElements,
} from "@excalidraw/excalidraw/types";
} from "@excalidraw/excalidraw/src/types";
import { bindLinearElement } from "./binding";
import { updateElbowArrowPoints } from "./elbowArrow";

View file

@ -9,7 +9,7 @@ import type {
AppClassProperties,
AppState,
StaticCanvasAppState,
} from "@excalidraw/excalidraw/types";
} from "@excalidraw/excalidraw/src/types";
import type { ReadonlySetLike } from "@excalidraw/common/utility-types";

View file

@ -2,7 +2,7 @@ import type {
AppClassProperties,
AppState,
InteractiveCanvasAppState,
} from "@excalidraw/excalidraw/types";
} from "@excalidraw/excalidraw/src/types";
import type { Mutable } from "@excalidraw/common/utility-types";
import { getBoundTextElement } from "./textElement";

View file

@ -8,7 +8,7 @@ import type {
AppClassProperties,
DataURL,
BinaryFiles,
} from "@excalidraw/excalidraw/types";
} from "@excalidraw/excalidraw/src/types";
import { isInitializedImageElement } from "./typeChecks";

View file

@ -24,7 +24,7 @@ import {
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
import Scene from "@excalidraw/excalidraw/src/scene/Scene";
import type { Store } from "@excalidraw/excalidraw/store";
import type { Store } from "@excalidraw/excalidraw/src/store";
import type { Radians } from "@excalidraw/math";
@ -35,7 +35,7 @@ import type {
AppClassProperties,
NullableGridSize,
Zoom,
} from "@excalidraw/excalidraw/types";
} from "@excalidraw/excalidraw/src/types";
import type { Mutable } from "@excalidraw/common/utility-types";

View file

@ -24,7 +24,7 @@ import type {
ElementsPendingErasure,
PendingExcalidrawElements,
NormalizedZoomValue,
} from "@excalidraw/excalidraw/types";
} from "@excalidraw/excalidraw/src/types";
import type {
StaticCanvasRenderConfig,

View file

@ -19,7 +19,7 @@ import type { GlobalPoint } from "@excalidraw/math";
import type Scene from "@excalidraw/excalidraw/src/scene/Scene";
import type { PointerDownState } from "@excalidraw/excalidraw/types";
import type { PointerDownState } from "@excalidraw/excalidraw/src/types";
import type { Mutable } from "@excalidraw/common/utility-types";

View file

@ -9,7 +9,7 @@ import { SIDE_RESIZING_THRESHOLD } from "@excalidraw/common";
import type { GlobalPoint, LineSegment, LocalPoint } from "@excalidraw/math";
import type { AppState, Device, Zoom } from "@excalidraw/excalidraw/types";
import type { AppState, Device, Zoom } from "@excalidraw/excalidraw/src/types";
import { getElementAbsoluteCoords } from "./bounds";
import {

View file

@ -3,7 +3,7 @@ import { isShallowEqual } from "@excalidraw/common";
import type {
AppState,
InteractiveCanvasAppState,
} from "@excalidraw/excalidraw/types";
} from "@excalidraw/excalidraw/src/types";
import { getElementAbsoluteCoords, getElementBounds } from "./bounds";
import { isElementInViewport } from "./sizeHelpers";

View file

@ -26,7 +26,10 @@ import {
type GeometricShape,
} from "@excalidraw/utils/shape";
import type { NormalizedZoomValue, Zoom } from "@excalidraw/excalidraw/types";
import type {
NormalizedZoomValue,
Zoom,
} from "@excalidraw/excalidraw/src/types";
import { shouldTestInside } from "./collision";
import { LinearElementEditor } from "./linearElementEditor";

View file

@ -1,4 +1,4 @@
import type { UIAppState } from "@excalidraw/excalidraw/types";
import type { UIAppState } from "@excalidraw/excalidraw/src/types";
import { getSelectedElements } from "./selection";

View file

@ -3,7 +3,7 @@ import {
viewportCoordsToSceneCoords,
} from "@excalidraw/common";
import type { AppState, Offsets, Zoom } from "@excalidraw/excalidraw/types";
import type { AppState, Offsets, Zoom } from "@excalidraw/excalidraw/src/types";
import { getCommonBounds, getElementBounds } from "./bounds";
import { mutateElement } from "./mutateElement";

View file

@ -10,7 +10,7 @@ import {
invariant,
} from "@excalidraw/common";
import type { AppState } from "@excalidraw/excalidraw/types";
import type { AppState } from "@excalidraw/excalidraw/src/types";
import type { ExtractSetType } from "@excalidraw/common/utility-types";

View file

@ -12,7 +12,7 @@ import type {
Device,
InteractiveCanvasAppState,
Zoom,
} from "@excalidraw/excalidraw/types";
} from "@excalidraw/excalidraw/src/types";
import { getElementAbsoluteCoords } from "./bounds";
import {

View file

@ -1,6 +1,6 @@
import { ROUNDNESS, assertNever } from "@excalidraw/common";
import type { ElementOrToolType } from "@excalidraw/excalidraw/types";
import type { ElementOrToolType } from "@excalidraw/excalidraw/src/types";
import type { MarkNonNullable } from "@excalidraw/common/utility-types";

View file

@ -1,6 +1,6 @@
import { arrayToMap, findIndex, findLastIndex } from "@excalidraw/common";
import type { AppState } from "@excalidraw/excalidraw/types";
import type { AppState } from "@excalidraw/excalidraw/src/types";
import type Scene from "@excalidraw/excalidraw/src/scene/Scene";

View file

@ -9,8 +9,8 @@ import {
actionAlignLeft,
actionAlignRight,
} from "@excalidraw/excalidraw/src/actions";
import { defaultLang, setLanguage } from "@excalidraw/excalidraw/i18n";
import { Excalidraw } from "@excalidraw/excalidraw";
import { defaultLang, setLanguage } from "@excalidraw/excalidraw/src/i18n";
import { Excalidraw } from "@excalidraw/excalidraw/src";
import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import { UI, Pointer, Keyboard } from "@excalidraw/excalidraw/tests/helpers/ui";

View file

@ -4,7 +4,7 @@ import { pointFrom } from "@excalidraw/math";
import { actionWrapTextInContainer } from "@excalidraw/excalidraw/src/actions/actionBoundText";
import { Excalidraw, isLinearElement } from "@excalidraw/excalidraw";
import { Excalidraw, isLinearElement } from "@excalidraw/excalidraw/src";
import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import { UI, Pointer, Keyboard } from "@excalidraw/excalidraw/tests/helpers/ui";

View file

@ -8,7 +8,7 @@ import {
isPrimitive,
} from "@excalidraw/common";
import { Excalidraw } from "@excalidraw/excalidraw";
import { Excalidraw } from "@excalidraw/excalidraw/src";
import { actionDuplicateSelection } from "@excalidraw/excalidraw/src/actions";

View file

@ -1,6 +1,6 @@
import { ARROW_TYPE } from "@excalidraw/common";
import { pointFrom } from "@excalidraw/math";
import { Excalidraw, mutateElement } from "@excalidraw/excalidraw";
import { Excalidraw, mutateElement } from "@excalidraw/excalidraw/src";
import Scene from "@excalidraw/excalidraw/src/scene/Scene";
import { actionSelectAll } from "@excalidraw/excalidraw/src/actions";

View file

@ -1,6 +1,6 @@
import { KEYS, reseed } from "@excalidraw/common";
import { Excalidraw } from "@excalidraw/excalidraw";
import { Excalidraw } from "@excalidraw/excalidraw/src";
import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import { UI, Keyboard, Pointer } from "@excalidraw/excalidraw/tests/helpers/ui";

View file

@ -1,7 +1,7 @@
import {
convertToExcalidrawElements,
Excalidraw,
} from "@excalidraw/excalidraw";
} from "@excalidraw/excalidraw/src";
import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import { Keyboard, Pointer } from "@excalidraw/excalidraw/tests/helpers/ui";

View file

@ -1,6 +1,6 @@
import { pointFrom } from "@excalidraw/math";
import { Excalidraw } from "@excalidraw/excalidraw";
import { Excalidraw } from "@excalidraw/excalidraw/src";
import {
KEYS,
getSizeFromPoints,

View file

@ -8,7 +8,7 @@ import {
actionDuplicateSelection,
} from "@excalidraw/excalidraw/src/actions";
import { Excalidraw } from "@excalidraw/excalidraw";
import { Excalidraw } from "@excalidraw/excalidraw/src";
import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import {
@ -18,7 +18,7 @@ import {
unmountComponent,
} from "@excalidraw/excalidraw/tests/test-utils";
import type { AppState } from "@excalidraw/excalidraw/types";
import type { AppState } from "@excalidraw/excalidraw/src/types";
import { selectGroupsForSelectedElements } from "../src/groups";

View file

@ -8,7 +8,7 @@
{
"patterns": [
{
"group": ["../../excalidraw", "../../../packages/excalidraw", "@excalidraw/excalidraw"],
"group": ["../../excalidraw", "../../../packages/excalidraw", "@excalidraw/excalidraw/src"],
"message": "Do not import from '@excalidraw/excalidraw' package anything but types, as this package must be independent.",
"allowTypeImports": true
}

View file

@ -86,13 +86,13 @@ Depending on the environment, this is how imports should look like with the `ESM
```ts
// excalidraw library with public API
import * as excalidrawLib from "@excalidraw/excalidraw";
import * as excalidrawLib from "@excalidraw/excalidraw/src";
// excalidraw react component
import { Excalidraw } from "@excalidraw/excalidraw";
import { Excalidraw } from "@excalidraw/excalidraw/src";
// excalidraw styles, usually auto-processed by the build tool (i.e. vite, next, etc.)
import "@excalidraw/excalidraw/index.css";
// excalidraw types (optional)
import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/types";
import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/src/types";
```
**Without bundler (Browser)**
@ -176,7 +176,7 @@ updateScene({ elements, appState, commitToHistory: true }); // A
updateScene({ elements, appState, commitToHistory: false }); // B
// after
import { CaptureUpdateAction } from "@excalidraw/excalidraw";
import { CaptureUpdateAction } from "@excalidraw/excalidraw/src";
updateScene({
elements,
appState,
@ -2020,7 +2020,7 @@ Check out the [release notes](https://github.com/excalidraw/excalidraw/releases/
#### BREAKING CHANGE
- `width/height` props have been removed. Instead now it takes `100%` of `width` and `height` of the container so you need to make sure the container in which you are rendering Excalidraw has non zero dimensions (It should have non zero width and height so Excalidraw can match the dimensions of containing block)
- Calculate offsets when excalidraw container resizes using resize observer api [#3374](https://github.com/excalidraw/excalidraw/pull/3374).
- Export types for the package so now it can be used with typescript [#3337](https://github.com/excalidraw/excalidraw/pull/3337). The types are available at `@excalidraw/excalidraw/types`.
- Export types for the package so now it can be used with typescript [#3337](https://github.com/excalidraw/excalidraw/pull/3337). The types are available at `@excalidraw/excalidraw/src/types`.
- Add `renderCustomStats` prop to render extra stats on host, and expose `setToastMessage` API via refs which can be used to show toast with custom message [#3360](https://github.com/excalidraw/excalidraw/pull/3360).
- Support passing a CSRF token when importing libraries to prevent prompting before installation. The token is passed from [https://libraries.excalidraw.com](https://libraries.excalidraw.com/) using the `token` URL key [#3329](https://github.com/excalidraw/excalidraw/pull/3329).
- #### BREAKING CHANGE

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

@ -22,14 +22,14 @@ import {
CenterVerticallyIcon,
} from "../components/icons";
import { t } from "../../i18n";
import { t } from "../i18n";
import { isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../../store";
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 { AppState } from "../../types";
import type { AppState } from "../types";
export const actionUnbindText = register({
name: "unbindText",

View file

@ -23,7 +23,7 @@ import {
getDefaultAppState,
isEraserActive,
isHandToolActive,
} from "../../appState";
} from "../appState";
import { ColorPicker } from "../components/ColorPicker/ColorPicker";
import { ToolButton } from "../components/ToolButton";
import { Tooltip } from "../components/Tooltip";
@ -38,17 +38,17 @@ import {
ZoomOutIcon,
ZoomResetIcon,
} from "../components/icons";
import { setCursor } from "../../cursor";
import { setCursor } from "../cursor";
import { t } from "../../i18n";
import { t } from "../i18n";
import { getNormalizedZoom } from "../scene";
import { centerScrollOn } from "../scene/scroll";
import { getStateForZoom } from "../scene/zoom";
import { CaptureUpdateAction } from "../../store";
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,12 @@ import {
probablySupportsClipboardBlob,
probablySupportsClipboardWriteText,
readSystemClipboard,
} from "../../clipboard";
} from "../clipboard";
import { DuplicateIcon, cutIcon, pngIcon, svgIcon } from "../components/icons";
import { exportCanvas, prepareElementsForExport } from "../data/index";
import { t } from "../../i18n";
import { t } from "../i18n";
import { CaptureUpdateAction } from "../../store";
import { CaptureUpdateAction } from "../store";
import { actionDeleteSelected } from "./actionDeleteSelected";
import { register } from "./register";

View file

@ -4,8 +4,8 @@ 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 { 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 { t } from "../i18n";
import { getSelectedElements, isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../../store";
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

@ -18,14 +18,14 @@ import {
DistributeVerticallyIcon,
} from "../components/icons";
import { t } from "../../i18n";
import { t } from "../i18n";
import { isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../../store";
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

@ -30,9 +30,9 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
import { ToolButton } from "../components/ToolButton";
import { DuplicateIcon } from "../components/icons";
import { t } from "../../i18n";
import { t } from "../i18n";
import { isSomeElementSelected } from "../scene";
import { CaptureUpdateAction } from "../../store";
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 { copyTextToSystemClipboard } from "../clipboard";
import { copyIcon, elementLinkIcon } from "../components/icons";
import { t } from "../../i18n";
import { t } from "../i18n";
import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { CaptureUpdateAction } from "../store";
import { register } from "./register";

View file

@ -9,7 +9,7 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
import { LockedIcon, UnlockedIcon } from "../components/icons";
import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../../store";
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

@ -21,10 +21,10 @@ import { isImageFileHandle } from "../data/blob";
import { nativeFileSystemSupported } from "../data/filesystem";
import { resaveAsImageWithScene } from "../data/resave";
import { t } from "../../i18n";
import { t } from "../i18n";
import { getSelectedElements, isSomeElementSelected } from "../scene";
import { getExportSize } from "../scene/export";
import { CaptureUpdateAction } from "../../store";
import { CaptureUpdateAction } from "../store";
import "../../src/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 { t } from "../i18n";
import { resetCursor } from "../cursor";
import { done } from "../components/icons";
import { ToolButton } from "../components/ToolButton";
import { CaptureUpdateAction } from "../../store";
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

@ -27,13 +27,13 @@ import type {
} from "@excalidraw/element/types";
import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../../store";
import { CaptureUpdateAction } from "../store";
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 { setCursorForShape } from "../cursor";
import { frameToolIcon } from "../components/icons";
import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../../store";
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

@ -37,14 +37,14 @@ import type {
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 { 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

@ -4,14 +4,14 @@ import type { SceneElementsMap } from "@excalidraw/element/types";
import { ToolButton } from "../components/ToolButton";
import { UndoIcon, RedoIcon } from "../components/icons";
import { HistoryChangedEvent } from "../../history";
import { HistoryChangedEvent } from "../history";
import { useEmitter } from "../hooks/useEmitter";
import { t } from "../../i18n";
import { CaptureUpdateAction } from "../../store";
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

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

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

View file

@ -6,9 +6,9 @@ import { showSelectedShapeActions } from "@excalidraw/element/showSelectedShapeA
import { ToolButton } from "../components/ToolButton";
import { HamburgerMenuIcon, HelpIconThin, palette } from "../components/icons";
import { t } from "../../i18n";
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 { getClientColor } from "../clients";
import { Avatar } from "../components/Avatar";
import {
eyeIcon,
microphoneIcon,
microphoneMutedIcon,
} from "../components/icons";
import { t } from "../../i18n";
import { CaptureUpdateAction } from "../../store";
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 { Collaborator } from "../types";
export const actionGoToCollaborator = register({
name: "goToCollaborator",

View file

@ -71,7 +71,7 @@ import type {
NonDeletedSceneElementsMap,
} from "@excalidraw/element/types";
import { trackEvent } from "../../analytics";
import { trackEvent } from "../analytics";
import { ButtonIconSelect } from "../components/ButtonIconSelect";
import { ColorPicker } from "../components/ColorPicker/ColorPicker";
import { FontPicker } from "../components/FontPicker/FontPicker";
@ -123,8 +123,8 @@ import {
ArrowheadCrowfootOneOrManyIcon,
} from "../components/icons";
import { Fonts } from "../../fonts";
import { getLanguage, t } from "../../i18n";
import { Fonts } from "../fonts";
import { getLanguage, t } from "../i18n";
import {
canHaveArrowheads,
getCommonAttributeOfSelectedElements,
@ -132,12 +132,12 @@ import {
getTargetElements,
isSomeElementSelected,
} from "../scene";
import { CaptureUpdateAction } from "../../store";
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,7 +8,7 @@ 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";

View file

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

View file

@ -6,11 +6,11 @@ import { measureText } from "@excalidraw/element/textMeasurements";
import { isTextElement } from "@excalidraw/element/typeChecks";
import { getSelectedElements } from "../scene";
import { CaptureUpdateAction } from "../../store";
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 { 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 { CaptureUpdateAction } from "../store";
import { register } from "./register";

View file

@ -6,11 +6,11 @@ import {
} from "@excalidraw/common";
import { searchIcon } from "../components/icons";
import { CaptureUpdateAction } from "../../store";
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 { 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 { 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 { CaptureUpdateAction } from "../store";
import { register } from "./register";

View file

@ -13,8 +13,8 @@ import {
SendBackwardIcon,
SendToBackIcon,
} 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

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

@ -10,7 +10,7 @@ import type { LaserPointerOptions } from "@excalidraw/laser-pointer";
import type { AnimationFrameHandler } from "./animation-frame-handler";
import type App from "./components/App";
import type { AppState } from "../types";
import type { AppState } from "./types";
export interface Trail {
start(container: SVGSVGElement): void;

View file

@ -6,9 +6,9 @@ import {
UserIdleState,
} from "@excalidraw/common";
import { roundRect } from "./src/renderer/roundRect";
import { roundRect } from "./renderer/roundRect";
import type { InteractiveCanvasRenderConfig } from "./src/scene/types";
import type { InteractiveCanvasRenderConfig } from "./scene/types";
import type {
Collaborator,
InteractiveCanvasAppState,

View file

@ -22,7 +22,7 @@ import type {
} from "@excalidraw/element/types";
import { ExcalidrawError } from "./errors";
import { createFile, isSupportedImageFileType } from "./src/data/blob";
import { createFile, isSupportedImageFileType } from "./data/blob";
import { tryParseSpreadsheet, VALID_SPREADSHEET } from "./charts";
import type { Spreadsheet } from "./charts";

View file

@ -33,10 +33,10 @@ import type {
import { actionToggleZenMode } from "../actions";
import { alignActionsPredicate } from "../actions/actionAlign";
import { trackEvent } from "../../analytics";
import { trackEvent } from "../analytics";
import { useTunnels } from "../context/tunnels";
import { t } from "../../i18n";
import { t } from "../i18n";
import {
canChangeRoundness,
canHaveArrowheads,
@ -65,12 +65,7 @@ import {
LassoIcon,
} from "./icons";
import type {
AppClassProperties,
AppProps,
UIAppState,
Zoom,
} from "../../types";
import type { AppClassProperties, AppProps, UIAppState, Zoom } from "../types";
import type { ActionManager } from "../actions/manager";
export const canChangeStrokeColor = (

View file

@ -1,6 +1,6 @@
import { actionClearCanvas } from "../actions";
import { atom, useAtom } from "../../editor-jotai";
import { t } from "../../i18n";
import { atom, useAtom } from "../editor-jotai";
import { t } from "../i18n";
import { useExcalidrawActionManager } from "./App";
import ConfirmDialog from "./ConfirmDialog";

View file

@ -379,26 +379,20 @@ import { actionToggleViewMode } from "../actions/actionToggleViewMode";
import { ActionManager } from "../actions/manager";
import { actions } from "../actions/register";
import { getShortcutFromShortcutName } from "../actions/shortcuts";
import { trackEvent } from "../../analytics";
import { trackEvent } from "../analytics";
import { AnimationFrameHandler } from "../animation-frame-handler";
import {
getDefaultAppState,
isEraserActive,
isHandToolActive,
} from "../../appState";
import { copyTextToSystemClipboard, parseClipboard } from "../../clipboard";
} from "../appState";
import { copyTextToSystemClipboard, parseClipboard } from "../clipboard";
import { exportCanvas, loadFromBlob } from "../data";
import Library, { distributeLibraryItemsOnSquareGrid } from "../data/library";
import { restore, restoreElements } from "../data/restore";
import { getCenter, getDistance } from "../../gesture";
import { History } from "../../history";
import {
defaultLang,
getLanguage,
languages,
setLanguage,
t,
} from "../../i18n";
import { getCenter, getDistance } from "../gesture";
import { History } from "../history";
import { defaultLang, getLanguage, languages, setLanguage, t } from "../i18n";
import {
calculateScrollCenter,
@ -434,9 +428,9 @@ import {
Hyperlink,
} from "./hyperlink/Hyperlink";
import { Fonts } from "../../fonts";
import { editorJotaiStore } from "../../editor-jotai";
import { ImageSceneDataError } from "../../errors";
import { Fonts } from "../fonts";
import { editorJotaiStore } from "../editor-jotai";
import { ImageSceneDataError } from "../errors";
import {
getSnapLinesAtPointer,
snapDraggedElements,
@ -448,7 +442,7 @@ import {
getReferenceSnapPoints,
SnapCache,
isGridModeEnabled,
} from "../../snapping";
} from "../snapping";
import { convertToExcalidrawElements } from "../data/transform";
import { Renderer } from "../scene/Renderer";
import {
@ -456,20 +450,17 @@ import {
setCursor,
resetCursor,
setCursorForShape,
} from "../../cursor";
import { Emitter } from "../../emitter";
} from "../cursor";
import { Emitter } from "../emitter";
import { ElementCanvasButtons } from "./ElementCanvasButtons";
import { Store, CaptureUpdateAction } from "../../store";
import { Store, CaptureUpdateAction } from "../store";
import { AnimatedTrail } from "../animated-trail";
import { LaserTrails } from "../../laser-trails";
import {
withBatchedUpdates,
withBatchedUpdatesThrottled,
} from "../../reactUtils";
import { LaserTrails } from "../laser-trails";
import { withBatchedUpdates, withBatchedUpdatesThrottled } from "../reactUtils";
import { textWysiwyg } from "../wysiwyg/textWysiwyg";
import { isOverScrollBars } from "../scene/scrollbars";
import { isMaybeMermaidDefinition } from "../../mermaid";
import { isMaybeMermaidDefinition } from "../mermaid";
import { LassoTrail } from "../lasso";
@ -499,7 +490,7 @@ import type {
ScrollBars,
} from "../scene/types";
import type { PastedMixedContent } from "../../clipboard";
import type { PastedMixedContent } from "../clipboard";
import type { ExportedElements } from "../data";
import type { ContextMenuItems } from "./ContextMenu";
import type { FileSystemHandle } from "../data/filesystem";
@ -532,7 +523,7 @@ import type {
GenerateDiagramToCode,
NullableGridSize,
Offsets,
} from "../../types";
} from "../types";
import type { RoughCanvas } from "roughjs/bin/canvas";
import type { Action, ActionResult } from "../actions/types";

View file

@ -1,7 +1,7 @@
import clsx from "clsx";
import React, { useState } from "react";
import { getNameInitial } from "../../clients";
import { getNameInitial } from "../clients";
import "./Avatar.scss";

View file

@ -3,8 +3,8 @@ import { useCallback, useEffect, useRef, useState } from "react";
import { KEYS, getShortcutKey } from "@excalidraw/common";
import { useAtom } from "../../../editor-jotai";
import { t } from "../../../i18n";
import { useAtom } from "../../editor-jotai";
import { t } from "../../i18n";
import { useDevice } from "../App";
import { activeEyeDropperAtom } from "../EyeDropper";
import { eyeDropperIcon } from "../icons";

View file

@ -12,8 +12,8 @@ import type { ColorTuple, ColorPaletteCustom } from "@excalidraw/common";
import type { ExcalidrawElement } from "@excalidraw/element/types";
import { useAtom } from "../../../editor-jotai";
import { t } from "../../../i18n";
import { useAtom } from "../../editor-jotai";
import { t } from "../../i18n";
import { useExcalidrawContainer } from "../App";
import { ButtonSeparator } from "../ButtonSeparator";
import { activeEyeDropperAtom } from "../EyeDropper";
@ -29,7 +29,7 @@ import "./ColorPicker.scss";
import type { ColorPickerType } from "./colorPickerUtils";
import type { AppState } from "../../../types";
import type { AppState } from "../../types";
const isValidColor = (color: string) => {
const style = new Option().style;

View file

@ -1,7 +1,7 @@
import clsx from "clsx";
import { useEffect, useRef } from "react";
import { useAtom } from "../../../editor-jotai";
import { useAtom } from "../../editor-jotai";
import HotkeyLabel from "./HotkeyLabel";
import { activeColorPickerSectionAtom } from "./colorPickerUtils";

View file

@ -12,8 +12,8 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
import type { ColorPaletteCustom } from "@excalidraw/common";
import { useAtom } from "../../../editor-jotai";
import { t } from "../../../i18n";
import { useAtom } from "../../editor-jotai";
import { t } from "../../i18n";
import { CustomColorList } from "./CustomColorList";
import PickerColorList from "./PickerColorList";

View file

@ -3,8 +3,8 @@ import { useEffect, useRef } from "react";
import type { ColorPaletteCustom } from "@excalidraw/common";
import { useAtom } from "../../../editor-jotai";
import { t } from "../../../i18n";
import { useAtom } from "../../editor-jotai";
import { t } from "../../i18n";
import HotkeyLabel from "./HotkeyLabel";
import {
@ -13,7 +13,7 @@ import {
getColorNameAndShadeFromColor,
} from "./colorPickerUtils";
import type { TranslationKeys } from "../../../i18n";
import type { TranslationKeys } from "../../i18n";
interface PickerColorListProps {
palette: ColorPaletteCustom;

View file

@ -3,8 +3,8 @@ import { useEffect, useRef } from "react";
import type { ColorPaletteCustom } from "@excalidraw/common";
import { useAtom } from "../../../editor-jotai";
import { t } from "../../../i18n";
import { useAtom } from "../../editor-jotai";
import { t } from "../../i18n";
import HotkeyLabel from "./HotkeyLabel";
import {

View file

@ -4,7 +4,7 @@ import type { ExcalidrawElement } from "@excalidraw/element/types";
import type { ColorPickerColor, ColorPaletteCustom } from "@excalidraw/common";
import { atom } from "../../../editor-jotai";
import { atom } from "../../editor-jotai";
export const getColorNameAndShadeFromColor = ({
palette,

View file

@ -23,11 +23,11 @@ import {
actionLinkToElement,
} from "../../actions/actionElementLink";
import { getShortcutFromShortcutName } from "../../actions/shortcuts";
import { trackEvent } from "../../../analytics";
import { trackEvent } from "../../analytics";
import { useUIAppState } from "../../context/ui-appState";
import { deburr } from "../../../deburr";
import { atom, useAtom, editorJotaiStore } from "../../../editor-jotai";
import { t } from "../../../i18n";
import { deburr } from "../../deburr";
import { atom, useAtom, editorJotaiStore } from "../../editor-jotai";
import { t } from "../../i18n";
import {
useApp,
useAppProps,
@ -62,9 +62,9 @@ import * as defaultItems from "./defaultCommandPaletteItems";
import "./CommandPalette.scss";
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 { TranslationKeys } from "../../../i18n";
import type { TranslationKeys } from "../../i18n";
import type { Action } from "../../actions/types";
const lastUsedPaletteItem = atom<CommandPaletteItem | null>(null);

View file

@ -1,6 +1,6 @@
import type { ActionManager } from "../../actions/manager";
import type { Action } from "../../actions/types";
import type { UIAppState } from "../../../types";
import type { UIAppState } from "../../types";
export type CommandPaletteItem = {
label: string;

View file

@ -1,7 +1,7 @@
import { flushSync } from "react-dom";
import { useSetAtom } from "../../editor-jotai";
import { t } from "../../i18n";
import { useSetAtom } from "../editor-jotai";
import { t } from "../i18n";
import { Dialog } from "./Dialog";
import DialogActionButton from "./DialogActionButton";

View file

@ -2,7 +2,7 @@ import clsx from "clsx";
import React from "react";
import { getShortcutFromShortcutName } from "../actions/shortcuts";
import { t } from "../../i18n";
import { t } from "../i18n";
import { useExcalidrawAppState, useExcalidrawElements } from "./App";
@ -14,7 +14,7 @@ import type { ActionManager } from "../actions/manager";
import type { ShortcutName } from "../actions/shortcuts";
import type { Action } from "../actions/types";
import type { TranslationKeys } from "../../i18n";
import type { TranslationKeys } from "../i18n";
export type ContextMenuItem = typeof CONTEXT_MENU_SEPARATOR | Action;

Some files were not shown because too many files have changed in this diff Show more