@zsviczian/excalidraw 0.18.0-11 → 0.18.0-13
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/excalidraw.development.js +103 -70
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/styles.development.css +16 -0
- package/dist/styles.production.css +1 -0
- package/package.json +1 -1
- package/types/common/src/constants.d.ts +1 -0
- package/types/{excalidraw/scene → element/src}/Scene.d.ts +8 -11
- package/types/element/src/align.d.ts +3 -3
- package/types/element/src/binding.d.ts +18 -10
- package/types/element/src/dragElements.d.ts +3 -2
- package/types/element/src/elbowArrow.d.ts +1 -1
- package/types/element/src/flowchart.d.ts +3 -2
- package/types/element/src/fractionalIndex.d.ts +2 -2
- package/types/element/src/frame.d.ts +1 -1
- package/types/element/src/linearElementEditor.d.ts +13 -13
- package/types/element/src/mutateElement.d.ts +10 -2
- package/types/element/src/newElement.d.ts +2 -2
- package/types/element/src/resizeElements.d.ts +5 -5
- package/types/element/src/sizeHelpers.d.ts +0 -1
- package/types/element/src/textElement.d.ts +4 -3
- package/types/element/src/typeChecks.d.ts +3 -0
- package/types/element/src/types.d.ts +3 -0
- package/types/element/src/zindex.d.ts +3 -3
- package/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -3
- package/types/excalidraw/actions/actionBoundText.d.ts +2 -2
- package/types/excalidraw/actions/actionCanvas.d.ts +30 -30
- package/types/excalidraw/actions/actionClipboard.d.ts +6 -6
- package/types/excalidraw/actions/actionCropEditor.d.ts +1 -1
- package/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
- package/types/excalidraw/actions/actionElementLink.d.ts +1 -1
- package/types/excalidraw/actions/actionElementLock.d.ts +2 -2
- package/types/excalidraw/actions/actionEmbeddable.d.ts +1 -1
- package/types/excalidraw/actions/actionExport.d.ts +32 -32
- package/types/excalidraw/actions/actionFinalize.d.ts +2 -2
- package/types/excalidraw/actions/actionFrame.d.ts +6 -6
- package/types/excalidraw/actions/actionGroup.d.ts +2 -2
- package/types/excalidraw/actions/actionLinearEditor.d.ts +1 -1
- package/types/excalidraw/actions/actionMenu.d.ts +1 -1
- package/types/excalidraw/actions/actionNavigate.d.ts +1 -1
- package/types/excalidraw/actions/actionProperties.d.ts +17 -17
- package/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
- package/types/excalidraw/actions/actionStyles.d.ts +1 -1
- package/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
- package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
- package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +2 -2
- package/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
- package/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
- package/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -1
- package/types/excalidraw/actions/actionZindex.d.ts +2 -2
- package/types/excalidraw/actions/types.d.ts +2 -2
- package/types/excalidraw/appState.d.ts +15 -15
- package/types/excalidraw/components/App.d.ts +6 -1
- package/types/excalidraw/components/ConvertElementTypePopup.d.ts +49 -0
- package/types/excalidraw/components/ElementLinkDialog.d.ts +4 -3
- package/types/excalidraw/components/Stats/Angle.d.ts +1 -1
- package/types/excalidraw/components/Stats/CanvasGrid.d.ts +1 -1
- package/types/excalidraw/components/Stats/CanvasGridSize.d.ts +1 -1
- package/types/excalidraw/components/Stats/Dimension.d.ts +1 -1
- package/types/excalidraw/components/Stats/DragInput.d.ts +1 -1
- package/types/excalidraw/components/Stats/FontSize.d.ts +1 -1
- package/types/excalidraw/components/Stats/MultiAngle.d.ts +1 -1
- package/types/excalidraw/components/Stats/MultiDimension.d.ts +1 -1
- package/types/excalidraw/components/Stats/MultiFontSize.d.ts +1 -1
- package/types/excalidraw/components/Stats/MultiPosition.d.ts +1 -1
- package/types/excalidraw/components/Stats/Position.d.ts +1 -1
- package/types/excalidraw/components/Stats/utils.d.ts +4 -11
- package/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
- package/types/excalidraw/editor-jotai.d.ts +6 -6
- package/types/excalidraw/fonts/Fonts.d.ts +1 -1
- package/types/excalidraw/scene/Renderer.d.ts +1 -1
- package/types/excalidraw/scene/types.d.ts +2 -0
- package/types/excalidraw/types.d.ts +2 -0
- package/types/excalidraw/wysiwyg/textWysiwyg.d.ts +3 -1
|
@@ -1493,6 +1493,22 @@
|
|
|
1493
1493
|
.excalidraw-hyperlinkContainer__buttons {
|
|
1494
1494
|
flex: 0 0 auto;
|
|
1495
1495
|
}
|
|
1496
|
+
/*!********************************************************************************************************************************************************************************************************************!*\
|
|
1497
|
+
!*** css ../../node_modules/css-loader/dist/cjs.js!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!../../node_modules/sass-loader/dist/cjs.js!./components/ConvertElementTypePopup.scss ***!
|
|
1498
|
+
\********************************************************************************************************************************************************************************************************************/
|
|
1499
|
+
.excalidraw .ConvertElementTypePopup {
|
|
1500
|
+
display: flex;
|
|
1501
|
+
flex-wrap: wrap;
|
|
1502
|
+
justify-content: center;
|
|
1503
|
+
gap: 0.2rem;
|
|
1504
|
+
border-radius: 0.5rem;
|
|
1505
|
+
background: var(--island-bg-color);
|
|
1506
|
+
box-shadow: var(--shadow-island);
|
|
1507
|
+
padding: 0.5rem;
|
|
1508
|
+
}
|
|
1509
|
+
.excalidraw .ConvertElementTypePopup:focus {
|
|
1510
|
+
outline: none;
|
|
1511
|
+
}
|
|
1496
1512
|
/*!***************************************************************************************************************************************************************************************************************!*\
|
|
1497
1513
|
!*** css ../../node_modules/css-loader/dist/cjs.js!../../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[0].use[2]!../../node_modules/sass-loader/dist/cjs.js!./components/DialogActionButton.scss ***!
|
|
1498
1514
|
\***************************************************************************************************************************************************************************************************************/
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
.excalidraw-tooltip{--ui-font: Assistant, system-ui, BlinkMacSystemFont, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;font-family:var(--ui-font);position:absolute;z-index:var(--zIndex-popup);padding:8px;border-radius:6px;box-sizing:border-box;pointer-events:none;word-wrap:break-word;background:#000;line-height:1.5;text-align:center;font-size:13px;font-weight:500;color:#fff;display:none}.excalidraw-tooltip.excalidraw-tooltip--visible{display:block}.excalidraw-tooltip-wrapper{display:flex}.excalidraw-tooltip-icon{width:.9em;height:.9em;margin-left:5px;margin-top:1px;display:flex}.excalidraw--mobile.excalidraw-tooltip-icon{display:none}
|
|
17
17
|
.excalidraw .Avatar{width:var(--avatar-size, 1.5rem);height:var(--avatar-size, 1.5rem);position:relative;border-radius:100%;outline-offset:2px;display:flex;justify-content:center;align-items:center;cursor:pointer;font-size:.75rem;font-weight:700;line-height:1;color:var(--color-gray-90);flex:0 0 auto}.excalidraw .Avatar:active{transform:scale(0.94)}.excalidraw .Avatar-img{width:100%;height:100%;border-radius:100%}.excalidraw .Avatar::before{content:"";position:absolute;top:-3px;right:-3px;bottom:-3px;left:-3px;border-radius:100%}.excalidraw .Avatar.is-followed::before{border-color:var(--color-primary-hover);box-shadow:0 0 0 1px var(--color-primary-hover)}.excalidraw .Avatar.is-current-user{cursor:auto}
|
|
18
18
|
.excalidraw-hyperlinkContainer{display:flex;align-items:center;justify-content:space-between;position:absolute;box-shadow:0px 2px 4px 0 rgba(0,0,0,.3);z-index:var(--zIndex-hyperlinkContainer);background:var(--island-bg-color);border-radius:var(--border-radius-md);box-sizing:border-box;min-height:42px}.excalidraw-hyperlinkContainer-input,.excalidraw-hyperlinkContainer button{z-index:100}.excalidraw-hyperlinkContainer-input,.excalidraw-hyperlinkContainer-link{height:24px;padding:0 8px;line-height:24px;font-size:.9rem;font-weight:500;font-family:var(--ui-font)}.excalidraw-hyperlinkContainer-input{width:18rem;border:none;background-color:rgba(0,0,0,0);color:var(--text-primary-color);outline:none;border:none;box-shadow:none !important}.excalidraw-hyperlinkContainer-link{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:15rem}.excalidraw-hyperlinkContainer button{color:#228be6;background-color:rgba(0,0,0,0) !important;font-weight:500}.excalidraw-hyperlinkContainer button.excalidraw-hyperlinkContainer--remove{color:#c92a2a}.excalidraw-hyperlinkContainer--remove .ToolIcon__icon svg{color:#fa5252}.excalidraw-hyperlinkContainer .ToolIcon__icon{width:2rem;height:2rem}.excalidraw-hyperlinkContainer__buttons{flex:0 0 auto}
|
|
19
|
+
.excalidraw .ConvertElementTypePopup{display:flex;flex-wrap:wrap;justify-content:center;gap:.2rem;border-radius:.5rem;background:var(--island-bg-color);box-shadow:var(--shadow-island);padding:.5rem}.excalidraw .ConvertElementTypePopup:focus{outline:none}
|
|
19
20
|
.excalidraw .Dialog__action-button{position:relative;display:flex;column-gap:.5rem;align-items:center;padding:.5rem 1.5rem;border:1px solid var(--default-border-color);background-color:rgba(0,0,0,0);height:3rem;border-radius:var(--border-radius-lg);letter-spacing:.4px;color:inherit;font-family:inherit;font-size:.875rem;font-weight:600;-webkit-user-select:none;user-select:none}.excalidraw .Dialog__action-button svg{display:block;width:1rem;height:1rem}.excalidraw .Dialog__action-button--danger{background-color:var(--color-danger);border-color:var(--color-danger);color:#fff}.excalidraw .Dialog__action-button--primary{background-color:var(--color-primary);border-color:var(--color-primary);color:#fff}.excalidraw.theme--dark .Dialog__action-button--danger{color:var(--color-gray-100)}.excalidraw.theme--dark .Dialog__action-button--primary{color:var(--color-gray-100)}
|
|
20
21
|
.excalidraw .confirm-dialog-buttons{display:flex;column-gap:.5rem;justify-content:flex-end}
|
|
21
22
|
.excalidraw .publish-library__fields{display:flex;flex-direction:column}.excalidraw .publish-library__fields label{padding:1em 0;display:flex;justify-content:space-between;align-items:center}.excalidraw .publish-library__fields label span{font-weight:500;font-size:1rem;color:#868e96}.excalidraw .publish-library__fields label input,.excalidraw .publish-library__fields label textarea{width:70%;padding:.6em;font-family:var(--ui-font)}.excalidraw .publish-library__fields label .required{color:#e03131;margin:.2rem}.excalidraw .publish-library__buttons{display:flex;padding:.2rem 0;justify-content:flex-end;gap:.5rem}.excalidraw .publish-library__buttons .ToolIcon__icon{min-width:2.5rem;width:auto;font-size:1rem}.excalidraw .publish-library__buttons .ToolIcon_type_button{margin-left:1rem;padding:0 .5rem}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button{background-color:#228be6}.excalidraw .publish-library__buttons--confirm.ToolIcon_type_button:hover{background-color:#1971c2}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button{background-color:#adb5bd}.excalidraw .publish-library__buttons--cancel.ToolIcon_type_button:hover{background-color:#868e96}.excalidraw .publish-library__buttons .ToolIcon__icon{color:#fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner{--spinner-color: #fff}.excalidraw .publish-library__buttons .ToolIcon__icon .Spinner svg{padding:.5rem}.excalidraw .publish-library .selected-library-items{display:flex;flex-wrap:wrap}.excalidraw .publish-library .selected-library-items .single-library-item-wrapper{width:9rem}.excalidraw .publish-library-warning{color:#fa5252}.excalidraw .publish-library-note{padding:1em 0;font-style:italic;font-size:14px;display:block}.excalidraw .single-library-item{position:relative}.excalidraw .single-library-item-status{position:absolute;top:.3rem;left:.3rem;font-size:.7rem;color:#f03e3e;background:rgba(255,255,255,.9);padding:.1rem .2rem;border-radius:.2rem}.excalidraw .single-library-item__svg{background-color:#fff;padding:.3rem;width:7.5rem;height:7.5rem;border:1px solid var(--button-gray-2)}.excalidraw .single-library-item__svg svg{width:100%;height:100%}.excalidraw .single-library-item .ToolIcon__icon{background-color:#fff;width:auto;height:auto;margin:0 .5rem}.excalidraw .single-library-item .ToolIcon,.excalidraw .single-library-item .ToolIcon_type_button:hover{background-color:#fff}.excalidraw .single-library-item .required,.excalidraw .single-library-item .error{color:#e03131;font-weight:700;font-size:1rem;margin:.2rem}.excalidraw .single-library-item .error{font-weight:500;margin:0;padding:.3em 0}.excalidraw .single-library-item--remove{position:absolute;top:.2rem;right:1rem}.excalidraw .single-library-item--remove .ToolIcon__icon{margin:0}.excalidraw .single-library-item--remove .ToolIcon__icon{background-color:#fa5252}.excalidraw .single-library-item--remove .ToolIcon__icon:hover{background-color:#f03e3e}.excalidraw .single-library-item--remove .ToolIcon__icon:active{background-color:#e03131}.excalidraw .single-library-item--remove svg{color:#fff;padding:.26rem;border-radius:.3em;width:1rem;height:1rem}
|
package/package.json
CHANGED
|
@@ -90,6 +90,7 @@ export declare const CLASSES: {
|
|
|
90
90
|
MOBILE_TOOLBAR: string;
|
|
91
91
|
ZOOM_ACTIONS: string;
|
|
92
92
|
SEARCH_MENU_INPUT_WRAPPER: string;
|
|
93
|
+
CONVERT_ELEMENT_TYPE_POPUP: string;
|
|
93
94
|
};
|
|
94
95
|
export declare const CJK_HAND_DRAWN_FALLBACK_FONT = "Xiaolai";
|
|
95
96
|
export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ElementUpdate } from "@excalidraw/element/mutateElement";
|
|
2
2
|
import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawFrameLikeElement, ElementsMapOrArray, OrderedExcalidrawElement, Ordered } from "@excalidraw/element/types";
|
|
3
|
-
import type {
|
|
4
|
-
type
|
|
5
|
-
type ElementKey = ExcalidrawElement | ElementIdKey;
|
|
3
|
+
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
4
|
+
import type { AppState } from "../../excalidraw/types";
|
|
6
5
|
type SceneStateCallback = () => void;
|
|
7
6
|
type SceneStateCallbackRemover = () => void;
|
|
8
7
|
export type ExcalidrawElementsIncludingDeleted = readonly ExcalidrawElement[];
|
|
9
8
|
declare class Scene {
|
|
10
|
-
private static sceneMapByElement;
|
|
11
|
-
private static sceneMapById;
|
|
12
|
-
static mapElementToScene(elementKey: ElementKey, scene: Scene): void;
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated pass down `app.scene` and use it directly
|
|
15
|
-
*/
|
|
16
|
-
static getScene(elementKey: ElementKey): Scene | null;
|
|
17
9
|
private callbacks;
|
|
18
10
|
private nonDeletedElements;
|
|
19
11
|
private nonDeletedElementsMap;
|
|
@@ -35,6 +27,7 @@ declare class Scene {
|
|
|
35
27
|
getElementsMapIncludingDeleted(): Map<string, Ordered<ExcalidrawElement>> & import("@excalidraw/common/utility-types").MakeBrand<"SceneElementsMap">;
|
|
36
28
|
getNonDeletedElements(): readonly Ordered<NonDeletedExcalidrawElement>[];
|
|
37
29
|
getFramesIncludingDeleted(): readonly ExcalidrawFrameLikeElement[];
|
|
30
|
+
constructor(elements?: ElementsMapOrArray | null);
|
|
38
31
|
getSelectedElements(opts: {
|
|
39
32
|
selectedElementIds: AppState["selectedElementIds"];
|
|
40
33
|
/**
|
|
@@ -75,5 +68,9 @@ declare class Scene {
|
|
|
75
68
|
containerId: ExcalidrawElement["id"] | null;
|
|
76
69
|
}) | null) => import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement | null;
|
|
77
70
|
getElementsFromId: (id: string) => ExcalidrawElement[];
|
|
71
|
+
mutateElement<TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, options?: {
|
|
72
|
+
informMutation: boolean;
|
|
73
|
+
isDragging: boolean;
|
|
74
|
+
}): TElement;
|
|
78
75
|
}
|
|
79
76
|
export default Scene;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type Scene from "
|
|
2
|
-
import type {
|
|
1
|
+
import type Scene from "./Scene";
|
|
2
|
+
import type { ExcalidrawElement } from "./types";
|
|
3
3
|
export interface Alignment {
|
|
4
4
|
position: "start" | "center" | "end";
|
|
5
5
|
axis: "x" | "y";
|
|
6
6
|
}
|
|
7
|
-
export declare const alignElements: (selectedElements: ExcalidrawElement[],
|
|
7
|
+
export declare const alignElements: (selectedElements: ExcalidrawElement[], alignment: Alignment, scene: Scene) => ExcalidrawElement[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type GlobalPoint } from "@excalidraw/math";
|
|
2
2
|
import type { LocalPoint } from "@excalidraw/math";
|
|
3
|
-
import type Scene from "@excalidraw/excalidraw/scene/Scene";
|
|
4
3
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
5
4
|
import { type Heading } from "./heading";
|
|
5
|
+
import type Scene from "./Scene";
|
|
6
6
|
import type { Bounds } from "./bounds";
|
|
7
7
|
import type { ElementUpdate } from "./mutateElement";
|
|
8
|
-
import type { ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, ExcalidrawLinearElement, NonDeletedExcalidrawElement, ElementsMap, NonDeletedSceneElementsMap,
|
|
8
|
+
import type { ExcalidrawBindableElement, ExcalidrawElement, NonDeleted, ExcalidrawLinearElement, NonDeletedExcalidrawElement, ElementsMap, NonDeletedSceneElementsMap, ExcalidrawElbowArrowElement, FixedPoint } from "./types";
|
|
9
9
|
export type SuggestedBinding = NonDeleted<ExcalidrawBindableElement> | SuggestedPointBinding;
|
|
10
10
|
export type SuggestedPointBinding = [
|
|
11
11
|
NonDeleted<ExcalidrawLinearElement>,
|
|
@@ -17,32 +17,40 @@ export declare const isBindingEnabled: (appState: AppState) => boolean;
|
|
|
17
17
|
export declare const FIXED_BINDING_DISTANCE = 5;
|
|
18
18
|
export declare const BINDING_HIGHLIGHT_THICKNESS = 10;
|
|
19
19
|
export declare const BINDING_HIGHLIGHT_OFFSET = 4;
|
|
20
|
-
export declare const bindOrUnbindLinearElement: (linearElement: NonDeleted<ExcalidrawLinearElement>, startBindingElement: ExcalidrawBindableElement | null | "keep", endBindingElement: ExcalidrawBindableElement | null | "keep",
|
|
21
|
-
export declare const bindOrUnbindLinearElements: (selectedElements: NonDeleted<ExcalidrawLinearElement>[],
|
|
20
|
+
export declare const bindOrUnbindLinearElement: (linearElement: NonDeleted<ExcalidrawLinearElement>, startBindingElement: ExcalidrawBindableElement | null | "keep", endBindingElement: ExcalidrawBindableElement | null | "keep", scene: Scene) => void;
|
|
21
|
+
export declare const bindOrUnbindLinearElements: (selectedElements: NonDeleted<ExcalidrawLinearElement>[], isBindingEnabled: boolean, draggingPoints: readonly number[] | null, scene: Scene, zoom?: AppState["zoom"]) => void;
|
|
22
22
|
export declare const getSuggestedBindingsForArrows: (selectedElements: NonDeleted<ExcalidrawElement>[], elementsMap: NonDeletedSceneElementsMap, zoom: AppState["zoom"]) => SuggestedBinding[];
|
|
23
23
|
export declare const maybeBindLinearElement: (linearElement: NonDeleted<ExcalidrawLinearElement>, appState: AppState, pointerCoords: {
|
|
24
24
|
x: number;
|
|
25
25
|
y: number;
|
|
26
|
-
},
|
|
27
|
-
export declare const bindLinearElement: (linearElement: NonDeleted<ExcalidrawLinearElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end",
|
|
26
|
+
}, scene: Scene) => void;
|
|
27
|
+
export declare const bindLinearElement: (linearElement: NonDeleted<ExcalidrawLinearElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", scene: Scene) => void;
|
|
28
28
|
export declare const isLinearElementSimpleAndAlreadyBound: (linearElement: NonDeleted<ExcalidrawLinearElement>, alreadyBoundToId: ExcalidrawBindableElement["id"] | undefined, bindableElement: ExcalidrawBindableElement) => boolean;
|
|
29
29
|
export declare const getHoveredElementForBinding: (pointerCoords: {
|
|
30
30
|
x: number;
|
|
31
31
|
y: number;
|
|
32
32
|
}, elements: readonly NonDeletedExcalidrawElement[], elementsMap: NonDeletedSceneElementsMap, zoom?: AppState["zoom"], fullShape?: boolean, considerAllElements?: boolean) => NonDeleted<ExcalidrawBindableElement> | null;
|
|
33
|
-
export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawElement,
|
|
33
|
+
export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawElement, scene: Scene, options?: {
|
|
34
34
|
simultaneouslyUpdated?: readonly ExcalidrawElement[];
|
|
35
35
|
newSize?: {
|
|
36
36
|
width: number;
|
|
37
37
|
height: number;
|
|
38
38
|
};
|
|
39
|
-
changedElements?: Map<string,
|
|
39
|
+
changedElements?: Map<string, ExcalidrawElement>;
|
|
40
40
|
}) => void;
|
|
41
|
-
export declare const
|
|
41
|
+
export declare const updateBindings: (latestElement: ExcalidrawElement, scene: Scene, options?: {
|
|
42
|
+
simultaneouslyUpdated?: readonly ExcalidrawElement[];
|
|
43
|
+
newSize?: {
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
};
|
|
47
|
+
zoom?: AppState["zoom"];
|
|
48
|
+
}) => void;
|
|
49
|
+
export declare const getHeadingForElbowArrowSnap: (p: Readonly<GlobalPoint>, otherPoint: Readonly<GlobalPoint>, bindableElement: ExcalidrawBindableElement | undefined | null, aabb: Bounds | undefined | null, origPoint: GlobalPoint, zoom?: AppState["zoom"]) => Heading;
|
|
42
50
|
export declare const bindPointToSnapToElementOutline: (arrow: ExcalidrawElbowArrowElement, bindableElement: ExcalidrawBindableElement, startOrEnd: "start" | "end") => GlobalPoint;
|
|
43
51
|
export declare const avoidRectangularCorner: (element: ExcalidrawBindableElement, p: GlobalPoint) => GlobalPoint;
|
|
44
52
|
export declare const snapToMid: (element: ExcalidrawBindableElement, p: GlobalPoint, tolerance?: number) => GlobalPoint;
|
|
45
|
-
export declare const calculateFixedPointForElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawElbowArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end"
|
|
53
|
+
export declare const calculateFixedPointForElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawElbowArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end") => {
|
|
46
54
|
fixedPoint: FixedPoint;
|
|
47
55
|
};
|
|
48
56
|
export declare const fixDuplicatedBindingsAfterDuplication: (duplicatedElements: ExcalidrawElement[], origIdToDuplicateId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>, duplicateElementsMap: NonDeletedSceneElementsMap) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AppState, NormalizedZoomValue, NullableGridSize, PointerDownState } from "@excalidraw/excalidraw/types";
|
|
2
|
-
import type Scene from "@excalidraw/excalidraw/scene/Scene";
|
|
3
2
|
import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
|
|
3
|
+
import type Scene from "./Scene";
|
|
4
4
|
export declare const dragSelectedElements: (pointerDownState: PointerDownState, _selectedElements: NonDeletedExcalidrawElement[], offset: {
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
@@ -9,7 +9,7 @@ export declare const dragSelectedElements: (pointerDownState: PointerDownState,
|
|
|
9
9
|
y: number;
|
|
10
10
|
}, gridSize: NullableGridSize) => void;
|
|
11
11
|
export declare const getDragOffsetXY: (selectedElements: NonDeletedExcalidrawElement[], x: number, y: number) => [number, number];
|
|
12
|
-
export declare const dragNewElement: ({ newElement, elementType, originX, originY, x, y, width, height, shouldMaintainAspectRatio, shouldResizeFromCenter, zoom, widthAspectRatio, originOffset, informMutation, }: {
|
|
12
|
+
export declare const dragNewElement: ({ newElement, elementType, originX, originY, x, y, width, height, shouldMaintainAspectRatio, shouldResizeFromCenter, zoom, scene, widthAspectRatio, originOffset, informMutation, }: {
|
|
13
13
|
newElement: NonDeletedExcalidrawElement;
|
|
14
14
|
elementType: AppState["activeTool"]["type"];
|
|
15
15
|
originX: number;
|
|
@@ -21,6 +21,7 @@ export declare const dragNewElement: ({ newElement, elementType, originX, origin
|
|
|
21
21
|
shouldMaintainAspectRatio: boolean;
|
|
22
22
|
shouldResizeFromCenter: boolean;
|
|
23
23
|
zoom: NormalizedZoomValue;
|
|
24
|
+
scene: Scene;
|
|
24
25
|
/** whether to keep given aspect ratio when `isResizeWithSidesSameLength` is
|
|
25
26
|
true */
|
|
26
27
|
widthAspectRatio?: number | null | undefined;
|
|
@@ -8,7 +8,7 @@ export declare const BASE_PADDING = 40;
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const updateElbowArrowPoints: (arrow: Readonly<ExcalidrawElbowArrowElement>, elementsMap: NonDeletedSceneElementsMap, updates: {
|
|
10
10
|
points?: readonly LocalPoint[];
|
|
11
|
-
fixedSegments?: FixedSegment[] | null;
|
|
11
|
+
fixedSegments?: readonly FixedSegment[] | null;
|
|
12
12
|
startBinding?: FixedPointBinding | null;
|
|
13
13
|
endBinding?: FixedPointBinding | null;
|
|
14
14
|
}, options?: {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { AppState, PendingExcalidrawElements } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import { type ElementsMap, type ExcalidrawBindableElement, type ExcalidrawElement, type ExcalidrawFlowchartNodeElement } from "./types";
|
|
3
|
+
import type Scene from "./Scene";
|
|
3
4
|
type LinkDirection = "up" | "right" | "down" | "left";
|
|
4
5
|
export declare const getLinkDirectionFromKey: (key: string) => LinkDirection;
|
|
5
6
|
export declare const getPredecessors: (node: ExcalidrawBindableElement, elementsMap: ElementsMap, direction: LinkDirection) => ExcalidrawBindableElement[];
|
|
6
|
-
export declare const addNewNodes: (startNode: ExcalidrawFlowchartNodeElement,
|
|
7
|
+
export declare const addNewNodes: (startNode: ExcalidrawFlowchartNodeElement, appState: AppState, direction: LinkDirection, scene: Scene, numberOfNodes: number) => ExcalidrawElement[];
|
|
7
8
|
export declare class FlowChartNavigator {
|
|
8
9
|
isExploring: boolean;
|
|
9
10
|
private sameLevelNodes;
|
|
@@ -18,7 +19,7 @@ export declare class FlowChartCreator {
|
|
|
18
19
|
private numberOfNodes;
|
|
19
20
|
private direction;
|
|
20
21
|
pendingNodes: PendingExcalidrawElements | null;
|
|
21
|
-
createNodes(startNode: ExcalidrawFlowchartNodeElement,
|
|
22
|
+
createNodes(startNode: ExcalidrawFlowchartNodeElement, appState: AppState, direction: LinkDirection, scene: Scene): void;
|
|
22
23
|
clear(): void;
|
|
23
24
|
}
|
|
24
25
|
export declare const isNodeInFlowchart: (element: ExcalidrawFlowchartNodeElement, elementsMap: ElementsMap) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExcalidrawElement, OrderedExcalidrawElement } from "./types";
|
|
1
|
+
import type { ElementsMap, ExcalidrawElement, OrderedExcalidrawElement } from "./types";
|
|
2
2
|
export declare class InvalidFractionalIndexError extends Error {
|
|
3
3
|
code: "ELEMENT_HAS_INVALID_INDEX";
|
|
4
4
|
}
|
|
@@ -42,7 +42,7 @@ export declare const orderByFractionalIndex: (elements: OrderedExcalidrawElement
|
|
|
42
42
|
* Synchronizes invalid fractional indices of moved elements with the array order by mutating passed elements.
|
|
43
43
|
* If the synchronization fails or the result is invalid, it fallbacks to `syncInvalidIndices`.
|
|
44
44
|
*/
|
|
45
|
-
export declare const syncMovedIndices: (elements: readonly ExcalidrawElement[], movedElements:
|
|
45
|
+
export declare const syncMovedIndices: (elements: readonly ExcalidrawElement[], movedElements: ElementsMap) => OrderedExcalidrawElement[];
|
|
46
46
|
/**
|
|
47
47
|
* Synchronizes all invalid fractional indices with the array order by mutating passed elements.
|
|
48
48
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ExcalidrawElementsIncludingDeleted } from "@excalidraw/excalidraw/scene/Scene";
|
|
2
1
|
import type { AppClassProperties, AppState, StaticCanvasAppState } from "@excalidraw/excalidraw/types";
|
|
3
2
|
import type { ReadonlySetLike } from "@excalidraw/common/utility-types";
|
|
3
|
+
import type { ExcalidrawElementsIncludingDeleted } from "./Scene";
|
|
4
4
|
import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted, NonDeletedExcalidrawElement } from "./types";
|
|
5
5
|
export declare const bindElementsToFramesAfterDuplication: (nextElements: readonly ExcalidrawElement[], origElements: readonly ExcalidrawElement[], origIdToDuplicateId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>) => void;
|
|
6
6
|
export declare function isElementIntersectingFrame(element: ExcalidrawElement, frame: ExcalidrawFrameLikeElement, elementsMap: ElementsMap): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
|
|
2
|
-
import Scene from "@excalidraw/excalidraw/scene/Scene";
|
|
3
2
|
import type { Store } from "@excalidraw/excalidraw/store";
|
|
4
3
|
import type { AppState, PointerCoords, InteractiveCanvasAppState, AppClassProperties, NullableGridSize, Zoom } from "@excalidraw/excalidraw/types";
|
|
4
|
+
import type Scene from "./Scene";
|
|
5
5
|
import type { Bounds } from "./bounds";
|
|
6
|
-
import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap,
|
|
6
|
+
import type { NonDeleted, ExcalidrawLinearElement, ExcalidrawElement, PointBinding, ExcalidrawBindableElement, ExcalidrawTextElementWithContainer, ElementsMap, NonDeletedSceneElementsMap, ExcalidrawElbowArrowElement } from "./types";
|
|
7
7
|
declare const editorMidPointsCache: {
|
|
8
8
|
version: number | null;
|
|
9
9
|
points: (GlobalPoint | null)[];
|
|
@@ -42,7 +42,7 @@ export declare class LinearElementEditor {
|
|
|
42
42
|
readonly hoverPointIndex: number;
|
|
43
43
|
readonly segmentMidPointHoveredCoords: GlobalPoint | null;
|
|
44
44
|
readonly elbowed: boolean;
|
|
45
|
-
constructor(element: NonDeleted<ExcalidrawLinearElement
|
|
45
|
+
constructor(element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap);
|
|
46
46
|
static POINT_HANDLE_SIZE: number;
|
|
47
47
|
/**
|
|
48
48
|
* @param id the `elementId` from the instance of this class (so that we can
|
|
@@ -76,7 +76,7 @@ export declare class LinearElementEditor {
|
|
|
76
76
|
linearElementEditor: LinearElementEditor | null;
|
|
77
77
|
};
|
|
78
78
|
static arePointsEqual<Point extends LocalPoint | GlobalPoint>(point1: Point | null, point2: Point | null): boolean;
|
|
79
|
-
static handlePointerMove(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number, app: AppClassProperties
|
|
79
|
+
static handlePointerMove(event: React.PointerEvent<HTMLCanvasElement>, scenePointerX: number, scenePointerY: number, app: AppClassProperties): LinearElementEditor | null;
|
|
80
80
|
/** scene coords */
|
|
81
81
|
static getPointGlobalCoordinates(element: NonDeleted<ExcalidrawLinearElement>, p: LocalPoint, elementsMap: ElementsMap): GlobalPoint;
|
|
82
82
|
/** scene coords */
|
|
@@ -96,22 +96,22 @@ export declare class LinearElementEditor {
|
|
|
96
96
|
x: number;
|
|
97
97
|
y: number;
|
|
98
98
|
};
|
|
99
|
-
static normalizePoints(element: NonDeleted<ExcalidrawLinearElement
|
|
100
|
-
static duplicateSelectedPoints(appState: AppState,
|
|
101
|
-
static deletePoints(element: NonDeleted<ExcalidrawLinearElement>, pointIndices: readonly number[]): void;
|
|
102
|
-
static addPoints(element: NonDeleted<ExcalidrawLinearElement>, targetPoints: {
|
|
99
|
+
static normalizePoints(element: NonDeleted<ExcalidrawLinearElement>, elementsMap: ElementsMap): void;
|
|
100
|
+
static duplicateSelectedPoints(appState: AppState, scene: Scene): AppState;
|
|
101
|
+
static deletePoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene, pointIndices: readonly number[]): void;
|
|
102
|
+
static addPoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene, targetPoints: {
|
|
103
103
|
point: LocalPoint;
|
|
104
104
|
}[]): void;
|
|
105
|
-
static movePoints(element: NonDeleted<ExcalidrawLinearElement>, targetPoints: {
|
|
105
|
+
static movePoints(element: NonDeleted<ExcalidrawLinearElement>, scene: Scene, targetPoints: {
|
|
106
106
|
index: number;
|
|
107
107
|
point: LocalPoint;
|
|
108
108
|
isDragging?: boolean;
|
|
109
109
|
}[], otherUpdates?: {
|
|
110
110
|
startBinding?: PointBinding | null;
|
|
111
111
|
endBinding?: PointBinding | null;
|
|
112
|
-
}
|
|
112
|
+
}): void;
|
|
113
113
|
static shouldAddMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, appState: AppState, elementsMap: ElementsMap): boolean;
|
|
114
|
-
static addMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, app: AppClassProperties, snapToGrid: boolean,
|
|
114
|
+
static addMidpoint(linearElementEditor: LinearElementEditor, pointerCoords: PointerCoords, app: AppClassProperties, snapToGrid: boolean, scene: Scene): {
|
|
115
115
|
pointerDownState: LinearElementEditor["pointerDownState"];
|
|
116
116
|
selectedPointsIndices: LinearElementEditor["selectedPointsIndices"];
|
|
117
117
|
} | undefined;
|
|
@@ -123,7 +123,7 @@ export declare class LinearElementEditor {
|
|
|
123
123
|
};
|
|
124
124
|
static getMinMaxXYWithBoundText: (element: ExcalidrawLinearElement, elementsMap: ElementsMap, elementBounds: Bounds, boundTextElement: ExcalidrawTextElementWithContainer) => [number, number, number, number, number, number];
|
|
125
125
|
static getElementAbsoluteCoords: (element: ExcalidrawLinearElement, elementsMap: ElementsMap, includeBoundText?: boolean) => [number, number, number, number, number, number];
|
|
126
|
-
static moveFixedSegment(linearElement: LinearElementEditor, index: number, x: number, y: number,
|
|
127
|
-
static deleteFixedSegment(element: ExcalidrawElbowArrowElement, index: number): void;
|
|
126
|
+
static moveFixedSegment(linearElement: LinearElementEditor, index: number, x: number, y: number, scene: Scene): LinearElementEditor;
|
|
127
|
+
static deleteFixedSegment(element: ExcalidrawElbowArrowElement, scene: Scene, index: number): void;
|
|
128
128
|
}
|
|
129
129
|
export {};
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
2
|
-
import type { ExcalidrawElement } from "./types";
|
|
2
|
+
import type { ElementsMap, ExcalidrawElement } from "./types";
|
|
3
3
|
export type ElementUpdate<TElement extends ExcalidrawElement> = Omit<Partial<TElement>, "id" | "version" | "versionNonce" | "updated">;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* This function tracks updates of text elements for the purposes for collaboration.
|
|
6
|
+
* The version is used to compare updates when more than one user is working in
|
|
7
|
+
* the same drawing.
|
|
8
|
+
*
|
|
9
|
+
* WARNING: this won't trigger the component to update, so if you need to trigger component update,
|
|
10
|
+
* use `scene.mutateElement` or `ExcalidrawImperativeAPI.mutateElement` instead.
|
|
11
|
+
*/
|
|
12
|
+
export declare const mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, elementsMap: ElementsMap, updates: ElementUpdate<TElement>, options?: {
|
|
5
13
|
isDragging?: boolean;
|
|
6
14
|
}) => TElement;
|
|
7
15
|
export declare const newElementWith: <TElement extends ExcalidrawElement>(element: TElement, updates: ElementUpdate<TElement>, force?: boolean) => TElement;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MarkOptional } from "@excalidraw/common/utility-types";
|
|
2
|
-
import type { ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawIframeElement, ElementsMap, ExcalidrawArrowElement,
|
|
2
|
+
import type { ExcalidrawImageElement, ExcalidrawTextElement, ExcalidrawLinearElement, ExcalidrawGenericElement, NonDeleted, TextAlign, VerticalAlign, Arrowhead, ExcalidrawFreeDrawElement, FontFamilyValues, ExcalidrawTextContainer, ExcalidrawFrameElement, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawIframeElement, ElementsMap, ExcalidrawArrowElement, ExcalidrawElbowArrowElement } from "./types";
|
|
3
3
|
export type ElementConstructorOpts = MarkOptional<Omit<ExcalidrawGenericElement, "id" | "type" | "isDeleted" | "updated">, "width" | "height" | "angle" | "groupIds" | "frameId" | "index" | "boundElements" | "seed" | "version" | "versionNonce" | "link" | "strokeStyle" | "fillStyle" | "strokeColor" | "backgroundColor" | "roughness" | "strokeWidth" | "roundness" | "locked" | "opacity" | "customData">;
|
|
4
4
|
export declare const newElement: (opts: {
|
|
5
5
|
type: ExcalidrawGenericElement["type"];
|
|
@@ -51,7 +51,7 @@ export declare const newArrowElement: <T extends boolean>(opts: {
|
|
|
51
51
|
endArrowhead?: Arrowhead | null | undefined;
|
|
52
52
|
points?: readonly import("@excalidraw/math").LocalPoint[] | undefined;
|
|
53
53
|
elbowed?: T | undefined;
|
|
54
|
-
fixedSegments?: FixedSegment[] | null | undefined;
|
|
54
|
+
fixedSegments?: readonly import("./types").FixedSegment[] | null | undefined;
|
|
55
55
|
} & Omit<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "link" | "angle" | "strokeColor" | "backgroundColor" | "fillStyle" | "strokeWidth" | "strokeStyle" | "roundness" | "roughness" | "opacity" | "width" | "height" | "seed" | "version" | "versionNonce" | "index" | "groupIds" | "frameId" | "boundElements" | "locked" | "customData"> & Partial<Pick<Omit<ExcalidrawGenericElement, "id" | "isDeleted" | "updated" | "type">, "link" | "angle" | "strokeColor" | "backgroundColor" | "fillStyle" | "strokeWidth" | "strokeStyle" | "roundness" | "roughness" | "opacity" | "width" | "height" | "seed" | "version" | "versionNonce" | "index" | "groupIds" | "frameId" | "boundElements" | "locked" | "customData">>) => T extends true ? NonDeleted<ExcalidrawElbowArrowElement> : NonDeleted<ExcalidrawArrowElement>;
|
|
56
56
|
export declare const newImageElement: (opts: {
|
|
57
57
|
type: ExcalidrawImageElement["type"];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type LocalPoint } from "@excalidraw/math";
|
|
2
|
-
import type Scene from "@excalidraw/excalidraw/scene/Scene";
|
|
3
2
|
import type { PointerDownState } from "@excalidraw/excalidraw/types";
|
|
3
|
+
import type Scene from "./Scene";
|
|
4
4
|
import type { BoundingBox } from "./bounds";
|
|
5
5
|
import type { MaybeTransformHandleType, TransformHandleDirection } from "./transformHandles";
|
|
6
|
-
import type { ExcalidrawLinearElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawElement, ElementsMap
|
|
7
|
-
export declare const transformElements: (originalElements: PointerDownState["originalElements"], transformHandleType: MaybeTransformHandleType, selectedElements: readonly NonDeletedExcalidrawElement[],
|
|
6
|
+
import type { ExcalidrawLinearElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawElement, ElementsMap } from "./types";
|
|
7
|
+
export declare const transformElements: (originalElements: PointerDownState["originalElements"], transformHandleType: MaybeTransformHandleType, selectedElements: readonly NonDeletedExcalidrawElement[], scene: Scene, shouldRotateWithDiscreteAngle: boolean, shouldResizeFromCenter: boolean, shouldMaintainAspectRatio: boolean, pointerX: number, pointerY: number, centerX: number, centerY: number) => boolean;
|
|
8
8
|
export declare const rescalePointsInElement: (element: NonDeletedExcalidrawElement, width: number, height: number, normalizePoints: boolean) => {
|
|
9
9
|
points: LocalPoint[];
|
|
10
10
|
} | {
|
|
@@ -15,12 +15,12 @@ export declare const measureFontSizeFromWidth: (element: NonDeleted<ExcalidrawTe
|
|
|
15
15
|
} | null;
|
|
16
16
|
export declare const getResizeOffsetXY: (transformHandleType: MaybeTransformHandleType, selectedElements: NonDeletedExcalidrawElement[], elementsMap: ElementsMap, x: number, y: number) => [number, number];
|
|
17
17
|
export declare const getResizeArrowDirection: (transformHandleType: MaybeTransformHandleType, element: NonDeleted<ExcalidrawLinearElement>) => "origin" | "end";
|
|
18
|
-
export declare const resizeSingleElement: (nextWidth: number, nextHeight: number, latestElement: ExcalidrawElement, origElement: ExcalidrawElement,
|
|
18
|
+
export declare const resizeSingleElement: (nextWidth: number, nextHeight: number, latestElement: ExcalidrawElement, origElement: ExcalidrawElement, originalElementsMap: ElementsMap, scene: Scene, handleDirection: TransformHandleDirection, { shouldInformMutation, shouldMaintainAspectRatio, shouldResizeFromCenter, }?: {
|
|
19
19
|
shouldMaintainAspectRatio?: boolean | undefined;
|
|
20
20
|
shouldResizeFromCenter?: boolean | undefined;
|
|
21
21
|
shouldInformMutation?: boolean | undefined;
|
|
22
22
|
}) => void;
|
|
23
|
-
export declare const getNextSingleWidthAndHeightFromPointer: (latestElement: ExcalidrawElement, origElement: ExcalidrawElement,
|
|
23
|
+
export declare const getNextSingleWidthAndHeightFromPointer: (latestElement: ExcalidrawElement, origElement: ExcalidrawElement, handleDirection: TransformHandleDirection, pointerX: number, pointerY: number, { shouldMaintainAspectRatio, shouldResizeFromCenter, }?: {
|
|
24
24
|
shouldMaintainAspectRatio?: boolean | undefined;
|
|
25
25
|
shouldResizeFromCenter?: boolean | undefined;
|
|
26
26
|
}) => {
|
|
@@ -26,7 +26,6 @@ export declare const getLockedLinearCursorAlignSize: (originX: number, originY:
|
|
|
26
26
|
width: number;
|
|
27
27
|
height: number;
|
|
28
28
|
};
|
|
29
|
-
export declare const resizePerfectLineForNWHandler: (element: ExcalidrawElement, x: number, y: number) => void;
|
|
30
29
|
export declare const getNormalizedDimensions: (element: Pick<ExcalidrawElement, "width" | "height" | "x" | "y">) => {
|
|
31
30
|
width: ExcalidrawElement["width"];
|
|
32
31
|
height: ExcalidrawElement["height"];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import type { ExtractSetType } from "@excalidraw/common/utility-types";
|
|
3
|
-
import type { Radians } from "
|
|
3
|
+
import type { Radians } from "@excalidraw/math";
|
|
4
|
+
import type Scene from "./Scene";
|
|
4
5
|
import type { MaybeTransformHandleType } from "./transformHandles";
|
|
5
6
|
import type { ElementsMap, ExcalidrawElement, ExcalidrawElementType, ExcalidrawTextContainer, ExcalidrawTextElement, ExcalidrawTextElementWithContainer, NonDeletedExcalidrawElement } from "./types";
|
|
6
|
-
export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null,
|
|
7
|
-
export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement,
|
|
7
|
+
export declare const redrawTextBoundingBox: (textElement: ExcalidrawTextElement, container: ExcalidrawElement | null, scene: Scene) => void;
|
|
8
|
+
export declare const handleBindTextResize: (container: NonDeletedExcalidrawElement, scene: Scene, transformHandleType: MaybeTransformHandleType, shouldMaintainAspectRatio?: boolean) => void;
|
|
8
9
|
export declare const computeBoundTextPosition: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer, elementsMap: ElementsMap) => {
|
|
9
10
|
x: number;
|
|
10
11
|
y: number;
|
|
@@ -16,6 +16,8 @@ export declare const isFreeDrawElementType: (elementType: ExcalidrawElementType)
|
|
|
16
16
|
export declare const isLinearElement: (element?: ExcalidrawElement | null) => element is ExcalidrawLinearElement;
|
|
17
17
|
export declare const isArrowElement: (element?: ExcalidrawElement | null) => element is ExcalidrawArrowElement;
|
|
18
18
|
export declare const isElbowArrow: (element?: ExcalidrawElement) => element is ExcalidrawElbowArrowElement;
|
|
19
|
+
export declare const isSharpArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
|
|
20
|
+
export declare const isCurvedArrow: (element?: ExcalidrawElement) => element is ExcalidrawArrowElement;
|
|
19
21
|
export declare const isLinearElementType: (elementType: ElementOrToolType) => boolean;
|
|
20
22
|
export declare const isBindingElement: (element?: ExcalidrawElement | null, includeLocked?: boolean) => element is ExcalidrawLinearElement;
|
|
21
23
|
export declare const isBindingElementType: (elementType: ElementOrToolType) => boolean;
|
|
@@ -27,6 +29,7 @@ export declare const isExcalidrawElement: (element: any) => element is Excalidra
|
|
|
27
29
|
export declare const isFlowchartNodeElement: (element: ExcalidrawElement) => element is ExcalidrawFlowchartNodeElement;
|
|
28
30
|
export declare const hasBoundTextElement: (element: ExcalidrawElement | null) => element is MarkNonNullable<ExcalidrawBindableElement, "boundElements">;
|
|
29
31
|
export declare const isBoundToContainer: (element: ExcalidrawElement | null) => element is ExcalidrawTextElementWithContainer;
|
|
32
|
+
export declare const isArrowBoundToElement: (element: ExcalidrawArrowElement) => boolean;
|
|
30
33
|
export declare const isUsingAdaptiveRadius: (type: string) => boolean;
|
|
31
34
|
export declare const isUsingProportionalRadius: (type: string) => boolean;
|
|
32
35
|
export declare const canApplyRoundnessTypeToElement: (roundnessType: RoundnessType, element: ExcalidrawElement) => boolean;
|
|
@@ -282,4 +282,7 @@ export type SceneElementsMap = Map<ExcalidrawElement["id"], Ordered<ExcalidrawEl
|
|
|
282
282
|
*/
|
|
283
283
|
export type NonDeletedSceneElementsMap = Map<ExcalidrawElement["id"], Ordered<NonDeletedExcalidrawElement>> & MakeBrand<"NonDeletedSceneElementsMap">;
|
|
284
284
|
export type ElementsMapOrArray = readonly ExcalidrawElement[] | Readonly<ElementsMap>;
|
|
285
|
+
export type ConvertibleGenericTypes = "rectangle" | "diamond" | "ellipse";
|
|
286
|
+
export type ConvertibleLinearTypes = "line" | "sharpArrow" | "curvedArrow" | "elbowArrow";
|
|
287
|
+
export type ConvertibleTypes = ConvertibleGenericTypes | ConvertibleLinearTypes;
|
|
285
288
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
2
|
-
import type Scene from "
|
|
2
|
+
import type Scene from "./Scene";
|
|
3
3
|
import type { ExcalidrawElement } from "./types";
|
|
4
4
|
export declare const moveOneLeft: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
|
|
5
5
|
export declare const moveOneRight: (allElements: readonly ExcalidrawElement[], appState: AppState, scene: Scene) => readonly ExcalidrawElement[];
|
|
6
|
-
export declare const moveAllLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) =>
|
|
7
|
-
export declare const moveAllRight: (allElements: readonly ExcalidrawElement[], appState: AppState) =>
|
|
6
|
+
export declare const moveAllLeft: (allElements: readonly ExcalidrawElement[], appState: AppState) => ExcalidrawElement[] | readonly ExcalidrawElement[];
|
|
7
|
+
export declare const moveAllRight: (allElements: readonly ExcalidrawElement[], appState: AppState) => ExcalidrawElement[] | readonly ExcalidrawElement[];
|
|
@@ -76,7 +76,7 @@ export declare const actionAddToLibrary: {
|
|
|
76
76
|
zoom: Readonly<{
|
|
77
77
|
value: import("../types").NormalizedZoomValue;
|
|
78
78
|
}>;
|
|
79
|
-
openMenu: "
|
|
79
|
+
openMenu: "canvas" | "shape" | null;
|
|
80
80
|
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
81
81
|
openSidebar: {
|
|
82
82
|
name: string;
|
|
@@ -283,7 +283,7 @@ export declare const actionAddToLibrary: {
|
|
|
283
283
|
zoom: Readonly<{
|
|
284
284
|
value: import("../types").NormalizedZoomValue;
|
|
285
285
|
}>;
|
|
286
|
-
openMenu: "
|
|
286
|
+
openMenu: "canvas" | "shape" | null;
|
|
287
287
|
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
288
288
|
openSidebar: {
|
|
289
289
|
name: string;
|
|
@@ -495,7 +495,7 @@ export declare const actionAddToLibrary: {
|
|
|
495
495
|
zoom: Readonly<{
|
|
496
496
|
value: import("../types").NormalizedZoomValue;
|
|
497
497
|
}>;
|
|
498
|
-
openMenu: "
|
|
498
|
+
openMenu: "canvas" | "shape" | null;
|
|
499
499
|
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
500
500
|
openSidebar: {
|
|
501
501
|
name: string;
|
|
@@ -96,7 +96,7 @@ export declare const actionBindText: {
|
|
|
96
96
|
zoom: Readonly<{
|
|
97
97
|
value: import("../types").NormalizedZoomValue;
|
|
98
98
|
}>;
|
|
99
|
-
openMenu: "
|
|
99
|
+
openMenu: "canvas" | "shape" | null;
|
|
100
100
|
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
101
101
|
openSidebar: {
|
|
102
102
|
name: string;
|
|
@@ -320,7 +320,7 @@ export declare const actionWrapTextInContainer: {
|
|
|
320
320
|
zoom: Readonly<{
|
|
321
321
|
value: import("../types").NormalizedZoomValue;
|
|
322
322
|
}>;
|
|
323
|
-
openMenu: "
|
|
323
|
+
openMenu: "canvas" | "shape" | null;
|
|
324
324
|
openPopup: "fontFamily" | "canvasBackground" | "elementBackground" | "elementStroke" | null;
|
|
325
325
|
openSidebar: {
|
|
326
326
|
name: string;
|