@zsviczian/excalidraw 0.15.2-obsidian-3 → 0.15.2-obsidian-5
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 +4 -0
- package/dist/excalidraw.development.js +333 -171
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +2 -0
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +30 -3
- package/types/actions/actionAlign.d.ts +12 -6
- package/types/actions/actionBoundText.d.ts +21 -3
- package/types/actions/actionCanvas.d.ts +94 -10
- package/types/actions/actionClipboard.d.ts +47 -5
- package/types/actions/actionDeleteSelected.d.ts +27 -3
- package/types/actions/actionDistribute.d.ts +2 -2
- package/types/actions/actionElementLock.d.ts +21 -2
- package/types/actions/actionExport.d.ts +90 -9
- package/types/actions/actionFinalize.d.ts +20 -2
- package/types/actions/actionFlip.d.ts +2 -2
- package/types/actions/actionFrame.d.ts +475 -0
- package/types/actions/actionGroup.d.ts +2 -2
- package/types/actions/actionLinearEditor.d.ts +10 -1
- package/types/actions/actionMenu.d.ts +30 -3
- package/types/actions/actionNavigate.d.ts +1 -1
- package/types/actions/actionProperties.d.ts +130 -13
- package/types/actions/actionStyles.d.ts +10 -1
- package/types/actions/actionToggleGridMode.d.ts +10 -1
- package/types/actions/actionToggleStats.d.ts +10 -1
- package/types/actions/actionToggleViewMode.d.ts +10 -1
- package/types/actions/actionToggleZenMode.d.ts +10 -1
- package/types/actions/actionZindex.d.ts +4 -4
- package/types/actions/types.d.ts +1 -1
- package/types/appState.d.ts +1 -1
- package/types/clients.d.ts +1 -5
- package/types/colors.d.ts +1 -0
- package/types/components/ActiveConfirmDialog.d.ts +1 -21
- package/types/components/App.d.ts +20 -4
- package/types/components/Avatar.d.ts +0 -1
- package/types/components/ColorPicker/ColorInput.d.ts +1 -1
- package/types/components/ColorPicker/ColorPicker.d.ts +3 -2
- package/types/components/ColorPicker/CustomColorList.d.ts +1 -1
- package/types/components/ColorPicker/Picker.d.ts +4 -2
- package/types/components/ColorPicker/PickerColorList.d.ts +1 -1
- package/types/components/ColorPicker/ShadeList.d.ts +1 -1
- package/types/components/ColorPicker/TopPicks.d.ts +1 -1
- package/types/components/ColorPicker/colorPickerUtils.d.ts +4 -24
- package/types/components/ColorPicker/keyboardNavHandlers.d.ts +8 -3
- package/types/components/Dialog.d.ts +2 -3
- package/types/components/EyeDropper.d.ts +18 -0
- package/types/components/FilledButton.d.ts +2 -1
- package/types/components/LibraryMenu.d.ts +1 -21
- package/types/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
- package/types/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
- package/types/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
- package/types/components/Sidebar/Sidebar.d.ts +1 -21
- package/types/components/ToolButton.d.ts +2 -1
- package/types/components/dropdownMenu/DropdownMenu.d.ts +3 -2
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +4 -2
- package/types/components/icons.d.ts +5 -0
- package/types/components/main-menu/MainMenu.d.ts +3 -2
- package/types/constants.d.ts +24 -1
- package/types/context/tunnels.d.ts +1 -0
- package/types/data/library.d.ts +1 -45
- package/types/element/Hyperlink.d.ts +21 -6
- package/types/element/binding.d.ts +1 -1
- package/types/element/bounds.d.ts +31 -6
- package/types/element/collision.d.ts +7 -7
- package/types/element/dragElements.d.ts +2 -1
- package/types/element/iframe.d.ts +173 -0
- package/types/element/index.d.ts +3 -2
- package/types/element/linearElementEditor.d.ts +11 -2
- package/types/element/newElement.d.ts +8 -2
- package/types/element/transformHandles.d.ts +8 -1
- package/types/element/typeChecks.d.ts +5 -3
- package/types/element/types.d.ts +13 -4
- package/types/frame.d.ts +40 -0
- package/types/groups.d.ts +4 -0
- package/types/hooks/useCreatePortalContainer.d.ts +5 -0
- package/types/hooks/useLibraryItemSvg.d.ts +1 -21
- package/types/hooks/useOutsideClick.d.ts +19 -1
- package/types/jotai.d.ts +16 -104
- package/types/keys.d.ts +2 -0
- package/types/math.d.ts +1 -0
- package/types/packages/excalidraw/example/initialData.d.ts +6 -0
- package/types/renderer/renderElement.d.ts +3 -2
- package/types/renderer/renderScene.d.ts +12 -3
- package/types/renderer/roundRect.d.ts +1 -1
- package/types/scene/Scene.d.ts +8 -1
- package/types/scene/export.d.ts +1 -0
- package/types/scene/selection.d.ts +13 -3
- package/types/types.d.ts +35 -3
- package/types/utils.d.ts +5 -2
- package/types/zindex.d.ts +4 -4
|
@@ -31,6 +31,7 @@ export declare const EraserIcon: JSX.Element;
|
|
|
31
31
|
export declare const ZoomInIcon: JSX.Element;
|
|
32
32
|
export declare const ZoomOutIcon: JSX.Element;
|
|
33
33
|
export declare const TrashIcon: JSX.Element;
|
|
34
|
+
export declare const EmbedIcon: JSX.Element;
|
|
34
35
|
export declare const DuplicateIcon: JSX.Element;
|
|
35
36
|
export declare const MoonIcon: JSX.Element;
|
|
36
37
|
export declare const SunIcon: JSX.Element;
|
|
@@ -146,4 +147,8 @@ export declare const helpIcon: JSX.Element;
|
|
|
146
147
|
export declare const playerPlayIcon: JSX.Element;
|
|
147
148
|
export declare const playerStopFilledIcon: JSX.Element;
|
|
148
149
|
export declare const tablerCheckIcon: JSX.Element;
|
|
150
|
+
export declare const alertTriangleIcon: JSX.Element;
|
|
151
|
+
export declare const eyeDropperIcon: JSX.Element;
|
|
152
|
+
export declare const extraToolsIcon: JSX.Element;
|
|
153
|
+
export declare const frameToolIcon: JSX.Element;
|
|
149
154
|
export {};
|
|
@@ -10,11 +10,12 @@ declare const MainMenu: React.FC<{
|
|
|
10
10
|
__fallback?: boolean | undefined;
|
|
11
11
|
}> & {
|
|
12
12
|
Trigger: {
|
|
13
|
-
({ className, children, onToggle, }: {
|
|
13
|
+
({ className, children, onToggle, title, ...rest }: {
|
|
14
14
|
className?: string | undefined;
|
|
15
15
|
children: React.ReactNode;
|
|
16
16
|
onToggle: () => void;
|
|
17
|
-
|
|
17
|
+
title?: string | undefined;
|
|
18
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): JSX.Element;
|
|
18
19
|
displayName: string;
|
|
19
20
|
};
|
|
20
21
|
Item: {
|
package/types/constants.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export declare enum EVENT {
|
|
|
47
47
|
GESTURE_START = "gesturestart",
|
|
48
48
|
GESTURE_CHANGE = "gesturechange",
|
|
49
49
|
POINTER_MOVE = "pointermove",
|
|
50
|
+
POINTER_DOWN = "pointerdown",
|
|
50
51
|
POINTER_UP = "pointerup",
|
|
51
52
|
STATE_CHANGE = "statechange",
|
|
52
53
|
WHEEL = "wheel",
|
|
@@ -56,7 +57,16 @@ export declare enum EVENT {
|
|
|
56
57
|
VISIBILITY_CHANGE = "visibilitychange",
|
|
57
58
|
SCROLL = "scroll",
|
|
58
59
|
EXCALIDRAW_LINK = "excalidraw-link",
|
|
59
|
-
MENU_ITEM_SELECT = "menu.itemSelect"
|
|
60
|
+
MENU_ITEM_SELECT = "menu.itemSelect",
|
|
61
|
+
MESSAGE = "message"
|
|
62
|
+
}
|
|
63
|
+
export declare enum YTPLAYER {
|
|
64
|
+
UNSTARTED = -1,
|
|
65
|
+
ENDED = 0,
|
|
66
|
+
PLAYING = 1,
|
|
67
|
+
PAUSED = 2,
|
|
68
|
+
BUFFERING = 3,
|
|
69
|
+
CUED = 5
|
|
60
70
|
}
|
|
61
71
|
export declare const ENV: {
|
|
62
72
|
TEST: string;
|
|
@@ -77,6 +87,19 @@ export declare const THEME: {
|
|
|
77
87
|
LIGHT: string;
|
|
78
88
|
DARK: string;
|
|
79
89
|
};
|
|
90
|
+
export declare const FRAME_STYLE: {
|
|
91
|
+
strokeColor: string;
|
|
92
|
+
strokeWidth: number;
|
|
93
|
+
strokeStyle: import("./element/types").StrokeStyle;
|
|
94
|
+
fillStyle: import("./element/types").FillStyle;
|
|
95
|
+
roughness: number;
|
|
96
|
+
roundness: {
|
|
97
|
+
type: import("./element/types").RoundnessType;
|
|
98
|
+
value?: number | undefined;
|
|
99
|
+
} | null;
|
|
100
|
+
backgroundColor: string;
|
|
101
|
+
radius: number;
|
|
102
|
+
};
|
|
80
103
|
export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
|
|
81
104
|
export declare const DEFAULT_FONT_SIZE = 20;
|
|
82
105
|
export declare const DEFAULT_FONT_FAMILY: FontFamilyValues;
|
|
@@ -10,6 +10,7 @@ type TunnelsContextValue = {
|
|
|
10
10
|
FooterCenterTunnel: Tunnel;
|
|
11
11
|
DefaultSidebarTriggerTunnel: Tunnel;
|
|
12
12
|
DefaultSidebarTabTriggersTunnel: Tunnel;
|
|
13
|
+
OverwriteConfirmDialogTunnel: Tunnel;
|
|
13
14
|
jotaiScope: symbol;
|
|
14
15
|
};
|
|
15
16
|
export declare const TunnelsContext: React.Context<TunnelsContextValue>;
|
package/types/data/library.d.ts
CHANGED
|
@@ -1,55 +1,11 @@
|
|
|
1
1
|
import { LibraryItems, ExcalidrawImperativeAPI, LibraryItemsSource } from "../types";
|
|
2
2
|
import type App from "../components/App";
|
|
3
3
|
import { ExcalidrawElement } from "../element/types";
|
|
4
|
-
export declare const libraryItemsAtom: import("jotai").
|
|
4
|
+
export declare const libraryItemsAtom: import("jotai").PrimitiveAtom<{
|
|
5
5
|
status: "loading" | "loaded";
|
|
6
6
|
isInitialized: boolean;
|
|
7
7
|
libraryItems: LibraryItems;
|
|
8
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
|
-
status: "loading" | "loaded";
|
|
28
|
-
isInitialized: boolean;
|
|
29
|
-
libraryItems: LibraryItems;
|
|
30
|
-
} | ((prev: {
|
|
31
|
-
status: "loading" | "loaded";
|
|
32
|
-
isInitialized: boolean;
|
|
33
|
-
libraryItems: LibraryItems;
|
|
34
|
-
}) => {
|
|
35
|
-
status: "loading" | "loaded";
|
|
36
|
-
isInitialized: boolean;
|
|
37
|
-
libraryItems: LibraryItems;
|
|
38
|
-
})) => void;
|
|
39
|
-
onMount?: (<S extends (update: {
|
|
40
|
-
status: "loading" | "loaded";
|
|
41
|
-
isInitialized: boolean;
|
|
42
|
-
libraryItems: LibraryItems;
|
|
43
|
-
} | ((prev: {
|
|
44
|
-
status: "loading" | "loaded";
|
|
45
|
-
isInitialized: boolean;
|
|
46
|
-
libraryItems: LibraryItems;
|
|
47
|
-
}) => {
|
|
48
|
-
status: "loading" | "loaded";
|
|
49
|
-
isInitialized: boolean;
|
|
50
|
-
libraryItems: LibraryItems;
|
|
51
|
-
})) => void>(setAtom: S) => void | (() => void)) | undefined;
|
|
52
|
-
} & {
|
|
53
9
|
init: {
|
|
54
10
|
status: "loading" | "loaded";
|
|
55
11
|
isInitialized: boolean;
|
|
@@ -4,13 +4,18 @@ 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, setAppState, onLinkOpen, }: {
|
|
7
|
+
export declare const Hyperlink: ({ element, setAppState, onLinkOpen, setToast, }: {
|
|
8
8
|
element: NonDeletedExcalidrawElement;
|
|
9
9
|
setAppState: React.Component<any, AppState>["setState"];
|
|
10
10
|
onLinkOpen: ExcalidrawProps["onLinkOpen"];
|
|
11
|
+
setToast: (toast: {
|
|
12
|
+
message: string;
|
|
13
|
+
closable?: boolean;
|
|
14
|
+
duration?: number;
|
|
15
|
+
} | null) => void;
|
|
11
16
|
}) => JSX.Element | null;
|
|
12
17
|
export declare const normalizeLink: (link: string) => string;
|
|
13
|
-
export declare const isLocalLink: (link: string | null) => boolean;
|
|
18
|
+
export declare const isLocalLink: (link: string | null | undefined) => boolean;
|
|
14
19
|
export declare const actionLink: {
|
|
15
20
|
name: "hyperlink";
|
|
16
21
|
perform: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => false | {
|
|
@@ -26,6 +31,10 @@ export declare const actionLink: {
|
|
|
26
31
|
showWelcomeScreen: boolean;
|
|
27
32
|
isLoading: boolean;
|
|
28
33
|
errorMessage: import("react").ReactNode;
|
|
34
|
+
activeIFrame: {
|
|
35
|
+
element: NonDeletedExcalidrawElement;
|
|
36
|
+
state: "active" | "hover";
|
|
37
|
+
} | null;
|
|
29
38
|
draggingElement: NonDeletedExcalidrawElement | null;
|
|
30
39
|
resizingElement: NonDeletedExcalidrawElement | null;
|
|
31
40
|
multiElement: import("./types").NonDeleted<import("./types").ExcalidrawLinearElement> | null;
|
|
@@ -33,13 +42,17 @@ export declare const actionLink: {
|
|
|
33
42
|
isBindingEnabled: boolean;
|
|
34
43
|
startBoundElement: import("./types").NonDeleted<import("./types").ExcalidrawBindableElement> | null;
|
|
35
44
|
suggestedBindings: import("./binding").SuggestedBinding[];
|
|
45
|
+
frameToHighlight: import("./types").NonDeleted<import("./types").ExcalidrawFrameElement> | null;
|
|
46
|
+
shouldRenderFrames: boolean;
|
|
47
|
+
editingFrame: string | null;
|
|
48
|
+
elementsToHighlight: import("./types").NonDeleted<import("./types").ExcalidrawElement>[] | null;
|
|
36
49
|
editingElement: NonDeletedExcalidrawElement | null;
|
|
37
50
|
editingLinearElement: import("./linearElementEditor").LinearElementEditor | null;
|
|
38
51
|
activeTool: {
|
|
39
52
|
lastActiveTool: import("../types").LastActiveTool;
|
|
40
53
|
locked: boolean;
|
|
41
54
|
} & ({
|
|
42
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
55
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
|
|
43
56
|
customType: null;
|
|
44
57
|
} | {
|
|
45
58
|
type: "custom";
|
|
@@ -89,6 +102,7 @@ export declare const actionLink: {
|
|
|
89
102
|
previousSelectedElementIds: {
|
|
90
103
|
[id: string]: boolean;
|
|
91
104
|
};
|
|
105
|
+
selectedElementsAreBeingDragged: boolean;
|
|
92
106
|
shouldCacheIgnoreZoom: boolean;
|
|
93
107
|
toast: {
|
|
94
108
|
message: string;
|
|
@@ -150,15 +164,16 @@ export declare const actionLink: {
|
|
|
150
164
|
action: string;
|
|
151
165
|
};
|
|
152
166
|
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
153
|
-
contextItemLabel: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => "labels.link.edit" | "labels.link.create";
|
|
167
|
+
contextItemLabel: (elements: readonly import("./types").ExcalidrawElement[], appState: Readonly<AppState>) => "labels.link.editEmbed" | "labels.link.edit" | "labels.link.createEmbed" | "labels.link.create";
|
|
154
168
|
predicate: (elements: readonly import("./types").ExcalidrawElement[], appState: AppState) => boolean;
|
|
155
169
|
PanelComponent: ({ elements, appState, updateData }: import("../actions/types").PanelComponentProps) => JSX.Element;
|
|
156
170
|
} & {
|
|
157
171
|
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
158
172
|
};
|
|
159
|
-
export declare const getContextMenuLabel: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState) => "labels.link.edit" | "labels.link.create";
|
|
173
|
+
export declare const getContextMenuLabel: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState) => "labels.link.editEmbed" | "labels.link.edit" | "labels.link.createEmbed" | "labels.link.create";
|
|
160
174
|
export declare const getLinkHandleFromCoords: ([x1, y1, x2, y2]: Bounds, angle: number, appState: UIAppState) => [x: number, y: number, width: number, height: number];
|
|
161
|
-
export declare const isPointHittingLinkIcon: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number]
|
|
175
|
+
export declare const isPointHittingLinkIcon: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number]) => boolean;
|
|
176
|
+
export declare const isPointHittingLink: (element: NonDeletedExcalidrawElement, appState: AppState, [x, y]: readonly [number, number], isMobile: boolean) => boolean;
|
|
162
177
|
export declare const showHyperlinkTooltip: (element: NonDeletedExcalidrawElement, appState: AppState) => void;
|
|
163
178
|
export declare const hideHyperlinkToolip: () => void;
|
|
164
179
|
export declare const shouldHideLinkPopup: (element: NonDeletedExcalidrawElement, appState: AppState, [clientX, clientY]: readonly [number, number]) => Boolean;
|
|
@@ -7,7 +7,7 @@ export type SuggestedPointBinding = [
|
|
|
7
7
|
"start" | "end" | "both",
|
|
8
8
|
NonDeleted<ExcalidrawBindableElement>
|
|
9
9
|
];
|
|
10
|
-
export declare const shouldEnableBindingForPointerEvent: (event: React.PointerEvent<
|
|
10
|
+
export declare const shouldEnableBindingForPointerEvent: (event: React.PointerEvent<HTMLElement>) => boolean;
|
|
11
11
|
export declare const isBindingEnabled: (appState: AppState) => boolean;
|
|
12
12
|
export declare const bindOrUnbindLinearElement: (linearElement: NonDeleted<ExcalidrawLinearElement>, startBindingElement: ExcalidrawBindableElement | null | "keep", endBindingElement: ExcalidrawBindableElement | null | "keep") => void;
|
|
13
13
|
export declare const bindOrUnbindSelectedElements: (elements: NonDeleted<ExcalidrawElement>[]) => void;
|
|
@@ -1,21 +1,46 @@
|
|
|
1
1
|
import { ExcalidrawElement, ExcalidrawLinearElement, Arrowhead, NonDeleted } from "./types";
|
|
2
2
|
import { Drawable, Op } from "roughjs/bin/core";
|
|
3
|
-
|
|
3
|
+
import { Point } from "../types";
|
|
4
|
+
export type RectangleBox = {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
angle: number;
|
|
10
|
+
};
|
|
11
|
+
export type Bounds = readonly [x1: number, y1: number, x2: number, y2: number];
|
|
12
|
+
export declare class ElementBounds {
|
|
13
|
+
private static boundsCache;
|
|
14
|
+
static getBounds(element: ExcalidrawElement): Bounds;
|
|
15
|
+
private static calculateBounds;
|
|
16
|
+
}
|
|
4
17
|
export declare const getElementAbsoluteCoords: (element: ExcalidrawElement, includeBoundText?: boolean) => [number, number, number, number, number, number];
|
|
18
|
+
/**
|
|
19
|
+
* for a given element, `getElementLineSegments` returns line segments
|
|
20
|
+
* that can be used for visual collision detection (useful for frames)
|
|
21
|
+
* as opposed to bounding box collision detection
|
|
22
|
+
*/
|
|
23
|
+
export declare const getElementLineSegments: (element: ExcalidrawElement) => [Point, Point][];
|
|
24
|
+
/**
|
|
25
|
+
* Scene -> Scene coords, but in x1,x2,y1,y2 format.
|
|
26
|
+
*
|
|
27
|
+
* Rectangle here means any rectangular frame, not an excalidraw element.
|
|
28
|
+
*/
|
|
29
|
+
export declare const getRectangleBoxAbsoluteCoords: (boxSceneCoords: RectangleBox) => number[];
|
|
5
30
|
export declare const pointRelativeTo: (element: ExcalidrawElement, absoluteCoords: readonly [number, number]) => readonly [number, number];
|
|
6
31
|
export declare const getDiamondPoints: (element: ExcalidrawElement) => number[];
|
|
7
32
|
export declare const getCurvePathOps: (shape: Drawable) => Op[];
|
|
8
33
|
export declare const getMinMaxXYFromCurvePathOps: (ops: Op[], transformXY?: ((x: number, y: number) => [number, number]) | undefined) => [number, number, number, number];
|
|
9
34
|
export declare const getArrowheadPoints: (element: ExcalidrawLinearElement, shape: Drawable[], position: "start" | "end", arrowhead: Arrowhead) => number[] | null;
|
|
10
|
-
export declare const getElementBounds: (element: ExcalidrawElement) =>
|
|
11
|
-
export declare const getCommonBounds: (elements: readonly ExcalidrawElement[]) =>
|
|
35
|
+
export declare const getElementBounds: (element: ExcalidrawElement) => Bounds;
|
|
36
|
+
export declare const getCommonBounds: (elements: readonly ExcalidrawElement[]) => Bounds;
|
|
12
37
|
export declare const getResizedElementAbsoluteCoords: (element: ExcalidrawElement, nextWidth: number, nextHeight: number, normalizePoints: boolean) => [number, number, number, number];
|
|
13
38
|
export declare const getElementPointsCoords: (element: ExcalidrawLinearElement, points: readonly (readonly [number, number])[]) => [number, number, number, number];
|
|
14
39
|
export declare const getClosestElementBounds: (elements: readonly ExcalidrawElement[], from: {
|
|
15
40
|
x: number;
|
|
16
41
|
y: number;
|
|
17
|
-
}) =>
|
|
18
|
-
export interface
|
|
42
|
+
}) => Bounds;
|
|
43
|
+
export interface BoundingBox {
|
|
19
44
|
minX: number;
|
|
20
45
|
minY: number;
|
|
21
46
|
maxX: number;
|
|
@@ -25,4 +50,4 @@ export interface Box {
|
|
|
25
50
|
width: number;
|
|
26
51
|
height: number;
|
|
27
52
|
}
|
|
28
|
-
export declare const getCommonBoundingBox: (elements: ExcalidrawElement[] | readonly NonDeleted<ExcalidrawElement>[]) =>
|
|
53
|
+
export declare const getCommonBoundingBox: (elements: ExcalidrawElement[] | readonly NonDeleted<ExcalidrawElement>[]) => BoundingBox;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as GA from "../ga";
|
|
2
|
-
import { NonDeletedExcalidrawElement, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawRectangleElement, ExcalidrawDiamondElement, ExcalidrawTextElement, ExcalidrawEllipseElement, NonDeleted, ExcalidrawImageElement } from "./types";
|
|
3
|
-
import { Point } from "../types";
|
|
2
|
+
import { NonDeletedExcalidrawElement, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawRectangleElement, ExcalidrawIFrameElement, ExcalidrawDiamondElement, ExcalidrawTextElement, ExcalidrawEllipseElement, NonDeleted, ExcalidrawImageElement, ExcalidrawFrameElement } from "./types";
|
|
3
|
+
import { FrameNameBoundsCache, Point } from "../types";
|
|
4
4
|
import { AppState } from "../types";
|
|
5
|
-
export declare const hitTest: (element: NonDeletedExcalidrawElement, appState: AppState, x: number, y: number) => boolean;
|
|
6
|
-
export declare const isHittingElementBoundingBoxWithoutHittingElement: (element: NonDeletedExcalidrawElement, appState: AppState, x: number, y: number) => boolean;
|
|
7
|
-
export declare const isHittingElementNotConsideringBoundingBox: (element: NonDeletedExcalidrawElement, appState: AppState, point: readonly [number, number]) => boolean;
|
|
8
|
-
export declare const isPointHittingElementBoundingBox: (element: NonDeleted<ExcalidrawElement>, [x, y]: readonly [number, number], threshold: number) => boolean;
|
|
5
|
+
export declare const hitTest: (element: NonDeletedExcalidrawElement, appState: AppState, frameNameBoundsCache: FrameNameBoundsCache, x: number, y: number) => boolean;
|
|
6
|
+
export declare const isHittingElementBoundingBoxWithoutHittingElement: (element: NonDeletedExcalidrawElement, appState: AppState, frameNameBoundsCache: FrameNameBoundsCache, x: number, y: number) => boolean;
|
|
7
|
+
export declare const isHittingElementNotConsideringBoundingBox: (element: NonDeletedExcalidrawElement, appState: AppState, frameNameBoundsCache: FrameNameBoundsCache | null, point: readonly [number, number]) => boolean;
|
|
8
|
+
export declare const isPointHittingElementBoundingBox: (element: NonDeleted<ExcalidrawElement>, [x, y]: readonly [number, number], threshold: number, frameNameBoundsCache: FrameNameBoundsCache | null) => boolean;
|
|
9
9
|
export declare const bindingBorderTest: (element: NonDeleted<ExcalidrawBindableElement>, { x, y }: {
|
|
10
10
|
x: number;
|
|
11
11
|
y: number;
|
|
@@ -18,4 +18,4 @@ export declare const determineFocusPoint: (element: ExcalidrawBindableElement, f
|
|
|
18
18
|
export declare const intersectElementWithLine: (element: ExcalidrawBindableElement, a: readonly [number, number], b: readonly [number, number], gap?: number) => Point[];
|
|
19
19
|
export declare const getCircleIntersections: (center: readonly [number, number, number, number, number, number, number, number], radius: number, line: readonly [number, number, number, number, number, number, number, number]) => GA.Point[];
|
|
20
20
|
export declare const findFocusPointForEllipse: (ellipse: ExcalidrawEllipseElement, relativeDistance: number, point: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
|
|
21
|
-
export declare const findFocusPointForRectangulars: (element: ExcalidrawRectangleElement | ExcalidrawImageElement | ExcalidrawDiamondElement | ExcalidrawTextElement, relativeDistance: number, point: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
|
|
21
|
+
export declare const findFocusPointForRectangulars: (element: ExcalidrawRectangleElement | ExcalidrawImageElement | ExcalidrawDiamondElement | ExcalidrawTextElement | ExcalidrawIFrameElement | ExcalidrawFrameElement, relativeDistance: number, point: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NonDeletedExcalidrawElement } from "./types";
|
|
2
2
|
import { AppState, PointerDownState } from "../types";
|
|
3
|
-
|
|
3
|
+
import Scene from "../scene/Scene";
|
|
4
|
+
export declare const dragSelectedElements: (pointerDownState: PointerDownState, selectedElements: NonDeletedExcalidrawElement[], pointerX: number, pointerY: number, lockDirection: boolean | undefined, distanceX: number | undefined, distanceY: number | undefined, appState: AppState, scene: Scene) => void;
|
|
4
5
|
export declare const getDragOffsetXY: (selectedElements: NonDeletedExcalidrawElement[], x: number, y: number) => [number, number];
|
|
5
6
|
export declare const dragNewElement: (draggingElement: NonDeletedExcalidrawElement, elementType: AppState["activeTool"]["type"], originX: number, originY: number, x: number, y: number, width: number, height: number, shouldMaintainAspectRatio: boolean, shouldResizeFromCenter: boolean, widthAspectRatio?: number | null) => void;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ExcalidrawProps } from "../types";
|
|
3
|
+
import { ExcalidrawElement, NonDeletedExcalidrawElement } from "./types";
|
|
4
|
+
type EmbeddedLink = {
|
|
5
|
+
link: string;
|
|
6
|
+
aspectRatio: {
|
|
7
|
+
w: number;
|
|
8
|
+
h: number;
|
|
9
|
+
};
|
|
10
|
+
type: "video" | "generic";
|
|
11
|
+
} | null;
|
|
12
|
+
export declare const getEmbedLink: (link?: string | null) => EmbeddedLink;
|
|
13
|
+
export declare const hideActionForIFrame: (element: ExcalidrawElement | undefined, props: ExcalidrawProps) => boolean | "" | null;
|
|
14
|
+
export declare const isIFrameOrFrameLabel: (element: NonDeletedExcalidrawElement) => Boolean;
|
|
15
|
+
export declare const createPlaceholderiFrameLabel: (element: NonDeletedExcalidrawElement) => ExcalidrawElement;
|
|
16
|
+
export declare const actionSetIFrameAsActiveTool: {
|
|
17
|
+
name: "setIFrameAsActiveTool";
|
|
18
|
+
trackEvent: {
|
|
19
|
+
category: "toolbar";
|
|
20
|
+
};
|
|
21
|
+
perform: (elements: readonly ExcalidrawElement[], appState: Readonly<import("../types").AppState>, _: any, app: import("../types").AppClassProperties) => {
|
|
22
|
+
elements: readonly ExcalidrawElement[];
|
|
23
|
+
appState: {
|
|
24
|
+
activeTool: {
|
|
25
|
+
lastActiveTool: import("../types").LastActiveTool;
|
|
26
|
+
locked: boolean;
|
|
27
|
+
} & ({
|
|
28
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
|
|
29
|
+
customType: null;
|
|
30
|
+
} | {
|
|
31
|
+
type: "custom";
|
|
32
|
+
customType: string;
|
|
33
|
+
});
|
|
34
|
+
contextMenu: {
|
|
35
|
+
items: import("../components/ContextMenu").ContextMenuItems;
|
|
36
|
+
top: number;
|
|
37
|
+
left: number;
|
|
38
|
+
} | null;
|
|
39
|
+
showWelcomeScreen: boolean;
|
|
40
|
+
isLoading: boolean;
|
|
41
|
+
errorMessage: import("react").ReactNode;
|
|
42
|
+
activeIFrame: {
|
|
43
|
+
element: NonDeletedExcalidrawElement;
|
|
44
|
+
state: "active" | "hover";
|
|
45
|
+
} | null;
|
|
46
|
+
draggingElement: NonDeletedExcalidrawElement | null;
|
|
47
|
+
resizingElement: NonDeletedExcalidrawElement | null;
|
|
48
|
+
multiElement: import("./types").NonDeleted<import("./types").ExcalidrawLinearElement> | null;
|
|
49
|
+
selectionElement: NonDeletedExcalidrawElement | null;
|
|
50
|
+
isBindingEnabled: boolean;
|
|
51
|
+
startBoundElement: import("./types").NonDeleted<import("./types").ExcalidrawBindableElement> | null;
|
|
52
|
+
suggestedBindings: import("./binding").SuggestedBinding[];
|
|
53
|
+
frameToHighlight: import("./types").NonDeleted<import("./types").ExcalidrawFrameElement> | null;
|
|
54
|
+
shouldRenderFrames: boolean;
|
|
55
|
+
editingFrame: string | null;
|
|
56
|
+
elementsToHighlight: import("./types").NonDeleted<ExcalidrawElement>[] | null;
|
|
57
|
+
editingElement: NonDeletedExcalidrawElement | null;
|
|
58
|
+
editingLinearElement: import("./linearElementEditor").LinearElementEditor | null;
|
|
59
|
+
penMode: boolean;
|
|
60
|
+
penDetected: boolean;
|
|
61
|
+
exportBackground: boolean;
|
|
62
|
+
exportEmbedScene: boolean;
|
|
63
|
+
exportWithDarkMode: boolean;
|
|
64
|
+
exportScale: number;
|
|
65
|
+
currentItemStrokeColor: string;
|
|
66
|
+
currentItemBackgroundColor: string;
|
|
67
|
+
currentItemFillStyle: import("./types").FillStyle;
|
|
68
|
+
currentItemStrokeWidth: number;
|
|
69
|
+
currentItemStrokeStyle: import("./types").StrokeStyle;
|
|
70
|
+
currentItemRoughness: number;
|
|
71
|
+
currentItemOpacity: number;
|
|
72
|
+
currentItemFontFamily: number;
|
|
73
|
+
currentItemFontSize: number;
|
|
74
|
+
currentItemTextAlign: string;
|
|
75
|
+
currentItemStartArrowhead: import("./types").Arrowhead | null;
|
|
76
|
+
currentItemEndArrowhead: import("./types").Arrowhead | null;
|
|
77
|
+
currentItemRoundness: import("./types").StrokeRoundness;
|
|
78
|
+
viewBackgroundColor: string;
|
|
79
|
+
scrollX: number;
|
|
80
|
+
scrollY: number;
|
|
81
|
+
cursorButton: "up" | "down";
|
|
82
|
+
scrolledOutside: boolean;
|
|
83
|
+
name: string;
|
|
84
|
+
isResizing: boolean;
|
|
85
|
+
isRotating: boolean;
|
|
86
|
+
zoom: Readonly<{
|
|
87
|
+
value: import("../types").NormalizedZoomValue;
|
|
88
|
+
}>;
|
|
89
|
+
openMenu: "canvas" | "shape" | null;
|
|
90
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
91
|
+
openSidebar: {
|
|
92
|
+
name: string;
|
|
93
|
+
tab?: string | undefined;
|
|
94
|
+
} | null;
|
|
95
|
+
openDialog: "imageExport" | "help" | "jsonExport" | null;
|
|
96
|
+
defaultSidebarDockedPreference: boolean;
|
|
97
|
+
lastPointerDownWith: import("./types").PointerType;
|
|
98
|
+
selectedElementIds: {
|
|
99
|
+
[id: string]: boolean;
|
|
100
|
+
};
|
|
101
|
+
previousSelectedElementIds: {
|
|
102
|
+
[id: string]: boolean;
|
|
103
|
+
};
|
|
104
|
+
selectedElementsAreBeingDragged: boolean;
|
|
105
|
+
shouldCacheIgnoreZoom: boolean;
|
|
106
|
+
toast: {
|
|
107
|
+
message: string;
|
|
108
|
+
closable?: boolean | undefined;
|
|
109
|
+
duration?: number | undefined;
|
|
110
|
+
} | null;
|
|
111
|
+
zenModeEnabled: boolean;
|
|
112
|
+
theme: string;
|
|
113
|
+
gridSize: number | null;
|
|
114
|
+
previousGridSize: number | null;
|
|
115
|
+
viewModeEnabled: boolean;
|
|
116
|
+
selectedGroupIds: {
|
|
117
|
+
[groupId: string]: boolean;
|
|
118
|
+
};
|
|
119
|
+
editingGroupId: string | null;
|
|
120
|
+
width: number;
|
|
121
|
+
height: number;
|
|
122
|
+
offsetTop: number;
|
|
123
|
+
offsetLeft: number;
|
|
124
|
+
fileHandle: import("browser-fs-access").FileSystemHandle | null;
|
|
125
|
+
collaborators: Map<string, import("../types").Collaborator>;
|
|
126
|
+
showStats: boolean;
|
|
127
|
+
currentChartType: import("./types").ChartType;
|
|
128
|
+
pasteDialog: {
|
|
129
|
+
shown: false;
|
|
130
|
+
data: null;
|
|
131
|
+
} | {
|
|
132
|
+
shown: true;
|
|
133
|
+
data: import("../charts").Spreadsheet;
|
|
134
|
+
};
|
|
135
|
+
pendingImageElementId: string | null;
|
|
136
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
137
|
+
linkOpacity: number;
|
|
138
|
+
trayModeEnabled: boolean;
|
|
139
|
+
colorPalette?: {
|
|
140
|
+
canvasBackground: import("../colors").ColorPaletteCustom;
|
|
141
|
+
elementBackground: import("../colors").ColorPaletteCustom;
|
|
142
|
+
elementStroke: import("../colors").ColorPaletteCustom;
|
|
143
|
+
topPicks: {
|
|
144
|
+
canvasBackground: [string, string, string, string, string];
|
|
145
|
+
elementStroke: [string, string, string, string, string];
|
|
146
|
+
elementBackground: [string, string, string, string, string];
|
|
147
|
+
};
|
|
148
|
+
} | undefined;
|
|
149
|
+
allowWheelZoom?: boolean | undefined;
|
|
150
|
+
allowPinchZoom?: boolean | undefined;
|
|
151
|
+
pinnedScripts?: string[] | undefined;
|
|
152
|
+
customPens?: any[] | undefined;
|
|
153
|
+
currentStrokeOptions?: any;
|
|
154
|
+
resetCustomPen?: any;
|
|
155
|
+
gridColor: string;
|
|
156
|
+
dynamicStyle: string;
|
|
157
|
+
invertBindingBehaviour: boolean;
|
|
158
|
+
selectedLinearElement: import("./linearElementEditor").LinearElementEditor | null;
|
|
159
|
+
};
|
|
160
|
+
commitToHistory: false;
|
|
161
|
+
};
|
|
162
|
+
keyTest: (event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean;
|
|
163
|
+
} & {
|
|
164
|
+
keyTest?: ((event: KeyboardEvent | import("react").KeyboardEvent<Element>) => boolean) | undefined;
|
|
165
|
+
};
|
|
166
|
+
export declare class IFrameURLValidator {
|
|
167
|
+
private static instance;
|
|
168
|
+
private validators;
|
|
169
|
+
private constructor();
|
|
170
|
+
static getInstance(validators?: RegExp[]): IFrameURLValidator;
|
|
171
|
+
run(url: string | null | undefined): boolean;
|
|
172
|
+
}
|
|
173
|
+
export {};
|
package/types/element/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted } from "./types";
|
|
1
|
+
import { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawFrameElement } from "./types";
|
|
2
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";
|
|
@@ -6,7 +6,7 @@ export { hitTest, isHittingElementBoundingBoxWithoutHittingElement, } from "./co
|
|
|
6
6
|
export { resizeTest, getCursorForResizingElement, getElementWithTransformHandleType, getTransformHandleTypeFromCoords, } from "./resizeTest";
|
|
7
7
|
export { transformElements, getResizeOffsetXY, getResizeArrowDirection, } from "./resizeElements";
|
|
8
8
|
export { dragSelectedElements, getDragOffsetXY, dragNewElement, } from "./dragElements";
|
|
9
|
-
export { isTextElement, isExcalidrawElement } from "./typeChecks";
|
|
9
|
+
export { isTextElement, isExcalidrawElement, isFrameElement, } from "./typeChecks";
|
|
10
10
|
export { textWysiwyg } from "./textWysiwyg";
|
|
11
11
|
export { redrawTextBoundingBox } from "./textElement";
|
|
12
12
|
export { getPerfectElementSize, getLockedLinearCursorAlignSize, isInvisiblySmallElement, resizePerfectLineForNWHandler, getNormalizedDimensions, } from "./sizeHelpers";
|
|
@@ -14,6 +14,7 @@ export { showSelectedShapeActions } from "./showSelectedShapeActions";
|
|
|
14
14
|
export declare const getSceneVersion: (elements: readonly ExcalidrawElement[]) => number;
|
|
15
15
|
export declare const getVisibleElements: (elements: readonly ExcalidrawElement[]) => readonly NonDeletedExcalidrawElement[];
|
|
16
16
|
export declare const getNonDeletedElements: (elements: readonly ExcalidrawElement[]) => readonly NonDeletedExcalidrawElement[];
|
|
17
|
+
export declare const getNonDeletedFrames: (frames: readonly ExcalidrawFrameElement[]) => readonly NonDeleted<ExcalidrawFrameElement>[];
|
|
17
18
|
export declare const isNonDeletedElement: <T extends ExcalidrawElement>(element: T) => element is NonDeleted<T>;
|
|
18
19
|
export declare const clearElementsForDatabase: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
|
|
19
20
|
export declare const clearElementsForExport: (elements: readonly ExcalidrawElement[]) => ExcalidrawElement[];
|
|
@@ -62,7 +62,7 @@ export declare class LinearElementEditor {
|
|
|
62
62
|
static isSegmentTooShort(element: NonDeleted<ExcalidrawLinearElement>, startPoint: Point, endPoint: Point, zoom: AppState["zoom"]): boolean;
|
|
63
63
|
static getSegmentMidPoint(element: NonDeleted<ExcalidrawLinearElement>, startPoint: Point, endPoint: Point, endPointIndex: number): readonly [number, number];
|
|
64
64
|
static getSegmentMidPointIndex(linearElementEditor: LinearElementEditor, appState: AppState, midPoint: Point): number;
|
|
65
|
-
static handlePointerDown(event: React.PointerEvent<
|
|
65
|
+
static handlePointerDown(event: React.PointerEvent<HTMLElement>, appState: AppState, history: History, scenePointer: {
|
|
66
66
|
x: number;
|
|
67
67
|
y: number;
|
|
68
68
|
}, linearElementEditor: LinearElementEditor): {
|
|
@@ -131,6 +131,10 @@ export declare class LinearElementEditor {
|
|
|
131
131
|
showWelcomeScreen: boolean;
|
|
132
132
|
isLoading: boolean;
|
|
133
133
|
errorMessage: import("react").ReactNode;
|
|
134
|
+
activeIFrame: {
|
|
135
|
+
element: import("./types").NonDeletedExcalidrawElement;
|
|
136
|
+
state: "active" | "hover";
|
|
137
|
+
} | null;
|
|
134
138
|
draggingElement: import("./types").NonDeletedExcalidrawElement | null;
|
|
135
139
|
resizingElement: import("./types").NonDeletedExcalidrawElement | null;
|
|
136
140
|
multiElement: NonDeleted<ExcalidrawLinearElement> | null;
|
|
@@ -138,12 +142,16 @@ export declare class LinearElementEditor {
|
|
|
138
142
|
isBindingEnabled: boolean;
|
|
139
143
|
startBoundElement: NonDeleted<ExcalidrawBindableElement> | null;
|
|
140
144
|
suggestedBindings: import("./binding").SuggestedBinding[];
|
|
145
|
+
frameToHighlight: NonDeleted<import("./types").ExcalidrawFrameElement> | null;
|
|
146
|
+
shouldRenderFrames: boolean;
|
|
147
|
+
editingFrame: string | null;
|
|
148
|
+
elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
|
|
141
149
|
editingElement: import("./types").NonDeletedExcalidrawElement | null;
|
|
142
150
|
activeTool: {
|
|
143
151
|
lastActiveTool: import("../types").LastActiveTool;
|
|
144
152
|
locked: boolean;
|
|
145
153
|
} & ({
|
|
146
|
-
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser" | "hand";
|
|
154
|
+
type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "iframe" | "image" | "frame" | "freedraw" | "eraser" | "hand";
|
|
147
155
|
customType: null;
|
|
148
156
|
} | {
|
|
149
157
|
type: "custom";
|
|
@@ -194,6 +202,7 @@ export declare class LinearElementEditor {
|
|
|
194
202
|
previousSelectedElementIds: {
|
|
195
203
|
[id: string]: boolean;
|
|
196
204
|
};
|
|
205
|
+
selectedElementsAreBeingDragged: boolean;
|
|
197
206
|
shouldCacheIgnoreZoom: boolean;
|
|
198
207
|
toast: {
|
|
199
208
|
message: string;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { ExcalidrawElement, ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, GroupId, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer } from "../element/types";
|
|
1
|
+
import { ExcalidrawElement, ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, GroupId, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawIFrameElement } from "../element/types";
|
|
2
2
|
import { AppState } from "../types";
|
|
3
3
|
import { MarkOptional, Mutable } from "../utility-types";
|
|
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">;
|
|
4
|
+
type ElementConstructorOpts = MarkOptional<Omit<ExcalidrawGenericElement, "id" | "type" | "isDeleted" | "updated">, "width" | "height" | "angle" | "groupIds" | "frameId" | "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>;
|
|
8
|
+
export declare const newIFrameElement: (opts: {
|
|
9
|
+
type: "iframe";
|
|
10
|
+
whitelisted: boolean;
|
|
11
|
+
} & ElementConstructorOpts) => NonDeleted<ExcalidrawIFrameElement>;
|
|
12
|
+
export declare const newFrameElement: (opts: ElementConstructorOpts) => NonDeleted<ExcalidrawFrameElement>;
|
|
8
13
|
export declare const newTextElement: (opts: {
|
|
9
14
|
text: string;
|
|
10
15
|
rawText: string;
|
|
@@ -15,6 +20,7 @@ export declare const newTextElement: (opts: {
|
|
|
15
20
|
containerId?: ExcalidrawTextContainer["id"];
|
|
16
21
|
lineHeight?: ExcalidrawTextElement["lineHeight"];
|
|
17
22
|
strokeWidth?: ExcalidrawTextElement["strokeWidth"];
|
|
23
|
+
isFrameName?: boolean;
|
|
18
24
|
} & ElementConstructorOpts) => NonDeleted<ExcalidrawTextElement>;
|
|
19
25
|
export declare const refreshTextDimensions: (textElement: ExcalidrawTextElement, text?: string) => {
|
|
20
26
|
x: number;
|
|
@@ -13,11 +13,18 @@ export declare const OMIT_SIDES_FOR_MULTIPLE_ELEMENTS: {
|
|
|
13
13
|
n: boolean;
|
|
14
14
|
w: boolean;
|
|
15
15
|
};
|
|
16
|
+
export declare const OMIT_SIDES_FOR_FRAME: {
|
|
17
|
+
e: boolean;
|
|
18
|
+
s: boolean;
|
|
19
|
+
n: boolean;
|
|
20
|
+
w: boolean;
|
|
21
|
+
rotation: boolean;
|
|
22
|
+
};
|
|
16
23
|
export declare const getTransformHandlesFromCoords: ([x1, y1, x2, y2, cx, cy]: [number, number, number, number, number, number], angle: number, zoom: Zoom, pointerType: PointerType, omitSides?: {
|
|
17
24
|
s?: boolean | undefined;
|
|
18
25
|
e?: boolean | undefined;
|
|
19
|
-
n?: boolean | undefined;
|
|
20
26
|
w?: boolean | undefined;
|
|
27
|
+
n?: boolean | undefined;
|
|
21
28
|
nw?: boolean | undefined;
|
|
22
29
|
ne?: boolean | undefined;
|
|
23
30
|
sw?: boolean | undefined;
|