@dwelle/excalidraw 0.4.0-e3bee83 → 0.4.0-e587816
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/CHANGELOG.md +525 -0
- package/README.md +18 -1820
- package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js → vendor-d415b28e9024dee4bb1b.js} +2 -2
- package/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.js → vendor-a14cd58fa2db417e42b2.js} +6 -6
- package/dist/excalidraw.development.js +3071 -1566
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +20 -0
- package/main.js +1 -8
- package/package.json +9 -4
- package/types/actions/actionAddToLibrary.d.ts +103 -55
- package/types/actions/actionAlign.d.ts +33 -28
- package/types/actions/actionBoundText.d.ts +175 -22
- package/types/actions/actionCanvas.d.ts +680 -170
- package/types/actions/actionClipboard.d.ts +174 -100
- package/types/actions/actionDeleteSelected.d.ts +102 -60
- package/types/actions/actionDistribute.d.ts +11 -12
- package/types/actions/actionDuplicateSelection.d.ts +3 -4
- package/types/actions/actionElementLock.d.ts +271 -0
- package/types/actions/actionExport.d.ts +363 -221
- package/types/actions/actionFinalize.d.ts +70 -42
- package/types/actions/actionFlip.d.ts +8 -11
- package/types/actions/actionFrame.d.ts +423 -0
- package/types/actions/actionGroup.d.ts +250 -13
- package/types/actions/actionHistory.d.ts +1 -1
- package/types/actions/actionLinearEditor.d.ts +37 -21
- package/types/actions/actionMenu.d.ts +108 -62
- package/types/actions/actionNavigate.d.ts +1 -1
- package/types/actions/actionProperties.d.ts +465 -256
- package/types/actions/actionSelectAll.d.ts +123 -4
- package/types/actions/actionStyles.d.ts +39 -24
- package/types/actions/actionToggleGridMode.d.ts +37 -22
- package/types/actions/{actionToggleLock.d.ts → actionToggleObjectsSnapMode.d.ts} +49 -32
- package/types/actions/actionToggleStats.d.ts +37 -22
- package/types/actions/actionToggleViewMode.d.ts +37 -22
- package/types/actions/actionToggleZenMode.d.ts +37 -22
- package/types/actions/actionZindex.d.ts +12 -12
- package/types/actions/index.d.ts +2 -1
- package/types/actions/manager.d.ts +1 -1
- package/types/actions/shortcuts.d.ts +2 -1
- package/types/actions/types.d.ts +11 -9
- package/types/appState.d.ts +18 -18
- package/types/charts.d.ts +2 -2
- package/types/clients.d.ts +5 -6
- package/types/clipboard.d.ts +8 -7
- package/types/colors.d.ts +60 -5
- package/types/components/Actions.d.ts +7 -12
- package/types/components/ActiveConfirmDialog.d.ts +4 -0
- package/types/components/App.d.ts +93 -35
- package/types/components/Avatar.d.ts +1 -2
- package/types/components/BraveMeasureTextError.d.ts +2 -0
- package/types/components/Button.d.ts +3 -2
- package/types/components/ButtonIconSelect.d.ts +11 -3
- package/types/components/Card.d.ts +0 -1
- package/types/components/ColorPicker/ColorInput.d.ts +9 -0
- package/types/components/ColorPicker/ColorPicker.d.ts +19 -0
- package/types/components/ColorPicker/CustomColorList.d.ts +8 -0
- package/types/components/ColorPicker/HotkeyLabel.d.ts +8 -0
- package/types/components/ColorPicker/Picker.d.ts +18 -0
- package/types/components/ColorPicker/PickerColorList.d.ts +10 -0
- package/types/components/ColorPicker/PickerHeading.d.ts +5 -0
- package/types/components/ColorPicker/ShadeList.d.ts +8 -0
- package/types/components/ColorPicker/TopPicks.d.ts +9 -0
- package/types/components/ColorPicker/colorPickerUtils.d.ts +21 -0
- package/types/components/ColorPicker/keyboardNavHandlers.d.ts +20 -0
- package/types/components/ContextMenu.d.ts +3 -3
- package/types/components/DefaultSidebar.d.ts +29 -0
- package/types/components/Dialog.d.ts +3 -4
- package/types/components/ErrorDialog.d.ts +3 -2
- package/types/components/ExcalidrawLogo.d.ts +15 -0
- package/types/components/EyeDropper.d.ts +28 -0
- package/types/components/FilledButton.d.ts +17 -0
- package/types/components/FixedSideContainer.d.ts +1 -1
- package/types/components/HandButton.d.ts +10 -0
- package/types/components/HelpButton.d.ts +1 -2
- package/types/components/HintViewer.d.ts +4 -5
- package/types/components/HomeButton.d.ts +1 -1
- package/types/components/ImageExportDialog.d.ts +8 -13
- package/types/components/Island.d.ts +1 -1
- package/types/components/JSONExportDialog.d.ts +5 -5
- package/types/components/LaserTool/LaserPathManager.d.ts +28 -0
- package/types/components/LaserTool/LaserPointerButton.d.ts +10 -0
- package/types/components/LaserTool/LaserTool.d.ts +7 -0
- package/types/components/LayerUI.d.ts +9 -15
- package/types/components/LibraryMenu.d.ts +13 -14
- package/types/components/LibraryMenuBrowseButton.d.ts +2 -2
- package/types/components/LibraryMenuControlButtons.d.ts +9 -0
- package/types/components/LibraryMenuHeaderContent.d.ts +10 -28
- package/types/components/LibraryMenuItems.d.ts +6 -7
- package/types/components/LibraryMenuSection.d.ts +22 -0
- package/types/components/LibraryUnit.d.ts +6 -3
- package/types/components/LoadingMessage.d.ts +0 -1
- package/types/components/LockButton.d.ts +1 -2
- package/types/components/MobileMenu.d.ts +8 -11
- package/types/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
- package/types/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
- package/types/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
- package/types/components/PasteChartDialog.d.ts +4 -5
- package/types/components/PenModeButton.d.ts +1 -1
- package/types/components/Popover.d.ts +1 -1
- package/types/components/ProjectName.d.ts +2 -1
- package/types/components/PublishLibrary.d.ts +2 -2
- package/types/components/RadioGroup.d.ts +12 -0
- package/types/components/Section.d.ts +1 -1
- package/types/components/Sidebar/Sidebar.d.ts +66 -63
- package/types/components/Sidebar/SidebarHeader.d.ts +6 -19
- package/types/components/Sidebar/SidebarTab.d.ts +8 -0
- package/types/components/Sidebar/SidebarTabTrigger.d.ts +9 -0
- package/types/components/Sidebar/SidebarTabTriggers.d.ts +6 -0
- package/types/components/Sidebar/SidebarTabs.d.ts +6 -0
- package/types/components/Sidebar/SidebarTrigger.d.ts +6 -0
- package/types/components/Sidebar/common.d.ts +24 -7
- package/types/components/Spinner.d.ts +2 -1
- package/types/components/Stack.d.ts +4 -3
- package/types/components/Stats.d.ts +3 -3
- package/types/components/Switch.d.ts +9 -0
- package/types/components/ToolButton.d.ts +6 -5
- package/types/components/Tooltip.d.ts +1 -1
- package/types/components/Trans.d.ts +9 -0
- package/types/components/canvases/InteractiveCanvas.d.ts +27 -0
- package/types/components/canvases/StaticCanvas.d.ts +18 -0
- package/types/components/canvases/index.d.ts +3 -0
- package/types/components/dropdownMenu/DropdownMenu.d.ts +15 -9
- package/types/components/dropdownMenu/DropdownMenuContent.d.ts +7 -3
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +4 -4
- package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -1
- package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +4 -2
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -2
- package/types/components/dropdownMenu/common.d.ts +6 -0
- package/types/components/footer/Footer.d.ts +4 -5
- package/types/components/hoc/withInternalFallback.d.ts +4 -0
- package/types/components/icons.d.ts +16 -1
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -1
- package/types/components/main-menu/MainMenu.d.ts +22 -13
- package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -1
- package/types/components/welcome-screen/WelcomeScreen.d.ts +2 -3
- package/types/constants.d.ts +94 -10
- package/types/context/tunnels.d.ts +19 -0
- package/types/context/ui-appState.d.ts +4 -0
- package/types/cursor.d.ts +5 -0
- package/types/data/blob.d.ts +5 -3
- package/types/data/encode.d.ts +1 -1
- package/types/data/filesystem.d.ts +2 -1
- package/types/data/library.d.ts +3 -45
- package/types/data/restore.d.ts +10 -4
- package/types/data/transform.d.ts +73 -0
- package/types/data/types.d.ts +3 -5
- package/types/data/url.d.ts +7 -0
- package/types/element/Hyperlink.d.ts +48 -29
- package/types/element/binding.d.ts +4 -3
- package/types/element/bounds.d.ts +40 -10
- package/types/element/collision.d.ts +7 -7
- package/types/element/dragElements.d.ts +12 -2
- package/types/element/embeddable.d.ts +153 -0
- package/types/element/image.d.ts +11 -1
- package/types/element/index.d.ts +3 -2
- package/types/element/linearElementEditor.d.ts +43 -27
- package/types/element/mutateElement.d.ts +3 -2
- package/types/element/newElement.d.ts +48 -15
- package/types/element/resizeElements.d.ts +3 -2
- package/types/element/resizeTest.d.ts +2 -1
- package/types/element/showSelectedShapeActions.d.ts +2 -2
- package/types/element/sizeHelpers.d.ts +8 -1
- package/types/element/sortElements.d.ts +2 -0
- package/types/element/textElement.d.ts +43 -17
- package/types/element/textWysiwyg.d.ts +1 -1
- package/types/element/transformHandles.d.ts +16 -8
- package/types/element/typeChecks.d.ts +5 -2
- package/types/element/types.d.ts +59 -35
- package/types/emitter.d.ts +1 -2
- package/types/errors.d.ts +1 -1
- package/types/frame.d.ts +46 -0
- package/types/ga.d.ts +5 -5
- package/types/groups.d.ts +15 -11
- package/types/history.d.ts +3 -3
- package/types/hooks/useCreatePortalContainer.d.ts +4 -0
- package/types/hooks/useLibraryItemSvg.d.ts +11 -0
- package/types/hooks/useOutsideClick.d.ts +19 -2
- package/types/hooks/useScrollPosition.d.ts +1 -0
- package/types/hooks/useStable.d.ts +1 -0
- package/types/hooks/useTransition.d.ts +2 -0
- package/types/i18n.d.ts +11 -2
- package/types/jotai.d.ts +20 -108
- package/types/keys.d.ts +5 -4
- package/types/math.d.ts +5 -0
- package/types/packages/bbox.d.ts +11 -0
- package/types/packages/excalidraw/example/App.d.ts +7 -1
- package/types/packages/excalidraw/example/initialData.d.ts +182 -64
- package/types/packages/excalidraw/index.d.ts +11 -4
- package/types/packages/excalidraw/main.d.ts +3 -1
- package/types/packages/excalidraw/webpack.dev.config.d.ts +5 -2
- package/types/packages/excalidraw/webpack.prod.config.d.ts +3 -0
- package/types/packages/utils.d.ts +11 -2
- package/types/packages/withinBounds.d.ts +19 -0
- package/types/renderer/renderElement.d.ts +12 -22
- package/types/renderer/renderScene.d.ts +19 -27
- package/types/renderer/renderSnaps.d.ts +2 -0
- package/types/renderer/roundRect.d.ts +1 -1
- package/types/scene/Renderer.d.ts +25 -0
- package/types/scene/Scene.d.ts +27 -5
- package/types/scene/Shape.d.ts +12 -0
- package/types/scene/ShapeCache.d.ts +20 -0
- package/types/scene/comparisons.d.ts +0 -1
- package/types/scene/export.d.ts +50 -11
- package/types/scene/index.d.ts +1 -1
- package/types/scene/scroll.d.ts +1 -1
- package/types/scene/scrollbars.d.ts +2 -6
- package/types/scene/selection.d.ts +27 -6
- package/types/scene/types.d.ts +70 -34
- package/types/snapping.d.ts +108 -0
- package/types/types.d.ts +200 -84
- package/types/utility-types.d.ts +24 -0
- package/types/utils.d.ts +73 -29
- package/types/zindex.d.ts +4 -4
- package/types/components/ColorPicker.d.ts +0 -14
- package/types/components/LibraryButton.d.ts +0 -8
- package/types/components/SingleLibraryItem.d.ts +0 -10
- package/types/components/hoc/withUpstreamOverride.d.ts +0 -10
- /package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js.LICENSE.txt → vendor-d415b28e9024dee4bb1b.js.LICENSE.txt} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.d.ts → vendor-d415b28e9024dee4bb1b.d.ts} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.d.ts → vendor-a14cd58fa2db417e42b2.d.ts} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const actionToggleViewMode: {
|
|
3
2
|
name: "viewMode";
|
|
4
3
|
viewMode: true;
|
|
@@ -16,7 +15,11 @@ export declare const actionToggleViewMode: {
|
|
|
16
15
|
} | null;
|
|
17
16
|
showWelcomeScreen: boolean;
|
|
18
17
|
isLoading: boolean;
|
|
19
|
-
errorMessage:
|
|
18
|
+
errorMessage: import("react").ReactNode;
|
|
19
|
+
activeEmbeddable: {
|
|
20
|
+
element: import("../element/types").NonDeletedExcalidrawElement;
|
|
21
|
+
state: "active" | "hover";
|
|
22
|
+
} | null;
|
|
20
23
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
21
24
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
22
25
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -24,19 +27,21 @@ export declare const actionToggleViewMode: {
|
|
|
24
27
|
isBindingEnabled: boolean;
|
|
25
28
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
26
29
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
30
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
|
|
31
|
+
frameRendering: {
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
name: boolean;
|
|
34
|
+
outline: boolean;
|
|
35
|
+
clip: boolean;
|
|
36
|
+
};
|
|
37
|
+
editingFrame: string | null;
|
|
38
|
+
elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
|
|
27
39
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
28
40
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
29
41
|
activeTool: {
|
|
30
|
-
|
|
31
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
42
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
32
43
|
locked: boolean;
|
|
33
|
-
|
|
34
|
-
} | {
|
|
35
|
-
type: "custom";
|
|
36
|
-
customType: string;
|
|
37
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
38
|
-
locked: boolean;
|
|
39
|
-
};
|
|
44
|
+
} & import("../types").ActiveTool;
|
|
40
45
|
penMode: boolean;
|
|
41
46
|
penDetected: boolean;
|
|
42
47
|
exportBackground: boolean;
|
|
@@ -68,17 +73,21 @@ export declare const actionToggleViewMode: {
|
|
|
68
73
|
value: import("../types").NormalizedZoomValue;
|
|
69
74
|
}>;
|
|
70
75
|
openMenu: "canvas" | "shape" | null;
|
|
71
|
-
openPopup: "
|
|
72
|
-
openSidebar:
|
|
76
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
77
|
+
openSidebar: {
|
|
78
|
+
name: string;
|
|
79
|
+
tab?: string | undefined;
|
|
80
|
+
} | null;
|
|
73
81
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
74
|
-
|
|
82
|
+
defaultSidebarDockedPreference: boolean;
|
|
75
83
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
76
|
-
selectedElementIds: {
|
|
77
|
-
[id: string]:
|
|
78
|
-
}
|
|
84
|
+
selectedElementIds: Readonly<{
|
|
85
|
+
[id: string]: true;
|
|
86
|
+
}>;
|
|
79
87
|
previousSelectedElementIds: {
|
|
80
|
-
[id: string]:
|
|
88
|
+
[id: string]: true;
|
|
81
89
|
};
|
|
90
|
+
selectedElementsAreBeingDragged: boolean;
|
|
82
91
|
shouldCacheIgnoreZoom: boolean;
|
|
83
92
|
toast: {
|
|
84
93
|
message: string;
|
|
@@ -86,7 +95,7 @@ export declare const actionToggleViewMode: {
|
|
|
86
95
|
duration?: number | undefined;
|
|
87
96
|
} | null;
|
|
88
97
|
zenModeEnabled: boolean;
|
|
89
|
-
theme:
|
|
98
|
+
theme: import("../element/types").Theme;
|
|
90
99
|
gridSize: number | null;
|
|
91
100
|
selectedGroupIds: {
|
|
92
101
|
[groupId: string]: boolean;
|
|
@@ -108,15 +117,21 @@ export declare const actionToggleViewMode: {
|
|
|
108
117
|
data: import("../charts").Spreadsheet;
|
|
109
118
|
};
|
|
110
119
|
pendingImageElementId: string | null;
|
|
111
|
-
showHyperlinkPopup: false | "
|
|
120
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
112
121
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
122
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
123
|
+
originSnapOffset: {
|
|
124
|
+
x: number;
|
|
125
|
+
y: number;
|
|
126
|
+
} | null;
|
|
127
|
+
objectsSnapModeEnabled: boolean;
|
|
113
128
|
};
|
|
114
129
|
commitToHistory: false;
|
|
115
130
|
};
|
|
116
131
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
117
132
|
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
118
133
|
contextItemLabel: string;
|
|
119
|
-
keyTest: (event:
|
|
134
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
120
135
|
} & {
|
|
121
|
-
keyTest?: ((event:
|
|
136
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
122
137
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export declare const actionToggleZenMode: {
|
|
3
2
|
name: "zenMode";
|
|
4
3
|
viewMode: true;
|
|
@@ -16,7 +15,11 @@ export declare const actionToggleZenMode: {
|
|
|
16
15
|
} | null;
|
|
17
16
|
showWelcomeScreen: boolean;
|
|
18
17
|
isLoading: boolean;
|
|
19
|
-
errorMessage:
|
|
18
|
+
errorMessage: import("react").ReactNode;
|
|
19
|
+
activeEmbeddable: {
|
|
20
|
+
element: import("../element/types").NonDeletedExcalidrawElement;
|
|
21
|
+
state: "active" | "hover";
|
|
22
|
+
} | null;
|
|
20
23
|
draggingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
21
24
|
resizingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
22
25
|
multiElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawLinearElement> | null;
|
|
@@ -24,19 +27,21 @@ export declare const actionToggleZenMode: {
|
|
|
24
27
|
isBindingEnabled: boolean;
|
|
25
28
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
26
29
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
30
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameElement> | null;
|
|
31
|
+
frameRendering: {
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
name: boolean;
|
|
34
|
+
outline: boolean;
|
|
35
|
+
clip: boolean;
|
|
36
|
+
};
|
|
37
|
+
editingFrame: string | null;
|
|
38
|
+
elementsToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | null;
|
|
27
39
|
editingElement: import("../element/types").NonDeletedExcalidrawElement | null;
|
|
28
40
|
editingLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
29
41
|
activeTool: {
|
|
30
|
-
|
|
31
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
42
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
32
43
|
locked: boolean;
|
|
33
|
-
|
|
34
|
-
} | {
|
|
35
|
-
type: "custom";
|
|
36
|
-
customType: string;
|
|
37
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
38
|
-
locked: boolean;
|
|
39
|
-
};
|
|
44
|
+
} & import("../types").ActiveTool;
|
|
40
45
|
penMode: boolean;
|
|
41
46
|
penDetected: boolean;
|
|
42
47
|
exportBackground: boolean;
|
|
@@ -68,24 +73,28 @@ export declare const actionToggleZenMode: {
|
|
|
68
73
|
value: import("../types").NormalizedZoomValue;
|
|
69
74
|
}>;
|
|
70
75
|
openMenu: "canvas" | "shape" | null;
|
|
71
|
-
openPopup: "
|
|
72
|
-
openSidebar:
|
|
76
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
77
|
+
openSidebar: {
|
|
78
|
+
name: string;
|
|
79
|
+
tab?: string | undefined;
|
|
80
|
+
} | null;
|
|
73
81
|
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
74
|
-
|
|
82
|
+
defaultSidebarDockedPreference: boolean;
|
|
75
83
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
76
|
-
selectedElementIds: {
|
|
77
|
-
[id: string]:
|
|
78
|
-
}
|
|
84
|
+
selectedElementIds: Readonly<{
|
|
85
|
+
[id: string]: true;
|
|
86
|
+
}>;
|
|
79
87
|
previousSelectedElementIds: {
|
|
80
|
-
[id: string]:
|
|
88
|
+
[id: string]: true;
|
|
81
89
|
};
|
|
90
|
+
selectedElementsAreBeingDragged: boolean;
|
|
82
91
|
shouldCacheIgnoreZoom: boolean;
|
|
83
92
|
toast: {
|
|
84
93
|
message: string;
|
|
85
94
|
closable?: boolean | undefined;
|
|
86
95
|
duration?: number | undefined;
|
|
87
96
|
} | null;
|
|
88
|
-
theme:
|
|
97
|
+
theme: import("../element/types").Theme;
|
|
89
98
|
gridSize: number | null;
|
|
90
99
|
viewModeEnabled: boolean;
|
|
91
100
|
selectedGroupIds: {
|
|
@@ -108,15 +117,21 @@ export declare const actionToggleZenMode: {
|
|
|
108
117
|
data: import("../charts").Spreadsheet;
|
|
109
118
|
};
|
|
110
119
|
pendingImageElementId: string | null;
|
|
111
|
-
showHyperlinkPopup: false | "
|
|
120
|
+
showHyperlinkPopup: false | "editor" | "info";
|
|
112
121
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
122
|
+
snapLines: readonly import("../snapping").SnapLine[];
|
|
123
|
+
originSnapOffset: {
|
|
124
|
+
x: number;
|
|
125
|
+
y: number;
|
|
126
|
+
} | null;
|
|
127
|
+
objectsSnapModeEnabled: boolean;
|
|
113
128
|
};
|
|
114
129
|
commitToHistory: false;
|
|
115
130
|
};
|
|
116
131
|
checked: (appState: Readonly<import("../types").AppState>) => boolean;
|
|
117
132
|
predicate: (elements: readonly import("../element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps) => boolean;
|
|
118
133
|
contextItemLabel: string;
|
|
119
|
-
keyTest: (event:
|
|
134
|
+
keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
120
135
|
} & {
|
|
121
|
-
keyTest?: ((event:
|
|
136
|
+
keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
122
137
|
};
|
|
@@ -5,16 +5,16 @@ export declare const actionSendBackward: {
|
|
|
5
5
|
category: "element";
|
|
6
6
|
};
|
|
7
7
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
8
|
-
elements:
|
|
8
|
+
elements: import("../element/types").ExcalidrawElement[];
|
|
9
9
|
appState: Readonly<import("../types").AppState>;
|
|
10
10
|
commitToHistory: true;
|
|
11
11
|
};
|
|
12
12
|
contextItemLabel: string;
|
|
13
13
|
keyPriority: number;
|
|
14
|
-
keyTest: (event:
|
|
14
|
+
keyTest: (event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
15
15
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
16
16
|
} & {
|
|
17
|
-
keyTest?: ((event:
|
|
17
|
+
keyTest?: ((event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
18
18
|
};
|
|
19
19
|
export declare const actionBringForward: {
|
|
20
20
|
name: "bringForward";
|
|
@@ -22,16 +22,16 @@ export declare const actionBringForward: {
|
|
|
22
22
|
category: "element";
|
|
23
23
|
};
|
|
24
24
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
25
|
-
elements:
|
|
25
|
+
elements: import("../element/types").ExcalidrawElement[];
|
|
26
26
|
appState: Readonly<import("../types").AppState>;
|
|
27
27
|
commitToHistory: true;
|
|
28
28
|
};
|
|
29
29
|
contextItemLabel: string;
|
|
30
30
|
keyPriority: number;
|
|
31
|
-
keyTest: (event:
|
|
31
|
+
keyTest: (event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
32
32
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
33
33
|
} & {
|
|
34
|
-
keyTest?: ((event:
|
|
34
|
+
keyTest?: ((event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
35
35
|
};
|
|
36
36
|
export declare const actionSendToBack: {
|
|
37
37
|
name: "sendToBack";
|
|
@@ -39,15 +39,15 @@ export declare const actionSendToBack: {
|
|
|
39
39
|
category: "element";
|
|
40
40
|
};
|
|
41
41
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
42
|
-
elements: readonly import("../element/types").ExcalidrawElement[];
|
|
42
|
+
elements: readonly import("../element/types").ExcalidrawElement[] | import("../element/types").ExcalidrawElement[];
|
|
43
43
|
appState: Readonly<import("../types").AppState>;
|
|
44
44
|
commitToHistory: true;
|
|
45
45
|
};
|
|
46
46
|
contextItemLabel: string;
|
|
47
|
-
keyTest: (event:
|
|
47
|
+
keyTest: (event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
48
48
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
49
49
|
} & {
|
|
50
|
-
keyTest?: ((event:
|
|
50
|
+
keyTest?: ((event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
51
51
|
};
|
|
52
52
|
export declare const actionBringToFront: {
|
|
53
53
|
name: "bringToFront";
|
|
@@ -55,13 +55,13 @@ export declare const actionBringToFront: {
|
|
|
55
55
|
category: "element";
|
|
56
56
|
};
|
|
57
57
|
perform: (elements: readonly import("../element/types").ExcalidrawElement[], appState: Readonly<import("../types").AppState>) => {
|
|
58
|
-
elements: readonly import("../element/types").ExcalidrawElement[];
|
|
58
|
+
elements: readonly import("../element/types").ExcalidrawElement[] | import("../element/types").ExcalidrawElement[];
|
|
59
59
|
appState: Readonly<import("../types").AppState>;
|
|
60
60
|
commitToHistory: true;
|
|
61
61
|
};
|
|
62
62
|
contextItemLabel: string;
|
|
63
|
-
keyTest: (event:
|
|
63
|
+
keyTest: (event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean;
|
|
64
64
|
PanelComponent: ({ updateData, appState }: import("./types").PanelComponentProps) => JSX.Element;
|
|
65
65
|
} & {
|
|
66
|
-
keyTest?: ((event:
|
|
66
|
+
keyTest?: ((event: React.KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
|
|
67
67
|
};
|
package/types/actions/index.d.ts
CHANGED
|
@@ -17,8 +17,9 @@ export { actionFlipHorizontal, actionFlipVertical } from "./actionFlip";
|
|
|
17
17
|
export { actionCopy, actionCut, actionCopyAsPng, actionCopyAsSvg, copyText, } from "./actionClipboard";
|
|
18
18
|
export { actionToggleGridMode } from "./actionToggleGridMode";
|
|
19
19
|
export { actionToggleZenMode } from "./actionToggleZenMode";
|
|
20
|
+
export { actionToggleObjectsSnapMode } from "./actionToggleObjectsSnapMode";
|
|
20
21
|
export { actionToggleStats } from "./actionToggleStats";
|
|
21
22
|
export { actionUnbindText, actionBindText } from "./actionBoundText";
|
|
22
23
|
export { actionLink } from "../element/Hyperlink";
|
|
23
|
-
export {
|
|
24
|
+
export { actionToggleElementLock } from "./actionElementLock";
|
|
24
25
|
export { actionToggleLinearEditor } from "./actionLinearEditor";
|
|
@@ -12,7 +12,7 @@ export declare class ActionManager {
|
|
|
12
12
|
registerAction(action: Action): void;
|
|
13
13
|
registerAll(actions: readonly Action[]): void;
|
|
14
14
|
handleKeyDown(event: React.KeyboardEvent | KeyboardEvent): boolean;
|
|
15
|
-
executeAction(action: Action, source?: ActionSource): void;
|
|
15
|
+
executeAction(action: Action, source?: ActionSource, value?: any): void;
|
|
16
16
|
/**
|
|
17
17
|
* @param data additional data sent to the PanelComponent
|
|
18
18
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SubtypeOf } from "../utility-types";
|
|
1
2
|
import { ActionName } from "./types";
|
|
2
|
-
export
|
|
3
|
+
export type ShortcutName = SubtypeOf<ActionName, "toggleTheme" | "loadScene" | "clearCanvas" | "cut" | "copy" | "paste" | "copyStyles" | "pasteStyles" | "selectAll" | "deleteSelectedElements" | "duplicateSelection" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyAsPng" | "copyAsSvg" | "group" | "ungroup" | "gridMode" | "zenMode" | "objectsSnapMode" | "stats" | "addToLibrary" | "viewMode" | "flipHorizontal" | "flipVertical" | "hyperlink" | "toggleElementLock"> | "saveScene" | "imageExport";
|
|
3
4
|
export declare const getShortcutFromShortcutName: (name: ShortcutName) => string;
|
package/types/actions/types.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ExcalidrawElement } from "../element/types";
|
|
3
3
|
import { AppClassProperties, AppState, ExcalidrawProps, BinaryFiles } from "../types";
|
|
4
|
-
|
|
4
|
+
import { MarkOptional } from "../utility-types";
|
|
5
|
+
export type ActionSource = "ui" | "keyboard" | "contextMenu" | "api";
|
|
5
6
|
/** if false, the action should be prevented */
|
|
6
|
-
export
|
|
7
|
+
export type ActionResult = {
|
|
7
8
|
elements?: readonly ExcalidrawElement[] | null;
|
|
8
9
|
appState?: MarkOptional<AppState, "offsetTop" | "offsetLeft" | "width" | "height"> | null;
|
|
9
10
|
files?: BinaryFiles | null;
|
|
@@ -11,24 +12,25 @@ export declare type ActionResult = {
|
|
|
11
12
|
syncHistory?: boolean;
|
|
12
13
|
replaceFiles?: boolean;
|
|
13
14
|
} | false;
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
15
|
+
type ActionFn = (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
16
|
+
export type UpdaterFn = (res: ActionResult) => void;
|
|
17
|
+
export type ActionFilterFn = (action: Action) => void;
|
|
18
|
+
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" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "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";
|
|
19
|
+
export type PanelComponentProps = {
|
|
19
20
|
elements: readonly ExcalidrawElement[];
|
|
20
21
|
appState: AppState;
|
|
21
22
|
updateData: (formData?: any) => void;
|
|
22
23
|
appProps: ExcalidrawProps;
|
|
23
24
|
data?: Record<string, any>;
|
|
25
|
+
app: AppClassProperties;
|
|
24
26
|
};
|
|
25
27
|
export interface Action {
|
|
26
28
|
name: ActionName;
|
|
27
29
|
PanelComponent?: React.FC<PanelComponentProps>;
|
|
28
30
|
perform: ActionFn;
|
|
29
31
|
keyPriority?: number;
|
|
30
|
-
keyTest?: (event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[]) => boolean;
|
|
31
|
-
contextItemLabel?: string | ((elements: readonly ExcalidrawElement[], appState: Readonly<AppState
|
|
32
|
+
keyTest?: (event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean;
|
|
33
|
+
contextItemLabel?: string | ((elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, app: AppClassProperties) => string);
|
|
32
34
|
predicate?: (elements: readonly ExcalidrawElement[], appState: AppState, appProps: ExcalidrawProps, app: AppClassProperties) => boolean;
|
|
33
35
|
checked?: (appState: Readonly<AppState>) => boolean;
|
|
34
36
|
trackEvent: false | {
|
package/types/appState.d.ts
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import { AppState } from "./types";
|
|
2
2
|
export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
3
3
|
export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
activeTool?: {
|
|
7
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
|
|
8
|
-
lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser;
|
|
9
|
-
locked: boolean;
|
|
10
|
-
customType: null;
|
|
11
|
-
} | {
|
|
12
|
-
type: "custom";
|
|
13
|
-
customType: string;
|
|
14
|
-
lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser;
|
|
4
|
+
activeTool?: ({
|
|
5
|
+
lastActiveTool: import("./types").ActiveTool | null;
|
|
15
6
|
locked: boolean;
|
|
16
|
-
} | undefined;
|
|
7
|
+
} & import("./types").ActiveTool) | undefined;
|
|
8
|
+
name?: string | undefined;
|
|
17
9
|
showWelcomeScreen?: boolean | undefined;
|
|
18
10
|
penMode?: boolean | undefined;
|
|
19
11
|
penDetected?: boolean | undefined;
|
|
@@ -43,17 +35,21 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
43
35
|
value: import("./types").NormalizedZoomValue;
|
|
44
36
|
}> | undefined;
|
|
45
37
|
openMenu?: "canvas" | "shape" | null | undefined;
|
|
46
|
-
openSidebar?:
|
|
47
|
-
|
|
38
|
+
openSidebar?: {
|
|
39
|
+
name: string;
|
|
40
|
+
tab?: string | undefined;
|
|
41
|
+
} | null | undefined;
|
|
42
|
+
defaultSidebarDockedPreference?: boolean | undefined;
|
|
48
43
|
lastPointerDownWith?: import("./element/types").PointerType | undefined;
|
|
49
|
-
selectedElementIds?: {
|
|
50
|
-
[id: string]:
|
|
51
|
-
} | undefined;
|
|
44
|
+
selectedElementIds?: Readonly<{
|
|
45
|
+
[id: string]: true;
|
|
46
|
+
}> | undefined;
|
|
52
47
|
previousSelectedElementIds?: {
|
|
53
|
-
[id: string]:
|
|
48
|
+
[id: string]: true;
|
|
54
49
|
} | undefined;
|
|
55
50
|
shouldCacheIgnoreZoom?: boolean | undefined;
|
|
56
51
|
zenModeEnabled?: boolean | undefined;
|
|
52
|
+
theme?: import("./element/types").Theme | undefined;
|
|
57
53
|
gridSize?: number | null | undefined;
|
|
58
54
|
selectedGroupIds?: {
|
|
59
55
|
[groupId: string]: boolean;
|
|
@@ -62,6 +58,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
62
58
|
showStats?: boolean | undefined;
|
|
63
59
|
currentChartType?: import("./element/types").ChartType | undefined;
|
|
64
60
|
selectedLinearElement?: import("./element/linearElementEditor").LinearElementEditor | null | undefined;
|
|
61
|
+
objectsSnapModeEnabled?: boolean | undefined;
|
|
65
62
|
};
|
|
66
63
|
export declare const cleanAppStateForExport: (appState: Partial<AppState>) => {
|
|
67
64
|
viewBackgroundColor?: string | undefined;
|
|
@@ -74,3 +71,6 @@ export declare const clearAppStateForDatabase: (appState: Partial<AppState>) =>
|
|
|
74
71
|
export declare const isEraserActive: ({ activeTool, }: {
|
|
75
72
|
activeTool: AppState["activeTool"];
|
|
76
73
|
}) => boolean;
|
|
74
|
+
export declare const isHandToolActive: ({ activeTool, }: {
|
|
75
|
+
activeTool: AppState["activeTool"];
|
|
76
|
+
}) => boolean;
|
package/types/charts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NonDeletedExcalidrawElement } from "./element/types";
|
|
2
|
-
export
|
|
2
|
+
export type ChartElements = readonly NonDeletedExcalidrawElement[];
|
|
3
3
|
export interface Spreadsheet {
|
|
4
4
|
title: string | null;
|
|
5
5
|
labels: string[] | null;
|
|
@@ -7,7 +7,7 @@ export interface Spreadsheet {
|
|
|
7
7
|
}
|
|
8
8
|
export declare const NOT_SPREADSHEET = "NOT_SPREADSHEET";
|
|
9
9
|
export declare const VALID_SPREADSHEET = "VALID_SPREADSHEET";
|
|
10
|
-
|
|
10
|
+
type ParseSpreadsheetResult = {
|
|
11
11
|
type: typeof NOT_SPREADSHEET;
|
|
12
12
|
reason: string;
|
|
13
13
|
} | {
|
package/types/clients.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare const getClientInitials: (userName?: string | null) => string;
|
|
1
|
+
export declare const getClientColor: (id: string) => string;
|
|
2
|
+
/**
|
|
3
|
+
* returns first char, capitalized
|
|
4
|
+
*/
|
|
5
|
+
export declare const getNameInitial: (name?: string | null) => string;
|
package/types/clipboard.d.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { ExcalidrawElement, NonDeletedExcalidrawElement } from "./element/types";
|
|
2
|
-
import {
|
|
2
|
+
import { BinaryFiles } from "./types";
|
|
3
3
|
import { Spreadsheet } from "./charts";
|
|
4
|
+
export type PastedMixedContent = {
|
|
5
|
+
type: "text" | "imageUrl";
|
|
6
|
+
value: string;
|
|
7
|
+
}[];
|
|
4
8
|
export interface ClipboardData {
|
|
5
9
|
spreadsheet?: Spreadsheet;
|
|
6
10
|
elements?: readonly ExcalidrawElement[];
|
|
7
11
|
files?: BinaryFiles;
|
|
8
12
|
text?: string;
|
|
13
|
+
mixedContent?: PastedMixedContent;
|
|
9
14
|
errorMessage?: string;
|
|
15
|
+
programmaticAPI?: boolean;
|
|
10
16
|
}
|
|
11
17
|
export declare const probablySupportsClipboardReadText: boolean;
|
|
12
18
|
export declare const probablySupportsClipboardWriteText: boolean;
|
|
13
19
|
export declare const probablySupportsClipboardBlob: boolean;
|
|
14
|
-
export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawElement[],
|
|
15
|
-
/**
|
|
16
|
-
* Retrieves content from system clipboard (either from ClipboardEvent or
|
|
17
|
-
* via async clipboard API if supported)
|
|
18
|
-
*/
|
|
19
|
-
export declare const getSystemClipboard: (event: ClipboardEvent | null) => Promise<string>;
|
|
20
|
+
export declare const copyToClipboard: (elements: readonly NonDeletedExcalidrawElement[], files: BinaryFiles | null) => Promise<string | undefined>;
|
|
20
21
|
/**
|
|
21
22
|
* Attempts to parse clipboard. Prefers system clipboard.
|
|
22
23
|
*/
|
package/types/colors.d.ts
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import oc from "open-color";
|
|
2
|
+
import { Merge } from "./utility-types";
|
|
3
|
+
export type ColorPickerColor = Exclude<keyof oc, "indigo" | "lime"> | "transparent" | "bronze";
|
|
4
|
+
export type ColorTuple = readonly [string, string, string, string, string];
|
|
5
|
+
export type ColorPalette = Merge<Record<ColorPickerColor, ColorTuple>, {
|
|
6
|
+
black: "#1e1e1e";
|
|
7
|
+
white: "#ffffff";
|
|
8
|
+
transparent: "transparent";
|
|
9
|
+
}>;
|
|
10
|
+
export type ColorPaletteCustom = {
|
|
11
|
+
[key: string]: ColorTuple | string;
|
|
5
12
|
};
|
|
6
|
-
export
|
|
13
|
+
export type ColorShadesIndexes = [number, number, number, number, number];
|
|
14
|
+
export declare const MAX_CUSTOM_COLORS_USED_IN_CANVAS = 5;
|
|
15
|
+
export declare const COLORS_PER_ROW = 5;
|
|
16
|
+
export declare const DEFAULT_CHART_COLOR_INDEX = 4;
|
|
17
|
+
export declare const DEFAULT_ELEMENT_STROKE_COLOR_INDEX = 4;
|
|
18
|
+
export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_INDEX = 1;
|
|
19
|
+
export declare const ELEMENTS_PALETTE_SHADE_INDEXES: readonly [0, 2, 4, 6, 8];
|
|
20
|
+
export declare const CANVAS_PALETTE_SHADE_INDEXES: readonly [0, 1, 2, 3, 4];
|
|
21
|
+
export declare const getSpecificColorShades: (color: Exclude<ColorPickerColor, "transparent" | "white" | "black" | "bronze">, indexArr: readonly [number, number, number, number, number]) => ColorTuple;
|
|
22
|
+
export declare const COLOR_PALETTE: ColorPalette;
|
|
23
|
+
export declare const DEFAULT_ELEMENT_STROKE_PICKS: ColorTuple;
|
|
24
|
+
export declare const DEFAULT_ELEMENT_BACKGROUND_PICKS: ColorTuple;
|
|
25
|
+
export declare const DEFAULT_CANVAS_BACKGROUND_PICKS: ColorTuple;
|
|
26
|
+
export declare const DEFAULT_ELEMENT_STROKE_COLOR_PALETTE: {
|
|
27
|
+
readonly red: ColorTuple;
|
|
28
|
+
readonly pink: ColorTuple;
|
|
29
|
+
readonly grape: ColorTuple;
|
|
30
|
+
readonly violet: ColorTuple;
|
|
31
|
+
readonly blue: ColorTuple;
|
|
32
|
+
readonly cyan: ColorTuple;
|
|
33
|
+
readonly teal: ColorTuple;
|
|
34
|
+
readonly green: ColorTuple;
|
|
35
|
+
readonly yellow: ColorTuple;
|
|
36
|
+
readonly orange: ColorTuple;
|
|
37
|
+
readonly transparent: "transparent";
|
|
38
|
+
readonly white: "#ffffff";
|
|
39
|
+
readonly gray: ColorTuple;
|
|
40
|
+
readonly black: "#1e1e1e";
|
|
41
|
+
readonly bronze: ColorTuple;
|
|
42
|
+
};
|
|
43
|
+
export declare const DEFAULT_ELEMENT_BACKGROUND_COLOR_PALETTE: {
|
|
44
|
+
readonly red: ColorTuple;
|
|
45
|
+
readonly pink: ColorTuple;
|
|
46
|
+
readonly grape: ColorTuple;
|
|
47
|
+
readonly violet: ColorTuple;
|
|
48
|
+
readonly blue: ColorTuple;
|
|
49
|
+
readonly cyan: ColorTuple;
|
|
50
|
+
readonly teal: ColorTuple;
|
|
51
|
+
readonly green: ColorTuple;
|
|
52
|
+
readonly yellow: ColorTuple;
|
|
53
|
+
readonly orange: ColorTuple;
|
|
54
|
+
readonly transparent: "transparent";
|
|
55
|
+
readonly white: "#ffffff";
|
|
56
|
+
readonly gray: ColorTuple;
|
|
57
|
+
readonly black: "#1e1e1e";
|
|
58
|
+
readonly bronze: ColorTuple;
|
|
59
|
+
};
|
|
60
|
+
export declare const getAllColorsSpecificShade: (index: 0 | 1 | 2 | 3 | 4) => readonly [string, string, string, string, string, string, string, string, string, string];
|
|
61
|
+
export declare const rgbToHex: (r: number, g: number, b: number) => string;
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { ActionManager } from "../actions/manager";
|
|
3
|
-
import { ExcalidrawElement
|
|
4
|
-
import {
|
|
2
|
+
import { ExcalidrawElement } from "../element/types";
|
|
3
|
+
import { AppClassProperties, UIAppState, Zoom } from "../types";
|
|
5
4
|
import "./Actions.scss";
|
|
6
5
|
export declare const SelectedShapeActions: ({ appState, elements, renderAction, }: {
|
|
7
|
-
appState:
|
|
6
|
+
appState: UIAppState;
|
|
8
7
|
elements: readonly ExcalidrawElement[];
|
|
9
8
|
renderAction: ActionManager["renderAction"];
|
|
10
9
|
}) => JSX.Element;
|
|
11
|
-
export declare const ShapesSwitcher: ({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
onImageAction: (data: {
|
|
16
|
-
pointerType: PointerType | null;
|
|
17
|
-
}) => void;
|
|
18
|
-
appState: AppState;
|
|
10
|
+
export declare const ShapesSwitcher: ({ activeTool, appState, app, }: {
|
|
11
|
+
activeTool: UIAppState["activeTool"];
|
|
12
|
+
appState: UIAppState;
|
|
13
|
+
app: AppClassProperties;
|
|
19
14
|
}) => JSX.Element;
|
|
20
15
|
export declare const ZoomActions: ({ renderAction, zoom, }: {
|
|
21
16
|
renderAction: ActionManager["renderAction"];
|