@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,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 `useCropperReducer` 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"}
@@ -1,94 +0,0 @@
1
- import type { CropperState, HandlePosition, NormalizedRect, Size } from './types';
2
- /**
3
- * The selected image region in source-pixel coordinates.
4
- */
5
- export interface SourceRegion {
6
- /** X offset in source pixels. */
7
- x: number;
8
- /** Y offset in source pixels. */
9
- y: number;
10
- /** Width in source pixels. */
11
- width: number;
12
- /** Height in source pixels. */
13
- height: number;
14
- /** Rotation in degrees (0-360). */
15
- rotation: number;
16
- /** Flip state. */
17
- flip: {
18
- horizontal: boolean;
19
- vertical: boolean;
20
- };
21
- /** Zoom factor applied. */
22
- zoom: number;
23
- }
24
- /**
25
- * Get the selected image region in source-pixel coordinates.
26
- *
27
- * Converts the current crop state (normalized visual space) to the actual
28
- * region of the original image that's selected. This is the bridge between
29
- * the cropper's internal coordinate system and external tools (image
30
- * processing libraries, AI APIs, server-side processing) that work in
31
- * source-pixel coordinates.
32
- *
33
- * The returned rectangle accounts for pan, zoom, and the crop rect position,
34
- * but expresses the crop in the unrotated image's coordinate space. Rotation
35
- * and flip are included as separate fields since they represent transforms,
36
- * not a region.
37
- *
38
- * @param state The current cropper state.
39
- * @param imageSize The natural dimensions of the source image.
40
- * @return The selected region in source pixels plus rotation/flip metadata.
41
- */
42
- export declare function getSourceRegion(state: CropperState, imageSize: Size): SourceRegion;
43
- /**
44
- * Snap a crop rect so the selected source-region edges land on whole pixels.
45
- *
46
- * This is a display-time affordance for visible pixel grids; it does not alter
47
- * pan/zoom/rotation. Callers decide when snapping is appropriate.
48
- *
49
- * @param state The current cropper state.
50
- * @param imageSize The natural dimensions of the source image.
51
- * @param cropRect The candidate crop rect from resize math.
52
- * @param handle The active resize handle. Only edges moved by the handle snap.
53
- * @return A crop rect whose selected source-region edges are whole pixels.
54
- */
55
- export declare function snapCropRectToSourcePixels(state: CropperState, imageSize: Size, cropRect: NormalizedRect, handle: HandlePosition): NormalizedRect;
56
- /**
57
- * Snap all source-region edges for a crop rect to the nearest whole pixels.
58
- *
59
- * @param state The current cropper state.
60
- * @param imageSize The natural dimensions of the source image.
61
- * @param cropRect The crop rect to align to the source-pixel grid.
62
- * @return A crop rect whose source-region edges are whole pixels.
63
- */
64
- export declare function snapCropRectToSourcePixelGrid(state: CropperState, imageSize: Size, cropRect: NormalizedRect): NormalizedRect;
65
- /**
66
- * The selected crop region expressed as percentages of the source image.
67
- */
68
- export interface SourceRegionPercent {
69
- /** X offset as a percentage (0–100) of the source image width. */
70
- x: number;
71
- /** Y offset as a percentage (0–100) of the source image height. */
72
- y: number;
73
- /** Width as a percentage (0–100) of the source image width. */
74
- width: number;
75
- /** Height as a percentage (0–100) of the source image height. */
76
- height: number;
77
- }
78
- /**
79
- * Get the selected image region as percentages of the source image dimensions.
80
- *
81
- * Returns `{ x, y, width, height }` where each value is a percentage (0–100)
82
- * of the source image's natural width or height. This format is compatible
83
- * with the WordPress REST API attachments `/edit` endpoint and CSS-based
84
- * crop workflows.
85
- *
86
- * Internally delegates to `getSourceRegion` and divides by the image
87
- * dimensions, so accuracy is identical.
88
- *
89
- * @param state The current cropper state.
90
- * @param imageSize The natural dimensions of the source image.
91
- * @return The crop region as percentages (0–100).
92
- */
93
- export declare function getSourceRegionPercent(state: CropperState, imageSize: Size): SourceRegionPercent;
94
- //# sourceMappingURL=source-region.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"source-region.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/source-region.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,YAAY,EACZ,cAAc,EACd,cAAc,EACd,IAAI,EACJ,MAAM,SAAS,CAAC;AAKjB;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,iCAAiC;IACjC,CAAC,EAAE,MAAM,CAAC;IACV,iCAAiC;IACjC,CAAC,EAAE,MAAM,CAAC;IACV,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB;IAClB,IAAI,EAAE;QAAE,UAAU,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IACjD,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAC9B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,GACb,YAAY,CA0Ed;AAgGD;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CACzC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,EACf,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,cAAc,GACpB,cAAc,CAYhB;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC5C,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,EACf,QAAQ,EAAE,cAAc,GACtB,cAAc,CAOhB;AAmDD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,kEAAkE;IAClE,CAAC,EAAE,MAAM,CAAC;IACV,mEAAmE;IACnE,CAAC,EAAE,MAAM,CAAC;IACV,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACrC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,GACb,mBAAmB,CAWrB"}
@@ -1,51 +0,0 @@
1
- import type { CropperAction, CropperState } from './types';
2
- /**
3
- * Value-equality check for two cropper states.
4
- *
5
- * Used by history machinery to dedup snapshots and detect no-op
6
- * transitions. Compares every field that participates in the rendered
7
- * output; ignores reference identity.
8
- *
9
- * @param a First cropper state.
10
- * @param b Second cropper state.
11
- * @return Whether the two states are value-equal across all tracked fields.
12
- */
13
- export declare function areCropperStatesEqual(a: CropperState, b: CropperState): boolean;
14
- /**
15
- * Enforces containment: restricts the crop rect to fit within the
16
- * rotated image, computes minimum zoom, clamps zoom, and restricts
17
- * the pan position so the image always covers the crop area.
18
- * Called after every relevant state transition.
19
- *
20
- * @param state The state to enforce containment on.
21
- * @return The state with cropRect, zoom, and position restricted.
22
- */
23
- export declare function enforceContainment(state: CropperState): CropperState;
24
- /**
25
- * Reducer function for cropper state management.
26
- *
27
- * Every state transition that could invalidate the containment invariant
28
- * (crop, zoom, rotation, cropRect, flip) is followed by enforceContainment
29
- * to ensure the image always covers the crop area.
30
- *
31
- * Committing actions (everything except SET_ROTATION) also call
32
- * `commitBase` to snapshot the post-containment state as the new
33
- * base pose. SET_ROTATION derives from that base without mutating
34
- * it, which prevents accumulated-clamp drift during continuous fine
35
- * rotation.
36
- *
37
- * @param state The current cropper state.
38
- * @param action The action to process.
39
- * @return The new cropper state.
40
- */
41
- export declare function cropperReducer(state: CropperState, action: CropperAction): CropperState;
42
- /**
43
- * Shallow comparison of key cropper state fields to determine if
44
- * the state has been modified from an initial snapshot.
45
- *
46
- * @param current The current cropper state.
47
- * @param initial The initial cropper state snapshot.
48
- * @return True if any tracked field differs.
49
- */
50
- export declare function isStateDirty(current: CropperState, initial: CropperState): boolean;
51
- //# sourceMappingURL=state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAsB,MAAM,SAAS,CAAC;AAiB/E;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACpC,CAAC,EAAE,YAAY,EACf,CAAC,EAAE,YAAY,GACb,OAAO,CAkBT;AA6DD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAE,KAAK,EAAE,YAAY,GAAI,YAAY,CAgDtE;AAgCD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,aAAa,GACnB,YAAY,CA8Od;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,YAAY,EACrB,OAAO,EAAE,YAAY,GACnB,OAAO,CAaT"}
@@ -1,102 +0,0 @@
1
- import type { HandlePosition, NormalizedRect, Size } from './types';
2
- export type { HandlePosition };
3
- /** Axis whose resize distance controls the locked-ratio size projection. */
4
- export type ResizeDriverAxis = 'width' | 'height';
5
- /**
6
- * Resolve the minimum crop dimension, in source-image pixels, for the current
7
- * display scale.
8
- *
9
- * Two floors compete: a fixed source-pixel floor (`MIN_CROP_PIXELS`) that
10
- * avoids sub-pixel crops, and an on-screen floor (`MIN_CROP_SCREEN_PX`) that
11
- * keeps the crop large enough to grab. The on-screen floor converted to source
12
- * pixels is `MIN_CROP_SCREEN_PX / displayScale`; the binding constraint is the
13
- * larger of the two. When the image is shown small (small `displayScale`) the
14
- * on-screen floor dominates; once it is shown large enough the source-pixel
15
- * floor takes over.
16
- *
17
- * @param displayScale CSS pixels rendered per source pixel
18
- * (fit scale × zoom × view scale).
19
- * @return Minimum crop dimension in source-image pixels.
20
- */
21
- export declare function getMinCropPixels(displayScale: number): number;
22
- /**
23
- * Default minimum crop rect dimension in normalized space, used when no
24
- * explicit per-axis minimum is supplied (e.g. before the source image
25
- * has loaded). Real usage derives a pixel-based min from the source
26
- * image dimensions and `MIN_CROP_PIXELS` in `constants.ts`.
27
- */
28
- export declare const DEFAULT_MIN_CROP_SIZE: Size;
29
- /**
30
- * Bounds within which the crop rect must stay.
31
- */
32
- export interface CropBounds {
33
- minX: number;
34
- minY: number;
35
- maxX: number;
36
- maxY: number;
37
- }
38
- /**
39
- * Drag state for tracking a resize interaction.
40
- */
41
- export interface ResizeDragState {
42
- /** Which handle is being dragged. */
43
- handle: HandlePosition;
44
- /** The mouse position (pixels) when the drag started. */
45
- startX: number;
46
- startY: number;
47
- /** The crop rect (normalized) when the drag started. */
48
- startRect: NormalizedRect;
49
- }
50
- /**
51
- * Compute the new crop rect for a free (no aspect ratio) resize.
52
- *
53
- * Each edge moves independently based on the handle being dragged.
54
- * Edges are clamped to the provided bounds and maintain a minimum size.
55
- *
56
- * @param drag The current drag state.
57
- * @param clientX Current mouse/touch X position in pixels.
58
- * @param clientY Current mouse/touch Y position in pixels.
59
- * @param imageSize The rendered image dimensions in pixels.
60
- * @param bounds The allowed crop area bounds.
61
- * @param minCropSize Minimum crop rect dimension in normalized space, per axis.
62
- * @return The new crop rect in normalized coordinates.
63
- */
64
- export declare function computeFreeResizeRect(drag: ResizeDragState, clientX: number, clientY: number, imageSize: Size, bounds: CropBounds, minCropSize?: Size): NormalizedRect;
65
- /**
66
- * Compute the new crop rect for a locked-aspect-ratio corner resize.
67
- *
68
- * The opposite corner is the anchor. The dragged corner moves freely
69
- * but the result is clamped to maintain the aspect ratio and stay
70
- * within bounds.
71
- *
72
- * @param drag The current drag state.
73
- * @param clientX Current mouse/touch X position in pixels.
74
- * @param clientY Current mouse/touch Y position in pixels.
75
- * @param imageSize The rendered image dimensions in pixels.
76
- * @param bounds The allowed crop area bounds.
77
- * @param normalizedRatio The locked aspect ratio (width / height in normalized space).
78
- * @param minCropSize Minimum crop rect dimension in normalized space, per axis.
79
- * @param driverAxis Optional explicit driver axis. Used for keyboard
80
- * resize, where one arrow axis should determine the step.
81
- * @return The new crop rect in normalized coordinates.
82
- */
83
- export declare function computeLockedResizeRect(drag: ResizeDragState, clientX: number, clientY: number, imageSize: Size, bounds: CropBounds, normalizedRatio: number, minCropSize?: Size, driverAxis?: ResizeDriverAxis): NormalizedRect;
84
- /**
85
- * Compute the new crop rect for a resize that temporarily locks the
86
- * aspect ratio to `drag.startRect`'s ratio (e.g. while Shift is held).
87
- *
88
- * Corner handles delegate to {@link computeLockedResizeRect}. Edge
89
- * handles size the dragged axis freely, then expand the perpendicular
90
- * axis symmetrically around the rect's center to preserve the ratio,
91
- * clamping symmetrically so the rect stays within bounds.
92
- *
93
- * @param drag The current drag state.
94
- * @param clientX Current mouse/touch X position in pixels.
95
- * @param clientY Current mouse/touch Y position in pixels.
96
- * @param imageSize The rendered image dimensions in pixels.
97
- * @param bounds The allowed crop area bounds.
98
- * @param minCropSize Minimum crop rect dimension in normalized space, per axis.
99
- * @return The new crop rect in normalized coordinates.
100
- */
101
- export declare function computeShiftLockedResizeRect(drag: ResizeDragState, clientX: number, clientY: number, imageSize: Size, bounds: CropBounds, minCropSize?: Size): NormalizedRect;
102
- //# sourceMappingURL=stencil-math.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stencil-math.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/stencil-math.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE/B,4EAA4E;AAC5E,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAElD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAE,YAAY,EAAE,MAAM,GAAI,MAAM,CAK/D;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,IAAoC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,qCAAqC;IACrC,MAAM,EAAE,cAAc,CAAC;IACvB,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,SAAS,EAAE,cAAc,CAAC;CAC1B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,UAAU,EAClB,WAAW,GAAE,IAA4B,GACvC,cAAc,CA6ChB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,uBAAuB,CACtC,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,UAAU,EAClB,eAAe,EAAE,MAAM,EACvB,WAAW,GAAE,IAA4B,EACzC,UAAU,CAAC,EAAE,gBAAgB,GAC3B,cAAc,CAyFhB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC3C,IAAI,EAAE,eAAe,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,UAAU,EAClB,WAAW,GAAE,IAA4B,GACvC,cAAc,CA0GhB"}
@@ -1,20 +0,0 @@
1
- import type { CropperState, Size } from './types';
2
- /**
3
- * Computes a CSS matrix() transform string from the cropper state.
4
- *
5
- * The combined transform is: translate(tx, ty) * scale(sx, sy) * rotate(r) * scale(z)
6
- * expressed as a 2D CSS matrix(a, b, c, d, tx, ty).
7
- *
8
- * Flip is composed outside rotation so it is viewport-relative — horizontal
9
- * flip mirrors across the viewport's vertical axis regardless of rotation.
10
- * Must match the matrix order in `createCamera` / `getImageCropBounds`.
11
- *
12
- * This is a pure function with no framework dependencies. The React hook
13
- * `useTransformStyle` wraps this in `useMemo` for memoization.
14
- *
15
- * @param state The current cropper state.
16
- * @param imageSize The rendered image dimensions in pixels.
17
- * @return A CSS transform string.
18
- */
19
- export declare function computeTransformStyle(state: CropperState, imageSize: Size): string;
20
- //# sourceMappingURL=transform-style.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transform-style.d.ts","sourceRoot":"","sources":["../../../src/image-editor/core/transform-style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAOlD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,IAAI,GACb,MAAM,CA4BR"}
@@ -1,24 +0,0 @@
1
- import type { TransformOperation, CropperState } from '../types';
2
- /**
3
- * Apply a single transform operation to a cropper state, returning
4
- * a new state with the containment invariant enforced.
5
- *
6
- * Delegates to the reducer via APPLY_OPERATION so pipeline replay
7
- * produces identical bounded state to UI interaction or setter
8
- * calls. The same logical operation yields the same result
9
- * regardless of entrypoint.
10
- *
11
- * @param state The current cropper state.
12
- * @param op The operation to apply.
13
- * @return A new cropper state with the operation applied.
14
- */
15
- export declare function applyOperationToState(state: CropperState, op: TransformOperation): CropperState;
16
- /**
17
- * Replay all operations from an initial state to produce the final state.
18
- *
19
- * @param pipeline The array of transform operations to replay.
20
- * @param initialState The starting state. Defaults to DEFAULT_STATE.
21
- * @return The resulting cropper state after all operations are applied.
22
- */
23
- export declare function stateFromPipeline(pipeline: TransformOperation[], initialState?: CropperState): CropperState;
24
- //# sourceMappingURL=pipeline.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../../src/image-editor/core/transforms/pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIjE;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,YAAY,EACnB,EAAE,EAAE,kBAAkB,GACpB,YAAY,CAEd;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,kBAAkB,EAAE,EAC9B,YAAY,GAAE,YAAmC,GAC/C,YAAY,CAKd"}