@zsviczian/excalidraw 0.18.0-5 → 0.18.0-50
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/excalidraw.development.js +745 -503
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +0 -2
- package/dist/styles.development.css +1062 -429
- package/dist/styles.production.css +26 -22
- package/package.json +14 -3
- package/types/common/src/commonObsidianUtils.d.ts +13 -0
- package/types/common/src/constants.d.ts +42 -18
- package/types/common/src/editorInterface.d.ts +35 -0
- package/types/{excalidraw → common/src}/emitter.d.ts +1 -1
- package/types/common/src/font-metadata.d.ts +4 -2
- package/types/common/src/index.d.ts +2 -0
- package/types/common/src/utility-types.d.ts +5 -0
- package/types/common/src/utils.d.ts +20 -5
- package/types/{excalidraw/scene → element/src}/Scene.d.ts +16 -15
- package/types/element/src/align.d.ts +4 -3
- package/types/element/src/binding.d.ts +27 -17
- package/types/element/src/bounds.d.ts +14 -6
- package/types/element/src/collision.d.ts +18 -12
- package/types/element/src/cropElement.d.ts +1 -1
- package/types/{excalidraw/change.d.ts → element/src/delta.d.ts} +77 -40
- package/types/element/src/distance.d.ts +2 -2
- package/types/element/src/distribute.d.ts +2 -1
- package/types/element/src/dragElements.d.ts +3 -2
- package/types/element/src/duplicate.d.ts +10 -13
- package/types/element/src/elbowArrow.d.ts +1 -1
- package/types/element/src/flowchart.d.ts +3 -2
- package/types/element/src/fractionalIndex.d.ts +9 -3
- package/types/element/src/frame.d.ts +5 -4
- package/types/element/src/groups.d.ts +1 -0
- package/types/element/src/index.d.ts +44 -2
- package/types/element/src/linearElementEditor.d.ts +23 -36
- package/types/element/src/mutateElement.d.ts +11 -3
- package/types/element/src/newElement.d.ts +6 -4
- package/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/types/element/src/renderElement.d.ts +4 -1
- package/types/element/src/resizeElements.d.ts +6 -5
- package/types/element/src/resizeTest.d.ts +5 -4
- package/types/element/src/selection.d.ts +11 -5
- package/types/element/src/shape.d.ts +42 -0
- package/types/element/src/sizeHelpers.d.ts +2 -2
- package/types/element/src/store.d.ts +237 -0
- package/types/element/src/textElement.d.ts +5 -3
- package/types/element/src/transformHandles.d.ts +5 -4
- package/types/element/src/typeChecks.d.ts +19 -1
- package/types/element/src/types.d.ts +25 -2
- package/types/element/src/utils.d.ts +16 -6
- package/types/element/src/zindex.d.ts +1 -1
- package/types/excalidraw/actions/actionAddToLibrary.d.ts +75 -54
- package/types/excalidraw/actions/actionBoundText.d.ts +50 -36
- package/types/excalidraw/actions/actionCanvas.d.ts +388 -282
- package/types/excalidraw/actions/actionClipboard.d.ts +151 -107
- package/types/excalidraw/actions/actionCropEditor.d.ts +25 -18
- package/types/excalidraw/actions/actionDeleteSelected.d.ts +77 -55
- package/types/excalidraw/actions/actionDuplicateSelection.d.ts +1 -1
- package/types/excalidraw/actions/actionElementLink.d.ts +25 -18
- package/types/excalidraw/actions/actionElementLock.d.ts +65 -52
- package/types/excalidraw/actions/actionEmbeddable.d.ts +25 -18
- package/types/excalidraw/actions/actionExport.d.ts +237 -174
- package/types/excalidraw/actions/actionFinalize.d.ts +307 -43
- package/types/excalidraw/actions/actionFrame.d.ts +157 -120
- package/types/excalidraw/actions/actionGroup.d.ts +50 -36
- package/types/excalidraw/actions/actionHistory.d.ts +1 -2
- package/types/excalidraw/actions/actionLinearEditor.d.ts +563 -20
- package/types/excalidraw/actions/actionLink.d.ts +23 -16
- package/types/excalidraw/actions/actionMenu.d.ts +25 -456
- package/types/excalidraw/actions/actionNavigate.d.ts +49 -35
- package/types/excalidraw/actions/actionProperties.d.ts +629 -273
- package/types/excalidraw/actions/actionSelectAll.d.ts +25 -18
- package/types/excalidraw/actions/actionStyles.d.ts +25 -18
- package/types/excalidraw/actions/actionToggleGridMode.d.ts +25 -18
- package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +25 -18
- package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +25 -223
- package/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/types/excalidraw/actions/actionToggleStats.d.ts +25 -18
- package/types/excalidraw/actions/actionToggleViewMode.d.ts +25 -18
- package/types/excalidraw/actions/actionToggleZenMode.d.ts +26 -19
- package/types/excalidraw/actions/actionTrayMenu.d.ts +226 -0
- package/types/excalidraw/actions/index.d.ts +4 -2
- package/types/excalidraw/actions/types.d.ts +4 -3
- package/types/excalidraw/appState.d.ts +24 -10
- package/types/excalidraw/clipboard.d.ts +68 -5
- package/types/excalidraw/components/Actions.d.ts +20 -7
- package/types/excalidraw/components/App.d.ts +63 -38
- package/types/excalidraw/components/ButtonIcon.d.ts +1 -0
- package/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -1
- package/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +5 -1
- package/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +1 -1
- package/types/excalidraw/components/ColorPicker/Picker.d.ts +4 -3
- package/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +3 -3
- package/types/excalidraw/components/ColorPicker/ShadeList.d.ts +3 -2
- package/types/excalidraw/components/ColorPicker/TopPicks.d.ts +1 -1
- package/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
- package/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +1 -1
- package/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
- package/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
- package/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
- package/types/excalidraw/components/Ellipsify.d.ts +3 -0
- package/types/excalidraw/components/ExcalidrawLogo.d.ts +1 -1
- package/types/excalidraw/components/FixedSideContainer.d.ts +2 -1
- package/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
- package/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
- package/types/excalidraw/components/HintViewer.d.ts +4 -3
- package/types/excalidraw/components/InlineIcon.d.ts +3 -1
- package/types/excalidraw/components/LayerUI.d.ts +2 -1
- package/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
- package/types/excalidraw/components/MobileMenu.d.ts +4 -5
- package/types/excalidraw/components/MobileToolBar.d.ts +10 -0
- package/types/excalidraw/components/Popover.d.ts +2 -1
- package/types/excalidraw/components/PropertiesPopover.d.ts +1 -0
- package/types/excalidraw/components/{ButtonIconSelect.d.ts → RadioSelection.d.ts} +1 -1
- package/types/excalidraw/components/Range.d.ts +3 -3
- package/types/excalidraw/components/Section.d.ts +1 -0
- package/types/excalidraw/components/Stats/Angle.d.ts +1 -1
- package/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
- package/types/excalidraw/components/Stats/CanvasGridSize.d.ts +1 -1
- package/types/excalidraw/components/Stats/Collapsible.d.ts +2 -1
- package/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
- package/types/excalidraw/components/Stats/DragInput.d.ts +12 -2
- package/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
- package/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
- package/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
- package/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
- package/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
- package/types/excalidraw/components/Stats/Position.d.ts +1 -1
- package/types/excalidraw/components/Stats/utils.d.ts +4 -11
- package/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +1 -2
- package/types/excalidraw/components/TextField.d.ts +1 -0
- package/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/types/excalidraw/components/TrayMenu.d.ts +26 -0
- package/types/excalidraw/components/UnlockPopup.d.ts +8 -0
- package/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +4 -2
- package/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +4 -2
- package/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +2 -1
- package/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
- package/types/excalidraw/components/hyperlink/helpers.d.ts +2 -1
- package/types/excalidraw/components/icons.d.ts +13 -0
- package/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +14 -1
- package/types/excalidraw/components/main-menu/MainMenu.d.ts +0 -3
- package/types/excalidraw/components/shapes.d.ts +115 -5
- package/types/excalidraw/data/blob.d.ts +3 -7
- package/types/excalidraw/data/reconcile.d.ts +1 -0
- package/types/excalidraw/data/restore.d.ts +6 -1
- package/types/excalidraw/data/transform.d.ts +1 -1
- package/types/excalidraw/data/types.d.ts +4 -1
- package/types/excalidraw/editor-jotai.d.ts +6 -6
- package/types/excalidraw/eraser/index.d.ts +12 -0
- package/types/excalidraw/fonts/Fonts.d.ts +1 -1
- package/types/excalidraw/history.d.ts +30 -22
- package/types/excalidraw/hooks/useEmitter.d.ts +1 -1
- package/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/types/excalidraw/index.d.ts +15 -14
- package/types/excalidraw/lasso/index.d.ts +1 -0
- package/types/excalidraw/lasso/utils.d.ts +3 -3
- package/types/excalidraw/obsidianUtils.d.ts +22 -4
- package/types/excalidraw/renderer/helpers.d.ts +7 -2
- package/types/excalidraw/renderer/interactiveScene.d.ts +1 -1
- package/types/excalidraw/renderer/staticScene.d.ts +4 -1
- package/types/excalidraw/scene/Renderer.d.ts +1 -2
- package/types/excalidraw/scene/index.d.ts +2 -2
- package/types/excalidraw/scene/scrollbars.d.ts +2 -3
- package/types/excalidraw/scene/types.d.ts +5 -3
- package/types/excalidraw/shortcut.d.ts +1 -0
- package/types/excalidraw/snapping.d.ts +2 -2
- package/types/excalidraw/types.d.ts +68 -30
- package/types/excalidraw/webpack.dev.config.d.ts +2 -0
- package/types/excalidraw/webpack.prod.config.d.ts +2 -0
- package/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
- package/types/math/src/angle.d.ts +2 -0
- package/types/math/src/constants.d.ts +3 -0
- package/types/math/src/curve.d.ts +34 -0
- package/types/math/src/index.d.ts +1 -0
- package/types/math/src/point.d.ts +1 -1
- package/types/math/src/rectangle.d.ts +2 -0
- package/types/math/src/segment.d.ts +1 -0
- package/types/math/src/types.d.ts +1 -0
- package/types/math/src/vector.d.ts +8 -2
- package/types/utils/src/bbox.d.ts +1 -1
- package/types/utils/src/index.d.ts +1 -1
- package/types/utils/src/withinBounds.d.ts +1 -1
- package/types/element/src/Shape.d.ts +0 -17
- package/types/element/src/ShapeCache.d.ts +0 -25
- package/types/element/src/shapes.d.ts +0 -23
- package/types/excalidraw/components/ButtonSelect.d.ts +0 -9
- package/types/excalidraw/store.d.ts +0 -129
- package/types/excalidraw/visualdebug.d.ts +0 -41
- package/types/utils/src/collision.d.ts +0 -8
|
@@ -28,23 +28,28 @@ export declare const actionToggleZenMode: {
|
|
|
28
28
|
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
29
29
|
isBindingEnabled: boolean;
|
|
30
30
|
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
31
|
-
suggestedBindings: import("@excalidraw/element
|
|
31
|
+
suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
|
|
32
32
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
33
33
|
frameRendering: {
|
|
34
34
|
enabled: boolean;
|
|
35
35
|
name: boolean;
|
|
36
36
|
outline: boolean;
|
|
37
37
|
clip: boolean;
|
|
38
|
+
markerName: boolean;
|
|
39
|
+
markerEnabled: boolean;
|
|
38
40
|
};
|
|
39
41
|
editingFrame: string | null;
|
|
40
42
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
41
43
|
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
42
|
-
editingLinearElement: import("@excalidraw/element/linearElementEditor").LinearElementEditor | null;
|
|
43
44
|
activeTool: {
|
|
44
45
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
45
46
|
locked: boolean;
|
|
46
47
|
fromSelection: boolean;
|
|
47
48
|
} & import("../types").ActiveTool;
|
|
49
|
+
preferredSelectionTool: {
|
|
50
|
+
type: "selection" | "lasso";
|
|
51
|
+
initialized: boolean;
|
|
52
|
+
};
|
|
48
53
|
penMode: boolean;
|
|
49
54
|
penDetected: boolean;
|
|
50
55
|
exportBackground: boolean;
|
|
@@ -66,6 +71,7 @@ export declare const actionToggleZenMode: {
|
|
|
66
71
|
currentHoveredFontFamily: number | null;
|
|
67
72
|
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
68
73
|
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
74
|
+
currentItemFrameRole: ("marker" | null) | undefined;
|
|
69
75
|
viewBackgroundColor: string;
|
|
70
76
|
scrollX: number;
|
|
71
77
|
scrollY: number;
|
|
@@ -77,8 +83,8 @@ export declare const actionToggleZenMode: {
|
|
|
77
83
|
zoom: Readonly<{
|
|
78
84
|
value: import("../types").NormalizedZoomValue;
|
|
79
85
|
}>;
|
|
80
|
-
openMenu: "
|
|
81
|
-
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
86
|
+
openMenu: "canvas" | "shape" | null;
|
|
87
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
82
88
|
openSidebar: {
|
|
83
89
|
name: string;
|
|
84
90
|
tab?: string | undefined;
|
|
@@ -158,10 +164,8 @@ export declare const actionToggleZenMode: {
|
|
|
158
164
|
shown: true;
|
|
159
165
|
data: import("../charts").Spreadsheet;
|
|
160
166
|
};
|
|
161
|
-
|
|
162
|
-
showHyperlinkPopup: false | "editor" | "info";
|
|
167
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
163
168
|
linkOpacity: number;
|
|
164
|
-
trayModeEnabled: boolean;
|
|
165
169
|
colorPalette?: {
|
|
166
170
|
canvasBackground: import("@excalidraw/common").ColorPaletteCustom;
|
|
167
171
|
elementBackground: import("@excalidraw/common").ColorPaletteCustom;
|
|
@@ -174,6 +178,7 @@ export declare const actionToggleZenMode: {
|
|
|
174
178
|
} | undefined;
|
|
175
179
|
allowWheelZoom?: boolean | undefined;
|
|
176
180
|
allowPinchZoom?: boolean | undefined;
|
|
181
|
+
disableContextMenu: boolean;
|
|
177
182
|
pinnedScripts?: string[] | undefined;
|
|
178
183
|
customPens?: any[] | undefined;
|
|
179
184
|
currentStrokeOptions?: any;
|
|
@@ -182,6 +187,10 @@ export declare const actionToggleZenMode: {
|
|
|
182
187
|
Bold: string;
|
|
183
188
|
Regular: string;
|
|
184
189
|
};
|
|
190
|
+
gridDirection: {
|
|
191
|
+
horizontal: boolean;
|
|
192
|
+
vertical: boolean;
|
|
193
|
+
};
|
|
185
194
|
highlightSearchResult: boolean;
|
|
186
195
|
dynamicStyle: {
|
|
187
196
|
[x: string]: string;
|
|
@@ -192,7 +201,7 @@ export declare const actionToggleZenMode: {
|
|
|
192
201
|
nameColor: string;
|
|
193
202
|
};
|
|
194
203
|
invertBindingBehaviour: boolean;
|
|
195
|
-
selectedLinearElement: import("@excalidraw/element
|
|
204
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
196
205
|
snapLines: readonly import("../snapping").SnapLine[];
|
|
197
206
|
originSnapOffset: {
|
|
198
207
|
x: number;
|
|
@@ -203,21 +212,19 @@ export declare const actionToggleZenMode: {
|
|
|
203
212
|
followedBy: Set<import("../types").SocketId>;
|
|
204
213
|
isCropping: boolean;
|
|
205
214
|
croppingElementId: string | null;
|
|
206
|
-
searchMatches:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}[];
|
|
215
|
-
}[];
|
|
215
|
+
searchMatches: Readonly<{
|
|
216
|
+
focusedId: string | null;
|
|
217
|
+
matches: readonly import("../types").SearchMatch[];
|
|
218
|
+
}> | null;
|
|
219
|
+
activeLockedId: string | null;
|
|
220
|
+
lockedMultiSelections: {
|
|
221
|
+
[groupId: string]: true;
|
|
222
|
+
};
|
|
216
223
|
};
|
|
217
224
|
captureUpdate: "EVENTUALLY";
|
|
218
225
|
};
|
|
219
226
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
220
|
-
predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
227
|
+
predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
|
|
221
228
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
222
229
|
} & {
|
|
223
230
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
export declare const actionToggleTrayEditMenu: {
|
|
2
|
+
name: "toggleTrayEditMenu";
|
|
3
|
+
label: string;
|
|
4
|
+
trackEvent: {
|
|
5
|
+
category: "menu";
|
|
6
|
+
};
|
|
7
|
+
perform: (_elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
8
|
+
appState: {
|
|
9
|
+
openMenu: "shape" | null;
|
|
10
|
+
contextMenu: {
|
|
11
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
12
|
+
top: number;
|
|
13
|
+
left: number;
|
|
14
|
+
} | null;
|
|
15
|
+
showWelcomeScreen: boolean;
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
errorMessage: import("react").ReactNode;
|
|
18
|
+
activeEmbeddable: {
|
|
19
|
+
element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
|
|
20
|
+
state: "active" | "hover";
|
|
21
|
+
} | null;
|
|
22
|
+
newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
|
|
23
|
+
resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
24
|
+
multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
|
|
25
|
+
selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
26
|
+
isBindingEnabled: boolean;
|
|
27
|
+
startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
|
|
28
|
+
suggestedBindings: import("@excalidraw/element").SuggestedBinding[];
|
|
29
|
+
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
30
|
+
frameRendering: {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
name: boolean;
|
|
33
|
+
outline: boolean;
|
|
34
|
+
clip: boolean;
|
|
35
|
+
markerName: boolean;
|
|
36
|
+
markerEnabled: boolean;
|
|
37
|
+
};
|
|
38
|
+
editingFrame: string | null;
|
|
39
|
+
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
40
|
+
editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
|
|
41
|
+
activeTool: {
|
|
42
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
43
|
+
locked: boolean;
|
|
44
|
+
fromSelection: boolean;
|
|
45
|
+
} & import("../types").ActiveTool;
|
|
46
|
+
preferredSelectionTool: {
|
|
47
|
+
type: "selection" | "lasso";
|
|
48
|
+
initialized: boolean;
|
|
49
|
+
};
|
|
50
|
+
penMode: boolean;
|
|
51
|
+
penDetected: boolean;
|
|
52
|
+
exportBackground: boolean;
|
|
53
|
+
exportEmbedScene: boolean;
|
|
54
|
+
exportWithDarkMode: boolean;
|
|
55
|
+
exportScale: number;
|
|
56
|
+
currentItemStrokeColor: string;
|
|
57
|
+
currentItemBackgroundColor: string;
|
|
58
|
+
currentItemFillStyle: import("@excalidraw/element/types").FillStyle;
|
|
59
|
+
currentItemStrokeWidth: number;
|
|
60
|
+
currentItemStrokeStyle: import("@excalidraw/element/types").StrokeStyle;
|
|
61
|
+
currentItemRoughness: number;
|
|
62
|
+
currentItemOpacity: number;
|
|
63
|
+
currentItemFontFamily: number;
|
|
64
|
+
currentItemFontSize: number;
|
|
65
|
+
currentItemTextAlign: string;
|
|
66
|
+
currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
67
|
+
currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
68
|
+
currentHoveredFontFamily: number | null;
|
|
69
|
+
currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
|
|
70
|
+
currentItemArrowType: "round" | "sharp" | "elbow";
|
|
71
|
+
currentItemFrameRole: ("marker" | null) | undefined;
|
|
72
|
+
viewBackgroundColor: string;
|
|
73
|
+
scrollX: number;
|
|
74
|
+
scrollY: number;
|
|
75
|
+
cursorButton: "up" | "down";
|
|
76
|
+
scrolledOutside: boolean;
|
|
77
|
+
name: string | null;
|
|
78
|
+
isResizing: boolean;
|
|
79
|
+
isRotating: boolean;
|
|
80
|
+
zoom: Readonly<{
|
|
81
|
+
value: import("../types").NormalizedZoomValue;
|
|
82
|
+
}>;
|
|
83
|
+
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
84
|
+
openSidebar: {
|
|
85
|
+
name: string;
|
|
86
|
+
tab?: string | undefined;
|
|
87
|
+
} | null;
|
|
88
|
+
openDialog: {
|
|
89
|
+
name: "help" | "imageExport" | "jsonExport";
|
|
90
|
+
} | {
|
|
91
|
+
name: "ttd";
|
|
92
|
+
tab: "mermaid" | "text-to-diagram";
|
|
93
|
+
} | {
|
|
94
|
+
name: "commandPalette";
|
|
95
|
+
} | {
|
|
96
|
+
name: "elementLinkSelector";
|
|
97
|
+
sourceElementId: string;
|
|
98
|
+
} | null;
|
|
99
|
+
defaultSidebarDockedPreference: boolean;
|
|
100
|
+
lastPointerDownWith: import("@excalidraw/element/types").PointerType;
|
|
101
|
+
selectedElementIds: Readonly<{
|
|
102
|
+
[id: string]: true;
|
|
103
|
+
}>;
|
|
104
|
+
hoveredElementIds: Readonly<{
|
|
105
|
+
[id: string]: true;
|
|
106
|
+
}>;
|
|
107
|
+
previousSelectedElementIds: {
|
|
108
|
+
[id: string]: true;
|
|
109
|
+
};
|
|
110
|
+
selectedElementsAreBeingDragged: boolean;
|
|
111
|
+
shouldCacheIgnoreZoom: boolean;
|
|
112
|
+
toast: {
|
|
113
|
+
message: string;
|
|
114
|
+
closable?: boolean | undefined;
|
|
115
|
+
duration?: number | undefined;
|
|
116
|
+
} | null;
|
|
117
|
+
zenModeEnabled: boolean;
|
|
118
|
+
theme: import("@excalidraw/element/types").Theme;
|
|
119
|
+
gridSize: number;
|
|
120
|
+
gridStep: number;
|
|
121
|
+
gridModeEnabled: boolean;
|
|
122
|
+
viewModeEnabled: boolean;
|
|
123
|
+
selectedGroupIds: {
|
|
124
|
+
[groupId: string]: boolean;
|
|
125
|
+
};
|
|
126
|
+
editingGroupId: string | null;
|
|
127
|
+
width: number;
|
|
128
|
+
height: number;
|
|
129
|
+
offsetTop: number;
|
|
130
|
+
offsetLeft: number;
|
|
131
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
132
|
+
collaborators: Map<import("../types").SocketId, Readonly<{
|
|
133
|
+
pointer?: import("../types").CollaboratorPointer | undefined;
|
|
134
|
+
button?: "up" | "down" | undefined;
|
|
135
|
+
selectedElementIds?: Readonly<{
|
|
136
|
+
[id: string]: true;
|
|
137
|
+
}> | undefined;
|
|
138
|
+
username?: string | null | undefined;
|
|
139
|
+
userState?: import("@excalidraw/common").UserIdleState | undefined;
|
|
140
|
+
color?: {
|
|
141
|
+
background: string;
|
|
142
|
+
stroke: string;
|
|
143
|
+
} | undefined;
|
|
144
|
+
avatarUrl?: string | undefined;
|
|
145
|
+
id?: string | undefined;
|
|
146
|
+
socketId?: import("../types").SocketId | undefined;
|
|
147
|
+
isCurrentUser?: boolean | undefined;
|
|
148
|
+
isInCall?: boolean | undefined;
|
|
149
|
+
isSpeaking?: boolean | undefined;
|
|
150
|
+
isMuted?: boolean | undefined;
|
|
151
|
+
}>>;
|
|
152
|
+
stats: {
|
|
153
|
+
open: boolean;
|
|
154
|
+
panels: number;
|
|
155
|
+
};
|
|
156
|
+
currentChartType: import("@excalidraw/element/types").ChartType;
|
|
157
|
+
pasteDialog: {
|
|
158
|
+
shown: false;
|
|
159
|
+
data: null;
|
|
160
|
+
} | {
|
|
161
|
+
shown: true;
|
|
162
|
+
data: import("../charts").Spreadsheet;
|
|
163
|
+
};
|
|
164
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
165
|
+
linkOpacity: number;
|
|
166
|
+
colorPalette?: {
|
|
167
|
+
canvasBackground: import("@excalidraw/common").ColorPaletteCustom;
|
|
168
|
+
elementBackground: import("@excalidraw/common").ColorPaletteCustom;
|
|
169
|
+
elementStroke: import("@excalidraw/common").ColorPaletteCustom;
|
|
170
|
+
topPicks: {
|
|
171
|
+
canvasBackground: [string, string, string, string, string];
|
|
172
|
+
elementStroke: [string, string, string, string, string];
|
|
173
|
+
elementBackground: [string, string, string, string, string];
|
|
174
|
+
};
|
|
175
|
+
} | undefined;
|
|
176
|
+
allowWheelZoom?: boolean | undefined;
|
|
177
|
+
allowPinchZoom?: boolean | undefined;
|
|
178
|
+
disableContextMenu: boolean;
|
|
179
|
+
pinnedScripts?: string[] | undefined;
|
|
180
|
+
customPens?: any[] | undefined;
|
|
181
|
+
currentStrokeOptions?: any;
|
|
182
|
+
resetCustomPen?: any;
|
|
183
|
+
gridColor: {
|
|
184
|
+
Bold: string;
|
|
185
|
+
Regular: string;
|
|
186
|
+
};
|
|
187
|
+
gridDirection: {
|
|
188
|
+
horizontal: boolean;
|
|
189
|
+
vertical: boolean;
|
|
190
|
+
};
|
|
191
|
+
highlightSearchResult: boolean;
|
|
192
|
+
dynamicStyle: {
|
|
193
|
+
[x: string]: string;
|
|
194
|
+
};
|
|
195
|
+
frameColor: {
|
|
196
|
+
stroke: string;
|
|
197
|
+
fill: string;
|
|
198
|
+
nameColor: string;
|
|
199
|
+
};
|
|
200
|
+
invertBindingBehaviour: boolean;
|
|
201
|
+
selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
|
|
202
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
203
|
+
originSnapOffset: {
|
|
204
|
+
x: number;
|
|
205
|
+
y: number;
|
|
206
|
+
} | null;
|
|
207
|
+
objectsSnapModeEnabled: boolean;
|
|
208
|
+
userToFollow: import("../types").UserToFollow | null;
|
|
209
|
+
followedBy: Set<import("../types").SocketId>;
|
|
210
|
+
isCropping: boolean;
|
|
211
|
+
croppingElementId: string | null;
|
|
212
|
+
searchMatches: Readonly<{
|
|
213
|
+
focusedId: string | null;
|
|
214
|
+
matches: readonly import("../types").SearchMatch[];
|
|
215
|
+
}> | null;
|
|
216
|
+
activeLockedId: string | null;
|
|
217
|
+
lockedMultiSelections: {
|
|
218
|
+
[groupId: string]: true;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
captureUpdate: "EVENTUALLY";
|
|
222
|
+
};
|
|
223
|
+
PanelComponent: ({ elements, appState, updateData }: import("./types").PanelComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
224
|
+
} & {
|
|
225
|
+
keyTest?: undefined;
|
|
226
|
+
};
|
|
@@ -2,13 +2,15 @@ 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, } from "./actionProperties";
|
|
5
|
+
export { actionChangeStrokeColor, actionChangeBackgroundColor, actionChangeStrokeWidth, actionChangeFillStyle, actionChangeSloppiness, actionChangeOpacity, actionChangeFontSize, actionChangeFontFamily, actionChangeTextAlign, actionChangeVerticalAlign, actionChangeArrowProperties, } from "./actionProperties";
|
|
6
6
|
export { actionChangeViewBackgroundColor, actionClearCanvas, actionZoomIn, actionZoomOut, actionResetZoom, actionZoomToFit, actionToggleTheme, zoomToFitElements, } from "./actionCanvas";
|
|
7
7
|
export { actionSetEmbeddableAsActiveTool } from "./actionEmbeddable";
|
|
8
8
|
export { actionFinalize } from "./actionFinalize";
|
|
9
9
|
export { actionChangeProjectName, actionChangeExportBackground, actionSaveToActiveFile, actionSaveFileToDisk, actionLoadScene, } from "./actionExport";
|
|
10
|
+
export { actionToggleFrameRole } from "./actionProperties";
|
|
10
11
|
export { actionCopyStyles, actionPasteStyles } from "./actionStyles";
|
|
11
|
-
export {
|
|
12
|
+
export { actionToggleTrayEditMenu } from "./actionTrayMenu";
|
|
13
|
+
export { actionShortcuts } from "./actionMenu";
|
|
12
14
|
export { actionGroup, actionUngroup } from "./actionGroup";
|
|
13
15
|
export { actionGoToCollaborator } from "./actionNavigate";
|
|
14
16
|
export { actionAddToLibrary } from "./actionAddToLibrary";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExcalidrawElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
|
-
import type { CaptureUpdateActionType } from "
|
|
2
|
+
import type { CaptureUpdateActionType } from "@excalidraw/element";
|
|
3
3
|
import type { AppClassProperties, AppState, ExcalidrawProps, BinaryFiles, UIAppState } from "../types";
|
|
4
4
|
import type React from "react";
|
|
5
5
|
export type ActionSource = "ui" | "keyboard" | "contextMenu" | "api" | "commandPalette";
|
|
@@ -14,7 +14,7 @@ export type ActionResult = {
|
|
|
14
14
|
type ActionFn = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: any, 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" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "
|
|
17
|
+
export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "toggleTrayEditMenu" | "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" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "toggleLaserPointerTool" | "toggleFrameRole" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
|
|
18
18
|
export type PanelComponentProps = {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
20
|
appState: AppState;
|
|
@@ -22,6 +22,7 @@ export type PanelComponentProps = {
|
|
|
22
22
|
appProps: ExcalidrawProps;
|
|
23
23
|
data?: Record<string, any>;
|
|
24
24
|
app: AppClassProperties;
|
|
25
|
+
renderAction: (name: ActionName, data?: PanelComponentProps["data"]) => React.JSX.Element | null;
|
|
25
26
|
};
|
|
26
27
|
export interface Action {
|
|
27
28
|
name: ActionName;
|
|
@@ -35,7 +36,7 @@ export interface Action {
|
|
|
35
36
|
predicate?: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: ExcalidrawProps, app: AppClassProperties) => boolean;
|
|
36
37
|
checked?: (appState: Readonly<AppState>) => boolean;
|
|
37
38
|
trackEvent: false | {
|
|
38
|
-
category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink" | "search_menu";
|
|
39
|
+
category: "toolbar" | "element" | "canvas" | "export" | "history" | "menu" | "collab" | "hyperlink" | "search_menu" | "shape_switch";
|
|
39
40
|
action?: string;
|
|
40
41
|
predicate?: (appState: Readonly<AppState>, elements: readonly ExcalidrawElement[], value: any) => boolean;
|
|
41
42
|
};
|
|
@@ -16,25 +16,24 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
16
16
|
selectedGroupIds?: {
|
|
17
17
|
[groupId: string]: boolean;
|
|
18
18
|
} | undefined;
|
|
19
|
-
selectedLinearElement?: import("@excalidraw/element
|
|
19
|
+
selectedLinearElement?: import("@excalidraw/element").LinearElementEditor | null | undefined;
|
|
20
20
|
zenModeEnabled?: boolean | undefined;
|
|
21
|
-
gridModeEnabled?: boolean | undefined;
|
|
22
|
-
objectsSnapModeEnabled?: boolean | undefined;
|
|
23
|
-
shouldCacheIgnoreZoom?: boolean | undefined;
|
|
24
|
-
exportScale?: number | undefined;
|
|
25
|
-
gridSize?: number | undefined;
|
|
26
|
-
gridStep?: number | undefined;
|
|
27
21
|
showWelcomeScreen?: boolean | undefined;
|
|
28
22
|
activeTool?: ({
|
|
29
23
|
lastActiveTool: import("./types").ActiveTool | null;
|
|
30
24
|
locked: boolean;
|
|
31
25
|
fromSelection: boolean;
|
|
32
26
|
} & import("./types").ActiveTool) | undefined;
|
|
27
|
+
preferredSelectionTool?: {
|
|
28
|
+
type: "selection" | "lasso";
|
|
29
|
+
initialized: boolean;
|
|
30
|
+
} | undefined;
|
|
33
31
|
penMode?: boolean | undefined;
|
|
34
32
|
penDetected?: boolean | undefined;
|
|
35
33
|
exportBackground?: boolean | undefined;
|
|
36
34
|
exportEmbedScene?: boolean | undefined;
|
|
37
35
|
exportWithDarkMode?: boolean | undefined;
|
|
36
|
+
exportScale?: number | undefined;
|
|
38
37
|
currentItemStrokeColor?: string | undefined;
|
|
39
38
|
currentItemBackgroundColor?: string | undefined;
|
|
40
39
|
currentItemFillStyle?: import("@excalidraw/element/types").FillStyle | undefined;
|
|
@@ -49,9 +48,10 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
49
48
|
currentItemEndArrowhead?: import("@excalidraw/element/types").Arrowhead | null | undefined;
|
|
50
49
|
currentItemRoundness?: import("@excalidraw/element/types").StrokeRoundness | undefined;
|
|
51
50
|
currentItemArrowType?: "round" | "sharp" | "elbow" | undefined;
|
|
51
|
+
currentItemFrameRole?: ("marker" | null) | undefined;
|
|
52
52
|
cursorButton?: "up" | "down" | undefined;
|
|
53
53
|
scrolledOutside?: boolean | undefined;
|
|
54
|
-
openMenu?: "
|
|
54
|
+
openMenu?: "canvas" | "shape" | null | undefined;
|
|
55
55
|
openSidebar?: {
|
|
56
56
|
name: string;
|
|
57
57
|
tab?: string | undefined;
|
|
@@ -61,23 +61,37 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
61
61
|
previousSelectedElementIds?: {
|
|
62
62
|
[id: string]: true;
|
|
63
63
|
} | undefined;
|
|
64
|
+
shouldCacheIgnoreZoom?: boolean | undefined;
|
|
65
|
+
gridSize?: number | undefined;
|
|
66
|
+
gridStep?: number | undefined;
|
|
67
|
+
gridModeEnabled?: boolean | undefined;
|
|
64
68
|
stats?: {
|
|
65
69
|
open: boolean;
|
|
66
70
|
panels: number;
|
|
67
71
|
} | undefined;
|
|
68
72
|
currentChartType?: import("@excalidraw/element/types").ChartType | undefined;
|
|
73
|
+
objectsSnapModeEnabled?: boolean | undefined;
|
|
74
|
+
lockedMultiSelections?: {
|
|
75
|
+
[groupId: string]: true;
|
|
76
|
+
} | undefined;
|
|
69
77
|
};
|
|
70
78
|
export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
|
|
71
79
|
viewBackgroundColor?: string | undefined;
|
|
72
|
-
gridModeEnabled?: boolean | undefined;
|
|
73
80
|
gridSize?: number | undefined;
|
|
74
81
|
gridStep?: number | undefined;
|
|
82
|
+
gridModeEnabled?: boolean | undefined;
|
|
83
|
+
lockedMultiSelections?: {
|
|
84
|
+
[groupId: string]: true;
|
|
85
|
+
} | undefined;
|
|
75
86
|
};
|
|
76
87
|
export declare const clearAppStateForDatabase: (appState: Partial<AppState>) => {
|
|
77
88
|
viewBackgroundColor?: string | undefined;
|
|
78
|
-
gridModeEnabled?: boolean | undefined;
|
|
79
89
|
gridSize?: number | undefined;
|
|
80
90
|
gridStep?: number | undefined;
|
|
91
|
+
gridModeEnabled?: boolean | undefined;
|
|
92
|
+
lockedMultiSelections?: {
|
|
93
|
+
[groupId: string]: true;
|
|
94
|
+
} | undefined;
|
|
81
95
|
};
|
|
82
96
|
export declare const isEraserActive: ({ activeTool, }: {
|
|
83
97
|
activeTool: AppState["activeTool"];
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ALLOWED_PASTE_MIME_TYPES } from "@excalidraw/common";
|
|
2
|
+
import type { ValueOf } from "@excalidraw/common/utility-types";
|
|
3
|
+
import type { IMAGE_MIME_TYPES, STRING_MIME_TYPES } from "@excalidraw/common";
|
|
2
4
|
import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
5
|
+
import type { FileSystemHandle } from "./data/filesystem";
|
|
3
6
|
import type { Spreadsheet } from "./charts";
|
|
4
7
|
import type { BinaryFiles } from "./types";
|
|
5
8
|
export type PastedMixedContent = {
|
|
@@ -21,9 +24,9 @@ export declare const probablySupportsClipboardWriteText: boolean;
|
|
|
21
24
|
export declare const probablySupportsClipboardBlob: boolean;
|
|
22
25
|
export declare const createPasteEvent: ({ types, files, }: {
|
|
23
26
|
types?: {
|
|
24
|
-
"image/svg+xml"?: string | File | undefined;
|
|
25
|
-
"text/html"?: string | File | undefined;
|
|
26
27
|
"text/plain"?: string | File | undefined;
|
|
28
|
+
"text/html"?: string | File | undefined;
|
|
29
|
+
"image/svg+xml"?: string | File | undefined;
|
|
27
30
|
"image/png"?: string | File | undefined;
|
|
28
31
|
"image/jpeg"?: string | File | undefined;
|
|
29
32
|
"image/gif"?: string | File | undefined;
|
|
@@ -45,9 +48,9 @@ export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawEl
|
|
|
45
48
|
* Will prompt user for permission if not granted.
|
|
46
49
|
*/
|
|
47
50
|
export declare const readSystemClipboard: () => Promise<{
|
|
48
|
-
"image/svg+xml"?: string | File | undefined;
|
|
49
|
-
"text/html"?: string | File | undefined;
|
|
50
51
|
"text/plain"?: string | File | undefined;
|
|
52
|
+
"text/html"?: string | File | undefined;
|
|
53
|
+
"image/svg+xml"?: string | File | undefined;
|
|
51
54
|
"image/png"?: string | File | undefined;
|
|
52
55
|
"image/jpeg"?: string | File | undefined;
|
|
53
56
|
"image/gif"?: string | File | undefined;
|
|
@@ -57,10 +60,70 @@ export declare const readSystemClipboard: () => Promise<{
|
|
|
57
60
|
"image/avif"?: string | File | undefined;
|
|
58
61
|
"image/jfif"?: string | File | undefined;
|
|
59
62
|
}>;
|
|
63
|
+
type AllowedParsedDataTransferItem = {
|
|
64
|
+
type: ValueOf<typeof IMAGE_MIME_TYPES>;
|
|
65
|
+
kind: "file";
|
|
66
|
+
file: File;
|
|
67
|
+
fileHandle: FileSystemHandle | null;
|
|
68
|
+
} | {
|
|
69
|
+
type: ValueOf<typeof STRING_MIME_TYPES>;
|
|
70
|
+
kind: "string";
|
|
71
|
+
value: string;
|
|
72
|
+
};
|
|
73
|
+
type ParsedDataTransferItem = {
|
|
74
|
+
type: string;
|
|
75
|
+
kind: "file";
|
|
76
|
+
file: File;
|
|
77
|
+
fileHandle: FileSystemHandle | null;
|
|
78
|
+
} | {
|
|
79
|
+
type: string;
|
|
80
|
+
kind: "string";
|
|
81
|
+
value: string;
|
|
82
|
+
};
|
|
83
|
+
type ParsedDataTransferItemType<T extends AllowedParsedDataTransferItem["type"]> = AllowedParsedDataTransferItem & {
|
|
84
|
+
type: T;
|
|
85
|
+
};
|
|
86
|
+
export type ParsedDataTransferFile = Extract<AllowedParsedDataTransferItem, {
|
|
87
|
+
kind: "file";
|
|
88
|
+
}>;
|
|
89
|
+
type ParsedDataTranferList = ParsedDataTransferItem[] & {
|
|
90
|
+
/**
|
|
91
|
+
* Only allows filtering by known `string` data types, since `file`
|
|
92
|
+
* types can have multiple items of the same type (e.g. multiple image files)
|
|
93
|
+
* unlike `string` data transfer items.
|
|
94
|
+
*/
|
|
95
|
+
findByType: typeof findDataTransferItemType;
|
|
96
|
+
/**
|
|
97
|
+
* Only allows filtering by known `string` data types, since `file`
|
|
98
|
+
* types can have multiple items of the same type (e.g. multiple image files)
|
|
99
|
+
* unlike `string` data transfer items.
|
|
100
|
+
*/
|
|
101
|
+
getData: typeof getDataTransferItemData;
|
|
102
|
+
getFiles: typeof getDataTransferFiles;
|
|
103
|
+
};
|
|
104
|
+
declare const findDataTransferItemType: <T extends ValueOf<{
|
|
105
|
+
readonly text: "text/plain";
|
|
106
|
+
readonly html: "text/html";
|
|
107
|
+
readonly json: "application/json";
|
|
108
|
+
readonly excalidraw: "application/vnd.excalidraw+json";
|
|
109
|
+
readonly excalidrawlib: "application/vnd.excalidrawlib+json";
|
|
110
|
+
readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
|
|
111
|
+
}>>(this: ParsedDataTranferList, type: T) => ParsedDataTransferItemType<T> | null;
|
|
112
|
+
declare const getDataTransferItemData: <T extends ValueOf<{
|
|
113
|
+
readonly text: "text/plain";
|
|
114
|
+
readonly html: "text/html";
|
|
115
|
+
readonly json: "application/json";
|
|
116
|
+
readonly excalidraw: "application/vnd.excalidraw+json";
|
|
117
|
+
readonly excalidrawlib: "application/vnd.excalidrawlib+json";
|
|
118
|
+
readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
|
|
119
|
+
}>>(this: ParsedDataTranferList, type: T) => ParsedDataTransferItemType<ValueOf<typeof STRING_MIME_TYPES>>["value"] | null;
|
|
120
|
+
declare const getDataTransferFiles: (this: ParsedDataTranferList) => ParsedDataTransferFile[];
|
|
121
|
+
export declare const parseDataTransferEvent: (event: ClipboardEvent | DragEvent | React.DragEvent<HTMLDivElement>) => Promise<ParsedDataTranferList>;
|
|
60
122
|
/**
|
|
61
123
|
* Attempts to parse clipboard event.
|
|
62
124
|
*/
|
|
63
|
-
export declare const parseClipboard: (
|
|
125
|
+
export declare const parseClipboard: (dataList: ParsedDataTranferList, isPlainPaste?: boolean) => Promise<ClipboardData>;
|
|
64
126
|
export declare const copyBlobToClipboardAsPng: (blob: Blob | Promise<Blob>) => Promise<void>;
|
|
65
127
|
export declare const copyTextToSystemClipboard: (text: string | null, clipboardEvent?: ClipboardEvent | null) => Promise<void>;
|
|
128
|
+
export declare const isClipboardEvent: (event: React.SyntheticEvent | Event) => event is ClipboardEvent;
|
|
66
129
|
export {};
|
|
@@ -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, Zoom } from "../types";
|
|
3
|
+
import type { AppClassProperties, AppProps, UIAppState, Zoom, 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;
|
|
@@ -10,9 +10,23 @@ export declare const SelectedShapeActions: ({ appState, elementsMap, renderActio
|
|
|
10
10
|
renderAction: ActionManager["renderAction"];
|
|
11
11
|
app: AppClassProperties;
|
|
12
12
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare const
|
|
14
|
-
activeTool: UIAppState["activeTool"];
|
|
13
|
+
export declare const CompactShapeActions: ({ appState, elementsMap, renderAction, app, setAppState, }: {
|
|
15
14
|
appState: UIAppState;
|
|
15
|
+
elementsMap: NonDeletedElementsMap | NonDeletedSceneElementsMap;
|
|
16
|
+
renderAction: ActionManager["renderAction"];
|
|
17
|
+
app: AppClassProperties;
|
|
18
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
19
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const MobileShapeActions: ({ appState, elementsMap, renderAction, app, setAppState, }: {
|
|
21
|
+
appState: UIAppState;
|
|
22
|
+
elementsMap: NonDeletedElementsMap | NonDeletedSceneElementsMap;
|
|
23
|
+
renderAction: ActionManager["renderAction"];
|
|
24
|
+
app: AppClassProperties;
|
|
25
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
26
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const ShapesSwitcher: ({ activeTool, setAppState, app, UIOptions, }: {
|
|
28
|
+
activeTool: UIAppState["activeTool"];
|
|
29
|
+
setAppState: React.Component<any, AppState>["setState"];
|
|
16
30
|
app: AppClassProperties;
|
|
17
31
|
UIOptions: AppProps["UIOptions"];
|
|
18
32
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -25,11 +39,10 @@ export declare const UndoRedoActions: ({ renderAction, className, }: {
|
|
|
25
39
|
renderAction: ActionManager["renderAction"];
|
|
26
40
|
className?: string | undefined;
|
|
27
41
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export declare const
|
|
42
|
+
export declare const ExitZenModeButton: ({ actionManager, showExitZenModeBtn, }: {
|
|
29
43
|
actionManager: ActionManager;
|
|
30
44
|
showExitZenModeBtn: boolean;
|
|
31
45
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
export declare const
|
|
33
|
-
|
|
34
|
-
className?: string | undefined;
|
|
46
|
+
export declare const ExitViewModeButton: ({ actionManager, }: {
|
|
47
|
+
actionManager: ActionManager;
|
|
35
48
|
}) => import("react/jsx-runtime").JSX.Element;
|