@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,73 +1,76 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import "./Sidebar.scss";
|
|
3
|
-
/**
|
|
4
|
-
* the
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} & {
|
|
14
|
-
<Value_3>(atom: import("jotai").Atom<Value_3 | Promise<Value_3>>, options: {
|
|
15
|
-
unstable_promise: true;
|
|
16
|
-
}): Value_3 | Promise<Value_3>;
|
|
17
|
-
<Value_4>(atom: import("jotai").Atom<Promise<Value_4>>, options: {
|
|
18
|
-
unstable_promise: true;
|
|
19
|
-
}): Value_4 | Promise<Value_4>;
|
|
20
|
-
<Value_5>(atom: import("jotai").Atom<Value_5>, options: {
|
|
21
|
-
unstable_promise: true;
|
|
22
|
-
}): (Value_5 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_5) | Promise<Value_5 extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? V extends Promise<infer V> ? any : V : V : V : V : V : V : V : V : V : V : Value_5>;
|
|
23
|
-
}, set: {
|
|
24
|
-
<Value_6, Result extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_6, undefined, Result>): Result;
|
|
25
|
-
<Value_7, Update, Result_1 extends void | Promise<void>>(atom: import("jotai").WritableAtom<Value_7, Update, Result_1>, update: Update): Result_1;
|
|
26
|
-
}, update: {
|
|
27
|
-
rendered: number;
|
|
28
|
-
docked: number;
|
|
29
|
-
} | ((prev: {
|
|
30
|
-
rendered: number;
|
|
31
|
-
docked: number;
|
|
32
|
-
}) => {
|
|
33
|
-
rendered: number;
|
|
34
|
-
docked: number;
|
|
35
|
-
})) => void;
|
|
36
|
-
onMount?: (<S extends (update: {
|
|
37
|
-
rendered: number;
|
|
38
|
-
docked: number;
|
|
39
|
-
} | ((prev: {
|
|
40
|
-
rendered: number;
|
|
41
|
-
docked: number;
|
|
42
|
-
}) => {
|
|
43
|
-
rendered: number;
|
|
44
|
-
docked: number;
|
|
45
|
-
})) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
46
|
-
} & {
|
|
47
|
-
init: {
|
|
48
|
-
rendered: number;
|
|
49
|
-
docked: number;
|
|
50
|
-
};
|
|
3
|
+
/**
|
|
4
|
+
* Flags whether the currently rendered Sidebar is docked or not, for use
|
|
5
|
+
* in upstream components that need to act on this (e.g. LayerUI to shift the
|
|
6
|
+
* UI). We use an atom because of potential host app sidebars (for the default
|
|
7
|
+
* sidebar we could just read from appState.defaultSidebarDockedPreference).
|
|
8
|
+
*
|
|
9
|
+
* Since we can only render one Sidebar at a time, we can use a simple flag.
|
|
10
|
+
*/
|
|
11
|
+
export declare const isSidebarDockedAtom: import("jotai").PrimitiveAtom<boolean> & {
|
|
12
|
+
init: boolean;
|
|
51
13
|
};
|
|
52
|
-
export declare const
|
|
53
|
-
|
|
54
|
-
|
|
14
|
+
export declare const SidebarInner: React.ForwardRefExoticComponent<Pick<{
|
|
15
|
+
name: string;
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
onStateChange?: ((state: {
|
|
18
|
+
name: string;
|
|
19
|
+
tab?: string | undefined;
|
|
20
|
+
} | null) => void) | undefined;
|
|
21
|
+
onDock?: ((docked: boolean) => void) | undefined;
|
|
22
|
+
docked?: boolean | undefined;
|
|
23
|
+
className?: string | undefined;
|
|
24
|
+
__fallback?: boolean | undefined;
|
|
25
|
+
} & Omit<React.RefAttributes<HTMLDivElement>, "onSelect">, "name" | "children" | "key" | "className" | "onDock" | "docked" | "onStateChange" | "__fallback"> & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
export declare const Sidebar: React.ForwardRefExoticComponent<{
|
|
27
|
+
name: string;
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
onStateChange?: ((state: {
|
|
30
|
+
name: string;
|
|
31
|
+
tab?: string | undefined;
|
|
32
|
+
} | null) => void) | undefined;
|
|
55
33
|
onDock?: ((docked: boolean) => void) | undefined;
|
|
56
34
|
docked?: boolean | undefined;
|
|
57
|
-
initialDockedState?: boolean | undefined;
|
|
58
|
-
dockable?: boolean | undefined;
|
|
59
35
|
className?: string | undefined;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
__isInternal?: boolean | undefined;
|
|
63
|
-
} & import("react").RefAttributes<HTMLDivElement>> & {
|
|
36
|
+
__fallback?: boolean | undefined;
|
|
37
|
+
} & React.RefAttributes<HTMLDivElement>> & {
|
|
64
38
|
Header: {
|
|
65
|
-
(
|
|
66
|
-
children?:
|
|
39
|
+
({ children, className, }: {
|
|
40
|
+
children?: React.ReactNode;
|
|
67
41
|
className?: string | undefined;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
42
|
+
}): JSX.Element;
|
|
43
|
+
displayName: string;
|
|
44
|
+
};
|
|
45
|
+
TabTriggers: {
|
|
46
|
+
({ children, ...rest }: {
|
|
47
|
+
children: React.ReactNode;
|
|
48
|
+
} & Omit<React.RefAttributes<HTMLDivElement>, "onSelect">): JSX.Element;
|
|
49
|
+
displayName: string;
|
|
50
|
+
};
|
|
51
|
+
TabTrigger: {
|
|
52
|
+
({ children, tab, onSelect, ...rest }: {
|
|
53
|
+
children: React.ReactNode;
|
|
54
|
+
tab: string;
|
|
55
|
+
onSelect?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
56
|
+
} & Omit<React.HTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
|
|
57
|
+
displayName: string;
|
|
58
|
+
};
|
|
59
|
+
Tabs: {
|
|
60
|
+
({ children, ...rest }: {
|
|
61
|
+
children: React.ReactNode;
|
|
62
|
+
} & Omit<React.RefAttributes<HTMLDivElement>, "onSelect">): JSX.Element | null;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
Tab: {
|
|
66
|
+
({ tab, children, ...rest }: {
|
|
67
|
+
tab: string;
|
|
68
|
+
children: React.ReactNode;
|
|
69
|
+
} & React.HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
70
|
+
displayName: string;
|
|
71
|
+
};
|
|
72
|
+
Trigger: {
|
|
73
|
+
({ name, tab, icon, title, children, onToggle, className, style, }: import("./common").SidebarTriggerProps): JSX.Element;
|
|
71
74
|
displayName: string;
|
|
72
75
|
};
|
|
73
76
|
};
|
|
@@ -1,20 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
})
|
|
6
|
-
|
|
7
|
-
export declare const SidebarHeaderComponents: {
|
|
8
|
-
Context: import("react").FC<{
|
|
9
|
-
children: import("react").ReactNode;
|
|
10
|
-
}>;
|
|
11
|
-
Component: {
|
|
12
|
-
(props: {
|
|
13
|
-
children?: React.ReactNode;
|
|
14
|
-
className?: string | undefined;
|
|
15
|
-
} & {
|
|
16
|
-
__isFallback?: boolean | undefined;
|
|
17
|
-
}): JSX.Element | null;
|
|
18
|
-
displayName: string;
|
|
19
|
-
};
|
|
1
|
+
export declare const SidebarHeader: {
|
|
2
|
+
({ children, className, }: {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
className?: string | undefined;
|
|
5
|
+
}): JSX.Element;
|
|
6
|
+
displayName: string;
|
|
20
7
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SidebarTabName } from "../../types";
|
|
2
|
+
export declare const SidebarTabTrigger: {
|
|
3
|
+
({ children, tab, onSelect, ...rest }: {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
tab: SidebarTabName;
|
|
6
|
+
onSelect?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
7
|
+
} & Omit<import("react").HTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import { AppState, SidebarName, SidebarTabName } from "../../types";
|
|
3
|
+
export type SidebarTriggerProps = {
|
|
4
|
+
name: SidebarName;
|
|
5
|
+
tab?: SidebarTabName;
|
|
6
|
+
icon?: JSX.Element;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
title?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
onToggle?: (open: boolean) => void;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
};
|
|
13
|
+
export type SidebarProps<P = {}> = {
|
|
14
|
+
name: SidebarName;
|
|
3
15
|
children: React.ReactNode;
|
|
4
16
|
/**
|
|
5
|
-
* Called on sidebar close
|
|
17
|
+
* Called on sidebar open/close or tab change.
|
|
18
|
+
*/
|
|
19
|
+
onStateChange?: (state: AppState["openSidebar"]) => void;
|
|
20
|
+
/**
|
|
21
|
+
* supply alongside `docked` prop in order to make the Sidebar user-dockable
|
|
6
22
|
*/
|
|
7
|
-
onClose?: () => void | boolean;
|
|
8
|
-
/** if not supplied, sidebar won't be dockable */
|
|
9
23
|
onDock?: (docked: boolean) => void;
|
|
10
24
|
docked?: boolean;
|
|
11
|
-
initialDockedState?: boolean;
|
|
12
|
-
dockable?: boolean;
|
|
13
25
|
className?: string;
|
|
26
|
+
/** @private internal */
|
|
27
|
+
__fallback?: boolean;
|
|
14
28
|
} & P;
|
|
15
|
-
export
|
|
29
|
+
export type SidebarPropsContextValue = Pick<SidebarProps, "onDock" | "docked"> & {
|
|
30
|
+
onCloseRequest: () => void;
|
|
31
|
+
shouldRenderDockButton: boolean;
|
|
32
|
+
};
|
|
16
33
|
export declare const SidebarPropsContext: React.Context<SidebarPropsContextValue>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./Spinner.scss";
|
|
2
|
-
declare const Spinner: ({ size, circleWidth, }: {
|
|
2
|
+
declare const Spinner: ({ size, circleWidth, synchronized, }: {
|
|
3
3
|
size?: string | number | undefined;
|
|
4
4
|
circleWidth?: number | undefined;
|
|
5
|
+
synchronized?: boolean | undefined;
|
|
5
6
|
}) => JSX.Element;
|
|
6
7
|
export default Spinner;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import "./Stack.scss";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
3
|
+
type StackProps = {
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
gap?: number;
|
|
6
6
|
align?: "start" | "center" | "end" | "baseline";
|
|
7
7
|
justifyContent?: "center" | "space-around" | "space-between";
|
|
8
8
|
className?: string | boolean;
|
|
9
9
|
style?: React.CSSProperties;
|
|
10
|
+
ref: React.RefObject<HTMLDivElement>;
|
|
10
11
|
};
|
|
11
12
|
declare const _default: {
|
|
12
|
-
Row:
|
|
13
|
-
Col:
|
|
13
|
+
Row: React.ForwardRefExoticComponent<Pick<StackProps, "style" | "children" | "align" | "gap" | "className" | "justifyContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Col: React.ForwardRefExoticComponent<Pick<StackProps, "style" | "children" | "align" | "gap" | "className" | "justifyContent"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
15
|
};
|
|
15
16
|
export default _default;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
3
|
-
import {
|
|
3
|
+
import { ExcalidrawProps, UIAppState } from "../types";
|
|
4
4
|
import "./Stats.scss";
|
|
5
5
|
export declare const Stats: (props: {
|
|
6
|
-
appState:
|
|
7
|
-
setAppState: React.Component<any,
|
|
6
|
+
appState: UIAppState;
|
|
7
|
+
setAppState: React.Component<any, UIAppState>["setState"];
|
|
8
8
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
9
9
|
onClose: () => void;
|
|
10
10
|
renderCustomStats: ExcalidrawProps["renderCustomStats"];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./Switch.scss";
|
|
2
|
+
export type SwitchProps = {
|
|
3
|
+
name: string;
|
|
4
|
+
checked: boolean;
|
|
5
|
+
title?: string;
|
|
6
|
+
onChange: (value: boolean) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const Switch: ({ title, name, checked, onChange, disabled, }: SwitchProps) => JSX.Element;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./ToolIcon.scss";
|
|
2
|
-
import React from "react";
|
|
2
|
+
import React, { CSSProperties } from "react";
|
|
3
3
|
import { PointerType } from "../element/types";
|
|
4
|
-
export
|
|
5
|
-
|
|
4
|
+
export type ToolButtonSize = "small" | "medium";
|
|
5
|
+
type ToolButtonBaseProps = {
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
"aria-label": string;
|
|
8
8
|
"aria-keyshortcuts"?: string;
|
|
@@ -12,15 +12,16 @@ declare type ToolButtonBaseProps = {
|
|
|
12
12
|
name?: string;
|
|
13
13
|
id?: string;
|
|
14
14
|
size?: ToolButtonSize;
|
|
15
|
-
keyBindingLabel?: string;
|
|
15
|
+
keyBindingLabel?: string | null;
|
|
16
16
|
showAriaLabel?: boolean;
|
|
17
17
|
hidden?: boolean;
|
|
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 & {
|
|
24
25
|
type: "button";
|
|
25
26
|
children?: React.ReactNode;
|
|
26
27
|
onClick?(event: React.MouseEvent): void;
|
|
@@ -7,7 +7,7 @@ export declare const updateTooltipPosition: (tooltip: HTMLDivElement, item: {
|
|
|
7
7
|
width: number;
|
|
8
8
|
height: number;
|
|
9
9
|
}, position?: "bottom" | "top") => void;
|
|
10
|
-
|
|
10
|
+
type TooltipProps = {
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
label: string;
|
|
13
13
|
long?: boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TranslationKeys } from "../i18n";
|
|
3
|
+
declare const Trans: ({ i18nKey, children, ...props }: {
|
|
4
|
+
[key: string]: React.ReactNode | ((el: React.ReactNode) => React.ReactNode);
|
|
5
|
+
i18nKey: TranslationKeys;
|
|
6
|
+
}) => React.FunctionComponentElement<{
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}>;
|
|
9
|
+
export default Trans;
|
|
@@ -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;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { RoughCanvas } from "roughjs/bin/canvas";
|
|
3
|
+
import type { StaticCanvasAppState } from "../../types";
|
|
4
|
+
import type { StaticCanvasRenderConfig } from "../../scene/types";
|
|
5
|
+
import type { NonDeletedExcalidrawElement } from "../../element/types";
|
|
6
|
+
type StaticCanvasProps = {
|
|
7
|
+
canvas: HTMLCanvasElement;
|
|
8
|
+
rc: RoughCanvas;
|
|
9
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
10
|
+
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
11
|
+
versionNonce: number | undefined;
|
|
12
|
+
selectionNonce: number | undefined;
|
|
13
|
+
scale: number;
|
|
14
|
+
appState: StaticCanvasAppState;
|
|
15
|
+
renderConfig: StaticCanvasRenderConfig;
|
|
16
|
+
};
|
|
17
|
+
declare const _default: React.MemoExoticComponent<(props: StaticCanvasProps) => JSX.Element>;
|
|
18
|
+
export default _default;
|
|
@@ -6,45 +6,51 @@ declare const DropdownMenu: {
|
|
|
6
6
|
open: boolean;
|
|
7
7
|
}): JSX.Element;
|
|
8
8
|
Trigger: {
|
|
9
|
-
({ className, children, onToggle, }: {
|
|
9
|
+
({ className, children, onToggle, title, ...rest }: {
|
|
10
10
|
className?: string | undefined;
|
|
11
11
|
children: React.ReactNode;
|
|
12
12
|
onToggle: () => void;
|
|
13
|
-
|
|
13
|
+
title?: string | undefined;
|
|
14
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
|
|
14
15
|
displayName: string;
|
|
15
16
|
};
|
|
16
17
|
Content: {
|
|
17
|
-
({ children, onClickOutside, className, style, }: {
|
|
18
|
+
({ children, onClickOutside, className, onSelect, style, }: {
|
|
18
19
|
children?: React.ReactNode;
|
|
19
20
|
onClickOutside?: (() => void) | undefined;
|
|
20
21
|
className?: string | undefined;
|
|
22
|
+
onSelect?: ((event: Event) => void) | undefined;
|
|
21
23
|
style?: React.CSSProperties | undefined;
|
|
22
24
|
}): JSX.Element;
|
|
23
25
|
displayName: string;
|
|
24
26
|
};
|
|
25
27
|
Item: {
|
|
26
|
-
({ icon, onSelect, children, shortcut, className, ...rest }: {
|
|
28
|
+
({ icon, onSelect, children, shortcut, className, selected, ...rest }: {
|
|
27
29
|
icon?: JSX.Element | undefined;
|
|
28
|
-
onSelect: () => void;
|
|
30
|
+
onSelect: (event: Event) => void;
|
|
29
31
|
children: React.ReactNode;
|
|
30
32
|
shortcut?: string | undefined;
|
|
33
|
+
selected?: boolean | undefined;
|
|
31
34
|
className?: string | undefined;
|
|
32
|
-
} & React.ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
|
|
35
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
|
|
33
36
|
displayName: string;
|
|
34
37
|
};
|
|
35
38
|
ItemLink: {
|
|
36
|
-
({ icon, shortcut, href, children, className, ...rest }: {
|
|
39
|
+
({ icon, shortcut, href, children, onSelect, className, selected, ...rest }: {
|
|
40
|
+
href: string;
|
|
37
41
|
icon?: JSX.Element | undefined;
|
|
38
42
|
children: React.ReactNode;
|
|
39
43
|
shortcut?: string | undefined;
|
|
40
44
|
className?: string | undefined;
|
|
41
|
-
|
|
45
|
+
selected?: boolean | undefined;
|
|
46
|
+
onSelect?: ((event: Event) => void) | undefined;
|
|
42
47
|
} & React.AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
43
48
|
displayName: string;
|
|
44
49
|
};
|
|
45
|
-
ItemCustom: ({ children, className, ...rest }: {
|
|
50
|
+
ItemCustom: ({ children, className, selected, ...rest }: {
|
|
46
51
|
children: React.ReactNode;
|
|
47
52
|
className?: string | undefined;
|
|
53
|
+
selected?: boolean | undefined;
|
|
48
54
|
} & React.HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
49
55
|
Group: {
|
|
50
56
|
({ children, className, style, title, }: {
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
declare const MenuContent: {
|
|
3
|
-
({ children, onClickOutside, className, style, }: {
|
|
3
|
+
({ children, onClickOutside, className, onSelect, style, }: {
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
onClickOutside?: (() => void) | undefined;
|
|
6
6
|
className?: string | undefined;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Called when any menu item is selected (clicked on).
|
|
9
|
+
*/
|
|
10
|
+
onSelect?: ((event: Event) => void) | undefined;
|
|
11
|
+
style?: React.CSSProperties | undefined;
|
|
8
12
|
}): JSX.Element;
|
|
9
13
|
displayName: string;
|
|
10
14
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const getDrodownMenuItemClassName: (className?: string) => string;
|
|
3
2
|
declare const DropdownMenuItem: {
|
|
4
|
-
({ icon, onSelect, children, shortcut, className, ...rest }: {
|
|
3
|
+
({ icon, onSelect, children, shortcut, className, selected, ...rest }: {
|
|
5
4
|
icon?: JSX.Element | undefined;
|
|
6
|
-
onSelect: () => void;
|
|
5
|
+
onSelect: (event: Event) => void;
|
|
7
6
|
children: React.ReactNode;
|
|
8
7
|
shortcut?: string | undefined;
|
|
8
|
+
selected?: boolean | undefined;
|
|
9
9
|
className?: string | undefined;
|
|
10
|
-
} & React.ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
|
|
10
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
|
|
11
11
|
displayName: string;
|
|
12
12
|
};
|
|
13
13
|
export default DropdownMenuItem;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare const DropdownMenuItemCustom: ({ children, className, ...rest }: {
|
|
2
|
+
declare const DropdownMenuItemCustom: ({ children, className, selected, ...rest }: {
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
className?: string | undefined;
|
|
5
|
+
selected?: boolean | undefined;
|
|
5
6
|
} & React.HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
6
7
|
export default DropdownMenuItemCustom;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
declare const DropdownMenuItemLink: {
|
|
3
|
-
({ icon, shortcut, href, children, className, ...rest }: {
|
|
3
|
+
({ icon, shortcut, href, children, onSelect, className, selected, ...rest }: {
|
|
4
|
+
href: string;
|
|
4
5
|
icon?: JSX.Element | undefined;
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
shortcut?: string | undefined;
|
|
7
8
|
className?: string | undefined;
|
|
8
|
-
|
|
9
|
+
selected?: boolean | undefined;
|
|
10
|
+
onSelect?: ((event: Event) => void) | undefined;
|
|
9
11
|
} & React.AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
10
12
|
displayName: string;
|
|
11
13
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
declare const MenuTrigger: {
|
|
2
|
-
({ className, children, onToggle, }: {
|
|
2
|
+
({ className, children, onToggle, title, ...rest }: {
|
|
3
3
|
className?: string | undefined;
|
|
4
4
|
children: React.ReactNode;
|
|
5
5
|
onToggle: () => void;
|
|
6
|
-
|
|
6
|
+
title?: string | undefined;
|
|
7
|
+
} & Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
|
|
7
8
|
displayName: string;
|
|
8
9
|
};
|
|
9
10
|
export default MenuTrigger;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const DropdownMenuContentPropsContext: React.Context<{
|
|
3
|
+
onSelect?: ((event: Event) => void) | undefined;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const getDropdownMenuItemClassName: (className?: string, selected?: boolean) => string;
|
|
6
|
+
export declare const useHandleDropdownMenuItemClick: (origOnClick: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement> | undefined, onSelect: ((event: Event) => void) | undefined) => (event: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement, MouseEvent>) => void;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ActionManager } from "../../actions/manager";
|
|
2
|
-
import {
|
|
2
|
+
import { UIAppState } from "../../types";
|
|
3
3
|
declare const Footer: {
|
|
4
|
-
({ appState, actionManager, showExitZenModeBtn,
|
|
5
|
-
appState:
|
|
4
|
+
({ appState, actionManager, showExitZenModeBtn, renderWelcomeScreen, }: {
|
|
5
|
+
appState: UIAppState;
|
|
6
6
|
actionManager: ActionManager;
|
|
7
7
|
showExitZenModeBtn: boolean;
|
|
8
|
-
|
|
9
|
-
welcomeScreenHelp: UIWelcomeScreenComponents["HelpHint"];
|
|
8
|
+
renderWelcomeScreen: boolean;
|
|
10
9
|
}): JSX.Element;
|
|
11
10
|
displayName: string;
|
|
12
11
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Theme } from "../element/types";
|
|
3
|
-
declare
|
|
3
|
+
export declare const iconFillColor: (theme: Theme) => string;
|
|
4
|
+
type Opts = {
|
|
4
5
|
width?: number;
|
|
5
6
|
height?: number;
|
|
6
7
|
mirror?: true;
|
|
@@ -31,6 +32,7 @@ export declare const EraserIcon: JSX.Element;
|
|
|
31
32
|
export declare const ZoomInIcon: JSX.Element;
|
|
32
33
|
export declare const ZoomOutIcon: JSX.Element;
|
|
33
34
|
export declare const TrashIcon: JSX.Element;
|
|
35
|
+
export declare const EmbedIcon: JSX.Element;
|
|
34
36
|
export declare const DuplicateIcon: JSX.Element;
|
|
35
37
|
export declare const MoonIcon: JSX.Element;
|
|
36
38
|
export declare const SunIcon: JSX.Element;
|
|
@@ -87,6 +89,7 @@ export declare const GroupIcon: React.MemoExoticComponent<({ theme }: {
|
|
|
87
89
|
export declare const UngroupIcon: React.MemoExoticComponent<({ theme }: {
|
|
88
90
|
theme: Theme;
|
|
89
91
|
}) => JSX.Element>;
|
|
92
|
+
export declare const FillZigZagIcon: JSX.Element;
|
|
90
93
|
export declare const FillHachureIcon: JSX.Element;
|
|
91
94
|
export declare const FillCrossHatchIcon: JSX.Element;
|
|
92
95
|
export declare const FillSolidIcon: JSX.Element;
|
|
@@ -136,4 +139,16 @@ export declare const TextAlignMiddleIcon: React.MemoExoticComponent<({ theme }:
|
|
|
136
139
|
}) => JSX.Element>;
|
|
137
140
|
export declare const publishIcon: JSX.Element;
|
|
138
141
|
export declare const eraser: JSX.Element;
|
|
142
|
+
export declare const handIcon: JSX.Element;
|
|
143
|
+
export declare const downloadIcon: JSX.Element;
|
|
144
|
+
export declare const copyIcon: JSX.Element;
|
|
145
|
+
export declare const helpIcon: JSX.Element;
|
|
146
|
+
export declare const playerPlayIcon: JSX.Element;
|
|
147
|
+
export declare const playerStopFilledIcon: JSX.Element;
|
|
148
|
+
export declare const tablerCheckIcon: JSX.Element;
|
|
149
|
+
export declare const alertTriangleIcon: JSX.Element;
|
|
150
|
+
export declare const eyeDropperIcon: JSX.Element;
|
|
151
|
+
export declare const extraToolsIcon: JSX.Element;
|
|
152
|
+
export declare const frameToolIcon: JSX.Element;
|
|
153
|
+
export declare const laserPointerToolIcon: JSX.Element;
|
|
139
154
|
export {};
|