@excalidraw/excalidraw 0.15.2-3ddcc48 → 0.15.2-5302490
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 +19 -0
- package/dist/excalidraw-assets/locales/{es-ES-json-f2467c6a875a9e288756.js → es-ES-json-4f3da97feff33cb00e6d.js} +1 -1
- package/dist/excalidraw-assets/locales/{hi-IN-json-e22f4ad73126c2971850.js → hi-IN-json-3898c9c1216b44476529.js} +1 -1
- package/dist/excalidraw-assets/locales/{id-ID-json-0e69caf5d919807ed234.js → id-ID-json-43d505d7071a0e359681.js} +1 -1
- package/dist/excalidraw-assets/locales/{kk-KZ-json-106d2a41c68f69765668.js → kk-KZ-json-f648362328b839e9313f.js} +1 -1
- package/dist/excalidraw-assets/locales/{pa-IN-json-0fd029451b07248c5194.js → pa-IN-json-d9ee09801ed220840b2b.js} +1 -1
- package/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.js → vendor-ef3c5d81a00ef582b871.js} +2 -2
- package/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.js → vendor-a14cd58fa2db417e42b2.js} +6 -6
- package/dist/excalidraw.development.js +2237 -2116
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +7 -2
- package/types/actions/actionAddToLibrary.d.ts +51 -25
- package/types/actions/actionAlign.d.ts +19 -20
- package/types/actions/actionBoundText.d.ts +38 -20
- package/types/actions/actionCanvas.d.ts +182 -90
- package/types/actions/actionClipboard.d.ts +81 -40
- package/types/actions/actionDeleteSelected.d.ts +45 -22
- package/types/actions/actionDistribute.d.ts +5 -6
- package/types/actions/actionDuplicateSelection.d.ts +0 -1
- package/types/actions/actionElementLock.d.ts +36 -19
- package/types/actions/actionExport.d.ts +161 -80
- package/types/actions/actionFinalize.d.ts +32 -18
- package/types/actions/actionFlip.d.ts +2 -3
- package/types/actions/actionFrame.d.ts +56 -30
- package/types/actions/actionGroup.d.ts +246 -9
- package/types/actions/actionLinearEditor.d.ts +19 -11
- package/types/actions/actionMenu.d.ts +51 -25
- package/types/actions/actionProperties.d.ts +223 -105
- package/types/actions/actionSelectAll.d.ts +121 -2
- package/types/actions/actionStyles.d.ts +17 -9
- package/types/actions/actionToggleGridMode.d.ts +17 -9
- package/types/actions/actionToggleStats.d.ts +17 -9
- package/types/actions/actionToggleViewMode.d.ts +17 -9
- package/types/actions/actionToggleZenMode.d.ts +17 -9
- package/types/actions/types.d.ts +4 -3
- package/types/appState.d.ts +7 -7
- package/types/clipboard.d.ts +1 -0
- package/types/colors.d.ts +9 -9
- package/types/components/Actions.d.ts +2 -2
- package/types/components/App.d.ts +24 -7
- package/types/components/Button.d.ts +0 -1
- package/types/components/Card.d.ts +0 -1
- package/types/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
- package/types/components/DefaultSidebar.d.ts +0 -1
- package/types/components/ExcalidrawLogo.d.ts +15 -0
- package/types/components/EyeDropper.d.ts +0 -1
- package/types/components/HintViewer.d.ts +3 -4
- package/types/components/JSONExportDialog.d.ts +1 -1
- package/types/components/LayerUI.d.ts +4 -2
- package/types/components/LibraryMenuHeaderContent.d.ts +0 -1
- package/types/components/LibraryUnit.d.ts +0 -1
- package/types/components/LoadingMessage.d.ts +0 -1
- package/types/components/MobileMenu.d.ts +4 -3
- package/types/components/Section.d.ts +1 -1
- package/types/components/Sidebar/SidebarTab.d.ts +0 -1
- package/types/components/Sidebar/SidebarTabTrigger.d.ts +0 -1
- package/types/components/Sidebar/SidebarTabTriggers.d.ts +0 -1
- package/types/components/Sidebar/SidebarTabs.d.ts +0 -1
- package/types/components/Stack.d.ts +2 -2
- package/types/components/Trans.d.ts +2 -1
- 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/DropdownMenuTrigger.d.ts +0 -1
- package/types/components/icons.d.ts +1 -0
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -1
- package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -1
- package/types/components/welcome-screen/WelcomeScreen.d.ts +0 -1
- package/types/constants.d.ts +17 -3
- package/types/data/transform.d.ts +71 -0
- package/types/data/url.d.ts +5 -0
- package/types/element/Hyperlink.d.ts +27 -13
- package/types/element/binding.d.ts +1 -0
- package/types/element/collision.d.ts +2 -2
- package/types/element/embeddable.d.ts +153 -0
- package/types/element/linearElementEditor.d.ts +20 -12
- package/types/element/newElement.d.ts +14 -7
- package/types/element/sizeHelpers.d.ts +8 -1
- package/types/element/textElement.d.ts +5 -7
- package/types/element/textWysiwyg.d.ts +1 -1
- package/types/element/transformHandles.d.ts +3 -3
- package/types/element/typeChecks.d.ts +2 -1
- package/types/element/types.d.ts +13 -2
- package/types/frame.d.ts +5 -5
- package/types/groups.d.ts +12 -12
- package/types/history.d.ts +3 -3
- package/types/hooks/useOutsideClick.d.ts +0 -1
- package/types/hooks/useScrollPosition.d.ts +0 -1
- package/types/i18n.d.ts +5 -2
- package/types/keys.d.ts +1 -0
- package/types/packages/excalidraw/example/initialData.d.ts +182 -70
- package/types/packages/excalidraw/index.d.ts +1 -0
- 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 +2 -1
- package/types/renderer/renderElement.d.ts +10 -22
- package/types/renderer/renderScene.d.ts +18 -37
- package/types/scene/Renderer.d.ts +25 -0
- package/types/scene/Scene.d.ts +15 -0
- package/types/scene/Shape.d.ts +12 -0
- package/types/scene/ShapeCache.d.ts +20 -0
- package/types/scene/export.d.ts +1 -0
- package/types/scene/scroll.d.ts +1 -1
- package/types/scene/scrollbars.d.ts +2 -6
- package/types/scene/selection.d.ts +13 -3
- package/types/scene/types.d.ts +57 -24
- package/types/types.d.ts +63 -12
- package/types/utility-types.d.ts +3 -1
- package/types/utils.d.ts +13 -5
- /package/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.js.LICENSE.txt → vendor-ef3c5d81a00ef582b871.js.LICENSE.txt} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{es-ES-json-f2467c6a875a9e288756.d.ts → es-ES-json-4f3da97feff33cb00e6d.d.ts} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{hi-IN-json-e22f4ad73126c2971850.d.ts → hi-IN-json-3898c9c1216b44476529.d.ts} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{id-ID-json-0e69caf5d919807ed234.d.ts → id-ID-json-43d505d7071a0e359681.d.ts} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{kk-KZ-json-106d2a41c68f69765668.d.ts → kk-KZ-json-f648362328b839e9313f.d.ts} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{pa-IN-json-0fd029451b07248c5194.d.ts → pa-IN-json-d9ee09801ed220840b2b.d.ts} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.d.ts → vendor-ef3c5d81a00ef582b871.d.ts} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.d.ts → vendor-a14cd58fa2db417e42b2.d.ts} +0 -0
package/types/scene/types.d.ts
CHANGED
|
@@ -1,39 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
2
|
+
import { Drawable } from "roughjs/bin/core";
|
|
3
|
+
import { ExcalidrawTextElement, NonDeletedExcalidrawElement } from "../element/types";
|
|
4
|
+
import { AppClassProperties, InteractiveCanvasAppState, StaticCanvasAppState } from "../types";
|
|
5
|
+
export type StaticCanvasRenderConfig = {
|
|
6
|
+
imageCache: AppClassProperties["imageCache"];
|
|
7
|
+
renderGrid: boolean;
|
|
8
|
+
/** when exporting the behavior is slightly different (e.g. we can't use
|
|
9
|
+
CSS filters), and we disable render optimizations for best output */
|
|
10
|
+
isExporting: boolean;
|
|
11
|
+
};
|
|
12
|
+
export type InteractiveCanvasRenderConfig = {
|
|
13
|
+
remoteSelectedElementIds: {
|
|
14
|
+
[elementId: string]: string[];
|
|
15
|
+
};
|
|
11
16
|
remotePointerViewportCoords: {
|
|
12
17
|
[id: string]: {
|
|
13
18
|
x: number;
|
|
14
19
|
y: number;
|
|
15
20
|
};
|
|
16
21
|
};
|
|
17
|
-
|
|
18
|
-
[id: string]: string
|
|
19
|
-
};
|
|
20
|
-
remoteSelectedElementIds: {
|
|
21
|
-
[elementId: string]: string[];
|
|
22
|
+
remotePointerUserStates: {
|
|
23
|
+
[id: string]: string;
|
|
22
24
|
};
|
|
23
25
|
remotePointerUsernames: {
|
|
24
26
|
[id: string]: string;
|
|
25
27
|
};
|
|
26
|
-
|
|
27
|
-
[id: string]: string;
|
|
28
|
+
remotePointerButton?: {
|
|
29
|
+
[id: string]: string | undefined;
|
|
28
30
|
};
|
|
29
|
-
imageCache: AppClassProperties["imageCache"];
|
|
30
|
-
renderScrollbars?: boolean;
|
|
31
|
-
renderSelection?: boolean;
|
|
32
|
-
renderGrid?: boolean;
|
|
33
|
-
/** when exporting the behavior is slightly different (e.g. we can't use
|
|
34
|
-
CSS filters), and we disable render optimizations for best output */
|
|
35
|
-
isExporting: boolean;
|
|
36
31
|
selectionColor?: string;
|
|
32
|
+
renderScrollbars?: boolean;
|
|
33
|
+
};
|
|
34
|
+
export type RenderInteractiveSceneCallback = {
|
|
35
|
+
atLeastOneVisibleElement: boolean;
|
|
36
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
37
|
+
scrollBars?: ScrollBars;
|
|
38
|
+
};
|
|
39
|
+
export type StaticSceneRenderConfig = {
|
|
40
|
+
canvas: HTMLCanvasElement;
|
|
41
|
+
rc: RoughCanvas;
|
|
42
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
43
|
+
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
44
|
+
scale: number;
|
|
45
|
+
appState: StaticCanvasAppState;
|
|
46
|
+
renderConfig: StaticCanvasRenderConfig;
|
|
47
|
+
};
|
|
48
|
+
export type InteractiveSceneRenderConfig = {
|
|
49
|
+
canvas: HTMLCanvasElement | null;
|
|
50
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
51
|
+
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
52
|
+
selectedElements: readonly NonDeletedExcalidrawElement[];
|
|
53
|
+
scale: number;
|
|
54
|
+
appState: InteractiveCanvasAppState;
|
|
55
|
+
renderConfig: InteractiveCanvasRenderConfig;
|
|
56
|
+
callback: (data: RenderInteractiveSceneCallback) => void;
|
|
37
57
|
};
|
|
38
58
|
export type SceneScroll = {
|
|
39
59
|
scrollX: number;
|
|
@@ -57,3 +77,16 @@ export type ScrollBars = {
|
|
|
57
77
|
height: number;
|
|
58
78
|
} | null;
|
|
59
79
|
};
|
|
80
|
+
export type ElementShape = Drawable | Drawable[] | null;
|
|
81
|
+
export type ElementShapes = {
|
|
82
|
+
rectangle: Drawable;
|
|
83
|
+
ellipse: Drawable;
|
|
84
|
+
diamond: Drawable;
|
|
85
|
+
embeddable: Drawable;
|
|
86
|
+
freedraw: Drawable | null;
|
|
87
|
+
arrow: Drawable[];
|
|
88
|
+
line: Drawable[];
|
|
89
|
+
text: null;
|
|
90
|
+
image: null;
|
|
91
|
+
frame: null;
|
|
92
|
+
};
|
package/types/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, FileId, ExcalidrawImageElement, Theme, StrokeRoundness, ExcalidrawFrameElement } from "./element/types";
|
|
2
|
+
import { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, FileId, ExcalidrawImageElement, Theme, StrokeRoundness, ExcalidrawFrameElement, ExcalidrawEmbeddableElement } from "./element/types";
|
|
3
3
|
import { SHAPES } from "./shapes";
|
|
4
4
|
import { Point as RoughPoint } from "roughjs/bin/geometry";
|
|
5
5
|
import { LinearElementEditor } from "./element/linearElementEditor";
|
|
@@ -57,7 +57,7 @@ export type BinaryFileData = {
|
|
|
57
57
|
export type BinaryFileMetadata = Omit<BinaryFileData, "dataURL">;
|
|
58
58
|
export type BinaryFiles = Record<ExcalidrawElement["id"], BinaryFileData>;
|
|
59
59
|
export type LastActiveTool = {
|
|
60
|
-
type: typeof SHAPES[number]["value"] | "eraser" | "hand" | "frame";
|
|
60
|
+
type: typeof SHAPES[number]["value"] | "eraser" | "hand" | "frame" | "embeddable";
|
|
61
61
|
customType: null;
|
|
62
62
|
} | {
|
|
63
63
|
type: "custom";
|
|
@@ -65,6 +65,45 @@ export type LastActiveTool = {
|
|
|
65
65
|
} | null;
|
|
66
66
|
export type SidebarName = string;
|
|
67
67
|
export type SidebarTabName = string;
|
|
68
|
+
type _CommonCanvasAppState = {
|
|
69
|
+
zoom: AppState["zoom"];
|
|
70
|
+
scrollX: AppState["scrollX"];
|
|
71
|
+
scrollY: AppState["scrollY"];
|
|
72
|
+
width: AppState["width"];
|
|
73
|
+
height: AppState["height"];
|
|
74
|
+
viewModeEnabled: AppState["viewModeEnabled"];
|
|
75
|
+
editingGroupId: AppState["editingGroupId"];
|
|
76
|
+
selectedElementIds: AppState["selectedElementIds"];
|
|
77
|
+
frameToHighlight: AppState["frameToHighlight"];
|
|
78
|
+
offsetLeft: AppState["offsetLeft"];
|
|
79
|
+
offsetTop: AppState["offsetTop"];
|
|
80
|
+
theme: AppState["theme"];
|
|
81
|
+
pendingImageElementId: AppState["pendingImageElementId"];
|
|
82
|
+
};
|
|
83
|
+
export type StaticCanvasAppState = Readonly<_CommonCanvasAppState & {
|
|
84
|
+
shouldCacheIgnoreZoom: AppState["shouldCacheIgnoreZoom"];
|
|
85
|
+
/** null indicates transparent bg */
|
|
86
|
+
viewBackgroundColor: AppState["viewBackgroundColor"] | null;
|
|
87
|
+
exportScale: AppState["exportScale"];
|
|
88
|
+
selectedElementsAreBeingDragged: AppState["selectedElementsAreBeingDragged"];
|
|
89
|
+
gridSize: AppState["gridSize"];
|
|
90
|
+
frameRendering: AppState["frameRendering"];
|
|
91
|
+
}>;
|
|
92
|
+
export type InteractiveCanvasAppState = Readonly<_CommonCanvasAppState & {
|
|
93
|
+
activeEmbeddable: AppState["activeEmbeddable"];
|
|
94
|
+
editingLinearElement: AppState["editingLinearElement"];
|
|
95
|
+
selectionElement: AppState["selectionElement"];
|
|
96
|
+
selectedGroupIds: AppState["selectedGroupIds"];
|
|
97
|
+
selectedLinearElement: AppState["selectedLinearElement"];
|
|
98
|
+
multiElement: AppState["multiElement"];
|
|
99
|
+
isBindingEnabled: AppState["isBindingEnabled"];
|
|
100
|
+
suggestedBindings: AppState["suggestedBindings"];
|
|
101
|
+
isRotating: AppState["isRotating"];
|
|
102
|
+
elementsToHighlight: AppState["elementsToHighlight"];
|
|
103
|
+
openSidebar: AppState["openSidebar"];
|
|
104
|
+
showHyperlinkPopup: AppState["showHyperlinkPopup"];
|
|
105
|
+
collaborators: AppState["collaborators"];
|
|
106
|
+
}>;
|
|
68
107
|
export type AppState = {
|
|
69
108
|
contextMenu: {
|
|
70
109
|
items: ContextMenuItems;
|
|
@@ -74,6 +113,10 @@ export type AppState = {
|
|
|
74
113
|
showWelcomeScreen: boolean;
|
|
75
114
|
isLoading: boolean;
|
|
76
115
|
errorMessage: React.ReactNode;
|
|
116
|
+
activeEmbeddable: {
|
|
117
|
+
element: NonDeletedExcalidrawElement;
|
|
118
|
+
state: "hover" | "active";
|
|
119
|
+
} | null;
|
|
77
120
|
draggingElement: NonDeletedExcalidrawElement | null;
|
|
78
121
|
resizingElement: NonDeletedExcalidrawElement | null;
|
|
79
122
|
multiElement: NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -82,7 +125,12 @@ export type AppState = {
|
|
|
82
125
|
startBoundElement: NonDeleted<ExcalidrawBindableElement> | null;
|
|
83
126
|
suggestedBindings: SuggestedBinding[];
|
|
84
127
|
frameToHighlight: NonDeleted<ExcalidrawFrameElement> | null;
|
|
85
|
-
|
|
128
|
+
frameRendering: {
|
|
129
|
+
enabled: boolean;
|
|
130
|
+
name: boolean;
|
|
131
|
+
outline: boolean;
|
|
132
|
+
clip: boolean;
|
|
133
|
+
};
|
|
86
134
|
editingFrame: string | null;
|
|
87
135
|
elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
|
|
88
136
|
editingElement: NonDeletedExcalidrawElement | null;
|
|
@@ -95,7 +143,7 @@ export type AppState = {
|
|
|
95
143
|
lastActiveTool: LastActiveTool;
|
|
96
144
|
locked: boolean;
|
|
97
145
|
} & ({
|
|
98
|
-
type: typeof SHAPES[number]["value"] | "eraser" | "hand" | "frame";
|
|
146
|
+
type: typeof SHAPES[number]["value"] | "eraser" | "hand" | "frame" | "embeddable";
|
|
99
147
|
customType: null;
|
|
100
148
|
} | {
|
|
101
149
|
type: "custom";
|
|
@@ -145,11 +193,11 @@ export type AppState = {
|
|
|
145
193
|
*/
|
|
146
194
|
defaultSidebarDockedPreference: boolean;
|
|
147
195
|
lastPointerDownWith: PointerType;
|
|
148
|
-
selectedElementIds: {
|
|
149
|
-
[id: string]:
|
|
150
|
-
}
|
|
196
|
+
selectedElementIds: Readonly<{
|
|
197
|
+
[id: string]: true;
|
|
198
|
+
}>;
|
|
151
199
|
previousSelectedElementIds: {
|
|
152
|
-
[id: string]:
|
|
200
|
+
[id: string]: true;
|
|
153
201
|
};
|
|
154
202
|
selectedElementsAreBeingDragged: boolean;
|
|
155
203
|
shouldCacheIgnoreZoom: boolean;
|
|
@@ -272,6 +320,8 @@ export interface ExcalidrawProps {
|
|
|
272
320
|
onPointerDown?: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState) => void;
|
|
273
321
|
onScrollChange?: (scrollX: number, scrollY: number) => void;
|
|
274
322
|
children?: React.ReactNode;
|
|
323
|
+
validateEmbeddable?: boolean | string[] | RegExp | RegExp[] | ((link: string) => boolean | undefined);
|
|
324
|
+
renderEmbeddable?: (element: NonDeleted<ExcalidrawEmbeddableElement>, appState: AppState) => JSX.Element | null;
|
|
275
325
|
}
|
|
276
326
|
export type SceneData = {
|
|
277
327
|
elements?: ImportedDataState["elements"];
|
|
@@ -286,8 +336,8 @@ export declare enum UserIdleState {
|
|
|
286
336
|
}
|
|
287
337
|
export type ExportOpts = {
|
|
288
338
|
saveFileToDisk?: boolean;
|
|
289
|
-
onExportToBackend?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles, canvas: HTMLCanvasElement
|
|
290
|
-
renderCustomUI?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles, canvas: HTMLCanvasElement
|
|
339
|
+
onExportToBackend?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles, canvas: HTMLCanvasElement) => void;
|
|
340
|
+
renderCustomUI?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles, canvas: HTMLCanvasElement) => JSX.Element;
|
|
291
341
|
};
|
|
292
342
|
type CanvasActions = Partial<{
|
|
293
343
|
changeViewBackgroundColor: boolean;
|
|
@@ -319,7 +369,8 @@ export type AppProps = Merge<ExcalidrawProps, {
|
|
|
319
369
|
* in the app, eg Manager. Factored out into a separate type to keep DRY. */
|
|
320
370
|
export type AppClassProperties = {
|
|
321
371
|
props: AppProps;
|
|
322
|
-
canvas: HTMLCanvasElement
|
|
372
|
+
canvas: HTMLCanvasElement;
|
|
373
|
+
interactiveCanvas: HTMLCanvasElement | null;
|
|
323
374
|
focusContainer(): void;
|
|
324
375
|
library: Library;
|
|
325
376
|
imageCache: Map<FileId, {
|
|
@@ -421,7 +472,7 @@ export type ExcalidrawImperativeAPI = {
|
|
|
421
472
|
* the frames are still interactive in edit mode. As such, this API should be
|
|
422
473
|
* used in conjunction with view mode (props.viewModeEnabled).
|
|
423
474
|
*/
|
|
424
|
-
|
|
475
|
+
updateFrameRendering: InstanceType<typeof App>["updateFrameRendering"];
|
|
425
476
|
};
|
|
426
477
|
export type Device = Readonly<{
|
|
427
478
|
isSmScreen: boolean;
|
package/types/utility-types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export type Mutable<T> = {
|
|
3
2
|
-readonly [P in keyof T]: T[P];
|
|
4
3
|
};
|
|
@@ -20,3 +19,6 @@ export type SignatureType<T> = T extends (...args: infer R) => any ? R : never;
|
|
|
20
19
|
export type CallableType<T extends (...args: any[]) => any> = (...args: SignatureType<T>) => ReturnType<T>;
|
|
21
20
|
export type ForwardRef<T, P = any> = Parameters<CallableType<React.ForwardRefRenderFunction<T, P>>>[1];
|
|
22
21
|
export type ExtractSetType<T extends Set<any>> = T extends Set<infer U> ? U : never;
|
|
22
|
+
export type SameType<T, U> = T extends U ? (U extends T ? true : false) : false;
|
|
23
|
+
export type Assert<T extends true> = T;
|
|
24
|
+
export type NestedKeyOf<T, K = keyof T> = K extends keyof T & (string | number) ? `${K}` | (T[K] extends object ? `${K}.${NestedKeyOf<T[K]>}` : never) : never;
|
package/types/utils.d.ts
CHANGED
|
@@ -81,17 +81,17 @@ export declare const selectNode: (node: Element) => void;
|
|
|
81
81
|
export declare const removeSelection: () => void;
|
|
82
82
|
export declare const distance: (x: number, y: number) => number;
|
|
83
83
|
export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">, data: ({
|
|
84
|
-
type: (typeof SHAPES)[number]["value"] | "eraser" | "hand" | "frame";
|
|
84
|
+
type: (typeof SHAPES)[number]["value"] | "eraser" | "hand" | "frame" | "embeddable";
|
|
85
85
|
} | {
|
|
86
86
|
type: "custom";
|
|
87
87
|
customType: string;
|
|
88
88
|
}) & {
|
|
89
89
|
lastActiveToolBeforeEraser?: LastActiveTool;
|
|
90
90
|
}) => AppState["activeTool"];
|
|
91
|
-
export declare const resetCursor: (
|
|
92
|
-
export declare const setCursor: (
|
|
93
|
-
export declare const setEraserCursor: (
|
|
94
|
-
export declare const setCursorForShape: (
|
|
91
|
+
export declare const resetCursor: (interactiveCanvas: HTMLCanvasElement | null) => void;
|
|
92
|
+
export declare const setCursor: (interactiveCanvas: HTMLCanvasElement | null, cursor: string) => void;
|
|
93
|
+
export declare const setEraserCursor: (interactiveCanvas: HTMLCanvasElement | null, theme: AppState["theme"]) => void;
|
|
94
|
+
export declare const setCursorForShape: (interactiveCanvas: HTMLCanvasElement | null, appState: Pick<AppState, "activeTool" | "theme">) => void;
|
|
95
95
|
export declare const isFullScreen: () => boolean;
|
|
96
96
|
export declare const allowFullScreen: () => Promise<void>;
|
|
97
97
|
export declare const exitFullScreen: () => Promise<void>;
|
|
@@ -190,3 +190,11 @@ export declare const composeEventHandlers: <E>(originalEventHandler?: ((event: E
|
|
|
190
190
|
checkForDefaultPrevented?: boolean | undefined;
|
|
191
191
|
}) => (event: E) => void;
|
|
192
192
|
export declare const isOnlyExportingSingleFrame: (elements: readonly NonDeletedExcalidrawElement[]) => boolean;
|
|
193
|
+
export declare const assertNever: (value: never, message: string, softAssert?: boolean) => never;
|
|
194
|
+
/**
|
|
195
|
+
* Memoizes on values of `opts` object (strict equality).
|
|
196
|
+
*/
|
|
197
|
+
export declare const memoize: <T extends Record<string, any>, R extends unknown>(func: (opts: T) => R) => ((opts: T) => R) & {
|
|
198
|
+
clear: () => void;
|
|
199
|
+
};
|
|
200
|
+
export declare const isRenderThrottlingEnabled: () => boolean;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|