diff --git a/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx b/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx
index 36fbfa758..6a8c8190a 100644
--- a/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx
+++ b/dev-docs/docs/@excalidraw/excalidraw/api/constants.mdx
@@ -5,7 +5,7 @@
**How to use**
```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:
@@ -23,7 +23,7 @@ Pre-selected family is `FONT_FAMILY.Excalifont`, unless it's overriden with `ini
**How to use**
```js
-import { THEME } from "@excalidraw/excalidraw";
+import { THEME } from "@excalidraw/excalidraw/src";
```
`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 **
```js
-import { MIME_TYPES } from "@excalidraw/excalidraw";
+import { MIME_TYPES } from "@excalidraw/excalidraw/src";
```
diff --git a/dev-docs/docs/@excalidraw/excalidraw/api/excalidraw-element-skeleton.mdx b/dev-docs/docs/@excalidraw/excalidraw/api/excalidraw-element-skeleton.mdx
index b633236aa..633a908a5 100644
--- a/dev-docs/docs/@excalidraw/excalidraw/api/excalidraw-element-skeleton.mdx
+++ b/dev-docs/docs/@excalidraw/excalidraw/api/excalidraw-element-skeleton.mdx
@@ -25,7 +25,7 @@ convertToExcalidrawElements(
**_How to use_**
```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
diff --git a/dev-docs/docs/@excalidraw/excalidraw/api/props/props.mdx b/dev-docs/docs/@excalidraw/excalidraw/api/props/props.mdx
index 5c2a5501b..35ee9e87e 100644
--- a/dev-docs/docs/@excalidraw/excalidraw/api/props/props.mdx
+++ b/dev-docs/docs/@excalidraw/excalidraw/api/props/props.mdx
@@ -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.
```js
-import { defaultLang, languages } from "@excalidraw/excalidraw";
+import { defaultLang, languages } from "@excalidraw/excalidraw/src";
```
| name | type |
diff --git a/dev-docs/docs/@excalidraw/excalidraw/api/utils/export.mdx b/dev-docs/docs/@excalidraw/excalidraw/api/utils/export.mdx
index 6337fe7ac..e7ed88659 100644
--- a/dev-docs/docs/@excalidraw/excalidraw/api/utils/export.mdx
+++ b/dev-docs/docs/@excalidraw/excalidraw/api/utils/export.mdx
@@ -47,7 +47,7 @@ A function which returns the `width`, `height`, and optionally `scale` (defaults
**How to use**
```js
-import { exportToCanvas } from "@excalidraw/excalidraw";
+import { exportToCanvas } from "@excalidraw/excalidraw/src";
```
This function returns the canvas with the exported elements, appState and dimensions.
@@ -122,7 +122,7 @@ exportToBlob(
**How to use**
```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).
@@ -181,7 +181,7 @@ exportToClipboard(
**How to use**
```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.
diff --git a/dev-docs/docs/@excalidraw/excalidraw/api/utils/restore.mdx b/dev-docs/docs/@excalidraw/excalidraw/api/utils/restore.mdx
index 2b4df2ccf..b5cf8d0e6 100644
--- a/dev-docs/docs/@excalidraw/excalidraw/api/utils/restore.mdx
+++ b/dev-docs/docs/@excalidraw/excalidraw/api/utils/restore.mdx
@@ -14,7 +14,7 @@ restoreAppState(appState:
**How to use**
```js
-import { serializeAsJSON } from "@excalidraw/excalidraw";
+import { serializeAsJSON } from "@excalidraw/excalidraw/src";
```
### serializeLibraryAsJSON
@@ -43,7 +43,7 @@ serializeLibraryAsJSON(
**How to use**
```js
-import { serializeLibraryAsJSON } from "@excalidraw/excalidraw";
+import { serializeLibraryAsJSON } from "@excalidraw/excalidraw/src";
```
#### isInvisiblySmallElement
@@ -59,7 +59,7 @@ isInvisiblySmallElement(element: {
// ...
@@ -259,7 +259,7 @@ getSceneVersion(elements:
This function returns equivalent `scene` coords for the provided `viewport` coords in params.
```js
-import { viewportCoordsToSceneCoords } from "@excalidraw/excalidraw";
+import { viewportCoordsToSceneCoords } from "@excalidraw/excalidraw/src";
```
**_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) |
```js
-import { defaultLang, languages, useI18n } from "@excalidraw/excalidraw";
+import { defaultLang, languages, useI18n } from "@excalidraw/excalidraw/src";
```
#### defaultLang
@@ -407,7 +407,7 @@ getCommonBounds(
**_How to use_**
```js
-import { getCommonBounds } from "@excalidraw/excalidraw";
+import { getCommonBounds } from "@excalidraw/excalidraw/src";
```
### elementsOverlappingBBox
@@ -436,7 +436,7 @@ elementsOverlappingBBox(
**_How to use_**
```js
-import { elementsOverlappingBBox } from "@excalidraw/excalidraw";
+import { elementsOverlappingBBox } from "@excalidraw/excalidraw/src";
```
### isElementInsideBBox
@@ -456,7 +456,7 @@ isElementInsideBBox(
**_How to use_**
```js
-import { isElementInsideBBox } from "@excalidraw/excalidraw";
+import { isElementInsideBBox } from "@excalidraw/excalidraw/src";
```
### elementPartiallyOverlapsWithOrContainsBBox
@@ -475,5 +475,5 @@ elementPartiallyOverlapsWithOrContainsBBox(
**_How to use_**
```js
-import { elementPartiallyOverlapsWithOrContainsBBox } from "@excalidraw/excalidraw";
+import { elementPartiallyOverlapsWithOrContainsBBox } from "@excalidraw/excalidraw/src";
```
diff --git a/dev-docs/docs/@excalidraw/excalidraw/integration.mdx b/dev-docs/docs/@excalidraw/excalidraw/integration.mdx
index 117877b75..0f288c9ed 100644
--- a/dev-docs/docs/@excalidraw/excalidraw/integration.mdx
+++ b/dev-docs/docs/@excalidraw/excalidraw/integration.mdx
@@ -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
```js
-import { Excalidraw } from "@excalidraw/excalidraw";
+import { Excalidraw } from "@excalidraw/excalidraw/src";
```
:::info
@@ -39,7 +39,7 @@ If you want to only import `Excalidraw` component you can do :point_down:
```jsx showLineNumbers
import dynamic from "next/dynamic";
const Excalidraw = dynamic(
- async () => (await import("@excalidraw/excalidraw")).Excalidraw,
+ async () => (await import("@excalidraw/excalidraw/src")).Excalidraw,
{
ssr: false,
},
@@ -58,7 +58,7 @@ If you are using `pages router` then importing the wrapper dynamically would wor
```jsx showLineNumbers
"use client";
- import { Excalidraw, convertToExcalidrawElements } from "@excalidraw/excalidraw";
+ import { Excalidraw, convertToExcalidrawElements } from "@excalidraw/excalidraw/src";
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! */}
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
diff --git a/dev-docs/docs/@excalidraw/mermaid-to-excalidraw/api.mdx b/dev-docs/docs/@excalidraw/mermaid-to-excalidraw/api.mdx
index f3212b43e..3a2813076 100644
--- a/dev-docs/docs/@excalidraw/mermaid-to-excalidraw/api.mdx
+++ b/dev-docs/docs/@excalidraw/mermaid-to-excalidraw/api.mdx
@@ -12,7 +12,7 @@ This API receives the mermaid syntax as the input, and resolves to skeleton Exca
```ts
import { parseMermaidToExcalidraw } from "@excalidraw/mermaid-to-excalidraw";
-import { convertToExcalidrawElements} from "@excalidraw/excalidraw"
+import { convertToExcalidrawElements} from "@excalidraw/excalidraw/src"
try {
const { elements, files } = await parseMermaidToExcalidraw(mermaidSyntax: string, {
fontSize: number,
diff --git a/dev-docs/docs/@excalidraw/mermaid-to-excalidraw/installation.mdx b/dev-docs/docs/@excalidraw/mermaid-to-excalidraw/installation.mdx
index 1860fdf63..74f407ca5 100644
--- a/dev-docs/docs/@excalidraw/mermaid-to-excalidraw/installation.mdx
+++ b/dev-docs/docs/@excalidraw/mermaid-to-excalidraw/installation.mdx
@@ -20,7 +20,7 @@ Once the library is installed, its ready to use.
```js
import { parseMermaidToExcalidraw } from "@excalidraw/mermaid-to-excalidraw";
-import { convertToExcalidrawElements} from "@excalidraw/excalidraw"
+import { convertToExcalidrawElements} from "@excalidraw/excalidraw/src"
try {
const { elements, files } = await parseMermaid(diagramDefinition, {
diff --git a/dev-docs/sidebars.js b/dev-docs/sidebars.js
index 8510ef135..7ee21ba2c 100644
--- a/dev-docs/sidebars.js
+++ b/dev-docs/sidebars.js
@@ -30,7 +30,7 @@ const sidebars = {
},
{
type: "category",
- label: "@excalidraw/excalidraw",
+ label: "@excalidraw/excalidraw/src",
collapsed: false,
items: [
"@excalidraw/excalidraw/installation",
diff --git a/dev-docs/src/theme/ReactLiveScope/index.js b/dev-docs/src/theme/ReactLiveScope/index.js
index ca5a902e8..319c5512f 100644
--- a/dev-docs/src/theme/ReactLiveScope/index.js
+++ b/dev-docs/src/theme/ReactLiveScope/index.js
@@ -7,7 +7,7 @@ import "@excalidraw/excalidraw/index.css";
let ExcalidrawComp = {};
if (ExecutionEnvironment.canUseDOM) {
- ExcalidrawComp = require("@excalidraw/excalidraw");
+ ExcalidrawComp = require("@excalidraw/excalidraw/src");
}
const Excalidraw = React.forwardRef((props, ref) => {
if (!window.EXCALIDRAW_ASSET_PATH) {
diff --git a/examples/with-nextjs/src/excalidrawWrapper.tsx b/examples/with-nextjs/src/excalidrawWrapper.tsx
index fab4df651..fe64c40b5 100644
--- a/examples/with-nextjs/src/excalidrawWrapper.tsx
+++ b/examples/with-nextjs/src/excalidrawWrapper.tsx
@@ -1,6 +1,6 @@
"use client";
-import * as excalidrawLib from "@excalidraw/excalidraw";
-import { Excalidraw } from "@excalidraw/excalidraw";
+import * as excalidrawLib from "@excalidraw/excalidraw/src";
+import { Excalidraw } from "@excalidraw/excalidraw/src";
import "@excalidraw/excalidraw/index.css";
diff --git a/examples/with-script-in-browser/components/CustomFooter.tsx b/examples/with-script-in-browser/components/CustomFooter.tsx
index a9c902ade..4852cda86 100644
--- a/examples/with-script-in-browser/components/CustomFooter.tsx
+++ b/examples/with-script-in-browser/components/CustomFooter.tsx
@@ -1,7 +1,7 @@
import React from "react";
-import type * as TExcalidraw from "@excalidraw/excalidraw";
-import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/types";
+import type * as TExcalidraw from "@excalidraw/excalidraw/src";
+import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/src/types";
const COMMENT_SVG = (