@excalidraw/math 0.18.0-7ea3229 → 0.18.0-816c81c
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/types/common/src/appEventBus.d.ts +27 -0
- package/dist/types/common/src/colors.d.ts +1 -1
- package/dist/types/common/src/index.d.ts +2 -0
- package/dist/types/common/src/utils.d.ts +1 -3
- package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
- package/dist/types/element/src/Scene.d.ts +2 -0
- package/dist/types/element/src/arrowheads.d.ts +3 -0
- package/dist/types/element/src/binding.d.ts +3 -4
- package/dist/types/element/src/bounds.d.ts +1 -1
- package/dist/types/element/src/elbowArrow.d.ts +2 -0
- package/dist/types/element/src/index.d.ts +1 -0
- package/dist/types/element/src/linearElementEditor.d.ts +3 -0
- package/dist/types/element/src/mutateElement.d.ts +2 -0
- package/dist/types/element/src/types.d.ts +5 -2
- package/dist/types/element/src/utils.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +23 -29
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +16 -20
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +97 -121
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +16 -20
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +8 -10
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +24 -30
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +4 -10
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +16 -20
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +8 -10
- package/dist/types/excalidraw/actions/actionExport.d.ts +60 -344
- package/dist/types/excalidraw/actions/actionFrame.d.ts +32 -40
- package/dist/types/excalidraw/actions/actionGroup.d.ts +16 -20
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +8 -10
- package/dist/types/excalidraw/actions/actionLink.d.ts +8 -10
- package/dist/types/excalidraw/actions/actionMenu.d.ts +4 -10
- package/dist/types/excalidraw/actions/actionProperties.d.ts +16 -20
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +8 -10
- package/dist/types/excalidraw/actions/actionStyles.d.ts +7 -9
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +172 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +8 -10
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +172 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +8 -10
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +4 -10
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +8 -10
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +8 -10
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +8 -10
- package/dist/types/excalidraw/actions/index.d.ts +2 -0
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +4 -2
- package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
- package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
- package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
- package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
- package/dist/types/excalidraw/charts/index.d.ts +7 -0
- package/dist/types/excalidraw/clipboard.d.ts +2 -5
- package/dist/types/excalidraw/components/App.d.ts +33 -11
- package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
- package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
- package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
- package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +4 -1
- package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
- package/dist/types/excalidraw/components/Toast.d.ts +8 -4
- package/dist/types/excalidraw/components/icons.d.ts +17 -8
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +2 -0
- package/dist/types/excalidraw/data/blob.d.ts +25 -30
- package/dist/types/excalidraw/data/filesystem.d.ts +3 -5
- package/dist/types/excalidraw/data/index.d.ts +2 -3
- package/dist/types/excalidraw/data/json.d.ts +28 -22
- package/dist/types/excalidraw/data/resave.d.ts +7 -2
- package/dist/types/excalidraw/types.d.ts +84 -13
- package/package.json +2 -2
- package/dist/types/excalidraw/charts.d.ts +0 -27
- package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
- package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
- package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +0 -24
- package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -11
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -84
- package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
- package/dist/types/excalidraw/index.d.ts +0 -47
- package/dist/types/excalidraw/polyfill.d.ts +0 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { UnsubscribeCallback } from "@excalidraw/excalidraw/types";
|
|
2
|
+
export type AppEventPayloadMap = Record<string, unknown[]>;
|
|
3
|
+
export type AppEventBehavior = {
|
|
4
|
+
cardinality: "once" | "many";
|
|
5
|
+
replay: "none" | "last";
|
|
6
|
+
};
|
|
7
|
+
export type AppEventBehaviorMap<Events extends AppEventPayloadMap> = {
|
|
8
|
+
[K in keyof Events]: AppEventBehavior;
|
|
9
|
+
};
|
|
10
|
+
type AwaitableAppEventKeys<Events extends AppEventPayloadMap, Behavior extends AppEventBehaviorMap<Events>> = {
|
|
11
|
+
[K in keyof Events]: Behavior[K]["cardinality"] extends "once" ? Behavior[K]["replay"] extends "last" ? K : never : never;
|
|
12
|
+
}[keyof Events];
|
|
13
|
+
type AppEventPromiseValue<Args extends any[]> = Args extends [infer Only] ? Only : Args;
|
|
14
|
+
export declare class AppEventBus<Events extends AppEventPayloadMap, Behavior extends AppEventBehaviorMap<Events>> {
|
|
15
|
+
private readonly behavior;
|
|
16
|
+
private readonly emitters;
|
|
17
|
+
private readonly lastPayload;
|
|
18
|
+
private readonly emittedOnce;
|
|
19
|
+
constructor(behavior: Behavior);
|
|
20
|
+
private getEmitter;
|
|
21
|
+
private toPromiseValue;
|
|
22
|
+
on<K extends keyof Events>(name: K, callback: (...args: Events[K]) => void): UnsubscribeCallback;
|
|
23
|
+
on<K extends AwaitableAppEventKeys<Events, Behavior>>(name: K): Promise<AppEventPromiseValue<Events[K]>>;
|
|
24
|
+
emit<K extends keyof Events>(name: K, ...args: Events[K]): void;
|
|
25
|
+
clear(): void;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -65,7 +65,7 @@ export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
|
|
|
65
65
|
readonly black: "#1e1e1e";
|
|
66
66
|
readonly bronze: readonly ["#f8f1ee", "#eaddd7", "#d2bab0", "#a18072", "#846358"];
|
|
67
67
|
};
|
|
68
|
-
export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) =>
|
|
68
|
+
export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) => ("#fff5f5" | "#ffc9c9" | "#ff8787" | "#fa5252" | "#e03131" | "#fff0f6" | "#fcc2d7" | "#f783ac" | "#e64980" | "#c2255c" | "#f8f0fc" | "#eebefa" | "#da77f2" | "#be4bdb" | "#9c36b5" | "#f3f0ff" | "#d0bfff" | "#9775fa" | "#7950f2" | "#6741d9" | "#e7f5ff" | "#a5d8ff" | "#4dabf7" | "#228be6" | "#1971c2" | "#e3fafc" | "#99e9f2" | "#3bc9db" | "#15aabf" | "#0c8599" | "#e6fcf5" | "#96f2d7" | "#38d9a9" | "#12b886" | "#099268" | "#ebfbee" | "#b2f2bb" | "#69db7c" | "#40c057" | "#2f9e44" | "#fff9db" | "#ffec99" | "#ffd43b" | "#fab005" | "#f08c00" | "#fff4e6" | "#ffd8a8" | "#ffa94d" | "#fd7e14" | "#e8590c")[];
|
|
69
69
|
export declare const rgbToHex: (r: number, g: number, b: number, a?: number) => string;
|
|
70
70
|
/**
|
|
71
71
|
* @returns #RRGGBB or #RRGGBBAA based on color containing non-opaque alpha,
|
|
@@ -11,5 +11,7 @@ export * from "./random";
|
|
|
11
11
|
export * from "./url";
|
|
12
12
|
export * from "./utils";
|
|
13
13
|
export * from "./emitter";
|
|
14
|
+
export * from "./appEventBus";
|
|
14
15
|
export * from "./editorInterface";
|
|
16
|
+
export * from "./versionedSnapshotStore";
|
|
15
17
|
export { Debug } from "../debug";
|
|
@@ -25,9 +25,7 @@ export declare const debounce: <T extends any[]>(fn: (...args: T) => void, timeo
|
|
|
25
25
|
flush(): void;
|
|
26
26
|
cancel(): void;
|
|
27
27
|
};
|
|
28
|
-
export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void
|
|
29
|
-
trailing?: boolean;
|
|
30
|
-
}) => {
|
|
28
|
+
export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void) => {
|
|
31
29
|
(...args: T): void;
|
|
32
30
|
flush(): void;
|
|
33
31
|
cancel(): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type VersionedSnapshot<T> = Readonly<{
|
|
2
|
+
version: number;
|
|
3
|
+
value: T;
|
|
4
|
+
}>;
|
|
5
|
+
export declare class VersionedSnapshotStore<T> {
|
|
6
|
+
private readonly isEqual;
|
|
7
|
+
private version;
|
|
8
|
+
private value;
|
|
9
|
+
private readonly waiters;
|
|
10
|
+
private readonly subscribers;
|
|
11
|
+
constructor(initialValue: T, isEqual?: (prev: T, next: T) => boolean);
|
|
12
|
+
getSnapshot(): VersionedSnapshot<T>;
|
|
13
|
+
set(nextValue: T): boolean;
|
|
14
|
+
update(updater: (prev: T) => T): boolean;
|
|
15
|
+
subscribe(subscriber: (snapshot: VersionedSnapshot<T>) => void): () => void;
|
|
16
|
+
pull(sinceVersion?: number): Promise<VersionedSnapshot<T>>;
|
|
17
|
+
}
|
|
@@ -75,6 +75,8 @@ export declare class Scene {
|
|
|
75
75
|
mutateElement<TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, options?: {
|
|
76
76
|
informMutation: boolean;
|
|
77
77
|
isDragging: boolean;
|
|
78
|
+
isBindingEnabled?: boolean;
|
|
79
|
+
isMidpointSnappingEnabled?: boolean;
|
|
78
80
|
}): TElement;
|
|
79
81
|
}
|
|
80
82
|
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Arrowhead, AnyArrowhead } from "./types";
|
|
2
|
+
export declare const normalizeArrowhead: (arrowhead: AnyArrowhead | null | undefined) => Arrowhead | null;
|
|
3
|
+
export declare const getArrowheadForPicker: (arrowhead: AnyArrowhead | null | undefined) => Arrowhead | null;
|
|
@@ -30,7 +30,6 @@ export declare const BASE_ARROW_MIN_LENGTH = 10;
|
|
|
30
30
|
export declare const FOCUS_POINT_SIZE: number;
|
|
31
31
|
export declare const getBindingGap: (bindTarget: ExcalidrawBindableElement, opts: Pick<ExcalidrawArrowElement, "elbowed">) => number;
|
|
32
32
|
export declare const maxBindingDistance_simple: (zoom?: AppState["zoom"]) => number;
|
|
33
|
-
export declare const shouldEnableBindingForPointerEvent: (event: React.PointerEvent<HTMLElement>) => boolean;
|
|
34
33
|
export declare const isBindingEnabled: (appState: {
|
|
35
34
|
isBindingEnabled: AppState["isBindingEnabled"];
|
|
36
35
|
}) => boolean;
|
|
@@ -55,7 +54,7 @@ export declare const getBindingStrategyForDraggingBindingElementEndpoints: (arro
|
|
|
55
54
|
end: BindingStrategy;
|
|
56
55
|
};
|
|
57
56
|
export declare const bindOrUnbindBindingElements: (selectedArrows: NonDeleted<ExcalidrawArrowElement>[], scene: Scene, appState: AppState) => void;
|
|
58
|
-
export declare const bindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, hoveredElement: ExcalidrawBindableElement, mode: BindMode, startOrEnd: "start" | "end", scene: Scene, focusPoint?: GlobalPoint) => void;
|
|
57
|
+
export declare const bindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, hoveredElement: ExcalidrawBindableElement, mode: BindMode, startOrEnd: "start" | "end", scene: Scene, focusPoint?: GlobalPoint, shouldSnapToOutline?: boolean) => void;
|
|
59
58
|
export declare const unbindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, startOrEnd: "start" | "end", scene: Scene) => ExcalidrawBindableElement["id"] | null;
|
|
60
59
|
export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawElement, scene: Scene, options?: {
|
|
61
60
|
simultaneouslyUpdated?: readonly ExcalidrawElement[];
|
|
@@ -69,11 +68,11 @@ export declare const updateBindings: (latestElement: ExcalidrawElement, scene: S
|
|
|
69
68
|
};
|
|
70
69
|
}) => void;
|
|
71
70
|
export declare const getHeadingForElbowArrowSnap: (p: Readonly<GlobalPoint>, otherPoint: Readonly<GlobalPoint>, bindableElement: ExcalidrawBindableElement | undefined | null, aabb: Bounds | undefined | null, origPoint: GlobalPoint, elementsMap: ElementsMap, zoom?: AppState["zoom"]) => Heading;
|
|
72
|
-
export declare const bindPointToSnapToElementOutline: (arrowElement: ExcalidrawArrowElement, bindableElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, customIntersector?: LineSegment<GlobalPoint
|
|
71
|
+
export declare const bindPointToSnapToElementOutline: (arrowElement: ExcalidrawArrowElement, bindableElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, customIntersector?: LineSegment<GlobalPoint>, isMidpointSnappingEnabled?: boolean) => GlobalPoint;
|
|
73
72
|
export declare const avoidRectangularCorner: (arrowElement: ExcalidrawArrowElement, bindTarget: ExcalidrawBindableElement, elementsMap: ElementsMap, p: GlobalPoint) => GlobalPoint;
|
|
74
73
|
export declare const snapToMid: (bindTarget: ExcalidrawBindableElement, elementsMap: ElementsMap, p: GlobalPoint, tolerance?: number, arrowElement?: ExcalidrawArrowElement) => GlobalPoint | undefined;
|
|
75
74
|
export declare const updateBoundPoint: (arrow: NonDeleted<ExcalidrawArrowElement>, startOrEnd: "startBinding" | "endBinding", binding: FixedPointBinding | null | undefined, bindableElement: ExcalidrawBindableElement, elementsMap: ElementsMap, dragging?: boolean) => LocalPoint | null;
|
|
76
|
-
export declare const calculateFixedPointForElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawElbowArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap) => {
|
|
75
|
+
export declare const calculateFixedPointForElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawElbowArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, shouldSnapToOutline?: boolean, isMidpointSnappingEnabled?: boolean) => {
|
|
77
76
|
fixedPoint: FixedPoint;
|
|
78
77
|
};
|
|
79
78
|
export declare const calculateFixedPointForNonElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, focusPoint?: GlobalPoint) => {
|
|
@@ -43,7 +43,7 @@ export declare const getBoundsFromPoints: (points: ExcalidrawFreeDrawElement["po
|
|
|
43
43
|
export declare const getArrowheadSize: (arrowhead: Arrowhead) => number;
|
|
44
44
|
/** @returns number in degrees */
|
|
45
45
|
export declare const getArrowheadAngle: (arrowhead: Arrowhead) => Degrees;
|
|
46
|
-
export declare const getArrowheadPoints: (element: ExcalidrawLinearElement, shape: Drawable[], position: "start" | "end", arrowhead: Arrowhead) => number[] | null;
|
|
46
|
+
export declare const getArrowheadPoints: (element: ExcalidrawLinearElement, shape: Drawable[], position: "start" | "end", arrowhead: Arrowhead, offsetMultiplier?: number) => number[] | null;
|
|
47
47
|
export declare const getElementBounds: (element: ExcalidrawElement, elementsMap: ElementsMap, nonRotated?: boolean) => Bounds;
|
|
48
48
|
export declare const getCommonBounds: (elements: ElementsMapOrArray, elementsMap?: ElementsMap) => Bounds;
|
|
49
49
|
export declare const getDraggedElementsBounds: (elements: ExcalidrawElement[], dragOffset: {
|
|
@@ -13,5 +13,7 @@ export declare const updateElbowArrowPoints: (arrow: Readonly<ExcalidrawElbowArr
|
|
|
13
13
|
endBinding?: FixedPointBinding | null;
|
|
14
14
|
}, options?: {
|
|
15
15
|
isDragging?: boolean;
|
|
16
|
+
isBindingEnabled?: boolean;
|
|
17
|
+
isMidpointSnappingEnabled?: boolean;
|
|
16
18
|
}) => ElementUpdate<ExcalidrawElbowArrowElement>;
|
|
17
19
|
export declare const validateElbowPoints: <P extends GlobalPoint | LocalPoint>(points: readonly P[], tolerance?: number) => boolean;
|
|
@@ -96,6 +96,9 @@ export declare class LinearElementEditor {
|
|
|
96
96
|
startBinding?: FixedPointBinding | null;
|
|
97
97
|
endBinding?: FixedPointBinding | null;
|
|
98
98
|
moveMidPointsWithElement?: boolean | null;
|
|
99
|
+
}, options?: {
|
|
100
|
+
isBindingEnabled?: boolean;
|
|
101
|
+
isMidpointSnappingEnabled?: boolean;
|
|
99
102
|
}): void;
|
|
100
103
|
static shouldAddMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, appState: AppState, elementsMap: ElementsMap): boolean;
|
|
101
104
|
static addMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, app: AppClassProperties, snapToGrid: boolean, scene: Scene): {
|
|
@@ -11,6 +11,8 @@ export type ElementUpdate<TElement extends ExcalidrawElement> = Omit<Partial<TEl
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, elementsMap: ElementsMap, updates: ElementUpdate<TElement>, options?: {
|
|
13
13
|
isDragging?: boolean;
|
|
14
|
+
isBindingEnabled?: boolean;
|
|
15
|
+
isMidpointSnappingEnabled?: boolean;
|
|
14
16
|
}) => TElement;
|
|
15
17
|
export declare const newElementWith: <TElement extends ExcalidrawElement>(element: TElement, updates: ElementUpdate<TElement>,
|
|
16
18
|
/** pass `true` to always regenerate */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LocalPoint, Radians } from "@excalidraw/math";
|
|
2
2
|
import type { FONT_FAMILY, ROUNDNESS, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "@excalidraw/common";
|
|
3
3
|
import type { MakeBrand, MarkNonNullable, Merge, ValueOf } from "@excalidraw/common/utility-types";
|
|
4
|
-
export type ChartType = "bar" | "line";
|
|
4
|
+
export type ChartType = "bar" | "line" | "radar";
|
|
5
5
|
export type FillStyle = "hachure" | "cross-hatch" | "solid" | "zigzag";
|
|
6
6
|
export type FontFamilyKeys = keyof typeof FONT_FAMILY;
|
|
7
7
|
export type FontFamilyValues = typeof FONT_FAMILY[FontFamilyKeys];
|
|
@@ -208,7 +208,10 @@ export type PointsPositionUpdates = Map<Index, {
|
|
|
208
208
|
point: LocalPoint;
|
|
209
209
|
isDragging?: boolean;
|
|
210
210
|
}>;
|
|
211
|
-
export type
|
|
211
|
+
export type CardinalityArrowhead = "cardinality_one" | "cardinality_many" | "cardinality_one_or_many" | "cardinality_exactly_one" | "cardinality_zero_or_one" | "cardinality_zero_or_many";
|
|
212
|
+
export type ArrowheadLegacy = "dot" | "crowfoot_one" | "crowfoot_many" | "crowfoot_one_or_many";
|
|
213
|
+
export type Arrowhead = "arrow" | "bar" | "circle" | "circle_outline" | "triangle" | "triangle_outline" | "diamond" | "diamond_outline" | CardinalityArrowhead;
|
|
214
|
+
export type AnyArrowhead = Arrowhead | ArrowheadLegacy;
|
|
212
215
|
export type ExcalidrawLinearElement = _ExcalidrawElementBase & Readonly<{
|
|
213
216
|
type: "line" | "arrow";
|
|
214
217
|
points: readonly LocalPoint[];
|
|
@@ -33,4 +33,4 @@ export declare const isPathALoop: (points: ExcalidrawLinearElement["points"],
|
|
|
33
33
|
zoomValue?: Zoom["value"]) => boolean;
|
|
34
34
|
export declare const getCornerRadius: (x: number, element: ExcalidrawElement) => number;
|
|
35
35
|
export declare const getSnapOutlineMidPoint: (point: GlobalPoint, element: ExcalidrawBindableElement, elementsMap: ElementsMap, zoom: AppState["zoom"]) => GlobalPoint | undefined;
|
|
36
|
-
export declare const projectFixedPointOntoDiagonal: (arrow: ExcalidrawArrowElement, point: GlobalPoint, element: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, zoom: AppState["zoom"]) => GlobalPoint | null;
|
|
36
|
+
export declare const projectFixedPointOntoDiagonal: (arrow: ExcalidrawArrowElement, point: GlobalPoint, element: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, zoom: AppState["zoom"], isMidpointSnappingEnabled?: boolean) => GlobalPoint | null;
|
|
@@ -26,6 +26,8 @@ export declare const actionAddToLibrary: {
|
|
|
26
26
|
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
27
27
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
28
28
|
isBindingEnabled: boolean;
|
|
29
|
+
bindingPreference: "enabled" | "disabled";
|
|
30
|
+
isMidpointSnappingEnabled: boolean;
|
|
29
31
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
30
32
|
suggestedBinding: {
|
|
31
33
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
@@ -98,6 +100,10 @@ export declare const actionAddToLibrary: {
|
|
|
98
100
|
} | {
|
|
99
101
|
name: "elementLinkSelector";
|
|
100
102
|
sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
103
|
+
} | {
|
|
104
|
+
name: "charts";
|
|
105
|
+
data: import("../charts").Spreadsheet;
|
|
106
|
+
rawText: string;
|
|
101
107
|
};
|
|
102
108
|
defaultSidebarDockedPreference: boolean;
|
|
103
109
|
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
@@ -126,20 +132,12 @@ export declare const actionAddToLibrary: {
|
|
|
126
132
|
height: number;
|
|
127
133
|
offsetTop: number;
|
|
128
134
|
offsetLeft: number;
|
|
129
|
-
fileHandle:
|
|
135
|
+
fileHandle: FileSystemFileHandle | null;
|
|
130
136
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
131
137
|
stats: {
|
|
132
138
|
open: boolean;
|
|
133
139
|
panels: number;
|
|
134
140
|
};
|
|
135
|
-
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
136
|
-
pasteDialog: {
|
|
137
|
-
shown: false;
|
|
138
|
-
data: null;
|
|
139
|
-
} | {
|
|
140
|
-
shown: true;
|
|
141
|
-
data: import("../charts").Spreadsheet;
|
|
142
|
-
};
|
|
143
141
|
showHyperlinkPopup: false | "info" | "editor";
|
|
144
142
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
145
143
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
@@ -182,6 +180,8 @@ export declare const actionAddToLibrary: {
|
|
|
182
180
|
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
183
181
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
184
182
|
isBindingEnabled: boolean;
|
|
183
|
+
bindingPreference: "enabled" | "disabled";
|
|
184
|
+
isMidpointSnappingEnabled: boolean;
|
|
185
185
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
186
186
|
suggestedBinding: {
|
|
187
187
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
@@ -254,6 +254,10 @@ export declare const actionAddToLibrary: {
|
|
|
254
254
|
} | {
|
|
255
255
|
name: "elementLinkSelector";
|
|
256
256
|
sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
257
|
+
} | {
|
|
258
|
+
name: "charts";
|
|
259
|
+
data: import("../charts").Spreadsheet;
|
|
260
|
+
rawText: string;
|
|
257
261
|
};
|
|
258
262
|
defaultSidebarDockedPreference: boolean;
|
|
259
263
|
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
@@ -269,7 +273,7 @@ export declare const actionAddToLibrary: {
|
|
|
269
273
|
selectedElementsAreBeingDragged: boolean;
|
|
270
274
|
shouldCacheIgnoreZoom: boolean;
|
|
271
275
|
toast: {
|
|
272
|
-
message:
|
|
276
|
+
message: React.ReactNode;
|
|
273
277
|
closable?: boolean;
|
|
274
278
|
duration?: number;
|
|
275
279
|
} | null;
|
|
@@ -287,20 +291,12 @@ export declare const actionAddToLibrary: {
|
|
|
287
291
|
height: number;
|
|
288
292
|
offsetTop: number;
|
|
289
293
|
offsetLeft: number;
|
|
290
|
-
fileHandle:
|
|
294
|
+
fileHandle: FileSystemFileHandle | null;
|
|
291
295
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
292
296
|
stats: {
|
|
293
297
|
open: boolean;
|
|
294
298
|
panels: number;
|
|
295
299
|
};
|
|
296
|
-
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
297
|
-
pasteDialog: {
|
|
298
|
-
shown: false;
|
|
299
|
-
data: null;
|
|
300
|
-
} | {
|
|
301
|
-
shown: true;
|
|
302
|
-
data: import("../charts").Spreadsheet;
|
|
303
|
-
};
|
|
304
300
|
showHyperlinkPopup: false | "info" | "editor";
|
|
305
301
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
306
302
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
@@ -343,6 +339,8 @@ export declare const actionAddToLibrary: {
|
|
|
343
339
|
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
344
340
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
345
341
|
isBindingEnabled: boolean;
|
|
342
|
+
bindingPreference: "enabled" | "disabled";
|
|
343
|
+
isMidpointSnappingEnabled: boolean;
|
|
346
344
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
347
345
|
suggestedBinding: {
|
|
348
346
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
@@ -415,6 +413,10 @@ export declare const actionAddToLibrary: {
|
|
|
415
413
|
} | {
|
|
416
414
|
name: "elementLinkSelector";
|
|
417
415
|
sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
416
|
+
} | {
|
|
417
|
+
name: "charts";
|
|
418
|
+
data: import("../charts").Spreadsheet;
|
|
419
|
+
rawText: string;
|
|
418
420
|
};
|
|
419
421
|
defaultSidebarDockedPreference: boolean;
|
|
420
422
|
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
@@ -430,7 +432,7 @@ export declare const actionAddToLibrary: {
|
|
|
430
432
|
selectedElementsAreBeingDragged: boolean;
|
|
431
433
|
shouldCacheIgnoreZoom: boolean;
|
|
432
434
|
toast: {
|
|
433
|
-
message:
|
|
435
|
+
message: React.ReactNode;
|
|
434
436
|
closable?: boolean;
|
|
435
437
|
duration?: number;
|
|
436
438
|
} | null;
|
|
@@ -448,20 +450,12 @@ export declare const actionAddToLibrary: {
|
|
|
448
450
|
height: number;
|
|
449
451
|
offsetTop: number;
|
|
450
452
|
offsetLeft: number;
|
|
451
|
-
fileHandle:
|
|
453
|
+
fileHandle: FileSystemFileHandle | null;
|
|
452
454
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
453
455
|
stats: {
|
|
454
456
|
open: boolean;
|
|
455
457
|
panels: number;
|
|
456
458
|
};
|
|
457
|
-
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
458
|
-
pasteDialog: {
|
|
459
|
-
shown: false;
|
|
460
|
-
data: null;
|
|
461
|
-
} | {
|
|
462
|
-
shown: true;
|
|
463
|
-
data: import("../charts").Spreadsheet;
|
|
464
|
-
};
|
|
465
459
|
showHyperlinkPopup: false | "info" | "editor";
|
|
466
460
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
467
461
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
@@ -46,6 +46,8 @@ export declare const actionBindText: {
|
|
|
46
46
|
multiElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
47
47
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
48
48
|
isBindingEnabled: boolean;
|
|
49
|
+
bindingPreference: "enabled" | "disabled";
|
|
50
|
+
isMidpointSnappingEnabled: boolean;
|
|
49
51
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
50
52
|
suggestedBinding: {
|
|
51
53
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
@@ -118,6 +120,10 @@ export declare const actionBindText: {
|
|
|
118
120
|
} | {
|
|
119
121
|
name: "elementLinkSelector";
|
|
120
122
|
sourceElementId: ExcalidrawElement["id"];
|
|
123
|
+
} | {
|
|
124
|
+
name: "charts";
|
|
125
|
+
data: import("../charts").Spreadsheet;
|
|
126
|
+
rawText: string;
|
|
121
127
|
};
|
|
122
128
|
defaultSidebarDockedPreference: boolean;
|
|
123
129
|
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
@@ -130,7 +136,7 @@ export declare const actionBindText: {
|
|
|
130
136
|
selectedElementsAreBeingDragged: boolean;
|
|
131
137
|
shouldCacheIgnoreZoom: boolean;
|
|
132
138
|
toast: {
|
|
133
|
-
message:
|
|
139
|
+
message: React.ReactNode;
|
|
134
140
|
closable?: boolean;
|
|
135
141
|
duration?: number;
|
|
136
142
|
} | null;
|
|
@@ -148,20 +154,12 @@ export declare const actionBindText: {
|
|
|
148
154
|
height: number;
|
|
149
155
|
offsetTop: number;
|
|
150
156
|
offsetLeft: number;
|
|
151
|
-
fileHandle:
|
|
157
|
+
fileHandle: FileSystemFileHandle | null;
|
|
152
158
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
153
159
|
stats: {
|
|
154
160
|
open: boolean;
|
|
155
161
|
panels: number;
|
|
156
162
|
};
|
|
157
|
-
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
158
|
-
pasteDialog: {
|
|
159
|
-
shown: false;
|
|
160
|
-
data: null;
|
|
161
|
-
} | {
|
|
162
|
-
shown: true;
|
|
163
|
-
data: import("../charts").Spreadsheet;
|
|
164
|
-
};
|
|
165
163
|
showHyperlinkPopup: false | "info" | "editor";
|
|
166
164
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
167
165
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
@@ -219,6 +217,8 @@ export declare const actionWrapTextInContainer: {
|
|
|
219
217
|
multiElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawLinearElement> | null;
|
|
220
218
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
221
219
|
isBindingEnabled: boolean;
|
|
220
|
+
bindingPreference: "enabled" | "disabled";
|
|
221
|
+
isMidpointSnappingEnabled: boolean;
|
|
222
222
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
223
223
|
suggestedBinding: {
|
|
224
224
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
@@ -291,6 +291,10 @@ export declare const actionWrapTextInContainer: {
|
|
|
291
291
|
} | {
|
|
292
292
|
name: "elementLinkSelector";
|
|
293
293
|
sourceElementId: ExcalidrawElement["id"];
|
|
294
|
+
} | {
|
|
295
|
+
name: "charts";
|
|
296
|
+
data: import("../charts").Spreadsheet;
|
|
297
|
+
rawText: string;
|
|
294
298
|
};
|
|
295
299
|
defaultSidebarDockedPreference: boolean;
|
|
296
300
|
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
@@ -303,7 +307,7 @@ export declare const actionWrapTextInContainer: {
|
|
|
303
307
|
selectedElementsAreBeingDragged: boolean;
|
|
304
308
|
shouldCacheIgnoreZoom: boolean;
|
|
305
309
|
toast: {
|
|
306
|
-
message:
|
|
310
|
+
message: React.ReactNode;
|
|
307
311
|
closable?: boolean;
|
|
308
312
|
duration?: number;
|
|
309
313
|
} | null;
|
|
@@ -321,20 +325,12 @@ export declare const actionWrapTextInContainer: {
|
|
|
321
325
|
height: number;
|
|
322
326
|
offsetTop: number;
|
|
323
327
|
offsetLeft: number;
|
|
324
|
-
fileHandle:
|
|
328
|
+
fileHandle: FileSystemFileHandle | null;
|
|
325
329
|
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
326
330
|
stats: {
|
|
327
331
|
open: boolean;
|
|
328
332
|
panels: number;
|
|
329
333
|
};
|
|
330
|
-
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
331
|
-
pasteDialog: {
|
|
332
|
-
shown: false;
|
|
333
|
-
data: null;
|
|
334
|
-
} | {
|
|
335
|
-
shown: true;
|
|
336
|
-
data: import("../charts").Spreadsheet;
|
|
337
|
-
};
|
|
338
334
|
showHyperlinkPopup: false | "info" | "editor";
|
|
339
335
|
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
340
336
|
snapLines: readonly import("../snapping").SnapLine[];
|