@myoc/math 0.19.505 → 0.19.508

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 (58) hide show
  1. package/dist/dev/index.js +32 -7
  2. package/dist/dev/index.js.map +2 -2
  3. package/dist/prod/index.js +1 -1
  4. package/dist/types/element/src/Scene.d.ts +5 -3
  5. package/dist/types/element/src/bounds.d.ts +4 -2
  6. package/dist/types/element/src/duplicate.d.ts +1 -0
  7. package/dist/types/element/src/frame.d.ts +7 -6
  8. package/dist/types/element/src/linearElementEditor.d.ts +2 -2
  9. package/dist/types/element/src/selection.d.ts +2 -2
  10. package/dist/types/element/src/shape.d.ts +1 -1
  11. package/dist/types/element/src/typeChecks.d.ts +1 -0
  12. package/dist/types/element/src/utils.d.ts +1 -1
  13. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +3 -3
  14. package/dist/types/excalidraw/actions/actionBoundText.d.ts +2 -2
  15. package/dist/types/excalidraw/actions/actionCanvas.d.ts +11 -11
  16. package/dist/types/excalidraw/actions/actionClipboard.d.ts +2 -2
  17. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +1 -1
  18. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +3 -3
  19. package/dist/types/excalidraw/actions/actionDeselect.d.ts +168 -0
  20. package/dist/types/excalidraw/actions/actionElementLink.d.ts +1 -1
  21. package/dist/types/excalidraw/actions/actionElementLock.d.ts +2 -2
  22. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +1 -1
  23. package/dist/types/excalidraw/actions/actionExport.d.ts +2 -2
  24. package/dist/types/excalidraw/actions/actionFrame.d.ts +4 -4
  25. package/dist/types/excalidraw/actions/actionGroup.d.ts +2 -2
  26. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +1 -1
  27. package/dist/types/excalidraw/actions/actionLink.d.ts +1 -1
  28. package/dist/types/excalidraw/actions/actionMenu.d.ts +1 -1
  29. package/dist/types/excalidraw/actions/actionProperties.d.ts +2 -2
  30. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +1 -1
  31. package/dist/types/excalidraw/actions/actionStyles.d.ts +3 -5
  32. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +1 -1
  33. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +1 -1
  34. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +1 -1
  35. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +1 -1
  36. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +1 -1
  37. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +1 -1
  38. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +1 -1
  39. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +2 -3
  40. package/dist/types/excalidraw/actions/index.d.ts +1 -0
  41. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  42. package/dist/types/excalidraw/appState.d.ts +1 -0
  43. package/dist/types/excalidraw/components/App.d.ts +9 -0
  44. package/dist/types/excalidraw/components/PublishLibrary.d.ts +3 -2
  45. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -1
  46. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
  47. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
  48. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -1
  49. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -0
  50. package/dist/types/excalidraw/data/blob.d.ts +4 -8
  51. package/dist/types/excalidraw/data/json.d.ts +1 -1
  52. package/dist/types/excalidraw/scene/Renderer.d.ts +425 -19
  53. package/dist/types/excalidraw/scene/types.d.ts +2 -0
  54. package/dist/types/excalidraw/types.d.ts +15 -2
  55. package/dist/types/fractional-indexing/src/index.d.ts +29 -0
  56. package/dist/types/math/src/constants.d.ts +0 -1
  57. package/dist/types/math/src/curve.d.ts +4 -1
  58. package/package.json +4 -3
@@ -36,9 +36,9 @@ export declare const actionLink: {
36
36
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
37
37
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
38
38
  isBindingEnabled: boolean;
39
+ boxSelectionMode: import("../types").BoxSelectionMode;
39
40
  bindingPreference: "enabled" | "disabled";
40
41
  isMidpointSnappingEnabled: boolean;
41
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
42
42
  suggestedBinding: {
43
43
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
44
44
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -43,9 +43,9 @@ export declare const actionShortcuts: {
43
43
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
44
44
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
45
45
  isBindingEnabled: boolean;
46
+ boxSelectionMode: import("../types").BoxSelectionMode;
46
47
  bindingPreference: "enabled" | "disabled";
47
48
  isMidpointSnappingEnabled: boolean;
48
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
49
49
  suggestedBinding: {
50
50
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
51
51
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -65,9 +65,9 @@ export declare const actionDecreaseFontSize: {
65
65
  multiElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawLinearElement> | null;
66
66
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
67
67
  isBindingEnabled: boolean;
68
+ boxSelectionMode: import("../types").BoxSelectionMode;
68
69
  bindingPreference: "enabled" | "disabled";
69
70
  isMidpointSnappingEnabled: boolean;
70
- startBoundElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawBindableElement> | null;
71
71
  suggestedBinding: {
72
72
  element: import("@excalidraw/element/types").NonDeleted<ExcalidrawBindableElement>;
73
73
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -244,9 +244,9 @@ export declare const actionIncreaseFontSize: {
244
244
  multiElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawLinearElement> | null;
245
245
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
246
246
  isBindingEnabled: boolean;
247
+ boxSelectionMode: import("../types").BoxSelectionMode;
247
248
  bindingPreference: "enabled" | "disabled";
248
249
  isMidpointSnappingEnabled: boolean;
249
- startBoundElement: import("@excalidraw/element/types").NonDeleted<ExcalidrawBindableElement> | null;
250
250
  suggestedBinding: {
251
251
  element: import("@excalidraw/element/types").NonDeleted<ExcalidrawBindableElement>;
252
252
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -43,9 +43,9 @@ export declare const actionSelectAll: {
43
43
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
44
44
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
45
45
  isBindingEnabled: boolean;
46
+ boxSelectionMode: import("../types").BoxSelectionMode;
46
47
  bindingPreference: "enabled" | "disabled";
47
48
  isMidpointSnappingEnabled: boolean;
48
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
49
49
  suggestedBinding: {
50
50
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
51
51
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -41,9 +41,9 @@ export declare const actionCopyStyles: {
41
41
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
42
42
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
43
43
  isBindingEnabled: boolean;
44
+ boxSelectionMode: import("../types").BoxSelectionMode;
44
45
  bindingPreference: "enabled" | "disabled";
45
46
  isMidpointSnappingEnabled: boolean;
46
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
47
47
  suggestedBinding: {
48
48
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
49
49
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -174,9 +174,8 @@ export declare const actionCopyStyles: {
174
174
  };
175
175
  captureUpdate: "EVENTUALLY";
176
176
  };
177
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
178
177
  } & {
179
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
178
+ keyTest?: undefined;
180
179
  };
181
180
  export declare const actionPasteStyles: {
182
181
  name: "pasteStyles";
@@ -192,7 +191,6 @@ export declare const actionPasteStyles: {
192
191
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
193
192
  captureUpdate: "IMMEDIATELY";
194
193
  };
195
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
196
194
  } & {
197
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
195
+ keyTest?: undefined;
198
196
  };
@@ -38,8 +38,8 @@ export declare const actionToggleArrowBinding: {
38
38
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
39
39
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
40
40
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
41
+ boxSelectionMode: import("../types").BoxSelectionMode;
41
42
  isMidpointSnappingEnabled: boolean;
42
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
43
43
  suggestedBinding: {
44
44
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
45
45
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -42,9 +42,9 @@ export declare const actionToggleGridMode: {
42
42
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
43
43
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
44
44
  isBindingEnabled: boolean;
45
+ boxSelectionMode: import("../types").BoxSelectionMode;
45
46
  bindingPreference: "enabled" | "disabled";
46
47
  isMidpointSnappingEnabled: boolean;
47
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
48
48
  suggestedBinding: {
49
49
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
50
50
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -38,8 +38,8 @@ export declare const actionToggleMidpointSnapping: {
38
38
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
39
39
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
40
40
  isBindingEnabled: boolean;
41
+ boxSelectionMode: import("../types").BoxSelectionMode;
41
42
  bindingPreference: "enabled" | "disabled";
42
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
43
43
  suggestedBinding: {
44
44
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
45
45
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -40,9 +40,9 @@ export declare const actionToggleObjectsSnapMode: {
40
40
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
41
41
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
42
42
  isBindingEnabled: boolean;
43
+ boxSelectionMode: import("../types").BoxSelectionMode;
43
44
  bindingPreference: "enabled" | "disabled";
44
45
  isMidpointSnappingEnabled: boolean;
45
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
46
46
  suggestedBinding: {
47
47
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
48
48
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -46,9 +46,9 @@ export declare const actionToggleSearchMenu: {
46
46
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
47
47
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
48
48
  isBindingEnabled: boolean;
49
+ boxSelectionMode: import("../types").BoxSelectionMode;
49
50
  bindingPreference: "enabled" | "disabled";
50
51
  isMidpointSnappingEnabled: boolean;
51
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
52
52
  suggestedBinding: {
53
53
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
54
54
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -42,9 +42,9 @@ export declare const actionToggleStats: {
42
42
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
43
43
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
44
44
  isBindingEnabled: boolean;
45
+ boxSelectionMode: import("../types").BoxSelectionMode;
45
46
  bindingPreference: "enabled" | "disabled";
46
47
  isMidpointSnappingEnabled: boolean;
47
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
48
48
  suggestedBinding: {
49
49
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
50
50
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -39,9 +39,9 @@ export declare const actionToggleViewMode: {
39
39
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
40
40
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
41
41
  isBindingEnabled: boolean;
42
+ boxSelectionMode: import("../types").BoxSelectionMode;
42
43
  bindingPreference: "enabled" | "disabled";
43
44
  isMidpointSnappingEnabled: boolean;
44
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
45
45
  suggestedBinding: {
46
46
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
47
47
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -39,9 +39,9 @@ export declare const actionToggleZenMode: {
39
39
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
40
40
  selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
41
41
  isBindingEnabled: boolean;
42
+ boxSelectionMode: import("../types").BoxSelectionMode;
42
43
  bindingPreference: "enabled" | "disabled";
43
44
  isMidpointSnappingEnabled: boolean;
44
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
45
45
  suggestedBinding: {
46
46
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
47
47
  midPoint?: import("@excalidraw/math").GlobalPoint;
@@ -178,7 +178,6 @@ export declare const actionToggleZenMode: {
178
178
  };
179
179
  checked: (appState: Readonly<import("../types").AppState>) => boolean;
180
180
  predicate: (elements: readonly import("@excalidraw/element/types").ExcalidrawElement[], appState: import("../types").AppState, appProps: import("../types").ExcalidrawProps, app: import("../types").AppClassProperties) => boolean;
181
- keyTest: (event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean;
182
181
  } & {
183
- keyTest?: ((event: import("react").KeyboardEvent<Element> | KeyboardEvent) => boolean) | undefined;
182
+ keyTest?: undefined;
184
183
  };
@@ -6,6 +6,7 @@ export { actionChangeStrokeColor, actionChangeBackgroundColor, actionChangeStrok
6
6
  export { actionChangeViewBackgroundColor, actionZoomIn, actionZoomOut, actionResetZoom, actionZoomToFit, actionToggleTheme, } from "./actionCanvas";
7
7
  export { actionSetEmbeddableAsActiveTool } from "./actionEmbeddable";
8
8
  export { actionFinalize } from "./actionFinalize";
9
+ export { actionDeselect } from "./actionDeselect";
9
10
  export { actionChangeProjectName, actionChangeExportBackground, actionSaveToActiveFile, actionSaveFileToDisk, actionLoadScene, } from "./actionExport";
10
11
  export { actionCopyStyles, actionPasteStyles } from "./actionStyles";
11
12
  export { actionShortcuts } from "./actionMenu";
@@ -14,7 +14,7 @@ export type ActionResult = {
14
14
  type ActionFn<TData = any> = (elements: readonly OrderedExcalidrawElement[], appState: Readonly<AppState>, formData: TData | undefined, app: AppClassProperties) => ActionResult | Promise<ActionResult>;
15
15
  export type UpdaterFn = (res: ActionResult) => void;
16
16
  export type ActionFilterFn = (action: Action) => void;
17
- export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "arrowBinding" | "midpointSnapping" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "arrangeElements" | "normaliseElements" | "flipHorizontal" | "flipVertical" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "smartZoom" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
17
+ export type ActionName = "copy" | "cut" | "paste" | "copyAsPng" | "copyAsSvg" | "copyText" | "sendBackward" | "bringForward" | "sendToBack" | "bringToFront" | "copyStyles" | "selectAll" | "pasteStyles" | "gridMode" | "zenMode" | "objectsSnapMode" | "arrowBinding" | "midpointSnapping" | "stats" | "changeStrokeColor" | "changeBackgroundColor" | "changeFillStyle" | "changeStrokeWidth" | "changeStrokeShape" | "changeSloppiness" | "changeStrokeStyle" | "changeArrowhead" | "changeArrowType" | "changeArrowProperties" | "changeOpacity" | "changeFontSize" | "undo" | "redo" | "finalize" | "changeProjectName" | "changeExportBackground" | "changeExportEmbedScene" | "changeExportScale" | "saveToActiveFile" | "saveFileToDisk" | "loadScene" | "duplicateSelection" | "deleteSelectedElements" | "changeViewBackgroundColor" | "zoomIn" | "zoomOut" | "resetZoom" | "zoomToFit" | "zoomToFitSelection" | "zoomToFitSelectionInViewport" | "changeFontFamily" | "changeTextAlign" | "changeVerticalAlign" | "toggleFullScreen" | "toggleShortcuts" | "group" | "ungroup" | "goToCollaborator" | "addToLibrary" | "changeRoundness" | "alignTop" | "alignBottom" | "alignLeft" | "alignRight" | "alignVerticallyCentered" | "alignHorizontallyCentered" | "distributeHorizontally" | "distributeVertically" | "arrangeElements" | "normaliseElements" | "flipHorizontal" | "flipVertical" | "deselect" | "viewMode" | "exportWithDarkMode" | "toggleTheme" | "increaseFontSize" | "decreaseFontSize" | "unbindText" | "hyperlink" | "bindText" | "unlockAllElements" | "toggleElementLock" | "toggleLinearEditor" | "toggleEraserTool" | "toggleHandTool" | "selectAllElementsInFrame" | "removeAllElementsFromFrame" | "updateFrameRendering" | "setFrameAsActiveTool" | "setEmbeddableAsActiveTool" | "createContainerFromText" | "wrapTextInContainer" | "commandPalette" | "autoResize" | "elementStats" | "searchMenu" | "copyElementLink" | "linkToElement" | "cropEditor" | "wrapSelectionInFrame" | "smartZoom" | "toggleLassoTool" | "toggleShapeSwitch" | "togglePolygon";
18
18
  export type PanelComponentProps = {
19
19
  elements: readonly ExcalidrawElement[];
20
20
  appState: AppState;
@@ -46,6 +46,7 @@ export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>)
46
46
  mode: import("./types").NormaliseMode;
47
47
  metric: import("./types").NormaliseMetric;
48
48
  } | undefined;
49
+ boxSelectionMode?: import("./types").BoxSelectionMode | undefined;
49
50
  bindingPreference?: "disabled" | "enabled" | undefined;
50
51
  preferredSelectionTool?: {
51
52
  type: "selection" | "lasso";
@@ -363,6 +363,7 @@ declare class App extends React.Component<AppProps, AppState> {
363
363
  } | "cursor" | "center";
364
364
  retainSeed?: boolean;
365
365
  fitToContent?: boolean;
366
+ preserveFrameChildrenOrder?: boolean;
366
367
  }) => void;
367
368
  private addElementsFromMixedContentPaste;
368
369
  private addTextFromPaste;
@@ -505,7 +506,15 @@ declare class App extends React.Component<AppProps, AppState> {
505
506
  private handleCanvasClick;
506
507
  private getElementLinkAtPosition;
507
508
  private handleElementLinkClick;
509
+ /**
510
+ * finds candidate frame under cursor (when dragging frame children/elements
511
+ * inside frames)
512
+ */
508
513
  private getTopLayerFrameAtSceneCoords;
514
+ private updateFrameToHighlight;
515
+ private maybeUpdateFrameToHighlightOnPointerMove;
516
+ private insertNewElements;
517
+ private insertNewElement;
509
518
  private handleCanvasPointerMove;
510
519
  private handleEraser;
511
520
  private handleTouchMove;
@@ -1,6 +1,6 @@
1
1
  import "./PublishLibrary.scss";
2
- import type { LibraryItems, UIAppState } from "../types";
3
- declare const PublishLibrary: ({ onClose, libraryItems, appState, onSuccess, onError, updateItemsInStorage, onRemove, }: {
2
+ import type { CompressImageFile, LibraryItems, UIAppState } from "../types";
3
+ declare const PublishLibrary: ({ onClose, libraryItems, appState, onSuccess, onError, updateItemsInStorage, onRemove, compressImageFile, }: {
4
4
  onClose: () => void;
5
5
  libraryItems: LibraryItems;
6
6
  appState: UIAppState;
@@ -12,5 +12,6 @@ declare const PublishLibrary: ({ onClose, libraryItems, appState, onSuccess, onE
12
12
  onError: (error: Error) => void;
13
13
  updateItemsInStorage: (items: LibraryItems) => void;
14
14
  onRemove: (id: string) => void;
15
+ compressImageFile: CompressImageFile;
15
16
  }) => import("react/jsx-runtime").JSX.Element;
16
17
  export default PublishLibrary;
@@ -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;
@@ -9,9 +9,10 @@ type Props<T> = {
9
9
  onChange: (value: T) => void;
10
10
  children: React.ReactNode;
11
11
  name: string;
12
+ icon?: React.ReactNode;
12
13
  };
13
14
  declare const DropdownMenuItemContentRadio: {
14
- <T>({ value, shortcut, onChange, choices, children, name, }: Props<T>): import("react/jsx-runtime").JSX.Element;
15
+ <T>({ value, shortcut, onChange, choices, children, name, icon, }: Props<T>): import("react/jsx-runtime").JSX.Element;
15
16
  displayName: string;
16
17
  };
17
18
  export default DropdownMenuItemContentRadio;
@@ -66,6 +66,7 @@ export declare const Preferences: {
66
66
  additionalItems?: React.ReactNode;
67
67
  }): import("react/jsx-runtime").JSX.Element;
68
68
  ToggleToolLock: () => import("react/jsx-runtime").JSX.Element;
69
+ BoxSelectionMode: () => import("react/jsx-runtime").JSX.Element;
69
70
  ToggleSnapMode: () => import("react/jsx-runtime").JSX.Element;
70
71
  ToggleArrowBinding: () => import("react/jsx-runtime").JSX.Element;
71
72
  ToggleMidpointSnapping: () => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { IMAGE_MIME_TYPES, MIME_TYPES } from "@excalidraw/common";
2
2
  import type { ValueOf } from "@excalidraw/common/utility-types";
3
3
  import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
4
- import type { AppState, DataURL, LibraryItem } from "../types";
4
+ import type { AppState, CompressImageFile, DataURL, LibraryItem } from "../types";
5
5
  import type { ImportedLibraryData } from "./types";
6
6
  export declare const getMimeType: (blob: Blob | string) => string;
7
7
  export declare const getFileHandleType: (handle: FileSystemFileHandle | null) => string | null;
@@ -121,8 +121,8 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
121
121
  };
122
122
  errorMessage: React.ReactNode;
123
123
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
124
+ boxSelectionMode: import("../types").BoxSelectionMode;
124
125
  bindingPreference: "enabled" | "disabled";
125
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
126
126
  editingFrame: string | null;
127
127
  preferredSelectionTool: {
128
128
  type: "selection" | "lasso";
@@ -295,8 +295,8 @@ fileHandle?: FileSystemFileHandle | null) => Promise<{
295
295
  };
296
296
  errorMessage: React.ReactNode;
297
297
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
298
+ boxSelectionMode: import("../types").BoxSelectionMode;
298
299
  bindingPreference: "enabled" | "disabled";
299
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
300
300
  editingFrame: string | null;
301
301
  preferredSelectionTool: {
302
302
  type: "selection" | "lasso";
@@ -368,11 +368,7 @@ export declare const getDataURL: (file: Blob | File) => Promise<DataURL>;
368
368
  export declare const getDataURL_sync: (data: string | Uint8Array | ArrayBuffer, mimeType: ValueOf<typeof MIME_TYPES>) => DataURL;
369
369
  export declare const dataURLToFile: (dataURL: DataURL, filename?: string) => File;
370
370
  export declare const dataURLToString: (dataURL: DataURL) => string;
371
- export declare const resizeImageFile: (file: File, opts: {
372
- /** undefined indicates auto */
373
- outputType?: (typeof MIME_TYPES)["jpg"];
374
- maxWidthOrHeight: number;
375
- }) => Promise<File>;
371
+ export declare const resizeImageFile: CompressImageFile;
376
372
  export declare const SVGStringToFile: (SVGString: string, filename?: string) => File & {
377
373
  type: typeof MIME_TYPES.svg;
378
374
  };
@@ -119,8 +119,8 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
119
119
  };
120
120
  errorMessage: React.ReactNode;
121
121
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
122
+ boxSelectionMode: import("../types").BoxSelectionMode;
122
123
  bindingPreference: "enabled" | "disabled";
123
- startBoundElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
124
124
  editingFrame: string | null;
125
125
  preferredSelectionTool: {
126
126
  type: "selection" | "lasso";