@excalidraw/math 0.18.0-1118751 → 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 +4 -0
- package/dist/types/common/src/utils.d.ts +12 -1
- package/dist/types/element/src/align.d.ts +4 -1
- package/dist/types/element/src/binding.d.ts +70 -0
- package/dist/types/element/src/bounds.d.ts +10 -2
- package/dist/types/element/src/collision.d.ts +13 -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 +2 -0
- package/dist/types/element/src/linearElementEditor.d.ts +4 -1
- package/dist/types/element/src/listMarker.d.ts +39 -0
- package/dist/types/element/src/newElement.d.ts +17 -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 +10 -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 +30 -3
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +56 -214
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +76 -16
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +20 -2
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +4 -564
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +14 -2
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +20 -2
- package/dist/types/excalidraw/actions/actionExport.d.ts +27 -9
- package/dist/types/excalidraw/actions/actionFrame.d.ts +71 -528
- package/dist/types/excalidraw/actions/actionGroup.d.ts +22 -4
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionProperties.d.ts +20 -2
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +11 -2
- package/dist/types/excalidraw/actions/actionStyles.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleMinimap.d.ts +201 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleShowHints.d.ts +198 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +10 -1
- package/dist/types/excalidraw/actions/actionToggleWrap.d.ts +12 -0
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +10 -1
- package/dist/types/excalidraw/actions/index.d.ts +3 -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 +9 -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.arrowText.d.ts +5 -39
- package/dist/types/excalidraw/components/App.clipboard.d.ts +31 -0
- package/dist/types/excalidraw/components/App.d.ts +79 -264
- package/dist/types/excalidraw/components/App.duplicate.d.ts +52 -2
- package/dist/types/excalidraw/components/App.host.d.ts +102 -0
- package/dist/types/excalidraw/components/App.modifiers.d.ts +38 -0
- package/dist/types/excalidraw/components/App.pan.d.ts +8 -0
- package/dist/types/excalidraw/components/App.selection.d.ts +265 -0
- package/dist/types/excalidraw/components/App.selectionTool.d.ts +93 -0
- package/dist/types/excalidraw/components/App.text.d.ts +146 -0
- package/dist/types/excalidraw/components/App.textTool.d.ts +140 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +64 -4
- 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/FileDropOverlay.d.ts +2 -0
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +6 -2
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +7 -2
- 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 +26 -2
- 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 +2 -0
- package/dist/types/excalidraw/data/blob.d.ts +34 -16
- package/dist/types/excalidraw/data/index.d.ts +3 -3
- package/dist/types/excalidraw/data/json.d.ts +17 -8
- 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 +83 -14
- package/dist/types/excalidraw/viewport.d.ts +23 -1
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +12 -1
- 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
|
@@ -108,12 +108,20 @@ export declare const zoomToFitBounds: ({ bounds, appState, canvasOffsets, fit, m
|
|
|
108
108
|
boxSelectionMode: import("./types").BoxSelectionMode;
|
|
109
109
|
bindingPreference: "enabled" | "disabled";
|
|
110
110
|
isMidpointSnappingEnabled: boolean;
|
|
111
|
+
showHints: boolean;
|
|
111
112
|
inputDevice: import("./types").InputDevice;
|
|
112
113
|
suggestedBinding: {
|
|
113
114
|
element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
|
|
114
115
|
midPoint?: import("@excalidraw/math").GlobalPoint;
|
|
115
116
|
} | null;
|
|
116
|
-
|
|
117
|
+
textToolHover: {
|
|
118
|
+
type: "text";
|
|
119
|
+
elementId: ExcalidrawElement["id"];
|
|
120
|
+
} | {
|
|
121
|
+
type: "container";
|
|
122
|
+
elementId: ExcalidrawElement["id"];
|
|
123
|
+
} | {
|
|
124
|
+
type: "arrow";
|
|
117
125
|
elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
|
|
118
126
|
anchor: "start" | "end" | "label";
|
|
119
127
|
} | null;
|
|
@@ -209,6 +217,7 @@ export declare const zoomToFitBounds: ({ bounds, appState, canvasOffsets, fit, m
|
|
|
209
217
|
duration?: number;
|
|
210
218
|
} | null;
|
|
211
219
|
zenModeEnabled: boolean;
|
|
220
|
+
minimapEnabled: boolean;
|
|
212
221
|
theme: import("@excalidraw/element/types").Theme;
|
|
213
222
|
gridSize: number;
|
|
214
223
|
gridStep: number;
|
|
@@ -274,6 +283,19 @@ export declare const centerScrollOn: ({ scenePoint, viewportDimensions, zoom, of
|
|
|
274
283
|
scrollX: number;
|
|
275
284
|
scrollY: number;
|
|
276
285
|
};
|
|
286
|
+
/**
|
|
287
|
+
* The scroll that brings `bounds` into the viewport — less `offsets` (screen
|
|
288
|
+
* px: UI covering its edges, room to leave) — by the least movement, keeping
|
|
289
|
+
* the zoom; `null` when they're in view already. Along an axis where they
|
|
290
|
+
* don't fit, their start (left / top) is brought in instead, or, with
|
|
291
|
+
* `tooLarge: "leave"`, that axis keeps its scroll.
|
|
292
|
+
*/
|
|
293
|
+
export declare const scrollBoundsIntoView: ({ bounds: [x1, y1, x2, y2], appState: { scrollX, scrollY, zoom, width, height }, offsets, tooLarge, }: {
|
|
294
|
+
bounds: Bounds;
|
|
295
|
+
appState: Pick<AppState, "scrollX" | "scrollY" | "zoom" | "width" | "height">;
|
|
296
|
+
offsets?: Offsets;
|
|
297
|
+
tooLarge?: "alignStart" | "leave";
|
|
298
|
+
}) => Pick<AppState, "scrollX" | "scrollY"> | null;
|
|
277
299
|
export declare const getScrollToContentState: (elements: readonly ExcalidrawElement[], appState: AppState) => {
|
|
278
300
|
scrollX: number;
|
|
279
301
|
scrollY: number;
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import type { ExcalidrawTextElement } from "@excalidraw/element/types";
|
|
2
2
|
import type App from "../components/App";
|
|
3
|
+
/**
|
|
4
|
+
* How much further than the browser's caret reveal the canvas pans, in
|
|
5
|
+
* screen px: text typed past the viewport's edge comes back with this much
|
|
6
|
+
* room to spare, instead of flush against the edge.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CARET_FOLLOW_PADDING = 5;
|
|
3
9
|
type SubmitHandler = () => void;
|
|
4
|
-
export declare const textWysiwyg: ({ onChange, onSubmit, getViewportCoords, element, canvas, excalidrawContainer, app, autoSelect, initialCaretSceneCoords, }: {
|
|
10
|
+
export declare const textWysiwyg: ({ onChange, onSubmit, getViewportCoords, element, canvas, excalidrawContainer, app, autoSelect, initialCaretSceneCoords, initialSelection, }: {
|
|
5
11
|
/**
|
|
6
12
|
* textWysiwyg only deals with `originalText`
|
|
7
13
|
*
|
|
@@ -23,5 +29,10 @@ export declare const textWysiwyg: ({ onChange, onSubmit, getViewportCoords, elem
|
|
|
23
29
|
x: number;
|
|
24
30
|
y: number;
|
|
25
31
|
} | null;
|
|
32
|
+
/** range of `originalText` to select (takes precedence over the caret) */
|
|
33
|
+
initialSelection?: {
|
|
34
|
+
start: number;
|
|
35
|
+
end: number;
|
|
36
|
+
} | null;
|
|
26
37
|
}) => SubmitHandler;
|
|
27
38
|
export {};
|
|
@@ -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>;
|