@excalidraw/excalidraw 0.18.0-58f7d33 → 0.18.0-5fffc47
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-CP5DND7P.js +7 -0
- package/dist/dev/chunk-CP5DND7P.js.map +7 -0
- package/dist/dev/{chunk-X3RYHLJU.js → chunk-PWQMCSHA.js} +26 -8
- package/dist/dev/chunk-PWQMCSHA.js.map +7 -0
- package/dist/dev/chunk-YMRX7R7U.js +5671 -0
- package/dist/dev/chunk-YMRX7R7U.js.map +7 -0
- package/dist/dev/data/{image-U2IPNUKJ.js → image-L23D26XS.js} +3 -3
- package/dist/dev/index.css +964 -501
- package/dist/dev/index.css.map +3 -3
- package/dist/dev/index.js +11915 -10771
- package/dist/dev/index.js.map +4 -4
- package/dist/dev/locales/{en-CKWC2GMK.js → en-V3NQTBPG.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-A66AFZZU.js +7 -0
- package/dist/prod/chunk-GF46JCB3.js +12 -0
- package/dist/prod/chunk-HT4FKTIQ.js +4 -0
- package/dist/prod/data/image-NWF7UX55.js +1 -0
- package/dist/prod/index.css +1 -1
- package/dist/prod/index.js +25 -17
- package/dist/prod/locales/{en-SBO6ZHT2.js → en-LQE6K457.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 +44 -7
- 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 +20 -4
- package/dist/types/{excalidraw/scene → element/src}/Scene.d.ts +16 -15
- package/dist/types/element/src/align.d.ts +4 -3
- package/dist/types/element/src/binding.d.ts +26 -16
- package/dist/types/element/src/bounds.d.ts +14 -6
- package/dist/types/element/src/collision.d.ts +18 -12
- package/dist/types/element/src/cropElement.d.ts +1 -1
- package/dist/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +77 -40
- package/dist/types/element/src/distance.d.ts +2 -2
- package/dist/types/element/src/distribute.d.ts +2 -1
- 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 +9 -3
- package/dist/types/element/src/frame.d.ts +5 -4
- package/dist/types/element/src/groups.d.ts +1 -0
- package/dist/types/element/src/index.d.ts +44 -2
- package/dist/types/element/src/linearElementEditor.d.ts +23 -36
- package/dist/types/element/src/mutateElement.d.ts +11 -3
- package/dist/types/element/src/newElement.d.ts +4 -3
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/element/src/renderElement.d.ts +4 -1
- package/dist/types/element/src/resizeElements.d.ts +5 -4
- package/dist/types/element/src/selection.d.ts +11 -5
- package/dist/types/element/src/shape.d.ts +42 -0
- package/dist/types/element/src/sizeHelpers.d.ts +2 -2
- package/dist/types/element/src/store.d.ts +237 -0
- package/dist/types/element/src/textElement.d.ts +4 -3
- package/dist/types/element/src/typeChecks.d.ts +19 -1
- package/dist/types/element/src/types.d.ts +15 -2
- package/dist/types/element/src/utils.d.ts +16 -6
- package/dist/types/element/src/zindex.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +57 -54
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +38 -36
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +256 -242
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +114 -106
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +19 -18
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +57 -53
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +18 -17
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +53 -52
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +19 -18
- package/dist/types/excalidraw/actions/actionExport.d.ts +181 -172
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +85 -42
- package/dist/types/excalidraw/actions/actionFrame.d.ts +123 -119
- package/dist/types/excalidraw/actions/actionGroup.d.ts +38 -36
- package/dist/types/excalidraw/actions/actionHistory.d.ts +1 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +545 -20
- package/dist/types/excalidraw/actions/actionLink.d.ts +18 -17
- package/dist/types/excalidraw/actions/actionMenu.d.ts +18 -391
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +38 -36
- package/dist/types/excalidraw/actions/actionProperties.d.ts +305 -273
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +19 -18
- package/dist/types/excalidraw/actions/actionStyles.d.ts +19 -18
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +19 -18
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +19 -18
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +18 -190
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +19 -18
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +19 -18
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +19 -18
- package/dist/types/excalidraw/actions/index.d.ts +2 -2
- package/dist/types/excalidraw/actions/types.d.ts +4 -3
- package/dist/types/excalidraw/appState.d.ts +23 -10
- package/dist/types/excalidraw/clipboard.d.ts +64 -1
- package/dist/types/excalidraw/components/Actions.d.ts +17 -7
- package/dist/types/excalidraw/components/App.d.ts +35 -22
- 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 +6 -1
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +4 -3
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +3 -3
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +3 -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/CommandPalette/CommandPalette.d.ts +1 -0
- 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/Ellipsify.d.ts +4 -0
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
- package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
- package/dist/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
- package/dist/types/excalidraw/components/MobileMenu.d.ts +3 -5
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +11 -0
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
- 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 +12 -2
- 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/TTDDialog/TTDDialogTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/TextField.d.ts +1 -0
- package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
- 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/dropdownMenu/DropdownMenu.d.ts +4 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
- 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 +8 -0
- package/dist/types/excalidraw/components/shapes.d.ts +129 -1
- package/dist/types/excalidraw/data/blob.d.ts +3 -7
- package/dist/types/excalidraw/data/reconcile.d.ts +1 -0
- package/dist/types/excalidraw/data/restore.d.ts +6 -1
- package/dist/types/excalidraw/data/transform.d.ts +1 -1
- package/dist/types/excalidraw/data/types.d.ts +4 -1
- package/dist/types/excalidraw/editor-jotai.d.ts +6 -6
- package/dist/types/excalidraw/eraser/index.d.ts +0 -2
- package/dist/types/excalidraw/fonts/Fonts.d.ts +1 -1
- package/dist/types/excalidraw/history.d.ts +30 -22
- package/dist/types/excalidraw/hooks/useEmitter.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/index.d.ts +11 -10
- package/dist/types/excalidraw/lasso/index.d.ts +1 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +2 -1
- package/dist/types/excalidraw/renderer/helpers.d.ts +7 -2
- package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
- package/dist/types/excalidraw/scene/Renderer.d.ts +1 -2
- 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 +46 -16
- 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/constants.d.ts +3 -0
- package/dist/types/math/src/curve.d.ts +34 -0
- package/dist/types/math/src/index.d.ts +1 -0
- package/dist/types/math/src/point.d.ts +1 -1
- package/dist/types/math/src/rectangle.d.ts +2 -0
- package/dist/types/math/src/segment.d.ts +1 -0
- package/dist/types/math/src/vector.d.ts +8 -2
- 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 +146 -109
- package/package.json +13 -10
- package/dist/dev/chunk-KKJLIRJU.js +0 -7
- package/dist/dev/chunk-KKJLIRJU.js.map +0 -7
- package/dist/dev/chunk-LEJJ2YZY.js +0 -18711
- package/dist/dev/chunk-LEJJ2YZY.js.map +0 -7
- package/dist/dev/chunk-X3RYHLJU.js.map +0 -7
- package/dist/prod/chunk-IUH5AXLB.js +0 -12
- package/dist/prod/chunk-QUX7WTVH.js +0 -7
- package/dist/prod/chunk-RQK6WG4F.js +0 -33
- package/dist/prod/data/image-UQDATCXC.js +0 -1
- package/dist/types/element/src/Shape.d.ts +0 -17
- package/dist/types/element/src/ShapeCache.d.ts +0 -25
- package/dist/types/element/src/shapes.d.ts +0 -23
- package/dist/types/excalidraw/components/ButtonSelect.d.ts +0 -9
- package/dist/types/excalidraw/store.d.ts +0 -129
- package/dist/types/excalidraw/visualdebug.d.ts +0 -41
- package/dist/types/utils/src/collision.d.ts +0 -8
- /package/dist/dev/data/{image-U2IPNUKJ.js.map → image-L23D26XS.js.map} +0 -0
- /package/dist/dev/locales/{en-CKWC2GMK.js.map → en-V3NQTBPG.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ih as a,jh as b,kh as c}from"../chunk-RQK6WG4F.js";import"../chunk-QUX7WTVH.js";import"../chunk-SRAX5OIU.js";export{c as decodePngMetadata,b as encodePngMetadata,a as getTEXtChunk};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { EmbedsValidationStatus } from "@excalidraw/excalidraw/types";
|
|
2
|
-
import type { ExcalidrawElement, NonDeletedExcalidrawElement, ExcalidrawSelectionElement } from "./types";
|
|
3
|
-
import type { Drawable, Options } from "roughjs/bin/core";
|
|
4
|
-
import type { RoughGenerator } from "roughjs/bin/generator";
|
|
5
|
-
export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean) => Options;
|
|
6
|
-
/**
|
|
7
|
-
* Generates the roughjs shape for given element.
|
|
8
|
-
*
|
|
9
|
-
* Low-level. Use `ShapeCache.generateElementShape` instead.
|
|
10
|
-
*
|
|
11
|
-
* @private
|
|
12
|
-
*/
|
|
13
|
-
export declare const _generateElementShape: (element: Exclude<NonDeletedExcalidrawElement, ExcalidrawSelectionElement>, generator: RoughGenerator, { isExporting, canvasBackgroundColor, embedsValidationStatus, }: {
|
|
14
|
-
isExporting: boolean;
|
|
15
|
-
canvasBackgroundColor: string;
|
|
16
|
-
embedsValidationStatus: EmbedsValidationStatus | null;
|
|
17
|
-
}) => Drawable | Drawable[] | null;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { AppState, EmbedsValidationStatus } from "@excalidraw/excalidraw/types";
|
|
2
|
-
import type { ElementShape, ElementShapes } from "@excalidraw/excalidraw/scene/types";
|
|
3
|
-
import type { ExcalidrawElement } from "./types";
|
|
4
|
-
import type { Drawable } from "roughjs/bin/core";
|
|
5
|
-
export declare class ShapeCache {
|
|
6
|
-
private static rg;
|
|
7
|
-
private static cache;
|
|
8
|
-
/**
|
|
9
|
-
* Retrieves shape from cache if available. Use this only if shape
|
|
10
|
-
* is optional and you have a fallback in case it's not cached.
|
|
11
|
-
*/
|
|
12
|
-
static get: <T extends ExcalidrawElement>(element: T) => T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : ElementShape | undefined;
|
|
13
|
-
static set: <T extends ExcalidrawElement>(element: T, shape: T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] : Drawable) => WeakMap<ExcalidrawElement, ElementShape>;
|
|
14
|
-
static delete: (element: ExcalidrawElement) => boolean;
|
|
15
|
-
static destroy: () => void;
|
|
16
|
-
/**
|
|
17
|
-
* Generates & caches shape for element if not already cached, otherwise
|
|
18
|
-
* returns cached shape.
|
|
19
|
-
*/
|
|
20
|
-
static generateElementShape: <T extends import("./types").ExcalidrawRectangleElement | import("./types").ExcalidrawDiamondElement | import("./types").ExcalidrawFrameElement | import("./types").ExcalidrawMagicFrameElement | import("./types").ExcalidrawEmbeddableElement | import("./types").ExcalidrawImageElement | import("./types").ExcalidrawIframeElement | import("./types").ExcalidrawTextElement | import("./types").ExcalidrawEllipseElement | import("./types").ExcalidrawLinearElement | import("./types").ExcalidrawArrowElement | import("./types").ExcalidrawFreeDrawElement>(element: T, renderConfig: {
|
|
21
|
-
isExporting: boolean;
|
|
22
|
-
canvasBackgroundColor: AppState["viewBackgroundColor"];
|
|
23
|
-
embedsValidationStatus: EmbedsValidationStatus;
|
|
24
|
-
} | null) => ((T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : ElementShape | undefined) & ({} | null)) | (T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] : Drawable | null);
|
|
25
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
2
|
-
import { type GeometricShape } from "@excalidraw/utils/shape";
|
|
3
|
-
import type { Zoom } from "@excalidraw/excalidraw/types";
|
|
4
|
-
import { type Bounds } from "./bounds";
|
|
5
|
-
import type { ElementsMap, ExcalidrawElement, ExcalidrawLinearElement, NonDeleted } from "./types";
|
|
6
|
-
/**
|
|
7
|
-
* get the pure geometric shape of an excalidraw elementw
|
|
8
|
-
* which is then used for hit detection
|
|
9
|
-
*/
|
|
10
|
-
export declare const getElementShape: <Point extends GlobalPoint | LocalPoint>(element: ExcalidrawElement, elementsMap: ElementsMap) => GeometricShape<Point>;
|
|
11
|
-
export declare const getBoundTextShape: <Point extends GlobalPoint | LocalPoint>(element: ExcalidrawElement, elementsMap: ElementsMap) => GeometricShape<Point> | null;
|
|
12
|
-
export declare const getControlPointsForBezierCurve: <P extends GlobalPoint | LocalPoint>(element: NonDeleted<ExcalidrawLinearElement>, endPoint: P) => P[] | null;
|
|
13
|
-
export declare const getBezierXY: <P extends GlobalPoint | LocalPoint>(p0: P, p1: P, p2: P, p3: P, t: number) => P;
|
|
14
|
-
export declare const getBezierCurveLength: <P extends GlobalPoint | LocalPoint>(element: NonDeleted<ExcalidrawLinearElement>, endPoint: P) => number;
|
|
15
|
-
export declare const mapIntervalToBezierT: <P extends GlobalPoint | LocalPoint>(element: NonDeleted<ExcalidrawLinearElement>, endPoint: P, interval: number) => number;
|
|
16
|
-
/**
|
|
17
|
-
* Get the axis-aligned bounding box for a given element
|
|
18
|
-
*/
|
|
19
|
-
export declare const aabbForElement: (element: Readonly<ExcalidrawElement>, offset?: [number, number, number, number]) => Bounds;
|
|
20
|
-
export declare const pointInsideBounds: <P extends GlobalPoint | LocalPoint>(p: P, bounds: Bounds) => boolean;
|
|
21
|
-
export declare const aabbsOverlapping: (a: Bounds, b: Bounds) => boolean;
|
|
22
|
-
export declare const getCornerRadius: (x: number, element: ExcalidrawElement) => number;
|
|
23
|
-
export declare const isPathALoop: (points: ExcalidrawLinearElement["points"], zoomValue?: Zoom["value"]) => boolean;
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import type { OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type { ValueOf } from "@excalidraw/common/utility-types";
|
|
3
|
-
import { AppStateChange, ElementsChange } from "./change";
|
|
4
|
-
import { Emitter } from "./emitter";
|
|
5
|
-
import type { AppState, ObservedAppState } from "./types";
|
|
6
|
-
export declare const getObservedAppState: (appState: AppState) => ObservedAppState;
|
|
7
|
-
export declare const CaptureUpdateAction: {
|
|
8
|
-
/**
|
|
9
|
-
* Immediately undoable.
|
|
10
|
-
*
|
|
11
|
-
* Use for updates which should be captured.
|
|
12
|
-
* Should be used for most of the local updates.
|
|
13
|
-
*
|
|
14
|
-
* These updates will _immediately_ make it to the local undo / redo stacks.
|
|
15
|
-
*/
|
|
16
|
-
readonly IMMEDIATELY: "IMMEDIATELY";
|
|
17
|
-
/**
|
|
18
|
-
* Never undoable.
|
|
19
|
-
*
|
|
20
|
-
* Use for updates which should never be recorded, such as remote updates
|
|
21
|
-
* or scene initialization.
|
|
22
|
-
*
|
|
23
|
-
* These updates will _never_ make it to the local undo / redo stacks.
|
|
24
|
-
*/
|
|
25
|
-
readonly NEVER: "NEVER";
|
|
26
|
-
/**
|
|
27
|
-
* Eventually undoable.
|
|
28
|
-
*
|
|
29
|
-
* Use for updates which should not be captured immediately - likely
|
|
30
|
-
* exceptions which are part of some async multi-step process. Otherwise, all
|
|
31
|
-
* such updates would end up being captured with the next
|
|
32
|
-
* `CaptureUpdateAction.IMMEDIATELY` - triggered either by the next `updateScene`
|
|
33
|
-
* or internally by the editor.
|
|
34
|
-
*
|
|
35
|
-
* These updates will _eventually_ make it to the local undo / redo stacks.
|
|
36
|
-
*/
|
|
37
|
-
readonly EVENTUALLY: "EVENTUALLY";
|
|
38
|
-
};
|
|
39
|
-
export type CaptureUpdateActionType = ValueOf<typeof CaptureUpdateAction>;
|
|
40
|
-
/**
|
|
41
|
-
* Represent an increment to the Store.
|
|
42
|
-
*/
|
|
43
|
-
declare class StoreIncrementEvent {
|
|
44
|
-
readonly elementsChange: ElementsChange;
|
|
45
|
-
readonly appStateChange: AppStateChange;
|
|
46
|
-
constructor(elementsChange: ElementsChange, appStateChange: AppStateChange);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Store which captures the observed changes and emits them as `StoreIncrementEvent` events.
|
|
50
|
-
*
|
|
51
|
-
* @experimental this interface is experimental and subject to change.
|
|
52
|
-
*/
|
|
53
|
-
export interface IStore {
|
|
54
|
-
onStoreIncrementEmitter: Emitter<[StoreIncrementEvent]>;
|
|
55
|
-
get snapshot(): Snapshot;
|
|
56
|
-
set snapshot(snapshot: Snapshot);
|
|
57
|
-
/**
|
|
58
|
-
* Use to schedule update of the snapshot, useful on updates for which we don't need to calculate increments (i.e. remote updates).
|
|
59
|
-
*/
|
|
60
|
-
shouldUpdateSnapshot(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Use to schedule calculation of a store increment.
|
|
63
|
-
*/
|
|
64
|
-
shouldCaptureIncrement(): void;
|
|
65
|
-
/**
|
|
66
|
-
* Based on the scheduled operation, either only updates store snapshot or also calculates increment and emits the result as a `StoreIncrementEvent`.
|
|
67
|
-
*
|
|
68
|
-
* @emits StoreIncrementEvent when increment is calculated.
|
|
69
|
-
*/
|
|
70
|
-
commit(elements: Map<string, OrderedExcalidrawElement> | undefined, appState: AppState | ObservedAppState | undefined): void;
|
|
71
|
-
/**
|
|
72
|
-
* Clears the store instance.
|
|
73
|
-
*/
|
|
74
|
-
clear(): void;
|
|
75
|
-
/**
|
|
76
|
-
* Filters out yet uncomitted elements from `nextElements`, which are part of in-progress local async actions (ephemerals) and thus were not yet commited to the snapshot.
|
|
77
|
-
*
|
|
78
|
-
* This is necessary in updates in which we receive reconciled elements, already containing elements which were not yet captured by the local store (i.e. collab).
|
|
79
|
-
*/
|
|
80
|
-
filterUncomittedElements(prevElements: Map<string, OrderedExcalidrawElement>, nextElements: Map<string, OrderedExcalidrawElement>): Map<string, OrderedExcalidrawElement>;
|
|
81
|
-
}
|
|
82
|
-
export declare class Store implements IStore {
|
|
83
|
-
readonly onStoreIncrementEmitter: Emitter<[StoreIncrementEvent]>;
|
|
84
|
-
private scheduledActions;
|
|
85
|
-
private _snapshot;
|
|
86
|
-
get snapshot(): Snapshot;
|
|
87
|
-
set snapshot(snapshot: Snapshot);
|
|
88
|
-
shouldCaptureIncrement: () => void;
|
|
89
|
-
shouldUpdateSnapshot: () => void;
|
|
90
|
-
private scheduleAction;
|
|
91
|
-
commit: (elements: Map<string, OrderedExcalidrawElement> | undefined, appState: AppState | ObservedAppState | undefined) => void;
|
|
92
|
-
captureIncrement: (elements: Map<string, OrderedExcalidrawElement> | undefined, appState: AppState | ObservedAppState | undefined) => void;
|
|
93
|
-
updateSnapshot: (elements: Map<string, OrderedExcalidrawElement> | undefined, appState: AppState | ObservedAppState | undefined) => void;
|
|
94
|
-
filterUncomittedElements: (prevElements: Map<string, OrderedExcalidrawElement>, nextElements: Map<string, OrderedExcalidrawElement>) => Map<string, OrderedExcalidrawElement>;
|
|
95
|
-
clear: () => void;
|
|
96
|
-
private satisfiesScheduledActionsInvariant;
|
|
97
|
-
}
|
|
98
|
-
export declare class Snapshot {
|
|
99
|
-
readonly elements: Map<string, OrderedExcalidrawElement>;
|
|
100
|
-
readonly appState: ObservedAppState;
|
|
101
|
-
readonly meta: {
|
|
102
|
-
didElementsChange: boolean;
|
|
103
|
-
didAppStateChange: boolean;
|
|
104
|
-
isEmpty?: boolean;
|
|
105
|
-
};
|
|
106
|
-
private constructor();
|
|
107
|
-
static empty(): Snapshot;
|
|
108
|
-
isEmpty(): boolean | undefined;
|
|
109
|
-
/**
|
|
110
|
-
* Efficiently clone the existing snapshot, only if we detected changes.
|
|
111
|
-
*
|
|
112
|
-
* @returns same instance if there are no changes detected, new instance otherwise.
|
|
113
|
-
*/
|
|
114
|
-
maybeClone(elements: Map<string, OrderedExcalidrawElement> | undefined, appState: AppState | ObservedAppState | undefined): Snapshot;
|
|
115
|
-
private maybeCreateAppStateSnapshot;
|
|
116
|
-
private detectChangedAppState;
|
|
117
|
-
private maybeCreateElementsSnapshot;
|
|
118
|
-
/**
|
|
119
|
-
* Detect if there any changed elements.
|
|
120
|
-
*
|
|
121
|
-
* NOTE: we shouldn't just use `sceneVersionNonce` instead, as we need to call this before the scene updates.
|
|
122
|
-
*/
|
|
123
|
-
private detectChangedElements;
|
|
124
|
-
/**
|
|
125
|
-
* Perform structural clone, cloning only elements that changed.
|
|
126
|
-
*/
|
|
127
|
-
private createElementsSnapshot;
|
|
128
|
-
}
|
|
129
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
2
|
-
import type { Curve } from "@excalidraw/math";
|
|
3
|
-
import type { LineSegment } from "@excalidraw/utils";
|
|
4
|
-
import type { Bounds } from "@excalidraw/element/bounds";
|
|
5
|
-
declare global {
|
|
6
|
-
interface Window {
|
|
7
|
-
visualDebug?: {
|
|
8
|
-
data: DebugElement[][];
|
|
9
|
-
currentFrame?: number;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export type DebugElement = {
|
|
14
|
-
color: string;
|
|
15
|
-
data: LineSegment<GlobalPoint> | Curve<GlobalPoint>;
|
|
16
|
-
permanent: boolean;
|
|
17
|
-
};
|
|
18
|
-
export declare const debugDrawCubicBezier: (c: Curve<GlobalPoint>, opts?: {
|
|
19
|
-
color?: string;
|
|
20
|
-
permanent?: boolean;
|
|
21
|
-
}) => void;
|
|
22
|
-
export declare const debugDrawLine: (segment: LineSegment<GlobalPoint> | LineSegment<GlobalPoint>[], opts?: {
|
|
23
|
-
color?: string;
|
|
24
|
-
permanent?: boolean;
|
|
25
|
-
}) => void;
|
|
26
|
-
export declare const debugDrawPoint: (p: GlobalPoint, opts?: {
|
|
27
|
-
color?: string;
|
|
28
|
-
permanent?: boolean;
|
|
29
|
-
fuzzy?: boolean;
|
|
30
|
-
}) => void;
|
|
31
|
-
export declare const debugDrawBounds: (box: Bounds | Bounds[], opts?: {
|
|
32
|
-
color?: string;
|
|
33
|
-
permanent?: boolean;
|
|
34
|
-
}) => void;
|
|
35
|
-
export declare const debugDrawPoints: ({ x, y, points, }: {
|
|
36
|
-
x: number;
|
|
37
|
-
y: number;
|
|
38
|
-
points: LocalPoint[];
|
|
39
|
-
}, options?: any) => void;
|
|
40
|
-
export declare const debugCloseFrame: () => void;
|
|
41
|
-
export declare const debugClear: () => void;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type GlobalPoint, type LocalPoint, type Polygon } from "@excalidraw/math";
|
|
2
|
-
import type { Curve } from "@excalidraw/math";
|
|
3
|
-
import type { Polyline, GeometricShape } from "./shape";
|
|
4
|
-
export declare const isPointOnShape: <Point extends GlobalPoint | LocalPoint>(point: Point, shape: GeometricShape<Point>, tolerance?: number) => boolean;
|
|
5
|
-
export declare const isPointInShape: <Point extends GlobalPoint | LocalPoint>(point: Point, shape: GeometricShape<Point>) => boolean;
|
|
6
|
-
export declare const isPointInBounds: <Point extends GlobalPoint | LocalPoint>(point: Point, bounds: Polygon<Point>) => boolean;
|
|
7
|
-
export declare const pointOnCurve: <Point extends GlobalPoint | LocalPoint>(point: Point, curve: Curve<Point>, threshold: number) => boolean;
|
|
8
|
-
export declare const pointOnPolyline: <Point extends GlobalPoint | LocalPoint>(point: Point, polyline: Polyline<Point>, threshold?: number) => boolean;
|
|
File without changes
|
|
File without changes
|