@wordpress/media-editor 0.22.0 → 0.24.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 (391) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/build/components/media-editor/index.cjs +229 -126
  3. package/build/components/media-editor/index.cjs.map +1 -1
  4. package/build/components/media-editor/use-crop-options.cjs +4 -5
  5. package/build/components/media-editor/use-crop-options.cjs.map +1 -1
  6. package/build/components/media-editor/use-save-media-editor.cjs +41 -11
  7. package/build/components/media-editor/use-save-media-editor.cjs.map +1 -1
  8. package/build/components/media-editor-canvas/index.cjs +15 -18
  9. package/build/components/media-editor-canvas/index.cjs.map +1 -1
  10. package/build/components/media-editor-crop-panel/index.cjs +26 -8
  11. package/build/components/media-editor-crop-panel/index.cjs.map +1 -1
  12. package/build/components/media-editor-fine-rotation/index.cjs +13 -12
  13. package/build/components/media-editor-fine-rotation/index.cjs.map +1 -1
  14. package/build/components/media-editor-image-controls/index.cjs +4 -6
  15. package/build/components/media-editor-image-controls/index.cjs.map +1 -1
  16. package/build/components/media-editor-keyboard-shortcuts-modal/index.cjs +33 -33
  17. package/build/components/media-editor-keyboard-shortcuts-modal/index.cjs.map +1 -1
  18. package/build/components/media-editor-modal/index.cjs +10 -7
  19. package/build/components/media-editor-modal/index.cjs.map +1 -1
  20. package/build/components/media-editor-panel/error-boundary.cjs +68 -0
  21. package/build/components/media-editor-panel/error-boundary.cjs.map +1 -0
  22. package/build/components/media-editor-panel/index.cjs +158 -0
  23. package/build/components/media-editor-panel/index.cjs.map +1 -0
  24. package/build/components/media-form/index.cjs +7 -1
  25. package/build/components/media-form/index.cjs.map +1 -1
  26. package/build/components/media-preview/index.cjs +143 -37
  27. package/build/components/media-preview/index.cjs.map +1 -1
  28. package/build/components/rotation-ruler/index.cjs +9 -7
  29. package/build/components/rotation-ruler/index.cjs.map +1 -1
  30. package/build/components/rotation-ruler/use-ruler-drag.cjs.map +1 -1
  31. package/build/hooks/use-crop-gesture-handlers.cjs.map +1 -1
  32. package/build/index.cjs +10 -8
  33. package/build/private-apis.cjs.map +1 -1
  34. package/build/state/aspect-ratio-presets.cjs +12 -6
  35. package/build/state/aspect-ratio-presets.cjs.map +1 -1
  36. package/build/state/composite-reducer.cjs +41 -74
  37. package/build/state/composite-reducer.cjs.map +1 -1
  38. package/build/state/index.cjs +0 -39
  39. package/build/state/types.cjs +1 -2
  40. package/build/state/types.cjs.map +1 -1
  41. package/build/state/use-media-editor-state.cjs +70 -106
  42. package/build/state/use-media-editor-state.cjs.map +1 -1
  43. package/build/store/index.cjs +11 -9
  44. package/build/store/index.cjs.map +1 -1
  45. package/build/utils/get-media-type.cjs +8 -0
  46. package/build/utils/get-media-type.cjs.map +1 -1
  47. package/build/utils/index.cjs +6 -0
  48. package/build-module/components/media-editor/index.mjs +217 -117
  49. package/build-module/components/media-editor/index.mjs.map +1 -1
  50. package/build-module/components/media-editor/use-crop-options.mjs +4 -5
  51. package/build-module/components/media-editor/use-crop-options.mjs.map +1 -1
  52. package/build-module/components/media-editor/use-save-media-editor.mjs +32 -4
  53. package/build-module/components/media-editor/use-save-media-editor.mjs.map +1 -1
  54. package/build-module/components/media-editor-canvas/index.mjs +8 -13
  55. package/build-module/components/media-editor-canvas/index.mjs.map +1 -1
  56. package/build-module/components/media-editor-crop-panel/index.mjs +17 -1
  57. package/build-module/components/media-editor-crop-panel/index.mjs.map +1 -1
  58. package/build-module/components/media-editor-fine-rotation/index.mjs +4 -5
  59. package/build-module/components/media-editor-fine-rotation/index.mjs.map +1 -1
  60. package/build-module/components/media-editor-image-controls/index.mjs +5 -7
  61. package/build-module/components/media-editor-image-controls/index.mjs.map +1 -1
  62. package/build-module/components/media-editor-keyboard-shortcuts-modal/index.mjs +33 -33
  63. package/build-module/components/media-editor-keyboard-shortcuts-modal/index.mjs.map +1 -1
  64. package/build-module/components/media-editor-modal/index.mjs +1 -0
  65. package/build-module/components/media-editor-modal/index.mjs.map +1 -1
  66. package/build-module/components/media-editor-panel/error-boundary.mjs +63 -0
  67. package/build-module/components/media-editor-panel/error-boundary.mjs.map +1 -0
  68. package/build-module/components/media-editor-panel/index.mjs +123 -0
  69. package/build-module/components/media-editor-panel/index.mjs.map +1 -0
  70. package/build-module/components/media-form/index.mjs +7 -1
  71. package/build-module/components/media-form/index.mjs.map +1 -1
  72. package/build-module/components/media-preview/index.mjs +123 -41
  73. package/build-module/components/media-preview/index.mjs.map +1 -1
  74. package/build-module/state/aspect-ratio-presets.mjs +12 -7
  75. package/build-module/state/aspect-ratio-presets.mjs.map +1 -1
  76. package/build-module/state/composite-reducer.mjs +32 -67
  77. package/build-module/state/composite-reducer.mjs.map +1 -1
  78. package/build-module/state/index.mjs +2 -5
  79. package/build-module/state/types.mjs +1 -2
  80. package/build-module/state/types.mjs.map +1 -1
  81. package/build-module/state/use-media-editor-state.mjs +70 -105
  82. package/build-module/state/use-media-editor-state.mjs.map +1 -1
  83. package/build-module/utils/get-media-type.mjs +8 -1
  84. package/build-module/utils/get-media-type.mjs.map +1 -1
  85. package/build-module/utils/index.mjs +1 -1
  86. package/build-style/style-rtl.css +122 -87
  87. package/build-style/style.css +121 -87
  88. package/build-types/components/media-editor/index.d.ts +25 -3
  89. package/build-types/components/media-editor/index.d.ts.map +1 -1
  90. package/build-types/components/media-editor/use-crop-options.d.ts +2 -3
  91. package/build-types/components/media-editor/use-crop-options.d.ts.map +1 -1
  92. package/build-types/components/media-editor/use-save-media-editor.d.ts.map +1 -1
  93. package/build-types/components/media-editor-canvas/index.d.ts +3 -3
  94. package/build-types/components/media-editor-canvas/index.d.ts.map +1 -1
  95. package/build-types/components/media-editor-crop-panel/index.d.ts +1 -1
  96. package/build-types/components/media-editor-crop-panel/index.d.ts.map +1 -1
  97. package/build-types/components/media-editor-fine-rotation/index.d.ts.map +1 -1
  98. package/build-types/components/media-editor-image-controls/index.d.ts +1 -1
  99. package/build-types/components/media-editor-image-controls/index.d.ts.map +1 -1
  100. package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts.map +1 -1
  101. package/build-types/components/media-editor-modal/index.d.ts +1 -1
  102. package/build-types/components/media-editor-modal/index.d.ts.map +1 -1
  103. package/build-types/components/media-editor-panel/error-boundary.d.ts +23 -0
  104. package/build-types/components/media-editor-panel/error-boundary.d.ts.map +1 -0
  105. package/build-types/components/media-editor-panel/index.d.ts +46 -0
  106. package/build-types/components/media-editor-panel/index.d.ts.map +1 -0
  107. package/build-types/components/media-form/index.d.ts.map +1 -1
  108. package/build-types/components/media-preview/index.d.ts.map +1 -1
  109. package/build-types/state/aspect-ratio-presets.d.ts +20 -3
  110. package/build-types/state/aspect-ratio-presets.d.ts.map +1 -1
  111. package/build-types/state/composite-reducer.d.ts +17 -19
  112. package/build-types/state/composite-reducer.d.ts.map +1 -1
  113. package/build-types/state/index.d.ts +2 -5
  114. package/build-types/state/index.d.ts.map +1 -1
  115. package/build-types/state/types.d.ts +20 -64
  116. package/build-types/state/types.d.ts.map +1 -1
  117. package/build-types/state/use-media-editor-state.d.ts +40 -54
  118. package/build-types/state/use-media-editor-state.d.ts.map +1 -1
  119. package/build-types/utils/get-media-type.d.ts +3 -1
  120. package/build-types/utils/get-media-type.d.ts.map +1 -1
  121. package/build-types/utils/index.d.ts +1 -1
  122. package/build-types/utils/index.d.ts.map +1 -1
  123. package/package.json +27 -24
  124. package/src/components/media-editor/index.tsx +372 -142
  125. package/src/components/media-editor/style.scss +21 -1
  126. package/src/components/media-editor/use-crop-options.ts +7 -11
  127. package/src/components/media-editor/use-save-media-editor.ts +48 -6
  128. package/src/components/media-editor-canvas/index.tsx +15 -26
  129. package/src/components/media-editor-canvas/style.scss +6 -6
  130. package/src/components/media-editor-crop-panel/index.tsx +38 -2
  131. package/src/components/media-editor-crop-panel/style.scss +21 -0
  132. package/src/components/media-editor-fine-rotation/index.tsx +6 -6
  133. package/src/components/media-editor-image-controls/index.tsx +11 -9
  134. package/src/components/media-editor-keyboard-shortcuts-modal/index.tsx +56 -63
  135. package/src/components/media-editor-keyboard-shortcuts-modal/style.scss +1 -1
  136. package/src/components/media-editor-modal/index.tsx +4 -1
  137. package/src/components/media-editor-panel/error-boundary.tsx +88 -0
  138. package/src/components/media-editor-panel/index.tsx +211 -0
  139. package/src/components/media-form/index.tsx +7 -1
  140. package/src/components/media-preview/index.tsx +195 -37
  141. package/src/components/media-preview/style.scss +11 -32
  142. package/src/components/rotation-ruler/style.scss +3 -3
  143. package/src/state/README.md +34 -0
  144. package/src/state/aspect-ratio-presets.ts +22 -3
  145. package/src/state/composite-reducer.ts +42 -80
  146. package/src/state/index.ts +2 -18
  147. package/src/state/types.ts +18 -68
  148. package/src/state/use-media-editor-state.ts +162 -242
  149. package/src/style.scss +2 -1
  150. package/src/utils/get-media-type.ts +9 -1
  151. package/src/utils/index.ts +1 -1
  152. package/build/components/media-editor-modal/build-modifiers.cjs +0 -110
  153. package/build/components/media-editor-modal/build-modifiers.cjs.map +0 -1
  154. package/build/image-editor/core/camera.cjs +0 -277
  155. package/build/image-editor/core/camera.cjs.map +0 -1
  156. package/build/image-editor/core/constants.cjs +0 -133
  157. package/build/image-editor/core/constants.cjs.map +0 -1
  158. package/build/image-editor/core/containment.cjs +0 -289
  159. package/build/image-editor/core/containment.cjs.map +0 -1
  160. package/build/image-editor/core/crop-rect.cjs +0 -37
  161. package/build/image-editor/core/crop-rect.cjs.map +0 -1
  162. package/build/image-editor/core/export/canvas-renderer.cjs +0 -181
  163. package/build/image-editor/core/export/canvas-renderer.cjs.map +0 -1
  164. package/build/image-editor/core/index.cjs +0 -89
  165. package/build/image-editor/core/interaction-controller.cjs +0 -591
  166. package/build/image-editor/core/interaction-controller.cjs.map +0 -1
  167. package/build/image-editor/core/math/rotation.cjs +0 -32
  168. package/build/image-editor/core/math/rotation.cjs.map +0 -1
  169. package/build/image-editor/core/math/sanitize.cjs +0 -136
  170. package/build/image-editor/core/math/sanitize.cjs.map +0 -1
  171. package/build/image-editor/core/setter-helpers.cjs +0 -61
  172. package/build/image-editor/core/setter-helpers.cjs.map +0 -1
  173. package/build/image-editor/core/source-region.cjs +0 -236
  174. package/build/image-editor/core/source-region.cjs.map +0 -1
  175. package/build/image-editor/core/state.cjs +0 -296
  176. package/build/image-editor/core/state.cjs.map +0 -1
  177. package/build/image-editor/core/stencil-math.cjs +0 -203
  178. package/build/image-editor/core/stencil-math.cjs.map +0 -1
  179. package/build/image-editor/core/transform-style.cjs +0 -43
  180. package/build/image-editor/core/transform-style.cjs.map +0 -1
  181. package/build/image-editor/core/transforms/pipeline.cjs +0 -41
  182. package/build/image-editor/core/transforms/pipeline.cjs.map +0 -1
  183. package/build/image-editor/core/types.cjs +0 -5
  184. package/build/image-editor/core/viewport-state.cjs +0 -36
  185. package/build/image-editor/core/viewport-state.cjs.map +0 -1
  186. package/build/image-editor/index.cjs +0 -68
  187. package/build/image-editor/react/components/cropper-provider.cjs +0 -49
  188. package/build/image-editor/react/components/cropper-provider.cjs.map +0 -1
  189. package/build/image-editor/react/components/cropper.cjs +0 -595
  190. package/build/image-editor/react/components/cropper.cjs.map +0 -1
  191. package/build/image-editor/react/components/index.cjs +0 -25
  192. package/build/image-editor/react/components/overlays/dimensions-overlay.cjs +0 -147
  193. package/build/image-editor/react/components/overlays/dimensions-overlay.cjs.map +0 -1
  194. package/build/image-editor/react/components/overlays/dimming-overlay.cjs +0 -31
  195. package/build/image-editor/react/components/overlays/dimming-overlay.cjs.map +0 -1
  196. package/build/image-editor/react/components/overlays/grid-overlay.cjs +0 -61
  197. package/build/image-editor/react/components/overlays/grid-overlay.cjs.map +0 -1
  198. package/build/image-editor/react/components/stencils/rectangle-stencil.cjs +0 -367
  199. package/build/image-editor/react/components/stencils/rectangle-stencil.cjs.map +0 -1
  200. package/build/image-editor/react/components/viewport-provider.cjs +0 -26
  201. package/build/image-editor/react/components/viewport-provider.cjs.map +0 -1
  202. package/build/image-editor/react/hooks/build-cropper-setters.cjs +0 -80
  203. package/build/image-editor/react/hooks/build-cropper-setters.cjs.map +0 -1
  204. package/build/image-editor/react/hooks/index.cjs +0 -19
  205. package/build/image-editor/react/hooks/use-aria-announcer.cjs +0 -104
  206. package/build/image-editor/react/hooks/use-aria-announcer.cjs.map +0 -1
  207. package/build/image-editor/react/hooks/use-cropper-controller.cjs +0 -80
  208. package/build/image-editor/react/hooks/use-cropper-controller.cjs.map +0 -1
  209. package/build/image-editor/react/hooks/use-interaction.cjs +0 -187
  210. package/build/image-editor/react/hooks/use-interaction.cjs.map +0 -1
  211. package/build/image-editor/react/hooks/use-transform-style.cjs +0 -24
  212. package/build/image-editor/react/hooks/use-transform-style.cjs.map +0 -1
  213. package/build/image-editor/react/hooks/use-viewport-state.cjs +0 -40
  214. package/build/image-editor/react/hooks/use-viewport-state.cjs.map +0 -1
  215. package/build/image-editor/react/visually-hidden-style.cjs +0 -24
  216. package/build/image-editor/react/visually-hidden-style.cjs.map +0 -1
  217. package/build-module/components/media-editor-modal/build-modifiers.mjs +0 -105
  218. package/build-module/components/media-editor-modal/build-modifiers.mjs.map +0 -1
  219. package/build-module/image-editor/core/camera.mjs +0 -265
  220. package/build-module/image-editor/core/camera.mjs.map +0 -1
  221. package/build-module/image-editor/core/constants.mjs +0 -115
  222. package/build-module/image-editor/core/constants.mjs.map +0 -1
  223. package/build-module/image-editor/core/containment.mjs +0 -281
  224. package/build-module/image-editor/core/containment.mjs.map +0 -1
  225. package/build-module/image-editor/core/crop-rect.mjs +0 -32
  226. package/build-module/image-editor/core/crop-rect.mjs.map +0 -1
  227. package/build-module/image-editor/core/export/canvas-renderer.mjs +0 -170
  228. package/build-module/image-editor/core/export/canvas-renderer.mjs.map +0 -1
  229. package/build-module/image-editor/core/index.mjs +0 -7
  230. package/build-module/image-editor/core/interaction-controller.mjs +0 -586
  231. package/build-module/image-editor/core/interaction-controller.mjs.map +0 -1
  232. package/build-module/image-editor/core/math/rotation.mjs +0 -26
  233. package/build-module/image-editor/core/math/rotation.mjs.map +0 -1
  234. package/build-module/image-editor/core/math/sanitize.mjs +0 -127
  235. package/build-module/image-editor/core/math/sanitize.mjs.map +0 -1
  236. package/build-module/image-editor/core/setter-helpers.mjs +0 -56
  237. package/build-module/image-editor/core/setter-helpers.mjs.map +0 -1
  238. package/build-module/image-editor/core/source-region.mjs +0 -228
  239. package/build-module/image-editor/core/source-region.mjs.map +0 -1
  240. package/build-module/image-editor/core/state.mjs +0 -288
  241. package/build-module/image-editor/core/state.mjs.map +0 -1
  242. package/build-module/image-editor/core/stencil-math.mjs +0 -194
  243. package/build-module/image-editor/core/stencil-math.mjs.map +0 -1
  244. package/build-module/image-editor/core/transform-style.mjs +0 -38
  245. package/build-module/image-editor/core/transform-style.mjs.map +0 -1
  246. package/build-module/image-editor/core/transforms/pipeline.mjs +0 -35
  247. package/build-module/image-editor/core/transforms/pipeline.mjs.map +0 -1
  248. package/build-module/image-editor/core/types.mjs +0 -0
  249. package/build-module/image-editor/core/viewport-state.mjs +0 -30
  250. package/build-module/image-editor/core/viewport-state.mjs.map +0 -1
  251. package/build-module/image-editor/index.mjs +0 -4
  252. package/build-module/image-editor/react/components/cropper-provider.mjs +0 -43
  253. package/build-module/image-editor/react/components/cropper-provider.mjs.map +0 -1
  254. package/build-module/image-editor/react/components/cropper.mjs +0 -568
  255. package/build-module/image-editor/react/components/cropper.mjs.map +0 -1
  256. package/build-module/image-editor/react/components/index.mjs +0 -3
  257. package/build-module/image-editor/react/components/overlays/dimensions-overlay.mjs +0 -142
  258. package/build-module/image-editor/react/components/overlays/dimensions-overlay.mjs.map +0 -1
  259. package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs +0 -26
  260. package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs.map +0 -1
  261. package/build-module/image-editor/react/components/overlays/grid-overlay.mjs +0 -56
  262. package/build-module/image-editor/react/components/overlays/grid-overlay.mjs.map +0 -1
  263. package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs +0 -362
  264. package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs.map +0 -1
  265. package/build-module/image-editor/react/components/viewport-provider.mjs +0 -20
  266. package/build-module/image-editor/react/components/viewport-provider.mjs.map +0 -1
  267. package/build-module/image-editor/react/hooks/build-cropper-setters.mjs +0 -75
  268. package/build-module/image-editor/react/hooks/build-cropper-setters.mjs.map +0 -1
  269. package/build-module/image-editor/react/hooks/index.mjs +0 -3
  270. package/build-module/image-editor/react/hooks/use-aria-announcer.mjs +0 -99
  271. package/build-module/image-editor/react/hooks/use-aria-announcer.mjs.map +0 -1
  272. package/build-module/image-editor/react/hooks/use-cropper-controller.mjs +0 -75
  273. package/build-module/image-editor/react/hooks/use-cropper-controller.mjs.map +0 -1
  274. package/build-module/image-editor/react/hooks/use-interaction.mjs +0 -182
  275. package/build-module/image-editor/react/hooks/use-interaction.mjs.map +0 -1
  276. package/build-module/image-editor/react/hooks/use-transform-style.mjs +0 -19
  277. package/build-module/image-editor/react/hooks/use-transform-style.mjs.map +0 -1
  278. package/build-module/image-editor/react/hooks/use-viewport-state.mjs +0 -35
  279. package/build-module/image-editor/react/hooks/use-viewport-state.mjs.map +0 -1
  280. package/build-module/image-editor/react/visually-hidden-style.mjs +0 -19
  281. package/build-module/image-editor/react/visually-hidden-style.mjs.map +0 -1
  282. package/build-types/components/media-editor-modal/build-modifiers.d.ts +0 -81
  283. package/build-types/components/media-editor-modal/build-modifiers.d.ts.map +0 -1
  284. package/build-types/image-editor/core/camera.d.ts +0 -128
  285. package/build-types/image-editor/core/camera.d.ts.map +0 -1
  286. package/build-types/image-editor/core/constants.d.ts +0 -98
  287. package/build-types/image-editor/core/constants.d.ts.map +0 -1
  288. package/build-types/image-editor/core/containment.d.ts +0 -72
  289. package/build-types/image-editor/core/containment.d.ts.map +0 -1
  290. package/build-types/image-editor/core/crop-rect.d.ts +0 -16
  291. package/build-types/image-editor/core/crop-rect.d.ts.map +0 -1
  292. package/build-types/image-editor/core/export/canvas-renderer.d.ts +0 -103
  293. package/build-types/image-editor/core/export/canvas-renderer.d.ts.map +0 -1
  294. package/build-types/image-editor/core/index.d.ts +0 -10
  295. package/build-types/image-editor/core/index.d.ts.map +0 -1
  296. package/build-types/image-editor/core/interaction-controller.d.ts +0 -191
  297. package/build-types/image-editor/core/interaction-controller.d.ts.map +0 -1
  298. package/build-types/image-editor/core/math/rotation.d.ts +0 -18
  299. package/build-types/image-editor/core/math/rotation.d.ts.map +0 -1
  300. package/build-types/image-editor/core/math/sanitize.d.ts +0 -67
  301. package/build-types/image-editor/core/math/sanitize.d.ts.map +0 -1
  302. package/build-types/image-editor/core/setter-helpers.d.ts +0 -21
  303. package/build-types/image-editor/core/setter-helpers.d.ts.map +0 -1
  304. package/build-types/image-editor/core/source-region.d.ts +0 -94
  305. package/build-types/image-editor/core/source-region.d.ts.map +0 -1
  306. package/build-types/image-editor/core/state.d.ts +0 -51
  307. package/build-types/image-editor/core/state.d.ts.map +0 -1
  308. package/build-types/image-editor/core/stencil-math.d.ts +0 -102
  309. package/build-types/image-editor/core/stencil-math.d.ts.map +0 -1
  310. package/build-types/image-editor/core/transform-style.d.ts +0 -20
  311. package/build-types/image-editor/core/transform-style.d.ts.map +0 -1
  312. package/build-types/image-editor/core/transforms/pipeline.d.ts +0 -24
  313. package/build-types/image-editor/core/transforms/pipeline.d.ts.map +0 -1
  314. package/build-types/image-editor/core/types.d.ts +0 -269
  315. package/build-types/image-editor/core/types.d.ts.map +0 -1
  316. package/build-types/image-editor/core/viewport-state.d.ts +0 -4
  317. package/build-types/image-editor/core/viewport-state.d.ts.map +0 -1
  318. package/build-types/image-editor/index.d.ts +0 -17
  319. package/build-types/image-editor/index.d.ts.map +0 -1
  320. package/build-types/image-editor/react/components/cropper-provider.d.ts +0 -38
  321. package/build-types/image-editor/react/components/cropper-provider.d.ts.map +0 -1
  322. package/build-types/image-editor/react/components/cropper.d.ts +0 -54
  323. package/build-types/image-editor/react/components/cropper.d.ts.map +0 -1
  324. package/build-types/image-editor/react/components/index.d.ts +0 -4
  325. package/build-types/image-editor/react/components/index.d.ts.map +0 -1
  326. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts +0 -33
  327. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts.map +0 -1
  328. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts +0 -17
  329. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts.map +0 -1
  330. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts +0 -27
  331. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts.map +0 -1
  332. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts +0 -33
  333. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts.map +0 -1
  334. package/build-types/image-editor/react/components/viewport-provider.d.ts +0 -6
  335. package/build-types/image-editor/react/components/viewport-provider.d.ts.map +0 -1
  336. package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts +0 -44
  337. package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts.map +0 -1
  338. package/build-types/image-editor/react/hooks/index.d.ts +0 -5
  339. package/build-types/image-editor/react/hooks/index.d.ts.map +0 -1
  340. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts +0 -14
  341. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts.map +0 -1
  342. package/build-types/image-editor/react/hooks/use-cropper-controller.d.ts +0 -55
  343. package/build-types/image-editor/react/hooks/use-cropper-controller.d.ts.map +0 -1
  344. package/build-types/image-editor/react/hooks/use-interaction.d.ts +0 -65
  345. package/build-types/image-editor/react/hooks/use-interaction.d.ts.map +0 -1
  346. package/build-types/image-editor/react/hooks/use-transform-style.d.ts +0 -13
  347. package/build-types/image-editor/react/hooks/use-transform-style.d.ts.map +0 -1
  348. package/build-types/image-editor/react/hooks/use-viewport-state.d.ts +0 -16
  349. package/build-types/image-editor/react/hooks/use-viewport-state.d.ts.map +0 -1
  350. package/build-types/image-editor/react/visually-hidden-style.d.ts +0 -6
  351. package/build-types/image-editor/react/visually-hidden-style.d.ts.map +0 -1
  352. package/src/components/media-editor-modal/build-modifiers.ts +0 -167
  353. package/src/image-editor/README.md +0 -61
  354. package/src/image-editor/core/camera.ts +0 -429
  355. package/src/image-editor/core/constants.ts +0 -137
  356. package/src/image-editor/core/containment.ts +0 -469
  357. package/src/image-editor/core/crop-rect.ts +0 -42
  358. package/src/image-editor/core/export/canvas-renderer.ts +0 -250
  359. package/src/image-editor/core/index.ts +0 -43
  360. package/src/image-editor/core/interaction-controller.ts +0 -976
  361. package/src/image-editor/core/math/rotation.ts +0 -26
  362. package/src/image-editor/core/math/sanitize.ts +0 -155
  363. package/src/image-editor/core/setter-helpers.ts +0 -63
  364. package/src/image-editor/core/source-region.ts +0 -367
  365. package/src/image-editor/core/state.ts +0 -484
  366. package/src/image-editor/core/stencil-math.ts +0 -379
  367. package/src/image-editor/core/transform-style.ts +0 -56
  368. package/src/image-editor/core/transforms/pipeline.ts +0 -40
  369. package/src/image-editor/core/types.ts +0 -230
  370. package/src/image-editor/core/viewport-state.ts +0 -30
  371. package/src/image-editor/docs/architecture.md +0 -63
  372. package/src/image-editor/docs/recipes.md +0 -184
  373. package/src/image-editor/index.ts +0 -43
  374. package/src/image-editor/react/components/cropper-provider.tsx +0 -70
  375. package/src/image-editor/react/components/cropper.scss +0 -259
  376. package/src/image-editor/react/components/cropper.tsx +0 -1108
  377. package/src/image-editor/react/components/index.ts +0 -3
  378. package/src/image-editor/react/components/overlays/dimensions-overlay.tsx +0 -262
  379. package/src/image-editor/react/components/overlays/dimming-overlay.tsx +0 -55
  380. package/src/image-editor/react/components/overlays/grid-overlay.tsx +0 -77
  381. package/src/image-editor/react/components/stencils/rectangle-stencil.tsx +0 -623
  382. package/src/image-editor/react/components/viewport-provider.tsx +0 -32
  383. package/src/image-editor/react/hooks/build-cropper-setters.ts +0 -102
  384. package/src/image-editor/react/hooks/index.ts +0 -4
  385. package/src/image-editor/react/hooks/use-aria-announcer.ts +0 -193
  386. package/src/image-editor/react/hooks/use-cropper-controller.ts +0 -197
  387. package/src/image-editor/react/hooks/use-interaction.ts +0 -294
  388. package/src/image-editor/react/hooks/use-transform-style.ts +0 -23
  389. package/src/image-editor/react/hooks/use-viewport-state.ts +0 -41
  390. package/src/image-editor/react/visually-hidden-style.ts +0 -15
  391. package/src/image-editor/style.scss +0 -1
@@ -1,98 +0,0 @@
1
- import type { CropperState } from './types';
2
- /**
3
- * Default/resting zoom. A full, unrotated crop needs at least 1x to cover the
4
- * crop area, but smaller/fine-rotated crops can be valid below 1x — the true
5
- * floor for those comes from `getMinZoom`.
6
- */
7
- export declare const MIN_ZOOM = 1;
8
- /**
9
- * Safety floor for coverage-aware zoom. Degenerate crops can have a geometric
10
- * coverage minimum of 0, but camera and inverse-matrix math need a stable,
11
- * positive scale.
12
- */
13
- export declare const ABSOLUTE_MIN_ZOOM = 0.1;
14
- export declare const MAX_ZOOM = 10;
15
- /**
16
- * Minimum crop rect dimension in source-image pixels, enforced per axis
17
- * during resize. Prevents accidental sub-pixel crops while staying small
18
- * enough to allow tight crops (favicons, icons). Adjust here to tune the
19
- * floor globally.
20
- */
21
- export declare const MIN_CROP_PIXELS = 16;
22
- /**
23
- * Minimum on-screen crop rect dimension in CSS pixels. The source-pixel
24
- * floor (`MIN_CROP_PIXELS`) keeps crops from going sub-pixel, but on a large
25
- * image fit into a small canvas it can render only a few CSS pixels wide —
26
- * too small to grab the resize handles. This floor keeps the crop operable
27
- * regardless of display scale; it binds when zoomed out and yields to the
28
- * source-pixel floor once the image is shown large enough. Sized to one
29
- * handle touch target (`$handle-touch-target-size` in `cropper.scss`).
30
- */
31
- export declare const MIN_CROP_SCREEN_PX = 44;
32
- /**
33
- * Fraction of the constraining canvas axis the settled crop should occupy on
34
- * screen. When a crop is shown smaller than this (e.g. a square crop in a tall
35
- * image, capped by the contain-fit footprint's narrow axis), the view magnifies
36
- * to fill the canvas. `1` = always fill the canvas; lower = rescue only the
37
- * under-filled cases. See `getViewScale`.
38
- */
39
- export declare const SETTLE_TARGET_CANVAS_FILL = 0.8;
40
- /**
41
- * Upper bound on the presentational view magnification (`getViewScale`).
42
- * Prevents a near-degenerate crop from magnifying the scene without limit.
43
- */
44
- export declare const MAX_VIEW_SCALE = 8;
45
- /**
46
- * CSS pixels per source pixel required before resize handles snap the selected
47
- * source region to whole-pixel edges. Below 1:1, a source pixel is sub-pixel on
48
- * screen, so snapping would feel notchy without a visible pixel boundary.
49
- */
50
- export declare const PIXEL_SNAP_DISPLAY_SCALE = 1;
51
- /**
52
- * Wheel zoom sensitivity. A deltaY of 100 changes zoom by 0.25.
53
- * This could be made configurable as a prop to the Cropper component.
54
- */
55
- export declare const DEFAULT_WHEEL_ZOOM_SPEED = 0.0025;
56
- /** Fine step for keyboard-driven cropper movement, in normalized coordinates. */
57
- export declare const DEFAULT_KEYBOARD_STEP = 0.01;
58
- /** Coarse keyboard movement multiplier when Shift is held. */
59
- export declare const KEYBOARD_SHIFT_STEP_MULTIPLIER = 10;
60
- /**
61
- * Maximum free-rotation offset in degrees from the nearest 90° step.
62
- * The rotation slider allows ±45° around the current cardinal angle.
63
- */
64
- export declare const MAX_ROTATION_OFFSET = 45;
65
- export declare const DEFAULT_STATE: CropperState;
66
- /**
67
- * An aspect ratio preset with a human-readable label.
68
- */
69
- export interface AspectRatioPreset {
70
- /** Display label (e.g., "Square (1:1)"). */
71
- label: string;
72
- /** The aspect ratio value (width / height). 0 = free / original. */
73
- value: number;
74
- }
75
- /**
76
- * Default aspect ratio presets. Consumers can use these as-is, override
77
- * with their own list, or extend with additional presets.
78
- *
79
- * @example
80
- * // Use defaults:
81
- * <CropControls presets={ DEFAULT_ASPECT_RATIOS } />
82
- *
83
- * // Custom presets:
84
- * const socialPresets = [
85
- * { label: 'Instagram Post', value: 1 },
86
- * { label: 'Instagram Story', value: 9 / 16 },
87
- * { label: 'YouTube Thumbnail', value: 16 / 9 },
88
- * ];
89
- *
90
- * // Extend defaults:
91
- * const extended = [ ...DEFAULT_ASPECT_RATIOS, { label: 'Cinema (21:9)', value: 21 / 9 } ];
92
- */
93
- /**
94
- * Sentinel value for "Original" aspect ratio — resolved at runtime
95
- * to the image's natural width / height.
96
- */
97
- export declare const ORIGINAL_ASPECT_RATIO = -1;
98
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAwB,YAAY,EAAE,MAAM,SAAS,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,QAAQ,IAAI,CAAC;AAC1B;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,eAAO,MAAM,QAAQ,KAAK,CAAC;AAE3B;;;;;GAKG;AACH,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;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"}
@@ -1,72 +0,0 @@
1
- import type { CropperState, NormalizedRect, Size } from './types';
2
- /**
3
- * Resolves the effective minimum zoom for the current state — the coverage-
4
- * aware floor when an image is loaded, falling back to `MIN_ZOOM` otherwise.
5
- * Used by both the cropper's interaction layer and the zoom slider so the
6
- * floor stays consistent across surfaces.
7
- *
8
- * @param state The current cropper state.
9
- * @return The minimum zoom factor.
10
- */
11
- export declare function getMinZoom(state: CropperState): number;
12
- /**
13
- * Compute the crop handle bounds in normalized visual space — the
14
- * axis-aligned bounding box (AABB) of the actual image footprint at the
15
- * current pan/zoom/rotation.
16
- *
17
- * Returns the full image AABB without intersecting with the container
18
- * viewport. The viewport pan mechanism in the Cropper component allows
19
- * the canvas to scroll so handles can reach the image edge even when it
20
- * lies outside the visible canvas area.
21
- *
22
- * Unlike a static centerline-based calculation, this accounts for the
23
- * current pan position — if the user pans right, the left bound tightens
24
- * because the image's left edge has moved right.
25
- *
26
- * @param state The current cropper state (crop, zoom, rotation, flip).
27
- * @param elementSize The fitted (unrotated) image element dimensions in pixels.
28
- * @param visualSize The visual (rotated) image bounding box in pixels.
29
- * @return The min/max x and y that a crop rect edge can reach in normalized space.
30
- */
31
- export declare function getImageCropBounds(state: CropperState, elementSize: Size, visualSize: Size): {
32
- minX: number;
33
- minY: number;
34
- maxX: number;
35
- maxY: number;
36
- };
37
- /**
38
- * Restricts a crop rectangle so that the rotated, zoomed image can fully cover it.
39
- * If the crop rect is too large for the current zoom and rotation, it is scaled
40
- * down proportionally and re-centered.
41
- *
42
- * Works in pixel-proportional space where the unrotated image is a×1.
43
- *
44
- * @param cropRect The crop rectangle in normalized coordinates.
45
- * @param zoom The current zoom factor.
46
- * @param rotation The rotation angle in degrees.
47
- * @param imageAspectRatio The image width / height ratio.
48
- * @return The restricted crop rectangle.
49
- */
50
- export declare function restrictCropRect(cropRect: NormalizedRect, zoom: number, rotation: number, imageAspectRatio: number): NormalizedRect;
51
- /**
52
- * Clamps pan and adjusts zoom so that the zoomed, rotated image fully covers
53
- * the crop rectangle.
54
- *
55
- * Uses the camera matrix to project: builds a camera from the candidate state,
56
- * maps the stencil corners (axis-aligned in the visual bounding box) to world
57
- * space via the inverse camera, and checks that all world points lie within
58
- * [0,1]×[0,1]. If any point is outside, computes the minimal pan correction.
59
- *
60
- * @param state The current cropper state.
61
- * @param imageSize The natural size of the image in pixels.
62
- * @param cropRect The crop rectangle in normalized coordinates.
63
- * @return The restricted crop pan and zoom values.
64
- */
65
- export declare function restrictPanZoom(state: CropperState, imageSize: Size, cropRect: NormalizedRect): {
66
- pan: {
67
- x: number;
68
- y: number;
69
- };
70
- zoom: number;
71
- };
72
- //# sourceMappingURL=containment.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"containment.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/containment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAuFlE;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAE,KAAK,EAAE,YAAY,GAAI,MAAM,CAqBxD;AAED;;;;;;;;;;;;;;;;;;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,CA0D5D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC/B,QAAQ,EAAE,cAAc,EACxB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,GACtB,cAAc,CAqDhB;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,CAkKjD"}
@@ -1,16 +0,0 @@
1
- import type { NormalizedRect, Size } from './types';
2
- /**
3
- * Largest rect of the given pixel aspect ratio that fits inside the
4
- * visual bounds, centered in [0,1] × [0,1] normalized space. Returns
5
- * a full-frame rect (1×1) if `aspectRatio` is unset or non-positive.
6
- *
7
- * The returned rect is the same in either freeform or fixed-crop
8
- * mode — it's the canonical "centered crop for this ratio at this
9
- * canvas size".
10
- *
11
- * @param aspectRatio Desired pixel width/height ratio. `undefined`
12
- * (or 0/negative) means no lock — returns full frame.
13
- * @param visualSize Rendered image dimensions in pixels.
14
- */
15
- export declare function computeInscribedRect(aspectRatio: number | undefined, visualSize: Size): NormalizedRect;
16
- //# sourceMappingURL=crop-rect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"crop-rect.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/crop-rect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CACnC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,UAAU,EAAE,IAAI,GACd,cAAc,CAuBhB"}
@@ -1,103 +0,0 @@
1
- import type { CropperState } from '../types';
2
- /**
3
- * Load an image from a URL with CORS support.
4
- *
5
- * @param src - The image URL to load.
6
- * @return A promise that resolves to the loaded HTMLImageElement.
7
- */
8
- export declare function loadImage(src: string): Promise<HTMLImageElement>;
9
- /**
10
- * Apply rectangular crop, rotation, and flip transforms to produce a canvas.
11
- *
12
- * Uses createExportCamera to compose the full transform matrix, then applies
13
- * it in a single ctx.setTransform call before drawing the image.
14
- *
15
- * @param image - The source image element.
16
- * @param state - The full cropper state containing crop, rotation, and flip settings.
17
- * @return A canvas element containing the transformed and cropped image.
18
- */
19
- export declare function renderToCanvas(image: HTMLImageElement, state: CropperState): HTMLCanvasElement;
20
- /**
21
- * Convert a canvas to a Blob with configurable MIME type and quality.
22
- *
23
- * @param canvas - The canvas to export.
24
- * @param mimeType - The output MIME type. Defaults to 'image/png'.
25
- * @param quality - The quality parameter for lossy formats (0-1). Defaults to DEFAULT_QUALITY.
26
- * @return A promise that resolves to the canvas content as a Blob.
27
- */
28
- export declare function canvasToBlob(canvas: HTMLCanvasElement, mimeType?: string, quality?: number): Promise<Blob>;
29
- /**
30
- * Convert a canvas to a data URL string.
31
- *
32
- * @param canvas - The canvas to export.
33
- * @param mimeType - The output MIME type. Defaults to 'image/png'.
34
- * @param quality - The quality parameter for lossy formats (0-1). Defaults to DEFAULT_QUALITY.
35
- * @return The canvas content as a data URL string.
36
- */
37
- export declare function canvasToDataURL(canvas: HTMLCanvasElement, mimeType?: string, quality?: number): string;
38
- /**
39
- * Load an image, render with transforms, and export as a Blob.
40
- *
41
- * Throws on failure so callers can distinguish error cases:
42
- * - Image load failures (network errors, 404s) throw the native
43
- * load error from the Image element.
44
- * - Cross-origin failures manifest as tainted-canvas errors from
45
- * `canvas.toBlob()` — the browser rejects reading pixel data
46
- * from a canvas that drew an image without valid CORS headers.
47
- * Ensure the source server sets `Access-Control-Allow-Origin`.
48
- * - Canvas context creation failures throw a descriptive Error.
49
- *
50
- * Only works in browser environments (needs DOM / HTMLCanvasElement).
51
- *
52
- * @param src - The image URL to load.
53
- * @param state - The cropper state with all transform settings.
54
- * @param mimeType - The output MIME type. Defaults to 'image/png'.
55
- * @param quality - The quality parameter for lossy formats (0-1). Defaults to DEFAULT_QUALITY.
56
- * @return A promise that resolves to the exported Blob.
57
- * @throws If the image fails to load, canvas creation fails, or
58
- * the resulting canvas is tainted by CORS restrictions.
59
- */
60
- export declare function exportCroppedImage(src: string, state: CropperState, mimeType?: string, quality?: number): Promise<Blob>;
61
- /**
62
- * Apply the cropper's transform (crop, rotation, flip, zoom) to an existing
63
- * canvas or image source. This is the bridge for multi-step editing pipelines
64
- * where an upstream tool (e.g., brightness/color adjustment) has already
65
- * processed the image and you want to apply the crop on top.
66
- *
67
- * Accepts any CanvasImageSource: HTMLImageElement, HTMLCanvasElement,
68
- * OffscreenCanvas, ImageBitmap, HTMLVideoElement, etc.
69
- *
70
- * @param source - The image source to crop/transform.
71
- * @param sourceSize - The dimensions of the source (natural width/height).
72
- * @param sourceSize.width - The width of the source in pixels.
73
- * @param sourceSize.height - The height of the source in pixels.
74
- * @param state - The cropper state with all transform settings.
75
- * @param outputSize - Optional output size. Defaults to the crop region's natural pixel size.
76
- * @param outputSize.width - The width of the output in pixels.
77
- * @param outputSize.height - The height of the output in pixels.
78
- * @return A canvas with the transforms applied.
79
- */
80
- export declare function applyToCanvas(source: CanvasImageSource, sourceSize: {
81
- width: number;
82
- height: number;
83
- }, state: CropperState, outputSize?: {
84
- width: number;
85
- height: number;
86
- }): HTMLCanvasElement;
87
- /**
88
- * Download the cropped image as a file.
89
- *
90
- * Loads the source image, applies all transforms, and triggers a
91
- * browser download via exportCroppedImage() + object URL + anchor click.
92
- *
93
- * Throws on export failure (see `exportCroppedImage`).
94
- *
95
- * @param src - The image URL to load.
96
- * @param state - The cropper state with all transform settings.
97
- * @param filename - The download filename. Defaults to 'cropped-image'.
98
- * @param mimeType - The output MIME type. Defaults to 'image/png'.
99
- * @param quality - The quality parameter for lossy formats (0-1). Defaults to DEFAULT_QUALITY.
100
- * @return A promise that resolves when the download is triggered.
101
- */
102
- export declare function downloadCroppedImage(src: string, state: CropperState, filename?: string, mimeType?: string, quality?: number): Promise<void>;
103
- //# sourceMappingURL=canvas-renderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"canvas-renderer.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/core/export/canvas-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAM7C;;;;;GAKG;AACH,wBAAgB,SAAS,CAAE,GAAG,EAAE,MAAM,GAAI,OAAO,CAAE,gBAAgB,CAAE,CAQpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,YAAY,GACjB,iBAAiB,CAqCnB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC3B,MAAM,EAAE,iBAAiB,EACzB,QAAQ,GAAE,MAAoB,EAC9B,OAAO,GAAE,MAAwB,GAC/B,OAAO,CAAE,IAAI,CAAE,CAcjB;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,iBAAiB,EACzB,QAAQ,GAAE,MAAoB,EAC9B,OAAO,GAAE,MAAwB,GAC/B,MAAM,CAER;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,kBAAkB,CACvC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,YAAY,EACnB,QAAQ,GAAE,MAAoB,EAC9B,OAAO,GAAE,MAAwB,GAC/B,OAAO,CAAE,IAAI,CAAE,CAIjB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAC5B,MAAM,EAAE,iBAAiB,EACzB,UAAU,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAC7C,KAAK,EAAE,YAAY,EACnB,UAAU,CAAC,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC5C,iBAAiB,CA0CnB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,oBAAoB,CACzC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,YAAY,EACnB,QAAQ,GAAE,MAAwB,EAClC,QAAQ,GAAE,MAAoB,EAC9B,OAAO,GAAE,MAAwB,GAC/B,OAAO,CAAE,IAAI,CAAE,CASjB"}
@@ -1,10 +0,0 @@
1
- export type { CropperState, CropperAction, TransformOperation, NormalizedPoint, NormalizedRect, Size, Flip, StencilProps, HandlePosition, } from './types';
2
- export { DEFAULT_STATE, ORIGINAL_ASPECT_RATIO } from './constants';
3
- export type { AspectRatioPreset } from './constants';
4
- export { cropperReducer, enforceContainment, areCropperStatesEqual, isStateDirty, } from './state';
5
- export { getSourceRegion, getSourceRegionPercent } from './source-region';
6
- export type { SourceRegion, SourceRegionPercent } from './source-region';
7
- export { computeInscribedRect } from './crop-rect';
8
- export { applyOperationToState, stateFromPipeline, } from './transforms/pipeline';
9
- export { exportCroppedImage, applyToCanvas } from './export/canvas-renderer';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/index.ts"],"names":[],"mappings":"AACA,YAAY,EACX,YAAY,EACZ,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,cAAc,GACd,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACnE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAMrD,OAAO,EACN,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,YAAY,GACZ,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EACN,qBAAqB,EACrB,iBAAiB,GACjB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC"}
@@ -1,191 +0,0 @@
1
- import type { CropperState, NormalizedPoint, Size } from './types';
2
- /**
3
- * Status reported by the interaction controller when drag/zoom state changes.
4
- */
5
- export interface InteractionStatus {
6
- /** Whether a drag (pan) interaction is in progress. */
7
- isDragging: boolean;
8
- /** Whether a double-tap zoom animation is in progress. */
9
- isZooming: boolean;
10
- }
11
- /**
12
- * State updates the interaction controller can request from its host UI.
13
- */
14
- export interface CropperInteractionActions {
15
- /** Set the image pan offset in normalized coordinates. */
16
- setPan: (pan: NormalizedPoint) => void;
17
- /**
18
- * Set the zoom level. Cursorless surfaces (slider, keyboard `+`/`-`)
19
- * rely on this anchoring at the crop center; pointer-driven zoom
20
- * paths use `setZoomAtPoint` with an explicit focal point instead.
21
- */
22
- setZoom: (zoom: number) => void;
23
- /** Set zoom and pan together for focal-point zoom. */
24
- setZoomAtPoint: (zoom: number, pan: NormalizedPoint) => void;
25
- /** Snap rotate by 90 degrees. */
26
- snapRotate90: (direction: 1 | -1) => void;
27
- /** Toggle flip on the given axis. */
28
- toggleFlip?: (direction: 'horizontal' | 'vertical') => void;
29
- }
30
- /**
31
- * Options for creating an InteractionController.
32
- *
33
- * Scalar options (minZoom, maxZoom, etc.) are read lazily on each
34
- * interaction, so changes to the options object take effect immediately
35
- * without recreating the controller.
36
- */
37
- export interface InteractionControllerOptions {
38
- /** Returns the current cropper state. Called on every interaction. */
39
- getState: () => CropperState;
40
- /** State updates the interaction controller can request from its host UI. */
41
- actions: CropperInteractionActions;
42
- /** Returns the container dimensions in pixels. */
43
- getContainerSize: () => Size;
44
- /** Returns the rendered image dimensions in pixels, if available. */
45
- getImageSize: () => Size | undefined;
46
- /** Minimum zoom level. Defaults to MIN_ZOOM. Read lazily. */
47
- minZoom?: number;
48
- /** Maximum zoom level. Defaults to MAX_ZOOM. Read lazily. */
49
- maxZoom?: number;
50
- /** Zoom speed multiplier for wheel events. Defaults to 0.0025. Read lazily. */
51
- zoomSpeed?: number;
52
- /**
53
- * Pan step size in normalized coords for keyboard events.
54
- * Defaults to 0.01. Read lazily. Shift multiplies it by 10.
55
- */
56
- keyboardStep?: number;
57
- /** Zoom level for double-tap zoom. Defaults to 2. Read lazily. */
58
- doubleTapZoom?: number;
59
- /** Fires when a continuous gesture begins (pan drag, pinch zoom). */
60
- onGestureStart?: () => void;
61
- /** Fires when a continuous gesture ends (pointer release). */
62
- onGestureEnd?: () => void;
63
- /** Called when isDragging or isZooming changes. */
64
- onStatusChange?: (status: InteractionStatus) => void;
65
- }
66
- /**
67
- * Framework-agnostic imperative controller for image cropper interactions.
68
- *
69
- * Handles mouse, touch, and keyboard event processing for pan, zoom,
70
- * and crop manipulation. Uses requestAnimationFrame for drag/pinch
71
- * updates to avoid layout thrashing.
72
- *
73
- * The controller does not register DOM event listeners itself — that is the
74
- * responsibility of the UI layer (React hook, Vue directive, or vanilla JS).
75
- * Instead it exposes `handlePointerDown`, `handleWheel`, `handleTouchStart`,
76
- * and `handleKeyDown` methods that the UI layer calls with native DOM events.
77
- *
78
- * Scalar options (minZoom, maxZoom, zoomSpeed, keyboardStep, doubleTapZoom)
79
- * are read lazily from `this.options` on each interaction, so the UI layer
80
- * can update them without recreating the controller.
81
- *
82
- * Call `destroy()` to clean up timers and pending animation frames.
83
- */
84
- export declare class InteractionController {
85
- private readonly options;
86
- /** Current drag/zoom status. */
87
- private isDragging;
88
- private isZooming;
89
- /** Active drag state during pointer interactions. */
90
- private drag;
91
- /** Active touch state during touch interactions. */
92
- private touch;
93
- /** Cleanup function for active touch listeners on document. */
94
- private touchCleanup;
95
- /**
96
- * Cleanup function for active pointer-drag listeners on the
97
- * captured element. Set while a pointer drag is in progress so
98
- * `destroy()` can tear the drag down cleanly if the consumer
99
- * unmounts mid-drag. Cleared on pointerup/lostpointercapture.
100
- */
101
- private pointerCleanup;
102
- /** Last tap info for double-tap detection. */
103
- private lastTap;
104
- /** Timer for the zoom animation state (double-tap). */
105
- private zoomTimer;
106
- /** Timer for wheel gesture debounce. */
107
- private wheelGestureTimer;
108
- /** Whether a wheel gesture is currently active. */
109
- private wheelGestureActive;
110
- /** Current requestAnimationFrame ID. */
111
- private rafId;
112
- constructor(options: InteractionControllerOptions);
113
- /** Read minZoom lazily so option changes take effect immediately. */
114
- private get minZoom();
115
- /** Read maxZoom lazily so option changes take effect immediately. */
116
- private get maxZoom();
117
- /** Read zoomSpeed lazily so option changes take effect immediately. */
118
- private get zoomSpeed();
119
- /** Read keyboardStep lazily so option changes take effect immediately. */
120
- private get keyboardStep();
121
- /**
122
- * Get the keyboard pan step, including modifier-based coarse movement.
123
- *
124
- * @param event The native KeyboardEvent.
125
- * @return The normalized pan step.
126
- */
127
- private getKeyboardStep;
128
- /** Read doubleTapZoom lazily so option changes take effect immediately. */
129
- private get doubleTapZoom();
130
- /**
131
- * Update the drag/zoom status and notify via callback if changed.
132
- *
133
- * @param update Partial status with isDragging and/or isZooming.
134
- */
135
- private setStatus;
136
- /**
137
- * Handle a pointer-down event on the container element.
138
- *
139
- * Initiates a drag (pan) interaction. Captures the pointer on the
140
- * provided element and registers pointermove/pointerup/lostpointercapture
141
- * listeners for the duration of the drag.
142
- *
143
- * @param e The native PointerEvent.
144
- * @param el The DOM element to capture the pointer on.
145
- */
146
- handlePointerDown(e: PointerEvent, el: HTMLElement): void;
147
- /**
148
- * Handle a wheel event on the container element.
149
- *
150
- * Implements focal-point zoom: the point under the cursor stays
151
- * stationary on screen while the zoom level changes.
152
- *
153
- * Must be registered with `{ passive: false }` to allow preventDefault.
154
- *
155
- * @param e The native WheelEvent.
156
- */
157
- handleWheel(e: WheelEvent): void;
158
- /**
159
- * Handle a touch-start event on the container element.
160
- *
161
- * Supports single-finger pan, two-finger pinch zoom, and
162
- * double-tap to toggle between fit and 2x zoom. Registers
163
- * touchmove/touchend/touchcancel on the provided document for the
164
- * duration of the gesture.
165
- *
166
- * @param e The native TouchEvent.
167
- * @param containerRect The bounding rect of the container element.
168
- * @param doc The document to register move/end listeners on.
169
- * Defaults to globalThis.document. Pass the iframe's
170
- * contentDocument when running inside an iframe.
171
- */
172
- handleTouchStart(e: TouchEvent, containerRect: DOMRect, doc?: Document): void;
173
- private handleTouchMove;
174
- private tryDoubleTap;
175
- /**
176
- * Handle a keydown event on the container element.
177
- *
178
- * Supports arrow keys for panning, +/- for zoom, and r/R for rotation.
179
- *
180
- * @param e The native KeyboardEvent.
181
- */
182
- handleKeyDown(e: KeyboardEvent): void;
183
- /**
184
- * Clean up all timers, animation frames, and active touch listeners.
185
- *
186
- * Must be called when the controller is no longer needed (e.g., on
187
- * component unmount or element removal).
188
- */
189
- destroy(): void;
190
- }
191
- //# sourceMappingURL=interaction-controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interaction-controller.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/interaction-controller.ts"],"names":[],"mappings":"AAAA,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;;;;OAIG;IACH,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,EAAE,MAAM,CAAC;IACtB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,mDAAmD;IACnD,cAAc,CAAC,EAAE,CAAE,MAAM,EAAE,iBAAiB,KAAM,IAAI,CAAC;CACvD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,qBAAqB;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IAEvD,gCAAgC;IAChC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAS;IAE1B,qDAAqD;IACrD,OAAO,CAAC,IAAI,CAKI;IAEhB,oDAAoD;IACpD,OAAO,CAAC,KAAK,CAoBG;IAEhB,+DAA+D;IAC/D,OAAO,CAAC,YAAY,CAA+B;IAEnD;;;;;OAKG;IACH,OAAO,CAAC,cAAc,CAA+B;IAErD,8CAA8C;IAC9C,OAAO,CAAC,OAAO,CAIC;IAEhB,uDAAuD;IACvD,OAAO,CAAC,SAAS,CAA8C;IAE/D,wCAAwC;IACxC,OAAO,CAAC,iBAAiB,CAA8C;IAEvE,mDAAmD;IACnD,OAAO,CAAC,kBAAkB,CAAS;IAEnC,wCAAwC;IACxC,OAAO,CAAC,KAAK,CAAK;IAElB,YAAa,OAAO,EAAE,4BAA4B,EAEjD;IAED,qEAAqE;IACrE,OAAO,KAAK,OAAO,GAElB;IAED,qEAAqE;IACrE,OAAO,KAAK,OAAO,GAElB;IAED,uEAAuE;IACvE,OAAO,KAAK,SAAS,GAEpB;IAED,0EAA0E;IAC1E,OAAO,KAAK,YAAY,GAEvB;IAED;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAMvB,2EAA2E;IAC3E,OAAO,KAAK,aAAa,GAExB;IAED;;;;OAIG;IACH,OAAO,CAAC,SAAS;IA0BjB;;;;;;;;;OASG;IACH,iBAAiB,CAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE,WAAW,GAAI,IAAI,CAyG1D;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,CA2JrB;IAQF,OAAO,CAAC,YAAY;IAkFpB;;;;;;OAMG;IACH,aAAa,CAAE,CAAC,EAAE,aAAa,GAAI,IAAI,CAwHtC;IAED;;;;;OAKG;IACH,OAAO,IAAI,IAAI,CAmBd;CACD"}
@@ -1,18 +0,0 @@
1
- /**
2
- * Normalizes a rotation value to the range [0, 360).
3
- *
4
- * Negative rotations are converted to their positive clockwise equivalent.
5
- * For example, -90 becomes 270, -45 becomes 315, and 450 becomes 90.
6
- *
7
- * @param degrees The rotation value in degrees.
8
- * @return The normalized rotation in the range [0, 360).
9
- */
10
- export declare function normalizeRotation(degrees: number): number;
11
- /**
12
- * Converts an angle from degrees to radians.
13
- *
14
- * @param degrees The angle in degrees.
15
- * @return The angle in radians.
16
- */
17
- export declare function degreesToRadians(degrees: number): number;
18
- //# sourceMappingURL=rotation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rotation.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/core/math/rotation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAE,OAAO,EAAE,MAAM,GAAI,MAAM,CAM3D;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAE,OAAO,EAAE,MAAM,GAAI,MAAM,CAE1D"}
@@ -1,67 +0,0 @@
1
- import type { CropperState, NormalizedRect, Size } from '../types';
2
- /**
3
- * Returns `value` if it's finite and within `[-MAX_SAFE_MAGNITUDE,
4
- * MAX_SAFE_MAGNITUDE]`, otherwise `fallback`. Stricter than `Number.isFinite`
5
- * because extreme finite magnitudes (e.g. `Number.MAX_VALUE`) overflow
6
- * downstream trig/matrix math even though the spec reports them as finite.
7
- *
8
- * Note: sub-normal denormals (e.g. `Number.MIN_VALUE`) are accepted by this
9
- * function — they don't overflow on their own. Protection against divisions
10
- * by sub-normal values lives in `sanitizeCropperState`'s zoom guard.
11
- *
12
- * @param value The candidate value.
13
- * @param fallback The replacement to return when `value` is unsafe.
14
- * @return Either `value` or `fallback`.
15
- */
16
- export declare function safeBoundedNumber(value: number, fallback: number): number;
17
- /**
18
- * Returns `true` when `value` is finite and within `[-MAX_SAFE_MAGNITUDE,
19
- * MAX_SAFE_MAGNITUDE]`. The predicate companion to {@link safeBoundedNumber}
20
- * for callers that need to short-circuit rather than substitute a fallback.
21
- *
22
- * @param value The candidate value.
23
- * @return Whether `value` is safe to use in math.
24
- */
25
- export declare function isSafeNumber(value: number): boolean;
26
- /**
27
- * Returns `true` when both dimensions are finite and within the safe
28
- * range `[Number.EPSILON, MAX_SAFE_MAGNITUDE]`. The lower bound matters
29
- * because sub-normal dimensions (e.g. `Number.MIN_VALUE`) pass `> 0` but
30
- * make `container / dim` overflow to `Infinity` downstream in
31
- * `getImageFit` / `createCamera`. Use this to short-circuit math that
32
- * would otherwise produce non-finite output.
33
- *
34
- * @param size The size to check.
35
- * @return Whether `size` is safe to use in math.
36
- */
37
- export declare function isValidSize(size: Size): boolean;
38
- /**
39
- * Returns a copy of `rect` with every numeric field replaced by a safe
40
- * value via {@link safeBoundedNumber}. Returns the same reference when no
41
- * field needed substitution so callers can keep their reference-equality
42
- * short-circuits intact for clean inputs.
43
- *
44
- * @param rect The rect to sanitize.
45
- * @return A rect with all numeric fields finite.
46
- */
47
- export declare function sanitizeRect(rect: NormalizedRect): NormalizedRect;
48
- /**
49
- * Returns a copy of `state` with the cropper-math numeric fields replaced
50
- * by safe defaults. Covers `pan`, `zoom`, `rotation`, the matching base
51
- * pose, and `cropRect`. The `state.image` numeric fields (naturalWidth /
52
- * naturalHeight) are intentionally NOT sanitized — image dimensions reach
53
- * the math layer as a separate `imageSize` argument, and cloning the
54
- * image object here would break the reducer's reference-equality
55
- * short-circuit.
56
- *
57
- * Returns the same `state` reference when no field needed substitution
58
- * so callers in hot paths (every pointermove via `restrictPanZoom`) can
59
- * keep their reference-equality optimizations. Sub-object references
60
- * (`pan`, `basePan`, `cropRect`) are also preserved when their fields
61
- * are individually clean.
62
- *
63
- * @param state The cropper state to sanitize.
64
- * @return A cropper state with the math-relevant numeric fields finite.
65
- */
66
- export declare function sanitizeCropperState(state: CropperState): CropperState;
67
- //# sourceMappingURL=sanitize.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/core/math/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAUnE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAI,MAAM,CAQ3E;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAE,KAAK,EAAE,MAAM,GAAI,OAAO,CAErD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAE,IAAI,EAAE,IAAI,GAAI,OAAO,CASjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAE,IAAI,EAAE,cAAc,GAAI,cAAc,CAcnE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAE,KAAK,EAAE,YAAY,GAAI,YAAY,CA2CxE"}
@@ -1,21 +0,0 @@
1
- import type { CropperState, CropperAction } from './types';
2
- /**
3
- * Build the reducer action that produces a "cursorless" zoom — zoom
4
- * anchored at the current crop-rect center, with pan clamped to keep
5
- * the image covering the crop.
6
- *
7
- * The slider, the `+`/`-` keys, and the toolbar buttons have no
8
- * natural focal point (unlike wheel/pinch zoom), so they default to
9
- * the crop center. Returns `null` when the clamped zoom matches the
10
- * current zoom (no-op).
11
- *
12
- * Extracted so multiple hooks (the pure `useCropperController` and the
13
- * composite `useMediaEditorState`) can share the math without
14
- * duplicating it.
15
- *
16
- * @param state The current cropper state.
17
- * @param requestedZoom The zoom value the caller asked for.
18
- * @return A `SET_ZOOM_AT_POINT` action, or `null` if no change is required.
19
- */
20
- export declare function buildFocalPointZoomAction(state: CropperState, requestedZoom: number): CropperAction | null;
21
- //# sourceMappingURL=setter-helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"setter-helpers.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/setter-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAmB,aAAa,EAAE,MAAM,SAAS,CAAC;AAI5E;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACxC,KAAK,EAAE,YAAY,EACnB,aAAa,EAAE,MAAM,GACnB,aAAa,GAAG,IAAI,CAqCtB"}