@zsviczian/excalidraw 0.16.1-obsidian-8 → 0.17.0-obsidian-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/excalidraw.development.js +407 -110
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +1 -1
- package/main.js +7 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +33 -6
- package/types/actions/actionBoundText.d.ts +22 -4
- package/types/actions/actionCanvas.d.ts +144 -27
- package/types/actions/actionClipboard.d.ts +77 -14
- package/types/actions/actionDeleteSelected.d.ts +33 -6
- package/types/actions/actionElementLock.d.ts +22 -4
- package/types/actions/actionExport.d.ts +96 -23
- package/types/actions/actionFinalize.d.ts +22 -4
- package/types/actions/actionFrame.d.ts +33 -6
- package/types/actions/actionGroup.d.ts +23 -5
- package/types/actions/actionLinearEditor.d.ts +11 -2
- package/types/actions/actionMenu.d.ts +27 -20
- package/types/actions/actionProperties.d.ts +143 -26
- package/types/actions/actionSelectAll.d.ts +11 -2
- package/types/actions/actionStyles.d.ts +11 -2
- package/types/actions/actionToggleGridMode.d.ts +11 -2
- package/types/actions/actionToggleObjectsSnapMode.d.ts +11 -2
- package/types/actions/actionToggleStats.d.ts +11 -2
- package/types/actions/actionToggleViewMode.d.ts +11 -2
- package/types/actions/actionToggleZenMode.d.ts +11 -2
- package/types/actions/index.d.ts +1 -1
- package/types/appState.d.ts +3 -3
- package/types/components/Actions.d.ts +3 -2
- package/types/components/App.d.ts +43 -13
- package/types/components/Button.d.ts +1 -1
- package/types/components/ImageExportDialog.d.ts +1 -1
- package/types/components/InlineIcon.d.ts +3 -0
- package/types/components/LayerUI.d.ts +6 -2
- package/types/components/MagicButton.d.ts +9 -0
- package/types/components/MagicSettings.d.ts +8 -0
- package/types/components/MobileMenu.d.ts +4 -3
- package/types/components/Paragraph.d.ts +4 -0
- package/types/components/TTDDialog/MermaidToExcalidraw.d.ts +13 -0
- package/types/components/TTDDialog/TTDDialog.d.ts +29 -0
- package/types/components/TTDDialog/TTDDialogInput.d.ts +9 -0
- package/types/components/TTDDialog/TTDDialogOutput.d.ts +7 -0
- package/types/components/TTDDialog/TTDDialogPanel.d.ts +16 -0
- package/types/components/TTDDialog/TTDDialogPanels.d.ts +4 -0
- package/types/components/TTDDialog/TTDDialogTab.d.ts +7 -0
- package/types/components/TTDDialog/TTDDialogTabTrigger.d.ts +8 -0
- package/types/components/TTDDialog/TTDDialogTabTriggers.d.ts +6 -0
- package/types/components/TTDDialog/TTDDialogTabs.d.ts +9 -0
- package/types/components/TTDDialog/TTDDialogTrigger.d.ts +8 -0
- package/types/components/TTDDialog/common.d.ts +33 -0
- package/types/components/TextField.d.ts +16 -0
- package/types/components/dropdownMenu/DropdownMenu.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +12 -0
- package/types/components/icons.d.ts +6 -0
- package/types/components/main-menu/MainMenu.d.ts +6 -0
- package/types/constants.d.ts +30 -3
- package/types/context/tunnels.d.ts +1 -0
- package/types/data/EditorLocalStorage.d.ts +8 -0
- package/types/data/ai/types.d.ts +242 -0
- package/types/data/index.d.ts +10 -2
- package/types/data/magic.d.ts +23 -0
- package/types/data/transform.d.ts +11 -7
- package/types/element/ElementCanvasButtons.d.ts +6 -0
- package/types/element/Hyperlink.d.ts +11 -2
- package/types/element/collision.d.ts +2 -2
- package/types/element/embeddable.d.ts +17 -21
- package/types/element/index.d.ts +3 -4
- package/types/element/linearElementEditor.d.ts +11 -2
- package/types/element/newElement.d.ts +7 -1
- package/types/element/textElement.d.ts +2 -2
- package/types/element/typeChecks.d.ts +10 -7
- package/types/element/types.d.ts +31 -2
- package/types/errors.d.ts +5 -0
- package/types/frame.d.ts +31 -20
- package/types/packages/excalidraw/index.d.ts +5 -3
- package/types/packages/excalidraw/webpack.preact.config.d.ts +170 -0
- package/types/packages/utils.d.ts +5 -4
- package/types/packages/withinBounds.d.ts +2 -2
- package/types/renderer/renderElement.d.ts +6 -1
- package/types/renderer/renderScene.d.ts +10 -5
- package/types/scene/Scene.d.ts +11 -6
- package/types/scene/ShapeCache.d.ts +1 -1
- package/types/scene/comparisons.d.ts +7 -6
- package/types/scene/export.d.ts +6 -5
- package/types/scene/types.d.ts +2 -0
- package/types/shapes.d.ts +1 -1
- package/types/types.d.ts +42 -25
- package/types/utils.d.ts +8 -3
|
@@ -28,7 +28,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
28
28
|
isBindingEnabled: boolean;
|
|
29
29
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
30
30
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
31
|
-
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").
|
|
31
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameLikeElement> | null;
|
|
32
32
|
frameRendering: {
|
|
33
33
|
enabled: boolean;
|
|
34
34
|
name: boolean;
|
|
@@ -79,7 +79,15 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
79
79
|
name: string;
|
|
80
80
|
tab?: string | undefined;
|
|
81
81
|
} | null;
|
|
82
|
-
openDialog:
|
|
82
|
+
openDialog: {
|
|
83
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
84
|
+
} | {
|
|
85
|
+
name: "magicSettings";
|
|
86
|
+
source: "tool" | "generation" | "settings";
|
|
87
|
+
} | {
|
|
88
|
+
name: "ttd";
|
|
89
|
+
tab: string;
|
|
90
|
+
} | null;
|
|
83
91
|
defaultSidebarDockedPreference: boolean;
|
|
84
92
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
85
93
|
selectedElementIds: Readonly<{
|
|
@@ -149,6 +157,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
149
157
|
frameColor: {
|
|
150
158
|
stroke: string;
|
|
151
159
|
fill: string;
|
|
160
|
+
nameColor: string;
|
|
152
161
|
};
|
|
153
162
|
invertBindingBehaviour: boolean;
|
|
154
163
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
@@ -26,7 +26,7 @@ export declare const actionToggleStats: {
|
|
|
26
26
|
isBindingEnabled: boolean;
|
|
27
27
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
28
28
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
29
|
-
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").
|
|
29
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameLikeElement> | null;
|
|
30
30
|
frameRendering: {
|
|
31
31
|
enabled: boolean;
|
|
32
32
|
name: boolean;
|
|
@@ -77,7 +77,15 @@ export declare const actionToggleStats: {
|
|
|
77
77
|
name: string;
|
|
78
78
|
tab?: string | undefined;
|
|
79
79
|
} | null;
|
|
80
|
-
openDialog:
|
|
80
|
+
openDialog: {
|
|
81
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
82
|
+
} | {
|
|
83
|
+
name: "magicSettings";
|
|
84
|
+
source: "tool" | "generation" | "settings";
|
|
85
|
+
} | {
|
|
86
|
+
name: "ttd";
|
|
87
|
+
tab: string;
|
|
88
|
+
} | null;
|
|
81
89
|
defaultSidebarDockedPreference: boolean;
|
|
82
90
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
83
91
|
selectedElementIds: Readonly<{
|
|
@@ -147,6 +155,7 @@ export declare const actionToggleStats: {
|
|
|
147
155
|
frameColor: {
|
|
148
156
|
stroke: string;
|
|
149
157
|
fill: string;
|
|
158
|
+
nameColor: string;
|
|
150
159
|
};
|
|
151
160
|
invertBindingBehaviour: boolean;
|
|
152
161
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
@@ -27,7 +27,7 @@ export declare const actionToggleViewMode: {
|
|
|
27
27
|
isBindingEnabled: boolean;
|
|
28
28
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
29
29
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
30
|
-
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").
|
|
30
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameLikeElement> | null;
|
|
31
31
|
frameRendering: {
|
|
32
32
|
enabled: boolean;
|
|
33
33
|
name: boolean;
|
|
@@ -78,7 +78,15 @@ export declare const actionToggleViewMode: {
|
|
|
78
78
|
name: string;
|
|
79
79
|
tab?: string | undefined;
|
|
80
80
|
} | null;
|
|
81
|
-
openDialog:
|
|
81
|
+
openDialog: {
|
|
82
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
83
|
+
} | {
|
|
84
|
+
name: "magicSettings";
|
|
85
|
+
source: "tool" | "generation" | "settings";
|
|
86
|
+
} | {
|
|
87
|
+
name: "ttd";
|
|
88
|
+
tab: string;
|
|
89
|
+
} | null;
|
|
82
90
|
defaultSidebarDockedPreference: boolean;
|
|
83
91
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
84
92
|
selectedElementIds: Readonly<{
|
|
@@ -148,6 +156,7 @@ export declare const actionToggleViewMode: {
|
|
|
148
156
|
frameColor: {
|
|
149
157
|
stroke: string;
|
|
150
158
|
fill: string;
|
|
159
|
+
nameColor: string;
|
|
151
160
|
};
|
|
152
161
|
invertBindingBehaviour: boolean;
|
|
153
162
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
|
@@ -27,7 +27,7 @@ export declare const actionToggleZenMode: {
|
|
|
27
27
|
isBindingEnabled: boolean;
|
|
28
28
|
startBoundElement: import("../element/types").NonDeleted<import("../element/types").ExcalidrawBindableElement> | null;
|
|
29
29
|
suggestedBindings: import("../element/binding").SuggestedBinding[];
|
|
30
|
-
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").
|
|
30
|
+
frameToHighlight: import("../element/types").NonDeleted<import("../element/types").ExcalidrawFrameLikeElement> | null;
|
|
31
31
|
frameRendering: {
|
|
32
32
|
enabled: boolean;
|
|
33
33
|
name: boolean;
|
|
@@ -78,7 +78,15 @@ export declare const actionToggleZenMode: {
|
|
|
78
78
|
name: string;
|
|
79
79
|
tab?: string | undefined;
|
|
80
80
|
} | null;
|
|
81
|
-
openDialog:
|
|
81
|
+
openDialog: {
|
|
82
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
83
|
+
} | {
|
|
84
|
+
name: "magicSettings";
|
|
85
|
+
source: "tool" | "generation" | "settings";
|
|
86
|
+
} | {
|
|
87
|
+
name: "ttd";
|
|
88
|
+
tab: string;
|
|
89
|
+
} | null;
|
|
82
90
|
defaultSidebarDockedPreference: boolean;
|
|
83
91
|
lastPointerDownWith: import("../element/types").PointerType;
|
|
84
92
|
selectedElementIds: Readonly<{
|
|
@@ -148,6 +156,7 @@ export declare const actionToggleZenMode: {
|
|
|
148
156
|
frameColor: {
|
|
149
157
|
stroke: string;
|
|
150
158
|
fill: string;
|
|
159
|
+
nameColor: string;
|
|
151
160
|
};
|
|
152
161
|
invertBindingBehaviour: boolean;
|
|
153
162
|
selectedLinearElement: import("../element/linearElementEditor").LinearElementEditor | null;
|
package/types/actions/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { actionChangeViewBackgroundColor, actionClearCanvas, actionZoomIn, actio
|
|
|
7
7
|
export { actionFinalize } from "./actionFinalize";
|
|
8
8
|
export { actionChangeProjectName, actionChangeExportBackground, actionSaveToActiveFile, actionSaveFileToDisk, actionLoadScene, } from "./actionExport";
|
|
9
9
|
export { actionCopyStyles, actionPasteStyles } from "./actionStyles";
|
|
10
|
-
export { actionToggleCanvasMenu, actionToggleEditMenu,
|
|
10
|
+
export { actionToggleCanvasMenu, actionToggleEditMenu, actionShortcuts, } from "./actionMenu";
|
|
11
11
|
export { actionGroup, actionUngroup } from "./actionGroup";
|
|
12
12
|
export { actionGoToCollaborator } from "./actionNavigate";
|
|
13
13
|
export { actionAddToLibrary } from "./actionAddToLibrary";
|
package/types/appState.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AppState, NormalizedZoomValue } from "./types";
|
|
2
2
|
export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
3
3
|
export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
|
|
4
|
+
theme?: import("./element/types").Theme | undefined;
|
|
5
|
+
showWelcomeScreen?: boolean | undefined;
|
|
4
6
|
activeTool?: ({
|
|
5
7
|
lastActiveTool: import("./types").ActiveTool | null;
|
|
6
8
|
locked: boolean;
|
|
7
9
|
} & import("./types").ActiveTool) | undefined;
|
|
8
|
-
name?: string | undefined;
|
|
9
|
-
showWelcomeScreen?: boolean | undefined;
|
|
10
10
|
penMode?: boolean | undefined;
|
|
11
11
|
penDetected?: boolean | undefined;
|
|
12
12
|
exportBackground?: boolean | undefined;
|
|
@@ -31,6 +31,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
31
31
|
scrollY?: number | undefined;
|
|
32
32
|
cursorButton?: "up" | "down" | undefined;
|
|
33
33
|
scrolledOutside?: boolean | undefined;
|
|
34
|
+
name?: string | undefined;
|
|
34
35
|
zoom?: Readonly<{
|
|
35
36
|
value: NormalizedZoomValue;
|
|
36
37
|
}> | undefined;
|
|
@@ -49,7 +50,6 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
49
50
|
} | undefined;
|
|
50
51
|
shouldCacheIgnoreZoom?: boolean | undefined;
|
|
51
52
|
zenModeEnabled?: boolean | undefined;
|
|
52
|
-
theme?: import("./element/types").Theme | undefined;
|
|
53
53
|
gridSize?: number | null | undefined;
|
|
54
54
|
selectedGroupIds?: {
|
|
55
55
|
[groupId: string]: boolean;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { ActionManager } from "../actions/manager";
|
|
2
2
|
import { ExcalidrawElement } from "../element/types";
|
|
3
|
-
import { AppClassProperties, UIAppState, Zoom } from "../types";
|
|
3
|
+
import { AppClassProperties, AppProps, UIAppState, Zoom } from "../types";
|
|
4
4
|
import "./Actions.scss";
|
|
5
5
|
export declare const SelectedShapeActions: ({ appState, elements, renderAction, }: {
|
|
6
6
|
appState: UIAppState;
|
|
7
7
|
elements: readonly ExcalidrawElement[];
|
|
8
8
|
renderAction: ActionManager["renderAction"];
|
|
9
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export declare const ShapesSwitcher: ({ activeTool, appState, app, }: {
|
|
10
|
+
export declare const ShapesSwitcher: ({ activeTool, appState, app, UIOptions, }: {
|
|
11
11
|
activeTool: UIAppState["activeTool"];
|
|
12
12
|
appState: UIAppState;
|
|
13
13
|
app: AppClassProperties;
|
|
14
|
+
UIOptions: AppProps["UIOptions"];
|
|
14
15
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export declare const ZoomActions: ({ renderAction, zoom, trayMode, }: {
|
|
16
17
|
renderAction: ActionManager["renderAction"];
|
|
@@ -2,8 +2,9 @@ import React from "react";
|
|
|
2
2
|
import { RoughCanvas } from "roughjs/bin/canvas";
|
|
3
3
|
import { ActionManager } from "../actions/manager";
|
|
4
4
|
import { EXPORT_IMAGE_TYPES } from "../constants";
|
|
5
|
+
import { ExportedElements } from "../data";
|
|
5
6
|
import { LinearElementEditor } from "../element/linearElementEditor";
|
|
6
|
-
import { ExcalidrawElement, ExcalidrawLinearElement, NonDeleted, NonDeletedExcalidrawElement } from "../element/types";
|
|
7
|
+
import { ExcalidrawElement, ExcalidrawLinearElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawFrameLikeElement, ExcalidrawIframeElement } from "../element/types";
|
|
7
8
|
import History from "../history";
|
|
8
9
|
import Scene from "../scene/Scene";
|
|
9
10
|
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType } from "../types";
|
|
@@ -19,11 +20,15 @@ export declare const ExcalidrawContainerContext: React.Context<{
|
|
|
19
20
|
export declare const useApp: () => AppClassProperties;
|
|
20
21
|
export declare const useAppProps: () => AppProps;
|
|
21
22
|
export declare const useDevice: () => Readonly<{
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
viewport: {
|
|
24
|
+
isMobile: boolean;
|
|
25
|
+
isLandscape: boolean;
|
|
26
|
+
};
|
|
27
|
+
editor: {
|
|
28
|
+
isMobile: boolean;
|
|
29
|
+
canFitSidebar: boolean;
|
|
30
|
+
};
|
|
24
31
|
isTouchScreen: boolean;
|
|
25
|
-
canDeviceFitSidebar: boolean;
|
|
26
|
-
isLandscape: boolean;
|
|
27
32
|
}>;
|
|
28
33
|
export declare const useExcalidrawContainer: () => {
|
|
29
34
|
container: HTMLDivElement | null;
|
|
@@ -40,9 +45,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
40
45
|
unmounted: boolean;
|
|
41
46
|
actionManager: ActionManager;
|
|
42
47
|
device: Device;
|
|
43
|
-
detachIsMobileMqHandler?: () => void;
|
|
44
48
|
private excalidrawContainerRef;
|
|
45
|
-
static defaultProps: Partial<AppProps>;
|
|
46
49
|
scene: Scene;
|
|
47
50
|
renderer: Renderer;
|
|
48
51
|
private fonts;
|
|
@@ -208,10 +211,10 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
208
211
|
}>, event: PointerEvent]>;
|
|
209
212
|
constructor(props: AppProps);
|
|
210
213
|
private onWindowMessage;
|
|
211
|
-
private
|
|
214
|
+
private cacheEmbeddableRef;
|
|
212
215
|
private getHTMLIFrameElement;
|
|
213
216
|
private handleEmbeddableCenterClick;
|
|
214
|
-
private
|
|
217
|
+
private isIframeLikeElementCenter;
|
|
215
218
|
private updateEmbeddables;
|
|
216
219
|
private renderEmbeddables;
|
|
217
220
|
private getFrameNameDOMId;
|
|
@@ -222,7 +225,19 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
222
225
|
getSceneElementsIncludingDeleted: () => readonly ExcalidrawElement[];
|
|
223
226
|
getSceneElements: () => readonly NonDeletedExcalidrawElement[];
|
|
224
227
|
onInsertElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
225
|
-
onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements:
|
|
228
|
+
onExportImage: (type: keyof typeof EXPORT_IMAGE_TYPES, elements: ExportedElements, opts: {
|
|
229
|
+
exportingFrame: ExcalidrawFrameLikeElement | null;
|
|
230
|
+
}) => Promise<void>;
|
|
231
|
+
private magicGenerations;
|
|
232
|
+
private updateMagicGeneration;
|
|
233
|
+
private getTextFromElements;
|
|
234
|
+
private onMagicFrameGenerate;
|
|
235
|
+
private onIframeSrcCopy;
|
|
236
|
+
private OPENAI_KEY;
|
|
237
|
+
private OPENAI_KEY_IS_PERSISTED;
|
|
238
|
+
private onOpenAIKeyChange;
|
|
239
|
+
private onMagicSettingsConfirm;
|
|
240
|
+
onMagicframeToolSelect: () => void;
|
|
226
241
|
private openEyeDropper;
|
|
227
242
|
private syncActionResult;
|
|
228
243
|
private onBlur;
|
|
@@ -235,11 +250,15 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
235
250
|
*/
|
|
236
251
|
private resetScene;
|
|
237
252
|
private initializeScene;
|
|
238
|
-
private
|
|
253
|
+
private isMobileBreakpoint;
|
|
254
|
+
private refreshViewportBreakpoints;
|
|
255
|
+
private refreshEditorBreakpoints;
|
|
239
256
|
componentDidMount(): Promise<void>;
|
|
240
257
|
componentWillUnmount(): void;
|
|
241
258
|
private onResize;
|
|
242
259
|
private removeEventListeners;
|
|
260
|
+
/** generally invoked only if fullscreen was invoked programmatically */
|
|
261
|
+
private onFullscreenChange;
|
|
243
262
|
private addEventListeners;
|
|
244
263
|
componentDidUpdate(prevProps: AppProps, prevState: AppState): void;
|
|
245
264
|
private renderInteractiveSceneCallback;
|
|
@@ -271,7 +290,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
271
290
|
outline: boolean;
|
|
272
291
|
clip: boolean;
|
|
273
292
|
}> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
|
|
274
|
-
togglePenMode: (force
|
|
293
|
+
togglePenMode: (force: boolean | null) => void;
|
|
275
294
|
onHandToolToggle: () => void;
|
|
276
295
|
/**
|
|
277
296
|
* Zooms on canvas viewport center
|
|
@@ -333,6 +352,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
333
352
|
private onKeyDown;
|
|
334
353
|
private onWheel;
|
|
335
354
|
private onKeyUp;
|
|
355
|
+
private isToolSupported;
|
|
336
356
|
setActiveTool: (tool: (({
|
|
337
357
|
type: Exclude<ToolType, "image">;
|
|
338
358
|
} | {
|
|
@@ -389,7 +409,17 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
389
409
|
private isHittingCommonBoundingBoxOfSelectedElements;
|
|
390
410
|
private handleTextOnPointerDown;
|
|
391
411
|
private handleFreeDrawElementOnPointerDown;
|
|
392
|
-
|
|
412
|
+
insertIframeElement: ({ sceneX, sceneY, width, height, }: {
|
|
413
|
+
sceneX: number;
|
|
414
|
+
sceneY: number;
|
|
415
|
+
width: number;
|
|
416
|
+
height: number;
|
|
417
|
+
}) => NonDeleted<ExcalidrawIframeElement>;
|
|
418
|
+
insertEmbeddableElement: ({ sceneX, sceneY, link, }: {
|
|
419
|
+
sceneX: number;
|
|
420
|
+
sceneY: number;
|
|
421
|
+
link: string;
|
|
422
|
+
}) => NonDeleted<import("../element/types").ExcalidrawEmbeddableElement> | undefined;
|
|
393
423
|
private createImageElement;
|
|
394
424
|
private handleLinearElementOnPointerDown;
|
|
395
425
|
private getCurrentItemRoundness;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./Button.scss";
|
|
2
|
-
interface ButtonProps extends React.
|
|
2
|
+
interface ButtonProps extends React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> {
|
|
3
3
|
type?: "button" | "submit" | "reset";
|
|
4
4
|
onSelect: () => any;
|
|
5
5
|
/** whether button is in active state */
|
|
@@ -10,4 +10,4 @@ export declare const ImageExportDialog: ({ elements, appState, files, actionMana
|
|
|
10
10
|
actionManager: ActionManager;
|
|
11
11
|
onExportImage: AppClassProperties["onExportImage"];
|
|
12
12
|
onCloseRequest: () => void;
|
|
13
|
-
}) => import("react/jsx-runtime").JSX.Element
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,7 +14,7 @@ interface LayerUIProps {
|
|
|
14
14
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
15
15
|
onLockToggle: () => void;
|
|
16
16
|
onHandToolToggle: () => void;
|
|
17
|
-
onPenModeToggle:
|
|
17
|
+
onPenModeToggle: AppClassProperties["togglePenMode"];
|
|
18
18
|
showExitZenModeBtn: boolean;
|
|
19
19
|
langCode: Language["code"];
|
|
20
20
|
renderTopRightUI?: ExcalidrawProps["renderTopRightUI"];
|
|
@@ -25,6 +25,10 @@ interface LayerUIProps {
|
|
|
25
25
|
children?: React.ReactNode;
|
|
26
26
|
app: AppClassProperties;
|
|
27
27
|
isCollaborating: boolean;
|
|
28
|
+
openAIKey: string | null;
|
|
29
|
+
isOpenAIKeyPersisted: boolean;
|
|
30
|
+
onOpenAIAPIKeyChange: (apiKey: string, shouldPersist: boolean) => void;
|
|
31
|
+
onMagicSettingsConfirm: (apiKey: string, shouldPersist: boolean, source: "tool" | "generation" | "settings") => void;
|
|
28
32
|
}
|
|
29
|
-
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onExportImage, renderWelcomeScreen, children, app, isCollaborating, }: LayerUIProps) => import("react/jsx-runtime").JSX.Element>;
|
|
33
|
+
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onExportImage, renderWelcomeScreen, children, app, isCollaborating, openAIKey, isOpenAIKeyPersisted, onOpenAIAPIKeyChange, onMagicSettingsConfirm, }: LayerUIProps) => import("react/jsx-runtime").JSX.Element>;
|
|
30
34
|
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./MagicSettings.scss";
|
|
2
|
+
export declare const MagicSettings: (props: {
|
|
3
|
+
openAIKey: string | null;
|
|
4
|
+
isPersisted: boolean;
|
|
5
|
+
onChange: (key: string, shouldPersist: boolean) => void;
|
|
6
|
+
onConfirm: (key: string, shouldPersist: boolean) => void;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AppClassProperties, AppState, Device, ExcalidrawProps, UIAppState } from "../types";
|
|
2
|
+
import { AppClassProperties, AppProps, AppState, Device, ExcalidrawProps, UIAppState } from "../types";
|
|
3
3
|
import { ActionManager } from "../actions/manager";
|
|
4
4
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
type MobileMenuProps = {
|
|
@@ -11,13 +11,14 @@ type MobileMenuProps = {
|
|
|
11
11
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
12
12
|
onLockToggle: () => void;
|
|
13
13
|
onHandToolToggle: () => void;
|
|
14
|
-
onPenModeToggle:
|
|
14
|
+
onPenModeToggle: AppClassProperties["togglePenMode"];
|
|
15
15
|
renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
16
16
|
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
17
17
|
renderSidebars: () => JSX.Element | null;
|
|
18
18
|
device: Device;
|
|
19
19
|
renderWelcomeScreen: boolean;
|
|
20
|
+
UIOptions: AppProps["UIOptions"];
|
|
20
21
|
app: AppClassProperties;
|
|
21
22
|
};
|
|
22
|
-
export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle, renderTopRightUI, renderCustomStats, renderSidebars, device, renderWelcomeScreen, app, }: MobileMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle, renderTopRightUI, renderCustomStats, renderSidebars, device, renderWelcomeScreen, UIOptions, app, }: MobileMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
24
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ExcalidrawElement, NonDeletedExcalidrawElement } from "../../element/types";
|
|
2
|
+
import "./MermaidToExcalidraw.scss";
|
|
3
|
+
import { MermaidToExcalidrawLibProps } from "./common";
|
|
4
|
+
import { MermaidOptions } from "@zsviczian/mermaid-to-excalidraw";
|
|
5
|
+
declare const MermaidToExcalidraw: ({ mermaidToExcalidrawLib, selectedElements, }: {
|
|
6
|
+
mermaidToExcalidrawLib: MermaidToExcalidrawLibProps;
|
|
7
|
+
selectedElements: readonly NonDeletedExcalidrawElement[];
|
|
8
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default MermaidToExcalidraw;
|
|
10
|
+
export declare const mermaidToExcalidraw: (mermaidDefinition: string, opts?: MermaidOptions, forceSVG?: boolean) => Promise<{
|
|
11
|
+
elements: ExcalidrawElement[];
|
|
12
|
+
files: any;
|
|
13
|
+
} | undefined>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "./TTDDialog.scss";
|
|
2
|
+
type OnTestSubmitRetValue = {
|
|
3
|
+
rateLimit?: number | null;
|
|
4
|
+
rateLimitRemaining?: number | null;
|
|
5
|
+
} & ({
|
|
6
|
+
generatedResponse: string | undefined;
|
|
7
|
+
error?: null | undefined;
|
|
8
|
+
} | {
|
|
9
|
+
error: Error;
|
|
10
|
+
generatedResponse?: null | undefined;
|
|
11
|
+
});
|
|
12
|
+
export declare const TTDDialog: (props: {
|
|
13
|
+
onTextSubmit(value: string): Promise<OnTestSubmitRetValue>;
|
|
14
|
+
} | {
|
|
15
|
+
__fallback: true;
|
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
17
|
+
/**
|
|
18
|
+
* Text to diagram (TTD) dialog
|
|
19
|
+
*/
|
|
20
|
+
export declare const TTDDialogBase: import("react").FC<({
|
|
21
|
+
tab: string;
|
|
22
|
+
} & ({
|
|
23
|
+
onTextSubmit(value: string): Promise<OnTestSubmitRetValue>;
|
|
24
|
+
} | {
|
|
25
|
+
__fallback: true;
|
|
26
|
+
})) & {
|
|
27
|
+
__fallback?: boolean | undefined;
|
|
28
|
+
}>;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ChangeEventHandler } from "react";
|
|
2
|
+
interface TTDDialogInputProps {
|
|
3
|
+
input: string;
|
|
4
|
+
placeholder: string;
|
|
5
|
+
onChange: ChangeEventHandler<HTMLTextAreaElement>;
|
|
6
|
+
onKeyboardSubmit?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const TTDDialogInput: ({ input, placeholder, onChange, onKeyboardSubmit, }: TTDDialogInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface TTDDialogOutputProps {
|
|
2
|
+
error: Error | null;
|
|
3
|
+
canvasRef: React.RefObject<HTMLDivElement>;
|
|
4
|
+
loaded: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const TTDDialogOutput: ({ error, canvasRef, loaded, }: TTDDialogOutputProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
interface TTDDialogPanelProps {
|
|
3
|
+
label: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
panelAction?: {
|
|
6
|
+
label: string;
|
|
7
|
+
action: () => void;
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
panelActionDisabled?: boolean;
|
|
11
|
+
onTextSubmitInProgess?: boolean;
|
|
12
|
+
renderTopRight?: () => ReactNode;
|
|
13
|
+
renderBottomRight?: () => ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare const TTDDialogPanel: ({ label, children, panelAction, panelActionDisabled, onTextSubmitInProgess, renderTopRight, renderBottomRight, }: TTDDialogPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const TTDDialogTabTrigger: {
|
|
2
|
+
({ children, tab, onSelect, ...rest }: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
tab: string;
|
|
5
|
+
onSelect?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
6
|
+
} & Omit<import("react").HTMLAttributes<HTMLButtonElement>, "onSelect">): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MermaidOptions } from "@zsviczian/mermaid-to-excalidraw";
|
|
2
|
+
import { MermaidToExcalidrawResult } from "@zsviczian/mermaid-to-excalidraw/dist/interfaces";
|
|
3
|
+
import { NonDeletedExcalidrawElement } from "../../element/types";
|
|
4
|
+
import { AppClassProperties, BinaryFiles } from "../../types";
|
|
5
|
+
export interface MermaidToExcalidrawLibProps {
|
|
6
|
+
loaded: boolean;
|
|
7
|
+
api: Promise<{
|
|
8
|
+
parseMermaidToExcalidraw: (definition: string, options: MermaidOptions) => Promise<MermaidToExcalidrawResult>;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
interface ConvertMermaidToExcalidrawFormatProps {
|
|
12
|
+
canvasRef: React.RefObject<HTMLDivElement>;
|
|
13
|
+
mermaidToExcalidrawLib: MermaidToExcalidrawLibProps;
|
|
14
|
+
text: string;
|
|
15
|
+
setError: (error: Error | null) => void;
|
|
16
|
+
data: React.MutableRefObject<{
|
|
17
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
18
|
+
files: BinaryFiles | null;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
export declare const convertMermaidToExcalidraw: ({ canvasRef, mermaidToExcalidrawLib, text, setError, data, }: ConvertMermaidToExcalidrawFormatProps) => Promise<void>;
|
|
22
|
+
export declare const LOCAL_STORAGE_KEY_MERMAID_TO_EXCALIDRAW = "mermaid-to-excalidraw";
|
|
23
|
+
export declare const saveMermaidDataToStorage: (data: string) => void;
|
|
24
|
+
export declare const insertToEditor: ({ app, data, text, shouldSaveMermaidDataToStorage, }: {
|
|
25
|
+
app: AppClassProperties;
|
|
26
|
+
data: React.MutableRefObject<{
|
|
27
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
28
|
+
files: BinaryFiles | null;
|
|
29
|
+
}>;
|
|
30
|
+
text?: string | undefined;
|
|
31
|
+
shouldSaveMermaidDataToStorage?: boolean | undefined;
|
|
32
|
+
}) => void;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { KeyboardEvent } from "react";
|
|
2
|
+
import "./TextField.scss";
|
|
3
|
+
type TextFieldProps = {
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange?: (value: string) => void;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
selectOnRender?: boolean;
|
|
11
|
+
label?: string;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
isRedacted?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
16
|
+
export {};
|
|
@@ -34,6 +34,12 @@ declare const DropdownMenu: {
|
|
|
34
34
|
className?: string | undefined;
|
|
35
35
|
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): import("react/jsx-runtime").JSX.Element;
|
|
36
36
|
displayName: string;
|
|
37
|
+
Badge: {
|
|
38
|
+
({ children, }: {
|
|
39
|
+
children: React.ReactNode;
|
|
40
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
displayName: string;
|
|
42
|
+
};
|
|
37
43
|
};
|
|
38
44
|
ItemLink: {
|
|
39
45
|
({ icon, shortcut, href, children, onSelect, className, selected, ...rest }: {
|
|
@@ -9,5 +9,17 @@ declare const DropdownMenuItem: {
|
|
|
9
9
|
className?: string | undefined;
|
|
10
10
|
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
|
+
Badge: {
|
|
13
|
+
({ children, }: {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const DropDownMenuItemBadge: {
|
|
20
|
+
({ children, }: {
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
12
24
|
};
|
|
13
25
|
export default DropdownMenuItem;
|