@excalidraw/math 0.18.0-4e758db → 0.18.0-4f68076
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/index.js +8 -2
- package/dist/dev/index.js.map +2 -2
- package/dist/prod/index.js +1 -1
- package/dist/types/common/src/constants.d.ts +10 -0
- package/dist/types/common/src/utils.d.ts +5 -0
- package/dist/types/element/src/binding.d.ts +13 -7
- package/dist/types/element/src/collision.d.ts +14 -5
- package/dist/types/element/src/duplicate.d.ts +60 -0
- package/dist/types/element/src/index.d.ts +1 -0
- package/dist/types/element/src/listMarker.d.ts +34 -0
- package/dist/types/element/src/newElement.d.ts +15 -1
- package/dist/types/element/src/renderElement.d.ts +21 -4
- package/dist/types/element/src/shape.d.ts +15 -1
- package/dist/types/element/src/textElement.d.ts +7 -0
- package/dist/types/element/src/utils.d.ts +8 -1
- package/dist/types/element/src/zindex.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +30 -3
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +20 -2
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +70 -7
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +20 -2
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +30 -3
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +13 -1
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +20 -2
- package/dist/types/excalidraw/actions/actionExport.d.ts +20 -2
- package/dist/types/excalidraw/actions/actionFrame.d.ts +30 -3
- package/dist/types/excalidraw/actions/actionGroup.d.ts +20 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionProperties.d.ts +20 -2
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleShowHints.d.ts +197 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +10 -1
- package/dist/types/excalidraw/actions/index.d.ts +1 -0
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +2 -0
- package/dist/types/excalidraw/components/App.arrowText.d.ts +5 -39
- package/dist/types/excalidraw/components/App.clipboard.d.ts +31 -0
- package/dist/types/excalidraw/components/App.d.ts +82 -262
- package/dist/types/excalidraw/components/App.duplicate.d.ts +101 -0
- package/dist/types/excalidraw/components/App.modifiers.d.ts +38 -0
- package/dist/types/excalidraw/components/App.pan.d.ts +62 -0
- package/dist/types/excalidraw/components/App.selectionTool.d.ts +57 -0
- package/dist/types/excalidraw/components/App.text.d.ts +146 -0
- package/dist/types/excalidraw/components/App.textTool.d.ts +140 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +41 -1
- package/dist/types/excalidraw/components/App.wheel.d.ts +3 -10
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +2 -0
- package/dist/types/excalidraw/components/ColorPicker/colorTopPicksDnD.d.ts +11 -0
- package/dist/types/excalidraw/components/FileDropOverlay.d.ts +2 -0
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +4 -1
- package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +6 -1
- package/dist/types/excalidraw/components/FontPicker/fontTopPicksDnD.d.ts +12 -0
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +6 -2
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +7 -2
- package/dist/types/excalidraw/components/Tooltip.d.ts +15 -1
- package/dist/types/excalidraw/components/TopPicksDnD/TopPicksContextMenu.d.ts +14 -0
- package/dist/types/excalidraw/components/TopPicksDnD/TopPicksTip.d.ts +11 -0
- package/dist/types/excalidraw/components/TopPicksDnD/topPicksDnD.d.ts +58 -0
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -0
- package/dist/types/excalidraw/data/blob.d.ts +20 -2
- package/dist/types/excalidraw/data/json.d.ts +10 -1
- package/dist/types/excalidraw/renderOverrides.d.ts +9 -0
- package/dist/types/excalidraw/scene/Renderer.d.ts +14 -1
- package/dist/types/excalidraw/scene/types.d.ts +2 -1
- package/dist/types/excalidraw/types.d.ts +92 -19
- package/dist/types/excalidraw/viewport.d.ts +23 -1
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +12 -1
- package/package.json +2 -2
- package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +0 -31
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
export declare const actionToggleShowHints: {
|
|
2
|
+
name: "showHints";
|
|
3
|
+
label: string;
|
|
4
|
+
icon: import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
keywords: string[];
|
|
6
|
+
viewMode: false;
|
|
7
|
+
trackEvent: {
|
|
8
|
+
category: "canvas";
|
|
9
|
+
predicate: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
10
|
+
};
|
|
11
|
+
perform(elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>): {
|
|
12
|
+
appState: {
|
|
13
|
+
showHints: boolean;
|
|
14
|
+
contextMenu: {
|
|
15
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
16
|
+
top: number;
|
|
17
|
+
left: number;
|
|
18
|
+
} | null;
|
|
19
|
+
showWelcomeScreen: boolean;
|
|
20
|
+
isLoading: boolean;
|
|
21
|
+
errorMessage: React.ReactNode;
|
|
22
|
+
activeEmbeddable: {
|
|
23
|
+
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
24
|
+
state: "hover" | "active";
|
|
25
|
+
} | null;
|
|
26
|
+
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
27
|
+
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
28
|
+
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
29
|
+
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
30
|
+
isBindingEnabled: boolean;
|
|
31
|
+
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
32
|
+
bindingPreference: "enabled" | "disabled";
|
|
33
|
+
isMidpointSnappingEnabled: boolean;
|
|
34
|
+
inputDevice: import("../types").InputDevice;
|
|
35
|
+
suggestedBinding: {
|
|
36
|
+
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
37
|
+
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
38
|
+
} | null;
|
|
39
|
+
textToolHover: {
|
|
40
|
+
type: "text";
|
|
41
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
42
|
+
} | {
|
|
43
|
+
type: "container";
|
|
44
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
45
|
+
} | {
|
|
46
|
+
type: "arrow";
|
|
47
|
+
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
48
|
+
anchor: "start" | "end" | "label";
|
|
49
|
+
} | null;
|
|
50
|
+
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
51
|
+
frameRendering: {
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
name: boolean;
|
|
54
|
+
outline: boolean;
|
|
55
|
+
clip: boolean;
|
|
56
|
+
};
|
|
57
|
+
editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
|
|
58
|
+
elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
|
|
59
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
60
|
+
activeTool: {
|
|
61
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
62
|
+
locked: boolean;
|
|
63
|
+
fromSelection: boolean;
|
|
64
|
+
} & import("../types").ActiveTool;
|
|
65
|
+
preferredSelectionTool: {
|
|
66
|
+
type: "selection" | "lasso";
|
|
67
|
+
initialized: boolean;
|
|
68
|
+
};
|
|
69
|
+
penMode: boolean;
|
|
70
|
+
penDetected: boolean;
|
|
71
|
+
exportBackground: boolean;
|
|
72
|
+
exportEmbedScene: boolean;
|
|
73
|
+
exportWithDarkMode: boolean;
|
|
74
|
+
exportScale: number;
|
|
75
|
+
currentItemStrokeColor: string;
|
|
76
|
+
currentItemStickynoteStrokeColor: string;
|
|
77
|
+
currentItemStickynoteBackgroundColor: string;
|
|
78
|
+
currentItemBackgroundColor: string;
|
|
79
|
+
currentItemFillStyle: import("@excalidraw/element/types").ExcalidrawElement["fillStyle"];
|
|
80
|
+
currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
|
|
81
|
+
currentItemStrokeStyle: import("@excalidraw/element/types").ExcalidrawElement["strokeStyle"];
|
|
82
|
+
currentItemRoughness: number;
|
|
83
|
+
currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
|
|
84
|
+
currentItemOpacity: number;
|
|
85
|
+
currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
|
|
86
|
+
currentItemFontSize: number;
|
|
87
|
+
currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
|
|
88
|
+
currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
89
|
+
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
90
|
+
currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
|
|
91
|
+
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
92
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
93
|
+
viewBackgroundColor: string;
|
|
94
|
+
scrollX: number;
|
|
95
|
+
scrollY: number;
|
|
96
|
+
scrollConstraints: import("../types").ScrollConstraints | null;
|
|
97
|
+
cursorButton: "up" | "down";
|
|
98
|
+
scrolledOutside: boolean;
|
|
99
|
+
name: string | null;
|
|
100
|
+
isResizing: boolean;
|
|
101
|
+
isRotating: boolean;
|
|
102
|
+
zoom: import("../types").Zoom;
|
|
103
|
+
openMenu: "canvas" | null;
|
|
104
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
105
|
+
openSidebar: {
|
|
106
|
+
name: import("../types").SidebarName;
|
|
107
|
+
tab?: import("../types").SidebarTabName;
|
|
108
|
+
} | null;
|
|
109
|
+
openDialog: null | {
|
|
110
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
111
|
+
} | {
|
|
112
|
+
name: "ttd";
|
|
113
|
+
tab: "text-to-diagram" | "mermaid";
|
|
114
|
+
} | {
|
|
115
|
+
name: "commandPalette";
|
|
116
|
+
} | {
|
|
117
|
+
name: "settings";
|
|
118
|
+
} | {
|
|
119
|
+
name: "elementLinkSelector";
|
|
120
|
+
sourceElementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
121
|
+
} | {
|
|
122
|
+
name: "charts";
|
|
123
|
+
data: import("../charts").Spreadsheet;
|
|
124
|
+
rawText: string;
|
|
125
|
+
};
|
|
126
|
+
defaultSidebarDockedPreference: boolean;
|
|
127
|
+
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
128
|
+
selectedElementIds: Readonly<{
|
|
129
|
+
[id: string]: true;
|
|
130
|
+
}>;
|
|
131
|
+
hoveredElementIds: Readonly<{
|
|
132
|
+
[id: string]: true;
|
|
133
|
+
}>;
|
|
134
|
+
previousSelectedElementIds: {
|
|
135
|
+
[id: string]: true;
|
|
136
|
+
};
|
|
137
|
+
selectedElementsAreBeingDragged: boolean;
|
|
138
|
+
shouldCacheIgnoreZoom: boolean;
|
|
139
|
+
toast: {
|
|
140
|
+
message: React.ReactNode;
|
|
141
|
+
closable?: boolean;
|
|
142
|
+
duration?: number;
|
|
143
|
+
} | null;
|
|
144
|
+
zenModeEnabled: boolean;
|
|
145
|
+
theme: import("@excalidraw/element/types").Theme;
|
|
146
|
+
gridSize: number;
|
|
147
|
+
gridStep: number;
|
|
148
|
+
gridModeEnabled: boolean;
|
|
149
|
+
viewModeEnabled: boolean;
|
|
150
|
+
selectedGroupIds: {
|
|
151
|
+
[groupId: string]: boolean;
|
|
152
|
+
};
|
|
153
|
+
editingGroupId: import("@excalidraw/element/types").GroupId | null;
|
|
154
|
+
width: number;
|
|
155
|
+
height: number;
|
|
156
|
+
offsetTop: number;
|
|
157
|
+
offsetLeft: number;
|
|
158
|
+
fileHandle: FileSystemFileHandle | null;
|
|
159
|
+
collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
|
|
160
|
+
stats: {
|
|
161
|
+
open: boolean;
|
|
162
|
+
panels: number;
|
|
163
|
+
};
|
|
164
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
165
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
166
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
167
|
+
originSnapOffset: {
|
|
168
|
+
x: number;
|
|
169
|
+
y: number;
|
|
170
|
+
} | null;
|
|
171
|
+
objectsSnapModeEnabled: boolean;
|
|
172
|
+
isCropping: boolean;
|
|
173
|
+
croppingElementId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
|
|
174
|
+
searchMatches: Readonly<{
|
|
175
|
+
focusedId: import("@excalidraw/element/types").ExcalidrawElement["id"] | null;
|
|
176
|
+
matches: readonly import("../types").SearchMatch[];
|
|
177
|
+
}> | null;
|
|
178
|
+
activeLockedId: string | null;
|
|
179
|
+
lockedMultiSelections: {
|
|
180
|
+
[groupId: string]: true;
|
|
181
|
+
};
|
|
182
|
+
bindMode: import("@excalidraw/element/types").BindMode;
|
|
183
|
+
colorTopPicks: {
|
|
184
|
+
elementStroke: readonly string[] | null;
|
|
185
|
+
elementBackground: readonly string[] | null;
|
|
186
|
+
bucketFill: readonly string[] | null;
|
|
187
|
+
stickyNoteStroke: readonly string[] | null;
|
|
188
|
+
stickyNoteBackground: readonly string[] | null;
|
|
189
|
+
};
|
|
190
|
+
fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
|
|
191
|
+
};
|
|
192
|
+
captureUpdate: "NEVER";
|
|
193
|
+
};
|
|
194
|
+
checked: (appState: Readonly<import("../types").UIAppState>) => boolean;
|
|
195
|
+
} & {
|
|
196
|
+
keyTest?: undefined;
|
|
197
|
+
};
|
|
@@ -33,12 +33,20 @@ export declare const actionToggleStats: {
|
|
|
33
33
|
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
34
34
|
bindingPreference: "enabled" | "disabled";
|
|
35
35
|
isMidpointSnappingEnabled: boolean;
|
|
36
|
+
showHints: boolean;
|
|
36
37
|
inputDevice: import("../types").InputDevice;
|
|
37
38
|
suggestedBinding: {
|
|
38
39
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
39
40
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
40
41
|
} | null;
|
|
41
|
-
|
|
42
|
+
textToolHover: {
|
|
43
|
+
type: "text";
|
|
44
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
45
|
+
} | {
|
|
46
|
+
type: "container";
|
|
47
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
48
|
+
} | {
|
|
49
|
+
type: "arrow";
|
|
42
50
|
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
43
51
|
anchor: "start" | "end" | "label";
|
|
44
52
|
} | null;
|
|
@@ -178,6 +186,7 @@ export declare const actionToggleStats: {
|
|
|
178
186
|
stickyNoteStroke: readonly string[] | null;
|
|
179
187
|
stickyNoteBackground: readonly string[] | null;
|
|
180
188
|
};
|
|
189
|
+
fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
|
|
181
190
|
};
|
|
182
191
|
captureUpdate: "EVENTUALLY";
|
|
183
192
|
};
|
|
@@ -30,12 +30,20 @@ export declare const actionToggleViewMode: {
|
|
|
30
30
|
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
31
31
|
bindingPreference: "enabled" | "disabled";
|
|
32
32
|
isMidpointSnappingEnabled: boolean;
|
|
33
|
+
showHints: boolean;
|
|
33
34
|
inputDevice: import("../types").InputDevice;
|
|
34
35
|
suggestedBinding: {
|
|
35
36
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
36
37
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
37
38
|
} | null;
|
|
38
|
-
|
|
39
|
+
textToolHover: {
|
|
40
|
+
type: "text";
|
|
41
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
42
|
+
} | {
|
|
43
|
+
type: "container";
|
|
44
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
45
|
+
} | {
|
|
46
|
+
type: "arrow";
|
|
39
47
|
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
40
48
|
anchor: "start" | "end" | "label";
|
|
41
49
|
} | null;
|
|
@@ -178,6 +186,7 @@ export declare const actionToggleViewMode: {
|
|
|
178
186
|
stickyNoteStroke: readonly string[] | null;
|
|
179
187
|
stickyNoteBackground: readonly string[] | null;
|
|
180
188
|
};
|
|
189
|
+
fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
|
|
181
190
|
};
|
|
182
191
|
captureUpdate: "EVENTUALLY";
|
|
183
192
|
};
|
|
@@ -30,12 +30,20 @@ export declare const actionToggleZenMode: {
|
|
|
30
30
|
boxSelectionMode: import("../types").BoxSelectionMode;
|
|
31
31
|
bindingPreference: "enabled" | "disabled";
|
|
32
32
|
isMidpointSnappingEnabled: boolean;
|
|
33
|
+
showHints: boolean;
|
|
33
34
|
inputDevice: import("../types").InputDevice;
|
|
34
35
|
suggestedBinding: {
|
|
35
36
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
36
37
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
37
38
|
} | null;
|
|
38
|
-
|
|
39
|
+
textToolHover: {
|
|
40
|
+
type: "text";
|
|
41
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
42
|
+
} | {
|
|
43
|
+
type: "container";
|
|
44
|
+
elementId: import("@excalidraw/element/types").ExcalidrawElement["id"];
|
|
45
|
+
} | {
|
|
46
|
+
type: "arrow";
|
|
39
47
|
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
40
48
|
anchor: "start" | "end" | "label";
|
|
41
49
|
} | null;
|
|
@@ -178,6 +186,7 @@ export declare const actionToggleZenMode: {
|
|
|
178
186
|
stickyNoteStroke: readonly string[] | null;
|
|
179
187
|
stickyNoteBackground: readonly string[] | null;
|
|
180
188
|
};
|
|
189
|
+
fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
|
|
181
190
|
};
|
|
182
191
|
captureUpdate: "EVENTUALLY";
|
|
183
192
|
};
|
|
@@ -21,6 +21,7 @@ export { actionToggleZenMode } from "./actionToggleZenMode";
|
|
|
21
21
|
export { actionToggleObjectsSnapMode } from "./actionToggleObjectsSnapMode";
|
|
22
22
|
export { actionToggleArrowBinding } from "./actionToggleArrowBinding";
|
|
23
23
|
export { actionToggleMidpointSnapping } from "./actionToggleMidpointSnapping";
|
|
24
|
+
export { actionToggleShowHints } from "./actionToggleShowHints";
|
|
24
25
|
export { actionToggleStats } from "./actionToggleStats";
|
|
25
26
|
export { actionUnbindText, actionBindText } from "./actionBoundText";
|
|
26
27
|
export { actionLink } from "./actionLink";
|
|
@@ -14,7 +14,7 @@ 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" | "changeBucketFillBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "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" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleShapeSwitch" | "togglePolygon";
|
|
17
|
+
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "arrowBinding" | "midpointSnapping" | "showHints" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeBucketFillBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "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" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleShapeSwitch" | "togglePolygon";
|
|
18
18
|
export type PanelComponentProps = {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
20
|
appState: UIAppState;
|
|
@@ -34,6 +34,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
34
34
|
showWelcomeScreen?: boolean | undefined;
|
|
35
35
|
boxSelectionMode?: import("./types").BoxSelectionMode | undefined;
|
|
36
36
|
bindingPreference?: "enabled" | "disabled" | undefined;
|
|
37
|
+
showHints?: boolean | undefined;
|
|
37
38
|
inputDevice?: InputDevice | undefined;
|
|
38
39
|
preferredSelectionTool?: {
|
|
39
40
|
type: "selection" | "lasso";
|
|
@@ -88,6 +89,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
88
89
|
stickyNoteStroke: readonly string[] | null;
|
|
89
90
|
stickyNoteBackground: readonly string[] | null;
|
|
90
91
|
} | undefined;
|
|
92
|
+
fontTopPicks?: readonly number[] | null | undefined;
|
|
91
93
|
};
|
|
92
94
|
export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
|
|
93
95
|
viewBackgroundColor?: string | undefined;
|
|
@@ -2,19 +2,16 @@ import { LinearElementEditor } from "@excalidraw/element";
|
|
|
2
2
|
import type { ArrowEndpoint } from "@excalidraw/element";
|
|
3
3
|
import type { ExcalidrawElement, ExcalidrawTextElement, FixedPoint, NonDeleted, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
4
4
|
import type App from "./App";
|
|
5
|
-
import type {
|
|
5
|
+
import type { PointerDownState } from "../types";
|
|
6
6
|
/**
|
|
7
7
|
* Text ↔ arrow interactions.
|
|
8
8
|
*
|
|
9
|
-
* With the text tool: the
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* bound to the arrow) — and the endpoint-bound flavor of drag-sizing a new
|
|
13
|
-
* text.
|
|
9
|
+
* With the text tool: the free endpoint a click would bind a new text to
|
|
10
|
+
* (`AppTextTool` resolves and shows it), the binding itself, and the
|
|
11
|
+
* endpoint-bound flavor of drag-sizing a new text.
|
|
14
12
|
*
|
|
15
13
|
* With the selection tool: dragging an arrow's existing label along the arrow
|
|
16
|
-
* — the grab affordance
|
|
17
|
-
* editing a label the drag has moved.
|
|
14
|
+
* — the grab affordance and the drag itself.
|
|
18
15
|
*
|
|
19
16
|
* The scene-level logic lives in `@excalidraw/element`'s
|
|
20
17
|
* `arrowEndpointText.ts` and `linearElementEditor.ts`.
|
|
@@ -22,34 +19,12 @@ import type { AppState, PointerDownState } from "../types";
|
|
|
22
19
|
export declare class AppArrowText {
|
|
23
20
|
private app;
|
|
24
21
|
constructor(app: App);
|
|
25
|
-
/**
|
|
26
|
-
* With the text tool active, an arrow under the cursor is a target for
|
|
27
|
-
* attaching text. Returns where the text would land (if anywhere), and keeps
|
|
28
|
-
* `appState.hoveredArrowTextAnchor` — which drives the highlight — in sync.
|
|
29
|
-
*/
|
|
30
|
-
updateHoveredAnchor: (scenePointer: {
|
|
31
|
-
x: number;
|
|
32
|
-
y: number;
|
|
33
|
-
}) => AppState["hoveredArrowTextAnchor"];
|
|
34
|
-
/**
|
|
35
|
-
* Re-evaluates the hovered anchor at the last known pointer position — for
|
|
36
|
-
* events that change what a click would do without the pointer moving,
|
|
37
|
-
* i.e. the ctrl/cmd binding toggle. (Events that invalidate the anchor
|
|
38
|
-
* wholesale — tool switches, finalize, deselect — clear it directly
|
|
39
|
-
* instead.)
|
|
40
|
-
*/
|
|
41
|
-
refresh: () => void;
|
|
42
22
|
/**
|
|
43
23
|
* A free arrow endpoint a new text could be bound to. Binding an endpoint is
|
|
44
24
|
* an arrow binding, so it follows the binding toggle (ctrl/cmd) like every
|
|
45
25
|
* other one — holding it makes the text tool drop plain text instead.
|
|
46
26
|
*/
|
|
47
27
|
getBindableEndpointAtPosition(x: number, y: number): ArrowEndpoint | null;
|
|
48
|
-
/**
|
|
49
|
-
* Mirrors what `handleTextOnPointerDown` would do at this position, so the
|
|
50
|
-
* highlight can't promise something the click won't deliver.
|
|
51
|
-
*/
|
|
52
|
-
private getAnchorAtPosition;
|
|
53
28
|
/**
|
|
54
29
|
* How a text should be created to read as a label for this endpoint — the
|
|
55
30
|
* side midpoint to bind, the alignment that pins it, and the scene position
|
|
@@ -92,13 +67,4 @@ export declare class AppArrowText {
|
|
|
92
67
|
x: number;
|
|
93
68
|
y: number;
|
|
94
69
|
}): boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Where a double-click on a labeled arrow should start text editing: the
|
|
97
|
-
* center of the label itself, which a label drag may have moved away from
|
|
98
|
-
* the arrow's midpoint. Null when the element is not a labeled arrow.
|
|
99
|
-
*/
|
|
100
|
-
getLabelCenter(element: ExcalidrawElement): {
|
|
101
|
-
x: number;
|
|
102
|
-
y: number;
|
|
103
|
-
} | null;
|
|
104
70
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type App from "./App";
|
|
3
|
+
type AppClipboardDependencies = {
|
|
4
|
+
getContainer: () => HTMLDivElement | null;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The clipboard: cut and copy (through their actions), and paste — the
|
|
8
|
+
* pasted data parsed (`pasteFromClipboard`) and inserted as whatever it is
|
|
9
|
+
* (`insertClipboardContent`): images or SVG code, elements, a Mermaid
|
|
10
|
+
* definition, embeddable URLs, a spreadsheet (as a chart), mixed content,
|
|
11
|
+
* or text. Pasted elements go in through `app.addElementsFromPasteOrLibrary`,
|
|
12
|
+
* as a library item or a drop does.
|
|
13
|
+
*/
|
|
14
|
+
export declare class AppClipboard {
|
|
15
|
+
private app;
|
|
16
|
+
private dependencies;
|
|
17
|
+
constructor(app: App, dependencies: AppClipboardDependencies);
|
|
18
|
+
onCut: (event: ClipboardEvent) => void;
|
|
19
|
+
onCopy: (event: ClipboardEvent) => void;
|
|
20
|
+
private insertClipboardContent;
|
|
21
|
+
/**
|
|
22
|
+
* Ctrl/Cmd+V: whether the paste event that follows is a plain one (with
|
|
23
|
+
* Shift)
|
|
24
|
+
*/
|
|
25
|
+
onPasteShortcut: (event: React.KeyboardEvent | KeyboardEvent) => void;
|
|
26
|
+
clearPlainPaste: () => void;
|
|
27
|
+
pasteFromClipboard: (event: ClipboardEvent) => Promise<void>;
|
|
28
|
+
private addElementsFromMixedContentPaste;
|
|
29
|
+
private addTextFromPaste;
|
|
30
|
+
}
|
|
31
|
+
export {};
|