@excalidraw/excalidraw 0.18.0-6fc8502 → 0.18.0-864353b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/{chunk-X3RYHLJU.js → chunk-7YMZV3TY.js} +14 -4
- package/dist/dev/chunk-7YMZV3TY.js.map +7 -0
- package/dist/dev/chunk-BBNNHA7I.js +7 -0
- package/dist/dev/chunk-BBNNHA7I.js.map +7 -0
- package/dist/dev/{chunk-KYBDXI6F.js → chunk-LL55DS44.js} +15037 -10099
- package/dist/dev/chunk-LL55DS44.js.map +7 -0
- package/dist/dev/data/{image-NKFINVKH.js → image-OFYK7EOY.js} +3 -3
- package/dist/dev/index.css +100 -22
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +3531 -6486
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-CKWC2GMK.js → en-KIY5SGI3.js} +2 -2
- package/dist/dev/subset-shared.chunk.js +1 -1
- package/dist/dev/subset-worker.chunk.js +1 -1
- package/dist/prod/chunk-F44EGBV2.js +33 -0
- package/dist/prod/{chunk-IUH5AXLB.js → chunk-OUULIERA.js} +4 -4
- package/dist/prod/chunk-UH6Q3EIV.js +7 -0
- package/dist/prod/data/image-CUOH64HE.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +18 -17
- package/dist/prod/locales/{en-SBO6ZHT2.js → en-GCLCIHXH.js} +1 -1
- package/dist/prod/subset-shared.chunk.js +1 -1
- package/dist/prod/subset-worker.chunk.js +1 -1
- package/dist/types/common/src/constants.d.ts +11 -1
- package/dist/types/{excalidraw → common/src}/emitter.d.ts +1 -1
- package/dist/types/common/src/font-metadata.d.ts +4 -2
- package/dist/types/common/src/index.d.ts +1 -0
- package/dist/types/common/src/utility-types.d.ts +5 -0
- package/dist/types/common/src/utils.d.ts +22 -4
- package/dist/types/{excalidraw/scene → element/src}/Scene.d.ts +11 -14
- package/dist/types/element/src/ShapeCache.d.ts +1 -1
- package/dist/types/element/src/align.d.ts +3 -3
- package/dist/types/element/src/binding.d.ts +19 -12
- package/dist/types/element/src/bounds.d.ts +2 -2
- package/dist/types/element/src/collision.d.ts +1 -1
- package/dist/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +40 -35
- package/dist/types/element/src/dragElements.d.ts +3 -2
- package/dist/types/element/src/duplicate.d.ts +10 -13
- package/dist/types/element/src/elbowArrow.d.ts +1 -1
- package/dist/types/element/src/flowchart.d.ts +3 -2
- package/dist/types/element/src/fractionalIndex.d.ts +2 -2
- package/dist/types/element/src/frame.d.ts +5 -4
- package/dist/types/element/src/index.d.ts +45 -2
- package/dist/types/element/src/linearElementEditor.d.ts +20 -31
- package/dist/types/element/src/mutateElement.d.ts +10 -2
- package/dist/types/element/src/newElement.d.ts +4 -3
- package/dist/types/element/src/resizeElements.d.ts +4 -4
- package/dist/types/element/src/selection.d.ts +11 -5
- package/dist/types/element/src/shapes.d.ts +5 -1
- package/dist/types/element/src/sizeHelpers.d.ts +2 -2
- package/dist/types/element/src/store.d.ts +227 -0
- package/dist/types/element/src/textElement.d.ts +5 -3
- package/dist/types/element/src/transformHandles.d.ts +4 -4
- package/dist/types/element/src/typeChecks.d.ts +15 -1
- package/dist/types/element/src/types.d.ts +14 -1
- package/dist/types/element/src/zindex.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +39 -45
- package/dist/types/excalidraw/actions/actionAlign.d.ts +8 -8
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +26 -30
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +262 -288
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +81 -92
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +13 -15
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +38 -43
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +13 -15
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +41 -46
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +13 -15
- package/dist/types/excalidraw/actions/actionExport.d.ts +210 -228
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +72 -36
- package/dist/types/excalidraw/actions/actionFlip.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionFrame.d.ts +96 -104
- package/dist/types/excalidraw/actions/actionGroup.d.ts +32 -36
- package/dist/types/excalidraw/actions/actionHistory.d.ts +1 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +505 -14
- package/dist/types/excalidraw/actions/actionLink.d.ts +13 -15
- package/dist/types/excalidraw/actions/actionMenu.d.ts +39 -45
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +25 -29
- package/dist/types/excalidraw/actions/actionProperties.d.ts +192 -214
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +15 -17
- package/dist/types/excalidraw/actions/actionStyles.d.ts +17 -19
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +15 -17
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +15 -17
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +15 -190
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +15 -17
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +15 -17
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +15 -17
- package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -8
- package/dist/types/excalidraw/actions/types.d.ts +4 -3
- package/dist/types/excalidraw/appState.d.ts +38 -29
- package/dist/types/excalidraw/components/App.d.ts +24 -11
- package/dist/types/excalidraw/components/ButtonIcon.d.ts +1 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +5 -1
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -3
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +2 -3
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
- package/dist/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
- package/dist/types/excalidraw/components/Range.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Position.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -11
- package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
- package/dist/types/excalidraw/components/icons.d.ts +3 -0
- package/dist/types/excalidraw/components/shapes.d.ts +1 -1
- package/dist/types/excalidraw/data/blob.d.ts +1 -1
- package/dist/types/excalidraw/data/transform.d.ts +1 -1
- package/dist/types/excalidraw/editor-jotai.d.ts +6 -6
- package/dist/types/excalidraw/eraser/index.d.ts +14 -0
- package/dist/types/excalidraw/fonts/Fonts.d.ts +1 -1
- package/dist/types/excalidraw/history.d.ts +14 -22
- package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
- package/dist/types/excalidraw/index.d.ts +9 -9
- package/dist/types/excalidraw/lasso/index.d.ts +1 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +1 -2
- package/dist/types/excalidraw/renderer/helpers.d.ts +7 -2
- package/dist/types/excalidraw/scene/Renderer.d.ts +1 -1
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/scene/scrollbars.d.ts +2 -3
- package/dist/types/excalidraw/scene/types.d.ts +2 -0
- package/dist/types/excalidraw/snapping.d.ts +2 -2
- package/dist/types/excalidraw/types.d.ts +28 -6
- package/dist/types/excalidraw/visualdebug.d.ts +1 -1
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
- package/dist/types/math/src/angle.d.ts +2 -0
- package/dist/types/math/src/curve.d.ts +2 -0
- package/dist/types/math/src/point.d.ts +1 -1
- package/dist/types/math/src/types.d.ts +1 -0
- package/dist/types/math/src/vector.d.ts +4 -0
- package/dist/types/utils/src/bbox.d.ts +1 -1
- package/dist/types/utils/src/index.d.ts +1 -1
- package/dist/types/utils/src/withinBounds.d.ts +1 -1
- package/history.ts +68 -94
- package/package.json +3 -3
- package/dist/dev/chunk-H7XJ5UVD.js +0 -7
- package/dist/dev/chunk-H7XJ5UVD.js.map +0 -7
- package/dist/dev/chunk-KYBDXI6F.js.map +0 -7
- package/dist/dev/chunk-X3RYHLJU.js.map +0 -7
- package/dist/prod/chunk-CAN5RS4P.js +0 -31
- package/dist/prod/chunk-KJYFYP64.js +0 -7
- package/dist/prod/data/image-5XD47O4X.js +0 -1
- package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
- package/dist/types/excalidraw/store.d.ts +0 -129
- /package/dist/dev/data/{image-NKFINVKH.js.map → image-OFYK7EOY.js.map} +0 -0
- /package/dist/dev/locales/{en-CKWC2GMK.js.map → en-KIY5SGI3.js.map} +0 -0
|
@@ -5,6 +5,7 @@ interface CollapsibleProps {
|
|
|
5
5
|
openTrigger: () => void;
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
className?: string;
|
|
8
|
+
showCollapsedIcon?: boolean;
|
|
8
9
|
}
|
|
9
|
-
declare const Collapsible: ({ label, open, openTrigger, children, className, }: CollapsibleProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const Collapsible: ({ label, open, openTrigger, children, className, showCollapsedIcon, }: CollapsibleProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export default Collapsible;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../../types";
|
|
4
4
|
interface DimensionDragInputProps {
|
|
5
5
|
property: "width" | "height";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
4
|
import "./DragInput.scss";
|
|
4
5
|
import type { StatsInputProperty } from "./utils";
|
|
5
|
-
import type Scene from "../../scene/Scene";
|
|
6
6
|
import type { AppState } from "../../types";
|
|
7
7
|
export type DragInputCallbackType<P extends StatsInputProperty, E = ExcalidrawElement> = (props: {
|
|
8
8
|
accumulatedChange: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../../types";
|
|
4
4
|
interface FontSizeProps {
|
|
5
5
|
element: ExcalidrawElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../../types";
|
|
4
4
|
interface MultiAngleProps {
|
|
5
5
|
elements: readonly ExcalidrawElement[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
2
3
|
import type { AtomicUnit } from "./utils";
|
|
3
|
-
import type Scene from "../../scene/Scene";
|
|
4
4
|
import type { AppState } from "../../types";
|
|
5
5
|
interface MultiDimensionProps {
|
|
6
6
|
property: "width" | "height";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../../types";
|
|
4
4
|
interface MultiFontSizeProps {
|
|
5
5
|
elements: readonly ExcalidrawElement[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
2
3
|
import type { AtomicUnit } from "./utils";
|
|
3
|
-
import type Scene from "../../scene/Scene";
|
|
4
4
|
import type { AppState } from "../../types";
|
|
5
5
|
interface MultiPositionProps {
|
|
6
6
|
property: "x" | "y";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../../types";
|
|
4
4
|
interface PositionProps {
|
|
5
5
|
property: "x" | "y";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement
|
|
2
|
-
import type Scene from "
|
|
1
|
+
import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../../types";
|
|
4
4
|
export type StatsInputProperty = "x" | "y" | "width" | "height" | "angle" | "fontSize" | "gridStep";
|
|
5
5
|
export declare const SMALLEST_DELTA = 0.01;
|
|
6
|
+
export declare const STEP_SIZE = 10;
|
|
6
7
|
export declare const isPropertyEditable: (element: ExcalidrawElement, property: keyof ExcalidrawElement) => boolean;
|
|
7
8
|
export declare const getStepSizedValue: (value: number, stepSize: number) => number;
|
|
8
9
|
export type AtomicUnit = Record<string, true>;
|
|
@@ -14,13 +15,5 @@ export declare const newOrigin: (x1: number, y1: number, w1: number, h1: number,
|
|
|
14
15
|
x: number;
|
|
15
16
|
y: number;
|
|
16
17
|
};
|
|
17
|
-
export declare const moveElement: (newTopLeftX: number, newTopLeftY: number, originalElement: ExcalidrawElement,
|
|
18
|
+
export declare const moveElement: (newTopLeftX: number, newTopLeftY: number, originalElement: ExcalidrawElement, scene: Scene, originalElementsMap: ElementsMap, shouldInformMutation?: boolean) => void;
|
|
18
19
|
export declare const getAtomicUnits: (targetElements: readonly ExcalidrawElement[], appState: AppState) => AtomicUnit[];
|
|
19
|
-
export declare const updateBindings: (latestElement: ExcalidrawElement, elementsMap: NonDeletedSceneElementsMap, elements: readonly NonDeletedExcalidrawElement[], scene: Scene, options?: {
|
|
20
|
-
simultaneouslyUpdated?: readonly ExcalidrawElement[];
|
|
21
|
-
newSize?: {
|
|
22
|
-
width: number;
|
|
23
|
-
height: number;
|
|
24
|
-
};
|
|
25
|
-
zoom?: AppState["zoom"];
|
|
26
|
-
}) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./UnlockPopup.scss";
|
|
2
|
+
import type App from "./App";
|
|
3
|
+
import type { AppState } from "../types";
|
|
4
|
+
declare const UnlockPopup: ({ app, activeLockedId, }: {
|
|
5
|
+
app: App;
|
|
6
|
+
activeLockedId: NonNullable<AppState["activeLockedId"]>;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export default UnlockPopup;
|
|
@@ -14,6 +14,7 @@ type InteractiveCanvasProps = {
|
|
|
14
14
|
selectionNonce: number | undefined;
|
|
15
15
|
scale: number;
|
|
16
16
|
appState: InteractiveCanvasAppState;
|
|
17
|
+
renderScrollbars: boolean;
|
|
17
18
|
device: Device;
|
|
18
19
|
renderInteractiveSceneCallback: (data: RenderInteractiveSceneCallback) => void;
|
|
19
20
|
handleCanvasRef: (canvas: HTMLCanvasElement | null) => void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { Scene } from "@excalidraw/element";
|
|
1
2
|
import type { ElementsMap, ExcalidrawEmbeddableElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
3
|
import "./Hyperlink.scss";
|
|
3
4
|
import type { AppState, ExcalidrawProps, UIAppState } from "../../types";
|
|
4
|
-
export declare const Hyperlink: ({ element,
|
|
5
|
+
export declare const Hyperlink: ({ element, scene, setAppState, onLinkOpen, setToast, updateEmbedValidationStatus, }: {
|
|
5
6
|
element: NonDeletedExcalidrawElement;
|
|
6
|
-
|
|
7
|
+
scene: Scene;
|
|
7
8
|
setAppState: React.Component<any, AppState>["setState"];
|
|
8
9
|
onLinkOpen: ExcalidrawProps["onLinkOpen"];
|
|
9
10
|
setToast: (toast: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { GlobalPoint, Radians } from "@excalidraw/math";
|
|
2
|
-
import type { Bounds } from "@excalidraw/element
|
|
2
|
+
import type { Bounds } from "@excalidraw/element";
|
|
3
3
|
import type { ElementsMap, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
4
4
|
import type { AppState, UIAppState } from "../../types";
|
|
5
|
+
export declare const DEFAULT_LINK_SIZE = 12;
|
|
5
6
|
export declare const EXTERNAL_LINK_IMG: HTMLImageElement;
|
|
6
7
|
export declare const ELEMENT_LINK_IMG: HTMLImageElement;
|
|
7
8
|
export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: Radians, appState: Pick<UIAppState, "zoom">) => Bounds;
|
|
@@ -12,8 +12,10 @@ export declare const LibraryIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
12
12
|
export declare const PlusIcon: import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export declare const DotsIcon: import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export declare const PinIcon: import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const polygonIcon: import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export declare const UnlockedIcon: import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export declare const LockedIcon: import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const LockedIconFilled: import("react/jsx-runtime").JSX.Element;
|
|
17
19
|
export declare const WelcomeScreenMenuArrow: import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
export declare const WelcomeScreenHelpArrow: import("react/jsx-runtime").JSX.Element;
|
|
19
21
|
export declare const WelcomeScreenTopToolbarArrow: import("react/jsx-runtime").JSX.Element;
|
|
@@ -54,6 +56,7 @@ export declare const LoadIcon: import("react/jsx-runtime").JSX.Element;
|
|
|
54
56
|
export declare const clipboard: import("react/jsx-runtime").JSX.Element;
|
|
55
57
|
export declare const palette: import("react/jsx-runtime").JSX.Element;
|
|
56
58
|
export declare const bucketFillIcon: import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare const slashIcon: import("react/jsx-runtime").JSX.Element;
|
|
57
60
|
export declare const ExportImageIcon: import("react/jsx-runtime").JSX.Element;
|
|
58
61
|
export declare const exportToFileIcon: import("react/jsx-runtime").JSX.Element;
|
|
59
62
|
export declare const zoomIn: import("react/jsx-runtime").JSX.Element;
|
|
@@ -59,4 +59,4 @@ export declare const SHAPES: readonly [{
|
|
|
59
59
|
readonly numericKey: "0";
|
|
60
60
|
readonly fillable: false;
|
|
61
61
|
}];
|
|
62
|
-
export declare const findShapeByKey: (key: string) => "
|
|
62
|
+
export declare const findShapeByKey: (key: string) => "text" | "line" | "arrow" | "selection" | "rectangle" | "diamond" | "ellipse" | "freedraw" | "image" | "eraser" | null;
|
|
@@ -6,7 +6,7 @@ import type { FileSystemHandle } from "./filesystem";
|
|
|
6
6
|
import type { ImportedLibraryData } from "./types";
|
|
7
7
|
export declare const getMimeType: (blob: Blob | string) => string;
|
|
8
8
|
export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
|
|
9
|
-
export declare const isImageFileHandleType: (type: string | null) => type is "
|
|
9
|
+
export declare const isImageFileHandleType: (type: string | null) => type is "svg" | "png";
|
|
10
10
|
export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boolean;
|
|
11
11
|
export declare const isSupportedImageFileType: (type: string | null | undefined) => boolean;
|
|
12
12
|
export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ElementConstructorOpts } from "@excalidraw/element
|
|
1
|
+
import type { ElementConstructorOpts } from "@excalidraw/element";
|
|
2
2
|
import type { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawIframeLikeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawMagicFrameElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FileId, FontFamilyValues, TextAlign, VerticalAlign } from "@excalidraw/element/types";
|
|
3
3
|
import type { MarkOptional } from "@excalidraw/common/utility-types";
|
|
4
4
|
export type ValidLinearElement = {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { atom, createStore, type PrimitiveAtom } from "jotai";
|
|
1
|
+
import { atom, createStore, type PrimitiveAtom, type WritableAtom } from "jotai";
|
|
2
2
|
import { createIsolation } from "jotai-scope";
|
|
3
|
-
export { atom, PrimitiveAtom };
|
|
3
|
+
export { atom, PrimitiveAtom, WritableAtom };
|
|
4
4
|
export declare const useAtom: typeof import("jotai").useAtom, useSetAtom: typeof import("jotai").useSetAtom, useAtomValue: typeof import("jotai").useAtomValue, useStore: (options?: {
|
|
5
5
|
store?: {
|
|
6
6
|
get: <Value>(atom: import("jotai").Atom<Value>) => Value;
|
|
7
|
-
set: <Value_1, Args extends unknown[], Result>(atom:
|
|
7
|
+
set: <Value_1, Args extends unknown[], Result>(atom: WritableAtom<Value_1, Args, Result>, ...args: Args) => Result;
|
|
8
8
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
9
9
|
} | ({
|
|
10
10
|
get: <Value_2>(atom: import("jotai").Atom<Value_2>) => Value_2;
|
|
11
|
-
set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom:
|
|
11
|
+
set: <Value_1_1, Args_1 extends unknown[], Result_1>(atom: WritableAtom<Value_1_1, Args_1, Result_1>, ...args: Args_1) => Result_1;
|
|
12
12
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
13
13
|
} & {
|
|
14
14
|
dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
|
|
@@ -29,11 +29,11 @@ export declare const useAtom: typeof import("jotai").useAtom, useSetAtom: typeof
|
|
|
29
29
|
}) | undefined;
|
|
30
30
|
} | undefined) => {
|
|
31
31
|
get: <Value_3>(atom: import("jotai").Atom<Value_3>) => Value_3;
|
|
32
|
-
set: <Value_1_2, Args_2 extends unknown[], Result_2>(atom:
|
|
32
|
+
set: <Value_1_2, Args_2 extends unknown[], Result_2>(atom: WritableAtom<Value_1_2, Args_2, Result_2>, ...args: Args_2) => Result_2;
|
|
33
33
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
34
34
|
} | ({
|
|
35
35
|
get: <Value_4>(atom: import("jotai").Atom<Value_4>) => Value_4;
|
|
36
|
-
set: <Value_1_3, Args_3 extends unknown[], Result_3>(atom:
|
|
36
|
+
set: <Value_1_3, Args_3 extends unknown[], Result_3>(atom: WritableAtom<Value_1_3, Args_3, Result_3>, ...args: Args_3) => Result_3;
|
|
37
37
|
sub: (atom: import("jotai").Atom<unknown>, listener: () => void) => () => void;
|
|
38
38
|
} & {
|
|
39
39
|
dev4_get_internal_weak_map: () => WeakMap<import("jotai").Atom<unknown>, {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AnimatedTrail } from "../animated-trail";
|
|
2
|
+
import type { AnimationFrameHandler } from "../animation-frame-handler";
|
|
3
|
+
import type App from "../components/App";
|
|
4
|
+
export declare class EraserTrail extends AnimatedTrail {
|
|
5
|
+
private elementsToErase;
|
|
6
|
+
private groupsToErase;
|
|
7
|
+
private segmentsCache;
|
|
8
|
+
private geometricShapesCache;
|
|
9
|
+
constructor(animationFrameHandler: AnimationFrameHandler, app: App);
|
|
10
|
+
startPath(x: number, y: number): void;
|
|
11
|
+
addPointToPath(x: number, y: number, restore?: boolean): string[];
|
|
12
|
+
private updateElementsToBeErased;
|
|
13
|
+
endPath(): void;
|
|
14
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type FontMetadata } from "@excalidraw/common";
|
|
2
2
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
4
|
import { ExcalidrawFontFace } from "./ExcalidrawFontFace";
|
|
4
|
-
import type Scene from "../scene/Scene";
|
|
5
5
|
export declare class Fonts {
|
|
6
6
|
static readonly loadedFontsCache: Set<string>;
|
|
7
7
|
private static _registered;
|
|
@@ -1,40 +1,32 @@
|
|
|
1
|
+
import { Emitter } from "@excalidraw/common";
|
|
2
|
+
import { StoreDelta, type Store } from "@excalidraw/element";
|
|
1
3
|
import type { SceneElementsMap } from "@excalidraw/element/types";
|
|
2
|
-
import { Emitter } from "./emitter";
|
|
3
|
-
import type { AppStateChange, ElementsChange } from "./change";
|
|
4
|
-
import type { Snapshot } from "./store";
|
|
5
4
|
import type { AppState } from "./types";
|
|
5
|
+
declare class HistoryEntry extends StoreDelta {
|
|
6
|
+
}
|
|
6
7
|
export declare class HistoryChangedEvent {
|
|
7
8
|
readonly isUndoStackEmpty: boolean;
|
|
8
9
|
readonly isRedoStackEmpty: boolean;
|
|
9
10
|
constructor(isUndoStackEmpty?: boolean, isRedoStackEmpty?: boolean);
|
|
10
11
|
}
|
|
11
12
|
export declare class History {
|
|
13
|
+
private readonly store;
|
|
12
14
|
readonly onHistoryChangedEmitter: Emitter<[HistoryChangedEvent]>;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
readonly undoStack: HistoryEntry[];
|
|
16
|
+
readonly redoStack: HistoryEntry[];
|
|
15
17
|
get isUndoStackEmpty(): boolean;
|
|
16
18
|
get isRedoStackEmpty(): boolean;
|
|
19
|
+
constructor(store: Store);
|
|
17
20
|
clear(): void;
|
|
18
21
|
/**
|
|
19
|
-
* Record a local
|
|
22
|
+
* Record a non-empty local durable increment, which will go into the undo stack..
|
|
23
|
+
* Do not re-record history entries, which were already pushed to undo / redo stack, as part of history action.
|
|
20
24
|
*/
|
|
21
|
-
record(
|
|
22
|
-
undo(elements: SceneElementsMap, appState: AppState
|
|
23
|
-
redo(elements: SceneElementsMap, appState: AppState
|
|
25
|
+
record(delta: StoreDelta): void;
|
|
26
|
+
undo(elements: SceneElementsMap, appState: AppState): void | [SceneElementsMap, AppState];
|
|
27
|
+
redo(elements: SceneElementsMap, appState: AppState): void | [SceneElementsMap, AppState];
|
|
24
28
|
private perform;
|
|
25
29
|
private static pop;
|
|
26
30
|
private static push;
|
|
27
31
|
}
|
|
28
|
-
export
|
|
29
|
-
readonly appStateChange: AppStateChange;
|
|
30
|
-
readonly elementsChange: ElementsChange;
|
|
31
|
-
private constructor();
|
|
32
|
-
static create(appStateChange: AppStateChange, elementsChange: ElementsChange): HistoryEntry;
|
|
33
|
-
inverse(): HistoryEntry;
|
|
34
|
-
applyTo(elements: SceneElementsMap, appState: AppState, snapshot: Readonly<Snapshot>): [SceneElementsMap, AppState, boolean];
|
|
35
|
-
/**
|
|
36
|
-
* Apply latest (remote) changes to the history entry, creates new instance of `HistoryEntry`.
|
|
37
|
-
*/
|
|
38
|
-
applyLatestChanges(elements: SceneElementsMap): HistoryEntry;
|
|
39
|
-
isEmpty(): boolean;
|
|
40
|
-
}
|
|
32
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Emitter } from "
|
|
1
|
+
import type { Emitter } from "@excalidraw/common";
|
|
2
2
|
export declare const useEmitter: <TEvent extends unknown>(emitter: Emitter<[TEvent]>, initialState: TEvent) => TEvent;
|
|
@@ -9,20 +9,20 @@ import "./fonts/fonts.css";
|
|
|
9
9
|
import type { ExcalidrawProps } from "./types";
|
|
10
10
|
export declare const Excalidraw: React.MemoExoticComponent<(props: ExcalidrawProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
11
|
export { getSceneVersion, hashElementsVersion, hashString, getNonDeletedElements, } from "@excalidraw/element";
|
|
12
|
-
export { getTextFromElements } from "@excalidraw/element
|
|
13
|
-
export { isInvisiblySmallElement } from "@excalidraw/element
|
|
12
|
+
export { getTextFromElements } from "@excalidraw/element";
|
|
13
|
+
export { isInvisiblySmallElement } from "@excalidraw/element";
|
|
14
14
|
export { defaultLang, useI18n, languages } from "./i18n";
|
|
15
15
|
export { restore, restoreAppState, restoreElements, restoreLibraryItems, } from "./data/restore";
|
|
16
16
|
export { reconcileElements } from "./data/reconcile";
|
|
17
17
|
export { exportToCanvas, exportToBlob, exportToSvg, exportToClipboard, } from "@excalidraw/utils/export";
|
|
18
18
|
export { serializeAsJSON, serializeLibraryAsJSON } from "./data/json";
|
|
19
19
|
export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "./data/blob";
|
|
20
|
-
export { getFreeDrawSvgPath } from "@excalidraw/element
|
|
20
|
+
export { getFreeDrawSvgPath } from "@excalidraw/element";
|
|
21
21
|
export { mergeLibraryItems, getLibraryItemsHash } from "./data/library";
|
|
22
|
-
export { isLinearElement } from "@excalidraw/element
|
|
22
|
+
export { isLinearElement } from "@excalidraw/element";
|
|
23
23
|
export { FONT_FAMILY, THEME, MIME_TYPES, ROUNDNESS, DEFAULT_LASER_COLOR, UserIdleState, normalizeLink, } from "@excalidraw/common";
|
|
24
|
-
export { mutateElement, newElementWith, bumpVersion, } from "@excalidraw/element
|
|
25
|
-
export { CaptureUpdateAction } from "
|
|
24
|
+
export { mutateElement, newElementWith, bumpVersion, } from "@excalidraw/element";
|
|
25
|
+
export { CaptureUpdateAction } from "@excalidraw/element";
|
|
26
26
|
export { parseLibraryTokensFromUrl, useHandleLibrary } from "./data/library";
|
|
27
27
|
export { sceneCoordsToViewportCoords, viewportCoordsToSceneCoords, } from "@excalidraw/common";
|
|
28
28
|
export { Sidebar } from "./components/Sidebar/Sidebar";
|
|
@@ -38,9 +38,9 @@ export { TTDDialog } from "./components/TTDDialog/TTDDialog";
|
|
|
38
38
|
export { TTDDialogTrigger } from "./components/TTDDialog/TTDDialogTrigger";
|
|
39
39
|
export { zoomToFitBounds } from "./actions/actionCanvas";
|
|
40
40
|
export { convertToExcalidrawElements } from "./data/transform";
|
|
41
|
-
export { getCommonBounds, getVisibleSceneBounds
|
|
41
|
+
export { getCommonBounds, getVisibleSceneBounds } from "@excalidraw/element";
|
|
42
42
|
export { elementsOverlappingBBox, isElementInsideBBox, elementPartiallyOverlapsWithOrContainsBBox, } from "@excalidraw/utils/withinBounds";
|
|
43
43
|
export { DiagramToCodePlugin } from "./components/DiagramToCodePlugin/DiagramToCodePlugin";
|
|
44
44
|
export { getDataURL } from "./data/blob";
|
|
45
|
-
export { isElementLink } from "@excalidraw/element
|
|
46
|
-
export { setCustomTextMetricsProvider } from "@excalidraw/element
|
|
45
|
+
export { isElementLink } from "@excalidraw/element";
|
|
46
|
+
export { setCustomTextMetricsProvider } from "@excalidraw/element";
|
|
@@ -5,6 +5,7 @@ export declare class LassoTrail extends AnimatedTrail {
|
|
|
5
5
|
private intersectedElements;
|
|
6
6
|
private enclosedElements;
|
|
7
7
|
private elementsSegments;
|
|
8
|
+
private canvasTranslate;
|
|
8
9
|
private keepPreviousSelection;
|
|
9
10
|
constructor(animationFrameHandler: AnimationFrameHandler, app: App);
|
|
10
11
|
startPath(x: number, y: number, keepPreviousSelection?: boolean): void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ElementsSegmentsMap, GlobalPoint } from "@excalidraw/math/types";
|
|
2
2
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
-
export type ElementsSegmentsMap = Map<string, LineSegment<GlobalPoint>[]>;
|
|
4
3
|
export declare const getLassoSelectedElementIds: (input: {
|
|
5
4
|
lassoPath: GlobalPoint[];
|
|
6
5
|
elements: readonly ExcalidrawElement[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { ExcalidrawDiamondElement, ExcalidrawRectanguloidElement } from "@excalidraw/element/types";
|
|
1
2
|
import type { StaticCanvasRenderConfig } from "../scene/types";
|
|
2
|
-
import type {
|
|
3
|
-
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke?: boolean) => void;
|
|
3
|
+
import type { AppState, StaticCanvasAppState } from "../types";
|
|
4
|
+
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke: boolean, fill?: boolean) => void;
|
|
4
5
|
export declare const getNormalizedCanvasDimensions: (canvas: HTMLCanvasElement, scale: number) => [number, number];
|
|
5
6
|
export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normalizedHeight, theme, isExporting, viewBackgroundColor, }: {
|
|
6
7
|
canvas: HTMLCanvasElement;
|
|
@@ -11,3 +12,7 @@ export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normali
|
|
|
11
12
|
isExporting?: boolean | undefined;
|
|
12
13
|
viewBackgroundColor?: string | null | undefined;
|
|
13
14
|
}) => CanvasRenderingContext2D;
|
|
15
|
+
export declare const drawHighlightForRectWithRotation: (context: CanvasRenderingContext2D, element: ExcalidrawRectanguloidElement, padding: number) => void;
|
|
16
|
+
export declare const strokeEllipseWithRotation: (context: CanvasRenderingContext2D, width: number, height: number, cx: number, cy: number, angle: number) => void;
|
|
17
|
+
export declare const strokeRectWithRotation: (context: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, cx: number, cy: number, angle: number, fill?: boolean, radius?: number) => void;
|
|
18
|
+
export declare const drawHighlightForDiamondWithRotation: (context: CanvasRenderingContext2D, padding: number, element: ExcalidrawDiamondElement) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import type { AppState } from "../types";
|
|
4
4
|
export declare class Renderer {
|
|
5
5
|
private scene;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { isSomeElementSelected, getElementsWithinSelection,
|
|
1
|
+
export { isSomeElementSelected, getElementsWithinSelection, getSelectedElements, getTargetElements, } from "@excalidraw/element";
|
|
2
2
|
export { calculateScrollCenter } from "./scroll";
|
|
3
|
-
export { hasBackground, hasStrokeWidth, hasStrokeStyle, canHaveArrowheads, canChangeRoundness, } from "@excalidraw/element
|
|
3
|
+
export { hasBackground, hasStrokeWidth, hasStrokeStyle, canHaveArrowheads, canChangeRoundness, } from "@excalidraw/element";
|
|
4
4
|
export { getNormalizedZoom, getNormalizedGridSize, getNormalizedGridStep, } from "./normalize";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
1
|
import type { InteractiveCanvasAppState } from "../types";
|
|
3
|
-
import type { ScrollBars } from "./types";
|
|
2
|
+
import type { RenderableElementsMap, ScrollBars } from "./types";
|
|
4
3
|
export declare const SCROLLBAR_MARGIN = 4;
|
|
5
4
|
export declare const SCROLLBAR_WIDTH = 6;
|
|
6
5
|
export declare const SCROLLBAR_COLOR = "rgba(0,0,0,0.3)";
|
|
7
|
-
export declare const getScrollBars: (elements:
|
|
6
|
+
export declare const getScrollBars: (elements: RenderableElementsMap, viewportWidth: number, viewportHeight: number, appState: InteractiveCanvasAppState) => ScrollBars;
|
|
8
7
|
export declare const isOverScrollBars: (scrollBars: ScrollBars, x: number, y: number) => {
|
|
9
8
|
isOverEither: boolean;
|
|
10
9
|
isOverHorizontal: boolean;
|
|
@@ -93,12 +93,14 @@ export type ScrollBars = {
|
|
|
93
93
|
y: number;
|
|
94
94
|
width: number;
|
|
95
95
|
height: number;
|
|
96
|
+
deltaMultiplier: number;
|
|
96
97
|
} | null;
|
|
97
98
|
vertical: {
|
|
98
99
|
x: number;
|
|
99
100
|
y: number;
|
|
100
101
|
width: number;
|
|
101
102
|
height: number;
|
|
103
|
+
deltaMultiplier: number;
|
|
102
104
|
} | null;
|
|
103
105
|
};
|
|
104
106
|
export type ElementShape = Drawable | Drawable[] | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type GlobalPoint } from "@excalidraw/math";
|
|
2
2
|
import type { InclusiveRange } from "@excalidraw/math";
|
|
3
|
-
import type { Bounds } from "@excalidraw/element
|
|
4
|
-
import type { MaybeTransformHandleType } from "@excalidraw/element
|
|
3
|
+
import type { Bounds } from "@excalidraw/element";
|
|
4
|
+
import type { MaybeTransformHandleType } from "@excalidraw/element";
|
|
5
5
|
import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
6
6
|
import type { AppClassProperties, AppState, KeyboardModifiersObject } from "./types";
|
|
7
7
|
export declare const getSnapDistance: (zoomValue: number) => number;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { IMAGE_MIME_TYPES, UserIdleState, throttleRAF, MIME_TYPES } from "@excalidraw/common";
|
|
2
|
-
import type { SuggestedBinding } from "@excalidraw/element
|
|
3
|
-
import type { LinearElementEditor } from "@excalidraw/element
|
|
4
|
-
import type { MaybeTransformHandleType } from "@excalidraw/element
|
|
2
|
+
import type { SuggestedBinding } from "@excalidraw/element";
|
|
3
|
+
import type { LinearElementEditor } from "@excalidraw/element";
|
|
4
|
+
import type { MaybeTransformHandleType } from "@excalidraw/element";
|
|
5
5
|
import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, FileId, ExcalidrawImageElement, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement } from "@excalidraw/element/types";
|
|
6
6
|
import type { Merge, MaybePromise, ValueOf, MakeBrand } from "@excalidraw/common/utility-types";
|
|
7
|
+
import type { CaptureUpdateActionType, DurableIncrement, EphemeralIncrement } from "@excalidraw/element";
|
|
7
8
|
import type { Action } from "./actions/types";
|
|
8
9
|
import type { Spreadsheet } from "./charts";
|
|
9
10
|
import type { ClipboardData } from "./clipboard";
|
|
@@ -12,7 +13,6 @@ import type Library from "./data/library";
|
|
|
12
13
|
import type { FileSystemHandle } from "./data/filesystem";
|
|
13
14
|
import type { ContextMenuItems } from "./components/ContextMenu";
|
|
14
15
|
import type { SnapLine } from "./snapping";
|
|
15
|
-
import type { CaptureUpdateActionType } from "./store";
|
|
16
16
|
import type { ImportedDataState } from "./data/types";
|
|
17
17
|
import type { Language } from "./i18n";
|
|
18
18
|
import type { isOverScrollBars } from "./scene/scrollbars";
|
|
@@ -146,6 +146,7 @@ export type InteractiveCanvasAppState = Readonly<_CommonCanvasAppState & {
|
|
|
146
146
|
isCropping: AppState["isCropping"];
|
|
147
147
|
croppingElementId: AppState["croppingElementId"];
|
|
148
148
|
searchMatches: AppState["searchMatches"];
|
|
149
|
+
activeLockedId: AppState["activeLockedId"];
|
|
149
150
|
}>;
|
|
150
151
|
export type ObservedAppState = ObservedStandaloneAppState & ObservedElementsAppState;
|
|
151
152
|
export type ObservedStandaloneAppState = {
|
|
@@ -159,6 +160,8 @@ export type ObservedElementsAppState = {
|
|
|
159
160
|
editingLinearElementId: LinearElementEditor["elementId"] | null;
|
|
160
161
|
selectedLinearElementId: LinearElementEditor["elementId"] | null;
|
|
161
162
|
croppingElementId: AppState["croppingElementId"];
|
|
163
|
+
lockedMultiSelections: AppState["lockedMultiSelections"];
|
|
164
|
+
activeLockedId: AppState["activeLockedId"];
|
|
162
165
|
};
|
|
163
166
|
export interface AppState {
|
|
164
167
|
contextMenu: {
|
|
@@ -341,9 +344,18 @@ export interface AppState {
|
|
|
341
344
|
/** image cropping */
|
|
342
345
|
isCropping: boolean;
|
|
343
346
|
croppingElementId: ExcalidrawElement["id"] | null;
|
|
344
|
-
|
|
347
|
+
/** null if no search matches found / search closed */
|
|
348
|
+
searchMatches: Readonly<{
|
|
349
|
+
focusedId: ExcalidrawElement["id"] | null;
|
|
350
|
+
matches: readonly SearchMatch[];
|
|
351
|
+
}> | null;
|
|
352
|
+
/** the locked element/group that's active and shows unlock popup */
|
|
353
|
+
activeLockedId: string | null;
|
|
354
|
+
lockedMultiSelections: {
|
|
355
|
+
[groupId: string]: true;
|
|
356
|
+
};
|
|
345
357
|
}
|
|
346
|
-
type SearchMatch = {
|
|
358
|
+
export type SearchMatch = {
|
|
347
359
|
id: string;
|
|
348
360
|
focus: boolean;
|
|
349
361
|
matchedLines: {
|
|
@@ -351,6 +363,7 @@ type SearchMatch = {
|
|
|
351
363
|
offsetY: number;
|
|
352
364
|
width: number;
|
|
353
365
|
height: number;
|
|
366
|
+
showOnCanvas: boolean;
|
|
354
367
|
}[];
|
|
355
368
|
};
|
|
356
369
|
export type UIAppState = Omit<AppState, "suggestedBindings" | "startBoundElement" | "cursorButton" | "scrollX" | "scrollY">;
|
|
@@ -403,6 +416,7 @@ export type OnUserFollowedPayload = {
|
|
|
403
416
|
};
|
|
404
417
|
export interface ExcalidrawProps {
|
|
405
418
|
onChange?: (elements: readonly OrderedExcalidrawElement[], appState: AppState, files: BinaryFiles) => void;
|
|
419
|
+
onIncrement?: (event: DurableIncrement | EphemeralIncrement) => void;
|
|
406
420
|
initialData?: (() => MaybePromise<ExcalidrawInitialDataState | null>) | MaybePromise<ExcalidrawInitialDataState | null>;
|
|
407
421
|
excalidrawAPI?: (api: ExcalidrawImperativeAPI) => void;
|
|
408
422
|
isCollaborating?: boolean;
|
|
@@ -459,6 +473,7 @@ export interface ExcalidrawProps {
|
|
|
459
473
|
renderEmbeddable?: (element: NonDeleted<ExcalidrawEmbeddableElement>, appState: AppState) => JSX.Element | null;
|
|
460
474
|
aiEnabled?: boolean;
|
|
461
475
|
showDeprecatedFonts?: boolean;
|
|
476
|
+
renderScrollbars?: boolean;
|
|
462
477
|
}
|
|
463
478
|
export type SceneData = {
|
|
464
479
|
elements?: ImportedDataState["elements"];
|
|
@@ -544,6 +559,7 @@ export type AppClassProperties = {
|
|
|
544
559
|
visibleElements: App["visibleElements"];
|
|
545
560
|
excalidrawContainerValue: App["excalidrawContainerValue"];
|
|
546
561
|
onPointerUpEmitter: App["onPointerUpEmitter"];
|
|
562
|
+
updateEditorAtom: App["updateEditorAtom"];
|
|
547
563
|
};
|
|
548
564
|
export type PointerDownState = Readonly<{
|
|
549
565
|
origin: Readonly<{
|
|
@@ -587,6 +603,10 @@ export type PointerDownState = Readonly<{
|
|
|
587
603
|
x: number;
|
|
588
604
|
y: number;
|
|
589
605
|
} | null;
|
|
606
|
+
origin: {
|
|
607
|
+
x: number;
|
|
608
|
+
y: number;
|
|
609
|
+
};
|
|
590
610
|
};
|
|
591
611
|
eventListeners: {
|
|
592
612
|
onMove: null | ReturnType<typeof throttleRAF>;
|
|
@@ -601,6 +621,7 @@ export type PointerDownState = Readonly<{
|
|
|
601
621
|
export type UnsubscribeCallback = () => void;
|
|
602
622
|
export interface ExcalidrawImperativeAPI {
|
|
603
623
|
updateScene: InstanceType<typeof App>["updateScene"];
|
|
624
|
+
mutateElement: InstanceType<typeof App>["mutateElement"];
|
|
604
625
|
updateLibrary: InstanceType<typeof Library>["updateLibrary"];
|
|
605
626
|
resetScene: InstanceType<typeof App>["resetScene"];
|
|
606
627
|
getSceneElementsIncludingDeleted: InstanceType<typeof App>["getSceneElementsIncludingDeleted"];
|
|
@@ -628,6 +649,7 @@ export interface ExcalidrawImperativeAPI {
|
|
|
628
649
|
*/
|
|
629
650
|
updateFrameRendering: InstanceType<typeof App>["updateFrameRendering"];
|
|
630
651
|
onChange: (callback: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles) => void) => UnsubscribeCallback;
|
|
652
|
+
onIncrement: (callback: (event: DurableIncrement | EphemeralIncrement) => void) => UnsubscribeCallback;
|
|
631
653
|
onPointerDown: (callback: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState, event: React.PointerEvent<HTMLElement>) => void) => UnsubscribeCallback;
|
|
632
654
|
onPointerUp: (callback: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState, event: PointerEvent) => void) => UnsubscribeCallback;
|
|
633
655
|
onScrollChange: (callback: (scrollX: number, scrollY: number, zoom: Zoom) => void) => UnsubscribeCallback;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
2
2
|
import type { Curve } from "@excalidraw/math";
|
|
3
3
|
import type { LineSegment } from "@excalidraw/utils";
|
|
4
|
-
import type { Bounds } from "@excalidraw/element
|
|
4
|
+
import type { Bounds } from "@excalidraw/element";
|
|
5
5
|
declare global {
|
|
6
6
|
interface Window {
|
|
7
7
|
visualDebug?: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ExcalidrawElement, ExcalidrawTextElement } from "@excalidraw/element/types";
|
|
2
2
|
import type App from "../components/App";
|
|
3
|
+
type SubmitHandler = () => void;
|
|
3
4
|
export declare const textWysiwyg: ({ id, onChange, onSubmit, getViewportCoords, element, canvas, excalidrawContainer, app, autoSelect, }: {
|
|
4
5
|
id: ExcalidrawElement["id"];
|
|
5
6
|
/**
|
|
@@ -19,4 +20,5 @@ export declare const textWysiwyg: ({ id, onChange, onSubmit, getViewportCoords,
|
|
|
19
20
|
excalidrawContainer: HTMLDivElement | null;
|
|
20
21
|
app: App;
|
|
21
22
|
autoSelect?: boolean | undefined;
|
|
22
|
-
}) =>
|
|
23
|
+
}) => SubmitHandler;
|
|
24
|
+
export {};
|