@dwelle/excalidraw 0.4.0-9db4535 → 0.4.0-9fa56da
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 +255 -1
- package/README.md +4 -0
- 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 +2123 -1783
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +7 -2
- package/types/actions/actionAddToLibrary.d.ts +84 -43
- package/types/actions/actionAlign.d.ts +33 -28
- package/types/actions/actionBoundText.d.ts +60 -32
- package/types/actions/actionCanvas.d.ts +436 -164
- package/types/actions/actionClipboard.d.ts +140 -74
- package/types/actions/actionDeleteSelected.d.ts +80 -42
- package/types/actions/actionDistribute.d.ts +11 -12
- package/types/actions/actionDuplicateSelection.d.ts +2 -3
- package/types/actions/actionElementLock.d.ts +58 -30
- package/types/actions/actionExport.d.ts +303 -177
- package/types/actions/actionFinalize.d.ts +56 -32
- package/types/actions/actionFlip.d.ts +8 -9
- package/types/actions/actionFrame.d.ts +423 -0
- package/types/actions/actionGroup.d.ts +250 -13
- package/types/actions/actionLinearEditor.d.ts +30 -17
- package/types/actions/actionMenu.d.ts +87 -47
- package/types/actions/actionNavigate.d.ts +1 -1
- package/types/actions/actionProperties.d.ts +370 -187
- package/types/actions/actionSelectAll.d.ts +123 -4
- package/types/actions/actionStyles.d.ts +32 -19
- package/types/actions/actionToggleGridMode.d.ts +30 -17
- package/types/actions/actionToggleObjectsSnapMode.d.ts +137 -0
- package/types/actions/actionToggleStats.d.ts +30 -17
- package/types/actions/actionToggleViewMode.d.ts +30 -17
- package/types/actions/actionToggleZenMode.d.ts +30 -17
- package/types/actions/actionZindex.d.ts +12 -12
- package/types/actions/index.d.ts +1 -0
- package/types/actions/shortcuts.d.ts +1 -1
- package/types/actions/types.d.ts +4 -3
- package/types/appState.d.ts +10 -15
- package/types/clients.d.ts +1 -5
- package/types/clipboard.d.ts +1 -0
- package/types/colors.d.ts +9 -9
- package/types/components/Actions.d.ts +4 -5
- package/types/components/App.d.ts +61 -28
- package/types/components/Avatar.d.ts +0 -1
- package/types/components/Button.d.ts +0 -1
- package/types/components/Card.d.ts +0 -1
- package/types/components/ColorPicker/ColorInput.d.ts +3 -1
- package/types/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
- package/types/components/DefaultSidebar.d.ts +0 -1
- package/types/components/Dialog.d.ts +2 -1
- package/types/components/ExcalidrawLogo.d.ts +15 -0
- package/types/components/EyeDropper.d.ts +18 -8
- package/types/components/FilledButton.d.ts +2 -1
- package/types/components/HintViewer.d.ts +3 -4
- package/types/components/JSONExportDialog.d.ts +1 -1
- package/types/components/LaserTool/LaserPathManager.d.ts +28 -0
- package/types/components/LaserTool/LaserPointerButton.d.ts +10 -0
- package/types/components/LaserTool/LaserTool.d.ts +7 -0
- package/types/components/LayerUI.d.ts +6 -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/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/Section.d.ts +1 -1
- package/types/components/Sidebar/Sidebar.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/ToolButton.d.ts +2 -1
- 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/DropdownMenu.d.ts +9 -5
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +2 -1
- package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -1
- package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +2 -1
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -2
- package/types/components/dropdownMenu/common.d.ts +1 -1
- package/types/components/icons.d.ts +6 -0
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -1
- package/types/components/main-menu/MainMenu.d.ts +9 -5
- 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 +35 -3
- package/types/context/tunnels.d.ts +1 -0
- package/types/data/transform.d.ts +71 -0
- package/types/data/url.d.ts +7 -0
- package/types/element/Hyperlink.d.ts +40 -23
- package/types/element/binding.d.ts +2 -1
- package/types/element/bounds.d.ts +30 -6
- package/types/element/collision.d.ts +7 -7
- package/types/element/dragElements.d.ts +12 -2
- package/types/element/embeddable.d.ts +153 -0
- package/types/element/index.d.ts +3 -2
- package/types/element/linearElementEditor.d.ts +33 -20
- package/types/element/newElement.d.ts +15 -6
- package/types/element/resizeElements.d.ts +2 -2
- 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 +10 -3
- package/types/element/typeChecks.d.ts +3 -1
- package/types/element/types.d.ts +19 -3
- package/types/frame.d.ts +40 -0
- package/types/groups.d.ts +15 -11
- 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/hooks/useStable.d.ts +1 -0
- package/types/i18n.d.ts +5 -2
- package/types/keys.d.ts +4 -0
- package/types/math.d.ts +3 -0
- package/types/packages/excalidraw/example/initialData.d.ts +182 -64
- package/types/packages/excalidraw/index.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 +4 -1
- package/types/renderer/renderElement.d.ts +11 -22
- package/types/renderer/renderScene.d.ts +19 -27
- package/types/renderer/renderSnaps.d.ts +2 -0
- package/types/renderer/roundRect.d.ts +1 -1
- package/types/scene/Renderer.d.ts +25 -0
- package/types/scene/Scene.d.ts +23 -1
- package/types/scene/Shape.d.ts +12 -0
- package/types/scene/ShapeCache.d.ts +20 -0
- package/types/scene/export.d.ts +35 -9
- package/types/scene/scroll.d.ts +1 -1
- package/types/scene/scrollbars.d.ts +2 -6
- package/types/scene/selection.d.ts +26 -5
- package/types/scene/types.d.ts +66 -31
- package/types/snapping.d.ts +108 -0
- package/types/types.d.ts +130 -25
- package/types/utility-types.d.ts +3 -1
- package/types/utils.d.ts +60 -23
- package/types/zindex.d.ts +4 -4
- /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
|
@@ -6,8 +6,10 @@ import { LinearElementEditor } from "../element/linearElementEditor";
|
|
|
6
6
|
import { ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement } from "../element/types";
|
|
7
7
|
import History from "../history";
|
|
8
8
|
import Scene from "../scene/Scene";
|
|
9
|
-
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, SidebarName, SidebarTabName } from "../types";
|
|
9
|
+
import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, Device, FrameNameBoundsCache, SidebarName, SidebarTabName, ToolType } from "../types";
|
|
10
10
|
import { FileSystemHandle } from "../data/filesystem";
|
|
11
|
+
import { Renderer } from "../scene/Renderer";
|
|
12
|
+
import { LaserPathManager } from "./LaserTool/LaserPathManager";
|
|
11
13
|
import { Emitter } from "../emitter";
|
|
12
14
|
export declare const ExcalidrawContainerContext: React.Context<{
|
|
13
15
|
container: HTMLDivElement | null;
|
|
@@ -32,7 +34,8 @@ export declare const useExcalidrawSetAppState: () => <K extends keyof AppState>(
|
|
|
32
34
|
export declare const useExcalidrawActionManager: () => ActionManager;
|
|
33
35
|
declare class App extends React.Component<AppProps, AppState> {
|
|
34
36
|
canvas: AppClassProperties["canvas"];
|
|
35
|
-
|
|
37
|
+
interactiveCanvas: AppClassProperties["interactiveCanvas"];
|
|
38
|
+
rc: RoughCanvas;
|
|
36
39
|
unmounted: boolean;
|
|
37
40
|
actionManager: ActionManager;
|
|
38
41
|
device: Device;
|
|
@@ -40,6 +43,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
40
43
|
private excalidrawContainerRef;
|
|
41
44
|
static defaultProps: Partial<AppProps>;
|
|
42
45
|
scene: Scene;
|
|
46
|
+
renderer: Renderer;
|
|
43
47
|
private fonts;
|
|
44
48
|
private resizeObserver;
|
|
45
49
|
private nearestScrollableContainer;
|
|
@@ -50,24 +54,20 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
50
54
|
private excalidrawContainerValue;
|
|
51
55
|
files: BinaryFiles;
|
|
52
56
|
imageCache: AppClassProperties["imageCache"];
|
|
57
|
+
private iFrameRefs;
|
|
53
58
|
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
|
|
60
|
+
lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
56
61
|
lastViewportPosition: {
|
|
57
62
|
x: number;
|
|
58
63
|
y: number;
|
|
59
64
|
};
|
|
65
|
+
laserPathManager: LaserPathManager;
|
|
60
66
|
onChangeEmitter: Emitter<[elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles]>;
|
|
61
67
|
onPointerDownEmitter: Emitter<[activeTool: {
|
|
62
|
-
lastActiveTool: import("../types").
|
|
68
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
63
69
|
locked: boolean;
|
|
64
|
-
} & ({
|
|
65
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
66
|
-
customType: null;
|
|
67
|
-
} | {
|
|
68
|
-
type: "custom";
|
|
69
|
-
customType: string;
|
|
70
|
-
}), pointerDownState: Readonly<{
|
|
70
|
+
} & import("../types").ActiveTool, pointerDownState: Readonly<{
|
|
71
71
|
origin: Readonly<{
|
|
72
72
|
x: number;
|
|
73
73
|
y: number;
|
|
@@ -133,17 +133,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
133
133
|
erase: boolean;
|
|
134
134
|
};
|
|
135
135
|
};
|
|
136
|
-
}>, event: React.PointerEvent<
|
|
136
|
+
}>, event: React.PointerEvent<HTMLElement>]>;
|
|
137
137
|
onPointerUpEmitter: Emitter<[activeTool: {
|
|
138
|
-
lastActiveTool: import("../types").
|
|
138
|
+
lastActiveTool: import("../types").ActiveTool | null;
|
|
139
139
|
locked: boolean;
|
|
140
|
-
} & ({
|
|
141
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
142
|
-
customType: null;
|
|
143
|
-
} | {
|
|
144
|
-
type: "custom";
|
|
145
|
-
customType: string;
|
|
146
|
-
}), pointerDownState: Readonly<{
|
|
140
|
+
} & import("../types").ActiveTool, pointerDownState: Readonly<{
|
|
147
141
|
origin: Readonly<{
|
|
148
142
|
x: number;
|
|
149
143
|
y: number;
|
|
@@ -211,7 +205,16 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
211
205
|
};
|
|
212
206
|
}>, event: PointerEvent]>;
|
|
213
207
|
constructor(props: AppProps);
|
|
214
|
-
private
|
|
208
|
+
private onWindowMessage;
|
|
209
|
+
private updateEmbeddableRef;
|
|
210
|
+
private getHTMLIFrameElement;
|
|
211
|
+
private handleEmbeddableCenterClick;
|
|
212
|
+
private isEmbeddableCenter;
|
|
213
|
+
private updateEmbeddables;
|
|
214
|
+
private renderEmbeddables;
|
|
215
|
+
private getFrameNameDOMId;
|
|
216
|
+
frameNameBoundsCache: FrameNameBoundsCache;
|
|
217
|
+
private renderFrameNames;
|
|
215
218
|
render(): JSX.Element;
|
|
216
219
|
focusContainer: AppClassProperties["focusContainer"];
|
|
217
220
|
getSceneElementsIncludingDeleted: () => readonly ExcalidrawElement[];
|
|
@@ -238,22 +241,28 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
238
241
|
private onFontsLoadingDone;
|
|
239
242
|
private addEventListeners;
|
|
240
243
|
componentDidUpdate(prevProps: AppProps, prevState: AppState): void;
|
|
241
|
-
private
|
|
244
|
+
private renderInteractiveSceneCallback;
|
|
242
245
|
private onScroll;
|
|
243
246
|
private onCut;
|
|
244
247
|
private onCopy;
|
|
245
248
|
private cutAll;
|
|
246
249
|
private copyAll;
|
|
247
250
|
private static resetTapTwice;
|
|
248
|
-
private
|
|
249
|
-
private
|
|
251
|
+
private onTouchStart;
|
|
252
|
+
private onTouchEnd;
|
|
250
253
|
pasteFromClipboard: (event: ClipboardEvent | null) => Promise<void>;
|
|
251
254
|
private addElementsFromPasteOrLibrary;
|
|
252
255
|
private addTextFromPaste;
|
|
253
256
|
setAppState: React.Component<any, AppState>["setState"];
|
|
254
257
|
removePointer: (event: React.PointerEvent<HTMLElement> | PointerEvent) => void;
|
|
255
258
|
toggleLock: (source?: "keyboard" | "ui") => void;
|
|
256
|
-
|
|
259
|
+
updateFrameRendering: (opts: Partial<{
|
|
260
|
+
enabled: boolean;
|
|
261
|
+
name: boolean;
|
|
262
|
+
outline: boolean;
|
|
263
|
+
clip: boolean;
|
|
264
|
+
}> | ((prevState: AppState["frameRendering"]) => Partial<AppState["frameRendering"]>)) => void;
|
|
265
|
+
togglePenMode: (force?: boolean) => void;
|
|
257
266
|
onHandToolToggle: () => void;
|
|
258
267
|
/**
|
|
259
268
|
* Zooms on canvas viewport center
|
|
@@ -262,6 +271,17 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
262
271
|
private cancelInProgresAnimation;
|
|
263
272
|
scrollToContent: (target?: ExcalidrawElement | readonly ExcalidrawElement[], opts?: {
|
|
264
273
|
fitToContent?: boolean;
|
|
274
|
+
fitToViewport?: never;
|
|
275
|
+
viewportZoomFactor?: never;
|
|
276
|
+
animate?: boolean;
|
|
277
|
+
duration?: number;
|
|
278
|
+
} | {
|
|
279
|
+
fitToContent?: never;
|
|
280
|
+
fitToViewport?: boolean;
|
|
281
|
+
/** when fitToViewport=true, how much screen should the content cover,
|
|
282
|
+
* between 0.1 (10%) and 1 (100%)
|
|
283
|
+
*/
|
|
284
|
+
viewportZoomFactor?: number;
|
|
265
285
|
animate?: boolean;
|
|
266
286
|
duration?: number;
|
|
267
287
|
}) => void;
|
|
@@ -294,7 +314,14 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
294
314
|
private onKeyDown;
|
|
295
315
|
private onWheel;
|
|
296
316
|
private onKeyUp;
|
|
297
|
-
|
|
317
|
+
setActiveTool: (tool: {
|
|
318
|
+
type: ToolType;
|
|
319
|
+
locked?: boolean;
|
|
320
|
+
} | {
|
|
321
|
+
type: "custom";
|
|
322
|
+
customType: string;
|
|
323
|
+
locked?: boolean;
|
|
324
|
+
}) => void;
|
|
298
325
|
private setCursor;
|
|
299
326
|
private resetCursor;
|
|
300
327
|
/**
|
|
@@ -316,6 +343,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
316
343
|
private handleCanvasDoubleClick;
|
|
317
344
|
private getElementLinkAtPosition;
|
|
318
345
|
private redirectToLink;
|
|
346
|
+
private getTopLayerFrameAtSceneCoords;
|
|
319
347
|
private handleCanvasPointerMove;
|
|
320
348
|
private handleEraser;
|
|
321
349
|
private handleTouchMove;
|
|
@@ -338,9 +366,14 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
338
366
|
private isHittingCommonBoundingBoxOfSelectedElements;
|
|
339
367
|
private handleTextOnPointerDown;
|
|
340
368
|
private handleFreeDrawElementOnPointerDown;
|
|
369
|
+
private insertEmbeddableElement;
|
|
341
370
|
private createImageElement;
|
|
342
371
|
private handleLinearElementOnPointerDown;
|
|
372
|
+
private getCurrentItemRoundness;
|
|
343
373
|
private createGenericElementOnPointerDown;
|
|
374
|
+
private createFrameElementOnPointerDown;
|
|
375
|
+
private maybeCacheReferenceSnapPoints;
|
|
376
|
+
private maybeCacheVisibleGaps;
|
|
344
377
|
private onKeyDownFromPointerDownHandler;
|
|
345
378
|
private onKeyUpFromPointerDownHandler;
|
|
346
379
|
private onPointerMoveFromPointerDownHandler;
|
|
@@ -369,7 +402,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
369
402
|
private maybeSuggestBindingsForLinearElementAtCoords;
|
|
370
403
|
private maybeSuggestBindingForAll;
|
|
371
404
|
private clearSelection;
|
|
372
|
-
private
|
|
405
|
+
private handleInteractiveCanvasRef;
|
|
373
406
|
private handleAppOnDrop;
|
|
374
407
|
loadFileToCanvas: (file: File, fileHandle: FileSystemHandle | null) => Promise<void>;
|
|
375
408
|
private handleCanvasContextMenu;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { ColorPickerType } from "./colorPickerUtils";
|
|
1
2
|
interface ColorInputProps {
|
|
2
3
|
color: string;
|
|
3
4
|
onChange: (color: string) => void;
|
|
4
5
|
label: string;
|
|
6
|
+
colorPickerType: ColorPickerType;
|
|
5
7
|
}
|
|
6
|
-
export declare const ColorInput: ({ color, onChange, label }: ColorInputProps) => JSX.Element;
|
|
8
|
+
export declare const ColorInput: ({ color, onChange, label, colorPickerType, }: ColorInputProps) => JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./Dialog.scss";
|
|
3
|
+
export type DialogSize = number | "small" | "regular" | "wide" | undefined;
|
|
3
4
|
export interface DialogProps {
|
|
4
5
|
children: React.ReactNode;
|
|
5
6
|
className?: string;
|
|
6
|
-
size?:
|
|
7
|
+
size?: DialogSize;
|
|
7
8
|
onCloseRequest(): void;
|
|
8
9
|
title: React.ReactNode | false;
|
|
9
10
|
autofocus?: boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./ExcalidrawLogo.scss";
|
|
2
|
+
type LogoSize = "xs" | "small" | "normal" | "large" | "custom";
|
|
3
|
+
interface LogoProps {
|
|
4
|
+
size?: LogoSize;
|
|
5
|
+
withText?: boolean;
|
|
6
|
+
style?: React.CSSProperties;
|
|
7
|
+
/**
|
|
8
|
+
* If true, the logo will not be wrapped in a Link component.
|
|
9
|
+
* The link prop will be ignored as well.
|
|
10
|
+
* It will merely be a plain div.
|
|
11
|
+
*/
|
|
12
|
+
isNotLink?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const ExcalidrawLogo: ({ style, size, withText, }: LogoProps) => JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import "./EyeDropper.scss";
|
|
3
|
-
|
|
3
|
+
import { ColorPickerType } from "./ColorPicker/colorPickerUtils";
|
|
4
|
+
import { ExcalidrawElement } from "../element/types";
|
|
5
|
+
export type EyeDropperProperties = {
|
|
4
6
|
keepOpenOnAlt: boolean;
|
|
5
7
|
swapPreviewOnAlt?: boolean;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
/** called when user picks color (on pointerup) */
|
|
9
|
+
onSelect: (color: string, event: PointerEvent) => void;
|
|
10
|
+
/**
|
|
11
|
+
* property of selected elements to update live when alt-dragging.
|
|
12
|
+
* Supply `null` if not applicable (e.g. updating the canvas bg instead of
|
|
13
|
+
* elements)
|
|
14
|
+
**/
|
|
15
|
+
colorPickerType: ColorPickerType;
|
|
8
16
|
};
|
|
9
17
|
export declare const activeEyeDropperAtom: import("jotai").PrimitiveAtom<EyeDropperProperties | null> & {
|
|
10
18
|
init: EyeDropperProperties | null;
|
|
11
19
|
};
|
|
12
20
|
export declare const EyeDropper: React.FC<{
|
|
13
21
|
onCancel: () => void;
|
|
14
|
-
onSelect:
|
|
15
|
-
|
|
16
|
-
|
|
22
|
+
onSelect: EyeDropperProperties["onSelect"];
|
|
23
|
+
/** called when color changes, on pointerdown for preview */
|
|
24
|
+
onChange: (type: ColorPickerType, color: string, selectedElements: ExcalidrawElement[], event: {
|
|
25
|
+
altKey: boolean;
|
|
26
|
+
}) => void;
|
|
27
|
+
colorPickerType: EyeDropperProperties["colorPickerType"];
|
|
17
28
|
}>;
|
|
18
|
-
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./FilledButton.scss";
|
|
3
3
|
export type ButtonVariant = "filled" | "outlined" | "icon";
|
|
4
|
-
export type ButtonColor = "primary" | "danger";
|
|
4
|
+
export type ButtonColor = "primary" | "danger" | "warning" | "muted";
|
|
5
5
|
export type ButtonSize = "medium" | "large";
|
|
6
6
|
export type FilledButtonProps = {
|
|
7
7
|
label: string;
|
|
@@ -11,6 +11,7 @@ export type FilledButtonProps = {
|
|
|
11
11
|
color?: ButtonColor;
|
|
12
12
|
size?: ButtonSize;
|
|
13
13
|
className?: string;
|
|
14
|
+
fullWidth?: boolean;
|
|
14
15
|
startIcon?: React.ReactNode;
|
|
15
16
|
};
|
|
16
17
|
export declare const FilledButton: React.ForwardRefExoticComponent<FilledButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Device, UIAppState } from "../types";
|
|
1
|
+
import { AppClassProperties, Device, UIAppState } from "../types";
|
|
3
2
|
import "./HintViewer.scss";
|
|
4
3
|
interface HintViewerProps {
|
|
5
4
|
appState: UIAppState;
|
|
6
|
-
elements: readonly NonDeletedExcalidrawElement[];
|
|
7
5
|
isMobile: boolean;
|
|
8
6
|
device: Device;
|
|
7
|
+
app: AppClassProperties;
|
|
9
8
|
}
|
|
10
|
-
export declare const HintViewer: ({ appState,
|
|
9
|
+
export declare const HintViewer: ({ appState, isMobile, device, app, }: HintViewerProps) => JSX.Element | null;
|
|
11
10
|
export {};
|
|
@@ -10,6 +10,6 @@ export declare const JSONExportDialog: ({ elements, appState, files, actionManag
|
|
|
10
10
|
files: BinaryFiles;
|
|
11
11
|
actionManager: ActionManager;
|
|
12
12
|
exportOpts: ExportOpts;
|
|
13
|
-
canvas: HTMLCanvasElement
|
|
13
|
+
canvas: HTMLCanvasElement;
|
|
14
14
|
setAppState: React.Component<any, UIAppState>["setState"];
|
|
15
15
|
}) => JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LaserPointer } from "@excalidraw/laser-pointer";
|
|
2
|
+
import App from "../App";
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
LPM: LaserPathManager;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export declare class LaserPathManager {
|
|
9
|
+
private app;
|
|
10
|
+
private ownState;
|
|
11
|
+
private collaboratorsState;
|
|
12
|
+
private rafId;
|
|
13
|
+
private isDrawing;
|
|
14
|
+
private container;
|
|
15
|
+
constructor(app: App);
|
|
16
|
+
destroy(): void;
|
|
17
|
+
startPath(x: number, y: number): void;
|
|
18
|
+
addPointToPath(x: number, y: number): void;
|
|
19
|
+
endPath(): void;
|
|
20
|
+
private updatePath;
|
|
21
|
+
private isRunning;
|
|
22
|
+
start(svg?: SVGSVGElement): void;
|
|
23
|
+
stop(): void;
|
|
24
|
+
loop(): void;
|
|
25
|
+
draw(path: LaserPointer): string;
|
|
26
|
+
updateCollabolatorsState(): void;
|
|
27
|
+
update(): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "../ToolIcon.scss";
|
|
2
|
+
type LaserPointerIconProps = {
|
|
3
|
+
title?: string;
|
|
4
|
+
name?: string;
|
|
5
|
+
checked: boolean;
|
|
6
|
+
onChange?(): void;
|
|
7
|
+
isMobile?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const LaserPointerButton: (props: LaserPointerIconProps) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -9,7 +9,8 @@ interface LayerUIProps {
|
|
|
9
9
|
actionManager: ActionManager;
|
|
10
10
|
appState: UIAppState;
|
|
11
11
|
files: BinaryFiles;
|
|
12
|
-
canvas: HTMLCanvasElement
|
|
12
|
+
canvas: HTMLCanvasElement;
|
|
13
|
+
interactiveCanvas: HTMLCanvasElement | null;
|
|
13
14
|
setAppState: React.Component<any, AppState>["setState"];
|
|
14
15
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
15
16
|
onLockToggle: () => void;
|
|
@@ -27,6 +28,9 @@ interface LayerUIProps {
|
|
|
27
28
|
renderWelcomeScreen: boolean;
|
|
28
29
|
onHomeButtonClick: () => void;
|
|
29
30
|
children?: React.ReactNode;
|
|
31
|
+
app: AppClassProperties;
|
|
32
|
+
isCollaborating: boolean;
|
|
33
|
+
uiDisabled: boolean;
|
|
30
34
|
}
|
|
31
|
-
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onImageAction, onExportImage, renderWelcomeScreen, onHomeButtonClick, children, }: LayerUIProps) => JSX.Element>;
|
|
35
|
+
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, interactiveCanvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onImageAction, onExportImage, renderWelcomeScreen, onHomeButtonClick, children, app, isCollaborating, uiDisabled, }: LayerUIProps) => JSX.Element | null>;
|
|
32
36
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AppState, Device, ExcalidrawProps, UIAppState } from "../types";
|
|
2
|
+
import { AppClassProperties, AppState, Device, ExcalidrawProps, UIAppState } from "../types";
|
|
3
3
|
import { ActionManager } from "../actions/manager";
|
|
4
4
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
type MobileMenuProps = {
|
|
@@ -12,7 +12,7 @@ type MobileMenuProps = {
|
|
|
12
12
|
onLockToggle: () => void;
|
|
13
13
|
onHandToolToggle: () => void;
|
|
14
14
|
onPenModeToggle: () => void;
|
|
15
|
-
|
|
15
|
+
interactiveCanvas: HTMLCanvasElement | null;
|
|
16
16
|
onImageAction: (data: {
|
|
17
17
|
insertOnCanvasDirectly: boolean;
|
|
18
18
|
}) => void;
|
|
@@ -21,7 +21,8 @@ type MobileMenuProps = {
|
|
|
21
21
|
renderSidebars: () => JSX.Element | null;
|
|
22
22
|
device: Device;
|
|
23
23
|
renderWelcomeScreen: boolean;
|
|
24
|
+
app: AppClassProperties;
|
|
24
25
|
onHomeButtonClick: () => void;
|
|
25
26
|
};
|
|
26
|
-
export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle,
|
|
27
|
+
export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle, interactiveCanvas, onImageAction, renderTopRightUI, renderCustomStats, renderSidebars, device, renderWelcomeScreen, app, onHomeButtonClick, }: MobileMenuProps) => JSX.Element;
|
|
27
28
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./OverwriteConfirm.scss";
|
|
3
|
+
export type OverwriteConfirmDialogProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
declare const OverwriteConfirmDialog: React.FC<OverwriteConfirmDialogProps & {
|
|
7
|
+
__fallback?: boolean | undefined;
|
|
8
|
+
}> & {
|
|
9
|
+
Actions: (({ children }: {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
}) => JSX.Element) & {
|
|
12
|
+
ExportToImage: () => JSX.Element;
|
|
13
|
+
SaveToDisk: () => JSX.Element;
|
|
14
|
+
};
|
|
15
|
+
Action: ({ title, children, actionLabel, onClick, }: import("./OverwriteConfirmActions").ActionProps) => JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
export { OverwriteConfirmDialog };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type ActionProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
actionLabel: string;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const Action: ({ title, children, actionLabel, onClick, }: ActionProps) => JSX.Element;
|
|
9
|
+
export declare const ExportToImage: () => JSX.Element;
|
|
10
|
+
export declare const SaveToDisk: () => JSX.Element;
|
|
11
|
+
declare const Actions: (({ children }: {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}) => JSX.Element) & {
|
|
14
|
+
ExportToImage: () => JSX.Element;
|
|
15
|
+
SaveToDisk: () => JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
export { Actions };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type OverwriteConfirmState = {
|
|
3
|
+
active: true;
|
|
4
|
+
title: string;
|
|
5
|
+
description: React.ReactNode;
|
|
6
|
+
actionLabel: string;
|
|
7
|
+
color: "danger" | "warning";
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
onConfirm: () => void;
|
|
10
|
+
onReject: () => void;
|
|
11
|
+
} | {
|
|
12
|
+
active: false;
|
|
13
|
+
};
|
|
14
|
+
export declare const overwriteConfirmStateAtom: import("jotai").PrimitiveAtom<OverwriteConfirmState> & {
|
|
15
|
+
init: OverwriteConfirmState;
|
|
16
|
+
};
|
|
17
|
+
export declare function openConfirmModal({ title, description, actionLabel, color, }: {
|
|
18
|
+
title: string;
|
|
19
|
+
description: React.ReactNode;
|
|
20
|
+
actionLabel: string;
|
|
21
|
+
color: "danger" | "warning";
|
|
22
|
+
}): Promise<boolean>;
|
|
@@ -22,7 +22,7 @@ export declare const SidebarInner: React.ForwardRefExoticComponent<Pick<{
|
|
|
22
22
|
docked?: boolean | undefined;
|
|
23
23
|
className?: string | undefined;
|
|
24
24
|
__fallback?: boolean | undefined;
|
|
25
|
-
} & Omit<React.RefAttributes<HTMLDivElement>, "onSelect">, "
|
|
25
|
+
} & Omit<React.RefAttributes<HTMLDivElement>, "onSelect">, "name" | "children" | "key" | "className" | "onDock" | "docked" | "onStateChange" | "__fallback"> & React.RefAttributes<HTMLDivElement>>;
|
|
26
26
|
export declare const Sidebar: React.ForwardRefExoticComponent<{
|
|
27
27
|
name: string;
|
|
28
28
|
children: React.ReactNode;
|
|
@@ -10,7 +10,7 @@ type StackProps = {
|
|
|
10
10
|
ref: React.RefObject<HTMLDivElement>;
|
|
11
11
|
};
|
|
12
12
|
declare const _default: {
|
|
13
|
-
Row: React.ForwardRefExoticComponent<Pick<StackProps, "
|
|
14
|
-
Col: React.ForwardRefExoticComponent<Pick<StackProps, "
|
|
13
|
+
Row: React.ForwardRefExoticComponent<Pick<StackProps, "align" | "style" | "children" | "gap" | "className" | "justifyContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Col: React.ForwardRefExoticComponent<Pick<StackProps, "align" | "style" | "children" | "gap" | "className" | "justifyContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
};
|
|
16
16
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./ToolIcon.scss";
|
|
2
|
-
import React from "react";
|
|
2
|
+
import React, { CSSProperties } from "react";
|
|
3
3
|
import { PointerType } from "../element/types";
|
|
4
4
|
export type ToolButtonSize = "small" | "medium";
|
|
5
5
|
type ToolButtonBaseProps = {
|
|
@@ -18,6 +18,7 @@ type ToolButtonBaseProps = {
|
|
|
18
18
|
visible?: boolean;
|
|
19
19
|
selected?: boolean;
|
|
20
20
|
className?: string;
|
|
21
|
+
style?: CSSProperties;
|
|
21
22
|
isLoading?: boolean;
|
|
22
23
|
};
|
|
23
24
|
type ToolButtonProps = (ToolButtonBaseProps & {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { TranslationKeys } from "../i18n";
|
|
2
3
|
declare const Trans: ({ i18nKey, children, ...props }: {
|
|
3
4
|
[key: string]: React.ReactNode | ((el: React.ReactNode) => React.ReactNode);
|
|
4
|
-
i18nKey:
|
|
5
|
+
i18nKey: TranslationKeys;
|
|
5
6
|
}) => React.FunctionComponentElement<{
|
|
6
7
|
children?: React.ReactNode;
|
|
7
8
|
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DOMAttributes } from "react";
|
|
3
|
+
import type { InteractiveCanvasAppState } from "../../types";
|
|
4
|
+
import type { RenderInteractiveSceneCallback } from "../../scene/types";
|
|
5
|
+
import type { NonDeletedExcalidrawElement } from "../../element/types";
|
|
6
|
+
type InteractiveCanvasProps = {
|
|
7
|
+
containerRef: React.RefObject<HTMLDivElement>;
|
|
8
|
+
canvas: HTMLCanvasElement | null;
|
|
9
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
10
|
+
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
11
|
+
selectedElements: readonly NonDeletedExcalidrawElement[];
|
|
12
|
+
versionNonce: number | undefined;
|
|
13
|
+
selectionNonce: number | undefined;
|
|
14
|
+
scale: number;
|
|
15
|
+
appState: InteractiveCanvasAppState;
|
|
16
|
+
renderInteractiveSceneCallback: (data: RenderInteractiveSceneCallback) => void;
|
|
17
|
+
handleCanvasRef: (canvas: HTMLCanvasElement | null) => void;
|
|
18
|
+
onContextMenu: Exclude<DOMAttributes<HTMLCanvasElement | HTMLDivElement>["onContextMenu"], undefined>;
|
|
19
|
+
onPointerMove: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerMove"], undefined>;
|
|
20
|
+
onPointerUp: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerUp"], undefined>;
|
|
21
|
+
onPointerCancel: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerCancel"], undefined>;
|
|
22
|
+
onTouchMove: Exclude<DOMAttributes<HTMLCanvasElement>["onTouchMove"], undefined>;
|
|
23
|
+
onPointerDown: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerDown"], undefined>;
|
|
24
|
+
onDoubleClick: Exclude<DOMAttributes<HTMLCanvasElement>["onDoubleClick"], undefined>;
|
|
25
|
+
};
|
|
26
|
+
declare const _default: React.MemoExoticComponent<(props: InteractiveCanvasProps) => JSX.Element>;
|
|
27
|
+
export default _default;
|