@excalidraw/excalidraw 0.12.0-6a6b9c9 → 0.12.0-6c1246e
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 +2 -0
- package/README.md +4 -2
- package/dist/excalidraw.development.js +35 -24
- package/dist/excalidraw.production.min.js +1 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +3 -3
- package/types/actions/actionBoundText.d.ts +1 -1
- package/types/actions/actionCanvas.d.ts +8 -8
- package/types/actions/actionClipboard.d.ts +6 -6
- package/types/actions/actionDeleteSelected.d.ts +4 -4
- package/types/actions/actionExport.d.ts +9 -9
- package/types/actions/actionFinalize.d.ts +2 -2
- package/types/actions/actionLinearEditor.d.ts +114 -0
- package/types/actions/actionMenu.d.ts +3 -3
- package/types/actions/actionProperties.d.ts +13 -13
- package/types/actions/actionStyles.d.ts +1 -1
- package/types/actions/actionToggleGridMode.d.ts +1 -1
- package/types/actions/actionToggleLock.d.ts +1 -1
- package/types/actions/actionToggleStats.d.ts +1 -1
- package/types/actions/actionToggleViewMode.d.ts +1 -1
- package/types/actions/actionToggleZenMode.d.ts +1 -1
- package/types/actions/index.d.ts +1 -0
- package/types/actions/types.d.ts +1 -1
- package/types/appState.d.ts +1 -1
- package/types/components/BackgroundPickerAndDarkModeToggle.d.ts +1 -6
- package/types/components/InitializeApp.d.ts +2 -0
- package/types/components/LayerUI.d.ts +1 -2
- package/types/components/LoadingMessage.d.ts +2 -0
- package/types/components/MobileMenu.d.ts +1 -2
- package/types/constants.d.ts +5 -0
- package/types/element/Hyperlink.d.ts +1 -1
- package/types/element/linearElementEditor.d.ts +20 -9
- package/types/element/newElement.d.ts +6 -1
- package/types/element/textElement.d.ts +6 -2
- package/types/element/types.d.ts +2 -2
- package/types/math.d.ts +8 -1
- package/types/types.d.ts +1 -1
package/types/actions/types.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare type ActionResult = {
|
|
|
14
14
|
declare type ActionFn = (elements: readonly ExcalidrawElement[], appState: Readonly<AppState>, formData: any, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
|
|
15
15
|
export declare type UpdaterFn = (res: ActionResult) => void;
|
|
16
16
|
export declare type ActionFilterFn = (action: Action) => void;
|
|
17
|
-
export declare type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToSelection" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeSharpness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "eraser" | "bindText" | "toggleLock";
|
|
17
|
+
export declare type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeOpacity" | "changeFontSize" | "toggleCanvasMenu" | "toggleEditMenu" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "clearCanvas" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToSelection" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeSharpness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "eraser" | "bindText" | "toggleLock" | "toggleLinearEditor";
|
|
18
18
|
export declare type PanelComponentProps = {
|
|
19
19
|
elements: readonly ExcalidrawElement[];
|
|
20
20
|
appState: AppState;
|
package/types/appState.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
|
|
|
35
35
|
currentItemOpacity?: number | undefined;
|
|
36
36
|
currentItemFontFamily?: number | undefined;
|
|
37
37
|
currentItemFontSize?: number | undefined;
|
|
38
|
-
currentItemTextAlign?:
|
|
38
|
+
currentItemTextAlign?: string | undefined;
|
|
39
39
|
currentItemStrokeSharpness?: import("./element/types").StrokeSharpness | undefined;
|
|
40
40
|
currentItemStartArrowhead?: import("./element/types").Arrowhead | null | undefined;
|
|
41
41
|
currentItemEndArrowhead?: import("./element/types").Arrowhead | null | undefined;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { ActionManager } from "../actions/manager";
|
|
3
|
-
|
|
4
|
-
export declare const BackgroundPickerAndDarkModeToggle: ({ appState, setAppState, actionManager, showThemeBtn, }: {
|
|
2
|
+
export declare const BackgroundPickerAndDarkModeToggle: ({ actionManager, }: {
|
|
5
3
|
actionManager: ActionManager;
|
|
6
|
-
appState: AppState;
|
|
7
|
-
setAppState: React.Component<any, AppState>["setState"];
|
|
8
|
-
showThemeBtn: boolean;
|
|
9
4
|
}) => JSX.Element;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Language } from "../i18n";
|
|
3
|
+
import { Theme } from "../element/types";
|
|
3
4
|
interface Props {
|
|
4
5
|
langCode: Language["code"];
|
|
5
6
|
children: React.ReactElement;
|
|
7
|
+
theme?: Theme;
|
|
6
8
|
}
|
|
7
9
|
export declare const InitializeApp: (props: Props) => JSX.Element;
|
|
8
10
|
export {};
|
|
@@ -18,7 +18,6 @@ interface LayerUIProps {
|
|
|
18
18
|
onPenModeToggle: () => void;
|
|
19
19
|
onInsertElements: (elements: readonly NonDeletedExcalidrawElement[]) => void;
|
|
20
20
|
showExitZenModeBtn: boolean;
|
|
21
|
-
showThemeBtn: boolean;
|
|
22
21
|
langCode: Language["code"];
|
|
23
22
|
isCollaborating: boolean;
|
|
24
23
|
renderTopRightUI?: ExcalidrawProps["renderTopRightUI"];
|
|
@@ -33,5 +32,5 @@ interface LayerUIProps {
|
|
|
33
32
|
insertOnCanvasDirectly: boolean;
|
|
34
33
|
}) => void;
|
|
35
34
|
}
|
|
36
|
-
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onCollabButtonClick, onLockToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn,
|
|
35
|
+
declare const _default: React.MemoExoticComponent<({ actionManager, appState, files, setAppState, elements, canvas, onCollabButtonClick, onLockToggle, onPenModeToggle, onInsertElements, showExitZenModeBtn, isCollaborating, renderTopRightUI, renderCustomFooter, renderCustomStats, libraryReturnUrl, UIOptions, focusContainer, library, id, onImageAction, }: LayerUIProps) => JSX.Element>;
|
|
37
36
|
export default _default;
|
|
@@ -16,12 +16,11 @@ declare type MobileMenuProps = {
|
|
|
16
16
|
canvas: HTMLCanvasElement | null;
|
|
17
17
|
isCollaborating: boolean;
|
|
18
18
|
renderCustomFooter?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
|
|
19
|
-
showThemeBtn: boolean;
|
|
20
19
|
onImageAction: (data: {
|
|
21
20
|
insertOnCanvasDirectly: boolean;
|
|
22
21
|
}) => void;
|
|
23
22
|
renderTopRightUI?: (isMobile: boolean, appState: AppState) => JSX.Element | null;
|
|
24
23
|
renderCustomStats?: ExcalidrawProps["renderCustomStats"];
|
|
25
24
|
};
|
|
26
|
-
export declare const MobileMenu: ({ appState, elements, libraryMenu, actionManager, renderJSONExportDialog, renderImageExportDialog, setAppState, onCollabButtonClick, onLockToggle, onPenModeToggle, canvas, isCollaborating, renderCustomFooter,
|
|
25
|
+
export declare const MobileMenu: ({ appState, elements, libraryMenu, actionManager, renderJSONExportDialog, renderImageExportDialog, setAppState, onCollabButtonClick, onLockToggle, onPenModeToggle, canvas, isCollaborating, renderCustomFooter, onImageAction, renderTopRightUI, renderCustomStats, }: MobileMenuProps) => JSX.Element;
|
|
27
26
|
export {};
|
package/types/constants.d.ts
CHANGED
|
@@ -139,6 +139,11 @@ export declare const VERTICAL_ALIGN: {
|
|
|
139
139
|
MIDDLE: string;
|
|
140
140
|
BOTTOM: string;
|
|
141
141
|
};
|
|
142
|
+
export declare const TEXT_ALIGN: {
|
|
143
|
+
LEFT: string;
|
|
144
|
+
CENTER: string;
|
|
145
|
+
RIGHT: string;
|
|
146
|
+
};
|
|
142
147
|
export declare const ELEMENT_READY_TO_ERASE_OPACITY = 20;
|
|
143
148
|
export declare const COOKIES: {
|
|
144
149
|
readonly AUTH_STATE_COOKIE: "excplus-auth";
|
|
@@ -55,7 +55,7 @@ export declare const actionLink: {
|
|
|
55
55
|
currentItemOpacity: number;
|
|
56
56
|
currentItemFontFamily: number;
|
|
57
57
|
currentItemFontSize: number;
|
|
58
|
-
currentItemTextAlign:
|
|
58
|
+
currentItemTextAlign: string;
|
|
59
59
|
currentItemStrokeSharpness: import("./types").StrokeSharpness;
|
|
60
60
|
currentItemStartArrowhead: import("./types").Arrowhead | null;
|
|
61
61
|
currentItemEndArrowhead: import("./types").Arrowhead | null;
|
|
@@ -3,6 +3,11 @@ import { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, E
|
|
|
3
3
|
import { Point, AppState } from "../types";
|
|
4
4
|
import History from "../history";
|
|
5
5
|
import Scene from "../scene/Scene";
|
|
6
|
+
declare const editorMidPointsCache: {
|
|
7
|
+
version: number | null;
|
|
8
|
+
points: (Point | null)[];
|
|
9
|
+
zoom: number | null;
|
|
10
|
+
};
|
|
6
11
|
export declare class LinearElementEditor {
|
|
7
12
|
readonly elementId: ExcalidrawElement["id"] & {
|
|
8
13
|
_brand: "excalidrawLinearElementId";
|
|
@@ -24,7 +29,7 @@ export declare class LinearElementEditor {
|
|
|
24
29
|
readonly startBindingElement: ExcalidrawBindableElement | null | "keep";
|
|
25
30
|
readonly endBindingElement: ExcalidrawBindableElement | null | "keep";
|
|
26
31
|
readonly hoverPointIndex: number;
|
|
27
|
-
readonly
|
|
32
|
+
readonly segmentMidPointHoveredCoords: Point | null;
|
|
28
33
|
constructor(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene);
|
|
29
34
|
static POINT_HANDLE_SIZE: number;
|
|
30
35
|
/**
|
|
@@ -39,11 +44,15 @@ export declare class LinearElementEditor {
|
|
|
39
44
|
y: number;
|
|
40
45
|
}[]) => void, linearElementEditor: LinearElementEditor): boolean;
|
|
41
46
|
static handlePointerUp(event: PointerEvent, editingLinearElement: LinearElementEditor, appState: AppState): LinearElementEditor;
|
|
42
|
-
static
|
|
47
|
+
static getEditorMidPoints: (element: NonDeleted<ExcalidrawLinearElement>, appState: AppState) => (typeof editorMidPointsCache)["points"];
|
|
48
|
+
static updateEditorMidPointsCache: (element: NonDeleted<ExcalidrawLinearElement>, appState: AppState) => void;
|
|
49
|
+
static getSegmentMidpointHitCoords: (linearElementEditor: LinearElementEditor, scenePointer: {
|
|
43
50
|
x: number;
|
|
44
51
|
y: number;
|
|
45
|
-
}, appState: AppState) =>
|
|
46
|
-
static
|
|
52
|
+
}, appState: AppState) => readonly [number, number] | null;
|
|
53
|
+
static isSegmentTooShort(element: NonDeleted<ExcalidrawLinearElement>, startPoint: Point, endPoint: Point, zoom: AppState["zoom"]): boolean;
|
|
54
|
+
static getSegmentMidPoint(element: NonDeleted<ExcalidrawLinearElement>, startPoint: Point, endPoint: Point, endPointIndex: number): readonly [number, number];
|
|
55
|
+
static getSegmentMidPointIndex(linearElementEditor: LinearElementEditor, appState: AppState, midPoint: Point): number;
|
|
47
56
|
static handlePointerDown(event: React.PointerEvent<HTMLCanvasElement>, appState: AppState, history: History, scenePointer: {
|
|
48
57
|
x: number;
|
|
49
58
|
y: number;
|
|
@@ -53,7 +62,8 @@ export declare class LinearElementEditor {
|
|
|
53
62
|
linearElementEditor: LinearElementEditor | null;
|
|
54
63
|
isMidPoint: boolean;
|
|
55
64
|
};
|
|
56
|
-
static
|
|
65
|
+
static arePointsEqual(point1: Point | null, point2: Point | null): boolean;
|
|
66
|
+
static handlePointerMove(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number, appState: AppState): LinearElementEditor | null;
|
|
57
67
|
/** scene coords */
|
|
58
68
|
static getPointGlobalCoordinates(element: NonDeleted<ExcalidrawLinearElement>, point: Point): readonly [number, number];
|
|
59
69
|
/** scene coords */
|
|
@@ -94,7 +104,7 @@ export declare class LinearElementEditor {
|
|
|
94
104
|
startBindingElement: ExcalidrawBindableElement | "keep" | null;
|
|
95
105
|
endBindingElement: ExcalidrawBindableElement | "keep" | null;
|
|
96
106
|
hoverPointIndex: number;
|
|
97
|
-
|
|
107
|
+
segmentMidPointHoveredCoords: readonly [number, number] | null;
|
|
98
108
|
};
|
|
99
109
|
isLoading: boolean;
|
|
100
110
|
errorMessage: string | null;
|
|
@@ -132,7 +142,7 @@ export declare class LinearElementEditor {
|
|
|
132
142
|
currentItemOpacity: number;
|
|
133
143
|
currentItemFontFamily: number;
|
|
134
144
|
currentItemFontSize: number;
|
|
135
|
-
currentItemTextAlign:
|
|
145
|
+
currentItemTextAlign: string;
|
|
136
146
|
currentItemStrokeSharpness: import("./types").StrokeSharpness;
|
|
137
147
|
currentItemStartArrowhead: import("./types").Arrowhead | null;
|
|
138
148
|
currentItemEndArrowhead: import("./types").Arrowhead | null;
|
|
@@ -160,7 +170,7 @@ export declare class LinearElementEditor {
|
|
|
160
170
|
shouldCacheIgnoreZoom: boolean;
|
|
161
171
|
showHelpDialog: boolean;
|
|
162
172
|
toast: {
|
|
163
|
-
message: string;
|
|
173
|
+
message: string; /** @returns whether point was dragged */
|
|
164
174
|
closable?: boolean | undefined;
|
|
165
175
|
duration?: number | undefined;
|
|
166
176
|
} | null;
|
|
@@ -195,7 +205,7 @@ export declare class LinearElementEditor {
|
|
|
195
205
|
};
|
|
196
206
|
};
|
|
197
207
|
static deletePoints(element: NonDeleted<ExcalidrawLinearElement>, pointIndices: readonly number[]): void;
|
|
198
|
-
static addPoints(element: NonDeleted<ExcalidrawLinearElement>, targetPoints: {
|
|
208
|
+
static addPoints(element: NonDeleted<ExcalidrawLinearElement>, appState: AppState, targetPoints: {
|
|
199
209
|
point: Point;
|
|
200
210
|
}[]): void;
|
|
201
211
|
static movePoints(element: NonDeleted<ExcalidrawLinearElement>, targetPoints: {
|
|
@@ -209,3 +219,4 @@ export declare class LinearElementEditor {
|
|
|
209
219
|
private static _updatePoints;
|
|
210
220
|
private static _getShiftLockedDelta;
|
|
211
221
|
}
|
|
222
|
+
export {};
|
|
@@ -12,7 +12,9 @@ export declare const newTextElement: (opts: {
|
|
|
12
12
|
verticalAlign: VerticalAlign;
|
|
13
13
|
containerId?: ExcalidrawRectangleElement["id"];
|
|
14
14
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawTextElement>;
|
|
15
|
-
export declare const
|
|
15
|
+
export declare const getMaxContainerWidth: (container: ExcalidrawElement) => number;
|
|
16
|
+
export declare const getMaxContainerHeight: (container: ExcalidrawElement) => number;
|
|
17
|
+
export declare const updateTextElement: (textElement: ExcalidrawTextElement, { text, isDeleted, originalText, }: {
|
|
16
18
|
text: string;
|
|
17
19
|
isDeleted?: boolean | undefined;
|
|
18
20
|
originalText: string;
|
|
@@ -30,6 +32,9 @@ export declare const newLinearElement: (opts: {
|
|
|
30
32
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawLinearElement>;
|
|
31
33
|
export declare const newImageElement: (opts: {
|
|
32
34
|
type: ExcalidrawImageElement["type"];
|
|
35
|
+
status?: ExcalidrawImageElement["status"];
|
|
36
|
+
fileId?: ExcalidrawImageElement["fileId"];
|
|
37
|
+
scale?: ExcalidrawImageElement["scale"];
|
|
33
38
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawImageElement>;
|
|
34
39
|
export declare const deepCopyElement: (val: any, depth?: number) => any;
|
|
35
40
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExcalidrawElement, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, FontString, NonDeletedExcalidrawElement } from "./types";
|
|
2
2
|
import { MaybeTransformHandleType } from "./transformHandles";
|
|
3
|
-
export declare const redrawTextBoundingBox: (
|
|
3
|
+
export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null) => void;
|
|
4
4
|
export declare const bindTextToShapeAfterDuplication: (sceneElements: ExcalidrawElement[], oldElements: ExcalidrawElement[], oldIdToDuplicatedId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
|
|
5
5
|
export declare const handleBindTextResize: (element: NonDeletedExcalidrawElement, transformHandleType: MaybeTransformHandleType) => void;
|
|
6
6
|
export declare const measureText: (text: string, font: FontString, maxWidth?: number | null) => {
|
|
@@ -9,7 +9,7 @@ export declare const measureText: (text: string, font: FontString, maxWidth?: nu
|
|
|
9
9
|
baseline: number;
|
|
10
10
|
};
|
|
11
11
|
export declare const getApproxLineHeight: (font: FontString) => number;
|
|
12
|
-
export declare const wrapText: (text: string, font: FontString,
|
|
12
|
+
export declare const wrapText: (text: string, font: FontString, maxWidth: number) => string;
|
|
13
13
|
export declare const charWidth: {
|
|
14
14
|
calculate: (char: string, font: FontString) => number;
|
|
15
15
|
getCache: (font: FontString) => number[];
|
|
@@ -24,3 +24,7 @@ export declare const getBoundTextElement: (element: ExcalidrawElement | null) =>
|
|
|
24
24
|
export declare const getContainerElement: (element: (ExcalidrawElement & {
|
|
25
25
|
containerId: ExcalidrawElement["id"] | null;
|
|
26
26
|
}) | null) => ExcalidrawElement | null;
|
|
27
|
+
export declare const getContainerDims: (element: ExcalidrawElement) => {
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
};
|
package/types/element/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Point } from "../types";
|
|
2
|
-
import { FONT_FAMILY, THEME, VERTICAL_ALIGN } from "../constants";
|
|
2
|
+
import { FONT_FAMILY, TEXT_ALIGN, THEME, VERTICAL_ALIGN } from "../constants";
|
|
3
3
|
export declare type ChartType = "bar" | "line";
|
|
4
4
|
export declare type FillStyle = "hachure" | "cross-hatch" | "solid";
|
|
5
5
|
export declare type FontFamilyKeys = keyof typeof FONT_FAMILY;
|
|
@@ -12,7 +12,7 @@ export declare type GroupId = string;
|
|
|
12
12
|
export declare type PointerType = "mouse" | "pen" | "touch";
|
|
13
13
|
export declare type StrokeSharpness = "round" | "sharp";
|
|
14
14
|
export declare type StrokeStyle = "solid" | "dashed" | "dotted";
|
|
15
|
-
export declare type TextAlign =
|
|
15
|
+
export declare type TextAlign = typeof TEXT_ALIGN[keyof typeof TEXT_ALIGN];
|
|
16
16
|
declare type VerticalAlignKeys = keyof typeof VERTICAL_ALIGN;
|
|
17
17
|
export declare type VerticalAlign = typeof VERTICAL_ALIGN[VerticalAlignKeys];
|
|
18
18
|
declare type _ExcalidrawElementBase = Readonly<{
|
package/types/math.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Point, Zoom } from "./types";
|
|
2
|
-
import { ExcalidrawLinearElement } from "./element/types";
|
|
2
|
+
import { ExcalidrawLinearElement, NonDeleted } from "./element/types";
|
|
3
3
|
export declare const rotate: (x1: number, y1: number, x2: number, y2: number, angle: number) => [number, number];
|
|
4
4
|
export declare const rotatePoint: (point: readonly [number, number], center: readonly [number, number], angle: number) => [number, number];
|
|
5
5
|
export declare const adjustXYWithRotation: (sides: {
|
|
@@ -18,3 +18,10 @@ export declare const centerPoint: (a: readonly [number, number], b: readonly [nu
|
|
|
18
18
|
export declare const isPathALoop: (points: ExcalidrawLinearElement["points"], zoomValue?: Zoom["value"]) => boolean;
|
|
19
19
|
export declare const isPointInPolygon: (points: Point[], x: number, y: number) => boolean;
|
|
20
20
|
export declare const getGridPoint: (x: number, y: number, gridSize: number | null) => [number, number];
|
|
21
|
+
export declare const getControlPointsForBezierCurve: (element: NonDeleted<ExcalidrawLinearElement>, endPoint: readonly [number, number]) => [number, number][] | null;
|
|
22
|
+
export declare const getBezierXY: (p0: readonly [number, number], p1: readonly [number, number], p2: readonly [number, number], p3: readonly [number, number], t: number) => number[];
|
|
23
|
+
export declare const getPointsInBezierCurve: (element: NonDeleted<ExcalidrawLinearElement>, endPoint: readonly [number, number]) => [number, number][];
|
|
24
|
+
export declare const getBezierCurveArcLengths: (element: NonDeleted<ExcalidrawLinearElement>, endPoint: readonly [number, number]) => number[];
|
|
25
|
+
export declare const getBezierCurveLength: (element: NonDeleted<ExcalidrawLinearElement>, endPoint: readonly [number, number]) => number;
|
|
26
|
+
export declare const mapIntervalToBezierT: (element: NonDeleted<ExcalidrawLinearElement>, endPoint: readonly [number, number], interval: number) => number;
|
|
27
|
+
export declare const arePointsEqual: (p1: readonly [number, number], p2: readonly [number, number]) => boolean;
|
package/types/types.d.ts
CHANGED
|
@@ -260,7 +260,7 @@ declare type CanvasActions = {
|
|
|
260
260
|
export?: false | ExportOpts;
|
|
261
261
|
loadScene?: boolean;
|
|
262
262
|
saveToActiveFile?: boolean;
|
|
263
|
-
|
|
263
|
+
toggleTheme?: boolean | null;
|
|
264
264
|
saveAsImage?: boolean;
|
|
265
265
|
};
|
|
266
266
|
export declare type AppProps = Merge<ExcalidrawProps, {
|