@wordpress/media-editor 0.7.0 → 0.8.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 (306) hide show
  1. package/build/components/media-editor-canvas/index.cjs +54 -0
  2. package/build/components/media-editor-canvas/index.cjs.map +7 -0
  3. package/build/components/media-editor-crop-panel/index.cjs +116 -0
  4. package/build/components/media-editor-crop-panel/index.cjs.map +7 -0
  5. package/build/components/media-editor-modal/build-modifiers.cjs +91 -0
  6. package/build/components/media-editor-modal/build-modifiers.cjs.map +7 -0
  7. package/build/components/media-editor-modal/index.cjs +497 -0
  8. package/build/components/media-editor-modal/index.cjs.map +7 -0
  9. package/build/components/media-editor-toolbar/index.cjs +146 -0
  10. package/build/components/media-editor-toolbar/index.cjs.map +7 -0
  11. package/build/components/media-preview/index.cjs +1 -1
  12. package/build/components/media-preview/index.cjs.map +2 -2
  13. package/build/image-editor/core/camera.cjs +194 -0
  14. package/build/image-editor/core/camera.cjs.map +7 -0
  15. package/build/image-editor/core/constants.cjs +81 -0
  16. package/build/image-editor/core/constants.cjs.map +7 -0
  17. package/build/image-editor/core/containment.cjs +245 -0
  18. package/build/image-editor/core/containment.cjs.map +7 -0
  19. package/build/image-editor/core/export/canvas-renderer.cjs +151 -0
  20. package/build/image-editor/core/export/canvas-renderer.cjs.map +7 -0
  21. package/build/image-editor/core/index.cjs +50 -0
  22. package/build/image-editor/core/index.cjs.map +7 -0
  23. package/build/image-editor/core/interaction-controller.cjs +608 -0
  24. package/build/image-editor/core/interaction-controller.cjs.map +7 -0
  25. package/build/image-editor/core/math/rotation.cjs +41 -0
  26. package/build/image-editor/core/math/rotation.cjs.map +7 -0
  27. package/build/image-editor/core/source-region.cjs +95 -0
  28. package/build/image-editor/core/source-region.cjs.map +7 -0
  29. package/build/image-editor/core/state.cjs +269 -0
  30. package/build/image-editor/core/state.cjs.map +7 -0
  31. package/build/image-editor/core/stencil-math.cjs +197 -0
  32. package/build/image-editor/core/stencil-math.cjs.map +7 -0
  33. package/build/image-editor/core/transform-style.cjs +46 -0
  34. package/build/image-editor/core/transform-style.cjs.map +7 -0
  35. package/build/image-editor/core/transforms/pipeline.cjs +43 -0
  36. package/build/image-editor/core/transforms/pipeline.cjs.map +7 -0
  37. package/build/image-editor/core/types.cjs +19 -0
  38. package/build/image-editor/core/types.cjs.map +7 -0
  39. package/build/image-editor/index.cjs +57 -0
  40. package/build/image-editor/index.cjs.map +7 -0
  41. package/build/image-editor/react/components/cropper-provider.cjs +50 -0
  42. package/build/image-editor/react/components/cropper-provider.cjs.map +7 -0
  43. package/build/image-editor/react/components/cropper.cjs +365 -0
  44. package/build/image-editor/react/components/cropper.cjs.map +7 -0
  45. package/build/image-editor/react/components/index.cjs +36 -0
  46. package/build/image-editor/react/components/index.cjs.map +7 -0
  47. package/build/image-editor/react/components/overlays/dimming-overlay.cjs +58 -0
  48. package/build/image-editor/react/components/overlays/dimming-overlay.cjs.map +7 -0
  49. package/build/image-editor/react/components/overlays/grid-overlay.cjs +91 -0
  50. package/build/image-editor/react/components/overlays/grid-overlay.cjs.map +7 -0
  51. package/build/image-editor/react/components/stencils/rectangle-stencil.cjs +351 -0
  52. package/build/image-editor/react/components/stencils/rectangle-stencil.cjs.map +7 -0
  53. package/build/image-editor/react/hooks/index.cjs +31 -0
  54. package/build/image-editor/react/hooks/index.cjs.map +7 -0
  55. package/build/image-editor/react/hooks/use-aria-announcer.cjs +68 -0
  56. package/build/image-editor/react/hooks/use-aria-announcer.cjs.map +7 -0
  57. package/build/image-editor/react/hooks/use-cropper-state.cjs +158 -0
  58. package/build/image-editor/react/hooks/use-cropper-state.cjs.map +7 -0
  59. package/build/image-editor/react/hooks/use-interaction.cjs +161 -0
  60. package/build/image-editor/react/hooks/use-interaction.cjs.map +7 -0
  61. package/build/image-editor/react/hooks/use-transform-style.cjs +38 -0
  62. package/build/image-editor/react/hooks/use-transform-style.cjs.map +7 -0
  63. package/build/index.cjs +5 -2
  64. package/build/index.cjs.map +2 -2
  65. package/build/lock-unlock.cjs +37 -0
  66. package/build/lock-unlock.cjs.map +7 -0
  67. package/build/private-apis.cjs +38 -0
  68. package/build/private-apis.cjs.map +7 -0
  69. package/build/store/actions.cjs +45 -0
  70. package/build/store/actions.cjs.map +7 -0
  71. package/build/store/constants.cjs +31 -0
  72. package/build/store/constants.cjs.map +7 -0
  73. package/build/store/index.cjs +51 -0
  74. package/build/store/index.cjs.map +7 -0
  75. package/build/store/reducer.cjs +51 -0
  76. package/build/store/reducer.cjs.map +7 -0
  77. package/build/store/selectors.cjs +43 -0
  78. package/build/store/selectors.cjs.map +7 -0
  79. package/build-module/components/media-editor-canvas/index.mjs +33 -0
  80. package/build-module/components/media-editor-canvas/index.mjs.map +7 -0
  81. package/build-module/components/media-editor-crop-panel/index.mjs +100 -0
  82. package/build-module/components/media-editor-crop-panel/index.mjs.map +7 -0
  83. package/build-module/components/media-editor-modal/build-modifiers.mjs +66 -0
  84. package/build-module/components/media-editor-modal/build-modifiers.mjs.map +7 -0
  85. package/build-module/components/media-editor-modal/index.mjs +483 -0
  86. package/build-module/components/media-editor-modal/index.mjs.map +7 -0
  87. package/build-module/components/media-editor-toolbar/index.mjs +130 -0
  88. package/build-module/components/media-editor-toolbar/index.mjs.map +7 -0
  89. package/build-module/components/media-preview/index.mjs +1 -1
  90. package/build-module/components/media-preview/index.mjs.map +2 -2
  91. package/build-module/image-editor/core/camera.mjs +163 -0
  92. package/build-module/image-editor/core/camera.mjs.map +7 -0
  93. package/build-module/image-editor/core/constants.mjs +51 -0
  94. package/build-module/image-editor/core/constants.mjs.map +7 -0
  95. package/build-module/image-editor/core/containment.mjs +218 -0
  96. package/build-module/image-editor/core/containment.mjs.map +7 -0
  97. package/build-module/image-editor/core/export/canvas-renderer.mjs +120 -0
  98. package/build-module/image-editor/core/export/canvas-renderer.mjs.map +7 -0
  99. package/build-module/image-editor/core/index.mjs +24 -0
  100. package/build-module/image-editor/core/index.mjs.map +7 -0
  101. package/build-module/image-editor/core/interaction-controller.mjs +583 -0
  102. package/build-module/image-editor/core/interaction-controller.mjs.map +7 -0
  103. package/build-module/image-editor/core/math/rotation.mjs +15 -0
  104. package/build-module/image-editor/core/math/rotation.mjs.map +7 -0
  105. package/build-module/image-editor/core/source-region.mjs +69 -0
  106. package/build-module/image-editor/core/source-region.mjs.map +7 -0
  107. package/build-module/image-editor/core/state.mjs +242 -0
  108. package/build-module/image-editor/core/state.mjs.map +7 -0
  109. package/build-module/image-editor/core/stencil-math.mjs +169 -0
  110. package/build-module/image-editor/core/stencil-math.mjs.map +7 -0
  111. package/build-module/image-editor/core/transform-style.mjs +21 -0
  112. package/build-module/image-editor/core/transform-style.mjs.map +7 -0
  113. package/build-module/image-editor/core/transforms/pipeline.mjs +17 -0
  114. package/build-module/image-editor/core/transforms/pipeline.mjs.map +7 -0
  115. package/build-module/image-editor/core/types.mjs +1 -0
  116. package/build-module/image-editor/core/types.mjs.map +7 -0
  117. package/build-module/image-editor/index.mjs +30 -0
  118. package/build-module/image-editor/index.mjs.map +7 -0
  119. package/build-module/image-editor/react/components/cropper-provider.mjs +26 -0
  120. package/build-module/image-editor/react/components/cropper-provider.mjs.map +7 -0
  121. package/build-module/image-editor/react/components/cropper.mjs +337 -0
  122. package/build-module/image-editor/react/components/cropper.mjs.map +7 -0
  123. package/build-module/image-editor/react/components/index.mjs +9 -0
  124. package/build-module/image-editor/react/components/index.mjs.map +7 -0
  125. package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs +33 -0
  126. package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs.map +7 -0
  127. package/build-module/image-editor/react/components/overlays/grid-overlay.mjs +66 -0
  128. package/build-module/image-editor/react/components/overlays/grid-overlay.mjs.map +7 -0
  129. package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs +330 -0
  130. package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs.map +7 -0
  131. package/build-module/image-editor/react/hooks/index.mjs +6 -0
  132. package/build-module/image-editor/react/hooks/index.mjs.map +7 -0
  133. package/build-module/image-editor/react/hooks/use-aria-announcer.mjs +43 -0
  134. package/build-module/image-editor/react/hooks/use-aria-announcer.mjs.map +7 -0
  135. package/build-module/image-editor/react/hooks/use-cropper-state.mjs +137 -0
  136. package/build-module/image-editor/react/hooks/use-cropper-state.mjs.map +7 -0
  137. package/build-module/image-editor/react/hooks/use-interaction.mjs +138 -0
  138. package/build-module/image-editor/react/hooks/use-interaction.mjs.map +7 -0
  139. package/build-module/image-editor/react/hooks/use-transform-style.mjs +13 -0
  140. package/build-module/image-editor/react/hooks/use-transform-style.mjs.map +7 -0
  141. package/build-module/index.mjs +3 -1
  142. package/build-module/index.mjs.map +2 -2
  143. package/build-module/lock-unlock.mjs +11 -0
  144. package/build-module/lock-unlock.mjs.map +7 -0
  145. package/build-module/private-apis.mjs +13 -0
  146. package/build-module/private-apis.mjs.map +7 -0
  147. package/build-module/store/actions.mjs +19 -0
  148. package/build-module/store/actions.mjs.map +7 -0
  149. package/build-module/store/constants.mjs +6 -0
  150. package/build-module/store/constants.mjs.map +7 -0
  151. package/build-module/store/index.mjs +16 -0
  152. package/build-module/store/index.mjs.map +7 -0
  153. package/build-module/store/reducer.mjs +26 -0
  154. package/build-module/store/reducer.mjs.map +7 -0
  155. package/build-module/store/selectors.mjs +16 -0
  156. package/build-module/store/selectors.mjs.map +7 -0
  157. package/build-style/style-rtl.css +315 -0
  158. package/build-style/style.css +315 -0
  159. package/build-types/components/media-editor-canvas/index.d.ts +22 -0
  160. package/build-types/components/media-editor-canvas/index.d.ts.map +1 -0
  161. package/build-types/components/media-editor-crop-panel/index.d.ts +45 -0
  162. package/build-types/components/media-editor-crop-panel/index.d.ts.map +1 -0
  163. package/build-types/components/media-editor-modal/build-modifiers.d.ts +83 -0
  164. package/build-types/components/media-editor-modal/build-modifiers.d.ts.map +1 -0
  165. package/build-types/components/media-editor-modal/index.d.ts +20 -0
  166. package/build-types/components/media-editor-modal/index.d.ts.map +1 -0
  167. package/build-types/components/media-editor-toolbar/index.d.ts +21 -0
  168. package/build-types/components/media-editor-toolbar/index.d.ts.map +1 -0
  169. package/build-types/components/media-preview/index.d.ts.map +1 -1
  170. package/build-types/image-editor/core/camera.d.ts +107 -0
  171. package/build-types/image-editor/core/camera.d.ts.map +1 -0
  172. package/build-types/image-editor/core/constants.d.ts +46 -0
  173. package/build-types/image-editor/core/constants.d.ts.map +1 -0
  174. package/build-types/image-editor/core/containment.d.ts +61 -0
  175. package/build-types/image-editor/core/containment.d.ts.map +1 -0
  176. package/build-types/image-editor/core/export/canvas-renderer.d.ts +106 -0
  177. package/build-types/image-editor/core/export/canvas-renderer.d.ts.map +1 -0
  178. package/build-types/image-editor/core/index.d.ts +8 -0
  179. package/build-types/image-editor/core/index.d.ts.map +1 -0
  180. package/build-types/image-editor/core/interaction-controller.d.ts +178 -0
  181. package/build-types/image-editor/core/interaction-controller.d.ts.map +1 -0
  182. package/build-types/image-editor/core/math/rotation.d.ts +18 -0
  183. package/build-types/image-editor/core/math/rotation.d.ts.map +1 -0
  184. package/build-types/image-editor/core/source-region.d.ts +75 -0
  185. package/build-types/image-editor/core/source-region.d.ts.map +1 -0
  186. package/build-types/image-editor/core/state.d.ts +42 -0
  187. package/build-types/image-editor/core/state.d.ts.map +1 -0
  188. package/build-types/image-editor/core/stencil-math.d.ts +79 -0
  189. package/build-types/image-editor/core/stencil-math.d.ts.map +1 -0
  190. package/build-types/image-editor/core/transform-style.d.ts +23 -0
  191. package/build-types/image-editor/core/transform-style.d.ts.map +1 -0
  192. package/build-types/image-editor/core/transforms/pipeline.d.ts +27 -0
  193. package/build-types/image-editor/core/transforms/pipeline.d.ts.map +1 -0
  194. package/build-types/image-editor/core/types.d.ts +211 -0
  195. package/build-types/image-editor/core/types.d.ts.map +1 -0
  196. package/build-types/image-editor/index.d.ts +16 -0
  197. package/build-types/image-editor/index.d.ts.map +1 -0
  198. package/build-types/image-editor/react/components/cropper-provider.d.ts +37 -0
  199. package/build-types/image-editor/react/components/cropper-provider.d.ts.map +1 -0
  200. package/build-types/image-editor/react/components/cropper.d.ts +59 -0
  201. package/build-types/image-editor/react/components/cropper.d.ts.map +1 -0
  202. package/build-types/image-editor/react/components/index.d.ts +4 -0
  203. package/build-types/image-editor/react/components/index.d.ts.map +1 -0
  204. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts +30 -0
  205. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts.map +1 -0
  206. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts +30 -0
  207. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts.map +1 -0
  208. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts +32 -0
  209. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts.map +1 -0
  210. package/build-types/image-editor/react/hooks/index.d.ts +3 -0
  211. package/build-types/image-editor/react/hooks/index.d.ts.map +1 -0
  212. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts +16 -0
  213. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts.map +1 -0
  214. package/build-types/image-editor/react/hooks/use-cropper-state.d.ts +68 -0
  215. package/build-types/image-editor/react/hooks/use-cropper-state.d.ts.map +1 -0
  216. package/build-types/image-editor/react/hooks/use-interaction.d.ts +60 -0
  217. package/build-types/image-editor/react/hooks/use-interaction.d.ts.map +1 -0
  218. package/build-types/image-editor/react/hooks/use-transform-style.d.ts +16 -0
  219. package/build-types/image-editor/react/hooks/use-transform-style.d.ts.map +1 -0
  220. package/build-types/image-editor/stories/rectangle-crop.story.d.ts +16 -0
  221. package/build-types/image-editor/stories/rectangle-crop.story.d.ts.map +1 -0
  222. package/build-types/index.d.ts +1 -0
  223. package/build-types/index.d.ts.map +1 -1
  224. package/build-types/lock-unlock.d.ts +2 -0
  225. package/build-types/lock-unlock.d.ts.map +1 -0
  226. package/build-types/private-apis.d.ts +2 -0
  227. package/build-types/private-apis.d.ts.map +1 -0
  228. package/build-types/store/actions.d.ts +27 -0
  229. package/build-types/store/actions.d.ts.map +1 -0
  230. package/build-types/store/constants.d.ts +2 -0
  231. package/build-types/store/constants.d.ts.map +1 -0
  232. package/build-types/store/index.d.ts +4 -0
  233. package/build-types/store/index.d.ts.map +1 -0
  234. package/build-types/store/reducer.d.ts +23 -0
  235. package/build-types/store/reducer.d.ts.map +1 -0
  236. package/build-types/store/selectors.d.ts +8 -0
  237. package/build-types/store/selectors.d.ts.map +1 -0
  238. package/package.json +21 -8
  239. package/src/components/media-editor-canvas/index.tsx +56 -0
  240. package/src/components/media-editor-canvas/style.scss +9 -0
  241. package/src/components/media-editor-crop-panel/index.tsx +143 -0
  242. package/src/components/media-editor-modal/build-modifiers.ts +164 -0
  243. package/src/components/media-editor-modal/index.tsx +639 -0
  244. package/src/components/media-editor-modal/style.scss +139 -0
  245. package/src/components/media-editor-modal/test/build-modifiers.test.ts +343 -0
  246. package/src/components/media-editor-toolbar/index.tsx +150 -0
  247. package/src/components/media-editor-toolbar/style.scss +21 -0
  248. package/src/components/media-preview/index.tsx +2 -1
  249. package/src/image-editor/README.md +162 -0
  250. package/src/image-editor/core/camera.ts +352 -0
  251. package/src/image-editor/core/constants.ts +93 -0
  252. package/src/image-editor/core/containment.ts +435 -0
  253. package/src/image-editor/core/export/canvas-renderer.ts +253 -0
  254. package/src/image-editor/core/export/test/canvas-renderer.ts +813 -0
  255. package/src/image-editor/core/index.ts +35 -0
  256. package/src/image-editor/core/interaction-controller.ts +889 -0
  257. package/src/image-editor/core/math/rotation.ts +26 -0
  258. package/src/image-editor/core/source-region.ts +166 -0
  259. package/src/image-editor/core/state.ts +428 -0
  260. package/src/image-editor/core/stencil-math.ts +330 -0
  261. package/src/image-editor/core/test/camera.ts +593 -0
  262. package/src/image-editor/core/test/interaction-controller.ts +996 -0
  263. package/src/image-editor/core/test/preview-export-parity.ts +242 -0
  264. package/src/image-editor/core/test/render-camera-bridge.ts +348 -0
  265. package/src/image-editor/core/test/state.ts +762 -0
  266. package/src/image-editor/core/test/stencil-math.ts +321 -0
  267. package/src/image-editor/core/transform-style.ts +44 -0
  268. package/src/image-editor/core/transforms/pipeline.ts +43 -0
  269. package/src/image-editor/core/transforms/test/pipeline.ts +269 -0
  270. package/src/image-editor/core/types.ts +177 -0
  271. package/src/image-editor/docs/architecture.md +96 -0
  272. package/src/image-editor/docs/recipes.md +720 -0
  273. package/src/image-editor/docs/roadmap.md +66 -0
  274. package/src/image-editor/index.ts +43 -0
  275. package/src/image-editor/react/components/cropper-provider.tsx +73 -0
  276. package/src/image-editor/react/components/cropper.scss +195 -0
  277. package/src/image-editor/react/components/cropper.tsx +534 -0
  278. package/src/image-editor/react/components/index.ts +3 -0
  279. package/src/image-editor/react/components/overlays/dimming-overlay.tsx +57 -0
  280. package/src/image-editor/react/components/overlays/grid-overlay.tsx +80 -0
  281. package/src/image-editor/react/components/stencils/rectangle-stencil.tsx +513 -0
  282. package/src/image-editor/react/components/stencils/test/rectangle-stencil.tsx +265 -0
  283. package/src/image-editor/react/components/test/cropper.tsx +140 -0
  284. package/src/image-editor/react/hooks/index.ts +2 -0
  285. package/src/image-editor/react/hooks/test/use-cropper-state.ts +913 -0
  286. package/src/image-editor/react/hooks/test/use-interaction.ts +218 -0
  287. package/src/image-editor/react/hooks/test/use-transform-style.ts +146 -0
  288. package/src/image-editor/react/hooks/use-aria-announcer.ts +64 -0
  289. package/src/image-editor/react/hooks/use-cropper-state.ts +238 -0
  290. package/src/image-editor/react/hooks/use-interaction.ts +223 -0
  291. package/src/image-editor/react/hooks/use-transform-style.ts +30 -0
  292. package/src/image-editor/stories/rectangle-crop.story.tsx +1085 -0
  293. package/src/image-editor/stories/style.css +94 -0
  294. package/src/image-editor/style.scss +1 -0
  295. package/src/index.ts +3 -0
  296. package/src/lock-unlock.ts +10 -0
  297. package/src/private-apis.ts +12 -0
  298. package/src/store/actions.ts +33 -0
  299. package/src/store/constants.ts +1 -0
  300. package/src/store/index.ts +20 -0
  301. package/src/store/reducer.ts +48 -0
  302. package/src/store/selectors.ts +16 -0
  303. package/src/store/test/reducer.ts +57 -0
  304. package/src/style.scss +4 -0
  305. package/tsconfig.json +10 -2
  306. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,365 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // packages/media-editor/src/image-editor/react/components/cropper.tsx
31
+ var cropper_exports = {};
32
+ __export(cropper_exports, {
33
+ Cropper: () => Cropper
34
+ });
35
+ module.exports = __toCommonJS(cropper_exports);
36
+ var import_clsx = __toESM(require("clsx"));
37
+ var import_element = require("@wordpress/element");
38
+ var import_i18n = require("@wordpress/i18n");
39
+ var import_camera = require("../../core/camera.cjs");
40
+ var import_containment = require("../../core/containment.cjs");
41
+ var import_use_interaction = require("../hooks/use-interaction.cjs");
42
+ var import_use_transform_style = require("../hooks/use-transform-style.cjs");
43
+ var import_use_aria_announcer = require("../hooks/use-aria-announcer.cjs");
44
+ var import_rectangle_stencil = require("./stencils/rectangle-stencil.cjs");
45
+ var import_dimming_overlay = require("./overlays/dimming-overlay.cjs");
46
+ var import_grid_overlay = require("./overlays/grid-overlay.cjs");
47
+
48
+ // packages/media-editor/src/image-editor/react/components/cropper.scss
49
+ if (typeof document !== "undefined" && process.env.NODE_ENV !== "test" && !document.head.querySelector("style[data-wp-hash='d3d6b4ac29']")) {
50
+ const style = document.createElement("style");
51
+ style.setAttribute("data-wp-hash", "d3d6b4ac29");
52
+ style.appendChild(document.createTextNode('.wp-media-editor-image-editor{cursor:grab;height:100%;overflow:hidden;position:relative;touch-action:none;user-select:none;width:100%}.wp-media-editor-image-editor__canvas{inset:22px;position:absolute}.wp-media-editor-image-editor--dragging{cursor:grabbing}.wp-media-editor-image-editor__image{left:0;position:absolute;top:0;transform-origin:center center;will-change:transform}.wp-media-editor-image-editor__stencil{pointer-events:none;position:absolute}.wp-media-editor-image-editor__dimming{box-shadow:0 0 0 9999px #000000b3;pointer-events:none;position:absolute;transition:box-shadow .15s ease}.wp-media-editor-image-editor--dragging .wp-media-editor-image-editor__dimming{box-shadow:0 0 0 9999px #00000080}.wp-media-editor-image-editor__grid{overflow:hidden;pointer-events:none;position:absolute;transition:opacity .15s ease}.wp-media-editor-image-editor__canvas--grid-interactive .wp-media-editor-image-editor__grid{opacity:0;transition-delay:.1s}.wp-media-editor-image-editor__canvas--show-grid .wp-media-editor-image-editor__grid{opacity:1;transition-delay:0s}.wp-media-editor-image-editor__grid-line{background:#fff6;position:absolute}.wp-media-editor-image-editor__grid-line--horizontal{height:1px;left:0;width:100%}.wp-media-editor-image-editor__grid-line--vertical{height:100%;top:0;width:1px}.wp-media-editor-image-editor__stencil-rect{border:1px solid #ffffffb3;box-sizing:border-box;pointer-events:none;position:absolute}.wp-media-editor-image-editor__handle{appearance:none;background:#fff9;border:1px solid #ffffffe6;border-radius:50%;box-sizing:border-box;cursor:default;font:inherit;height:12px;margin:0;padding:0;pointer-events:auto;position:absolute;transition:background-color .15s ease,box-shadow .15s ease;width:12px}.wp-media-editor-image-editor__handle:focus{outline:none}.wp-media-editor-image-editor__handle:focus-visible{background:var(--wp-image-editor-focus-color,var(--wp-admin-theme-color,#007cba));border-color:#0000;box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-image-editor-focus-color,var(--wp-admin-theme-color,#007cba))}.wp-media-editor-image-editor__handle:before{content:"";height:44px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:44px}.wp-media-editor-image-editor__handle--n{cursor:ns-resize;left:50%;margin-left:-6px;top:-6px}.wp-media-editor-image-editor__handle--s{bottom:-6px;cursor:ns-resize;left:50%;margin-left:-6px}.wp-media-editor-image-editor__handle--e{cursor:ew-resize;margin-top:-6px;right:-6px;top:50%}.wp-media-editor-image-editor__handle--w{cursor:ew-resize;left:-6px;margin-top:-6px;top:50%}.wp-media-editor-image-editor__handle--nw{cursor:nwse-resize;left:-6px;top:-6px}.wp-media-editor-image-editor__handle--ne{cursor:nesw-resize;right:-6px;top:-6px}.wp-media-editor-image-editor__handle--sw{bottom:-6px;cursor:nesw-resize;left:-6px}.wp-media-editor-image-editor__handle--se{bottom:-6px;cursor:nwse-resize;right:-6px}'));
53
+ document.head.appendChild(style);
54
+ }
55
+
56
+ // packages/media-editor/src/image-editor/react/components/cropper.tsx
57
+ var import_jsx_runtime = require("react/jsx-runtime");
58
+ var CROP_RECT_EPSILON = 1e-6;
59
+ function computeInscribedRect(aspectRatio, visualSize) {
60
+ let w = 1;
61
+ let h = 1;
62
+ if (aspectRatio && aspectRatio > 0 && visualSize.width > 0) {
63
+ const normalizedRatio = aspectRatio * visualSize.height / visualSize.width;
64
+ if (normalizedRatio <= 1) {
65
+ w = normalizedRatio;
66
+ } else {
67
+ h = 1 / normalizedRatio;
68
+ }
69
+ }
70
+ return {
71
+ x: (1 - w) / 2,
72
+ y: (1 - h) / 2,
73
+ width: w,
74
+ height: h
75
+ };
76
+ }
77
+ function CropperInner({
78
+ src,
79
+ controller,
80
+ stencil: StencilComponent = import_rectangle_stencil.RectangleStencil,
81
+ showGrid = false,
82
+ isPlacementActive = false,
83
+ showDimming = true,
84
+ minZoom,
85
+ maxZoom,
86
+ aspectRatio,
87
+ freeformCrop = false,
88
+ onImageLoaded,
89
+ onStateChange,
90
+ onGestureStart,
91
+ onGestureEnd,
92
+ className
93
+ }, ref) {
94
+ const { state, setImage, setCropRect, settleCrop } = controller;
95
+ const canvasRef = (0, import_element.useRef)(null);
96
+ const [canvasSize, setCanvasSize] = (0, import_element.useState)({
97
+ width: 0,
98
+ height: 0
99
+ });
100
+ (0, import_element.useEffect)(() => {
101
+ const element = canvasRef.current;
102
+ if (!element) {
103
+ return;
104
+ }
105
+ const observer = new ResizeObserver((entries) => {
106
+ for (const entry of entries) {
107
+ const { width, height } = entry.contentRect;
108
+ setCanvasSize((prev) => {
109
+ if (prev.width === width && prev.height === height) {
110
+ return prev;
111
+ }
112
+ return { width, height };
113
+ });
114
+ }
115
+ });
116
+ observer.observe(element);
117
+ return () => {
118
+ observer.disconnect();
119
+ };
120
+ }, []);
121
+ (0, import_element.useEffect)(() => {
122
+ onStateChange?.(state);
123
+ }, [state, onStateChange]);
124
+ const ariaMessage = (0, import_use_aria_announcer.useAriaAnnouncer)(state);
125
+ const naturalWidth = state.image?.naturalWidth ?? 0;
126
+ const naturalHeight = state.image?.naturalHeight ?? 0;
127
+ const { elementSize, visualSize } = (0, import_element.useMemo)(
128
+ () => (0, import_camera.getImageFit)(
129
+ canvasSize,
130
+ { width: naturalWidth, height: naturalHeight },
131
+ state.rotation
132
+ ),
133
+ [canvasSize, naturalWidth, naturalHeight, state.rotation]
134
+ );
135
+ (0, import_element.useEffect)(() => {
136
+ if (freeformCrop || visualSize.width === 0 || visualSize.height === 0) {
137
+ return;
138
+ }
139
+ const rect = computeInscribedRect(aspectRatio, visualSize);
140
+ const current = state.cropRect;
141
+ if (Math.abs(current.x - rect.x) < CROP_RECT_EPSILON && Math.abs(current.y - rect.y) < CROP_RECT_EPSILON && Math.abs(current.width - rect.width) < CROP_RECT_EPSILON && Math.abs(current.height - rect.height) < CROP_RECT_EPSILON) {
142
+ return;
143
+ }
144
+ setCropRect(rect);
145
+ }, [freeformCrop, aspectRatio, visualSize, setCropRect, state.cropRect]);
146
+ const prevAspectRatioRef = (0, import_element.useRef)(aspectRatio);
147
+ (0, import_element.useEffect)(() => {
148
+ if (prevAspectRatioRef.current === aspectRatio) {
149
+ return;
150
+ }
151
+ prevAspectRatioRef.current = aspectRatio;
152
+ if (!freeformCrop || visualSize.width === 0 || visualSize.height === 0 || !aspectRatio || aspectRatio <= 0) {
153
+ return;
154
+ }
155
+ setCropRect(computeInscribedRect(aspectRatio, visualSize));
156
+ }, [aspectRatio, freeformCrop, visualSize, setCropRect]);
157
+ const cropBounds = (0, import_element.useMemo)(() => {
158
+ if (!state.image || elementSize.width === 0) {
159
+ return void 0;
160
+ }
161
+ return (0, import_containment.getCropBounds)(state, elementSize, visualSize, canvasSize);
162
+ }, [state, elementSize, visualSize, canvasSize]);
163
+ const {
164
+ handlers,
165
+ onWheelNative,
166
+ isDragging,
167
+ isZooming,
168
+ isPlacementActive: isInteractionPlacementActive
169
+ } = (0, import_use_interaction.useInteraction)(state, controller, canvasSize, visualSize, {
170
+ minZoom,
171
+ maxZoom,
172
+ onGestureStart,
173
+ onGestureEnd
174
+ });
175
+ (0, import_element.useEffect)(() => {
176
+ const el = canvasRef.current;
177
+ if (!el) {
178
+ return;
179
+ }
180
+ el.addEventListener("wheel", onWheelNative, {
181
+ passive: false
182
+ });
183
+ return () => {
184
+ el.removeEventListener("wheel", onWheelNative);
185
+ };
186
+ }, [onWheelNative]);
187
+ const transformString = (0, import_use_transform_style.useTransformStyle)(state, visualSize);
188
+ const handleImageLoad = (0, import_element.useCallback)(
189
+ (event) => {
190
+ const img = event.currentTarget;
191
+ const size = {
192
+ width: img.naturalWidth,
193
+ height: img.naturalHeight
194
+ };
195
+ setImage({
196
+ src,
197
+ naturalWidth: size.width,
198
+ naturalHeight: size.height
199
+ });
200
+ onImageLoaded?.(size);
201
+ },
202
+ [src, setImage, onImageLoaded]
203
+ );
204
+ const handleCropChange = (0, import_element.useCallback)(
205
+ (rect) => {
206
+ setCropRect(rect);
207
+ },
208
+ [setCropRect]
209
+ );
210
+ const [settling, setSettling] = (0, import_element.useState)(false);
211
+ const settleTimerRef = (0, import_element.useRef)();
212
+ (0, import_element.useEffect)(() => {
213
+ return () => {
214
+ clearTimeout(settleTimerRef.current);
215
+ };
216
+ }, []);
217
+ const [isResizing, setIsResizing] = (0, import_element.useState)(false);
218
+ const isInteractiveGrid = showGrid === "interactive";
219
+ const showInteractiveGrid = isInteractiveGrid && (isInteractionPlacementActive || isResizing || isPlacementActive);
220
+ const handleEscape = (0, import_element.useCallback)(() => {
221
+ canvasRef.current?.focus({ preventScroll: true });
222
+ }, []);
223
+ const handleResizeStart = (0, import_element.useCallback)(() => {
224
+ setIsResizing(true);
225
+ onGestureStart?.();
226
+ }, [onGestureStart]);
227
+ const handleResizeEnd = (0, import_element.useCallback)(() => {
228
+ setIsResizing(false);
229
+ setSettling(true);
230
+ settleCrop();
231
+ onGestureEnd?.();
232
+ clearTimeout(settleTimerRef.current);
233
+ settleTimerRef.current = setTimeout(() => {
234
+ setSettling(false);
235
+ }, 200);
236
+ }, [settleCrop, onGestureEnd]);
237
+ const imageTransition = settling || isZooming ? "transform 150ms linear" : void 0;
238
+ const settleStencilTransition = settling ? "left 150ms linear, top 150ms linear, width 150ms linear, height 150ms linear" : void 0;
239
+ const imageStyle = (0, import_element.useMemo)(() => {
240
+ if (elementSize.width === 0 || elementSize.height === 0) {
241
+ return {};
242
+ }
243
+ const centerX = (canvasSize.width - elementSize.width) / 2;
244
+ const centerY = (canvasSize.height - elementSize.height) / 2;
245
+ return {
246
+ width: elementSize.width,
247
+ height: elementSize.height,
248
+ maxWidth: elementSize.width,
249
+ maxHeight: elementSize.height,
250
+ left: centerX,
251
+ top: centerY,
252
+ transform: transformString,
253
+ transition: imageTransition
254
+ };
255
+ }, [canvasSize, elementSize, transformString, imageTransition]);
256
+ const setContainerRef = (0, import_element.useCallback)(
257
+ (element) => {
258
+ if (typeof ref === "function") {
259
+ ref(element);
260
+ } else if (ref) {
261
+ ref.current = element;
262
+ }
263
+ },
264
+ [ref]
265
+ );
266
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
267
+ "div",
268
+ {
269
+ ref: setContainerRef,
270
+ className: (0, import_clsx.default)(
271
+ "wp-media-editor-image-editor",
272
+ isDragging && "wp-media-editor-image-editor--dragging",
273
+ className
274
+ ),
275
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
276
+ "div",
277
+ {
278
+ ref: canvasRef,
279
+ className: (0, import_clsx.default)(
280
+ "wp-media-editor-image-editor__canvas",
281
+ isInteractiveGrid && "wp-media-editor-image-editor__canvas--grid-interactive",
282
+ showInteractiveGrid && "wp-media-editor-image-editor__canvas--show-grid"
283
+ ),
284
+ tabIndex: 0,
285
+ role: "group",
286
+ "aria-label": (0, import_i18n.__)("Image editor"),
287
+ ...handlers,
288
+ children: [
289
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
290
+ "img",
291
+ {
292
+ className: "wp-media-editor-image-editor__image",
293
+ src,
294
+ alt: "",
295
+ onLoad: handleImageLoad,
296
+ style: imageStyle,
297
+ draggable: false
298
+ }
299
+ ),
300
+ showDimming && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
301
+ import_dimming_overlay.DimmingOverlay,
302
+ {
303
+ cropRect: state.cropRect,
304
+ containerSize: canvasSize,
305
+ imageSize: visualSize
306
+ }
307
+ ),
308
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
309
+ StencilComponent,
310
+ {
311
+ cropRect: state.cropRect,
312
+ containerSize: canvasSize,
313
+ imageSize: visualSize,
314
+ onCropChange: handleCropChange,
315
+ onResizeStart: handleResizeStart,
316
+ onResizeEnd: handleResizeEnd,
317
+ onEscape: handleEscape,
318
+ aspectRatio,
319
+ freeformCrop,
320
+ stencilTransition: settleStencilTransition,
321
+ cropBounds
322
+ }
323
+ ),
324
+ (showGrid === true || isInteractiveGrid) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
325
+ import_grid_overlay.GridOverlay,
326
+ {
327
+ cropRect: state.cropRect,
328
+ containerSize: canvasSize,
329
+ imageSize: visualSize
330
+ }
331
+ ),
332
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
333
+ "div",
334
+ {
335
+ "aria-live": "polite",
336
+ "aria-atomic": "true",
337
+ className: "wp-media-editor-image-editor__aria-live",
338
+ style: {
339
+ position: "absolute",
340
+ width: 1,
341
+ height: 1,
342
+ padding: 0,
343
+ margin: -1,
344
+ overflow: "hidden",
345
+ clip: "rect(0, 0, 0, 0)",
346
+ whiteSpace: "nowrap",
347
+ border: 0
348
+ },
349
+ children: ariaMessage
350
+ }
351
+ )
352
+ ]
353
+ }
354
+ )
355
+ }
356
+ );
357
+ }
358
+ var Cropper = (0, import_element.forwardRef)(
359
+ CropperInner
360
+ );
361
+ // Annotate the CommonJS export names for ESM import in node:
362
+ 0 && (module.exports = {
363
+ Cropper
364
+ });
365
+ //# sourceMappingURL=cropper.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/image-editor/react/components/cropper.tsx", "../../../../src/image-editor/react/components/cropper.scss"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\n\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseCallback,\n\tuseMemo,\n\tuseRef,\n\tuseEffect,\n\tforwardRef,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tCropperState,\n\tStencilProps,\n\tSize,\n\tNormalizedRect,\n} from '../../core/types';\nimport type { UseCropperStateReturn } from '../hooks/use-cropper-state';\nimport { getImageFit } from '../../core/camera';\nimport { getCropBounds } from '../../core/containment';\nimport { useInteraction } from '../hooks/use-interaction';\nimport { useTransformStyle } from '../hooks/use-transform-style';\nimport { useAriaAnnouncer } from '../hooks/use-aria-announcer';\nimport { RectangleStencil } from './stencils/rectangle-stencil';\nimport { DimmingOverlay } from './overlays/dimming-overlay';\nimport { GridOverlay } from './overlays/grid-overlay';\nimport './cropper.scss';\n\n/** Threshold for comparing normalized crop rect values. */\nconst CROP_RECT_EPSILON = 1e-6;\n\n// Largest rect of the given pixel aspect ratio that fits inside the visual\n// bounds, centered in [0,1] \u00D7 [0,1] normalized space. Returns a full-frame\n// rect (1\u00D71) if `aspectRatio` is unset or non-positive.\nfunction computeInscribedRect(\n\taspectRatio: number | undefined,\n\tvisualSize: Size\n): NormalizedRect {\n\tlet w = 1;\n\tlet h = 1;\n\tif ( aspectRatio && aspectRatio > 0 && visualSize.width > 0 ) {\n\t\t// normalizedRatio = w/h in normalized space that produces the\n\t\t// desired pixel aspect ratio.\n\t\t// pixelW = w * visualW, pixelH = h * visualH\n\t\t// pixelW / pixelH = aspectRatio\n\t\t// => w / h = aspectRatio * visualH / visualW\n\t\tconst normalizedRatio =\n\t\t\t( aspectRatio * visualSize.height ) / visualSize.width;\n\t\tif ( normalizedRatio <= 1 ) {\n\t\t\tw = normalizedRatio;\n\t\t} else {\n\t\t\th = 1 / normalizedRatio;\n\t\t}\n\t}\n\treturn {\n\t\tx: ( 1 - w ) / 2,\n\t\ty: ( 1 - h ) / 2,\n\t\twidth: w,\n\t\theight: h,\n\t};\n}\n\n/**\n * Props for the Cropper component.\n */\nexport interface CropperProps {\n\t/** Image source URL. */\n\tsrc: string;\n\t/** The full state/setter object from `useCropperState`. */\n\tcontroller: UseCropperStateReturn;\n\t/** Stencil component for the crop area. Defaults to RectangleStencil. */\n\tstencil?: React.ComponentType< StencilProps >;\n\t/** Show the rule-of-thirds grid overlay, or only during interactions. */\n\tshowGrid?: boolean | 'interactive';\n\t/** Whether external placement activity should keep the grid visible. */\n\tisPlacementActive?: boolean;\n\t/** Show the dimming overlay outside the crop area. */\n\tshowDimming?: boolean;\n\t/** Minimum zoom level. */\n\tminZoom?: number;\n\t/** Maximum zoom level. */\n\tmaxZoom?: number;\n\t/** Fixed aspect ratio (width / height) in pixel space for the crop area. */\n\taspectRatio?: number;\n\t/**\n\t * Enable freeform crop mode with resizable handles.\n\t * When false (default), the crop area is fixed and centered.\n\t * When true, the crop area has resize handles and can be freely repositioned.\n\t */\n\tfreeformCrop?: boolean;\n\t/** Callback fired when the image is loaded. */\n\tonImageLoaded?: ( size: Size ) => void;\n\t/**\n\t * Callback fired on every state change. Fires at pointermove rate\n\t * during drags, so keep the handler light \u2014 no heavy work, no\n\t * expensive parent re-renders. For commit-style events (drag end,\n\t * settled crop), use `onGestureEnd` instead.\n\t *\n\t * Useful for lightweight syncing with external tools, analytics,\n\t * or AI agents. Receives the full state so consumers can derive\n\t * whatever they need.\n\t */\n\tonStateChange?: ( state: CropperState ) => void;\n\t/** Fires when a continuous gesture begins (pan drag, handle resize, pinch zoom). */\n\tonGestureStart?: () => void;\n\t/** Fires when a continuous gesture ends (pointerup, resize settle). */\n\tonGestureEnd?: () => void;\n\t/** Additional className for the container. */\n\tclassName?: string;\n}\n\n/**\n * The main image cropper component.\n *\n * Renders an image within a container with interactive crop overlays.\n * Creates the camera once per render via getImageFit, then passes\n * derived values to stencil, overlays, and interaction hooks.\n *\n * The component fills its parent container (100% width and height).\n * Wrap it in a sized container to control its dimensions.\n *\n * @param root0 Component props implementing CropperProps.\n * @param root0.src Image source URL.\n * @param root0.controller The full state/setter object from `useCropperState`.\n * @param root0.stencil Custom stencil component.\n * @param root0.showGrid Grid overlay mode: false | true | 'interactive'.\n * @param root0.isPlacementActive Keep grid visible during external placement activity.\n * @param root0.showDimming Show dimming overlay outside crop.\n * @param root0.minZoom Minimum zoom level.\n * @param root0.maxZoom Maximum zoom level.\n * @param root0.aspectRatio Fixed aspect ratio (width/height).\n * @param root0.freeformCrop Enable resize handles.\n * @param root0.onImageLoaded Image load callback.\n * @param root0.onStateChange Every-frame state callback.\n * @param root0.onGestureStart Gesture boundary start.\n * @param root0.onGestureEnd Gesture boundary end.\n * @param root0.className Additional CSS class.\n * @param ref Forwarded ref for the container div.\n */\nfunction CropperInner(\n\t{\n\t\tsrc,\n\t\tcontroller,\n\t\tstencil: StencilComponent = RectangleStencil,\n\t\tshowGrid = false,\n\t\tisPlacementActive = false,\n\t\tshowDimming = true,\n\t\tminZoom,\n\t\tmaxZoom,\n\t\taspectRatio,\n\t\tfreeformCrop = false,\n\t\tonImageLoaded,\n\t\tonStateChange,\n\t\tonGestureStart,\n\t\tonGestureEnd,\n\t\tclassName,\n\t}: CropperProps,\n\tref: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst { state, setImage, setCropRect, settleCrop } = controller;\n\t// Canvas measurement via ResizeObserver. The canvas is the inner\n\t// positioning context for image/stencil/handles \u2014 inset from the root\n\t// by the handle gutter, so crop math operates on the reduced box.\n\tconst canvasRef = useRef< HTMLDivElement >( null );\n\tconst [ canvasSize, setCanvasSize ] = useState< Size >( {\n\t\twidth: 0,\n\t\theight: 0,\n\t} );\n\n\tuseEffect( () => {\n\t\tconst element = canvasRef.current;\n\t\tif ( ! element ) {\n\t\t\treturn;\n\t\t}\n\t\tconst observer = new ResizeObserver( ( entries ) => {\n\t\t\tfor ( const entry of entries ) {\n\t\t\t\tconst { width, height } = entry.contentRect;\n\t\t\t\tsetCanvasSize( ( prev ) => {\n\t\t\t\t\tif ( prev.width === width && prev.height === height ) {\n\t\t\t\t\t\treturn prev;\n\t\t\t\t\t}\n\t\t\t\t\treturn { width, height };\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t\tobserver.observe( element );\n\t\treturn () => {\n\t\t\tobserver.disconnect();\n\t\t};\n\t}, [] );\n\n\t// Notify consumer of state changes.\n\tuseEffect( () => {\n\t\tonStateChange?.( state );\n\t}, [ state, onStateChange ] );\n\n\t// ARIA live region: announce significant state changes for screen readers.\n\tconst ariaMessage = useAriaAnnouncer( state );\n\n\t// Compute fitted image dimensions and visual bounds from camera math.\n\tconst naturalWidth = state.image?.naturalWidth ?? 0;\n\tconst naturalHeight = state.image?.naturalHeight ?? 0;\n\tconst { elementSize, visualSize } = useMemo(\n\t\t() =>\n\t\t\tgetImageFit(\n\t\t\t\tcanvasSize,\n\t\t\t\t{ width: naturalWidth, height: naturalHeight },\n\t\t\t\tstate.rotation\n\t\t\t),\n\t\t[ canvasSize, naturalWidth, naturalHeight, state.rotation ]\n\t);\n\n\t// In fixed-crop mode, auto-size the crop rect to fill the visual area\n\t// while respecting the aspect ratio. The crop is always centered.\n\tuseEffect( () => {\n\t\tif (\n\t\t\tfreeformCrop ||\n\t\t\tvisualSize.width === 0 ||\n\t\t\tvisualSize.height === 0\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst rect = computeInscribedRect( aspectRatio, visualSize );\n\t\tconst current = state.cropRect;\n\t\tif (\n\t\t\tMath.abs( current.x - rect.x ) < CROP_RECT_EPSILON &&\n\t\t\tMath.abs( current.y - rect.y ) < CROP_RECT_EPSILON &&\n\t\t\tMath.abs( current.width - rect.width ) < CROP_RECT_EPSILON &&\n\t\t\tMath.abs( current.height - rect.height ) < CROP_RECT_EPSILON\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tsetCropRect( rect );\n\t}, [ freeformCrop, aspectRatio, visualSize, setCropRect, state.cropRect ] );\n\n\t// In freeform mode, when aspectRatio changes, reshape the crop to the\n\t// largest inscribed rect of the new ratio.\n\tconst prevAspectRatioRef = useRef( aspectRatio );\n\tuseEffect( () => {\n\t\tif ( prevAspectRatioRef.current === aspectRatio ) {\n\t\t\treturn;\n\t\t}\n\t\tprevAspectRatioRef.current = aspectRatio;\n\n\t\tif (\n\t\t\t! freeformCrop ||\n\t\t\tvisualSize.width === 0 ||\n\t\t\tvisualSize.height === 0 ||\n\t\t\t! aspectRatio ||\n\t\t\taspectRatio <= 0\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tsetCropRect( computeInscribedRect( aspectRatio, visualSize ) );\n\t}, [ aspectRatio, freeformCrop, visualSize, setCropRect ] );\n\n\t// Compute the crop handle bounds from the actual image footprint.\n\t// Depends on the full state object because getCropBounds reads\n\t// crop, zoom, rotation, flip, and image. React Compiler requires\n\t// the complete dependency; the computation is lightweight (a few\n\t// trig ops + 4 corner transforms).\n\tconst cropBounds = useMemo( () => {\n\t\tif ( ! state.image || elementSize.width === 0 ) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn getCropBounds( state, elementSize, visualSize, canvasSize );\n\t}, [ state, elementSize, visualSize, canvasSize ] );\n\n\t// Use the interaction hook for mouse, touch, and keyboard events.\n\tconst {\n\t\thandlers,\n\t\tonWheelNative,\n\t\tisDragging,\n\t\tisZooming,\n\t\tisPlacementActive: isInteractionPlacementActive,\n\t} = useInteraction( state, controller, canvasSize, visualSize, {\n\t\tminZoom,\n\t\tmaxZoom,\n\t\tonGestureStart,\n\t\tonGestureEnd,\n\t} );\n\n\t// Register wheel handler natively with { passive: false } so\n\t// preventDefault works. React's onWheel registers as passive. Bound\n\t// to the canvas (not the root) so pointer geometry inside the handler\n\t// resolves against the canvas box.\n\tuseEffect( () => {\n\t\tconst el = canvasRef.current;\n\t\tif ( ! el ) {\n\t\t\treturn;\n\t\t}\n\t\tel.addEventListener( 'wheel', onWheelNative, {\n\t\t\tpassive: false,\n\t\t} );\n\t\treturn () => {\n\t\t\tel.removeEventListener( 'wheel', onWheelNative );\n\t\t};\n\t}, [ onWheelNative ] );\n\n\t// Use the transform style hook for the image CSS transform.\n\tconst transformString = useTransformStyle( state, visualSize );\n\n\t/**\n\t * Handle the image load event.\n\t */\n\tconst handleImageLoad = useCallback(\n\t\t( event: React.SyntheticEvent< HTMLImageElement > ) => {\n\t\t\tconst img = event.currentTarget;\n\t\t\tconst size: Size = {\n\t\t\t\twidth: img.naturalWidth,\n\t\t\t\theight: img.naturalHeight,\n\t\t\t};\n\n\t\t\tsetImage( {\n\t\t\t\tsrc,\n\t\t\t\tnaturalWidth: size.width,\n\t\t\t\tnaturalHeight: size.height,\n\t\t\t} );\n\n\t\t\tonImageLoaded?.( size );\n\t\t},\n\t\t[ src, setImage, onImageLoaded ]\n\t);\n\n\t/**\n\t * Handle crop rect changes from the stencil (during drag).\n\t */\n\tconst handleCropChange = useCallback(\n\t\t( rect: NormalizedRect ) => {\n\t\t\tsetCropRect( rect );\n\t\t},\n\t\t[ setCropRect ]\n\t);\n\n\t// Settling animation: brief linear transition after resize end.\n\tconst [ settling, setSettling ] = useState( false );\n\tconst settleTimerRef = useRef< ReturnType< typeof setTimeout > >();\n\n\t// Clear the pending settle timer on unmount so it can't fire a\n\t// state update on an unmounted component.\n\tuseEffect( () => {\n\t\treturn () => {\n\t\t\tclearTimeout( settleTimerRef.current );\n\t\t};\n\t}, [] );\n\n\tconst [ isResizing, setIsResizing ] = useState( false );\n\tconst isInteractiveGrid = showGrid === 'interactive';\n\tconst showInteractiveGrid =\n\t\tisInteractiveGrid &&\n\t\t( isInteractionPlacementActive || isResizing || isPlacementActive );\n\n\t/**\n\t * Handle Escape on a resize handle \u2014 return focus to the canvas so\n\t * arrow keys pan the image rather than resize.\n\t */\n\tconst handleEscape = useCallback( () => {\n\t\tcanvasRef.current?.focus( { preventScroll: true } );\n\t}, [] );\n\n\tconst handleResizeStart = useCallback( () => {\n\t\tsetIsResizing( true );\n\t\tonGestureStart?.();\n\t}, [ onGestureStart ] );\n\n\t/**\n\t * Handle resize end \u2014 settle the crop rect (re-center, fill height).\n\t */\n\tconst handleResizeEnd = useCallback( () => {\n\t\tsetIsResizing( false );\n\t\tsetSettling( true );\n\t\tsettleCrop();\n\t\tonGestureEnd?.();\n\t\tclearTimeout( settleTimerRef.current );\n\t\tsettleTimerRef.current = setTimeout( () => {\n\t\t\tsetSettling( false );\n\t\t}, 200 );\n\t}, [ settleCrop, onGestureEnd ] );\n\n\tconst imageTransition =\n\t\tsettling || isZooming ? 'transform 150ms linear' : undefined;\n\tconst settleStencilTransition = settling\n\t\t? 'left 150ms linear, top 150ms linear, width 150ms linear, height 150ms linear'\n\t\t: undefined;\n\n\t// Compute the image's CSS style.\n\tconst imageStyle = useMemo( (): React.CSSProperties => {\n\t\tif ( elementSize.width === 0 || elementSize.height === 0 ) {\n\t\t\treturn {};\n\t\t}\n\t\tconst centerX = ( canvasSize.width - elementSize.width ) / 2;\n\t\tconst centerY = ( canvasSize.height - elementSize.height ) / 2;\n\t\treturn {\n\t\t\twidth: elementSize.width,\n\t\t\theight: elementSize.height,\n\t\t\tmaxWidth: elementSize.width,\n\t\t\tmaxHeight: elementSize.height,\n\t\t\tleft: centerX,\n\t\t\ttop: centerY,\n\t\t\ttransform: transformString,\n\t\t\ttransition: imageTransition,\n\t\t};\n\t}, [ canvasSize, elementSize, transformString, imageTransition ] );\n\n\t// Forward the root element to the consumer's ref.\n\tconst setContainerRef = useCallback(\n\t\t( element: HTMLDivElement | null ) => {\n\t\t\tif ( typeof ref === 'function' ) {\n\t\t\t\tref( element );\n\t\t\t} else if ( ref ) {\n\t\t\t\t(\n\t\t\t\t\tref as React.MutableRefObject< HTMLDivElement | null >\n\t\t\t\t ).current = element;\n\t\t\t}\n\t\t},\n\t\t[ ref ]\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tref={ setContainerRef }\n\t\t\tclassName={ clsx(\n\t\t\t\t'wp-media-editor-image-editor',\n\t\t\t\tisDragging && 'wp-media-editor-image-editor--dragging',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t{ /*\n\t\t\t * The canvas is the interactive, inset surface. Handles and\n\t\t\t * the ARIA role/tabIndex live here so pointer geometry\n\t\t\t * (getBoundingClientRect on e.currentTarget) resolves against\n\t\t\t * the same box that crop math uses. The root stays as the\n\t\t\t * clipping shell for the dimming overlay's box-shadow.\n\t\t\t *\n\t\t\t * Not role=\"application\" \u2014 that disables the screen reader's\n\t\t\t * normal keyboard interception, too heavy-handed for a single\n\t\t\t * widget. Screen reader users get the ARIA live region below\n\t\t\t * as the announcement channel.\n\t\t\t */ }\n\t\t\t<div\n\t\t\t\tref={ canvasRef }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'wp-media-editor-image-editor__canvas',\n\t\t\t\t\tisInteractiveGrid &&\n\t\t\t\t\t\t'wp-media-editor-image-editor__canvas--grid-interactive',\n\t\t\t\t\tshowInteractiveGrid &&\n\t\t\t\t\t\t'wp-media-editor-image-editor__canvas--show-grid'\n\t\t\t\t) }\n\t\t\t\ttabIndex={ 0 }\n\t\t\t\trole=\"group\"\n\t\t\t\taria-label={ __( 'Image editor' ) }\n\t\t\t\t{ ...handlers }\n\t\t\t>\n\t\t\t\t{ /* The image layer */ }\n\t\t\t\t<img\n\t\t\t\t\tclassName=\"wp-media-editor-image-editor__image\"\n\t\t\t\t\tsrc={ src }\n\t\t\t\t\talt=\"\"\n\t\t\t\t\tonLoad={ handleImageLoad }\n\t\t\t\t\tstyle={ imageStyle }\n\t\t\t\t\tdraggable={ false }\n\t\t\t\t/>\n\n\t\t\t\t{ /* Dimming overlay outside the crop area */ }\n\t\t\t\t{ showDimming && (\n\t\t\t\t\t<DimmingOverlay\n\t\t\t\t\t\tcropRect={ state.cropRect }\n\t\t\t\t\t\tcontainerSize={ canvasSize }\n\t\t\t\t\t\timageSize={ visualSize }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ /* The stencil (crop area with handles) */ }\n\t\t\t\t<StencilComponent\n\t\t\t\t\tcropRect={ state.cropRect }\n\t\t\t\t\tcontainerSize={ canvasSize }\n\t\t\t\t\timageSize={ visualSize }\n\t\t\t\t\tonCropChange={ handleCropChange }\n\t\t\t\t\tonResizeStart={ handleResizeStart }\n\t\t\t\t\tonResizeEnd={ handleResizeEnd }\n\t\t\t\t\tonEscape={ handleEscape }\n\t\t\t\t\taspectRatio={ aspectRatio }\n\t\t\t\t\tfreeformCrop={ freeformCrop }\n\t\t\t\t\tstencilTransition={ settleStencilTransition }\n\t\t\t\t\tcropBounds={ cropBounds }\n\t\t\t\t/>\n\n\t\t\t\t{ /* Rule-of-thirds grid */ }\n\t\t\t\t{ ( showGrid === true || isInteractiveGrid ) && (\n\t\t\t\t\t<GridOverlay\n\t\t\t\t\t\tcropRect={ state.cropRect }\n\t\t\t\t\t\tcontainerSize={ canvasSize }\n\t\t\t\t\t\timageSize={ visualSize }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\n\t\t\t\t{ /* ARIA live region for screen reader announcements */ }\n\t\t\t\t<div\n\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\taria-atomic=\"true\"\n\t\t\t\t\tclassName=\"wp-media-editor-image-editor__aria-live\"\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\theight: 1,\n\t\t\t\t\t\tpadding: 0,\n\t\t\t\t\t\tmargin: -1,\n\t\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\t\tclip: 'rect(0, 0, 0, 0)',\n\t\t\t\t\t\twhiteSpace: 'nowrap',\n\t\t\t\t\t\tborder: 0,\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ ariaMessage }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport const Cropper = forwardRef< HTMLDivElement, CropperProps >(\n\tCropperInner\n);\n", "if (typeof document !== 'undefined' && process.env.NODE_ENV !== 'test' && !document.head.querySelector(\"style[data-wp-hash='d3d6b4ac29']\")) {\n\tconst style = document.createElement(\"style\");\n\tstyle.setAttribute(\"data-wp-hash\", \"d3d6b4ac29\");\n\tstyle.appendChild(document.createTextNode(\".wp-media-editor-image-editor{cursor:grab;height:100%;overflow:hidden;position:relative;touch-action:none;user-select:none;width:100%}.wp-media-editor-image-editor__canvas{inset:22px;position:absolute}.wp-media-editor-image-editor--dragging{cursor:grabbing}.wp-media-editor-image-editor__image{left:0;position:absolute;top:0;transform-origin:center center;will-change:transform}.wp-media-editor-image-editor__stencil{pointer-events:none;position:absolute}.wp-media-editor-image-editor__dimming{box-shadow:0 0 0 9999px #000000b3;pointer-events:none;position:absolute;transition:box-shadow .15s ease}.wp-media-editor-image-editor--dragging .wp-media-editor-image-editor__dimming{box-shadow:0 0 0 9999px #00000080}.wp-media-editor-image-editor__grid{overflow:hidden;pointer-events:none;position:absolute;transition:opacity .15s ease}.wp-media-editor-image-editor__canvas--grid-interactive .wp-media-editor-image-editor__grid{opacity:0;transition-delay:.1s}.wp-media-editor-image-editor__canvas--show-grid .wp-media-editor-image-editor__grid{opacity:1;transition-delay:0s}.wp-media-editor-image-editor__grid-line{background:#fff6;position:absolute}.wp-media-editor-image-editor__grid-line--horizontal{height:1px;left:0;width:100%}.wp-media-editor-image-editor__grid-line--vertical{height:100%;top:0;width:1px}.wp-media-editor-image-editor__stencil-rect{border:1px solid #ffffffb3;box-sizing:border-box;pointer-events:none;position:absolute}.wp-media-editor-image-editor__handle{appearance:none;background:#fff9;border:1px solid #ffffffe6;border-radius:50%;box-sizing:border-box;cursor:default;font:inherit;height:12px;margin:0;padding:0;pointer-events:auto;position:absolute;transition:background-color .15s ease,box-shadow .15s ease;width:12px}.wp-media-editor-image-editor__handle:focus{outline:none}.wp-media-editor-image-editor__handle:focus-visible{background:var(--wp-image-editor-focus-color,var(--wp-admin-theme-color,#007cba));border-color:#0000;box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-image-editor-focus-color,var(--wp-admin-theme-color,#007cba))}.wp-media-editor-image-editor__handle:before{content:\\\"\\\";height:44px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:44px}.wp-media-editor-image-editor__handle--n{cursor:ns-resize;left:50%;margin-left:-6px;top:-6px}.wp-media-editor-image-editor__handle--s{bottom:-6px;cursor:ns-resize;left:50%;margin-left:-6px}.wp-media-editor-image-editor__handle--e{cursor:ew-resize;margin-top:-6px;right:-6px;top:50%}.wp-media-editor-image-editor__handle--w{cursor:ew-resize;left:-6px;margin-top:-6px;top:50%}.wp-media-editor-image-editor__handle--nw{cursor:nwse-resize;left:-6px;top:-6px}.wp-media-editor-image-editor__handle--ne{cursor:nesw-resize;right:-6px;top:-6px}.wp-media-editor-image-editor__handle--sw{bottom:-6px;cursor:nesw-resize;left:-6px}.wp-media-editor-image-editor__handle--se{bottom:-6px;cursor:nwse-resize;right:-6px}\"));\n\tdocument.head.appendChild(style);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAAiB;AAKjB,qBAOO;AACP,kBAAmB;AAYnB,oBAA4B;AAC5B,yBAA8B;AAC9B,6BAA+B;AAC/B,iCAAkC;AAClC,gCAAiC;AACjC,+BAAiC;AACjC,6BAA+B;AAC/B,0BAA4B;;;ACpC5B,IAAI,OAAO,aAAa,eAAe,QAAQ,IAAI,aAAa,UAAU,CAAC,SAAS,KAAK,cAAc,kCAAkC,GAAG;AAC3I,QAAM,QAAQ,SAAS,cAAc,OAAO;AAC5C,QAAM,aAAa,gBAAgB,YAAY;AAC/C,QAAM,YAAY,SAAS,eAAe,21FAA61F,CAAC;AACx4F,WAAS,KAAK,YAAY,KAAK;AAChC;;;AD6bG;AA1ZH,IAAM,oBAAoB;AAK1B,SAAS,qBACR,aACA,YACiB;AACjB,MAAI,IAAI;AACR,MAAI,IAAI;AACR,MAAK,eAAe,cAAc,KAAK,WAAW,QAAQ,GAAI;AAM7D,UAAM,kBACH,cAAc,WAAW,SAAW,WAAW;AAClD,QAAK,mBAAmB,GAAI;AAC3B,UAAI;AAAA,IACL,OAAO;AACN,UAAI,IAAI;AAAA,IACT;AAAA,EACD;AACA,SAAO;AAAA,IACN,IAAK,IAAI,KAAM;AAAA,IACf,IAAK,IAAI,KAAM;AAAA,IACf,OAAO;AAAA,IACP,QAAQ;AAAA,EACT;AACD;AA+EA,SAAS,a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AAI,cAAe;AAAA,UAC9B,GAAG;AAAA,UAGL;AAAA;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV;AAAA,gBACA,KAAI;AAAA,gBACJ,QAAS;AAAA,gBACT,OAAQ;AAAA,gBACR,WAAY;AAAA;AAAA,YACb;AAAA,YAGE,eACD;AAAA,cAAC;AAAA;AAAA,gBACA,UAAW,MAAM;AAAA,gBACjB,eAAgB;AAAA,gBAChB,WAAY;AAAA;AAAA,YACb;AAAA,YAID;AAAA,cAAC;AAAA;AAAA,gBACA,UAAW,MAAM;AAAA,gBACjB,eAAgB;AAAA,gBAChB,WAAY;AAAA,gBACZ,cAAe;AAAA,gBACf,eAAgB;AAAA,gBAChB,aAAc;AAAA,gBACd,UAAW;AAAA,gBACX;AAAA,gBACA;AAAA,gBACA,mBAAoB;AAAA,gBACpB;AAAA;AAAA,YACD;AAAA,aAGI,aAAa,QAAQ,sBACxB;AAAA,cAAC;AAAA;AAAA,gBACA,UAAW,MAAM;AAAA,gBACjB,eAAgB;AAAA,gBAChB,WAAY;AAAA;AAAA,YACb;AAAA,YAID;AAAA,cAAC;AAAA;AAAA,gBACA,aAAU;AAAA,gBACV,eAAY;AAAA,gBACZ,WAAU;AAAA,gBACV,OAAQ;AAAA,kBACP,UAAU;AAAA,kBACV,OAAO;AAAA,kBACP,QAAQ;AAAA,kBACR,SAAS;AAAA,kBACT,QAAQ;AAAA,kBACR,UAAU;AAAA,kBACV,MAAM;AAAA,kBACN,YAAY;AAAA,kBACZ,QAAQ;AAAA,gBACT;AAAA,gBAEE;AAAA;AAAA,YACH;AAAA;AAAA;AAAA,MACD;AAAA;AAAA,EACD;AAEF;AAEO,IAAM,cAAU;AAAA,EACtB;AACD;",
6
+ "names": ["clsx"]
7
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/media-editor/src/image-editor/react/components/index.ts
21
+ var components_exports = {};
22
+ __export(components_exports, {
23
+ Cropper: () => import_cropper.Cropper,
24
+ CropperProvider: () => import_cropper_provider.CropperProvider,
25
+ useCropper: () => import_cropper_provider.useCropper
26
+ });
27
+ module.exports = __toCommonJS(components_exports);
28
+ var import_cropper = require("./cropper.cjs");
29
+ var import_cropper_provider = require("./cropper-provider.cjs");
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ Cropper,
33
+ CropperProvider,
34
+ useCropper
35
+ });
36
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/image-editor/react/components/index.ts"],
4
+ "sourcesContent": ["export { Cropper } from './cropper';\nexport type { CropperProps } from './cropper';\nexport { CropperProvider, useCropper } from './cropper-provider';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAwB;AAExB,8BAA4C;",
6
+ "names": []
7
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/media-editor/src/image-editor/react/components/overlays/dimming-overlay.tsx
21
+ var dimming_overlay_exports = {};
22
+ __export(dimming_overlay_exports, {
23
+ DimmingOverlay: () => DimmingOverlay
24
+ });
25
+ module.exports = __toCommonJS(dimming_overlay_exports);
26
+ var import_jsx_runtime = require("react/jsx-runtime");
27
+ function DimmingOverlay({
28
+ cropRect,
29
+ containerSize,
30
+ imageSize
31
+ }) {
32
+ if (containerSize.width === 0 || containerSize.height === 0) {
33
+ return null;
34
+ }
35
+ const offsetX = (containerSize.width - imageSize.width) / 2;
36
+ const offsetY = (containerSize.height - imageSize.height) / 2;
37
+ const left = offsetX + cropRect.x * imageSize.width;
38
+ const top = offsetY + cropRect.y * imageSize.height;
39
+ const width = cropRect.width * imageSize.width;
40
+ const height = cropRect.height * imageSize.height;
41
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
42
+ "div",
43
+ {
44
+ className: "wp-media-editor-image-editor__dimming",
45
+ style: {
46
+ left,
47
+ top,
48
+ width,
49
+ height
50
+ }
51
+ }
52
+ );
53
+ }
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ DimmingOverlay
57
+ });
58
+ //# sourceMappingURL=dimming-overlay.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/image-editor/react/components/overlays/dimming-overlay.tsx"],
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { NormalizedRect, Size } from '../../../core/types';\n\n/**\n * Props for the DimmingOverlay component.\n */\ninterface DimmingOverlayProps {\n\t/** The crop rectangle in normalized coordinates. */\n\tcropRect: NormalizedRect;\n\t/** The container element dimensions in pixels. */\n\tcontainerSize: Size;\n\t/** The rendered image dimensions in pixels within the container. */\n\timageSize: Size;\n}\n\n/**\n * Renders a semi-transparent overlay outside the crop rectangle.\n *\n * Uses the box-shadow approach: a div matching the crop rect position\n * with a large box-shadow that dims everything outside it.\n *\n * @param props Component props.\n * @param props.cropRect The crop rectangle in normalized coordinates.\n * @param props.containerSize The container element dimensions in pixels.\n * @param props.imageSize The rendered image dimensions in pixels.\n * @return The dimming overlay element.\n */\nexport function DimmingOverlay( {\n\tcropRect,\n\tcontainerSize,\n\timageSize,\n}: DimmingOverlayProps ) {\n\tif ( containerSize.width === 0 || containerSize.height === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst offsetX = ( containerSize.width - imageSize.width ) / 2;\n\tconst offsetY = ( containerSize.height - imageSize.height ) / 2;\n\tconst left = offsetX + cropRect.x * imageSize.width;\n\tconst top = offsetY + cropRect.y * imageSize.height;\n\tconst width = cropRect.width * imageSize.width;\n\tconst height = cropRect.height * imageSize.height;\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"wp-media-editor-image-editor__dimming\"\n\t\t\tstyle={ {\n\t\t\t\tleft,\n\t\t\t\ttop,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8CE;AAjBK,SAAS,eAAgB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AACD,GAAyB;AACxB,MAAK,cAAc,UAAU,KAAK,cAAc,WAAW,GAAI;AAC9D,WAAO;AAAA,EACR;AAEA,QAAM,WAAY,cAAc,QAAQ,UAAU,SAAU;AAC5D,QAAM,WAAY,cAAc,SAAS,UAAU,UAAW;AAC9D,QAAM,OAAO,UAAU,SAAS,IAAI,UAAU;AAC9C,QAAM,MAAM,UAAU,SAAS,IAAI,UAAU;AAC7C,QAAM,QAAQ,SAAS,QAAQ,UAAU;AACzC,QAAM,SAAS,SAAS,SAAS,UAAU;AAE3C,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,OAAQ;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA;AAAA,EACD;AAEF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/media-editor/src/image-editor/react/components/overlays/grid-overlay.tsx
21
+ var grid_overlay_exports = {};
22
+ __export(grid_overlay_exports, {
23
+ GridOverlay: () => GridOverlay
24
+ });
25
+ module.exports = __toCommonJS(grid_overlay_exports);
26
+ var import_jsx_runtime = require("react/jsx-runtime");
27
+ function GridOverlay({
28
+ cropRect,
29
+ containerSize,
30
+ imageSize
31
+ }) {
32
+ if (containerSize.width === 0 || containerSize.height === 0) {
33
+ return null;
34
+ }
35
+ const offsetX = (containerSize.width - imageSize.width) / 2;
36
+ const offsetY = (containerSize.height - imageSize.height) / 2;
37
+ const left = offsetX + cropRect.x * imageSize.width;
38
+ const top = offsetY + cropRect.y * imageSize.height;
39
+ const width = cropRect.width * imageSize.width;
40
+ const height = cropRect.height * imageSize.height;
41
+ const thirdW = width / 3;
42
+ const thirdH = height / 3;
43
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
44
+ "div",
45
+ {
46
+ className: "wp-media-editor-image-editor__grid",
47
+ "data-testid": "cropper-grid",
48
+ style: {
49
+ left,
50
+ top,
51
+ width,
52
+ height
53
+ },
54
+ children: [
55
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
56
+ "div",
57
+ {
58
+ className: "wp-media-editor-image-editor__grid-line wp-media-editor-image-editor__grid-line--horizontal",
59
+ style: { top: thirdH }
60
+ }
61
+ ),
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
+ "div",
64
+ {
65
+ className: "wp-media-editor-image-editor__grid-line wp-media-editor-image-editor__grid-line--horizontal",
66
+ style: { top: thirdH * 2 }
67
+ }
68
+ ),
69
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
70
+ "div",
71
+ {
72
+ className: "wp-media-editor-image-editor__grid-line wp-media-editor-image-editor__grid-line--vertical",
73
+ style: { left: thirdW }
74
+ }
75
+ ),
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
77
+ "div",
78
+ {
79
+ className: "wp-media-editor-image-editor__grid-line wp-media-editor-image-editor__grid-line--vertical",
80
+ style: { left: thirdW * 2 }
81
+ }
82
+ )
83
+ ]
84
+ }
85
+ );
86
+ }
87
+ // Annotate the CommonJS export names for ESM import in node:
88
+ 0 && (module.exports = {
89
+ GridOverlay
90
+ });
91
+ //# sourceMappingURL=grid-overlay.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/image-editor/react/components/overlays/grid-overlay.tsx"],
4
+ "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { NormalizedRect, Size } from '../../../core/types';\n\n/**\n * Props for the GridOverlay component.\n */\ninterface GridOverlayProps {\n\t/** The crop rectangle in normalized coordinates. */\n\tcropRect: NormalizedRect;\n\t/** The container element dimensions in pixels. */\n\tcontainerSize: Size;\n\t/** The rendered image dimensions in pixels within the container. */\n\timageSize: Size;\n}\n\n/**\n * Renders a rule-of-thirds grid inside the crop rectangle.\n *\n * Displays 2 horizontal and 2 vertical lines at 1/3 and 2/3\n * positions within the crop area.\n *\n * @param props Component props.\n * @param props.cropRect The crop rectangle in normalized coordinates.\n * @param props.containerSize The container element dimensions in pixels.\n * @param props.imageSize The rendered image dimensions in pixels.\n * @return The grid overlay element.\n */\nexport function GridOverlay( {\n\tcropRect,\n\tcontainerSize,\n\timageSize,\n}: GridOverlayProps ) {\n\tif ( containerSize.width === 0 || containerSize.height === 0 ) {\n\t\treturn null;\n\t}\n\n\tconst offsetX = ( containerSize.width - imageSize.width ) / 2;\n\tconst offsetY = ( containerSize.height - imageSize.height ) / 2;\n\tconst left = offsetX + cropRect.x * imageSize.width;\n\tconst top = offsetY + cropRect.y * imageSize.height;\n\tconst width = cropRect.width * imageSize.width;\n\tconst height = cropRect.height * imageSize.height;\n\n\tconst thirdW = width / 3;\n\tconst thirdH = height / 3;\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"wp-media-editor-image-editor__grid\"\n\t\t\tdata-testid=\"cropper-grid\"\n\t\t\tstyle={ {\n\t\t\t\tleft,\n\t\t\t\ttop,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t} }\n\t\t>\n\t\t\t{ /* Horizontal lines at 1/3 and 2/3 */ }\n\t\t\t<div\n\t\t\t\tclassName=\"wp-media-editor-image-editor__grid-line wp-media-editor-image-editor__grid-line--horizontal\"\n\t\t\t\tstyle={ { top: thirdH } }\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tclassName=\"wp-media-editor-image-editor__grid-line wp-media-editor-image-editor__grid-line--horizontal\"\n\t\t\t\tstyle={ { top: thirdH * 2 } }\n\t\t\t/>\n\t\t\t{ /* Vertical lines at 1/3 and 2/3 */ }\n\t\t\t<div\n\t\t\t\tclassName=\"wp-media-editor-image-editor__grid-line wp-media-editor-image-editor__grid-line--vertical\"\n\t\t\t\tstyle={ { left: thirdW } }\n\t\t\t/>\n\t\t\t<div\n\t\t\t\tclassName=\"wp-media-editor-image-editor__grid-line wp-media-editor-image-editor__grid-line--vertical\"\n\t\t\t\tstyle={ { left: thirdW * 2 } }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiDE;AApBK,SAAS,YAAa;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AACD,GAAsB;AACrB,MAAK,cAAc,UAAU,KAAK,cAAc,WAAW,GAAI;AAC9D,WAAO;AAAA,EACR;AAEA,QAAM,WAAY,cAAc,QAAQ,UAAU,SAAU;AAC5D,QAAM,WAAY,cAAc,SAAS,UAAU,UAAW;AAC9D,QAAM,OAAO,UAAU,SAAS,IAAI,UAAU;AAC9C,QAAM,MAAM,UAAU,SAAS,IAAI,UAAU;AAC7C,QAAM,QAAQ,SAAS,QAAQ,UAAU;AACzC,QAAM,SAAS,SAAS,SAAS,UAAU;AAE3C,QAAM,SAAS,QAAQ;AACvB,QAAM,SAAS,SAAS;AAExB,SACC;AAAA,IAAC;AAAA;AAAA,MACA,WAAU;AAAA,MACV,eAAY;AAAA,MACZ,OAAQ;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,MAGA;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;AAAA,YACV,OAAQ,EAAE,KAAK,OAAO;AAAA;AAAA,QACvB;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;AAAA,YACV,OAAQ,EAAE,KAAK,SAAS,EAAE;AAAA;AAAA,QAC3B;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;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