@zsviczian/excalidraw 0.12.0-obsidian-5 → 0.12.0-obsidian-6
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 +16 -8
- package/dist/excalidraw.development.js +35 -24
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/components/Actions.d.ts +13 -2
- package/types/components/App.d.ts +3 -0
- package/types/components/Footer.d.ts +9 -0
- package/types/components/LayerUI.d.ts +1 -1
- package/types/components/LibraryMenu.d.ts +1 -2
- package/types/components/MobileMenu.d.ts +3 -3
- package/types/components/Stats.d.ts +1 -1
- package/types/element/Hyperlink.d.ts +1 -2
- package/types/element/bounds.d.ts +1 -1
- package/types/element/transformHandles.d.ts +2 -2
- package/types/element/types.d.ts +1 -0
- package/types/points.d.ts +2 -1
- package/types/renderer/renderScene.d.ts +17 -2
- package/types/types.d.ts +0 -1
package/package.json
CHANGED
|
@@ -2,11 +2,10 @@ import React from "react";
|
|
|
2
2
|
import { ActionManager } from "../actions/manager";
|
|
3
3
|
import { ExcalidrawElement, PointerType } from "../element/types";
|
|
4
4
|
import { AppState, Zoom } from "../types";
|
|
5
|
-
export declare const SelectedShapeActions: ({ appState, elements, renderAction,
|
|
5
|
+
export declare const SelectedShapeActions: ({ appState, elements, renderAction, }: {
|
|
6
6
|
appState: AppState;
|
|
7
7
|
elements: readonly ExcalidrawElement[];
|
|
8
8
|
renderAction: ActionManager["renderAction"];
|
|
9
|
-
activeTool: AppState["activeTool"]["type"];
|
|
10
9
|
}) => JSX.Element;
|
|
11
10
|
export declare const ShapesSwitcher: ({ canvas, activeTool, setAppState, onImageAction, appState, }: {
|
|
12
11
|
canvas: HTMLCanvasElement | null;
|
|
@@ -21,3 +20,15 @@ export declare const ZoomActions: ({ renderAction, zoom, }: {
|
|
|
21
20
|
renderAction: ActionManager["renderAction"];
|
|
22
21
|
zoom: Zoom;
|
|
23
22
|
}) => JSX.Element;
|
|
23
|
+
export declare const UndoRedoActions: ({ renderAction, className, }: {
|
|
24
|
+
renderAction: ActionManager["renderAction"];
|
|
25
|
+
className?: string | undefined;
|
|
26
|
+
}) => JSX.Element;
|
|
27
|
+
export declare const ExitZenModeAction: ({ executeAction, showExitZenModeBtn, }: {
|
|
28
|
+
executeAction: ActionManager["executeAction"];
|
|
29
|
+
showExitZenModeBtn: boolean;
|
|
30
|
+
}) => JSX.Element;
|
|
31
|
+
export declare const FinalizeAction: ({ renderAction, className, }: {
|
|
32
|
+
renderAction: ActionManager["renderAction"];
|
|
33
|
+
className?: string | undefined;
|
|
34
|
+
}) => JSX.Element;
|
|
@@ -20,6 +20,8 @@ export declare const useExcalidrawContainer: () => {
|
|
|
20
20
|
container: HTMLDivElement | null;
|
|
21
21
|
id: string | null;
|
|
22
22
|
};
|
|
23
|
+
export declare const useExcalidrawElements: () => readonly NonDeletedExcalidrawElement[];
|
|
24
|
+
export declare const useExcalidrawAppState: () => AppState;
|
|
23
25
|
declare class App extends React.Component<AppProps, AppState> {
|
|
24
26
|
canvas: AppClassProperties["canvas"];
|
|
25
27
|
rc: RoughCanvas | null;
|
|
@@ -73,6 +75,7 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
73
75
|
private removeEventListeners;
|
|
74
76
|
private addEventListeners;
|
|
75
77
|
componentDidUpdate(prevProps: AppProps, prevState: AppState): void;
|
|
78
|
+
private renderScene;
|
|
76
79
|
private onScroll;
|
|
77
80
|
private onCut;
|
|
78
81
|
private onCopy;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActionManager } from "../actions/manager";
|
|
2
|
+
import { AppState, ExcalidrawProps } from "../types";
|
|
3
|
+
declare const Footer: ({ appState, actionManager, renderCustomFooter, showExitZenModeBtn, }: {
|
|
4
|
+
appState: AppState;
|
|
5
|
+
actionManager: ActionManager;
|
|
6
|
+
renderCustomFooter?: ExcalidrawProps["renderFooter"];
|
|
7
|
+
showExitZenModeBtn: boolean;
|
|
8
|
+
}) => JSX.Element;
|
|
9
|
+
export default Footer;
|
|
@@ -33,5 +33,5 @@ interface LayerUIProps {
|
|
|
33
33
|
insertOnCanvasDirectly: boolean;
|
|
34
34
|
}) => void;
|
|
35
35
|
}
|
|
36
|
-
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState,
|
|
36
|
+
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onCollabButtonClick, onLockToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, showThemeBtn, isCollaborating, renderTopRightUI, renderCustomFooter, renderCustomStats, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, }: LayerUIProps) => JSX.Element>;
|
|
37
37
|
export default _default;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import Library from "../data/library";
|
|
2
2
|
import { LibraryItems, LibraryItem, AppState, BinaryFiles, ExcalidrawProps } from "../types";
|
|
3
3
|
import "./LibraryMenu.scss";
|
|
4
|
-
export declare const LibraryMenu: ({ onClose, onInsertLibraryItems, pendingElements, onAddToLibrary,
|
|
4
|
+
export declare const LibraryMenu: ({ onClose, onInsertLibraryItems, pendingElements, onAddToLibrary, setAppState, files, libraryReturnUrl, focusContainer, library, id, appState, }: {
|
|
5
5
|
pendingElements: LibraryItem["elements"];
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
onInsertLibraryItems: (libraryItems: LibraryItems) => void;
|
|
8
8
|
onAddToLibrary: () => void;
|
|
9
|
-
theme: AppState["theme"];
|
|
10
9
|
files: BinaryFiles;
|
|
11
10
|
setAppState: React.Component<any, AppState>["setState"];
|
|
12
11
|
libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { AppState } from "../types";
|
|
2
|
+
import { AppState, ExcalidrawProps } from "../types";
|
|
3
3
|
import { ActionManager } from "../actions/manager";
|
|
4
4
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
declare type MobileMenuProps = {
|
|
@@ -21,7 +21,7 @@ declare type MobileMenuProps = {
|
|
|
21
21
|
insertOnCanvasDirectly: boolean;
|
|
22
22
|
}) => void;
|
|
23
23
|
renderTopRightUI?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
|
|
24
|
-
|
|
24
|
+
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
25
25
|
};
|
|
26
|
-
export declare const MobileMenu: ({ appState, elements, libraryMenu, actionManager, renderJSONExportDialog, renderImageExportDialog, setAppState, onCollabButtonClick, onLockToggle, onPenModeToggle, canvas, isCollaborating, renderCustomFooter, showThemeBtn, onImageAction, renderTopRightUI,
|
|
26
|
+
export declare const MobileMenu: ({ appState, elements, libraryMenu, actionManager, renderJSONExportDialog, renderImageExportDialog, setAppState, onCollabButtonClick, onLockToggle, onPenModeToggle, canvas, isCollaborating, renderCustomFooter, showThemeBtn, onImageAction, renderTopRightUI, renderCustomStats, }: MobileMenuProps) => JSX.Element;
|
|
27
27
|
export {};
|
|
@@ -4,9 +4,8 @@ import { NonDeletedExcalidrawElement } from "./types";
|
|
|
4
4
|
import { Bounds } from "./bounds";
|
|
5
5
|
import "./Hyperlink.scss";
|
|
6
6
|
export declare const EXTERNAL_LINK_IMG: HTMLImageElement;
|
|
7
|
-
export declare const Hyperlink: ({ element,
|
|
7
|
+
export declare const Hyperlink: ({ element, setAppState, onLinkOpen, }: {
|
|
8
8
|
element: NonDeletedExcalidrawElement;
|
|
9
|
-
appState: AppState;
|
|
10
9
|
setAppState: React.Component<any, AppState>["setState"];
|
|
11
10
|
onLinkOpen: ExcalidrawProps["onLinkOpen"];
|
|
12
11
|
}) => JSX.Element | null;
|
|
@@ -8,7 +8,7 @@ export declare const getCurvePathOps: (shape: Drawable) => Op[];
|
|
|
8
8
|
export declare const getArrowheadPoints: (element: ExcalidrawLinearElement, shape: Drawable[], position: "start" | "end", arrowhead: Arrowhead) => number[] | null;
|
|
9
9
|
export declare const getElementBounds: (element: ExcalidrawElement) => [number, number, number, number];
|
|
10
10
|
export declare const getCommonBounds: (elements: readonly ExcalidrawElement[]) => [number, number, number, number];
|
|
11
|
-
export declare const getResizedElementAbsoluteCoords: (element: ExcalidrawElement, nextWidth: number, nextHeight: number) => [number, number, number, number];
|
|
11
|
+
export declare const getResizedElementAbsoluteCoords: (element: ExcalidrawElement, nextWidth: number, nextHeight: number, normalizePoints: boolean) => [number, number, number, number];
|
|
12
12
|
export declare const getElementPointsCoords: (element: ExcalidrawLinearElement, points: readonly (readonly [number, number])[], sharpness: ExcalidrawElement["strokeSharpness"]) => [number, number, number, number];
|
|
13
13
|
export declare const getClosestElementBounds: (elements: readonly ExcalidrawElement[], from: {
|
|
14
14
|
x: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExcalidrawElement, NonDeletedExcalidrawElement, PointerType } from "./types";
|
|
2
2
|
import { Bounds } from "./bounds";
|
|
3
|
-
import { Zoom } from "../types";
|
|
3
|
+
import { AppState, Zoom } from "../types";
|
|
4
4
|
export declare type TransformHandleDirection = "n" | "s" | "w" | "e" | "nw" | "ne" | "sw" | "se";
|
|
5
5
|
export declare type TransformHandleType = TransformHandleDirection | "rotation";
|
|
6
6
|
export declare type TransformHandle = [number, number, number, number];
|
|
@@ -26,4 +26,4 @@ export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2]: Bounds, a
|
|
|
26
26
|
rotation?: boolean | undefined;
|
|
27
27
|
}, margin?: number) => TransformHandles;
|
|
28
28
|
export declare const getTransformHandles: (element: ExcalidrawElement, zoom: Zoom, pointerType?: PointerType) => TransformHandles;
|
|
29
|
-
export declare const shouldShowBoundingBox: (elements: NonDeletedExcalidrawElement[]) => boolean;
|
|
29
|
+
export declare const shouldShowBoundingBox: (elements: NonDeletedExcalidrawElement[], appState: AppState) => boolean;
|
package/types/element/types.d.ts
CHANGED
package/types/points.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export declare const getSizeFromPoints: (points: readonly Point[]) => {
|
|
|
3
3
|
width: number;
|
|
4
4
|
height: number;
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
/** @arg dimension, 0 for rescaling only x, 1 for y */
|
|
7
|
+
export declare const rescalePoints: (dimension: 0 | 1, newSize: number, points: readonly Point[], normalize: boolean) => Point[];
|
|
@@ -4,7 +4,14 @@ import { AppState, BinaryFiles } from "../types";
|
|
|
4
4
|
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
5
5
|
import { RenderConfig } from "../scene/types";
|
|
6
6
|
export declare const DEFAULT_SPACING = 4;
|
|
7
|
-
export declare const _renderScene: (elements
|
|
7
|
+
export declare const _renderScene: ({ elements, appState, scale, rc, canvas, renderConfig, }: {
|
|
8
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
9
|
+
appState: AppState;
|
|
10
|
+
scale: number;
|
|
11
|
+
rc: RoughCanvas;
|
|
12
|
+
canvas: HTMLCanvasElement;
|
|
13
|
+
renderConfig: RenderConfig;
|
|
14
|
+
}) => {
|
|
8
15
|
atLeastOneVisibleElement: boolean;
|
|
9
16
|
scrollBars?: undefined;
|
|
10
17
|
} | {
|
|
@@ -12,7 +19,15 @@ export declare const _renderScene: (elements: readonly NonDeletedExcalidrawEleme
|
|
|
12
19
|
scrollBars: import("../scene/types").ScrollBars | undefined;
|
|
13
20
|
};
|
|
14
21
|
/** renderScene throttled to animation framerate */
|
|
15
|
-
export declare const renderScene: <T extends boolean = false>(
|
|
22
|
+
export declare const renderScene: <T extends boolean = false>(config: {
|
|
23
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
24
|
+
appState: AppState;
|
|
25
|
+
scale: number;
|
|
26
|
+
rc: RoughCanvas;
|
|
27
|
+
canvas: HTMLCanvasElement;
|
|
28
|
+
renderConfig: RenderConfig;
|
|
29
|
+
callback?: ((data: ReturnType<typeof _renderScene>) => void) | undefined;
|
|
30
|
+
}, throttle?: T | undefined) => T extends true ? void : {
|
|
16
31
|
atLeastOneVisibleElement: boolean;
|
|
17
32
|
scrollBars?: undefined;
|
|
18
33
|
} | {
|
package/types/types.d.ts
CHANGED