@dwelle/excalidraw 0.4.0-d8d86cf → 0.4.0-da7ef3e
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 +706 -0
- package/README.md +18 -1422
- 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 +3035 -1464
- 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 +130 -52
- package/types/actions/actionAlign.d.ts +25 -32
- package/types/actions/actionBoundText.d.ts +191 -22
- package/types/actions/actionCanvas.d.ts +774 -174
- package/types/actions/actionClipboard.d.ts +232 -88
- package/types/actions/actionDeleteSelected.d.ts +129 -57
- package/types/actions/actionDistribute.d.ts +7 -12
- package/types/actions/actionDuplicateSelection.d.ts +2 -5
- package/types/actions/actionElementLock.d.ts +283 -0
- package/types/actions/actionExport.d.ts +448 -229
- package/types/actions/actionFinalize.d.ts +87 -41
- package/types/actions/actionFlip.d.ts +4 -7
- package/types/actions/actionFrame.d.ts +441 -0
- package/types/actions/actionGroup.d.ts +260 -15
- package/types/actions/actionHistory.d.ts +1 -1
- package/types/actions/actionLinearEditor.d.ts +46 -20
- package/types/actions/actionMenu.d.ts +136 -65
- package/types/actions/actionNavigate.d.ts +2 -3
- package/types/actions/actionProperties.d.ts +590 -277
- package/types/actions/actionSelectAll.d.ts +127 -2
- package/types/actions/actionStyles.d.ts +44 -19
- package/types/actions/actionToggleGridMode.d.ts +46 -19
- package/types/actions/{actionToggleLock.d.ts → actionToggleObjectsSnapMode.d.ts} +58 -31
- package/types/actions/actionToggleStats.d.ts +45 -19
- package/types/actions/actionToggleViewMode.d.ts +46 -19
- package/types/actions/actionToggleZenMode.d.ts +46 -19
- package/types/actions/actionZindex.d.ts +8 -16
- package/types/actions/index.d.ts +2 -1
- package/types/actions/manager.d.ts +3 -2
- package/types/actions/shortcuts.d.ts +2 -1
- package/types/actions/types.d.ts +16 -13
- package/types/appState.d.ts +23 -18
- package/types/charts.d.ts +2 -2
- package/types/clients.d.ts +5 -6
- package/types/clipboard.d.ts +3 -2
- package/types/colors.d.ts +60 -5
- package/types/components/Actions.d.ts +7 -7
- package/types/components/ActiveConfirmDialog.d.ts +4 -0
- package/types/components/App.d.ts +88 -74
- package/types/components/Avatar.d.ts +1 -2
- package/types/components/BraveMeasureTextError.d.ts +2 -0
- package/types/components/Button.d.ts +16 -0
- package/types/components/ButtonIconSelect.d.ts +11 -3
- package/types/components/Card.d.ts +6 -0
- 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 +9 -22
- 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 +7 -5
- package/types/components/LayerUI.d.ts +10 -16
- 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 -5
- 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 +10 -12
- 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/UserList.d.ts +0 -2
- 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 +67 -0
- package/types/components/dropdownMenu/DropdownMenuContent.d.ts +15 -0
- package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +12 -0
- package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +13 -0
- package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +10 -0
- package/types/components/dropdownMenu/common.d.ts +6 -0
- package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
- package/types/components/footer/Footer.d.ts +12 -0
- package/types/components/footer/FooterCenter.d.ts +8 -0
- package/types/components/hoc/withInternalFallback.d.ts +4 -0
- package/types/components/icons.d.ts +15 -2
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +9 -0
- package/types/components/main-menu/DefaultItems.d.ts +47 -0
- package/types/components/main-menu/MainMenu.d.ts +61 -0
- package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +57 -0
- package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
- package/types/components/welcome-screen/WelcomeScreen.d.ts +84 -0
- package/types/constants.d.ts +94 -18
- package/types/context/tunnels.d.ts +19 -0
- package/types/context/ui-appState.d.ts +4 -0
- package/types/data/blob.d.ts +3 -2
- package/types/data/encode.d.ts +1 -1
- package/types/data/filesystem.d.ts +2 -1
- package/types/data/index.d.ts +1 -1
- package/types/data/library.d.ts +3 -45
- package/types/data/restore.d.ts +10 -4
- package/types/data/transform.d.ts +71 -0
- package/types/data/types.d.ts +3 -5
- package/types/data/url.d.ts +7 -0
- package/types/element/Hyperlink.d.ts +57 -30
- package/types/element/binding.d.ts +4 -3
- package/types/element/bounds.d.ts +31 -7
- package/types/element/collision.d.ts +7 -7
- package/types/element/dragElements.d.ts +12 -2
- package/types/element/embeddable.d.ts +159 -0
- package/types/element/image.d.ts +11 -1
- package/types/element/index.d.ts +3 -2
- package/types/element/linearElementEditor.d.ts +49 -24
- package/types/element/mutateElement.d.ts +2 -1
- package/types/element/newElement.d.ts +48 -15
- package/types/element/resizeElements.d.ts +3 -2
- 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 +44 -11
- package/types/element/textWysiwyg.d.ts +7 -2
- package/types/element/transformHandles.d.ts +15 -8
- package/types/element/typeChecks.d.ts +13 -2
- package/types/element/types.d.ts +64 -36
- package/types/emitter.d.ts +1 -1
- package/types/errors.d.ts +1 -1
- package/types/frame.d.ts +40 -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 +7 -4
- package/types/math.d.ts +6 -1
- package/types/packages/excalidraw/example/App.d.ts +7 -1
- package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/initialData.d.ts +182 -64
- package/types/packages/excalidraw/index.d.ts +19 -3
- 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 +28 -24
- package/types/renderer/renderElement.d.ts +12 -22
- package/types/renderer/renderScene.d.ts +19 -29
- 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 +1 -1
- package/types/scene/export.d.ts +182 -10
- 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 +69 -26
- package/types/snapping.d.ts +108 -0
- package/types/types.d.ts +196 -81
- package/types/utility-types.d.ts +24 -0
- package/types/utils.d.ts +78 -12
- package/types/zindex.d.ts +4 -4
- package/types/components/ActiveFile.d.ts +0 -7
- package/types/components/ClearCanvas.d.ts +0 -4
- package/types/components/CollabButton.d.ts +0 -6
- package/types/components/ColorPicker.d.ts +0 -14
- package/types/components/Footer.d.ts +0 -10
- package/types/components/LibraryButton.d.ts +0 -8
- package/types/components/MenuItem.d.ts +0 -11
- package/types/components/MenuUtils.d.ts +0 -1
- package/types/components/SingleLibraryItem.d.ts +0 -10
- package/types/components/WelcomeScreen.d.ts +0 -10
- package/types/components/WelcomeScreenDecor.d.ts +0 -6
- 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
package/types/constants.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import { AppProps } from "./types";
|
|
2
|
-
import { FontFamilyValues } from "./element/types";
|
|
1
|
+
import { AppProps, NormalizedZoomValue } from "./types";
|
|
2
|
+
import { ExcalidrawElement, FontFamilyValues } from "./element/types";
|
|
3
|
+
export declare const isDarwin: boolean;
|
|
4
|
+
export declare const isWindows: boolean;
|
|
5
|
+
export declare const isAndroid: boolean;
|
|
6
|
+
export declare const isFirefox: boolean;
|
|
7
|
+
export declare const isChrome: boolean;
|
|
8
|
+
export declare const isSafari: boolean;
|
|
9
|
+
export declare const isBrave: () => boolean;
|
|
3
10
|
export declare const APP_NAME = "Excalidraw";
|
|
4
11
|
export declare const DRAGGING_THRESHOLD = 10;
|
|
5
12
|
export declare const LINE_CONFIRM_THRESHOLD = 8;
|
|
@@ -22,6 +29,11 @@ export declare const POINTER_BUTTON: {
|
|
|
22
29
|
readonly SECONDARY: 2;
|
|
23
30
|
readonly TOUCH: -1;
|
|
24
31
|
};
|
|
32
|
+
export declare const POINTER_EVENTS: {
|
|
33
|
+
readonly enabled: "all";
|
|
34
|
+
readonly disabled: "none";
|
|
35
|
+
readonly inheritFromUI: any;
|
|
36
|
+
};
|
|
25
37
|
export declare enum EVENT {
|
|
26
38
|
COPY = "copy",
|
|
27
39
|
PASTE = "paste",
|
|
@@ -40,6 +52,7 @@ export declare enum EVENT {
|
|
|
40
52
|
GESTURE_START = "gesturestart",
|
|
41
53
|
GESTURE_CHANGE = "gesturechange",
|
|
42
54
|
POINTER_MOVE = "pointermove",
|
|
55
|
+
POINTER_DOWN = "pointerdown",
|
|
43
56
|
POINTER_UP = "pointerup",
|
|
44
57
|
STATE_CHANGE = "statechange",
|
|
45
58
|
WHEEL = "wheel",
|
|
@@ -48,11 +61,22 @@ export declare enum EVENT {
|
|
|
48
61
|
HASHCHANGE = "hashchange",
|
|
49
62
|
VISIBILITY_CHANGE = "visibilitychange",
|
|
50
63
|
SCROLL = "scroll",
|
|
51
|
-
EXCALIDRAW_LINK = "excalidraw-link"
|
|
64
|
+
EXCALIDRAW_LINK = "excalidraw-link",
|
|
65
|
+
MENU_ITEM_SELECT = "menu.itemSelect",
|
|
66
|
+
MESSAGE = "message"
|
|
52
67
|
}
|
|
68
|
+
export declare const YOUTUBE_STATES: {
|
|
69
|
+
readonly UNSTARTED: -1;
|
|
70
|
+
readonly ENDED: 0;
|
|
71
|
+
readonly PLAYING: 1;
|
|
72
|
+
readonly PAUSED: 2;
|
|
73
|
+
readonly BUFFERING: 3;
|
|
74
|
+
readonly CUED: 5;
|
|
75
|
+
};
|
|
53
76
|
export declare const ENV: {
|
|
54
77
|
TEST: string;
|
|
55
78
|
DEVELOPMENT: string;
|
|
79
|
+
PRODUCTION: string;
|
|
56
80
|
};
|
|
57
81
|
export declare const CLASSES: {
|
|
58
82
|
SHAPE_ACTIONS_MENU: string;
|
|
@@ -63,36 +87,72 @@ export declare const FONT_FAMILY: {
|
|
|
63
87
|
Cascadia: number;
|
|
64
88
|
};
|
|
65
89
|
export declare const THEME: {
|
|
66
|
-
LIGHT:
|
|
67
|
-
DARK:
|
|
90
|
+
readonly LIGHT: "light";
|
|
91
|
+
readonly DARK: "dark";
|
|
92
|
+
};
|
|
93
|
+
export declare const FRAME_STYLE: {
|
|
94
|
+
strokeColor: string;
|
|
95
|
+
strokeWidth: number;
|
|
96
|
+
strokeStyle: import("./element/types").StrokeStyle;
|
|
97
|
+
fillStyle: import("./element/types").FillStyle;
|
|
98
|
+
roughness: number;
|
|
99
|
+
roundness: {
|
|
100
|
+
type: import("./element/types").RoundnessType;
|
|
101
|
+
value?: number | undefined;
|
|
102
|
+
} | null;
|
|
103
|
+
backgroundColor: string;
|
|
104
|
+
radius: number;
|
|
68
105
|
};
|
|
69
106
|
export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
|
|
107
|
+
export declare const MIN_FONT_SIZE = 1;
|
|
70
108
|
export declare const DEFAULT_FONT_SIZE = 20;
|
|
71
109
|
export declare const DEFAULT_FONT_FAMILY: FontFamilyValues;
|
|
72
110
|
export declare const DEFAULT_TEXT_ALIGN = "left";
|
|
73
111
|
export declare const DEFAULT_VERTICAL_ALIGN = "top";
|
|
74
112
|
export declare const DEFAULT_VERSION = "{version}";
|
|
113
|
+
export declare const DEFAULT_BACKGROUND_COLOR = "#ffffff";
|
|
114
|
+
export declare const DEFAULT_STROKE_COLOR = "#000000";
|
|
115
|
+
export declare const DEFAULT_ZOOM_VALUE: NormalizedZoomValue;
|
|
75
116
|
export declare const CANVAS_ONLY_ACTIONS: string[];
|
|
76
117
|
export declare const GRID_SIZE = 20;
|
|
118
|
+
export declare const IMAGE_MIME_TYPES: {
|
|
119
|
+
readonly svg: "image/svg+xml";
|
|
120
|
+
readonly png: "image/png";
|
|
121
|
+
readonly jpg: "image/jpeg";
|
|
122
|
+
readonly gif: "image/gif";
|
|
123
|
+
readonly webp: "image/webp";
|
|
124
|
+
readonly bmp: "image/bmp";
|
|
125
|
+
readonly ico: "image/x-icon";
|
|
126
|
+
readonly avif: "image/avif";
|
|
127
|
+
readonly jfif: "image/jfif";
|
|
128
|
+
};
|
|
77
129
|
export declare const MIME_TYPES: {
|
|
78
|
-
readonly excalidraw: "application/vnd.excalidraw+json";
|
|
79
|
-
readonly excalidrawlib: "application/vnd.excalidrawlib+json";
|
|
80
|
-
readonly json: "application/json";
|
|
81
130
|
readonly svg: "image/svg+xml";
|
|
82
|
-
readonly "excalidraw.svg": "image/svg+xml";
|
|
83
131
|
readonly png: "image/png";
|
|
84
|
-
readonly "excalidraw.png": "image/png";
|
|
85
132
|
readonly jpg: "image/jpeg";
|
|
86
133
|
readonly gif: "image/gif";
|
|
87
134
|
readonly webp: "image/webp";
|
|
88
135
|
readonly bmp: "image/bmp";
|
|
89
136
|
readonly ico: "image/x-icon";
|
|
137
|
+
readonly avif: "image/avif";
|
|
138
|
+
readonly jfif: "image/jfif";
|
|
139
|
+
readonly json: "application/json";
|
|
140
|
+
readonly excalidraw: "application/vnd.excalidraw+json";
|
|
141
|
+
readonly excalidrawlib: "application/vnd.excalidrawlib+json";
|
|
142
|
+
readonly "excalidraw.svg": "image/svg+xml";
|
|
143
|
+
readonly "excalidraw.png": "image/png";
|
|
90
144
|
readonly binary: "application/octet-stream";
|
|
91
145
|
};
|
|
146
|
+
export declare const EXPORT_IMAGE_TYPES: {
|
|
147
|
+
readonly png: "png";
|
|
148
|
+
readonly svg: "svg";
|
|
149
|
+
readonly clipboard: "clipboard";
|
|
150
|
+
};
|
|
92
151
|
export declare const EXPORT_DATA_TYPES: {
|
|
93
152
|
readonly excalidraw: "excalidraw";
|
|
94
153
|
readonly excalidrawClipboard: "excalidraw/clipboard";
|
|
95
154
|
readonly excalidrawLibrary: "excalidrawlib";
|
|
155
|
+
readonly excalidrawClipboardWithAPI: "excalidraw-api/clipboard";
|
|
96
156
|
};
|
|
97
157
|
export declare const EXPORT_SOURCE: string;
|
|
98
158
|
export declare const IMAGE_RENDER_TIMEOUT = 500;
|
|
@@ -106,11 +166,6 @@ export declare const MIN_ZOOM = 0.1;
|
|
|
106
166
|
export declare const HYPERLINK_TOOLTIP_DELAY = 300;
|
|
107
167
|
export declare const IDLE_THRESHOLD = 60000;
|
|
108
168
|
export declare const ACTIVE_THRESHOLD = 3000;
|
|
109
|
-
export declare const MODES: {
|
|
110
|
-
VIEW: string;
|
|
111
|
-
ZEN: string;
|
|
112
|
-
GRID: string;
|
|
113
|
-
};
|
|
114
169
|
export declare const THEME_FILTER: any;
|
|
115
170
|
export declare const URL_QUERY_KEYS: {
|
|
116
171
|
readonly addLibrary: "addLibrary";
|
|
@@ -129,7 +184,6 @@ export declare const MAX_DECIMALS_FOR_SVG_EXPORT = 2;
|
|
|
129
184
|
export declare const EXPORT_SCALES: number[];
|
|
130
185
|
export declare const DEFAULT_EXPORT_PADDING = 10;
|
|
131
186
|
export declare const DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT = 1440;
|
|
132
|
-
export declare const ALLOWED_IMAGE_MIME_TYPES: readonly ["image/png", "image/jpeg", "image/svg+xml", "image/gif", "image/webp", "image/bmp", "image/x-icon"];
|
|
133
187
|
export declare const MAX_ALLOWED_FILE_BYTES: number;
|
|
134
188
|
export declare const SVG_NS = "http://www.w3.org/2000/svg";
|
|
135
189
|
export declare const ENCRYPTION_KEY_BITS = 128;
|
|
@@ -138,6 +192,8 @@ export declare const VERSIONS: {
|
|
|
138
192
|
readonly excalidrawLibrary: 2;
|
|
139
193
|
};
|
|
140
194
|
export declare const BOUND_TEXT_PADDING = 5;
|
|
195
|
+
export declare const ARROW_LABEL_WIDTH_FRACTION = 0.7;
|
|
196
|
+
export declare const ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO = 11;
|
|
141
197
|
export declare const VERTICAL_ALIGN: {
|
|
142
198
|
TOP: string;
|
|
143
199
|
MIDDLE: string;
|
|
@@ -149,9 +205,29 @@ export declare const TEXT_ALIGN: {
|
|
|
149
205
|
RIGHT: string;
|
|
150
206
|
};
|
|
151
207
|
export declare const ELEMENT_READY_TO_ERASE_OPACITY = 20;
|
|
152
|
-
export declare const
|
|
153
|
-
|
|
208
|
+
export declare const DEFAULT_PROPORTIONAL_RADIUS = 0.25;
|
|
209
|
+
export declare const DEFAULT_ADAPTIVE_RADIUS = 32;
|
|
210
|
+
export declare const ROUNDNESS: {
|
|
211
|
+
readonly LEGACY: 1;
|
|
212
|
+
readonly PROPORTIONAL_RADIUS: 2;
|
|
213
|
+
readonly ADAPTIVE_RADIUS: 3;
|
|
154
214
|
};
|
|
155
215
|
/** key containt id of precedeing elemnt id we use in reconciliation during
|
|
156
216
|
* collaboration */
|
|
157
217
|
export declare const PRECEDING_ELEMENT_KEY = "__precedingElement__";
|
|
218
|
+
export declare const DEFAULT_ELEMENT_PROPS: {
|
|
219
|
+
strokeColor: ExcalidrawElement["strokeColor"];
|
|
220
|
+
backgroundColor: ExcalidrawElement["backgroundColor"];
|
|
221
|
+
fillStyle: ExcalidrawElement["fillStyle"];
|
|
222
|
+
strokeWidth: ExcalidrawElement["strokeWidth"];
|
|
223
|
+
strokeStyle: ExcalidrawElement["strokeStyle"];
|
|
224
|
+
roughness: ExcalidrawElement["roughness"];
|
|
225
|
+
opacity: ExcalidrawElement["opacity"];
|
|
226
|
+
locked: ExcalidrawElement["locked"];
|
|
227
|
+
};
|
|
228
|
+
export declare const LIBRARY_SIDEBAR_TAB = "library";
|
|
229
|
+
export declare const DEFAULT_SIDEBAR: {
|
|
230
|
+
readonly name: "default";
|
|
231
|
+
readonly defaultTab: "library";
|
|
232
|
+
};
|
|
233
|
+
export declare const LIBRARY_DISABLED_TYPES: Set<"embeddable" | "image">;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import tunnel from "tunnel-rat";
|
|
3
|
+
export type Tunnel = ReturnType<typeof tunnel>;
|
|
4
|
+
type TunnelsContextValue = {
|
|
5
|
+
MainMenuTunnel: Tunnel;
|
|
6
|
+
WelcomeScreenMenuHintTunnel: Tunnel;
|
|
7
|
+
WelcomeScreenToolbarHintTunnel: Tunnel;
|
|
8
|
+
WelcomeScreenHelpHintTunnel: Tunnel;
|
|
9
|
+
WelcomeScreenCenterTunnel: Tunnel;
|
|
10
|
+
FooterCenterTunnel: Tunnel;
|
|
11
|
+
DefaultSidebarTriggerTunnel: Tunnel;
|
|
12
|
+
DefaultSidebarTabTriggersTunnel: Tunnel;
|
|
13
|
+
OverwriteConfirmDialogTunnel: Tunnel;
|
|
14
|
+
jotaiScope: symbol;
|
|
15
|
+
};
|
|
16
|
+
export declare const TunnelsContext: React.Context<TunnelsContextValue>;
|
|
17
|
+
export declare const useTunnels: () => TunnelsContextValue;
|
|
18
|
+
export declare const useInitializeTunnels: () => TunnelsContextValue;
|
|
19
|
+
export {};
|
package/types/data/blob.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IMAGE_MIME_TYPES, MIME_TYPES } from "../constants";
|
|
2
2
|
import { ExcalidrawElement, FileId } from "../element/types";
|
|
3
3
|
import { AppState, DataURL, LibraryItem } from "../types";
|
|
4
|
+
import { ValueOf } from "../utility-types";
|
|
4
5
|
import { FileSystemHandle } from "./filesystem";
|
|
5
6
|
import { ImportedLibraryData } from "./types";
|
|
6
7
|
export declare const getMimeType: (blob: Blob | string) => string;
|
|
@@ -8,7 +9,7 @@ export declare const getFileHandleType: (handle: FileSystemHandle | null) => str
|
|
|
8
9
|
export declare const isImageFileHandleType: (type: string | null) => type is "svg" | "png";
|
|
9
10
|
export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boolean;
|
|
10
11
|
export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
|
|
11
|
-
type:
|
|
12
|
+
type: ValueOf<typeof IMAGE_MIME_TYPES>;
|
|
12
13
|
};
|
|
13
14
|
export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null) => Promise<{
|
|
14
15
|
type: "application/vnd.excalidraw+json";
|
package/types/data/encode.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const toByteString: (data: string | Uint8Array | ArrayBuffer) =>
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const stringToBase64: (str: string, isByteString?: boolean) => Promise<string>;
|
|
7
7
|
export declare const base64ToString: (base64: string, isByteString?: boolean) => Promise<string>;
|
|
8
|
-
|
|
8
|
+
type EncodedData = {
|
|
9
9
|
encoded: string;
|
|
10
10
|
encoding: "bstring";
|
|
11
11
|
/** whether text is compressed (zlib) */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FileSystemHandle, supported as nativeFileSystemSupported } from "browser-fs-access";
|
|
2
|
-
|
|
2
|
+
import { MIME_TYPES } from "../constants";
|
|
3
|
+
type FILE_EXTENSION = Exclude<keyof typeof MIME_TYPES, "binary">;
|
|
3
4
|
export declare const fileOpen: <M extends boolean | undefined = false>(opts: {
|
|
4
5
|
extensions?: FILE_EXTENSION[] | undefined;
|
|
5
6
|
description: string;
|
package/types/data/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { AppState, BinaryFiles } from "../types";
|
|
|
4
4
|
import { FileSystemHandle } from "./filesystem";
|
|
5
5
|
export { loadFromBlob } from "./blob";
|
|
6
6
|
export { loadFromJSON, saveAsJSON } from "./json";
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const exportAsImage: (type: Omit<ExportType, "backend">, elements: readonly NonDeletedExcalidrawElement[], appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, name, fileHandle, }: {
|
|
8
8
|
exportBackground: boolean;
|
|
9
9
|
exportPadding?: number | undefined;
|
|
10
10
|
viewBackgroundColor: string;
|
package/types/data/library.d.ts
CHANGED
|
@@ -1,55 +1,11 @@
|
|
|
1
1
|
import { LibraryItems, ExcalidrawImperativeAPI, LibraryItemsSource } from "../types";
|
|
2
2
|
import type App from "../components/App";
|
|
3
3
|
import { ExcalidrawElement } from "../element/types";
|
|
4
|
-
export declare const libraryItemsAtom: import("jotai").
|
|
4
|
+
export declare const libraryItemsAtom: import("jotai").PrimitiveAtom<{
|
|
5
5
|
status: "loading" | "loaded";
|
|
6
6
|
isInitialized: boolean;
|
|
7
7
|
libraryItems: LibraryItems;
|
|
8
8
|
}> & {
|
|
9
|
-
write: (get: {
|
|
10
|
-
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
11
|
-
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
12
|
-
<Value_2>(atom: import("jotai").Atom<Value_2>): Value_2 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_2;
|
|
13
|
-
} & {
|
|
14
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
15
|
-
unstable_promise: true;
|
|
16
|
-
}): Value_3 | Promise<Value_3>;
|
|
17
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
18
|
-
unstable_promise: true;
|
|
19
|
-
}): Value_4 | Promise<Value_4>;
|
|
20
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
21
|
-
unstable_promise: true;
|
|
22
|
-
}): (Value_5 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_5) | Promise<Value_5 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_5>;
|
|
23
|
-
}, set: {
|
|
24
|
-
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
25
|
-
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
26
|
-
}, update: {
|
|
27
|
-
status: "loading" | "loaded";
|
|
28
|
-
isInitialized: boolean;
|
|
29
|
-
libraryItems: LibraryItems;
|
|
30
|
-
} | ((prev: {
|
|
31
|
-
status: "loading" | "loaded";
|
|
32
|
-
isInitialized: boolean;
|
|
33
|
-
libraryItems: LibraryItems;
|
|
34
|
-
}) => {
|
|
35
|
-
status: "loading" | "loaded";
|
|
36
|
-
isInitialized: boolean;
|
|
37
|
-
libraryItems: LibraryItems;
|
|
38
|
-
})) => void;
|
|
39
|
-
onMount?: (<S extends (update: {
|
|
40
|
-
status: "loading" | "loaded";
|
|
41
|
-
isInitialized: boolean;
|
|
42
|
-
libraryItems: LibraryItems;
|
|
43
|
-
} | ((prev: {
|
|
44
|
-
status: "loading" | "loaded";
|
|
45
|
-
isInitialized: boolean;
|
|
46
|
-
libraryItems: LibraryItems;
|
|
47
|
-
}) => {
|
|
48
|
-
status: "loading" | "loaded";
|
|
49
|
-
isInitialized: boolean;
|
|
50
|
-
libraryItems: LibraryItems;
|
|
51
|
-
})) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
52
|
-
} & {
|
|
53
9
|
init: {
|
|
54
10
|
status: "loading" | "loaded";
|
|
55
11
|
isInitialized: boolean;
|
|
@@ -70,6 +26,8 @@ declare class Library {
|
|
|
70
26
|
private updateQueue;
|
|
71
27
|
private getLastUpdateTask;
|
|
72
28
|
private notifyListeners;
|
|
29
|
+
/** call on excalidraw instance unmount */
|
|
30
|
+
destroy: () => void;
|
|
73
31
|
resetLibrary: () => Promise<LibraryItems>;
|
|
74
32
|
/**
|
|
75
33
|
* @returns latest cloned libraryItems. Awaits all in-progress updates first.
|
package/types/data/restore.d.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { ExcalidrawElement } from "../element/types";
|
|
2
2
|
import { AppState, BinaryFiles, LibraryItem } from "../types";
|
|
3
3
|
import { ImportedDataState } from "./types";
|
|
4
|
-
|
|
4
|
+
type RestoredAppState = Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
5
5
|
export declare const AllowedExcalidrawActiveTools: Record<AppState["activeTool"]["type"], boolean>;
|
|
6
|
-
export
|
|
6
|
+
export type RestoredDataState = {
|
|
7
7
|
elements: ExcalidrawElement[];
|
|
8
8
|
appState: RestoredAppState;
|
|
9
9
|
files: BinaryFiles;
|
|
10
10
|
};
|
|
11
|
-
export declare const restoreElements: (elements: ImportedDataState["elements"], localElements: readonly ExcalidrawElement[] | null | undefined,
|
|
11
|
+
export declare const restoreElements: (elements: ImportedDataState["elements"], localElements: readonly ExcalidrawElement[] | null | undefined, opts?: {
|
|
12
|
+
refreshDimensions?: boolean;
|
|
13
|
+
repairBindings?: boolean;
|
|
14
|
+
} | undefined) => ExcalidrawElement[];
|
|
12
15
|
export declare const restoreAppState: (appState: ImportedDataState["appState"], localAppState: Partial<AppState> | null | undefined) => RestoredAppState;
|
|
13
|
-
export declare const restore: (data: Pick<ImportedDataState, "appState" | "elements" | "files"> | null, localAppState: Partial<AppState> | null | undefined, localElements: readonly ExcalidrawElement[] | null | undefined
|
|
16
|
+
export declare const restore: (data: Pick<ImportedDataState, "appState" | "elements" | "files"> | null, localAppState: Partial<AppState> | null | undefined, localElements: readonly ExcalidrawElement[] | null | undefined, elementsConfig?: {
|
|
17
|
+
refreshDimensions?: boolean;
|
|
18
|
+
repairBindings?: boolean;
|
|
19
|
+
}) => RestoredDataState;
|
|
14
20
|
export declare const restoreLibraryItems: (libraryItems: ImportedDataState["libraryItems"], defaultStatus: LibraryItem["status"]) => LibraryItem[];
|
|
15
21
|
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ElementConstructorOpts } from "../element/newElement";
|
|
2
|
+
import { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawEmbeddableElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FileId, FontFamilyValues, TextAlign, VerticalAlign } from "../element/types";
|
|
3
|
+
import { MarkOptional } from "../utility-types";
|
|
4
|
+
export type ValidLinearElement = {
|
|
5
|
+
type: "arrow" | "line";
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
label?: {
|
|
9
|
+
text: string;
|
|
10
|
+
fontSize?: number;
|
|
11
|
+
fontFamily?: FontFamilyValues;
|
|
12
|
+
textAlign?: TextAlign;
|
|
13
|
+
verticalAlign?: VerticalAlign;
|
|
14
|
+
} & MarkOptional<ElementConstructorOpts, "x" | "y">;
|
|
15
|
+
end?: (({
|
|
16
|
+
type: Exclude<ExcalidrawBindableElement["type"], "image" | "text" | "frame" | "embeddable">;
|
|
17
|
+
id?: ExcalidrawGenericElement["id"];
|
|
18
|
+
} | {
|
|
19
|
+
id: ExcalidrawGenericElement["id"];
|
|
20
|
+
type?: Exclude<ExcalidrawBindableElement["type"], "image" | "text" | "frame" | "embeddable">;
|
|
21
|
+
}) | (({
|
|
22
|
+
type: "text";
|
|
23
|
+
text: string;
|
|
24
|
+
} | {
|
|
25
|
+
type?: "text";
|
|
26
|
+
id: ExcalidrawTextElement["id"];
|
|
27
|
+
text: string;
|
|
28
|
+
}) & Partial<ExcalidrawTextElement>)) & MarkOptional<ElementConstructorOpts, "x" | "y">;
|
|
29
|
+
start?: (({
|
|
30
|
+
type: Exclude<ExcalidrawBindableElement["type"], "image" | "text" | "frame" | "embeddable">;
|
|
31
|
+
id?: ExcalidrawGenericElement["id"];
|
|
32
|
+
} | {
|
|
33
|
+
id: ExcalidrawGenericElement["id"];
|
|
34
|
+
type?: Exclude<ExcalidrawBindableElement["type"], "image" | "text" | "frame" | "embeddable">;
|
|
35
|
+
}) | (({
|
|
36
|
+
type: "text";
|
|
37
|
+
text: string;
|
|
38
|
+
} | {
|
|
39
|
+
type?: "text";
|
|
40
|
+
id: ExcalidrawTextElement["id"];
|
|
41
|
+
text: string;
|
|
42
|
+
}) & Partial<ExcalidrawTextElement>)) & MarkOptional<ElementConstructorOpts, "x" | "y">;
|
|
43
|
+
} & Partial<ExcalidrawLinearElement>;
|
|
44
|
+
export type ValidContainer = {
|
|
45
|
+
type: Exclude<ExcalidrawGenericElement["type"], "selection">;
|
|
46
|
+
id?: ExcalidrawGenericElement["id"];
|
|
47
|
+
label?: {
|
|
48
|
+
text: string;
|
|
49
|
+
fontSize?: number;
|
|
50
|
+
fontFamily?: FontFamilyValues;
|
|
51
|
+
textAlign?: TextAlign;
|
|
52
|
+
verticalAlign?: VerticalAlign;
|
|
53
|
+
} & MarkOptional<ElementConstructorOpts, "x" | "y">;
|
|
54
|
+
} & ElementConstructorOpts;
|
|
55
|
+
export type ExcalidrawElementSkeleton = Extract<Exclude<ExcalidrawElement, ExcalidrawSelectionElement>, ExcalidrawEmbeddableElement | ExcalidrawFreeDrawElement | ExcalidrawFrameElement> | ({
|
|
56
|
+
type: Extract<ExcalidrawLinearElement["type"], "line">;
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
} & Partial<ExcalidrawLinearElement>) | ValidContainer | ValidLinearElement | ({
|
|
60
|
+
type: "text";
|
|
61
|
+
text: string;
|
|
62
|
+
x: number;
|
|
63
|
+
y: number;
|
|
64
|
+
id?: ExcalidrawTextElement["id"];
|
|
65
|
+
} & Partial<ExcalidrawTextElement>) | ({
|
|
66
|
+
type: Extract<ExcalidrawImageElement["type"], "image">;
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
fileId: FileId;
|
|
70
|
+
} & Partial<ExcalidrawImageElement>);
|
|
71
|
+
export declare const convertToExcalidrawElements: (elements: ExcalidrawElementSkeleton[] | null) => ExcalidrawElement[];
|
package/types/data/types.d.ts
CHANGED
|
@@ -17,11 +17,9 @@ export interface ExportedDataState {
|
|
|
17
17
|
* This is a helper type used in downstream abstractions.
|
|
18
18
|
* Don't consume on its own.
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
21
|
-
/** @deprecated #
|
|
22
|
-
|
|
23
|
-
/** @deprecated #5663 TODO remove 22-12-15 */
|
|
24
|
-
isLibraryMenuDocked: [boolean, "isSidebarDocked"];
|
|
20
|
+
export type LegacyAppState = {
|
|
21
|
+
/** @deprecated #6213 TODO remove 23-06-01 */
|
|
22
|
+
isSidebarDocked: [boolean, "defaultSidebarDockedPreference"];
|
|
25
23
|
};
|
|
26
24
|
export interface ImportedDataState {
|
|
27
25
|
type?: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const normalizeLink: (link: string) => string;
|
|
2
|
+
export declare const isLocalLink: (link: string | null) => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Returns URL sanitized and safe for usage in places such as
|
|
5
|
+
* iframe's src attribute or <a> href attributes.
|
|
6
|
+
*/
|
|
7
|
+
export declare const toValidURL: (link: string) => string;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import { AppState, ExcalidrawProps } from "../types";
|
|
1
|
+
import { AppState, ExcalidrawProps, UIAppState } from "../types";
|
|
3
2
|
import { NonDeletedExcalidrawElement } from "./types";
|
|
4
3
|
import { Bounds } from "./bounds";
|
|
5
4
|
import "./Hyperlink.scss";
|
|
6
5
|
export declare const EXTERNAL_LINK_IMG: HTMLImageElement;
|
|
7
|
-
export declare const Hyperlink: ({ element, setAppState, onLinkOpen, }: {
|
|
6
|
+
export declare const Hyperlink: ({ element, setAppState, onLinkOpen, setToast, }: {
|
|
8
7
|
element: NonDeletedExcalidrawElement;
|
|
9
8
|
setAppState: React.Component<any, AppState>["setState"];
|
|
10
9
|
onLinkOpen: ExcalidrawProps["onLinkOpen"];
|
|
10
|
+
setToast: (toast: {
|
|
11
|
+
message: string;
|
|
12
|
+
closable?: boolean;
|
|
13
|
+
duration?: number;
|
|
14
|
+
} | null) => void;
|
|
11
15
|
}) => JSX.Element | null;
|
|
12
|
-
export declare const normalizeLink: (link: string) => string;
|
|
13
|
-
export declare const isLocalLink: (link: string | null) => boolean;
|
|
14
16
|
export declare const actionLink: {
|
|
15
17
|
name: "hyperlink";
|
|
16
18
|
perform: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => false | {
|
|
@@ -18,9 +20,18 @@ export declare const actionLink: {
|
|
|
18
20
|
appState: {
|
|
19
21
|
showHyperlinkPopup: "editor";
|
|
20
22
|
openMenu: null;
|
|
23
|
+
contextMenu: {
|
|
24
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
25
|
+
top: number;
|
|
26
|
+
left: number;
|
|
27
|
+
} | null;
|
|
21
28
|
showWelcomeScreen: boolean;
|
|
22
29
|
isLoading: boolean;
|
|
23
|
-
errorMessage:
|
|
30
|
+
errorMessage: import("react").ReactNode;
|
|
31
|
+
activeEmbeddable: {
|
|
32
|
+
element: NonDeletedExcalidrawElement;
|
|
33
|
+
state: "active" | "hover";
|
|
34
|
+
} | null;
|
|
24
35
|
draggingElement: NonDeletedExcalidrawElement | null;
|
|
25
36
|
resizingElement: NonDeletedExcalidrawElement | null;
|
|
26
37
|
multiElement: import("./types").NonDeleted<import("./types").ExcalidrawLinearElement> | null;
|
|
@@ -28,19 +39,27 @@ export declare const actionLink: {
|
|
|
28
39
|
isBindingEnabled: boolean;
|
|
29
40
|
startBoundElement: import("./types").NonDeleted<import("./types").ExcalidrawBindableElement> | null;
|
|
30
41
|
suggestedBindings: import("./binding").SuggestedBinding[];
|
|
42
|
+
frameToHighlight: import("./types").NonDeleted<import("./types").ExcalidrawFrameElement> | null;
|
|
43
|
+
frameRendering: {
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
name: boolean;
|
|
46
|
+
outline: boolean;
|
|
47
|
+
clip: boolean;
|
|
48
|
+
};
|
|
49
|
+
editingFrame: string | null;
|
|
50
|
+
elementsToHighlight: import("./types").NonDeleted<import("./types").ExcalidrawElement>[] | null;
|
|
31
51
|
editingElement: NonDeletedExcalidrawElement | null;
|
|
32
52
|
editingLinearElement: import("./linearElementEditor").LinearElementEditor | null;
|
|
33
53
|
activeTool: {
|
|
34
|
-
|
|
35
|
-
lastActiveToolBeforeEraser: import("../types").LastActiveToolBeforeEraser;
|
|
54
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
36
55
|
locked: boolean;
|
|
56
|
+
} & ({
|
|
57
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "embeddable" | "image" | "frame" | "freedraw" | "eraser" | "hand";
|
|
37
58
|
customType: null;
|
|
38
59
|
} | {
|
|
39
60
|
type: "custom";
|
|
40
61
|
customType: string;
|
|
41
|
-
|
|
42
|
-
locked: boolean;
|
|
43
|
-
};
|
|
62
|
+
});
|
|
44
63
|
penMode: boolean;
|
|
45
64
|
penDetected: boolean;
|
|
46
65
|
exportBackground: boolean;
|
|
@@ -57,10 +76,9 @@ export declare const actionLink: {
|
|
|
57
76
|
currentItemFontFamily: number;
|
|
58
77
|
currentItemFontSize: number;
|
|
59
78
|
currentItemTextAlign: string;
|
|
60
|
-
currentItemStrokeSharpness: import("./types").StrokeSharpness;
|
|
61
79
|
currentItemStartArrowhead: import("./types").Arrowhead | null;
|
|
62
80
|
currentItemEndArrowhead: import("./types").Arrowhead | null;
|
|
63
|
-
|
|
81
|
+
currentItemRoundness: import("./types").StrokeRoundness;
|
|
64
82
|
viewBackgroundColor: string;
|
|
65
83
|
scrollX: number;
|
|
66
84
|
scrollY: number;
|
|
@@ -72,17 +90,21 @@ export declare const actionLink: {
|
|
|
72
90
|
zoom: Readonly<{
|
|
73
91
|
value: import("../types").NormalizedZoomValue;
|
|
74
92
|
}>;
|
|
75
|
-
openPopup: "
|
|
76
|
-
openSidebar:
|
|
77
|
-
|
|
78
|
-
|
|
93
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
94
|
+
openSidebar: {
|
|
95
|
+
name: string;
|
|
96
|
+
tab?: string | undefined;
|
|
97
|
+
} | null;
|
|
98
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
99
|
+
defaultSidebarDockedPreference: boolean;
|
|
79
100
|
lastPointerDownWith: import("./types").PointerType;
|
|
80
|
-
selectedElementIds: {
|
|
81
|
-
[id: string]:
|
|
82
|
-
}
|
|
101
|
+
selectedElementIds: Readonly<{
|
|
102
|
+
[id: string]: true;
|
|
103
|
+
}>;
|
|
83
104
|
previousSelectedElementIds: {
|
|
84
|
-
[id: string]:
|
|
105
|
+
[id: string]: true;
|
|
85
106
|
};
|
|
107
|
+
selectedElementsAreBeingDragged: boolean;
|
|
86
108
|
shouldCacheIgnoreZoom: boolean;
|
|
87
109
|
toast: {
|
|
88
110
|
message: string;
|
|
@@ -90,7 +112,7 @@ export declare const actionLink: {
|
|
|
90
112
|
duration?: number | undefined;
|
|
91
113
|
} | null;
|
|
92
114
|
zenModeEnabled: boolean;
|
|
93
|
-
theme:
|
|
115
|
+
theme: import("./types").Theme;
|
|
94
116
|
gridSize: number | null;
|
|
95
117
|
viewModeEnabled: boolean;
|
|
96
118
|
selectedGroupIds: {
|
|
@@ -114,6 +136,12 @@ export declare const actionLink: {
|
|
|
114
136
|
};
|
|
115
137
|
pendingImageElementId: string | null;
|
|
116
138
|
selectedLinearElement: import("./linearElementEditor").LinearElementEditor | null;
|
|
139
|
+
snapLines: import("../snapping").SnapLine[];
|
|
140
|
+
originSnapOffset: {
|
|
141
|
+
x: number;
|
|
142
|
+
y: number;
|
|
143
|
+
} | null;
|
|
144
|
+
objectsSnapModeEnabled: boolean;
|
|
117
145
|
};
|
|
118
146
|
commitToHistory: true;
|
|
119
147
|
};
|
|
@@ -122,17 +150,16 @@ export declare const actionLink: {
|
|
|
122
150
|
action: string;
|
|
123
151
|
};
|
|
124
152
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
125
|
-
contextItemLabel: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => "labels.link.edit" | "labels.link.create";
|
|
126
|
-
|
|
127
|
-
PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps
|
|
128
|
-
isInHamburgerMenu: boolean;
|
|
129
|
-
}) => JSX.Element;
|
|
153
|
+
contextItemLabel: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => "labels.link.editEmbed" | "labels.link.edit" | "labels.link.createEmbed" | "labels.link.create";
|
|
154
|
+
predicate: (elements: readonly import("./types").ExcalidrawElement[], appState: AppState) => boolean;
|
|
155
|
+
PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps) => JSX.Element;
|
|
130
156
|
} & {
|
|
131
157
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
132
158
|
};
|
|
133
|
-
export declare const getContextMenuLabel: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState) => "labels.link.edit" | "labels.link.create";
|
|
134
|
-
export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: number, appState:
|
|
135
|
-
export declare const isPointHittingLinkIcon: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number]
|
|
159
|
+
export declare const getContextMenuLabel: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState) => "labels.link.editEmbed" | "labels.link.edit" | "labels.link.createEmbed" | "labels.link.create";
|
|
160
|
+
export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: number, appState: Pick<UIAppState, "zoom">) => [x: number, y: number, width: number, height: number];
|
|
161
|
+
export declare const isPointHittingLinkIcon: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number]) => boolean;
|
|
162
|
+
export declare const isPointHittingLink: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number], isMobile: boolean) => boolean;
|
|
136
163
|
export declare const showHyperlinkTooltip: (element: NonDeletedExcalidrawElement, appState: AppState) => void;
|
|
137
164
|
export declare const hideHyperlinkToolip: () => void;
|
|
138
165
|
export declare const shouldHideLinkPopup: (element: NonDeletedExcalidrawElement, appState: AppState, [clientX, clientY]: readonly [number, number]) => Boolean;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ExcalidrawLinearElement, ExcalidrawBindableElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawElement } from "./types";
|
|
2
2
|
import { AppState } from "../types";
|
|
3
3
|
import Scene from "../scene/Scene";
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type SuggestedBinding = NonDeleted<ExcalidrawBindableElement> | SuggestedPointBinding;
|
|
5
|
+
export type SuggestedPointBinding = [
|
|
6
6
|
NonDeleted<ExcalidrawLinearElement>,
|
|
7
7
|
"start" | "end" | "both",
|
|
8
8
|
NonDeleted<ExcalidrawBindableElement>
|
|
9
9
|
];
|
|
10
|
-
export declare const shouldEnableBindingForPointerEvent: (event: React.PointerEvent<
|
|
10
|
+
export declare const shouldEnableBindingForPointerEvent: (event: React.PointerEvent<HTMLElement>) => boolean;
|
|
11
11
|
export declare const isBindingEnabled: (appState: AppState) => boolean;
|
|
12
12
|
export declare const bindOrUnbindLinearElement: (linearElement: NonDeleted<ExcalidrawLinearElement>, startBindingElement: ExcalidrawBindableElement | null | "keep", endBindingElement: ExcalidrawBindableElement | null | "keep") => void;
|
|
13
13
|
export declare const bindOrUnbindSelectedElements: (elements: NonDeleted<ExcalidrawElement>[]) => void;
|
|
@@ -15,6 +15,7 @@ export declare const maybeBindLinearElement: (linearElement: NonDeleted<Excalidr
|
|
|
15
15
|
x: number;
|
|
16
16
|
y: number;
|
|
17
17
|
}) => void;
|
|
18
|
+
export declare const bindLinearElement: (linearElement: NonDeleted<ExcalidrawLinearElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end") => void;
|
|
18
19
|
export declare const isLinearElementSimpleAndAlreadyBound: (linearElement: NonDeleted<ExcalidrawLinearElement>, alreadyBoundToId: ExcalidrawBindableElement["id"] | undefined, bindableElement: ExcalidrawBindableElement) => boolean;
|
|
19
20
|
export declare const unbindLinearElements: (elements: NonDeleted<ExcalidrawElement>[]) => void;
|
|
20
21
|
export declare const getHoveredElementForBinding: (pointerCoords: {
|