Move remaining files into src

This commit is contained in:
Deepen Timalsina 2025-04-14 21:24:23 +05:45
parent 676e89f018
commit 85d4af2e3d
276 changed files with 451 additions and 463 deletions

View file

@ -4,7 +4,7 @@ import {
TTDDialogTrigger, TTDDialogTrigger,
CaptureUpdateAction, CaptureUpdateAction,
reconcileElements, reconcileElements,
} from "@excalidraw/excalidraw"; } from "@excalidraw/excalidraw/src";
import { trackEvent } from "@excalidraw/excalidraw/analytics"; import { trackEvent } from "@excalidraw/excalidraw/analytics";
import { getDefaultAppState } from "@excalidraw/excalidraw/appState"; import { getDefaultAppState } from "@excalidraw/excalidraw/appState";
import { import {
@ -31,11 +31,11 @@ import {
isRunningInIframe, isRunningInIframe,
isDevEnv, isDevEnv,
} from "@excalidraw/common"; } from "@excalidraw/common";
import polyfill from "@excalidraw/excalidraw/polyfill"; import polyfill from "@excalidraw/excalidraw/src/polyfill";
import { useCallback, useEffect, useRef, useState } from "react"; import { useCallback, useEffect, useRef, useState } from "react";
import { loadFromBlob } from "@excalidraw/excalidraw/data/blob"; import { loadFromBlob } from "@excalidraw/excalidraw/data/blob";
import { useCallbackRefState } from "@excalidraw/excalidraw/hooks/useCallbackRefState"; import { useCallbackRefState } from "@excalidraw/excalidraw/hooks/useCallbackRefState";
import { t } from "@excalidraw/excalidraw/i18n"; import { t } from "@excalidraw/excalidraw/src/i18n";
import { import {
GithubIcon, GithubIcon,
@ -70,7 +70,7 @@ import type {
BinaryFiles, BinaryFiles,
ExcalidrawInitialDataState, ExcalidrawInitialDataState,
UIAppState, UIAppState,
} from "@excalidraw/excalidraw/types"; } from "@excalidraw/excalidraw/src/types";
import type { ResolutionType } from "@excalidraw/common/utility-types"; import type { ResolutionType } from "@excalidraw/common/utility-types";
import type { ResolvablePromise } from "@excalidraw/common/utils"; import type { ResolvablePromise } from "@excalidraw/common/utils";

View file

@ -1,16 +1,16 @@
import { Stats } from "@excalidraw/excalidraw"; import { Stats } from "@excalidraw/excalidraw/src";
import { copyTextToSystemClipboard } from "@excalidraw/excalidraw/clipboard"; import { copyTextToSystemClipboard } from "@excalidraw/excalidraw/src/clipboard";
import { import {
DEFAULT_VERSION, DEFAULT_VERSION,
debounce, debounce,
getVersion, getVersion,
nFormatter, nFormatter,
} from "@excalidraw/common"; } from "@excalidraw/common";
import { t } from "@excalidraw/excalidraw/i18n"; import { t } from "@excalidraw/excalidraw/src/i18n";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types"; import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
import type { UIAppState } from "@excalidraw/excalidraw/types"; import type { UIAppState } from "@excalidraw/excalidraw/src/types";
import { import {
getElementsStorageSize, getElementsStorageSize,

View file

@ -1,12 +1,15 @@
import { base64urlToString } from "@excalidraw/excalidraw/data/encode"; import { base64urlToString } from "@excalidraw/excalidraw/data/encode";
import { ExcalidrawError } from "@excalidraw/excalidraw/errors"; import { ExcalidrawError } from "@excalidraw/excalidraw/src/errors";
import { useLayoutEffect, useRef } from "react"; import { useLayoutEffect, useRef } from "react";
import type { import type {
FileId, FileId,
OrderedExcalidrawElement, OrderedExcalidrawElement,
} from "@excalidraw/element/types"; } from "@excalidraw/element/types";
import type { AppState, BinaryFileData } from "@excalidraw/excalidraw/types"; import type {
AppState,
BinaryFileData,
} from "@excalidraw/excalidraw/src/types";
import { STORAGE_KEYS } from "./app_constants"; import { STORAGE_KEYS } from "./app_constants";
import { LocalData } from "./data/LocalData"; import { LocalData } from "./data/LocalData";

View file

@ -1,4 +1,4 @@
import { useI18n, languages } from "@excalidraw/excalidraw/i18n"; import { useI18n, languages } from "@excalidraw/excalidraw/src/i18n";
import React from "react"; import React from "react";
import { useSetAtom } from "../app-jotai"; import { useSetAtom } from "../app-jotai";

View file

@ -1,4 +1,4 @@
import { defaultLang, languages } from "@excalidraw/excalidraw"; import { defaultLang, languages } from "@excalidraw/excalidraw/src";
import LanguageDetector from "i18next-browser-languagedetector"; import LanguageDetector from "i18next-browser-languagedetector";
export const languageDetector = new LanguageDetector(); export const languageDetector = new LanguageDetector();

View file

@ -4,7 +4,7 @@ import {
restoreElements, restoreElements,
zoomToFitBounds, zoomToFitBounds,
reconcileElements, reconcileElements,
} from "@excalidraw/excalidraw"; } from "@excalidraw/excalidraw/src";
import { ErrorDialog } from "@excalidraw/excalidraw/components/ErrorDialog"; import { ErrorDialog } from "@excalidraw/excalidraw/components/ErrorDialog";
import { APP_NAME, EVENT } from "@excalidraw/common"; import { APP_NAME, EVENT } from "@excalidraw/common";
import { import {
@ -25,9 +25,9 @@ import {
isImageElement, isImageElement,
isInitializedImageElement, isInitializedImageElement,
} from "@excalidraw/element/typeChecks"; } from "@excalidraw/element/typeChecks";
import { AbortError } from "@excalidraw/excalidraw/errors"; import { AbortError } from "@excalidraw/excalidraw/src/errors";
import { t } from "@excalidraw/excalidraw/i18n"; import { t } from "@excalidraw/excalidraw/src/i18n";
import { withBatchedUpdates } from "@excalidraw/excalidraw/reactUtils"; import { withBatchedUpdates } from "@excalidraw/excalidraw/src/reactUtils";
import throttle from "lodash.throttle"; import throttle from "lodash.throttle";
import { PureComponent } from "react"; import { PureComponent } from "react";
@ -49,7 +49,7 @@ import type {
SocketId, SocketId,
Collaborator, Collaborator,
Gesture, Gesture,
} from "@excalidraw/excalidraw/types"; } from "@excalidraw/excalidraw/src/types";
import type { Mutable, ValueOf } from "@excalidraw/common/utility-types"; import type { Mutable, ValueOf } from "@excalidraw/common/utility-types";
import { appJotaiStore, atom } from "../app-jotai"; import { appJotaiStore, atom } from "../app-jotai";

View file

@ -1,4 +1,4 @@
import { CaptureUpdateAction } from "@excalidraw/excalidraw"; import { CaptureUpdateAction } from "@excalidraw/excalidraw/src";
import { trackEvent } from "@excalidraw/excalidraw/analytics"; import { trackEvent } from "@excalidraw/excalidraw/analytics";
import { encryptData } from "@excalidraw/excalidraw/data/encryption"; import { encryptData } from "@excalidraw/excalidraw/data/encryption";
import { newElementWith } from "@excalidraw/element/mutateElement"; import { newElementWith } from "@excalidraw/element/mutateElement";
@ -9,7 +9,7 @@ import type { OrderedExcalidrawElement } from "@excalidraw/element/types";
import type { import type {
OnUserFollowedPayload, OnUserFollowedPayload,
SocketId, SocketId,
} from "@excalidraw/excalidraw/types"; } from "@excalidraw/excalidraw/src/types";
import { WS_EVENTS, FILE_UPLOAD_TIMEOUT, WS_SUBTYPES } from "../app_constants"; import { WS_EVENTS, FILE_UPLOAD_TIMEOUT, WS_SUBTYPES } from "../app_constants";
import { isSyncableElement } from "../data"; import { isSyncableElement } from "../data";

View file

@ -4,11 +4,11 @@ import {
getTextFromElements, getTextFromElements,
MIME_TYPES, MIME_TYPES,
TTDDialog, TTDDialog,
} from "@excalidraw/excalidraw"; } from "@excalidraw/excalidraw/src";
import { getDataURL } from "@excalidraw/excalidraw/data/blob"; import { getDataURL } from "@excalidraw/excalidraw/data/blob";
import { safelyParseJSON } from "@excalidraw/common"; import { safelyParseJSON } from "@excalidraw/common";
import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/types"; import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/src/types";
export const AIComponents = ({ export const AIComponents = ({
excalidrawAPI, excalidrawAPI,

View file

@ -1,4 +1,4 @@
import { Footer } from "@excalidraw/excalidraw/index"; import { Footer } from "@excalidraw/excalidraw/src/index";
import React from "react"; import React from "react";
import { isExcalidrawPlusSignedUser } from "../app_constants"; import { isExcalidrawPlusSignedUser } from "../app_constants";

View file

@ -3,7 +3,7 @@ import {
ExcalLogo, ExcalLogo,
eyeIcon, eyeIcon,
} from "@excalidraw/excalidraw/components/icons"; } from "@excalidraw/excalidraw/components/icons";
import { MainMenu } from "@excalidraw/excalidraw/index"; import { MainMenu } from "@excalidraw/excalidraw/src/index";
import React from "react"; import React from "react";
import { isDevEnv } from "@excalidraw/common"; import { isDevEnv } from "@excalidraw/common";

View file

@ -1,7 +1,7 @@
import { loginIcon } from "@excalidraw/excalidraw/components/icons"; import { loginIcon } from "@excalidraw/excalidraw/components/icons";
import { POINTER_EVENTS } from "@excalidraw/common"; import { POINTER_EVENTS } from "@excalidraw/common";
import { useI18n } from "@excalidraw/excalidraw/i18n"; import { useI18n } from "@excalidraw/excalidraw/src/i18n";
import { WelcomeScreen } from "@excalidraw/excalidraw/index"; import { WelcomeScreen } from "@excalidraw/excalidraw/src/index";
import React from "react"; import React from "react";
import { isExcalidrawPlusSignedUser } from "../app_constants"; import { isExcalidrawPlusSignedUser } from "../app_constants";

View file

@ -7,7 +7,7 @@ import {
bootstrapCanvas, bootstrapCanvas,
getNormalizedCanvasDimensions, getNormalizedCanvasDimensions,
} from "@excalidraw/excalidraw/renderer/helpers"; } from "@excalidraw/excalidraw/renderer/helpers";
import { type AppState } from "@excalidraw/excalidraw/types"; import { type AppState } from "@excalidraw/excalidraw/src/types";
import { throttleRAF } from "@excalidraw/common"; import { throttleRAF } from "@excalidraw/common";
import { useCallback, useImperativeHandle, useRef } from "react"; import { useCallback, useImperativeHandle, useRef } from "react";
@ -18,7 +18,7 @@ import {
} from "@excalidraw/math"; } from "@excalidraw/math";
import { isCurve } from "@excalidraw/math/curve"; import { isCurve } from "@excalidraw/math/curve";
import type { DebugElement } from "@excalidraw/excalidraw/visualdebug"; import type { DebugElement } from "@excalidraw/excalidraw/src/visualdebug";
import type { Curve } from "@excalidraw/math"; import type { Curve } from "@excalidraw/math";

View file

@ -1,6 +1,6 @@
import { Tooltip } from "@excalidraw/excalidraw/components/Tooltip"; import { Tooltip } from "@excalidraw/excalidraw/components/Tooltip";
import { shield } from "@excalidraw/excalidraw/components/icons"; import { shield } from "@excalidraw/excalidraw/components/icons";
import { useI18n } from "@excalidraw/excalidraw/i18n"; import { useI18n } from "@excalidraw/excalidraw/src/i18n";
export const EncryptedIcon = () => { export const EncryptedIcon = () => {
const { t } = useI18n(); const { t } = useI18n();

View file

@ -13,7 +13,7 @@ import {
} from "@excalidraw/excalidraw/data/encryption"; } from "@excalidraw/excalidraw/data/encryption";
import { serializeAsJSON } from "@excalidraw/excalidraw/data/json"; import { serializeAsJSON } from "@excalidraw/excalidraw/data/json";
import { isInitializedImageElement } from "@excalidraw/element/typeChecks"; import { isInitializedImageElement } from "@excalidraw/element/typeChecks";
import { useI18n } from "@excalidraw/excalidraw/i18n"; import { useI18n } from "@excalidraw/excalidraw/src/i18n";
import type { import type {
FileId, FileId,
@ -23,7 +23,7 @@ import type {
AppState, AppState,
BinaryFileData, BinaryFileData,
BinaryFiles, BinaryFiles,
} from "@excalidraw/excalidraw/types"; } from "@excalidraw/excalidraw/src/types";
import { FILE_UPLOAD_MAX_BYTES } from "../app_constants"; import { FILE_UPLOAD_MAX_BYTES } from "../app_constants";
import { encodeFilesForUpload } from "../data/FileManager"; import { encodeFilesForUpload } from "../data/FileManager";

View file

@ -1,5 +1,5 @@
import Trans from "@excalidraw/excalidraw/components/Trans"; import Trans from "@excalidraw/excalidraw/components/Trans";
import { t } from "@excalidraw/excalidraw/i18n"; import { t } from "@excalidraw/excalidraw/src/i18n";
import * as Sentry from "@sentry/browser"; import * as Sentry from "@sentry/browser";
import React from "react"; import React from "react";

View file

@ -1,8 +1,8 @@
import { CaptureUpdateAction } from "@excalidraw/excalidraw"; import { CaptureUpdateAction } from "@excalidraw/excalidraw/src";
import { compressData } from "@excalidraw/excalidraw/data/encode"; import { compressData } from "@excalidraw/excalidraw/data/encode";
import { newElementWith } from "@excalidraw/element/mutateElement"; import { newElementWith } from "@excalidraw/element/mutateElement";
import { isInitializedImageElement } from "@excalidraw/element/typeChecks"; import { isInitializedImageElement } from "@excalidraw/element/typeChecks";
import { t } from "@excalidraw/excalidraw/i18n"; import { t } from "@excalidraw/excalidraw/src/i18n";
import type { import type {
ExcalidrawElement, ExcalidrawElement,
@ -15,7 +15,7 @@ import type {
BinaryFileMetadata, BinaryFileMetadata,
ExcalidrawImperativeAPI, ExcalidrawImperativeAPI,
BinaryFiles, BinaryFiles,
} from "@excalidraw/excalidraw/types"; } from "@excalidraw/excalidraw/src/types";
type FileVersion = Required<BinaryFileData>["version"]; type FileVersion = Required<BinaryFileData>["version"];

View file

@ -34,7 +34,7 @@ import type {
AppState, AppState,
BinaryFileData, BinaryFileData,
BinaryFiles, BinaryFiles,
} from "@excalidraw/excalidraw/types"; } from "@excalidraw/excalidraw/src/types";
import type { MaybePromise } from "@excalidraw/common/utility-types"; import type { MaybePromise } from "@excalidraw/common/utility-types";
import { SAVE_TO_LOCAL_STORAGE_TIMEOUT, STORAGE_KEYS } from "../app_constants"; import { SAVE_TO_LOCAL_STORAGE_TIMEOUT, STORAGE_KEYS } from "../app_constants";

View file

@ -1,4 +1,4 @@
import { reconcileElements } from "@excalidraw/excalidraw"; import { reconcileElements } from "@excalidraw/excalidraw/src";
import { MIME_TYPES } from "@excalidraw/common"; import { MIME_TYPES } from "@excalidraw/common";
import { decompressData } from "@excalidraw/excalidraw/data/encode"; import { decompressData } from "@excalidraw/excalidraw/data/encode";
import { import {
@ -28,7 +28,7 @@ import type {
BinaryFileData, BinaryFileData,
BinaryFileMetadata, BinaryFileMetadata,
DataURL, DataURL,
} from "@excalidraw/excalidraw/types"; } from "@excalidraw/excalidraw/src/types";
import { FILE_CACHE_MAX_AGE_SEC } from "../app_constants"; import { FILE_CACHE_MAX_AGE_SEC } from "../app_constants";

View file

@ -11,7 +11,7 @@ import { serializeAsJSON } from "@excalidraw/excalidraw/data/json";
import { restore } from "@excalidraw/excalidraw/data/restore"; import { restore } from "@excalidraw/excalidraw/data/restore";
import { isInvisiblySmallElement } from "@excalidraw/element/sizeHelpers"; import { isInvisiblySmallElement } from "@excalidraw/element/sizeHelpers";
import { isInitializedImageElement } from "@excalidraw/element/typeChecks"; import { isInitializedImageElement } from "@excalidraw/element/typeChecks";
import { t } from "@excalidraw/excalidraw/i18n"; import { t } from "@excalidraw/excalidraw/src/i18n";
import { bytesToHexString } from "@excalidraw/common"; import { bytesToHexString } from "@excalidraw/common";
import type { UserIdleState } from "@excalidraw/common"; import type { UserIdleState } from "@excalidraw/common";
@ -27,7 +27,7 @@ import type {
BinaryFileData, BinaryFileData,
BinaryFiles, BinaryFiles,
SocketId, SocketId,
} from "@excalidraw/excalidraw/types"; } from "@excalidraw/excalidraw/src/types";
import type { MakeBrand } from "@excalidraw/common/utility-types"; import type { MakeBrand } from "@excalidraw/common/utility-types";
import { import {

View file

@ -5,7 +5,7 @@ import {
import { clearElementsForLocalStorage } from "@excalidraw/element"; import { clearElementsForLocalStorage } from "@excalidraw/element";
import type { ExcalidrawElement } from "@excalidraw/element/types"; import type { ExcalidrawElement } from "@excalidraw/element/types";
import type { AppState } from "@excalidraw/excalidraw/types"; import type { AppState } from "@excalidraw/excalidraw/src/types";
import { STORAGE_KEYS } from "../app_constants"; import { STORAGE_KEYS } from "../app_constants";

View file

@ -1,5 +1,5 @@
import { trackEvent } from "@excalidraw/excalidraw/analytics"; import { trackEvent } from "@excalidraw/excalidraw/analytics";
import { copyTextToSystemClipboard } from "@excalidraw/excalidraw/clipboard"; import { copyTextToSystemClipboard } from "@excalidraw/excalidraw/src/clipboard";
import { Dialog } from "@excalidraw/excalidraw/components/Dialog"; import { Dialog } from "@excalidraw/excalidraw/components/Dialog";
import { FilledButton } from "@excalidraw/excalidraw/components/FilledButton"; import { FilledButton } from "@excalidraw/excalidraw/components/FilledButton";
import { TextField } from "@excalidraw/excalidraw/components/TextField"; import { TextField } from "@excalidraw/excalidraw/components/TextField";
@ -14,7 +14,7 @@ import {
} from "@excalidraw/excalidraw/components/icons"; } from "@excalidraw/excalidraw/components/icons";
import { useUIAppState } from "@excalidraw/excalidraw/context/ui-appState"; import { useUIAppState } from "@excalidraw/excalidraw/context/ui-appState";
import { useCopyStatus } from "@excalidraw/excalidraw/hooks/useCopiedIndicator"; import { useCopyStatus } from "@excalidraw/excalidraw/hooks/useCopiedIndicator";
import { useI18n } from "@excalidraw/excalidraw/i18n"; import { useI18n } from "@excalidraw/excalidraw/src/i18n";
import { KEYS, getFrame } from "@excalidraw/common"; import { KEYS, getFrame } from "@excalidraw/common";
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";

View file

@ -1,4 +1,4 @@
import { defaultLang } from "@excalidraw/excalidraw/i18n"; import { defaultLang } from "@excalidraw/excalidraw/src/i18n";
import { UI } from "@excalidraw/excalidraw/tests/helpers/ui"; import { UI } from "@excalidraw/excalidraw/tests/helpers/ui";
import { import {
screen, screen,

View file

@ -1,4 +1,7 @@
import { CaptureUpdateAction, newElementWith } from "@excalidraw/excalidraw"; import {
CaptureUpdateAction,
newElementWith,
} from "@excalidraw/excalidraw/src";
import { import {
createRedoAction, createRedoAction,
createUndoAction, createUndoAction,

View file

@ -1,4 +1,4 @@
import { THEME } from "@excalidraw/excalidraw"; import { THEME } from "@excalidraw/excalidraw/src";
import { EVENT, CODES, KEYS } from "@excalidraw/common"; import { EVENT, CODES, KEYS } from "@excalidraw/common";
import { useEffect, useLayoutEffect, useState } from "react"; import { useEffect, useLayoutEffect, useState } from "react";

View file

@ -2,7 +2,7 @@ import type {
ExcalidrawElement, ExcalidrawElement,
FontFamilyValues, FontFamilyValues,
} from "@excalidraw/element/types"; } 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"; import { COLOR_PALETTE } from "./colors";

View file

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

View file

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

View file

@ -5,7 +5,7 @@ import { ROUGHNESS, isTransparent, assertNever } from "@excalidraw/common";
import type { Mutable } from "@excalidraw/common/utility-types"; 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 type { ElementShapes } from "@excalidraw/excalidraw/src/scene/types";
import { import {

View file

@ -5,7 +5,7 @@ import { COLOR_PALETTE } from "@excalidraw/common";
import type { import type {
AppState, AppState,
EmbedsValidationStatus, EmbedsValidationStatus,
} from "@excalidraw/excalidraw/types"; } from "@excalidraw/excalidraw/src/types";
import type { import type {
ElementShape, ElementShape,
ElementShapes, 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 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"; import type { Mutable } from "@excalidraw/common/utility-types";

View file

@ -24,7 +24,7 @@ import type {
Radians, Radians,
} from "@excalidraw/math"; } 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"; import type { Mutable } from "@excalidraw/common/utility-types";

View file

@ -26,7 +26,7 @@ import type {
Radians, Radians,
} from "@excalidraw/math"; } from "@excalidraw/math";
import type { FrameNameBounds } from "@excalidraw/excalidraw/types"; import type { FrameNameBounds } from "@excalidraw/excalidraw/src/types";
import { getBoundTextShape, isPathALoop } from "./shapes"; import { getBoundTextShape, isPathALoop } from "./shapes";
import { getElementBounds } from "./bounds"; 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) => export const hasBackground = (type: ElementOrToolType) =>
type === "rectangle" || type === "rectangle" ||

View file

@ -9,7 +9,7 @@ import type {
NormalizedZoomValue, NormalizedZoomValue,
NullableGridSize, NullableGridSize,
PointerDownState, PointerDownState,
} from "@excalidraw/excalidraw/types"; } from "@excalidraw/excalidraw/src/types";
import type Scene from "@excalidraw/excalidraw/src/scene/Scene"; 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 { Mutable } from "@excalidraw/common/utility-types";
import type { AppState } from "@excalidraw/excalidraw/types"; import type { AppState } from "@excalidraw/excalidraw/src/types";
import { import {
getElementsInGroup, getElementsInGroup,

View file

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

View file

@ -4,7 +4,7 @@
import { ELEMENT_LINK_KEY, normalizeLink } from "@excalidraw/common"; 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"; import { elementsAreInSameGroup } from "./groups";

View file

@ -5,7 +5,7 @@ import {
getFontString, getFontString,
} from "@excalidraw/common"; } 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 type { MarkRequired } from "@excalidraw/common/utility-types";
import { newTextElement } from "./newElement"; import { newTextElement } from "./newElement";

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -19,7 +19,7 @@ import type { GlobalPoint } from "@excalidraw/math";
import type Scene from "@excalidraw/excalidraw/src/scene/Scene"; 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"; 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 { 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 { getElementAbsoluteCoords } from "./bounds";
import { import {

View file

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

View file

@ -26,7 +26,10 @@ import {
type GeometricShape, type GeometricShape,
} from "@excalidraw/utils/shape"; } 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 { shouldTestInside } from "./collision";
import { LinearElementEditor } from "./linearElementEditor"; 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"; import { getSelectedElements } from "./selection";

View file

@ -3,7 +3,7 @@ import {
viewportCoordsToSceneCoords, viewportCoordsToSceneCoords,
} from "@excalidraw/common"; } 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 { getCommonBounds, getElementBounds } from "./bounds";
import { mutateElement } from "./mutateElement"; import { mutateElement } from "./mutateElement";

View file

@ -10,7 +10,7 @@ import {
invariant, invariant,
} from "@excalidraw/common"; } 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"; import type { ExtractSetType } from "@excalidraw/common/utility-types";

View file

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

View file

@ -1,6 +1,6 @@
import { ROUNDNESS, assertNever } from "@excalidraw/common"; 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"; import type { MarkNonNullable } from "@excalidraw/common/utility-types";

View file

@ -1,6 +1,6 @@
import { arrayToMap, findIndex, findLastIndex } from "@excalidraw/common"; 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"; import type Scene from "@excalidraw/excalidraw/src/scene/Scene";

View file

@ -9,8 +9,8 @@ import {
actionAlignLeft, actionAlignLeft,
actionAlignRight, actionAlignRight,
} from "@excalidraw/excalidraw/actions"; } from "@excalidraw/excalidraw/actions";
import { defaultLang, setLanguage } from "@excalidraw/excalidraw/i18n"; import { defaultLang, setLanguage } from "@excalidraw/excalidraw/src/i18n";
import { Excalidraw } from "@excalidraw/excalidraw"; import { Excalidraw } from "@excalidraw/excalidraw/src";
import { API } from "@excalidraw/excalidraw/tests/helpers/api"; import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import { UI, Pointer, Keyboard } from "@excalidraw/excalidraw/tests/helpers/ui"; 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/actions/actionBoundText"; import { actionWrapTextInContainer } from "@excalidraw/excalidraw/actions/actionBoundText";
import { Excalidraw, isLinearElement } from "@excalidraw/excalidraw"; import { Excalidraw, isLinearElement } from "@excalidraw/excalidraw/src";
import { API } from "@excalidraw/excalidraw/tests/helpers/api"; import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import { UI, Pointer, Keyboard } from "@excalidraw/excalidraw/tests/helpers/ui"; import { UI, Pointer, Keyboard } from "@excalidraw/excalidraw/tests/helpers/ui";

View file

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

View file

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

View file

@ -1,6 +1,6 @@
import { KEYS, reseed } from "@excalidraw/common"; 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 { API } from "@excalidraw/excalidraw/tests/helpers/api";
import { UI, Keyboard, Pointer } from "@excalidraw/excalidraw/tests/helpers/ui"; import { UI, Keyboard, Pointer } from "@excalidraw/excalidraw/tests/helpers/ui";

View file

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

View file

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

View file

@ -8,7 +8,7 @@ import {
actionDuplicateSelection, actionDuplicateSelection,
} from "@excalidraw/excalidraw/actions"; } from "@excalidraw/excalidraw/actions";
import { Excalidraw } from "@excalidraw/excalidraw"; import { Excalidraw } from "@excalidraw/excalidraw/src";
import { API } from "@excalidraw/excalidraw/tests/helpers/api"; import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import { import {
@ -18,7 +18,7 @@ import {
unmountComponent, unmountComponent,
} from "@excalidraw/excalidraw/tests/test-utils"; } 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"; import { selectGroupsForSelectedElements } from "../src/groups";

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

@ -22,14 +22,14 @@ import {
CenterVerticallyIcon, CenterVerticallyIcon,
} from "../components/icons"; } from "../components/icons";
import { t } from "../../i18n"; import { t } from "../i18n";
import { isSomeElementSelected } from "../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

@ -38,17 +38,17 @@ import {
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 "../scene"; import { getNormalizedZoom } from "../scene";
import { centerScrollOn } from "../scene/scroll"; import { centerScrollOn } from "../scene/scroll";
import { getStateForZoom } from "../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,12 @@ import {
probablySupportsClipboardBlob, probablySupportsClipboardBlob,
probablySupportsClipboardWriteText, probablySupportsClipboardWriteText,
readSystemClipboard, readSystemClipboard,
} from "../../clipboard"; } from "../clipboard";
import { DuplicateIcon, cutIcon, pngIcon, svgIcon } from "../components/icons"; import { DuplicateIcon, cutIcon, pngIcon, svgIcon } from "../components/icons";
import { exportCanvas, prepareElementsForExport } from "../data/index"; 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 { actionDeleteSelected } from "./actionDeleteSelected";
import { register } from "./register"; import { register } from "./register";

View file

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

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

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

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

View file

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

@ -21,10 +21,10 @@ import { isImageFileHandle } from "../data/blob";
import { nativeFileSystemSupported } from "../data/filesystem"; import { nativeFileSystemSupported } from "../data/filesystem";
import { resaveAsImageWithScene } from "../data/resave"; import { resaveAsImageWithScene } from "../data/resave";
import { t } from "../../i18n"; import { t } from "../i18n";
import { getSelectedElements, isSomeElementSelected } from "../scene"; import { getSelectedElements, isSomeElementSelected } from "../scene";
import { getExportSize } from "../scene/export"; import { getExportSize } from "../scene/export";
import { CaptureUpdateAction } from "../../store"; import { CaptureUpdateAction } from "../store";
import "../components/ToolIcon.scss"; import "../components/ToolIcon.scss";

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

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

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

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

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

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

View file

@ -6,9 +6,9 @@ import { showSelectedShapeActions } from "@excalidraw/element/showSelectedShapeA
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../components/ToolButton";
import { HamburgerMenuIcon, HelpIconThin, palette } from "../components/icons"; 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"; 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

@ -124,7 +124,7 @@ import {
} 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,
@ -132,12 +132,12 @@ import {
getTargetElements, getTargetElements,
isSomeElementSelected, isSomeElementSelected,
} from "../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,7 +8,7 @@ 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";

View file

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

View file

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

@ -6,11 +6,11 @@ import {
} 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

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

@ -9,7 +9,7 @@ import type {
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 =

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