mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Move all remaining files in src
This commit is contained in:
parent
e75a7b45d6
commit
c48d847f62
524 changed files with 538 additions and 547 deletions
|
@ -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";
|
||||
|
||||
|
|
|
@ -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)[],
|
||||
|
|
|
@ -13,7 +13,7 @@ import type {
|
|||
ToolType,
|
||||
UnsubscribeCallback,
|
||||
Zoom,
|
||||
} from "@excalidraw/excalidraw/types";
|
||||
} from "@excalidraw/excalidraw/src/types";
|
||||
|
||||
import { COLOR_PALETTE } from "./colors";
|
||||
import {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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" ||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -8,7 +8,7 @@ import type {
|
|||
AppClassProperties,
|
||||
DataURL,
|
||||
BinaryFiles,
|
||||
} from "@excalidraw/excalidraw/types";
|
||||
} from "@excalidraw/excalidraw/src/types";
|
||||
|
||||
import { isInitializedImageElement } from "./typeChecks";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import type {
|
|||
ElementsPendingErasure,
|
||||
PendingExcalidrawElements,
|
||||
NormalizedZoomValue,
|
||||
} from "@excalidraw/excalidraw/types";
|
||||
} from "@excalidraw/excalidraw/src/types";
|
||||
|
||||
import type {
|
||||
StaticCanvasRenderConfig,
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { UIAppState } from "@excalidraw/excalidraw/types";
|
||||
import type { UIAppState } from "@excalidraw/excalidraw/src/types";
|
||||
|
||||
import { getSelectedElements } from "./selection";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ import type {
|
|||
Device,
|
||||
InteractiveCanvasAppState,
|
||||
Zoom,
|
||||
} from "@excalidraw/excalidraw/types";
|
||||
} from "@excalidraw/excalidraw/src/types";
|
||||
|
||||
import { getElementAbsoluteCoords } from "./bounds";
|
||||
import {
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { pointFrom } from "@excalidraw/math";
|
||||
|
||||
import { Excalidraw } from "@excalidraw/excalidraw";
|
||||
import { Excalidraw } from "@excalidraw/excalidraw/src";
|
||||
import {
|
||||
KEYS,
|
||||
getSizeFromPoints,
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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[],
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 = (
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
|
@ -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";
|
|
@ -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 = (
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import clsx from "clsx";
|
||||
import React, { useState } from "react";
|
||||
|
||||
import { getNameInitial } from "../../clients";
|
||||
import { getNameInitial } from "../clients";
|
||||
|
||||
import "./Avatar.scss";
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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
Loading…
Add table
Add a link
Reference in a new issue