@dwelle/excalidraw 0.4.0-e80989b → 0.4.0-eadd4b9
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 +458 -0
- package/README.md +16 -1424
- package/dist/excalidraw.development.js +1829 -500
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +20 -0
- package/package.json +3 -3
- package/types/actions/actionAddToLibrary.d.ts +68 -34
- package/types/actions/actionAlign.d.ts +12 -18
- package/types/actions/actionBoundText.d.ts +158 -19
- package/types/actions/actionCanvas.d.ts +430 -118
- package/types/actions/actionClipboard.d.ts +132 -59
- package/types/actions/actionDeleteSelected.d.ts +72 -41
- package/types/actions/actionDistribute.d.ts +2 -6
- package/types/actions/actionDuplicateSelection.d.ts +2 -4
- package/types/actions/actionElementLock.d.ts +254 -0
- package/types/actions/actionExport.d.ts +215 -131
- package/types/actions/actionFinalize.d.ts +47 -27
- package/types/actions/actionFlip.d.ts +2 -4
- package/types/actions/actionFrame.d.ts +397 -0
- package/types/actions/actionGroup.d.ts +6 -10
- package/types/actions/actionHistory.d.ts +1 -1
- package/types/actions/actionLinearEditor.d.ts +25 -13
- package/types/actions/actionMenu.d.ts +73 -46
- package/types/actions/actionNavigate.d.ts +2 -3
- package/types/actions/actionProperties.d.ts +315 -198
- package/types/actions/actionStyles.d.ts +23 -12
- package/types/actions/actionToggleGridMode.d.ts +25 -12
- package/types/actions/actionToggleStats.d.ts +24 -12
- package/types/actions/actionToggleViewMode.d.ts +25 -12
- package/types/actions/actionToggleZenMode.d.ts +25 -12
- package/types/actions/actionZindex.d.ts +8 -16
- package/types/actions/index.d.ts +1 -1
- package/types/actions/manager.d.ts +3 -2
- package/types/actions/shortcuts.d.ts +2 -1
- package/types/actions/types.d.ts +13 -11
- package/types/appState.d.ts +16 -12
- package/types/charts.d.ts +2 -2
- package/types/clients.d.ts +5 -6
- package/types/clipboard.d.ts +2 -2
- package/types/colors.d.ts +60 -5
- package/types/components/Actions.d.ts +5 -5
- package/types/components/ActiveConfirmDialog.d.ts +4 -0
- package/types/components/App.d.ts +52 -68
- package/types/components/Avatar.d.ts +1 -2
- package/types/components/BraveMeasureTextError.d.ts +2 -0
- package/types/components/Button.d.ts +17 -0
- package/types/components/ButtonIconSelect.d.ts +11 -3
- package/types/components/Card.d.ts +7 -0
- package/types/components/ColorPicker/ColorInput.d.ts +7 -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 +21 -0
- package/types/components/ContextMenu.d.ts +9 -22
- package/types/components/DefaultSidebar.d.ts +30 -0
- package/types/components/Dialog.d.ts +2 -4
- package/types/components/ErrorDialog.d.ts +3 -2
- package/types/components/EyeDropper.d.ts +18 -0
- package/types/components/FilledButton.d.ts +16 -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 +2 -2
- 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 +6 -4
- package/types/components/LayerUI.d.ts +7 -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 +11 -5
- package/types/components/LibraryMenuItems.d.ts +6 -7
- package/types/components/LibraryMenuSection.d.ts +22 -0
- package/types/components/LibraryUnit.d.ts +7 -3
- package/types/components/LockButton.d.ts +1 -2
- package/types/components/MobileMenu.d.ts +8 -11
- 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/Sidebar/Sidebar.d.ts +66 -63
- package/types/components/Sidebar/SidebarHeader.d.ts +6 -19
- package/types/components/Sidebar/SidebarTab.d.ts +9 -0
- package/types/components/Sidebar/SidebarTabTrigger.d.ts +10 -0
- package/types/components/Sidebar/SidebarTabTriggers.d.ts +7 -0
- package/types/components/Sidebar/SidebarTabs.d.ts +7 -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 +8 -0
- package/types/components/UserList.d.ts +0 -2
- package/types/components/dropdownMenu/DropdownMenu.d.ts +67 -0
- package/types/components/dropdownMenu/DropdownMenuContent.d.ts +15 -0
- package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +12 -0
- package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +13 -0
- package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +11 -0
- package/types/components/dropdownMenu/common.d.ts +6 -0
- package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
- package/types/components/footer/Footer.d.ts +12 -0
- package/types/components/footer/FooterCenter.d.ts +8 -0
- package/types/components/hoc/withInternalFallback.d.ts +4 -0
- package/types/components/icons.d.ts +13 -2
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +10 -0
- package/types/components/main-menu/DefaultItems.d.ts +47 -0
- package/types/components/main-menu/MainMenu.d.ts +61 -0
- package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +58 -0
- package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
- package/types/components/welcome-screen/WelcomeScreen.d.ts +85 -0
- package/types/constants.d.ts +73 -16
- package/types/context/tunnels.d.ts +18 -0
- package/types/context/ui-appState.d.ts +4 -0
- package/types/data/blob.d.ts +3 -2
- package/types/data/encode.d.ts +1 -1
- package/types/data/filesystem.d.ts +2 -1
- package/types/data/index.d.ts +1 -1
- package/types/data/library.d.ts +3 -45
- package/types/data/restore.d.ts +10 -4
- package/types/data/types.d.ts +3 -5
- package/types/element/Hyperlink.d.ts +27 -18
- package/types/element/binding.d.ts +3 -3
- package/types/element/bounds.d.ts +32 -7
- package/types/element/collision.d.ts +7 -7
- package/types/element/dragElements.d.ts +2 -1
- package/types/element/image.d.ts +11 -1
- package/types/element/index.d.ts +3 -2
- package/types/element/linearElementEditor.d.ts +24 -13
- package/types/element/mutateElement.d.ts +2 -1
- package/types/element/newElement.d.ts +37 -11
- package/types/element/resizeElements.d.ts +1 -0
- package/types/element/showSelectedShapeActions.d.ts +2 -2
- package/types/element/sortElements.d.ts +2 -0
- package/types/element/textElement.d.ts +40 -5
- package/types/element/textWysiwyg.d.ts +6 -1
- package/types/element/transformHandles.d.ts +12 -5
- package/types/element/typeChecks.d.ts +12 -2
- package/types/element/types.d.ts +53 -36
- package/types/emitter.d.ts +1 -1
- package/types/errors.d.ts +1 -1
- package/types/frame.d.ts +40 -0
- package/types/ga.d.ts +5 -5
- package/types/groups.d.ts +4 -0
- package/types/hooks/useCreatePortalContainer.d.ts +4 -0
- package/types/hooks/useLibraryItemSvg.d.ts +11 -0
- package/types/hooks/useOutsideClick.d.ts +19 -1
- package/types/hooks/useScrollPosition.d.ts +2 -0
- package/types/hooks/useTransition.d.ts +2 -0
- package/types/i18n.d.ts +7 -1
- package/types/jotai.d.ts +20 -108
- package/types/keys.d.ts +4 -4
- package/types/math.d.ts +4 -1
- package/types/packages/excalidraw/example/App.d.ts +7 -1
- package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/initialData.d.ts +6 -0
- package/types/packages/excalidraw/index.d.ts +17 -3
- package/types/packages/utils.d.ts +26 -25
- package/types/renderer/renderElement.d.ts +7 -5
- package/types/renderer/renderScene.d.ts +13 -6
- package/types/renderer/roundRect.d.ts +1 -1
- package/types/scene/Scene.d.ts +12 -5
- package/types/scene/comparisons.d.ts +1 -1
- package/types/scene/export.d.ts +157 -10
- package/types/scene/index.d.ts +1 -1
- package/types/scene/selection.d.ts +15 -5
- package/types/scene/types.d.ts +13 -5
- package/types/types.d.ts +126 -77
- package/types/utility-types.d.ts +22 -0
- package/types/utils.d.ts +40 -9
- package/types/zindex.d.ts +4 -4
- package/types/actions/actionToggleLock.d.ts +0 -116
- package/types/components/ActiveFile.d.ts +0 -7
- package/types/components/ClearCanvas.d.ts +0 -4
- package/types/components/CollabButton.d.ts +0 -6
- package/types/components/ColorPicker.d.ts +0 -14
- package/types/components/Footer.d.ts +0 -10
- package/types/components/LibraryButton.d.ts +0 -8
- package/types/components/MenuItem.d.ts +0 -11
- package/types/components/MenuUtils.d.ts +0 -1
- package/types/components/SingleLibraryItem.d.ts +0 -10
- package/types/components/WelcomeScreen.d.ts +0 -10
- package/types/components/WelcomeScreenDecor.d.ts +0 -6
- package/types/components/hoc/withUpstreamOverride.d.ts +0 -10
|
@@ -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">, "className" | "name" | "children" | "key" | "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
|
+
/// <reference types="react" />
|
|
2
|
+
import { SidebarTabName } from "../../types";
|
|
3
|
+
export declare const SidebarTab: {
|
|
4
|
+
({ tab, children, ...rest }: {
|
|
5
|
+
tab: SidebarTabName;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
} & import("react").HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SidebarTabName } from "../../types";
|
|
3
|
+
export declare const SidebarTabTrigger: {
|
|
4
|
+
({ children, tab, onSelect, ...rest }: {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
tab: SidebarTabName;
|
|
7
|
+
onSelect?: React.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
8
|
+
} & Omit<import("react").HTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
@@ -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" | "className" | "children" | "gap" | "justifyContent" | "align"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Col: React.ForwardRefExoticComponent<Pick<StackProps, "style" | "className" | "children" | "gap" | "justifyContent" | "align"> & 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,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const Trans: ({ i18nKey, children, ...props }: {
|
|
3
|
+
[key: string]: React.ReactNode | ((el: React.ReactNode) => React.ReactNode);
|
|
4
|
+
i18nKey: string;
|
|
5
|
+
}) => React.FunctionComponentElement<{
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
export default Trans;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import "./UserList.scss";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { AppState } from "../types";
|
|
4
|
-
import { ActionManager } from "../actions/manager";
|
|
5
4
|
export declare const UserList: React.FC<{
|
|
6
5
|
className?: string;
|
|
7
6
|
mobile?: boolean;
|
|
8
7
|
collaborators: AppState["collaborators"];
|
|
9
|
-
actionManager: ActionManager;
|
|
10
8
|
}>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./DropdownMenu.scss";
|
|
3
|
+
declare const DropdownMenu: {
|
|
4
|
+
({ children, open, }: {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
open: boolean;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
Trigger: {
|
|
9
|
+
({ className, children, onToggle, title, ...rest }: {
|
|
10
|
+
className?: string | undefined;
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
onToggle: () => void;
|
|
13
|
+
title?: string | undefined;
|
|
14
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
Content: {
|
|
18
|
+
({ children, onClickOutside, className, onSelect, style, }: {
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
onClickOutside?: (() => void) | undefined;
|
|
21
|
+
className?: string | undefined;
|
|
22
|
+
onSelect?: ((event: Event) => void) | undefined;
|
|
23
|
+
style?: React.CSSProperties | undefined;
|
|
24
|
+
}): JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
Item: {
|
|
28
|
+
({ icon, onSelect, children, shortcut, className, ...rest }: {
|
|
29
|
+
icon?: JSX.Element | undefined;
|
|
30
|
+
onSelect: (event: Event) => void;
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
shortcut?: string | undefined;
|
|
33
|
+
className?: string | undefined;
|
|
34
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
ItemLink: {
|
|
38
|
+
({ icon, shortcut, href, children, onSelect, className, ...rest }: {
|
|
39
|
+
href: string;
|
|
40
|
+
icon?: JSX.Element | undefined;
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
shortcut?: string | undefined;
|
|
43
|
+
className?: string | undefined;
|
|
44
|
+
onSelect?: ((event: Event) => void) | undefined;
|
|
45
|
+
} & React.AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
46
|
+
displayName: string;
|
|
47
|
+
};
|
|
48
|
+
ItemCustom: ({ children, className, ...rest }: {
|
|
49
|
+
children: React.ReactNode;
|
|
50
|
+
className?: string | undefined;
|
|
51
|
+
} & React.HTMLAttributes<HTMLDivElement>) => JSX.Element;
|
|
52
|
+
Group: {
|
|
53
|
+
({ children, className, style, title, }: {
|
|
54
|
+
children: React.ReactNode;
|
|
55
|
+
className?: string | undefined;
|
|
56
|
+
style?: React.CSSProperties | undefined;
|
|
57
|
+
title?: string | undefined;
|
|
58
|
+
}): JSX.Element;
|
|
59
|
+
displayName: string;
|
|
60
|
+
};
|
|
61
|
+
Separator: {
|
|
62
|
+
(): JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
displayName: string;
|
|
66
|
+
};
|
|
67
|
+
export default DropdownMenu;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const MenuContent: {
|
|
3
|
+
({ children, onClickOutside, className, onSelect, style, }: {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
onClickOutside?: (() => void) | undefined;
|
|
6
|
+
className?: string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Called when any menu item is selected (clicked on).
|
|
9
|
+
*/
|
|
10
|
+
onSelect?: ((event: Event) => void) | undefined;
|
|
11
|
+
style?: React.CSSProperties | undefined;
|
|
12
|
+
}): JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export default MenuContent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const MenuGroup: {
|
|
3
|
+
({ children, className, style, title, }: {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string | undefined;
|
|
6
|
+
style?: React.CSSProperties | undefined;
|
|
7
|
+
title?: string | undefined;
|
|
8
|
+
}): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export default MenuGroup;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const DropdownMenuItem: {
|
|
3
|
+
({ icon, onSelect, children, shortcut, className, ...rest }: {
|
|
4
|
+
icon?: JSX.Element | undefined;
|
|
5
|
+
onSelect: (event: Event) => void;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
shortcut?: string | undefined;
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default DropdownMenuItem;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const DropdownMenuItemLink: {
|
|
3
|
+
({ icon, shortcut, href, children, onSelect, className, ...rest }: {
|
|
4
|
+
href: string;
|
|
5
|
+
icon?: JSX.Element | undefined;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
shortcut?: string | undefined;
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
onSelect?: ((event: Event) => void) | undefined;
|
|
10
|
+
} & React.AnchorHTMLAttributes<HTMLAnchorElement>): JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
export default DropdownMenuItemLink;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const MenuTrigger: {
|
|
3
|
+
({ className, children, onToggle, title, ...rest }: {
|
|
4
|
+
className?: string | undefined;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
onToggle: () => void;
|
|
7
|
+
title?: string | undefined;
|
|
8
|
+
} & Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
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) => string;
|
|
6
|
+
export declare const useHandleDropdownMenuItemClick: (origOnClick: React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement> | undefined, onSelect: ((event: Event) => void) | undefined) => (event: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement, MouseEvent>) => void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const getMenuTriggerComponent: (children: React.ReactNode) => string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | null;
|
|
3
|
+
export declare const getMenuContentComponent: (children: React.ReactNode) => string | number | React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactFragment | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ActionManager } from "../../actions/manager";
|
|
2
|
+
import { UIAppState } from "../../types";
|
|
3
|
+
declare const Footer: {
|
|
4
|
+
({ appState, actionManager, showExitZenModeBtn, renderWelcomeScreen, }: {
|
|
5
|
+
appState: UIAppState;
|
|
6
|
+
actionManager: ActionManager;
|
|
7
|
+
showExitZenModeBtn: boolean;
|
|
8
|
+
renderWelcomeScreen: boolean;
|
|
9
|
+
}): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export default Footer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Theme } from "../element/types";
|
|
3
|
-
|
|
3
|
+
type Opts = {
|
|
4
4
|
width?: number;
|
|
5
5
|
height?: number;
|
|
6
6
|
mirror?: true;
|
|
@@ -73,7 +73,7 @@ export declare const DistributeHorizontallyIcon: JSX.Element;
|
|
|
73
73
|
export declare const DistributeVerticallyIcon: JSX.Element;
|
|
74
74
|
export declare const CenterVerticallyIcon: JSX.Element;
|
|
75
75
|
export declare const CenterHorizontallyIcon: JSX.Element;
|
|
76
|
-
export declare const
|
|
76
|
+
export declare const usersIcon: JSX.Element;
|
|
77
77
|
export declare const start: JSX.Element;
|
|
78
78
|
export declare const stop: JSX.Element;
|
|
79
79
|
export declare const CloseIcon: JSX.Element;
|
|
@@ -87,6 +87,7 @@ export declare const GroupIcon: React.MemoExoticComponent<({ theme }: {
|
|
|
87
87
|
export declare const UngroupIcon: React.MemoExoticComponent<({ theme }: {
|
|
88
88
|
theme: Theme;
|
|
89
89
|
}) => JSX.Element>;
|
|
90
|
+
export declare const FillZigZagIcon: JSX.Element;
|
|
90
91
|
export declare const FillHachureIcon: JSX.Element;
|
|
91
92
|
export declare const FillCrossHatchIcon: JSX.Element;
|
|
92
93
|
export declare const FillSolidIcon: JSX.Element;
|
|
@@ -136,4 +137,14 @@ export declare const TextAlignMiddleIcon: React.MemoExoticComponent<({ theme }:
|
|
|
136
137
|
}) => JSX.Element>;
|
|
137
138
|
export declare const publishIcon: JSX.Element;
|
|
138
139
|
export declare const eraser: JSX.Element;
|
|
140
|
+
export declare const handIcon: JSX.Element;
|
|
141
|
+
export declare const downloadIcon: JSX.Element;
|
|
142
|
+
export declare const copyIcon: JSX.Element;
|
|
143
|
+
export declare const helpIcon: JSX.Element;
|
|
144
|
+
export declare const playerPlayIcon: JSX.Element;
|
|
145
|
+
export declare const playerStopFilledIcon: JSX.Element;
|
|
146
|
+
export declare const tablerCheckIcon: JSX.Element;
|
|
147
|
+
export declare const eyeDropperIcon: JSX.Element;
|
|
148
|
+
export declare const extraToolsIcon: JSX.Element;
|
|
149
|
+
export declare const frameToolIcon: JSX.Element;
|
|
139
150
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./LiveCollaborationTrigger.scss";
|
|
3
|
+
declare const LiveCollaborationTrigger: {
|
|
4
|
+
({ isCollaborating, onSelect, ...rest }: {
|
|
5
|
+
isCollaborating: boolean;
|
|
6
|
+
onSelect: () => void;
|
|
7
|
+
} & import("react").ButtonHTMLAttributes<HTMLButtonElement>): JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
export default LiveCollaborationTrigger;
|