@wordpress/media-editor 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (391) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/build/components/media-editor/index.cjs +229 -126
  3. package/build/components/media-editor/index.cjs.map +1 -1
  4. package/build/components/media-editor/use-crop-options.cjs +4 -5
  5. package/build/components/media-editor/use-crop-options.cjs.map +1 -1
  6. package/build/components/media-editor/use-save-media-editor.cjs +41 -11
  7. package/build/components/media-editor/use-save-media-editor.cjs.map +1 -1
  8. package/build/components/media-editor-canvas/index.cjs +15 -18
  9. package/build/components/media-editor-canvas/index.cjs.map +1 -1
  10. package/build/components/media-editor-crop-panel/index.cjs +26 -8
  11. package/build/components/media-editor-crop-panel/index.cjs.map +1 -1
  12. package/build/components/media-editor-fine-rotation/index.cjs +13 -12
  13. package/build/components/media-editor-fine-rotation/index.cjs.map +1 -1
  14. package/build/components/media-editor-image-controls/index.cjs +4 -6
  15. package/build/components/media-editor-image-controls/index.cjs.map +1 -1
  16. package/build/components/media-editor-keyboard-shortcuts-modal/index.cjs +33 -33
  17. package/build/components/media-editor-keyboard-shortcuts-modal/index.cjs.map +1 -1
  18. package/build/components/media-editor-modal/index.cjs +10 -7
  19. package/build/components/media-editor-modal/index.cjs.map +1 -1
  20. package/build/components/media-editor-panel/error-boundary.cjs +68 -0
  21. package/build/components/media-editor-panel/error-boundary.cjs.map +1 -0
  22. package/build/components/media-editor-panel/index.cjs +158 -0
  23. package/build/components/media-editor-panel/index.cjs.map +1 -0
  24. package/build/components/media-form/index.cjs +7 -1
  25. package/build/components/media-form/index.cjs.map +1 -1
  26. package/build/components/media-preview/index.cjs +143 -37
  27. package/build/components/media-preview/index.cjs.map +1 -1
  28. package/build/components/rotation-ruler/index.cjs +9 -7
  29. package/build/components/rotation-ruler/index.cjs.map +1 -1
  30. package/build/components/rotation-ruler/use-ruler-drag.cjs.map +1 -1
  31. package/build/hooks/use-crop-gesture-handlers.cjs.map +1 -1
  32. package/build/index.cjs +10 -8
  33. package/build/private-apis.cjs.map +1 -1
  34. package/build/state/aspect-ratio-presets.cjs +12 -6
  35. package/build/state/aspect-ratio-presets.cjs.map +1 -1
  36. package/build/state/composite-reducer.cjs +41 -74
  37. package/build/state/composite-reducer.cjs.map +1 -1
  38. package/build/state/index.cjs +0 -39
  39. package/build/state/types.cjs +1 -2
  40. package/build/state/types.cjs.map +1 -1
  41. package/build/state/use-media-editor-state.cjs +70 -106
  42. package/build/state/use-media-editor-state.cjs.map +1 -1
  43. package/build/store/index.cjs +11 -9
  44. package/build/store/index.cjs.map +1 -1
  45. package/build/utils/get-media-type.cjs +8 -0
  46. package/build/utils/get-media-type.cjs.map +1 -1
  47. package/build/utils/index.cjs +6 -0
  48. package/build-module/components/media-editor/index.mjs +217 -117
  49. package/build-module/components/media-editor/index.mjs.map +1 -1
  50. package/build-module/components/media-editor/use-crop-options.mjs +4 -5
  51. package/build-module/components/media-editor/use-crop-options.mjs.map +1 -1
  52. package/build-module/components/media-editor/use-save-media-editor.mjs +32 -4
  53. package/build-module/components/media-editor/use-save-media-editor.mjs.map +1 -1
  54. package/build-module/components/media-editor-canvas/index.mjs +8 -13
  55. package/build-module/components/media-editor-canvas/index.mjs.map +1 -1
  56. package/build-module/components/media-editor-crop-panel/index.mjs +17 -1
  57. package/build-module/components/media-editor-crop-panel/index.mjs.map +1 -1
  58. package/build-module/components/media-editor-fine-rotation/index.mjs +4 -5
  59. package/build-module/components/media-editor-fine-rotation/index.mjs.map +1 -1
  60. package/build-module/components/media-editor-image-controls/index.mjs +5 -7
  61. package/build-module/components/media-editor-image-controls/index.mjs.map +1 -1
  62. package/build-module/components/media-editor-keyboard-shortcuts-modal/index.mjs +33 -33
  63. package/build-module/components/media-editor-keyboard-shortcuts-modal/index.mjs.map +1 -1
  64. package/build-module/components/media-editor-modal/index.mjs +1 -0
  65. package/build-module/components/media-editor-modal/index.mjs.map +1 -1
  66. package/build-module/components/media-editor-panel/error-boundary.mjs +63 -0
  67. package/build-module/components/media-editor-panel/error-boundary.mjs.map +1 -0
  68. package/build-module/components/media-editor-panel/index.mjs +123 -0
  69. package/build-module/components/media-editor-panel/index.mjs.map +1 -0
  70. package/build-module/components/media-form/index.mjs +7 -1
  71. package/build-module/components/media-form/index.mjs.map +1 -1
  72. package/build-module/components/media-preview/index.mjs +123 -41
  73. package/build-module/components/media-preview/index.mjs.map +1 -1
  74. package/build-module/state/aspect-ratio-presets.mjs +12 -7
  75. package/build-module/state/aspect-ratio-presets.mjs.map +1 -1
  76. package/build-module/state/composite-reducer.mjs +32 -67
  77. package/build-module/state/composite-reducer.mjs.map +1 -1
  78. package/build-module/state/index.mjs +2 -5
  79. package/build-module/state/types.mjs +1 -2
  80. package/build-module/state/types.mjs.map +1 -1
  81. package/build-module/state/use-media-editor-state.mjs +70 -105
  82. package/build-module/state/use-media-editor-state.mjs.map +1 -1
  83. package/build-module/utils/get-media-type.mjs +8 -1
  84. package/build-module/utils/get-media-type.mjs.map +1 -1
  85. package/build-module/utils/index.mjs +1 -1
  86. package/build-style/style-rtl.css +122 -87
  87. package/build-style/style.css +121 -87
  88. package/build-types/components/media-editor/index.d.ts +25 -3
  89. package/build-types/components/media-editor/index.d.ts.map +1 -1
  90. package/build-types/components/media-editor/use-crop-options.d.ts +2 -3
  91. package/build-types/components/media-editor/use-crop-options.d.ts.map +1 -1
  92. package/build-types/components/media-editor/use-save-media-editor.d.ts.map +1 -1
  93. package/build-types/components/media-editor-canvas/index.d.ts +3 -3
  94. package/build-types/components/media-editor-canvas/index.d.ts.map +1 -1
  95. package/build-types/components/media-editor-crop-panel/index.d.ts +1 -1
  96. package/build-types/components/media-editor-crop-panel/index.d.ts.map +1 -1
  97. package/build-types/components/media-editor-fine-rotation/index.d.ts.map +1 -1
  98. package/build-types/components/media-editor-image-controls/index.d.ts +1 -1
  99. package/build-types/components/media-editor-image-controls/index.d.ts.map +1 -1
  100. package/build-types/components/media-editor-keyboard-shortcuts-modal/index.d.ts.map +1 -1
  101. package/build-types/components/media-editor-modal/index.d.ts +1 -1
  102. package/build-types/components/media-editor-modal/index.d.ts.map +1 -1
  103. package/build-types/components/media-editor-panel/error-boundary.d.ts +23 -0
  104. package/build-types/components/media-editor-panel/error-boundary.d.ts.map +1 -0
  105. package/build-types/components/media-editor-panel/index.d.ts +46 -0
  106. package/build-types/components/media-editor-panel/index.d.ts.map +1 -0
  107. package/build-types/components/media-form/index.d.ts.map +1 -1
  108. package/build-types/components/media-preview/index.d.ts.map +1 -1
  109. package/build-types/state/aspect-ratio-presets.d.ts +20 -3
  110. package/build-types/state/aspect-ratio-presets.d.ts.map +1 -1
  111. package/build-types/state/composite-reducer.d.ts +17 -19
  112. package/build-types/state/composite-reducer.d.ts.map +1 -1
  113. package/build-types/state/index.d.ts +2 -5
  114. package/build-types/state/index.d.ts.map +1 -1
  115. package/build-types/state/types.d.ts +20 -64
  116. package/build-types/state/types.d.ts.map +1 -1
  117. package/build-types/state/use-media-editor-state.d.ts +40 -54
  118. package/build-types/state/use-media-editor-state.d.ts.map +1 -1
  119. package/build-types/utils/get-media-type.d.ts +3 -1
  120. package/build-types/utils/get-media-type.d.ts.map +1 -1
  121. package/build-types/utils/index.d.ts +1 -1
  122. package/build-types/utils/index.d.ts.map +1 -1
  123. package/package.json +27 -24
  124. package/src/components/media-editor/index.tsx +372 -142
  125. package/src/components/media-editor/style.scss +21 -1
  126. package/src/components/media-editor/use-crop-options.ts +7 -11
  127. package/src/components/media-editor/use-save-media-editor.ts +48 -6
  128. package/src/components/media-editor-canvas/index.tsx +15 -26
  129. package/src/components/media-editor-canvas/style.scss +6 -6
  130. package/src/components/media-editor-crop-panel/index.tsx +38 -2
  131. package/src/components/media-editor-crop-panel/style.scss +21 -0
  132. package/src/components/media-editor-fine-rotation/index.tsx +6 -6
  133. package/src/components/media-editor-image-controls/index.tsx +11 -9
  134. package/src/components/media-editor-keyboard-shortcuts-modal/index.tsx +56 -63
  135. package/src/components/media-editor-keyboard-shortcuts-modal/style.scss +1 -1
  136. package/src/components/media-editor-modal/index.tsx +4 -1
  137. package/src/components/media-editor-panel/error-boundary.tsx +88 -0
  138. package/src/components/media-editor-panel/index.tsx +211 -0
  139. package/src/components/media-form/index.tsx +7 -1
  140. package/src/components/media-preview/index.tsx +195 -37
  141. package/src/components/media-preview/style.scss +11 -32
  142. package/src/components/rotation-ruler/style.scss +3 -3
  143. package/src/state/README.md +34 -0
  144. package/src/state/aspect-ratio-presets.ts +22 -3
  145. package/src/state/composite-reducer.ts +42 -80
  146. package/src/state/index.ts +2 -18
  147. package/src/state/types.ts +18 -68
  148. package/src/state/use-media-editor-state.ts +162 -242
  149. package/src/style.scss +2 -1
  150. package/src/utils/get-media-type.ts +9 -1
  151. package/src/utils/index.ts +1 -1
  152. package/build/components/media-editor-modal/build-modifiers.cjs +0 -110
  153. package/build/components/media-editor-modal/build-modifiers.cjs.map +0 -1
  154. package/build/image-editor/core/camera.cjs +0 -277
  155. package/build/image-editor/core/camera.cjs.map +0 -1
  156. package/build/image-editor/core/constants.cjs +0 -133
  157. package/build/image-editor/core/constants.cjs.map +0 -1
  158. package/build/image-editor/core/containment.cjs +0 -289
  159. package/build/image-editor/core/containment.cjs.map +0 -1
  160. package/build/image-editor/core/crop-rect.cjs +0 -37
  161. package/build/image-editor/core/crop-rect.cjs.map +0 -1
  162. package/build/image-editor/core/export/canvas-renderer.cjs +0 -181
  163. package/build/image-editor/core/export/canvas-renderer.cjs.map +0 -1
  164. package/build/image-editor/core/index.cjs +0 -89
  165. package/build/image-editor/core/interaction-controller.cjs +0 -591
  166. package/build/image-editor/core/interaction-controller.cjs.map +0 -1
  167. package/build/image-editor/core/math/rotation.cjs +0 -32
  168. package/build/image-editor/core/math/rotation.cjs.map +0 -1
  169. package/build/image-editor/core/math/sanitize.cjs +0 -136
  170. package/build/image-editor/core/math/sanitize.cjs.map +0 -1
  171. package/build/image-editor/core/setter-helpers.cjs +0 -61
  172. package/build/image-editor/core/setter-helpers.cjs.map +0 -1
  173. package/build/image-editor/core/source-region.cjs +0 -236
  174. package/build/image-editor/core/source-region.cjs.map +0 -1
  175. package/build/image-editor/core/state.cjs +0 -296
  176. package/build/image-editor/core/state.cjs.map +0 -1
  177. package/build/image-editor/core/stencil-math.cjs +0 -203
  178. package/build/image-editor/core/stencil-math.cjs.map +0 -1
  179. package/build/image-editor/core/transform-style.cjs +0 -43
  180. package/build/image-editor/core/transform-style.cjs.map +0 -1
  181. package/build/image-editor/core/transforms/pipeline.cjs +0 -41
  182. package/build/image-editor/core/transforms/pipeline.cjs.map +0 -1
  183. package/build/image-editor/core/types.cjs +0 -5
  184. package/build/image-editor/core/viewport-state.cjs +0 -36
  185. package/build/image-editor/core/viewport-state.cjs.map +0 -1
  186. package/build/image-editor/index.cjs +0 -68
  187. package/build/image-editor/react/components/cropper-provider.cjs +0 -49
  188. package/build/image-editor/react/components/cropper-provider.cjs.map +0 -1
  189. package/build/image-editor/react/components/cropper.cjs +0 -595
  190. package/build/image-editor/react/components/cropper.cjs.map +0 -1
  191. package/build/image-editor/react/components/index.cjs +0 -25
  192. package/build/image-editor/react/components/overlays/dimensions-overlay.cjs +0 -147
  193. package/build/image-editor/react/components/overlays/dimensions-overlay.cjs.map +0 -1
  194. package/build/image-editor/react/components/overlays/dimming-overlay.cjs +0 -31
  195. package/build/image-editor/react/components/overlays/dimming-overlay.cjs.map +0 -1
  196. package/build/image-editor/react/components/overlays/grid-overlay.cjs +0 -61
  197. package/build/image-editor/react/components/overlays/grid-overlay.cjs.map +0 -1
  198. package/build/image-editor/react/components/stencils/rectangle-stencil.cjs +0 -367
  199. package/build/image-editor/react/components/stencils/rectangle-stencil.cjs.map +0 -1
  200. package/build/image-editor/react/components/viewport-provider.cjs +0 -26
  201. package/build/image-editor/react/components/viewport-provider.cjs.map +0 -1
  202. package/build/image-editor/react/hooks/build-cropper-setters.cjs +0 -80
  203. package/build/image-editor/react/hooks/build-cropper-setters.cjs.map +0 -1
  204. package/build/image-editor/react/hooks/index.cjs +0 -19
  205. package/build/image-editor/react/hooks/use-aria-announcer.cjs +0 -104
  206. package/build/image-editor/react/hooks/use-aria-announcer.cjs.map +0 -1
  207. package/build/image-editor/react/hooks/use-cropper-controller.cjs +0 -80
  208. package/build/image-editor/react/hooks/use-cropper-controller.cjs.map +0 -1
  209. package/build/image-editor/react/hooks/use-interaction.cjs +0 -187
  210. package/build/image-editor/react/hooks/use-interaction.cjs.map +0 -1
  211. package/build/image-editor/react/hooks/use-transform-style.cjs +0 -24
  212. package/build/image-editor/react/hooks/use-transform-style.cjs.map +0 -1
  213. package/build/image-editor/react/hooks/use-viewport-state.cjs +0 -40
  214. package/build/image-editor/react/hooks/use-viewport-state.cjs.map +0 -1
  215. package/build/image-editor/react/visually-hidden-style.cjs +0 -24
  216. package/build/image-editor/react/visually-hidden-style.cjs.map +0 -1
  217. package/build-module/components/media-editor-modal/build-modifiers.mjs +0 -105
  218. package/build-module/components/media-editor-modal/build-modifiers.mjs.map +0 -1
  219. package/build-module/image-editor/core/camera.mjs +0 -265
  220. package/build-module/image-editor/core/camera.mjs.map +0 -1
  221. package/build-module/image-editor/core/constants.mjs +0 -115
  222. package/build-module/image-editor/core/constants.mjs.map +0 -1
  223. package/build-module/image-editor/core/containment.mjs +0 -281
  224. package/build-module/image-editor/core/containment.mjs.map +0 -1
  225. package/build-module/image-editor/core/crop-rect.mjs +0 -32
  226. package/build-module/image-editor/core/crop-rect.mjs.map +0 -1
  227. package/build-module/image-editor/core/export/canvas-renderer.mjs +0 -170
  228. package/build-module/image-editor/core/export/canvas-renderer.mjs.map +0 -1
  229. package/build-module/image-editor/core/index.mjs +0 -7
  230. package/build-module/image-editor/core/interaction-controller.mjs +0 -586
  231. package/build-module/image-editor/core/interaction-controller.mjs.map +0 -1
  232. package/build-module/image-editor/core/math/rotation.mjs +0 -26
  233. package/build-module/image-editor/core/math/rotation.mjs.map +0 -1
  234. package/build-module/image-editor/core/math/sanitize.mjs +0 -127
  235. package/build-module/image-editor/core/math/sanitize.mjs.map +0 -1
  236. package/build-module/image-editor/core/setter-helpers.mjs +0 -56
  237. package/build-module/image-editor/core/setter-helpers.mjs.map +0 -1
  238. package/build-module/image-editor/core/source-region.mjs +0 -228
  239. package/build-module/image-editor/core/source-region.mjs.map +0 -1
  240. package/build-module/image-editor/core/state.mjs +0 -288
  241. package/build-module/image-editor/core/state.mjs.map +0 -1
  242. package/build-module/image-editor/core/stencil-math.mjs +0 -194
  243. package/build-module/image-editor/core/stencil-math.mjs.map +0 -1
  244. package/build-module/image-editor/core/transform-style.mjs +0 -38
  245. package/build-module/image-editor/core/transform-style.mjs.map +0 -1
  246. package/build-module/image-editor/core/transforms/pipeline.mjs +0 -35
  247. package/build-module/image-editor/core/transforms/pipeline.mjs.map +0 -1
  248. package/build-module/image-editor/core/types.mjs +0 -0
  249. package/build-module/image-editor/core/viewport-state.mjs +0 -30
  250. package/build-module/image-editor/core/viewport-state.mjs.map +0 -1
  251. package/build-module/image-editor/index.mjs +0 -4
  252. package/build-module/image-editor/react/components/cropper-provider.mjs +0 -43
  253. package/build-module/image-editor/react/components/cropper-provider.mjs.map +0 -1
  254. package/build-module/image-editor/react/components/cropper.mjs +0 -568
  255. package/build-module/image-editor/react/components/cropper.mjs.map +0 -1
  256. package/build-module/image-editor/react/components/index.mjs +0 -3
  257. package/build-module/image-editor/react/components/overlays/dimensions-overlay.mjs +0 -142
  258. package/build-module/image-editor/react/components/overlays/dimensions-overlay.mjs.map +0 -1
  259. package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs +0 -26
  260. package/build-module/image-editor/react/components/overlays/dimming-overlay.mjs.map +0 -1
  261. package/build-module/image-editor/react/components/overlays/grid-overlay.mjs +0 -56
  262. package/build-module/image-editor/react/components/overlays/grid-overlay.mjs.map +0 -1
  263. package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs +0 -362
  264. package/build-module/image-editor/react/components/stencils/rectangle-stencil.mjs.map +0 -1
  265. package/build-module/image-editor/react/components/viewport-provider.mjs +0 -20
  266. package/build-module/image-editor/react/components/viewport-provider.mjs.map +0 -1
  267. package/build-module/image-editor/react/hooks/build-cropper-setters.mjs +0 -75
  268. package/build-module/image-editor/react/hooks/build-cropper-setters.mjs.map +0 -1
  269. package/build-module/image-editor/react/hooks/index.mjs +0 -3
  270. package/build-module/image-editor/react/hooks/use-aria-announcer.mjs +0 -99
  271. package/build-module/image-editor/react/hooks/use-aria-announcer.mjs.map +0 -1
  272. package/build-module/image-editor/react/hooks/use-cropper-controller.mjs +0 -75
  273. package/build-module/image-editor/react/hooks/use-cropper-controller.mjs.map +0 -1
  274. package/build-module/image-editor/react/hooks/use-interaction.mjs +0 -182
  275. package/build-module/image-editor/react/hooks/use-interaction.mjs.map +0 -1
  276. package/build-module/image-editor/react/hooks/use-transform-style.mjs +0 -19
  277. package/build-module/image-editor/react/hooks/use-transform-style.mjs.map +0 -1
  278. package/build-module/image-editor/react/hooks/use-viewport-state.mjs +0 -35
  279. package/build-module/image-editor/react/hooks/use-viewport-state.mjs.map +0 -1
  280. package/build-module/image-editor/react/visually-hidden-style.mjs +0 -19
  281. package/build-module/image-editor/react/visually-hidden-style.mjs.map +0 -1
  282. package/build-types/components/media-editor-modal/build-modifiers.d.ts +0 -81
  283. package/build-types/components/media-editor-modal/build-modifiers.d.ts.map +0 -1
  284. package/build-types/image-editor/core/camera.d.ts +0 -128
  285. package/build-types/image-editor/core/camera.d.ts.map +0 -1
  286. package/build-types/image-editor/core/constants.d.ts +0 -98
  287. package/build-types/image-editor/core/constants.d.ts.map +0 -1
  288. package/build-types/image-editor/core/containment.d.ts +0 -72
  289. package/build-types/image-editor/core/containment.d.ts.map +0 -1
  290. package/build-types/image-editor/core/crop-rect.d.ts +0 -16
  291. package/build-types/image-editor/core/crop-rect.d.ts.map +0 -1
  292. package/build-types/image-editor/core/export/canvas-renderer.d.ts +0 -103
  293. package/build-types/image-editor/core/export/canvas-renderer.d.ts.map +0 -1
  294. package/build-types/image-editor/core/index.d.ts +0 -10
  295. package/build-types/image-editor/core/index.d.ts.map +0 -1
  296. package/build-types/image-editor/core/interaction-controller.d.ts +0 -191
  297. package/build-types/image-editor/core/interaction-controller.d.ts.map +0 -1
  298. package/build-types/image-editor/core/math/rotation.d.ts +0 -18
  299. package/build-types/image-editor/core/math/rotation.d.ts.map +0 -1
  300. package/build-types/image-editor/core/math/sanitize.d.ts +0 -67
  301. package/build-types/image-editor/core/math/sanitize.d.ts.map +0 -1
  302. package/build-types/image-editor/core/setter-helpers.d.ts +0 -21
  303. package/build-types/image-editor/core/setter-helpers.d.ts.map +0 -1
  304. package/build-types/image-editor/core/source-region.d.ts +0 -94
  305. package/build-types/image-editor/core/source-region.d.ts.map +0 -1
  306. package/build-types/image-editor/core/state.d.ts +0 -51
  307. package/build-types/image-editor/core/state.d.ts.map +0 -1
  308. package/build-types/image-editor/core/stencil-math.d.ts +0 -102
  309. package/build-types/image-editor/core/stencil-math.d.ts.map +0 -1
  310. package/build-types/image-editor/core/transform-style.d.ts +0 -20
  311. package/build-types/image-editor/core/transform-style.d.ts.map +0 -1
  312. package/build-types/image-editor/core/transforms/pipeline.d.ts +0 -24
  313. package/build-types/image-editor/core/transforms/pipeline.d.ts.map +0 -1
  314. package/build-types/image-editor/core/types.d.ts +0 -269
  315. package/build-types/image-editor/core/types.d.ts.map +0 -1
  316. package/build-types/image-editor/core/viewport-state.d.ts +0 -4
  317. package/build-types/image-editor/core/viewport-state.d.ts.map +0 -1
  318. package/build-types/image-editor/index.d.ts +0 -17
  319. package/build-types/image-editor/index.d.ts.map +0 -1
  320. package/build-types/image-editor/react/components/cropper-provider.d.ts +0 -38
  321. package/build-types/image-editor/react/components/cropper-provider.d.ts.map +0 -1
  322. package/build-types/image-editor/react/components/cropper.d.ts +0 -54
  323. package/build-types/image-editor/react/components/cropper.d.ts.map +0 -1
  324. package/build-types/image-editor/react/components/index.d.ts +0 -4
  325. package/build-types/image-editor/react/components/index.d.ts.map +0 -1
  326. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts +0 -33
  327. package/build-types/image-editor/react/components/overlays/dimensions-overlay.d.ts.map +0 -1
  328. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts +0 -17
  329. package/build-types/image-editor/react/components/overlays/dimming-overlay.d.ts.map +0 -1
  330. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts +0 -27
  331. package/build-types/image-editor/react/components/overlays/grid-overlay.d.ts.map +0 -1
  332. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts +0 -33
  333. package/build-types/image-editor/react/components/stencils/rectangle-stencil.d.ts.map +0 -1
  334. package/build-types/image-editor/react/components/viewport-provider.d.ts +0 -6
  335. package/build-types/image-editor/react/components/viewport-provider.d.ts.map +0 -1
  336. package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts +0 -44
  337. package/build-types/image-editor/react/hooks/build-cropper-setters.d.ts.map +0 -1
  338. package/build-types/image-editor/react/hooks/index.d.ts +0 -5
  339. package/build-types/image-editor/react/hooks/index.d.ts.map +0 -1
  340. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts +0 -14
  341. package/build-types/image-editor/react/hooks/use-aria-announcer.d.ts.map +0 -1
  342. package/build-types/image-editor/react/hooks/use-cropper-controller.d.ts +0 -55
  343. package/build-types/image-editor/react/hooks/use-cropper-controller.d.ts.map +0 -1
  344. package/build-types/image-editor/react/hooks/use-interaction.d.ts +0 -65
  345. package/build-types/image-editor/react/hooks/use-interaction.d.ts.map +0 -1
  346. package/build-types/image-editor/react/hooks/use-transform-style.d.ts +0 -13
  347. package/build-types/image-editor/react/hooks/use-transform-style.d.ts.map +0 -1
  348. package/build-types/image-editor/react/hooks/use-viewport-state.d.ts +0 -16
  349. package/build-types/image-editor/react/hooks/use-viewport-state.d.ts.map +0 -1
  350. package/build-types/image-editor/react/visually-hidden-style.d.ts +0 -6
  351. package/build-types/image-editor/react/visually-hidden-style.d.ts.map +0 -1
  352. package/src/components/media-editor-modal/build-modifiers.ts +0 -167
  353. package/src/image-editor/README.md +0 -61
  354. package/src/image-editor/core/camera.ts +0 -429
  355. package/src/image-editor/core/constants.ts +0 -137
  356. package/src/image-editor/core/containment.ts +0 -469
  357. package/src/image-editor/core/crop-rect.ts +0 -42
  358. package/src/image-editor/core/export/canvas-renderer.ts +0 -250
  359. package/src/image-editor/core/index.ts +0 -43
  360. package/src/image-editor/core/interaction-controller.ts +0 -976
  361. package/src/image-editor/core/math/rotation.ts +0 -26
  362. package/src/image-editor/core/math/sanitize.ts +0 -155
  363. package/src/image-editor/core/setter-helpers.ts +0 -63
  364. package/src/image-editor/core/source-region.ts +0 -367
  365. package/src/image-editor/core/state.ts +0 -484
  366. package/src/image-editor/core/stencil-math.ts +0 -379
  367. package/src/image-editor/core/transform-style.ts +0 -56
  368. package/src/image-editor/core/transforms/pipeline.ts +0 -40
  369. package/src/image-editor/core/types.ts +0 -230
  370. package/src/image-editor/core/viewport-state.ts +0 -30
  371. package/src/image-editor/docs/architecture.md +0 -63
  372. package/src/image-editor/docs/recipes.md +0 -184
  373. package/src/image-editor/index.ts +0 -43
  374. package/src/image-editor/react/components/cropper-provider.tsx +0 -70
  375. package/src/image-editor/react/components/cropper.scss +0 -259
  376. package/src/image-editor/react/components/cropper.tsx +0 -1108
  377. package/src/image-editor/react/components/index.ts +0 -3
  378. package/src/image-editor/react/components/overlays/dimensions-overlay.tsx +0 -262
  379. package/src/image-editor/react/components/overlays/dimming-overlay.tsx +0 -55
  380. package/src/image-editor/react/components/overlays/grid-overlay.tsx +0 -77
  381. package/src/image-editor/react/components/stencils/rectangle-stencil.tsx +0 -623
  382. package/src/image-editor/react/components/viewport-provider.tsx +0 -32
  383. package/src/image-editor/react/hooks/build-cropper-setters.ts +0 -102
  384. package/src/image-editor/react/hooks/index.ts +0 -4
  385. package/src/image-editor/react/hooks/use-aria-announcer.ts +0 -193
  386. package/src/image-editor/react/hooks/use-cropper-controller.ts +0 -197
  387. package/src/image-editor/react/hooks/use-interaction.ts +0 -294
  388. package/src/image-editor/react/hooks/use-transform-style.ts +0 -23
  389. package/src/image-editor/react/hooks/use-viewport-state.ts +0 -41
  390. package/src/image-editor/react/visually-hidden-style.ts +0 -15
  391. package/src/image-editor/style.scss +0 -1
@@ -1,6 +1,3 @@
1
- /**
2
- * Colors
3
- */
4
1
  /**
5
2
  * SCSS Variables.
6
3
  *
@@ -8,6 +5,9 @@
8
5
  * Don't add to this sheet unless you're pretty sure the value will be reused in many places.
9
6
  * For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
10
7
  */
8
+ /**
9
+ * Colors
10
+ */
11
11
  /**
12
12
  * Fonts & basic variables.
13
13
  */
@@ -109,124 +109,120 @@
109
109
  border: 0;
110
110
  border-radius: 2px;
111
111
  }
112
- .media-editor-preview__file-info {
113
- text-align: center;
114
- background: #f0f0f0;
115
- padding: 24px;
116
- border-radius: 2px;
117
- }
118
112
  .media-editor-preview__file-name {
119
- font-weight: var(--wpds-typography-font-weight-emphasis, 600);
120
- margin-bottom: 8px;
121
- }
122
- .media-editor-preview__mime-type {
123
- color: #757575;
124
- font-size: 0.9em;
125
- margin-bottom: 16px;
126
- }
127
- .media-editor-preview__download-link {
128
- display: inline-block;
129
- margin-top: 8px;
130
- }
131
- .media-editor-preview--error, .media-editor-preview--empty {
132
- color: #757575;
133
- text-align: center;
113
+ overflow-wrap: anywhere;
134
114
  }
135
- .media-editor-preview__url {
136
- font-size: 0.9em;
137
- color: #949494;
138
- word-break: break-all;
139
- margin-top: 8px;
115
+ .media-editor-preview__actions {
116
+ flex-direction: row;
117
+ flex-wrap: wrap;
118
+ justify-content: center;
119
+ gap: var(--wpds-dimension-gap-sm, 8px);
140
120
  }
141
121
 
122
+ /* stylelint-disable plugin-wpds/no-token-fallback-values -- This SCSS also works when the design tokens are not loaded. */
123
+ /* stylelint-enable plugin-wpds/no-token-fallback-values */
142
124
  /*!rtl:begin:ignore*/
143
- .wp-media-editor-image-editor {
125
+ .wp-image-editor {
144
126
  position: relative;
145
127
  overflow: hidden;
146
128
  width: 100%;
147
129
  height: 100%;
148
130
  touch-action: none;
149
131
  -webkit-user-select: none;
150
- user-select: none;
132
+ user-select: none;
151
133
  cursor: grab;
152
134
  }
153
- .wp-media-editor-image-editor__canvas {
135
+
136
+ .wp-image-editor__canvas {
154
137
  position: absolute;
155
- inset: 24px;
138
+ inset: max(22px, var(--wp-image-editor-canvas-inset, var(--wpds-dimension-padding-2xl, 24px)));
156
139
  min-height: 100px;
157
140
  min-width: 100px;
158
141
  }
159
- .wp-media-editor-image-editor__canvas:focus {
142
+
143
+ .wp-image-editor__canvas:focus {
160
144
  outline: none;
161
145
  }
162
- .wp-media-editor-image-editor__stage {
146
+
147
+ .wp-image-editor__stage {
163
148
  position: absolute;
164
149
  inset: 0;
165
150
  }
166
- .wp-media-editor-image-editor--dragging {
151
+
152
+ .wp-image-editor--dragging {
167
153
  cursor: grabbing;
168
154
  }
169
- .wp-media-editor-image-editor__image {
155
+
156
+ .wp-image-editor__image {
170
157
  position: absolute;
171
158
  top: 0;
172
159
  left: 0;
173
160
  will-change: transform;
174
161
  transform-origin: center center;
175
162
  }
176
- .wp-media-editor-image-editor__stencil {
163
+
164
+ .wp-image-editor__stencil {
177
165
  position: absolute;
178
166
  pointer-events: none;
179
167
  }
180
- .wp-media-editor-image-editor__dimming {
168
+
169
+ .wp-image-editor__dimming {
181
170
  position: absolute;
182
171
  pointer-events: none;
183
- /* Large shadow spread washes everything outside the crop area
184
- toward the canvas grey ($gray-200). Slightly stronger at rest
185
- for clear crop framing, lighter during drag so the user can see
186
- where they're panning. */
187
- box-shadow: 0 0 0 9999px rgba(224, 224, 224, 0.6);
172
+ /* Large shadow spread washes everything outside the crop area.
173
+ It is lighter during drag so the image stays visible. */
174
+ box-shadow: 0 0 0 9999px var(--wp-image-editor-dimming-color, color-mix(in srgb, color-mix(in srgb, var(--wpds-color-background-surface-neutral-weak, #f4f4f4) 90.65%, var(--wpds-color-foreground-content-neutral, #1e1e1e)) 60%, transparent));
188
175
  transition: box-shadow 0.15s ease;
189
176
  }
190
- .wp-media-editor-image-editor--dragging .wp-media-editor-image-editor__dimming {
191
- box-shadow: 0 0 0 9999px rgba(224, 224, 224, 0.4);
177
+
178
+ .wp-image-editor--dragging .wp-image-editor__dimming {
179
+ box-shadow: 0 0 0 9999px color-mix(in srgb, var(--wp-image-editor-dimming-color, color-mix(in srgb, color-mix(in srgb, var(--wpds-color-background-surface-neutral-weak, #f4f4f4) 90.65%, var(--wpds-color-foreground-content-neutral, #1e1e1e)) 60%, transparent)) 66.667%, transparent);
192
180
  }
193
- .wp-media-editor-image-editor__grid {
181
+
182
+ .wp-image-editor__grid {
194
183
  position: absolute;
195
184
  pointer-events: none;
196
185
  overflow: hidden;
197
186
  transition: opacity 0.15s ease;
198
187
  }
199
- .wp-media-editor-image-editor__canvas--grid-interactive .wp-media-editor-image-editor__grid {
188
+
189
+ .wp-image-editor__canvas--grid-interactive .wp-image-editor__grid {
200
190
  opacity: 0;
201
191
  transition-delay: 0.1s;
202
192
  }
203
- .wp-media-editor-image-editor__canvas--show-grid .wp-media-editor-image-editor__grid {
193
+
194
+ .wp-image-editor__canvas--show-grid .wp-image-editor__grid {
204
195
  opacity: 1;
205
196
  transition-delay: 0s;
206
197
  }
207
- .wp-media-editor-image-editor__canvas--settling .wp-media-editor-image-editor__grid {
198
+
199
+ .wp-image-editor__canvas--settling .wp-image-editor__grid {
208
200
  opacity: 0;
209
201
  transition: none;
210
202
  }
211
- .wp-media-editor-image-editor__grid-line {
203
+
204
+ .wp-image-editor__grid-line {
212
205
  position: absolute;
213
- background: rgba(255, 255, 255, 0.4);
206
+ background: var(--wp-image-editor-grid-color, rgba(255, 255, 255, 0.4));
214
207
  }
215
- .wp-media-editor-image-editor__grid-line--horizontal {
208
+
209
+ .wp-image-editor__grid-line--horizontal {
216
210
  left: 0;
217
211
  width: 100%;
218
212
  height: 1px;
219
213
  }
220
- .wp-media-editor-image-editor__grid-line--vertical {
214
+
215
+ .wp-image-editor__grid-line--vertical {
221
216
  top: 0;
222
217
  height: 100%;
223
218
  width: 1px;
224
219
  }
225
- .wp-media-editor-image-editor__dimensions-tooltip {
220
+
221
+ .wp-image-editor__dimensions-tooltip {
226
222
  position: absolute;
227
223
  padding: 2px 6px;
228
- background: #fff;
229
- color: #1e1e1e;
224
+ background: var(--wp-image-editor-surface-color, var(--wpds-color-background-surface-neutral-strong, #fff));
225
+ color: var(--wp-image-editor-foreground-color, var(--wpds-color-foreground-content-neutral, #1e1e1e));
230
226
  font-size: 11px;
231
227
  line-height: 1.4;
232
228
  font-variant-numeric: tabular-nums;
@@ -235,18 +231,21 @@
235
231
  white-space: nowrap;
236
232
  z-index: 2;
237
233
  }
238
- .wp-media-editor-image-editor__stencil-rect {
234
+
235
+ .wp-image-editor__stencil-rect {
239
236
  position: absolute;
240
- border: 1px solid #1e1e1e;
237
+ border: 1px solid var(--wp-image-editor-foreground-color, var(--wpds-color-foreground-content-neutral, #1e1e1e));
241
238
  box-sizing: border-box;
242
239
  pointer-events: none;
243
240
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
244
241
  }
245
- .wp-media-editor-image-editor__canvas--focus-visible:focus .wp-media-editor-image-editor__stencil-rect {
246
- border-color: var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #3858e9));
247
- box-shadow: 0 0 0 1px var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #3858e9));
242
+
243
+ .wp-image-editor__canvas--focus-visible:focus .wp-image-editor__stencil-rect {
244
+ border-color: var(--wp-image-editor-accent-color, var(--wpds-color-stroke-focus, var(--wp-admin-theme-color, #3858e9)));
245
+ box-shadow: 0 0 0 1px var(--wp-image-editor-accent-color, var(--wpds-color-stroke-focus, var(--wp-admin-theme-color, #3858e9)));
248
246
  }
249
- .wp-media-editor-image-editor__handle {
247
+
248
+ .wp-image-editor__handle {
250
249
  appearance: none;
251
250
  margin: 0;
252
251
  padding: 0;
@@ -255,22 +254,25 @@
255
254
  position: absolute;
256
255
  width: 12px;
257
256
  height: 12px;
258
- background: #fff;
259
- border: 1px solid var(--wp-admin-theme-color, #3858e9);
257
+ background: var(--wp-image-editor-surface-color, var(--wpds-color-background-surface-neutral-strong, #fff));
258
+ border: 1px solid var(--wp-image-editor-accent-color, var(--wpds-color-stroke-focus, var(--wp-admin-theme-color, #3858e9)));
260
259
  border-radius: 50%;
261
260
  box-sizing: border-box;
262
261
  pointer-events: auto;
263
262
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
264
263
  }
265
- .wp-media-editor-image-editor__handle:focus {
264
+
265
+ .wp-image-editor__handle:focus {
266
266
  outline: none;
267
267
  }
268
- .wp-media-editor-image-editor__canvas--focus-visible .wp-media-editor-image-editor__handle:focus {
269
- background: var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #3858e9));
268
+
269
+ .wp-image-editor__canvas--focus-visible .wp-image-editor__handle:focus {
270
+ background: var(--wp-image-editor-accent-color, var(--wpds-color-stroke-focus, var(--wp-admin-theme-color, #3858e9)));
270
271
  border-color: transparent;
271
- box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--wp-image-editor-focus-color, var(--wp-admin-theme-color, #3858e9));
272
+ box-shadow: 0 0 0 2px var(--wp-image-editor-surface-color, var(--wpds-color-background-surface-neutral-strong, #fff)), 0 0 0 4px var(--wp-image-editor-accent-color, var(--wpds-color-stroke-focus, var(--wp-admin-theme-color, #3858e9)));
272
273
  }
273
- .wp-media-editor-image-editor__handle::before {
274
+
275
+ .wp-image-editor__handle::before {
274
276
  content: "";
275
277
  position: absolute;
276
278
  top: 50%;
@@ -279,49 +281,58 @@
279
281
  height: 44px;
280
282
  transform: translate(-50%, -50%);
281
283
  }
282
- .wp-media-editor-image-editor__handle {
284
+
285
+ .wp-image-editor__handle {
283
286
  /* Offset by half the handle width (12px / 2 = 6px) to center on crop edge */
284
287
  }
285
- .wp-media-editor-image-editor__handle--n {
288
+
289
+ .wp-image-editor__handle--n {
286
290
  top: -6px;
287
291
  left: 50%;
288
292
  margin-left: -6px;
289
293
  cursor: ns-resize;
290
294
  }
291
- .wp-media-editor-image-editor__handle--s {
295
+
296
+ .wp-image-editor__handle--s {
292
297
  bottom: -6px;
293
298
  left: 50%;
294
299
  margin-left: -6px;
295
300
  cursor: ns-resize;
296
301
  }
297
- .wp-media-editor-image-editor__handle--e {
302
+
303
+ .wp-image-editor__handle--e {
298
304
  top: 50%;
299
305
  right: -6px;
300
306
  margin-top: -6px;
301
307
  cursor: ew-resize;
302
308
  }
303
- .wp-media-editor-image-editor__handle--w {
309
+
310
+ .wp-image-editor__handle--w {
304
311
  top: 50%;
305
312
  left: -6px;
306
313
  margin-top: -6px;
307
314
  cursor: ew-resize;
308
315
  }
309
- .wp-media-editor-image-editor__handle--nw {
316
+
317
+ .wp-image-editor__handle--nw {
310
318
  top: -6px;
311
319
  left: -6px;
312
320
  cursor: nwse-resize;
313
321
  }
314
- .wp-media-editor-image-editor__handle--ne {
322
+
323
+ .wp-image-editor__handle--ne {
315
324
  top: -6px;
316
325
  right: -6px;
317
326
  cursor: nesw-resize;
318
327
  }
319
- .wp-media-editor-image-editor__handle--sw {
328
+
329
+ .wp-image-editor__handle--sw {
320
330
  bottom: -6px;
321
331
  left: -6px;
322
332
  cursor: nesw-resize;
323
333
  }
324
- .wp-media-editor-image-editor__handle--se {
334
+
335
+ .wp-image-editor__handle--se {
325
336
  bottom: -6px;
326
337
  right: -6px;
327
338
  cursor: nwse-resize;
@@ -455,6 +466,9 @@
455
466
  .media-editor .media-editor__canvas-area .media-editor-preview {
456
467
  height: 100%;
457
468
  }
469
+ .media-editor .media-editor__canvas-area:has(.media-editor-preview.is-placeholder) {
470
+ background: none;
471
+ }
458
472
  .media-editor .media-editor__canvas-area img,
459
473
  .media-editor .media-editor__canvas-area video {
460
474
  max-width: 100%;
@@ -487,6 +501,11 @@
487
501
  width: var(--wpds-dimension-surface-width-sm, 320px);
488
502
  }
489
503
  }
504
+ @media (min-width: 600px) {
505
+ .media-editor .media-editor__body:has(.media-editor-preview.is-placeholder) .media-editor__sidebar {
506
+ border-inline-start: var(--wpds-border-width-xs, 1px) solid var(--wpds-color-stroke-surface-neutral-weak, #f0f0f0);
507
+ }
508
+ }
490
509
  .media-editor .media-editor__tabs {
491
510
  display: flex;
492
511
  flex: 1;
@@ -516,7 +535,7 @@
516
535
  @media (min-width: 600px) {
517
536
  .media-editor .media-editor__body.has-panel-open .media-editor__content {
518
537
  display: flex;
519
- margin: 0 0 0 24px;
538
+ margin-right: 0;
520
539
  }
521
540
  }
522
541
 
@@ -599,13 +618,13 @@
599
618
  width: 100%;
600
619
  height: 100%;
601
620
  }
602
- .media-editor-canvas__cropper {
621
+ .media-editor-canvas__image-editor {
603
622
  width: 100%;
604
623
  height: 100%;
605
624
  opacity: 0;
606
625
  pointer-events: none;
607
626
  }
608
- .media-editor-canvas__cropper.is-loaded {
627
+ .media-editor-canvas__image-editor.is-loaded {
609
628
  opacity: 1;
610
629
  pointer-events: auto;
611
630
  }
@@ -618,7 +637,7 @@
618
637
  }
619
638
  }
620
639
  @media not (prefers-reduced-motion) {
621
- .media-editor-canvas__cropper.is-loaded {
640
+ .media-editor-canvas__image-editor.is-loaded {
622
641
  animation: __wp-base-styles-fade-in 0.2s linear 0s;
623
642
  animation-fill-mode: forwards;
624
643
  }
@@ -671,6 +690,22 @@
671
690
  padding-inline: 2px 0;
672
691
  }
673
692
 
693
+ .media-editor-crop-panel__aspect-ratio-option {
694
+ display: flex;
695
+ align-items: center;
696
+ gap: 8px;
697
+ min-width: 0;
698
+ }
699
+ .media-editor-crop-panel__aspect-ratio-option svg {
700
+ flex-shrink: 0;
701
+ }
702
+
703
+ .media-editor-crop-panel__aspect-ratio-label {
704
+ overflow: hidden;
705
+ text-overflow: ellipsis;
706
+ white-space: nowrap;
707
+ }
708
+
674
709
  .media-editor-keyboard-shortcuts-modal {
675
710
  min-width: 280px;
676
711
  }
@@ -711,7 +746,7 @@
711
746
  margin: 0 0.2rem 0 0.2rem;
712
747
  }
713
748
  .media-editor-keyboard-shortcuts-modal .media-editor-keyboard-shortcuts-modal__shortcut-key:last-child {
714
- margin: 0 0 0 0.2rem;
749
+ margin-inline-end: 0;
715
750
  }
716
751
 
717
752
  .rotation-ruler {
@@ -720,8 +755,7 @@
720
755
  height: 32px;
721
756
  padding: 0 8px;
722
757
  box-sizing: border-box;
723
- color: #1e1e1e;
724
- font-family: -apple-system, system-ui, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
758
+ font-family: var(--wpds-typography-font-family-body, -apple-system, system-ui, "Segoe UI", "Roboto", "Oxygen-Sans", "Ubuntu", "Cantarell", "Helvetica Neue", sans-serif);
725
759
  -webkit-user-select: none;
726
760
  user-select: none;
727
761
  touch-action: none;
@@ -780,6 +814,7 @@
780
814
 
781
815
  .rotation-ruler__ticks {
782
816
  position: absolute;
817
+ color: CanvasText;
783
818
  /*rtl:ignore*/
784
819
  left: 50%;
785
820
  top: 0;
@@ -817,7 +852,6 @@
817
852
  font-size: 12px;
818
853
  font-weight: var(--wpds-typography-font-weight-emphasis, 600);
819
854
  line-height: 14px;
820
- color: #1e1e1e;
821
855
  pointer-events: none;
822
856
  }
823
857
  .rotation-ruler__active-label::before {
@@ -1,7 +1,7 @@
1
- import type { Field, Form } from '@wordpress/dataviews';
1
+ import type { Action, Field, Form } from '@wordpress/dataviews';
2
2
  import type { KeyboardEvent as ReactKeyboardEvent, ReactElement, ReactNode } from 'react';
3
+ import type { AspectRatioPreset } from '../../state/aspect-ratio-presets';
3
4
  import type { Media } from '../media-editor-provider';
4
- import type { AspectRatioPreset } from '../../image-editor/core/constants';
5
5
  import { type MediaEditorSaveResult } from './use-save-media-editor';
6
6
  export type { MediaEditorSaveResult } from './use-save-media-editor';
7
7
  export interface MediaEditorFrameProps {
@@ -35,10 +35,20 @@ export interface MediaEditorProps {
35
35
  aspectRatioPresets?: AspectRatioPreset[];
36
36
  onClose?: () => void;
37
37
  onSaved?: (result: MediaEditorSaveResult) => void;
38
+ /** Called with the original's id when the user chooses "Edit original". */
39
+ onEditOriginal?: (originalId: number) => void;
38
40
  renderFrame: (props: MediaEditorFrameProps) => ReactElement;
39
41
  noticesClassName?: string;
40
42
  noticesPortalElement?: Element | null;
41
43
  shouldCloseOnEsc?: boolean;
44
+ /**
45
+ * The id of the panel to open on, which is also shown as the first tab.
46
+ * Below `small`, or when no tab has this id, the sidebar opens on
47
+ * Details.
48
+ *
49
+ * @default 'core/details'
50
+ */
51
+ defaultPanel?: string;
42
52
  }
43
53
  export interface HeaderActionsProps {
44
54
  /**
@@ -50,7 +60,19 @@ export interface HeaderActionsProps {
50
60
  showCloseButton?: boolean;
51
61
  }
52
62
  declare function PanelToggle(): import("react").JSX.Element;
53
- declare function MoreMenu(): import("react").JSX.Element | null;
63
+ export interface MoreMenuProps {
64
+ /**
65
+ * Actions for the attachment, such as those from the entity actions API.
66
+ * Only the ones whose `isEligible` passes for `item` are shown.
67
+ */
68
+ actions?: Action<Media>[];
69
+ /**
70
+ * The attachment the actions apply to, with anything their `isEligible`
71
+ * checks need, such as `permissions`. Without it no actions are shown.
72
+ */
73
+ item?: Media;
74
+ }
75
+ declare function MoreMenu({ actions, item }: MoreMenuProps): import("react").JSX.Element | null;
54
76
  declare function HeaderActions({ showCloseButton }: HeaderActionsProps): import("react").JSX.Element;
55
77
  declare function HistoryActions(): import("react").JSX.Element | null;
56
78
  export interface SaveActionsProps {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor/index.tsx"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EACX,aAAa,IAAI,kBAAkB,EACnC,YAAY,EACZ,SAAS,EACT,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAStD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAG3E,OAAO,EAGN,KAAK,qBAAqB,EAC1B,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AA8CrE,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,EAAE,CAAE,KAAK,EAAE,kBAAkB,CAAE,WAAW,CAAE,KAAM,IAAI,CAAC;IAChE,yBAAyB,EAAE,OAAO,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAChC,MAAM,CAAC,EAAE,KAAK,CAAE,KAAK,CAAE,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAE,MAAM,EAAE,qBAAqB,KAAM,IAAI,CAAC;IACpD,WAAW,EAAE,CAAE,KAAK,EAAE,qBAAqB,KAAM,YAAY,CAAC;IAC9D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B;AAiID,MAAM,WAAW,kBAAkB;IAClC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,iBAAS,WAAW,gCAmBnB;AAED,iBAAS,QAAQ,uCAmChB;AAED,iBAAS,aAAa,CAAE,EAAE,eAAuB,EAAE,EAAE,kBAAkB,+BAuBtE;AAED,iBAAS,cAAc,uCA0HtB;AAED,MAAM,WAAW,gBAAgB;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAC7B;AAED,iBAAS,WAAW,CAAE,EAAE,IAAgB,EAAE,EAAE,gBAAgB,+BAkC3D;AAqgBD,wBAAgB,WAAW,CAAE,KAAK,EAAE,gBAAgB,+BAMnD;yBANe,WAAW;;;;;;;eAiBZ,WAAW"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor/index.tsx"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAAE,MAAM,EAAe,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EACX,aAAa,IAAI,kBAAkB,EACnC,YAAY,EACZ,SAAS,EACT,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAkBtD,OAAO,EAGN,KAAK,qBAAqB,EAC1B,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAiDrE,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,SAAS,EAAE,CAAE,KAAK,EAAE,kBAAkB,CAAE,WAAW,CAAE,KAAM,IAAI,CAAC;IAChE,yBAAyB,EAAE,OAAO,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAChC,MAAM,CAAC,EAAE,KAAK,CAAE,KAAK,CAAE,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAE,MAAM,EAAE,qBAAqB,KAAM,IAAI,CAAC;IACpD,2EAA2E;IAC3E,cAAc,CAAC,EAAE,CAAE,UAAU,EAAE,MAAM,KAAM,IAAI,CAAC;IAChD,WAAW,EAAE,CAAE,KAAK,EAAE,qBAAqB,KAAM,YAAY,CAAC;IAC9D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAwJD,MAAM,WAAW,kBAAkB;IAClC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,iBAAS,WAAW,gCAmBnB;AAsCD,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAE,KAAK,CAAE,EAAE,CAAC;IAC5B;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC;CACb;AAED,iBAAS,QAAQ,CAAE,EAAE,OAAY,EAAE,IAAI,EAAE,EAAE,aAAa,sCAuGvD;AAED,iBAAS,aAAa,CAAE,EAAE,eAAuB,EAAE,EAAE,kBAAkB,+BAuBtE;AAED,iBAAS,cAAc,uCA6HtB;AAED,MAAM,WAAW,gBAAgB;IAChC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAC7B;AAED,iBAAS,WAAW,CAAE,EAAE,IAAgB,EAAE,EAAE,gBAAgB,+BAkC3D;AAikBD,wBAAgB,WAAW,CAAE,KAAK,EAAE,gBAAgB,+BAMnD;yBANe,WAAW;;;;;;;eAiBZ,WAAW"}
@@ -1,4 +1,4 @@
1
- import type { AspectRatioPreset } from '../../image-editor/core/constants';
1
+ import { type AspectRatioPreset } from '../../state/aspect-ratio-presets';
2
2
  interface UseCropOptionsArgs {
3
3
  aspectRatioPresets?: AspectRatioPreset[];
4
4
  }
@@ -20,8 +20,7 @@ export declare function getAspectRatioOptions(aspectRatioPresets?: AspectRatioPr
20
20
  /**
21
21
  * Thin selector over the composite media-editor store for the Crop
22
22
  * sidebar tab. Reads the cropOptions slice (preset key) and exposes
23
- * the corresponding setters plus a render-time `resolvedAspectRatio`
24
- * derivation.
23
+ * the corresponding setters plus the ratio the image editor has locked.
25
24
  *
26
25
  * No local React state, no refs, no synchronization effects — the
27
26
  * composite store is the single source of truth.
@@ -1 +1 @@
1
- {"version":3,"file":"use-crop-options.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor/use-crop-options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAO3E,UAAU,kBAAkB;IAC3B,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED,UAAU,oBAAoB;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IAC/C,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IACxC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACpC,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,GACtC,iBAAiB,EAAE,CAMrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAE,EAC/B,kBAAkB,GAClB,GAAE,kBAAuB,GAAI,oBAAoB,CAqBjD"}
1
+ {"version":3,"file":"use-crop-options.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor/use-crop-options.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,KAAK,iBAAiB,EACtB,MAAM,kCAAkC,CAAC;AAG1C,UAAU,kBAAkB;IAC3B,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED,UAAU,oBAAoB;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IAC/C,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IACxC,mBAAmB,EAAE,MAAM,GAAG,SAAS,CAAC;CACxC;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACpC,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,GACtC,iBAAiB,EAAE,CAMrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAE,EAC/B,kBAAkB,GAClB,GAAE,kBAAuB,GAAI,oBAAoB,CAmBjD"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-save-media-editor.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor/use-save-media-editor.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAiBtD,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAI3D,MAAM,WAAW,qBAAqB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,GAAG,CAAC,EAAE,MAAM,CAAC;KACb,CAAC;CACF;AAED,UAAU,sBAAsB;IAC/B,OAAO,EAAE,kBAAkB,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAE,MAAM,EAAE,qBAAqB,KAAM,IAAI,CAAC;IACpD;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,KAAK,CAAC;KACb,CAAC;CACF;AAED,UAAU,wBAAwB;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,OAAO,CAAE,IAAI,CAAE,CAAC;CAC5B;AA6BD,wBAAgB,kBAAkB,CAAE,EACnC,OAAO,EACP,EAAE,EACF,OAAO,EACP,KAAK,EACL,OAAO,EACP,iBAAiB,GACjB,EAAE,sBAAsB,GAAI,wBAAwB,CAkJpD"}
1
+ {"version":3,"file":"use-save-media-editor.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor/use-save-media-editor.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAwCtD,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAI3D,MAAM,WAAW,qBAAqB;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE;QACV,EAAE,EAAE,MAAM,CAAC;QACX,GAAG,CAAC,EAAE,MAAM,CAAC;KACb,CAAC;CACF;AAED,UAAU,sBAAsB;IAC/B,OAAO,EAAE,kBAAkB,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAE,MAAM,EAAE,qBAAqB,KAAM,IAAI,CAAC;IACpD;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,KAAK,CAAC;KACb,CAAC;CACF;AAED,UAAU,wBAAwB;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,OAAO,CAAE,IAAI,CAAE,CAAC;CAC5B;AA+CD,wBAAgB,kBAAkB,CAAE,EACnC,OAAO,EACP,EAAE,EACF,OAAO,EACP,KAAK,EACL,OAAO,EACP,iBAAiB,GACjB,EAAE,sBAAsB,GAAI,wBAAwB,CAkJpD"}
@@ -1,9 +1,9 @@
1
1
  export interface MediaEditorCanvasProps {
2
2
  /** Whether external placement activity should reveal the grid. */
3
3
  isPlacementActive?: boolean;
4
- /** Fires when a canvas cropper gesture begins. */
4
+ /** Fires when a canvas gesture begins. */
5
5
  onGestureStart?: () => void;
6
- /** Fires when a canvas cropper gesture ends. */
6
+ /** Fires when a canvas gesture ends. */
7
7
  onGestureEnd?: () => void;
8
8
  /**
9
9
  * Disable crop interaction on the canvas. Set while the edit is saving,
@@ -13,7 +13,7 @@ export interface MediaEditorCanvasProps {
13
13
  }
14
14
  /**
15
15
  * Editing surface for image media in the media editor modal. Pulls
16
- * its cropper controller from the surrounding `<MediaEditorStateProvider>`
16
+ * its image editor controller from the surrounding `<MediaEditorStateProvider>`
17
17
  * so the bottom bar and Crop sidebar tab share the same state.
18
18
  *
19
19
  * Returns `null` for missing or non-image media so the modal's outer
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-canvas/index.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,sBAAsB;IACtC,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kDAAkD;IAClD,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAE,EAC1C,iBAAyB,EACzB,cAAc,EACd,YAAY,EACZ,QAAgB,GAChB,EAAE,sBAAsB,sCAwHxB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-canvas/index.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,sBAAsB;IACtC,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAE,EAC1C,iBAAyB,EACzB,cAAc,EACd,YAAY,EACZ,QAAgB,GAChB,EAAE,sBAAsB,sCA6GxB"}
@@ -1,4 +1,4 @@
1
- import type { AspectRatioPreset } from '../../image-editor/core/constants';
1
+ import type { AspectRatioPreset } from '../../state/aspect-ratio-presets';
2
2
  export interface MediaEditorCropPanelProps {
3
3
  /**
4
4
  * Selected aspect-ratio preset value as a string (so it round-trips
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-crop-panel/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,MAAM,WAAW,yBAAyB;IACzC;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,mBAAmB,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IAC/C,uDAAuD;IACvD,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IACxC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAE,EAC7C,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,QAAgB,GAChB,EAAE,yBAAyB,+BAmC3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-crop-panel/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAI1E,MAAM,WAAW,yBAAyB;IACzC;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB,gDAAgD;IAChD,mBAAmB,EAAE,CAAE,KAAK,EAAE,MAAM,KAAM,IAAI,CAAC;IAC/C,uDAAuD;IACvD,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IACxC,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAE,EAC7C,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,QAAgB,GAChB,EAAE,yBAAyB,+BAsE3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-fine-rotation/index.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,4BAA4B;IAC5C,kEAAkE;IAClE,6BAA6B,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAE,EAChD,6BAA6B,EAC7B,QAAgB,GAChB,EAAE,4BAA4B,+BA8C9B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-fine-rotation/index.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,4BAA4B;IAC5C,kEAAkE;IAClE,6BAA6B,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAE,EAChD,6BAA6B,EAC7B,QAAgB,GAChB,EAAE,4BAA4B,+BA+C9B"}
@@ -1,4 +1,4 @@
1
- import { type AspectRatioPreset } from '../../image-editor/core/constants';
1
+ import type { AspectRatioPreset } from '../../state/aspect-ratio-presets';
2
2
  /**
3
3
  * Default zoom factor per +/- click. Zooming is geometric, so a fixed
4
4
  * multiplier — rather than an additive step — makes each click feel like the
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-image-controls/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAEN,KAAK,iBAAiB,EACtB,MAAM,mCAAmC,CAAC;AAI3C;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,MAAM,WAAW,6BAA6B;IAC7C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,qDAAqD;IACrD,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACzC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAE,EACjD,UAAkB,EAClB,sBAA8B,EAC9B,kBAAkB,EAClB,UAAgC,EAChC,QAAgB,GAChB,EAAE,6BAA6B,+BAmM/B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-image-controls/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAG1E;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,MAAM,WAAW,6BAA6B;IAC7C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,qDAAqD;IACrD,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACzC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAE,EACjD,UAAkB,EAClB,sBAA8B,EAC9B,kBAAkB,EAClB,UAAgC,EAChC,QAAgB,GAChB,EAAE,6BAA6B,+BAwM/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-keyboard-shortcuts-modal/index.tsx"],"names":[],"mappings":"AAiIA,UAAU,sCAAsC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,iCAAiC,CAAE,EAC1D,OAAO,GACP,EAAE,sCAAsC,+BAsCxC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-keyboard-shortcuts-modal/index.tsx"],"names":[],"mappings":"AA4HA,UAAU,sCAAsC;IAC/C,OAAO,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,iCAAiC,CAAE,EAC1D,OAAO,GACP,EAAE,sCAAsC,+BAoCxC"}
@@ -1,6 +1,6 @@
1
1
  import type { Field, Form } from '@wordpress/dataviews';
2
+ import type { AspectRatioPreset } from '../../state/aspect-ratio-presets';
2
3
  import type { Media } from '../media-editor-provider';
3
- import type { AspectRatioPreset } from '../../image-editor/core/constants';
4
4
  interface MediaEditorModalProps {
5
5
  /**
6
6
  * Attachment fields to render in the Details tab.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-modal/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAGtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,UAAU,qBAAqB;IAC9B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,KAAK,CAAE,KAAK,CAAE,EAAE,CAAC;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;;OAGG;IACH,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAqBD,wBAAgB,gBAAgB,CAAE,EACjC,MAAW,EACX,IAAI,EACJ,kBAAkB,GAClB,EAAE,qBAAqB,sCAiHvB;eAEc,gBAAgB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-modal/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAItD,UAAU,qBAAqB;IAC9B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,KAAK,CAAE,KAAK,CAAE,EAAE,CAAC;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;;OAGG;IACH,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAqBD,wBAAgB,gBAAgB,CAAE,EACjC,MAAW,EACX,IAAI,EACJ,kBAAkB,GAClB,EAAE,qBAAqB,sCAoHvB;eAEc,gBAAgB"}
@@ -0,0 +1,23 @@
1
+ import { Component } from '@wordpress/element';
2
+ import type { ReactNode } from 'react';
3
+ interface Props {
4
+ title: string;
5
+ children: ReactNode;
6
+ }
7
+ interface State {
8
+ /** Separate from `error`: a panel can throw a falsy value. */
9
+ hasError: boolean;
10
+ error: unknown;
11
+ }
12
+ /**
13
+ * Keeps a panel's failure inside its tab, so the rest of the editor stays
14
+ * usable.
15
+ */
16
+ export default class MediaEditorPanelErrorBoundary extends Component<Props, State> {
17
+ state: State;
18
+ static getDerivedStateFromError(error: unknown): State;
19
+ componentDidCatch(): void;
20
+ render(): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
21
+ }
22
+ export {};
23
+ //# sourceMappingURL=error-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../../src/components/media-editor-panel/error-boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAK/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,UAAU,KAAK;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,SAAS,CAAC;CACpB;AAED,UAAU,KAAK;IACd,8DAA8D;IAC9D,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;CACf;AAqCD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,6BAA8B,SAAQ,SAAS,CACnE,KAAK,EACL,KAAK,CACL;IACA,KAAK,EAAE,KAAK,CAAoC;IAEhD,MAAM,CAAC,wBAAwB,CAAE,KAAK,EAAE,OAAO,GAAI,KAAK,CAEvD;IAED,iBAAiB,SAGhB;IAED,MAAM,gUAcL;CACD"}