@excalidraw/common 0.18.0-b1c6bfc → 0.18.0-b2b2815

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.
Files changed (43) hide show
  1. package/dist/types/element/src/Scene.d.ts +5 -3
  2. package/dist/types/element/src/duplicate.d.ts +1 -0
  3. package/dist/types/element/src/frame.d.ts +6 -5
  4. package/dist/types/element/src/typeChecks.d.ts +1 -0
  5. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +0 -3
  6. package/dist/types/excalidraw/actions/actionBoundText.d.ts +0 -2
  7. package/dist/types/excalidraw/actions/actionCanvas.d.ts +0 -12
  8. package/dist/types/excalidraw/actions/actionClipboard.d.ts +0 -2
  9. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +0 -1
  10. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +0 -3
  11. package/dist/types/excalidraw/actions/actionDeselect.d.ts +1 -2
  12. package/dist/types/excalidraw/actions/actionElementLink.d.ts +0 -1
  13. package/dist/types/excalidraw/actions/actionElementLock.d.ts +0 -2
  14. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -1
  15. package/dist/types/excalidraw/actions/actionExport.d.ts +0 -2
  16. package/dist/types/excalidraw/actions/actionFrame.d.ts +0 -4
  17. package/dist/types/excalidraw/actions/actionGroup.d.ts +0 -2
  18. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +0 -1
  19. package/dist/types/excalidraw/actions/actionLink.d.ts +0 -1
  20. package/dist/types/excalidraw/actions/actionMenu.d.ts +0 -1
  21. package/dist/types/excalidraw/actions/actionProperties.d.ts +0 -2
  22. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +0 -1
  23. package/dist/types/excalidraw/actions/actionStyles.d.ts +0 -1
  24. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +0 -1
  25. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +0 -1
  26. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +0 -1
  27. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +0 -1
  28. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +0 -1
  29. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +0 -1
  30. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +0 -1
  31. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +0 -1
  32. package/dist/types/excalidraw/components/App.d.ts +9 -0
  33. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -1
  34. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
  35. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
  36. package/dist/types/excalidraw/components/shapes.d.ts +7 -0
  37. package/dist/types/excalidraw/data/blob.d.ts +0 -2
  38. package/dist/types/excalidraw/data/json.d.ts +0 -1
  39. package/dist/types/excalidraw/scene/Renderer.d.ts +425 -19
  40. package/dist/types/excalidraw/types.d.ts +5 -2
  41. package/dist/types/fractional-indexing/src/index.d.ts +29 -0
  42. package/dist/types/math/src/constants.d.ts +0 -1
  43. package/package.json +1 -1
@@ -63,10 +63,12 @@ export declare class Scene {
63
63
  triggerUpdate(): void;
64
64
  onUpdate(cb: SceneStateCallback): SceneStateCallbackRemover;
65
65
  destroy(): void;
66
- insertElementAtIndex(element: ExcalidrawElement, index: number): void;
67
- insertElementsAtIndex(elements: ExcalidrawElement[], index: number): void;
66
+ /** low-level - generally use app.insertNewElements() */
67
+ insertElementsAtIndex(elements: ExcalidrawElement[],
68
+ /** null indicates end of the array */
69
+ index: number | null): void;
70
+ /** low-level - generally use app.insertNewElement() */
68
71
  insertElement: (element: ExcalidrawElement) => void;
69
- insertElements: (elements: ExcalidrawElement[]) => void;
70
72
  getElementIndex(elementId: string): number;
71
73
  getContainerElement: (element: (ExcalidrawElement & {
72
74
  containerId: ExcalidrawElement["id"] | null;
@@ -31,6 +31,7 @@ export declare const duplicateElements: (opts: {
31
31
  * user interaction.
32
32
  */
33
33
  type: "everything";
34
+ preserveFrameChildrenOrder?: boolean;
34
35
  } | {
35
36
  /**
36
37
  * Duplicates specified elements and inserts them back into the array
@@ -36,17 +36,18 @@ export declare const omitPartialGroups: (elements: ExcalidrawElement[], frame: E
36
36
  export declare const getContainingFrame: (element: ExcalidrawElement, elementsMap: ElementsMap) => ExcalidrawFrameLikeElement | null;
37
37
  /** */
38
38
  export declare const filterElementsEligibleAsFrameChildren: (elements: readonly ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => ExcalidrawElement[];
39
+ export declare const getCommonFrameId: (elements: readonly ExcalidrawElement[]) => string | null;
40
+ export declare const getFrameChildrenInsertionIndex: (elements: readonly ExcalidrawElement[], frameId: ExcalidrawFrameLikeElement["id"]) => number | null;
39
41
  /**
40
- * Retains (or repairs for target frame) the ordering invriant where children
41
- * elements come right before the parent frame:
42
- * [el, el, child, child, frame, el]
42
+ * Adds elements and their bound elements to frame. Reorders added elements to
43
+ * be just below frame, or just above its highest child (whichever is higher).
43
44
  *
44
45
  * @returns mutated allElements (same data structure)
45
46
  */
46
- export declare const addElementsToFrame: <T extends ElementsMapOrArray>(allElements: T, elementsToAdd: NonDeletedExcalidrawElement[], frame: ExcalidrawFrameLikeElement, appState: AppState) => T;
47
+ export declare const addElementsToFrame: <T extends ElementsMapOrArray>(allElements: T, elementsToAdd: NonDeletedExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => T;
47
48
  export declare const removeElementsFromFrame: (elementsToRemove: ReadonlySetLike<NonDeletedExcalidrawElement>, elementsMap: ElementsMap) => void;
48
49
  export declare const removeAllElementsFromFrame: <T extends ExcalidrawElement>(allElements: readonly T[], frame: ExcalidrawFrameLikeElement) => readonly T[];
49
- export declare const replaceAllElementsInFrame: <T extends ExcalidrawElement>(allElements: readonly T[], nextElementsInFrame: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement, app: AppClassProperties) => T[];
50
+ export declare const replaceAllElementsInFrame: <T extends ExcalidrawElement>(allElements: readonly T[], nextElementsInFrame: ExcalidrawElement[], frame: ExcalidrawFrameLikeElement) => T[];
50
51
  /** does not mutate elements, but returns new ones */
51
52
  export declare const updateFrameMembershipOfSelectedElements: <T extends ElementsMapOrArray>(allElements: T, appState: AppState, app: AppClassProperties) => T;
52
53
  /**
@@ -52,3 +52,4 @@ export declare const getLinearElementSubType: (element: ExcalidrawLinearElement)
52
52
  */
53
53
  export declare const isValidPolygon: (points: ExcalidrawLineElement["points"]) => boolean;
54
54
  export declare const canBecomePolygon: (points: ExcalidrawLineElement["points"]) => boolean;
55
+ export declare const isEligibleFrameChildType: (type: ElementOrToolType) => boolean;
@@ -29,7 +29,6 @@ export declare const actionAddToLibrary: {
29
29
  boxSelectionMode: import("../types").BoxSelectionMode;
30
30
  bindingPreference: "enabled" | "disabled";
31
31
  isMidpointSnappingEnabled: boolean;
32
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
33
32
  suggestedBinding: {
34
33
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
35
34
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -184,7 +183,6 @@ export declare const actionAddToLibrary: {
184
183
  boxSelectionMode: import("../types").BoxSelectionMode;
185
184
  bindingPreference: "enabled" | "disabled";
186
185
  isMidpointSnappingEnabled: boolean;
187
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
188
186
  suggestedBinding: {
189
187
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
190
188
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -344,7 +342,6 @@ export declare const actionAddToLibrary: {
344
342
  boxSelectionMode: import("../types").BoxSelectionMode;
345
343
  bindingPreference: "enabled" | "disabled";
346
344
  isMidpointSnappingEnabled: boolean;
347
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
348
345
  suggestedBinding: {
349
346
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
350
347
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -49,7 +49,6 @@ export declare const actionBindText: {
49
49
  boxSelectionMode: import("../types").BoxSelectionMode;
50
50
  bindingPreference: "enabled" | "disabled";
51
51
  isMidpointSnappingEnabled: boolean;
52
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
53
52
  suggestedBinding: {
54
53
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
55
54
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -221,7 +220,6 @@ export declare const actionWrapTextInContainer: {
221
220
  boxSelectionMode: import("../types").BoxSelectionMode;
222
221
  bindingPreference: "enabled" | "disabled";
223
222
  isMidpointSnappingEnabled: boolean;
224
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
225
223
  suggestedBinding: {
226
224
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
227
225
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -58,7 +58,6 @@ export declare const actionClearCanvas: {
58
58
  boxSelectionMode: import("../types").BoxSelectionMode;
59
59
  bindingPreference: "enabled" | "disabled";
60
60
  isMidpointSnappingEnabled: boolean;
61
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
62
61
  suggestedBinding: {
63
62
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
64
63
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -210,7 +209,6 @@ export declare const actionZoomIn: {
210
209
  boxSelectionMode: import("../types").BoxSelectionMode;
211
210
  bindingPreference: "enabled" | "disabled";
212
211
  isMidpointSnappingEnabled: boolean;
213
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
214
212
  suggestedBinding: {
215
213
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
216
214
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -386,7 +384,6 @@ export declare const actionZoomOut: {
386
384
  boxSelectionMode: import("../types").BoxSelectionMode;
387
385
  bindingPreference: "enabled" | "disabled";
388
386
  isMidpointSnappingEnabled: boolean;
389
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
390
387
  suggestedBinding: {
391
388
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
392
389
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -562,7 +559,6 @@ export declare const actionResetZoom: {
562
559
  boxSelectionMode: import("../types").BoxSelectionMode;
563
560
  bindingPreference: "enabled" | "disabled";
564
561
  isMidpointSnappingEnabled: boolean;
565
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
566
562
  suggestedBinding: {
567
563
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
568
564
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -739,7 +735,6 @@ export declare const zoomToFitBounds: ({ bounds, appState, canvasOffsets, fitToV
739
735
  boxSelectionMode: import("../types").BoxSelectionMode;
740
736
  bindingPreference: "enabled" | "disabled";
741
737
  isMidpointSnappingEnabled: boolean;
742
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
743
738
  suggestedBinding: {
744
739
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
745
740
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -912,7 +907,6 @@ export declare const zoomToFit: ({ canvasOffsets, targetElements, appState, fitT
912
907
  boxSelectionMode: import("../types").BoxSelectionMode;
913
908
  bindingPreference: "enabled" | "disabled";
914
909
  isMidpointSnappingEnabled: boolean;
915
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
916
910
  suggestedBinding: {
917
911
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
918
912
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -1082,7 +1076,6 @@ export declare const actionZoomToFitSelectionInViewport: {
1082
1076
  boxSelectionMode: import("../types").BoxSelectionMode;
1083
1077
  bindingPreference: "enabled" | "disabled";
1084
1078
  isMidpointSnappingEnabled: boolean;
1085
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
1086
1079
  suggestedBinding: {
1087
1080
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
1088
1081
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -1256,7 +1249,6 @@ export declare const actionZoomToFitSelection: {
1256
1249
  boxSelectionMode: import("../types").BoxSelectionMode;
1257
1250
  bindingPreference: "enabled" | "disabled";
1258
1251
  isMidpointSnappingEnabled: boolean;
1259
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
1260
1252
  suggestedBinding: {
1261
1253
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
1262
1254
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -1431,7 +1423,6 @@ export declare const actionZoomToFit: {
1431
1423
  boxSelectionMode: import("../types").BoxSelectionMode;
1432
1424
  bindingPreference: "enabled" | "disabled";
1433
1425
  isMidpointSnappingEnabled: boolean;
1434
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
1435
1426
  suggestedBinding: {
1436
1427
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
1437
1428
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -1606,7 +1597,6 @@ export declare const actionToggleEraserTool: {
1606
1597
  boxSelectionMode: import("../types").BoxSelectionMode;
1607
1598
  bindingPreference: "enabled" | "disabled";
1608
1599
  isMidpointSnappingEnabled: boolean;
1609
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
1610
1600
  suggestedBinding: {
1611
1601
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
1612
1602
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -1772,7 +1762,6 @@ export declare const actionToggleLassoTool: {
1772
1762
  boxSelectionMode: import("../types").BoxSelectionMode;
1773
1763
  bindingPreference: "enabled" | "disabled";
1774
1764
  isMidpointSnappingEnabled: boolean;
1775
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
1776
1765
  suggestedBinding: {
1777
1766
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
1778
1767
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -1937,7 +1926,6 @@ export declare const actionToggleHandTool: {
1937
1926
  boxSelectionMode: import("../types").BoxSelectionMode;
1938
1927
  bindingPreference: "enabled" | "disabled";
1939
1928
  isMidpointSnappingEnabled: boolean;
1940
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
1941
1929
  suggestedBinding: {
1942
1930
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
1943
1931
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -30,7 +30,6 @@ export declare const actionPaste: {
30
30
  boxSelectionMode: import("../types").BoxSelectionMode;
31
31
  bindingPreference: "enabled" | "disabled";
32
32
  isMidpointSnappingEnabled: boolean;
33
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
34
33
  suggestedBinding: {
35
34
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
36
35
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -240,7 +239,6 @@ export declare const actionCopyAsPng: {
240
239
  boxSelectionMode: import("../types").BoxSelectionMode;
241
240
  bindingPreference: "enabled" | "disabled";
242
241
  isMidpointSnappingEnabled: boolean;
243
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
244
242
  suggestedBinding: {
245
243
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
246
244
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -31,7 +31,6 @@ export declare const actionToggleCropEditor: {
31
31
  boxSelectionMode: import("../types").BoxSelectionMode;
32
32
  bindingPreference: "enabled" | "disabled";
33
33
  isMidpointSnappingEnabled: boolean;
34
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
35
34
  suggestedBinding: {
36
35
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
37
36
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -32,7 +32,6 @@ export declare const actionDeleteSelected: {
32
32
  boxSelectionMode: import("../types").BoxSelectionMode;
33
33
  bindingPreference: "enabled" | "disabled";
34
34
  isMidpointSnappingEnabled: boolean;
35
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
36
35
  suggestedBinding: {
37
36
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
38
37
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -225,7 +224,6 @@ export declare const actionDeleteSelected: {
225
224
  boxSelectionMode: import("../types").BoxSelectionMode;
226
225
  bindingPreference: "enabled" | "disabled";
227
226
  isMidpointSnappingEnabled: boolean;
228
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
229
227
  suggestedBinding: {
230
228
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
231
229
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -391,7 +389,6 @@ export declare const actionDeleteSelected: {
391
389
  boxSelectionMode: import("../types").BoxSelectionMode;
392
390
  bindingPreference: "enabled" | "disabled";
393
391
  isMidpointSnappingEnabled: boolean;
394
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
395
392
  suggestedBinding: {
396
393
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
397
394
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -15,6 +15,7 @@ export declare const actionDeselect: {
15
15
  selectionElement: null;
16
16
  showHyperlinkPopup: false;
17
17
  suggestedBinding: null;
18
+ frameToHighlight: null;
18
19
  selectedElementIds: AppState["selectedElementIds"];
19
20
  selectedGroupIds: AppState["selectedGroupIds"];
20
21
  editingGroupId: AppState["editingGroupId"];
@@ -33,8 +34,6 @@ export declare const actionDeselect: {
33
34
  boxSelectionMode: import("../types").BoxSelectionMode;
34
35
  bindingPreference: "enabled" | "disabled";
35
36
  isMidpointSnappingEnabled: boolean;
36
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
37
- frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
38
37
  frameRendering: {
39
38
  enabled: boolean;
40
39
  name: boolean;
@@ -60,7 +60,6 @@ export declare const actionLinkToElement: {
60
60
  boxSelectionMode: import("../types").BoxSelectionMode;
61
61
  bindingPreference: "enabled" | "disabled";
62
62
  isMidpointSnappingEnabled: boolean;
63
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
64
63
  suggestedBinding: {
65
64
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
66
65
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -42,7 +42,6 @@ export declare const actionToggleElementLock: {
42
42
  boxSelectionMode: import("../types").BoxSelectionMode;
43
43
  bindingPreference: "enabled" | "disabled";
44
44
  isMidpointSnappingEnabled: boolean;
45
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
46
45
  suggestedBinding: {
47
46
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
48
47
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -213,7 +212,6 @@ export declare const actionUnlockAllElements: {
213
212
  boxSelectionMode: import("../types").BoxSelectionMode;
214
213
  bindingPreference: "enabled" | "disabled";
215
214
  isMidpointSnappingEnabled: boolean;
216
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
217
215
  suggestedBinding: {
218
216
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
219
217
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -33,7 +33,6 @@ export declare const actionSetEmbeddableAsActiveTool: {
33
33
  boxSelectionMode: import("../types").BoxSelectionMode;
34
34
  bindingPreference: "enabled" | "disabled";
35
35
  isMidpointSnappingEnabled: boolean;
36
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
37
36
  suggestedBinding: {
38
37
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
39
38
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -115,7 +115,6 @@ export declare const actionLoadScene: {
115
115
  boxSelectionMode: import("../types").BoxSelectionMode;
116
116
  bindingPreference: "enabled" | "disabled";
117
117
  isMidpointSnappingEnabled: boolean;
118
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
119
118
  suggestedBinding: {
120
119
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
121
120
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -260,7 +259,6 @@ export declare const actionLoadScene: {
260
259
  boxSelectionMode: import("../types").BoxSelectionMode;
261
260
  bindingPreference: "enabled" | "disabled";
262
261
  isMidpointSnappingEnabled: boolean;
263
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
264
262
  suggestedBinding: {
265
263
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
266
264
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -30,7 +30,6 @@ export declare const actionSelectAllElementsInFrame: {
30
30
  boxSelectionMode: import("../types").BoxSelectionMode;
31
31
  bindingPreference: "enabled" | "disabled";
32
32
  isMidpointSnappingEnabled: boolean;
33
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
34
33
  suggestedBinding: {
35
34
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
36
35
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -206,7 +205,6 @@ export declare const actionRemoveAllElementsFromFrame: {
206
205
  boxSelectionMode: import("../types").BoxSelectionMode;
207
206
  bindingPreference: "enabled" | "disabled";
208
207
  isMidpointSnappingEnabled: boolean;
209
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
210
208
  suggestedBinding: {
211
209
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
212
210
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -386,7 +384,6 @@ export declare const actionupdateFrameRendering: {
386
384
  boxSelectionMode: import("../types").BoxSelectionMode;
387
385
  bindingPreference: "enabled" | "disabled";
388
386
  isMidpointSnappingEnabled: boolean;
389
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
390
387
  suggestedBinding: {
391
388
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
392
389
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -559,7 +556,6 @@ export declare const actionSetFrameAsActiveTool: {
559
556
  boxSelectionMode: import("../types").BoxSelectionMode;
560
557
  bindingPreference: "enabled" | "disabled";
561
558
  isMidpointSnappingEnabled: boolean;
562
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
563
559
  suggestedBinding: {
564
560
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
565
561
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -36,7 +36,6 @@ export declare const actionGroup: {
36
36
  boxSelectionMode: import("../types").BoxSelectionMode;
37
37
  bindingPreference: "enabled" | "disabled";
38
38
  isMidpointSnappingEnabled: boolean;
39
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
40
39
  suggestedBinding: {
41
40
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
42
41
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -211,7 +210,6 @@ export declare const actionUngroup: {
211
210
  boxSelectionMode: import("../types").BoxSelectionMode;
212
211
  bindingPreference: "enabled" | "disabled";
213
212
  isMidpointSnappingEnabled: boolean;
214
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
215
213
  suggestedBinding: {
216
214
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
217
215
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -63,7 +63,6 @@ export declare const actionToggleLinearEditor: {
63
63
  boxSelectionMode: import("../types").BoxSelectionMode;
64
64
  bindingPreference: "enabled" | "disabled";
65
65
  isMidpointSnappingEnabled: boolean;
66
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
67
66
  suggestedBinding: {
68
67
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
69
68
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -27,7 +27,6 @@ export declare const actionLink: {
27
27
  boxSelectionMode: import("../types").BoxSelectionMode;
28
28
  bindingPreference: "enabled" | "disabled";
29
29
  isMidpointSnappingEnabled: boolean;
30
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
31
30
  suggestedBinding: {
32
31
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
33
32
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -34,7 +34,6 @@ export declare const actionShortcuts: {
34
34
  boxSelectionMode: import("../types").BoxSelectionMode;
35
35
  bindingPreference: "enabled" | "disabled";
36
36
  isMidpointSnappingEnabled: boolean;
37
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
38
37
  suggestedBinding: {
39
38
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
40
39
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -56,7 +56,6 @@ export declare const actionDecreaseFontSize: {
56
56
  boxSelectionMode: import("../types").BoxSelectionMode;
57
57
  bindingPreference: "enabled" | "disabled";
58
58
  isMidpointSnappingEnabled: boolean;
59
- startBoundElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawBindableElement> | null;
60
59
  suggestedBinding: {
61
60
  element: import("@excalidraw/element/types").NonDeleted<ExcalidrawBindableElement>;
62
61
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -227,7 +226,6 @@ export declare const actionIncreaseFontSize: {
227
226
  boxSelectionMode: import("../types").BoxSelectionMode;
228
227
  bindingPreference: "enabled" | "disabled";
229
228
  isMidpointSnappingEnabled: boolean;
230
- startBoundElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawBindableElement> | null;
231
229
  suggestedBinding: {
232
230
  element: import("@excalidraw/element/types").NonDeleted<ExcalidrawBindableElement>;
233
231
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -34,7 +34,6 @@ export declare const actionSelectAll: {
34
34
  boxSelectionMode: import("../types").BoxSelectionMode;
35
35
  bindingPreference: "enabled" | "disabled";
36
36
  isMidpointSnappingEnabled: boolean;
37
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
38
37
  suggestedBinding: {
39
38
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
40
39
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -32,7 +32,6 @@ export declare const actionCopyStyles: {
32
32
  boxSelectionMode: import("../types").BoxSelectionMode;
33
33
  bindingPreference: "enabled" | "disabled";
34
34
  isMidpointSnappingEnabled: boolean;
35
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
36
35
  suggestedBinding: {
37
36
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
38
37
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -28,7 +28,6 @@ export declare const actionToggleArrowBinding: {
28
28
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
29
29
  boxSelectionMode: import("../types").BoxSelectionMode;
30
30
  isMidpointSnappingEnabled: boolean;
31
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
32
31
  suggestedBinding: {
33
32
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
34
33
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -33,7 +33,6 @@ export declare const actionToggleGridMode: {
33
33
  boxSelectionMode: import("../types").BoxSelectionMode;
34
34
  bindingPreference: "enabled" | "disabled";
35
35
  isMidpointSnappingEnabled: boolean;
36
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
37
36
  suggestedBinding: {
38
37
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
39
38
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -28,7 +28,6 @@ export declare const actionToggleMidpointSnapping: {
28
28
  isBindingEnabled: boolean;
29
29
  boxSelectionMode: import("../types").BoxSelectionMode;
30
30
  bindingPreference: "enabled" | "disabled";
31
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
32
31
  suggestedBinding: {
33
32
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
34
33
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -31,7 +31,6 @@ export declare const actionToggleObjectsSnapMode: {
31
31
  boxSelectionMode: import("../types").BoxSelectionMode;
32
32
  bindingPreference: "enabled" | "disabled";
33
33
  isMidpointSnappingEnabled: boolean;
34
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
35
34
  suggestedBinding: {
36
35
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
37
36
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -37,7 +37,6 @@ export declare const actionToggleSearchMenu: {
37
37
  boxSelectionMode: import("../types").BoxSelectionMode;
38
38
  bindingPreference: "enabled" | "disabled";
39
39
  isMidpointSnappingEnabled: boolean;
40
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
41
40
  suggestedBinding: {
42
41
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
43
42
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -33,7 +33,6 @@ export declare const actionToggleStats: {
33
33
  boxSelectionMode: import("../types").BoxSelectionMode;
34
34
  bindingPreference: "enabled" | "disabled";
35
35
  isMidpointSnappingEnabled: boolean;
36
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
37
36
  suggestedBinding: {
38
37
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
39
38
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -30,7 +30,6 @@ export declare const actionToggleViewMode: {
30
30
  boxSelectionMode: import("../types").BoxSelectionMode;
31
31
  bindingPreference: "enabled" | "disabled";
32
32
  isMidpointSnappingEnabled: boolean;
33
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
34
33
  suggestedBinding: {
35
34
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
36
35
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -30,7 +30,6 @@ export declare const actionToggleZenMode: {
30
30
  boxSelectionMode: import("../types").BoxSelectionMode;
31
31
  bindingPreference: "enabled" | "disabled";
32
32
  isMidpointSnappingEnabled: boolean;
33
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
34
33
  suggestedBinding: {
35
34
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
36
35
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -361,6 +361,7 @@ declare class App extends React.Component<AppProps, AppState> {
361
361
  } | "cursor" | "center";
362
362
  retainSeed?: boolean;
363
363
  fitToContent?: boolean;
364
+ preserveFrameChildrenOrder?: boolean;
364
365
  }) => void;
365
366
  private addElementsFromMixedContentPaste;
366
367
  private addTextFromPaste;
@@ -494,7 +495,15 @@ declare class App extends React.Component<AppProps, AppState> {
494
495
  private handleCanvasClick;
495
496
  private getElementLinkAtPosition;
496
497
  private handleElementLinkClick;
498
+ /**
499
+ * finds candidate frame under cursor (when dragging frame children/elements
500
+ * inside frames)
501
+ */
497
502
  private getTopLayerFrameAtSceneCoords;
503
+ private updateFrameToHighlight;
504
+ private maybeUpdateFrameToHighlightOnPointerMove;
505
+ private insertNewElements;
506
+ private insertNewElement;
498
507
  private handleCanvasPointerMove;
499
508
  private handleEraser;
500
509
  private handleTouchMove;
@@ -11,7 +11,7 @@ type InteractiveCanvasProps = {
11
11
  visibleElements: readonly NonDeletedExcalidrawElement[];
12
12
  selectedElements: readonly NonDeletedExcalidrawElement[];
13
13
  allElementsMap: NonDeletedSceneElementsMap;
14
- sceneNonce: number | undefined;
14
+ canvasNonce: string;
15
15
  selectionNonce: number | undefined;
16
16
  scale: number;
17
17
  appState: InteractiveCanvasAppState;
@@ -4,6 +4,7 @@ import type { AppState } from "../../types";
4
4
  import type { RoughCanvas } from "roughjs/bin/canvas";
5
5
  interface NewElementCanvasProps {
6
6
  appState: AppState;
7
+ newElement: NonNullable<AppState["newElement"]>;
7
8
  elementsMap: RenderableElementsMap;
8
9
  allElementsMap: NonDeletedSceneElementsMap;
9
10
  scale: number;
@@ -9,7 +9,7 @@ type StaticCanvasProps = {
9
9
  elementsMap: RenderableElementsMap;
10
10
  allElementsMap: NonDeletedSceneElementsMap;
11
11
  visibleElements: readonly NonDeletedExcalidrawElement[];
12
- sceneNonce: number | undefined;
12
+ canvasNonce: string;
13
13
  selectionNonce: number | undefined;
14
14
  scale: number;
15
15
  appState: StaticCanvasAppState;
@@ -169,6 +169,13 @@ export declare const getToolbarTools: (app: AppClassProperties) => readonly [{
169
169
  readonly fillable: false;
170
170
  readonly toolbar: false;
171
171
  }] | readonly [{
172
+ readonly icon: import("react/jsx-runtime").JSX.Element;
173
+ readonly value: "hand";
174
+ readonly key: "h";
175
+ readonly numericKey: null;
176
+ readonly fillable: false;
177
+ readonly toolbar: true;
178
+ }, {
172
179
  readonly value: "lasso";
173
180
  readonly icon: import("react/jsx-runtime").JSX.Element;
174
181
  readonly key: "v";
@@ -53,7 +53,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
53
53
  boxSelectionMode: import("../types").BoxSelectionMode;
54
54
  bindingPreference: "enabled" | "disabled";
55
55
  isMidpointSnappingEnabled: boolean;
56
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
57
56
  suggestedBinding: {
58
57
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
59
58
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -219,7 +218,6 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
219
218
  boxSelectionMode: import("../types").BoxSelectionMode;
220
219
  bindingPreference: "enabled" | "disabled";
221
220
  isMidpointSnappingEnabled: boolean;
222
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
223
221
  suggestedBinding: {
224
222
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
225
223
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -51,7 +51,6 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
51
51
  boxSelectionMode: import("../types").BoxSelectionMode;
52
52
  bindingPreference: "enabled" | "disabled";
53
53
  isMidpointSnappingEnabled: boolean;
54
- startBoundElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
55
54
  suggestedBinding: {
56
55
  element: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
57
56
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -1,30 +1,436 @@
1
- import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
1
+ import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
2
  import type { Scene } from "@excalidraw/element";
3
3
  import type { RenderableElementsMap } from "./types";
4
4
  import type { AppState } from "../types";
5
+ type GetRenderableElementsOpts = {
6
+ zoom: AppState["zoom"];
7
+ offsetLeft: AppState["offsetLeft"];
8
+ offsetTop: AppState["offsetTop"];
9
+ scrollX: AppState["scrollX"];
10
+ scrollY: AppState["scrollY"];
11
+ height: AppState["height"];
12
+ width: AppState["width"];
13
+ editingTextElement: AppState["editingTextElement"];
14
+ newElement: AppState["newElement"];
15
+ selectedElements: readonly NonDeletedExcalidrawElement[];
16
+ selectedElementsAreBeingDragged: AppState["selectedElementsAreBeingDragged"];
17
+ frameToHighlight: AppState["frameToHighlight"];
18
+ };
5
19
  export declare class Renderer {
6
20
  private scene;
7
21
  constructor(scene: Scene);
8
- getRenderableElements: ((opts: {
9
- zoom: Readonly<{
10
- value: import("../types").NormalizedZoomValue;
11
- }>;
12
- offsetLeft: AppState["offsetLeft"];
13
- offsetTop: AppState["offsetTop"];
14
- scrollX: AppState["scrollX"];
15
- scrollY: AppState["scrollY"];
16
- height: AppState["height"];
17
- width: AppState["width"];
18
- editingTextElement: AppState["editingTextElement"];
19
- /** note: first render of newElement will always bust the cache
20
- * (we'd have to prefilter elements outside of this function) */
21
- newElementId: ExcalidrawElement["id"] | undefined;
22
- sceneNonce: ReturnType<InstanceType<typeof Scene>["getSceneNonce"]>;
23
- }) => {
22
+ private getVisibleCanvasElements;
23
+ private getRenderableElementsMap;
24
+ private sortSelectedElementsIntoHighlightedFrame;
25
+ private _getRenderableElements;
26
+ getRenderableElements: (opts: GetRenderableElementsOpts) => {
24
27
  elementsMap: RenderableElementsMap;
25
28
  visibleElements: readonly NonDeletedExcalidrawElement[];
26
- }) & {
27
- clear: () => void;
29
+ newElementCanvasElement: (Readonly<{
30
+ id: string;
31
+ x: number;
32
+ y: number;
33
+ strokeColor: string;
34
+ backgroundColor: string;
35
+ fillStyle: import("@excalidraw/element/types").FillStyle;
36
+ strokeWidth: number;
37
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
38
+ roundness: null | {
39
+ type: import("@excalidraw/element/types").RoundnessType;
40
+ value?: number;
41
+ };
42
+ roughness: number;
43
+ opacity: number;
44
+ width: number;
45
+ height: number;
46
+ angle: import("@excalidraw/math").Radians;
47
+ seed: number;
48
+ version: number;
49
+ versionNonce: number;
50
+ index: import("@excalidraw/element/types").FractionalIndex | null;
51
+ isDeleted: boolean;
52
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
53
+ frameId: string | null;
54
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
55
+ updated: number;
56
+ link: string | null;
57
+ locked: boolean;
58
+ customData?: Record<string, any>;
59
+ }> & Readonly<{
60
+ type: "line" | "arrow";
61
+ points: readonly import("@excalidraw/math").LocalPoint[];
62
+ startBinding: import("@excalidraw/element/types").FixedPointBinding | null;
63
+ endBinding: import("@excalidraw/element/types").FixedPointBinding | null;
64
+ startArrowhead: import("@excalidraw/element/types").Arrowhead | null;
65
+ endArrowhead: import("@excalidraw/element/types").Arrowhead | null;
66
+ }> & {
67
+ isDeleted: boolean;
68
+ }) | (Readonly<{
69
+ id: string;
70
+ x: number;
71
+ y: number;
72
+ strokeColor: string;
73
+ backgroundColor: string;
74
+ fillStyle: import("@excalidraw/element/types").FillStyle;
75
+ strokeWidth: number;
76
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
77
+ roundness: null | {
78
+ type: import("@excalidraw/element/types").RoundnessType;
79
+ value?: number;
80
+ };
81
+ roughness: number;
82
+ opacity: number;
83
+ width: number;
84
+ height: number;
85
+ angle: import("@excalidraw/math").Radians;
86
+ seed: number;
87
+ version: number;
88
+ versionNonce: number;
89
+ index: import("@excalidraw/element/types").FractionalIndex | null;
90
+ isDeleted: boolean;
91
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
92
+ frameId: string | null;
93
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
94
+ updated: number;
95
+ link: string | null;
96
+ locked: boolean;
97
+ customData?: Record<string, any>;
98
+ }> & {
99
+ type: "rectangle";
100
+ } & {
101
+ isDeleted: boolean;
102
+ }) | (Readonly<{
103
+ id: string;
104
+ x: number;
105
+ y: number;
106
+ strokeColor: string;
107
+ backgroundColor: string;
108
+ fillStyle: import("@excalidraw/element/types").FillStyle;
109
+ strokeWidth: number;
110
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
111
+ roundness: null | {
112
+ type: import("@excalidraw/element/types").RoundnessType;
113
+ value?: number;
114
+ };
115
+ roughness: number;
116
+ opacity: number;
117
+ width: number;
118
+ height: number;
119
+ angle: import("@excalidraw/math").Radians;
120
+ seed: number;
121
+ version: number;
122
+ versionNonce: number;
123
+ index: import("@excalidraw/element/types").FractionalIndex | null;
124
+ isDeleted: boolean;
125
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
126
+ frameId: string | null;
127
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
128
+ updated: number;
129
+ link: string | null;
130
+ locked: boolean;
131
+ customData?: Record<string, any>;
132
+ }> & {
133
+ type: "diamond";
134
+ } & {
135
+ isDeleted: boolean;
136
+ }) | (Readonly<{
137
+ id: string;
138
+ x: number;
139
+ y: number;
140
+ strokeColor: string;
141
+ backgroundColor: string;
142
+ fillStyle: import("@excalidraw/element/types").FillStyle;
143
+ strokeWidth: number;
144
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
145
+ roundness: null | {
146
+ type: import("@excalidraw/element/types").RoundnessType;
147
+ value?: number;
148
+ };
149
+ roughness: number;
150
+ opacity: number;
151
+ width: number;
152
+ height: number;
153
+ angle: import("@excalidraw/math").Radians;
154
+ seed: number;
155
+ version: number;
156
+ versionNonce: number;
157
+ index: import("@excalidraw/element/types").FractionalIndex | null;
158
+ isDeleted: boolean;
159
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
160
+ frameId: string | null;
161
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
162
+ updated: number;
163
+ link: string | null;
164
+ locked: boolean;
165
+ customData?: Record<string, any>;
166
+ }> & {
167
+ type: "ellipse";
168
+ } & {
169
+ isDeleted: boolean;
170
+ }) | (Readonly<{
171
+ id: string;
172
+ x: number;
173
+ y: number;
174
+ strokeColor: string;
175
+ backgroundColor: string;
176
+ fillStyle: import("@excalidraw/element/types").FillStyle;
177
+ strokeWidth: number;
178
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
179
+ roundness: null | {
180
+ type: import("@excalidraw/element/types").RoundnessType;
181
+ value?: number;
182
+ };
183
+ roughness: number;
184
+ opacity: number;
185
+ width: number;
186
+ height: number;
187
+ angle: import("@excalidraw/math").Radians;
188
+ seed: number;
189
+ version: number;
190
+ versionNonce: number;
191
+ index: import("@excalidraw/element/types").FractionalIndex | null;
192
+ isDeleted: boolean;
193
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
194
+ frameId: string | null;
195
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
196
+ updated: number;
197
+ link: string | null;
198
+ locked: boolean;
199
+ customData?: Record<string, any>;
200
+ }> & Readonly<{
201
+ type: "embeddable";
202
+ }> & {
203
+ isDeleted: boolean;
204
+ }) | (Readonly<{
205
+ id: string;
206
+ x: number;
207
+ y: number;
208
+ strokeColor: string;
209
+ backgroundColor: string;
210
+ fillStyle: import("@excalidraw/element/types").FillStyle;
211
+ strokeWidth: number;
212
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
213
+ roundness: null | {
214
+ type: import("@excalidraw/element/types").RoundnessType;
215
+ value?: number;
216
+ };
217
+ roughness: number;
218
+ opacity: number;
219
+ width: number;
220
+ height: number;
221
+ angle: import("@excalidraw/math").Radians;
222
+ seed: number;
223
+ version: number;
224
+ versionNonce: number;
225
+ index: import("@excalidraw/element/types").FractionalIndex | null;
226
+ isDeleted: boolean;
227
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
228
+ frameId: string | null;
229
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
230
+ updated: number;
231
+ link: string | null;
232
+ locked: boolean;
233
+ customData?: Record<string, any>;
234
+ }> & Readonly<{
235
+ type: "iframe";
236
+ customData?: {
237
+ generationData?: import("@excalidraw/element/types").MagicGenerationData;
238
+ };
239
+ }> & {
240
+ isDeleted: boolean;
241
+ }) | (Readonly<{
242
+ id: string;
243
+ x: number;
244
+ y: number;
245
+ strokeColor: string;
246
+ backgroundColor: string;
247
+ fillStyle: import("@excalidraw/element/types").FillStyle;
248
+ strokeWidth: number;
249
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
250
+ roundness: null | {
251
+ type: import("@excalidraw/element/types").RoundnessType;
252
+ value?: number;
253
+ };
254
+ roughness: number;
255
+ opacity: number;
256
+ width: number;
257
+ height: number;
258
+ angle: import("@excalidraw/math").Radians;
259
+ seed: number;
260
+ version: number;
261
+ versionNonce: number;
262
+ index: import("@excalidraw/element/types").FractionalIndex | null;
263
+ isDeleted: boolean;
264
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
265
+ frameId: string | null;
266
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
267
+ updated: number;
268
+ link: string | null;
269
+ locked: boolean;
270
+ customData?: Record<string, any>;
271
+ }> & Readonly<{
272
+ type: "image";
273
+ fileId: import("@excalidraw/element/types").FileId | null;
274
+ status: "pending" | "saved" | "error";
275
+ scale: [number, number];
276
+ crop: import("@excalidraw/element/types").ImageCrop | null;
277
+ }> & {
278
+ isDeleted: boolean;
279
+ }) | (Readonly<{
280
+ id: string;
281
+ x: number;
282
+ y: number;
283
+ strokeColor: string;
284
+ backgroundColor: string;
285
+ fillStyle: import("@excalidraw/element/types").FillStyle;
286
+ strokeWidth: number;
287
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
288
+ roundness: null | {
289
+ type: import("@excalidraw/element/types").RoundnessType;
290
+ value?: number;
291
+ };
292
+ roughness: number;
293
+ opacity: number;
294
+ width: number;
295
+ height: number;
296
+ angle: import("@excalidraw/math").Radians;
297
+ seed: number;
298
+ version: number;
299
+ versionNonce: number;
300
+ index: import("@excalidraw/element/types").FractionalIndex | null;
301
+ isDeleted: boolean;
302
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
303
+ frameId: string | null;
304
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
305
+ updated: number;
306
+ link: string | null;
307
+ locked: boolean;
308
+ customData?: Record<string, any>;
309
+ }> & {
310
+ type: "frame";
311
+ name: string | null;
312
+ } & {
313
+ isDeleted: boolean;
314
+ }) | (Readonly<{
315
+ id: string;
316
+ x: number;
317
+ y: number;
318
+ strokeColor: string;
319
+ backgroundColor: string;
320
+ fillStyle: import("@excalidraw/element/types").FillStyle;
321
+ strokeWidth: number;
322
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
323
+ roundness: null | {
324
+ type: import("@excalidraw/element/types").RoundnessType;
325
+ value?: number;
326
+ };
327
+ roughness: number;
328
+ opacity: number;
329
+ width: number;
330
+ height: number;
331
+ angle: import("@excalidraw/math").Radians;
332
+ seed: number;
333
+ version: number;
334
+ versionNonce: number;
335
+ index: import("@excalidraw/element/types").FractionalIndex | null;
336
+ isDeleted: boolean;
337
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
338
+ frameId: string | null;
339
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
340
+ updated: number;
341
+ link: string | null;
342
+ locked: boolean;
343
+ customData?: Record<string, any>;
344
+ }> & {
345
+ type: "magicframe";
346
+ name: string | null;
347
+ } & {
348
+ isDeleted: boolean;
349
+ }) | (Readonly<{
350
+ id: string;
351
+ x: number;
352
+ y: number;
353
+ strokeColor: string;
354
+ backgroundColor: string;
355
+ fillStyle: import("@excalidraw/element/types").FillStyle;
356
+ strokeWidth: number;
357
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
358
+ roundness: null | {
359
+ type: import("@excalidraw/element/types").RoundnessType;
360
+ value?: number;
361
+ };
362
+ roughness: number;
363
+ opacity: number;
364
+ width: number;
365
+ height: number;
366
+ angle: import("@excalidraw/math").Radians;
367
+ seed: number;
368
+ version: number;
369
+ versionNonce: number;
370
+ index: import("@excalidraw/element/types").FractionalIndex | null;
371
+ isDeleted: boolean;
372
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
373
+ frameId: string | null;
374
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
375
+ updated: number;
376
+ link: string | null;
377
+ locked: boolean;
378
+ customData?: Record<string, any>;
379
+ }> & Readonly<{
380
+ type: "text";
381
+ fontSize: number;
382
+ fontFamily: import("@excalidraw/element/types").FontFamilyValues;
383
+ text: string;
384
+ textAlign: import("@excalidraw/element/types").TextAlign;
385
+ verticalAlign: import("@excalidraw/element/types").VerticalAlign;
386
+ containerId: import("@excalidraw/element/types").ExcalidrawGenericElement["id"] | null;
387
+ originalText: string;
388
+ autoResize: boolean;
389
+ lineHeight: number & {
390
+ _brand: "unitlessLineHeight";
391
+ };
392
+ }> & {
393
+ isDeleted: boolean;
394
+ }) | (Readonly<{
395
+ id: string;
396
+ x: number;
397
+ y: number;
398
+ strokeColor: string;
399
+ backgroundColor: string;
400
+ fillStyle: import("@excalidraw/element/types").FillStyle;
401
+ strokeWidth: number;
402
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
403
+ roundness: null | {
404
+ type: import("@excalidraw/element/types").RoundnessType;
405
+ value?: number;
406
+ };
407
+ roughness: number;
408
+ opacity: number;
409
+ width: number;
410
+ height: number;
411
+ angle: import("@excalidraw/math").Radians;
412
+ seed: number;
413
+ version: number;
414
+ versionNonce: number;
415
+ index: import("@excalidraw/element/types").FractionalIndex | null;
416
+ isDeleted: boolean;
417
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
418
+ frameId: string | null;
419
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
420
+ updated: number;
421
+ link: string | null;
422
+ locked: boolean;
423
+ customData?: Record<string, any>;
424
+ }> & Readonly<{
425
+ type: "freedraw";
426
+ points: readonly import("@excalidraw/math").LocalPoint[];
427
+ pressures: readonly number[];
428
+ simulatePressure: boolean;
429
+ }> & {
430
+ isDeleted: boolean;
431
+ }) | null;
432
+ canvasNonce: string;
28
433
  };
29
434
  destroy(): void;
30
435
  }
436
+ export {};
@@ -217,7 +217,10 @@ export interface AppState {
217
217
  bindingPreference: "enabled" | "disabled";
218
218
  /** user preference whether arrow snap to midpoints while binding */
219
219
  isMidpointSnappingEnabled: boolean;
220
- startBoundElement: NonDeleted<ExcalidrawBindableElement> | null;
220
+ /**
221
+ * The bindable element the UI highlights for the user when an arrow is
222
+ * dragged or otherwise its endpoint being close to said element.
223
+ */
221
224
  suggestedBinding: {
222
225
  element: NonDeleted<ExcalidrawBindableElement>;
223
226
  midPoint?: GlobalPoint;
@@ -389,7 +392,7 @@ export type SearchMatch = {
389
392
  showOnCanvas: boolean;
390
393
  }[];
391
394
  };
392
- export type UIAppState = Omit<AppState, "startBoundElement" | "cursorButton" | "scrollX" | "scrollY">;
395
+ export type UIAppState = Omit<AppState, "cursorButton" | "scrollX" | "scrollY">;
393
396
  export type NormalizedZoomValue = number & {
394
397
  _brand: "normalizedZoom";
395
398
  };
@@ -0,0 +1,29 @@
1
+ export declare const BASE_62_DIGITS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
2
+ /**
3
+ * @param {string} key
4
+ * @param {string} digits
5
+ * @return {void}
6
+ */
7
+ export declare function validateOrderKey(key: string, digits?: string): void;
8
+ /**
9
+ * @param {string | null | undefined} a
10
+ * @param {string | null | undefined} b
11
+ * @param {string=} digits
12
+ * @return {string}
13
+ */
14
+ export declare function generateKeyBetween(a: string | null | undefined, b: string | null | undefined, digits?: string): string;
15
+ /**
16
+ * same preconditions as generateKeysBetween.
17
+ * n >= 0.
18
+ * Returns an array of n distinct keys in sorted order.
19
+ * If a and b are both null, returns [a0, a1, ...]
20
+ * If one or the other is null, returns consecutive "integer"
21
+ * keys. Otherwise, returns relatively short keys between
22
+ * a and b.
23
+ * @param {string | null | undefined} a
24
+ * @param {string | null | undefined} b
25
+ * @param {number} n
26
+ * @param {string} digits
27
+ * @return {string[]}
28
+ */
29
+ export declare function generateNKeysBetween(a: string | null | undefined, b: string | null | undefined, n: number, digits?: string): string[];
@@ -1,3 +1,2 @@
1
- export declare const PRECISION = 0.0001;
2
1
  export declare const LegendreGaussN24TValues: number[];
3
2
  export declare const LegendreGaussN24CValues: number[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@excalidraw/common",
3
- "version": "0.18.0-b1c6bfc",
3
+ "version": "0.18.0-b2b2815",
4
4
  "type": "module",
5
5
  "types": "./dist/types/common/src/index.d.ts",
6
6
  "main": "./dist/prod/index.js",