@wordpress/media-editor 0.8.0 → 0.8.1-next.v.202605131032.0

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 (217) hide show
  1. package/build/components/media-editor/index.cjs +560 -0
  2. package/build/components/media-editor/index.cjs.map +7 -0
  3. package/build/components/media-editor-canvas/index.cjs +14 -2
  4. package/build/components/media-editor-canvas/index.cjs.map +2 -2
  5. package/build/components/media-editor-crop-panel/index.cjs +34 -27
  6. package/build/components/media-editor-crop-panel/index.cjs.map +2 -2
  7. package/build/components/media-editor-keyboard-shortcuts-modal/index.cjs +162 -0
  8. package/build/components/media-editor-keyboard-shortcuts-modal/index.cjs.map +7 -0
  9. package/build/components/media-editor-modal/index.cjs +42 -430
  10. package/build/components/media-editor-modal/index.cjs.map +3 -3
  11. package/build/components/media-editor-toolbar/index.cjs +143 -75
  12. package/build/components/media-editor-toolbar/index.cjs.map +3 -3
  13. package/build/components/media-form/index.cjs +3 -0
  14. package/build/components/media-form/index.cjs.map +2 -2
  15. package/build/components/rotation-ruler/index.cjs +197 -0
  16. package/build/components/rotation-ruler/index.cjs.map +7 -0
  17. package/build/components/rotation-ruler/use-ruler-drag.cjs +154 -0
  18. package/build/components/rotation-ruler/use-ruler-drag.cjs.map +7 -0
  19. package/build/hooks/use-crop-gesture-handlers.cjs +43 -0
  20. package/build/hooks/use-crop-gesture-handlers.cjs.map +7 -0
  21. package/build/image-editor/core/constants.cjs +9 -0
  22. package/build/image-editor/core/constants.cjs.map +2 -2
  23. package/build/image-editor/core/containment.cjs +7 -13
  24. package/build/image-editor/core/containment.cjs.map +2 -2
  25. package/build/image-editor/core/interaction-controller.cjs +43 -7
  26. package/build/image-editor/core/interaction-controller.cjs.map +2 -2
  27. package/build/image-editor/core/state.cjs +5 -1
  28. package/build/image-editor/core/state.cjs.map +2 -2
  29. package/build/image-editor/core/transform-style.cjs.map +1 -1
  30. package/build/image-editor/core/types.cjs.map +1 -1
  31. package/build/image-editor/core/viewport-state.cjs +50 -0
  32. package/build/image-editor/core/viewport-state.cjs.map +7 -0
  33. package/build/image-editor/react/components/cropper.cjs +192 -72
  34. package/build/image-editor/react/components/cropper.cjs.map +3 -3
  35. package/build/image-editor/react/components/overlays/dimming-overlay.cjs +5 -2
  36. package/build/image-editor/react/components/overlays/dimming-overlay.cjs.map +2 -2
  37. package/build/image-editor/react/components/stencils/rectangle-stencil.cjs +16 -4
  38. package/build/image-editor/react/components/stencils/rectangle-stencil.cjs.map +2 -2
  39. package/build/image-editor/react/components/viewport-provider.cjs +51 -0
  40. package/build/image-editor/react/components/viewport-provider.cjs.map +7 -0
  41. package/build/image-editor/react/hooks/use-aria-announcer.cjs +53 -6
  42. package/build/image-editor/react/hooks/use-aria-announcer.cjs.map +2 -2
  43. package/build/image-editor/react/hooks/use-cropper-state.cjs +127 -8
  44. package/build/image-editor/react/hooks/use-cropper-state.cjs.map +2 -2
  45. package/build/image-editor/react/hooks/use-interaction.cjs +26 -5
  46. package/build/image-editor/react/hooks/use-interaction.cjs.map +2 -2
  47. package/build/image-editor/react/hooks/use-viewport-state.cjs +51 -0
  48. package/build/image-editor/react/hooks/use-viewport-state.cjs.map +7 -0
  49. package/build/image-editor/react/visually-hidden-style.cjs +41 -0
  50. package/build/image-editor/react/visually-hidden-style.cjs.map +7 -0
  51. package/build/private-apis.cjs +2 -0
  52. package/build/private-apis.cjs.map +2 -2
  53. package/build-module/components/media-editor/index.mjs +545 -0
  54. package/build-module/components/media-editor/index.mjs.map +7 -0
  55. package/build-module/components/media-editor-canvas/index.mjs +14 -2
  56. package/build-module/components/media-editor-canvas/index.mjs.map +2 -2
  57. package/build-module/components/media-editor-crop-panel/index.mjs +35 -28
  58. package/build-module/components/media-editor-crop-panel/index.mjs.map +2 -2
  59. package/build-module/components/media-editor-keyboard-shortcuts-modal/index.mjs +144 -0
  60. package/build-module/components/media-editor-keyboard-shortcuts-modal/index.mjs.map +7 -0
  61. package/build-module/components/media-editor-modal/index.mjs +46 -455
  62. package/build-module/components/media-editor-modal/index.mjs.map +2 -2
  63. package/build-module/components/media-editor-toolbar/index.mjs +137 -77
  64. package/build-module/components/media-editor-toolbar/index.mjs.map +2 -2
  65. package/build-module/components/media-form/index.mjs +3 -0
  66. package/build-module/components/media-form/index.mjs.map +2 -2
  67. package/build-module/components/rotation-ruler/index.mjs +166 -0
  68. package/build-module/components/rotation-ruler/index.mjs.map +7 -0
  69. package/build-module/components/rotation-ruler/use-ruler-drag.mjs +126 -0
  70. package/build-module/components/rotation-ruler/use-ruler-drag.mjs.map +7 -0
  71. package/build-module/hooks/use-crop-gesture-handlers.mjs +17 -0
  72. package/build-module/hooks/use-crop-gesture-handlers.mjs.map +7 -0
  73. package/build-module/image-editor/core/constants.mjs +6 -0
  74. package/build-module/image-editor/core/constants.mjs.map +2 -2
  75. package/build-module/image-editor/core/containment.mjs +6 -12
  76. package/build-module/image-editor/core/containment.mjs.map +2 -2
  77. package/build-module/image-editor/core/interaction-controller.mjs +50 -8
  78. package/build-module/image-editor/core/interaction-controller.mjs.map +2 -2
  79. package/build-module/image-editor/core/state.mjs +5 -1
  80. package/build-module/image-editor/core/state.mjs.map +2 -2
  81. package/build-module/image-editor/core/transform-style.mjs.map +1 -1
  82. package/build-module/image-editor/core/viewport-state.mjs +24 -0
  83. package/build-module/image-editor/core/viewport-state.mjs.map +7 -0
  84. package/build-module/image-editor/react/components/cropper.mjs +195 -73
  85. package/build-module/image-editor/react/components/cropper.mjs.map +3 -3
  86. package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs +5 -2
  87. package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs.map +2 -2
  88. package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs +26 -5
  89. package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs.map +2 -2
  90. package/build-module/image-editor/react/components/viewport-provider.mjs +27 -0
  91. package/build-module/image-editor/react/components/viewport-provider.mjs.map +7 -0
  92. package/build-module/image-editor/react/hooks/use-aria-announcer.mjs +59 -7
  93. package/build-module/image-editor/react/hooks/use-aria-announcer.mjs.map +2 -2
  94. package/build-module/image-editor/react/hooks/use-cropper-state.mjs +134 -9
  95. package/build-module/image-editor/react/hooks/use-cropper-state.mjs.map +2 -2
  96. package/build-module/image-editor/react/hooks/use-interaction.mjs +26 -5
  97. package/build-module/image-editor/react/hooks/use-interaction.mjs.map +2 -2
  98. package/build-module/image-editor/react/hooks/use-viewport-state.mjs +29 -0
  99. package/build-module/image-editor/react/hooks/use-viewport-state.mjs.map +7 -0
  100. package/build-module/image-editor/react/visually-hidden-style.mjs +16 -0
  101. package/build-module/image-editor/react/visually-hidden-style.mjs.map +7 -0
  102. package/build-module/private-apis.mjs +2 -0
  103. package/build-module/private-apis.mjs.map +2 -2
  104. package/build-style/style-rtl.css +254 -29
  105. package/build-style/style.css +254 -29
  106. package/build-types/components/media-editor/index.d.ts +34 -0
  107. package/build-types/components/media-editor/index.d.ts.map +1 -0
  108. package/build-types/components/media-editor-canvas/index.d.ts +10 -1
  109. package/build-types/components/media-editor-canvas/index.d.ts.map +1 -1
  110. package/build-types/components/media-editor-crop-panel/index.d.ts +1 -1
  111. package/build-types/components/media-editor-crop-panel/index.d.ts.map +1 -1
  112. package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts +6 -0
  113. package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts.map +1 -0
  114. package/build-types/components/media-editor-modal/index.d.ts +2 -2
  115. package/build-types/components/media-editor-modal/index.d.ts.map +1 -1
  116. package/build-types/components/media-editor-provider/index.d.ts +1 -1
  117. package/build-types/components/media-editor-provider/index.d.ts.map +1 -1
  118. package/build-types/components/media-editor-toolbar/index.d.ts +4 -1
  119. package/build-types/components/media-editor-toolbar/index.d.ts.map +1 -1
  120. package/build-types/components/media-form/index.d.ts +1 -1
  121. package/build-types/components/media-form/index.d.ts.map +1 -1
  122. package/build-types/components/rotation-ruler/index.d.ts +46 -0
  123. package/build-types/components/rotation-ruler/index.d.ts.map +1 -0
  124. package/build-types/components/rotation-ruler/stories/index.story.d.ts +14 -0
  125. package/build-types/components/rotation-ruler/stories/index.story.d.ts.map +1 -0
  126. package/build-types/components/rotation-ruler/use-ruler-drag.d.ts +61 -0
  127. package/build-types/components/rotation-ruler/use-ruler-drag.d.ts.map +1 -0
  128. package/build-types/hooks/use-crop-gesture-handlers.d.ts +42 -0
  129. package/build-types/hooks/use-crop-gesture-handlers.d.ts.map +1 -0
  130. package/build-types/image-editor/core/constants.d.ts +9 -0
  131. package/build-types/image-editor/core/constants.d.ts.map +1 -1
  132. package/build-types/image-editor/core/containment.d.ts +11 -7
  133. package/build-types/image-editor/core/containment.d.ts.map +1 -1
  134. package/build-types/image-editor/core/interaction-controller.d.ts +14 -2
  135. package/build-types/image-editor/core/interaction-controller.d.ts.map +1 -1
  136. package/build-types/image-editor/core/state.d.ts.map +1 -1
  137. package/build-types/image-editor/core/transform-style.d.ts +1 -1
  138. package/build-types/image-editor/core/types.d.ts +25 -0
  139. package/build-types/image-editor/core/types.d.ts.map +1 -1
  140. package/build-types/image-editor/core/viewport-state.d.ts +7 -0
  141. package/build-types/image-editor/core/viewport-state.d.ts.map +1 -0
  142. package/build-types/image-editor/react/components/cropper-provider.d.ts +1 -1
  143. package/build-types/image-editor/react/components/cropper-provider.d.ts.map +1 -1
  144. package/build-types/image-editor/react/components/cropper.d.ts +2 -1
  145. package/build-types/image-editor/react/components/cropper.d.ts.map +1 -1
  146. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts +3 -13
  147. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts.map +1 -1
  148. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts +1 -1
  149. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts.map +1 -1
  150. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts +1 -1
  151. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts.map +1 -1
  152. package/build-types/image-editor/react/components/viewport-provider.d.ts +9 -0
  153. package/build-types/image-editor/react/components/viewport-provider.d.ts.map +1 -0
  154. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts.map +1 -1
  155. package/build-types/image-editor/react/hooks/use-cropper-state.d.ts +29 -0
  156. package/build-types/image-editor/react/hooks/use-cropper-state.d.ts.map +1 -1
  157. package/build-types/image-editor/react/hooks/use-interaction.d.ts +5 -2
  158. package/build-types/image-editor/react/hooks/use-interaction.d.ts.map +1 -1
  159. package/build-types/image-editor/react/hooks/use-viewport-state.d.ts +19 -0
  160. package/build-types/image-editor/react/hooks/use-viewport-state.d.ts.map +1 -0
  161. package/build-types/image-editor/react/visually-hidden-style.d.ts +6 -0
  162. package/build-types/image-editor/react/visually-hidden-style.d.ts.map +1 -0
  163. package/build-types/image-editor/stories/rectangle-crop.story.d.ts.map +1 -1
  164. package/build-types/private-apis.d.ts.map +1 -1
  165. package/build-types/store/actions.d.ts +3 -3
  166. package/build-types/store/actions.d.ts.map +1 -1
  167. package/package.json +16 -15
  168. package/src/components/media-editor/index.tsx +709 -0
  169. package/src/components/media-editor/style.scss +89 -0
  170. package/src/components/media-editor-canvas/index.tsx +24 -0
  171. package/src/components/media-editor-crop-panel/index.tsx +39 -27
  172. package/src/components/media-editor-crop-panel/test/index.tsx +109 -0
  173. package/src/components/media-editor-keyboard-shortcuts-modal/index.tsx +177 -0
  174. package/src/components/media-editor-keyboard-shortcuts-modal/style.scss +53 -0
  175. package/src/components/media-editor-modal/index.tsx +49 -589
  176. package/src/components/media-editor-modal/style.scss +13 -112
  177. package/src/components/media-editor-toolbar/index.tsx +122 -63
  178. package/src/components/media-editor-toolbar/style.scss +39 -11
  179. package/src/components/media-form/index.tsx +5 -0
  180. package/src/components/rotation-ruler/README.md +37 -0
  181. package/src/components/rotation-ruler/index.tsx +266 -0
  182. package/src/components/rotation-ruler/stories/index.story.tsx +54 -0
  183. package/src/components/rotation-ruler/style.scss +147 -0
  184. package/src/components/rotation-ruler/test/index.tsx +109 -0
  185. package/src/components/rotation-ruler/use-ruler-drag.ts +230 -0
  186. package/src/hooks/use-crop-gesture-handlers.ts +54 -0
  187. package/src/image-editor/core/constants.ts +12 -0
  188. package/src/image-editor/core/containment.ts +16 -28
  189. package/src/image-editor/core/interaction-controller.ts +66 -10
  190. package/src/image-editor/core/state.ts +15 -8
  191. package/src/image-editor/core/test/camera.ts +15 -26
  192. package/src/image-editor/core/test/interaction-controller.ts +158 -7
  193. package/src/image-editor/core/test/state.ts +21 -1
  194. package/src/image-editor/core/transform-style.ts +1 -1
  195. package/src/image-editor/core/types.ts +16 -0
  196. package/src/image-editor/core/viewport-state.ts +33 -0
  197. package/src/image-editor/docs/architecture.md +1 -1
  198. package/src/image-editor/docs/recipes.md +2 -2
  199. package/src/image-editor/react/components/cropper.scss +28 -0
  200. package/src/image-editor/react/components/cropper.tsx +268 -72
  201. package/src/image-editor/react/components/overlays/dimming-overlay.tsx +12 -12
  202. package/src/image-editor/react/components/stencils/rectangle-stencil.tsx +27 -8
  203. package/src/image-editor/react/components/stencils/test/rectangle-stencil.tsx +29 -3
  204. package/src/image-editor/react/components/test/cropper.tsx +294 -5
  205. package/src/image-editor/react/components/viewport-provider.tsx +39 -0
  206. package/src/image-editor/react/hooks/test/use-aria-announcer.ts +81 -0
  207. package/src/image-editor/react/hooks/test/use-cropper-state.ts +286 -0
  208. package/src/image-editor/react/hooks/test/use-interaction.ts +1 -0
  209. package/src/image-editor/react/hooks/use-aria-announcer.ts +68 -7
  210. package/src/image-editor/react/hooks/use-cropper-state.ts +230 -11
  211. package/src/image-editor/react/hooks/use-interaction.ts +36 -6
  212. package/src/image-editor/react/hooks/use-viewport-state.ts +48 -0
  213. package/src/image-editor/react/visually-hidden-style.ts +15 -0
  214. package/src/private-apis.ts +2 -0
  215. package/src/style.scss +3 -0
  216. package/tsconfig.json +1 -0
  217. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Convert a horizontal pointer delta (px) into a value delta.
3
+ *
4
+ * Negative because dragging the ruler to the right should expose
5
+ * smaller values to the left of the fixed center pointer (and vice
6
+ * versa) — the ruler scrubs *under* the pointer.
7
+ *
8
+ * @param deltaPx Pointer movement in CSS pixels.
9
+ * @param pixelsPerStep CSS pixels of pointer travel per `step`.
10
+ * @param step Value units per step.
11
+ */
12
+ export declare function pxToValueDelta(deltaPx: number, pixelsPerStep: number, step: number): number;
13
+ /**
14
+ * Clamp `value` to the inclusive `[min, max]` interval.
15
+ *
16
+ * @param value Value to clamp.
17
+ * @param min Lower bound (inclusive).
18
+ * @param max Upper bound (inclusive).
19
+ */
20
+ export declare function clampValue(value: number, min: number, max: number): number;
21
+ /**
22
+ * Round `value` to the nearest multiple of `step`.
23
+ *
24
+ * @param value Value to quantize.
25
+ * @param step Step granularity (must be > 0).
26
+ */
27
+ export declare function quantize(value: number, step: number): number;
28
+ export interface UseRulerDragOptions {
29
+ value: number;
30
+ onChange: (next: number) => void;
31
+ min: number;
32
+ max: number;
33
+ step: number;
34
+ pixelsPerStep: number;
35
+ disabled: boolean;
36
+ /** Called once on pointerdown so the caller can focus the input. */
37
+ onPointerDownStart?: () => void;
38
+ }
39
+ export interface RulerDragHandlers {
40
+ onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;
41
+ onPointerMove: (event: React.PointerEvent<HTMLElement>) => void;
42
+ onPointerUp: (event: React.PointerEvent<HTMLElement>) => void;
43
+ onPointerCancel: (event: React.PointerEvent<HTMLElement>) => void;
44
+ }
45
+ /**
46
+ * Drag-the-ruler gesture for a horizontal slider. Translates pointer
47
+ * movement into value changes quantized to `step`; the caller renders
48
+ * the visuals and holds the value.
49
+ *
50
+ * The hook owns no state of its own — every value change is reported
51
+ * through the supplied `onChange`. The "current value" is read from a
52
+ * ref so closure staleness during a drag is impossible. Drag continues
53
+ * past the wrapper's bounds (standard slider behaviour); a window-level
54
+ * `pointerup` listener guarantees the drag ends and pointer capture
55
+ * releases even if the underlying captured event never fires on the
56
+ * wrapper.
57
+ *
58
+ * @param options Ruler-drag configuration. See `UseRulerDragOptions`.
59
+ */
60
+ export declare function useRulerDrag(options: UseRulerDragOptions): RulerDragHandlers;
61
+ //# sourceMappingURL=use-ruler-drag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-ruler-drag.d.ts","sourceRoot":"","sources":["../../../src/components/rotation-ruler/use-ruler-drag.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC7B,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,MAAM,GACV,MAAM,CAER;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAI,MAAM,CAQ5E;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAI,MAAM,CAE9D;AAED,MAAM,WAAW,mBAAmB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,oEAAoE;IACpE,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IACjC,aAAa,EAAE,CAAE,KAAK,EAAE,KAAK,CAAC,YAAY,CAAE,WAAW,CAAE,KAAM,IAAI,CAAC;IACpE,aAAa,EAAE,CAAE,KAAK,EAAE,KAAK,CAAC,YAAY,CAAE,WAAW,CAAE,KAAM,IAAI,CAAC;IACpE,WAAW,EAAE,CAAE,KAAK,EAAE,KAAK,CAAC,YAAY,CAAE,WAAW,CAAE,KAAM,IAAI,CAAC;IAClE,eAAe,EAAE,CAAE,KAAK,EAAE,KAAK,CAAC,YAAY,CAAE,WAAW,CAAE,KAAM,IAAI,CAAC;CACtE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,mBAAmB,GAC1B,iBAAiB,CA8InB"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Data attribute applied to crop control wrappers. The modal's keyboard
3
+ * shortcut handler uses this to distinguish crop controls (where custom
4
+ * undo/redo should fire) from metadata text fields (where the browser's
5
+ * native undo should be preserved).
6
+ */
7
+ export declare const CROP_CONTROL_ATTR = "data-crop-control";
8
+ export interface UseCropGestureHandlersOptions {
9
+ /**
10
+ * When `true` (default), key-up triggers an immediate history commit so
11
+ * each discrete keypress becomes its own undo step. Set to `false` for
12
+ * continuous-input controls (e.g. the rotation ruler) where rapid
13
+ * keypresses should coalesce into a single history entry via the
14
+ * state-change debounce.
15
+ */
16
+ commitOnKeyUp?: boolean;
17
+ }
18
+ /**
19
+ * Returns event handler props to spread onto a wrapper element around a
20
+ * crop control. Marks the wrapper as a crop control (via `data-crop-control`)
21
+ * so the modal's Cmd+Z handler can identify it, and wires up immediate-flush
22
+ * signals on pointer-up and (optionally) key-up so history is committed as
23
+ * soon as the user releases rather than waiting for the debounce window to
24
+ * expire.
25
+ *
26
+ * The history entry itself is recorded by the state-change debounce in
27
+ * `useCropperState` — no explicit gesture-start signal is needed.
28
+ *
29
+ * Usage:
30
+ * const gestureHandlers = useCropGestureHandlers();
31
+ * <div role="presentation" { ...gestureHandlers }>
32
+ * <RangeControl ... />
33
+ * </div>
34
+ *
35
+ * @param options Optional behavior flags.
36
+ */
37
+ export declare function useCropGestureHandlers(options?: UseCropGestureHandlersOptions): {
38
+ "data-crop-control": boolean;
39
+ onPointerUp: () => void;
40
+ onKeyUp?: (() => void) | undefined;
41
+ };
42
+ //# sourceMappingURL=use-crop-gesture-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-crop-gesture-handlers.d.ts","sourceRoot":"","sources":["../../src/hooks/use-crop-gesture-handlers.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,MAAM,WAAW,6BAA6B;IAC7C;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CACrC,OAAO,GAAE,6BAAkC;;;;EAS3C"}
@@ -4,6 +4,15 @@
4
4
  import type { CropperState } from './types';
5
5
  export declare const MIN_ZOOM = 1;
6
6
  export declare const MAX_ZOOM = 10;
7
+ /**
8
+ * Wheel zoom sensitivity. A deltaY of 100 changes zoom by 0.25.
9
+ * This could be made configurable as a prop to the Cropper component.
10
+ */
11
+ export declare const DEFAULT_WHEEL_ZOOM_SPEED = 0.0025;
12
+ /** Fine step for keyboard-driven cropper movement, in normalized coordinates. */
13
+ export declare const DEFAULT_KEYBOARD_STEP = 0.01;
14
+ /** Coarse keyboard movement multiplier when Shift is held. */
15
+ export declare const KEYBOARD_SHIFT_STEP_MULTIPLIER = 10;
7
16
  /**
8
17
  * Maximum free-rotation offset in degrees from the nearest 90° step.
9
18
  * The rotation slider allows ±45° around the current cardinal angle.
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/constants.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAwB,YAAY,EAAE,MAAM,SAAS,CAAC;AAElE,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B,eAAO,MAAM,QAAQ,KAAK,CAAC;AAE3B;;;GAGG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAmBtC,eAAO,MAAM,aAAa,EAAE,YAU3B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,EAUpD,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/constants.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAwB,YAAY,EAAE,MAAM,SAAS,CAAC;AAElE,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B,eAAO,MAAM,QAAQ,KAAK,CAAC;AAE3B;;;GAGG;AACH,eAAO,MAAM,wBAAwB,SAAS,CAAC;AAE/C,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,8DAA8D;AAC9D,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAmBtC,eAAO,MAAM,aAAa,EAAE,YAU3B,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH;;;GAGG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,EAUpD,CAAC"}
@@ -3,21 +3,25 @@
3
3
  */
4
4
  import type { CropperState, NormalizedRect, Size } from './types';
5
5
  /**
6
- * Compute the crop handle bounds in normalized visual space by finding the
6
+ * Compute the crop handle bounds in normalized visual space — the
7
7
  * axis-aligned bounding box (AABB) of the actual image footprint at the
8
- * current pan/zoom/rotation, then intersecting with the container viewport.
8
+ * current pan/zoom/rotation.
9
+ *
10
+ * Returns the full image AABB without intersecting with the container
11
+ * viewport. The viewport pan mechanism in the Cropper component allows
12
+ * the canvas to scroll so handles can reach the image edge even when it
13
+ * lies outside the visible canvas area.
9
14
  *
10
15
  * Unlike a static centerline-based calculation, this accounts for the
11
16
  * current pan position — if the user pans right, the left bound tightens
12
17
  * because the image's left edge has moved right.
13
18
  *
14
- * @param state The current cropper state (crop, zoom, rotation, flip).
15
- * @param elementSize The fitted (unrotated) image element dimensions in pixels.
16
- * @param visualSize The visual (rotated) image bounding box in pixels.
17
- * @param containerSize The container dimensions in pixels.
19
+ * @param state The current cropper state (crop, zoom, rotation, flip).
20
+ * @param elementSize The fitted (unrotated) image element dimensions in pixels.
21
+ * @param visualSize The visual (rotated) image bounding box in pixels.
18
22
  * @return The min/max x and y that a crop rect edge can reach in normalized space.
19
23
  */
20
- export declare function getCropBounds(state: CropperState, elementSize: Size, visualSize: Size, containerSize: Size): {
24
+ export declare function getImageCropBounds(state: CropperState, elementSize: Size, visualSize: Size): {
21
25
  minX: number;
22
26
  minY: number;
23
27
  maxX: number;
@@ -1 +1 @@
1
- {"version":3,"file":"containment.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/containment.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AA+ElE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC5B,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,IAAI,EACjB,UAAU,EAAE,IAAI,EAChB,aAAa,EAAE,IAAI,GACjB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CA4E5D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,GACtB,cAAc,CA4ChB;AAcD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC9B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,EACf,QAAQ,EAAE,cAAc,GACtB;IAAE,GAAG,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CA2JjD"}
1
+ {"version":3,"file":"containment.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/containment.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AA+ElE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,IAAI,EACjB,UAAU,EAAE,IAAI,GACd;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CA6D5D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,GACtB,cAAc,CA4ChB;AAcD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC9B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,EACf,QAAQ,EAAE,cAAc,GACtB;IAAE,GAAG,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CA2JjD"}
@@ -23,6 +23,8 @@ export interface CropperInteractionActions {
23
23
  setZoomAtPoint: (zoom: number, pan: NormalizedPoint) => void;
24
24
  /** Snap rotate by 90 degrees. */
25
25
  snapRotate90: (direction: 1 | -1) => void;
26
+ /** Toggle flip on the given axis. */
27
+ toggleFlip?: (direction: 'horizontal' | 'vertical') => void;
26
28
  }
27
29
  /**
28
30
  * Options for creating an InteractionController.
@@ -44,9 +46,12 @@ export interface InteractionControllerOptions {
44
46
  minZoom?: number;
45
47
  /** Maximum zoom level. Defaults to MAX_ZOOM. Read lazily. */
46
48
  maxZoom?: number;
47
- /** Zoom speed multiplier for wheel events. Defaults to 0.01. Read lazily. */
49
+ /** Zoom speed multiplier for wheel events. Defaults to 0.0025. Read lazily. */
48
50
  zoomSpeed?: number;
49
- /** Pan step size in normalized coords for keyboard events. Defaults to 0.05. Read lazily. */
51
+ /**
52
+ * Pan step size in normalized coords for keyboard events.
53
+ * Defaults to 0.01. Read lazily. Shift multiplies it by 10.
54
+ */
50
55
  keyboardStep?: number;
51
56
  /** Zoom level for double-tap zoom. Defaults to 2. Read lazily. */
52
57
  doubleTapZoom?: number;
@@ -112,6 +117,13 @@ export declare class InteractionController {
112
117
  private get zoomSpeed();
113
118
  /** Read keyboardStep lazily so option changes take effect immediately. */
114
119
  private get keyboardStep();
120
+ /**
121
+ * Get the keyboard pan step, including modifier-based coarse movement.
122
+ *
123
+ * @param event The native KeyboardEvent.
124
+ * @return The normalized pan step.
125
+ */
126
+ private getKeyboardStep;
115
127
  /** Read doubleTapZoom lazily so option changes take effect immediately. */
116
128
  private get doubleTapZoom();
117
129
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"interaction-controller.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/interaction-controller.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAuCnE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;IACpB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,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":"interaction-controller.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/interaction-controller.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AA6CnE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;IACpB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACzC,0DAA0D;IAC1D,MAAM,EAAE,CAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IACzC,0BAA0B;IAC1B,OAAO,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;IAClC,sDAAsD;IACtD,cAAc,EAAE,CAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IAC/D,iCAAiC;IACjC,YAAY,EAAE,CAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,KAAM,IAAI,CAAC;IAC5C,qCAAqC;IACrC,UAAU,CAAC,EAAE,CAAE,SAAS,EAAE,YAAY,GAAG,UAAU,KAAM,IAAI,CAAC;CAC9D;AAED;;;;;;GAMG;AACH,MAAM,WAAW,4BAA4B;IAC5C,sEAAsE;IACtE,QAAQ,EAAE,MAAM,YAAY,CAAC;IAC7B,6EAA6E;IAC7E,OAAO,EAAE,yBAAyB,CAAC;IACnC,kDAAkD;IAClD,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,qEAAqE;IACrE,YAAY,EAAE,MAAM,IAAI,GAAG,SAAS,CAAC;IACrC,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,E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;IACH,iBAAiB,CAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,WAAW,GAAI,IAAI,CA4F1D;IAED;;;;;;;;;OASG;IACH,WAAW,CAAE,CAAC,EAAE,UAAU,GAAI,IAAI,CA0DjC;IAED;;;;;;;;;;;;;OAaG;IACH,gBAAgB,CACf,CAAC,EAAE,UAAU,EACb,aAAa,EAAE,OAAO,EACtB,GAAG,GAAE,QAAmB,GACtB,IAAI,CA6FN;IAOD,OAAO,CAAC,eAAe,CAkJrB;IAQF,OAAO,CAAC,YAAY;IAkFpB;;;;;;OAMG;IACH,aAAa,CAAE,CAAC,EAAE,aAAa,GAAI,IAAI,CAwHtC;IAED;;;;;OAKG;IACH,OAAO,IAAI,IAAI,CAWd;CACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/state.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAsB,MAAM,SAAS,CAAC;AAsD/E;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAE,KAAK,EAAE,YAAY,GAAI,YAAY,CAgDtE;AAgCD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,aAAa,GACnB,YAAY,CA2Od;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,YAAY,GACnB,OAAO,CAaT"}
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/state.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAsB,MAAM,SAAS,CAAC;AA6D/E;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAE,KAAK,EAAE,YAAY,GAAI,YAAY,CAgDtE;AAgCD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,aAAa,GACnB,YAAY,CA2Od;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,YAAY,GACnB,OAAO,CAaT"}
@@ -10,7 +10,7 @@ import type { CropperState, Size } from './types';
10
10
  *
11
11
  * Flip is composed outside rotation so it is viewport-relative — horizontal
12
12
  * flip mirrors across the viewport's vertical axis regardless of rotation.
13
- * Must match the matrix order in `createCamera` / `getCropBounds`.
13
+ * Must match the matrix order in `createCamera` / `getImageCropBounds`.
14
14
  *
15
15
  * This is a pure function with no framework dependencies. The React hook
16
16
  * `useTransformStyle` wraps this in `useMemo` for memoization.
@@ -175,6 +175,31 @@ export type CropperAction =
175
175
  type: 'RESET';
176
176
  payload?: Partial<CropperState>;
177
177
  };
178
+ /**
179
+ * Viewport camera state — display-only, does not affect export or undo.
180
+ *
181
+ * Applied as a CSS transform on the inner stage div so the user can scroll
182
+ * the view independently of the crop. zoom > 1 magnifies; pan shifts in CSS px.
183
+ */
184
+ export interface ViewportState {
185
+ zoom: number;
186
+ pan: {
187
+ x: number;
188
+ y: number;
189
+ };
190
+ }
191
+ export type ViewportAction = {
192
+ type: 'SET_VIEWPORT_ZOOM';
193
+ payload: number;
194
+ } | {
195
+ type: 'SET_VIEWPORT_PAN';
196
+ payload: {
197
+ x: number;
198
+ y: number;
199
+ };
200
+ } | {
201
+ type: 'RESET_VIEWPORT';
202
+ };
178
203
  /**
179
204
  * The contract for a pluggable stencil component.
180
205
  * Stencils render the crop area overlay and handle resize interactions.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,MAAM,GAAG,KAAK,CAAC;AAE3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E,GAC9C;IAAE,IAAI,EAAE,kBAAkB,CAAC;IAAC,OAAO,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAE9B;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC5B,4DAA4D;IAC5D,QAAQ,EAAE,cAAc,CAAC;IACzB,kDAAkD;IAClD,aAAa,EAAE,IAAI,CAAC;IACpB,oEAAoE;IACpE,SAAS,EAAE,IAAI,CAAC;IAChB,8DAA8D;IAC9D,YAAY,EAAE,CAAE,IAAI,EAAE,cAAc,KAAM,IAAI,CAAC;IAC/C,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,mEAAmE;IACnE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gEAAgE;IAChE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,+DAA+D;IAC/D,UAAU,CAAC,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACb,CAAC;IACF,wDAAwD;IACxD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { ViewportState, ViewportAction } from './types';
5
+ export declare const DEFAULT_VIEWPORT_STATE: ViewportState;
6
+ export declare function viewportReducer(state: ViewportState, action: ViewportAction): ViewportState;
7
+ //# sourceMappingURL=viewport-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport-state.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/viewport-state.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE7D,eAAO,MAAM,sBAAsB,EAAE,aAGpC,CAAC;AAEF,wBAAgB,eAAe,CAC9B,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,cAAc,GACpB,aAAa,CAmBf"}
@@ -23,7 +23,7 @@ interface CropperProviderProps {
23
23
  * @param props.children
24
24
  * @return The provider element wrapping children.
25
25
  */
26
- export declare function CropperProvider({ initialState, children, }: CropperProviderProps): import("react").JSX.Element;
26
+ export declare function CropperProvider({ initialState, children }: CropperProviderProps): import("react").JSX.Element;
27
27
  /**
28
28
  * Hook to consume the CropperProvider context.
29
29
  *
@@ -1 +1 @@
1
- {"version":3,"file":"cropper-provider.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/cropper-provider.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAEN,KAAK,qBAAqB,EAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUrD;;GAEG;AACH,UAAU,oBAAoB;IAC7B,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,CAAC;IACvC,wBAAwB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAE,EAChC,YAAY,EACZ,QAAQ,GACR,EAAE,oBAAoB,+BAQtB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,IAAI,qBAAqB,CAQlD"}
1
+ {"version":3,"file":"cropper-provider.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/cropper-provider.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAEN,KAAK,qBAAqB,EAC1B,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAUrD;;GAEG;AACH,UAAU,oBAAoB;IAC7B,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,CAAC;IACvC,wBAAwB;IACxB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAE,EAChC,YAAY,EACZ,QAAQ,EACR,EAAE,oBAAoB,+BAQtB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,IAAI,qBAAqB,CAQlD"}
@@ -6,7 +6,6 @@
6
6
  */
7
7
  import type { CropperState, StencilProps, Size } from '../../core/types';
8
8
  import type { UseCropperStateReturn } from '../hooks/use-cropper-state';
9
- import './cropper.scss';
10
9
  /**
11
10
  * Props for the Cropper component.
12
11
  */
@@ -35,6 +34,8 @@ export interface CropperProps {
35
34
  * When true, the crop area has resize handles and can be freely repositioned.
36
35
  */
37
36
  freeformCrop?: boolean;
37
+ /** Focus the crop area when the cropper mounts. */
38
+ focusOnMount?: boolean;
38
39
  /** Callback fired when the image is loaded. */
39
40
  onImageLoaded?: (size: Size) => void;
40
41
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"cropper.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/cropper.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAiBH;;GAEG;AACH,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,IAAI,EAEJ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AASxE,OAAO,gBAAgB,CAAC;AAoCxB;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,2DAA2D;IAC3D,UAAU,EAAE,qBAAqB,CAAC;IAClC,yEAAyE;IACzE,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAE,YAAY,CAAE,CAAC;IAC9C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E;IACzE,QAAQ,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IACnC,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sDAAsD;IACtD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mDAAmD;IACnD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,IAAI,CAAC;IACvC;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,CAAE,KAAK,EAAE,YAAY,KAAM,IAAI,CAAC;IAChD,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,uEAAuE;IACvE,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAslBD,eAAO,MAAM,OAAO,yGAMnB,CAAC"}
@@ -12,19 +12,9 @@ interface DimmingOverlayProps {
12
12
  containerSize: Size;
13
13
  /** The rendered image dimensions in pixels within the container. */
14
14
  imageSize: Size;
15
+ /** CSS transition string, e.g. during settle animation. */
16
+ transition?: string;
15
17
  }
16
- /**
17
- * Renders a semi-transparent overlay outside the crop rectangle.
18
- *
19
- * Uses the box-shadow approach: a div matching the crop rect position
20
- * with a large box-shadow that dims everything outside it.
21
- *
22
- * @param props Component props.
23
- * @param props.cropRect The crop rectangle in normalized coordinates.
24
- * @param props.containerSize The container element dimensions in pixels.
25
- * @param props.imageSize The rendered image dimensions in pixels.
26
- * @return The dimming overlay element.
27
- */
28
- export declare function DimmingOverlay({ cropRect, containerSize, imageSize, }: DimmingOverlayProps): import("react").JSX.Element | null;
18
+ export declare function DimmingOverlay({ cropRect, containerSize, imageSize, transition }: DimmingOverlayProps): import("react").JSX.Element | null;
29
19
  export {};
30
20
  //# sourceMappingURL=dimming-overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dimming-overlay.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/overlays/dimming-overlay.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;GAEG;AACH,UAAU,mBAAmB;IAC5B,oDAAoD;IACpD,QAAQ,EAAE,cAAc,CAAC;IACzB,kDAAkD;IAClD,aAAa,EAAE,IAAI,CAAC;IACpB,oEAAoE;IACpE,SAAS,EAAE,IAAI,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAE,EAC/B,QAAQ,EACR,aAAa,EACb,SAAS,GACT,EAAE,mBAAmB,sCAuBrB"}
1
+ {"version":3,"file":"dimming-overlay.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/overlays/dimming-overlay.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;GAEG;AACH,UAAU,mBAAmB;IAC5B,oDAAoD;IACpD,QAAQ,EAAE,cAAc,CAAC;IACzB,kDAAkD;IAClD,aAAa,EAAE,IAAI,CAAC;IACpB,oEAAoE;IACpE,SAAS,EAAE,IAAI,CAAC;IAChB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,wBAAgB,cAAc,CAAE,EAC/B,QAAQ,EACR,aAAa,EACb,SAAS,EACT,UAAU,EACV,EAAE,mBAAmB,sCA8BrB"}
@@ -25,6 +25,6 @@ interface GridOverlayProps {
25
25
  * @param props.imageSize The rendered image dimensions in pixels.
26
26
  * @return The grid overlay element.
27
27
  */
28
- export declare function GridOverlay({ cropRect, containerSize, imageSize, }: GridOverlayProps): import("react").JSX.Element | null;
28
+ export declare function GridOverlay({ cropRect, containerSize, imageSize }: GridOverlayProps): import("react").JSX.Element | null;
29
29
  export {};
30
30
  //# sourceMappingURL=grid-overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grid-overlay.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/overlays/grid-overlay.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;GAEG;AACH,UAAU,gBAAgB;IACzB,oDAAoD;IACpD,QAAQ,EAAE,cAAc,CAAC;IACzB,kDAAkD;IAClD,aAAa,EAAE,IAAI,CAAC;IACpB,oEAAoE;IACpE,SAAS,EAAE,IAAI,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAE,EAC5B,QAAQ,EACR,aAAa,EACb,SAAS,GACT,EAAE,gBAAgB,sCA8ClB"}
1
+ {"version":3,"file":"grid-overlay.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/overlays/grid-overlay.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhE;;GAEG;AACH,UAAU,gBAAgB;IACzB,oDAAoD;IACpD,QAAQ,EAAE,cAAc,CAAC;IACzB,kDAAkD;IAClD,aAAa,EAAE,IAAI,CAAC;IACpB,oEAAoE;IACpE,SAAS,EAAE,IAAI,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAE,EAC5B,QAAQ,EACR,aAAa,EACb,SAAS,EACT,EAAE,gBAAgB,sCA8ClB"}
@@ -27,6 +27,6 @@ type RectangleStencilProps = StencilProps;
27
27
  * @param props.onEscape Called when Escape is pressed on a resize handle.
28
28
  * @return The rectangle stencil element.
29
29
  */
30
- export declare function RectangleStencil({ cropRect, containerSize, imageSize, onCropChange, onResizeStart, onResizeEnd, aspectRatio, freeformCrop, stencilTransition, cropBounds, onEscape, }: RectangleStencilProps): import("react").JSX.Element | null;
30
+ export declare function RectangleStencil({ cropRect, containerSize, imageSize, onCropChange, onResizeStart, onResizeEnd, aspectRatio, freeformCrop, stencilTransition, cropBounds, onEscape }: RectangleStencilProps): import("react").JSX.Element | null;
31
31
  export {};
32
32
  //# sourceMappingURL=rectangle-stencil.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rectangle-stencil.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/stencils/rectangle-stencil.tsx"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,qBAAqB,CAAC;AAmExE;;GAEG;AACH,KAAK,qBAAqB,GAAG,YAAY,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAE,EACjC,QAAQ,EACR,aAAa,EACb,SAAS,EACT,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,QAAQ,GACR,EAAE,qBAAqB,sCA8YvB"}
1
+ {"version":3,"file":"rectangle-stencil.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/stencils/rectangle-stencil.tsx"],"names":[],"mappings":"AAYA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,qBAAqB,CAAC;AAkExE;;GAEG;AACH,KAAK,qBAAqB,GAAG,YAAY,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAE,EACjC,QAAQ,EACR,aAAa,EACb,SAAS,EACT,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,EAAE,qBAAqB,sCA4ZvB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import { type UseViewportStateReturn } from '../hooks/use-viewport-state';
5
+ export declare function ViewportProvider({ children }: {
6
+ children: React.ReactNode;
7
+ }): import("react").JSX.Element;
8
+ export declare function useViewport(): UseViewportStateReturn;
9
+ //# sourceMappingURL=viewport-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewport-provider.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/viewport-provider.tsx"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,6BAA6B,CAAC;AAMrC,wBAAgB,gBAAgB,CAAE,EACjC,QAAQ,EACR,EAAE;IACF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,+BAOA;AAED,wBAAgB,WAAW,IAAI,sBAAsB,CAQpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-aria-announcer.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-aria-announcer.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAkBrD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAE,KAAK,EAAE,YAAY,GAAI,MAAM,CA2B9D"}
1
+ {"version":3,"file":"use-aria-announcer.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-aria-announcer.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAiErD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAE,KAAK,EAAE,YAAY,GAAI,MAAM,CAmC9D"}
@@ -29,6 +29,8 @@ export interface UseCropperStateReturn {
29
29
  setRotation: (rotation: number) => void;
30
30
  /** Set the flip state. */
31
31
  setFlip: (flip: Flip) => void;
32
+ /** Toggle flip on the given axis. */
33
+ toggleFlip: (direction: 'horizontal' | 'vertical') => void;
32
34
  /** Snap rotate 90° preserving the image selection (Google Photos style). */
33
35
  snapRotate90: (direction: 1 | -1) => void;
34
36
  /** Set the crop rectangle in normalized coordinates. */
@@ -37,6 +39,9 @@ export interface UseCropperStateReturn {
37
39
  * Settle the crop rect after a resize drag: expand to fill the
38
40
  * available visual area while preserving the framed image region.
39
41
  * Typically called from a stencil's `onResizeEnd` callback.
42
+ *
43
+ * Flushes the pending resize history before dispatching, then suppresses
44
+ * the settle dispatch itself so resizing and settling undo as one step.
40
45
  */
41
46
  settleCrop: () => void;
42
47
  /** Apply a transform operation through the pipeline. */
@@ -45,6 +50,25 @@ export interface UseCropperStateReturn {
45
50
  reset: (resetState?: Partial<CropperState>) => void;
46
51
  /** Whether the current state differs from the initial state. */
47
52
  isDirty: boolean;
53
+ /** Whether there is a cropper state to undo. */
54
+ hasUndo: boolean;
55
+ /** Whether there is a cropper state to redo. */
56
+ hasRedo: boolean;
57
+ /** Undo the last committed cropper operation. */
58
+ undo: () => void;
59
+ /** Redo the last undone cropper operation. */
60
+ redo: () => void;
61
+ /**
62
+ * Flush the pending history entry immediately, bypassing the debounce
63
+ * timer. Useful in two situations:
64
+ *
65
+ * - **Pointer-up / key-up**: commit as soon as the user releases so the
66
+ * undo button lights up without waiting for the debounce window.
67
+ * - **Gesture start**: pass to `onGestureStart` on the `Cropper` so any
68
+ * pending sidebar interaction is committed before a new canvas gesture
69
+ * begins, keeping the two interactions as separate undo steps.
70
+ */
71
+ commitHistory: () => void;
48
72
  /**
49
73
  * Export the cropped image as a Blob. Throws on failure — see
50
74
  * `exportCroppedImage` in core for the error semantics (image
@@ -61,6 +85,11 @@ export interface UseCropperStateReturn {
61
85
  * live in core/state.ts (framework-agnostic); this hook is a thin
62
86
  * React wrapper around that pure reducer, with memoized callbacks.
63
87
  *
88
+ * History is recorded via a state-change debounce: any state change
89
+ * starts a 300 ms timer; when it fires the pre-change state is pushed
90
+ * onto the undo stack. `commitHistory` flushes the timer immediately
91
+ * (useful on pointer-up / key-up for a crisp commit feel).
92
+ *
64
93
  * @param initialState Optional partial state to merge with DEFAULT_STATE.
65
94
  * @return The cropper state, setters, and utilities.
66
95
  */
@@ -1 +1 @@
1
- {"version":3,"file":"use-cropper-state.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-cropper-state.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EACX,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,IAAI,EACJ,MAAM,kBAAkB,CAAC;AAS1B;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACrC,6CAA6C;IAC7C,KAAK,EAAE,YAAY,CAAC;IACpB,mDAAmD;IACnD,QAAQ,EAAE,CAAE,KAAK,EAAE,YAAY,CAAE,OAAO,CAAE,KAAM,IAAI,CAAC;IACrD;;;OAGG;IACH,MAAM,EAAE,CAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IACzC,8CAA8C;IAC9C,OAAO,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;IAClC,oEAAoE;IACpE,cAAc,EAAE,CAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IAC/D,2DAA2D;IAC3D,WAAW,EAAE,CAAE,QAAQ,EAAE,MAAM,KAAM,IAAI,CAAC;IAC1C,0BAA0B;IAC1B,OAAO,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,IAAI,CAAC;IAChC,4EAA4E;IAC5E,YAAY,EAAE,CAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,KAAM,IAAI,CAAC;IAC5C,wDAAwD;IACxD,WAAW,EAAE,CAAE,IAAI,EAAE,cAAc,KAAM,IAAI,CAAC;IAC9C;;;;OAIG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,wDAAwD;IACxD,cAAc,EAAE,CAAE,EAAE,EAAE,kBAAkB,KAAM,IAAI,CAAC;IACnD,iEAAiE;IACjE,KAAK,EAAE,CAAE,UAAU,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,KAAM,IAAI,CAAC;IACxD,gEAAgE;IAChE,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,eAAe,EAAE,CAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAM,OAAO,CAAE,IAAI,CAAE,CAAC;CAC5E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC9B,YAAY,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,GACpC,qBAAqB,CAqJvB"}
1
+ {"version":3,"file":"use-cropper-state.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-cropper-state.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,OAAO,KAAK,EACX,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,IAAI,EACJ,MAAM,kBAAkB,CAAC;AAS1B;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACrC,6CAA6C;IAC7C,KAAK,EAAE,YAAY,CAAC;IACpB,mDAAmD;IACnD,QAAQ,EAAE,CAAE,KAAK,EAAE,YAAY,CAAE,OAAO,CAAE,KAAM,IAAI,CAAC;IACrD;;;OAGG;IACH,MAAM,EAAE,CAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IACzC,8CAA8C;IAC9C,OAAO,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;IAClC,oEAAoE;IACpE,cAAc,EAAE,CAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IAC/D,2DAA2D;IAC3D,WAAW,EAAE,CAAE,QAAQ,EAAE,MAAM,KAAM,IAAI,CAAC;IAC1C,0BAA0B;IAC1B,OAAO,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,IAAI,CAAC;IAChC,qCAAqC;IACrC,UAAU,EAAE,CAAE,SAAS,EAAE,YAAY,GAAG,UAAU,KAAM,IAAI,CAAC;IAC7D,4EAA4E;IAC5E,YAAY,EAAE,CAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,KAAM,IAAI,CAAC;IAC5C,wDAAwD;IACxD,WAAW,EAAE,CAAE,IAAI,EAAE,cAAc,KAAM,IAAI,CAAC;IAC9C;;;;;;;OAOG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,wDAAwD;IACxD,cAAc,EAAE,CAAE,EAAE,EAAE,kBAAkB,KAAM,IAAI,CAAC;IACnD,iEAAiE;IACjE,KAAK,EAAE,CAAE,UAAU,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,KAAM,IAAI,CAAC;IACxD,gEAAgE;IAChE,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,iDAAiD;IACjD,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB;;;;;;;;;OASG;IACH,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B;;;;;OAKG;IACH,eAAe,EAAE,CAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAM,OAAO,CAAE,IAAI,CAAE,CAAC;CAC5E;AAgCD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAC9B,YAAY,CAAC,EAAE,OAAO,CAAE,YAAY,CAAE,GACpC,qBAAqB,CA+SvB"}
@@ -30,9 +30,12 @@ export interface UseInteractionOptions {
30
30
  minZoom?: number;
31
31
  /** Maximum zoom level. Defaults to MAX_ZOOM. */
32
32
  maxZoom?: number;
33
- /** Zoom speed multiplier for wheel events. Defaults to 0.01. */
33
+ /** Zoom speed multiplier for wheel events. Defaults to 0.0025. */
34
34
  zoomSpeed?: number;
35
- /** Pan step size in normalized coords for keyboard events. Defaults to 0.05. */
35
+ /**
36
+ * Pan step size in normalized coords for keyboard events.
37
+ * Defaults to 0.01. Shift multiplies it by 10.
38
+ */
36
39
  keyboardStep?: number;
37
40
  /** Zoom level for double-tap zoom. Defaults to 2. */
38
41
  doubleTapZoom?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"use-interaction.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-interaction.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAEN,KAAK,yBAAyB,EAC9B,MAAM,mCAAmC,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,8DAA8D;IAC9D,QAAQ,EAAE;QACT,aAAa,EAAE,CAAE,CAAC,EAAE,KAAK,CAAC,YAAY,KAAM,IAAI,CAAC;QACjD,YAAY,EAAE,CAAE,CAAC,EAAE,KAAK,CAAC,UAAU,KAAM,IAAI,CAAC;QAC9C,SAAS,EAAE,CAAE,CAAC,EAAE,KAAK,CAAC,aAAa,KAAM,IAAI,CAAC;KAC9C,CAAC;IACF,yEAAyE;IACzE,aAAa,EAAE,CAAE,CAAC,EAAE,UAAU,KAAM,IAAI,CAAC;IACzC,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;IACpB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,iBAAiB,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gFAAgF;IAChF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAiBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,yBAAyB,EAClC,aAAa,EAAE,IAAI,EACnB,SAAS,CAAC,EAAE,IAAI,EAChB,OAAO,CAAC,EAAE,qBAAqB,GAC7B,oBAAoB,CAoItB"}
1
+ {"version":3,"file":"use-interaction.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-interaction.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAEN,KAAK,yBAAyB,EAC9B,MAAM,mCAAmC,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,8DAA8D;IAC9D,QAAQ,EAAE;QACT,aAAa,EAAE,CAAE,CAAC,EAAE,KAAK,CAAC,YAAY,KAAM,IAAI,CAAC;QACjD,YAAY,EAAE,CAAE,CAAC,EAAE,KAAK,CAAC,UAAU,KAAM,IAAI,CAAC;QAC9C,SAAS,EAAE,CAAE,CAAC,EAAE,KAAK,CAAC,aAAa,KAAM,IAAI,CAAC;KAC9C,CAAC;IACF,yEAAyE;IACzE,aAAa,EAAE,CAAE,CAAC,EAAE,UAAU,KAAM,IAAI,CAAC;IACzC,uDAAuD;IACvD,UAAU,EAAE,OAAO,CAAC;IACpB,0DAA0D;IAC1D,SAAS,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,iBAAiB,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qDAAqD;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AA6BD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,yBAAyB,EAClC,aAAa,EAAE,IAAI,EACnB,SAAS,CAAC,EAAE,IAAI,EAChB,OAAO,CAAC,EAAE,qBAAqB,GAC7B,oBAAoB,CAmJtB"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ import type { ViewportState } from '../../core/types';
5
+ export interface UseViewportStateReturn {
6
+ viewport: ViewportState;
7
+ /**
8
+ * Unused in the current Cropper implementation — scaffolded for the
9
+ * upcoming navigator panel (viewport zoom slider).
10
+ */
11
+ setViewportZoom: (zoom: number) => void;
12
+ setViewportPan: (pan: {
13
+ x: number;
14
+ y: number;
15
+ }) => void;
16
+ resetViewport: () => void;
17
+ }
18
+ export declare function useViewportState(): UseViewportStateReturn;
19
+ //# sourceMappingURL=use-viewport-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-viewport-state.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/use-viewport-state.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAMtD,MAAM,WAAW,sBAAsB;IACtC,QAAQ,EAAE,aAAa,CAAC;IACxB;;;OAGG;IACH,eAAe,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;IAC1C,cAAc,EAAE,CAAE,GAAG,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,KAAM,IAAI,CAAC;IAC1D,aAAa,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,wBAAgB,gBAAgB,IAAI,sBAAsB,CAsBzD"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * CSS style object that visually hides an element while keeping it accessible
3
+ * to screen readers.
4
+ */
5
+ export declare const VISUALLY_HIDDEN_STYLE: React.CSSProperties;
6
+ //# sourceMappingURL=visually-hidden-style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visually-hidden-style.d.ts","sourceRoot":"","sources":["../../../src/image-editor/react/visually-hidden-style.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,aAUzC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rectangle-crop.story.d.ts","sourceRoot":"","sources":["../../../src/image-editor/stories/rectangle-crop.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAwB5D;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAwBtD,OAAO,aAAa,CAAC;AA6ErB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAI/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,OAAO,CAAE,CAAC;AAsBxC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAkXF,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC;AAmiBF,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC"}
1
+ {"version":3,"file":"rectangle-crop.story.d.ts","sourceRoot":"","sources":["../../../src/image-editor/stories/rectangle-crop.story.tsx"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAwB5D;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAwBtD,OAAO,aAAa,CAAC;AA6ErB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,OAAO,CAI/B,CAAC;eAEa,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,OAAO,CAAE,CAAC;AAsBxC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAkXF,eAAO,MAAM,YAAY,EAAE,KAE1B,CAAC;AAmiBF,eAAO,MAAM,KAAK,EAAE,KAEnB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"private-apis.d.ts","sourceRoot":"","sources":["../src/private-apis.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,IAAK,CAAC"}
1
+ {"version":3,"file":"private-apis.d.ts","sourceRoot":"","sources":["../src/private-apis.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,IAAK,CAAC"}
@@ -15,13 +15,13 @@ interface OpenMediaEditorModalArgs {
15
15
  id: number;
16
16
  onUpdate?: (updated: MediaEditorModalUpdate) => void;
17
17
  }
18
- export declare function openMediaEditorModal({ id, onUpdate, }: OpenMediaEditorModalArgs): {
19
- type: "OPEN_MEDIA_EDITOR_MODAL";
18
+ export declare function openMediaEditorModal({ id, onUpdate }: OpenMediaEditorModalArgs): {
19
+ type: 'OPEN_MEDIA_EDITOR_MODAL';
20
20
  id: number;
21
21
  onUpdate: ((updated: MediaEditorModalUpdate) => void) | null;
22
22
  };
23
23
  export declare function closeMediaEditorModal(): {
24
- type: "CLOSE_MEDIA_EDITOR_MODAL";
24
+ type: 'CLOSE_MEDIA_EDITOR_MODAL';
25
25
  };
26
26
  export {};
27
27
  //# sourceMappingURL=actions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/store/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,UAAU,wBAAwB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,CAAE,OAAO,EAAE,sBAAsB,KAAM,IAAI,CAAC;CACvD;AAED,wBAAgB,oBAAoB,CAAE,EACrC,EAAE,EACF,QAAQ,GACR,EAAE,wBAAwB;;;yBANJ,sBAAsB,KAAM,IAAI;EAYtD;AAED,wBAAgB,qBAAqB;;EAEpC"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/store/actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;CACb;AAED,UAAU,wBAAwB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,CAAE,OAAO,EAAE,sBAAsB,KAAM,IAAI,CAAC;CACvD;AAED,wBAAgB,oBAAoB,CAAE,EACrC,EAAE,EACF,QAAQ,EACR,EAAE,wBAAwB;UAEnB,yBAAyB;;yBARV,sBAAsB,KAAM,IAAI;EAYtD;AAED,wBAAgB,qBAAqB;IAC3B,IAAI,EAAE,0BAA0B;EACzC"}