@zsviczian/excalidraw 0.12.0-obsidian-11 → 0.13.0-obsidian-1
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/README.md +68 -14
- package/dist/excalidraw.development.js +1192 -154
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +104 -0
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +12 -9
- package/types/actions/actionAlign.d.ts +18 -6
- package/types/actions/actionBoundText.d.ts +4 -3
- package/types/actions/actionCanvas.d.ts +59 -36
- package/types/actions/actionClipboard.d.ts +20 -15
- package/types/actions/actionDeleteSelected.d.ts +15 -10
- package/types/actions/actionDistribute.d.ts +6 -2
- package/types/actions/actionDuplicateSelection.d.ts +3 -1
- package/types/actions/actionExport.d.ts +62 -37
- package/types/actions/actionFinalize.d.ts +11 -7
- package/types/actions/actionGroup.d.ts +6 -2
- package/types/actions/actionLinearEditor.d.ts +4 -3
- package/types/actions/actionMenu.d.ts +21 -12
- package/types/actions/actionNavigate.d.ts +3 -1
- package/types/actions/actionProperties.d.ts +91 -52
- package/types/actions/actionStyles.d.ts +4 -3
- package/types/actions/actionToggleGridMode.d.ts +4 -3
- package/types/actions/actionToggleLock.d.ts +4 -3
- package/types/actions/actionToggleStats.d.ts +4 -3
- package/types/actions/actionToggleViewMode.d.ts +4 -3
- package/types/actions/actionToggleZenMode.d.ts +4 -3
- package/types/actions/actionZindex.d.ts +12 -4
- package/types/actions/manager.d.ts +1 -1
- package/types/actions/shortcuts.d.ts +1 -1
- package/types/actions/types.d.ts +3 -1
- package/types/appState.d.ts +5 -4
- package/types/bug-issue-template.d.ts +2 -0
- package/types/clients.d.ts +1 -1
- package/types/components/Actions.d.ts +1 -0
- package/types/components/App.d.ts +52 -1
- package/types/components/Avatar.d.ts +1 -1
- package/types/components/CollabButton.d.ts +2 -1
- package/types/components/DialogActionButton.d.ts +10 -0
- package/types/components/EncryptedIcon.d.ts +2 -0
- package/types/components/Footer.d.ts +2 -1
- package/types/components/HelpButton.d.ts +8 -0
- package/types/components/HintViewer.d.ts +3 -2
- package/types/components/ImageExportDialog.d.ts +3 -1
- package/types/components/LayerUI.d.ts +3 -1
- package/types/components/LibraryButton.d.ts +1 -0
- package/types/components/LibraryMenu.d.ts +14 -5
- package/types/components/LibraryMenuBrowseButton.d.ts +7 -0
- package/types/components/LibraryMenuHeaderContent.d.ts +12 -0
- package/types/components/LibraryMenuItems.d.ts +5 -14
- package/types/components/LibraryUnit.d.ts +2 -3
- package/types/components/MenuItem.d.ts +11 -0
- package/types/components/MenuUtils.d.ts +2 -0
- package/types/components/MobileMenu.d.ts +5 -3
- package/types/components/Sidebar/Sidebar.d.ts +73 -0
- package/types/components/Sidebar/SidebarHeader.d.ts +20 -0
- package/types/components/Sidebar/common.d.ts +16 -0
- package/types/components/TopErrorBoundary.d.ts +15 -0
- package/types/components/WelcomeScreen.d.ts +8 -0
- package/types/components/WelcomeScreenDecor.d.ts +6 -0
- package/types/components/hoc/withUpstreamOverride.d.ts +10 -0
- package/types/components/icons.d.ts +83 -124
- package/types/constants.d.ts +1 -0
- package/types/data/restore.d.ts +1 -1
- package/types/data/types.d.ts +16 -1
- package/types/element/Hyperlink.d.ts +7 -4
- package/types/element/index.d.ts +1 -1
- package/types/element/linearElementEditor.d.ts +4 -3
- package/types/element/newElement.d.ts +8 -0
- package/types/element/transformHandles.d.ts +1 -1
- package/types/excalidraw-app/CustomStats.d.ts +9 -0
- package/types/excalidraw-app/app_constants.d.ts +32 -0
- package/types/excalidraw-app/collab/Collab.d.ts +163 -0
- package/types/excalidraw-app/collab/Portal.d.ts +28 -0
- package/types/excalidraw-app/collab/RoomDialog.d.ts +13 -0
- package/types/excalidraw-app/collab/reconciliation.d.ts +10 -0
- package/types/excalidraw-app/components/ExportToExcalidrawPlus.d.ts +9 -0
- package/types/excalidraw-app/components/LanguageList.d.ts +4 -0
- package/types/excalidraw-app/components/icons.d.ts +1 -0
- package/types/excalidraw-app/data/FileManager.d.ts +66 -0
- package/types/excalidraw-app/data/LocalData.d.ts +32 -0
- package/types/excalidraw-app/data/Locker.d.ts +8 -0
- package/types/excalidraw-app/data/firebase.d.ts +25 -0
- package/types/excalidraw-app/data/index.d.ts +186 -0
- package/types/excalidraw-app/data/localStorage.d.ts +112 -0
- package/types/excalidraw-app/data/tabSync.d.ts +9 -0
- package/types/excalidraw-app/index.d.ts +26 -0
- package/types/hooks/useOutsideClick.d.ts +2 -0
- package/types/keys.d.ts +13 -3
- package/types/packages/excalidraw/example/App.d.ts +2 -1
- package/types/packages/excalidraw/example/sidebar/ExampleSidebar.d.ts +5 -0
- package/types/packages/excalidraw/index.d.ts +4 -0
- package/types/packages/utils.d.ts +3 -1
- package/types/renderer/renderScene.d.ts +1 -1
- package/types/scene/scrollbars.d.ts +1 -1
- package/types/scene/types.d.ts +1 -0
- package/types/shapes.d.ts +27 -3
- package/types/types.d.ts +21 -3
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import "./Sidebar.scss";
|
|
3
|
+
/** using a counter instead of boolean to handle race conditions where
|
|
4
|
+
* the host app may render (mount/unmount) multiple different sidebar */
|
|
5
|
+
export declare const hostSidebarCountersAtom: import("jotai").Atom<{
|
|
6
|
+
rendered: number;
|
|
7
|
+
docked: number;
|
|
8
|
+
}> & {
|
|
9
|
+
write: (get: {
|
|
10
|
+
<Value>(atom: import("jotai").Atom<Value | Promise<Value>>): Value;
|
|
11
|
+
<Value_1>(atom: import("jotai").Atom<Promise<Value_1>>): Value_1;
|
|
12
|
+
<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;
|
|
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
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export declare const Sidebar: import("react").ForwardRefExoticComponent<{
|
|
53
|
+
children: import("react").ReactNode;
|
|
54
|
+
onClose?: (() => boolean | void) | undefined;
|
|
55
|
+
onDock?: ((docked: boolean) => void) | undefined;
|
|
56
|
+
docked?: boolean | undefined;
|
|
57
|
+
initialDockedState?: boolean | undefined;
|
|
58
|
+
dockable?: boolean | undefined;
|
|
59
|
+
className?: string | undefined;
|
|
60
|
+
} & {
|
|
61
|
+
/** @private internal */
|
|
62
|
+
__isInternal?: boolean | undefined;
|
|
63
|
+
} & import("react").RefAttributes<HTMLDivElement>> & {
|
|
64
|
+
Header: {
|
|
65
|
+
(props: {
|
|
66
|
+
children?: import("react").ReactNode;
|
|
67
|
+
className?: string | undefined;
|
|
68
|
+
} & {
|
|
69
|
+
__isFallback?: boolean | undefined;
|
|
70
|
+
}): JSX.Element | null;
|
|
71
|
+
displayName: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const SidebarDockButton: (props: {
|
|
3
|
+
checked: boolean;
|
|
4
|
+
onChange?(): void;
|
|
5
|
+
}) => JSX.Element;
|
|
6
|
+
/** @private */
|
|
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
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare type SidebarProps<P = {}> = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Called on sidebar close (either by user action or by the editor).
|
|
6
|
+
*/
|
|
7
|
+
onClose?: () => void | boolean;
|
|
8
|
+
/** if not supplied, sidebar won't be dockable */
|
|
9
|
+
onDock?: (docked: boolean) => void;
|
|
10
|
+
docked?: boolean;
|
|
11
|
+
initialDockedState?: boolean;
|
|
12
|
+
dockable?: boolean;
|
|
13
|
+
className?: string;
|
|
14
|
+
} & P;
|
|
15
|
+
export declare type SidebarPropsContextValue = Pick<SidebarProps, "onClose" | "onDock" | "docked" | "dockable">;
|
|
16
|
+
export declare const SidebarPropsContext: React.Context<SidebarPropsContextValue>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface TopErrorBoundaryState {
|
|
3
|
+
hasError: boolean;
|
|
4
|
+
sentryEventId: string;
|
|
5
|
+
localStorage: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class TopErrorBoundary extends React.Component<any, TopErrorBoundaryState> {
|
|
8
|
+
state: TopErrorBoundaryState;
|
|
9
|
+
render(): any;
|
|
10
|
+
componentDidCatch(error: Error, errorInfo: any): void;
|
|
11
|
+
private selectTextArea;
|
|
12
|
+
private createGithubIssue;
|
|
13
|
+
private errorSplash;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionManager } from "../actions/manager";
|
|
2
|
+
import { AppState } from "../types";
|
|
3
|
+
import "./WelcomeScreen.scss";
|
|
4
|
+
declare const WelcomeScreen: ({ appState, actionManager, }: {
|
|
5
|
+
appState: AppState;
|
|
6
|
+
actionManager: ActionManager;
|
|
7
|
+
}) => JSX.Element;
|
|
8
|
+
export default WelcomeScreen;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const withUpstreamOverride: <P>(Component: React.ComponentType<P>) => readonly [React.FC<{
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}>, {
|
|
5
|
+
(props: P & {
|
|
6
|
+
/** @private internal */
|
|
7
|
+
__isFallback?: boolean | undefined;
|
|
8
|
+
}): JSX.Element | null;
|
|
9
|
+
displayName: string;
|
|
10
|
+
}];
|
|
@@ -6,68 +6,77 @@ declare type Opts = {
|
|
|
6
6
|
mirror?: true;
|
|
7
7
|
} & React.SVGProps<SVGSVGElement>;
|
|
8
8
|
export declare const createIcon: (d: string | React.ReactNode, opts?: number | Opts) => JSX.Element;
|
|
9
|
+
export declare const PlusPromoIcon: JSX.Element;
|
|
10
|
+
export declare const LibraryIcon: JSX.Element;
|
|
11
|
+
export declare const PlusIcon: JSX.Element;
|
|
12
|
+
export declare const DotsIcon: JSX.Element;
|
|
13
|
+
export declare const PinIcon: JSX.Element;
|
|
14
|
+
export declare const UnlockedIcon: JSX.Element;
|
|
15
|
+
export declare const LockedIcon: JSX.Element;
|
|
16
|
+
export declare const WelcomeScreenMenuArrow: JSX.Element;
|
|
17
|
+
export declare const WelcomeScreenHelpArrow: JSX.Element;
|
|
18
|
+
export declare const WelcomeScreenTopToolbarArrow: JSX.Element;
|
|
19
|
+
export declare const ExcalLogo: JSX.Element;
|
|
20
|
+
export declare const SelectionIcon: JSX.Element;
|
|
21
|
+
export declare const RectangleIcon: JSX.Element;
|
|
22
|
+
export declare const DiamondIcon: JSX.Element;
|
|
23
|
+
export declare const EllipseIcon: JSX.Element;
|
|
24
|
+
export declare const ArrowIcon: JSX.Element;
|
|
25
|
+
export declare const LineIcon: JSX.Element;
|
|
26
|
+
export declare const PenModeIcon: JSX.Element;
|
|
27
|
+
export declare const FreedrawIcon: JSX.Element;
|
|
28
|
+
export declare const TextIcon: JSX.Element;
|
|
29
|
+
export declare const ImageIcon: JSX.Element;
|
|
30
|
+
export declare const EraserIcon: JSX.Element;
|
|
31
|
+
export declare const ZoomInIcon: JSX.Element;
|
|
32
|
+
export declare const ZoomOutIcon: JSX.Element;
|
|
33
|
+
export declare const TrashIcon: JSX.Element;
|
|
34
|
+
export declare const DuplicateIcon: JSX.Element;
|
|
35
|
+
export declare const MoonIcon: JSX.Element;
|
|
36
|
+
export declare const SunIcon: JSX.Element;
|
|
37
|
+
export declare const HamburgerMenuIcon: JSX.Element;
|
|
38
|
+
export declare const ExportIcon: JSX.Element;
|
|
39
|
+
export declare const HelpIcon: JSX.Element;
|
|
40
|
+
export declare const ExternalLinkIcon: JSX.Element;
|
|
41
|
+
export declare const GithubIcon: JSX.Element;
|
|
42
|
+
export declare const DiscordIcon: JSX.Element;
|
|
43
|
+
export declare const TwitterIcon: JSX.Element;
|
|
9
44
|
export declare const checkIcon: JSX.Element;
|
|
10
|
-
export declare const
|
|
45
|
+
export declare const LinkIcon: JSX.Element;
|
|
11
46
|
export declare const save: JSX.Element;
|
|
12
47
|
export declare const saveAs: JSX.Element;
|
|
13
|
-
export declare const
|
|
48
|
+
export declare const LoadIcon: JSX.Element;
|
|
14
49
|
export declare const clipboard: JSX.Element;
|
|
15
|
-
export declare const trash: JSX.Element;
|
|
16
50
|
export declare const palette: JSX.Element;
|
|
17
|
-
export declare const
|
|
18
|
-
export declare const exportImage: JSX.Element;
|
|
51
|
+
export declare const ExportImageIcon: JSX.Element;
|
|
19
52
|
export declare const exportToFileIcon: JSX.Element;
|
|
20
53
|
export declare const zoomIn: JSX.Element;
|
|
21
54
|
export declare const zoomOut: JSX.Element;
|
|
22
55
|
export declare const done: JSX.Element;
|
|
23
56
|
export declare const menu: JSX.Element;
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
57
|
+
export declare const UndoIcon: JSX.Element;
|
|
58
|
+
export declare const RedoIcon: JSX.Element;
|
|
26
59
|
export declare const questionCircle: JSX.Element;
|
|
27
60
|
export declare const share: JSX.Element;
|
|
28
61
|
export declare const shareIOS: JSX.Element;
|
|
29
62
|
export declare const shareWindows: JSX.Element;
|
|
30
63
|
export declare const resetZoom: JSX.Element;
|
|
31
|
-
export declare const BringForwardIcon:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
export declare const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export declare const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export declare const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
export declare const
|
|
44
|
-
theme: Theme;
|
|
45
|
-
}) => JSX.Element>;
|
|
46
|
-
export declare const AlignBottomIcon: React.MemoExoticComponent<({ theme }: {
|
|
47
|
-
theme: Theme;
|
|
48
|
-
}) => JSX.Element>;
|
|
49
|
-
export declare const AlignLeftIcon: React.MemoExoticComponent<({ theme }: {
|
|
50
|
-
theme: Theme;
|
|
51
|
-
}) => JSX.Element>;
|
|
52
|
-
export declare const AlignRightIcon: React.MemoExoticComponent<({ theme }: {
|
|
53
|
-
theme: Theme;
|
|
54
|
-
}) => JSX.Element>;
|
|
55
|
-
export declare const DistributeHorizontallyIcon: React.MemoExoticComponent<({ theme }: {
|
|
56
|
-
theme: Theme;
|
|
57
|
-
}) => JSX.Element>;
|
|
58
|
-
export declare const DistributeVerticallyIcon: React.MemoExoticComponent<({ theme }: {
|
|
59
|
-
theme: Theme;
|
|
60
|
-
}) => JSX.Element>;
|
|
61
|
-
export declare const CenterVerticallyIcon: React.MemoExoticComponent<({ theme }: {
|
|
62
|
-
theme: Theme;
|
|
63
|
-
}) => JSX.Element>;
|
|
64
|
-
export declare const CenterHorizontallyIcon: React.MemoExoticComponent<({ theme }: {
|
|
65
|
-
theme: Theme;
|
|
66
|
-
}) => JSX.Element>;
|
|
67
|
-
export declare const users: JSX.Element;
|
|
64
|
+
export declare const BringForwardIcon: JSX.Element;
|
|
65
|
+
export declare const SendBackwardIcon: JSX.Element;
|
|
66
|
+
export declare const BringToFrontIcon: JSX.Element;
|
|
67
|
+
export declare const SendToBackIcon: JSX.Element;
|
|
68
|
+
export declare const AlignTopIcon: JSX.Element;
|
|
69
|
+
export declare const AlignBottomIcon: JSX.Element;
|
|
70
|
+
export declare const AlignLeftIcon: JSX.Element;
|
|
71
|
+
export declare const AlignRightIcon: JSX.Element;
|
|
72
|
+
export declare const DistributeHorizontallyIcon: JSX.Element;
|
|
73
|
+
export declare const DistributeVerticallyIcon: JSX.Element;
|
|
74
|
+
export declare const CenterVerticallyIcon: JSX.Element;
|
|
75
|
+
export declare const CenterHorizontallyIcon: JSX.Element;
|
|
76
|
+
export declare const UsersIcon: JSX.Element;
|
|
68
77
|
export declare const start: JSX.Element;
|
|
69
78
|
export declare const stop: JSX.Element;
|
|
70
|
-
export declare const
|
|
79
|
+
export declare const CloseIcon: JSX.Element;
|
|
71
80
|
export declare const back: JSX.Element;
|
|
72
81
|
export declare const clone: JSX.Element;
|
|
73
82
|
export declare const shield: JSX.Element;
|
|
@@ -78,95 +87,46 @@ export declare const GroupIcon: React.MemoExoticComponent<({ theme }: {
|
|
|
78
87
|
export declare const UngroupIcon: React.MemoExoticComponent<({ theme }: {
|
|
79
88
|
theme: Theme;
|
|
80
89
|
}) => JSX.Element>;
|
|
81
|
-
export declare const FillHachureIcon:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
export declare const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
export declare const
|
|
88
|
-
theme: Theme;
|
|
89
|
-
}) => JSX.Element>;
|
|
90
|
-
export declare const StrokeWidthIcon: React.MemoExoticComponent<({ theme, strokeWidth }: {
|
|
91
|
-
theme: Theme;
|
|
92
|
-
strokeWidth: number;
|
|
93
|
-
}) => JSX.Element>;
|
|
90
|
+
export declare const FillHachureIcon: JSX.Element;
|
|
91
|
+
export declare const FillCrossHatchIcon: JSX.Element;
|
|
92
|
+
export declare const FillSolidIcon: JSX.Element;
|
|
93
|
+
export declare const StrokeWidthThinIcon: JSX.Element;
|
|
94
|
+
export declare const StrokeWidthBaseIcon: JSX.Element;
|
|
95
|
+
export declare const StrokeWidthBoldIcon: JSX.Element;
|
|
96
|
+
export declare const StrokeWidthExtraBoldIcon: JSX.Element;
|
|
94
97
|
export declare const StrokeStyleSolidIcon: React.MemoExoticComponent<({ theme }: {
|
|
95
98
|
theme: Theme;
|
|
96
99
|
}) => JSX.Element>;
|
|
97
|
-
export declare const StrokeStyleDashedIcon:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
export declare const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
export declare const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
export declare const SloppinessArtistIcon: React.MemoExoticComponent<({ theme }: {
|
|
107
|
-
theme: Theme;
|
|
108
|
-
}) => JSX.Element>;
|
|
109
|
-
export declare const SloppinessCartoonistIcon: React.MemoExoticComponent<({ theme }: {
|
|
110
|
-
theme: Theme;
|
|
111
|
-
}) => JSX.Element>;
|
|
112
|
-
export declare const EdgeSharpIcon: React.MemoExoticComponent<({ theme }: {
|
|
113
|
-
theme: Theme;
|
|
114
|
-
}) => JSX.Element>;
|
|
115
|
-
export declare const EdgeRoundIcon: React.MemoExoticComponent<({ theme }: {
|
|
116
|
-
theme: Theme;
|
|
117
|
-
}) => JSX.Element>;
|
|
118
|
-
export declare const ArrowheadNoneIcon: React.MemoExoticComponent<({ theme }: {
|
|
119
|
-
theme: Theme;
|
|
120
|
-
}) => JSX.Element>;
|
|
121
|
-
export declare const ArrowheadArrowIcon: React.MemoExoticComponent<({ theme, flip }: {
|
|
122
|
-
theme: Theme;
|
|
100
|
+
export declare const StrokeStyleDashedIcon: JSX.Element;
|
|
101
|
+
export declare const StrokeStyleDottedIcon: JSX.Element;
|
|
102
|
+
export declare const SloppinessArchitectIcon: JSX.Element;
|
|
103
|
+
export declare const SloppinessArtistIcon: JSX.Element;
|
|
104
|
+
export declare const SloppinessCartoonistIcon: JSX.Element;
|
|
105
|
+
export declare const EdgeSharpIcon: JSX.Element;
|
|
106
|
+
export declare const EdgeRoundIcon: JSX.Element;
|
|
107
|
+
export declare const ArrowheadNoneIcon: JSX.Element;
|
|
108
|
+
export declare const ArrowheadArrowIcon: React.MemoExoticComponent<({ flip }: {
|
|
123
109
|
flip?: boolean | undefined;
|
|
124
110
|
}) => JSX.Element>;
|
|
125
|
-
export declare const ArrowheadDotIcon: React.MemoExoticComponent<({
|
|
126
|
-
theme: Theme;
|
|
111
|
+
export declare const ArrowheadDotIcon: React.MemoExoticComponent<({ flip }: {
|
|
127
112
|
flip?: boolean | undefined;
|
|
128
113
|
}) => JSX.Element>;
|
|
129
|
-
export declare const ArrowheadBarIcon: React.MemoExoticComponent<({
|
|
130
|
-
theme: Theme;
|
|
114
|
+
export declare const ArrowheadBarIcon: React.MemoExoticComponent<({ flip }: {
|
|
131
115
|
flip?: boolean | undefined;
|
|
132
116
|
}) => JSX.Element>;
|
|
133
|
-
export declare const ArrowheadTriangleIcon: React.MemoExoticComponent<({
|
|
134
|
-
theme: Theme;
|
|
117
|
+
export declare const ArrowheadTriangleIcon: React.MemoExoticComponent<({ flip }: {
|
|
135
118
|
flip?: boolean | undefined;
|
|
136
119
|
}) => JSX.Element>;
|
|
137
|
-
export declare const FontSizeSmallIcon:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
export declare const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
export declare const
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
export declare const
|
|
147
|
-
theme: Theme;
|
|
148
|
-
}) => JSX.Element>;
|
|
149
|
-
export declare const FontFamilyHandDrawnIcon: React.MemoExoticComponent<({ theme }: {
|
|
150
|
-
theme: Theme;
|
|
151
|
-
}) => JSX.Element>;
|
|
152
|
-
export declare const FontFamilyLocalFontIcon: React.MemoExoticComponent<({ theme }: {
|
|
153
|
-
theme: Theme;
|
|
154
|
-
}) => JSX.Element>;
|
|
155
|
-
export declare const FontFamilyNormalIcon: React.MemoExoticComponent<({ theme }: {
|
|
156
|
-
theme: Theme;
|
|
157
|
-
}) => JSX.Element>;
|
|
158
|
-
export declare const FontFamilyCodeIcon: React.MemoExoticComponent<({ theme }: {
|
|
159
|
-
theme: Theme;
|
|
160
|
-
}) => JSX.Element>;
|
|
161
|
-
export declare const TextAlignLeftIcon: React.MemoExoticComponent<({ theme }: {
|
|
162
|
-
theme: Theme;
|
|
163
|
-
}) => JSX.Element>;
|
|
164
|
-
export declare const TextAlignCenterIcon: React.MemoExoticComponent<({ theme }: {
|
|
165
|
-
theme: Theme;
|
|
166
|
-
}) => JSX.Element>;
|
|
167
|
-
export declare const TextAlignRightIcon: React.MemoExoticComponent<({ theme }: {
|
|
168
|
-
theme: Theme;
|
|
169
|
-
}) => JSX.Element>;
|
|
120
|
+
export declare const FontSizeSmallIcon: JSX.Element;
|
|
121
|
+
export declare const FontSizeMediumIcon: JSX.Element;
|
|
122
|
+
export declare const FontSizeLargeIcon: JSX.Element;
|
|
123
|
+
export declare const FontSizeExtraLargeIcon: JSX.Element;
|
|
124
|
+
export declare const FontFamilyNormalIcon: JSX.Element;
|
|
125
|
+
export declare const FontFamilyCodeIcon: JSX.Element;
|
|
126
|
+
export declare const FontFamilyLocalFontIcon: JSX.Element;
|
|
127
|
+
export declare const TextAlignLeftIcon: JSX.Element;
|
|
128
|
+
export declare const TextAlignCenterIcon: JSX.Element;
|
|
129
|
+
export declare const TextAlignRightIcon: JSX.Element;
|
|
170
130
|
export declare const TextAlignTopIcon: React.MemoExoticComponent<({ theme }: {
|
|
171
131
|
theme: Theme;
|
|
172
132
|
}) => JSX.Element>;
|
|
@@ -177,6 +137,5 @@ export declare const TextAlignMiddleIcon: React.MemoExoticComponent<({ theme }:
|
|
|
177
137
|
theme: Theme;
|
|
178
138
|
}) => JSX.Element>;
|
|
179
139
|
export declare const publishIcon: JSX.Element;
|
|
180
|
-
export declare const editIcon: JSX.Element;
|
|
181
140
|
export declare const eraser: JSX.Element;
|
|
182
141
|
export {};
|
package/types/constants.d.ts
CHANGED
|
@@ -105,6 +105,7 @@ export declare const TITLE_TIMEOUT = 10000;
|
|
|
105
105
|
export declare const VERSION_TIMEOUT = 30000;
|
|
106
106
|
export declare const SCROLL_TIMEOUT = 100;
|
|
107
107
|
export declare const ZOOM_STEP = 0.05;
|
|
108
|
+
export declare const MIN_ZOOM = 0.1;
|
|
108
109
|
export declare const HYPERLINK_TOOLTIP_DELAY = 300;
|
|
109
110
|
export declare const IDLE_THRESHOLD = 60000;
|
|
110
111
|
export declare const ACTIVE_THRESHOLD = 3000;
|
package/types/data/restore.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare type RestoredDataState = {
|
|
|
8
8
|
appState: RestoredAppState;
|
|
9
9
|
files: BinaryFiles;
|
|
10
10
|
};
|
|
11
|
-
export declare const restoreElements: (elements: ImportedDataState["elements"], localElements: readonly ExcalidrawElement[] | null | undefined) => ExcalidrawElement[];
|
|
11
|
+
export declare const restoreElements: (elements: ImportedDataState["elements"], localElements: readonly ExcalidrawElement[] | null | undefined, refreshDimensions?: boolean) => ExcalidrawElement[];
|
|
12
12
|
export declare const restoreAppState: (appState: ImportedDataState["appState"], localAppState: Partial<AppState> | null | undefined) => RestoredAppState;
|
|
13
13
|
export declare const restore: (data: Pick<ImportedDataState, "appState" | "elements" | "files"> | null, localAppState: Partial<AppState> | null | undefined, localElements: readonly ExcalidrawElement[] | null | undefined) => RestoredDataState;
|
|
14
14
|
export declare const restoreLibraryItems: (libraryItems: ImportedDataState["libraryItems"], defaultStatus: LibraryItem["status"]) => LibraryItem[];
|
package/types/data/types.d.ts
CHANGED
|
@@ -10,12 +10,27 @@ export interface ExportedDataState {
|
|
|
10
10
|
appState: ReturnType<typeof cleanAppStateForExport>;
|
|
11
11
|
files: BinaryFiles | undefined;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Map of legacy AppState keys, with values of:
|
|
15
|
+
* [<legacy type>, <new AppState proeprty>]
|
|
16
|
+
*
|
|
17
|
+
* This is a helper type used in downstream abstractions.
|
|
18
|
+
* Don't consume on its own.
|
|
19
|
+
*/
|
|
20
|
+
export declare type LegacyAppState = {
|
|
21
|
+
/** @deprecated #5663 TODO remove 22-12-15 */
|
|
22
|
+
isLibraryOpen: [boolean, "openSidebar"];
|
|
23
|
+
/** @deprecated #5663 TODO remove 22-12-15 */
|
|
24
|
+
isLibraryMenuDocked: [boolean, "isSidebarDocked"];
|
|
25
|
+
};
|
|
13
26
|
export interface ImportedDataState {
|
|
14
27
|
type?: string;
|
|
15
28
|
version?: number;
|
|
16
29
|
source?: string;
|
|
17
30
|
elements?: readonly ExcalidrawElement[] | null;
|
|
18
|
-
appState?: Readonly<Partial<AppState
|
|
31
|
+
appState?: Readonly<Partial<AppState & {
|
|
32
|
+
[T in keyof LegacyAppState]: LegacyAppState[T][0];
|
|
33
|
+
}>> | null;
|
|
19
34
|
scrollToContent?: boolean;
|
|
20
35
|
libraryItems?: LibraryItems_anyVersion;
|
|
21
36
|
files?: BinaryFiles;
|
|
@@ -18,6 +18,7 @@ export declare const actionLink: {
|
|
|
18
18
|
appState: {
|
|
19
19
|
showHyperlinkPopup: "editor";
|
|
20
20
|
openMenu: null;
|
|
21
|
+
showWelcomeScreen: boolean;
|
|
21
22
|
isLoading: boolean;
|
|
22
23
|
errorMessage: string | null;
|
|
23
24
|
draggingElement: NonDeletedExcalidrawElement | null;
|
|
@@ -72,6 +73,9 @@ export declare const actionLink: {
|
|
|
72
73
|
value: import("../types").NormalizedZoomValue;
|
|
73
74
|
}>;
|
|
74
75
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
76
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
77
|
+
openDialog: "imageExport" | "help" | null;
|
|
78
|
+
isSidebarDocked: boolean;
|
|
75
79
|
lastPointerDownWith: import("./types").PointerType;
|
|
76
80
|
selectedElementIds: {
|
|
77
81
|
[id: string]: boolean;
|
|
@@ -80,7 +84,6 @@ export declare const actionLink: {
|
|
|
80
84
|
[id: string]: boolean;
|
|
81
85
|
};
|
|
82
86
|
shouldCacheIgnoreZoom: boolean;
|
|
83
|
-
showHelpDialog: boolean;
|
|
84
87
|
toast: {
|
|
85
88
|
message: string;
|
|
86
89
|
closable?: boolean | undefined;
|
|
@@ -98,8 +101,6 @@ export declare const actionLink: {
|
|
|
98
101
|
height: number;
|
|
99
102
|
offsetTop: number;
|
|
100
103
|
offsetLeft: number;
|
|
101
|
-
isLibraryOpen: boolean;
|
|
102
|
-
isLibraryMenuDocked: boolean;
|
|
103
104
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
104
105
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
105
106
|
showStats: boolean;
|
|
@@ -130,7 +131,9 @@ export declare const actionLink: {
|
|
|
130
131
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
131
132
|
contextItemLabel: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => "labels.link.edit" | "labels.link.create";
|
|
132
133
|
contextItemPredicate: (elements: readonly import("./types").ExcalidrawElement[], appState: AppState) => boolean;
|
|
133
|
-
PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps
|
|
134
|
+
PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps & {
|
|
135
|
+
isInHamburgerMenu: boolean;
|
|
136
|
+
}) => JSX.Element;
|
|
134
137
|
} & {
|
|
135
138
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
136
139
|
};
|
package/types/element/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted } from "./types";
|
|
2
|
-
export { newElement, newTextElement, updateTextElement, newLinearElement, newImageElement, duplicateElement, } from "./newElement";
|
|
2
|
+
export { newElement, newTextElement, updateTextElement, refreshTextDimensions, newLinearElement, newImageElement, duplicateElement, } from "./newElement";
|
|
3
3
|
export { getElementAbsoluteCoords, getElementBounds, getCommonBounds, getDiamondPoints, getArrowheadPoints, getClosestElementBounds, } from "./bounds";
|
|
4
4
|
export { OMIT_SIDES_FOR_MULTIPLE_ELEMENTS, getTransformHandlesFromCoords, getTransformHandles, } from "./transformHandles";
|
|
5
5
|
export { hitTest, isHittingElementBoundingBoxWithoutHittingElement, } from "./collision";
|
|
@@ -106,6 +106,7 @@ export declare class LinearElementEditor {
|
|
|
106
106
|
hoverPointIndex: number;
|
|
107
107
|
segmentMidPointHoveredCoords: readonly [number, number] | null;
|
|
108
108
|
};
|
|
109
|
+
showWelcomeScreen: boolean;
|
|
109
110
|
isLoading: boolean;
|
|
110
111
|
errorMessage: string | null;
|
|
111
112
|
draggingElement: import("./types").NonDeletedExcalidrawElement | null;
|
|
@@ -160,6 +161,9 @@ export declare class LinearElementEditor {
|
|
|
160
161
|
}>;
|
|
161
162
|
openMenu: "canvas" | "shape" | null;
|
|
162
163
|
openPopup: "canvasColorPicker" | "backgroundColorPicker" | "strokeColorPicker" | null;
|
|
164
|
+
openSidebar: "library" | "customSidebar" | null;
|
|
165
|
+
openDialog: "imageExport" | "help" | null;
|
|
166
|
+
isSidebarDocked: boolean;
|
|
163
167
|
lastPointerDownWith: import("./types").PointerType;
|
|
164
168
|
selectedElementIds: {
|
|
165
169
|
[id: string]: boolean;
|
|
@@ -168,7 +172,6 @@ export declare class LinearElementEditor {
|
|
|
168
172
|
[id: string]: boolean;
|
|
169
173
|
};
|
|
170
174
|
shouldCacheIgnoreZoom: boolean;
|
|
171
|
-
showHelpDialog: boolean;
|
|
172
175
|
toast: {
|
|
173
176
|
message: string;
|
|
174
177
|
closable?: boolean | undefined;
|
|
@@ -186,8 +189,6 @@ export declare class LinearElementEditor {
|
|
|
186
189
|
height: number;
|
|
187
190
|
offsetTop: number;
|
|
188
191
|
offsetLeft: number;
|
|
189
|
-
isLibraryOpen: boolean;
|
|
190
|
-
isLibraryMenuDocked: boolean;
|
|
191
192
|
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
192
193
|
collaborators: Map<string, import("../types").Collaborator>;
|
|
193
194
|
showStats: boolean;
|
|
@@ -13,6 +13,14 @@ export declare const newTextElement: (opts: {
|
|
|
13
13
|
verticalAlign: VerticalAlign;
|
|
14
14
|
containerId?: ExcalidrawRectangleElement["id"];
|
|
15
15
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawTextElement>;
|
|
16
|
+
export declare const refreshTextDimensions: (textElement: ExcalidrawTextElement, text?: string) => {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
baseline: number;
|
|
22
|
+
text: string;
|
|
23
|
+
};
|
|
16
24
|
export declare const getMaxContainerWidth: (container: ExcalidrawElement) => number;
|
|
17
25
|
export declare const getMaxContainerHeight: (container: ExcalidrawElement) => number;
|
|
18
26
|
export declare const updateTextElement: (textElement: ExcalidrawTextElement, { text, isDeleted, originalText, rawText, link, }: {
|
|
@@ -15,8 +15,8 @@ export declare const OMIT_SIDES_FOR_MULTIPLE_ELEMENTS: {
|
|
|
15
15
|
w: boolean;
|
|
16
16
|
};
|
|
17
17
|
export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2]: Bounds, angle: number, zoom: Zoom, pointerType: PointerType, omitSides?: {
|
|
18
|
-
e?: boolean | undefined;
|
|
19
18
|
s?: boolean | undefined;
|
|
19
|
+
e?: boolean | undefined;
|
|
20
20
|
w?: boolean | undefined;
|
|
21
21
|
n?: boolean | undefined;
|
|
22
22
|
nw?: boolean | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AppState } from "../types";
|
|
2
|
+
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
setToast: (message: string) => void;
|
|
5
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
6
|
+
appState: AppState;
|
|
7
|
+
};
|
|
8
|
+
declare const CustomStats: (props: Props) => JSX.Element;
|
|
9
|
+
export default CustomStats;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const SAVE_TO_LOCAL_STORAGE_TIMEOUT = 300;
|
|
2
|
+
export declare const INITIAL_SCENE_UPDATE_TIMEOUT = 5000;
|
|
3
|
+
export declare const FILE_UPLOAD_TIMEOUT = 300;
|
|
4
|
+
export declare const LOAD_IMAGES_TIMEOUT = 500;
|
|
5
|
+
export declare const SYNC_FULL_SCENE_INTERVAL_MS = 20000;
|
|
6
|
+
export declare const SYNC_BROWSER_TABS_TIMEOUT = 50;
|
|
7
|
+
export declare const CURSOR_SYNC_TIMEOUT = 33;
|
|
8
|
+
export declare const DELETED_ELEMENT_TIMEOUT: number;
|
|
9
|
+
export declare const FILE_UPLOAD_MAX_BYTES: number;
|
|
10
|
+
export declare const FILE_CACHE_MAX_AGE_SEC = 31536000;
|
|
11
|
+
export declare const WS_EVENTS: {
|
|
12
|
+
SERVER_VOLATILE: string;
|
|
13
|
+
SERVER: string;
|
|
14
|
+
};
|
|
15
|
+
export declare enum WS_SCENE_EVENT_TYPES {
|
|
16
|
+
INIT = "SCENE_INIT",
|
|
17
|
+
UPDATE = "SCENE_UPDATE"
|
|
18
|
+
}
|
|
19
|
+
export declare const FIREBASE_STORAGE_PREFIXES: {
|
|
20
|
+
shareLinkFiles: string;
|
|
21
|
+
collabFiles: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const ROOM_ID_BYTES = 10;
|
|
24
|
+
export declare const STORAGE_KEYS: {
|
|
25
|
+
readonly LOCAL_STORAGE_ELEMENTS: "excalidraw";
|
|
26
|
+
readonly LOCAL_STORAGE_APP_STATE: "excalidraw-state";
|
|
27
|
+
readonly LOCAL_STORAGE_COLLAB: "excalidraw-collab";
|
|
28
|
+
readonly LOCAL_STORAGE_LIBRARY: "excalidraw-library";
|
|
29
|
+
readonly LOCAL_STORAGE_THEME: "excalidraw-theme";
|
|
30
|
+
readonly VERSION_DATA_STATE: "version-dataState";
|
|
31
|
+
readonly VERSION_FILES: "version-files";
|
|
32
|
+
};
|