@excalidraw/common 0.18.0-816c81c → 0.18.0-81ab857
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/element/src/selection.d.ts +5 -1
- package/dist/types/element/src/textElement.d.ts +1 -1
- package/dist/types/element/src/textWrapping.d.ts +26 -0
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +12 -12
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionExport.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionFrame.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionGroup.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionLink.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionMenu.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionProperties.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionStyles.d.ts +2 -1
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +1 -1
- package/dist/types/excalidraw/components/App.d.ts +10 -0
- package/dist/types/excalidraw/components/Range.d.ts +10 -4
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
- package/dist/types/excalidraw/data/blob.d.ts +2 -2
- package/dist/types/excalidraw/data/json.d.ts +1 -1
- package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
- package/dist/types/excalidraw/types.d.ts +2 -2
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +5 -1
- package/dist/types/math/src/point.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AppState, InteractiveCanvasAppState } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import { LinearElementEditor } from "./linearElementEditor";
|
|
3
|
-
import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, NonDeletedExcalidrawElement } from "./types";
|
|
3
|
+
import type { ElementsMap, ElementsMapOrArray, ExcalidrawElement, NonDeleted, NonDeletedExcalidrawElement } from "./types";
|
|
4
4
|
/**
|
|
5
5
|
* Frames and their containing elements are not to be selected at the same time.
|
|
6
6
|
* Given an array of selected elements, if there are frames and their containing elements
|
|
@@ -32,3 +32,7 @@ export declare const getSelectionStateForElements: (targetElements: readonly Exc
|
|
|
32
32
|
editingGroupId: AppState["editingGroupId"];
|
|
33
33
|
selectedLinearElement: LinearElementEditor | null;
|
|
34
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* Returns editing or single-selected text element, if any.
|
|
37
|
+
*/
|
|
38
|
+
export declare const getActiveTextElement: (selectedElements: readonly NonDeleted<ExcalidrawElement>[], appState: Pick<AppState, "editingTextElement">) => import("./types").ExcalidrawTextElement | null;
|
|
@@ -31,7 +31,7 @@ export declare const suppportsHorizontalAlign: (selectedElements: NonDeletedExca
|
|
|
31
31
|
declare const VALID_CONTAINER_TYPES: Set<string>;
|
|
32
32
|
export declare const isValidTextContainer: (element: {
|
|
33
33
|
type: ExcalidrawElementType;
|
|
34
|
-
}) =>
|
|
34
|
+
}) => element is ExcalidrawTextContainer;
|
|
35
35
|
export declare const computeContainerDimensionForBoundText: (dimension: number, containerType: ExtractSetType<typeof VALID_CONTAINER_TYPES>) => number;
|
|
36
36
|
export declare const getBoundTextMaxWidth: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElement | null) => number;
|
|
37
37
|
export declare const getBoundTextMaxHeight: (container: ExcalidrawElement, boundTextElement: ExcalidrawTextElementWithContainer) => number;
|
|
@@ -5,9 +5,35 @@ import type { FontString } from "./types";
|
|
|
5
5
|
export declare const containsCJK: (text: string) => boolean;
|
|
6
6
|
/**
|
|
7
7
|
* Breaks the line into the tokens based on the found line break opporutnities.
|
|
8
|
+
*
|
|
9
|
+
* Note: tokenization normalizes to NFC first so decomposed graphemes are treated as
|
|
10
|
+
* their composed variants for wrapping. Any code that needs exact source offsets should
|
|
11
|
+
* keep in mind that this assumes the input text is already NFC-normalized.
|
|
8
12
|
*/
|
|
9
13
|
export declare const parseTokens: (line: string) => string[];
|
|
10
14
|
/**
|
|
11
15
|
* Wraps the original text into the lines based on the given width.
|
|
16
|
+
*
|
|
17
|
+
* This is a convenience adapter over `getWrappedTextLines()` for call sites
|
|
18
|
+
* that only need the rendered wrapped string and not the source offsets.
|
|
12
19
|
*/
|
|
13
20
|
export declare const wrapText: (text: string, font: FontString, maxWidth: number) => string;
|
|
21
|
+
/**
|
|
22
|
+
* A single rendered visual line produced from the original text.
|
|
23
|
+
*
|
|
24
|
+
* `start` and `end` are end-exclusive code-unit offsets into the original text, and do
|
|
25
|
+
* not include synthetic soft line breaks inserted by this module. If trailing whitespace
|
|
26
|
+
* was trimmed away at a wrap boundary, `end` points to the last rendered character.
|
|
27
|
+
*/
|
|
28
|
+
export type WrappedTextLine = {
|
|
29
|
+
text: string;
|
|
30
|
+
start: number;
|
|
31
|
+
end: number;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Returns the rendered visual lines together with their source offsets.
|
|
35
|
+
*
|
|
36
|
+
* This is the source-of-truth wrapping pipeline for callers that need more than the
|
|
37
|
+
* final wrapped string, for example caret placement or future editor/rich-text mapping.
|
|
38
|
+
*/
|
|
39
|
+
export declare const getWrappedTextLines: (text: string, font: FontString, maxWidth: number) => WrappedTextLine[];
|
|
@@ -42,7 +42,7 @@ export declare const actionAddToLibrary: {
|
|
|
42
42
|
};
|
|
43
43
|
editingFrame: string | null;
|
|
44
44
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
45
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
45
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
46
46
|
activeTool: {
|
|
47
47
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
48
48
|
locked: boolean;
|
|
@@ -196,7 +196,7 @@ export declare const actionAddToLibrary: {
|
|
|
196
196
|
};
|
|
197
197
|
editingFrame: string | null;
|
|
198
198
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
199
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
199
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
200
200
|
activeTool: {
|
|
201
201
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
202
202
|
locked: boolean;
|
|
@@ -355,7 +355,7 @@ export declare const actionAddToLibrary: {
|
|
|
355
355
|
};
|
|
356
356
|
editingFrame: string | null;
|
|
357
357
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
358
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
358
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
359
359
|
activeTool: {
|
|
360
360
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
361
361
|
locked: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExcalidrawElement, ExcalidrawLinearElement } from "@excalidraw/element/types";
|
|
1
|
+
import type { ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawTextElement } from "@excalidraw/element/types";
|
|
2
2
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
3
3
|
import type { AppState } from "../types";
|
|
4
4
|
export declare const actionUnbindText: {
|
|
@@ -62,7 +62,7 @@ export declare const actionBindText: {
|
|
|
62
62
|
};
|
|
63
63
|
editingFrame: string | null;
|
|
64
64
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
65
|
-
editingTextElement:
|
|
65
|
+
editingTextElement: ExcalidrawTextElement | null;
|
|
66
66
|
activeTool: {
|
|
67
67
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
68
68
|
locked: boolean;
|
|
@@ -233,7 +233,7 @@ export declare const actionWrapTextInContainer: {
|
|
|
233
233
|
};
|
|
234
234
|
editingFrame: string | null;
|
|
235
235
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
236
|
-
editingTextElement:
|
|
236
|
+
editingTextElement: ExcalidrawTextElement | null;
|
|
237
237
|
activeTool: {
|
|
238
238
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
239
239
|
locked: boolean;
|
|
@@ -71,7 +71,7 @@ export declare const actionClearCanvas: {
|
|
|
71
71
|
};
|
|
72
72
|
editingFrame: string | null;
|
|
73
73
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
74
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
74
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
75
75
|
preferredSelectionTool: {
|
|
76
76
|
type: "selection" | "lasso";
|
|
77
77
|
initialized: boolean;
|
|
@@ -222,7 +222,7 @@ export declare const actionZoomIn: {
|
|
|
222
222
|
};
|
|
223
223
|
editingFrame: string | null;
|
|
224
224
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
225
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
225
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
226
226
|
activeTool: {
|
|
227
227
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
228
228
|
locked: boolean;
|
|
@@ -397,7 +397,7 @@ export declare const actionZoomOut: {
|
|
|
397
397
|
};
|
|
398
398
|
editingFrame: string | null;
|
|
399
399
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
400
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
400
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
401
401
|
activeTool: {
|
|
402
402
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
403
403
|
locked: boolean;
|
|
@@ -572,7 +572,7 @@ export declare const actionResetZoom: {
|
|
|
572
572
|
};
|
|
573
573
|
editingFrame: string | null;
|
|
574
574
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
575
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
575
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
576
576
|
activeTool: {
|
|
577
577
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
578
578
|
locked: boolean;
|
|
@@ -748,7 +748,7 @@ export declare const zoomToFitBounds: ({ bounds, appState, canvasOffsets, fitToV
|
|
|
748
748
|
};
|
|
749
749
|
editingFrame: string | null;
|
|
750
750
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
751
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
751
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
752
752
|
activeTool: {
|
|
753
753
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
754
754
|
locked: boolean;
|
|
@@ -920,7 +920,7 @@ export declare const zoomToFit: ({ canvasOffsets, targetElements, appState, fitT
|
|
|
920
920
|
};
|
|
921
921
|
editingFrame: string | null;
|
|
922
922
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
923
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
923
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
924
924
|
activeTool: {
|
|
925
925
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
926
926
|
locked: boolean;
|
|
@@ -1089,7 +1089,7 @@ export declare const actionZoomToFitSelectionInViewport: {
|
|
|
1089
1089
|
};
|
|
1090
1090
|
editingFrame: string | null;
|
|
1091
1091
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
1092
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
1092
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
1093
1093
|
activeTool: {
|
|
1094
1094
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
1095
1095
|
locked: boolean;
|
|
@@ -1262,7 +1262,7 @@ export declare const actionZoomToFitSelection: {
|
|
|
1262
1262
|
};
|
|
1263
1263
|
editingFrame: string | null;
|
|
1264
1264
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
1265
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
1265
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
1266
1266
|
activeTool: {
|
|
1267
1267
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
1268
1268
|
locked: boolean;
|
|
@@ -1436,7 +1436,7 @@ export declare const actionZoomToFit: {
|
|
|
1436
1436
|
};
|
|
1437
1437
|
editingFrame: string | null;
|
|
1438
1438
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
1439
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
1439
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
1440
1440
|
activeTool: {
|
|
1441
1441
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
1442
1442
|
locked: boolean;
|
|
@@ -1610,7 +1610,7 @@ export declare const actionToggleEraserTool: {
|
|
|
1610
1610
|
};
|
|
1611
1611
|
editingFrame: string | null;
|
|
1612
1612
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
1613
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
1613
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
1614
1614
|
preferredSelectionTool: {
|
|
1615
1615
|
type: "selection" | "lasso";
|
|
1616
1616
|
initialized: boolean;
|
|
@@ -1775,7 +1775,7 @@ export declare const actionToggleLassoTool: {
|
|
|
1775
1775
|
};
|
|
1776
1776
|
editingFrame: string | null;
|
|
1777
1777
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
1778
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
1778
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
1779
1779
|
preferredSelectionTool: {
|
|
1780
1780
|
type: "selection" | "lasso";
|
|
1781
1781
|
initialized: boolean;
|
|
@@ -1939,7 +1939,7 @@ export declare const actionToggleHandTool: {
|
|
|
1939
1939
|
};
|
|
1940
1940
|
editingFrame: string | null;
|
|
1941
1941
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
1942
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
1942
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
1943
1943
|
preferredSelectionTool: {
|
|
1944
1944
|
type: "selection" | "lasso";
|
|
1945
1945
|
initialized: boolean;
|
|
@@ -43,7 +43,7 @@ export declare const actionPaste: {
|
|
|
43
43
|
};
|
|
44
44
|
editingFrame: string | null;
|
|
45
45
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
46
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
46
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
47
47
|
activeTool: {
|
|
48
48
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
49
49
|
locked: boolean;
|
|
@@ -252,7 +252,7 @@ export declare const actionCopyAsPng: {
|
|
|
252
252
|
};
|
|
253
253
|
editingFrame: string | null;
|
|
254
254
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
255
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
255
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
256
256
|
activeTool: {
|
|
257
257
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
258
258
|
locked: boolean;
|
|
@@ -44,7 +44,7 @@ export declare const actionToggleCropEditor: {
|
|
|
44
44
|
};
|
|
45
45
|
editingFrame: string | null;
|
|
46
46
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
47
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
47
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
48
48
|
activeTool: {
|
|
49
49
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
50
50
|
locked: boolean;
|
|
@@ -45,7 +45,7 @@ export declare const actionDeleteSelected: {
|
|
|
45
45
|
};
|
|
46
46
|
editingFrame: string | null;
|
|
47
47
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
48
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
48
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
49
49
|
activeTool: {
|
|
50
50
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
51
51
|
locked: boolean;
|
|
@@ -237,7 +237,7 @@ export declare const actionDeleteSelected: {
|
|
|
237
237
|
};
|
|
238
238
|
editingFrame: string | null;
|
|
239
239
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
240
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
240
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
241
241
|
activeTool: {
|
|
242
242
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
243
243
|
locked: boolean;
|
|
@@ -402,7 +402,7 @@ export declare const actionDeleteSelected: {
|
|
|
402
402
|
};
|
|
403
403
|
editingFrame: string | null;
|
|
404
404
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
405
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
405
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
406
406
|
preferredSelectionTool: {
|
|
407
407
|
type: "selection" | "lasso";
|
|
408
408
|
initialized: boolean;
|
|
@@ -73,7 +73,7 @@ export declare const actionLinkToElement: {
|
|
|
73
73
|
};
|
|
74
74
|
editingFrame: string | null;
|
|
75
75
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
76
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
76
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
77
77
|
activeTool: {
|
|
78
78
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
79
79
|
locked: boolean;
|
|
@@ -55,7 +55,7 @@ export declare const actionToggleElementLock: {
|
|
|
55
55
|
};
|
|
56
56
|
editingFrame: string | null;
|
|
57
57
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
58
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
58
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
59
59
|
activeTool: {
|
|
60
60
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
61
61
|
locked: boolean;
|
|
@@ -225,7 +225,7 @@ export declare const actionUnlockAllElements: {
|
|
|
225
225
|
};
|
|
226
226
|
editingFrame: string | null;
|
|
227
227
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
228
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
228
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
229
229
|
activeTool: {
|
|
230
230
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
231
231
|
locked: boolean;
|
|
@@ -46,7 +46,7 @@ export declare const actionSetEmbeddableAsActiveTool: {
|
|
|
46
46
|
};
|
|
47
47
|
editingFrame: string | null;
|
|
48
48
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
49
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
49
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
50
50
|
preferredSelectionTool: {
|
|
51
51
|
type: "selection" | "lasso";
|
|
52
52
|
initialized: boolean;
|
|
@@ -128,7 +128,7 @@ export declare const actionLoadScene: {
|
|
|
128
128
|
};
|
|
129
129
|
editingFrame: string | null;
|
|
130
130
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
131
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
131
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
132
132
|
preferredSelectionTool: {
|
|
133
133
|
type: "selection" | "lasso";
|
|
134
134
|
initialized: boolean;
|
|
@@ -272,7 +272,7 @@ export declare const actionLoadScene: {
|
|
|
272
272
|
};
|
|
273
273
|
editingFrame: string | null;
|
|
274
274
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
275
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
275
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
276
276
|
activeTool: {
|
|
277
277
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
278
278
|
locked: boolean;
|
|
@@ -43,7 +43,7 @@ export declare const actionSelectAllElementsInFrame: {
|
|
|
43
43
|
};
|
|
44
44
|
editingFrame: string | null;
|
|
45
45
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
46
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
46
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
47
47
|
activeTool: {
|
|
48
48
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
49
49
|
locked: boolean;
|
|
@@ -218,7 +218,7 @@ export declare const actionRemoveAllElementsFromFrame: {
|
|
|
218
218
|
};
|
|
219
219
|
editingFrame: string | null;
|
|
220
220
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
221
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
221
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
222
222
|
activeTool: {
|
|
223
223
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
224
224
|
locked: boolean;
|
|
@@ -391,7 +391,7 @@ export declare const actionupdateFrameRendering: {
|
|
|
391
391
|
frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
|
|
392
392
|
editingFrame: string | null;
|
|
393
393
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
394
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
394
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
395
395
|
activeTool: {
|
|
396
396
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
397
397
|
locked: boolean;
|
|
@@ -569,7 +569,7 @@ export declare const actionSetFrameAsActiveTool: {
|
|
|
569
569
|
};
|
|
570
570
|
editingFrame: string | null;
|
|
571
571
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
572
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
572
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
573
573
|
preferredSelectionTool: {
|
|
574
574
|
type: "selection" | "lasso";
|
|
575
575
|
initialized: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExcalidrawElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
1
|
+
import type { ExcalidrawElement, ExcalidrawTextElement, OrderedExcalidrawElement } from "@excalidraw/element/types";
|
|
2
2
|
import type { AppClassProperties, AppState } from "../types";
|
|
3
3
|
export declare const actionGroup: {
|
|
4
4
|
name: "group";
|
|
@@ -49,7 +49,7 @@ export declare const actionGroup: {
|
|
|
49
49
|
};
|
|
50
50
|
editingFrame: string | null;
|
|
51
51
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
52
|
-
editingTextElement:
|
|
52
|
+
editingTextElement: ExcalidrawTextElement | null;
|
|
53
53
|
activeTool: {
|
|
54
54
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
55
55
|
locked: boolean;
|
|
@@ -223,7 +223,7 @@ export declare const actionUngroup: {
|
|
|
223
223
|
};
|
|
224
224
|
editingFrame: string | null;
|
|
225
225
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
226
|
-
editingTextElement:
|
|
226
|
+
editingTextElement: ExcalidrawTextElement | null;
|
|
227
227
|
activeTool: {
|
|
228
228
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
229
229
|
locked: boolean;
|
|
@@ -76,7 +76,7 @@ export declare const actionToggleLinearEditor: {
|
|
|
76
76
|
};
|
|
77
77
|
editingFrame: string | null;
|
|
78
78
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
79
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
79
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
80
80
|
activeTool: {
|
|
81
81
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
82
82
|
locked: boolean;
|
|
@@ -40,7 +40,7 @@ export declare const actionLink: {
|
|
|
40
40
|
};
|
|
41
41
|
editingFrame: string | null;
|
|
42
42
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
43
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
43
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
44
44
|
activeTool: {
|
|
45
45
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
46
46
|
locked: boolean;
|
|
@@ -47,7 +47,7 @@ export declare const actionShortcuts: {
|
|
|
47
47
|
};
|
|
48
48
|
editingFrame: string | null;
|
|
49
49
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
50
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
50
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
51
51
|
activeTool: {
|
|
52
52
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
53
53
|
locked: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LinearElementEditor } from "@excalidraw/element";
|
|
2
|
-
import type { Arrowhead, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawLinearElement, FontFamilyValues, TextAlign } from "@excalidraw/element/types";
|
|
2
|
+
import type { Arrowhead, ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawLinearElement, ExcalidrawTextElement, FontFamilyValues, TextAlign } from "@excalidraw/element/types";
|
|
3
3
|
import type { AppClassProperties, AppState, Primitive } from "../types";
|
|
4
4
|
export declare const changeProperty: (elements: readonly ExcalidrawElement[], appState: AppState, callback: (element: ExcalidrawElement) => ExcalidrawElement, includeBoundText?: boolean) => ExcalidrawElement[];
|
|
5
|
-
export declare const getFormValue: <T extends Primitive>(elements: readonly ExcalidrawElement[], app: AppClassProperties, getAttribute: (element: ExcalidrawElement) => T,
|
|
5
|
+
export declare const getFormValue: <T extends Primitive>(elements: readonly ExcalidrawElement[], app: AppClassProperties, getAttribute: (element: ExcalidrawElement) => T, elementPredicate: true | ((element: ExcalidrawElement) => boolean), defaultValue: T | ((isSomeElementSelected: boolean) => T)) => T;
|
|
6
6
|
export declare const actionChangeStrokeColor: import("./types").Action<Pick<AppState, "currentItemStrokeColor">> & {
|
|
7
7
|
keyTest?: ((event: React.KeyboardEvent | KeyboardEvent, appState: AppState, elements: readonly ExcalidrawElement[], app: AppClassProperties) => boolean) | undefined;
|
|
8
8
|
};
|
|
@@ -69,7 +69,7 @@ export declare const actionDecreaseFontSize: {
|
|
|
69
69
|
};
|
|
70
70
|
editingFrame: string | null;
|
|
71
71
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
72
|
-
editingTextElement:
|
|
72
|
+
editingTextElement: ExcalidrawTextElement | null;
|
|
73
73
|
activeTool: {
|
|
74
74
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
75
75
|
locked: boolean;
|
|
@@ -239,7 +239,7 @@ export declare const actionIncreaseFontSize: {
|
|
|
239
239
|
};
|
|
240
240
|
editingFrame: string | null;
|
|
241
241
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
242
|
-
editingTextElement:
|
|
242
|
+
editingTextElement: ExcalidrawTextElement | null;
|
|
243
243
|
activeTool: {
|
|
244
244
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
245
245
|
locked: boolean;
|
|
@@ -47,7 +47,7 @@ export declare const actionSelectAll: {
|
|
|
47
47
|
};
|
|
48
48
|
editingFrame: string | null;
|
|
49
49
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
50
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
50
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
51
51
|
activeTool: {
|
|
52
52
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
53
53
|
locked: boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ExcalidrawTextElement } from "@excalidraw/element/types";
|
|
1
2
|
export declare let copiedStyles: string;
|
|
2
3
|
export declare const actionCopyStyles: {
|
|
3
4
|
name: "copyStyles";
|
|
@@ -44,7 +45,7 @@ export declare const actionCopyStyles: {
|
|
|
44
45
|
};
|
|
45
46
|
editingFrame: string | null;
|
|
46
47
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
47
|
-
editingTextElement:
|
|
48
|
+
editingTextElement: ExcalidrawTextElement | null;
|
|
48
49
|
activeTool: {
|
|
49
50
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
50
51
|
locked: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ExcalidrawElement } from "@excalidraw/element/types";
|
|
2
2
|
export declare const actionTextAutoResize: {
|
|
3
3
|
name: "autoResize";
|
|
4
4
|
label: string;
|
|
@@ -6,8 +6,8 @@ export declare const actionTextAutoResize: {
|
|
|
6
6
|
trackEvent: {
|
|
7
7
|
category: "element";
|
|
8
8
|
};
|
|
9
|
-
predicate: (elements: readonly
|
|
10
|
-
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>,
|
|
9
|
+
predicate: (elements: readonly ExcalidrawElement[], appState: import("../types").AppState, _: unknown) => boolean;
|
|
10
|
+
perform: (elements: readonly import("@excalidraw/element/types").OrderedExcalidrawElement[], appState: Readonly<import("../types").AppState>, targetElement: unknown) => {
|
|
11
11
|
appState: Readonly<import("../types").AppState>;
|
|
12
12
|
elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
|
|
13
13
|
captureUpdate: "IMMEDIATELY";
|
|
@@ -41,7 +41,7 @@ export declare const actionToggleArrowBinding: {
|
|
|
41
41
|
};
|
|
42
42
|
editingFrame: string | null;
|
|
43
43
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
44
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
44
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
45
45
|
activeTool: {
|
|
46
46
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
47
47
|
locked: boolean;
|
|
@@ -46,7 +46,7 @@ export declare const actionToggleGridMode: {
|
|
|
46
46
|
};
|
|
47
47
|
editingFrame: string | null;
|
|
48
48
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
49
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
49
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
50
50
|
activeTool: {
|
|
51
51
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
52
52
|
locked: boolean;
|
|
@@ -41,7 +41,7 @@ export declare const actionToggleMidpointSnapping: {
|
|
|
41
41
|
};
|
|
42
42
|
editingFrame: string | null;
|
|
43
43
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
44
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
44
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
45
45
|
activeTool: {
|
|
46
46
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
47
47
|
locked: boolean;
|
|
@@ -44,7 +44,7 @@ export declare const actionToggleObjectsSnapMode: {
|
|
|
44
44
|
};
|
|
45
45
|
editingFrame: string | null;
|
|
46
46
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
47
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
47
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
48
48
|
activeTool: {
|
|
49
49
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
50
50
|
locked: boolean;
|
|
@@ -50,7 +50,7 @@ export declare const actionToggleSearchMenu: {
|
|
|
50
50
|
};
|
|
51
51
|
editingFrame: string | null;
|
|
52
52
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
53
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
53
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
54
54
|
activeTool: {
|
|
55
55
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
56
56
|
locked: boolean;
|
|
@@ -46,7 +46,7 @@ export declare const actionToggleStats: {
|
|
|
46
46
|
};
|
|
47
47
|
editingFrame: string | null;
|
|
48
48
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
49
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
49
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
50
50
|
activeTool: {
|
|
51
51
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
52
52
|
locked: boolean;
|
|
@@ -43,7 +43,7 @@ export declare const actionToggleViewMode: {
|
|
|
43
43
|
};
|
|
44
44
|
editingFrame: string | null;
|
|
45
45
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
46
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
46
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
47
47
|
activeTool: {
|
|
48
48
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
49
49
|
locked: boolean;
|
|
@@ -43,7 +43,7 @@ export declare const actionToggleZenMode: {
|
|
|
43
43
|
};
|
|
44
44
|
editingFrame: string | null;
|
|
45
45
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawElement>[] | null;
|
|
46
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
46
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
47
47
|
activeTool: {
|
|
48
48
|
lastActiveTool: import("../types").ActiveTool | null;
|
|
49
49
|
locked: boolean;
|
|
@@ -113,12 +113,14 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
113
113
|
hitLinkElement?: NonDeletedExcalidrawElement;
|
|
114
114
|
lastPointerDownEvent: React.PointerEvent<HTMLElement> | null;
|
|
115
115
|
lastPointerUpEvent: React.PointerEvent<HTMLElement> | PointerEvent | null;
|
|
116
|
+
lastPointerUpIsDoubleClick: boolean;
|
|
116
117
|
lastPointerMoveEvent: PointerEvent | null;
|
|
117
118
|
/** current frame pointer cords */
|
|
118
119
|
lastPointerMoveCoords: {
|
|
119
120
|
x: number;
|
|
120
121
|
y: number;
|
|
121
122
|
} | null;
|
|
123
|
+
private lastCompletedCanvasClicks;
|
|
122
124
|
/** previous frame pointer coords */
|
|
123
125
|
previousPointerMoveCoords: {
|
|
124
126
|
x: number;
|
|
@@ -278,10 +280,12 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
278
280
|
* If disabled, returns null.
|
|
279
281
|
*/
|
|
280
282
|
getEffectiveGridSize: () => NullableGridSize;
|
|
283
|
+
private getTextCreationGridPoint;
|
|
281
284
|
private getHTMLIFrameElement;
|
|
282
285
|
private handleIframeLikeElementHover;
|
|
283
286
|
/** @returns true if iframe-like element click handled */
|
|
284
287
|
private handleIframeLikeCenterClick;
|
|
288
|
+
private isDoubleClick;
|
|
285
289
|
private isIframeLikeElementCenter;
|
|
286
290
|
private updateEmbedValidationStatus;
|
|
287
291
|
private updateEmbeddables;
|
|
@@ -472,7 +476,11 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
472
476
|
private onGestureEnd;
|
|
473
477
|
private handleTextWysiwyg;
|
|
474
478
|
private deselectElements;
|
|
479
|
+
private getSelectedTextElement;
|
|
480
|
+
private getSelectedTextEditingContainerAtPosition;
|
|
475
481
|
private getTextElementAtPosition;
|
|
482
|
+
private isHittingTextAutoResizeHandle;
|
|
483
|
+
private handleTextAutoResizeHandlePointerDown;
|
|
476
484
|
private getElementAtPosition;
|
|
477
485
|
private getElementsAtPosition;
|
|
478
486
|
getElementHitThreshold(element: ExcalidrawElement): number;
|
|
@@ -481,7 +489,9 @@ declare class App extends React.Component<AppProps, AppState> {
|
|
|
481
489
|
private startTextEditing;
|
|
482
490
|
private startImageCropping;
|
|
483
491
|
private finishImageCropping;
|
|
492
|
+
private shouldHandleBrowserCanvasDoubleClick;
|
|
484
493
|
private handleCanvasDoubleClick;
|
|
494
|
+
private handleCanvasClick;
|
|
485
495
|
private getElementLinkAtPosition;
|
|
486
496
|
private handleElementLinkClick;
|
|
487
497
|
private getTopLayerFrameAtSceneCoords;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import "./Range.scss";
|
|
2
|
-
import type { AppClassProperties } from "../types";
|
|
3
3
|
export type RangeProps = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
label: React.ReactNode;
|
|
5
|
+
value: number;
|
|
6
|
+
onChange: (value: number) => void;
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
minLabel?: React.ReactNode;
|
|
11
|
+
hasCommonValue?: boolean;
|
|
6
12
|
testId?: string;
|
|
7
13
|
};
|
|
8
|
-
export declare const Range: ({
|
|
14
|
+
export declare const Range: ({ label, value, onChange, min, max, step, minLabel, hasCommonValue, testId, }: RangeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -21,6 +21,7 @@ type InteractiveCanvasProps = {
|
|
|
21
21
|
renderInteractiveSceneCallback: (data: RenderInteractiveSceneCallback) => void;
|
|
22
22
|
handleCanvasRef: (canvas: HTMLCanvasElement | null) => void;
|
|
23
23
|
onContextMenu: Exclude<DOMAttributes<HTMLCanvasElement | HTMLDivElement>["onContextMenu"], undefined>;
|
|
24
|
+
onClick: Exclude<DOMAttributes<HTMLCanvasElement>["onClick"], undefined>;
|
|
24
25
|
onPointerMove: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerMove"], undefined>;
|
|
25
26
|
onPointerUp: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerUp"], undefined>;
|
|
26
27
|
onPointerCancel: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerCancel"], undefined>;
|
|
@@ -66,7 +66,7 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
66
66
|
};
|
|
67
67
|
editingFrame: string | null;
|
|
68
68
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
69
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
69
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
70
70
|
preferredSelectionTool: {
|
|
71
71
|
type: "selection" | "lasso";
|
|
72
72
|
initialized: boolean;
|
|
@@ -231,7 +231,7 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
|
|
|
231
231
|
};
|
|
232
232
|
editingFrame: string | null;
|
|
233
233
|
elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
|
|
234
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
234
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
235
235
|
preferredSelectionTool: {
|
|
236
236
|
type: "selection" | "lasso";
|
|
237
237
|
initialized: boolean;
|
|
@@ -64,7 +64,7 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
|
|
|
64
64
|
};
|
|
65
65
|
editingFrame: string | null;
|
|
66
66
|
elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
|
|
67
|
-
editingTextElement: import("@excalidraw/element/types").
|
|
67
|
+
editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
|
|
68
68
|
preferredSelectionTool: {
|
|
69
69
|
type: "selection" | "lasso";
|
|
70
70
|
initialized: boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type GlobalPoint } from "@excalidraw/math";
|
|
2
|
+
import type { EditorInterface } from "@excalidraw/common";
|
|
3
|
+
import type { ExcalidrawTextElement } from "@excalidraw/element/types";
|
|
4
|
+
export declare const getTextBoxPadding: (zoomValue: number) => number;
|
|
5
|
+
export declare const getTextAutoResizeHandle: (textElement: ExcalidrawTextElement, zoomValue: number, formFactor: EditorInterface["formFactor"]) => {
|
|
6
|
+
center: GlobalPoint | import("@excalidraw/math").LocalPoint;
|
|
7
|
+
start: GlobalPoint;
|
|
8
|
+
end: GlobalPoint;
|
|
9
|
+
hitboxWidth: number;
|
|
10
|
+
hitboxHeight: number;
|
|
11
|
+
} | null;
|
|
12
|
+
export declare const isPointHittingTextAutoResizeHandle: (point: Readonly<{
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
}>, textElement: ExcalidrawTextElement, zoomValue: number, formFactor: EditorInterface["formFactor"]) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IMAGE_MIME_TYPES, UserIdleState, throttleRAF, MIME_TYPES, EditorInterface } from "@excalidraw/common";
|
|
2
2
|
import type { LinearElementEditor } from "@excalidraw/element";
|
|
3
3
|
import type { MaybeTransformHandleType } from "@excalidraw/element";
|
|
4
|
-
import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, FontFamilyValues, FileId, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement, BindMode } from "@excalidraw/element/types";
|
|
4
|
+
import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, FontFamilyValues, FileId, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement, BindMode, ExcalidrawTextElement } from "@excalidraw/element/types";
|
|
5
5
|
import type { Merge, MaybePromise, ValueOf, MakeBrand } from "@excalidraw/common/utility-types";
|
|
6
6
|
import type { CaptureUpdateActionType, DurableIncrement, EphemeralIncrement } from "@excalidraw/element";
|
|
7
7
|
import type { GlobalPoint } from "@excalidraw/math";
|
|
@@ -231,7 +231,7 @@ export interface AppState {
|
|
|
231
231
|
/**
|
|
232
232
|
* set when a new text is created or when an existing text is being edited
|
|
233
233
|
*/
|
|
234
|
-
editingTextElement:
|
|
234
|
+
editingTextElement: ExcalidrawTextElement | null;
|
|
235
235
|
activeTool: {
|
|
236
236
|
/**
|
|
237
237
|
* indicates a previous tool we should revert back to if we deselect the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExcalidrawElement, ExcalidrawTextElement } from "@excalidraw/element/types";
|
|
2
2
|
import type App from "../components/App";
|
|
3
3
|
type SubmitHandler = () => void;
|
|
4
|
-
export declare const textWysiwyg: ({ id, onChange, onSubmit, getViewportCoords, element, canvas, excalidrawContainer, app, autoSelect, }: {
|
|
4
|
+
export declare const textWysiwyg: ({ id, onChange, onSubmit, getViewportCoords, element, canvas, excalidrawContainer, app, autoSelect, initialCaretSceneCoords, }: {
|
|
5
5
|
id: ExcalidrawElement["id"];
|
|
6
6
|
/**
|
|
7
7
|
* textWysiwyg only deals with `originalText`
|
|
@@ -20,5 +20,9 @@ export declare const textWysiwyg: ({ id, onChange, onSubmit, getViewportCoords,
|
|
|
20
20
|
excalidrawContainer: HTMLDivElement | null;
|
|
21
21
|
app: App;
|
|
22
22
|
autoSelect?: boolean;
|
|
23
|
+
initialCaretSceneCoords?: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
} | null;
|
|
23
27
|
}) => SubmitHandler;
|
|
24
28
|
export {};
|
|
@@ -57,7 +57,7 @@ export declare function pointsEqual<Point extends GlobalPoint | LocalPoint>(a: P
|
|
|
57
57
|
* @param angle The radians to rotate the point by
|
|
58
58
|
* @returns The rotated point
|
|
59
59
|
*/
|
|
60
|
-
export declare function pointRotateRads<Point extends GlobalPoint | LocalPoint>(
|
|
60
|
+
export declare function pointRotateRads<Point extends GlobalPoint | LocalPoint>(point: Point, center: Point, angle: Radians): Point;
|
|
61
61
|
/**
|
|
62
62
|
* Rotate a point by [angle] degree.
|
|
63
63
|
*
|