@excalidraw/element 0.18.0-2a82821 → 0.18.0-2b1c2a9
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/dev/index.js +5570 -3546
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/index.js +12 -12
- package/dist/types/common/src/colors.d.ts +19 -0
- package/dist/types/common/src/constants.d.ts +3 -0
- package/dist/types/common/src/keys.d.ts +2 -0
- package/dist/types/common/src/points.d.ts +1 -1
- package/dist/types/common/src/utils.d.ts +1 -43
- package/dist/types/element/src/Scene.d.ts +1 -1
- package/dist/types/element/src/align.d.ts +2 -2
- package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
- package/dist/types/element/src/arrows/focus.d.ts +5 -2
- package/dist/types/element/src/binding.d.ts +17 -8
- package/dist/types/element/src/bounds.d.ts +5 -9
- package/dist/types/element/src/bucketFill.d.ts +110 -0
- package/dist/types/element/src/collision.d.ts +1 -1
- package/dist/types/element/src/comparisons.d.ts +4 -4
- package/dist/types/element/src/convertToShape.d.ts +23 -0
- package/dist/types/element/src/distribute.d.ts +2 -2
- package/dist/types/element/src/dragElements.d.ts +27 -0
- package/dist/types/element/src/duplicate.d.ts +3 -3
- package/dist/types/element/src/embeddable.d.ts +2 -2
- package/dist/types/element/src/flowchart.d.ts +7 -7
- package/dist/types/element/src/fractionalIndex.d.ts +2 -2
- package/dist/types/element/src/frame.d.ts +4 -4
- package/dist/types/element/src/groups.d.ts +9 -9
- package/dist/types/element/src/index.d.ts +4 -1
- package/dist/types/element/src/linearElementEditor.d.ts +27 -10
- package/dist/types/element/src/newElement.d.ts +14 -0
- package/dist/types/element/src/renderElement.d.ts +0 -3
- package/dist/types/element/src/resizeElements.d.ts +2 -2
- package/dist/types/element/src/selection.d.ts +5 -5
- package/dist/types/element/src/shape.d.ts +12 -0
- package/dist/types/element/src/sortElements.d.ts +10 -0
- package/dist/types/element/src/textElement.d.ts +13 -9
- package/dist/types/element/src/transform.d.ts +2 -2
- package/dist/types/element/src/typeChecks.d.ts +25 -25
- package/dist/types/element/src/types.d.ts +9 -1
- package/dist/types/element/src/utils.d.ts +7 -3
- package/dist/types/element/src/zindex.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +36 -12
- package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +24 -8
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +146 -931
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +24 -8
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +38 -13
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +9 -4
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +25 -9
- package/dist/types/excalidraw/actions/actionExport.d.ts +26 -10
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionFrame.d.ts +48 -197
- package/dist/types/excalidraw/actions/actionGroup.d.ts +39 -23
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +16 -6
- package/dist/types/excalidraw/actions/actionLink.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionMenu.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionProperties.d.ts +43 -24
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +17 -9
- package/dist/types/excalidraw/actions/actionStyles.d.ts +12 -4
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +16 -9
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +16 -9
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +13 -5
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +14 -6
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +13 -5
- package/dist/types/excalidraw/actions/index.d.ts +1 -2
- package/dist/types/excalidraw/actions/manager.d.ts +1 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +8 -4
- package/dist/types/excalidraw/appState.d.ts +9 -4
- package/dist/types/excalidraw/components/Actions.d.ts +17 -12
- package/dist/types/excalidraw/components/App.arrowText.d.ts +104 -0
- package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
- package/dist/types/excalidraw/components/App.cursor.d.ts +38 -0
- package/dist/types/excalidraw/components/App.d.ts +372 -67
- package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
- package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -3
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +9 -2
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -1
- package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +31 -0
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
- package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
- package/dist/types/excalidraw/components/{ToolButton.d.ts → IconButton.d.ts} +16 -19
- package/dist/types/excalidraw/components/Island.d.ts +7 -0
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
- package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
- package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
- package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
- package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
- package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
- package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
- package/dist/types/excalidraw/components/Popover.d.ts +1 -3
- package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
- package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
- package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
- package/dist/types/excalidraw/components/Tools.d.ts +146 -0
- package/dist/types/excalidraw/components/UserList.d.ts +3 -2
- package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -0
- package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +2 -2
- package/dist/types/excalidraw/components/icons.d.ts +4 -1
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -1
- package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
- package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
- package/dist/types/excalidraw/data/blob.d.ts +28 -12
- package/dist/types/excalidraw/data/index.d.ts +4 -4
- package/dist/types/excalidraw/data/json.d.ts +20 -12
- package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
- package/dist/types/excalidraw/fonts/Fonts.d.ts +3 -2
- package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +5 -5
- package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
- package/dist/types/excalidraw/renderer/animation.d.ts +1 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +7 -0
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +1 -3
- package/dist/types/excalidraw/scene/Renderer.d.ts +12 -11
- package/dist/types/excalidraw/scene/export.d.ts +3 -3
- package/dist/types/excalidraw/scene/index.d.ts +1 -1
- package/dist/types/excalidraw/scene/types.d.ts +4 -3
- package/dist/types/excalidraw/snapping.d.ts +7 -7
- package/dist/types/excalidraw/types.d.ts +410 -20
- package/dist/types/excalidraw/viewport.d.ts +275 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +2 -3
- package/dist/types/laser-pointer/src/state.d.ts +1 -0
- package/dist/types/math/src/curve.d.ts +19 -12
- package/dist/types/math/src/index.d.ts +1 -0
- package/dist/types/math/src/pca.d.ts +79 -0
- package/dist/types/math/src/polygon.d.ts +25 -1
- package/dist/types/math/src/segment.d.ts +6 -0
- package/dist/types/utils/src/export.d.ts +3 -3
- package/package.json +4 -4
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -172
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
- package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -10
- package/dist/types/excalidraw/components/shapes.d.ts +0 -270
- package/dist/types/excalidraw/cursor.d.ts +0 -5
- package/dist/types/excalidraw/scene/scroll.d.ts +0 -18
- package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
|
@@ -15,7 +15,8 @@ export declare class Fonts {
|
|
|
15
15
|
fontFaces: ExcalidrawFontFace[];
|
|
16
16
|
}>;
|
|
17
17
|
private readonly scene;
|
|
18
|
-
|
|
18
|
+
private readonly ownerDocument;
|
|
19
|
+
constructor(scene: Scene, ownerDocument?: Document);
|
|
19
20
|
/**
|
|
20
21
|
* Get all the font families for the given scene.
|
|
21
22
|
*/
|
|
@@ -36,7 +37,7 @@ export declare class Fonts {
|
|
|
36
37
|
/**
|
|
37
38
|
* Load font faces for passed elements - use when the scene is unavailable (i.e. export).
|
|
38
39
|
*/
|
|
39
|
-
static loadElementsFonts: (elements: readonly ExcalidrawElement[]) => Promise<FontFace[]>;
|
|
40
|
+
static loadElementsFonts: (elements: readonly ExcalidrawElement[], ownerDocument?: Document) => Promise<FontFace[]>;
|
|
40
41
|
/**
|
|
41
42
|
* Generate CSS @font-face declarations for the given elements.
|
|
42
43
|
*/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AppState } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Subscribes to specific appState changes. The component re-renders
|
|
4
|
+
* only when the specified prop(s) change — not on every appState update.
|
|
5
|
+
*
|
|
6
|
+
* Works both inside and outside the <Excalidraw> tree, as long as
|
|
7
|
+
* ExcalidrawAPIContext.Provider is an ancestor (automatically provided
|
|
8
|
+
* inside <Excalidraw>, or manually by the host app).
|
|
9
|
+
*
|
|
10
|
+
* Returns the narrowed value depending on prop form:
|
|
11
|
+
* - `keyof AppState` → `AppState[K]`
|
|
12
|
+
* - `(keyof AppState)[]` → whole `AppState`
|
|
13
|
+
* - selector function → selector's return type `T`
|
|
14
|
+
*
|
|
15
|
+
* If excalidrawAPI is not ready yet (host apps), hook is rerendered with latest
|
|
16
|
+
* value once available.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useAppStateValue<K extends keyof AppState>(prop: K, _internal?: boolean): AppState[K];
|
|
19
|
+
export declare function useAppStateValue(props: (keyof AppState)[], _internal?: boolean): AppState;
|
|
20
|
+
export declare function useAppStateValue<T>(selector: (appState: AppState) => T, _internal?: boolean): T;
|
|
21
|
+
/**
|
|
22
|
+
* Subscribes to specific appState changes without causing component rerenders.
|
|
23
|
+
*
|
|
24
|
+
* The callback is called on every matching change, but also on initial render
|
|
25
|
+
* so you can initialize your state.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useOnAppStateChange<K extends keyof AppState>(prop: K, callback: (value: AppState[K], appState: AppState) => void): undefined;
|
|
28
|
+
export declare function useOnAppStateChange(props: (keyof AppState)[], callback: (props: AppState, appState: AppState) => void): undefined;
|
|
29
|
+
export declare function useOnAppStateChange<T>(selector: (appState: AppState) => T, callback: (value: T, appState: AppState) => void): undefined;
|
|
@@ -2,13 +2,13 @@ export type CaretPosition = {
|
|
|
2
2
|
start: number;
|
|
3
3
|
end: number;
|
|
4
4
|
};
|
|
5
|
-
export declare const saveCaretPosition: () => CaretPosition | null;
|
|
6
|
-
export declare const restoreCaretPosition: (position: CaretPosition | null) => void;
|
|
7
|
-
export declare const withCaretPositionPreservation: (callback: () => void, isCompactMode: boolean, isEditingText: boolean, onPreventClose?: () => void) => void;
|
|
8
|
-
export declare const useTextEditorFocus: () => {
|
|
5
|
+
export declare const saveCaretPosition: (ownerDocument?: Document) => CaretPosition | null;
|
|
6
|
+
export declare const restoreCaretPosition: (position: CaretPosition | null, ownerDocument?: Document) => void;
|
|
7
|
+
export declare const withCaretPositionPreservation: (callback: () => void, isCompactMode: boolean, isEditingText: boolean, onPreventClose?: () => void, ownerDocument?: Document) => void;
|
|
8
|
+
export declare const useTextEditorFocus: (ownerDocument?: Document) => {
|
|
9
9
|
saveCaretPosition: () => void;
|
|
10
10
|
restoreCaretPosition: () => void;
|
|
11
11
|
clearSavedPosition: () => void;
|
|
12
12
|
hasSavedPosition: boolean;
|
|
13
13
|
};
|
|
14
|
-
export declare const temporarilyDisableTextEditorBlur: (duration?: number) => void;
|
|
14
|
+
export declare const temporarilyDisableTextEditorBlur: (ownerDocument?: Document, duration?: number) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ElementsSegmentsMap, GlobalPoint } from "@excalidraw/math/types";
|
|
2
2
|
import type { ElementsMap, ExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
import type { BoxSelectionMode } from "../types";
|
|
3
4
|
export declare const getLassoSelectedElementIds: (input: {
|
|
4
5
|
lassoPath: GlobalPoint[];
|
|
5
6
|
elements: readonly ExcalidrawElement[];
|
|
@@ -8,6 +9,7 @@ export declare const getLassoSelectedElementIds: (input: {
|
|
|
8
9
|
intersectedElements: Set<ExcalidrawElement["id"]>;
|
|
9
10
|
enclosedElements: Set<ExcalidrawElement["id"]>;
|
|
10
11
|
simplifyDistance?: number;
|
|
12
|
+
mode?: BoxSelectionMode;
|
|
11
13
|
}) => {
|
|
12
14
|
selectedElementIds: string[];
|
|
13
15
|
};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { StaticCanvasRenderConfig } from "../scene/types";
|
|
2
2
|
import type { AppState, StaticCanvasAppState } from "../types";
|
|
3
|
+
export declare const DEFAULT_SELECTION_COLOR = "#6965db";
|
|
4
|
+
/**
|
|
5
|
+
* Returns the theme's selection color (`--color-selection`), read from the
|
|
6
|
+
* computed style of any element inside the editor container so that host
|
|
7
|
+
* overrides are respected. Falls back to the default when unavailable.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getSelectionColor: (element: Element | null | undefined) => string;
|
|
3
10
|
export declare const fillCircle: (context: CanvasRenderingContext2D, cx: number, cy: number, radius: number, stroke: boolean, fill?: boolean) => void;
|
|
4
11
|
export declare const getNormalizedCanvasDimensions: (canvas: HTMLCanvasElement, scale: number) => [number, number];
|
|
5
12
|
export declare const bootstrapCanvas: ({ canvas, scale, normalizedWidth, normalizedHeight, theme, isExporting, viewBackgroundColor, }: {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { getScrollBars } from "../scene/scrollbars";
|
|
2
|
-
import type { InteractiveSceneRenderConfig
|
|
2
|
+
import type { InteractiveSceneRenderConfig } from "../scene/types";
|
|
3
3
|
declare const _renderInteractiveScene: ({ app, canvas, elementsMap, visibleElements, selectedElements, allElementsMap, scale, appState, renderConfig, editorInterface, animationState, deltaTime, }: InteractiveSceneRenderConfig) => {
|
|
4
4
|
scrollBars?: ReturnType<typeof getScrollBars>;
|
|
5
|
-
atLeastOneVisibleElement: boolean;
|
|
6
|
-
elementsMap: RenderableElementsMap;
|
|
7
5
|
animationState?: typeof animationState;
|
|
8
6
|
};
|
|
9
7
|
/**
|
|
@@ -64,7 +64,7 @@ export declare class Renderer {
|
|
|
64
64
|
startArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
65
65
|
endArrowhead: import("@excalidraw/element/types").Arrowhead | null;
|
|
66
66
|
}> & {
|
|
67
|
-
isDeleted:
|
|
67
|
+
isDeleted: false;
|
|
68
68
|
}) | (Readonly<{
|
|
69
69
|
id: string;
|
|
70
70
|
x: number;
|
|
@@ -98,7 +98,7 @@ export declare class Renderer {
|
|
|
98
98
|
}> & {
|
|
99
99
|
type: "rectangle";
|
|
100
100
|
} & {
|
|
101
|
-
isDeleted:
|
|
101
|
+
isDeleted: false;
|
|
102
102
|
}) | (Readonly<{
|
|
103
103
|
id: string;
|
|
104
104
|
x: number;
|
|
@@ -132,7 +132,7 @@ export declare class Renderer {
|
|
|
132
132
|
}> & {
|
|
133
133
|
type: "diamond";
|
|
134
134
|
} & {
|
|
135
|
-
isDeleted:
|
|
135
|
+
isDeleted: false;
|
|
136
136
|
}) | (Readonly<{
|
|
137
137
|
id: string;
|
|
138
138
|
x: number;
|
|
@@ -166,7 +166,7 @@ export declare class Renderer {
|
|
|
166
166
|
}> & {
|
|
167
167
|
type: "ellipse";
|
|
168
168
|
} & {
|
|
169
|
-
isDeleted:
|
|
169
|
+
isDeleted: false;
|
|
170
170
|
}) | (Readonly<{
|
|
171
171
|
id: string;
|
|
172
172
|
x: number;
|
|
@@ -200,7 +200,7 @@ export declare class Renderer {
|
|
|
200
200
|
}> & Readonly<{
|
|
201
201
|
type: "embeddable";
|
|
202
202
|
}> & {
|
|
203
|
-
isDeleted:
|
|
203
|
+
isDeleted: false;
|
|
204
204
|
}) | (Readonly<{
|
|
205
205
|
id: string;
|
|
206
206
|
x: number;
|
|
@@ -237,7 +237,7 @@ export declare class Renderer {
|
|
|
237
237
|
generationData?: import("@excalidraw/element/types").MagicGenerationData;
|
|
238
238
|
};
|
|
239
239
|
}> & {
|
|
240
|
-
isDeleted:
|
|
240
|
+
isDeleted: false;
|
|
241
241
|
}) | (Readonly<{
|
|
242
242
|
id: string;
|
|
243
243
|
x: number;
|
|
@@ -275,7 +275,7 @@ export declare class Renderer {
|
|
|
275
275
|
scale: [number, number];
|
|
276
276
|
crop: import("@excalidraw/element/types").ImageCrop | null;
|
|
277
277
|
}> & {
|
|
278
|
-
isDeleted:
|
|
278
|
+
isDeleted: false;
|
|
279
279
|
}) | (Readonly<{
|
|
280
280
|
id: string;
|
|
281
281
|
x: number;
|
|
@@ -310,7 +310,7 @@ export declare class Renderer {
|
|
|
310
310
|
type: "frame";
|
|
311
311
|
name: string | null;
|
|
312
312
|
} & {
|
|
313
|
-
isDeleted:
|
|
313
|
+
isDeleted: false;
|
|
314
314
|
}) | (Readonly<{
|
|
315
315
|
id: string;
|
|
316
316
|
x: number;
|
|
@@ -345,7 +345,7 @@ export declare class Renderer {
|
|
|
345
345
|
type: "magicframe";
|
|
346
346
|
name: string | null;
|
|
347
347
|
} & {
|
|
348
|
-
isDeleted:
|
|
348
|
+
isDeleted: false;
|
|
349
349
|
}) | (Readonly<{
|
|
350
350
|
id: string;
|
|
351
351
|
x: number;
|
|
@@ -389,8 +389,9 @@ export declare class Renderer {
|
|
|
389
389
|
lineHeight: number & {
|
|
390
390
|
_brand: "unitlessLineHeight";
|
|
391
391
|
};
|
|
392
|
+
labelPosition?: number | null;
|
|
392
393
|
}> & {
|
|
393
|
-
isDeleted:
|
|
394
|
+
isDeleted: false;
|
|
394
395
|
}) | (Readonly<{
|
|
395
396
|
id: string;
|
|
396
397
|
x: number;
|
|
@@ -428,7 +429,7 @@ export declare class Renderer {
|
|
|
428
429
|
simulatePressure: boolean;
|
|
429
430
|
strokeOptions: import("@excalidraw/element/types").StrokeOptions;
|
|
430
431
|
}> & {
|
|
431
|
-
isDeleted:
|
|
432
|
+
isDeleted: false;
|
|
432
433
|
}) | null;
|
|
433
434
|
canvasNonce: string;
|
|
434
435
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
1
|
+
import type { ExcalidrawFrameLikeElement, NonDeleted, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
2
|
import type { AppState, BinaryFiles } from "../types";
|
|
3
3
|
export declare const exportToCanvas: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, exportingFrame, }: {
|
|
4
4
|
exportBackground: boolean;
|
|
5
5
|
exportPadding?: number;
|
|
6
6
|
viewBackgroundColor: string;
|
|
7
|
-
exportingFrame?: ExcalidrawFrameLikeElement | null;
|
|
7
|
+
exportingFrame?: NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
8
8
|
}, createCanvas?: (width: number, height: number) => {
|
|
9
9
|
canvas: HTMLCanvasElement;
|
|
10
10
|
scale: number;
|
|
@@ -22,7 +22,7 @@ export declare const exportToSvg: (elements: readonly NonDeletedExcalidrawElemen
|
|
|
22
22
|
* if true, all embeddables passed in will be rendered when possible.
|
|
23
23
|
*/
|
|
24
24
|
renderEmbeddables?: boolean;
|
|
25
|
-
exportingFrame?: ExcalidrawFrameLikeElement | null;
|
|
25
|
+
exportingFrame?: NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
26
26
|
skipInliningFonts?: true;
|
|
27
27
|
reuseImages?: boolean;
|
|
28
28
|
}) => Promise<SVGSVGElement>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { isSomeElementSelected, getElementsWithinSelection, getSelectedElements, getTargetElements, } from "@excalidraw/element";
|
|
2
|
-
export {
|
|
2
|
+
export { getScrollToContentState } from "../viewport";
|
|
3
3
|
export { hasBackground, hasStrokeWidth, hasStrokeStyle, hasFreedrawMode, canHaveArrowheads, canChangeRoundness, } from "@excalidraw/element";
|
|
4
4
|
export { getNormalizedZoom, getNormalizedGridSize, getNormalizedGridStep, } from "./normalize";
|
|
@@ -9,6 +9,9 @@ export type StaticCanvasRenderConfig = {
|
|
|
9
9
|
canvasBackgroundColor: AppState["viewBackgroundColor"];
|
|
10
10
|
imageCache: AppClassProperties["imageCache"];
|
|
11
11
|
renderGrid: boolean;
|
|
12
|
+
/** whether to render link icons on elements with links (never rendered
|
|
13
|
+
when exporting). @default true */
|
|
14
|
+
renderLinks?: boolean;
|
|
12
15
|
/** when exporting the behavior is slightly different (e.g. we can't use
|
|
13
16
|
CSS filters), and we disable render optimizations for best output */
|
|
14
17
|
isExporting: boolean;
|
|
@@ -52,8 +55,6 @@ export type InteractiveCanvasRenderConfig = {
|
|
|
52
55
|
renderScrollbars?: boolean;
|
|
53
56
|
};
|
|
54
57
|
export type RenderInteractiveSceneCallback = {
|
|
55
|
-
atLeastOneVisibleElement: boolean;
|
|
56
|
-
elementsMap: RenderableElementsMap;
|
|
57
58
|
scrollBars?: ScrollBars;
|
|
58
59
|
};
|
|
59
60
|
export type StaticSceneRenderConfig = {
|
|
@@ -89,7 +90,7 @@ export type InteractiveSceneRenderConfig = {
|
|
|
89
90
|
export type NewElementSceneRenderConfig = {
|
|
90
91
|
canvas: HTMLCanvasElement | null;
|
|
91
92
|
rc: RoughCanvas;
|
|
92
|
-
newElement:
|
|
93
|
+
newElement: NonDeletedExcalidrawElement | null;
|
|
93
94
|
elementsMap: RenderableElementsMap;
|
|
94
95
|
allElementsMap: NonDeletedSceneElementsMap;
|
|
95
96
|
scale: number;
|
|
@@ -66,19 +66,19 @@ export declare const isGridModeEnabled: (app: AppClassProperties) => boolean;
|
|
|
66
66
|
export declare const isSnappingEnabled: ({ event, app, selectedElements, }: {
|
|
67
67
|
app: AppClassProperties;
|
|
68
68
|
event: KeyboardModifiersObject;
|
|
69
|
-
selectedElements: NonDeletedExcalidrawElement[];
|
|
69
|
+
selectedElements: readonly NonDeletedExcalidrawElement[];
|
|
70
70
|
}) => boolean;
|
|
71
71
|
export declare const areRoughlyEqual: (a: number, b: number, precision?: number) => boolean;
|
|
72
|
-
export declare const getElementsCorners: (elements:
|
|
72
|
+
export declare const getElementsCorners: (elements: readonly NonDeletedExcalidrawElement[], elementsMap: ElementsMap, { omitCenter, boundingBoxCorners, dragOffset, }?: {
|
|
73
73
|
omitCenter?: boolean;
|
|
74
74
|
boundingBoxCorners?: boolean;
|
|
75
75
|
dragOffset?: Vector2D;
|
|
76
76
|
}) => GlobalPoint[];
|
|
77
|
-
export declare const getVisibleGaps: (elements: readonly NonDeletedExcalidrawElement[], selectedElements:
|
|
77
|
+
export declare const getVisibleGaps: (elements: readonly NonDeletedExcalidrawElement[], selectedElements: readonly NonDeletedExcalidrawElement[], appState: AppState, elementsMap: ElementsMap) => {
|
|
78
78
|
horizontalGaps: Gap[];
|
|
79
79
|
verticalGaps: Gap[];
|
|
80
80
|
};
|
|
81
|
-
export declare const getReferenceSnapPoints: (elements: readonly NonDeletedExcalidrawElement[], selectedElements:
|
|
81
|
+
export declare const getReferenceSnapPoints: (elements: readonly NonDeletedExcalidrawElement[], selectedElements: readonly NonDeletedExcalidrawElement[], appState: AppState, elementsMap: ElementsMap) => GlobalPoint[];
|
|
82
82
|
export declare const snapDraggedElements: (elements: ExcalidrawElement[], dragOffset: Vector2D, app: AppClassProperties, event: KeyboardModifiersObject, elementsMap: ElementsMap) => {
|
|
83
83
|
snapOffset: {
|
|
84
84
|
x: number;
|
|
@@ -86,21 +86,21 @@ export declare const snapDraggedElements: (elements: ExcalidrawElement[], dragOf
|
|
|
86
86
|
};
|
|
87
87
|
snapLines: (PointSnapLine | GapSnapLine)[];
|
|
88
88
|
};
|
|
89
|
-
export declare const snapResizingElements: (selectedElements:
|
|
89
|
+
export declare const snapResizingElements: (selectedElements: readonly NonDeletedExcalidrawElement[], selectedOriginalElements: readonly NonDeletedExcalidrawElement[], app: AppClassProperties, event: KeyboardModifiersObject, dragOffset: Vector2D, transformHandle: MaybeTransformHandleType) => {
|
|
90
90
|
snapOffset: {
|
|
91
91
|
x: number;
|
|
92
92
|
y: number;
|
|
93
93
|
};
|
|
94
94
|
snapLines: PointSnapLine[];
|
|
95
95
|
};
|
|
96
|
-
export declare const snapNewElement: (newElement:
|
|
96
|
+
export declare const snapNewElement: (newElement: NonDeletedExcalidrawElement, app: AppClassProperties, event: KeyboardModifiersObject, origin: Vector2D, dragOffset: Vector2D, elementsMap: ElementsMap) => {
|
|
97
97
|
snapOffset: {
|
|
98
98
|
x: number;
|
|
99
99
|
y: number;
|
|
100
100
|
};
|
|
101
101
|
snapLines: PointSnapLine[];
|
|
102
102
|
};
|
|
103
|
-
export declare const getSnapLinesAtPointer: (elements: readonly
|
|
103
|
+
export declare const getSnapLinesAtPointer: (elements: readonly NonDeletedExcalidrawElement[], app: AppClassProperties, pointer: Vector2D, event: KeyboardModifiersObject, elementsMap: ElementsMap) => {
|
|
104
104
|
originOffset: {
|
|
105
105
|
x: number;
|
|
106
106
|
y: number;
|