@zsviczian/excalidraw 0.18.0-1 → 0.18.0-2
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/README.md +1 -1
- package/dist/excalidraw.development.js +339 -361
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +0 -32
- package/dist/styles.development.css +2976 -2982
- package/dist/styles.production.css +23 -23
- package/package.json +1 -1
- package/types/excalidraw/actions/actionCanvas.d.ts +7 -7
- package/types/excalidraw/actions/actionDeleteSelected.d.ts +1 -1
- package/types/excalidraw/actions/actionExport.d.ts +8 -8
- package/types/excalidraw/actions/actionFrame.d.ts +51 -51
- package/types/excalidraw/actions/actionHistory.d.ts +1 -1
- package/types/excalidraw/actions/actionProperties.d.ts +2 -2
- package/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
- package/types/excalidraw/actions/manager.d.ts +1 -1
- package/types/excalidraw/actions/types.d.ts +2 -2
- package/types/excalidraw/animated-trail.d.ts +1 -1
- package/types/excalidraw/appState.d.ts +8 -8
- package/types/excalidraw/clipboard.d.ts +6 -6
- package/types/excalidraw/components/Actions.d.ts +2 -2
- package/types/excalidraw/components/App.d.ts +7 -7
- package/types/excalidraw/components/Avatar.d.ts +1 -1
- package/types/excalidraw/components/ButtonIcon.d.ts +1 -1
- package/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +3 -3
- package/types/excalidraw/components/ColorPicker/Picker.d.ts +1 -1
- package/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
- package/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -1
- package/types/excalidraw/components/ConfirmDialog.d.ts +1 -1
- package/types/excalidraw/components/ContextMenu.d.ts +2 -2
- package/types/excalidraw/components/DefaultSidebar.d.ts +1 -1
- package/types/excalidraw/components/DialogActionButton.d.ts +1 -1
- package/types/excalidraw/components/ElementLinkDialog.d.ts +2 -2
- package/types/excalidraw/components/EyeDropper.d.ts +1 -1
- package/types/excalidraw/components/FixedSideContainer.d.ts +1 -1
- package/types/excalidraw/components/FollowMode/FollowMode.d.ts +1 -1
- package/types/excalidraw/components/FontPicker/FontPicker.d.ts +1 -1
- package/types/excalidraw/components/FontPicker/FontPickerList.d.ts +2 -2
- package/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +1 -1
- package/types/excalidraw/components/HintViewer.d.ts +1 -1
- package/types/excalidraw/components/IconPicker.d.ts +1 -1
- package/types/excalidraw/components/ImageExportDialog.d.ts +2 -2
- package/types/excalidraw/components/InitializeApp.d.ts +1 -1
- package/types/excalidraw/components/Island.d.ts +1 -1
- package/types/excalidraw/components/JSONExportDialog.d.ts +2 -2
- package/types/excalidraw/components/LayerUI.d.ts +2 -2
- package/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -1
- package/types/excalidraw/components/LibraryMenuItems.d.ts +1 -1
- package/types/excalidraw/components/LibraryMenuSection.d.ts +2 -2
- package/types/excalidraw/components/LibraryUnit.d.ts +1 -1
- package/types/excalidraw/components/MagicButton.d.ts +1 -1
- package/types/excalidraw/components/MobileMenu.d.ts +2 -2
- package/types/excalidraw/components/PasteChartDialog.d.ts +1 -1
- package/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
- package/types/excalidraw/components/PublishLibrary.d.ts +1 -1
- package/types/excalidraw/components/SVGLayer.d.ts +1 -1
- package/types/excalidraw/components/Sidebar/SidebarTrigger.d.ts +1 -1
- package/types/excalidraw/components/Sidebar/common.d.ts +1 -1
- package/types/excalidraw/components/Stack.d.ts +1 -1
- package/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
- package/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
- package/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
- package/types/excalidraw/components/Stats/index.d.ts +1 -1
- package/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +1 -1
- package/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -1
- package/types/excalidraw/components/TTDDialog/common.d.ts +2 -2
- package/types/excalidraw/components/TextField.d.ts +1 -1
- package/types/excalidraw/components/Toast.d.ts +1 -1
- package/types/excalidraw/components/ToolButton.d.ts +2 -2
- package/types/excalidraw/components/Tooltip.d.ts +1 -1
- package/types/excalidraw/components/UserList.d.ts +1 -1
- package/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +3 -3
- package/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -1
- package/types/excalidraw/components/canvases/StaticCanvas.d.ts +3 -3
- package/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +1 -1
- package/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +1 -1
- package/types/excalidraw/components/hyperlink/Hyperlink.d.ts +2 -2
- package/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -1
- package/types/excalidraw/constants.d.ts +3 -3
- package/types/excalidraw/context/tunnels.d.ts +1 -1
- package/types/excalidraw/data/blob.d.ts +1 -1
- package/types/excalidraw/data/filesystem.d.ts +1 -1
- package/types/excalidraw/data/index.d.ts +1 -1
- package/types/excalidraw/data/library.d.ts +2 -2
- package/types/excalidraw/data/types.d.ts +2 -2
- package/types/excalidraw/element/ElementCanvasButtons.d.ts +1 -1
- package/types/excalidraw/element/binding.d.ts +5 -5
- package/types/excalidraw/element/bounds.d.ts +2 -2
- package/types/excalidraw/element/collision.d.ts +2 -2
- package/types/excalidraw/element/dragElements.d.ts +1 -1
- package/types/excalidraw/element/elbowArrow.d.ts +2 -2
- package/types/excalidraw/element/embeddable.d.ts +1 -1
- package/types/excalidraw/element/linearElementEditor.d.ts +4 -4
- package/types/excalidraw/element/resizeElements.d.ts +3 -3
- package/types/excalidraw/element/resizeTest.d.ts +3 -3
- package/types/excalidraw/element/showSelectedShapeActions.d.ts +1 -1
- package/types/excalidraw/element/textElement.d.ts +1 -1
- package/types/excalidraw/element/transformHandles.d.ts +5 -5
- package/types/excalidraw/element/utils.d.ts +1 -1
- package/types/excalidraw/frame.d.ts +3 -3
- package/types/excalidraw/history.d.ts +1 -1
- package/types/excalidraw/index.d.ts +4 -4
- package/types/excalidraw/laser-trails.d.ts +1 -1
- package/types/excalidraw/renderer/helpers.d.ts +1 -1
- package/types/excalidraw/renderer/renderElement.d.ts +1 -1
- package/types/excalidraw/renderer/staticSvgScene.d.ts +1 -1
- package/types/excalidraw/scene/Renderer.d.ts +1 -1
- package/types/excalidraw/scene/Scene.d.ts +2 -2
- package/types/excalidraw/scene/Shape.d.ts +2 -2
- package/types/excalidraw/scene/ShapeCache.d.ts +3 -3
- package/types/excalidraw/scene/scroll.d.ts +1 -1
- package/types/excalidraw/scene/scrollbars.d.ts +1 -1
- package/types/excalidraw/scene/types.d.ts +3 -3
- package/types/excalidraw/shapes.d.ts +1 -1
- package/types/excalidraw/snapping.d.ts +1 -1
- package/types/excalidraw/store.d.ts +1 -1
- package/types/excalidraw/types.d.ts +12 -12
- package/types/excalidraw/visualdebug.d.ts +1 -1
- package/types/utils/collision.d.ts +3 -3
- package/types/utils/export.d.ts +2 -2
- package/types/utils/geometry/shape.d.ts +1 -1
- package/types/utils/withinBounds.d.ts +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
2
2
|
import { type ElementUpdate } from "./mutateElement";
|
|
3
|
-
import { type ExcalidrawElbowArrowElement, type NonDeletedSceneElementsMap
|
|
3
|
+
import { type ExcalidrawElbowArrowElement, type NonDeletedSceneElementsMap } from "./types";
|
|
4
4
|
import type { FixedPointBinding, FixedSegment } from "./types";
|
|
5
5
|
export declare const BASE_PADDING = 40;
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
|
-
export declare const updateElbowArrowPoints: (arrow: Readonly<ExcalidrawElbowArrowElement>, elementsMap: NonDeletedSceneElementsMap
|
|
9
|
+
export declare const updateElbowArrowPoints: (arrow: Readonly<ExcalidrawElbowArrowElement>, elementsMap: NonDeletedSceneElementsMap, updates: {
|
|
10
10
|
points?: readonly LocalPoint[];
|
|
11
11
|
fixedSegments?: FixedSegment[] | null;
|
|
12
12
|
startBinding?: FixedPointBinding | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExcalidrawProps } from "../types";
|
|
2
|
-
import type { ExcalidrawElement, ExcalidrawIframeLikeElement, IframeData } from "./types";
|
|
3
2
|
import type { MarkRequired } from "../utility-types";
|
|
3
|
+
import type { ExcalidrawElement, ExcalidrawIframeLikeElement, IframeData } from "./types";
|
|
4
4
|
type IframeDataWithSandbox = MarkRequired<IframeData, "sandbox">;
|
|
5
5
|
export declare const createSrcDoc: (body: string) => string;
|
|
6
6
|
export declare const getEmbedLink: (link: string | null | undefined) => IframeDataWithSandbox | null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
2
2
|
import type { Bounds } from "./bounds";
|
|
3
|
-
import type {
|
|
4
|
-
import type { Store } from "../store";
|
|
3
|
+
import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap, SceneElementsMap, ExcalidrawElbowArrowElement } from "./types";
|
|
5
4
|
import type Scene from "../scene/Scene";
|
|
6
|
-
import
|
|
5
|
+
import type { Store } from "../store";
|
|
6
|
+
import type { AppState, PointerCoords, InteractiveCanvasAppState, AppClassProperties, NullableGridSize, Zoom } from "../types";
|
|
7
7
|
declare const editorMidPointsCache: {
|
|
8
8
|
version: number | null;
|
|
9
9
|
points: (GlobalPoint | null)[];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type LocalPoint } from "@excalidraw/math";
|
|
2
2
|
import type { BoundingBox } from "./bounds";
|
|
3
3
|
import type { MaybeTransformHandleType, TransformHandleDirection } from "./transformHandles";
|
|
4
|
-
import type {
|
|
4
|
+
import type { ExcalidrawLinearElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawElement, ElementsMap, SceneElementsMap } from "./types";
|
|
5
5
|
import type Scene from "../scene/Scene";
|
|
6
|
-
import {
|
|
6
|
+
import type { PointerDownState } from "../types";
|
|
7
7
|
export declare const transformElements: (originalElements: PointerDownState["originalElements"], transformHandleType: MaybeTransformHandleType, selectedElements: readonly NonDeletedExcalidrawElement[], elementsMap: SceneElementsMap, scene: Scene, shouldRotateWithDiscreteAngle: boolean, shouldResizeFromCenter: boolean, shouldMaintainAspectRatio: boolean, pointerX: number, pointerY: number, centerX: number, centerY: number) => boolean;
|
|
8
8
|
export declare const rescalePointsInElement: (element: NonDeletedExcalidrawElement, width: number, height: number, normalizePoints: boolean) => {
|
|
9
9
|
points: LocalPoint[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { MaybeTransformHandleType } from "./transformHandles";
|
|
1
|
+
import type { GlobalPoint, LocalPoint } from "@excalidraw/math";
|
|
3
2
|
import type { AppState, Device, Zoom } from "../types";
|
|
4
3
|
import type { Bounds } from "./bounds";
|
|
5
|
-
import type {
|
|
4
|
+
import type { MaybeTransformHandleType } from "./transformHandles";
|
|
5
|
+
import type { ExcalidrawElement, PointerType, NonDeletedExcalidrawElement, ElementsMap } from "./types";
|
|
6
6
|
export declare const resizeTest: <Point extends GlobalPoint | LocalPoint>(element: NonDeletedExcalidrawElement, elementsMap: ElementsMap, appState: AppState, x: number, y: number, zoom: Zoom, pointerType: PointerType, device: Device) => MaybeTransformHandleType;
|
|
7
7
|
export declare const getElementWithTransformHandleType: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, scenePointerX: number, scenePointerY: number, zoom: Zoom, pointerType: PointerType, elementsMap: ElementsMap, device: Device) => {
|
|
8
8
|
element: NonDeletedExcalidrawElement;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { NonDeletedExcalidrawElement } from "./types";
|
|
2
1
|
import type { UIAppState } from "../types";
|
|
2
|
+
import type { NonDeletedExcalidrawElement } from "./types";
|
|
3
3
|
export declare const showSelectedShapeActions: (appState: UIAppState, elements: readonly NonDeletedExcalidrawElement[]) => boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, NonDeletedExcalidrawElement } from "./types";
|
|
2
1
|
import type { MaybeTransformHandleType } from "./transformHandles";
|
|
2
|
+
import type { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, NonDeletedExcalidrawElement } from "./types";
|
|
3
3
|
import type { AppState } from "../types";
|
|
4
4
|
import type { ExtractSetType } from "../utility-types";
|
|
5
5
|
export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null, elementsMap: ElementsMap, informMutation?: boolean) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement, PointerType } from "./types";
|
|
2
|
-
import type { Bounds } from "./bounds";
|
|
3
|
-
import type { Device, InteractiveCanvasAppState, Zoom } from "../types";
|
|
4
1
|
import type { Radians } from "@excalidraw/math";
|
|
2
|
+
import type { Device, InteractiveCanvasAppState, Zoom } from "../types";
|
|
3
|
+
import type { Bounds } from "./bounds";
|
|
4
|
+
import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement, PointerType } from "./types";
|
|
5
5
|
export type TransformHandleDirection = "n" | "s" | "w" | "e" | "nw" | "ne" | "sw" | "se";
|
|
6
6
|
export type TransformHandleType = TransformHandleDirection | "rotation";
|
|
7
7
|
export type TransformHandle = Bounds;
|
|
@@ -31,8 +31,8 @@ export declare const OMIT_SIDES_FOR_FRAME: {
|
|
|
31
31
|
export declare const canResizeFromSides: (device: Device) => boolean;
|
|
32
32
|
export declare const getOmitSidesForDevice: (device: Device) => {};
|
|
33
33
|
export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2, cx, cy]: [number, number, number, number, number, number], angle: Radians, zoom: Zoom, pointerType: PointerType, omitSides?: {
|
|
34
|
-
s?: boolean | undefined;
|
|
35
34
|
e?: boolean | undefined;
|
|
35
|
+
s?: boolean | undefined;
|
|
36
36
|
w?: boolean | undefined;
|
|
37
37
|
n?: boolean | undefined;
|
|
38
38
|
nw?: boolean | undefined;
|
|
@@ -42,8 +42,8 @@ export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2, cx, cy]: [
|
|
|
42
42
|
rotation?: boolean | undefined;
|
|
43
43
|
}, margin?: number, spacing?: number) => TransformHandles;
|
|
44
44
|
export declare const getTransformHandles: (element: ExcalidrawElement, zoom: Zoom, elementsMap: ElementsMap, pointerType?: PointerType, omitSides?: {
|
|
45
|
-
s?: boolean | undefined;
|
|
46
45
|
e?: boolean | undefined;
|
|
46
|
+
s?: boolean | undefined;
|
|
47
47
|
w?: boolean | undefined;
|
|
48
48
|
n?: boolean | undefined;
|
|
49
49
|
nw?: boolean | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Curve, LineSegment } from "@excalidraw/math";
|
|
2
1
|
import { type GlobalPoint } from "@excalidraw/math";
|
|
2
|
+
import type { Curve, LineSegment } from "@excalidraw/math";
|
|
3
3
|
import type { ExcalidrawDiamondElement, ExcalidrawRectanguloidElement } from "./types";
|
|
4
4
|
/**
|
|
5
5
|
* Get the building components of a rectanguloid element in the form of
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted, NonDeletedExcalidrawElement } from "./element/types";
|
|
2
|
-
import type { AppClassProperties, AppState, StaticCanvasAppState } from "./types";
|
|
3
2
|
import type { ExcalidrawElementsIncludingDeleted } from "./scene/Scene";
|
|
3
|
+
import type { AppClassProperties, AppState, StaticCanvasAppState } from "./types";
|
|
4
4
|
import type { ReadonlySetLike } from "./utility-types";
|
|
5
5
|
export declare const bindElementsToFramesAfterDuplication: (nextElements: readonly ExcalidrawElement[], oldElements: readonly ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
|
|
6
6
|
export declare function isElementIntersectingFrame(element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap): boolean;
|
|
@@ -31,8 +31,8 @@ export declare const getFrameLikeElements: (allElements: ExcalidrawElementsInclu
|
|
|
31
31
|
*/
|
|
32
32
|
export declare const getRootElements: (allElements: ExcalidrawElementsIncludingDeleted) => ExcalidrawElement[];
|
|
33
33
|
export declare const getElementsInResizingFrame: (allElements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, appState: AppState, elementsMap: ElementsMap) => ExcalidrawElement[];
|
|
34
|
-
export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => (import("./element/types").
|
|
35
|
-
export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, allElementsMap: ElementsMap) => (import("./element/types").
|
|
34
|
+
export declare const getElementsInNewFrame: (elements: ExcalidrawElementsIncludingDeleted, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap) => (import("./element/types").ExcalidrawLinearElement | import("./element/types").ExcalidrawSelectionElement | import("./element/types").ExcalidrawRectangleElement | import("./element/types").ExcalidrawDiamondElement | import("./element/types").ExcalidrawEllipseElement | import("./element/types").ExcalidrawEmbeddableElement | import("./element/types").ExcalidrawIframeElement | import("./element/types").ExcalidrawImageElement | import("./element/types").ExcalidrawFrameElement | import("./element/types").ExcalidrawMagicFrameElement | import("./element/types").ExcalidrawTextElement | import("./element/types").ExcalidrawFreeDrawElement)[];
|
|
35
|
+
export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, allElementsMap: ElementsMap) => (import("./element/types").ExcalidrawLinearElement | import("./element/types").ExcalidrawSelectionElement | import("./element/types").ExcalidrawRectangleElement | import("./element/types").ExcalidrawDiamondElement | import("./element/types").ExcalidrawEllipseElement | import("./element/types").ExcalidrawEmbeddableElement | import("./element/types").ExcalidrawIframeElement | import("./element/types").ExcalidrawImageElement | import("./element/types").ExcalidrawFrameElement | import("./element/types").ExcalidrawMagicFrameElement | import("./element/types").ExcalidrawTextElement | import("./element/types").ExcalidrawFreeDrawElement)[];
|
|
36
36
|
export declare const getContainingFrame: (element: ExcalidrawElement, elementsMap: ElementsMap) => ExcalidrawFrameLikeElement | null;
|
|
37
37
|
/** */
|
|
38
38
|
export declare const filterElementsEligibleAsFrameChildren: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => ExcalidrawElement[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Emitter } from "./emitter";
|
|
1
2
|
import type { AppStateChange, ElementsChange } from "./change";
|
|
2
3
|
import type { SceneElementsMap } from "./element/types";
|
|
3
|
-
import { Emitter } from "./emitter";
|
|
4
4
|
import type { Snapshot } from "./store";
|
|
5
5
|
import type { AppState } from "./types";
|
|
6
6
|
export declare class HistoryChangedEvent {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import Footer from "./components/footer/FooterCenter";
|
|
3
|
+
import LiveCollaborationTrigger from "./components/live-collaboration/LiveCollaborationTrigger";
|
|
4
|
+
import MainMenu from "./components/main-menu/MainMenu";
|
|
5
|
+
import WelcomeScreen from "./components/welcome-screen/WelcomeScreen";
|
|
2
6
|
import "./css/app.scss";
|
|
3
7
|
import "./css/styles.scss";
|
|
4
8
|
import "./fonts/fonts.css";
|
|
5
9
|
import type { ExcalidrawProps } from "./types";
|
|
6
|
-
import Footer from "./components/footer/FooterCenter";
|
|
7
|
-
import MainMenu from "./components/main-menu/MainMenu";
|
|
8
|
-
import WelcomeScreen from "./components/welcome-screen/WelcomeScreen";
|
|
9
|
-
import LiveCollaborationTrigger from "./components/live-collaboration/LiveCollaborationTrigger";
|
|
10
10
|
export declare const Excalidraw: React.MemoExoticComponent<(props: ExcalidrawProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
11
|
export { getSceneVersion, hashElementsVersion, hashString, isInvisiblySmallElement, getNonDeletedElements, getTextFromElements, } from "./element";
|
|
12
12
|
export { defaultLang, useI18n, languages } from "./i18n";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Trail } from "./animated-trail";
|
|
2
1
|
import { AnimatedTrail } from "./animated-trail";
|
|
2
|
+
import type { Trail } from "./animated-trail";
|
|
3
3
|
import type { AnimationFrameHandler } from "./animation-frame-handler";
|
|
4
4
|
import type App from "./components/App";
|
|
5
5
|
export declare class LaserTrails implements Trail {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { StaticCanvasAppState, AppState } from "../types";
|
|
2
1
|
import type { StaticCanvasRenderConfig } from "../scene/types";
|
|
2
|
+
import type { StaticCanvasAppState, AppState } from "../types";
|
|
3
3
|
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke?: boolean) => void;
|
|
4
4
|
export declare const getNormalizedCanvasDimensions: (canvas: HTMLCanvasElement, scale: number) => [number, number];
|
|
5
5
|
export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normalizedHeight, theme, isExporting, viewBackgroundColor, }: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement, ExcalidrawImageElement, ExcalidrawFrameLikeElement, NonDeletedSceneElementsMap } from "../element/types";
|
|
2
|
-
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
3
2
|
import type { StaticCanvasRenderConfig, RenderableElementsMap, InteractiveCanvasRenderConfig } from "../scene/types";
|
|
4
3
|
import type { AppState, StaticCanvasAppState, InteractiveCanvasAppState, ElementsPendingErasure, PendingExcalidrawElements } from "../types";
|
|
4
|
+
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
5
5
|
export declare const IMAGE_INVERT_FILTER = "invert(100%) hue-rotate(180deg) saturate(1.25)";
|
|
6
6
|
export declare const getRenderOpacity: (element: ExcalidrawElement, containingFrame: ExcalidrawFrameLikeElement | null, elementsPendingErasure: ElementsPendingErasure, pendingNodes: Readonly<PendingExcalidrawElements> | null, globalAlpha?: number) => number;
|
|
7
7
|
export interface ExcalidrawElementWithCanvas {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RoughSVG } from "roughjs/bin/svg";
|
|
2
1
|
import type { NonDeletedExcalidrawElement } from "../element/types";
|
|
3
2
|
import type { RenderableElementsMap, SVGRenderConfig } from "../scene/types";
|
|
4
3
|
import type { BinaryFiles } from "../types";
|
|
4
|
+
import type { RoughSVG } from "roughjs/bin/svg";
|
|
5
5
|
export declare const renderSceneToSvg: (elements: readonly NonDeletedExcalidrawElement[], elementsMap: RenderableElementsMap, rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, renderConfig: SVGRenderConfig) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type Scene from "./Scene";
|
|
1
2
|
import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
|
|
2
3
|
import type { AppState } from "../types";
|
|
3
|
-
import type Scene from "./Scene";
|
|
4
4
|
export declare class Renderer {
|
|
5
5
|
private scene;
|
|
6
6
|
constructor(scene: Scene);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawFrameLikeElement, ElementsMapOrArray, OrderedExcalidrawElement, Ordered } from "../element/types";
|
|
2
1
|
import type { LinearElementEditor } from "../element/linearElementEditor";
|
|
2
|
+
import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawFrameLikeElement, ElementsMapOrArray, OrderedExcalidrawElement, Ordered } from "../element/types";
|
|
3
3
|
import type { AppState } from "../types";
|
|
4
4
|
type ElementIdKey = InstanceType<typeof LinearElementEditor>["elementId"];
|
|
5
5
|
type ElementKey = ExcalidrawElement | ElementIdKey;
|
|
@@ -73,7 +73,7 @@ declare class Scene {
|
|
|
73
73
|
getElementIndex(elementId: string): number;
|
|
74
74
|
getContainerElement: (element: (ExcalidrawElement & {
|
|
75
75
|
containerId: ExcalidrawElement["id"] | null;
|
|
76
|
-
}) | null) => import("../element/types").
|
|
76
|
+
}) | null) => import("../element/types").ExcalidrawLinearElement | import("../element/types").ExcalidrawSelectionElement | import("../element/types").ExcalidrawRectangleElement | import("../element/types").ExcalidrawDiamondElement | import("../element/types").ExcalidrawEllipseElement | import("../element/types").ExcalidrawEmbeddableElement | import("../element/types").ExcalidrawIframeElement | import("../element/types").ExcalidrawImageElement | import("../element/types").ExcalidrawFrameElement | import("../element/types").ExcalidrawMagicFrameElement | import("../element/types").ExcalidrawTextElement | import("../element/types").ExcalidrawFreeDrawElement | null;
|
|
77
77
|
getElementsFromId: (id: string) => ExcalidrawElement[];
|
|
78
78
|
}
|
|
79
79
|
export default Scene;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Drawable, Options } from "roughjs/bin/core";
|
|
2
|
-
import type { RoughGenerator } from "roughjs/bin/generator";
|
|
3
1
|
import type { ExcalidrawElement, NonDeletedExcalidrawElement, ExcalidrawSelectionElement } from "../element/types";
|
|
4
2
|
import type { EmbedsValidationStatus } from "../types";
|
|
3
|
+
import type { Drawable, Options } from "roughjs/bin/core";
|
|
4
|
+
import type { RoughGenerator } from "roughjs/bin/generator";
|
|
5
5
|
export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean) => Options;
|
|
6
6
|
/**
|
|
7
7
|
* Generates the roughjs shape for given element.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Drawable } from "roughjs/bin/core";
|
|
2
1
|
import type { ExcalidrawElement } from "../element/types";
|
|
3
|
-
import type { ElementShape, ElementShapes } from "./types";
|
|
4
2
|
import type { AppState, EmbedsValidationStatus } from "../types";
|
|
3
|
+
import type { ElementShape, ElementShapes } from "./types";
|
|
4
|
+
import type { Drawable } from "roughjs/bin/core";
|
|
5
5
|
export declare class ShapeCache {
|
|
6
6
|
private static rg;
|
|
7
7
|
private static cache;
|
|
@@ -17,7 +17,7 @@ export declare class ShapeCache {
|
|
|
17
17
|
* Generates & caches shape for element if not already cached, otherwise
|
|
18
18
|
* returns cached shape.
|
|
19
19
|
*/
|
|
20
|
-
static generateElementShape: <T extends import("../element/types").
|
|
20
|
+
static generateElementShape: <T extends import("../element/types").ExcalidrawLinearElement | import("../element/types").ExcalidrawRectangleElement | import("../element/types").ExcalidrawDiamondElement | import("../element/types").ExcalidrawEllipseElement | import("../element/types").ExcalidrawEmbeddableElement | import("../element/types").ExcalidrawIframeElement | import("../element/types").ExcalidrawImageElement | import("../element/types").ExcalidrawFrameElement | import("../element/types").ExcalidrawMagicFrameElement | import("../element/types").ExcalidrawTextElement | import("../element/types").ExcalidrawFreeDrawElement | import("../element/types").ExcalidrawArrowElement>(element: T, renderConfig: {
|
|
21
21
|
isExporting: boolean;
|
|
22
22
|
canvasBackgroundColor: AppState["viewBackgroundColor"];
|
|
23
23
|
embedsValidationStatus: EmbedsValidationStatus;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AppState, Offsets, PointerCoords, Zoom } from "../types";
|
|
2
1
|
import type { ExcalidrawElement } from "../element/types";
|
|
2
|
+
import type { AppState, Offsets, PointerCoords, Zoom } from "../types";
|
|
3
3
|
export declare const centerScrollOn: ({ scenePoint, viewportDimensions, zoom, offsets, }: {
|
|
4
4
|
scenePoint: PointerCoords;
|
|
5
5
|
viewportDimensions: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { ExcalidrawElement } from "../element/types";
|
|
1
2
|
import type { InteractiveCanvasAppState } from "../types";
|
|
2
3
|
import type { ScrollBars } from "./types";
|
|
3
|
-
import type { ExcalidrawElement } from "../element/types";
|
|
4
4
|
export declare const SCROLLBAR_MARGIN = 4;
|
|
5
5
|
export declare const SCROLLBAR_WIDTH = 6;
|
|
6
6
|
export declare const SCROLLBAR_COLOR = "rgba(128,128,128,0.3)";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Drawable } from "roughjs/bin/core";
|
|
1
|
+
import type { UserIdleState } from "../constants";
|
|
3
2
|
import type { ExcalidrawElement, NonDeletedElementsMap, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap } from "../element/types";
|
|
4
3
|
import type { AppClassProperties, AppState, EmbedsValidationStatus, ElementsPendingErasure, InteractiveCanvasAppState, StaticCanvasAppState, SocketId, Device, PendingExcalidrawElements } from "../types";
|
|
5
4
|
import type { MakeBrand } from "../utility-types";
|
|
6
|
-
import type {
|
|
5
|
+
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
6
|
+
import type { Drawable } from "roughjs/bin/core";
|
|
7
7
|
export type RenderableElementsMap = NonDeletedElementsMap & MakeBrand<"RenderableElementsMap">;
|
|
8
8
|
export type StaticCanvasRenderConfig = {
|
|
9
9
|
canvasBackgroundColor: AppState["viewBackgroundColor"];
|
|
@@ -64,7 +64,7 @@ export declare const SHAPES: readonly [{
|
|
|
64
64
|
readonly numericKey: "0";
|
|
65
65
|
readonly fillable: false;
|
|
66
66
|
}];
|
|
67
|
-
export declare const findShapeByKey: (key: string) => "
|
|
67
|
+
export declare const findShapeByKey: (key: string) => "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | null;
|
|
68
68
|
/**
|
|
69
69
|
* get the pure geometric shape of an excalidraw element
|
|
70
70
|
* which is then used for hit detection
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { InclusiveRange } from "@excalidraw/math";
|
|
2
1
|
import { type GlobalPoint } from "@excalidraw/math";
|
|
2
|
+
import type { InclusiveRange } from "@excalidraw/math";
|
|
3
3
|
import type { Bounds } from "./element/bounds";
|
|
4
4
|
import type { MaybeTransformHandleType } from "./element/transformHandles";
|
|
5
5
|
import type { ElementsMap, ExcalidrawElement, NonDeletedExcalidrawElement } from "./element/types";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppStateChange, ElementsChange } from "./change";
|
|
2
|
-
import type { OrderedExcalidrawElement } from "./element/types";
|
|
3
2
|
import { Emitter } from "./emitter";
|
|
3
|
+
import type { OrderedExcalidrawElement } from "./element/types";
|
|
4
4
|
import type { AppState, ObservedAppState } from "./types";
|
|
5
5
|
import type { ValueOf } from "./utility-types";
|
|
6
6
|
export declare const getObservedAppState: (appState: AppState) => ObservedAppState;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import type { JSX } from "react";
|
|
2
|
-
import type React from "react";
|
|
3
|
-
import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, ExcalidrawTextElement, FileId, ExcalidrawImageElement, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement } from "./element/types";
|
|
4
1
|
import type { Action } from "./actions/types";
|
|
5
|
-
import type { LinearElementEditor } from "./element/linearElementEditor";
|
|
6
|
-
import type { SuggestedBinding } from "./element/binding";
|
|
7
|
-
import type { ImportedDataState } from "./data/types";
|
|
8
|
-
import type App from "./components/App";
|
|
9
|
-
import type { throttleRAF } from "./utils";
|
|
10
2
|
import type { Spreadsheet } from "./charts";
|
|
11
|
-
import type { Language } from "./i18n";
|
|
12
3
|
import type { ClipboardData } from "./clipboard";
|
|
13
|
-
import type
|
|
14
|
-
import type { MaybeTransformHandleType } from "./element/transformHandles";
|
|
4
|
+
import type App from "./components/App";
|
|
15
5
|
import type Library from "./data/library";
|
|
16
6
|
import type { FileSystemHandle } from "./data/filesystem";
|
|
17
7
|
import type { IMAGE_MIME_TYPES, MIME_TYPES } from "./constants";
|
|
18
8
|
import type { ContextMenuItems } from "./components/ContextMenu";
|
|
19
9
|
import type { SnapLine } from "./snapping";
|
|
20
10
|
import type { Merge, MaybePromise, ValueOf, MakeBrand } from "./utility-types";
|
|
21
|
-
import type { ColorPaletteCustom } from "./colors";
|
|
22
11
|
import type { CaptureUpdateActionType } from "./store";
|
|
12
|
+
import type { ColorPaletteCustom } from "./colors";
|
|
23
13
|
import type { UserIdleState } from "./constants";
|
|
14
|
+
import type { ImportedDataState } from "./data/types";
|
|
15
|
+
import type { SuggestedBinding } from "./element/binding";
|
|
16
|
+
import type { LinearElementEditor } from "./element/linearElementEditor";
|
|
17
|
+
import type { MaybeTransformHandleType } from "./element/transformHandles";
|
|
18
|
+
import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, ExcalidrawTextElement, FileId, ExcalidrawImageElement, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement } from "./element/types";
|
|
19
|
+
import type { Language } from "./i18n";
|
|
20
|
+
import type { isOverScrollBars } from "./scene/scrollbars";
|
|
21
|
+
import type { throttleRAF } from "./utils";
|
|
22
|
+
import type React from "react";
|
|
23
|
+
import type { JSX } from "react";
|
|
24
24
|
export type SocketId = string & {
|
|
25
25
|
_brand: "SocketId";
|
|
26
26
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Curve } from "@excalidraw/math";
|
|
2
1
|
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
2
|
+
import type { Curve } from "@excalidraw/math";
|
|
3
3
|
import type { LineSegment } from "@excalidraw/utils";
|
|
4
4
|
import type { Bounds } from "./element/bounds";
|
|
5
5
|
declare global {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Polyline } from "./geometry/shape";
|
|
2
|
-
import { type GeometricShape } from "./geometry/shape";
|
|
3
|
-
import type { Curve } from "@excalidraw/math";
|
|
4
1
|
import { type GlobalPoint, type LocalPoint, type Polygon } from "@excalidraw/math";
|
|
2
|
+
import type { Curve } from "@excalidraw/math";
|
|
3
|
+
import { type GeometricShape } from "./geometry/shape";
|
|
4
|
+
import type { Polyline } from "./geometry/shape";
|
|
5
5
|
export declare const isPointOnShape: <Point extends GlobalPoint | LocalPoint>(point: Point, shape: GeometricShape<Point>, tolerance?: number) => boolean;
|
|
6
6
|
export declare const isPointInShape: <Point extends GlobalPoint | LocalPoint>(point: Point, shape: GeometricShape<Point>) => boolean;
|
|
7
7
|
export declare const isPointInBounds: <Point extends GlobalPoint | LocalPoint>(point: Point, bounds: Polygon<Point>) => boolean;
|
package/types/utils/export.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AppState, BinaryFiles } from "@excalidraw/excalidraw/types";
|
|
2
|
-
import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted } from "@excalidraw/excalidraw/element/types";
|
|
3
1
|
import { MIME_TYPES } from "@excalidraw/excalidraw/constants";
|
|
2
|
+
import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted } from "@excalidraw/excalidraw/element/types";
|
|
3
|
+
import type { AppState, BinaryFiles } from "@excalidraw/excalidraw/types";
|
|
4
4
|
export { MIME_TYPES };
|
|
5
5
|
type ExportOpts = {
|
|
6
6
|
elements: readonly NonDeleted<ExcalidrawElement>[];
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* also included in this file are methods for converting an Excalidraw element or a Drawable from roughjs
|
|
12
12
|
* to pure shapes
|
|
13
13
|
*/
|
|
14
|
-
import type { Curve, LineSegment, Polygon, Radians } from "@excalidraw/math";
|
|
15
14
|
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
16
15
|
import type { ElementsMap, ExcalidrawBindableElement, ExcalidrawDiamondElement, ExcalidrawElement, ExcalidrawEllipseElement, ExcalidrawEmbeddableElement, ExcalidrawFrameLikeElement, ExcalidrawFreeDrawElement, ExcalidrawIframeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawRectangleElement, ExcalidrawSelectionElement, ExcalidrawTextElement } from "@excalidraw/excalidraw/element/types";
|
|
16
|
+
import type { Curve, LineSegment, Polygon, Radians } from "@excalidraw/math";
|
|
17
17
|
import type { Drawable, Op } from "roughjs/bin/core";
|
|
18
18
|
export type Polyline<Point extends GlobalPoint | LocalPoint> = LineSegment<Point>[];
|
|
19
19
|
export type Polycurve<Point extends GlobalPoint | LocalPoint> = Curve<Point>[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/excalidraw/element/types";
|
|
2
1
|
import type { Bounds } from "@excalidraw/excalidraw/element/bounds";
|
|
2
|
+
import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/excalidraw/element/types";
|
|
3
3
|
type Element = NonDeletedExcalidrawElement;
|
|
4
4
|
type Elements = readonly NonDeletedExcalidrawElement[];
|
|
5
5
|
export declare const isElementInsideBBox: (element: Element, bbox: Bounds, eitherDirection?: boolean) => boolean;
|