Move all remaining files in src

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

View file

@ -5,7 +5,7 @@
**How to use** **How to use**
```js ```js
import { FONT_FAMILY } from "@excalidraw/excalidraw"; import { FONT_FAMILY } from "@excalidraw/excalidraw/src";
``` ```
`FONT_FAMILY` contains all the font families used in `Excalidraw`. The default families are the following: `FONT_FAMILY` contains all the font families used in `Excalidraw`. The default families are the following:
@ -23,7 +23,7 @@ Pre-selected family is `FONT_FAMILY.Excalifont`, unless it's overriden with `ini
**How to use** **How to use**
```js ```js
import { THEME } from "@excalidraw/excalidraw"; import { THEME } from "@excalidraw/excalidraw/src";
``` ```
`THEME` contains all the themes supported by `Excalidraw` as explained below `THEME` contains all the themes supported by `Excalidraw` as explained below
@ -42,5 +42,5 @@ Defaults to `THEME.LIGHT` unless passed in `initialData.appState.theme`
**How to use ** **How to use **
```js ```js
import { MIME_TYPES } from "@excalidraw/excalidraw"; import { MIME_TYPES } from "@excalidraw/excalidraw/src";
``` ```

View file

@ -25,7 +25,7 @@ convertToExcalidrawElements(
**_How to use_** **_How to use_**
```js ```js
import { convertToExcalidrawElements } from "@excalidraw/excalidraw"; import { convertToExcalidrawElements } from "@excalidraw/excalidraw/src";
``` ```
This function converts the Excalidraw Element Skeleton to excalidraw elements which could be then rendered on the canvas. Hence calling this function is necessary before passing it to APIs like [`initialData`](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/initialdata), [`updateScene`](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/excalidraw-api#updatescene) if you are using the Skeleton API This function converts the Excalidraw Element Skeleton to excalidraw elements which could be then rendered on the canvas. Hence calling this function is necessary before passing it to APIs like [`initialData`](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/initialdata), [`updateScene`](https://docs.excalidraw.com/docs/@excalidraw/excalidraw/api/props/excalidraw-api#updatescene) if you are using the Skeleton API

View file

@ -193,7 +193,7 @@ const onLinkOpen: ExcalidrawProps["onLinkOpen"] = useCallback(
Determines the `language` of the UI. It should be one of the [available language codes](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/i18n.ts#L14). Defaults to `en` (English). We also export default language and supported languages which you can import as shown below. Determines the `language` of the UI. It should be one of the [available language codes](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/i18n.ts#L14). Defaults to `en` (English). We also export default language and supported languages which you can import as shown below.
```js ```js
import { defaultLang, languages } from "@excalidraw/excalidraw"; import { defaultLang, languages } from "@excalidraw/excalidraw/src";
``` ```
| name | type | | name | type |

View file

@ -47,7 +47,7 @@ A function which returns the `width`, `height`, and optionally `scale` (defaults
**How to use** **How to use**
```js ```js
import { exportToCanvas } from "@excalidraw/excalidraw"; import { exportToCanvas } from "@excalidraw/excalidraw/src";
``` ```
This function returns the canvas with the exported elements, appState and dimensions. This function returns the canvas with the exported elements, appState and dimensions.
@ -122,7 +122,7 @@ exportToBlob(<br/>&nbsp;
**How to use** **How to use**
```js ```js
import { exportToBlob } from "@excalidraw/excalidraw"; import { exportToBlob } from "@excalidraw/excalidraw/src";
``` ```
Returns a promise which resolves with a [blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob). It internally uses [canvas.ToBlob](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob). Returns a promise which resolves with a [blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob). It internally uses [canvas.ToBlob](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob).
@ -181,7 +181,7 @@ exportToClipboard(<br/>&nbsp;
**How to use** **How to use**
```js ```js
import { exportToClipboard } from "@excalidraw/excalidraw"; import { exportToClipboard } from "@excalidraw/excalidraw/src";
``` ```
Copies the scene data in the specified format (determined by `type`) to clipboard. Copies the scene data in the specified format (determined by `type`) to clipboard.

View file

@ -14,7 +14,7 @@ restoreAppState(appState: <a href="https://github.com/excalidraw/excalidraw/blob
**_How to use_** **_How to use_**
```js ```js
import { restoreAppState } from "@excalidraw/excalidraw"; import { restoreAppState } from "@excalidraw/excalidraw/src";
``` ```
This function will make sure all the `keys` have appropriate `values` in [appState](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/types.ts#L95) and if any key is missing, it will be set to its `default` value. This function will make sure all the `keys` have appropriate `values` in [appState](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/types.ts#L95) and if any key is missing, it will be set to its `default` value.
@ -58,7 +58,7 @@ The extra optional parameter to configure restored elements. It has the followin
**_How to use_** **_How to use_**
```js ```js
import { restoreElements } from "@excalidraw/excalidraw"; import { restoreElements } from "@excalidraw/excalidraw/src";
``` ```
This function will make sure all properties of element is correctly set and if any attribute is missing, it will be set to its default value. This function will make sure all properties of element is correctly set and if any attribute is missing, it will be set to its default value.
@ -84,7 +84,7 @@ See [`restoreAppState()`](https://github.com/excalidraw/excalidraw/blob/master/p
**_How to use_** **_How to use_**
```js ```js
import { restore } from "@excalidraw/excalidraw"; import { restore } from "@excalidraw/excalidraw/src";
``` ```
This function makes sure elements and state is set to appropriate values and set to default value if not present. It is a combination of [restoreElements](#restoreelements) and [restoreAppState](#restoreappstate). This function makes sure elements and state is set to appropriate values and set to default value if not present. It is a combination of [restoreElements](#restoreelements) and [restoreAppState](#restoreappstate).
@ -101,7 +101,7 @@ defaultStatus: "published" | "unpublished")
**_How to use_** **_How to use_**
```js ```js
import { restoreLibraryItems } from "@excalidraw/excalidraw"; import { restoreLibraryItems } from "@excalidraw/excalidraw/src";
restoreLibraryItems(libraryItems, "unpublished"); restoreLibraryItems(libraryItems, "unpublished");
``` ```

View file

@ -24,7 +24,7 @@ serializeAsJSON(&#123;<br/>&nbsp;
**How to use** **How to use**
```js ```js
import { serializeAsJSON } from "@excalidraw/excalidraw"; import { serializeAsJSON } from "@excalidraw/excalidraw/src";
``` ```
### serializeLibraryAsJSON ### serializeLibraryAsJSON
@ -43,7 +43,7 @@ serializeLibraryAsJSON(
**How to use** **How to use**
```js ```js
import { serializeLibraryAsJSON } from "@excalidraw/excalidraw"; import { serializeLibraryAsJSON } from "@excalidraw/excalidraw/src";
``` ```
#### isInvisiblySmallElement #### isInvisiblySmallElement
@ -59,7 +59,7 @@ isInvisiblySmallElement(element: <a href="https://github.com/excalidraw/excalid
**How to use** **How to use**
```js ```js
import { isInvisiblySmallElement } from "@excalidraw/excalidraw"; import { isInvisiblySmallElement } from "@excalidraw/excalidraw/src";
``` ```
### loadFromBlob ### loadFromBlob
@ -69,7 +69,7 @@ This function loads the scene data from the blob (or file). If you pass `localAp
**How to use** **How to use**
```js ```js
import { loadFromBlob } from "@excalidraw/excalidraw"; import { loadFromBlob } from "@excalidraw/excalidraw/src";
const scene = await loadFromBlob(file, null, null); const scene = await loadFromBlob(file, null, null);
excalidrawAPI.updateScene(scene); excalidrawAPI.updateScene(scene);
@ -93,7 +93,7 @@ This function loads the library from the blob. Additonally takes `defaultStatus`
**How to use ** **How to use **
```js ```js
import { loadLibraryFromBlob } from "@excalidraw/excalidraw"; import { loadLibraryFromBlob } from "@excalidraw/excalidraw/src";
``` ```
**_Signature_** **_Signature_**
@ -115,7 +115,7 @@ Throws if blob doesn't contain valid `scene` data or `library` data.
**How to use** **How to use**
```js showLineNumbers ```js showLineNumbers
import { loadSceneOrLibraryFromBlob, MIME_TYPES } from "@excalidraw/excalidraw"; import { loadSceneOrLibraryFromBlob, MIME_TYPES } from "@excalidraw/excalidraw/src";
const contents = await loadSceneOrLibraryFromBlob(file, null, null); const contents = await loadSceneOrLibraryFromBlob(file, null, null);
if (contents.type === MIME_TYPES.excalidraw) { if (contents.type === MIME_TYPES.excalidraw) {
@ -143,7 +143,7 @@ This function returns the `free draw` svg path for the element.
**How to use** **How to use**
```js ```js
import { getFreeDrawSvgPath } from "@excalidraw/excalidraw"; import { getFreeDrawSvgPath } from "@excalidraw/excalidraw/src";
``` ```
**Signature** **Signature**
@ -159,7 +159,7 @@ This function returns true if the element is `linear` type (`arrow` |`line`) els
**How to use** **How to use**
```js ```js
import { isLinearElement } from "@excalidraw/excalidraw"; import { isLinearElement } from "@excalidraw/excalidraw/src";
``` ```
**Signature** **Signature**
@ -175,7 +175,7 @@ This function returns an array of `deleted` elements.
**How to use** **How to use**
```js ```js
import { getNonDeletedElements } from "@excalidraw/excalidraw"; import { getNonDeletedElements } from "@excalidraw/excalidraw/src";
``` ```
**Signature** **Signature**
@ -189,7 +189,7 @@ getNonDeletedElements(elements:<a href="https://github.com/excalidraw/excalidraw
This function merges two `LibraryItems` arrays, where unique items from `otherItems` are sorted first in the returned array. This function merges two `LibraryItems` arrays, where unique items from `otherItems` are sorted first in the returned array.
```js ```js
import { mergeLibraryItems } from "@excalidraw/excalidraw"; import { mergeLibraryItems } from "@excalidraw/excalidraw/src";
``` ```
**_Signature_** **_Signature_**
@ -208,7 +208,7 @@ Parses library parameters from URL if present (expects the `#addLibrary` hash ke
**How to use** **How to use**
```js ```js
import { parseLibraryTokensFromUrl } from "@excalidraw/excalidraw"; import { parseLibraryTokensFromUrl } from "@excalidraw/excalidraw/src";
``` ```
**Signature** **Signature**
@ -227,7 +227,7 @@ A hook that automatically imports library from url if `#addLibrary` hash key exi
**How to use** **How to use**
```js ```js
import { useHandleLibrary } from "@excalidraw/excalidraw"; import { useHandleLibrary } from "@excalidraw/excalidraw/src";
export const App = () => { export const App = () => {
// ... // ...
@ -259,7 +259,7 @@ getSceneVersion(elements: <a href="https://github.com/excalidraw/excalidraw/blo
**How to use** **How to use**
```js ```js
import { getSceneVersion } from "@excalidraw/excalidraw"; import { getSceneVersion } from "@excalidraw/excalidraw/src";
``` ```
### sceneCoordsToViewportCoords ### sceneCoordsToViewportCoords
@ -267,7 +267,7 @@ import { getSceneVersion } from "@excalidraw/excalidraw";
This function returns equivalent `viewport` coords for the provided `scene` coords in params. This function returns equivalent `viewport` coords for the provided `scene` coords in params.
```js ```js
import { sceneCoordsToViewportCoords } from "@excalidraw/excalidraw"; import { sceneCoordsToViewportCoords } from "@excalidraw/excalidraw/src";
``` ```
**_Signature_** **_Signature_**
@ -282,7 +282,7 @@ sceneCoordsToViewportCoords(&#123; sceneX: number, sceneY: number },<br/>&nbsp;
This function returns equivalent `scene` coords for the provided `viewport` coords in params. This function returns equivalent `scene` coords for the provided `viewport` coords in params.
```js ```js
import { viewportCoordsToSceneCoords } from "@excalidraw/excalidraw"; import { viewportCoordsToSceneCoords } from "@excalidraw/excalidraw/src";
``` ```
**_Signature_** **_Signature_**
@ -354,7 +354,7 @@ To help with localization, we export the following.
| `useI18n` | [`() => { langCode, t }`](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/i18n.ts#L15) | | `useI18n` | [`() => { langCode, t }`](https://github.com/excalidraw/excalidraw/blob/master/packages/excalidraw/i18n.ts#L15) |
```js ```js
import { defaultLang, languages, useI18n } from "@excalidraw/excalidraw"; import { defaultLang, languages, useI18n } from "@excalidraw/excalidraw/src";
``` ```
#### defaultLang #### defaultLang
@ -407,7 +407,7 @@ getCommonBounds(
**_How to use_** **_How to use_**
```js ```js
import { getCommonBounds } from "@excalidraw/excalidraw"; import { getCommonBounds } from "@excalidraw/excalidraw/src";
``` ```
### elementsOverlappingBBox ### elementsOverlappingBBox
@ -436,7 +436,7 @@ elementsOverlappingBBox(<br/>&nbsp;
**_How to use_** **_How to use_**
```js ```js
import { elementsOverlappingBBox } from "@excalidraw/excalidraw"; import { elementsOverlappingBBox } from "@excalidraw/excalidraw/src";
``` ```
### isElementInsideBBox ### isElementInsideBBox
@ -456,7 +456,7 @@ isElementInsideBBox(<br/>&nbsp;
**_How to use_** **_How to use_**
```js ```js
import { isElementInsideBBox } from "@excalidraw/excalidraw"; import { isElementInsideBBox } from "@excalidraw/excalidraw/src";
``` ```
### elementPartiallyOverlapsWithOrContainsBBox ### elementPartiallyOverlapsWithOrContainsBBox
@ -475,5 +475,5 @@ elementPartiallyOverlapsWithOrContainsBBox(<br/>&nbsp;
**_How to use_** **_How to use_**
```js ```js
import { elementPartiallyOverlapsWithOrContainsBBox } from "@excalidraw/excalidraw"; import { elementPartiallyOverlapsWithOrContainsBBox } from "@excalidraw/excalidraw/src";
``` ```

View file

@ -5,7 +5,7 @@
If you are using a module bundler (for instance, Webpack), you can import it as an ES6 module as shown below If you are using a module bundler (for instance, Webpack), you can import it as an ES6 module as shown below
```js ```js
import { Excalidraw } from "@excalidraw/excalidraw"; import { Excalidraw } from "@excalidraw/excalidraw/src";
``` ```
:::info :::info
@ -39,7 +39,7 @@ If you want to only import `Excalidraw` component you can do :point_down:
```jsx showLineNumbers ```jsx showLineNumbers
import dynamic from "next/dynamic"; import dynamic from "next/dynamic";
const Excalidraw = dynamic( const Excalidraw = dynamic(
async () => (await import("@excalidraw/excalidraw")).Excalidraw, async () => (await import("@excalidraw/excalidraw/src")).Excalidraw,
{ {
ssr: false, ssr: false,
}, },
@ -58,7 +58,7 @@ If you are using `pages router` then importing the wrapper dynamically would wor
```jsx showLineNumbers ```jsx showLineNumbers
"use client"; "use client";
import { Excalidraw, convertToExcalidrawElements } from "@excalidraw/excalidraw"; import { Excalidraw, convertToExcalidrawElements } from "@excalidraw/excalidraw/src";
import "@excalidraw/excalidraw/index.css"; import "@excalidraw/excalidraw/index.css";
@ -131,7 +131,7 @@ If you are using `pages router` then importing the wrapper dynamically would wor
{/* Link should be updated to point to the latest! */} {/* Link should be updated to point to the latest! */}
Here is a [source code](https://github.com/excalidraw/excalidraw/tree/master/examples/with-nextjs) for the example with app and pages router. You you can try it out [here](https://excalidraw-package-example-with-nextjs.vercel.app/). Here is a [source code](https://github.com/excalidraw/excalidraw/tree/master/examples/with-nextjs) for the example with app and pages router. You you can try it out [here](https://excalidraw-package-example-with-nextjs.vercel.app/).
The `types` are available at `@excalidraw/excalidraw/types`, check [CodeSandbox](https://codesandbox.io/p/sandbox/github/excalidraw/excalidraw/tree/master/examples/with-script-in-browser) example for details. The `types` are available at `@excalidraw/excalidraw/src/types`, check [CodeSandbox](https://codesandbox.io/p/sandbox/github/excalidraw/excalidraw/tree/master/examples/with-script-in-browser) example for details.
### Preact ### Preact

View file

@ -12,7 +12,7 @@ This API receives the mermaid syntax as the input, and resolves to skeleton Exca
```ts ```ts
import { parseMermaidToExcalidraw } from "@excalidraw/mermaid-to-excalidraw"; import { parseMermaidToExcalidraw } from "@excalidraw/mermaid-to-excalidraw";
import { convertToExcalidrawElements} from "@excalidraw/excalidraw" import { convertToExcalidrawElements} from "@excalidraw/excalidraw/src"
try { try {
const { elements, files } = await parseMermaidToExcalidraw(mermaidSyntax: string, { const { elements, files } = await parseMermaidToExcalidraw(mermaidSyntax: string, {
fontSize: number, fontSize: number,

View file

@ -20,7 +20,7 @@ Once the library is installed, its ready to use.
```js ```js
import { parseMermaidToExcalidraw } from "@excalidraw/mermaid-to-excalidraw"; import { parseMermaidToExcalidraw } from "@excalidraw/mermaid-to-excalidraw";
import { convertToExcalidrawElements} from "@excalidraw/excalidraw" import { convertToExcalidrawElements} from "@excalidraw/excalidraw/src"
try { try {
const { elements, files } = await parseMermaid(diagramDefinition, { const { elements, files } = await parseMermaid(diagramDefinition, {

View file

@ -30,7 +30,7 @@ const sidebars = {
}, },
{ {
type: "category", type: "category",
label: "@excalidraw/excalidraw", label: "@excalidraw/excalidraw/src",
collapsed: false, collapsed: false,
items: [ items: [
"@excalidraw/excalidraw/installation", "@excalidraw/excalidraw/installation",

View file

@ -7,7 +7,7 @@ import "@excalidraw/excalidraw/index.css";
let ExcalidrawComp = {}; let ExcalidrawComp = {};
if (ExecutionEnvironment.canUseDOM) { if (ExecutionEnvironment.canUseDOM) {
ExcalidrawComp = require("@excalidraw/excalidraw"); ExcalidrawComp = require("@excalidraw/excalidraw/src");
} }
const Excalidraw = React.forwardRef((props, ref) => { const Excalidraw = React.forwardRef((props, ref) => {
if (!window.EXCALIDRAW_ASSET_PATH) { if (!window.EXCALIDRAW_ASSET_PATH) {

View file

@ -1,6 +1,6 @@
"use client"; "use client";
import * as excalidrawLib from "@excalidraw/excalidraw"; import * as excalidrawLib from "@excalidraw/excalidraw/src";
import { Excalidraw } from "@excalidraw/excalidraw"; import { Excalidraw } from "@excalidraw/excalidraw/src";
import "@excalidraw/excalidraw/index.css"; import "@excalidraw/excalidraw/index.css";

View file

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
import type * as TExcalidraw from "@excalidraw/excalidraw"; import type * as TExcalidraw from "@excalidraw/excalidraw/src";
import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/types"; import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/src/types";
const COMMENT_SVG = ( const COMMENT_SVG = (
<svg <svg

View file

@ -8,7 +8,7 @@ import React, {
cloneElement, cloneElement,
} from "react"; } from "react";
import type * as TExcalidraw from "@excalidraw/excalidraw"; import type * as TExcalidraw from "@excalidraw/excalidraw/src";
import type { ImportedLibraryData } from "@excalidraw/excalidraw/data/types"; import type { ImportedLibraryData } from "@excalidraw/excalidraw/data/types";
import type { import type {
NonDeletedExcalidrawElement, NonDeletedExcalidrawElement,
@ -22,7 +22,7 @@ import type {
Gesture, Gesture,
LibraryItems, LibraryItems,
PointerDownState as ExcalidrawPointerDownState, PointerDownState as ExcalidrawPointerDownState,
} from "@excalidraw/excalidraw/types"; } from "@excalidraw/excalidraw/src/types";
import initialData from "../initialData"; import initialData from "../initialData";
import { import {

View file

@ -1,7 +1,7 @@
import React from "react"; import React from "react";
import type * as TExcalidraw from "@excalidraw/excalidraw"; import type * as TExcalidraw from "@excalidraw/excalidraw/src";
import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/types"; import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/src/types";
import CustomFooter from "./CustomFooter"; import CustomFooter from "./CustomFooter";

View file

@ -21,7 +21,7 @@
<div id="root"></div> <div id="root"></div>
<script type="module"> <script type="module">
import * as ExcalidrawLib from "@excalidraw/excalidraw"; import * as ExcalidrawLib from "@excalidraw/excalidraw/src";
console.log(ExcalidrawLib); console.log(ExcalidrawLib);
window.ExcalidrawLib = ExcalidrawLib; window.ExcalidrawLib = ExcalidrawLib;

View file

@ -3,7 +3,7 @@ import { createRoot } from "react-dom/client";
import "@excalidraw/excalidraw/index.css"; import "@excalidraw/excalidraw/index.css";
import type * as TExcalidraw from "@excalidraw/excalidraw"; import type * as TExcalidraw from "@excalidraw/excalidraw/src";
import App from "./components/ExampleApp"; import App from "./components/ExampleApp";

View file

@ -1,4 +1,4 @@
import { MIME_TYPES } from "@excalidraw/excalidraw"; import { MIME_TYPES } from "@excalidraw/excalidraw/src";
import { fileOpen as _fileOpen } from "browser-fs-access"; import { fileOpen as _fileOpen } from "browser-fs-access";
import { unstable_batchedUpdates } from "react-dom"; import { unstable_batchedUpdates } from "react-dom";

View file

@ -4,9 +4,9 @@ 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/src/analytics";
import { getDefaultAppState } from "@excalidraw/excalidraw/appState"; import { getDefaultAppState } from "@excalidraw/excalidraw/src/appState";
import { import {
CommandPalette, CommandPalette,
DEFAULT_CATEGORIES, DEFAULT_CATEGORIES,
@ -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/src/data/blob"; import { loadFromBlob } from "@excalidraw/excalidraw/src/data/blob";
import { useCallbackRefState } from "@excalidraw/excalidraw/src/hooks/useCallbackRefState"; import { useCallbackRefState } from "@excalidraw/excalidraw/src/hooks/useCallbackRefState";
import { t } from "@excalidraw/excalidraw/i18n"; import { t } from "@excalidraw/excalidraw/src/i18n";
import { import {
GithubIcon, GithubIcon,
@ -73,7 +73,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/src/data/encode"; import { base64urlToString } from "@excalidraw/excalidraw/src/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/src/components/ErrorDialog"; import { ErrorDialog } from "@excalidraw/excalidraw/src/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,5 +1,5 @@
import { CaptureUpdateAction } from "@excalidraw/excalidraw"; import { CaptureUpdateAction } from "@excalidraw/excalidraw/src";
import { trackEvent } from "@excalidraw/excalidraw/analytics"; import { trackEvent } from "@excalidraw/excalidraw/src/analytics";
import { encryptData } from "@excalidraw/excalidraw/src/data/encryption"; import { encryptData } from "@excalidraw/excalidraw/src/data/encryption";
import { newElementWith } from "@excalidraw/element/mutateElement"; import { newElementWith } from "@excalidraw/element/mutateElement";
import throttle from "lodash.throttle"; import throttle from "lodash.throttle";
@ -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/src/data/blob"; import { getDataURL } from "@excalidraw/excalidraw/src/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/src/components/icons"; } from "@excalidraw/excalidraw/src/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/src/components/icons"; import { loginIcon } from "@excalidraw/excalidraw/src/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/src/renderer/helpers"; } from "@excalidraw/excalidraw/src/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";

View file

@ -1,6 +1,6 @@
import { Tooltip } from "@excalidraw/excalidraw/src/components/Tooltip"; import { Tooltip } from "@excalidraw/excalidraw/src/components/Tooltip";
import { shield } from "@excalidraw/excalidraw/src/components/icons"; import { shield } from "@excalidraw/excalidraw/src/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

@ -2,7 +2,7 @@ import React from "react";
import { uploadBytes, ref } from "firebase/storage"; import { uploadBytes, ref } from "firebase/storage";
import { nanoid } from "nanoid"; import { nanoid } from "nanoid";
import { trackEvent } from "@excalidraw/excalidraw/analytics"; import { trackEvent } from "@excalidraw/excalidraw/src/analytics";
import { Card } from "@excalidraw/excalidraw/src/components/Card"; import { Card } from "@excalidraw/excalidraw/src/components/Card";
import { ExcalidrawLogo } from "@excalidraw/excalidraw/src/components/ExcalidrawLogo"; import { ExcalidrawLogo } from "@excalidraw/excalidraw/src/components/ExcalidrawLogo";
import { ToolButton } from "@excalidraw/excalidraw/src/components/ToolButton"; import { ToolButton } from "@excalidraw/excalidraw/src/components/ToolButton";
@ -13,7 +13,7 @@ import {
} from "@excalidraw/excalidraw/src/data/encryption"; } from "@excalidraw/excalidraw/src/data/encryption";
import { serializeAsJSON } from "@excalidraw/excalidraw/src/data/json"; import { serializeAsJSON } from "@excalidraw/excalidraw/src/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/src/components/Trans"; import Trans from "@excalidraw/excalidraw/src/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/src/data/encode"; import { compressData } from "@excalidraw/excalidraw/src/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

@ -10,7 +10,7 @@
* (localStorage, indexedDB). * (localStorage, indexedDB).
*/ */
import { clearAppStateForLocalStorage } from "@excalidraw/excalidraw/appState"; import { clearAppStateForLocalStorage } from "@excalidraw/excalidraw/src/appState";
import { import {
CANVAS_SEARCH_TAB, CANVAS_SEARCH_TAB,
DEFAULT_SIDEBAR, DEFAULT_SIDEBAR,
@ -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/src/data/encode"; import { decompressData } from "@excalidraw/excalidraw/src/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/src/data/json";
import { restore } from "@excalidraw/excalidraw/src/data/restore"; import { restore } from "@excalidraw/excalidraw/src/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

@ -1,11 +1,11 @@
import { import {
clearAppStateForLocalStorage, clearAppStateForLocalStorage,
getDefaultAppState, getDefaultAppState,
} from "@excalidraw/excalidraw/appState"; } from "@excalidraw/excalidraw/src/appState";
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/src/analytics";
import { copyTextToSystemClipboard } from "@excalidraw/excalidraw/clipboard"; import { copyTextToSystemClipboard } from "@excalidraw/excalidraw/src/clipboard";
import { Dialog } from "@excalidraw/excalidraw/src/components/Dialog"; import { Dialog } from "@excalidraw/excalidraw/src/components/Dialog";
import { FilledButton } from "@excalidraw/excalidraw/src/components/FilledButton"; import { FilledButton } from "@excalidraw/excalidraw/src/components/FilledButton";
import { TextField } from "@excalidraw/excalidraw/src/components/TextField"; import { TextField } from "@excalidraw/excalidraw/src/components/TextField";
@ -14,7 +14,7 @@ import {
} from "@excalidraw/excalidraw/src/components/icons"; } from "@excalidraw/excalidraw/src/components/icons";
import { useUIAppState } from "@excalidraw/excalidraw/src/context/ui-appState"; import { useUIAppState } from "@excalidraw/excalidraw/src/context/ui-appState";
import { useCopyStatus } from "@excalidraw/excalidraw/src/hooks/useCopiedIndicator"; import { useCopyStatus } from "@excalidraw/excalidraw/src/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/src/actions"; } from "@excalidraw/excalidraw/src/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/src/actions/actionBoundText"; 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 { 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/src/actions"; import { actionDuplicateSelection } from "@excalidraw/excalidraw/src/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/src/scene/Scene"; import Scene from "@excalidraw/excalidraw/src/scene/Scene";
import { actionSelectAll } from "@excalidraw/excalidraw/src/actions"; import { actionSelectAll } from "@excalidraw/excalidraw/src/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/src/actions"; } 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 { 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

@ -8,7 +8,7 @@
{ {
"patterns": [ "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.", "message": "Do not import from '@excalidraw/excalidraw' package anything but types, as this package must be independent.",
"allowTypeImports": true "allowTypeImports": true
} }

View file

@ -86,13 +86,13 @@ Depending on the environment, this is how imports should look like with the `ESM
```ts ```ts
// excalidraw library with public API // excalidraw library with public API
import * as excalidrawLib from "@excalidraw/excalidraw"; import * as excalidrawLib from "@excalidraw/excalidraw/src";
// excalidraw react component // 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.) // excalidraw styles, usually auto-processed by the build tool (i.e. vite, next, etc.)
import "@excalidraw/excalidraw/index.css"; import "@excalidraw/excalidraw/index.css";
// excalidraw types (optional) // excalidraw types (optional)
import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/types"; import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/src/types";
``` ```
**Without bundler (Browser)** **Without bundler (Browser)**
@ -176,7 +176,7 @@ updateScene({ elements, appState, commitToHistory: true }); // A
updateScene({ elements, appState, commitToHistory: false }); // B updateScene({ elements, appState, commitToHistory: false }); // B
// after // after
import { CaptureUpdateAction } from "@excalidraw/excalidraw"; import { CaptureUpdateAction } from "@excalidraw/excalidraw/src";
updateScene({ updateScene({
elements, elements,
appState, appState,
@ -2020,7 +2020,7 @@ Check out the [release notes](https://github.com/excalidraw/excalidraw/releases/
#### BREAKING CHANGE #### 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) - `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). - 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). - 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). - 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 - #### BREAKING CHANGE

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

@ -23,7 +23,7 @@ import {
getDefaultAppState, getDefaultAppState,
isEraserActive, isEraserActive,
isHandToolActive, isHandToolActive,
} from "../../appState"; } from "../appState";
import { ColorPicker } from "../components/ColorPicker/ColorPicker"; import { ColorPicker } from "../components/ColorPicker/ColorPicker";
import { ToolButton } from "../components/ToolButton"; import { ToolButton } from "../components/ToolButton";
import { Tooltip } from "../components/Tooltip"; import { Tooltip } from "../components/Tooltip";
@ -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 "../../src/components/ToolIcon.scss"; import "../../src/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

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

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