@zsviczian/excalidraw 0.15.2-obsidian-2 → 0.15.2-obsidian-3
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/dist/excalidraw.development.js +980 -170
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +2 -2
- package/types/actions/actionAddToLibrary.d.ts +33 -18
- package/types/actions/actionBoundText.d.ts +22 -12
- package/types/actions/actionCanvas.d.ts +110 -60
- package/types/actions/actionClipboard.d.ts +55 -30
- package/types/actions/actionDeleteSelected.d.ts +33 -18
- package/types/actions/actionElementLock.d.ts +287 -0
- package/types/actions/actionExport.d.ts +100 -55
- package/types/actions/actionFinalize.d.ts +22 -12
- package/types/actions/actionFlip.d.ts +2 -4
- package/types/actions/actionHistory.d.ts +1 -1
- package/types/actions/actionLinearEditor.d.ts +11 -6
- package/types/actions/actionMenu.d.ts +33 -18
- package/types/actions/actionProperties.d.ts +145 -80
- package/types/actions/actionStyles.d.ts +11 -6
- package/types/actions/actionToggleGridMode.d.ts +11 -6
- package/types/actions/actionToggleStats.d.ts +11 -6
- package/types/actions/actionToggleViewMode.d.ts +11 -6
- package/types/actions/actionToggleZenMode.d.ts +11 -6
- package/types/actions/index.d.ts +1 -1
- package/types/actions/manager.d.ts +1 -1
- package/types/actions/shortcuts.d.ts +1 -1
- package/types/actions/types.d.ts +7 -7
- package/types/charts.d.ts +2 -2
- package/types/clients.d.ts +4 -1
- package/types/colors.d.ts +59 -5
- package/types/components/App.d.ts +3 -0
- package/types/components/Avatar.d.ts +1 -1
- package/types/components/ColorPicker/ColorInput.d.ts +7 -0
- package/types/components/ColorPicker/ColorPicker.d.ts +18 -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 +16 -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 +41 -0
- package/types/components/ColorPicker/keyboardNavHandlers.d.ts +16 -0
- package/types/components/ContextMenu.d.ts +3 -3
- package/types/components/Dialog.d.ts +2 -2
- package/types/components/FilledButton.d.ts +16 -0
- package/types/components/FixedSideContainer.d.ts +1 -1
- package/types/components/HandButton.d.ts +1 -1
- package/types/components/HelpButton.d.ts +1 -1
- package/types/components/ImageExportDialog.d.ts +7 -12
- package/types/components/Island.d.ts +1 -1
- package/types/components/JSONExportDialog.d.ts +1 -1
- package/types/components/LayerUI.d.ts +3 -2
- package/types/components/LibraryMenu.d.ts +2 -2
- package/types/components/LibraryMenuControlButtons.d.ts +4 -4
- package/types/components/LibraryMenuHeaderContent.d.ts +3 -1
- package/types/components/LibraryMenuItems.d.ts +4 -5
- package/types/components/LibraryMenuSection.d.ts +22 -0
- package/types/components/LibraryUnit.d.ts +7 -3
- package/types/components/LockButton.d.ts +1 -1
- package/types/components/MobileMenu.d.ts +1 -1
- 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/RadioGroup.d.ts +12 -0
- package/types/components/Sidebar/common.d.ts +3 -3
- package/types/components/Spinner.d.ts +2 -1
- package/types/components/Stack.d.ts +4 -3
- package/types/components/Switch.d.ts +9 -0
- package/types/components/ToolButton.d.ts +3 -3
- package/types/components/Tooltip.d.ts +1 -1
- package/types/components/icons.d.ts +7 -1
- package/types/constants.d.ts +5 -0
- package/types/context/tunnels.d.ts +2 -2
- package/types/data/encode.d.ts +1 -1
- package/types/data/filesystem.d.ts +1 -1
- package/types/data/library.d.ts +2 -0
- package/types/data/restore.d.ts +2 -2
- package/types/data/types.d.ts +1 -1
- package/types/element/Hyperlink.d.ts +11 -6
- package/types/element/binding.d.ts +2 -2
- package/types/element/bounds.d.ts +1 -1
- package/types/element/linearElementEditor.d.ts +11 -6
- package/types/element/mutateElement.d.ts +1 -1
- package/types/element/newElement.d.ts +1 -1
- package/types/element/resizeElements.d.ts +1 -0
- package/types/element/transformHandles.d.ts +5 -5
- package/types/element/types.d.ts +35 -35
- package/types/errors.d.ts +1 -1
- package/types/ga.d.ts +5 -5
- package/types/hooks/useLibraryItemSvg.d.ts +31 -0
- package/types/hooks/useScrollPosition.d.ts +2 -0
- package/types/hooks/useTransition.d.ts +2 -0
- package/types/i18n.d.ts +2 -2
- package/types/keys.d.ts +1 -1
- package/types/packages/excalidraw/index.d.ts +1 -1
- package/types/packages/utils.d.ts +2 -2
- package/types/renderer/easingFunctions.d.ts +1 -1
- package/types/renderer/renderElement.d.ts +2 -2
- package/types/scene/Scene.d.ts +4 -4
- package/types/scene/types.d.ts +4 -4
- package/types/types.d.ts +45 -37
- package/types/utility-types.d.ts +13 -13
- package/types/utils.d.ts +3 -3
|
@@ -3,7 +3,7 @@ import { NonDeletedExcalidrawElement } from "../element/types";
|
|
|
3
3
|
import { ExportOpts, BinaryFiles, UIAppState } from "../types";
|
|
4
4
|
import "./ExportDialog.scss";
|
|
5
5
|
import { ActionManager } from "../actions/manager";
|
|
6
|
-
export
|
|
6
|
+
export type ExportCB = (elements: readonly NonDeletedExcalidrawElement[], scale?: number) => void;
|
|
7
7
|
export declare const JSONExportDialog: ({ elements, appState, files, actionManager, exportOpts, canvas, setAppState, }: {
|
|
8
8
|
elements: readonly NonDeletedExcalidrawElement[];
|
|
9
9
|
appState: UIAppState;
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { ActionManager } from "../actions/manager";
|
|
3
3
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
4
4
|
import { Language } from "../i18n";
|
|
5
|
-
import { AppProps, AppState, ExcalidrawProps, BinaryFiles, UIAppState } from "../types";
|
|
5
|
+
import { AppProps, AppState, ExcalidrawProps, BinaryFiles, UIAppState, AppClassProperties } from "../types";
|
|
6
6
|
import "./LayerUI.scss";
|
|
7
7
|
import "./Toolbar.scss";
|
|
8
8
|
interface LayerUIProps {
|
|
@@ -23,8 +23,9 @@ interface LayerUIProps {
|
|
|
23
23
|
onImageAction: (data: {
|
|
24
24
|
insertOnCanvasDirectly: boolean;
|
|
25
25
|
}) => void;
|
|
26
|
+
onExportImage: AppClassProperties["onExportImage"];
|
|
26
27
|
renderWelcomeScreen: boolean;
|
|
27
28
|
children?: React.ReactNode;
|
|
28
29
|
}
|
|
29
|
-
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onImageAction, renderWelcomeScreen, children, }: LayerUIProps) => JSX.Element>;
|
|
30
|
+
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onLockToggle, onHandToolToggle, onPenModeToggle, showExitZenModeBtn, renderTopRightUI, renderCustomStats, UIOptions, onImageAction, onExportImage, renderWelcomeScreen, children, }: LayerUIProps) => JSX.Element>;
|
|
30
31
|
export default _default;
|
|
@@ -25,7 +25,7 @@ export declare const isLibraryMenuOpenAtom: import("jotai").Atom<boolean> & {
|
|
|
25
25
|
} & {
|
|
26
26
|
init: boolean;
|
|
27
27
|
};
|
|
28
|
-
export declare const LibraryMenuContent: ({ onInsertLibraryItems, pendingElements, onAddToLibrary, setAppState, libraryReturnUrl, library, id,
|
|
28
|
+
export declare const LibraryMenuContent: ({ onInsertLibraryItems, pendingElements, onAddToLibrary, setAppState, libraryReturnUrl, library, id, theme, selectedItems, onSelectItems, }: {
|
|
29
29
|
pendingElements: LibraryItem["elements"];
|
|
30
30
|
onInsertLibraryItems: (libraryItems: LibraryItems) => void;
|
|
31
31
|
onAddToLibrary: () => void;
|
|
@@ -33,7 +33,7 @@ export declare const LibraryMenuContent: ({ onInsertLibraryItems, pendingElement
|
|
|
33
33
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
34
34
|
library: Library;
|
|
35
35
|
id: string;
|
|
36
|
-
|
|
36
|
+
theme: UIAppState["theme"];
|
|
37
37
|
selectedItems: LibraryItem["id"][];
|
|
38
38
|
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
39
39
|
}) => JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const LibraryMenuControlButtons: ({
|
|
3
|
-
selectedItems: LibraryItem["id"][];
|
|
4
|
-
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
1
|
+
import { ExcalidrawProps, UIAppState } from "../types";
|
|
2
|
+
export declare const LibraryMenuControlButtons: ({ libraryReturnUrl, theme, id, style, children, className, }: {
|
|
5
3
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
6
4
|
theme: UIAppState["theme"];
|
|
7
5
|
id: string;
|
|
8
6
|
style: React.CSSProperties;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
className?: string | undefined;
|
|
9
9
|
}) => JSX.Element;
|
|
@@ -9,8 +9,10 @@ export declare const LibraryDropdownMenuButton: React.FC<{
|
|
|
9
9
|
resetLibrary: () => void;
|
|
10
10
|
onSelectItems: (items: LibraryItem["id"][]) => void;
|
|
11
11
|
appState: UIAppState;
|
|
12
|
+
className?: string;
|
|
12
13
|
}>;
|
|
13
|
-
export declare const LibraryDropdownMenu: ({ selectedItems, onSelectItems, }: {
|
|
14
|
+
export declare const LibraryDropdownMenu: ({ selectedItems, onSelectItems, className, }: {
|
|
14
15
|
selectedItems: LibraryItem["id"][];
|
|
15
16
|
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
17
|
+
className?: string | undefined;
|
|
16
18
|
}) => JSX.Element;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { ExcalidrawProps, LibraryItem, LibraryItems, UIAppState } from "../types";
|
|
2
2
|
import "./LibraryMenuItems.scss";
|
|
3
|
-
|
|
3
|
+
export default function LibraryMenuItems({ isLoading, libraryItems, onAddToLibrary, onInsertLibraryItems, pendingElements, theme, id, libraryReturnUrl, onSelectItems, selectedItems, }: {
|
|
4
4
|
isLoading: boolean;
|
|
5
5
|
libraryItems: LibraryItems;
|
|
6
6
|
pendingElements: LibraryItem["elements"];
|
|
7
7
|
onInsertLibraryItems: (libraryItems: LibraryItems) => void;
|
|
8
8
|
onAddToLibrary: (elements: LibraryItem["elements"]) => void;
|
|
9
|
-
selectedItems: LibraryItem["id"][];
|
|
10
|
-
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
11
9
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
12
10
|
theme: UIAppState["theme"];
|
|
13
11
|
id: string;
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
selectedItems: LibraryItem["id"][];
|
|
13
|
+
onSelectItems: (id: LibraryItem["id"][]) => void;
|
|
14
|
+
}): JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { LibraryItem } from "../types";
|
|
3
|
+
import { ExcalidrawElement, NonDeleted } from "../element/types";
|
|
4
|
+
import { SvgCache } from "../hooks/useLibraryItemSvg";
|
|
5
|
+
type LibraryOrPendingItem = (LibraryItem | /* pending library item */ {
|
|
6
|
+
id: null;
|
|
7
|
+
elements: readonly NonDeleted<ExcalidrawElement>[];
|
|
8
|
+
})[];
|
|
9
|
+
interface Props {
|
|
10
|
+
items: LibraryOrPendingItem;
|
|
11
|
+
onClick: (id: LibraryItem["id"] | null) => void;
|
|
12
|
+
onItemSelectToggle: (id: LibraryItem["id"], event: React.MouseEvent) => void;
|
|
13
|
+
onItemDrag: (id: LibraryItem["id"], event: React.DragEvent) => void;
|
|
14
|
+
isItemSelected: (id: LibraryItem["id"] | null) => boolean;
|
|
15
|
+
svgCache: SvgCache;
|
|
16
|
+
itemsRenderedPerBatch: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const LibraryMenuSectionGrid: ({ children, }: {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}) => JSX.Element;
|
|
21
|
+
export declare const LibraryMenuSection: React.MemoExoticComponent<({ items, onItemSelectToggle, onItemDrag, isItemSelected, onClick, svgCache, itemsRenderedPerBatch, }: Props) => JSX.Element>;
|
|
22
|
+
export {};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { LibraryItem } from "../types";
|
|
2
3
|
import "./LibraryUnit.scss";
|
|
3
|
-
|
|
4
|
+
import { SvgCache } from "../hooks/useLibraryItemSvg";
|
|
5
|
+
export declare const LibraryUnit: import("react").MemoExoticComponent<({ id, elements, isPending, onClick, selected, onToggle, onDrag, svgCache, }: {
|
|
4
6
|
id: LibraryItem["id"] | /** for pending item */ null;
|
|
5
7
|
elements?: readonly import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | undefined;
|
|
6
8
|
isPending?: boolean | undefined;
|
|
7
|
-
onClick: () => void;
|
|
9
|
+
onClick: (id: LibraryItem["id"] | null) => void;
|
|
8
10
|
selected: boolean;
|
|
9
11
|
onToggle: (id: string, event: React.MouseEvent) => void;
|
|
10
12
|
onDrag: (id: string, event: React.DragEvent) => void;
|
|
11
|
-
|
|
13
|
+
svgCache: SvgCache;
|
|
14
|
+
}) => JSX.Element>;
|
|
15
|
+
export declare const EmptyLibraryUnit: () => JSX.Element;
|
|
@@ -2,7 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { AppState, Device, ExcalidrawProps, UIAppState } from "../types";
|
|
3
3
|
import { ActionManager } from "../actions/manager";
|
|
4
4
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
|
-
|
|
5
|
+
type MobileMenuProps = {
|
|
6
6
|
appState: UIAppState;
|
|
7
7
|
actionManager: ActionManager;
|
|
8
8
|
renderJSONExportDialog: () => React.ReactNode;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "./TextInput.scss";
|
|
2
2
|
import "./ProjectName.scss";
|
|
3
|
-
|
|
3
|
+
type Props = {
|
|
4
4
|
value: string;
|
|
5
5
|
onChange: (value: string) => void;
|
|
6
6
|
label: string;
|
|
7
7
|
isNameEditable: boolean;
|
|
8
|
+
ignoreFocus?: boolean;
|
|
8
9
|
};
|
|
9
10
|
export declare const ProjectName: (props: Props) => JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./RadioGroup.scss";
|
|
2
|
+
export type RadioGroupChoice<T> = {
|
|
3
|
+
value: T;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
export type RadioGroupProps<T> = {
|
|
7
|
+
choices: RadioGroupChoice<T>[];
|
|
8
|
+
value: T;
|
|
9
|
+
onChange: (value: T) => void;
|
|
10
|
+
name: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const RadioGroup: <T>({ onChange, value, choices, name, }: RadioGroupProps<T>) => JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AppState, SidebarName, SidebarTabName } from "../../types";
|
|
3
|
-
export
|
|
3
|
+
export type SidebarTriggerProps = {
|
|
4
4
|
name: SidebarName;
|
|
5
5
|
tab?: SidebarTabName;
|
|
6
6
|
icon?: JSX.Element;
|
|
@@ -10,7 +10,7 @@ export declare type SidebarTriggerProps = {
|
|
|
10
10
|
onToggle?: (open: boolean) => void;
|
|
11
11
|
style?: React.CSSProperties;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type SidebarProps<P = {}> = {
|
|
14
14
|
name: SidebarName;
|
|
15
15
|
children: React.ReactNode;
|
|
16
16
|
/**
|
|
@@ -26,7 +26,7 @@ export declare type SidebarProps<P = {}> = {
|
|
|
26
26
|
/** @private internal */
|
|
27
27
|
__fallback?: boolean;
|
|
28
28
|
} & P;
|
|
29
|
-
export
|
|
29
|
+
export type SidebarPropsContextValue = Pick<SidebarProps, "onDock" | "docked"> & {
|
|
30
30
|
onCloseRequest: () => void;
|
|
31
31
|
shouldRenderDockButton: boolean;
|
|
32
32
|
};
|
|
@@ -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;
|
|
@@ -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
2
|
import React 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;
|
|
@@ -20,7 +20,7 @@ declare type ToolButtonBaseProps = {
|
|
|
20
20
|
className?: string;
|
|
21
21
|
isLoading?: boolean;
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
type ToolButtonProps = (ToolButtonBaseProps & {
|
|
24
24
|
type: "button";
|
|
25
25
|
children?: React.ReactNode;
|
|
26
26
|
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;
|
|
@@ -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;
|
|
@@ -140,4 +140,10 @@ export declare const TextAlignMiddleIcon: React.MemoExoticComponent<({ theme }:
|
|
|
140
140
|
export declare const publishIcon: JSX.Element;
|
|
141
141
|
export declare const eraser: JSX.Element;
|
|
142
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;
|
|
143
149
|
export {};
|
package/types/constants.d.ts
CHANGED
|
@@ -113,6 +113,11 @@ export declare const MIME_TYPES: {
|
|
|
113
113
|
readonly "excalidraw.png": "image/png";
|
|
114
114
|
readonly binary: "application/octet-stream";
|
|
115
115
|
};
|
|
116
|
+
export declare const EXPORT_IMAGE_TYPES: {
|
|
117
|
+
readonly png: "png";
|
|
118
|
+
readonly svg: "svg";
|
|
119
|
+
readonly clipboard: "clipboard";
|
|
120
|
+
};
|
|
116
121
|
export declare const EXPORT_DATA_TYPES: {
|
|
117
122
|
readonly excalidraw: "excalidraw";
|
|
118
123
|
readonly excalidrawClipboard: "excalidraw/clipboard";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import tunnel from "tunnel-rat";
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export type Tunnel = ReturnType<typeof tunnel>;
|
|
4
|
+
type TunnelsContextValue = {
|
|
5
5
|
MainMenuTunnel: Tunnel;
|
|
6
6
|
WelcomeScreenMenuHintTunnel: Tunnel;
|
|
7
7
|
WelcomeScreenToolbarHintTunnel: Tunnel;
|
package/types/data/encode.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const toByteString: (data: string | Uint8Array | ArrayBuffer) =>
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const stringToBase64: (str: string, isByteString?: boolean) => Promise<string>;
|
|
7
7
|
export declare const base64ToString: (base64: string, isByteString?: boolean) => Promise<string>;
|
|
8
|
-
|
|
8
|
+
type EncodedData = {
|
|
9
9
|
encoded: string;
|
|
10
10
|
encoding: "bstring";
|
|
11
11
|
/** whether text is compressed (zlib) */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FileSystemHandle, supported as nativeFileSystemSupported } from "browser-fs-access";
|
|
2
2
|
import { MIME_TYPES } from "../constants";
|
|
3
|
-
|
|
3
|
+
type FILE_EXTENSION = Exclude<keyof typeof MIME_TYPES, "binary">;
|
|
4
4
|
export declare const fileOpen: <M extends boolean | undefined = false>(opts: {
|
|
5
5
|
extensions?: FILE_EXTENSION[] | undefined;
|
|
6
6
|
description: string;
|
package/types/data/library.d.ts
CHANGED
|
@@ -70,6 +70,8 @@ declare class Library {
|
|
|
70
70
|
private updateQueue;
|
|
71
71
|
private getLastUpdateTask;
|
|
72
72
|
private notifyListeners;
|
|
73
|
+
/** call on excalidraw instance unmount */
|
|
74
|
+
destroy: () => void;
|
|
73
75
|
resetLibrary: () => Promise<LibraryItems>;
|
|
74
76
|
/**
|
|
75
77
|
* @returns latest cloned libraryItems. Awaits all in-progress updates first.
|
package/types/data/restore.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ExcalidrawElement } from "../element/types";
|
|
2
2
|
import { AppState, BinaryFiles, LibraryItem } from "../types";
|
|
3
3
|
import { ImportedDataState } from "./types";
|
|
4
|
-
|
|
4
|
+
type RestoredAppState = Omit<AppState, "offsetTop" | "offsetLeft" | "width" | "height">;
|
|
5
5
|
export declare const AllowedExcalidrawActiveTools: Record<AppState["activeTool"]["type"], boolean>;
|
|
6
|
-
export
|
|
6
|
+
export type RestoredDataState = {
|
|
7
7
|
elements: ExcalidrawElement[];
|
|
8
8
|
appState: RestoredAppState;
|
|
9
9
|
files: BinaryFiles;
|
package/types/data/types.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface ExportedDataState {
|
|
|
17
17
|
* This is a helper type used in downstream abstractions.
|
|
18
18
|
* Don't consume on its own.
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export type LegacyAppState = {
|
|
21
21
|
/** @deprecated #6213 TODO remove 23-06-01 */
|
|
22
22
|
isSidebarDocked: [boolean, "defaultSidebarDockedPreference"];
|
|
23
23
|
};
|
|
@@ -75,7 +75,7 @@ export declare const actionLink: {
|
|
|
75
75
|
zoom: Readonly<{
|
|
76
76
|
value: import("../types").NormalizedZoomValue;
|
|
77
77
|
}>;
|
|
78
|
-
openPopup: "
|
|
78
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
79
79
|
openSidebar: {
|
|
80
80
|
name: string;
|
|
81
81
|
tab?: string | undefined;
|
|
@@ -122,11 +122,16 @@ export declare const actionLink: {
|
|
|
122
122
|
pendingImageElementId: string | null;
|
|
123
123
|
linkOpacity: number;
|
|
124
124
|
trayModeEnabled: boolean;
|
|
125
|
-
colorPalette
|
|
126
|
-
canvasBackground
|
|
127
|
-
elementBackground
|
|
128
|
-
elementStroke
|
|
129
|
-
|
|
125
|
+
colorPalette?: {
|
|
126
|
+
canvasBackground: import("../colors").ColorPaletteCustom;
|
|
127
|
+
elementBackground: import("../colors").ColorPaletteCustom;
|
|
128
|
+
elementStroke: import("../colors").ColorPaletteCustom;
|
|
129
|
+
topPicks: {
|
|
130
|
+
canvasBackground: [string, string, string, string, string];
|
|
131
|
+
elementStroke: [string, string, string, string, string];
|
|
132
|
+
elementBackground: [string, string, string, string, string];
|
|
133
|
+
};
|
|
134
|
+
} | undefined;
|
|
130
135
|
allowWheelZoom?: boolean | undefined;
|
|
131
136
|
allowPinchZoom?: boolean | undefined;
|
|
132
137
|
pinnedScripts?: string[] | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ExcalidrawLinearElement, ExcalidrawBindableElement, NonDeleted, NonDeletedExcalidrawElement, ExcalidrawElement } from "./types";
|
|
2
2
|
import { AppState } from "../types";
|
|
3
3
|
import Scene from "../scene/Scene";
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type SuggestedBinding = NonDeleted<ExcalidrawBindableElement> | SuggestedPointBinding;
|
|
5
|
+
export type SuggestedPointBinding = [
|
|
6
6
|
NonDeleted<ExcalidrawLinearElement>,
|
|
7
7
|
"start" | "end" | "both",
|
|
8
8
|
NonDeleted<ExcalidrawBindableElement>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExcalidrawElement, ExcalidrawLinearElement, Arrowhead, NonDeleted } from "./types";
|
|
2
2
|
import { Drawable, Op } from "roughjs/bin/core";
|
|
3
|
-
export
|
|
3
|
+
export type Bounds = readonly [number, number, number, number];
|
|
4
4
|
export declare const getElementAbsoluteCoords: (element: ExcalidrawElement, includeBoundText?: boolean) => [number, number, number, number, number, number];
|
|
5
5
|
export declare const pointRelativeTo: (element: ExcalidrawElement, absoluteCoords: readonly [number, number]) => readonly [number, number];
|
|
6
6
|
export declare const getDiamondPoints: (element: ExcalidrawElement) => number[];
|
|
@@ -180,7 +180,7 @@ export declare class LinearElementEditor {
|
|
|
180
180
|
value: import("../types").NormalizedZoomValue;
|
|
181
181
|
}>;
|
|
182
182
|
openMenu: "canvas" | "shape" | null;
|
|
183
|
-
openPopup: "
|
|
183
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
184
184
|
openSidebar: {
|
|
185
185
|
name: string;
|
|
186
186
|
tab?: string | undefined;
|
|
@@ -228,11 +228,16 @@ export declare class LinearElementEditor {
|
|
|
228
228
|
showHyperlinkPopup: false | "info" | "editor";
|
|
229
229
|
linkOpacity: number;
|
|
230
230
|
trayModeEnabled: boolean;
|
|
231
|
-
colorPalette
|
|
232
|
-
canvasBackground
|
|
233
|
-
elementBackground
|
|
234
|
-
elementStroke
|
|
235
|
-
|
|
231
|
+
colorPalette?: {
|
|
232
|
+
canvasBackground: import("../colors").ColorPaletteCustom;
|
|
233
|
+
elementBackground: import("../colors").ColorPaletteCustom;
|
|
234
|
+
elementStroke: import("../colors").ColorPaletteCustom;
|
|
235
|
+
topPicks: {
|
|
236
|
+
canvasBackground: [string, string, string, string, string];
|
|
237
|
+
elementStroke: [string, string, string, string, string];
|
|
238
|
+
elementBackground: [string, string, string, string, string];
|
|
239
|
+
};
|
|
240
|
+
} | undefined;
|
|
236
241
|
allowWheelZoom?: boolean | undefined;
|
|
237
242
|
allowPinchZoom?: boolean | undefined;
|
|
238
243
|
pinnedScripts?: string[] | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExcalidrawElement } from "./types";
|
|
2
2
|
import { Mutable } from "../utility-types";
|
|
3
|
-
|
|
3
|
+
type ElementUpdate<TElement extends ExcalidrawElement> = Omit<Partial<TElement>, "id" | "version" | "versionNonce">;
|
|
4
4
|
export declare const mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean) => TElement;
|
|
5
5
|
export declare const newElementWith: <TElement extends ExcalidrawElement>(element: TElement, updates: ElementUpdate<TElement>) => TElement;
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ExcalidrawElement, ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, GroupId, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer } from "../element/types";
|
|
2
2
|
import { AppState } from "../types";
|
|
3
3
|
import { MarkOptional, Mutable } from "../utility-types";
|
|
4
|
-
|
|
4
|
+
type ElementConstructorOpts = MarkOptional<Omit<ExcalidrawGenericElement, "id" | "type" | "isDeleted" | "updated">, "width" | "height" | "angle" | "groupIds" | "boundElements" | "seed" | "version" | "versionNonce" | "link" | "strokeStyle" | "fillStyle" | "strokeColor" | "backgroundColor" | "roughness" | "strokeWidth" | "roundness" | "locked" | "opacity">;
|
|
5
5
|
export declare const newElement: (opts: {
|
|
6
6
|
type: ExcalidrawGenericElement["type"];
|
|
7
7
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawGenericElement>;
|
|
@@ -4,5 +4,6 @@ import { PointerDownState } from "../types";
|
|
|
4
4
|
export declare const normalizeAngle: (angle: number) => number;
|
|
5
5
|
export declare const transformElements: (pointerDownState: PointerDownState, transformHandleType: MaybeTransformHandleType, selectedElements: readonly NonDeletedExcalidrawElement[], resizeArrowDirection: "origin" | "end", shouldRotateWithDiscreteAngle: boolean, shouldResizeFromCenter: boolean, shouldMaintainAspectRatio: boolean, pointerX: number, pointerY: number, centerX: number, centerY: number) => boolean;
|
|
6
6
|
export declare const resizeSingleElement: (originalElements: PointerDownState["originalElements"], shouldMaintainAspectRatio: boolean, element: NonDeletedExcalidrawElement, transformHandleDirection: TransformHandleDirection, shouldResizeFromCenter: boolean, pointerX: number, pointerY: number) => void;
|
|
7
|
+
export declare const resizeMultipleElements: (pointerDownState: PointerDownState, selectedElements: readonly NonDeletedExcalidrawElement[], transformHandleType: "nw" | "ne" | "sw" | "se", shouldResizeFromCenter: boolean, pointerX: number, pointerY: number) => void;
|
|
7
8
|
export declare const getResizeOffsetXY: (transformHandleType: MaybeTransformHandleType, selectedElements: NonDeletedExcalidrawElement[], x: number, y: number) => [number, number];
|
|
8
9
|
export declare const getResizeArrowDirection: (transformHandleType: MaybeTransformHandleType, element: NonDeleted<ExcalidrawLinearElement>) => "origin" | "end";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ExcalidrawElement, NonDeletedExcalidrawElement, PointerType } from "./types";
|
|
2
2
|
import { AppState, Zoom } from "../types";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
3
|
+
export type TransformHandleDirection = "n" | "s" | "w" | "e" | "nw" | "ne" | "sw" | "se";
|
|
4
|
+
export type TransformHandleType = TransformHandleDirection | "rotation";
|
|
5
|
+
export type TransformHandle = [number, number, number, number];
|
|
6
|
+
export type TransformHandles = Partial<{
|
|
7
7
|
[T in TransformHandleType]: TransformHandle;
|
|
8
8
|
}>;
|
|
9
|
-
export
|
|
9
|
+
export type MaybeTransformHandleType = TransformHandleType | false;
|
|
10
10
|
export declare const OMIT_SIDES_FOR_MULTIPLE_ELEMENTS: {
|
|
11
11
|
e: boolean;
|
|
12
12
|
s: boolean;
|