@excalidraw/math 0.18.0-0457ac9 → 0.18.0-063e025
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/colors.d.ts +1 -1
- package/dist/types/common/src/constants.d.ts +9 -7
- package/dist/types/common/src/utils.d.ts +0 -42
- package/dist/types/element/src/Scene.d.ts +1 -1
- package/dist/types/element/src/align.d.ts +2 -2
- package/dist/types/element/src/binding.d.ts +6 -6
- package/dist/types/element/src/bounds.d.ts +19 -6
- package/dist/types/element/src/collision.d.ts +1 -1
- package/dist/types/element/src/comparisons.d.ts +1 -0
- package/dist/types/element/src/distribute.d.ts +2 -2
- package/dist/types/element/src/duplicate.d.ts +3 -3
- package/dist/types/element/src/embeddable.d.ts +2 -2
- package/dist/types/element/src/flowchart.d.ts +3 -3
- package/dist/types/element/src/fractionalIndex.d.ts +2 -2
- package/dist/types/element/src/frame.d.ts +4 -4
- package/dist/types/element/src/groups.d.ts +9 -9
- package/dist/types/element/src/index.d.ts +1 -1
- package/dist/types/element/src/linearElementEditor.d.ts +10 -10
- package/dist/types/element/src/newElement.d.ts +1 -0
- package/dist/types/element/src/renderElement.d.ts +0 -3
- package/dist/types/element/src/resizeElements.d.ts +2 -2
- package/dist/types/element/src/selection.d.ts +5 -5
- package/dist/types/element/src/textElement.d.ts +7 -7
- package/dist/types/element/src/transform.d.ts +2 -2
- package/dist/types/element/src/typeChecks.d.ts +25 -25
- package/dist/types/element/src/types.d.ts +8 -1
- package/dist/types/element/src/zindex.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +12 -6
- package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +8 -4
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +61 -389
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +8 -4
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +4 -2
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +13 -7
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +4 -2
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +4 -2
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +9 -5
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +4 -2
- package/dist/types/excalidraw/actions/actionExport.d.ts +8 -4
- package/dist/types/excalidraw/actions/actionFrame.d.ts +29 -20
- package/dist/types/excalidraw/actions/actionGroup.d.ts +23 -19
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +7 -4
- package/dist/types/excalidraw/actions/actionLink.d.ts +5 -3
- package/dist/types/excalidraw/actions/actionMenu.d.ts +4 -2
- package/dist/types/excalidraw/actions/actionProperties.d.ts +35 -22
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +9 -7
- package/dist/types/excalidraw/actions/actionStyles.d.ts +4 -2
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +5 -3
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +8 -7
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +5 -3
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +5 -3
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +8 -7
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +5 -3
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +5 -3
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +5 -3
- package/dist/types/excalidraw/actions/index.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +4 -4
- package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
- package/dist/types/excalidraw/appState.d.ts +2 -1
- package/dist/types/excalidraw/components/Actions.d.ts +2 -3
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/App.d.ts +61 -32
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +2 -2
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -2
- package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
- package/dist/types/excalidraw/components/Island.d.ts +7 -0
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
- package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
- package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +4 -4
- package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +3 -3
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -2
- package/dist/types/excalidraw/components/icons.d.ts +2 -0
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +6 -3
- package/dist/types/excalidraw/data/blob.d.ts +8 -4
- package/dist/types/excalidraw/data/index.d.ts +4 -4
- package/dist/types/excalidraw/data/json.d.ts +10 -8
- package/dist/types/excalidraw/data/library.d.ts +1 -1
- package/dist/types/excalidraw/eraser/index.d.ts +2 -3
- package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
- package/dist/types/excalidraw/lasso/index.d.ts +2 -3
- package/dist/types/excalidraw/renderer/animation.d.ts +5 -1
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +1 -3
- package/dist/types/excalidraw/scene/Renderer.d.ts +12 -11
- package/dist/types/excalidraw/scene/export.d.ts +3 -3
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/scene/types.d.ts +1 -3
- package/dist/types/excalidraw/snapping.d.ts +7 -7
- package/dist/types/excalidraw/types.d.ts +168 -11
- package/dist/types/excalidraw/viewport.d.ts +316 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +2 -3
- package/dist/types/laser-pointer/src/index.d.ts +2 -0
- package/dist/types/laser-pointer/src/math.d.ts +16 -0
- package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
- package/dist/types/laser-pointer/src/state.d.ts +35 -0
- package/dist/types/utils/src/export.d.ts +3 -3
- package/dist/types/utils/src/index.d.ts +1 -2
- package/package.json +2 -2
- package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
- package/dist/types/excalidraw/scene/scroll.d.ts +0 -18
- package/dist/types/utils/src/bbox.d.ts +0 -9
- package/dist/types/utils/src/withinBounds.d.ts +0 -19
|
@@ -43,7 +43,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
43
43
|
clip: boolean;
|
|
44
44
|
};
|
|
45
45
|
editingFrame: string | null;
|
|
46
|
-
elementsToHighlight: import("@excalidraw/element/types").
|
|
46
|
+
elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
|
|
47
47
|
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
48
48
|
activeTool: {
|
|
49
49
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
@@ -63,9 +63,10 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
63
63
|
currentItemStrokeColor: string;
|
|
64
64
|
currentItemBackgroundColor: string;
|
|
65
65
|
currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
|
|
66
|
-
|
|
66
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
67
67
|
currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
|
|
68
68
|
currentItemRoughness: number;
|
|
69
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
69
70
|
currentItemOpacity: number;
|
|
70
71
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
71
72
|
currentItemFontSize: number;
|
|
@@ -78,6 +79,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
78
79
|
viewBackgroundColor: string;
|
|
79
80
|
scrollX: number;
|
|
80
81
|
scrollY: number;
|
|
82
|
+
scrollConstraints: import("../types").ScrollConstraints | null;
|
|
81
83
|
cursorButton: "up" | "down";
|
|
82
84
|
scrolledOutside: boolean;
|
|
83
85
|
name: string | null;
|
|
@@ -167,7 +169,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
167
169
|
};
|
|
168
170
|
captureUpdate: "EVENTUALLY";
|
|
169
171
|
};
|
|
170
|
-
checked: (appState: Readonly<import("../types").
|
|
172
|
+
checked: (appState: Readonly<import("../types").UIAppState>) => boolean;
|
|
171
173
|
predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
172
174
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
173
175
|
} & {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { AppState } from "../types";
|
|
2
1
|
export declare const actionToggleSearchMenu: {
|
|
3
2
|
name: "searchMenu";
|
|
4
3
|
icon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,9 +7,9 @@ export declare const actionToggleSearchMenu: {
|
|
|
8
7
|
trackEvent: {
|
|
9
8
|
category: "search_menu";
|
|
10
9
|
action: string;
|
|
11
|
-
predicate: (appState: Readonly<AppState>) => boolean;
|
|
10
|
+
predicate: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
12
11
|
};
|
|
13
|
-
perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<AppState>, _: unknown, app: import("../types").AppClassProperties): false | {
|
|
12
|
+
perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: import("../types").AppClassProperties): false | {
|
|
14
13
|
appState: {
|
|
15
14
|
openSidebar: {
|
|
16
15
|
name: "default";
|
|
@@ -49,7 +48,7 @@ export declare const actionToggleSearchMenu: {
|
|
|
49
48
|
clip: boolean;
|
|
50
49
|
};
|
|
51
50
|
editingFrame: string | null;
|
|
52
|
-
elementsToHighlight: import("@excalidraw/element/types").
|
|
51
|
+
elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
|
|
53
52
|
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
54
53
|
activeTool: {
|
|
55
54
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
@@ -69,9 +68,10 @@ export declare const actionToggleSearchMenu: {
|
|
|
69
68
|
currentItemStrokeColor: string;
|
|
70
69
|
currentItemBackgroundColor: string;
|
|
71
70
|
currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
|
|
72
|
-
|
|
71
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
73
72
|
currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
|
|
74
73
|
currentItemRoughness: number;
|
|
74
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
75
75
|
currentItemOpacity: number;
|
|
76
76
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
77
77
|
currentItemFontSize: number;
|
|
@@ -84,6 +84,7 @@ export declare const actionToggleSearchMenu: {
|
|
|
84
84
|
viewBackgroundColor: string;
|
|
85
85
|
scrollX: number;
|
|
86
86
|
scrollY: number;
|
|
87
|
+
scrollConstraints: import("../types").ScrollConstraints | null;
|
|
87
88
|
cursorButton: "up" | "down";
|
|
88
89
|
scrolledOutside: boolean;
|
|
89
90
|
name: string | null;
|
|
@@ -154,8 +155,8 @@ export declare const actionToggleSearchMenu: {
|
|
|
154
155
|
};
|
|
155
156
|
captureUpdate: "EVENTUALLY";
|
|
156
157
|
};
|
|
157
|
-
checked: (appState:
|
|
158
|
-
predicate: (element: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: AppState, props: import("../types").ExcalidrawProps) => boolean;
|
|
158
|
+
checked: (appState: Readonly<import("../types").UIAppState>) => boolean;
|
|
159
|
+
predicate: (element: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, props: import("../types").ExcalidrawProps) => boolean;
|
|
159
160
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
160
161
|
} & {
|
|
161
162
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
@@ -12,7 +12,7 @@ export declare const actionToggleShapeSwitch: {
|
|
|
12
12
|
perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: unknown, app: import("../types").AppClassProperties): {
|
|
13
13
|
captureUpdate: "NEVER";
|
|
14
14
|
};
|
|
15
|
-
checked: (appState: Readonly<import("../types").
|
|
15
|
+
checked: (appState: Readonly<import("../types").UIAppState>) => boolean;
|
|
16
16
|
predicate: (elements: readonly ExcalidrawElement[], appState: import("../types").AppState, props: import("../types").ExcalidrawProps) => boolean;
|
|
17
17
|
} & {
|
|
18
18
|
keyTest?: undefined;
|
|
@@ -45,7 +45,7 @@ export declare const actionToggleStats: {
|
|
|
45
45
|
clip: boolean;
|
|
46
46
|
};
|
|
47
47
|
editingFrame: string | null;
|
|
48
|
-
elementsToHighlight: import("@excalidraw/element/types").
|
|
48
|
+
elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
|
|
49
49
|
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
50
50
|
activeTool: {
|
|
51
51
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
@@ -65,9 +65,10 @@ export declare const actionToggleStats: {
|
|
|
65
65
|
currentItemStrokeColor: string;
|
|
66
66
|
currentItemBackgroundColor: string;
|
|
67
67
|
currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
|
|
68
|
-
|
|
68
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
69
69
|
currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
|
|
70
70
|
currentItemRoughness: number;
|
|
71
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
71
72
|
currentItemOpacity: number;
|
|
72
73
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
73
74
|
currentItemFontSize: number;
|
|
@@ -80,6 +81,7 @@ export declare const actionToggleStats: {
|
|
|
80
81
|
viewBackgroundColor: string;
|
|
81
82
|
scrollX: number;
|
|
82
83
|
scrollY: number;
|
|
84
|
+
scrollConstraints: import("../types").ScrollConstraints | null;
|
|
83
85
|
cursorButton: "up" | "down";
|
|
84
86
|
scrolledOutside: boolean;
|
|
85
87
|
name: string | null;
|
|
@@ -167,7 +169,7 @@ export declare const actionToggleStats: {
|
|
|
167
169
|
};
|
|
168
170
|
captureUpdate: "EVENTUALLY";
|
|
169
171
|
};
|
|
170
|
-
checked: (appState: Readonly<import("../types").
|
|
172
|
+
checked: (appState: Readonly<import("../types").UIAppState>) => boolean;
|
|
171
173
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
172
174
|
} & {
|
|
173
175
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
@@ -42,7 +42,7 @@ export declare const actionToggleViewMode: {
|
|
|
42
42
|
clip: boolean;
|
|
43
43
|
};
|
|
44
44
|
editingFrame: string | null;
|
|
45
|
-
elementsToHighlight: import("@excalidraw/element/types").
|
|
45
|
+
elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
|
|
46
46
|
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
47
47
|
activeTool: {
|
|
48
48
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
@@ -62,9 +62,10 @@ export declare const actionToggleViewMode: {
|
|
|
62
62
|
currentItemStrokeColor: string;
|
|
63
63
|
currentItemBackgroundColor: string;
|
|
64
64
|
currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
|
|
65
|
-
|
|
65
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
66
66
|
currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
|
|
67
67
|
currentItemRoughness: number;
|
|
68
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
68
69
|
currentItemOpacity: number;
|
|
69
70
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
70
71
|
currentItemFontSize: number;
|
|
@@ -77,6 +78,7 @@ export declare const actionToggleViewMode: {
|
|
|
77
78
|
viewBackgroundColor: string;
|
|
78
79
|
scrollX: number;
|
|
79
80
|
scrollY: number;
|
|
81
|
+
scrollConstraints: import("../types").ScrollConstraints | null;
|
|
80
82
|
cursorButton: "up" | "down";
|
|
81
83
|
scrolledOutside: boolean;
|
|
82
84
|
name: string | null;
|
|
@@ -167,7 +169,7 @@ export declare const actionToggleViewMode: {
|
|
|
167
169
|
};
|
|
168
170
|
captureUpdate: "EVENTUALLY";
|
|
169
171
|
};
|
|
170
|
-
checked: (appState: Readonly<import("../types").
|
|
172
|
+
checked: (appState: Readonly<import("../types").UIAppState>) => boolean;
|
|
171
173
|
predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
172
174
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
173
175
|
} & {
|
|
@@ -42,7 +42,7 @@ export declare const actionToggleZenMode: {
|
|
|
42
42
|
clip: boolean;
|
|
43
43
|
};
|
|
44
44
|
editingFrame: string | null;
|
|
45
|
-
elementsToHighlight: import("@excalidraw/element/types").
|
|
45
|
+
elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
|
|
46
46
|
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
47
47
|
activeTool: {
|
|
48
48
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
@@ -62,9 +62,10 @@ export declare const actionToggleZenMode: {
|
|
|
62
62
|
currentItemStrokeColor: string;
|
|
63
63
|
currentItemBackgroundColor: string;
|
|
64
64
|
currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
|
|
65
|
-
|
|
65
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
66
66
|
currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
|
|
67
67
|
currentItemRoughness: number;
|
|
68
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
68
69
|
currentItemOpacity: number;
|
|
69
70
|
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
70
71
|
currentItemFontSize: number;
|
|
@@ -77,6 +78,7 @@ export declare const actionToggleZenMode: {
|
|
|
77
78
|
viewBackgroundColor: string;
|
|
78
79
|
scrollX: number;
|
|
79
80
|
scrollY: number;
|
|
81
|
+
scrollConstraints: import("../types").ScrollConstraints | null;
|
|
80
82
|
cursorButton: "up" | "down";
|
|
81
83
|
scrolledOutside: boolean;
|
|
82
84
|
name: string | null;
|
|
@@ -167,7 +169,7 @@ export declare const actionToggleZenMode: {
|
|
|
167
169
|
};
|
|
168
170
|
captureUpdate: "EVENTUALLY";
|
|
169
171
|
};
|
|
170
|
-
checked: (appState: Readonly<import("../types").
|
|
172
|
+
checked: (appState: Readonly<import("../types").UIAppState>) => boolean;
|
|
171
173
|
predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
|
|
172
174
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
173
175
|
} & {
|
|
@@ -2,7 +2,7 @@ export { actionDeleteSelected } from "./actionDeleteSelected";
|
|
|
2
2
|
export { actionBringForward, actionBringToFront, actionSendBackward, actionSendToBack, } from "./actionZindex";
|
|
3
3
|
export { actionSelectAll } from "./actionSelectAll";
|
|
4
4
|
export { actionDuplicateSelection } from "./actionDuplicateSelection";
|
|
5
|
-
export { actionChangeStrokeColor, actionChangeBackgroundColor, actionChangeStrokeWidth, actionChangeFillStyle, actionChangeSloppiness, actionChangeOpacity, actionChangeFontSize, actionChangeFontFamily, actionChangeTextAlign, actionChangeVerticalAlign, actionChangeArrowProperties, } from "./actionProperties";
|
|
5
|
+
export { actionChangeStrokeColor, actionChangeBackgroundColor, actionChangeStrokeWidth, actionChangeFillStyle, actionChangeSloppiness, actionChangeFreedrawMode, actionChangeOpacity, actionChangeFontSize, actionChangeFontFamily, actionChangeTextAlign, actionChangeVerticalAlign, actionChangeArrowProperties, } from "./actionProperties";
|
|
6
6
|
export { actionChangeViewBackgroundColor, actionClearCanvas, actionZoomIn, actionZoomOut, actionResetZoom, actionZoomToFit, actionToggleTheme, } from "./actionCanvas";
|
|
7
7
|
export { actionSetEmbeddableAsActiveTool } from "./actionEmbeddable";
|
|
8
8
|
export { actionFinalize } from "./actionFinalize";
|
|
@@ -14,10 +14,10 @@ export type ActionResult = {
|
|
|
14
14
|
type ActionFn<TData = any> = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: TData | undefined, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
15
15
|
export type UpdaterFn = (res: ActionResult) => void;
|
|
16
16
|
export type ActionFilterFn = (action: Action) => void;
|
|
17
|
-
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "arrowBinding" | "midpointSnapping" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "deselect" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
|
|
17
|
+
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "arrowBinding" | "midpointSnapping" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeFreedrawMode" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "deselect" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
|
|
18
18
|
export type PanelComponentProps = {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
|
-
appState:
|
|
20
|
+
appState: UIAppState;
|
|
21
21
|
updateData: <T = any>(formData?: T) => void;
|
|
22
22
|
appProps: ExcalidrawProps;
|
|
23
23
|
data?: Record<string, any>;
|
|
@@ -26,7 +26,7 @@ export type PanelComponentProps = {
|
|
|
26
26
|
};
|
|
27
27
|
export interface Action<TData = any> {
|
|
28
28
|
name: ActionName;
|
|
29
|
-
label: string | ((elements: readonly ExcalidrawElement[], appState: Readonly<
|
|
29
|
+
label: string | ((elements: readonly ExcalidrawElement[], appState: Readonly<UIAppState>, app: AppClassProperties) => string);
|
|
30
30
|
keywords?: string[];
|
|
31
31
|
icon?: React.ReactNode | ((appState: UIAppState, elements: readonly ExcalidrawElement[]) => React.ReactNode);
|
|
32
32
|
PanelComponent?: React.FC<PanelComponentProps>;
|
|
@@ -34,7 +34,7 @@ export interface Action<TData = any> {
|
|
|
34
34
|
keyPriority?: number;
|
|
35
35
|
keyTest?: (event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean;
|
|
36
36
|
predicate?: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: ExcalidrawProps, app: AppClassProperties) => boolean;
|
|
37
|
-
checked?: (appState: Readonly<
|
|
37
|
+
checked?: (appState: Readonly<UIAppState>) => boolean;
|
|
38
38
|
trackEvent: false | {
|
|
39
39
|
category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink" | "search_menu" | "shape_switch";
|
|
40
40
|
action?: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LaserPointer } from "@excalidraw/laser-pointer";
|
|
2
2
|
import type { LaserPointerOptions } from "@excalidraw/laser-pointer";
|
|
3
|
-
import type { AnimationFrameHandler } from "./animation-frame-handler";
|
|
4
3
|
import type App from "./components/App";
|
|
5
4
|
export interface Trail {
|
|
6
5
|
start(container: SVGSVGElement): void;
|
|
@@ -15,7 +14,6 @@ export interface AnimatedTrailOptions {
|
|
|
15
14
|
animateTrail?: boolean;
|
|
16
15
|
}
|
|
17
16
|
export declare class AnimatedTrail implements Trail {
|
|
18
|
-
private animationFrameHandler;
|
|
19
17
|
protected app: App;
|
|
20
18
|
private options;
|
|
21
19
|
private currentTrail?;
|
|
@@ -23,9 +21,12 @@ export declare class AnimatedTrail implements Trail {
|
|
|
23
21
|
private container?;
|
|
24
22
|
private trailElement;
|
|
25
23
|
private trailAnimation?;
|
|
26
|
-
|
|
24
|
+
private key;
|
|
25
|
+
private static counter;
|
|
26
|
+
constructor(app: App, options: Partial<LaserPointerOptions> & Partial<AnimatedTrailOptions>);
|
|
27
27
|
get hasCurrentTrail(): boolean;
|
|
28
28
|
hasLastPoint(x: number, y: number): boolean;
|
|
29
|
+
private cleanup;
|
|
29
30
|
start(container?: SVGSVGElement): void;
|
|
30
31
|
stop(): void;
|
|
31
32
|
startPath(x: number, y: number): void;
|
|
@@ -45,9 +45,10 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
45
45
|
currentItemStrokeColor?: string | undefined;
|
|
46
46
|
currentItemBackgroundColor?: string | undefined;
|
|
47
47
|
currentItemFillStyle?: import("@excalidraw/element/types").FillStyle | undefined;
|
|
48
|
-
|
|
48
|
+
currentItemStrokeWidthKey?: import("@excalidraw/common").StrokeWidthKey | undefined;
|
|
49
49
|
currentItemStrokeStyle?: import("@excalidraw/element/types").StrokeStyle | undefined;
|
|
50
50
|
currentItemRoughness?: number | undefined;
|
|
51
|
+
currentItemStrokeVariability?: import("@excalidraw/element/types").StrokeVariability | undefined;
|
|
51
52
|
currentItemOpacity?: number | undefined;
|
|
52
53
|
currentItemFontFamily?: number | undefined;
|
|
53
54
|
currentItemFontSize?: number | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExcalidrawElement, NonDeletedElementsMap, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
|
|
2
2
|
import "./Actions.scss";
|
|
3
|
-
import type { AppClassProperties, AppProps, UIAppState,
|
|
3
|
+
import type { AppClassProperties, AppProps, UIAppState, AppState } from "../types";
|
|
4
4
|
import type { ActionManager } from "../actions/manager";
|
|
5
5
|
export declare const canChangeStrokeColor: (appState: UIAppState, targetElements: ExcalidrawElement[]) => boolean;
|
|
6
6
|
export declare const canChangeBackgroundColor: (appState: UIAppState, targetElements: ExcalidrawElement[]) => boolean;
|
|
@@ -30,9 +30,8 @@ export declare const ShapesSwitcher: ({ activeTool, setAppState, app, UIOptions,
|
|
|
30
30
|
app: AppClassProperties;
|
|
31
31
|
UIOptions: AppProps["UIOptions"];
|
|
32
32
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
export declare const ZoomActions: ({ renderAction,
|
|
33
|
+
export declare const ZoomActions: ({ renderAction, }: {
|
|
34
34
|
renderAction: ActionManager["renderAction"];
|
|
35
|
-
zoom: Zoom;
|
|
36
35
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
37
36
|
export declare const UndoRedoActions: ({ renderAction, className, }: {
|
|
38
37
|
renderAction: ActionManager["renderAction"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const activeConfirmDialogAtom: import("jotai
|
|
1
|
+
export declare const activeConfirmDialogAtom: import("jotai").PrimitiveAtom<"clearCanvas" | null> & {
|
|
2
2
|
init: "clearCanvas" | null;
|
|
3
3
|
};
|
|
4
4
|
export declare const ActiveConfirmDialog: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -4,18 +4,19 @@ import { LinearElementEditor, FlowChartCreator, Scene, Store, type ElementUpdate
|
|
|
4
4
|
import type { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement, ExcalidrawEmbeddableElement, Ordered, SceneElementsMap } from "@excalidraw/element/types";
|
|
5
5
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
6
6
|
import { ActionManager } from "../actions/manager";
|
|
7
|
-
import { AnimationFrameHandler } from "../animation-frame-handler";
|
|
8
7
|
import { History } from "../history";
|
|
9
8
|
import { Fonts } from "../fonts";
|
|
10
9
|
import { type WritableAtom } from "../editor-jotai";
|
|
11
10
|
import { Renderer } from "../scene/Renderer";
|
|
12
|
-
import {
|
|
11
|
+
import { type SetViewportOptions } from "../viewport";
|
|
12
|
+
import { LaserTrails } from "../laserTrails";
|
|
13
13
|
import { isOverScrollBars } from "../scene/scrollbars";
|
|
14
14
|
import { LassoTrail } from "../lasso";
|
|
15
15
|
import { EraserTrail } from "../eraser";
|
|
16
|
+
import { CursorHints } from "./CursorHint";
|
|
16
17
|
import { type OnStateChange } from "./AppStateObserver";
|
|
17
18
|
import type { ExportedElements } from "../data";
|
|
18
|
-
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize, Offsets } from "../types";
|
|
19
|
+
import type { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType, OnUserFollowedPayload, ExcalidrawImperativeAPIEventMap, GenerateDiagramToCode, NullableGridSize, Offsets, ViewportOffsetsOptions } from "../types";
|
|
19
20
|
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
20
21
|
import type { ActionResult } from "../actions/types";
|
|
21
22
|
declare const editorLifecycleEventBehavior: {
|
|
@@ -73,11 +74,20 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
73
74
|
actionManager: ActionManager;
|
|
74
75
|
editorInterface: EditorInterface;
|
|
75
76
|
private stylesPanelMode;
|
|
77
|
+
/**
|
|
78
|
+
* Last-measured footprints of named viewport UI surfaces
|
|
79
|
+
* (`data-viewport-ui-name`), so `getViewportOffsets` can reserve space
|
|
80
|
+
* for them while they're hidden.
|
|
81
|
+
*/
|
|
82
|
+
private viewportUILastMeasured;
|
|
76
83
|
private excalidrawContainerRef;
|
|
77
84
|
scene: Scene;
|
|
78
85
|
fonts: Fonts;
|
|
79
86
|
renderer: Renderer;
|
|
80
87
|
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
88
|
+
/** whether the last render had any renderable elements (excludes e.g. the
|
|
89
|
+
* in-progress `newElement` and the edited text element) */
|
|
90
|
+
private hasRenderableElements;
|
|
81
91
|
private resizeObserver;
|
|
82
92
|
library: AppClassProperties["library"];
|
|
83
93
|
libraryItemsFromStorage: LibraryItems | undefined;
|
|
@@ -121,6 +131,9 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
121
131
|
y: number;
|
|
122
132
|
} | null;
|
|
123
133
|
private lastCompletedCanvasClicks;
|
|
134
|
+
/** arrowheads removed via endpoint double-click toggle, so a subsequent
|
|
135
|
+
* toggle can restore the original arrowhead (keyed by `elementId:side`) */
|
|
136
|
+
private removedArrowheads;
|
|
124
137
|
/** previous frame pointer coords */
|
|
125
138
|
previousPointerMoveCoords: {
|
|
126
139
|
x: number;
|
|
@@ -130,10 +143,10 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
130
143
|
x: number;
|
|
131
144
|
y: number;
|
|
132
145
|
};
|
|
133
|
-
animationFrameHandler: AnimationFrameHandler;
|
|
134
146
|
laserTrails: LaserTrails;
|
|
135
147
|
eraserTrail: EraserTrail;
|
|
136
148
|
lassoTrail: LassoTrail;
|
|
149
|
+
cursorHints: CursorHints;
|
|
137
150
|
onChangeEmitter: Emitter<[elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles]>;
|
|
138
151
|
onPointerDownEmitter: Emitter<[activeTool: {
|
|
139
152
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
@@ -302,7 +315,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
302
315
|
getSceneElements: () => readonly Ordered<NonDeletedExcalidrawElement>[];
|
|
303
316
|
onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
304
317
|
onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
|
|
305
|
-
exportingFrame: ExcalidrawFrameLikeElement | null;
|
|
318
|
+
exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
306
319
|
}) => Promise<void>;
|
|
307
320
|
private magicGenerations;
|
|
308
321
|
private updateMagicGeneration;
|
|
@@ -360,7 +373,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
360
373
|
clientY: number;
|
|
361
374
|
} | "cursor" | "center";
|
|
362
375
|
retainSeed?: boolean;
|
|
363
|
-
|
|
376
|
+
fit?: SetViewportOptions["fit"];
|
|
364
377
|
preserveFrameChildrenOrder?: boolean;
|
|
365
378
|
}) => void;
|
|
366
379
|
private addElementsFromMixedContentPaste;
|
|
@@ -380,37 +393,36 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
380
393
|
* 1 = 100% zoom, 2 = 200% zoom, 0.5 = 50% zoom
|
|
381
394
|
*/
|
|
382
395
|
value: number) => void;
|
|
383
|
-
private cancelInProgressAnimation;
|
|
384
|
-
scrollToContent: (
|
|
385
396
|
/**
|
|
386
|
-
*
|
|
397
|
+
* Navigates the viewport to a target and, optionally, locks pan/zoom to it.
|
|
398
|
+
* The resolved target box drives both the navigation (pan + zoom per
|
|
399
|
+
* `fit`) and the lock: the operations chain — the viewport animates onto
|
|
400
|
+
* the target, then the lock is installed against the settled viewport.
|
|
387
401
|
*
|
|
388
|
-
*
|
|
389
|
-
* - ExcalidrawElement | ExcalidrawElement[] - element(s) objects
|
|
402
|
+
* Passing `null` clears any active lock without navigating.
|
|
390
403
|
*/
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
viewportZoomFactor?: number;
|
|
404
|
-
animate?: boolean;
|
|
405
|
-
duration?: number;
|
|
406
|
-
}) & {
|
|
407
|
-
minZoom?: number;
|
|
408
|
-
maxZoom?: number;
|
|
409
|
-
canvasOffsets?: Offsets;
|
|
410
|
-
}) => void;
|
|
404
|
+
/**
|
|
405
|
+
* Resolves user-supplied viewport offsets ({@link ViewportOffsets}) into
|
|
406
|
+
* concrete per-side pixel values: static sides are used as-is, and when
|
|
407
|
+
* `ui` is set, the remaining sides are derived from the currently
|
|
408
|
+
* rendered editor UI (via `getViewportOffsets`).
|
|
409
|
+
*
|
|
410
|
+
* Must be called at the time the offsets are applied (not e.g. cached at
|
|
411
|
+
* props-definition time), so the UI-derived values reflect the actual
|
|
412
|
+
* rendered UI.
|
|
413
|
+
*/
|
|
414
|
+
private resolveViewportOffsets;
|
|
415
|
+
setViewport: (opts: SetViewportOptions | null) => void;
|
|
411
416
|
private maybeUnfollowRemoteUser;
|
|
412
417
|
/** use when changing scrollX/scrollY/zoom based on user interaction */
|
|
413
418
|
private translateCanvas;
|
|
419
|
+
/** clamps scroll/zoom back into `appState.scrollConstraints` (no-op when
|
|
420
|
+
* unconstrained). Runs as a queued update, so it sees the preceding change.
|
|
421
|
+
* `overscroll` (screen px) relaxes the bounds for rubberbanding. */
|
|
422
|
+
private constrainViewportToScrollConstraints;
|
|
423
|
+
/** animates an overscrolled viewport back inside the constraint box */
|
|
424
|
+
private snapBackToScrollConstraints;
|
|
425
|
+
private snapBackToScrollConstraintsDebounced;
|
|
414
426
|
setToast: (toast: AppState["toast"]) => void;
|
|
415
427
|
restoreFileFromShare: () => Promise<void>;
|
|
416
428
|
/**
|
|
@@ -448,7 +460,17 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
448
460
|
force?: boolean;
|
|
449
461
|
}) => boolean;
|
|
450
462
|
private updateCurrentCursorPosition;
|
|
451
|
-
|
|
463
|
+
/**
|
|
464
|
+
* top/right/bottom/left override the final offsets for those sides.
|
|
465
|
+
*
|
|
466
|
+
* Default side offsets are measured from the currently rendered UI
|
|
467
|
+
* surfaces marked with the `data-viewport-ui` attribute (see
|
|
468
|
+
* {@link ViewportUIDock}), plus padding.
|
|
469
|
+
*
|
|
470
|
+
* See {@link ViewportOffsetsOptions} for the individual options
|
|
471
|
+
* (padding, per-side overrides, reserving space for hidden surfaces).
|
|
472
|
+
*/
|
|
473
|
+
getViewportOffsets: (opts?: ViewportOffsetsOptions) => Offsets;
|
|
452
474
|
private onKeyDown;
|
|
453
475
|
private onKeyUp;
|
|
454
476
|
private isToolSupported;
|
|
@@ -491,6 +513,12 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
491
513
|
private startImageCropping;
|
|
492
514
|
private finishImageCropping;
|
|
493
515
|
private shouldHandleBrowserCanvasDoubleClick;
|
|
516
|
+
/**
|
|
517
|
+
* Toggles the arrowhead at the given endpoint between no arrowhead and the
|
|
518
|
+
* arrowhead it had before the last toggle (falling back to the current
|
|
519
|
+
* default arrowhead).
|
|
520
|
+
*/
|
|
521
|
+
private toggleArrowheadAtEndpoint;
|
|
494
522
|
private handleCanvasDoubleClick;
|
|
495
523
|
private handleCanvasClick;
|
|
496
524
|
private getElementLinkAtPosition;
|
|
@@ -545,6 +573,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
545
573
|
private newImagePlaceholder;
|
|
546
574
|
private handleLinearElementOnPointerDown;
|
|
547
575
|
private getCurrentItemRoundness;
|
|
576
|
+
private getCurrentItemStrokeWidth;
|
|
548
577
|
private createGenericElementOnPointerDown;
|
|
549
578
|
private createFrameElementOnPointerDown;
|
|
550
579
|
private maybeCacheReferenceSnapPoints;
|
|
@@ -2,7 +2,7 @@ import type { ColorTuple, ColorPaletteCustom } from "@excalidraw/common";
|
|
|
2
2
|
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
3
|
import "./ColorPicker.scss";
|
|
4
4
|
import type { ColorPickerType } from "./colorPickerUtils";
|
|
5
|
-
import type {
|
|
5
|
+
import type { UIAppState } from "../../types";
|
|
6
6
|
interface ColorPickerProps {
|
|
7
7
|
type: ColorPickerType;
|
|
8
8
|
/**
|
|
@@ -13,7 +13,7 @@ interface ColorPickerProps {
|
|
|
13
13
|
onChange: (color: string) => void;
|
|
14
14
|
label: string;
|
|
15
15
|
elements: readonly ExcalidrawElement[];
|
|
16
|
-
appState:
|
|
16
|
+
appState: UIAppState;
|
|
17
17
|
palette?: ColorPaletteCustom | null;
|
|
18
18
|
topPicks?: ColorTuple;
|
|
19
19
|
updateData: (formData?: any) => void;
|
|
@@ -14,7 +14,7 @@ export declare const isCustomColor: ({ color, palette, }: {
|
|
|
14
14
|
}) => boolean;
|
|
15
15
|
export declare const getMostUsedCustomColors: (elements: readonly ExcalidrawElement[], type: "elementBackground" | "elementStroke", palette: ColorPaletteCustom) => string[];
|
|
16
16
|
export type ActiveColorPickerSectionAtomType = "custom" | "baseColors" | "shades" | "hex" | null;
|
|
17
|
-
export declare const activeColorPickerSectionAtom: import("jotai
|
|
17
|
+
export declare const activeColorPickerSectionAtom: import("jotai").PrimitiveAtom<ActiveColorPickerSectionAtomType> & {
|
|
18
18
|
init: ActiveColorPickerSectionAtomType;
|
|
19
19
|
};
|
|
20
20
|
export type ColorPickerType = "canvasBackground" | "elementBackground" | "elementStroke";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const toggleTheme: CommandPaletteItem;
|
|
1
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import type { ConvertibleTypes, ExcalidrawElement, ExcalidrawTextContainer, Exca
|
|
|
2
2
|
import type { Scene } from "@excalidraw/element";
|
|
3
3
|
import "./ConvertElementTypePopup.scss";
|
|
4
4
|
import type App from "./App";
|
|
5
|
-
export declare const convertElementTypePopupAtom: import("jotai
|
|
5
|
+
export declare const convertElementTypePopupAtom: import("jotai").PrimitiveAtom<{
|
|
6
6
|
type: "panel";
|
|
7
7
|
} | null> & {
|
|
8
8
|
init: {
|
|
@@ -19,5 +19,5 @@ export declare const convertElementTypes: (app: App, { conversionType, nextType,
|
|
|
19
19
|
nextType?: ConvertibleTypes;
|
|
20
20
|
direction?: "left" | "right";
|
|
21
21
|
}) => boolean;
|
|
22
|
-
export declare const getConversionTypeFromElements: (elements: ExcalidrawElement[]) => ConversionType;
|
|
22
|
+
export declare const getConversionTypeFromElements: (elements: readonly ExcalidrawElement[]) => ConversionType;
|
|
23
23
|
export default ConvertElementTypePopup;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import "./CursorHint.scss";
|
|
2
|
+
import type { AppClassProperties, AppState } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* While a recently shown hint is still fresh in memory, tool-switch hints
|
|
5
|
+
* are suppressed (repeatedly re-picking a tool you just used doesn't need
|
|
6
|
+
* the reminder). Cycling arrow types and numeric shortcuts bypass this.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CURSOR_HINT_COOLDOWN: number;
|
|
9
|
+
export declare const cursorHintAtom: import("jotai").PrimitiveAtom<{
|
|
10
|
+
content: React.ReactNode;
|
|
11
|
+
/** unique per trigger so a re-trigger restarts the hide timer */
|
|
12
|
+
nonce: number;
|
|
13
|
+
} | null> & {
|
|
14
|
+
init: {
|
|
15
|
+
content: React.ReactNode;
|
|
16
|
+
/** unique per trigger so a re-trigger restarts the hide timer */
|
|
17
|
+
nonce: number;
|
|
18
|
+
} | null;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Owns the cursor-hint policy. App reports semantic interaction events
|
|
22
|
+
* (what the user did); all decisions about whether and what to show —
|
|
23
|
+
* cooldown, bypasses, hint content — are made here.
|
|
24
|
+
*/
|
|
25
|
+
export declare class CursorHints {
|
|
26
|
+
private app;
|
|
27
|
+
private lastShownAt;
|
|
28
|
+
constructor(app: AppClassProperties);
|
|
29
|
+
/**
|
|
30
|
+
* Shows a transient tooltip next to the cursor, hidden automatically
|
|
31
|
+
* after a short delay. Repeated calls replace the content and restart
|
|
32
|
+
* the timer.
|
|
33
|
+
*/
|
|
34
|
+
show: (content: React.ReactNode) => void;
|
|
35
|
+
private isOnCooldown;
|
|
36
|
+
/** arrow type cycled via shortcut (arrow tool already active) */
|
|
37
|
+
onArrowTypeCycled: (arrowType: AppState["currentItemArrowType"]) => void;
|
|
38
|
+
/** arrow/line tool picked via keyboard shortcut */
|
|
39
|
+
onToolShortcut: (tool: "arrow" | "line", source: "letter" | "digit") => void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Transient tooltip shown next to the cursor for added affordance after
|
|
43
|
+
* actions that have no other visual feedback near the pointer (e.g. cycling
|
|
44
|
+
* arrow types via shortcut). Trigger via `app.cursorHints`.
|
|
45
|
+
*/
|
|
46
|
+
export declare const CursorHint: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -13,7 +13,7 @@ export type EyeDropperProperties = {
|
|
|
13
13
|
**/
|
|
14
14
|
colorPickerType: ColorPickerType;
|
|
15
15
|
};
|
|
16
|
-
export declare const activeEyeDropperAtom: import("jotai
|
|
16
|
+
export declare const activeEyeDropperAtom: import("jotai").PrimitiveAtom<EyeDropperProperties | null> & {
|
|
17
17
|
init: EyeDropperProperties | null;
|
|
18
18
|
};
|
|
19
19
|
export declare const EyeDropper: React.FC<{
|