@wordpress/media-editor 0.21.0 → 0.23.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 (432) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/build/components/media-editor/index.cjs +586 -686
  3. package/build/components/media-editor/index.cjs.map +1 -7
  4. package/build/components/media-editor/use-crop-options.cjs +42 -57
  5. package/build/components/media-editor/use-crop-options.cjs.map +1 -7
  6. package/build/components/media-editor/use-save-media-editor.cjs +131 -185
  7. package/build/components/media-editor/use-save-media-editor.cjs.map +1 -7
  8. package/build/components/media-editor-canvas/index.cjs +117 -124
  9. package/build/components/media-editor-canvas/index.cjs.map +1 -7
  10. package/build/components/media-editor-crop-panel/index.cjs +81 -72
  11. package/build/components/media-editor-crop-panel/index.cjs.map +1 -7
  12. package/build/components/media-editor-fine-rotation/index.cjs +61 -72
  13. package/build/components/media-editor-fine-rotation/index.cjs.map +1 -7
  14. package/build/components/media-editor-image-controls/index.cjs +181 -257
  15. package/build/components/media-editor-image-controls/index.cjs.map +1 -7
  16. package/build/components/media-editor-keyboard-shortcuts-modal/index.cjs +120 -157
  17. package/build/components/media-editor-keyboard-shortcuts-modal/index.cjs.map +1 -7
  18. package/build/components/media-editor-modal/index.cjs +112 -155
  19. package/build/components/media-editor-modal/index.cjs.map +1 -7
  20. package/build/components/media-editor-provider/index.cjs +32 -55
  21. package/build/components/media-editor-provider/index.cjs.map +1 -7
  22. package/build/components/media-form/index.cjs +82 -77
  23. package/build/components/media-form/index.cjs.map +1 -7
  24. package/build/components/media-preview/index.cjs +113 -114
  25. package/build/components/media-preview/index.cjs.map +1 -7
  26. package/build/components/rotation-ruler/index.cjs +181 -188
  27. package/build/components/rotation-ruler/index.cjs.map +1 -7
  28. package/build/components/rotation-ruler/use-ruler-drag.cjs +132 -149
  29. package/build/components/rotation-ruler/use-ruler-drag.cjs.map +1 -7
  30. package/build/hooks/use-crop-gesture-handlers.cjs +82 -76
  31. package/build/hooks/use-crop-gesture-handlers.cjs.map +1 -7
  32. package/build/index.cjs +45 -39
  33. package/build/lock-unlock.cjs +9 -35
  34. package/build/lock-unlock.cjs.map +1 -7
  35. package/build/private-apis.cjs +16 -37
  36. package/build/private-apis.cjs.map +1 -7
  37. package/build/state/aspect-ratio-presets.cjs +59 -0
  38. package/build/state/aspect-ratio-presets.cjs.map +1 -0
  39. package/build/state/composite-reducer.cjs +100 -113
  40. package/build/state/composite-reducer.cjs.map +1 -7
  41. package/build/state/index.cjs +22 -45
  42. package/build/state/media-editor-state-provider.cjs +35 -48
  43. package/build/state/media-editor-state-provider.cjs.map +1 -7
  44. package/build/state/types.cjs +11 -31
  45. package/build/state/types.cjs.map +1 -7
  46. package/build/state/use-media-editor-state.cjs +227 -296
  47. package/build/state/use-media-editor-state.cjs.map +1 -7
  48. package/build/store/actions.cjs +17 -44
  49. package/build/store/actions.cjs.map +1 -7
  50. package/build/store/constants.cjs +8 -29
  51. package/build/store/constants.cjs.map +1 -7
  52. package/build/store/index.cjs +33 -40
  53. package/build/store/index.cjs.map +1 -7
  54. package/build/store/reducer.cjs +28 -50
  55. package/build/store/reducer.cjs.map +1 -7
  56. package/build/store/selectors.cjs +16 -41
  57. package/build/store/selectors.cjs.map +1 -7
  58. package/build/utils/get-media-type.cjs +18 -41
  59. package/build/utils/get-media-type.cjs.map +1 -7
  60. package/build/utils/index.cjs +9 -28
  61. package/build-module/components/media-editor/index.mjs +545 -675
  62. package/build-module/components/media-editor/index.mjs.map +1 -7
  63. package/build-module/components/media-editor/use-crop-options.mjs +37 -32
  64. package/build-module/components/media-editor/use-crop-options.mjs.map +1 -7
  65. package/build-module/components/media-editor/use-save-media-editor.mjs +109 -157
  66. package/build-module/components/media-editor/use-save-media-editor.mjs.map +1 -7
  67. package/build-module/components/media-editor-canvas/index.mjs +95 -98
  68. package/build-module/components/media-editor-canvas/index.mjs.map +1 -7
  69. package/build-module/components/media-editor-crop-panel/index.mjs +59 -46
  70. package/build-module/components/media-editor-crop-panel/index.mjs.map +1 -7
  71. package/build-module/components/media-editor-fine-rotation/index.mjs +39 -46
  72. package/build-module/components/media-editor-fine-rotation/index.mjs.map +1 -7
  73. package/build-module/components/media-editor-image-controls/index.mjs +171 -238
  74. package/build-module/components/media-editor-image-controls/index.mjs.map +1 -7
  75. package/build-module/components/media-editor-keyboard-shortcuts-modal/index.mjs +113 -137
  76. package/build-module/components/media-editor-keyboard-shortcuts-modal/index.mjs.map +1 -7
  77. package/build-module/components/media-editor-modal/index.mjs +88 -124
  78. package/build-module/components/media-editor-modal/index.mjs.map +1 -7
  79. package/build-module/components/media-editor-provider/index.mjs +26 -29
  80. package/build-module/components/media-editor-provider/index.mjs.map +1 -7
  81. package/build-module/components/media-form/index.mjs +74 -56
  82. package/build-module/components/media-form/index.mjs.map +1 -7
  83. package/build-module/components/media-preview/index.mjs +105 -90
  84. package/build-module/components/media-preview/index.mjs.map +1 -7
  85. package/build-module/components/rotation-ruler/index.mjs +161 -164
  86. package/build-module/components/rotation-ruler/index.mjs.map +1 -7
  87. package/build-module/components/rotation-ruler/use-ruler-drag.mjs +125 -122
  88. package/build-module/components/rotation-ruler/use-ruler-drag.mjs.map +1 -7
  89. package/build-module/hooks/use-crop-gesture-handlers.mjs +76 -50
  90. package/build-module/hooks/use-crop-gesture-handlers.mjs.map +1 -7
  91. package/build-module/index.mjs +3 -10
  92. package/build-module/lock-unlock.mjs +5 -10
  93. package/build-module/lock-unlock.mjs.map +1 -7
  94. package/build-module/private-apis.mjs +8 -9
  95. package/build-module/private-apis.mjs.map +1 -7
  96. package/build-module/state/aspect-ratio-presets.mjs +53 -0
  97. package/build-module/state/aspect-ratio-presets.mjs.map +1 -0
  98. package/build-module/state/composite-reducer.mjs +80 -91
  99. package/build-module/state/composite-reducer.mjs.map +1 -7
  100. package/build-module/state/index.mjs +3 -26
  101. package/build-module/state/media-editor-state-provider.mjs +29 -24
  102. package/build-module/state/media-editor-state-provider.mjs.map +1 -7
  103. package/build-module/state/types.mjs +7 -7
  104. package/build-module/state/types.mjs.map +1 -7
  105. package/build-module/state/use-media-editor-state.mjs +223 -288
  106. package/build-module/state/use-media-editor-state.mjs.map +1 -7
  107. package/build-module/store/actions.mjs +12 -19
  108. package/build-module/store/actions.mjs.map +1 -7
  109. package/build-module/store/constants.mjs +4 -5
  110. package/build-module/store/constants.mjs.map +1 -7
  111. package/build-module/store/index.mjs +8 -9
  112. package/build-module/store/index.mjs.map +1 -7
  113. package/build-module/store/reducer.mjs +23 -26
  114. package/build-module/store/reducer.mjs.map +1 -7
  115. package/build-module/store/selectors.mjs +8 -13
  116. package/build-module/store/selectors.mjs.map +1 -7
  117. package/build-module/utils/get-media-type.mjs +14 -17
  118. package/build-module/utils/get-media-type.mjs.map +1 -7
  119. package/build-module/utils/index.mjs +1 -6
  120. package/build-style/style-rtl.css +145 -61
  121. package/build-style/style.css +144 -61
  122. package/build-types/components/media-editor/index.d.ts +20 -2
  123. package/build-types/components/media-editor/index.d.ts.map +1 -1
  124. package/build-types/components/media-editor/use-crop-options.d.ts +2 -3
  125. package/build-types/components/media-editor/use-crop-options.d.ts.map +1 -1
  126. package/build-types/components/media-editor/use-save-media-editor.d.ts.map +1 -1
  127. package/build-types/components/media-editor-canvas/index.d.ts +3 -3
  128. package/build-types/components/media-editor-canvas/index.d.ts.map +1 -1
  129. package/build-types/components/media-editor-crop-panel/index.d.ts +1 -1
  130. package/build-types/components/media-editor-crop-panel/index.d.ts.map +1 -1
  131. package/build-types/components/media-editor-fine-rotation/index.d.ts.map +1 -1
  132. package/build-types/components/media-editor-image-controls/index.d.ts +1 -1
  133. package/build-types/components/media-editor-image-controls/index.d.ts.map +1 -1
  134. package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts.map +1 -1
  135. package/build-types/components/media-editor-modal/index.d.ts +1 -1
  136. package/build-types/components/media-editor-modal/index.d.ts.map +1 -1
  137. package/build-types/components/media-form/index.d.ts.map +1 -1
  138. package/build-types/components/media-preview/index.d.ts.map +1 -1
  139. package/build-types/components/rotation-ruler/use-ruler-drag.d.ts.map +1 -1
  140. package/build-types/state/aspect-ratio-presets.d.ts +24 -0
  141. package/build-types/state/aspect-ratio-presets.d.ts.map +1 -0
  142. package/build-types/state/composite-reducer.d.ts +17 -19
  143. package/build-types/state/composite-reducer.d.ts.map +1 -1
  144. package/build-types/state/index.d.ts +2 -4
  145. package/build-types/state/index.d.ts.map +1 -1
  146. package/build-types/state/types.d.ts +20 -63
  147. package/build-types/state/types.d.ts.map +1 -1
  148. package/build-types/state/use-media-editor-state.d.ts +33 -52
  149. package/build-types/state/use-media-editor-state.d.ts.map +1 -1
  150. package/package.json +22 -23
  151. package/src/components/media-editor/index.tsx +355 -167
  152. package/src/components/media-editor/style.scss +19 -0
  153. package/src/components/media-editor/use-crop-options.ts +9 -10
  154. package/src/components/media-editor/use-save-media-editor.ts +48 -10
  155. package/src/components/media-editor-canvas/index.tsx +30 -51
  156. package/src/components/media-editor-canvas/style.scss +6 -6
  157. package/src/components/media-editor-crop-panel/index.tsx +38 -2
  158. package/src/components/media-editor-crop-panel/style.scss +21 -0
  159. package/src/components/media-editor-fine-rotation/index.tsx +6 -6
  160. package/src/components/media-editor-image-controls/index.tsx +15 -11
  161. package/src/components/media-editor-keyboard-shortcuts-modal/index.tsx +1 -0
  162. package/src/components/media-editor-keyboard-shortcuts-modal/style.scss +1 -1
  163. package/src/components/media-editor-modal/index.tsx +1 -1
  164. package/src/components/media-editor-modal/style.scss +1 -1
  165. package/src/components/media-form/index.tsx +7 -1
  166. package/src/components/media-preview/index.tsx +65 -23
  167. package/src/components/media-preview/style.scss +16 -2
  168. package/src/components/rotation-ruler/style.scss +9 -5
  169. package/src/components/rotation-ruler/use-ruler-drag.ts +6 -11
  170. package/src/state/README.md +32 -0
  171. package/src/state/aspect-ratio-presets.ts +37 -0
  172. package/src/state/composite-reducer.ts +42 -80
  173. package/src/state/index.ts +2 -17
  174. package/src/state/types.ts +18 -72
  175. package/src/state/use-media-editor-state.ts +155 -238
  176. package/src/style.scss +2 -1
  177. package/build/components/media-editor-modal/build-modifiers.cjs +0 -91
  178. package/build/components/media-editor-modal/build-modifiers.cjs.map +0 -7
  179. package/build/image-editor/core/camera.cjs +0 -225
  180. package/build/image-editor/core/camera.cjs.map +0 -7
  181. package/build/image-editor/core/constants.cjs +0 -108
  182. package/build/image-editor/core/constants.cjs.map +0 -7
  183. package/build/image-editor/core/containment.cjs +0 -276
  184. package/build/image-editor/core/containment.cjs.map +0 -7
  185. package/build/image-editor/core/crop-rect.cjs +0 -48
  186. package/build/image-editor/core/crop-rect.cjs.map +0 -7
  187. package/build/image-editor/core/export/canvas-renderer.cjs +0 -151
  188. package/build/image-editor/core/export/canvas-renderer.cjs.map +0 -7
  189. package/build/image-editor/core/index.cjs +0 -62
  190. package/build/image-editor/core/index.cjs.map +0 -7
  191. package/build/image-editor/core/interaction-controller.cjs +0 -654
  192. package/build/image-editor/core/interaction-controller.cjs.map +0 -7
  193. package/build/image-editor/core/math/rotation.cjs +0 -41
  194. package/build/image-editor/core/math/rotation.cjs.map +0 -7
  195. package/build/image-editor/core/math/sanitize.cjs +0 -92
  196. package/build/image-editor/core/math/sanitize.cjs.map +0 -7
  197. package/build/image-editor/core/setter-helpers.cjs +0 -64
  198. package/build/image-editor/core/setter-helpers.cjs.map +0 -7
  199. package/build/image-editor/core/source-region.cjs +0 -206
  200. package/build/image-editor/core/source-region.cjs.map +0 -7
  201. package/build/image-editor/core/state.cjs +0 -283
  202. package/build/image-editor/core/state.cjs.map +0 -7
  203. package/build/image-editor/core/stencil-math.cjs +0 -216
  204. package/build/image-editor/core/stencil-math.cjs.map +0 -7
  205. package/build/image-editor/core/transform-style.cjs +0 -52
  206. package/build/image-editor/core/transform-style.cjs.map +0 -7
  207. package/build/image-editor/core/transforms/pipeline.cjs +0 -43
  208. package/build/image-editor/core/transforms/pipeline.cjs.map +0 -7
  209. package/build/image-editor/core/types.cjs +0 -19
  210. package/build/image-editor/core/types.cjs.map +0 -7
  211. package/build/image-editor/core/viewport-state.cjs +0 -50
  212. package/build/image-editor/core/viewport-state.cjs.map +0 -7
  213. package/build/image-editor/index.cjs +0 -67
  214. package/build/image-editor/index.cjs.map +0 -7
  215. package/build/image-editor/react/components/cropper-provider.cjs +0 -50
  216. package/build/image-editor/react/components/cropper-provider.cjs.map +0 -7
  217. package/build/image-editor/react/components/cropper.cjs +0 -722
  218. package/build/image-editor/react/components/cropper.cjs.map +0 -7
  219. package/build/image-editor/react/components/index.cjs +0 -36
  220. package/build/image-editor/react/components/index.cjs.map +0 -7
  221. package/build/image-editor/react/components/overlays/dimensions-overlay.cjs +0 -172
  222. package/build/image-editor/react/components/overlays/dimensions-overlay.cjs.map +0 -7
  223. package/build/image-editor/react/components/overlays/dimming-overlay.cjs +0 -62
  224. package/build/image-editor/react/components/overlays/dimming-overlay.cjs.map +0 -7
  225. package/build/image-editor/react/components/overlays/grid-overlay.cjs +0 -91
  226. package/build/image-editor/react/components/overlays/grid-overlay.cjs.map +0 -7
  227. package/build/image-editor/react/components/stencils/rectangle-stencil.cjs +0 -426
  228. package/build/image-editor/react/components/stencils/rectangle-stencil.cjs.map +0 -7
  229. package/build/image-editor/react/components/viewport-provider.cjs +0 -51
  230. package/build/image-editor/react/components/viewport-provider.cjs.map +0 -7
  231. package/build/image-editor/react/hooks/build-cropper-setters.cjs +0 -71
  232. package/build/image-editor/react/hooks/build-cropper-setters.cjs.map +0 -7
  233. package/build/image-editor/react/hooks/index.cjs +0 -34
  234. package/build/image-editor/react/hooks/index.cjs.map +0 -7
  235. package/build/image-editor/react/hooks/use-aria-announcer.cjs +0 -160
  236. package/build/image-editor/react/hooks/use-aria-announcer.cjs.map +0 -7
  237. package/build/image-editor/react/hooks/use-cropper-reducer.cjs +0 -113
  238. package/build/image-editor/react/hooks/use-cropper-reducer.cjs.map +0 -7
  239. package/build/image-editor/react/hooks/use-interaction.cjs +0 -213
  240. package/build/image-editor/react/hooks/use-interaction.cjs.map +0 -7
  241. package/build/image-editor/react/hooks/use-transform-style.cjs +0 -38
  242. package/build/image-editor/react/hooks/use-transform-style.cjs.map +0 -7
  243. package/build/image-editor/react/hooks/use-viewport-state.cjs +0 -51
  244. package/build/image-editor/react/hooks/use-viewport-state.cjs.map +0 -7
  245. package/build/image-editor/react/visually-hidden-style.cjs +0 -41
  246. package/build/image-editor/react/visually-hidden-style.cjs.map +0 -7
  247. package/build/index.cjs.map +0 -7
  248. package/build/state/index.cjs.map +0 -7
  249. package/build/utils/index.cjs.map +0 -7
  250. package/build-module/components/media-editor-modal/build-modifiers.mjs +0 -66
  251. package/build-module/components/media-editor-modal/build-modifiers.mjs.map +0 -7
  252. package/build-module/image-editor/core/camera.mjs +0 -198
  253. package/build-module/image-editor/core/camera.mjs.map +0 -7
  254. package/build-module/image-editor/core/constants.mjs +0 -69
  255. package/build-module/image-editor/core/constants.mjs.map +0 -7
  256. package/build-module/image-editor/core/containment.mjs +0 -253
  257. package/build-module/image-editor/core/containment.mjs.map +0 -7
  258. package/build-module/image-editor/core/crop-rect.mjs +0 -23
  259. package/build-module/image-editor/core/crop-rect.mjs.map +0 -7
  260. package/build-module/image-editor/core/export/canvas-renderer.mjs +0 -120
  261. package/build-module/image-editor/core/export/canvas-renderer.mjs.map +0 -7
  262. package/build-module/image-editor/core/index.mjs +0 -36
  263. package/build-module/image-editor/core/index.mjs.map +0 -7
  264. package/build-module/image-editor/core/interaction-controller.mjs +0 -635
  265. package/build-module/image-editor/core/interaction-controller.mjs.map +0 -7
  266. package/build-module/image-editor/core/math/rotation.mjs +0 -15
  267. package/build-module/image-editor/core/math/rotation.mjs.map +0 -7
  268. package/build-module/image-editor/core/math/sanitize.mjs +0 -63
  269. package/build-module/image-editor/core/math/sanitize.mjs.map +0 -7
  270. package/build-module/image-editor/core/setter-helpers.mjs +0 -39
  271. package/build-module/image-editor/core/setter-helpers.mjs.map +0 -7
  272. package/build-module/image-editor/core/source-region.mjs +0 -178
  273. package/build-module/image-editor/core/source-region.mjs.map +0 -7
  274. package/build-module/image-editor/core/state.mjs +0 -260
  275. package/build-module/image-editor/core/state.mjs.map +0 -7
  276. package/build-module/image-editor/core/stencil-math.mjs +0 -187
  277. package/build-module/image-editor/core/stencil-math.mjs.map +0 -7
  278. package/build-module/image-editor/core/transform-style.mjs +0 -27
  279. package/build-module/image-editor/core/transform-style.mjs.map +0 -7
  280. package/build-module/image-editor/core/transforms/pipeline.mjs +0 -17
  281. package/build-module/image-editor/core/transforms/pipeline.mjs.map +0 -7
  282. package/build-module/image-editor/core/types.mjs +0 -1
  283. package/build-module/image-editor/core/types.mjs.map +0 -7
  284. package/build-module/image-editor/core/viewport-state.mjs +0 -24
  285. package/build-module/image-editor/core/viewport-state.mjs.map +0 -7
  286. package/build-module/image-editor/index.mjs +0 -39
  287. package/build-module/image-editor/index.mjs.map +0 -7
  288. package/build-module/image-editor/react/components/cropper-provider.mjs +0 -26
  289. package/build-module/image-editor/react/components/cropper-provider.mjs.map +0 -7
  290. package/build-module/image-editor/react/components/cropper.mjs +0 -704
  291. package/build-module/image-editor/react/components/cropper.mjs.map +0 -7
  292. package/build-module/image-editor/react/components/index.mjs +0 -9
  293. package/build-module/image-editor/react/components/index.mjs.map +0 -7
  294. package/build-module/image-editor/react/components/overlays/dimensions-overlay.mjs +0 -147
  295. package/build-module/image-editor/react/components/overlays/dimensions-overlay.mjs.map +0 -7
  296. package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs +0 -37
  297. package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs.map +0 -7
  298. package/build-module/image-editor/react/components/overlays/grid-overlay.mjs +0 -66
  299. package/build-module/image-editor/react/components/overlays/grid-overlay.mjs.map +0 -7
  300. package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs +0 -414
  301. package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs.map +0 -7
  302. package/build-module/image-editor/react/components/viewport-provider.mjs +0 -27
  303. package/build-module/image-editor/react/components/viewport-provider.mjs.map +0 -7
  304. package/build-module/image-editor/react/hooks/build-cropper-setters.mjs +0 -46
  305. package/build-module/image-editor/react/hooks/build-cropper-setters.mjs.map +0 -7
  306. package/build-module/image-editor/react/hooks/index.mjs +0 -8
  307. package/build-module/image-editor/react/hooks/index.mjs.map +0 -7
  308. package/build-module/image-editor/react/hooks/use-aria-announcer.mjs +0 -135
  309. package/build-module/image-editor/react/hooks/use-aria-announcer.mjs.map +0 -7
  310. package/build-module/image-editor/react/hooks/use-cropper-reducer.mjs +0 -100
  311. package/build-module/image-editor/react/hooks/use-cropper-reducer.mjs.map +0 -7
  312. package/build-module/image-editor/react/hooks/use-interaction.mjs +0 -190
  313. package/build-module/image-editor/react/hooks/use-interaction.mjs.map +0 -7
  314. package/build-module/image-editor/react/hooks/use-transform-style.mjs +0 -13
  315. package/build-module/image-editor/react/hooks/use-transform-style.mjs.map +0 -7
  316. package/build-module/image-editor/react/hooks/use-viewport-state.mjs +0 -29
  317. package/build-module/image-editor/react/hooks/use-viewport-state.mjs.map +0 -7
  318. package/build-module/image-editor/react/visually-hidden-style.mjs +0 -16
  319. package/build-module/image-editor/react/visually-hidden-style.mjs.map +0 -7
  320. package/build-module/index.mjs.map +0 -7
  321. package/build-module/state/index.mjs.map +0 -7
  322. package/build-module/utils/index.mjs.map +0 -7
  323. package/build-types/components/media-editor-modal/build-modifiers.d.ts +0 -80
  324. package/build-types/components/media-editor-modal/build-modifiers.d.ts.map +0 -1
  325. package/build-types/image-editor/core/camera.d.ts +0 -128
  326. package/build-types/image-editor/core/camera.d.ts.map +0 -1
  327. package/build-types/image-editor/core/constants.d.ts +0 -99
  328. package/build-types/image-editor/core/constants.d.ts.map +0 -1
  329. package/build-types/image-editor/core/containment.d.ts +0 -72
  330. package/build-types/image-editor/core/containment.d.ts.map +0 -1
  331. package/build-types/image-editor/core/crop-rect.d.ts +0 -16
  332. package/build-types/image-editor/core/crop-rect.d.ts.map +0 -1
  333. package/build-types/image-editor/core/export/canvas-renderer.d.ts +0 -103
  334. package/build-types/image-editor/core/export/canvas-renderer.d.ts.map +0 -1
  335. package/build-types/image-editor/core/index.d.ts +0 -10
  336. package/build-types/image-editor/core/index.d.ts.map +0 -1
  337. package/build-types/image-editor/core/interaction-controller.d.ts +0 -191
  338. package/build-types/image-editor/core/interaction-controller.d.ts.map +0 -1
  339. package/build-types/image-editor/core/math/rotation.d.ts +0 -18
  340. package/build-types/image-editor/core/math/rotation.d.ts.map +0 -1
  341. package/build-types/image-editor/core/math/sanitize.d.ts +0 -67
  342. package/build-types/image-editor/core/math/sanitize.d.ts.map +0 -1
  343. package/build-types/image-editor/core/setter-helpers.d.ts +0 -21
  344. package/build-types/image-editor/core/setter-helpers.d.ts.map +0 -1
  345. package/build-types/image-editor/core/source-region.d.ts +0 -94
  346. package/build-types/image-editor/core/source-region.d.ts.map +0 -1
  347. package/build-types/image-editor/core/state.d.ts +0 -51
  348. package/build-types/image-editor/core/state.d.ts.map +0 -1
  349. package/build-types/image-editor/core/stencil-math.d.ts +0 -102
  350. package/build-types/image-editor/core/stencil-math.d.ts.map +0 -1
  351. package/build-types/image-editor/core/transform-style.d.ts +0 -20
  352. package/build-types/image-editor/core/transform-style.d.ts.map +0 -1
  353. package/build-types/image-editor/core/transforms/pipeline.d.ts +0 -24
  354. package/build-types/image-editor/core/transforms/pipeline.d.ts.map +0 -1
  355. package/build-types/image-editor/core/types.d.ts +0 -269
  356. package/build-types/image-editor/core/types.d.ts.map +0 -1
  357. package/build-types/image-editor/core/viewport-state.d.ts +0 -4
  358. package/build-types/image-editor/core/viewport-state.d.ts.map +0 -1
  359. package/build-types/image-editor/index.d.ts +0 -16
  360. package/build-types/image-editor/index.d.ts.map +0 -1
  361. package/build-types/image-editor/react/components/cropper-provider.d.ts +0 -38
  362. package/build-types/image-editor/react/components/cropper-provider.d.ts.map +0 -1
  363. package/build-types/image-editor/react/components/cropper.d.ts +0 -63
  364. package/build-types/image-editor/react/components/cropper.d.ts.map +0 -1
  365. package/build-types/image-editor/react/components/index.d.ts +0 -4
  366. package/build-types/image-editor/react/components/index.d.ts.map +0 -1
  367. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts +0 -33
  368. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts.map +0 -1
  369. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts +0 -17
  370. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts.map +0 -1
  371. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts +0 -27
  372. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts.map +0 -1
  373. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts +0 -33
  374. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts.map +0 -1
  375. package/build-types/image-editor/react/components/viewport-provider.d.ts +0 -6
  376. package/build-types/image-editor/react/components/viewport-provider.d.ts.map +0 -1
  377. package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts +0 -44
  378. package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts.map +0 -1
  379. package/build-types/image-editor/react/hooks/index.d.ts +0 -5
  380. package/build-types/image-editor/react/hooks/index.d.ts.map +0 -1
  381. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts +0 -14
  382. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts.map +0 -1
  383. package/build-types/image-editor/react/hooks/use-cropper-reducer.d.ts +0 -55
  384. package/build-types/image-editor/react/hooks/use-cropper-reducer.d.ts.map +0 -1
  385. package/build-types/image-editor/react/hooks/use-interaction.d.ts +0 -65
  386. package/build-types/image-editor/react/hooks/use-interaction.d.ts.map +0 -1
  387. package/build-types/image-editor/react/hooks/use-transform-style.d.ts +0 -13
  388. package/build-types/image-editor/react/hooks/use-transform-style.d.ts.map +0 -1
  389. package/build-types/image-editor/react/hooks/use-viewport-state.d.ts +0 -16
  390. package/build-types/image-editor/react/hooks/use-viewport-state.d.ts.map +0 -1
  391. package/build-types/image-editor/react/visually-hidden-style.d.ts +0 -6
  392. package/build-types/image-editor/react/visually-hidden-style.d.ts.map +0 -1
  393. package/src/components/media-editor-modal/build-modifiers.ts +0 -161
  394. package/src/image-editor/README.md +0 -61
  395. package/src/image-editor/core/camera.ts +0 -429
  396. package/src/image-editor/core/constants.ts +0 -150
  397. package/src/image-editor/core/containment.ts +0 -469
  398. package/src/image-editor/core/crop-rect.ts +0 -42
  399. package/src/image-editor/core/export/canvas-renderer.ts +0 -250
  400. package/src/image-editor/core/index.ts +0 -47
  401. package/src/image-editor/core/interaction-controller.ts +0 -976
  402. package/src/image-editor/core/math/rotation.ts +0 -26
  403. package/src/image-editor/core/math/sanitize.ts +0 -155
  404. package/src/image-editor/core/setter-helpers.ts +0 -63
  405. package/src/image-editor/core/source-region.ts +0 -367
  406. package/src/image-editor/core/state.ts +0 -484
  407. package/src/image-editor/core/stencil-math.ts +0 -379
  408. package/src/image-editor/core/transform-style.ts +0 -56
  409. package/src/image-editor/core/transforms/pipeline.ts +0 -40
  410. package/src/image-editor/core/types.ts +0 -230
  411. package/src/image-editor/core/viewport-state.ts +0 -30
  412. package/src/image-editor/docs/architecture.md +0 -63
  413. package/src/image-editor/docs/recipes.md +0 -184
  414. package/src/image-editor/index.ts +0 -52
  415. package/src/image-editor/react/components/cropper-provider.tsx +0 -70
  416. package/src/image-editor/react/components/cropper.scss +0 -259
  417. package/src/image-editor/react/components/cropper.tsx +0 -1116
  418. package/src/image-editor/react/components/index.ts +0 -3
  419. package/src/image-editor/react/components/overlays/dimensions-overlay.tsx +0 -262
  420. package/src/image-editor/react/components/overlays/dimming-overlay.tsx +0 -55
  421. package/src/image-editor/react/components/overlays/grid-overlay.tsx +0 -77
  422. package/src/image-editor/react/components/stencils/rectangle-stencil.tsx +0 -623
  423. package/src/image-editor/react/components/viewport-provider.tsx +0 -32
  424. package/src/image-editor/react/hooks/build-cropper-setters.ts +0 -102
  425. package/src/image-editor/react/hooks/index.ts +0 -4
  426. package/src/image-editor/react/hooks/use-aria-announcer.ts +0 -193
  427. package/src/image-editor/react/hooks/use-cropper-reducer.ts +0 -197
  428. package/src/image-editor/react/hooks/use-interaction.ts +0 -294
  429. package/src/image-editor/react/hooks/use-transform-style.ts +0 -23
  430. package/src/image-editor/react/hooks/use-viewport-state.ts +0 -41
  431. package/src/image-editor/react/visually-hidden-style.ts +0 -15
  432. package/src/image-editor/style.scss +0 -1
@@ -1,269 +0,0 @@
1
- import type { mat2d } from 'gl-matrix';
2
- /**
3
- * A 2D camera represented as a 2×3 affine transformation matrix (`mat2d`).
4
- *
5
- * This is not a camera object with properties — it's a raw 6-element matrix
6
- * `[a, b, c, d, tx, ty]` that maps normalized world coordinates [0,1] to
7
- * screen pixels. It composes pan, rotation, flip, zoom, and contain-fit
8
- * into a single transform.
9
- *
10
- * Use `createCamera()` to build one from `CropperState`, then pass it to
11
- * `worldToScreen()` / `screenToWorld()` for coordinate conversion.
12
- *
13
- * A 3D camera would use `mat4`; this is strictly 2D (no perspective).
14
- */
15
- export type Camera = mat2d;
16
- /**
17
- * A point with normalized coordinates (0-1 range relative to image dimensions).
18
- */
19
- export interface NormalizedPoint {
20
- x: number;
21
- y: number;
22
- }
23
- /**
24
- * A rectangle with normalized coordinates (0-1 range).
25
- * Origin is the top-left corner of the image.
26
- */
27
- export interface NormalizedRect {
28
- x: number;
29
- y: number;
30
- width: number;
31
- height: number;
32
- }
33
- /**
34
- * Width and height dimensions.
35
- */
36
- export interface Size {
37
- width: number;
38
- height: number;
39
- }
40
- /**
41
- * Flip state for horizontal and vertical axes.
42
- */
43
- export interface Flip {
44
- horizontal: boolean;
45
- vertical: boolean;
46
- }
47
- /**
48
- * A JSON-serializable transform operation for the non-destructive pipeline.
49
- */
50
- export type TransformOperation = {
51
- type: 'crop';
52
- rect: NormalizedRect;
53
- } | {
54
- type: 'rotate';
55
- degrees: number;
56
- } | {
57
- type: 'flip';
58
- direction: 'horizontal' | 'vertical';
59
- } | {
60
- type: 'zoom';
61
- factor: number;
62
- };
63
- /**
64
- * Full cropper state.
65
- */
66
- export interface CropperState {
67
- /** The source image information. Null until an image is loaded. */
68
- image: {
69
- src: string;
70
- naturalWidth: number;
71
- naturalHeight: number;
72
- } | null;
73
- /**
74
- * Image pan offset in normalized coordinates. Not the crop
75
- * rectangle — that's `cropRect` below.
76
- */
77
- pan: NormalizedPoint;
78
- /** Zoom level. 1 = no zoom. */
79
- zoom: number;
80
- /** Rotation in degrees, normalized to 0-360. */
81
- rotation: number;
82
- /**
83
- * Base pan/zoom/rotation — the pose the user last explicitly set.
84
- *
85
- * During continuous fine rotation (SET_ROTATION), every tick
86
- * re-derives the transient `pan`/`zoom` from these base values
87
- * rather than compounding on the previous tick. This prevents
88
- * drift from accumulated containment clamping near image edges:
89
- * rotating 0°→30°→0° returns to the exact starting pan, not a
90
- * slightly-nudged version of it.
91
- *
92
- * These are updated by every action except SET_ROTATION itself —
93
- * explicit zoom, pan, crop-rect, flip, and 90° snap all commit
94
- * the post-containment state into base. SET_ROTATION reads from
95
- * `basePan` and `baseRotation` to compute the new pan, and reads
96
- * `baseZoom` as the zoom floor (enforceContainment may bump it up
97
- * to cover the rotated crop, but never leaves it above baseZoom).
98
- */
99
- basePan: NormalizedPoint;
100
- baseZoom: number;
101
- baseRotation: number;
102
- /** Flip state. */
103
- flip: Flip;
104
- /** The crop rectangle in normalized coordinates. */
105
- cropRect: NormalizedRect;
106
- }
107
- /**
108
- * Internal reducer action union.
109
- *
110
- * This type is intentionally not exported from the image-editor public barrel.
111
- * Consumers should drive state through the controller returned by
112
- * `useCropperReducer()` (or a composite store) or through serializable
113
- * `TransformOperation` values.
114
- */
115
- export type CropperAction =
116
- /** Sets the loaded image metadata (natural size, src). */
117
- {
118
- type: 'SET_IMAGE';
119
- payload: CropperState['image'];
120
- }
121
- /** Sets the image pan offset. (Crop rectangle is SET_CROP_RECT.) */
122
- | {
123
- type: 'SET_PAN';
124
- payload: NormalizedPoint;
125
- }
126
- /** Sets the zoom level, clamped to [coverage-aware min, MAX_ZOOM]. */
127
- | {
128
- type: 'SET_ZOOM';
129
- payload: number;
130
- }
131
- /**
132
- * Sets zoom and pan together atomically. Used by focal-point
133
- * zoom (wheel, pinch) to keep a target point stationary while
134
- * zoom changes.
135
- */
136
- | {
137
- type: 'SET_ZOOM_AT_POINT';
138
- payload: {
139
- zoom: number;
140
- pan: NormalizedPoint;
141
- };
142
- }
143
- /** Sets the absolute rotation angle in degrees. */
144
- | {
145
- type: 'SET_ROTATION';
146
- payload: number;
147
- }
148
- /** Rotates by +/-90 degrees (snap). */
149
- | {
150
- type: 'SNAP_ROTATE_90';
151
- payload: {
152
- direction: 1 | -1;
153
- };
154
- }
155
- /** Sets the flip state. */
156
- | {
157
- type: 'SET_FLIP';
158
- payload: Flip;
159
- }
160
- /** Sets the crop rectangle. */
161
- | {
162
- type: 'SET_CROP_RECT';
163
- payload: NormalizedRect;
164
- }
165
- /** Settle animation after resize drag, recentering the crop rect. */
166
- | {
167
- type: 'SETTLE_CROP';
168
- }
169
- /** Applies a single pipeline transform via the reducer. */
170
- | {
171
- type: 'APPLY_OPERATION';
172
- payload: TransformOperation;
173
- }
174
- /** Resets to DEFAULT_STATE, optionally merging a partial override. */
175
- | {
176
- type: 'RESET';
177
- payload?: Partial<CropperState>;
178
- };
179
- /**
180
- * Viewport camera state — display-only, does not affect export or undo.
181
- *
182
- * Applied as a CSS transform on the inner stage div so the user can scroll
183
- * the view independently of the crop. zoom > 1 magnifies; pan shifts in CSS px.
184
- */
185
- export interface ViewportState {
186
- zoom: number;
187
- pan: {
188
- x: number;
189
- y: number;
190
- };
191
- }
192
- export type ViewportAction = {
193
- type: 'SET_VIEWPORT_ZOOM';
194
- payload: number;
195
- } | {
196
- type: 'SET_VIEWPORT_PAN';
197
- payload: {
198
- x: number;
199
- y: number;
200
- };
201
- } | {
202
- type: 'RESET_VIEWPORT';
203
- };
204
- /**
205
- * Direction of a crop resize handle. Eight compass positions: four
206
- * corners and four edge midpoints. Used by stencil callbacks and any
207
- * overlay that needs to know which handle the user is dragging.
208
- */
209
- export type HandlePosition = 'n' | 's' | 'e' | 'w' | 'nw' | 'ne' | 'sw' | 'se';
210
- /**
211
- * The contract for a pluggable stencil component.
212
- * Stencils render the crop area overlay and handle resize interactions.
213
- */
214
- export interface StencilProps {
215
- /** The current crop rectangle in normalized coordinates. */
216
- cropRect: NormalizedRect;
217
- /** The container element dimensions in pixels. */
218
- containerSize: Size;
219
- /** The rendered image dimensions in pixels within the container. */
220
- imageSize: Size;
221
- /** Callback when the crop rectangle changes (during drag). */
222
- onCropChange: (rect: NormalizedRect) => void;
223
- /**
224
- * Callback when a resize interaction starts — pointerdown on a handle
225
- * or the first arrow-key press on a focused handle. The handle direction
226
- * is passed so downstream overlays can anchor to it. The argument is
227
- * optional to keep custom stencils that don't track a direction
228
- * backward-compatible.
229
- */
230
- onResizeStart?: (handle?: HandlePosition) => void;
231
- /** Callback when a resize drag ends (mouseup after handle drag). */
232
- onResizeEnd?: () => void;
233
- /** Optional fixed aspect ratio (width / height) in pixel space. */
234
- aspectRatio?: number;
235
- /** Whether the crop handles are shown for freeform resizing. */
236
- freeformCrop?: boolean;
237
- /** Whether resize handles should ignore pointer and keyboard input. */
238
- isResizeDisabled?: boolean;
239
- /** CSS transition string for settle animation. */
240
- stencilTransition?: string;
241
- /** Maximum crop rect bounds based on current zoom/rotation. */
242
- cropBounds?: {
243
- minX: number;
244
- minY: number;
245
- maxX: number;
246
- maxY: number;
247
- };
248
- /** Called when Escape is pressed on a resize handle. */
249
- onEscape?: () => void;
250
- /**
251
- * Minimum crop rect dimension in normalized space, per axis. Derived
252
- * by the host from a pixel-based floor (see `MIN_CROP_PIXELS`) and
253
- * the source image dimensions. Omit to use the stencil's default.
254
- */
255
- minCropSize?: Size;
256
- /**
257
- * Optional post-processor for freeform resize output. Hosts use this for
258
- * display-gated behavior such as snapping visible pixel grids to source
259
- * pixel boundaries.
260
- */
261
- snapCropRect?: (rect: NormalizedRect, handle: HandlePosition) => NormalizedRect;
262
- /**
263
- * Optional keyboard resize step in normalized space, per axis. Hosts use
264
- * this when keyboard resize should follow the rendered image scale instead
265
- * of the default percentage-based step.
266
- */
267
- keyboardResizeStep?: Size;
268
- }
269
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/types.ts"],"names":[],"mappings":"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"}
@@ -1,4 +0,0 @@
1
- import type { ViewportState, ViewportAction } from './types';
2
- export declare const DEFAULT_VIEWPORT_STATE: ViewportState;
3
- export declare function viewportReducer(state: ViewportState, action: ViewportAction): ViewportState;
4
- //# sourceMappingURL=viewport-state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"viewport-state.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/viewport-state.ts"],"names":[],"mappings":"AAAA,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"}
@@ -1,16 +0,0 @@
1
- /**
2
- * Public image editor contract.
3
- *
4
- * Keep this barrel explicit so implementation details from `core/`,
5
- * `react/hooks/`, or `react/components/` do not become supported API by
6
- * accident. Internal modules may export additional helpers for local tests or
7
- * React wiring; consumers should import through this file.
8
- */
9
- export { useCropperReducer, buildCropperSetters } from './react/hooks';
10
- export { Cropper, CropperProvider, useCropper } from './react/components';
11
- export type { CropperController, CropperSetters } from './react/hooks';
12
- export type { CropperProps } from './react/components';
13
- export type { CropperState, CropperAction, TransformOperation, NormalizedPoint, NormalizedRect, Size, Flip, StencilProps, HandlePosition, } from './core';
14
- export { DEFAULT_STATE, DEFAULT_ASPECT_RATIOS, ORIGINAL_ASPECT_RATIO, cropperReducer, enforceContainment, areCropperStatesEqual, computeInscribedRect, getSourceRegion, getSourceRegionPercent, applyOperationToState, stateFromPipeline, exportCroppedImage, applyToCanvas, } from './core';
15
- export type { AspectRatioPreset, SourceRegion, SourceRegionPercent, } from './core';
16
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/image-editor/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1E,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,YAAY,EACX,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,cAAc,GACd,MAAM,QAAQ,CAAC;AAMhB,OAAO,EACN,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,GACb,MAAM,QAAQ,CAAC;AAChB,YAAY,EACX,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,GACnB,MAAM,QAAQ,CAAC"}
@@ -1,38 +0,0 @@
1
- import { type CropperController } from '../hooks/use-cropper-reducer';
2
- import type { CropperState } from '../../core/types';
3
- /**
4
- * Props for the CropperProvider component.
5
- */
6
- interface CropperProviderProps {
7
- /** Optional partial initial state to merge with defaults. */
8
- initialState?: Partial<CropperState>;
9
- /** Child components. */
10
- children: React.ReactNode;
11
- }
12
- /**
13
- * Convenience context provider that wraps `useCropperReducer`.
14
- *
15
- * Provides the pure cropper controller (state + setters, NO undo
16
- * history) to all descendant components via React context.
17
- *
18
- * History is a higher-layer concern owned by composite stores
19
- * (see `useMediaEditorState` in media-editor/state for the media
20
- * editor's composite controller with undo/redo).
21
- *
22
- * @param props
23
- * @param props.initialState
24
- * @param props.children
25
- * @return The provider element wrapping children.
26
- */
27
- export declare function CropperProvider({ initialState, children, }: CropperProviderProps): import("react").JSX.Element;
28
- /**
29
- * Hook to consume the CropperProvider context.
30
- *
31
- * Must be used within a CropperProvider. Throws if used outside
32
- * of the provider tree.
33
- *
34
- * @return The cropper controller.
35
- */
36
- export declare function useCropper(): CropperController;
37
- export {};
38
- //# sourceMappingURL=cropper-provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cropper-provider.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/cropper-provider.tsx"],"names":[],"mappings":"AACA,OAAO,EAEN,KAAK,iBAAiB,EACtB,MAAM,8BAA8B,CAAC;AACtC,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;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAAE,EAChC,YAAY,EACZ,QAAQ,GACR,EAAE,oBAAoB,+BAQtB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,IAAI,iBAAiB,CAQ9C"}
@@ -1,63 +0,0 @@
1
- import type { CropperState, StencilProps, Size } from '../../core/types';
2
- import type { CropperController } from '../hooks/use-cropper-reducer';
3
- /**
4
- * Props for the Cropper component.
5
- */
6
- export interface CropperProps {
7
- /** Image source URL. */
8
- src: string;
9
- /** The cropper controller from `useCropperReducer` or a composite store. */
10
- controller: CropperController;
11
- /** Stencil component for the crop area. Defaults to RectangleStencil. */
12
- stencil?: React.ComponentType<StencilProps>;
13
- /** Show the rule-of-thirds grid overlay, or only during interactions. */
14
- showGrid?: boolean | 'interactive';
15
- /** Whether external placement activity should keep the grid visible. */
16
- isPlacementActive?: boolean;
17
- /** Show the dimming overlay outside the crop area. */
18
- showDimming?: boolean;
19
- /** Show the live output dimensions tooltip during a resize. */
20
- showDimensions?: boolean;
21
- /** Minimum zoom level override. Defaults to the coverage-aware minimum. */
22
- minZoom?: number;
23
- /** Maximum zoom level. */
24
- maxZoom?: number;
25
- /** Fixed aspect ratio (width / height) in pixel space for the crop area. */
26
- aspectRatio?: number;
27
- /**
28
- * Enable freeform crop mode with resizable handles.
29
- * When false (default), the crop area is fixed and centered.
30
- * When true, the crop area has resize handles and can be freely repositioned.
31
- */
32
- freeformCrop?: boolean;
33
- /** Focus the crop area when the cropper mounts. */
34
- focusOnMount?: boolean;
35
- /**
36
- * Ignore all crop interaction: pointer drags, wheel zoom, keyboard
37
- * pan/zoom and the stencil's resize handles. Any gesture already in
38
- * flight is cancelled. Used while the edit is being saved, so the
39
- * modifiers sent to the server cannot change after the request starts.
40
- */
41
- disabled?: boolean;
42
- /** Callback fired when the image is loaded. */
43
- onImageLoaded?: (size: Size) => void;
44
- /**
45
- * Callback fired on every state change. Fires at pointermove rate
46
- * during drags, so keep the handler light — no heavy work, no
47
- * expensive parent re-renders. For commit-style events (drag end,
48
- * settled crop), use `onGestureEnd` instead.
49
- *
50
- * Useful for lightweight syncing with external tools, analytics,
51
- * or AI agents. Receives the full state so consumers can derive
52
- * whatever they need.
53
- */
54
- onStateChange?: (state: CropperState) => void;
55
- /** Fires when a continuous gesture begins (pan drag, handle resize, pinch zoom). */
56
- onGestureStart?: () => void;
57
- /** Fires when a continuous gesture ends (pointerup, resize settle). */
58
- onGestureEnd?: () => void;
59
- /** Additional className for the container. */
60
- className?: string;
61
- }
62
- export declare const Cropper: import("react").ForwardRefExoticComponent<CropperProps & import("react").RefAttributes<HTMLDivElement>>;
63
- //# sourceMappingURL=cropper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cropper.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/cropper.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACX,YAAY,EAEZ,YAAY,EACZ,IAAI,EAEJ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AA2CtE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,wBAAwB;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,4EAA4E;IAC5E,UAAU,EAAE,iBAAiB,CAAC;IAC9B,yEAAyE;IACzE,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAE,YAAY,CAAE,CAAC;IAC9C,yEAAyE;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,+DAA+D;IAC/D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,2EAA2E;IAC3E,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;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+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;AA69BD,eAAO,MAAM,OAAO,yGAMnB,CAAC"}
@@ -1,4 +0,0 @@
1
- export { Cropper } from './cropper';
2
- export type { CropperProps } from './cropper';
3
- export { CropperProvider, useCropper } from './cropper-provider';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,33 +0,0 @@
1
- import type { HandlePosition, NormalizedRect, Size } from '../../../core/types';
2
- interface DimensionsOverlayProps {
3
- /** Crop rectangle in normalized coordinates. */
4
- cropRect: NormalizedRect;
5
- /** Container element dimensions in pixels. */
6
- containerSize: Size;
7
- /** Rendered image dimensions in pixels within the container. */
8
- imageSize: Size;
9
- /** Currently-dragged handle, or null when no pointer drag is active. */
10
- activeHandle: HandlePosition | null;
11
- /** Output crop width in source pixels. */
12
- outputWidth: number;
13
- /** Output crop height in source pixels. */
14
- outputHeight: number;
15
- }
16
- /**
17
- * Tooltip that follows the active resize handle during a pointer drag,
18
- * showing the current output dimensions of the crop in source pixels.
19
- *
20
- * Renders nothing outside of a pointer-driven resize, so keyboard
21
- * arrow-key adjustments and pan/zoom gestures stay quiet.
22
- *
23
- * @param props
24
- * @param props.cropRect
25
- * @param props.containerSize
26
- * @param props.imageSize
27
- * @param props.activeHandle
28
- * @param props.outputWidth
29
- * @param props.outputHeight
30
- */
31
- export declare function DimensionsOverlay({ cropRect, containerSize, imageSize, activeHandle, outputWidth, outputHeight, }: DimensionsOverlayProps): import("react").JSX.Element | null;
32
- export {};
33
- //# sourceMappingURL=dimensions-overlay.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dimensions-overlay.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/overlays/dimensions-overlay.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAgIhF,UAAU,sBAAsB;IAC/B,gDAAgD;IAChD,QAAQ,EAAE,cAAc,CAAC;IACzB,8CAA8C;IAC9C,aAAa,EAAE,IAAI,CAAC;IACpB,gEAAgE;IAChE,SAAS,EAAE,IAAI,CAAC;IAChB,wEAAwE;IACxE,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;IACpC,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAE,EAClC,QAAQ,EACR,aAAa,EACb,SAAS,EACT,YAAY,EACZ,WAAW,EACX,YAAY,GACZ,EAAE,sBAAsB,sCA+FxB"}
@@ -1,17 +0,0 @@
1
- import type { NormalizedRect, Size } from '../../../core/types';
2
- /**
3
- * Props for the DimmingOverlay component.
4
- */
5
- interface DimmingOverlayProps {
6
- /** The crop rectangle in normalized coordinates. */
7
- cropRect: NormalizedRect;
8
- /** The container element dimensions in pixels. */
9
- containerSize: Size;
10
- /** The rendered image dimensions in pixels within the container. */
11
- imageSize: Size;
12
- /** CSS transition string, e.g. during settle animation. */
13
- transition?: string;
14
- }
15
- export declare function DimmingOverlay({ cropRect, containerSize, imageSize, transition, }: DimmingOverlayProps): import("react").JSX.Element | null;
16
- export {};
17
- //# sourceMappingURL=dimming-overlay.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dimming-overlay.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/overlays/dimming-overlay.tsx"],"names":[],"mappings":"AAAA,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,GACV,EAAE,mBAAmB,sCA+BrB"}
@@ -1,27 +0,0 @@
1
- import type { NormalizedRect, Size } from '../../../core/types';
2
- /**
3
- * Props for the GridOverlay component.
4
- */
5
- interface GridOverlayProps {
6
- /** The crop rectangle in normalized coordinates. */
7
- cropRect: NormalizedRect;
8
- /** The container element dimensions in pixels. */
9
- containerSize: Size;
10
- /** The rendered image dimensions in pixels within the container. */
11
- imageSize: Size;
12
- }
13
- /**
14
- * Renders a rule-of-thirds grid inside the crop rectangle.
15
- *
16
- * Displays 2 horizontal and 2 vertical lines at 1/3 and 2/3
17
- * positions within the crop area.
18
- *
19
- * @param props Component props.
20
- * @param props.cropRect The crop rectangle in normalized coordinates.
21
- * @param props.containerSize The container element dimensions in pixels.
22
- * @param props.imageSize The rendered image dimensions in pixels.
23
- * @return The grid overlay element.
24
- */
25
- export declare function GridOverlay({ cropRect, containerSize, imageSize, }: GridOverlayProps): import("react").JSX.Element | null;
26
- export {};
27
- //# sourceMappingURL=grid-overlay.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grid-overlay.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/overlays/grid-overlay.tsx"],"names":[],"mappings":"AAAA,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,33 +0,0 @@
1
- import type { StencilProps } from '../../../core/types';
2
- /**
3
- * Props for the RectangleStencil component.
4
- */
5
- type RectangleStencilProps = StencilProps;
6
- /**
7
- * A rectangular crop stencil with resize handles.
8
- *
9
- * In freeform mode, handles resize the crop area. Clicks inside the
10
- * crop pass through to the container for image panning. The crop
11
- * auto-centers after resize via SETTLE_CROP.
12
- *
13
- * @param props Component props implementing StencilProps.
14
- * @param props.cropRect The crop rectangle in normalized coordinates.
15
- * @param props.containerSize The container element dimensions in pixels.
16
- * @param props.imageSize The rendered image dimensions in pixels.
17
- * @param props.onCropChange Callback fired when the crop rect changes.
18
- * @param props.onResizeStart Callback fired when a resize drag starts.
19
- * @param props.onResizeEnd Callback fired when a resize drag ends (mouseup).
20
- * @param props.aspectRatio Optional fixed aspect ratio (width / height).
21
- * @param props.freeformCrop Whether resize handles are shown.
22
- * @param props.isResizeDisabled Whether resize handles should ignore pointer and keyboard input.
23
- * @param props.stencilTransition CSS transition string for settle animation.
24
- * @param props.cropBounds Maximum crop rect bounds from camera (zoom/rotation-aware).
25
- * @param props.onEscape Called when Escape is pressed on a resize handle.
26
- * @param props.minCropSize Minimum crop rect dimension in normalized space, per axis.
27
- * @param props.snapCropRect Optional post-processor for freeform resize output.
28
- * @param props.keyboardResizeStep Optional keyboard resize step in normalized space, per axis.
29
- * @return The rectangle stencil element.
30
- */
31
- export declare function RectangleStencil({ cropRect, containerSize, imageSize, onCropChange, onResizeStart, onResizeEnd, aspectRatio, freeformCrop, isResizeDisabled, stencilTransition, cropBounds, onEscape, minCropSize, snapCropRect, keyboardResizeStep, }: RectangleStencilProps): import("react").JSX.Element | null;
32
- export {};
33
- //# sourceMappingURL=rectangle-stencil.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rectangle-stencil.d.ts","sourceRoot":"","sources":["../../../../../src/image-editor/react/components/stencils/rectangle-stencil.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,qBAAqB,CAAC;AAmExE;;GAEG;AACH,KAAK,qBAAqB,GAAG,YAAY,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,gBAAgB,CAAE,EACjC,QAAQ,EACR,aAAa,EACb,SAAS,EACT,YAAY,EACZ,aAAa,EACb,WAAW,EACX,WAAW,EACX,YAAoB,EACpB,gBAAwB,EACxB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,kBAAkB,GAClB,EAAE,qBAAqB,sCAqfvB"}
@@ -1,6 +0,0 @@
1
- import { type UseViewportStateReturn } from '../hooks/use-viewport-state';
2
- export declare function ViewportProvider({ children, }: {
3
- children: React.ReactNode;
4
- }): import("react").JSX.Element;
5
- export declare function useViewport(): UseViewportStateReturn;
6
- //# sourceMappingURL=viewport-provider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"viewport-provider.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/components/viewport-provider.tsx"],"names":[],"mappings":"AACA,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,6BAA6B,CAAC;AAMrC,wBAAgB,gBAAgB,CAAE,EACjC,QAAQ,GACR,EAAE;IACF,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B,+BAOA;AAED,wBAAgB,WAAW,IAAI,sBAAsB,CAQpD"}
@@ -1,44 +0,0 @@
1
- import type { CropperAction, CropperState, Flip, NormalizedPoint, NormalizedRect, TransformOperation } from '../../core/types';
2
- /**
3
- * The named cropper setters shared by every hook that drives the
4
- * cropper reducer — the pure `useCropperReducer` and any composite
5
- * store that delegates cropper actions (e.g. `useMediaEditorState`).
6
- *
7
- * `setImage` and `reset` are intentionally NOT included: each hook
8
- * has additional bookkeeping for them (dirty-baseline, history clear)
9
- * that doesn't fit a shared factory.
10
- */
11
- export interface CropperSetters {
12
- setPan: (pan: NormalizedPoint) => void;
13
- setZoom: (zoom: number) => void;
14
- setZoomAtPoint: (zoom: number, pan: NormalizedPoint) => void;
15
- setRotation: (rotation: number) => void;
16
- setFlip: (flip: Flip) => void;
17
- toggleFlip: (direction: 'horizontal' | 'vertical') => void;
18
- snapRotate90: (direction: 1 | -1) => void;
19
- setCropRect: (rect: NormalizedRect) => void;
20
- settleCrop: () => void;
21
- applyOperation: (op: TransformOperation) => void;
22
- }
23
- /**
24
- * Build the named cropper setters from a dispatch function and a
25
- * state getter. The two consuming hooks differ in how they dispatch:
26
- *
27
- * - `useCropperReducer` dispatches directly into its `useReducer`.
28
- * - `useMediaEditorState` wraps cropper actions in a composite
29
- * `CROPPER` envelope so the history machinery can record them.
30
- *
31
- * Both pass their own dispatch function and a getter that returns
32
- * the current `CropperState`. The factory shape keeps the two hooks
33
- * in lockstep — add a setter here once, both hooks get it.
34
- *
35
- * @param dispatchCropperAction Apply a `CropperAction` to the
36
- * underlying reducer.
37
- * @param getCropperState Return the current `CropperState`.
38
- * Used by setters that need to read
39
- * the latest state to compute their
40
- * payload (focal-point zoom, flip toggle).
41
- * @return The named cropper setters.
42
- */
43
- export declare function buildCropperSetters(dispatchCropperAction: (action: CropperAction) => void, getCropperState: () => CropperState): CropperSetters;
44
- //# sourceMappingURL=build-cropper-setters.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-cropper-setters.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/build-cropper-setters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,aAAa,EACb,YAAY,EACZ,IAAI,EACJ,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,MAAM,kBAAkB,CAAC;AAG1B;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,CAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IACzC,OAAO,EAAE,CAAE,IAAI,EAAE,MAAM,KAAM,IAAI,CAAC;IAClC,cAAc,EAAE,CAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,KAAM,IAAI,CAAC;IAC/D,WAAW,EAAE,CAAE,QAAQ,EAAE,MAAM,KAAM,IAAI,CAAC;IAC1C,OAAO,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,IAAI,CAAC;IAChC,UAAU,EAAE,CAAE,SAAS,EAAE,YAAY,GAAG,UAAU,KAAM,IAAI,CAAC;IAC7D,YAAY,EAAE,CAAE,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,KAAM,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAE,IAAI,EAAE,cAAc,KAAM,IAAI,CAAC;IAC9C,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,cAAc,EAAE,CAAE,EAAE,EAAE,kBAAkB,KAAM,IAAI,CAAC;CACnD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAClC,qBAAqB,EAAE,CAAE,MAAM,EAAE,aAAa,KAAM,IAAI,EACxD,eAAe,EAAE,MAAM,YAAY,GACjC,cAAc,CA8ChB"}
@@ -1,5 +0,0 @@
1
- export { useCropperReducer } from './use-cropper-reducer';
2
- export type { CropperController } from './use-cropper-reducer';
3
- export { buildCropperSetters } from './build-cropper-setters';
4
- export type { CropperSetters } from './build-cropper-setters';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/react/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,14 +0,0 @@
1
- import type { CropperState } from '../../core/types';
2
- /**
3
- * Debounce and dedupe ARIA-live announcements for screen readers as the
4
- * cropper state changes. Calls `speak()` from `@wordpress/a11y` to use the
5
- * centralized, persistent live region instead of a local one that may be
6
- * dynamically mounted.
7
- *
8
- * Debouncing avoids flooding announcements during drag/pointermove bursts;
9
- * deduping avoids re-announcing the same state.
10
- *
11
- * @param state The current cropper state to announce.
12
- */
13
- export declare function useAriaAnnouncer(state: CropperState): void;
14
- //# sourceMappingURL=use-aria-announcer.d.ts.map