@wordpress/block-library 10.1.0 → 10.2.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 (926) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/build/accordion/block.json +1 -0
  3. package/build/accordion/edit.cjs +0 -1
  4. package/build/accordion/edit.cjs.map +2 -2
  5. package/build/accordion/view.cjs +23 -0
  6. package/build/accordion/view.cjs.map +2 -2
  7. package/build/accordion-heading/deprecated.cjs +121 -1
  8. package/build/accordion-heading/deprecated.cjs.map +2 -2
  9. package/build/accordion-heading/edit.cjs +18 -1
  10. package/build/accordion-heading/edit.cjs.map +3 -3
  11. package/build/accordion-heading/save.cjs +18 -1
  12. package/build/accordion-heading/save.cjs.map +3 -3
  13. package/build/accordion-panel/edit.cjs +1 -1
  14. package/build/accordion-panel/edit.cjs.map +2 -2
  15. package/build/archives/edit.cjs +0 -1
  16. package/build/archives/edit.cjs.map +2 -2
  17. package/build/audio/edit.cjs +0 -1
  18. package/build/audio/edit.cjs.map +2 -2
  19. package/build/avatar/edit.cjs +0 -1
  20. package/build/avatar/edit.cjs.map +2 -2
  21. package/build/avatar/user-control.cjs +0 -1
  22. package/build/avatar/user-control.cjs.map +2 -2
  23. package/build/button/edit.cjs +18 -8
  24. package/build/button/edit.cjs.map +2 -2
  25. package/build/categories/edit.cjs +0 -1
  26. package/build/categories/edit.cjs.map +2 -2
  27. package/build/code/transforms.cjs +5 -3
  28. package/build/code/transforms.cjs.map +2 -2
  29. package/build/column/edit.cjs +0 -1
  30. package/build/column/edit.cjs.map +2 -2
  31. package/build/columns/edit.cjs +0 -1
  32. package/build/columns/edit.cjs.map +2 -2
  33. package/build/columns/transforms.cjs +9 -2
  34. package/build/columns/transforms.cjs.map +2 -2
  35. package/build/comment-author-avatar/edit.cjs +0 -1
  36. package/build/comment-author-avatar/edit.cjs.map +2 -2
  37. package/build/comments-pagination/comments-pagination-arrow-controls.cjs +0 -1
  38. package/build/comments-pagination/comments-pagination-arrow-controls.cjs.map +2 -2
  39. package/build/cover/block.json +11 -0
  40. package/build/cover/edit/block-controls.cjs +11 -4
  41. package/build/cover/edit/block-controls.cjs.map +2 -2
  42. package/build/cover/edit/embed-video-url-input.cjs +5 -3
  43. package/build/cover/edit/embed-video-url-input.cjs.map +3 -3
  44. package/build/cover/edit/index.cjs +1 -1
  45. package/build/cover/edit/index.cjs.map +2 -2
  46. package/build/cover/edit/inspector-controls.cjs +1 -3
  47. package/build/cover/edit/inspector-controls.cjs.map +2 -2
  48. package/build/cover/embed-video-utils.cjs +17 -7
  49. package/build/cover/embed-video-utils.cjs.map +2 -2
  50. package/build/details/transforms.cjs +1 -1
  51. package/build/details/transforms.cjs.map +2 -2
  52. package/build/embed/edit.cjs +2 -3
  53. package/build/embed/edit.cjs.map +2 -2
  54. package/build/embed/embed-placeholder.cjs +20 -21
  55. package/build/embed/embed-placeholder.cjs.map +3 -3
  56. package/build/file/edit.cjs +4 -3
  57. package/build/file/edit.cjs.map +2 -2
  58. package/build/file/inspector.cjs +0 -2
  59. package/build/file/inspector.cjs.map +2 -2
  60. package/build/file/transforms.cjs +25 -60
  61. package/build/file/transforms.cjs.map +2 -2
  62. package/build/form/edit.cjs +0 -2
  63. package/build/form/edit.cjs.map +2 -2
  64. package/build/freeform/convert-to-blocks-button.cjs +52 -0
  65. package/build/freeform/convert-to-blocks-button.cjs.map +7 -0
  66. package/build/freeform/edit.cjs +14 -33
  67. package/build/freeform/edit.cjs.map +3 -3
  68. package/build/freeform/index.cjs +1 -7
  69. package/build/freeform/index.cjs.map +3 -3
  70. package/build/gallery/block.json +8 -3
  71. package/build/gallery/dynamic-gallery.cjs +263 -0
  72. package/build/gallery/dynamic-gallery.cjs.map +7 -0
  73. package/build/gallery/dynamic-source.cjs +85 -0
  74. package/build/gallery/dynamic-source.cjs.map +7 -0
  75. package/build/gallery/edit.cjs +286 -206
  76. package/build/gallery/edit.cjs.map +3 -3
  77. package/build/gallery/gallery.cjs +0 -3
  78. package/build/gallery/gallery.cjs.map +2 -2
  79. package/build/gallery/gap-styles.cjs +49 -13
  80. package/build/gallery/gap-styles.cjs.map +3 -3
  81. package/build/gallery/index.cjs +2 -0
  82. package/build/gallery/index.cjs.map +3 -3
  83. package/build/gallery/save.cjs +16 -12
  84. package/build/gallery/save.cjs.map +2 -2
  85. package/build/gallery/use-dynamic-gallery.cjs +181 -0
  86. package/build/gallery/use-dynamic-gallery.cjs.map +7 -0
  87. package/build/gallery/variations.cjs +54 -0
  88. package/build/gallery/variations.cjs.map +7 -0
  89. package/build/group/edit.cjs +1 -2
  90. package/build/group/edit.cjs.map +2 -2
  91. package/build/group/transforms.cjs +3 -7
  92. package/build/group/transforms.cjs.map +2 -2
  93. package/build/heading/edit.cjs +10 -3
  94. package/build/heading/edit.cjs.map +2 -2
  95. package/build/html/block.json +2 -2
  96. package/build/html/edit.cjs +65 -23
  97. package/build/html/edit.cjs.map +3 -3
  98. package/build/html/index.cjs +3 -3
  99. package/build/html/index.cjs.map +2 -2
  100. package/build/html/modal.cjs +4 -8
  101. package/build/html/modal.cjs.map +2 -2
  102. package/build/html/save.cjs +2 -4
  103. package/build/html/save.cjs.map +2 -2
  104. package/build/html/transforms.cjs +7 -5
  105. package/build/html/transforms.cjs.map +2 -2
  106. package/build/icon/components/custom-inserter/icon-grid.cjs +25 -12
  107. package/build/icon/components/custom-inserter/icon-grid.cjs.map +2 -2
  108. package/build/icon/components/custom-inserter/index.cjs +100 -31
  109. package/build/icon/components/custom-inserter/index.cjs.map +3 -3
  110. package/build/icon/edit.cjs +11 -12
  111. package/build/icon/edit.cjs.map +2 -2
  112. package/build/image/block.json +1 -1
  113. package/build/image/image.cjs +23 -70
  114. package/build/image/image.cjs.map +3 -3
  115. package/build/image/transforms.cjs +78 -0
  116. package/build/image/transforms.cjs.map +3 -3
  117. package/build/index.cjs +18 -8
  118. package/build/index.cjs.map +2 -2
  119. package/build/latest-comments/edit.cjs +0 -2
  120. package/build/latest-comments/edit.cjs.map +2 -2
  121. package/build/latest-posts/block.json +8 -9
  122. package/build/latest-posts/constants.cjs +0 -3
  123. package/build/latest-posts/constants.cjs.map +2 -2
  124. package/build/latest-posts/deprecated.cjs +100 -8
  125. package/build/latest-posts/deprecated.cjs.map +2 -2
  126. package/build/latest-posts/edit.cjs +67 -84
  127. package/build/latest-posts/edit.cjs.map +2 -2
  128. package/build/list/ordered-list-settings.cjs +0 -1
  129. package/build/list/ordered-list-settings.cjs.map +2 -2
  130. package/build/list-item/edit.cjs +1 -1
  131. package/build/list-item/edit.cjs.map +2 -2
  132. package/build/list-item/hooks/use-enter.cjs +14 -17
  133. package/build/list-item/hooks/use-enter.cjs.map +3 -3
  134. package/build/list-item/hooks/use-space.cjs +3 -2
  135. package/build/list-item/hooks/use-space.cjs.map +3 -3
  136. package/build/media-text/edit.cjs +0 -1
  137. package/build/media-text/edit.cjs.map +2 -2
  138. package/build/missing/edit.cjs +1 -3
  139. package/build/missing/edit.cjs.map +2 -2
  140. package/build/navigation/edit/index.cjs +0 -1
  141. package/build/navigation/edit/index.cjs.map +2 -2
  142. package/build/navigation/edit/overlay-menu-preview-controls.cjs +0 -1
  143. package/build/navigation/edit/overlay-menu-preview-controls.cjs.map +2 -2
  144. package/build/navigation/edit/overlay-menu-preview.cjs +0 -1
  145. package/build/navigation/edit/overlay-menu-preview.cjs.map +2 -2
  146. package/build/navigation/edit/overlay-template-part-selector.cjs +0 -1
  147. package/build/navigation/edit/overlay-template-part-selector.cjs.map +2 -2
  148. package/build/navigation/edit/overlay-visibility-control.cjs +0 -1
  149. package/build/navigation/edit/overlay-visibility-control.cjs.map +2 -2
  150. package/build/navigation-link/shared/use-link-preview.cjs +11 -1
  151. package/build/navigation-link/shared/use-link-preview.cjs.map +2 -2
  152. package/build/navigation-overlay-close/edit.cjs +0 -1
  153. package/build/navigation-overlay-close/edit.cjs.map +2 -2
  154. package/build/page-list/edit.cjs +0 -1
  155. package/build/page-list/edit.cjs.map +2 -2
  156. package/build/paragraph/block.json +1 -0
  157. package/build/paragraph/use-enter.cjs +3 -7
  158. package/build/paragraph/use-enter.cjs.map +3 -3
  159. package/build/playlist/block.json +28 -15
  160. package/build/playlist/context.cjs +36 -0
  161. package/build/playlist/context.cjs.map +7 -0
  162. package/build/playlist/edit.cjs +257 -81
  163. package/build/playlist/edit.cjs.map +3 -3
  164. package/build/playlist/index.cjs +1 -1
  165. package/build/playlist/index.cjs.map +2 -2
  166. package/build/playlist/utils.cjs +19 -8
  167. package/build/playlist/utils.cjs.map +3 -3
  168. package/build/playlist/view.cjs +87 -17
  169. package/build/playlist/view.cjs.map +2 -2
  170. package/build/playlist-track/block.json +4 -5
  171. package/build/playlist-track/edit.cjs +114 -70
  172. package/build/playlist-track/edit.cjs.map +3 -3
  173. package/build/post-author/edit.cjs +0 -2
  174. package/build/post-author/edit.cjs.map +2 -2
  175. package/build/post-content/block.json +1 -0
  176. package/build/post-excerpt/edit.cjs +0 -1
  177. package/build/post-excerpt/edit.cjs.map +2 -2
  178. package/build/post-featured-image/overlay-controls.cjs +1 -2
  179. package/build/post-featured-image/overlay-controls.cjs.map +2 -2
  180. package/build/post-navigation-link/edit.cjs +0 -2
  181. package/build/post-navigation-link/edit.cjs.map +2 -2
  182. package/build/post-template/block.json +2 -1
  183. package/build/post-template/edit.cjs +10 -1
  184. package/build/post-template/edit.cjs.map +2 -2
  185. package/build/pullquote/block.json +3 -1
  186. package/build/query/block.json +3 -2
  187. package/build/query/edit/inspector-controls/author-control.cjs +1 -2
  188. package/build/query/edit/inspector-controls/author-control.cjs.map +2 -2
  189. package/build/query/edit/inspector-controls/format-controls.cjs +1 -2
  190. package/build/query/edit/inspector-controls/format-controls.cjs.map +2 -2
  191. package/build/query/edit/inspector-controls/index.cjs +38 -7
  192. package/build/query/edit/inspector-controls/index.cjs.map +2 -2
  193. package/build/query/edit/inspector-controls/offset-controls.cjs +0 -1
  194. package/build/query/edit/inspector-controls/offset-controls.cjs.map +2 -2
  195. package/build/query/edit/inspector-controls/order-control.cjs +0 -1
  196. package/build/query/edit/inspector-controls/order-control.cjs.map +2 -2
  197. package/build/query/edit/inspector-controls/pages-control.cjs +0 -1
  198. package/build/query/edit/inspector-controls/pages-control.cjs.map +2 -2
  199. package/build/query/edit/inspector-controls/parent-control.cjs +0 -1
  200. package/build/query/edit/inspector-controls/parent-control.cjs.map +2 -2
  201. package/build/query/edit/inspector-controls/per-page-control.cjs +0 -1
  202. package/build/query/edit/inspector-controls/per-page-control.cjs.map +2 -2
  203. package/build/query/edit/inspector-controls/sticky-control.cjs +0 -1
  204. package/build/query/edit/inspector-controls/sticky-control.cjs.map +2 -2
  205. package/build/query/edit/inspector-controls/taxonomy-controls.cjs +1 -2
  206. package/build/query/edit/inspector-controls/taxonomy-controls.cjs.map +2 -2
  207. package/build/query/edit/query-content.cjs +10 -3
  208. package/build/query/edit/query-content.cjs.map +2 -2
  209. package/build/query/index.cjs +2 -1
  210. package/build/query/index.cjs.map +2 -2
  211. package/build/query-pagination/query-pagination-arrow-controls.cjs +0 -1
  212. package/build/query-pagination/query-pagination-arrow-controls.cjs.map +2 -2
  213. package/build/query-pagination-numbers/edit.cjs +0 -1
  214. package/build/query-pagination-numbers/edit.cjs.map +2 -2
  215. package/build/quote/block.json +3 -1
  216. package/build/quote/transforms.cjs +1 -7
  217. package/build/quote/transforms.cjs.map +2 -2
  218. package/build/rss/edit.cjs +0 -4
  219. package/build/rss/edit.cjs.map +2 -2
  220. package/build/search/edit.cjs +0 -4
  221. package/build/search/edit.cjs.map +2 -2
  222. package/build/separator/edit.cjs +1 -2
  223. package/build/separator/edit.cjs.map +2 -2
  224. package/build/site-logo/edit.cjs +34 -63
  225. package/build/site-logo/edit.cjs.map +3 -3
  226. package/build/social-links/edit.cjs +0 -1
  227. package/build/social-links/edit.cjs.map +2 -2
  228. package/build/spacer/controls.cjs +2 -4
  229. package/build/spacer/controls.cjs.map +2 -2
  230. package/build/spacer/edit.cjs +1 -2
  231. package/build/spacer/edit.cjs.map +2 -2
  232. package/build/tab-list/block.json +5 -4
  233. package/build/tab-list/edit.cjs +95 -54
  234. package/build/tab-list/edit.cjs.map +3 -3
  235. package/build/tab-list/save.cjs +4 -3
  236. package/build/tab-list/save.cjs.map +2 -2
  237. package/build/tab-panel/block.json +1 -6
  238. package/build/tab-panel/controls.cjs +2 -4
  239. package/build/tab-panel/controls.cjs.map +3 -3
  240. package/build/tab-panel/edit.cjs +15 -15
  241. package/build/tab-panel/edit.cjs.map +2 -2
  242. package/build/tab-panels/block.json +0 -1
  243. package/build/tab-panels/edit.cjs +2 -4
  244. package/build/tab-panels/edit.cjs.map +3 -3
  245. package/build/table-of-contents/edit.cjs +0 -1
  246. package/build/table-of-contents/edit.cjs.map +2 -2
  247. package/build/tabs/block.json +0 -5
  248. package/build/tabs/edit.cjs +6 -41
  249. package/build/tabs/edit.cjs.map +3 -3
  250. package/build/tabs/tab-toolbar-controls.cjs +74 -0
  251. package/build/tabs/tab-toolbar-controls.cjs.map +7 -0
  252. package/build/tabs/use-tab-actions.cjs +87 -0
  253. package/build/tabs/use-tab-actions.cjs.map +7 -0
  254. package/build/tabs/use-tab-list-items-sync.cjs +23 -5
  255. package/build/tabs/use-tab-list-items-sync.cjs.map +2 -2
  256. package/build/tag-cloud/edit.cjs +2 -6
  257. package/build/tag-cloud/edit.cjs.map +2 -2
  258. package/build/template-part/edit/advanced-controls.cjs +0 -1
  259. package/build/template-part/edit/advanced-controls.cjs.map +2 -2
  260. package/build/template-part/edit/import-controls.cjs +1 -2
  261. package/build/template-part/edit/import-controls.cjs.map +2 -2
  262. package/build/term-name/block.json +1 -3
  263. package/build/term-name/deprecated.cjs +105 -0
  264. package/build/term-name/deprecated.cjs.map +7 -0
  265. package/build/term-name/edit.cjs +11 -37
  266. package/build/term-name/edit.cjs.map +3 -3
  267. package/build/term-name/index.cjs +3 -1
  268. package/build/term-name/index.cjs.map +3 -3
  269. package/build/terms-query/edit/inspector-controls/include-control.cjs +0 -1
  270. package/build/terms-query/edit/inspector-controls/include-control.cjs.map +2 -2
  271. package/build/terms-query/edit/inspector-controls/inherit-control.cjs +0 -1
  272. package/build/terms-query/edit/inspector-controls/inherit-control.cjs.map +2 -2
  273. package/build/terms-query/edit/inspector-controls/max-terms-control.cjs +0 -1
  274. package/build/terms-query/edit/inspector-controls/max-terms-control.cjs.map +2 -2
  275. package/build/terms-query/edit/inspector-controls/order-control.cjs +0 -1
  276. package/build/terms-query/edit/inspector-controls/order-control.cjs.map +2 -2
  277. package/build/terms-query/edit/inspector-controls/taxonomy-control.cjs +0 -1
  278. package/build/terms-query/edit/inspector-controls/taxonomy-control.cjs.map +2 -2
  279. package/build/text-columns/edit.cjs +0 -1
  280. package/build/text-columns/edit.cjs.map +2 -2
  281. package/build/utils/waveform-player.cjs +138 -22
  282. package/build/utils/waveform-player.cjs.map +2 -2
  283. package/build/utils/waveform-utils.cjs +315 -17
  284. package/build/utils/waveform-utils.cjs.map +2 -2
  285. package/build/verse/block.json +3 -1
  286. package/build/video/block.json +6 -0
  287. package/build/video/edit-common-settings.cjs +0 -1
  288. package/build/video/edit-common-settings.cjs.map +2 -2
  289. package/build/video/edit.cjs +17 -1
  290. package/build/video/edit.cjs.map +2 -2
  291. package/build/video/index.cjs +2 -0
  292. package/build/video/index.cjs.map +3 -3
  293. package/build/video/save.cjs +7 -1
  294. package/build/video/save.cjs.map +2 -2
  295. package/build/video/tracks-editor.cjs +0 -1
  296. package/build/video/tracks-editor.cjs.map +2 -2
  297. package/build/video/variations.cjs +75 -0
  298. package/build/video/variations.cjs.map +7 -0
  299. package/build-module/accordion/block.json +1 -0
  300. package/build-module/accordion/edit.mjs +0 -1
  301. package/build-module/accordion/edit.mjs.map +2 -2
  302. package/build-module/accordion/view.mjs +23 -0
  303. package/build-module/accordion/view.mjs.map +2 -2
  304. package/build-module/accordion-heading/deprecated.mjs +121 -1
  305. package/build-module/accordion-heading/deprecated.mjs.map +2 -2
  306. package/build-module/accordion-heading/edit.mjs +8 -1
  307. package/build-module/accordion-heading/edit.mjs.map +2 -2
  308. package/build-module/accordion-heading/save.mjs +8 -1
  309. package/build-module/accordion-heading/save.mjs.map +2 -2
  310. package/build-module/accordion-panel/edit.mjs +1 -1
  311. package/build-module/accordion-panel/edit.mjs.map +2 -2
  312. package/build-module/archives/edit.mjs +0 -1
  313. package/build-module/archives/edit.mjs.map +2 -2
  314. package/build-module/audio/edit.mjs +0 -1
  315. package/build-module/audio/edit.mjs.map +2 -2
  316. package/build-module/avatar/edit.mjs +0 -1
  317. package/build-module/avatar/edit.mjs.map +2 -2
  318. package/build-module/avatar/user-control.mjs +0 -1
  319. package/build-module/avatar/user-control.mjs.map +2 -2
  320. package/build-module/button/edit.mjs +19 -14
  321. package/build-module/button/edit.mjs.map +2 -2
  322. package/build-module/categories/edit.mjs +0 -1
  323. package/build-module/categories/edit.mjs.map +2 -2
  324. package/build-module/code/transforms.mjs +6 -4
  325. package/build-module/code/transforms.mjs.map +2 -2
  326. package/build-module/column/edit.mjs +0 -1
  327. package/build-module/column/edit.mjs.map +2 -2
  328. package/build-module/columns/edit.mjs +0 -1
  329. package/build-module/columns/edit.mjs.map +2 -2
  330. package/build-module/columns/transforms.mjs +9 -2
  331. package/build-module/columns/transforms.mjs.map +2 -2
  332. package/build-module/comment-author-avatar/edit.mjs +0 -1
  333. package/build-module/comment-author-avatar/edit.mjs.map +2 -2
  334. package/build-module/comments-pagination/comments-pagination-arrow-controls.mjs +0 -1
  335. package/build-module/comments-pagination/comments-pagination-arrow-controls.mjs.map +2 -2
  336. package/build-module/cover/block.json +11 -0
  337. package/build-module/cover/edit/block-controls.mjs +11 -4
  338. package/build-module/cover/edit/block-controls.mjs.map +2 -2
  339. package/build-module/cover/edit/embed-video-url-input.mjs +5 -4
  340. package/build-module/cover/edit/embed-video-url-input.mjs.map +2 -2
  341. package/build-module/cover/edit/index.mjs +1 -1
  342. package/build-module/cover/edit/index.mjs.map +2 -2
  343. package/build-module/cover/edit/inspector-controls.mjs +1 -3
  344. package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
  345. package/build-module/cover/embed-video-utils.mjs +16 -7
  346. package/build-module/cover/embed-video-utils.mjs.map +2 -2
  347. package/build-module/details/transforms.mjs +2 -2
  348. package/build-module/details/transforms.mjs.map +2 -2
  349. package/build-module/embed/edit.mjs +2 -3
  350. package/build-module/embed/edit.mjs.map +2 -2
  351. package/build-module/embed/embed-placeholder.mjs +20 -24
  352. package/build-module/embed/embed-placeholder.mjs.map +2 -2
  353. package/build-module/file/edit.mjs +4 -3
  354. package/build-module/file/edit.mjs.map +2 -2
  355. package/build-module/file/inspector.mjs +0 -2
  356. package/build-module/file/inspector.mjs.map +2 -2
  357. package/build-module/file/transforms.mjs +25 -60
  358. package/build-module/file/transforms.mjs.map +2 -2
  359. package/build-module/form/edit.mjs +0 -2
  360. package/build-module/form/edit.mjs.map +2 -2
  361. package/build-module/freeform/convert-to-blocks-button.mjs +31 -0
  362. package/build-module/freeform/convert-to-blocks-button.mjs.map +7 -0
  363. package/build-module/freeform/edit.mjs +15 -34
  364. package/build-module/freeform/edit.mjs.map +2 -2
  365. package/build-module/freeform/index.mjs +1 -7
  366. package/build-module/freeform/index.mjs.map +2 -2
  367. package/build-module/gallery/block.json +8 -3
  368. package/build-module/gallery/dynamic-gallery.mjs +253 -0
  369. package/build-module/gallery/dynamic-gallery.mjs.map +7 -0
  370. package/build-module/gallery/dynamic-source.mjs +55 -0
  371. package/build-module/gallery/dynamic-source.mjs.map +7 -0
  372. package/build-module/gallery/edit.mjs +291 -209
  373. package/build-module/gallery/edit.mjs.map +2 -2
  374. package/build-module/gallery/gallery.mjs +0 -3
  375. package/build-module/gallery/gallery.mjs.map +2 -2
  376. package/build-module/gallery/gap-styles.mjs +53 -14
  377. package/build-module/gallery/gap-styles.mjs.map +2 -2
  378. package/build-module/gallery/index.mjs +2 -0
  379. package/build-module/gallery/index.mjs.map +2 -2
  380. package/build-module/gallery/save.mjs +16 -12
  381. package/build-module/gallery/save.mjs.map +2 -2
  382. package/build-module/gallery/use-dynamic-gallery.mjs +167 -0
  383. package/build-module/gallery/use-dynamic-gallery.mjs.map +7 -0
  384. package/build-module/gallery/variations.mjs +33 -0
  385. package/build-module/gallery/variations.mjs.map +7 -0
  386. package/build-module/group/edit.mjs +1 -2
  387. package/build-module/group/edit.mjs.map +2 -2
  388. package/build-module/group/transforms.mjs +4 -8
  389. package/build-module/group/transforms.mjs.map +2 -2
  390. package/build-module/heading/edit.mjs +11 -4
  391. package/build-module/heading/edit.mjs.map +2 -2
  392. package/build-module/html/block.json +2 -2
  393. package/build-module/html/edit.mjs +69 -25
  394. package/build-module/html/edit.mjs.map +2 -2
  395. package/build-module/html/index.mjs +3 -3
  396. package/build-module/html/index.mjs.map +2 -2
  397. package/build-module/html/modal.mjs +4 -8
  398. package/build-module/html/modal.mjs.map +2 -2
  399. package/build-module/html/save.mjs +2 -4
  400. package/build-module/html/save.mjs.map +2 -2
  401. package/build-module/html/transforms.mjs +8 -6
  402. package/build-module/html/transforms.mjs.map +2 -2
  403. package/build-module/icon/components/custom-inserter/icon-grid.mjs +25 -12
  404. package/build-module/icon/components/custom-inserter/icon-grid.mjs.map +2 -2
  405. package/build-module/icon/components/custom-inserter/index.mjs +102 -33
  406. package/build-module/icon/components/custom-inserter/index.mjs.map +2 -2
  407. package/build-module/icon/edit.mjs +11 -12
  408. package/build-module/icon/edit.mjs.map +2 -2
  409. package/build-module/image/block.json +1 -1
  410. package/build-module/image/image.mjs +23 -71
  411. package/build-module/image/image.mjs.map +2 -2
  412. package/build-module/image/transforms.mjs +78 -0
  413. package/build-module/image/transforms.mjs.map +2 -2
  414. package/build-module/index.mjs +18 -8
  415. package/build-module/index.mjs.map +2 -2
  416. package/build-module/latest-comments/edit.mjs +0 -2
  417. package/build-module/latest-comments/edit.mjs.map +2 -2
  418. package/build-module/latest-posts/block.json +8 -9
  419. package/build-module/latest-posts/constants.mjs +0 -2
  420. package/build-module/latest-posts/constants.mjs.map +2 -2
  421. package/build-module/latest-posts/deprecated.mjs +100 -8
  422. package/build-module/latest-posts/deprecated.mjs.map +2 -2
  423. package/build-module/latest-posts/edit.mjs +67 -85
  424. package/build-module/latest-posts/edit.mjs.map +2 -2
  425. package/build-module/list/ordered-list-settings.mjs +0 -1
  426. package/build-module/list/ordered-list-settings.mjs.map +2 -2
  427. package/build-module/list-item/edit.mjs +1 -1
  428. package/build-module/list-item/edit.mjs.map +2 -2
  429. package/build-module/list-item/hooks/use-enter.mjs +15 -21
  430. package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
  431. package/build-module/list-item/hooks/use-space.mjs +4 -6
  432. package/build-module/list-item/hooks/use-space.mjs.map +2 -2
  433. package/build-module/media-text/edit.mjs +0 -1
  434. package/build-module/media-text/edit.mjs.map +2 -2
  435. package/build-module/missing/edit.mjs +1 -3
  436. package/build-module/missing/edit.mjs.map +2 -2
  437. package/build-module/navigation/edit/index.mjs +0 -1
  438. package/build-module/navigation/edit/index.mjs.map +2 -2
  439. package/build-module/navigation/edit/overlay-menu-preview-controls.mjs +0 -1
  440. package/build-module/navigation/edit/overlay-menu-preview-controls.mjs.map +2 -2
  441. package/build-module/navigation/edit/overlay-menu-preview.mjs +0 -1
  442. package/build-module/navigation/edit/overlay-menu-preview.mjs.map +2 -2
  443. package/build-module/navigation/edit/overlay-template-part-selector.mjs +0 -1
  444. package/build-module/navigation/edit/overlay-template-part-selector.mjs.map +2 -2
  445. package/build-module/navigation/edit/overlay-visibility-control.mjs +0 -1
  446. package/build-module/navigation/edit/overlay-visibility-control.mjs.map +2 -2
  447. package/build-module/navigation-link/shared/use-link-preview.mjs +11 -1
  448. package/build-module/navigation-link/shared/use-link-preview.mjs.map +2 -2
  449. package/build-module/navigation-overlay-close/edit.mjs +0 -1
  450. package/build-module/navigation-overlay-close/edit.mjs.map +2 -2
  451. package/build-module/page-list/edit.mjs +0 -1
  452. package/build-module/page-list/edit.mjs.map +2 -2
  453. package/build-module/paragraph/block.json +1 -0
  454. package/build-module/paragraph/use-enter.mjs +4 -11
  455. package/build-module/paragraph/use-enter.mjs.map +2 -2
  456. package/build-module/playlist/block.json +28 -15
  457. package/build-module/playlist/context.mjs +11 -0
  458. package/build-module/playlist/context.mjs.map +7 -0
  459. package/build-module/playlist/edit.mjs +262 -84
  460. package/build-module/playlist/edit.mjs.map +2 -2
  461. package/build-module/playlist/index.mjs +1 -1
  462. package/build-module/playlist/index.mjs.map +2 -2
  463. package/build-module/playlist/utils.mjs +17 -7
  464. package/build-module/playlist/utils.mjs.map +2 -2
  465. package/build-module/playlist/view.mjs +93 -18
  466. package/build-module/playlist/view.mjs.map +2 -2
  467. package/build-module/playlist-track/block.json +4 -5
  468. package/build-module/playlist-track/edit.mjs +117 -72
  469. package/build-module/playlist-track/edit.mjs.map +2 -2
  470. package/build-module/post-author/edit.mjs +0 -2
  471. package/build-module/post-author/edit.mjs.map +2 -2
  472. package/build-module/post-content/block.json +1 -0
  473. package/build-module/post-excerpt/edit.mjs +0 -1
  474. package/build-module/post-excerpt/edit.mjs.map +2 -2
  475. package/build-module/post-featured-image/overlay-controls.mjs +1 -2
  476. package/build-module/post-featured-image/overlay-controls.mjs.map +2 -2
  477. package/build-module/post-navigation-link/edit.mjs +0 -2
  478. package/build-module/post-navigation-link/edit.mjs.map +2 -2
  479. package/build-module/post-template/block.json +2 -1
  480. package/build-module/post-template/edit.mjs +10 -1
  481. package/build-module/post-template/edit.mjs.map +2 -2
  482. package/build-module/pullquote/block.json +3 -1
  483. package/build-module/query/block.json +3 -2
  484. package/build-module/query/edit/inspector-controls/author-control.mjs +1 -2
  485. package/build-module/query/edit/inspector-controls/author-control.mjs.map +2 -2
  486. package/build-module/query/edit/inspector-controls/format-controls.mjs +1 -2
  487. package/build-module/query/edit/inspector-controls/format-controls.mjs.map +2 -2
  488. package/build-module/query/edit/inspector-controls/index.mjs +40 -8
  489. package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
  490. package/build-module/query/edit/inspector-controls/offset-controls.mjs +0 -1
  491. package/build-module/query/edit/inspector-controls/offset-controls.mjs.map +2 -2
  492. package/build-module/query/edit/inspector-controls/order-control.mjs +0 -1
  493. package/build-module/query/edit/inspector-controls/order-control.mjs.map +2 -2
  494. package/build-module/query/edit/inspector-controls/pages-control.mjs +0 -1
  495. package/build-module/query/edit/inspector-controls/pages-control.mjs.map +2 -2
  496. package/build-module/query/edit/inspector-controls/parent-control.mjs +0 -1
  497. package/build-module/query/edit/inspector-controls/parent-control.mjs.map +2 -2
  498. package/build-module/query/edit/inspector-controls/per-page-control.mjs +0 -1
  499. package/build-module/query/edit/inspector-controls/per-page-control.mjs.map +2 -2
  500. package/build-module/query/edit/inspector-controls/sticky-control.mjs +0 -1
  501. package/build-module/query/edit/inspector-controls/sticky-control.mjs.map +2 -2
  502. package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs +1 -2
  503. package/build-module/query/edit/inspector-controls/taxonomy-controls.mjs.map +2 -2
  504. package/build-module/query/edit/query-content.mjs +10 -3
  505. package/build-module/query/edit/query-content.mjs.map +2 -2
  506. package/build-module/query/index.mjs +2 -1
  507. package/build-module/query/index.mjs.map +2 -2
  508. package/build-module/query-pagination/query-pagination-arrow-controls.mjs +0 -1
  509. package/build-module/query-pagination/query-pagination-arrow-controls.mjs.map +2 -2
  510. package/build-module/query-pagination-numbers/edit.mjs +0 -1
  511. package/build-module/query-pagination-numbers/edit.mjs.map +2 -2
  512. package/build-module/quote/block.json +3 -1
  513. package/build-module/quote/transforms.mjs +6 -8
  514. package/build-module/quote/transforms.mjs.map +2 -2
  515. package/build-module/rss/edit.mjs +0 -4
  516. package/build-module/rss/edit.mjs.map +2 -2
  517. package/build-module/search/edit.mjs +0 -4
  518. package/build-module/search/edit.mjs.map +2 -2
  519. package/build-module/separator/edit.mjs +1 -2
  520. package/build-module/separator/edit.mjs.map +2 -2
  521. package/build-module/site-logo/edit.mjs +34 -64
  522. package/build-module/site-logo/edit.mjs.map +2 -2
  523. package/build-module/social-links/edit.mjs +0 -1
  524. package/build-module/social-links/edit.mjs.map +2 -2
  525. package/build-module/spacer/controls.mjs +2 -4
  526. package/build-module/spacer/controls.mjs.map +2 -2
  527. package/build-module/spacer/edit.mjs +1 -2
  528. package/build-module/spacer/edit.mjs.map +2 -2
  529. package/build-module/tab-list/block.json +5 -4
  530. package/build-module/tab-list/edit.mjs +102 -56
  531. package/build-module/tab-list/edit.mjs.map +2 -2
  532. package/build-module/tab-list/save.mjs +5 -3
  533. package/build-module/tab-list/save.mjs.map +2 -2
  534. package/build-module/tab-panel/block.json +1 -6
  535. package/build-module/tab-panel/controls.mjs +2 -4
  536. package/build-module/tab-panel/controls.mjs.map +2 -2
  537. package/build-module/tab-panel/edit.mjs +16 -16
  538. package/build-module/tab-panel/edit.mjs.map +2 -2
  539. package/build-module/tab-panels/block.json +0 -1
  540. package/build-module/tab-panels/edit.mjs +2 -4
  541. package/build-module/tab-panels/edit.mjs.map +2 -2
  542. package/build-module/table-of-contents/edit.mjs +0 -1
  543. package/build-module/table-of-contents/edit.mjs.map +2 -2
  544. package/build-module/tabs/block.json +0 -5
  545. package/build-module/tabs/edit.mjs +7 -47
  546. package/build-module/tabs/edit.mjs.map +2 -2
  547. package/build-module/tabs/tab-toolbar-controls.mjs +46 -0
  548. package/build-module/tabs/tab-toolbar-controls.mjs.map +7 -0
  549. package/build-module/tabs/use-tab-actions.mjs +66 -0
  550. package/build-module/tabs/use-tab-actions.mjs.map +7 -0
  551. package/build-module/tabs/use-tab-list-items-sync.mjs +25 -7
  552. package/build-module/tabs/use-tab-list-items-sync.mjs.map +2 -2
  553. package/build-module/tag-cloud/edit.mjs +2 -6
  554. package/build-module/tag-cloud/edit.mjs.map +2 -2
  555. package/build-module/template-part/edit/advanced-controls.mjs +0 -1
  556. package/build-module/template-part/edit/advanced-controls.mjs.map +2 -2
  557. package/build-module/template-part/edit/import-controls.mjs +1 -2
  558. package/build-module/template-part/edit/import-controls.mjs.map +2 -2
  559. package/build-module/term-name/block.json +1 -3
  560. package/build-module/term-name/deprecated.mjs +74 -0
  561. package/build-module/term-name/deprecated.mjs.map +7 -0
  562. package/build-module/term-name/edit.mjs +11 -28
  563. package/build-module/term-name/edit.mjs.map +2 -2
  564. package/build-module/term-name/index.mjs +3 -1
  565. package/build-module/term-name/index.mjs.map +2 -2
  566. package/build-module/terms-query/edit/inspector-controls/include-control.mjs +0 -1
  567. package/build-module/terms-query/edit/inspector-controls/include-control.mjs.map +2 -2
  568. package/build-module/terms-query/edit/inspector-controls/inherit-control.mjs +0 -1
  569. package/build-module/terms-query/edit/inspector-controls/inherit-control.mjs.map +2 -2
  570. package/build-module/terms-query/edit/inspector-controls/max-terms-control.mjs +0 -1
  571. package/build-module/terms-query/edit/inspector-controls/max-terms-control.mjs.map +2 -2
  572. package/build-module/terms-query/edit/inspector-controls/order-control.mjs +0 -1
  573. package/build-module/terms-query/edit/inspector-controls/order-control.mjs.map +2 -2
  574. package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs +0 -1
  575. package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs.map +2 -2
  576. package/build-module/text-columns/edit.mjs +0 -1
  577. package/build-module/text-columns/edit.mjs.map +2 -2
  578. package/build-module/utils/waveform-player.mjs +144 -23
  579. package/build-module/utils/waveform-player.mjs.map +2 -2
  580. package/build-module/utils/waveform-utils.mjs +310 -16
  581. package/build-module/utils/waveform-utils.mjs.map +2 -2
  582. package/build-module/verse/block.json +3 -1
  583. package/build-module/video/block.json +6 -0
  584. package/build-module/video/edit-common-settings.mjs +0 -1
  585. package/build-module/video/edit-common-settings.mjs.map +2 -2
  586. package/build-module/video/edit.mjs +17 -1
  587. package/build-module/video/edit.mjs.map +2 -2
  588. package/build-module/video/index.mjs +2 -0
  589. package/build-module/video/index.mjs.map +2 -2
  590. package/build-module/video/save.mjs +7 -1
  591. package/build-module/video/save.mjs.map +2 -2
  592. package/build-module/video/tracks-editor.mjs +0 -1
  593. package/build-module/video/tracks-editor.mjs.map +2 -2
  594. package/build-module/video/variations.mjs +50 -0
  595. package/build-module/video/variations.mjs.map +7 -0
  596. package/build-style/accordion-panel/style-rtl.css +1 -2
  597. package/build-style/accordion-panel/style.css +1 -2
  598. package/build-style/audio/style-rtl.css +6 -0
  599. package/build-style/audio/style.css +6 -0
  600. package/build-style/audio/theme-rtl.css +6 -0
  601. package/build-style/audio/theme.css +6 -0
  602. package/build-style/columns/style-rtl.css +6 -0
  603. package/build-style/columns/style.css +6 -0
  604. package/build-style/common-rtl.css +6 -4
  605. package/build-style/common.css +6 -4
  606. package/build-style/editor-rtl.css +84 -24
  607. package/build-style/editor.css +84 -24
  608. package/build-style/embed/style-rtl.css +6 -0
  609. package/build-style/embed/style.css +6 -0
  610. package/build-style/embed/theme-rtl.css +6 -0
  611. package/build-style/embed/theme.css +6 -0
  612. package/build-style/freeform/editor-rtl.css +6 -0
  613. package/build-style/freeform/editor.css +6 -0
  614. package/build-style/gallery/editor-rtl.css +27 -3
  615. package/build-style/gallery/editor.css +27 -3
  616. package/build-style/gallery/style-rtl.css +6 -0
  617. package/build-style/gallery/style.css +6 -0
  618. package/build-style/gallery/theme-rtl.css +6 -0
  619. package/build-style/gallery/theme.css +6 -0
  620. package/build-style/html/editor-rtl.css +13 -0
  621. package/build-style/html/editor.css +13 -0
  622. package/build-style/icon/editor-rtl.css +80 -7
  623. package/build-style/icon/editor.css +80 -7
  624. package/build-style/image/editor-rtl.css +10 -0
  625. package/build-style/image/editor.css +10 -0
  626. package/build-style/image/style-rtl.css +6 -1
  627. package/build-style/image/style.css +6 -1
  628. package/build-style/image/theme-rtl.css +6 -0
  629. package/build-style/image/theme.css +6 -0
  630. package/build-style/latest-posts/style-rtl.css +26 -15
  631. package/build-style/latest-posts/style.css +26 -15
  632. package/build-style/more/editor-rtl.css +2 -2
  633. package/build-style/more/editor.css +2 -2
  634. package/build-style/navigation/editor-rtl.css +9 -4
  635. package/build-style/navigation/editor.css +9 -4
  636. package/build-style/navigation/style-rtl.css +6 -0
  637. package/build-style/navigation/style.css +6 -0
  638. package/build-style/navigation-link/editor-rtl.css +1 -1
  639. package/build-style/navigation-link/editor.css +1 -1
  640. package/build-style/navigation-submenu/editor-rtl.css +6 -0
  641. package/build-style/navigation-submenu/editor.css +6 -0
  642. package/build-style/nextpage/editor-rtl.css +2 -2
  643. package/build-style/nextpage/editor.css +2 -2
  644. package/build-style/page-list/editor-rtl.css +6 -0
  645. package/build-style/page-list/editor.css +6 -0
  646. package/build-style/playlist/editor-rtl.css +6 -0
  647. package/build-style/playlist/editor.css +6 -0
  648. package/build-style/playlist/style-rtl.css +158 -20
  649. package/build-style/playlist/style.css +158 -20
  650. package/build-style/playlist-track/style-rtl.css +10 -0
  651. package/build-style/playlist-track/style.css +10 -0
  652. package/build-style/post-template/style-rtl.css +6 -0
  653. package/build-style/post-template/style.css +6 -0
  654. package/build-style/query/editor-rtl.css +6 -0
  655. package/build-style/query/editor.css +6 -0
  656. package/build-style/rss/style-rtl.css +6 -0
  657. package/build-style/rss/style.css +6 -0
  658. package/build-style/shortcode/editor-rtl.css +6 -0
  659. package/build-style/shortcode/editor.css +6 -0
  660. package/build-style/style-rtl.css +192 -39
  661. package/build-style/style.css +192 -39
  662. package/build-style/table/editor-rtl.css +6 -0
  663. package/build-style/table/editor.css +6 -0
  664. package/build-style/table/theme-rtl.css +6 -0
  665. package/build-style/table/theme.css +6 -0
  666. package/build-style/template-part/editor-rtl.css +6 -0
  667. package/build-style/template-part/editor.css +6 -0
  668. package/build-style/theme-rtl.css +6 -0
  669. package/build-style/theme.css +6 -0
  670. package/build-style/video/editor-rtl.css +1 -1
  671. package/build-style/video/editor.css +1 -1
  672. package/build-style/video/style-rtl.css +6 -0
  673. package/build-style/video/style.css +6 -0
  674. package/build-style/video/theme-rtl.css +6 -0
  675. package/build-style/video/theme.css +6 -0
  676. package/build-types/table-of-contents/list.d.ts +1 -1
  677. package/build-types/table-of-contents/list.d.ts.map +1 -1
  678. package/package.json +48 -44
  679. package/src/accordion/README.md +2 -1
  680. package/src/accordion/block.json +1 -0
  681. package/src/accordion/edit.js +0 -1
  682. package/src/accordion/view.js +24 -0
  683. package/src/accordion-heading/README.md +1 -1
  684. package/src/accordion-heading/deprecated.js +122 -1
  685. package/src/accordion-heading/edit.js +12 -1
  686. package/src/accordion-heading/save.js +12 -1
  687. package/src/accordion-item/README.md +1 -1
  688. package/src/accordion-item/index.php +2 -1
  689. package/src/accordion-panel/edit.js +1 -1
  690. package/src/accordion-panel/style.scss +1 -4
  691. package/src/archives/edit.js +0 -1
  692. package/src/audio/edit.js +0 -1
  693. package/src/avatar/edit.js +0 -1
  694. package/src/avatar/user-control.js +0 -1
  695. package/src/button/edit.js +21 -15
  696. package/src/categories/edit.js +0 -1
  697. package/src/code/transforms.js +6 -4
  698. package/src/column/edit.js +0 -1
  699. package/src/columns/edit.js +0 -1
  700. package/src/columns/transforms.js +9 -2
  701. package/src/comment-author-avatar/edit.js +0 -1
  702. package/src/comments-pagination/comments-pagination-arrow-controls.js +0 -1
  703. package/src/common.scss +0 -4
  704. package/src/cover/README.md +60 -0
  705. package/src/cover/block.json +11 -0
  706. package/src/cover/edit/block-controls.js +21 -11
  707. package/src/cover/edit/embed-video-url-input.js +5 -4
  708. package/src/cover/edit/index.js +9 -11
  709. package/src/cover/edit/inspector-controls.js +0 -2
  710. package/src/cover/embed-video-utils.js +38 -13
  711. package/src/cover/test/edit.js +4 -4
  712. package/src/details/transforms.js +2 -2
  713. package/src/embed/edit.js +4 -5
  714. package/src/embed/embed-placeholder.js +16 -20
  715. package/src/file/edit.js +8 -8
  716. package/src/file/inspector.js +0 -2
  717. package/src/file/transforms.js +28 -60
  718. package/src/form/edit.js +0 -2
  719. package/src/freeform/convert-to-blocks-button.js +33 -0
  720. package/src/freeform/edit.js +11 -21
  721. package/src/freeform/index.js +1 -9
  722. package/src/gallery/README.md +4 -1
  723. package/src/gallery/block.json +8 -3
  724. package/src/gallery/dynamic-gallery.js +384 -0
  725. package/src/gallery/dynamic-source.js +117 -0
  726. package/src/gallery/edit.js +155 -49
  727. package/src/gallery/editor.scss +32 -4
  728. package/src/gallery/gallery.js +0 -7
  729. package/src/gallery/gap-styles.js +79 -20
  730. package/src/gallery/index.js +2 -0
  731. package/src/gallery/index.php +379 -42
  732. package/src/gallery/save.js +22 -11
  733. package/src/gallery/test/dynamic-source.js +90 -0
  734. package/src/gallery/use-dynamic-gallery.js +275 -0
  735. package/src/gallery/variations.js +37 -0
  736. package/src/group/edit.js +2 -3
  737. package/src/group/transforms.js +4 -8
  738. package/src/heading/edit.js +19 -14
  739. package/src/home-link/index.php +1 -1
  740. package/src/html/README.md +2 -1
  741. package/src/html/block.json +2 -2
  742. package/src/html/edit.js +86 -14
  743. package/src/html/editor.scss +10 -0
  744. package/src/html/index.js +3 -4
  745. package/src/html/modal.js +5 -9
  746. package/src/html/save.js +4 -7
  747. package/src/html/test/index.js +143 -0
  748. package/src/html/transforms.js +11 -6
  749. package/src/icon/components/custom-inserter/icon-grid.js +40 -11
  750. package/src/icon/components/custom-inserter/index.js +98 -25
  751. package/src/icon/edit.js +11 -17
  752. package/src/icon/editor.scss +33 -8
  753. package/src/icon/index.php +38 -45
  754. package/src/image/README.md +1 -1
  755. package/src/image/block.json +1 -1
  756. package/src/image/editor.scss +11 -0
  757. package/src/image/image.js +105 -169
  758. package/src/image/style.scss +0 -1
  759. package/src/image/test/use-open-image-media-editor-modal.js +19 -4
  760. package/src/image/transforms.js +128 -0
  761. package/src/index.js +19 -9
  762. package/src/latest-comments/edit.js +0 -2
  763. package/src/latest-posts/README.md +2 -2
  764. package/src/latest-posts/block.json +8 -9
  765. package/src/latest-posts/constants.js +0 -1
  766. package/src/latest-posts/deprecated.js +112 -9
  767. package/src/latest-posts/edit.js +38 -53
  768. package/src/latest-posts/index.php +60 -19
  769. package/src/latest-posts/style.scss +12 -2
  770. package/src/latest-posts/test/deprecated.js +153 -0
  771. package/src/list/ordered-list-settings.js +0 -1
  772. package/src/list-item/edit.js +1 -1
  773. package/src/list-item/hooks/use-enter.js +15 -22
  774. package/src/list-item/hooks/use-space.js +4 -6
  775. package/src/media-text/edit.js +0 -1
  776. package/src/media-text/editor.scss +1 -0
  777. package/src/missing/edit.js +1 -3
  778. package/src/more/editor.scss +1 -1
  779. package/src/navigation/edit/index.js +0 -1
  780. package/src/navigation/edit/overlay-menu-preview-controls.js +0 -1
  781. package/src/navigation/edit/overlay-menu-preview.js +0 -1
  782. package/src/navigation/edit/overlay-template-part-selector.js +0 -1
  783. package/src/navigation/edit/overlay-visibility-control.js +0 -1
  784. package/src/navigation/editor.scss +1 -2
  785. package/src/navigation-link/editor.scss +1 -1
  786. package/src/navigation-link/index.php +6 -3
  787. package/src/navigation-link/shared/test/controls.js +0 -4
  788. package/src/navigation-link/shared/test/use-entity-binding.js +8 -12
  789. package/src/navigation-link/shared/test/use-handle-link-change.test.js +0 -4
  790. package/src/navigation-link/shared/test/use-link-preview.test.js +17 -4
  791. package/src/navigation-link/shared/use-link-preview.js +24 -4
  792. package/src/navigation-overlay-close/edit.js +0 -1
  793. package/src/navigation-submenu/index.php +6 -3
  794. package/src/nextpage/editor.scss +1 -1
  795. package/src/page-list/edit.js +0 -1
  796. package/src/page-list/index.php +1 -1
  797. package/src/paragraph/README.md +1 -0
  798. package/src/paragraph/block.json +1 -0
  799. package/src/paragraph/use-enter.js +4 -11
  800. package/src/playlist/README.md +17 -20
  801. package/src/playlist/block.json +28 -15
  802. package/src/playlist/context.js +9 -0
  803. package/src/playlist/edit.js +298 -97
  804. package/src/playlist/editor.scss +6 -0
  805. package/src/playlist/index.js +1 -1
  806. package/src/playlist/index.php +91 -36
  807. package/src/playlist/style.scss +51 -6
  808. package/src/playlist/test/edit.js +13 -12
  809. package/src/playlist/utils.js +24 -12
  810. package/src/playlist/view.js +101 -20
  811. package/src/playlist-track/README.md +3 -5
  812. package/src/playlist-track/block.json +4 -5
  813. package/src/playlist-track/edit.js +116 -83
  814. package/src/playlist-track/index.php +24 -17
  815. package/src/playlist-track/style.scss +10 -0
  816. package/src/playlist-track/test/edit.js +169 -0
  817. package/src/post-author/edit.js +0 -2
  818. package/src/post-content/README.md +1 -0
  819. package/src/post-content/block.json +1 -0
  820. package/src/post-excerpt/edit.js +0 -1
  821. package/src/post-featured-image/overlay-controls.js +0 -1
  822. package/src/post-navigation-link/edit.js +0 -2
  823. package/src/post-template/README.md +1 -0
  824. package/src/post-template/block.json +2 -1
  825. package/src/post-template/edit.js +9 -0
  826. package/src/pullquote/README.md +1 -0
  827. package/src/pullquote/block.json +3 -1
  828. package/src/query/README.md +2 -1
  829. package/src/query/block.json +3 -2
  830. package/src/query/edit/inspector-controls/author-control.js +0 -1
  831. package/src/query/edit/inspector-controls/format-controls.js +0 -1
  832. package/src/query/edit/inspector-controls/index.js +43 -6
  833. package/src/query/edit/inspector-controls/offset-controls.js +0 -1
  834. package/src/query/edit/inspector-controls/order-control.js +0 -1
  835. package/src/query/edit/inspector-controls/pages-control.js +0 -1
  836. package/src/query/edit/inspector-controls/parent-control.js +0 -1
  837. package/src/query/edit/inspector-controls/per-page-control.js +0 -1
  838. package/src/query/edit/inspector-controls/sticky-control.js +0 -1
  839. package/src/query/edit/inspector-controls/taxonomy-controls.js +0 -1
  840. package/src/query/edit/query-content.js +19 -3
  841. package/src/query/index.js +1 -0
  842. package/src/query-pagination/query-pagination-arrow-controls.js +0 -1
  843. package/src/query-pagination-numbers/edit.js +0 -1
  844. package/src/quote/README.md +1 -0
  845. package/src/quote/block.json +3 -1
  846. package/src/quote/transforms.js +6 -8
  847. package/src/rss/edit.js +0 -4
  848. package/src/rss/index.php +1 -1
  849. package/src/search/edit.js +0 -4
  850. package/src/separator/edit.js +0 -1
  851. package/src/site-logo/edit.js +38 -78
  852. package/src/social-links/edit.js +0 -1
  853. package/src/spacer/controls.js +2 -4
  854. package/src/spacer/edit.js +2 -3
  855. package/src/tab-list/README.md +4 -5
  856. package/src/tab-list/block.json +5 -4
  857. package/src/tab-list/edit.js +133 -73
  858. package/src/tab-list/index.php +9 -4
  859. package/src/tab-list/save.js +5 -4
  860. package/src/tab-panel/README.md +4 -6
  861. package/src/tab-panel/block.json +1 -6
  862. package/src/tab-panel/controls.js +2 -4
  863. package/src/tab-panel/edit.js +19 -24
  864. package/src/tab-panels/README.md +5 -3
  865. package/src/tab-panels/block.json +0 -1
  866. package/src/tab-panels/edit.js +2 -4
  867. package/src/table-of-contents/edit.js +0 -1
  868. package/src/tabs/README.md +18 -9
  869. package/src/tabs/block.json +0 -5
  870. package/src/tabs/edit.js +8 -65
  871. package/src/tabs/tab-toolbar-controls.js +58 -0
  872. package/src/tabs/use-tab-actions.js +102 -0
  873. package/src/tabs/use-tab-list-items-sync.js +31 -12
  874. package/src/tag-cloud/edit.js +0 -4
  875. package/src/tag-cloud/index.php +1 -1
  876. package/src/template-part/edit/advanced-controls.js +0 -1
  877. package/src/template-part/edit/import-controls.js +0 -1
  878. package/src/template-part/index.php +1 -16
  879. package/src/term-name/README.md +1 -1
  880. package/src/term-name/block.json +1 -3
  881. package/src/term-name/deprecated.js +74 -0
  882. package/src/term-name/edit.js +2 -18
  883. package/src/term-name/index.js +2 -0
  884. package/src/terms-query/edit/inspector-controls/include-control.js +0 -1
  885. package/src/terms-query/edit/inspector-controls/inherit-control.js +0 -1
  886. package/src/terms-query/edit/inspector-controls/max-terms-control.js +0 -1
  887. package/src/terms-query/edit/inspector-controls/order-control.js +0 -1
  888. package/src/terms-query/edit/inspector-controls/taxonomy-control.js +0 -1
  889. package/src/text-columns/edit.js +0 -1
  890. package/src/utils/media-control.scss +1 -5
  891. package/src/utils/test/waveform-player.js +297 -38
  892. package/src/utils/test/waveform-utils.js +410 -9
  893. package/src/utils/waveform-player.js +189 -59
  894. package/src/utils/waveform-utils.js +443 -40
  895. package/src/verse/README.md +1 -0
  896. package/src/verse/block.json +3 -1
  897. package/src/video/README.md +2 -0
  898. package/src/video/block.json +6 -0
  899. package/src/video/edit-common-settings.js +0 -1
  900. package/src/video/edit.js +30 -1
  901. package/src/video/editor.scss +1 -1
  902. package/src/video/index.js +2 -0
  903. package/src/video/save.js +12 -0
  904. package/src/video/test/variations.js +65 -0
  905. package/src/video/tracks-editor.js +0 -1
  906. package/src/video/variations.js +65 -0
  907. package/build/freeform/migration-notice.cjs +0 -58
  908. package/build/freeform/migration-notice.cjs.map +0 -7
  909. package/build/tab-panel/add-tab-toolbar-control.cjs +0 -90
  910. package/build/tab-panel/add-tab-toolbar-control.cjs.map +0 -7
  911. package/build/tab-panel/remove-tab-toolbar-control.cjs +0 -99
  912. package/build/tab-panel/remove-tab-toolbar-control.cjs.map +0 -7
  913. package/build/tabs/controls.cjs +0 -45
  914. package/build/tabs/controls.cjs.map +0 -7
  915. package/build-module/freeform/migration-notice.mjs +0 -37
  916. package/build-module/freeform/migration-notice.mjs.map +0 -7
  917. package/build-module/tab-panel/add-tab-toolbar-control.mjs +0 -72
  918. package/build-module/tab-panel/add-tab-toolbar-control.mjs.map +0 -7
  919. package/build-module/tab-panel/remove-tab-toolbar-control.mjs +0 -81
  920. package/build-module/tab-panel/remove-tab-toolbar-control.mjs.map +0 -7
  921. package/build-module/tabs/controls.mjs +0 -14
  922. package/build-module/tabs/controls.mjs.map +0 -7
  923. package/src/freeform/migration-notice.js +0 -49
  924. package/src/tab-panel/add-tab-toolbar-control.js +0 -90
  925. package/src/tab-panel/remove-tab-toolbar-control.js +0 -110
  926. package/src/tabs/controls.js +0 -14
@@ -23,7 +23,6 @@ __export(image_exports, {
23
23
  default: () => Image
24
24
  });
25
25
  module.exports = __toCommonJS(image_exports);
26
- var import_blob = require("@wordpress/blob");
27
26
  var import_components = require("@wordpress/components");
28
27
  var import_compose = require("@wordpress/compose");
29
28
  var import_data = require("@wordpress/data");
@@ -50,7 +49,8 @@ var {
50
49
  DimensionsTool,
51
50
  isDefaultBlockStyleState,
52
51
  ResolutionTool,
53
- mediaEditKey
52
+ mediaEditKey,
53
+ mediaSideloadFromUrlKey
54
54
  } = (0, import_lock_unlock.unlock)(import_block_editor.privateApis);
55
55
  var scaleOptions = [
56
56
  {
@@ -337,8 +337,6 @@ function Image({
337
337
  { loadedNaturalWidth, loadedNaturalHeight },
338
338
  setLoadedNaturalSize
339
339
  ] = (0, import_element.useState)({});
340
- const [isEditingImage, setIsEditingImage] = (0, import_element.useState)(false);
341
- const [externalBlob, setExternalBlob] = (0, import_element.useState)();
342
340
  const [hasImageErrored, setHasImageErrored] = (0, import_element.useState)(false);
343
341
  const hasNonContentControls = blockEditingMode === "default";
344
342
  const isContentOnlyMode = blockEditingMode === "contentOnly";
@@ -363,17 +361,7 @@ function Image({
363
361
  setAttributes,
364
362
  __unstableMarkNextChangeAsNotPersistent
365
363
  ]);
366
- (0, import_element.useEffect)(() => {
367
- if (!(0, import_edit.isExternalImage)(id, url) || !isSingleSelected || !getSettings().mediaUpload) {
368
- setExternalBlob();
369
- return;
370
- }
371
- if (externalBlob) {
372
- return;
373
- }
374
- window.fetch(url.includes("?") ? url : url + "?").then((response) => response.blob()).then((blob) => setExternalBlob(blob)).catch(() => {
375
- });
376
- }, [id, url, isSingleSelected, externalBlob, getSettings]);
364
+ const canUploadExternalImage = isSingleSelected && (0, import_edit.isExternalImage)(id, url) && !!getSettings()[mediaSideloadFromUrlKey];
377
365
  const { naturalWidth, naturalHeight } = (0, import_element.useMemo)(() => {
378
366
  return {
379
367
  naturalWidth: imageElement?.naturalWidth || loadedNaturalWidth || void 0,
@@ -462,39 +450,25 @@ function Image({
462
450
  });
463
451
  }
464
452
  function uploadExternal() {
465
- const { mediaUpload } = getSettings();
466
- if (!mediaUpload) {
453
+ const mediaSideloadFromUrl = getSettings()[mediaSideloadFromUrlKey];
454
+ if (!mediaSideloadFromUrl) {
467
455
  return;
468
456
  }
469
- let notified = false;
470
- mediaUpload({
471
- filesList: [externalBlob],
472
- onFileChange([img2]) {
457
+ mediaSideloadFromUrl({
458
+ url,
459
+ onSuccess(img2) {
473
460
  onSelectImage(img2);
474
- if ((0, import_blob.isBlobURL)(img2.url)) {
475
- return;
476
- }
477
- if (!notified) {
478
- notified = true;
479
- setExternalBlob();
480
- createSuccessNotice((0, import_i18n.__)("Image uploaded."), {
481
- type: "snackbar"
482
- });
483
- }
461
+ createSuccessNotice((0, import_i18n.__)("Image uploaded."), {
462
+ type: "snackbar"
463
+ });
484
464
  },
485
- allowedTypes: import_constants.ALLOWED_MEDIA_TYPES,
486
465
  onError(message) {
487
466
  createErrorNotice(message, { type: "snackbar" });
488
467
  }
489
468
  });
490
469
  }
491
- (0, import_element.useEffect)(() => {
492
- if (!isSingleSelected) {
493
- setIsEditingImage(false);
494
- }
495
- }, [isSingleSelected]);
496
470
  const canEditImage = id && naturalWidth && naturalHeight && imageEditing && !!editMediaEntity;
497
- const allowCrop = isSingleSelected && canEditImage && !isEditingImage && !isContentOnlyMode && !isUploading;
471
+ const allowCrop = isSingleSelected && canEditImage && !!openImageMediaEditorModal && !isContentOnlyMode && !isUploading;
498
472
  function switchToCover() {
499
473
  replaceBlocks(
500
474
  clientId,
@@ -689,11 +663,10 @@ function Image({
689
663
  metadata?.bindings
690
664
  ]
691
665
  );
692
- const showUrlInput = isSingleSelected && !isEditingImage && !lockHrefControls && !lockUrlControls && !isDecorative;
666
+ const showUrlInput = isSingleSelected && !lockHrefControls && !lockUrlControls && !isDecorative;
693
667
  const showCoverControls = isSingleSelected && canInsertCover && !isContentOnlyMode;
694
668
  const showBlockControls = showUrlInput || allowCrop || showCoverControls;
695
- const mediaReplaceFlow = isSingleSelected && !isEditingImage && !lockUrlControls && // For contentOnly mode, put this button in its own area so it has borders around it.
696
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockControls, { group: isContentOnlyMode ? "inline" : "other", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
669
+ const mediaControls = isSingleSelected && !lockUrlControls && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockControls, { group: isContentOnlyMode ? "inline" : "other", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
697
670
  import_block_editor.MediaReplaceFlow,
698
671
  {
699
672
  mediaId: id,
@@ -706,7 +679,7 @@ function Image({
706
679
  onReset: () => onSelectImage(void 0),
707
680
  variant: "toolbar"
708
681
  }
709
- ) });
682
+ ) }) });
710
683
  const hasDataFormBlockFields = window?.__experimentalContentOnlyInspectorFields;
711
684
  const controls = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
712
685
  showBlockControls && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_block_editor.BlockControls, { group: "block", children: [
@@ -731,8 +704,8 @@ function Image({
731
704
  import_components.ToolbarButton,
732
705
  {
733
706
  ref: cropButtonRef,
734
- onClick: openImageMediaEditorModal ? openImageMediaEditorModal : () => setIsEditingImage(true),
735
- "aria-haspopup": openImageMediaEditorModal ? "dialog" : void 0,
707
+ onClick: openImageMediaEditorModal,
708
+ "aria-haspopup": "dialog",
736
709
  icon: import_icons.crop,
737
710
  label: (0, import_i18n.__)("Crop")
738
711
  }
@@ -746,7 +719,7 @@ function Image({
746
719
  }
747
720
  )
748
721
  ] }),
749
- isSingleSelected && externalBlob && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
722
+ canUploadExternalImage && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
750
723
  import_components.ToolbarButton,
751
724
  {
752
725
  onClick: uploadExternal,
@@ -965,10 +938,9 @@ function Image({
965
938
  }
966
939
  const borderProps = (0, import_block_editor.__experimentalUseBorderProps)(attributes);
967
940
  const shadowProps = (0, import_block_editor.__experimentalGetShadowClassesAndStyles)(attributes);
968
- const isRounded = attributes.className?.includes("is-style-rounded");
969
941
  const { postType, postId, queryId } = context;
970
942
  const isDescendentOfQueryLoop = Number.isFinite(queryId);
971
- let img = temporaryURL && hasImageErrored ? (
943
+ const img = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ImageWrapper, { href, children: temporaryURL && hasImageErrored ? (
972
944
  // Show a placeholder during upload when the blob URL can't be loaded. This can
973
945
  // happen when the user uploads a HEIC image in a browser that doesn't support them.
974
946
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1018,28 +990,9 @@ function Image({
1018
990
  }
1019
991
  ),
1020
992
  isUploading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.Spinner, {})
1021
- ] });
1022
- if (canEditImage && isEditingImage) {
1023
- img = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ImageWrapper, { href, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1024
- import_block_editor.__experimentalImageEditor,
1025
- {
1026
- id,
1027
- url,
1028
- ...pixelSize,
1029
- naturalHeight,
1030
- naturalWidth,
1031
- onSaveImage: (imageAttributes) => setAttributes(imageAttributes),
1032
- onFinishEditing: () => {
1033
- setIsEditingImage(false);
1034
- },
1035
- borderProps: isRounded ? void 0 : borderProps
1036
- }
1037
- ) });
1038
- } else {
1039
- img = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ImageWrapper, { href, children: img });
1040
- }
993
+ ] }) });
1041
994
  let resizableBox;
1042
- if (isResizable && isSingleSelected && !isEditingImage && !isUploading && !import_constants.SIZED_LAYOUTS.includes(parentLayoutType)) {
995
+ if (isResizable && isSingleSelected && !isUploading && !import_constants.SIZED_LAYOUTS.includes(parentLayoutType)) {
1043
996
  const numericRatio = aspectRatio && (0, import_utils.evalAspectRatio)(aspectRatio);
1044
997
  const customRatio = pixelSize.width / pixelSize.height;
1045
998
  const naturalRatio = naturalWidth / naturalHeight;
@@ -1123,7 +1076,7 @@ function Image({
1123
1076
  }
1124
1077
  if (!url && !temporaryURL) {
1125
1078
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
1126
- mediaReplaceFlow,
1079
+ mediaControls,
1127
1080
  controls
1128
1081
  ] });
1129
1082
  }
@@ -1137,7 +1090,7 @@ function Image({
1137
1090
  };
1138
1091
  const featuredImageControl = !isDescendentOfQueryLoop && postId && id ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_block_editor.BlockSettingsMenuControls, { children: ({ canEdit, selectedClientIds }) => canEdit && selectedClientIds.length === 1 && clientId === selectedClientIds[0] && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.MenuItem, { onClick: setPostFeatureImage, children: (0, import_i18n.__)("Set as featured image") }) }) : null;
1139
1092
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
1140
- mediaReplaceFlow,
1093
+ mediaControls,
1141
1094
  controls,
1142
1095
  featuredImageControl,
1143
1096
  img,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/image/image.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tExternalLink,\n\tFocalPointPicker,\n\tResizableBox,\n\tSpinner,\n\tTextareaControl,\n\tTextControl,\n\tCheckboxControl,\n\tToolbarButton,\n\tToolbarGroup,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\tPlaceholder,\n\tMenuItem,\n\tToolbarItem,\n\tDropdownMenu,\n\tPopover,\n} from '@wordpress/components';\nimport {\n\tuseMergeRefs,\n\tuseResizeObserver,\n\tuseViewportMatch,\n} from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\t__experimentalImageURLInputUI as ImageURLInputUI,\n\tMediaReplaceFlow,\n\tstore as blockEditorStore,\n\tuseSettings,\n\t__experimentalImageEditor as ImageEditor,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\tprivateApis as blockEditorPrivateApis,\n\tBlockSettingsMenuControls,\n} from '@wordpress/block-editor';\nimport {\n\tcreateInterpolateElement,\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { __, _x, sprintf, isRTL } from '@wordpress/i18n';\nimport { getFilename } from '@wordpress/url';\nimport { getBlockBindingsSource, switchToBlockType } from '@wordpress/blocks';\nimport { crop, overlayText, upload, chevronDown } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport { isExternalImage } from './edit';\nimport { Caption } from '../utils/caption';\nimport { MediaControl } from '../utils/media-control';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport {\n\tgetActiveDimensionValue,\n\tgetDimensionResetAttributes,\n\tgetDimensionUpdateAttributes,\n\tgetStyleStateKey,\n} from '../utils/style-state';\nimport { useOpenImageMediaEditorModal } from './use-open-image-media-editor-modal';\nimport {\n\tMIN_SIZE,\n\tALLOWED_MEDIA_TYPES,\n\tSIZED_LAYOUTS,\n\tDEFAULT_MEDIA_SIZE_SLUG,\n} from './constants';\nimport { evalAspectRatio, mediaPosition } from './utils';\n\nconst {\n\tDimensionsTool,\n\tisDefaultBlockStyleState,\n\tResolutionTool,\n\tmediaEditKey,\n} = unlock( blockEditorPrivateApis );\n\nconst scaleOptions = [\n\t{\n\t\tvalue: 'cover',\n\t\tlabel: _x( 'Cover', 'Scale option for dimensions control' ),\n\t\thelp: __( 'Image covers the space evenly.' ),\n\t},\n\t{\n\t\tvalue: 'contain',\n\t\tlabel: _x( 'Contain', 'Scale option for dimensions control' ),\n\t\thelp: __( 'Image is contained without distortion.' ),\n\t},\n];\n\nconst WRITEMODE_POPOVER_PROPS = {\n\tplacement: 'bottom-start',\n};\n\n// If the image has a href, wrap in an <a /> tag to trigger any inherited link element styles.\nconst ImageWrapper = ( { href, children } ) => {\n\tif ( ! href ) {\n\t\treturn children;\n\t}\n\treturn (\n\t\t<a\n\t\t\thref={ href }\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\taria-disabled\n\t\t\tstyle={ {\n\t\t\t\t// When the Image block is linked,\n\t\t\t\t// it's wrapped with a disabled <a /> tag.\n\t\t\t\t// Restore cursor style so it doesn't appear 'clickable'\n\t\t\t\t// and remove pointer events. Safari needs the display property.\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\tcursor: 'default',\n\t\t\t\tdisplay: 'inline',\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</a>\n\t);\n};\n\nfunction ContentOnlyControls( {\n\tattributes,\n\tsetAttributes,\n\tlockAltControls,\n\tlockAltControlsMessage,\n\tlockTitleControls,\n\tlockTitleControlsMessage,\n} ) {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst [ isAltDialogOpen, setIsAltDialogOpen ] = useState( false );\n\tconst [ isTitleDialogOpen, setIsTitleDialogOpen ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<ToolbarItem ref={ setPopoverAnchor }>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t...toggleProps,\n\t\t\t\t\t\t\tdescription: __( 'Displays more controls.' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tpopoverProps={ WRITEMODE_POPOVER_PROPS }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsAltDialogOpen( true );\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ _x(\n\t\t\t\t\t\t\t\t\t\t'Alternative text',\n\t\t\t\t\t\t\t\t\t\t'Alternative text for an image. Block toolbar label, a low character count is preferred.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsTitleDialogOpen( true );\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Title text' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t) }\n\t\t\t</ToolbarItem>\n\t\t\t{ isAltDialogOpen && (\n\t\t\t\t<Popover\n\t\t\t\t\tplacement=\"bottom-start\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tonClose={ () => setIsAltDialogOpen( false ) }\n\t\t\t\t\toffset={ 13 }\n\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"wp-block-image__toolbar_content_textarea__container\">\n\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\tvalue={ attributes.alt || '' }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { alt: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={ lockAltControls }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t\t{ isTitleDialogOpen && (\n\t\t\t\t<Popover\n\t\t\t\t\tplacement=\"bottom-start\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tonClose={ () => setIsTitleDialogOpen( false ) }\n\t\t\t\t\toffset={ 13 }\n\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"wp-block-image__toolbar_content_textarea__container\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\t\tvalue={ attributes.title || '' }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\ttitle: value,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={ lockTitleControls }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tcreateInterpolateElement(\n\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t'Describe the role of this image on the page. <a>(Note: many devices and browsers do not display this text.)</a>'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/TR/html52/dom.html#the-title-attribute\" />\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default function Image( {\n\ttemporaryURL,\n\tisSideloading,\n\tattributes,\n\tsetAttributes,\n\tisSingleSelected,\n\tinsertBlocksAfter,\n\tonReplace,\n\tonSelectImage,\n\tonSelectURL,\n\tonUploadError,\n\tcontext,\n\tclientId,\n\tblockEditingMode,\n\tparentLayoutType,\n\tmaxContentWidth,\n} ) {\n\tconst {\n\t\turl = '',\n\t\talt,\n\t\talign,\n\t\tid,\n\t\thref,\n\t\trel,\n\t\tlinkClass,\n\t\tlinkDestination,\n\t\ttitle,\n\t\twidth,\n\t\theight,\n\t\taspectRatio,\n\t\tscale,\n\t\tfocalPoint,\n\t\tlinkTarget,\n\t\tsizeSlug,\n\t\tlightbox,\n\t\tmetadata,\n\t\tisDecorative,\n\t} = attributes;\n\tconst [ imageElement, setImageElement ] = useState();\n\tconst [ resizeDelta, setResizeDelta ] = useState( null );\n\tconst [ pixelSize, setPixelSize ] = useState( {} );\n\tconst [ offsetTop, setOffsetTop ] = useState( 0 );\n\tconst setResizeObserved = useResizeObserver( ( [ entry ] ) => {\n\t\tif ( ! resizeDelta ) {\n\t\t\tconst [ box ] = entry.borderBoxSize;\n\t\t\tsetPixelSize( { width: box.inlineSize, height: box.blockSize } );\n\t\t}\n\t\t// This is usually 0 unless the image height is less than the line-height.\n\t\tsetOffsetTop( entry.target.offsetTop );\n\t} );\n\tconst effectResizeableBoxPlacement = useCallback( () => {\n\t\tsetOffsetTop( imageElement?.offsetTop ?? 0 );\n\t}, [ imageElement ] );\n\tconst setRefs = useMergeRefs( [ setImageElement, setResizeObserved ] );\n\tconst { allowResize = true } = context;\n\n\tconst { image, attachmentResolutionError } = useSelect(\n\t\t( select ) => {\n\t\t\tconst imageRecord =\n\t\t\t\tid && isSingleSelected\n\t\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t{ context: 'view' }\n\t\t\t\t\t )\n\t\t\t\t\t: null;\n\n\t\t\t// Check if the attachment resolution failed with a specific error.\n\t\t\t// We use getResolutionError instead of hasFinishedResolution so we\n\t\t\t// can distinguish 404 (attachment doesn't exist) from transient\n\t\t\t// errors (500, 403, network) that shouldn't clear the id.\n\t\t\tconst resolutionError =\n\t\t\t\tid && isSingleSelected\n\t\t\t\t\t? select( coreStore ).getResolutionError(\n\t\t\t\t\t\t\t'getEntityRecord',\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t{ context: 'view' },\n\t\t\t\t\t\t\t]\n\t\t\t\t\t )\n\t\t\t\t\t: null;\n\n\t\t\treturn {\n\t\t\t\timage: imageRecord,\n\t\t\t\tattachmentResolutionError: resolutionError,\n\t\t\t};\n\t\t},\n\t\t[ id, isSingleSelected ]\n\t);\n\n\tconst {\n\t\tcanInsertCover,\n\t\timageEditing,\n\t\timageSizes,\n\t\tmaxWidth,\n\t\teditMediaEntity,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType, getSettings } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst settings = getSettings();\n\n\t\t\treturn {\n\t\t\t\timageEditing: settings.imageEditing,\n\t\t\t\timageSizes: settings.imageSizes,\n\t\t\t\tmaxWidth: settings.maxWidth,\n\t\t\t\teditMediaEntity: settings?.[ mediaEditKey ],\n\t\t\t\tcanInsertCover: canInsertBlockType(\n\t\t\t\t\t'core/cover',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { getBlock, getSettings } = useSelect( blockEditorStore );\n\tconst cropButtonRef = useRef();\n\tconst handleMediaEditorModalClose = useCallback(\n\t\t() => cropButtonRef.current?.focus(),\n\t\t[]\n\t);\n\tconst openImageMediaEditorModal = useOpenImageMediaEditorModal( {\n\t\tattributes,\n\t\tsetAttributes,\n\t\tonClose: handleMediaEditorModalClose,\n\t} );\n\n\tconst {\n\t\treplaceBlocks,\n\t\ttoggleSelection,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = useDispatch( blockEditorStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideAligned = [ 'wide', 'full' ].includes( align );\n\tconst [\n\t\t{ loadedNaturalWidth, loadedNaturalHeight },\n\t\tsetLoadedNaturalSize,\n\t] = useState( {} );\n\tconst [ isEditingImage, setIsEditingImage ] = useState( false );\n\tconst [ externalBlob, setExternalBlob ] = useState();\n\tconst [ hasImageErrored, setHasImageErrored ] = useState( false );\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\tconst isContentOnlyMode = blockEditingMode === 'contentOnly';\n\tconst showDimensionsControls = allowResize && hasNonContentControls;\n\tconst isResizable =\n\t\tallowResize &&\n\t\thasNonContentControls &&\n\t\t! isWideAligned &&\n\t\tisLargeViewport;\n\t// An image is uploading if it has a temporary blob URL, or if it is\n\t// being processed client-side (e.g. transcoded or generating sub-sizes).\n\tconst isUploading = !! temporaryURL || isSideloading;\n\tconst imageSizeOptions = imageSizes\n\t\t.filter(\n\t\t\t( { slug } ) => image?.media_details?.sizes?.[ slug ]?.source_url\n\t\t)\n\t\t.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\t// If the image has an id but the attachment doesn't exist on this site,\n\t// clear the id so Gutenberg treats the image as external.\n\t// This handles content copied between WordPress sites.\n\t//\n\t// Known limitation: if a different attachment with the same id happens to\n\t// exist on the destination site, the lookup will succeed and the wrong\n\t// local image will be used. URL matching could address this in a follow-up.\n\t// See: https://github.com/WordPress/gutenberg/issues/74156\n\tuseEffect( () => {\n\t\tif ( ! id || ! isSingleSelected ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only clear for confirmed 404s. apiFetch throws the Response object\n\t\t// for HTTP errors, so checking .status === 404 avoids incorrectly\n\t\t// clearing the id on 403, 500, or network failures, which would\n\t\t// cause data loss for valid local attachments.\n\t\tif ( attachmentResolutionError?.status === 404 ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { id: undefined } );\n\t\t}\n\t}, [\n\t\tid,\n\t\tisSingleSelected,\n\t\tattachmentResolutionError,\n\t\tsetAttributes,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t] );\n\n\t// If an image is externally hosted, try to fetch the image data. This may\n\t// fail if the image host doesn't allow CORS with the domain. If it works,\n\t// we can enable a button in the toolbar to upload the image.\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! isExternalImage( id, url ) ||\n\t\t\t! isSingleSelected ||\n\t\t\t! getSettings().mediaUpload\n\t\t) {\n\t\t\tsetExternalBlob();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( externalBlob ) {\n\t\t\treturn;\n\t\t}\n\n\t\twindow\n\t\t\t// Avoid cache, which seems to help avoid CORS problems.\n\t\t\t.fetch( url.includes( '?' ) ? url : url + '?' )\n\t\t\t.then( ( response ) => response.blob() )\n\t\t\t.then( ( blob ) => setExternalBlob( blob ) )\n\t\t\t// Do nothing, cannot upload.\n\t\t\t.catch( () => {} );\n\t}, [ id, url, isSingleSelected, externalBlob, getSettings ] );\n\n\t// Get naturalWidth and naturalHeight from image, and fall back to loaded natural\n\t// width and height. This resolves an issue in Safari where the loaded natural\n\t// width and height is otherwise lost when switching between alignments.\n\t// See: https://github.com/WordPress/gutenberg/pull/37210.\n\tconst { naturalWidth, naturalHeight } = useMemo( () => {\n\t\treturn {\n\t\t\tnaturalWidth:\n\t\t\t\timageElement?.naturalWidth || loadedNaturalWidth || undefined,\n\t\t\tnaturalHeight:\n\t\t\t\timageElement?.naturalHeight || loadedNaturalHeight || undefined,\n\t\t};\n\t}, [ loadedNaturalWidth, loadedNaturalHeight, imageElement?.complete ] );\n\n\tfunction onImageError() {\n\t\tsetHasImageErrored( true );\n\n\t\t// Check if there's an embed block that handles this URL, e.g., instagram URL.\n\t\t// See: https://github.com/WordPress/gutenberg/pull/11472\n\t\tconst embedBlock = createUpgradedEmbedBlock( { attributes: { url } } );\n\t\tif ( undefined !== embedBlock ) {\n\t\t\tonReplace( embedBlock );\n\t\t}\n\t}\n\n\tfunction onImageLoad( event ) {\n\t\tsetHasImageErrored( false );\n\t\tsetLoadedNaturalSize( {\n\t\t\tloadedNaturalWidth: event.target?.naturalWidth,\n\t\t\tloadedNaturalHeight: event.target?.naturalHeight,\n\t\t} );\n\t}\n\n\tfunction onSetHref( props ) {\n\t\tsetAttributes( props );\n\t}\n\n\tfunction onSetLightbox( enable ) {\n\t\tif ( enable && ! lightboxSetting?.enabled ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: true },\n\t\t\t\tisDecorative: false,\n\t\t\t} );\n\t\t} else if ( ! enable && lightboxSetting?.enabled ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: false },\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction resetLightbox() {\n\t\t// When deleting a link from an image while lightbox settings\n\t\t// are enabled by default, we should disable the lightbox,\n\t\t// otherwise the resulting UX looks like a mistake.\n\t\t// See https://github.com/WordPress/gutenberg/pull/59890/files#r1532286123.\n\t\tif ( lightboxSetting?.enabled && lightboxSetting?.allowEditing ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: false },\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction onSetTitle( value ) {\n\t\t// This is the HTML title attribute, separate from the media object\n\t\t// title.\n\t\tsetAttributes( { title: value } );\n\t}\n\n\tfunction updateAlt( newAlt ) {\n\t\tsetAttributes( { alt: newAlt } );\n\t}\n\n\tfunction updateIsDecorative( value ) {\n\t\tsetAttributes( {\n\t\t\tisDecorative: value || undefined,\n\t\t\t...( value && {\n\t\t\t\talt: '',\n\t\t\t\tcaption: undefined,\n\t\t\t\thref: undefined,\n\t\t\t\tlinkDestination: undefined,\n\t\t\t\tlinkTarget: undefined,\n\t\t\t\trel: undefined,\n\t\t\t} ),\n\t\t} );\n\t}\n\n\tconst imperativeFocalPointPreview = ( value ) => {\n\t\tif ( imageElement ) {\n\t\t\timageElement.style.setProperty(\n\t\t\t\t'object-position',\n\t\t\t\tmediaPosition( value )\n\t\t\t);\n\t\t}\n\t};\n\n\tfunction updateImage( newSizeSlug ) {\n\t\tconst newUrl = image?.media_details?.sizes?.[ newSizeSlug ]?.source_url;\n\t\tif ( ! newUrl ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\turl: newUrl,\n\t\t\tsizeSlug: newSizeSlug,\n\t\t} );\n\t}\n\n\tfunction uploadExternal() {\n\t\tconst { mediaUpload } = getSettings();\n\t\tif ( ! mediaUpload ) {\n\t\t\treturn;\n\t\t}\n\t\tlet notified = false;\n\t\tmediaUpload( {\n\t\t\tfilesList: [ externalBlob ],\n\t\t\tonFileChange( [ img ] ) {\n\t\t\t\tonSelectImage( img );\n\n\t\t\t\tif ( isBlobURL( img.url ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// With client-side media processing, onFileChange fires\n\t\t\t\t// for each generated sub-size. Only show the notice once.\n\t\t\t\tif ( ! notified ) {\n\t\t\t\t\tnotified = true;\n\t\t\t\t\tsetExternalBlob();\n\t\t\t\t\tcreateSuccessNotice( __( 'Image uploaded.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t},\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tonError( message ) {\n\t\t\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSingleSelected ) {\n\t\t\tsetIsEditingImage( false );\n\t\t}\n\t}, [ isSingleSelected ] );\n\n\tconst canEditImage =\n\t\tid &&\n\t\tnaturalWidth &&\n\t\tnaturalHeight &&\n\t\timageEditing &&\n\t\t!! editMediaEntity;\n\tconst allowCrop =\n\t\tisSingleSelected &&\n\t\tcanEditImage &&\n\t\t! isEditingImage &&\n\t\t! isContentOnlyMode &&\n\t\t! isUploading;\n\n\tfunction switchToCover() {\n\t\treplaceBlocks(\n\t\t\tclientId,\n\t\t\tswitchToBlockType( getBlock( clientId ), 'core/cover' )\n\t\t);\n\t}\n\n\t// TODO: Can allow more units after figuring out how they should interact\n\t// with the ResizableBox and ImageEditor components. Calculations later on\n\t// for those components are currently assuming px units.\n\tconst dimensionsUnitsOptions = useCustomUnits( {\n\t\tavailableUnits: [ 'px' ],\n\t} );\n\n\tconst [ lightboxSetting ] = useSettings( 'lightbox' );\n\n\tconst showLightboxSetting =\n\t\t// If a block-level override is set, we should give users the option to\n\t\t// remove that override, even if the lightbox UI is disabled in the settings.\n\t\t( !! lightbox && lightbox?.enabled !== lightboxSetting?.enabled ) ||\n\t\tlightboxSetting?.allowEditing;\n\n\tconst lightboxChecked =\n\t\t!! lightbox?.enabled || ( ! lightbox && !! lightboxSetting?.enabled );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst selectedStyleState = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSingleSelected ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst { getSelectedBlockStyleState } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\treturn getSelectedBlockStyleState( clientId );\n\t\t},\n\t\t[ clientId, isSingleSelected ]\n\t);\n\tconst hasSelectedStyleState =\n\t\t! isDefaultBlockStyleState( selectedStyleState );\n\tconst selectedStyleStateKey = getStyleStateKey( selectedStyleState );\n\tconst activeWidth = getActiveDimensionValue( {\n\t\tattributes,\n\t\tselectedState: selectedStyleState,\n\t\thasSelectedStyleState,\n\t\tattributeKey: 'width',\n\t} );\n\tconst activeHeight = getActiveDimensionValue( {\n\t\tattributes,\n\t\tselectedState: selectedStyleState,\n\t\thasSelectedStyleState,\n\t\tattributeKey: 'height',\n\t} );\n\tconst activeAspectRatio = getActiveDimensionValue( {\n\t\tattributes,\n\t\tselectedState: selectedStyleState,\n\t\thasSelectedStyleState,\n\t\tattributeKey: 'aspectRatio',\n\t} );\n\tconst activeScale = getActiveDimensionValue( {\n\t\tattributes,\n\t\tselectedState: selectedStyleState,\n\t\thasSelectedStyleState,\n\t\tattributeKey: 'scale',\n\t\tstyleKey: 'objectFit',\n\t} );\n\tconst setDimensionAttributes = ( nextDimensions ) => {\n\t\tsetAttributes(\n\t\t\tgetDimensionUpdateAttributes( {\n\t\t\t\tstyle: attributes.style,\n\t\t\t\tselectedState: selectedStyleState,\n\t\t\t\thasSelectedStyleState,\n\t\t\t\tnextDimensions,\n\t\t\t\tdimensionKeyMap: { scale: 'objectFit' },\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst dimensionsControl =\n\t\tshowDimensionsControls &&\n\t\t( SIZED_LAYOUTS.includes( parentLayoutType ) ? (\n\t\t\t<DimensionsTool\n\t\t\t\tkey={ selectedStyleStateKey }\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tvalue={ { aspectRatio: activeAspectRatio, scale: activeScale } }\n\t\t\t\tonChange={ ( { aspectRatio: newAspectRatio } ) => {\n\t\t\t\t\tsetDimensionAttributes( {\n\t\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t\t\tscale: 'cover',\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\t\ttools={ [ 'aspectRatio' ] }\n\t\t\t/>\n\t\t) : (\n\t\t\t<DimensionsTool\n\t\t\t\tkey={ selectedStyleStateKey }\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tvalue={ {\n\t\t\t\t\twidth: activeWidth,\n\t\t\t\t\theight: activeHeight,\n\t\t\t\t\tscale: activeScale,\n\t\t\t\t\taspectRatio: activeAspectRatio,\n\t\t\t\t} }\n\t\t\t\tonChange={ ( {\n\t\t\t\t\twidth: newWidth,\n\t\t\t\t\theight: newHeight,\n\t\t\t\t\tscale: newScale,\n\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t} ) => {\n\t\t\t\t\tsetDimensionAttributes( {\n\t\t\t\t\t\t// CSS includes `height: auto`, but we need\n\t\t\t\t\t\t// `width: auto` to fix the aspect ratio when\n\t\t\t\t\t\t// only height is set due to the width and\n\t\t\t\t\t\t// height attributes set via the server.\n\t\t\t\t\t\twidth: ! newWidth && newHeight ? 'auto' : newWidth,\n\t\t\t\t\t\theight: newHeight,\n\t\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t\t\tscale: newScale,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdefaultScale=\"cover\"\n\t\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\t\tscaleOptions={ scaleOptions }\n\t\t\t\tunitsOptions={ dimensionsUnitsOptions }\n\t\t\t\ttools={\n\t\t\t\t\tisWideAligned\n\t\t\t\t\t\t? [ 'aspectRatio', 'scale' ]\n\t\t\t\t\t\t: [ 'aspectRatio', 'widthHeight', 'scale' ]\n\t\t\t\t}\n\t\t\t/>\n\t\t) );\n\n\tconst resetSettings = () => {\n\t\tsetAttributes( {\n\t\t\tlightbox: undefined,\n\t\t} );\n\t\tupdateImage( DEFAULT_MEDIA_SIZE_SLUG );\n\t};\n\n\tconst arePatternOverridesEnabled =\n\t\tmetadata?.bindings?.__default?.source === 'core/pattern-overrides';\n\n\tconst {\n\t\tlockUrlControls = false,\n\t\tlockHrefControls = false,\n\t\tlockAltControls = false,\n\t\tlockAltControlsMessage,\n\t\tlockTitleControls = false,\n\t\tlockTitleControlsMessage,\n\t\thideCaptionControls = false,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSingleSelected ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst {\n\t\t\t\turl: urlBinding,\n\t\t\t\talt: altBinding,\n\t\t\t\ttitle: titleBinding,\n\t\t\t\tcaption: captionBinding,\n\t\t\t} = metadata?.bindings || {};\n\t\t\tconst hasParentPattern = !! context[ 'pattern/overrides' ];\n\t\t\tconst urlBindingSource = getBlockBindingsSource(\n\t\t\t\turlBinding?.source\n\t\t\t);\n\t\t\tconst altBindingSource = getBlockBindingsSource(\n\t\t\t\taltBinding?.source\n\t\t\t);\n\t\t\tconst titleBindingSource = getBlockBindingsSource(\n\t\t\t\ttitleBinding?.source\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tlockUrlControls:\n\t\t\t\t\t!! urlBinding &&\n\t\t\t\t\t! urlBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: urlBinding?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockHrefControls:\n\t\t\t\t\t// Disable editing the link of the URL if the image is inside a pattern instance.\n\t\t\t\t\t// This is a temporary solution until we support overriding the link on the frontend.\n\t\t\t\t\thasParentPattern || arePatternOverridesEnabled,\n\t\t\t\thideCaptionControls: !! captionBinding,\n\t\t\t\tlockAltControls:\n\t\t\t\t\t!! altBinding &&\n\t\t\t\t\t! altBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: altBinding?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockAltControlsMessage: altBindingSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\taltBindingSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t\tlockTitleControls:\n\t\t\t\t\t!! titleBinding &&\n\t\t\t\t\t! titleBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: titleBinding?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockTitleControlsMessage: titleBindingSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\ttitleBindingSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tarePatternOverridesEnabled,\n\t\t\tcontext,\n\t\t\tisSingleSelected,\n\t\t\tmetadata?.bindings,\n\t\t]\n\t);\n\n\tconst showUrlInput =\n\t\tisSingleSelected &&\n\t\t! isEditingImage &&\n\t\t! lockHrefControls &&\n\t\t! lockUrlControls &&\n\t\t! isDecorative;\n\n\tconst showCoverControls =\n\t\tisSingleSelected && canInsertCover && ! isContentOnlyMode;\n\n\tconst showBlockControls = showUrlInput || allowCrop || showCoverControls;\n\n\tconst mediaReplaceFlow = isSingleSelected &&\n\t\t! isEditingImage &&\n\t\t! lockUrlControls && (\n\t\t\t// For contentOnly mode, put this button in its own area so it has borders around it.\n\t\t\t<BlockControls group={ isContentOnlyMode ? 'inline' : 'other' }>\n\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\tmediaId={ id }\n\t\t\t\t\tmediaURL={ url }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tname={ ! url ? __( 'Add image' ) : __( 'Replace' ) }\n\t\t\t\t\tonReset={ () => onSelectImage( undefined ) }\n\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t);\n\n\tconst hasDataFormBlockFields =\n\t\twindow?.__experimentalContentOnlyInspectorFields;\n\n\tconst controls = (\n\t\t<>\n\t\t\t{ showBlockControls && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t{ showUrlInput && (\n\t\t\t\t\t\t<ImageURLInputUI\n\t\t\t\t\t\t\turl={ href || '' }\n\t\t\t\t\t\t\tonChangeUrl={ onSetHref }\n\t\t\t\t\t\t\tlinkDestination={ linkDestination }\n\t\t\t\t\t\t\tmediaUrl={ ( image && image.source_url ) || url }\n\t\t\t\t\t\t\tmediaLink={ image && image.link }\n\t\t\t\t\t\t\tlinkTarget={ linkTarget }\n\t\t\t\t\t\t\tlinkClass={ linkClass }\n\t\t\t\t\t\t\trel={ rel }\n\t\t\t\t\t\t\tshowLightboxSetting={ showLightboxSetting }\n\t\t\t\t\t\t\tlightboxEnabled={ lightboxChecked }\n\t\t\t\t\t\t\tonSetLightbox={ onSetLightbox }\n\t\t\t\t\t\t\tresetLightbox={ resetLightbox }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ allowCrop && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tref={ cropButtonRef }\n\t\t\t\t\t\t\tonClick={\n\t\t\t\t\t\t\t\topenImageMediaEditorModal\n\t\t\t\t\t\t\t\t\t? openImageMediaEditorModal\n\t\t\t\t\t\t\t\t\t: () => setIsEditingImage( true )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-haspopup={\n\t\t\t\t\t\t\t\topenImageMediaEditorModal ? 'dialog' : undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={ crop }\n\t\t\t\t\t\t\tlabel={ __( 'Crop' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showCoverControls && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ticon={ overlayText }\n\t\t\t\t\t\t\tlabel={ __( 'Add text over image' ) }\n\t\t\t\t\t\t\tonClick={ switchToCover }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isSingleSelected && externalBlob && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={ uploadExternal }\n\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\tlabel={ __( 'Upload to Media Library' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isContentOnlyMode && (\n\t\t\t\t// Add some extra controls for content attributes when content only mode is active.\n\t\t\t\t// With content only mode active, the inspector is hidden, so users need another way\n\t\t\t\t// to edit these attributes.\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t<ContentOnlyControls\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tlockAltControls={ lockAltControls }\n\t\t\t\t\t\tlockAltControlsMessage={ lockAltControlsMessage }\n\t\t\t\t\t\tlockTitleControls={ lockTitleControls }\n\t\t\t\t\t\tlockTitleControlsMessage={ lockTitleControlsMessage }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ ! hasDataFormBlockFields && isSingleSelected && (\n\t\t\t\t<InspectorControls group=\"content\">\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Media' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tonSelectImage( undefined );\n\t\t\t\t\t\t\tsetAttributes( { isDecorative: false } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! lockUrlControls && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Image' ) }\n\t\t\t\t\t\t\t\thasValue={ () => !! url }\n\t\t\t\t\t\t\t\tonDeselect={ () => onSelectImage( undefined ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<MediaControl\n\t\t\t\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\t\t\t\tmediaUrl={ url }\n\t\t\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\t\t\tfilename={\n\t\t\t\t\t\t\t\t\t\timage?.media_details?.sizes?.full\n\t\t\t\t\t\t\t\t\t\t\t?.file ||\n\t\t\t\t\t\t\t\t\t\timage?.slug ||\n\t\t\t\t\t\t\t\t\t\tgetFilename( url )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\t\t\t\tonReset={ () => onSelectImage( undefined ) }\n\t\t\t\t\t\t\t\t\tisUploading={ isUploading }\n\t\t\t\t\t\t\t\t\temptyLabel={ __( 'Add image' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDecorative && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! alt }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { alt: undefined } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\t\tvalue={ alt || '' }\n\t\t\t\t\t\t\t\t\tonChange={ updateAlt }\n\t\t\t\t\t\t\t\t\treadOnly={ lockAltControls }\n\t\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t{ ! lockAltControls && ! lightboxChecked && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Mark as decorative' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! isDecorative }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { isDecorative: false } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Mark as decorative' ) }\n\t\t\t\t\t\t\t\t\tchecked={ !! isDecorative }\n\t\t\t\t\t\t\t\t\tonChange={ updateIsDecorative }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Hidden from assistive technologies.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tresetAllFilter={ ( attrs ) => {\n\t\t\t\t\treturn getDimensionResetAttributes( {\n\t\t\t\t\t\tattributes: attrs,\n\t\t\t\t\t\tselectedState: selectedStyleState,\n\t\t\t\t\t\thasSelectedStyleState,\n\t\t\t\t\t\tkeys: [ 'aspectRatio', 'height', 'objectFit', 'width' ],\n\t\t\t\t\t\tdefaultAttributes: {\n\t\t\t\t\t\t\taspectRatio: undefined,\n\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\theight: undefined,\n\t\t\t\t\t\t\tscale: undefined,\n\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ dimensionsControl }\n\t\t\t\t{ ! hasSelectedStyleState && url && scale && (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! focalPoint }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<FocalPointPicker\n\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\tvalue={ focalPoint }\n\t\t\t\t\t\t\tonDragStart={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\tonDrag={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\tonChange={ ( newFocalPoint ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tfocalPoint: newFocalPoint,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t{ !! imageSizeOptions.length && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ resetSettings }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ResolutionTool\n\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\tdefaultValue={ DEFAULT_MEDIA_SIZE_SLUG }\n\t\t\t\t\t\t\tonChange={ updateImage }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\tonChange={ onSetTitle }\n\t\t\t\t\treadOnly={ lockTitleControls }\n\t\t\t\t\thelp={\n\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tcreateInterpolateElement(\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Describe the role of this image on the page. <a>(Note: many devices and browsers do not display this text.)</a>'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/TR/html52/dom.html#the-title-attribute\" />\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst filename = getFilename( url );\n\tlet defaultedAlt;\n\n\tif ( isDecorative ) {\n\t\tdefaultedAlt = filename\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: %s: file name */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'This image has been marked as decorative; its file name is %s'\n\t\t\t\t\t),\n\t\t\t\t\tfilename\n\t\t\t )\n\t\t\t: __( 'This image has been marked as decorative.' );\n\t} else if ( alt ) {\n\t\tdefaultedAlt = alt;\n\t} else if ( filename ) {\n\t\tdefaultedAlt = sprintf(\n\t\t\t/* translators: %s: file name */\n\t\t\t__( 'This image has an empty alt attribute; its file name is %s' ),\n\t\t\tfilename\n\t\t);\n\t} else {\n\t\tdefaultedAlt = __( 'This image has an empty alt attribute' );\n\t}\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\tconst isRounded = attributes.className?.includes( 'is-style-rounded' );\n\n\tconst { postType, postId, queryId } = context;\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\n\tlet img =\n\t\ttemporaryURL && hasImageErrored ? (\n\t\t\t// Show a placeholder during upload when the blob URL can't be loaded. This can\n\t\t\t// happen when the user uploads a HEIC image in a browser that doesn't support them.\n\t\t\t<Placeholder\n\t\t\t\tclassName=\"wp-block-image__placeholder\"\n\t\t\t\twithIllustration\n\t\t\t>\n\t\t\t\t<Spinner />\n\t\t\t</Placeholder>\n\t\t) : (\n\t\t\t<>\n\t\t\t\t<img\n\t\t\t\t\tsrc={ temporaryURL || url }\n\t\t\t\t\talt={ defaultedAlt }\n\t\t\t\t\tonError={ onImageError }\n\t\t\t\t\tonLoad={ onImageLoad }\n\t\t\t\t\tref={ setRefs }\n\t\t\t\t\tclassName={ borderProps.className }\n\t\t\t\t\twidth={ naturalWidth }\n\t\t\t\t\theight={ naturalHeight }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\taspectRatio,\n\t\t\t\t\t\t...( resizeDelta\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\twidth: pixelSize.width + resizeDelta.width,\n\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\tpixelSize.height + resizeDelta.height,\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: ( () => {\n\t\t\t\t\t\t\t\t\tconst style = {};\n\t\t\t\t\t\t\t\t\tif ( width === 'auto' ) {\n\t\t\t\t\t\t\t\t\t\tstyle.width = 'auto';\n\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\twidth !== undefined &&\n\t\t\t\t\t\t\t\t\t\twidth !== null\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tstyle.width =\n\t\t\t\t\t\t\t\t\t\t\ttypeof width === 'number'\n\t\t\t\t\t\t\t\t\t\t\t\t? `${ width }px`\n\t\t\t\t\t\t\t\t\t\t\t\t: width;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\theight === 'auto' ||\n\t\t\t\t\t\t\t\t\t\theight === undefined ||\n\t\t\t\t\t\t\t\t\t\theight === null\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tstyle.height = 'auto';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tstyle.height =\n\t\t\t\t\t\t\t\t\t\t\ttypeof height === 'number'\n\t\t\t\t\t\t\t\t\t\t\t\t? `${ height }px`\n\t\t\t\t\t\t\t\t\t\t\t\t: height;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn style;\n\t\t\t\t\t\t\t } )() ),\n\t\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\t\tobjectPosition:\n\t\t\t\t\t\t\tfocalPoint && scale\n\t\t\t\t\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t\t...shadowProps.style,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ isUploading && <Spinner /> }\n\t\t\t</>\n\t\t);\n\n\tif ( canEditImage && isEditingImage ) {\n\t\timg = (\n\t\t\t<ImageWrapper href={ href }>\n\t\t\t\t<ImageEditor\n\t\t\t\t\tid={ id }\n\t\t\t\t\turl={ url }\n\t\t\t\t\t{ ...pixelSize }\n\t\t\t\t\tnaturalHeight={ naturalHeight }\n\t\t\t\t\tnaturalWidth={ naturalWidth }\n\t\t\t\t\tonSaveImage={ ( imageAttributes ) =>\n\t\t\t\t\t\tsetAttributes( imageAttributes )\n\t\t\t\t\t}\n\t\t\t\t\tonFinishEditing={ () => {\n\t\t\t\t\t\tsetIsEditingImage( false );\n\t\t\t\t\t} }\n\t\t\t\t\tborderProps={ isRounded ? undefined : borderProps }\n\t\t\t\t/>\n\t\t\t</ImageWrapper>\n\t\t);\n\t} else {\n\t\timg = <ImageWrapper href={ href }>{ img }</ImageWrapper>;\n\t}\n\n\tlet resizableBox;\n\tif (\n\t\tisResizable &&\n\t\tisSingleSelected &&\n\t\t! isEditingImage &&\n\t\t! isUploading &&\n\t\t! SIZED_LAYOUTS.includes( parentLayoutType )\n\t) {\n\t\tconst numericRatio = aspectRatio && evalAspectRatio( aspectRatio );\n\t\tconst customRatio = pixelSize.width / pixelSize.height;\n\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\tconst ratio = numericRatio || customRatio || naturalRatio || 1;\n\t\tconst minWidth =\n\t\t\tnaturalWidth < naturalHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\tconst minHeight =\n\t\t\tnaturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t// With the current implementation of ResizableBox, an image needs an\n\t\t// explicit pixel value for the max-width. In absence of being able to\n\t\t// set the content-width, this max-width is currently dictated by the\n\t\t// vanilla editor style. The following variable adds a buffer to this\n\t\t// vanilla style, so 3rd party themes have some wiggleroom. This does,\n\t\t// in most cases, allow you to scale the image beyond the width of the\n\t\t// main column, though not infinitely.\n\t\t// @todo It would be good to revisit this once a content-width variable\n\t\t// becomes available.\n\t\tconst maxWidthBuffer = maxWidth * 2.5;\n\t\tconst maxResizeWidth = maxContentWidth || maxWidthBuffer;\n\n\t\tlet showRightHandle = false;\n\t\tlet showLeftHandle = false;\n\n\t\t/* eslint-disable no-lonely-if */\n\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\tif ( align === 'center' ) {\n\t\t\t// When the image is centered, show both handles.\n\t\t\tshowRightHandle = true;\n\t\t\tshowLeftHandle = true;\n\t\t} else if ( isRTL() ) {\n\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t// Show the right handle and hide the left handle only when it is\n\t\t\t// aligned left. Otherwise always show the left handle.\n\t\t\tif ( align === 'left' ) {\n\t\t\t\tshowRightHandle = true;\n\t\t\t} else {\n\t\t\t\tshowLeftHandle = true;\n\t\t\t}\n\t\t} else {\n\t\t\t// Show the left handle and hide the right handle only when the\n\t\t\t// image is aligned right. Otherwise always show the right handle.\n\t\t\tif ( align === 'right' ) {\n\t\t\t\tshowLeftHandle = true;\n\t\t\t} else {\n\t\t\t\tshowRightHandle = true;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-lonely-if */\n\t\tresizableBox = (\n\t\t\t<ResizableBox\n\t\t\t\tref={ effectResizeableBoxPlacement }\n\t\t\t\tstyle={ {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t// To match the vertical-align: bottom of the img (from style.scss)\n\t\t\t\t\t// syncs the top with the img. This matters when the img height is\n\t\t\t\t\t// less than the line-height.\n\t\t\t\t\tinset: `${ offsetTop }px 0 0 0`,\n\t\t\t\t} }\n\t\t\t\tsize={ pixelSize }\n\t\t\t\tminWidth={ minWidth }\n\t\t\t\tmaxWidth={ maxResizeWidth }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tmaxHeight={ maxResizeWidth / ratio }\n\t\t\t\tlockAspectRatio={ ratio }\n\t\t\t\tenable={ {\n\t\t\t\t\ttop: false,\n\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\tbottom: true,\n\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t} }\n\t\t\t\tonResizeStart={ () => {\n\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t} }\n\t\t\t\tonResize={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetResizeDelta( delta );\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t\tsetResizeDelta( null );\n\t\t\t\t\tsetPixelSize( ( current ) => ( {\n\t\t\t\t\t\twidth: current.width + delta.width,\n\t\t\t\t\t\theight: current.height + delta.height,\n\t\t\t\t\t} ) );\n\n\t\t\t\t\t// Clear hardcoded width if the resized width is close to the max-content width.\n\t\t\t\t\tif (\n\t\t\t\t\t\tmaxContentWidth &&\n\t\t\t\t\t\t// Only do this if the image is bigger than the container to prevent it from being squished.\n\t\t\t\t\t\t// TODO: Remove this check if the image support setting 100% width.\n\t\t\t\t\t\tnaturalWidth >= maxContentWidth &&\n\t\t\t\t\t\tMath.abs( elt.offsetWidth - maxContentWidth ) < 10\n\t\t\t\t\t) {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\theight: undefined,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Since the aspect ratio is locked when resizing, we can\n\t\t\t\t\t// use the width of the resized element to calculate the\n\t\t\t\t\t// height in CSS to prevent stretching when the max-width\n\t\t\t\t\t// is reached.\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: `${ elt.offsetWidth }px`,\n\t\t\t\t\t\theight: 'auto',\n\t\t\t\t\t\taspectRatio:\n\t\t\t\t\t\t\tratio === naturalRatio\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: String( ratio ),\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tresizeRatio={ align === 'center' ? 2 : 1 }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( ! url && ! temporaryURL ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ mediaReplaceFlow }\n\t\t\t\t{ controls }\n\t\t\t</>\n\t\t);\n\t}\n\n\t/**\n\t * Set the post's featured image with the current image.\n\t */\n\tconst setPostFeatureImage = () => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tfeatured_media: id,\n\t\t} );\n\t\tcreateSuccessNotice( __( 'Post featured image updated.' ), {\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\tconst featuredImageControl =\n\t\t! isDescendentOfQueryLoop && postId && id ? (\n\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t{ ( { canEdit, selectedClientIds } ) =>\n\t\t\t\t\tcanEdit &&\n\t\t\t\t\tselectedClientIds.length === 1 &&\n\t\t\t\t\tclientId === selectedClientIds[ 0 ] && (\n\t\t\t\t\t\t<MenuItem onClick={ setPostFeatureImage }>\n\t\t\t\t\t\t\t{ __( 'Set as featured image' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t</BlockSettingsMenuControls>\n\t\t) : null;\n\n\treturn (\n\t\t<>\n\t\t\t{ mediaReplaceFlow }\n\t\t\t{ controls }\n\t\t\t{ featuredImageControl }\n\t\t\t{ img }\n\t\t\t{ resizableBox }\n\n\t\t\t{ ! isDecorative && (\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Image caption text' ) }\n\t\t\t\t\tshowToolbarButton={\n\t\t\t\t\t\tisSingleSelected &&\n\t\t\t\t\t\t( hasNonContentControls || isContentOnlyMode ) &&\n\t\t\t\t\t\t! hideCaptionControls\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA0B;AAC1B,wBAkBO;AACP,qBAIO;AACP,kBAAuC;AACvC,0BAYO;AACP,qBAOO;AACP,kBAAuC;AACvC,iBAA4B;AAC5B,oBAA0D;AAC1D,mBAAuD;AACvD,qBAAsC;AACtC,uBAAmC;AAKnC,yBAAuB;AACvB,kBAAyC;AACzC,kBAAgC;AAChC,qBAAwB;AACxB,2BAA6B;AAC7B,mBAA+C;AAC/C,yBAKO;AACP,+CAA6C;AAC7C,uBAKO;AACP,mBAA+C;AAgC7C;AA9BF,IAAM;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,QAAI,2BAAQ,oBAAAA,WAAuB;AAEnC,IAAM,eAAe;AAAA,EACpB;AAAA,IACC,OAAO;AAAA,IACP,WAAO,gBAAI,SAAS,qCAAsC;AAAA,IAC1D,UAAM,gBAAI,gCAAiC;AAAA,EAC5C;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,WAAO,gBAAI,WAAW,qCAAsC;AAAA,IAC5D,UAAM,gBAAI,wCAAyC;AAAA,EACpD;AACD;AAEA,IAAM,0BAA0B;AAAA,EAC/B,WAAW;AACZ;AAGA,IAAM,eAAe,CAAE,EAAE,MAAM,SAAS,MAAO;AAC9C,MAAK,CAAE,MAAO;AACb,WAAO;AAAA,EACR;AACA,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACA,SAAU,CAAE,UAAW,MAAM,eAAe;AAAA,MAC5C,iBAAa;AAAA,MACb,OAAQ;AAAA;AAAA;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nB,CAAE;AAAA,QACH;AAAA,QACA,aAAc,UAAU,WAAW,IAAI;AAAA;AAAA,IACxC;AAAA,EAEF;AAEA,MAAK,CAAE,OAAO,CAAE,cAAe;AAC9B,WACC,4EACG;AAAA;AAAA,MACA;AAAA,OACH;AAAA,EAEF;AAKA,QAAM,sBAAsB,MAAM;AACjC,qBAAkB,YAAY,UAAU,QAAQ;AAAA,MAC/C,gBAAgB;AAAA,IACjB,CAAE;AACF,4BAAqB,gBAAI,8BAA+B,GAAG;AAAA,MAC1D,MAAM;AAAA,IACP,CAAE;AAAA,EACH;AAEA,QAAM,uBACL,CAAE,2BAA2B,UAAU,KACtC,4CAAC,iDACE,WAAE,EAAE,SAAS,kBAAkB,MAChC,WACA,kBAAkB,WAAW,KAC7B,aAAa,kBAAmB,CAAE,KACjC,4CAAC,8BAAS,SAAU,qBACjB,8BAAI,uBAAwB,GAC/B,GAGH,IACG;AAEL,SACC,4EACG;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA,CAAE,gBACH;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA,YAAa;AAAA,QACb;AAAA,QACA,WAAQ,gBAAI,oBAAqB;AAAA,QACjC,mBACC,qBACE,yBAAyB,sBAC3B,CAAE;AAAA;AAAA,IAEJ;AAAA,KAEF;AAEF;",
6
- "names": ["blockEditorPrivateApis", "coreStore", "getSettings", "blockEditorStore", "noticesStore", "img", "useCustomUnits", "ImageURLInputUI", "ToolsPanel", "ToolsPanelItem", "useBorderProps", "getShadowClassesAndStyles", "ImageEditor"]
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tExternalLink,\n\tFocalPointPicker,\n\tResizableBox,\n\tSpinner,\n\tTextareaControl,\n\tTextControl,\n\tCheckboxControl,\n\tToolbarButton,\n\tToolbarGroup,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\tPlaceholder,\n\tMenuItem,\n\tToolbarItem,\n\tDropdownMenu,\n\tPopover,\n} from '@wordpress/components';\nimport {\n\tuseMergeRefs,\n\tuseResizeObserver,\n\tuseViewportMatch,\n} from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\t__experimentalImageURLInputUI as ImageURLInputUI,\n\tMediaReplaceFlow,\n\tstore as blockEditorStore,\n\tuseSettings,\n\t__experimentalUseBorderProps as useBorderProps,\n\t__experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,\n\tprivateApis as blockEditorPrivateApis,\n\tBlockSettingsMenuControls,\n} from '@wordpress/block-editor';\nimport {\n\tcreateInterpolateElement,\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { __, _x, sprintf, isRTL } from '@wordpress/i18n';\nimport { getFilename } from '@wordpress/url';\nimport { getBlockBindingsSource, switchToBlockType } from '@wordpress/blocks';\nimport { crop, overlayText, upload, chevronDown } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { createUpgradedEmbedBlock } from '../embed/util';\nimport { isExternalImage } from './edit';\nimport { Caption } from '../utils/caption';\nimport { MediaControl } from '../utils/media-control';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport {\n\tgetActiveDimensionValue,\n\tgetDimensionResetAttributes,\n\tgetDimensionUpdateAttributes,\n\tgetStyleStateKey,\n} from '../utils/style-state';\nimport { useOpenImageMediaEditorModal } from './use-open-image-media-editor-modal';\nimport {\n\tMIN_SIZE,\n\tALLOWED_MEDIA_TYPES,\n\tSIZED_LAYOUTS,\n\tDEFAULT_MEDIA_SIZE_SLUG,\n} from './constants';\nimport { evalAspectRatio, mediaPosition } from './utils';\n\nconst {\n\tDimensionsTool,\n\tisDefaultBlockStyleState,\n\tResolutionTool,\n\tmediaEditKey,\n\tmediaSideloadFromUrlKey,\n} = unlock( blockEditorPrivateApis );\n\nconst scaleOptions = [\n\t{\n\t\tvalue: 'cover',\n\t\tlabel: _x( 'Cover', 'Scale option for dimensions control' ),\n\t\thelp: __( 'Image covers the space evenly.' ),\n\t},\n\t{\n\t\tvalue: 'contain',\n\t\tlabel: _x( 'Contain', 'Scale option for dimensions control' ),\n\t\thelp: __( 'Image is contained without distortion.' ),\n\t},\n];\n\nconst WRITEMODE_POPOVER_PROPS = {\n\tplacement: 'bottom-start',\n};\n\n// If the image has a href, wrap in an <a /> tag to trigger any inherited link element styles.\nconst ImageWrapper = ( { href, children } ) => {\n\tif ( ! href ) {\n\t\treturn children;\n\t}\n\treturn (\n\t\t<a\n\t\t\thref={ href }\n\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\taria-disabled\n\t\t\tstyle={ {\n\t\t\t\t// When the Image block is linked,\n\t\t\t\t// it's wrapped with a disabled <a /> tag.\n\t\t\t\t// Restore cursor style so it doesn't appear 'clickable'\n\t\t\t\t// and remove pointer events. Safari needs the display property.\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\tcursor: 'default',\n\t\t\t\tdisplay: 'inline',\n\t\t\t} }\n\t\t>\n\t\t\t{ children }\n\t\t</a>\n\t);\n};\n\nfunction ContentOnlyControls( {\n\tattributes,\n\tsetAttributes,\n\tlockAltControls,\n\tlockAltControlsMessage,\n\tlockTitleControls,\n\tlockTitleControlsMessage,\n} ) {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst [ isAltDialogOpen, setIsAltDialogOpen ] = useState( false );\n\tconst [ isTitleDialogOpen, setIsTitleDialogOpen ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<ToolbarItem ref={ setPopoverAnchor }>\n\t\t\t\t{ ( toggleProps ) => (\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'More' ) }\n\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t...toggleProps,\n\t\t\t\t\t\t\tdescription: __( 'Displays more controls.' ),\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tpopoverProps={ WRITEMODE_POPOVER_PROPS }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsAltDialogOpen( true );\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ _x(\n\t\t\t\t\t\t\t\t\t\t'Alternative text',\n\t\t\t\t\t\t\t\t\t\t'Alternative text for an image. Block toolbar label, a low character count is preferred.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsTitleDialogOpen( true );\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( 'Title text' ) }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t) }\n\t\t\t</ToolbarItem>\n\t\t\t{ isAltDialogOpen && (\n\t\t\t\t<Popover\n\t\t\t\t\tplacement=\"bottom-start\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tonClose={ () => setIsAltDialogOpen( false ) }\n\t\t\t\t\toffset={ 13 }\n\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"wp-block-image__toolbar_content_textarea__container\">\n\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\tvalue={ attributes.alt || '' }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { alt: value } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={ lockAltControls }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t\t\t{ __( 'Leave empty if decorative.' ) }\n\t\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t\t{ isTitleDialogOpen && (\n\t\t\t\t<Popover\n\t\t\t\t\tplacement=\"bottom-start\"\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tonClose={ () => setIsTitleDialogOpen( false ) }\n\t\t\t\t\toffset={ 13 }\n\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"wp-block-image__toolbar_content_textarea__container\">\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\tclassName=\"wp-block-image__toolbar_content_textarea\"\n\t\t\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\t\t\tvalue={ attributes.title || '' }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\ttitle: value,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={ lockTitleControls }\n\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\tcreateInterpolateElement(\n\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t'Describe the role of this image on the page. <a>(Note: many devices and browsers do not display this text.)</a>'\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/TR/html52/dom.html#the-title-attribute\" />\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</Popover>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default function Image( {\n\ttemporaryURL,\n\tisSideloading,\n\tattributes,\n\tsetAttributes,\n\tisSingleSelected,\n\tinsertBlocksAfter,\n\tonReplace,\n\tonSelectImage,\n\tonSelectURL,\n\tonUploadError,\n\tcontext,\n\tclientId,\n\tblockEditingMode,\n\tparentLayoutType,\n\tmaxContentWidth,\n} ) {\n\tconst {\n\t\turl = '',\n\t\talt,\n\t\talign,\n\t\tid,\n\t\thref,\n\t\trel,\n\t\tlinkClass,\n\t\tlinkDestination,\n\t\ttitle,\n\t\twidth,\n\t\theight,\n\t\taspectRatio,\n\t\tscale,\n\t\tfocalPoint,\n\t\tlinkTarget,\n\t\tsizeSlug,\n\t\tlightbox,\n\t\tmetadata,\n\t\tisDecorative,\n\t} = attributes;\n\tconst [ imageElement, setImageElement ] = useState();\n\tconst [ resizeDelta, setResizeDelta ] = useState( null );\n\tconst [ pixelSize, setPixelSize ] = useState( {} );\n\tconst [ offsetTop, setOffsetTop ] = useState( 0 );\n\tconst setResizeObserved = useResizeObserver( ( [ entry ] ) => {\n\t\tif ( ! resizeDelta ) {\n\t\t\tconst [ box ] = entry.borderBoxSize;\n\t\t\tsetPixelSize( { width: box.inlineSize, height: box.blockSize } );\n\t\t}\n\t\t// This is usually 0 unless the image height is less than the line-height.\n\t\tsetOffsetTop( entry.target.offsetTop );\n\t} );\n\tconst effectResizeableBoxPlacement = useCallback( () => {\n\t\tsetOffsetTop( imageElement?.offsetTop ?? 0 );\n\t}, [ imageElement ] );\n\tconst setRefs = useMergeRefs( [ setImageElement, setResizeObserved ] );\n\tconst { allowResize = true } = context;\n\n\tconst { image, attachmentResolutionError } = useSelect(\n\t\t( select ) => {\n\t\t\tconst imageRecord =\n\t\t\t\tid && isSingleSelected\n\t\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t{ context: 'view' }\n\t\t\t\t\t )\n\t\t\t\t\t: null;\n\n\t\t\t// Check if the attachment resolution failed with a specific error.\n\t\t\t// We use getResolutionError instead of hasFinishedResolution so we\n\t\t\t// can distinguish 404 (attachment doesn't exist) from transient\n\t\t\t// errors (500, 403, network) that shouldn't clear the id.\n\t\t\tconst resolutionError =\n\t\t\t\tid && isSingleSelected\n\t\t\t\t\t? select( coreStore ).getResolutionError(\n\t\t\t\t\t\t\t'getEntityRecord',\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t{ context: 'view' },\n\t\t\t\t\t\t\t]\n\t\t\t\t\t )\n\t\t\t\t\t: null;\n\n\t\t\treturn {\n\t\t\t\timage: imageRecord,\n\t\t\t\tattachmentResolutionError: resolutionError,\n\t\t\t};\n\t\t},\n\t\t[ id, isSingleSelected ]\n\t);\n\n\tconst {\n\t\tcanInsertCover,\n\t\timageEditing,\n\t\timageSizes,\n\t\tmaxWidth,\n\t\teditMediaEntity,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId, canInsertBlockType, getSettings } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst settings = getSettings();\n\n\t\t\treturn {\n\t\t\t\timageEditing: settings.imageEditing,\n\t\t\t\timageSizes: settings.imageSizes,\n\t\t\t\tmaxWidth: settings.maxWidth,\n\t\t\t\teditMediaEntity: settings?.[ mediaEditKey ],\n\t\t\t\tcanInsertCover: canInsertBlockType(\n\t\t\t\t\t'core/cover',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst { getBlock, getSettings } = useSelect( blockEditorStore );\n\tconst cropButtonRef = useRef();\n\tconst handleMediaEditorModalClose = useCallback(\n\t\t() => cropButtonRef.current?.focus(),\n\t\t[]\n\t);\n\tconst openImageMediaEditorModal = useOpenImageMediaEditorModal( {\n\t\tattributes,\n\t\tsetAttributes,\n\t\tonClose: handleMediaEditorModalClose,\n\t} );\n\n\tconst {\n\t\treplaceBlocks,\n\t\ttoggleSelection,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t} = useDispatch( blockEditorStore );\n\tconst { createErrorNotice, createSuccessNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideAligned = [ 'wide', 'full' ].includes( align );\n\tconst [\n\t\t{ loadedNaturalWidth, loadedNaturalHeight },\n\t\tsetLoadedNaturalSize,\n\t] = useState( {} );\n\tconst [ hasImageErrored, setHasImageErrored ] = useState( false );\n\tconst hasNonContentControls = blockEditingMode === 'default';\n\tconst isContentOnlyMode = blockEditingMode === 'contentOnly';\n\tconst showDimensionsControls = allowResize && hasNonContentControls;\n\tconst isResizable =\n\t\tallowResize &&\n\t\thasNonContentControls &&\n\t\t! isWideAligned &&\n\t\tisLargeViewport;\n\t// An image is uploading if it has a temporary blob URL, or if it is\n\t// being processed client-side (e.g. transcoded or generating sub-sizes).\n\tconst isUploading = !! temporaryURL || isSideloading;\n\tconst imageSizeOptions = imageSizes\n\t\t.filter(\n\t\t\t( { slug } ) => image?.media_details?.sizes?.[ slug ]?.source_url\n\t\t)\n\t\t.map( ( { name, slug } ) => ( { value: slug, label: name } ) );\n\n\t// If the image has an id but the attachment doesn't exist on this site,\n\t// clear the id so Gutenberg treats the image as external.\n\t// This handles content copied between WordPress sites.\n\t//\n\t// Known limitation: if a different attachment with the same id happens to\n\t// exist on the destination site, the lookup will succeed and the wrong\n\t// local image will be used. URL matching could address this in a follow-up.\n\t// See: https://github.com/WordPress/gutenberg/issues/74156\n\tuseEffect( () => {\n\t\tif ( ! id || ! isSingleSelected ) {\n\t\t\treturn;\n\t\t}\n\t\t// Only clear for confirmed 404s. apiFetch throws the Response object\n\t\t// for HTTP errors, so checking .status === 404 avoids incorrectly\n\t\t// clearing the id on 403, 500, or network failures, which would\n\t\t// cause data loss for valid local attachments.\n\t\tif ( attachmentResolutionError?.status === 404 ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { id: undefined } );\n\t\t}\n\t}, [\n\t\tid,\n\t\tisSingleSelected,\n\t\tattachmentResolutionError,\n\t\tsetAttributes,\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t] );\n\n\t/*\n\t * Externally hosted images can be uploaded to the media library. The\n\t * server sideloads the URL (see mediaSideloadFromUrl), so this works even\n\t * when the editor is cross-origin isolated and the browser cannot read the\n\t * cross-origin image's bytes itself.\n\t */\n\tconst canUploadExternalImage =\n\t\tisSingleSelected &&\n\t\tisExternalImage( id, url ) &&\n\t\t!! getSettings()[ mediaSideloadFromUrlKey ];\n\n\t// Get naturalWidth and naturalHeight from image, and fall back to loaded natural\n\t// width and height. This resolves an issue in Safari where the loaded natural\n\t// width and height is otherwise lost when switching between alignments.\n\t// See: https://github.com/WordPress/gutenberg/pull/37210.\n\tconst { naturalWidth, naturalHeight } = useMemo( () => {\n\t\treturn {\n\t\t\tnaturalWidth:\n\t\t\t\timageElement?.naturalWidth || loadedNaturalWidth || undefined,\n\t\t\tnaturalHeight:\n\t\t\t\timageElement?.naturalHeight || loadedNaturalHeight || undefined,\n\t\t};\n\t}, [ loadedNaturalWidth, loadedNaturalHeight, imageElement?.complete ] );\n\n\tfunction onImageError() {\n\t\tsetHasImageErrored( true );\n\n\t\t// Check if there's an embed block that handles this URL, e.g., instagram URL.\n\t\t// See: https://github.com/WordPress/gutenberg/pull/11472\n\t\tconst embedBlock = createUpgradedEmbedBlock( { attributes: { url } } );\n\t\tif ( undefined !== embedBlock ) {\n\t\t\tonReplace( embedBlock );\n\t\t}\n\t}\n\n\tfunction onImageLoad( event ) {\n\t\tsetHasImageErrored( false );\n\t\tsetLoadedNaturalSize( {\n\t\t\tloadedNaturalWidth: event.target?.naturalWidth,\n\t\t\tloadedNaturalHeight: event.target?.naturalHeight,\n\t\t} );\n\t}\n\n\tfunction onSetHref( props ) {\n\t\tsetAttributes( props );\n\t}\n\n\tfunction onSetLightbox( enable ) {\n\t\tif ( enable && ! lightboxSetting?.enabled ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: true },\n\t\t\t\tisDecorative: false,\n\t\t\t} );\n\t\t} else if ( ! enable && lightboxSetting?.enabled ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: false },\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction resetLightbox() {\n\t\t// When deleting a link from an image while lightbox settings\n\t\t// are enabled by default, we should disable the lightbox,\n\t\t// otherwise the resulting UX looks like a mistake.\n\t\t// See https://github.com/WordPress/gutenberg/pull/59890/files#r1532286123.\n\t\tif ( lightboxSetting?.enabled && lightboxSetting?.allowEditing ) {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: { enabled: false },\n\t\t\t} );\n\t\t} else {\n\t\t\tsetAttributes( {\n\t\t\t\tlightbox: undefined,\n\t\t\t} );\n\t\t}\n\t}\n\n\tfunction onSetTitle( value ) {\n\t\t// This is the HTML title attribute, separate from the media object\n\t\t// title.\n\t\tsetAttributes( { title: value } );\n\t}\n\n\tfunction updateAlt( newAlt ) {\n\t\tsetAttributes( { alt: newAlt } );\n\t}\n\n\tfunction updateIsDecorative( value ) {\n\t\tsetAttributes( {\n\t\t\tisDecorative: value || undefined,\n\t\t\t...( value && {\n\t\t\t\talt: '',\n\t\t\t\tcaption: undefined,\n\t\t\t\thref: undefined,\n\t\t\t\tlinkDestination: undefined,\n\t\t\t\tlinkTarget: undefined,\n\t\t\t\trel: undefined,\n\t\t\t} ),\n\t\t} );\n\t}\n\n\tconst imperativeFocalPointPreview = ( value ) => {\n\t\tif ( imageElement ) {\n\t\t\timageElement.style.setProperty(\n\t\t\t\t'object-position',\n\t\t\t\tmediaPosition( value )\n\t\t\t);\n\t\t}\n\t};\n\n\tfunction updateImage( newSizeSlug ) {\n\t\tconst newUrl = image?.media_details?.sizes?.[ newSizeSlug ]?.source_url;\n\t\tif ( ! newUrl ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\turl: newUrl,\n\t\t\tsizeSlug: newSizeSlug,\n\t\t} );\n\t}\n\n\tfunction uploadExternal() {\n\t\tconst mediaSideloadFromUrl = getSettings()[ mediaSideloadFromUrlKey ];\n\t\tif ( ! mediaSideloadFromUrl ) {\n\t\t\treturn;\n\t\t}\n\t\tmediaSideloadFromUrl( {\n\t\t\turl,\n\t\t\tonSuccess( img ) {\n\t\t\t\tonSelectImage( img );\n\t\t\t\tcreateSuccessNotice( __( 'Image uploaded.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t},\n\t\t\tonError( message ) {\n\t\t\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\t\t},\n\t\t} );\n\t}\n\n\tconst canEditImage =\n\t\tid &&\n\t\tnaturalWidth &&\n\t\tnaturalHeight &&\n\t\timageEditing &&\n\t\t!! editMediaEntity;\n\tconst allowCrop =\n\t\tisSingleSelected &&\n\t\tcanEditImage &&\n\t\t!! openImageMediaEditorModal &&\n\t\t! isContentOnlyMode &&\n\t\t! isUploading;\n\n\tfunction switchToCover() {\n\t\treplaceBlocks(\n\t\t\tclientId,\n\t\t\tswitchToBlockType( getBlock( clientId ), 'core/cover' )\n\t\t);\n\t}\n\n\t// TODO: Can allow more units after figuring out how they should interact\n\t// with the ResizableBox component. Calculations later on for that\n\t// component are currently assuming px units.\n\tconst dimensionsUnitsOptions = useCustomUnits( {\n\t\tavailableUnits: [ 'px' ],\n\t} );\n\n\tconst [ lightboxSetting ] = useSettings( 'lightbox' );\n\n\tconst showLightboxSetting =\n\t\t// If a block-level override is set, we should give users the option to\n\t\t// remove that override, even if the lightbox UI is disabled in the settings.\n\t\t( !! lightbox && lightbox?.enabled !== lightboxSetting?.enabled ) ||\n\t\tlightboxSetting?.allowEditing;\n\n\tconst lightboxChecked =\n\t\t!! lightbox?.enabled || ( ! lightbox && !! lightboxSetting?.enabled );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst selectedStyleState = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSingleSelected ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tconst { getSelectedBlockStyleState } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\treturn getSelectedBlockStyleState( clientId );\n\t\t},\n\t\t[ clientId, isSingleSelected ]\n\t);\n\tconst hasSelectedStyleState =\n\t\t! isDefaultBlockStyleState( selectedStyleState );\n\tconst selectedStyleStateKey = getStyleStateKey( selectedStyleState );\n\tconst activeWidth = getActiveDimensionValue( {\n\t\tattributes,\n\t\tselectedState: selectedStyleState,\n\t\thasSelectedStyleState,\n\t\tattributeKey: 'width',\n\t} );\n\tconst activeHeight = getActiveDimensionValue( {\n\t\tattributes,\n\t\tselectedState: selectedStyleState,\n\t\thasSelectedStyleState,\n\t\tattributeKey: 'height',\n\t} );\n\tconst activeAspectRatio = getActiveDimensionValue( {\n\t\tattributes,\n\t\tselectedState: selectedStyleState,\n\t\thasSelectedStyleState,\n\t\tattributeKey: 'aspectRatio',\n\t} );\n\tconst activeScale = getActiveDimensionValue( {\n\t\tattributes,\n\t\tselectedState: selectedStyleState,\n\t\thasSelectedStyleState,\n\t\tattributeKey: 'scale',\n\t\tstyleKey: 'objectFit',\n\t} );\n\tconst setDimensionAttributes = ( nextDimensions ) => {\n\t\tsetAttributes(\n\t\t\tgetDimensionUpdateAttributes( {\n\t\t\t\tstyle: attributes.style,\n\t\t\t\tselectedState: selectedStyleState,\n\t\t\t\thasSelectedStyleState,\n\t\t\t\tnextDimensions,\n\t\t\t\tdimensionKeyMap: { scale: 'objectFit' },\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst dimensionsControl =\n\t\tshowDimensionsControls &&\n\t\t( SIZED_LAYOUTS.includes( parentLayoutType ) ? (\n\t\t\t<DimensionsTool\n\t\t\t\tkey={ selectedStyleStateKey }\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tvalue={ { aspectRatio: activeAspectRatio, scale: activeScale } }\n\t\t\t\tonChange={ ( { aspectRatio: newAspectRatio } ) => {\n\t\t\t\t\tsetDimensionAttributes( {\n\t\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t\t\tscale: 'cover',\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\t\ttools={ [ 'aspectRatio' ] }\n\t\t\t/>\n\t\t) : (\n\t\t\t<DimensionsTool\n\t\t\t\tkey={ selectedStyleStateKey }\n\t\t\t\tpanelId={ clientId }\n\t\t\t\tvalue={ {\n\t\t\t\t\twidth: activeWidth,\n\t\t\t\t\theight: activeHeight,\n\t\t\t\t\tscale: activeScale,\n\t\t\t\t\taspectRatio: activeAspectRatio,\n\t\t\t\t} }\n\t\t\t\tonChange={ ( {\n\t\t\t\t\twidth: newWidth,\n\t\t\t\t\theight: newHeight,\n\t\t\t\t\tscale: newScale,\n\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t} ) => {\n\t\t\t\t\tsetDimensionAttributes( {\n\t\t\t\t\t\t// CSS includes `height: auto`, but we need\n\t\t\t\t\t\t// `width: auto` to fix the aspect ratio when\n\t\t\t\t\t\t// only height is set due to the width and\n\t\t\t\t\t\t// height attributes set via the server.\n\t\t\t\t\t\twidth: ! newWidth && newHeight ? 'auto' : newWidth,\n\t\t\t\t\t\theight: newHeight,\n\t\t\t\t\t\taspectRatio: newAspectRatio,\n\t\t\t\t\t\tscale: newScale,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tdefaultScale=\"cover\"\n\t\t\t\tdefaultAspectRatio=\"auto\"\n\t\t\t\tscaleOptions={ scaleOptions }\n\t\t\t\tunitsOptions={ dimensionsUnitsOptions }\n\t\t\t\ttools={\n\t\t\t\t\tisWideAligned\n\t\t\t\t\t\t? [ 'aspectRatio', 'scale' ]\n\t\t\t\t\t\t: [ 'aspectRatio', 'widthHeight', 'scale' ]\n\t\t\t\t}\n\t\t\t/>\n\t\t) );\n\n\tconst resetSettings = () => {\n\t\tsetAttributes( {\n\t\t\tlightbox: undefined,\n\t\t} );\n\t\tupdateImage( DEFAULT_MEDIA_SIZE_SLUG );\n\t};\n\n\tconst arePatternOverridesEnabled =\n\t\tmetadata?.bindings?.__default?.source === 'core/pattern-overrides';\n\n\tconst {\n\t\tlockUrlControls = false,\n\t\tlockHrefControls = false,\n\t\tlockAltControls = false,\n\t\tlockAltControlsMessage,\n\t\tlockTitleControls = false,\n\t\tlockTitleControlsMessage,\n\t\thideCaptionControls = false,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! isSingleSelected ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst {\n\t\t\t\turl: urlBinding,\n\t\t\t\talt: altBinding,\n\t\t\t\ttitle: titleBinding,\n\t\t\t\tcaption: captionBinding,\n\t\t\t} = metadata?.bindings || {};\n\t\t\tconst hasParentPattern = !! context[ 'pattern/overrides' ];\n\t\t\tconst urlBindingSource = getBlockBindingsSource(\n\t\t\t\turlBinding?.source\n\t\t\t);\n\t\t\tconst altBindingSource = getBlockBindingsSource(\n\t\t\t\taltBinding?.source\n\t\t\t);\n\t\t\tconst titleBindingSource = getBlockBindingsSource(\n\t\t\t\ttitleBinding?.source\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tlockUrlControls:\n\t\t\t\t\t!! urlBinding &&\n\t\t\t\t\t! urlBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: urlBinding?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockHrefControls:\n\t\t\t\t\t// Disable editing the link of the URL if the image is inside a pattern instance.\n\t\t\t\t\t// This is a temporary solution until we support overriding the link on the frontend.\n\t\t\t\t\thasParentPattern || arePatternOverridesEnabled,\n\t\t\t\thideCaptionControls: !! captionBinding,\n\t\t\t\tlockAltControls:\n\t\t\t\t\t!! altBinding &&\n\t\t\t\t\t! altBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: altBinding?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockAltControlsMessage: altBindingSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\taltBindingSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t\tlockTitleControls:\n\t\t\t\t\t!! titleBinding &&\n\t\t\t\t\t! titleBindingSource?.canUserEditValue?.( {\n\t\t\t\t\t\tselect,\n\t\t\t\t\t\tcontext,\n\t\t\t\t\t\targs: titleBinding?.args,\n\t\t\t\t\t} ),\n\t\t\t\tlockTitleControlsMessage: titleBindingSource?.label\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: Label of the bindings source. */\n\t\t\t\t\t\t\t__( 'Connected to %s' ),\n\t\t\t\t\t\t\ttitleBindingSource.label\n\t\t\t\t\t )\n\t\t\t\t\t: __( 'Connected to dynamic data' ),\n\t\t\t};\n\t\t},\n\t\t[\n\t\t\tarePatternOverridesEnabled,\n\t\t\tcontext,\n\t\t\tisSingleSelected,\n\t\t\tmetadata?.bindings,\n\t\t]\n\t);\n\n\tconst showUrlInput =\n\t\tisSingleSelected &&\n\t\t! lockHrefControls &&\n\t\t! lockUrlControls &&\n\t\t! isDecorative;\n\n\tconst showCoverControls =\n\t\tisSingleSelected && canInsertCover && ! isContentOnlyMode;\n\n\tconst showBlockControls = showUrlInput || allowCrop || showCoverControls;\n\n\tconst mediaControls = isSingleSelected && ! lockUrlControls && (\n\t\t<>\n\t\t\t{ /* For contentOnly mode, put this button in its own area so it has borders around it. */ }\n\t\t\t<BlockControls group={ isContentOnlyMode ? 'inline' : 'other' }>\n\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\tmediaId={ id }\n\t\t\t\t\tmediaURL={ url }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tname={ ! url ? __( 'Add image' ) : __( 'Replace' ) }\n\t\t\t\t\tonReset={ () => onSelectImage( undefined ) }\n\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t/>\n\t\t\t</BlockControls>\n\t\t</>\n\t);\n\n\tconst hasDataFormBlockFields =\n\t\twindow?.__experimentalContentOnlyInspectorFields;\n\n\tconst controls = (\n\t\t<>\n\t\t\t{ showBlockControls && (\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t{ showUrlInput && (\n\t\t\t\t\t\t<ImageURLInputUI\n\t\t\t\t\t\t\turl={ href || '' }\n\t\t\t\t\t\t\tonChangeUrl={ onSetHref }\n\t\t\t\t\t\t\tlinkDestination={ linkDestination }\n\t\t\t\t\t\t\tmediaUrl={ ( image && image.source_url ) || url }\n\t\t\t\t\t\t\tmediaLink={ image && image.link }\n\t\t\t\t\t\t\tlinkTarget={ linkTarget }\n\t\t\t\t\t\t\tlinkClass={ linkClass }\n\t\t\t\t\t\t\trel={ rel }\n\t\t\t\t\t\t\tshowLightboxSetting={ showLightboxSetting }\n\t\t\t\t\t\t\tlightboxEnabled={ lightboxChecked }\n\t\t\t\t\t\t\tonSetLightbox={ onSetLightbox }\n\t\t\t\t\t\t\tresetLightbox={ resetLightbox }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ allowCrop && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tref={ cropButtonRef }\n\t\t\t\t\t\t\tonClick={ openImageMediaEditorModal }\n\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\ticon={ crop }\n\t\t\t\t\t\t\tlabel={ __( 'Crop' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ showCoverControls && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\ticon={ overlayText }\n\t\t\t\t\t\t\tlabel={ __( 'Add text over image' ) }\n\t\t\t\t\t\t\tonClick={ switchToCover }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ canUploadExternalImage && (\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={ uploadExternal }\n\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\tlabel={ __( 'Upload to Media Library' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ isContentOnlyMode && (\n\t\t\t\t// Add some extra controls for content attributes when content only mode is active.\n\t\t\t\t// With content only mode active, the inspector is hidden, so users need another way\n\t\t\t\t// to edit these attributes.\n\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t<ContentOnlyControls\n\t\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\t\tlockAltControls={ lockAltControls }\n\t\t\t\t\t\tlockAltControlsMessage={ lockAltControlsMessage }\n\t\t\t\t\t\tlockTitleControls={ lockTitleControls }\n\t\t\t\t\t\tlockTitleControlsMessage={ lockTitleControlsMessage }\n\t\t\t\t\t/>\n\t\t\t\t</BlockControls>\n\t\t\t) }\n\t\t\t{ ! hasDataFormBlockFields && isSingleSelected && (\n\t\t\t\t<InspectorControls group=\"content\">\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Media' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tonSelectImage( undefined );\n\t\t\t\t\t\t\tsetAttributes( { isDecorative: false } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! lockUrlControls && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Image' ) }\n\t\t\t\t\t\t\t\thasValue={ () => !! url }\n\t\t\t\t\t\t\t\tonDeselect={ () => onSelectImage( undefined ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<MediaControl\n\t\t\t\t\t\t\t\t\tmediaId={ id }\n\t\t\t\t\t\t\t\t\tmediaUrl={ url }\n\t\t\t\t\t\t\t\t\talt={ alt }\n\t\t\t\t\t\t\t\t\tfilename={\n\t\t\t\t\t\t\t\t\t\timage?.media_details?.sizes?.full\n\t\t\t\t\t\t\t\t\t\t\t?.file ||\n\t\t\t\t\t\t\t\t\t\timage?.slug ||\n\t\t\t\t\t\t\t\t\t\tgetFilename( url )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\t\t\tonSelect={ onSelectImage }\n\t\t\t\t\t\t\t\t\tonSelectURL={ onSelectURL }\n\t\t\t\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\t\t\t\tonReset={ () => onSelectImage( undefined ) }\n\t\t\t\t\t\t\t\t\tisUploading={ isUploading }\n\t\t\t\t\t\t\t\t\temptyLabel={ __( 'Add image' ) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! isDecorative && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! alt }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { alt: undefined } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Alternative text' ) }\n\t\t\t\t\t\t\t\t\tvalue={ alt || '' }\n\t\t\t\t\t\t\t\t\tonChange={ updateAlt }\n\t\t\t\t\t\t\t\t\treadOnly={ lockAltControls }\n\t\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\t\tlockAltControls ? (\n\t\t\t\t\t\t\t\t\t\t\t<>{ lockAltControlsMessage }</>\n\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\t\t\t\thref={\n\t\t\t\t\t\t\t\t\t\t\t\t\t// translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.\n\t\t\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'https://www.w3.org/WAI/tutorials/images/decision-tree/'\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Describe the purpose of the image.'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\n\t\t\t\t\t\t{ ! lockAltControls && ! lightboxChecked && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Mark as decorative' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => !! isDecorative }\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( { isDecorative: false } )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Mark as decorative' ) }\n\t\t\t\t\t\t\t\t\tchecked={ !! isDecorative }\n\t\t\t\t\t\t\t\t\tonChange={ updateIsDecorative }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Hidden from assistive technologies.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tresetAllFilter={ ( attrs ) => {\n\t\t\t\t\treturn getDimensionResetAttributes( {\n\t\t\t\t\t\tattributes: attrs,\n\t\t\t\t\t\tselectedState: selectedStyleState,\n\t\t\t\t\t\thasSelectedStyleState,\n\t\t\t\t\t\tkeys: [ 'aspectRatio', 'height', 'objectFit', 'width' ],\n\t\t\t\t\t\tdefaultAttributes: {\n\t\t\t\t\t\t\taspectRatio: undefined,\n\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\theight: undefined,\n\t\t\t\t\t\t\tscale: undefined,\n\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ dimensionsControl }\n\t\t\t\t{ ! hasSelectedStyleState && url && scale && (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! focalPoint }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tfocalPoint: undefined,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpanelId={ clientId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<FocalPointPicker\n\t\t\t\t\t\t\tlabel={ __( 'Focal point' ) }\n\t\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\t\tvalue={ focalPoint }\n\t\t\t\t\t\t\tonDragStart={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\tonDrag={ imperativeFocalPointPreview }\n\t\t\t\t\t\t\tonChange={ ( newFocalPoint ) =>\n\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\tfocalPoint: newFocalPoint,\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t) }\n\t\t\t</InspectorControls>\n\t\t\t{ !! imageSizeOptions.length && (\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\t\tresetAll={ resetSettings }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ResolutionTool\n\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\tdefaultValue={ DEFAULT_MEDIA_SIZE_SLUG }\n\t\t\t\t\t\t\tonChange={ updateImage }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t</InspectorControls>\n\t\t\t) }\n\t\t\t<InspectorControls group=\"advanced\">\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ __( 'Title attribute' ) }\n\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\tonChange={ onSetTitle }\n\t\t\t\t\treadOnly={ lockTitleControls }\n\t\t\t\t\thelp={\n\t\t\t\t\t\tlockTitleControls ? (\n\t\t\t\t\t\t\t<>{ lockTitleControlsMessage }</>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\tcreateInterpolateElement(\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Describe the role of this image on the page. <a>(Note: many devices and browsers do not display this text.)</a>'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t\t\t\t<ExternalLink href=\"https://www.w3.org/TR/html52/dom.html#the-title-attribute\" />\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n\n\tconst filename = getFilename( url );\n\tlet defaultedAlt;\n\n\tif ( isDecorative ) {\n\t\tdefaultedAlt = filename\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: %s: file name */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'This image has been marked as decorative; its file name is %s'\n\t\t\t\t\t),\n\t\t\t\t\tfilename\n\t\t\t )\n\t\t\t: __( 'This image has been marked as decorative.' );\n\t} else if ( alt ) {\n\t\tdefaultedAlt = alt;\n\t} else if ( filename ) {\n\t\tdefaultedAlt = sprintf(\n\t\t\t/* translators: %s: file name */\n\t\t\t__( 'This image has an empty alt attribute; its file name is %s' ),\n\t\t\tfilename\n\t\t);\n\t} else {\n\t\tdefaultedAlt = __( 'This image has an empty alt attribute' );\n\t}\n\n\tconst borderProps = useBorderProps( attributes );\n\tconst shadowProps = getShadowClassesAndStyles( attributes );\n\n\tconst { postType, postId, queryId } = context;\n\tconst isDescendentOfQueryLoop = Number.isFinite( queryId );\n\n\tconst img = (\n\t\t<ImageWrapper href={ href }>\n\t\t\t{ temporaryURL && hasImageErrored ? (\n\t\t\t\t// Show a placeholder during upload when the blob URL can't be loaded. This can\n\t\t\t\t// happen when the user uploads a HEIC image in a browser that doesn't support them.\n\t\t\t\t<Placeholder\n\t\t\t\t\tclassName=\"wp-block-image__placeholder\"\n\t\t\t\t\twithIllustration\n\t\t\t\t>\n\t\t\t\t\t<Spinner />\n\t\t\t\t</Placeholder>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<img\n\t\t\t\t\t\tsrc={ temporaryURL || url }\n\t\t\t\t\t\talt={ defaultedAlt }\n\t\t\t\t\t\tonError={ onImageError }\n\t\t\t\t\t\tonLoad={ onImageLoad }\n\t\t\t\t\t\tref={ setRefs }\n\t\t\t\t\t\tclassName={ borderProps.className }\n\t\t\t\t\t\twidth={ naturalWidth }\n\t\t\t\t\t\theight={ naturalHeight }\n\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\taspectRatio,\n\t\t\t\t\t\t\t...( resizeDelta\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\twidth:\n\t\t\t\t\t\t\t\t\t\t\tpixelSize.width + resizeDelta.width,\n\t\t\t\t\t\t\t\t\t\theight:\n\t\t\t\t\t\t\t\t\t\t\tpixelSize.height +\n\t\t\t\t\t\t\t\t\t\t\tresizeDelta.height,\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: ( () => {\n\t\t\t\t\t\t\t\t\t\tconst style = {};\n\t\t\t\t\t\t\t\t\t\tif ( width === 'auto' ) {\n\t\t\t\t\t\t\t\t\t\t\tstyle.width = 'auto';\n\t\t\t\t\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\t\t\t\t\twidth !== undefined &&\n\t\t\t\t\t\t\t\t\t\t\twidth !== null\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tstyle.width =\n\t\t\t\t\t\t\t\t\t\t\t\ttypeof width === 'number'\n\t\t\t\t\t\t\t\t\t\t\t\t\t? `${ width }px`\n\t\t\t\t\t\t\t\t\t\t\t\t\t: width;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\theight === 'auto' ||\n\t\t\t\t\t\t\t\t\t\t\theight === undefined ||\n\t\t\t\t\t\t\t\t\t\t\theight === null\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tstyle.height = 'auto';\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tstyle.height =\n\t\t\t\t\t\t\t\t\t\t\t\ttypeof height === 'number'\n\t\t\t\t\t\t\t\t\t\t\t\t\t? `${ height }px`\n\t\t\t\t\t\t\t\t\t\t\t\t\t: height;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn style;\n\t\t\t\t\t\t\t\t } )() ),\n\t\t\t\t\t\t\tobjectFit: scale,\n\t\t\t\t\t\t\tobjectPosition:\n\t\t\t\t\t\t\t\tfocalPoint && scale\n\t\t\t\t\t\t\t\t\t? mediaPosition( focalPoint )\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t...borderProps.style,\n\t\t\t\t\t\t\t...shadowProps.style,\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isUploading && <Spinner /> }\n\t\t\t\t</>\n\t\t\t) }\n\t\t</ImageWrapper>\n\t);\n\n\tlet resizableBox;\n\tif (\n\t\tisResizable &&\n\t\tisSingleSelected &&\n\t\t! isUploading &&\n\t\t! SIZED_LAYOUTS.includes( parentLayoutType )\n\t) {\n\t\tconst numericRatio = aspectRatio && evalAspectRatio( aspectRatio );\n\t\tconst customRatio = pixelSize.width / pixelSize.height;\n\t\tconst naturalRatio = naturalWidth / naturalHeight;\n\t\tconst ratio = numericRatio || customRatio || naturalRatio || 1;\n\t\tconst minWidth =\n\t\t\tnaturalWidth < naturalHeight ? MIN_SIZE : MIN_SIZE * ratio;\n\t\tconst minHeight =\n\t\t\tnaturalHeight < naturalWidth ? MIN_SIZE : MIN_SIZE / ratio;\n\n\t\t// With the current implementation of ResizableBox, an image needs an\n\t\t// explicit pixel value for the max-width. In absence of being able to\n\t\t// set the content-width, this max-width is currently dictated by the\n\t\t// vanilla editor style. The following variable adds a buffer to this\n\t\t// vanilla style, so 3rd party themes have some wiggleroom. This does,\n\t\t// in most cases, allow you to scale the image beyond the width of the\n\t\t// main column, though not infinitely.\n\t\t// @todo It would be good to revisit this once a content-width variable\n\t\t// becomes available.\n\t\tconst maxWidthBuffer = maxWidth * 2.5;\n\t\tconst maxResizeWidth = maxContentWidth || maxWidthBuffer;\n\n\t\tlet showRightHandle = false;\n\t\tlet showLeftHandle = false;\n\n\t\t/* eslint-disable no-lonely-if */\n\t\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\t\tif ( align === 'center' ) {\n\t\t\t// When the image is centered, show both handles.\n\t\t\tshowRightHandle = true;\n\t\t\tshowLeftHandle = true;\n\t\t} else if ( isRTL() ) {\n\t\t\t// In RTL mode the image is on the right by default.\n\t\t\t// Show the right handle and hide the left handle only when it is\n\t\t\t// aligned left. Otherwise always show the left handle.\n\t\t\tif ( align === 'left' ) {\n\t\t\t\tshowRightHandle = true;\n\t\t\t} else {\n\t\t\t\tshowLeftHandle = true;\n\t\t\t}\n\t\t} else {\n\t\t\t// Show the left handle and hide the right handle only when the\n\t\t\t// image is aligned right. Otherwise always show the right handle.\n\t\t\tif ( align === 'right' ) {\n\t\t\t\tshowLeftHandle = true;\n\t\t\t} else {\n\t\t\t\tshowRightHandle = true;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-lonely-if */\n\t\tresizableBox = (\n\t\t\t<ResizableBox\n\t\t\t\tref={ effectResizeableBoxPlacement }\n\t\t\t\tstyle={ {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t// To match the vertical-align: bottom of the img (from style.scss)\n\t\t\t\t\t// syncs the top with the img. This matters when the img height is\n\t\t\t\t\t// less than the line-height.\n\t\t\t\t\tinset: `${ offsetTop }px 0 0 0`,\n\t\t\t\t} }\n\t\t\t\tsize={ pixelSize }\n\t\t\t\tminWidth={ minWidth }\n\t\t\t\tmaxWidth={ maxResizeWidth }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tmaxHeight={ maxResizeWidth / ratio }\n\t\t\t\tlockAspectRatio={ ratio }\n\t\t\t\tenable={ {\n\t\t\t\t\ttop: false,\n\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\tbottom: true,\n\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t} }\n\t\t\t\tonResizeStart={ () => {\n\t\t\t\t\ttoggleSelection( false );\n\t\t\t\t} }\n\t\t\t\tonResize={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tsetResizeDelta( delta );\n\t\t\t\t} }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\ttoggleSelection( true );\n\t\t\t\t\tsetResizeDelta( null );\n\t\t\t\t\tsetPixelSize( ( current ) => ( {\n\t\t\t\t\t\twidth: current.width + delta.width,\n\t\t\t\t\t\theight: current.height + delta.height,\n\t\t\t\t\t} ) );\n\n\t\t\t\t\t// Clear hardcoded width if the resized width is close to the max-content width.\n\t\t\t\t\tif (\n\t\t\t\t\t\tmaxContentWidth &&\n\t\t\t\t\t\t// Only do this if the image is bigger than the container to prevent it from being squished.\n\t\t\t\t\t\t// TODO: Remove this check if the image support setting 100% width.\n\t\t\t\t\t\tnaturalWidth >= maxContentWidth &&\n\t\t\t\t\t\tMath.abs( elt.offsetWidth - maxContentWidth ) < 10\n\t\t\t\t\t) {\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\twidth: undefined,\n\t\t\t\t\t\t\theight: undefined,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Since the aspect ratio is locked when resizing, we can\n\t\t\t\t\t// use the width of the resized element to calculate the\n\t\t\t\t\t// height in CSS to prevent stretching when the max-width\n\t\t\t\t\t// is reached.\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: `${ elt.offsetWidth }px`,\n\t\t\t\t\t\theight: 'auto',\n\t\t\t\t\t\taspectRatio:\n\t\t\t\t\t\t\tratio === naturalRatio\n\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t: String( ratio ),\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t\tresizeRatio={ align === 'center' ? 2 : 1 }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( ! url && ! temporaryURL ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ mediaControls }\n\t\t\t\t{ controls }\n\t\t\t</>\n\t\t);\n\t}\n\n\t/**\n\t * Set the post's featured image with the current image.\n\t */\n\tconst setPostFeatureImage = () => {\n\t\teditEntityRecord( 'postType', postType, postId, {\n\t\t\tfeatured_media: id,\n\t\t} );\n\t\tcreateSuccessNotice( __( 'Post featured image updated.' ), {\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t};\n\n\tconst featuredImageControl =\n\t\t! isDescendentOfQueryLoop && postId && id ? (\n\t\t\t<BlockSettingsMenuControls>\n\t\t\t\t{ ( { canEdit, selectedClientIds } ) =>\n\t\t\t\t\tcanEdit &&\n\t\t\t\t\tselectedClientIds.length === 1 &&\n\t\t\t\t\tclientId === selectedClientIds[ 0 ] && (\n\t\t\t\t\t\t<MenuItem onClick={ setPostFeatureImage }>\n\t\t\t\t\t\t\t{ __( 'Set as featured image' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t</BlockSettingsMenuControls>\n\t\t) : null;\n\n\treturn (\n\t\t<>\n\t\t\t{ mediaControls }\n\t\t\t{ controls }\n\t\t\t{ featuredImageControl }\n\t\t\t{ img }\n\t\t\t{ resizableBox }\n\n\t\t\t{ ! isDecorative && (\n\t\t\t\t<Caption\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tisSelected={ isSingleSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tlabel={ __( 'Image caption text' ) }\n\t\t\t\t\tshowToolbarButton={\n\t\t\t\t\t\tisSingleSelected &&\n\t\t\t\t\t\t( hasNonContentControls || isContentOnlyMode ) &&\n\t\t\t\t\t\t! hideCaptionControls\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAkBO;AACP,qBAIO;AACP,kBAAuC;AACvC,0BAWO;AACP,qBAOO;AACP,kBAAuC;AACvC,iBAA4B;AAC5B,oBAA0D;AAC1D,mBAAuD;AACvD,qBAAsC;AACtC,uBAAmC;AAKnC,yBAAuB;AACvB,kBAAyC;AACzC,kBAAgC;AAChC,qBAAwB;AACxB,2BAA6B;AAC7B,mBAA+C;AAC/C,yBAKO;AACP,+CAA6C;AAC7C,uBAKO;AACP,mBAA+C;AAiC7C;AA/BF,IAAM;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,QAAI,2BAAQ,oBAAAA,WAAuB;AAEnC,IAAM,eAAe;AAAA,EACpB;AAAA,IACC,OAAO;AAAA,IACP,WAAO,gBAAI,SAAS,qCAAsC;AAAA,IAC1D,UAAM,gBAAI,gCAAiC;AAAA,EAC5C;AAAA,EACA;AAAA,IACC,OAAO;AAAA,IACP,WAAO,gBAAI,WAAW,qCAAsC;AAAA,IAC5D,UAAM,g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", "noticesStore", "img", "useCustomUnits", "ImageURLInputUI", "ToolsPanel", "ToolsPanelItem", "useBorderProps", "getShadowClassesAndStyles"]
7
7
  }
@@ -26,6 +26,47 @@ __export(transforms_exports, {
26
26
  module.exports = __toCommonJS(transforms_exports);
27
27
  var import_blob = require("@wordpress/blob");
28
28
  var import_blocks = require("@wordpress/blocks");
29
+ var import_data = require("@wordpress/data");
30
+ var import_core_data = require("@wordpress/core-data");
31
+ function getCarriedGifConversionAttributes(attributes) {
32
+ const { align, anchor, className, style } = attributes;
33
+ const margin = style?.spacing?.margin;
34
+ return {
35
+ ...align && { align },
36
+ ...anchor && { anchor },
37
+ ...className && { className },
38
+ ...margin && { style: { spacing: { margin } } }
39
+ };
40
+ }
41
+ function getAnimatedGifVideoCompanion(id, url) {
42
+ if (!id) {
43
+ return null;
44
+ }
45
+ const urlPath = url?.split(/[?#]/)[0];
46
+ if (!urlPath?.toLowerCase().endsWith(".gif")) {
47
+ return null;
48
+ }
49
+ const record = (0, import_data.select)(import_core_data.store).getEntityRecord(
50
+ "postType",
51
+ "attachment",
52
+ id,
53
+ { context: "view" }
54
+ );
55
+ const details = record?.media_details;
56
+ if (!details?.animated_video || !record?.source_url) {
57
+ return null;
58
+ }
59
+ const dir = record.source_url.slice(
60
+ 0,
61
+ record.source_url.lastIndexOf("/") + 1
62
+ );
63
+ return {
64
+ src: dir + details.animated_video,
65
+ poster: details.animated_video_poster ? dir + details.animated_video_poster : void 0,
66
+ width: details.width,
67
+ height: details.height
68
+ };
69
+ }
29
70
  function stripFirstImage(attributes, { shortcode }) {
30
71
  const { body } = document.implementation.createHTMLDocument("");
31
72
  body.innerHTML = shortcode.content;
@@ -213,6 +254,43 @@ var transforms = {
213
254
  }
214
255
  }
215
256
  }
257
+ ],
258
+ to: [
259
+ {
260
+ // Offer converting an animated GIF into the Video block's "GIF"
261
+ // variation: a muted, looping, autoplaying video transcoded from
262
+ // the GIF and sideloaded next to it when it was uploaded. Only
263
+ // matches when that companion video exists, so ordinary images
264
+ // never see this transform.
265
+ type: "block",
266
+ blocks: ["core/video"],
267
+ isMatch: ({ id, url }) => !!getAnimatedGifVideoCompanion(id, url),
268
+ transform(attributes) {
269
+ const { id, url, caption } = attributes;
270
+ const companion = getAnimatedGifVideoCompanion(id, url);
271
+ return (0, import_blocks.createBlock)("core/video", {
272
+ ...getCarriedGifConversionAttributes(attributes),
273
+ id,
274
+ src: companion.src,
275
+ poster: companion.poster,
276
+ caption,
277
+ controls: false,
278
+ loop: true,
279
+ autoplay: true,
280
+ muted: true,
281
+ playsInline: true,
282
+ /*
283
+ * Carry the GIF's intrinsic dimensions so the <video>
284
+ * keeps its aspect ratio from the first paint. Without
285
+ * them the element collapses to the browser-default size
286
+ * and then jumps once the poster/metadata load, which
287
+ * shows up as a brief duplicated image during the swap.
288
+ */
289
+ width: companion.width,
290
+ height: companion.height
291
+ });
292
+ }
293
+ }
216
294
  ]
217
295
  };
218
296
  var transforms_default = transforms;