@excalidraw/math 0.18.0-143b5b6 → 0.18.0-1440f2d
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/types/common/src/constants.d.ts +1 -0
- package/dist/types/common/src/utils.d.ts +7 -1
- package/dist/types/element/src/align.d.ts +4 -1
- package/dist/types/element/src/binding.d.ts +62 -0
- package/dist/types/element/src/bounds.d.ts +10 -2
- package/dist/types/element/src/collision.d.ts +7 -0
- package/dist/types/element/src/cropElement.d.ts +36 -4
- package/dist/types/element/src/delta.d.ts +7 -1
- package/dist/types/element/src/distribute.d.ts +4 -1
- package/dist/types/element/src/dragElements.d.ts +8 -3
- package/dist/types/element/src/elbowArrow.d.ts +5 -0
- package/dist/types/element/src/embeddable.d.ts +2 -1
- package/dist/types/element/src/flowchart.d.ts +1 -7
- package/dist/types/element/src/frame.d.ts +19 -1
- package/dist/types/element/src/groups.d.ts +1 -6
- package/dist/types/element/src/image.d.ts +5 -2
- package/dist/types/element/src/index.d.ts +1 -0
- package/dist/types/element/src/linearElementEditor.d.ts +4 -1
- package/dist/types/element/src/listMarker.d.ts +7 -2
- package/dist/types/element/src/newElement.d.ts +3 -1
- package/dist/types/element/src/renderElement.d.ts +10 -0
- package/dist/types/element/src/renderEnvironment.d.ts +66 -0
- package/dist/types/element/src/resizeElements.d.ts +15 -5
- package/dist/types/element/src/selection.d.ts +1 -7
- package/dist/types/element/src/shape.d.ts +2 -0
- package/dist/types/element/src/stickyNote.d.ts +8 -0
- package/dist/types/element/src/textElement.d.ts +3 -2
- package/dist/types/element/src/textMeasurements.d.ts +15 -11
- package/dist/types/element/src/textWrapping.d.ts +3 -2
- package/dist/types/element/src/transform.d.ts +5 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -0
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +47 -221
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +13 -9
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +4 -588
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionExport.d.ts +9 -7
- package/dist/types/excalidraw/actions/actionFrame.d.ts +44 -525
- package/dist/types/excalidraw/actions/actionGroup.d.ts +4 -2
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionLink.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionMenu.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionProperties.d.ts +2 -0
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleMinimap.d.ts +201 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleShowHints.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/actionToggleWrap.d.ts +12 -0
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -0
- package/dist/types/excalidraw/actions/index.d.ts +2 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +1 -1
- package/dist/types/excalidraw/appState.d.ts +8 -7
- package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -1
- package/dist/types/excalidraw/charts/charts.helpers.d.ts +6 -5
- package/dist/types/excalidraw/charts/charts.line.d.ts +2 -1
- package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -1
- package/dist/types/excalidraw/charts/index.d.ts +2 -1
- package/dist/types/excalidraw/components/Actions.d.ts +9 -2
- package/dist/types/excalidraw/components/App.d.ts +23 -8
- package/dist/types/excalidraw/components/App.host.d.ts +102 -0
- package/dist/types/excalidraw/components/App.selection.d.ts +265 -0
- package/dist/types/excalidraw/components/App.selectionTool.d.ts +42 -6
- package/dist/types/excalidraw/components/App.viewport.d.ts +23 -3
- package/dist/types/excalidraw/components/App.wheel.d.ts +6 -2
- package/dist/types/excalidraw/components/App.wrap.d.ts +31 -0
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -1
- package/dist/types/excalidraw/components/Minimap/Minimap.d.ts +15 -0
- package/dist/types/excalidraw/components/Minimap/MinimapAnnouncementDot.d.ts +10 -0
- package/dist/types/excalidraw/components/Minimap/minimap-controller.chunk.d.ts +90 -0
- package/dist/types/excalidraw/components/Minimap/minimap-shared.chunk.d.ts +122 -0
- package/dist/types/excalidraw/components/Minimap/minimap-worker.chunk.d.ts +12 -0
- package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -2
- package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +2 -1
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +5 -2
- package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +2 -1
- package/dist/types/excalidraw/components/TTDDialog/common.d.ts +4 -1
- package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +3 -2
- package/dist/types/excalidraw/components/TTDDialog/types.d.ts +14 -1
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +16 -0
- package/dist/types/excalidraw/components/Tooltip.d.ts +11 -1
- package/dist/types/excalidraw/components/TopPicksDnD/topPicksDnD.d.ts +1 -1
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +0 -1
- package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +13 -2
- package/dist/types/excalidraw/components/icons.d.ts +1 -0
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -0
- package/dist/types/excalidraw/data/blob.d.ts +16 -14
- package/dist/types/excalidraw/data/index.d.ts +3 -3
- package/dist/types/excalidraw/data/json.d.ts +8 -7
- package/dist/types/excalidraw/fonts/Fonts.d.ts +9 -6
- package/dist/types/excalidraw/history.d.ts +10 -4
- package/dist/types/excalidraw/mermaid.d.ts +7 -0
- package/dist/types/excalidraw/reactUtils.d.ts +1 -1
- package/dist/types/excalidraw/renderer/animation.d.ts +11 -4
- package/dist/types/excalidraw/renderer/staticScene.d.ts +11 -6
- package/dist/types/excalidraw/scene/Renderer.d.ts +1 -1
- package/dist/types/excalidraw/scene/export.d.ts +343 -20
- package/dist/types/excalidraw/scene/types.d.ts +23 -1
- package/dist/types/excalidraw/types.d.ts +48 -1
- package/dist/types/excalidraw/viewport.d.ts +1 -0
- package/dist/types/utils/src/index.d.ts +3 -1
- package/package.json +2 -2
- package/dist/types/utils/src/export.d.ts +0 -36
|
@@ -3,7 +3,7 @@ import type { LinearElementEditor } from "@excalidraw/element";
|
|
|
3
3
|
import type { ListMarkerAdvance, MaybeTransformHandleType } from "@excalidraw/element";
|
|
4
4
|
import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, ExcalidrawArrowElement, Arrowhead, FontFamilyValues, FileId, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement, BindMode, ExcalidrawTextElement, StrokeVariability } from "@excalidraw/element/types";
|
|
5
5
|
import type { Merge, MaybePromise, ValueOf, MakeBrand } from "@excalidraw/common/utility-types";
|
|
6
|
-
import type { CaptureUpdateActionType, DurableIncrement, EphemeralIncrement, OnDuplicateData } from "@excalidraw/element";
|
|
6
|
+
import type { CaptureUpdateActionType, DurableIncrement, EphemeralIncrement, RenderEnvironment, OnDuplicateData } from "@excalidraw/element";
|
|
7
7
|
import type { GlobalPoint } from "@excalidraw/math";
|
|
8
8
|
import type { Action } from "./actions/types";
|
|
9
9
|
import type { Spreadsheet } from "./charts";
|
|
@@ -412,6 +412,7 @@ export interface AppState {
|
|
|
412
412
|
duration?: number;
|
|
413
413
|
} | null;
|
|
414
414
|
zenModeEnabled: boolean;
|
|
415
|
+
minimapEnabled: boolean;
|
|
415
416
|
theme: Theme;
|
|
416
417
|
/** grid cell px size */
|
|
417
418
|
gridSize: number;
|
|
@@ -692,6 +693,30 @@ export interface ExcalidrawProps {
|
|
|
692
693
|
* @default document
|
|
693
694
|
*/
|
|
694
695
|
ownerDocument?: Document;
|
|
696
|
+
/**
|
|
697
|
+
* Host environment used by the renderer and export pipeline to create
|
|
698
|
+
* canvases and images. Supply a custom implementation to redirect canvas
|
|
699
|
+
* creation and image decoding to e.g. a host canvas pool, an
|
|
700
|
+
* `OffscreenCanvas`, or a non-DOM image decoder. When omitted, canvas and
|
|
701
|
+
* image creation fall back to `ownerDocument` / `ownerWindow`.
|
|
702
|
+
*
|
|
703
|
+
* The value must be referentially stable -- every render cache (element
|
|
704
|
+
* canvases, text metrics, char widths, link icons) is keyed by this
|
|
705
|
+
* object's identity, so a new identity is a full cache miss. Passing an
|
|
706
|
+
* inline object literal mints a fresh identity on every React render,
|
|
707
|
+
* which silently re-rasterizes every element on every frame; hoist it to a
|
|
708
|
+
* module constant or memoize it (e.g. `useMemo`) instead.
|
|
709
|
+
*
|
|
710
|
+
* Only `createCanvas` and `createImage` are required. `createPath` (used to
|
|
711
|
+
* fill freedraw strokes) falls back to the global `Path2D`, which every
|
|
712
|
+
* browser has -- a non-browser host without one must supply it. Pass
|
|
713
|
+
* `document` (the owner document) for SVG exports to be built in it rather
|
|
714
|
+
* than in the global `document`, and `textMetrics` to measure the editor's
|
|
715
|
+
* text with your own provider.
|
|
716
|
+
*
|
|
717
|
+
* @default { createCanvas: () => ownerDocument.createElement("canvas"), createImage: () => new ownerWindow.Image(), createPath: (d) => new ownerWindow.Path2D(d), document: ownerDocument }
|
|
718
|
+
*/
|
|
719
|
+
renderEnvironment?: RenderEnvironment;
|
|
695
720
|
onChange?: (elements: readonly OrderedExcalidrawElement[], appState: AppState, files: BinaryFiles) => void;
|
|
696
721
|
onThemeChange?: (theme: Theme | "system") => void;
|
|
697
722
|
/**
|
|
@@ -960,6 +985,7 @@ export type AppClassProperties = {
|
|
|
960
985
|
state: AppState;
|
|
961
986
|
readonly ownerDocument: Document;
|
|
962
987
|
readonly ownerWindow: Window & typeof globalThis;
|
|
988
|
+
renderEnvironment: RenderEnvironment;
|
|
963
989
|
api: App["api"];
|
|
964
990
|
sessionExportThemeOverride: App["sessionExportThemeOverride"];
|
|
965
991
|
interactiveCanvas: HTMLCanvasElement | null;
|
|
@@ -981,6 +1007,7 @@ export type AppClassProperties = {
|
|
|
981
1007
|
onInsertElements: App["onInsertElements"];
|
|
982
1008
|
onExportImage: App["onExportImage"];
|
|
983
1009
|
viewport: App["viewport"];
|
|
1010
|
+
wheel: App["wheel"];
|
|
984
1011
|
addFiles: App["addFiles"];
|
|
985
1012
|
addElementsFromPasteOrLibrary: App["addElementsFromPasteOrLibrary"];
|
|
986
1013
|
togglePenMode: App["togglePenMode"];
|
|
@@ -1001,6 +1028,7 @@ export type AppClassProperties = {
|
|
|
1001
1028
|
toolDrag: App["toolDrag"];
|
|
1002
1029
|
activeResizeHandle: App["activeResizeHandle"];
|
|
1003
1030
|
selectionTool: App["selectionTool"];
|
|
1031
|
+
wrap: App["wrap"];
|
|
1004
1032
|
modifiers: App["modifiers"];
|
|
1005
1033
|
isToolLocked: App["isToolLocked"];
|
|
1006
1034
|
getEffectiveGridSize: App["getEffectiveGridSize"];
|
|
@@ -1072,6 +1100,10 @@ export type PointerDownState = Readonly<{
|
|
|
1072
1100
|
x: number;
|
|
1073
1101
|
y: number;
|
|
1074
1102
|
};
|
|
1103
|
+
lastOffset: {
|
|
1104
|
+
x: number;
|
|
1105
|
+
y: number;
|
|
1106
|
+
};
|
|
1075
1107
|
blockDragging: boolean;
|
|
1076
1108
|
};
|
|
1077
1109
|
eventListeners: {
|
|
@@ -1107,6 +1139,21 @@ export interface ExcalidrawImperativeAPI {
|
|
|
1107
1139
|
history: {
|
|
1108
1140
|
clear: InstanceType<typeof App>["resetHistory"];
|
|
1109
1141
|
};
|
|
1142
|
+
/**
|
|
1143
|
+
* Selects elements (or their ids — one or many), adds them to or removes
|
|
1144
|
+
* them from the selection, or clears it — as the editor does: an element is
|
|
1145
|
+
* selected with its group (unless `deep`), a frame and its children aren't
|
|
1146
|
+
* selected at the same time, and locked elements are skipped (unless
|
|
1147
|
+
* `includeLocked`). Text editing and cropping end, and the link popup of a
|
|
1148
|
+
* lone selected element shows. Missing and deleted elements are skipped.
|
|
1149
|
+
*
|
|
1150
|
+
* By default the change is recorded for undo along with the next undoable
|
|
1151
|
+
* change — pass `captureUpdate` as for `updateScene()` otherwise. Like
|
|
1152
|
+
* `updateScene()`, it applies on the next render: read it back through
|
|
1153
|
+
* `onChange()` or `getAppState()` after that. Works in view mode too, where
|
|
1154
|
+
* the selection shows without transform handles.
|
|
1155
|
+
*/
|
|
1156
|
+
selection: Pick<InstanceType<typeof App>["selection"], "select" | "add" | "remove" | "clear">;
|
|
1110
1157
|
getSceneElements: InstanceType<typeof App>["getSceneElements"];
|
|
1111
1158
|
getAppState: () => InstanceType<typeof App>["state"];
|
|
1112
1159
|
getFiles: () => InstanceType<typeof App>["files"];
|
|
@@ -217,6 +217,7 @@ export declare const zoomToFitBounds: ({ bounds, appState, canvasOffsets, fit, m
|
|
|
217
217
|
duration?: number;
|
|
218
218
|
} | null;
|
|
219
219
|
zenModeEnabled: boolean;
|
|
220
|
+
minimapEnabled: boolean;
|
|
220
221
|
theme: import("@excalidraw/element/types").Theme;
|
|
221
222
|
gridSize: number;
|
|
222
223
|
gridStep: number;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { exportScene, exportToClipboard, MIME_TYPES, } from "@excalidraw/excalidraw/scene/export";
|
|
2
|
+
export type { ExportSceneData, ExportSceneConfig, ExportSceneOptions, } from "@excalidraw/excalidraw/scene/export";
|
|
2
3
|
export { elementsOverlappingBBox } from "@excalidraw/element";
|
|
3
4
|
export { getCommonBounds } from "@excalidraw/element";
|
|
5
|
+
export type { RenderEnvironment } from "@excalidraw/element";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@excalidraw/math",
|
|
3
|
-
"version": "0.18.0-
|
|
3
|
+
"version": "0.18.0-1440f2d",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/types/math/src/index.d.ts",
|
|
6
6
|
"main": "./dist/prod/index.js",
|
|
@@ -61,6 +61,6 @@
|
|
|
61
61
|
"build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@excalidraw/common": "0.18.0-
|
|
64
|
+
"@excalidraw/common": "0.18.0-1440f2d"
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { MIME_TYPES } from "@excalidraw/common";
|
|
2
|
-
import type { ExcalidrawFrameLikeElement, NonDeleted, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
-
import type { AppState, BinaryFiles } from "@excalidraw/excalidraw/types";
|
|
4
|
-
export { MIME_TYPES };
|
|
5
|
-
type ExportOpts = {
|
|
6
|
-
/** restored before exporting */
|
|
7
|
-
elements: readonly NonDeletedExcalidrawElement[];
|
|
8
|
-
appState?: Partial<Omit<AppState, "offsetTop" | "offsetLeft">>;
|
|
9
|
-
files: BinaryFiles | null;
|
|
10
|
-
maxWidthOrHeight?: number;
|
|
11
|
-
exportingFrame?: NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
12
|
-
getDimensions?: (width: number, height: number) => {
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
scale?: number;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare const exportToCanvas: ({ elements, appState, files, maxWidthOrHeight, getDimensions, exportPadding, exportingFrame, }: ExportOpts & {
|
|
19
|
-
exportPadding?: number;
|
|
20
|
-
}) => Promise<HTMLCanvasElement>;
|
|
21
|
-
export declare const exportToBlob: (opts: ExportOpts & {
|
|
22
|
-
mimeType?: string;
|
|
23
|
-
quality?: number;
|
|
24
|
-
exportPadding?: number;
|
|
25
|
-
}) => Promise<Blob>;
|
|
26
|
-
export declare const exportToSvg: ({ elements, appState, files, exportPadding, renderEmbeddables, exportingFrame, skipInliningFonts, reuseImages, }: Omit<ExportOpts, "getDimensions"> & {
|
|
27
|
-
exportPadding?: number;
|
|
28
|
-
renderEmbeddables?: boolean;
|
|
29
|
-
skipInliningFonts?: true;
|
|
30
|
-
reuseImages?: boolean;
|
|
31
|
-
}) => Promise<SVGSVGElement>;
|
|
32
|
-
export declare const exportToClipboard: (opts: ExportOpts & {
|
|
33
|
-
mimeType?: string;
|
|
34
|
-
quality?: number;
|
|
35
|
-
type: "png" | "svg" | "json";
|
|
36
|
-
}) => Promise<void>;
|