@excalidraw/math 0.18.0-1118751 → 0.18.0-143b5b6

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 (59) hide show
  1. package/dist/types/common/src/constants.d.ts +3 -0
  2. package/dist/types/common/src/utils.d.ts +5 -0
  3. package/dist/types/element/src/binding.d.ts +8 -0
  4. package/dist/types/element/src/collision.d.ts +6 -0
  5. package/dist/types/element/src/index.d.ts +1 -0
  6. package/dist/types/element/src/listMarker.d.ts +34 -0
  7. package/dist/types/element/src/newElement.d.ts +15 -1
  8. package/dist/types/element/src/textElement.d.ts +7 -0
  9. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +27 -3
  10. package/dist/types/excalidraw/actions/actionBoundText.d.ts +18 -2
  11. package/dist/types/excalidraw/actions/actionCanvas.d.ts +63 -7
  12. package/dist/types/excalidraw/actions/actionClipboard.d.ts +18 -2
  13. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +9 -1
  14. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +27 -3
  15. package/dist/types/excalidraw/actions/actionDeselect.d.ts +12 -1
  16. package/dist/types/excalidraw/actions/actionElementLink.d.ts +9 -1
  17. package/dist/types/excalidraw/actions/actionElementLock.d.ts +18 -2
  18. package/dist/types/excalidraw/actions/actionExport.d.ts +18 -2
  19. package/dist/types/excalidraw/actions/actionFrame.d.ts +27 -3
  20. package/dist/types/excalidraw/actions/actionGroup.d.ts +18 -2
  21. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +9 -1
  22. package/dist/types/excalidraw/actions/actionLink.d.ts +9 -1
  23. package/dist/types/excalidraw/actions/actionMenu.d.ts +9 -1
  24. package/dist/types/excalidraw/actions/actionProperties.d.ts +18 -2
  25. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +9 -1
  26. package/dist/types/excalidraw/actions/actionStyles.d.ts +9 -1
  27. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +9 -1
  28. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +9 -1
  29. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +9 -1
  30. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +9 -1
  31. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +9 -1
  32. package/dist/types/excalidraw/actions/actionToggleShowHints.d.ts +197 -0
  33. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +9 -1
  34. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +9 -1
  35. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +9 -1
  36. package/dist/types/excalidraw/actions/index.d.ts +1 -0
  37. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  38. package/dist/types/excalidraw/appState.d.ts +1 -0
  39. package/dist/types/excalidraw/components/App.arrowText.d.ts +5 -39
  40. package/dist/types/excalidraw/components/App.clipboard.d.ts +31 -0
  41. package/dist/types/excalidraw/components/App.d.ts +58 -258
  42. package/dist/types/excalidraw/components/App.duplicate.d.ts +52 -2
  43. package/dist/types/excalidraw/components/App.modifiers.d.ts +38 -0
  44. package/dist/types/excalidraw/components/App.pan.d.ts +8 -0
  45. package/dist/types/excalidraw/components/App.selectionTool.d.ts +57 -0
  46. package/dist/types/excalidraw/components/App.text.d.ts +146 -0
  47. package/dist/types/excalidraw/components/App.textTool.d.ts +140 -0
  48. package/dist/types/excalidraw/components/App.viewport.d.ts +41 -1
  49. package/dist/types/excalidraw/components/FileDropOverlay.d.ts +2 -0
  50. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +6 -2
  51. package/dist/types/excalidraw/components/LibraryUnit.d.ts +7 -2
  52. package/dist/types/excalidraw/components/Tooltip.d.ts +15 -1
  53. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +1 -0
  54. package/dist/types/excalidraw/data/blob.d.ts +18 -2
  55. package/dist/types/excalidraw/data/json.d.ts +9 -1
  56. package/dist/types/excalidraw/types.d.ts +35 -13
  57. package/dist/types/excalidraw/viewport.d.ts +22 -1
  58. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +12 -1
  59. package/package.json +2 -2
@@ -108,12 +108,20 @@ export declare const zoomToFitBounds: ({ bounds, appState, canvasOffsets, fit, m
108
108
  boxSelectionMode: import("./types").BoxSelectionMode;
109
109
  bindingPreference: "enabled" | "disabled";
110
110
  isMidpointSnappingEnabled: boolean;
111
+ showHints: boolean;
111
112
  inputDevice: import("./types").InputDevice;
112
113
  suggestedBinding: {
113
114
  element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
114
115
  midPoint?: import("@excalidraw/math").GlobalPoint;
115
116
  } | null;
116
- hoveredArrowTextAnchor: {
117
+ textToolHover: {
118
+ type: "text";
119
+ elementId: ExcalidrawElement["id"];
120
+ } | {
121
+ type: "container";
122
+ elementId: ExcalidrawElement["id"];
123
+ } | {
124
+ type: "arrow";
117
125
  elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
118
126
  anchor: "start" | "end" | "label";
119
127
  } | null;
@@ -274,6 +282,19 @@ export declare const centerScrollOn: ({ scenePoint, viewportDimensions, zoom, of
274
282
  scrollX: number;
275
283
  scrollY: number;
276
284
  };
285
+ /**
286
+ * The scroll that brings `bounds` into the viewport — less `offsets` (screen
287
+ * px: UI covering its edges, room to leave) — by the least movement, keeping
288
+ * the zoom; `null` when they're in view already. Along an axis where they
289
+ * don't fit, their start (left / top) is brought in instead, or, with
290
+ * `tooLarge: "leave"`, that axis keeps its scroll.
291
+ */
292
+ export declare const scrollBoundsIntoView: ({ bounds: [x1, y1, x2, y2], appState: { scrollX, scrollY, zoom, width, height }, offsets, tooLarge, }: {
293
+ bounds: Bounds;
294
+ appState: Pick<AppState, "scrollX" | "scrollY" | "zoom" | "width" | "height">;
295
+ offsets?: Offsets;
296
+ tooLarge?: "alignStart" | "leave";
297
+ }) => Pick<AppState, "scrollX" | "scrollY"> | null;
277
298
  export declare const getScrollToContentState: (elements: readonly ExcalidrawElement[], appState: AppState) => {
278
299
  scrollX: number;
279
300
  scrollY: number;
@@ -1,7 +1,13 @@
1
1
  import type { ExcalidrawTextElement } from "@excalidraw/element/types";
2
2
  import type App from "../components/App";
3
+ /**
4
+ * How much further than the browser's caret reveal the canvas pans, in
5
+ * screen px: text typed past the viewport's edge comes back with this much
6
+ * room to spare, instead of flush against the edge.
7
+ */
8
+ export declare const CARET_FOLLOW_PADDING = 5;
3
9
  type SubmitHandler = () => void;
4
- export declare const textWysiwyg: ({ onChange, onSubmit, getViewportCoords, element, canvas, excalidrawContainer, app, autoSelect, initialCaretSceneCoords, }: {
10
+ export declare const textWysiwyg: ({ onChange, onSubmit, getViewportCoords, element, canvas, excalidrawContainer, app, autoSelect, initialCaretSceneCoords, initialSelection, }: {
5
11
  /**
6
12
  * textWysiwyg only deals with `originalText`
7
13
  *
@@ -23,5 +29,10 @@ export declare const textWysiwyg: ({ onChange, onSubmit, getViewportCoords, elem
23
29
  x: number;
24
30
  y: number;
25
31
  } | null;
32
+ /** range of `originalText` to select (takes precedence over the caret) */
33
+ initialSelection?: {
34
+ start: number;
35
+ end: number;
36
+ } | null;
26
37
  }) => SubmitHandler;
27
38
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@excalidraw/math",
3
- "version": "0.18.0-1118751",
3
+ "version": "0.18.0-143b5b6",
4
4
  "type": "module",
5
5
  "types": "./dist/types/math/src/index.d.ts",
6
6
  "main": "./dist/prod/index.js",
@@ -61,6 +61,6 @@
61
61
  "build:esm": "rimraf dist && node ../../scripts/buildBase.js && yarn gen:types"
62
62
  },
63
63
  "dependencies": {
64
- "@excalidraw/common": "0.18.0-1118751"
64
+ "@excalidraw/common": "0.18.0-143b5b6"
65
65
  }
66
66
  }