@dwelle/excalidraw 0.4.0-e3bee83 → 0.4.0-e587816
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +525 -0
- package/README.md +18 -1820
- package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js → vendor-d415b28e9024dee4bb1b.js} +2 -2
- package/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.js → vendor-a14cd58fa2db417e42b2.js} +6 -6
- package/dist/excalidraw.development.js +3071 -1566
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +20 -0
- package/main.js +1 -8
- package/package.json +9 -4
- package/types/actions/actionAddToLibrary.d.ts +103 -55
- package/types/actions/actionAlign.d.ts +33 -28
- package/types/actions/actionBoundText.d.ts +175 -22
- package/types/actions/actionCanvas.d.ts +680 -170
- package/types/actions/actionClipboard.d.ts +174 -100
- package/types/actions/actionDeleteSelected.d.ts +102 -60
- package/types/actions/actionDistribute.d.ts +11 -12
- package/types/actions/actionDuplicateSelection.d.ts +3 -4
- package/types/actions/actionElementLock.d.ts +271 -0
- package/types/actions/actionExport.d.ts +363 -221
- package/types/actions/actionFinalize.d.ts +70 -42
- package/types/actions/actionFlip.d.ts +8 -11
- package/types/actions/actionFrame.d.ts +423 -0
- package/types/actions/actionGroup.d.ts +250 -13
- package/types/actions/actionHistory.d.ts +1 -1
- package/types/actions/actionLinearEditor.d.ts +37 -21
- package/types/actions/actionMenu.d.ts +108 -62
- package/types/actions/actionNavigate.d.ts +1 -1
- package/types/actions/actionProperties.d.ts +465 -256
- package/types/actions/actionSelectAll.d.ts +123 -4
- package/types/actions/actionStyles.d.ts +39 -24
- package/types/actions/actionToggleGridMode.d.ts +37 -22
- package/types/actions/{actionToggleLock.d.ts → actionToggleObjectsSnapMode.d.ts} +49 -32
- package/types/actions/actionToggleStats.d.ts +37 -22
- package/types/actions/actionToggleViewMode.d.ts +37 -22
- package/types/actions/actionToggleZenMode.d.ts +37 -22
- package/types/actions/actionZindex.d.ts +12 -12
- package/types/actions/index.d.ts +2 -1
- package/types/actions/manager.d.ts +1 -1
- package/types/actions/shortcuts.d.ts +2 -1
- package/types/actions/types.d.ts +11 -9
- package/types/appState.d.ts +18 -18
- package/types/charts.d.ts +2 -2
- package/types/clients.d.ts +5 -6
- package/types/clipboard.d.ts +8 -7
- package/types/colors.d.ts +60 -5
- package/types/components/Actions.d.ts +7 -12
- package/types/components/ActiveConfirmDialog.d.ts +4 -0
- package/types/components/App.d.ts +93 -35
- package/types/components/Avatar.d.ts +1 -2
- package/types/components/BraveMeasureTextError.d.ts +2 -0
- package/types/components/Button.d.ts +3 -2
- package/types/components/ButtonIconSelect.d.ts +11 -3
- package/types/components/Card.d.ts +0 -1
- package/types/components/ColorPicker/ColorInput.d.ts +9 -0
- package/types/components/ColorPicker/ColorPicker.d.ts +19 -0
- package/types/components/ColorPicker/CustomColorList.d.ts +8 -0
- package/types/components/ColorPicker/HotkeyLabel.d.ts +8 -0
- package/types/components/ColorPicker/Picker.d.ts +18 -0
- package/types/components/ColorPicker/PickerColorList.d.ts +10 -0
- package/types/components/ColorPicker/PickerHeading.d.ts +5 -0
- package/types/components/ColorPicker/ShadeList.d.ts +8 -0
- package/types/components/ColorPicker/TopPicks.d.ts +9 -0
- package/types/components/ColorPicker/colorPickerUtils.d.ts +21 -0
- package/types/components/ColorPicker/keyboardNavHandlers.d.ts +20 -0
- package/types/components/ContextMenu.d.ts +3 -3
- package/types/components/DefaultSidebar.d.ts +29 -0
- package/types/components/Dialog.d.ts +3 -4
- package/types/components/ErrorDialog.d.ts +3 -2
- package/types/components/ExcalidrawLogo.d.ts +15 -0
- package/types/components/EyeDropper.d.ts +28 -0
- package/types/components/FilledButton.d.ts +17 -0
- package/types/components/FixedSideContainer.d.ts +1 -1
- package/types/components/HandButton.d.ts +10 -0
- package/types/components/HelpButton.d.ts +1 -2
- package/types/components/HintViewer.d.ts +4 -5
- package/types/components/HomeButton.d.ts +1 -1
- package/types/components/ImageExportDialog.d.ts +8 -13
- package/types/components/Island.d.ts +1 -1
- package/types/components/JSONExportDialog.d.ts +5 -5
- package/types/components/LaserTool/LaserPathManager.d.ts +28 -0
- package/types/components/LaserTool/LaserPointerButton.d.ts +10 -0
- package/types/components/LaserTool/LaserTool.d.ts +7 -0
- package/types/components/LayerUI.d.ts +9 -15
- package/types/components/LibraryMenu.d.ts +13 -14
- package/types/components/LibraryMenuBrowseButton.d.ts +2 -2
- package/types/components/LibraryMenuControlButtons.d.ts +9 -0
- package/types/components/LibraryMenuHeaderContent.d.ts +10 -28
- package/types/components/LibraryMenuItems.d.ts +6 -7
- package/types/components/LibraryMenuSection.d.ts +22 -0
- package/types/components/LibraryUnit.d.ts +6 -3
- package/types/components/LoadingMessage.d.ts +0 -1
- package/types/components/LockButton.d.ts +1 -2
- package/types/components/MobileMenu.d.ts +8 -11
- package/types/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
- package/types/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
- package/types/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
- package/types/components/PasteChartDialog.d.ts +4 -5
- package/types/components/PenModeButton.d.ts +1 -1
- package/types/components/Popover.d.ts +1 -1
- package/types/components/ProjectName.d.ts +2 -1
- package/types/components/PublishLibrary.d.ts +2 -2
- package/types/components/RadioGroup.d.ts +12 -0
- package/types/components/Section.d.ts +1 -1
- package/types/components/Sidebar/Sidebar.d.ts +66 -63
- package/types/components/Sidebar/SidebarHeader.d.ts +6 -19
- package/types/components/Sidebar/SidebarTab.d.ts +8 -0
- package/types/components/Sidebar/SidebarTabTrigger.d.ts +9 -0
- package/types/components/Sidebar/SidebarTabTriggers.d.ts +6 -0
- package/types/components/Sidebar/SidebarTabs.d.ts +6 -0
- package/types/components/Sidebar/SidebarTrigger.d.ts +6 -0
- package/types/components/Sidebar/common.d.ts +24 -7
- package/types/components/Spinner.d.ts +2 -1
- package/types/components/Stack.d.ts +4 -3
- package/types/components/Stats.d.ts +3 -3
- package/types/components/Switch.d.ts +9 -0
- package/types/components/ToolButton.d.ts +6 -5
- package/types/components/Tooltip.d.ts +1 -1
- package/types/components/Trans.d.ts +9 -0
- package/types/components/canvases/InteractiveCanvas.d.ts +27 -0
- package/types/components/canvases/StaticCanvas.d.ts +18 -0
- package/types/components/canvases/index.d.ts +3 -0
- package/types/components/dropdownMenu/DropdownMenu.d.ts +15 -9
- package/types/components/dropdownMenu/DropdownMenuContent.d.ts +7 -3
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +4 -4
- package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -1
- package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +4 -2
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -2
- package/types/components/dropdownMenu/common.d.ts +6 -0
- package/types/components/footer/Footer.d.ts +4 -5
- package/types/components/hoc/withInternalFallback.d.ts +4 -0
- package/types/components/icons.d.ts +16 -1
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -1
- package/types/components/main-menu/MainMenu.d.ts +22 -13
- package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -1
- package/types/components/welcome-screen/WelcomeScreen.d.ts +2 -3
- package/types/constants.d.ts +94 -10
- package/types/context/tunnels.d.ts +19 -0
- package/types/context/ui-appState.d.ts +4 -0
- package/types/cursor.d.ts +5 -0
- package/types/data/blob.d.ts +5 -3
- package/types/data/encode.d.ts +1 -1
- package/types/data/filesystem.d.ts +2 -1
- package/types/data/library.d.ts +3 -45
- package/types/data/restore.d.ts +10 -4
- package/types/data/transform.d.ts +73 -0
- package/types/data/types.d.ts +3 -5
- package/types/data/url.d.ts +7 -0
- package/types/element/Hyperlink.d.ts +48 -29
- package/types/element/binding.d.ts +4 -3
- package/types/element/bounds.d.ts +40 -10
- package/types/element/collision.d.ts +7 -7
- package/types/element/dragElements.d.ts +12 -2
- package/types/element/embeddable.d.ts +153 -0
- package/types/element/image.d.ts +11 -1
- package/types/element/index.d.ts +3 -2
- package/types/element/linearElementEditor.d.ts +43 -27
- package/types/element/mutateElement.d.ts +3 -2
- package/types/element/newElement.d.ts +48 -15
- package/types/element/resizeElements.d.ts +3 -2
- package/types/element/resizeTest.d.ts +2 -1
- package/types/element/showSelectedShapeActions.d.ts +2 -2
- package/types/element/sizeHelpers.d.ts +8 -1
- package/types/element/sortElements.d.ts +2 -0
- package/types/element/textElement.d.ts +43 -17
- package/types/element/textWysiwyg.d.ts +1 -1
- package/types/element/transformHandles.d.ts +16 -8
- package/types/element/typeChecks.d.ts +5 -2
- package/types/element/types.d.ts +59 -35
- package/types/emitter.d.ts +1 -2
- package/types/errors.d.ts +1 -1
- package/types/frame.d.ts +46 -0
- package/types/ga.d.ts +5 -5
- package/types/groups.d.ts +15 -11
- package/types/history.d.ts +3 -3
- package/types/hooks/useCreatePortalContainer.d.ts +4 -0
- package/types/hooks/useLibraryItemSvg.d.ts +11 -0
- package/types/hooks/useOutsideClick.d.ts +19 -2
- package/types/hooks/useScrollPosition.d.ts +1 -0
- package/types/hooks/useStable.d.ts +1 -0
- package/types/hooks/useTransition.d.ts +2 -0
- package/types/i18n.d.ts +11 -2
- package/types/jotai.d.ts +20 -108
- package/types/keys.d.ts +5 -4
- package/types/math.d.ts +5 -0
- package/types/packages/bbox.d.ts +11 -0
- package/types/packages/excalidraw/example/App.d.ts +7 -1
- package/types/packages/excalidraw/example/initialData.d.ts +182 -64
- package/types/packages/excalidraw/index.d.ts +11 -4
- package/types/packages/excalidraw/main.d.ts +3 -1
- package/types/packages/excalidraw/webpack.dev.config.d.ts +5 -2
- package/types/packages/excalidraw/webpack.prod.config.d.ts +3 -0
- package/types/packages/utils.d.ts +11 -2
- package/types/packages/withinBounds.d.ts +19 -0
- package/types/renderer/renderElement.d.ts +12 -22
- package/types/renderer/renderScene.d.ts +19 -27
- package/types/renderer/renderSnaps.d.ts +2 -0
- package/types/renderer/roundRect.d.ts +1 -1
- package/types/scene/Renderer.d.ts +25 -0
- package/types/scene/Scene.d.ts +27 -5
- package/types/scene/Shape.d.ts +12 -0
- package/types/scene/ShapeCache.d.ts +20 -0
- package/types/scene/comparisons.d.ts +0 -1
- package/types/scene/export.d.ts +50 -11
- package/types/scene/index.d.ts +1 -1
- package/types/scene/scroll.d.ts +1 -1
- package/types/scene/scrollbars.d.ts +2 -6
- package/types/scene/selection.d.ts +27 -6
- package/types/scene/types.d.ts +70 -34
- package/types/snapping.d.ts +108 -0
- package/types/types.d.ts +200 -84
- package/types/utility-types.d.ts +24 -0
- package/types/utils.d.ts +73 -29
- package/types/zindex.d.ts +4 -4
- package/types/components/ColorPicker.d.ts +0 -14
- package/types/components/LibraryButton.d.ts +0 -8
- package/types/components/SingleLibraryItem.d.ts +0 -10
- package/types/components/hoc/withUpstreamOverride.d.ts +0 -10
- /package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js.LICENSE.txt → vendor-d415b28e9024dee4bb1b.js.LICENSE.txt} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.d.ts → vendor-d415b28e9024dee4bb1b.d.ts} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.d.ts → vendor-a14cd58fa2db417e42b2.d.ts} +0 -0
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ActionManager } from "../actions/manager";
|
|
2
|
+
import type { AppClassProperties, BinaryFiles, UIAppState } from "../types";
|
|
2
3
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
3
|
-
import
|
|
4
|
-
import "./ExportDialog.scss";
|
|
5
|
-
import { ActionManager } from "../actions/manager";
|
|
4
|
+
import "./ImageExportDialog.scss";
|
|
6
5
|
export declare const ErrorCanvasPreview: () => JSX.Element;
|
|
7
|
-
export declare
|
|
8
|
-
|
|
9
|
-
appState: AppState;
|
|
10
|
-
setAppState: React.Component<any, AppState>["setState"];
|
|
6
|
+
export declare const ImageExportDialog: ({ elements, appState, files, actionManager, onExportImage, onCloseRequest, }: {
|
|
7
|
+
appState: UIAppState;
|
|
11
8
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
12
9
|
files: BinaryFiles;
|
|
13
|
-
exportPadding?: number | undefined;
|
|
14
10
|
actionManager: ActionManager;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}) => JSX.Element;
|
|
11
|
+
onExportImage: AppClassProperties["onExportImage"];
|
|
12
|
+
onCloseRequest: () => void;
|
|
13
|
+
}) => JSX.Element | null;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
3
|
-
import {
|
|
3
|
+
import { ExportOpts, BinaryFiles, UIAppState } from "../types";
|
|
4
4
|
import "./ExportDialog.scss";
|
|
5
5
|
import { ActionManager } from "../actions/manager";
|
|
6
|
-
export
|
|
6
|
+
export type ExportCB = (elements: readonly NonDeletedExcalidrawElement[], scale?: number) => void;
|
|
7
7
|
export declare const JSONExportDialog: ({ elements, appState, files, actionManager, exportOpts, canvas, setAppState, }: {
|
|
8
8
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
9
|
-
appState:
|
|
9
|
+
appState: UIAppState;
|
|
10
10
|
files: BinaryFiles;
|
|
11
11
|
actionManager: ActionManager;
|
|
12
12
|
exportOpts: ExportOpts;
|
|
13
|
-
canvas: HTMLCanvasElement
|
|
14
|
-
setAppState: React.Component<any,
|
|
13
|
+
canvas: HTMLCanvasElement;
|
|
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 {};
|
|
@@ -2,37 +2,31 @@ import React from "react";
|
|
|
2
2
|
import { ActionManager } from "../actions/manager";
|
|
3
3
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
4
4
|
import { Language } from "../i18n";
|
|
5
|
-
import { AppProps, AppState, ExcalidrawProps, BinaryFiles } from "../types";
|
|
6
|
-
import Library from "../data/library";
|
|
5
|
+
import { AppProps, AppState, ExcalidrawProps, BinaryFiles, UIAppState, AppClassProperties } from "../types";
|
|
7
6
|
import "./LayerUI.scss";
|
|
8
7
|
import "./Toolbar.scss";
|
|
9
8
|
interface LayerUIProps {
|
|
10
9
|
actionManager: ActionManager;
|
|
11
|
-
appState:
|
|
10
|
+
appState: UIAppState;
|
|
12
11
|
files: BinaryFiles;
|
|
13
|
-
canvas: HTMLCanvasElement
|
|
12
|
+
canvas: HTMLCanvasElement;
|
|
14
13
|
setAppState: React.Component<any, AppState>["setState"];
|
|
15
14
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
16
15
|
onLockToggle: () => void;
|
|
16
|
+
onHandToolToggle: () => void;
|
|
17
17
|
onPenModeToggle: () => void;
|
|
18
|
-
onInsertElements: (elements: readonly NonDeletedExcalidrawElement[]) => void;
|
|
19
18
|
showExitZenModeBtn: boolean;
|
|
20
19
|
langCode: Language["code"];
|
|
21
|
-
isCollaborating: boolean;
|
|
22
20
|
renderTopRightUI?: ExcalidrawProps["renderTopRightUI"];
|
|
23
21
|
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
24
|
-
renderCustomSidebar?: ExcalidrawProps["renderSidebar"];
|
|
25
|
-
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
26
22
|
UIOptions: AppProps["UIOptions"];
|
|
27
|
-
|
|
28
|
-
library: Library;
|
|
29
|
-
id: string;
|
|
30
|
-
onImageAction: (data: {
|
|
31
|
-
insertOnCanvasDirectly: boolean;
|
|
32
|
-
}) => void;
|
|
23
|
+
onExportImage: AppClassProperties["onExportImage"];
|
|
33
24
|
renderWelcomeScreen: boolean;
|
|
34
25
|
onHomeButtonClick: () => void;
|
|
35
26
|
children?: React.ReactNode;
|
|
27
|
+
app: AppClassProperties;
|
|
28
|
+
isCollaborating: boolean;
|
|
29
|
+
uiDisabled: boolean;
|
|
36
30
|
}
|
|
37
|
-
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle,
|
|
31
|
+
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onExportImage, renderWelcomeScreen, onHomeButtonClick, children, app, isCollaborating, uiDisabled, }: LayerUIProps) => JSX.Element | null>;
|
|
38
32
|
export default _default;
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import Library from "../data/library";
|
|
3
|
-
import { LibraryItems, LibraryItem,
|
|
3
|
+
import { LibraryItems, LibraryItem, ExcalidrawProps, UIAppState } from "../types";
|
|
4
4
|
import "./LibraryMenu.scss";
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
export declare const isLibraryMenuOpenAtom: import("jotai").PrimitiveAtom<boolean> & {
|
|
6
|
+
init: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const LibraryMenuContent: ({ onInsertLibraryItems, pendingElements, onAddToLibrary, setAppState, libraryReturnUrl, library, id, theme, selectedItems, onSelectItems, }: {
|
|
7
9
|
pendingElements: LibraryItem["elements"];
|
|
8
10
|
onInsertLibraryItems: (libraryItems: LibraryItems) => void;
|
|
9
11
|
onAddToLibrary: () => void;
|
|
10
|
-
setAppState: React.Component<any,
|
|
12
|
+
setAppState: React.Component<any, UIAppState>["setState"];
|
|
11
13
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
12
14
|
library: Library;
|
|
13
15
|
id: string;
|
|
14
|
-
|
|
16
|
+
theme: UIAppState["theme"];
|
|
15
17
|
selectedItems: LibraryItem["id"][];
|
|
16
18
|
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
17
19
|
}) => JSX.Element;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
library: Library;
|
|
24
|
-
id: string;
|
|
25
|
-
}>;
|
|
20
|
+
/**
|
|
21
|
+
* This component is meant to be rendered inside <Sidebar.Tab/> inside our
|
|
22
|
+
* <DefaultSidebar/> or host apps Sidebar components.
|
|
23
|
+
*/
|
|
24
|
+
export declare const LibraryMenu: () => JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExcalidrawProps, UIAppState } from "../types";
|
|
2
2
|
declare const LibraryMenuBrowseButton: ({ theme, id, libraryReturnUrl, }: {
|
|
3
3
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
4
|
-
theme:
|
|
4
|
+
theme: UIAppState["theme"];
|
|
5
5
|
id: string;
|
|
6
6
|
}) => JSX.Element;
|
|
7
7
|
export default LibraryMenuBrowseButton;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ExcalidrawProps, UIAppState } from "../types";
|
|
2
|
+
export declare const LibraryMenuControlButtons: ({ libraryReturnUrl, theme, id, style, children, className, }: {
|
|
3
|
+
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
4
|
+
theme: UIAppState["theme"];
|
|
5
|
+
id: string;
|
|
6
|
+
style: React.CSSProperties;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
}) => JSX.Element;
|
|
@@ -1,35 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { LibraryItem, UIAppState } from "../types";
|
|
2
2
|
import Library from "../data/library";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
write: (get: {
|
|
6
|
-
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
7
|
-
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
8
|
-
<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;
|
|
9
|
-
} & {
|
|
10
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
11
|
-
unstable_promise: true;
|
|
12
|
-
}): Value_3 | Promise<Value_3>;
|
|
13
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
14
|
-
unstable_promise: true;
|
|
15
|
-
}): Value_4 | Promise<Value_4>;
|
|
16
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
17
|
-
unstable_promise: true;
|
|
18
|
-
}): (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>;
|
|
19
|
-
}, set: {
|
|
20
|
-
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
21
|
-
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
22
|
-
}, update: boolean | ((prev: boolean) => boolean)) => void;
|
|
23
|
-
onMount?: (<S extends (update: boolean | ((prev: boolean) => boolean)) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
24
|
-
} & {
|
|
25
|
-
init: boolean;
|
|
26
|
-
};
|
|
27
|
-
export declare const LibraryMenuHeader: React.FC<{
|
|
28
|
-
setAppState: React.Component<any, AppState>["setState"];
|
|
3
|
+
export declare const LibraryDropdownMenuButton: React.FC<{
|
|
4
|
+
setAppState: React.Component<any, UIAppState>["setState"];
|
|
29
5
|
selectedItems: LibraryItem["id"][];
|
|
30
6
|
library: Library;
|
|
31
7
|
onRemoveFromLibrary: () => void;
|
|
32
8
|
resetLibrary: () => void;
|
|
33
9
|
onSelectItems: (items: LibraryItem["id"][]) => void;
|
|
34
|
-
appState:
|
|
10
|
+
appState: UIAppState;
|
|
11
|
+
className?: string;
|
|
35
12
|
}>;
|
|
13
|
+
export declare const LibraryDropdownMenu: ({ selectedItems, onSelectItems, className, }: {
|
|
14
|
+
selectedItems: LibraryItem["id"][];
|
|
15
|
+
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
}) => JSX.Element;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExcalidrawProps, LibraryItem, LibraryItems, UIAppState } from "../types";
|
|
2
2
|
import "./LibraryMenuItems.scss";
|
|
3
|
-
|
|
3
|
+
export default function LibraryMenuItems({ isLoading, libraryItems, onAddToLibrary, onInsertLibraryItems, pendingElements, theme, id, libraryReturnUrl, onSelectItems, selectedItems, }: {
|
|
4
4
|
isLoading: boolean;
|
|
5
5
|
libraryItems: LibraryItems;
|
|
6
6
|
pendingElements: LibraryItem["elements"];
|
|
7
7
|
onInsertLibraryItems: (libraryItems: LibraryItems) => void;
|
|
8
8
|
onAddToLibrary: (elements: LibraryItem["elements"]) => void;
|
|
9
|
-
selectedItems: LibraryItem["id"][];
|
|
10
|
-
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
11
9
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
12
|
-
theme:
|
|
10
|
+
theme: UIAppState["theme"];
|
|
13
11
|
id: string;
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
selectedItems: LibraryItem["id"][];
|
|
13
|
+
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
14
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { LibraryItem } from "../types";
|
|
3
|
+
import { ExcalidrawElement, NonDeleted } from "../element/types";
|
|
4
|
+
import { SvgCache } from "../hooks/useLibraryItemSvg";
|
|
5
|
+
type LibraryOrPendingItem = (LibraryItem | /* pending library item */ {
|
|
6
|
+
id: null;
|
|
7
|
+
elements: readonly NonDeleted<ExcalidrawElement>[];
|
|
8
|
+
})[];
|
|
9
|
+
interface Props {
|
|
10
|
+
items: LibraryOrPendingItem;
|
|
11
|
+
onClick: (id: LibraryItem["id"] | null) => void;
|
|
12
|
+
onItemSelectToggle: (id: LibraryItem["id"], event: React.MouseEvent) => void;
|
|
13
|
+
onItemDrag: (id: LibraryItem["id"], event: React.DragEvent) => void;
|
|
14
|
+
isItemSelected: (id: LibraryItem["id"] | null) => boolean;
|
|
15
|
+
svgCache: SvgCache;
|
|
16
|
+
itemsRenderedPerBatch: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const LibraryMenuSectionGrid: ({ children, }: {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}) => JSX.Element;
|
|
21
|
+
export declare const LibraryMenuSection: React.MemoExoticComponent<({ items, onItemSelectToggle, onItemDrag, isItemSelected, onClick, svgCache, itemsRenderedPerBatch, }: Props) => JSX.Element>;
|
|
22
|
+
export {};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { LibraryItem } from "../types";
|
|
2
2
|
import "./LibraryUnit.scss";
|
|
3
|
-
|
|
3
|
+
import { SvgCache } from "../hooks/useLibraryItemSvg";
|
|
4
|
+
export declare const LibraryUnit: import("react").MemoExoticComponent<({ id, elements, isPending, onClick, selected, onToggle, onDrag, svgCache, }: {
|
|
4
5
|
id: LibraryItem["id"] | /** for pending item */ null;
|
|
5
6
|
elements?: readonly import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | undefined;
|
|
6
7
|
isPending?: boolean | undefined;
|
|
7
|
-
onClick: () => void;
|
|
8
|
+
onClick: (id: LibraryItem["id"] | null) => void;
|
|
8
9
|
selected: boolean;
|
|
9
10
|
onToggle: (id: string, event: React.MouseEvent) => void;
|
|
10
11
|
onDrag: (id: string, event: React.DragEvent) => void;
|
|
11
|
-
|
|
12
|
+
svgCache: SvgCache;
|
|
13
|
+
}) => JSX.Element>;
|
|
14
|
+
export declare const EmptyLibraryUnit: () => JSX.Element;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import "./ToolIcon.scss";
|
|
2
|
-
|
|
2
|
+
type LockIconProps = {
|
|
3
3
|
title?: string;
|
|
4
4
|
name?: string;
|
|
5
5
|
checked: boolean;
|
|
6
6
|
onChange?(): void;
|
|
7
|
-
zenModeEnabled?: boolean;
|
|
8
7
|
isMobile?: boolean;
|
|
9
8
|
};
|
|
10
9
|
export declare const LockButton: (props: LockIconProps) => JSX.Element;
|
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AppState, Device, ExcalidrawProps,
|
|
2
|
+
import { AppClassProperties, AppState, Device, ExcalidrawProps, UIAppState } from "../types";
|
|
3
3
|
import { ActionManager } from "../actions/manager";
|
|
4
4
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
|
-
|
|
6
|
-
appState:
|
|
5
|
+
type MobileMenuProps = {
|
|
6
|
+
appState: UIAppState;
|
|
7
7
|
actionManager: ActionManager;
|
|
8
8
|
renderJSONExportDialog: () => React.ReactNode;
|
|
9
9
|
renderImageExportDialog: () => React.ReactNode;
|
|
10
10
|
setAppState: React.Component<any, AppState>["setState"];
|
|
11
11
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
12
12
|
onLockToggle: () => void;
|
|
13
|
+
onHandToolToggle: () => void;
|
|
13
14
|
onPenModeToggle: () => void;
|
|
14
|
-
|
|
15
|
-
onImageAction: (data: {
|
|
16
|
-
insertOnCanvasDirectly: boolean;
|
|
17
|
-
}) => void;
|
|
18
|
-
renderTopRightUI?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
|
|
15
|
+
renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
19
16
|
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
20
17
|
renderSidebars: () => JSX.Element | null;
|
|
21
18
|
device: Device;
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
renderWelcomeScreen: boolean;
|
|
20
|
+
app: AppClassProperties;
|
|
24
21
|
onHomeButtonClick: () => void;
|
|
25
22
|
};
|
|
26
|
-
export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle,
|
|
23
|
+
export declare const MobileMenu: ({ appState, elements, actionManager, setAppState, onLockToggle, onHandToolToggle, onPenModeToggle, renderTopRightUI, renderCustomStats, renderSidebars, device, renderWelcomeScreen, app, onHomeButtonClick, }: MobileMenuProps) => JSX.Element;
|
|
27
24
|
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>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { UIAppState } from "../types";
|
|
3
3
|
import "./PasteChartDialog.scss";
|
|
4
|
-
export declare const PasteChartDialog: ({ setAppState, appState, onClose,
|
|
5
|
-
appState:
|
|
4
|
+
export declare const PasteChartDialog: ({ setAppState, appState, onClose, }: {
|
|
5
|
+
appState: UIAppState;
|
|
6
6
|
onClose: () => void;
|
|
7
|
-
setAppState: React.Component<any,
|
|
8
|
-
onInsertChart: (elements: LibraryItem["elements"]) => void;
|
|
7
|
+
setAppState: React.Component<any, UIAppState>["setState"];
|
|
9
8
|
}) => JSX.Element;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "./TextInput.scss";
|
|
2
2
|
import "./ProjectName.scss";
|
|
3
|
-
|
|
3
|
+
type Props = {
|
|
4
4
|
value: string;
|
|
5
5
|
onChange: (value: string) => void;
|
|
6
6
|
label: string;
|
|
7
7
|
isNameEditable: boolean;
|
|
8
|
+
ignoreFocus?: boolean;
|
|
8
9
|
};
|
|
9
10
|
export declare const ProjectName: (props: Props) => JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LibraryItems, UIAppState } from "../types";
|
|
2
2
|
import "./PublishLibrary.scss";
|
|
3
3
|
declare const PublishLibrary: ({ onClose, libraryItems, appState, onSuccess, onError, updateItemsInStorage, onRemove, }: {
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
libraryItems: LibraryItems;
|
|
6
|
-
appState:
|
|
6
|
+
appState: UIAppState;
|
|
7
7
|
onSuccess: (data: {
|
|
8
8
|
url: string;
|
|
9
9
|
authorName: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./RadioGroup.scss";
|
|
2
|
+
export type RadioGroupChoice<T> = {
|
|
3
|
+
value: T;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
export type RadioGroupProps<T> = {
|
|
7
|
+
choices: RadioGroupChoice<T>[];
|
|
8
|
+
value: T;
|
|
9
|
+
onChange: (value: T) => void;
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const RadioGroup: <T>({ onChange, value, choices, name, }: RadioGroupProps<T>) => JSX.Element;
|