@wordpress/block-library 11.0.2-next.v.202609171837.0 → 11.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 (686) hide show
  1. package/CHANGELOG.md +44 -1
  2. package/build/accordion/block.json +4 -1
  3. package/build/accordion-heading/block.json +1 -0
  4. package/build/accordion-item/block.json +7 -1
  5. package/build/accordion-panel/block.json +9 -1
  6. package/build/archives/block.json +12 -0
  7. package/build/audio/block.json +8 -0
  8. package/build/audio/edit.cjs +2 -1
  9. package/build/audio/edit.cjs.map +2 -2
  10. package/build/avatar/block.json +4 -0
  11. package/build/avatar/edit.cjs +31 -1
  12. package/build/avatar/edit.cjs.map +3 -3
  13. package/build/breadcrumbs/block.json +3 -0
  14. package/build/breadcrumbs/edit.cjs.map +3 -3
  15. package/build/button/block.json +6 -0
  16. package/build/button/edit.cjs +9 -6
  17. package/build/button/edit.cjs.map +2 -2
  18. package/build/buttons/block.json +15 -1
  19. package/build/categories/block.json +12 -1
  20. package/build/code/block.json +13 -0
  21. package/build/column/block.json +9 -0
  22. package/build/column/edit.cjs +5 -0
  23. package/build/column/edit.cjs.map +2 -2
  24. package/build/columns/block.json +13 -0
  25. package/build/columns/edit.cjs +21 -112
  26. package/build/columns/edit.cjs.map +3 -3
  27. package/build/comment-author-name/block.json +3 -0
  28. package/build/comment-content/block.json +5 -0
  29. package/build/comment-date/block.json +3 -0
  30. package/build/comment-edit-link/block.json +3 -0
  31. package/build/comment-reply-link/block.json +3 -0
  32. package/build/comments/block.json +10 -0
  33. package/build/comments/edit/placeholder.cjs +95 -87
  34. package/build/comments/edit/placeholder.cjs.map +2 -2
  35. package/build/comments-pagination/block.json +14 -0
  36. package/build/comments-pagination-next/block.json +3 -0
  37. package/build/comments-pagination-numbers/block.json +3 -0
  38. package/build/comments-pagination-previous/block.json +6 -0
  39. package/build/comments-title/block.json +3 -0
  40. package/build/cover/block.json +2 -1
  41. package/build/cover/edit/index.cjs +30 -6
  42. package/build/cover/edit/index.cjs.map +2 -2
  43. package/build/cover/edit/inspector-controls.cjs +56 -14
  44. package/build/cover/edit/inspector-controls.cjs.map +2 -2
  45. package/build/cover/embed-video-utils.cjs +9 -8
  46. package/build/cover/embed-video-utils.cjs.map +2 -2
  47. package/build/cover/view.cjs +21 -0
  48. package/build/cover/view.cjs.map +7 -0
  49. package/build/details/block.json +14 -0
  50. package/build/embed/block.json +6 -1
  51. package/build/file/block.json +14 -0
  52. package/build/footnotes/block.json +13 -0
  53. package/build/gallery/block.json +22 -0
  54. package/build/gallery/dynamic-gallery.cjs +32 -93
  55. package/build/gallery/dynamic-gallery.cjs.map +3 -3
  56. package/build/gallery/edit.cjs +104 -42
  57. package/build/gallery/edit.cjs.map +2 -2
  58. package/build/gallery/order-controls.cjs +107 -0
  59. package/build/gallery/order-controls.cjs.map +7 -0
  60. package/build/gallery/order-images.cjs +92 -0
  61. package/build/gallery/order-images.cjs.map +7 -0
  62. package/build/gallery/order-options.cjs +62 -0
  63. package/build/gallery/order-options.cjs.map +7 -0
  64. package/build/gallery/use-dynamic-gallery.cjs +1 -7
  65. package/build/gallery/use-dynamic-gallery.cjs.map +2 -2
  66. package/build/gallery/use-get-media.cjs +2 -3
  67. package/build/gallery/use-get-media.cjs.map +2 -2
  68. package/build/group/block.json +1 -0
  69. package/build/group/edit.cjs +3 -3
  70. package/build/group/edit.cjs.map +2 -2
  71. package/build/heading/block.json +14 -0
  72. package/build/home-link/block.json +30 -0
  73. package/build/home-link/edit.cjs.map +3 -3
  74. package/build/icon/components/custom-inserter/index.cjs +3 -1
  75. package/build/icon/components/custom-inserter/index.cjs.map +2 -2
  76. package/build/icon/edit.cjs +49 -5
  77. package/build/icon/edit.cjs.map +2 -2
  78. package/build/image/image.cjs +10 -8
  79. package/build/image/image.cjs.map +3 -3
  80. package/build/image/use-open-image-media-editor-modal.cjs +32 -8
  81. package/build/image/use-open-image-media-editor-modal.cjs.map +2 -2
  82. package/build/image/view.cjs +44 -50
  83. package/build/image/view.cjs.map +2 -2
  84. package/build/latest-comments/block.json +20 -0
  85. package/build/latest-posts/block.json +14 -0
  86. package/build/list/block.json +12 -1
  87. package/build/list-item/block.json +8 -1
  88. package/build/list-item/index.cjs +4 -0
  89. package/build/list-item/index.cjs.map +3 -3
  90. package/build/loginout/block.json +14 -0
  91. package/build/math/block.json +14 -0
  92. package/build/media-text/block.json +19 -0
  93. package/build/navigation/edit/index.cjs +1 -4
  94. package/build/navigation/edit/index.cjs.map +2 -2
  95. package/build/navigation-link/link-ui/index.cjs +33 -19
  96. package/build/navigation-link/link-ui/index.cjs.map +2 -2
  97. package/build/navigation-link/link-ui/page-creator.cjs.map +3 -3
  98. package/build/navigation-link/shared/controls.cjs.map +3 -3
  99. package/build/navigation-link/shared/index.cjs +5 -0
  100. package/build/navigation-link/shared/index.cjs.map +2 -2
  101. package/build/navigation-link/shared/use-block-suggestions.cjs +141 -0
  102. package/build/navigation-link/shared/use-block-suggestions.cjs.map +7 -0
  103. package/build/navigation-link/shared/use-link-preview.cjs +13 -13
  104. package/build/navigation-link/shared/use-link-preview.cjs.map +2 -2
  105. package/build/navigation-overlay-close/block.json +7 -0
  106. package/build/navigation-submenu/block.json +6 -0
  107. package/build/navigation-submenu/edit.cjs +9 -1
  108. package/build/navigation-submenu/edit.cjs.map +3 -3
  109. package/build/page-list/block.json +14 -0
  110. package/build/paragraph/block.json +1 -0
  111. package/build/paragraph/edit.cjs +1 -2
  112. package/build/paragraph/edit.cjs.map +2 -2
  113. package/build/playlist/block.json +1 -0
  114. package/build/post-author-biography/block.json +5 -0
  115. package/build/post-author-name/block.json +5 -0
  116. package/build/post-comments-count/block.json +3 -0
  117. package/build/post-comments-form/block.json +15 -0
  118. package/build/post-content/block.json +4 -1
  119. package/build/post-date/block.json +3 -0
  120. package/build/post-excerpt/block.json +9 -0
  121. package/build/post-featured-image/block.json +1 -0
  122. package/build/post-featured-image/edit.cjs +12 -10
  123. package/build/post-featured-image/edit.cjs.map +2 -2
  124. package/build/post-navigation-link/block.json +30 -0
  125. package/build/post-navigation-link/edit.cjs +13 -2
  126. package/build/post-navigation-link/edit.cjs.map +3 -3
  127. package/build/post-template/block.json +13 -1
  128. package/build/post-terms/block.json +10 -0
  129. package/build/post-time-to-read/block.json +10 -0
  130. package/build/post-title/block.json +14 -0
  131. package/build/preformatted/block.json +11 -0
  132. package/build/pullquote/block.json +3 -1
  133. package/build/query-no-results/block.json +14 -2
  134. package/build/query-pagination/block.json +20 -0
  135. package/build/query-pagination-next/block.json +3 -0
  136. package/build/query-pagination-numbers/block.json +3 -0
  137. package/build/query-pagination-previous/block.json +3 -0
  138. package/build/query-title/block.json +3 -0
  139. package/build/query-total/block.json +10 -0
  140. package/build/quote/block.json +3 -0
  141. package/build/read-more/block.json +11 -0
  142. package/build/rss/block.json +10 -0
  143. package/build/search/block.json +2 -1
  144. package/build/site-tagline/block.json +12 -1
  145. package/build/site-title/block.json +11 -1
  146. package/build/social-links/block.json +4 -0
  147. package/build/social-links/edit.cjs +2 -3
  148. package/build/social-links/edit.cjs.map +2 -2
  149. package/build/tab-list/block.json +4 -0
  150. package/build/tab-list/edit.cjs +3 -1
  151. package/build/tab-list/edit.cjs.map +3 -3
  152. package/build/tab-list/save.cjs +3 -1
  153. package/build/tab-list/save.cjs.map +3 -3
  154. package/build/tab-panel/block.json +25 -0
  155. package/build/tab-panel/controls.cjs.map +3 -3
  156. package/build/tab-panels/block.json +21 -1
  157. package/build/table-of-contents/block.json +7 -0
  158. package/build/tabs/block.json +27 -1
  159. package/build/tag-cloud/block.json +19 -0
  160. package/build/template-part/edit/selection-modal.cjs.map +1 -1
  161. package/build/term-count/block.json +12 -0
  162. package/build/term-description/block.json +13 -0
  163. package/build/term-name/block.json +16 -1
  164. package/build/term-template/block.json +14 -1
  165. package/build/utils/search-patterns.cjs +7 -43
  166. package/build/utils/search-patterns.cjs.map +3 -3
  167. package/build/utils/style-state.cjs +4 -6
  168. package/build/utils/style-state.cjs.map +2 -2
  169. package/build/utils/waveform-utils.cjs +2 -2
  170. package/build/utils/waveform-utils.cjs.map +2 -2
  171. package/build/verse/block.json +4 -0
  172. package/build/video/block.json +12 -0
  173. package/build/video/edit.cjs +30 -14
  174. package/build/video/edit.cjs.map +3 -3
  175. package/build/video/index.cjs +0 -2
  176. package/build/video/index.cjs.map +3 -3
  177. package/build/video/save.cjs +5 -1
  178. package/build/video/save.cjs.map +3 -3
  179. package/build-module/accordion/block.json +4 -1
  180. package/build-module/accordion-heading/block.json +1 -0
  181. package/build-module/accordion-item/block.json +7 -1
  182. package/build-module/accordion-panel/block.json +9 -1
  183. package/build-module/archives/block.json +12 -0
  184. package/build-module/audio/block.json +8 -0
  185. package/build-module/audio/edit.mjs +2 -1
  186. package/build-module/audio/edit.mjs.map +2 -2
  187. package/build-module/avatar/block.json +4 -0
  188. package/build-module/avatar/edit.mjs +33 -2
  189. package/build-module/avatar/edit.mjs.map +2 -2
  190. package/build-module/breadcrumbs/block.json +3 -0
  191. package/build-module/breadcrumbs/edit.mjs +3 -3
  192. package/build-module/breadcrumbs/edit.mjs.map +2 -2
  193. package/build-module/button/block.json +6 -0
  194. package/build-module/button/edit.mjs +11 -7
  195. package/build-module/button/edit.mjs.map +2 -2
  196. package/build-module/buttons/block.json +15 -1
  197. package/build-module/categories/block.json +12 -1
  198. package/build-module/code/block.json +13 -0
  199. package/build-module/column/block.json +9 -0
  200. package/build-module/column/edit.mjs +5 -0
  201. package/build-module/column/edit.mjs.map +2 -2
  202. package/build-module/columns/block.json +13 -0
  203. package/build-module/columns/edit.mjs +22 -122
  204. package/build-module/columns/edit.mjs.map +2 -2
  205. package/build-module/comment-author-name/block.json +3 -0
  206. package/build-module/comment-content/block.json +5 -0
  207. package/build-module/comment-date/block.json +3 -0
  208. package/build-module/comment-edit-link/block.json +3 -0
  209. package/build-module/comment-reply-link/block.json +3 -0
  210. package/build-module/comments/block.json +10 -0
  211. package/build-module/comments/edit/placeholder.mjs +95 -87
  212. package/build-module/comments/edit/placeholder.mjs.map +2 -2
  213. package/build-module/comments-pagination/block.json +14 -0
  214. package/build-module/comments-pagination-next/block.json +3 -0
  215. package/build-module/comments-pagination-numbers/block.json +3 -0
  216. package/build-module/comments-pagination-previous/block.json +6 -0
  217. package/build-module/comments-title/block.json +3 -0
  218. package/build-module/cover/block.json +2 -1
  219. package/build-module/cover/edit/index.mjs +36 -7
  220. package/build-module/cover/edit/index.mjs.map +2 -2
  221. package/build-module/cover/edit/inspector-controls.mjs +62 -16
  222. package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
  223. package/build-module/cover/embed-video-utils.mjs +9 -8
  224. package/build-module/cover/embed-video-utils.mjs.map +2 -2
  225. package/build-module/cover/view.mjs +19 -0
  226. package/build-module/cover/view.mjs.map +7 -0
  227. package/build-module/details/block.json +14 -0
  228. package/build-module/embed/block.json +6 -1
  229. package/build-module/file/block.json +14 -0
  230. package/build-module/footnotes/block.json +13 -0
  231. package/build-module/gallery/block.json +22 -0
  232. package/build-module/gallery/dynamic-gallery.mjs +33 -97
  233. package/build-module/gallery/dynamic-gallery.mjs.map +2 -2
  234. package/build-module/gallery/edit.mjs +111 -44
  235. package/build-module/gallery/edit.mjs.map +2 -2
  236. package/build-module/gallery/order-controls.mjs +87 -0
  237. package/build-module/gallery/order-controls.mjs.map +7 -0
  238. package/build-module/gallery/order-images.mjs +66 -0
  239. package/build-module/gallery/order-images.mjs.map +7 -0
  240. package/build-module/gallery/order-options.mjs +33 -0
  241. package/build-module/gallery/order-options.mjs.map +7 -0
  242. package/build-module/gallery/use-dynamic-gallery.mjs +1 -7
  243. package/build-module/gallery/use-dynamic-gallery.mjs.map +2 -2
  244. package/build-module/gallery/use-get-media.mjs +2 -3
  245. package/build-module/gallery/use-get-media.mjs.map +2 -2
  246. package/build-module/group/block.json +1 -0
  247. package/build-module/group/edit.mjs +4 -4
  248. package/build-module/group/edit.mjs.map +2 -2
  249. package/build-module/heading/block.json +14 -0
  250. package/build-module/home-link/block.json +30 -0
  251. package/build-module/home-link/edit.mjs +2 -2
  252. package/build-module/home-link/edit.mjs.map +2 -2
  253. package/build-module/icon/components/custom-inserter/index.mjs +3 -1
  254. package/build-module/icon/components/custom-inserter/index.mjs.map +2 -2
  255. package/build-module/icon/edit.mjs +50 -6
  256. package/build-module/icon/edit.mjs.map +2 -2
  257. package/build-module/image/image.mjs +12 -10
  258. package/build-module/image/image.mjs.map +2 -2
  259. package/build-module/image/use-open-image-media-editor-modal.mjs +32 -8
  260. package/build-module/image/use-open-image-media-editor-modal.mjs.map +2 -2
  261. package/build-module/image/view.mjs +44 -50
  262. package/build-module/image/view.mjs.map +2 -2
  263. package/build-module/latest-comments/block.json +20 -0
  264. package/build-module/latest-posts/block.json +14 -0
  265. package/build-module/list/block.json +12 -1
  266. package/build-module/list-item/block.json +8 -1
  267. package/build-module/list-item/index.mjs +4 -0
  268. package/build-module/list-item/index.mjs.map +2 -2
  269. package/build-module/loginout/block.json +14 -0
  270. package/build-module/math/block.json +14 -0
  271. package/build-module/media-text/block.json +19 -0
  272. package/build-module/navigation/edit/index.mjs +1 -4
  273. package/build-module/navigation/edit/index.mjs.map +2 -2
  274. package/build-module/navigation-link/link-ui/index.mjs +39 -20
  275. package/build-module/navigation-link/link-ui/index.mjs.map +2 -2
  276. package/build-module/navigation-link/link-ui/page-creator.mjs +2 -2
  277. package/build-module/navigation-link/link-ui/page-creator.mjs.map +2 -2
  278. package/build-module/navigation-link/shared/controls.mjs +2 -2
  279. package/build-module/navigation-link/shared/controls.mjs.map +2 -2
  280. package/build-module/navigation-link/shared/index.mjs +6 -0
  281. package/build-module/navigation-link/shared/index.mjs.map +2 -2
  282. package/build-module/navigation-link/shared/use-block-suggestions.mjs +120 -0
  283. package/build-module/navigation-link/shared/use-block-suggestions.mjs.map +7 -0
  284. package/build-module/navigation-link/shared/use-link-preview.mjs +13 -13
  285. package/build-module/navigation-link/shared/use-link-preview.mjs.map +2 -2
  286. package/build-module/navigation-overlay-close/block.json +7 -0
  287. package/build-module/navigation-submenu/block.json +6 -0
  288. package/build-module/navigation-submenu/edit.mjs +11 -2
  289. package/build-module/navigation-submenu/edit.mjs.map +2 -2
  290. package/build-module/page-list/block.json +14 -0
  291. package/build-module/paragraph/block.json +1 -0
  292. package/build-module/paragraph/edit.mjs +1 -2
  293. package/build-module/paragraph/edit.mjs.map +2 -2
  294. package/build-module/playlist/block.json +1 -0
  295. package/build-module/post-author-biography/block.json +5 -0
  296. package/build-module/post-author-name/block.json +5 -0
  297. package/build-module/post-comments-count/block.json +3 -0
  298. package/build-module/post-comments-form/block.json +15 -0
  299. package/build-module/post-content/block.json +4 -1
  300. package/build-module/post-date/block.json +3 -0
  301. package/build-module/post-excerpt/block.json +9 -0
  302. package/build-module/post-featured-image/block.json +1 -0
  303. package/build-module/post-featured-image/edit.mjs +12 -10
  304. package/build-module/post-featured-image/edit.mjs.map +2 -2
  305. package/build-module/post-navigation-link/block.json +30 -0
  306. package/build-module/post-navigation-link/edit.mjs +17 -3
  307. package/build-module/post-navigation-link/edit.mjs.map +2 -2
  308. package/build-module/post-template/block.json +13 -1
  309. package/build-module/post-terms/block.json +10 -0
  310. package/build-module/post-time-to-read/block.json +10 -0
  311. package/build-module/post-title/block.json +14 -0
  312. package/build-module/preformatted/block.json +11 -0
  313. package/build-module/pullquote/block.json +3 -1
  314. package/build-module/query-no-results/block.json +14 -2
  315. package/build-module/query-pagination/block.json +20 -0
  316. package/build-module/query-pagination-next/block.json +3 -0
  317. package/build-module/query-pagination-numbers/block.json +3 -0
  318. package/build-module/query-pagination-previous/block.json +3 -0
  319. package/build-module/query-title/block.json +3 -0
  320. package/build-module/query-total/block.json +10 -0
  321. package/build-module/quote/block.json +3 -0
  322. package/build-module/read-more/block.json +11 -0
  323. package/build-module/rss/block.json +10 -0
  324. package/build-module/search/block.json +2 -1
  325. package/build-module/site-tagline/block.json +12 -1
  326. package/build-module/site-title/block.json +11 -1
  327. package/build-module/social-links/block.json +4 -0
  328. package/build-module/social-links/edit.mjs +2 -3
  329. package/build-module/social-links/edit.mjs.map +2 -2
  330. package/build-module/tab-list/block.json +4 -0
  331. package/build-module/tab-list/edit.mjs +4 -1
  332. package/build-module/tab-list/edit.mjs.map +2 -2
  333. package/build-module/tab-list/save.mjs +4 -1
  334. package/build-module/tab-list/save.mjs.map +2 -2
  335. package/build-module/tab-panel/block.json +25 -0
  336. package/build-module/tab-panel/controls.mjs +2 -2
  337. package/build-module/tab-panel/controls.mjs.map +2 -2
  338. package/build-module/tab-panels/block.json +21 -1
  339. package/build-module/table-of-contents/block.json +7 -0
  340. package/build-module/tabs/block.json +27 -1
  341. package/build-module/tag-cloud/block.json +19 -0
  342. package/build-module/template-part/edit/selection-modal.mjs.map +1 -1
  343. package/build-module/term-count/block.json +12 -0
  344. package/build-module/term-description/block.json +13 -0
  345. package/build-module/term-name/block.json +16 -1
  346. package/build-module/term-template/block.json +14 -1
  347. package/build-module/utils/search-patterns.mjs +7 -32
  348. package/build-module/utils/search-patterns.mjs.map +2 -2
  349. package/build-module/utils/style-state.mjs +6 -4
  350. package/build-module/utils/style-state.mjs.map +2 -2
  351. package/build-module/utils/waveform-utils.mjs +1 -1
  352. package/build-module/utils/waveform-utils.mjs.map +1 -1
  353. package/build-module/verse/block.json +4 -0
  354. package/build-module/video/block.json +12 -0
  355. package/build-module/video/edit.mjs +32 -15
  356. package/build-module/video/edit.mjs.map +2 -2
  357. package/build-module/video/index.mjs +0 -2
  358. package/build-module/video/index.mjs.map +2 -2
  359. package/build-module/video/save.mjs +7 -2
  360. package/build-module/video/save.mjs.map +2 -2
  361. package/build-style/avatar/editor-rtl.css +4 -0
  362. package/build-style/avatar/editor.css +4 -0
  363. package/build-style/comments-pagination/style-rtl.css +3 -0
  364. package/build-style/comments-pagination/style.css +3 -0
  365. package/build-style/common-rtl.css +32 -1
  366. package/build-style/common.css +35 -2
  367. package/build-style/editor-rtl.css +23 -6
  368. package/build-style/editor.css +23 -6
  369. package/build-style/embed/style-rtl.css +4 -1
  370. package/build-style/embed/style.css +4 -1
  371. package/build-style/gallery/editor-rtl.css +1 -3
  372. package/build-style/gallery/editor.css +1 -3
  373. package/build-style/image/editor-rtl.css +6 -0
  374. package/build-style/image/editor.css +6 -0
  375. package/build-style/image/style-rtl.css +11 -2
  376. package/build-style/image/style.css +11 -2
  377. package/build-style/media-text/style-rtl.css +4 -1
  378. package/build-style/media-text/style.css +4 -1
  379. package/build-style/navigation/style-rtl.css +18 -3
  380. package/build-style/navigation/style.css +18 -3
  381. package/build-style/navigation-link/editor-rtl.css +3 -1
  382. package/build-style/navigation-link/editor.css +3 -1
  383. package/build-style/navigation-overlay-close/style-rtl.css +1 -1
  384. package/build-style/navigation-overlay-close/style.css +1 -1
  385. package/build-style/navigation-submenu/editor-rtl.css +3 -1
  386. package/build-style/navigation-submenu/editor.css +3 -1
  387. package/build-style/post-navigation-link/style-rtl.css +3 -0
  388. package/build-style/post-navigation-link/style.css +3 -0
  389. package/build-style/query-pagination/style-rtl.css +3 -0
  390. package/build-style/query-pagination/style.css +3 -0
  391. package/build-style/style-rtl.css +94 -13
  392. package/build-style/style.css +97 -14
  393. package/build-style/tab-panel/style-rtl.css +2 -0
  394. package/build-style/tab-panel/style.css +2 -0
  395. package/build-style/table/editor-rtl.css +6 -1
  396. package/build-style/table/editor.css +6 -1
  397. package/build-style/table/style-rtl.css +4 -2
  398. package/build-style/table/style.css +4 -2
  399. package/build-style/tag-cloud/style-rtl.css +1 -1
  400. package/build-style/tag-cloud/style.css +1 -1
  401. package/build-style/verse/style-rtl.css +8 -1
  402. package/build-style/verse/style.css +8 -1
  403. package/build-types/gallery/order-controls.d.ts +58 -0
  404. package/build-types/gallery/order-controls.d.ts.map +1 -0
  405. package/build-types/gallery/order-options.d.ts +67 -0
  406. package/build-types/gallery/order-options.d.ts.map +1 -0
  407. package/package.json +46 -44
  408. package/src/accordion/README.md +3 -0
  409. package/src/accordion/block.json +4 -1
  410. package/src/accordion-heading/README.md +1 -0
  411. package/src/accordion-heading/block.json +1 -0
  412. package/src/accordion-item/README.md +5 -0
  413. package/src/accordion-item/block.json +7 -1
  414. package/src/accordion-panel/README.md +7 -0
  415. package/src/accordion-panel/block.json +9 -1
  416. package/src/archives/README.md +6 -0
  417. package/src/archives/block.json +12 -0
  418. package/src/audio/README.md +4 -0
  419. package/src/audio/block.json +8 -0
  420. package/src/audio/edit.jsx +2 -1
  421. package/src/avatar/README.md +2 -0
  422. package/src/avatar/block.json +4 -0
  423. package/src/avatar/edit.jsx +48 -2
  424. package/src/avatar/editor.scss +4 -0
  425. package/src/avatar/index.php +5 -3
  426. package/src/breadcrumbs/README.md +2 -0
  427. package/src/breadcrumbs/block.json +3 -0
  428. package/src/breadcrumbs/edit.jsx +3 -3
  429. package/src/breadcrumbs/index.php +1 -1
  430. package/src/button/README.md +4 -0
  431. package/src/button/block.json +6 -0
  432. package/src/button/edit.jsx +47 -52
  433. package/src/button/index.php +47 -0
  434. package/src/buttons/README.md +8 -0
  435. package/src/buttons/block.json +15 -1
  436. package/src/categories/README.md +6 -0
  437. package/src/categories/block.json +12 -1
  438. package/src/code/README.md +7 -0
  439. package/src/code/block.json +13 -0
  440. package/src/column/README.md +4 -0
  441. package/src/column/block.json +9 -0
  442. package/src/column/edit.jsx +6 -0
  443. package/src/columns/README.md +7 -0
  444. package/src/columns/block.json +13 -0
  445. package/src/columns/edit.jsx +1 -131
  446. package/src/comment-author-name/README.md +2 -0
  447. package/src/comment-author-name/block.json +3 -0
  448. package/src/comment-content/README.md +4 -0
  449. package/src/comment-content/block.json +5 -0
  450. package/src/comment-date/README.md +2 -0
  451. package/src/comment-date/block.json +3 -0
  452. package/src/comment-edit-link/README.md +2 -0
  453. package/src/comment-edit-link/block.json +3 -0
  454. package/src/comment-reply-link/README.md +2 -0
  455. package/src/comment-reply-link/block.json +3 -0
  456. package/src/comments/README.md +5 -0
  457. package/src/comments/block.json +10 -0
  458. package/src/comments/edit/placeholder.jsx +5 -1
  459. package/src/comments-pagination/README.md +6 -0
  460. package/src/comments-pagination/block.json +14 -0
  461. package/src/comments-pagination/style.scss +3 -0
  462. package/src/comments-pagination-next/README.md +2 -0
  463. package/src/comments-pagination-next/block.json +3 -0
  464. package/src/comments-pagination-numbers/README.md +2 -0
  465. package/src/comments-pagination-numbers/block.json +3 -0
  466. package/src/comments-pagination-previous/README.md +2 -0
  467. package/src/comments-pagination-previous/block.json +6 -0
  468. package/src/comments-title/README.md +2 -0
  469. package/src/comments-title/block.json +3 -0
  470. package/src/common.scss +38 -0
  471. package/src/cover/README.md +1 -0
  472. package/src/cover/block.json +2 -1
  473. package/src/cover/edit/index.jsx +41 -6
  474. package/src/cover/edit/inspector-controls.jsx +74 -14
  475. package/src/cover/embed-video-utils.js +18 -10
  476. package/src/cover/index.php +44 -15
  477. package/src/cover/test/edit.browser.test.js +200 -4
  478. package/src/cover/test/embed-video-utils.test.js +48 -0
  479. package/src/cover/view.js +22 -0
  480. package/src/details/README.md +8 -0
  481. package/src/details/block.json +14 -0
  482. package/src/embed/README.md +4 -0
  483. package/src/embed/block.json +6 -1
  484. package/src/embed/style.scss +7 -1
  485. package/src/file/README.md +8 -0
  486. package/src/file/block.json +14 -0
  487. package/src/footnotes/README.md +7 -0
  488. package/src/footnotes/block.json +13 -0
  489. package/src/gallery/README.md +17 -0
  490. package/src/gallery/block.json +22 -0
  491. package/src/gallery/dynamic-gallery.jsx +11 -91
  492. package/src/gallery/edit.jsx +147 -49
  493. package/src/gallery/editor.scss +5 -9
  494. package/src/gallery/order-controls.tsx +143 -0
  495. package/src/gallery/order-images.js +111 -0
  496. package/src/gallery/order-options.ts +75 -0
  497. package/src/gallery/test/edit.jsdom.test.js +87 -10
  498. package/src/gallery/test/order-images.js +162 -0
  499. package/src/gallery/use-dynamic-gallery.js +1 -9
  500. package/src/gallery/use-get-media.js +7 -2
  501. package/src/group/README.md +1 -0
  502. package/src/group/block.json +1 -0
  503. package/src/group/edit.jsx +5 -5
  504. package/src/heading/README.md +8 -0
  505. package/src/heading/block.json +14 -0
  506. package/src/home-link/README.md +11 -0
  507. package/src/home-link/block.json +30 -0
  508. package/src/home-link/edit.jsx +2 -2
  509. package/src/icon/components/custom-inserter/index.jsx +5 -1
  510. package/src/icon/edit.jsx +68 -7
  511. package/src/icon/index.php +10 -1
  512. package/src/image/editor.scss +8 -0
  513. package/src/image/image.jsx +13 -11
  514. package/src/image/index.php +3 -4
  515. package/src/image/style.scss +14 -2
  516. package/src/image/test/use-open-image-media-editor-modal.jsdom.test.js +201 -0
  517. package/src/image/use-open-image-media-editor-modal.js +37 -4
  518. package/src/image/view.js +64 -68
  519. package/src/latest-comments/README.md +8 -0
  520. package/src/latest-comments/block.json +20 -0
  521. package/src/latest-posts/README.md +8 -0
  522. package/src/latest-posts/block.json +14 -0
  523. package/src/list/README.md +6 -0
  524. package/src/list/block.json +12 -1
  525. package/src/list-item/README.md +6 -0
  526. package/src/list-item/block.json +8 -1
  527. package/src/list-item/index.js +5 -0
  528. package/src/loginout/README.md +8 -0
  529. package/src/loginout/block.json +14 -0
  530. package/src/math/README.md +8 -0
  531. package/src/math/block.json +14 -0
  532. package/src/media-text/README.md +18 -0
  533. package/src/media-text/block.json +19 -0
  534. package/src/media-text/style.scss +5 -1
  535. package/src/navigation/edit/index.jsx +2 -4
  536. package/src/navigation/style.scss +40 -4
  537. package/src/navigation/test/use-navigation-menu.jsdom.test.js +1 -1
  538. package/src/navigation-link/README.md +1 -1
  539. package/src/navigation-link/editor.scss +6 -1
  540. package/src/navigation-link/link-ui/index.jsx +60 -27
  541. package/src/navigation-link/link-ui/page-creator.jsx +2 -2
  542. package/src/navigation-link/link-ui/test/get-suggestions-query.jsdom.test.js +67 -0
  543. package/src/navigation-link/shared/controls.jsx +2 -2
  544. package/src/navigation-link/shared/index.js +4 -0
  545. package/src/navigation-link/shared/test/use-block-suggestions.jsdom.test.js +158 -0
  546. package/src/navigation-link/shared/test/use-entity-binding.jsdom.test.js +1 -7
  547. package/src/navigation-link/shared/test/use-link-preview.jsdom.test.js +22 -22
  548. package/src/navigation-link/shared/use-block-suggestions.js +192 -0
  549. package/src/navigation-link/shared/use-link-preview.js +15 -14
  550. package/src/navigation-overlay-close/README.md +1 -0
  551. package/src/navigation-overlay-close/block.json +7 -0
  552. package/src/navigation-overlay-close/style.scss +1 -1
  553. package/src/navigation-submenu/README.md +7 -0
  554. package/src/navigation-submenu/block.json +6 -0
  555. package/src/navigation-submenu/edit.jsx +11 -1
  556. package/src/navigation-submenu/editor.scss +6 -1
  557. package/src/navigation-submenu/index.php +11 -0
  558. package/src/page-list/README.md +8 -0
  559. package/src/page-list/block.json +14 -0
  560. package/src/paragraph/README.md +1 -0
  561. package/src/paragraph/block.json +1 -0
  562. package/src/paragraph/edit.jsx +1 -3
  563. package/src/playlist/README.md +1 -0
  564. package/src/playlist/block.json +1 -0
  565. package/src/playlist/test/edit-component.jsdom.test.jsx +11 -11
  566. package/src/playlist-track/test/edit.jsdom.test.jsx +3 -3
  567. package/src/post-author-biography/README.md +4 -0
  568. package/src/post-author-biography/block.json +5 -0
  569. package/src/post-author-name/README.md +4 -0
  570. package/src/post-author-name/block.json +5 -0
  571. package/src/post-comments-count/README.md +2 -0
  572. package/src/post-comments-count/block.json +3 -0
  573. package/src/post-comments-form/README.md +8 -0
  574. package/src/post-comments-form/block.json +15 -0
  575. package/src/post-content/README.md +3 -0
  576. package/src/post-content/block.json +4 -1
  577. package/src/post-date/README.md +2 -0
  578. package/src/post-date/block.json +3 -0
  579. package/src/post-excerpt/README.md +7 -0
  580. package/src/post-excerpt/block.json +9 -0
  581. package/src/post-featured-image/block.json +1 -0
  582. package/src/post-featured-image/edit.jsx +13 -11
  583. package/src/post-navigation-link/README.md +12 -0
  584. package/src/post-navigation-link/block.json +30 -0
  585. package/src/post-navigation-link/edit.jsx +23 -2
  586. package/src/post-navigation-link/index.php +94 -5
  587. package/src/post-navigation-link/style.scss +2 -0
  588. package/src/post-template/README.md +7 -0
  589. package/src/post-template/block.json +13 -1
  590. package/src/post-terms/README.md +8 -0
  591. package/src/post-terms/block.json +10 -0
  592. package/src/post-time-to-read/README.md +8 -0
  593. package/src/post-time-to-read/block.json +10 -0
  594. package/src/post-title/README.md +8 -0
  595. package/src/post-title/block.json +14 -0
  596. package/src/preformatted/README.md +9 -0
  597. package/src/preformatted/block.json +11 -0
  598. package/src/pullquote/README.md +2 -0
  599. package/src/pullquote/block.json +3 -1
  600. package/src/query-no-results/README.md +10 -0
  601. package/src/query-no-results/block.json +14 -2
  602. package/src/query-pagination/README.md +6 -0
  603. package/src/query-pagination/block.json +20 -0
  604. package/src/query-pagination/style.scss +3 -0
  605. package/src/query-pagination-next/README.md +2 -0
  606. package/src/query-pagination-next/block.json +3 -0
  607. package/src/query-pagination-numbers/README.md +2 -0
  608. package/src/query-pagination-numbers/block.json +3 -0
  609. package/src/query-pagination-previous/README.md +2 -0
  610. package/src/query-pagination-previous/block.json +3 -0
  611. package/src/query-title/README.md +2 -0
  612. package/src/query-title/block.json +3 -0
  613. package/src/query-total/README.md +8 -0
  614. package/src/query-total/block.json +10 -0
  615. package/src/quote/README.md +3 -0
  616. package/src/quote/block.json +3 -0
  617. package/src/read-more/README.md +8 -0
  618. package/src/read-more/block.json +11 -0
  619. package/src/rss/README.md +8 -0
  620. package/src/rss/block.json +10 -0
  621. package/src/search/README.md +1 -0
  622. package/src/search/block.json +2 -1
  623. package/src/site-tagline/README.md +9 -0
  624. package/src/site-tagline/block.json +12 -1
  625. package/src/site-title/README.md +8 -0
  626. package/src/site-title/block.json +11 -1
  627. package/src/social-links/README.md +3 -0
  628. package/src/social-links/block.json +4 -0
  629. package/src/social-links/edit.jsx +2 -3
  630. package/src/tab-list/README.md +2 -0
  631. package/src/tab-list/block.json +4 -0
  632. package/src/tab-list/edit.jsx +3 -0
  633. package/src/tab-list/save.jsx +3 -0
  634. package/src/tab-panel/README.md +9 -0
  635. package/src/tab-panel/block.json +25 -0
  636. package/src/tab-panel/controls.jsx +2 -2
  637. package/src/tab-panel/style.scss +5 -2
  638. package/src/tab-panels/README.md +9 -0
  639. package/src/tab-panels/block.json +21 -1
  640. package/src/table/editor.scss +8 -2
  641. package/src/table/style.scss +4 -4
  642. package/src/table-of-contents/README.md +6 -0
  643. package/src/table-of-contents/block.json +7 -0
  644. package/src/tabs/README.md +11 -0
  645. package/src/tabs/block.json +27 -1
  646. package/src/tag-cloud/README.md +9 -0
  647. package/src/tag-cloud/block.json +19 -0
  648. package/src/tag-cloud/style.scss +1 -1
  649. package/src/template-part/edit/selection-modal.jsx +1 -1
  650. package/src/template-part/index.php +16 -3
  651. package/src/term-count/README.md +10 -0
  652. package/src/term-count/block.json +12 -0
  653. package/src/term-description/README.md +8 -0
  654. package/src/term-description/block.json +13 -0
  655. package/src/term-name/README.md +9 -0
  656. package/src/term-name/block.json +16 -1
  657. package/src/term-name/index.php +1 -1
  658. package/src/term-template/README.md +8 -0
  659. package/src/term-template/block.json +14 -1
  660. package/src/utils/search-patterns.js +9 -53
  661. package/src/utils/style-state.js +6 -4
  662. package/src/utils/test/{search-patterns.js → search-patterns.jsdom.test.js} +1 -22
  663. package/src/utils/test/waveform-player-auto-init.jsdom.test.js +25 -0
  664. package/src/utils/test/waveform-player-dependency.jsdom.test.js +7 -60
  665. package/src/utils/test/waveform-utils.browser.test.js +3 -15
  666. package/src/utils/waveform-utils.js +1 -1
  667. package/src/verse/README.md +4 -0
  668. package/src/verse/block.json +4 -0
  669. package/src/verse/style.scss +11 -2
  670. package/src/video/README.md +11 -0
  671. package/src/video/block.json +12 -0
  672. package/src/video/edit.jsx +65 -49
  673. package/src/video/index.js +0 -2
  674. package/src/video/save.jsx +10 -1
  675. package/build/columns/utils.cjs +0 -112
  676. package/build/columns/utils.cjs.map +0 -7
  677. package/build/video/variations.cjs +0 -75
  678. package/build/video/variations.cjs.map +0 -7
  679. package/build-module/columns/utils.mjs +0 -78
  680. package/build-module/columns/utils.mjs.map +0 -7
  681. package/build-module/video/variations.mjs +0 -50
  682. package/build-module/video/variations.mjs.map +0 -7
  683. package/src/columns/test/utils.js +0 -331
  684. package/src/columns/utils.js +0 -176
  685. package/src/video/test/variations.js +0 -63
  686. package/src/video/variations.js +0 -62
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/gallery/dynamic-gallery.jsx"],
4
- "sourcesContent": ["import { __, sprintf } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport {\n\tButton,\n\tNotice,\n\tPanelBody,\n\tPlaceholder,\n\tSelectControl as WCSelectControl,\n\tSpinner,\n\tToolbarButton,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport {\n\tBlockContextProvider,\n\tBlockControls,\n\tuseBlockEditingMode,\n\t__experimentalUseBlockPreview as useBlockPreview,\n} from '@wordpress/block-editor';\nimport { sharedIcon } from './shared-icon';\nimport { isGalleryFlexLayout } from './shared';\nimport { Caption } from '../utils/caption';\nimport { DEFAULT_ORDERBY, DEFAULT_ORDER, MAX_IMAGES } from './dynamic-source';\n\n/**\n * Ordering options for a dynamic gallery source. Each value is a composite\n * `\"orderby/order\"` string mapping to the matching `/wp/v2/media` collection\n * params. `menu_order` is deliberately omitted — it isn't a valid REST `orderby`\n * value, so the editor preview couldn't reproduce it (see `dynamic-source.js`).\n */\nconst ORDER_OPTIONS = [\n\t{ label: __( 'Newest to oldest' ), value: 'date/desc' },\n\t{ label: __( 'Oldest to newest' ), value: 'date/asc' },\n\t{\n\t\t/* translators: Label for ordering images by title in ascending order. */\n\t\tlabel: __( 'A → Z' ),\n\t\tvalue: 'title/asc',\n\t},\n\t{\n\t\t/* translators: Label for ordering images by title in descending order. */\n\t\tlabel: __( 'Z → A' ),\n\t\tvalue: 'title/desc',\n\t},\n];\n\n/**\n * \"Order by\" control for a dynamic gallery, mirroring the Query Loop block's\n * `OrderControl`: a single `SelectControl` whose value composites `orderby` and\n * `order`, split apart again on change.\n *\n * @param {Object} props\n * @param {string} props.orderby Current `orderby` value.\n * @param {string} props.order Current `order` value (`asc`/`desc`).\n * @param {Function} props.onChange Called with `{ orderby, order }` on change.\n */\nfunction OrderControl( { orderby, order, onChange } ) {\n\treturn (\n\t\t<WCSelectControl\n\t\t\tlabel={ __( 'Order by' ) }\n\t\t\tvalue={ `${ orderby }/${ order }` }\n\t\t\toptions={ ORDER_OPTIONS }\n\t\t\tonChange={ ( value ) => {\n\t\t\t\tconst [ newOrderby, newOrder ] = value.split( '/' );\n\t\t\t\tonChange( { orderby: newOrderby, order: newOrder } );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\n/**\n * Confirmation for leaving dynamic mode, shown from both the block toolbar and\n * the Source panel so the two entry points explain the change identically.\n *\n * Detaching keeps the images the gallery currently shows but breaks the link to\n * its source, so it's worth confirming — mirroring the dialog `GallerySourcePanel`\n * shows for the opposite direction.\n *\n * @param {Object} props\n * @param {Function} props.onConfirm Called when the user confirms detaching.\n * @param {Function} props.onCancel Called when the user dismisses the dialog.\n */\nfunction DetachGalleryDialog( { onConfirm, onCancel } ) {\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen\n\t\t\ttitle={ __( 'Detach Gallery' ) }\n\t\t\t__experimentalHideHeader={ false }\n\t\t\tconfirmButtonText={ __( 'Detach' ) }\n\t\t\tonConfirm={ onConfirm }\n\t\t\tonCancel={ onCancel }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'The gallery displays the images attached to the post. Detaching will enable you to add, delete, or reorder images. However, new attachments will no longer be added automatically.'\n\t\t\t) }\n\t\t</ConfirmDialog>\n\t);\n}\n\n/**\n * The Gallery block's \"Source\" inspector panel.\n *\n * In dynamic mode it shows the resolved source, a control to detach the gallery\n * from it, and the source ordering. In static mode it offers the entry point\n * into dynamic mode. Either direction is a one-way change, so both are behind a\n * confirmation dialog this panel owns. Rendered inside the block's\n * `InspectorControls`, alongside the Settings panel.\n *\n * @param {Object} props\n * @param {Object} props.dynamic The `useDynamicGallery` result.\n * @param {Object} props.dropdownMenuProps Shared ToolsPanel dropdown menu props.\n * @param {boolean} props.hasImages Whether the gallery has manually-added images.\n */\nexport function GallerySourcePanel( {\n\tdynamic,\n\tdropdownMenuProps,\n\thasImages,\n} ) {\n\tconst {\n\t\tdynamicContent,\n\t\tcanUseDynamicSource,\n\t\tsourceDescriptor,\n\t\tsourceOrderby,\n\t\tsourceOrder,\n\t\tsetSourceOrder,\n\t\tconvertToStatic,\n\t\tenableDynamicMode,\n\t\tresetSource,\n\t\tisResolvingDynamic,\n\t\thasMoreImagesThanCap,\n\t\tdynamicMediaTotal,\n\t} = dynamic;\n\tconst isDynamic = !! dynamicContent;\n\n\tconst [ isConfirming, setIsConfirming ] = useState( false );\n\tconst [ isConfirmingDetach, setIsConfirmingDetach ] = useState( false );\n\n\t// Entering dynamic mode discards any hand-added images, so confirm first\n\t// when there are images to lose; otherwise switch straight away.\n\tfunction requestEnableDynamicMode() {\n\t\tif ( hasImages ) {\n\t\t\tsetIsConfirming( true );\n\t\t} else {\n\t\t\tenableDynamicMode();\n\t\t}\n\t}\n\n\tif ( isDynamic ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Source' ) }\n\t\t\t\t\tresetAll={ resetSource }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<div className=\"wp-block-gallery__source-settings\">\n\t\t\t\t\t\t<p className=\"wp-block-gallery__source-description\">\n\t\t\t\t\t\t\t{ sourceDescriptor?.description ??\n\t\t\t\t\t\t\t\t__( 'Dynamic images.' ) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ () => setIsConfirmingDetach( true ) }\n\t\t\t\t\t\t\t// Guard the race where the media is still resolving:\n\t\t\t\t\t\t\t// detaching now would map over an incomplete (or\n\t\t\t\t\t\t\t// empty) list and produce a gallery missing images.\n\t\t\t\t\t\t\tdisabled={ isResolvingDynamic }\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Detach Gallery' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t\t{ hasMoreImagesThanCap && (\n\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\tclassName=\"wp-block-gallery__source-notice\"\n\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: 1: number of images shown. 2: total number of matching images. */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Only the first %1$d of %2$d images will be displayed.'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tMAX_IMAGES,\n\t\t\t\t\t\t\t\tdynamicMediaTotal\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Notice>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\tlabel={ __( 'Order by' ) }\n\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\tsourceOrderby !== DEFAULT_ORDERBY ||\n\t\t\t\t\t\t\tsourceOrder !== DEFAULT_ORDER\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetSourceOrder( undefined, undefined )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<OrderControl\n\t\t\t\t\t\t\torderby={ sourceOrderby }\n\t\t\t\t\t\t\torder={ sourceOrder }\n\t\t\t\t\t\t\tonChange={ ( { orderby, order } ) =>\n\t\t\t\t\t\t\t\tsetSourceOrder( orderby, order )\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</ToolsPanel>\n\t\t\t\t{ isConfirmingDetach && (\n\t\t\t\t\t<DetachGalleryDialog\n\t\t\t\t\t\tonConfirm={ () => {\n\t\t\t\t\t\t\tconvertToStatic();\n\t\t\t\t\t\t\tsetIsConfirmingDetach( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonCancel={ () => setIsConfirmingDetach( false ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\t// In static mode this panel is just an entry into dynamic mode, so hide it\n\t// when there's no post type to preview against. This is intentionally\n\t// stricter than the placeholder's entry button (see `edit.jsx`), which stays\n\t// available anywhere because the source resolves at render time.\n\tif ( ! canUseDynamicSource ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<PanelBody title={ __( 'Source' ) }>\n\t\t\t\t<div className=\"wp-block-gallery__source-settings\">\n\t\t\t\t\t{ /*\n\t\t\t\t\t * Hardcoded on purpose: this single-source entry button (and\n\t\t\t\t\t * its confirm dialog below) is temporary. Once more sources\n\t\t\t\t\t * exist it becomes a \"Choose source\" select whose options read\n\t\t\t\t\t * from each source descriptor's `title`, with help text\n\t\t\t\t\t * carrying the per-source explanation these strings do today.\n\t\t\t\t\t */ }\n\t\t\t\t\t<p className=\"wp-block-gallery__source-description\">\n\t\t\t\t\t\t{ __( 'Images added to the gallery.' ) }\n\t\t\t\t\t</p>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ requestEnableDynamicMode }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Use attached images' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</PanelBody>\n\t\t\t{ isConfirming && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen\n\t\t\t\t\ttitle={ __( 'Use images attached to the post?' ) }\n\t\t\t\t\t__experimentalHideHeader={ false }\n\t\t\t\t\tconfirmButtonText={ __( 'Use attached images' ) }\n\t\t\t\t\tonConfirm={ () => {\n\t\t\t\t\t\tenableDynamicMode();\n\t\t\t\t\t\tsetIsConfirming( false );\n\t\t\t\t\t} }\n\t\t\t\t\tonCancel={ () => setIsConfirming( false ) }\n\t\t\t\t\tsize=\"medium\"\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'The images in this gallery will be replaced, but will remain in the media library.'\n\t\t\t\t\t) }\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Renders the resolved image blocks as a read-only preview.\n *\n * `useBlockPreview` returns a `useDisabled` ref that makes its subtree inert, so\n * previewed images (including any links) aren't interactive in the editor. The\n * ref needs a real element, yet the images must stay flex children of the gallery\n * `<figure>` and sit beside an editable caption. `display: contents` resolves\n * this: the wrapper carries the ref but generates no box, so the image figures\n * remain the figure's flex items and only they are disabled — the caption sibling\n * stays editable. This relies on the gallery's image styles using descendant\n * (not direct-child) selectors, which the box-less wrapper leaves intact.\n *\n * The gallery's layout is passed through so the previewed images see the same\n * parent layout that real inner blocks would (`useBlockPreview` provides it to\n * their layout context). Without it they resolve to the default flow layout and\n * behave as if they weren't in a gallery — most visibly, an image inside a\n * cropped gallery would keep its baseline `height: auto` and defeat the\n * gallery's cropping CSS.\n *\n * @param {Object} props\n * @param {Object[]} props.imageBlocks Non-persisted `core/image` blocks to preview.\n * @param {Object} props.layout The gallery's layout, for the preview's layout context.\n */\nfunction GalleryImagesPreview( { imageBlocks, layout } ) {\n\tconst { children, ref, className } = useBlockPreview( {\n\t\tblocks: imageBlocks,\n\t\tlayout,\n\t} );\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ className }\n\t\t\tstyle={ { display: 'contents' } }\n\t\t>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\n/**\n * Renders a dynamic-mode gallery on the canvas:\n *\n * - a block-toolbar control to detach the gallery from its source, confirmed in\n * a dialog;\n * - the gallery `<figure>` wrapper holding a non-editable preview of the\n * resolved media (or a placeholder while resolving / when nothing is found),\n * with the gallery's provided context so the previewed images inherit\n * gallery-wide settings;\n * - an editable gallery-level caption, alongside the read-only preview;\n * - the (empty) inner blocks kept mounted so the container's `allowedBlocks: []`\n * keeps syncing to block list settings (which blocks insertion and hides the\n * List View).\n *\n * @param {Object} props\n * @param {Object} props.dynamic The `useDynamicGallery` result.\n * @param {Object} props.blockProps The gallery's `useBlockProps()` result.\n * @param {Object} props.innerBlocksProps The gallery's `useInnerBlocksProps()` result.\n * @param {Object} props.attributes The gallery block attributes.\n * @param {Function} props.setAttributes The block's `setAttributes`.\n * @param {boolean} props.isSelected Whether the gallery block is selected.\n * @param {Function} props.insertBlocksAfter Inserts blocks after the gallery.\n * @param {boolean} props.isContentLocked Whether the gallery is content-locked.\n * @param {boolean} props.multiGallerySelection Whether multiple galleries are selected.\n */\nexport function GalleryDynamicView( {\n\tdynamic,\n\tblockProps,\n\tinnerBlocksProps,\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tinsertBlocksAfter,\n\tisContentLocked,\n\tmultiGallerySelection,\n} ) {\n\tconst {\n\t\tsourceDescriptor,\n\t\tdynamicImageBlocks,\n\t\tgalleryContext,\n\t\tisResolvingDynamic,\n\t\tconvertToStatic,\n\t} = dynamic;\n\n\t// Detaching the gallery materializes editable inner blocks, which is a\n\t// structural change. Only offer it when the block is fully editable:\n\t// under a content lock (e.g. inside a `contentOnly` group) the editing mode\n\t// is `'contentOnly'`/`'disabled'`, where structural toolbar controls are\n\t// hidden and the conversion shouldn't be possible.\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst [ isConfirmingDetach, setIsConfirmingDetach ] = useState( false );\n\n\t// The layout the previewed images sit in. Normalized the same way the\n\t// gallery's own classes are (`isGalleryFlexLayout`), so a layout that the\n\t// wrapper treats as flex — including a missing or typeless one — is reported\n\t// as flex to the images rather than resolving to the default flow layout.\n\t// Memoized because it becomes the preview's layout context value.\n\tconst previewLayout = useMemo(\n\t\t() =>\n\t\t\tisGalleryFlexLayout( attributes.layout )\n\t\t\t\t? { ...attributes.layout, type: 'flex' }\n\t\t\t\t: attributes.layout,\n\t\t[ attributes.layout ]\n\t);\n\n\t// Empty-state copy for the preview. Framed as forward-looking (\"… will appear\n\t// here\") rather than as an error, since the same empty result covers both a\n\t// post with no matching images and a template with no post in context yet —\n\t// in either case the source simply resolves to nothing right now. The per-\n\t// source wording comes from the source descriptor.\n\tconst emptyInstructions = isResolvingDynamic\n\t\t? __( 'Loading images…' )\n\t\t: ( sourceDescriptor?.emptyMessage ??\n\t\t\t__( 'Dynamic images will appear here.' ) );\n\n\treturn (\n\t\t<>\n\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={ () => setIsConfirmingDetach( true ) }\n\t\t\t\t\t\t\t// Same guard as the inspector's \"Detach Gallery\": both end in\n\t\t\t\t\t\t\t// `convertToStatic`, which would map over a\n\t\t\t\t\t\t\t// still-resolving (or empty) media list.\n\t\t\t\t\t\t\t// (`ToolbarButton` stays focusable when disabled by\n\t\t\t\t\t\t\t// default.)\n\t\t\t\t\t\t\tdisabled={ isResolvingDynamic }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Detach' ) }\n\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t{ isConfirmingDetach && (\n\t\t\t\t\t\t<DetachGalleryDialog\n\t\t\t\t\t\t\tonConfirm={ () => {\n\t\t\t\t\t\t\t\tconvertToStatic();\n\t\t\t\t\t\t\t\tsetIsConfirmingDetach( false );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonCancel={ () => setIsConfirmingDetach( false ) }\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<figure { ...blockProps }>\n\t\t\t\t{ dynamicImageBlocks.length ? (\n\t\t\t\t\t<BlockContextProvider value={ galleryContext }>\n\t\t\t\t\t\t<GalleryImagesPreview\n\t\t\t\t\t\t\timageBlocks={ dynamicImageBlocks }\n\t\t\t\t\t\t\tlayout={ previewLayout }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t) : (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ sharedIcon }\n\t\t\t\t\t\tlabel={ __( 'Gallery' ) }\n\t\t\t\t\t\tinstructions={ emptyInstructions }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isResolvingDynamic && <Spinner /> }\n\t\t\t\t\t</Placeholder>\n\t\t\t\t) }\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={ isSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tshowToolbarButton={\n\t\t\t\t\t\t! multiGallerySelection && ! isContentLocked\n\t\t\t\t\t}\n\t\t\t\t\tclassName=\"blocks-gallery-caption\"\n\t\t\t\t\tlabel={ __( 'Gallery caption text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add gallery caption' ) }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t\t{ /*\n\t\t\t * Dynamic mode shows a preview instead of real inner blocks, but the\n\t\t\t * empty inner blocks are still rendered here for their side effect:\n\t\t\t * the `allowedBlocks: []` passed to `useInnerBlocksProps` only syncs\n\t\t\t * to block list settings while the inner blocks are mounted (via\n\t\t\t * `useNestedSettingsUpdate`). That setting is what blocks insertion\n\t\t\t * (`canInsertBlockType`) and hides the now-unusable List View\n\t\t\t * (`shouldRenderBlockListView`). With no inner blocks and no appender,\n\t\t\t * this renders no output of its own.\n\t\t\t */ }\n\t\t\t{ innerBlocksProps.children }\n\t\t</>\n\t);\n}\n"],
5
- "mapp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,QAAC;AAAA;AAAA,UACA,aAAc;AAAA,UACd,QAAS;AAAA;AAAA,MACV,GACD,IAEA;AAAA,QAAC;AAAA;AAAA,UACA,MAAO;AAAA,UACP,OAAQ,GAAI,SAAU;AAAA,UACtB,cAAe;AAAA,UAEb,gCAAsB,oBAAC,WAAQ;AAAA;AAAA,MAClC;AAAA,MAED;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,mBACC,CAAE,yBAAyB,CAAE;AAAA,UAE9B,WAAU;AAAA,UACV,OAAQ,GAAI,sBAAuB;AAAA,UACnC,aAAc,GAAI,qBAAsB;AAAA;AAAA,MACzC;AAAA,OACD;AAAA,IAWE,iBAAiB;AAAA,KACpB;AAEF;",
4
+ "sourcesContent": ["import { __, sprintf } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport {\n\tButton,\n\tNotice,\n\tPanelBody,\n\tPlaceholder,\n\tSpinner,\n\tToolbarButton,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport {\n\tBlockContextProvider,\n\tBlockControls,\n\tuseBlockEditingMode,\n\t__experimentalUseBlockPreview as useBlockPreview,\n} from '@wordpress/block-editor';\nimport { sharedIcon } from './shared-icon';\nimport { isGalleryFlexLayout } from './shared';\nimport { Caption } from '../utils/caption';\nimport { MAX_IMAGES } from './dynamic-source';\n\n/**\n * Confirmation for leaving dynamic mode, shown from both the block toolbar and\n * the Source panel so the two entry points explain the change identically.\n *\n * Detaching keeps the images the gallery currently shows but breaks the link to\n * its source, so it's worth confirming — mirroring the dialog `GallerySourcePanel`\n * shows for the opposite direction.\n *\n * @param {Object} props\n * @param {Function} props.onConfirm Called when the user confirms detaching.\n * @param {Function} props.onCancel Called when the user dismisses the dialog.\n */\nfunction DetachGalleryDialog( { onConfirm, onCancel } ) {\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen\n\t\t\ttitle={ __( 'Detach Gallery' ) }\n\t\t\t__experimentalHideHeader={ false }\n\t\t\tconfirmButtonText={ __( 'Detach' ) }\n\t\t\tonConfirm={ onConfirm }\n\t\t\tonCancel={ onCancel }\n\t\t\tsize=\"medium\"\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'The gallery displays the images attached to the post. Detaching will enable you to add, delete, or reorder images. However, new attachments will no longer be added automatically.'\n\t\t\t) }\n\t\t</ConfirmDialog>\n\t);\n}\n\n/**\n * The Gallery block's \"Source\" inspector panel.\n *\n * In dynamic mode it shows the resolved source and a control to detach the\n * gallery from it. In static mode it offers the entry point into dynamic mode.\n * Either direction is a one-way change, so both are behind a confirmation\n * dialog this panel owns. Rendered inside the block's `InspectorControls`,\n * alongside the Settings panel, which owns the ordering for both modes.\n *\n * @param {Object} props\n * @param {Object} props.dynamic The `useDynamicGallery` result.\n * @param {boolean} props.hasImages Whether the gallery has manually-added images.\n */\nexport function GallerySourcePanel( { dynamic, hasImages } ) {\n\tconst {\n\t\tdynamicContent,\n\t\tcanUseDynamicSource,\n\t\tsourceDescriptor,\n\t\tconvertToStatic,\n\t\tenableDynamicMode,\n\t\tisResolvingDynamic,\n\t\thasMoreImagesThanCap,\n\t\tdynamicMediaTotal,\n\t} = dynamic;\n\tconst isDynamic = !! dynamicContent;\n\n\tconst [ isConfirming, setIsConfirming ] = useState( false );\n\tconst [ isConfirmingDetach, setIsConfirmingDetach ] = useState( false );\n\n\t// Entering dynamic mode discards any hand-added images, so confirm first\n\t// when there are images to lose; otherwise switch straight away.\n\tfunction requestEnableDynamicMode() {\n\t\tif ( hasImages ) {\n\t\t\tsetIsConfirming( true );\n\t\t} else {\n\t\t\tenableDynamicMode();\n\t\t}\n\t}\n\n\tif ( isDynamic ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<PanelBody title={ __( 'Source' ) }>\n\t\t\t\t\t<div className=\"wp-block-gallery__source-settings\">\n\t\t\t\t\t\t<p className=\"wp-block-gallery__source-description\">\n\t\t\t\t\t\t\t{ sourceDescriptor?.description ??\n\t\t\t\t\t\t\t\t__( 'Dynamic images.' ) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ () => setIsConfirmingDetach( true ) }\n\t\t\t\t\t\t\t// Guard the race where the media is still resolving:\n\t\t\t\t\t\t\t// detaching now would map over an incomplete (or\n\t\t\t\t\t\t\t// empty) list and produce a gallery missing images.\n\t\t\t\t\t\t\tdisabled={ isResolvingDynamic }\n\t\t\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Detach Gallery' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t\t{ hasMoreImagesThanCap && (\n\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\tclassName=\"wp-block-gallery__source-notice\"\n\t\t\t\t\t\t\tstatus=\"warning\"\n\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: 1: number of images shown. 2: total number of matching images. */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Only the first %1$d of %2$d images will be displayed.'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tMAX_IMAGES,\n\t\t\t\t\t\t\t\tdynamicMediaTotal\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Notice>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t\t{ isConfirmingDetach && (\n\t\t\t\t\t<DetachGalleryDialog\n\t\t\t\t\t\tonConfirm={ () => {\n\t\t\t\t\t\t\tconvertToStatic();\n\t\t\t\t\t\t\tsetIsConfirmingDetach( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonCancel={ () => setIsConfirmingDetach( false ) }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</>\n\t\t);\n\t}\n\n\t// In static mode this panel is just an entry into dynamic mode, so hide it\n\t// when there's no post type to preview against. This is intentionally\n\t// stricter than the placeholder's entry button (see `edit.jsx`), which stays\n\t// available anywhere because the source resolves at render time.\n\tif ( ! canUseDynamicSource ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<PanelBody title={ __( 'Source' ) }>\n\t\t\t\t<div className=\"wp-block-gallery__source-settings\">\n\t\t\t\t\t{ /*\n\t\t\t\t\t * Hardcoded on purpose: this single-source entry button (and\n\t\t\t\t\t * its confirm dialog below) is temporary. Once more sources\n\t\t\t\t\t * exist it becomes a \"Choose source\" select whose options read\n\t\t\t\t\t * from each source descriptor's `title`, with help text\n\t\t\t\t\t * carrying the per-source explanation these strings do today.\n\t\t\t\t\t */ }\n\t\t\t\t\t<p className=\"wp-block-gallery__source-description\">\n\t\t\t\t\t\t{ __( 'Images added to the gallery.' ) }\n\t\t\t\t\t</p>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ requestEnableDynamicMode }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Use attached images' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</PanelBody>\n\t\t\t{ isConfirming && (\n\t\t\t\t<ConfirmDialog\n\t\t\t\t\tisOpen\n\t\t\t\t\ttitle={ __( 'Use images attached to the post?' ) }\n\t\t\t\t\t__experimentalHideHeader={ false }\n\t\t\t\t\tconfirmButtonText={ __( 'Use attached images' ) }\n\t\t\t\t\tonConfirm={ () => {\n\t\t\t\t\t\tenableDynamicMode();\n\t\t\t\t\t\tsetIsConfirming( false );\n\t\t\t\t\t} }\n\t\t\t\t\tonCancel={ () => setIsConfirming( false ) }\n\t\t\t\t\tsize=\"medium\"\n\t\t\t\t>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'The images in this gallery will be replaced, but will remain in the media library.'\n\t\t\t\t\t) }\n\t\t\t\t</ConfirmDialog>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\n/**\n * Renders the resolved image blocks as a read-only preview.\n *\n * `useBlockPreview` returns a `useDisabled` ref that makes its subtree inert, so\n * previewed images (including any links) aren't interactive in the editor. The\n * ref needs a real element, yet the images must stay flex children of the gallery\n * `<figure>` and sit beside an editable caption. `display: contents` resolves\n * this: the wrapper carries the ref but generates no box, so the image figures\n * remain the figure's flex items and only they are disabled — the caption sibling\n * stays editable. This relies on the gallery's image styles using descendant\n * (not direct-child) selectors, which the box-less wrapper leaves intact.\n *\n * The gallery's layout is passed through so the previewed images see the same\n * parent layout that real inner blocks would (`useBlockPreview` provides it to\n * their layout context). Without it they resolve to the default flow layout and\n * behave as if they weren't in a gallery — most visibly, an image inside a\n * cropped gallery would keep its baseline `height: auto` and defeat the\n * gallery's cropping CSS.\n *\n * @param {Object} props\n * @param {Object[]} props.imageBlocks Non-persisted `core/image` blocks to preview.\n * @param {Object} props.layout The gallery's layout, for the preview's layout context.\n */\nfunction GalleryImagesPreview( { imageBlocks, layout } ) {\n\tconst { children, ref, className } = useBlockPreview( {\n\t\tblocks: imageBlocks,\n\t\tlayout,\n\t} );\n\treturn (\n\t\t<div\n\t\t\tref={ ref }\n\t\t\tclassName={ className }\n\t\t\tstyle={ { display: 'contents' } }\n\t\t>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\n/**\n * Renders a dynamic-mode gallery on the canvas:\n *\n * - a block-toolbar control to detach the gallery from its source, confirmed in\n * a dialog;\n * - the gallery `<figure>` wrapper holding a non-editable preview of the\n * resolved media (or a placeholder while resolving / when nothing is found),\n * with the gallery's provided context so the previewed images inherit\n * gallery-wide settings;\n * - an editable gallery-level caption, alongside the read-only preview;\n * - the (empty) inner blocks kept mounted so the container's `allowedBlocks: []`\n * keeps syncing to block list settings (which blocks insertion and hides the\n * List View).\n *\n * @param {Object} props\n * @param {Object} props.dynamic The `useDynamicGallery` result.\n * @param {Object} props.blockProps The gallery's `useBlockProps()` result.\n * @param {Object} props.innerBlocksProps The gallery's `useInnerBlocksProps()` result.\n * @param {Object} props.attributes The gallery block attributes.\n * @param {Function} props.setAttributes The block's `setAttributes`.\n * @param {boolean} props.isSelected Whether the gallery block is selected.\n * @param {Function} props.insertBlocksAfter Inserts blocks after the gallery.\n * @param {boolean} props.isContentLocked Whether the gallery is content-locked.\n * @param {boolean} props.multiGallerySelection Whether multiple galleries are selected.\n */\nexport function GalleryDynamicView( {\n\tdynamic,\n\tblockProps,\n\tinnerBlocksProps,\n\tattributes,\n\tsetAttributes,\n\tisSelected,\n\tinsertBlocksAfter,\n\tisContentLocked,\n\tmultiGallerySelection,\n} ) {\n\tconst {\n\t\tsourceDescriptor,\n\t\tdynamicImageBlocks,\n\t\tgalleryContext,\n\t\tisResolvingDynamic,\n\t\tconvertToStatic,\n\t} = dynamic;\n\n\t// Detaching the gallery materializes editable inner blocks, which is a\n\t// structural change. Only offer it when the block is fully editable:\n\t// under a content lock (e.g. inside a `contentOnly` group) the editing mode\n\t// is `'contentOnly'`/`'disabled'`, where structural toolbar controls are\n\t// hidden and the conversion shouldn't be possible.\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst [ isConfirmingDetach, setIsConfirmingDetach ] = useState( false );\n\n\t// The layout the previewed images sit in. Normalized the same way the\n\t// gallery's own classes are (`isGalleryFlexLayout`), so a layout that the\n\t// wrapper treats as flex — including a missing or typeless one — is reported\n\t// as flex to the images rather than resolving to the default flow layout.\n\t// Memoized because it becomes the preview's layout context value.\n\tconst previewLayout = useMemo(\n\t\t() =>\n\t\t\tisGalleryFlexLayout( attributes.layout )\n\t\t\t\t? { ...attributes.layout, type: 'flex' }\n\t\t\t\t: attributes.layout,\n\t\t[ attributes.layout ]\n\t);\n\n\t// Empty-state copy for the preview. Framed as forward-looking (\"… will appear\n\t// here\") rather than as an error, since the same empty result covers both a\n\t// post with no matching images and a template with no post in context yet —\n\t// in either case the source simply resolves to nothing right now. The per-\n\t// source wording comes from the source descriptor.\n\tconst emptyInstructions = isResolvingDynamic\n\t\t? __( 'Loading images…' )\n\t\t: ( sourceDescriptor?.emptyMessage ??\n\t\t\t__( 'Dynamic images will appear here.' ) );\n\n\treturn (\n\t\t<>\n\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t<>\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tonClick={ () => setIsConfirmingDetach( true ) }\n\t\t\t\t\t\t\t// Same guard as the inspector's \"Detach Gallery\": both end in\n\t\t\t\t\t\t\t// `convertToStatic`, which would map over a\n\t\t\t\t\t\t\t// still-resolving (or empty) media list.\n\t\t\t\t\t\t\t// (`ToolbarButton` stays focusable when disabled by\n\t\t\t\t\t\t\t// default.)\n\t\t\t\t\t\t\tdisabled={ isResolvingDynamic }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Detach' ) }\n\t\t\t\t\t\t</ToolbarButton>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t\t{ isConfirmingDetach && (\n\t\t\t\t\t\t<DetachGalleryDialog\n\t\t\t\t\t\t\tonConfirm={ () => {\n\t\t\t\t\t\t\t\tconvertToStatic();\n\t\t\t\t\t\t\t\tsetIsConfirmingDetach( false );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonCancel={ () => setIsConfirmingDetach( false ) }\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<figure { ...blockProps }>\n\t\t\t\t{ dynamicImageBlocks.length ? (\n\t\t\t\t\t<BlockContextProvider value={ galleryContext }>\n\t\t\t\t\t\t<GalleryImagesPreview\n\t\t\t\t\t\t\timageBlocks={ dynamicImageBlocks }\n\t\t\t\t\t\t\tlayout={ previewLayout }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t) : (\n\t\t\t\t\t<Placeholder\n\t\t\t\t\t\ticon={ sharedIcon }\n\t\t\t\t\t\tlabel={ __( 'Gallery' ) }\n\t\t\t\t\t\tinstructions={ emptyInstructions }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isResolvingDynamic && <Spinner /> }\n\t\t\t\t\t</Placeholder>\n\t\t\t\t) }\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={ isSelected }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tshowToolbarButton={\n\t\t\t\t\t\t! multiGallerySelection && ! isContentLocked\n\t\t\t\t\t}\n\t\t\t\t\tclassName=\"blocks-gallery-caption\"\n\t\t\t\t\tlabel={ __( 'Gallery caption text' ) }\n\t\t\t\t\tplaceholder={ __( 'Add gallery caption' ) }\n\t\t\t\t/>\n\t\t\t</figure>\n\t\t\t{ /*\n\t\t\t * Dynamic mode shows a preview instead of real inner blocks, but the\n\t\t\t * empty inner blocks are still rendered here for their side effect:\n\t\t\t * the `allowedBlocks: []` passed to `useInnerBlocksProps` only syncs\n\t\t\t * to block list settings while the inner blocks are mounted (via\n\t\t\t * `useNestedSettingsUpdate`). That setting is what blocks insertion\n\t\t\t * (`canInsertBlockType`) and hides the now-unusable List View\n\t\t\t * (`shouldRenderBlockListView`). With no inner blocks and no appender,\n\t\t\t * this renders no output of its own.\n\t\t\t */ }\n\t\t\t{ innerBlocksProps.children }\n\t\t</>\n\t);\n}\n"],
5
+ "mappings": ";AAAA,SAAS,IAAI,eAAe;AAC5B,SAAS,SAAS,gBAAgB;AAClC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,+BAA+B;AAAA,OACzB;AACP;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA,iCAAiC;AAAA,OAC3B;AACP,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AACpC,SAAS,eAAe;AACxB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A,UACA;AAAA,UACA;AAAA,UACA,mBACC,CAAE,yBAAyB,CAAE;AAAA,UAE9B,WAAU;AAAA,UACV,OAAQ,GAAI,sBAAuB;AAAA,UACnC,aAAc,GAAI,qBAAsB;AAAA;AAAA,MACzC;AAAA,OACD;AAAA,IAWE,iBAAiB;AAAA,KACpB;AAEF;",
6
6
  "names": []
7
7
  }
@@ -24,7 +24,7 @@ import {
24
24
  MediaReplaceFlow,
25
25
  useSettings
26
26
  } from "@wordpress/block-editor";
27
- import { useEffect, useMemo, useRef } from "@wordpress/element";
27
+ import { useEffect, useMemo, useRef, useState } from "@wordpress/element";
28
28
  import { __, _x, sprintf } from "@wordpress/i18n";
29
29
  import { useSelect, useDispatch } from "@wordpress/data";
30
30
  import { createBlock } from "@wordpress/blocks";
@@ -65,8 +65,14 @@ import useGetMedia from "./use-get-media.mjs";
65
65
  import GalleryStyles from "./gallery-styles.mjs";
66
66
  import useDynamicGallery from "./use-dynamic-gallery.mjs";
67
67
  import { GallerySourcePanel, GalleryDynamicView } from "./dynamic-gallery.mjs";
68
- import { getDynamicSource, ATTACHED_MEDIA } from "./dynamic-source.mjs";
69
- import { unlock } from "../lock-unlock.mjs";
68
+ import { SortImagesControl, SourceOrderControl } from "./order-controls.mjs";
69
+ import {
70
+ getDynamicSource,
71
+ ATTACHED_MEDIA,
72
+ DEFAULT_ORDERBY,
73
+ DEFAULT_ORDER
74
+ } from "./dynamic-source.mjs";
75
+ import { hasSortableImages, sortImageBlocks } from "./order-images.mjs";
70
76
  import {
71
77
  getViewportGalleryStyle,
72
78
  getUpdatedGalleryStyle,
@@ -201,7 +207,7 @@ function GalleryEdit(props) {
201
207
  getSettings: _getSettings,
202
208
  getBlock: _getBlock,
203
209
  getSelectedBlockStyleState
204
- } = unlock(select(blockEditorStore));
210
+ } = select(blockEditorStore);
205
211
  const multiSelectedClientIds = getMultiSelectedBlockClientIds();
206
212
  return {
207
213
  getBlock: _getBlock,
@@ -243,6 +249,11 @@ function GalleryEdit(props) {
243
249
  const newImages = useGetNewImages(images, imageData);
244
250
  const hasImages = !!images.length;
245
251
  const isDynamic = !!attributes.dynamicContent;
252
+ const [appliedSort, setAppliedSort] = useState(null);
253
+ const currentOrder = appliedSort && appliedSort.clientIds.length === innerBlockImages.length && appliedSort.clientIds.every(
254
+ (id, index) => innerBlockImages[index].clientId === id
255
+ ) ? appliedSort.order : null;
256
+ const canSortImages = hasSortableImages(innerBlockImages, imageData);
246
257
  const dynamic = useDynamicGallery({
247
258
  attributes,
248
259
  setAttributes,
@@ -394,6 +405,36 @@ function GalleryEdit(props) {
394
405
  selectBlock(newBlocks[0].clientId);
395
406
  }
396
407
  }
408
+ function selectRandomOrder() {
409
+ setAttributes({ randomOrder: true });
410
+ }
411
+ function clearRandomOrderAfterEdit() {
412
+ if (randomOrder) {
413
+ __unstableMarkNextChangeAsNotPersistent();
414
+ setAttributes({ randomOrder: false });
415
+ }
416
+ }
417
+ function sortImages(order) {
418
+ const sortedBlocks = sortImageBlocks(
419
+ getBlock(clientId).innerBlocks,
420
+ imageData,
421
+ order
422
+ );
423
+ replaceInnerBlocks(clientId, sortedBlocks);
424
+ clearRandomOrderAfterEdit();
425
+ setAppliedSort({
426
+ order,
427
+ clientIds: sortedBlocks.map((block) => block.clientId)
428
+ });
429
+ }
430
+ function selectCustomOrder() {
431
+ setAttributes({ randomOrder: false });
432
+ setAppliedSort(null);
433
+ }
434
+ function changeSourceOrder({ orderby, order }) {
435
+ dynamic.setSourceOrder(orderby, order);
436
+ clearRandomOrderAfterEdit();
437
+ }
397
438
  function onUploadError(message) {
398
439
  createErrorNotice(message, { type: "snackbar" });
399
440
  }
@@ -454,9 +495,6 @@ function GalleryEdit(props) {
454
495
  function toggleImageCrop() {
455
496
  setGallerySettings({ imageCrop: !activeImageCrop });
456
497
  }
457
- function toggleRandomOrder() {
458
- setAttributes({ randomOrder: !randomOrder });
459
- }
460
498
  function toggleOpenInNewTab(openInNewTab) {
461
499
  const newLinkTarget = openInNewTab ? "_blank" : void 0;
462
500
  setAttributes({ linkTarget: newLinkTarget });
@@ -645,7 +683,6 @@ function GalleryEdit(props) {
645
683
  GallerySourcePanel,
646
684
  {
647
685
  dynamic,
648
- dropdownMenuProps,
649
686
  hasImages
650
687
  }
651
688
  ),
@@ -671,6 +708,9 @@ function GalleryEdit(props) {
671
708
  }
672
709
  });
673
710
  setAspectRatio("auto");
711
+ if (isDynamic) {
712
+ dynamic.setSourceOrder(void 0, void 0);
713
+ }
674
714
  if (sizeSlug !== DEFAULT_MEDIA_SIZE_SLUG) {
675
715
  updateImagesSize(DEFAULT_MEDIA_SIZE_SLUG);
676
716
  }
@@ -705,6 +745,50 @@ function GalleryEdit(props) {
705
745
  )
706
746
  }
707
747
  ),
748
+ !isViewportStyleState && // "Random" is stored in both modes. Beyond that, a
749
+ // dynamic gallery's order is a stored query setting,
750
+ // while a static gallery's orders are one-off actions.
751
+ /* @__PURE__ */ jsx(
752
+ ToolsPanelItem,
753
+ {
754
+ isShownByDefault: true,
755
+ label: __("Order by"),
756
+ hasValue: () => !!randomOrder || isDynamic && (dynamic.sourceOrderby !== DEFAULT_ORDERBY || dynamic.sourceOrder !== DEFAULT_ORDER),
757
+ onDeselect: () => {
758
+ if (isDynamic) {
759
+ dynamic.setSourceOrder(
760
+ void 0,
761
+ void 0
762
+ );
763
+ clearRandomOrderAfterEdit();
764
+ } else {
765
+ selectCustomOrder();
766
+ }
767
+ },
768
+ children: isDynamic ? /* @__PURE__ */ jsx(
769
+ SourceOrderControl,
770
+ {
771
+ order: {
772
+ orderby: dynamic.sourceOrderby,
773
+ order: dynamic.sourceOrder
774
+ },
775
+ isRandom: !!randomOrder,
776
+ onChange: changeSourceOrder,
777
+ onSelectRandom: selectRandomOrder
778
+ }
779
+ ) : /* @__PURE__ */ jsx(
780
+ SortImagesControl,
781
+ {
782
+ currentOrder,
783
+ isRandom: !!randomOrder,
784
+ canSort: canSortImages,
785
+ onSort: sortImages,
786
+ onSelectCustom: selectCustomOrder,
787
+ onSelectRandom: selectRandomOrder
788
+ }
789
+ )
790
+ }
791
+ ),
708
792
  !isViewportStyleState && imageSizeOptions?.length > 0 && /* @__PURE__ */ jsx(
709
793
  ToolsPanelItem,
710
794
  {
@@ -727,42 +811,6 @@ function GalleryEdit(props) {
727
811
  )
728
812
  }
729
813
  ),
730
- isFlexLayout && /* @__PURE__ */ jsx(
731
- ToolsPanelItem,
732
- {
733
- isShownByDefault: true,
734
- label: __("Crop images to fit"),
735
- hasValue: () => isViewportStyleState ? hasViewportImageCrop : !activeImageCrop,
736
- onDeselect: () => setGallerySettings({
737
- imageCrop: isViewportStyleState ? void 0 : true
738
- }),
739
- children: /* @__PURE__ */ jsx(
740
- ToggleControl,
741
- {
742
- label: __("Crop images to fit"),
743
- checked: activeImageCrop,
744
- onChange: toggleImageCrop
745
- }
746
- )
747
- }
748
- ),
749
- !isViewportStyleState && /* @__PURE__ */ jsx(
750
- ToolsPanelItem,
751
- {
752
- isShownByDefault: true,
753
- label: __("Randomize order"),
754
- hasValue: () => !!randomOrder,
755
- onDeselect: () => setAttributes({ randomOrder: false }),
756
- children: /* @__PURE__ */ jsx(
757
- ToggleControl,
758
- {
759
- label: __("Randomize order"),
760
- checked: !!randomOrder,
761
- onChange: toggleRandomOrder
762
- }
763
- )
764
- }
765
- ),
766
814
  !isViewportStyleState && hasLinkTo && /* @__PURE__ */ jsx(
767
815
  ToolsPanelItem,
768
816
  {
@@ -808,6 +856,25 @@ function GalleryEdit(props) {
808
856
  )
809
857
  }
810
858
  ),
859
+ isFlexLayout && /* @__PURE__ */ jsx(
860
+ ToolsPanelItem,
861
+ {
862
+ isShownByDefault: true,
863
+ label: __("Crop images to fit"),
864
+ hasValue: () => isViewportStyleState ? hasViewportImageCrop : !activeImageCrop,
865
+ onDeselect: () => setGallerySettings({
866
+ imageCrop: isViewportStyleState ? void 0 : true
867
+ }),
868
+ children: /* @__PURE__ */ jsx(
869
+ ToggleControl,
870
+ {
871
+ label: __("Crop images to fit"),
872
+ checked: activeImageCrop,
873
+ onChange: toggleImageCrop
874
+ }
875
+ )
876
+ }
877
+ ),
811
878
  !isViewportStyleState && lightboxSetting?.allowEditing && hasLightboxImages && /* @__PURE__ */ jsx(
812
879
  ToolsPanelItem,
813
880
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/gallery/edit.jsx"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport {\n\tSelectControl as WCSelectControl,\n\tToggleControl,\n\tRangeControl,\n\tMenuGroup,\n\tMenuItem,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tToolbarDropdownMenu,\n\tButton,\n} from '@wordpress/components';\nimport {\n\tstore as blockEditorStore,\n\tMediaPlaceholder,\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tuseBlockEditingMode,\n\tBlockControls,\n\tMediaReplaceFlow,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useEffect, useMemo, useRef } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { createBlock } from '@wordpress/blocks';\nimport { createBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\nimport {\n\tlink as linkIcon,\n\tcustomLink,\n\timage as imageIcon,\n\tlinkOff,\n\tfullscreen,\n} from '@wordpress/icons';\nimport { sharedIcon } from './shared-icon';\nimport {\n\tdefaultColumnsNumber,\n\tisGalleryFlexLayout,\n\tisObject,\n\tpickRelevantMediaFiles,\n} from './shared';\nimport { getHrefAndDestination } from './utils';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport {\n\tgetUpdatedLinkTargetSettings,\n\tgetImageSizeAttributes,\n} from '../image/utils';\nimport Gallery from './gallery';\nimport {\n\tLINK_DESTINATION_ATTACHMENT,\n\tLINK_DESTINATION_MEDIA,\n\tLINK_DESTINATION_NONE,\n\tLINK_DESTINATION_LIGHTBOX,\n\tDEFAULT_MEDIA_SIZE_SLUG,\n\tMAX_COLUMNS,\n} from './constants';\nimport useImageSizes from './use-image-sizes';\nimport useGetNewImages from './use-get-new-images';\nimport useGetMedia from './use-get-media';\nimport GalleryStyles from './gallery-styles';\nimport useDynamicGallery from './use-dynamic-gallery';\nimport { GallerySourcePanel, GalleryDynamicView } from './dynamic-gallery';\nimport { getDynamicSource, ATTACHED_MEDIA } from './dynamic-source';\nimport { unlock } from '../lock-unlock';\nimport {\n\tgetViewportGalleryStyle,\n\tgetUpdatedGalleryStyle,\n\tisValidGalleryColumns,\n} from './responsive-styles';\n\nconst LINK_OPTIONS = [\n\t{\n\t\ticon: customLink,\n\t\tlabel: __( 'Link images to attachment pages' ),\n\t\tvalue: LINK_DESTINATION_ATTACHMENT,\n\t\tnoticeText: __( 'Attachment Pages' ),\n\t},\n\t{\n\t\ticon: imageIcon,\n\t\tlabel: __( 'Link images to media files' ),\n\t\tvalue: LINK_DESTINATION_MEDIA,\n\t\tnoticeText: __( 'Media Files' ),\n\t},\n\t{\n\t\ticon: fullscreen,\n\t\tlabel: __( 'Enlarge on click' ),\n\t\tvalue: LINK_DESTINATION_LIGHTBOX,\n\t\tnoticeText: __( 'Lightbox effect' ),\n\t\tinfoText: __( 'Scale images with a lightbox effect' ),\n\t},\n\t{\n\t\ticon: linkOff,\n\t\tlabel: _x( 'None', 'Media item link option' ),\n\t\tvalue: LINK_DESTINATION_NONE,\n\t\tnoticeText: __( 'None' ),\n\t},\n];\nconst NAVIGATION_BUTTON_TYPE_OPTIONS = [\n\t{\n\t\tlabel: __( 'Icon' ),\n\t\tvalue: 'icon',\n\t},\n\t{\n\t\tlabel: __( 'Text' ),\n\t\tvalue: 'text',\n\t},\n\t{\n\t\tlabel: __( 'Both' ),\n\t\tvalue: 'both',\n\t},\n];\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nconst PLACEHOLDER_TEXT = __(\n\t'Drag and drop images, upload, or choose from your library.'\n);\n\nconst DEFAULT_BLOCK = { name: 'core/image' };\nconst EMPTY_ARRAY = [];\n\nexport default function GalleryEdit( props ) {\n\tconst {\n\t\tsetAttributes,\n\t\tattributes,\n\t\tclassName,\n\t\tclientId,\n\t\tisSelected,\n\t\tinsertBlocksAfter,\n\t\tisContentLocked,\n\t\tcontext,\n\t\t__unstableLayoutClassNames: layoutClassNames,\n\t} = props;\n\n\tconst postId = context?.postId;\n\tconst postType = context?.postType;\n\n\t// Entering dynamic mode is a structural change (it discards inner blocks and\n\t// switches the block's mode), so the entry point is only offered when the\n\t// block is fully editable — mirroring the dynamic view's \"Edit images\"\n\t// toolbar control. Under a content lock the mode is `'contentOnly'`/\n\t// `'disabled'`, where structural affordances are hidden.\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst [ lightboxSetting, defaultRatios, themeRatios, showDefaultRatios ] =\n\t\tuseSettings(\n\t\t\t'blocks.core/image.lightbox',\n\t\t\t'dimensions.aspectRatios.default',\n\t\t\t'dimensions.aspectRatios.theme',\n\t\t\t'dimensions.defaultAspectRatios'\n\t\t);\n\n\tconst linkOptions = ! lightboxSetting?.allowEditing\n\t\t? LINK_OPTIONS.filter(\n\t\t\t\t( option ) => option.value !== LINK_DESTINATION_LIGHTBOX\n\t\t\t)\n\t\t: LINK_OPTIONS;\n\n\tconst {\n\t\talign,\n\t\tnavigationButtonType,\n\t\tcolumns,\n\t\timageCrop,\n\t\trandomOrder,\n\t\tlinkTarget,\n\t\tlinkTo,\n\t\tsizeSlug,\n\t\taspectRatio,\n\t\tlayout,\n\t} = attributes;\n\tconst isFlexLayout = isGalleryFlexLayout( layout );\n\tconst previousLayoutRef = useRef( layout );\n\n\tconst {\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceInnerBlocks,\n\t\tupdateBlockAttributes,\n\t\tselectBlock,\n\t} = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tuseEffect( () => {\n\t\t// Variations replace the whole layout object. Carry Grid-only settings\n\t\t// across a layout type change so switching back restores them.\n\t\tconst previousLayout = previousLayoutRef.current;\n\t\tpreviousLayoutRef.current = layout;\n\n\t\tif (\n\t\t\t! isObject( previousLayout ) ||\n\t\t\t! isObject( layout ) ||\n\t\t\tpreviousLayout.type === layout.type\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst nextLayout = { ...layout };\n\t\tlet hasPreservedGridSetting = false;\n\n\t\tif (\n\t\t\t! Object.hasOwn( layout, 'columnCount' ) &&\n\t\t\tNumber.isInteger( previousLayout.columnCount ) &&\n\t\t\tpreviousLayout.columnCount > 0\n\t\t) {\n\t\t\tnextLayout.columnCount = previousLayout.columnCount;\n\t\t\thasPreservedGridSetting = true;\n\t\t}\n\n\t\tif (\n\t\t\t! Object.hasOwn( layout, 'minimumColumnWidth' ) &&\n\t\t\ttypeof previousLayout.minimumColumnWidth === 'string'\n\t\t) {\n\t\t\tnextLayout.minimumColumnWidth = previousLayout.minimumColumnWidth;\n\t\t\thasPreservedGridSetting = true;\n\t\t}\n\n\t\tif ( hasPreservedGridSetting ) {\n\t\t\tpreviousLayoutRef.current = nextLayout;\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { layout: nextLayout } );\n\t\t}\n\t}, [ layout, setAttributes, __unstableMarkNextChangeAsNotPersistent ] );\n\n\tconst {\n\t\tgetBlock,\n\t\tgetSettings,\n\t\tinnerBlockImages,\n\t\tmultiGallerySelection,\n\t\tselectedStyleState,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tgetMultiSelectedBlockClientIds,\n\t\t\t\tgetSettings: _getSettings,\n\t\t\t\tgetBlock: _getBlock,\n\t\t\t\tgetSelectedBlockStyleState,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tconst multiSelectedClientIds = getMultiSelectedBlockClientIds();\n\n\t\t\treturn {\n\t\t\t\tgetBlock: _getBlock,\n\t\t\t\tgetSettings: _getSettings,\n\t\t\t\tinnerBlockImages:\n\t\t\t\t\t_getBlock( clientId )?.innerBlocks ?? EMPTY_ARRAY,\n\t\t\t\tmultiGallerySelection:\n\t\t\t\t\tmultiSelectedClientIds.length &&\n\t\t\t\t\tmultiSelectedClientIds.every(\n\t\t\t\t\t\t( _clientId ) =>\n\t\t\t\t\t\t\tgetBlockName( _clientId ) === 'core/gallery'\n\t\t\t\t\t),\n\t\t\t\tselectedStyleState: getSelectedBlockStyleState( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst isViewportStyleState =\n\t\tselectedStyleState?.viewport &&\n\t\tselectedStyleState.viewport !== 'default';\n\tconst viewportStyle = isViewportStyleState\n\t\t? getViewportGalleryStyle(\n\t\t\t\tattributes.style,\n\t\t\t\tselectedStyleState.viewport\n\t\t\t)\n\t\t: {};\n\tconst baseColumns = isValidGalleryColumns( columns ) ? columns : undefined;\n\tconst baseImageCrop = typeof imageCrop === 'boolean' ? imageCrop : true;\n\t// Normalized so a Gallery with no aspect ratio and one explicitly set to\n\t// Original compare equal, and a viewport override matching either is\n\t// dropped rather than stored.\n\tconst baseAspectRatio = aspectRatio || 'auto';\n\tconst hasViewportColumns =\n\t\tisViewportStyleState &&\n\t\tObject.hasOwn( viewportStyle, 'columns' ) &&\n\t\tisValidGalleryColumns( viewportStyle.columns );\n\tconst hasViewportImageCrop =\n\t\tisViewportStyleState &&\n\t\tObject.hasOwn( viewportStyle, 'imageCrop' ) &&\n\t\ttypeof viewportStyle.imageCrop === 'boolean';\n\tconst hasViewportAspectRatio =\n\t\tisViewportStyleState &&\n\t\tObject.hasOwn( viewportStyle, 'aspectRatio' ) &&\n\t\ttypeof viewportStyle.aspectRatio === 'string' &&\n\t\t!! viewportStyle.aspectRatio;\n\tconst activeColumns = hasViewportColumns\n\t\t? viewportStyle.columns\n\t\t: baseColumns;\n\tconst activeImageCrop = hasViewportImageCrop\n\t\t? viewportStyle.imageCrop\n\t\t: baseImageCrop;\n\tconst activeAspectRatio = hasViewportAspectRatio\n\t\t? viewportStyle.aspectRatio\n\t\t: baseAspectRatio;\n\n\tconst images = useMemo(\n\t\t() =>\n\t\t\tinnerBlockImages?.map( ( block ) => ( {\n\t\t\t\tclientId: block.clientId,\n\t\t\t\tid: block.attributes.id,\n\t\t\t\turl: block.attributes.url,\n\t\t\t\tattributes: block.attributes,\n\t\t\t\tfromSavedContent: Boolean( block.originalContent ),\n\t\t\t} ) ),\n\t\t[ innerBlockImages ]\n\t);\n\n\tconst imageData = useGetMedia( innerBlockImages );\n\n\tconst newImages = useGetNewImages( images, imageData );\n\n\tconst hasImages = !! images.length;\n\tconst isDynamic = !! attributes.dynamicContent;\n\n\t// Dynamic mode (resolving images from a source instead of inner blocks):\n\t// source resolution, the editor-preview blocks, and the mode/ordering\n\t// actions.\n\tconst dynamic = useDynamicGallery( {\n\t\tattributes,\n\t\tsetAttributes,\n\t\tclientId,\n\t\tpostId,\n\t\tpostType,\n\t} );\n\n\t// State that drives counts/size options should reflect the dynamic media\n\t// when the gallery is in dynamic mode.\n\tconst displayedImageCount = isDynamic\n\t\t? dynamic.dynamicMedia.length\n\t\t: images.length;\n\n\t// Check if there is at least one image with lightbox enabled. In dynamic\n\t// mode the images inherit the gallery's link setting, so the lightbox is on\n\t// when the gallery links images to the lightbox.\n\tlet hasLightboxImages;\n\tif ( isDynamic ) {\n\t\thasLightboxImages = linkTo === LINK_DESTINATION_LIGHTBOX;\n\t} else if ( lightboxSetting?.enabled ) {\n\t\thasLightboxImages =\n\t\t\timages.filter(\n\t\t\t\t( image ) =>\n\t\t\t\t\timage.attributes?.lightbox?.enabled === undefined ||\n\t\t\t\t\timage.attributes?.lightbox?.enabled === true\n\t\t\t).length > 0;\n\t} else {\n\t\thasLightboxImages =\n\t\t\timages.filter( ( image ) => image.attributes.lightbox?.enabled )\n\t\t\t\t.length > 0;\n\t}\n\n\tconst themeOptions = themeRatios?.map( ( { name, ratio } ) => ( {\n\t\tlabel: name,\n\t\tvalue: ratio,\n\t} ) );\n\tconst defaultOptions = defaultRatios?.map( ( { name, ratio } ) => ( {\n\t\tlabel: name,\n\t\tvalue: ratio,\n\t} ) );\n\tconst aspectRatioOptions = [\n\t\t{\n\t\t\tlabel: _x(\n\t\t\t\t'Original',\n\t\t\t\t'Aspect ratio option for dimensions control'\n\t\t\t),\n\t\t\tvalue: 'auto',\n\t\t},\n\t\t...( showDefaultRatios ? defaultOptions || [] : [] ),\n\t\t...( themeOptions || [] ),\n\t];\n\n\tuseEffect( () => {\n\t\tnewImages?.forEach( ( newImage ) => {\n\t\t\t// Update the images data without creating new undo levels.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateBlockAttributes( newImage.clientId, {\n\t\t\t\t...buildImageAttributes( newImage.attributes ),\n\t\t\t\tid: newImage.id,\n\t\t\t\talign: undefined,\n\t\t\t} );\n\t\t} );\n\t}, [ newImages ] );\n\n\tconst imageSizeOptions = useImageSizes(\n\t\tisDynamic ? dynamic.dynamicMedia : imageData,\n\t\tisSelected,\n\t\tgetSettings\n\t);\n\n\t/**\n\t * Determines the image attributes that should be applied to an image block\n\t * after the gallery updates.\n\t *\n\t * The gallery will receive the full collection of images when a new image\n\t * is added. As a result we need to reapply the image's original settings if\n\t * it already existed in the gallery. If the image is in fact new, we need\n\t * to apply the gallery's current settings to the image.\n\t *\n\t * @param {Object} imageAttributes Media object for the actual image.\n\t * @return {Object} Attributes to set on the new image block.\n\t */\n\tfunction buildImageAttributes( imageAttributes ) {\n\t\tconst image = imageAttributes.id\n\t\t\t? imageData.find( ( { id } ) => id === imageAttributes.id )\n\t\t\t: null;\n\n\t\tlet newClassName;\n\t\tif ( imageAttributes.className && imageAttributes.className !== '' ) {\n\t\t\tnewClassName = imageAttributes.className;\n\t\t}\n\n\t\tlet newLinkTarget;\n\t\tif ( imageAttributes.linkTarget || imageAttributes.rel ) {\n\t\t\t// When transformed from image blocks, the link destination and rel attributes are inherited.\n\t\t\tnewLinkTarget = {\n\t\t\t\tlinkTarget: imageAttributes.linkTarget,\n\t\t\t\trel: imageAttributes.rel,\n\t\t\t};\n\t\t} else {\n\t\t\t// When an image is added, update the link destination and rel attributes according to the gallery settings\n\t\t\tnewLinkTarget = getUpdatedLinkTargetSettings(\n\t\t\t\tlinkTarget,\n\t\t\t\tattributes\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\t...pickRelevantMediaFiles( image, sizeSlug ),\n\t\t\t...getHrefAndDestination(\n\t\t\t\timage,\n\t\t\t\tlinkTo,\n\t\t\t\timageAttributes?.linkDestination\n\t\t\t),\n\t\t\t...newLinkTarget,\n\t\t\tclassName: newClassName,\n\t\t\tsizeSlug,\n\t\t\tcaption:\n\t\t\t\timageAttributes.caption.length > 0\n\t\t\t\t\t? imageAttributes.caption\n\t\t\t\t\t: image.caption?.raw,\n\t\t\talt: imageAttributes.alt || image.alt_text,\n\t\t\taspectRatio: aspectRatio === 'auto' ? undefined : aspectRatio,\n\t\t\tscale: aspectRatio && aspectRatio !== 'auto' ? 'cover' : undefined,\n\t\t};\n\t}\n\n\tfunction isValidFileType( file ) {\n\t\tconst mediaTypeSelector = file.type;\n\n\t\treturn (\n\t\t\tALLOWED_MEDIA_TYPES.some(\n\t\t\t\t( mediaType ) => mediaTypeSelector?.indexOf( mediaType ) === 0\n\t\t\t) || file.blob\n\t\t);\n\t}\n\n\tfunction updateImages( selectedImages ) {\n\t\tconst newFileUploads =\n\t\t\tObject.prototype.toString.call( selectedImages ) ===\n\t\t\t'[object FileList]';\n\n\t\tconst imageArray = newFileUploads\n\t\t\t? Array.from( selectedImages ).map( ( file ) => {\n\t\t\t\t\tif ( ! file.url ) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn file;\n\t\t\t\t} )\n\t\t\t: selectedImages;\n\n\t\tif ( ! imageArray.every( isValidFileType ) ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'If uploading to a gallery all files need to be image formats'\n\t\t\t\t),\n\t\t\t\t{ id: 'gallery-upload-invalid-file', type: 'snackbar' }\n\t\t\t);\n\t\t}\n\n\t\tconst processedImages = imageArray\n\t\t\t.filter( ( file ) => file.url || isValidFileType( file ) )\n\t\t\t.map( ( file ) => {\n\t\t\t\tif ( ! file.url ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tblob: file.blob || createBlobURL( file ),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn file;\n\t\t\t} );\n\n\t\t// Because we are reusing existing innerImage blocks any reordering\n\t\t// done in the media library will be lost so we need to reapply that ordering\n\t\t// once the new image blocks are merged in with existing.\n\t\tconst newOrderMap = processedImages.reduce(\n\t\t\t( result, image, index ) => (\n\t\t\t\t( result[ image.id ] = index ),\n\t\t\t\tresult\n\t\t\t ),\n\t\t\t{}\n\t\t);\n\n\t\tconst existingImageBlocks = ! newFileUploads\n\t\t\t? innerBlockImages.filter( ( block ) =>\n\t\t\t\t\tprocessedImages.find(\n\t\t\t\t\t\t( img ) => img.id === block.attributes.id\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t: innerBlockImages;\n\n\t\tconst newImageList = processedImages.filter(\n\t\t\t( img ) =>\n\t\t\t\t! existingImageBlocks.find(\n\t\t\t\t\t( existingImg ) => img.id === existingImg.attributes.id\n\t\t\t\t)\n\t\t);\n\n\t\tconst newBlocks = newImageList.map( ( image ) => {\n\t\t\treturn createBlock( 'core/image', {\n\t\t\t\tid: image.id,\n\t\t\t\tblob: image.blob,\n\t\t\t\turl: image.url,\n\t\t\t\tcaption: image.caption,\n\t\t\t\talt: image.alt,\n\t\t\t} );\n\t\t} );\n\n\t\treplaceInnerBlocks(\n\t\t\tclientId,\n\t\t\texistingImageBlocks\n\t\t\t\t.concat( newBlocks )\n\t\t\t\t.sort(\n\t\t\t\t\t( a, b ) =>\n\t\t\t\t\t\tnewOrderMap[ a.attributes.id ] -\n\t\t\t\t\t\tnewOrderMap[ b.attributes.id ]\n\t\t\t\t)\n\t\t);\n\n\t\t// Select the first block to scroll into view when new blocks are added.\n\t\tif ( newBlocks?.length > 0 ) {\n\t\t\tselectBlock( newBlocks[ 0 ].clientId );\n\t\t}\n\t}\n\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\tfunction setLinkTo( value ) {\n\t\tsetAttributes( { linkTo: value } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tconst image = block.attributes.id\n\t\t\t\t? imageData.find( ( { id } ) => id === block.attributes.id )\n\t\t\t\t: null;\n\n\t\t\tchangedAttributes[ block.clientId ] = getHrefAndDestination(\n\t\t\t\timage,\n\t\t\t\tvalue,\n\t\t\t\tfalse,\n\t\t\t\tblock.attributes,\n\t\t\t\tlightboxSetting\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, {\n\t\t\tuniqueByBlock: true,\n\t\t} );\n\t\tconst linkToText = [ ...linkOptions ].find(\n\t\t\t( linkType ) => linkType.value === value\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: image size settings */\n\t\t\t\t__( 'All gallery image links updated to: %s' ),\n\t\t\t\tlinkToText.noticeText\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-linkTo',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction setGallerySettings( settings ) {\n\t\tif ( ! isViewportStyleState ) {\n\t\t\tsetAttributes( settings );\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tstyle: getUpdatedGalleryStyle( {\n\t\t\t\tstyle: attributes.style,\n\t\t\t\tviewport: selectedStyleState.viewport,\n\t\t\t\tbaseSettings: {\n\t\t\t\t\tcolumns: baseColumns,\n\t\t\t\t\timageCrop: baseImageCrop,\n\t\t\t\t\taspectRatio: baseAspectRatio,\n\t\t\t\t},\n\t\t\t\tsettings,\n\t\t\t} ),\n\t\t} );\n\t}\n\n\tfunction setColumnsNumber( value ) {\n\t\tsetGallerySettings( { columns: value } );\n\t}\n\n\tfunction toggleImageCrop() {\n\t\tsetGallerySettings( { imageCrop: ! activeImageCrop } );\n\t}\n\n\tfunction toggleRandomOrder() {\n\t\tsetAttributes( { randomOrder: ! randomOrder } );\n\t}\n\n\tfunction toggleOpenInNewTab( openInNewTab ) {\n\t\tconst newLinkTarget = openInNewTab ? '_blank' : undefined;\n\t\tsetAttributes( { linkTarget: newLinkTarget } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tchangedAttributes[ block.clientId ] = getUpdatedLinkTargetSettings(\n\t\t\t\tnewLinkTarget,\n\t\t\t\tblock.attributes\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, {\n\t\t\tuniqueByBlock: true,\n\t\t} );\n\t\tconst noticeText = openInNewTab\n\t\t\t? __( 'All gallery images updated to open in new tab' )\n\t\t\t: __( 'All gallery images updated to not open in new tab' );\n\t\tcreateSuccessNotice( noticeText, {\n\t\t\tid: 'gallery-attributes-openInNewTab',\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tfunction updateImagesSize( newSizeSlug ) {\n\t\tsetAttributes( { sizeSlug: newSizeSlug } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tconst image = block.attributes.id\n\t\t\t\t? imageData.find( ( { id } ) => id === block.attributes.id )\n\t\t\t\t: null;\n\t\t\tchangedAttributes[ block.clientId ] = getImageSizeAttributes(\n\t\t\t\timage,\n\t\t\t\tnewSizeSlug\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, {\n\t\t\tuniqueByBlock: true,\n\t\t} );\n\t\tconst imageSize = imageSizeOptions.find(\n\t\t\t( size ) => size.value === newSizeSlug\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: image size settings */\n\t\t\t\t__( 'All gallery image sizes updated to: %s' ),\n\t\t\t\timageSize?.label ?? newSizeSlug\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-sizeSlug',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Sets the Gallery's aspect ratio.\n\t *\n\t * The base value is added to the img element as an inline\n\t * style. A viewport value is instead rendered\n\t * from the Gallery's responsive CSS, which overrides that inline style.\n\t *\n\t * @param {string|undefined} value Aspect ratio to set. In a viewport state\n\t * `'auto'` is an override that cancels the\n\t * base ratio, while `undefined` removes the\n\t * override so the base value applies again.\n\t */\n\tfunction setAspectRatio( value ) {\n\t\tif ( isViewportStyleState ) {\n\t\t\tsetGallerySettings( { aspectRatio: value } );\n\t\t} else {\n\t\t\tconst cleanValue = ! value || value === 'auto' ? undefined : value;\n\t\t\tsetAttributes( { aspectRatio: value ?? 'auto' } );\n\n\t\t\t// Update all inner image blocks with the new aspect ratio\n\t\t\tconst changedAttributes = {};\n\t\t\tconst blocks = [];\n\n\t\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\t\tblocks.push( block.clientId );\n\t\t\t\tchangedAttributes[ block.clientId ] = {\n\t\t\t\t\taspectRatio: cleanValue,\n\t\t\t\t\tscale: cleanValue ? 'cover' : undefined,\n\t\t\t\t};\n\t\t\t} );\n\n\t\t\tupdateBlockAttributes( blocks, changedAttributes, true );\n\t\t}\n\n\t\tconst noticeValue = value ?? baseAspectRatio;\n\t\tconst aspectRatioText = aspectRatioOptions.find(\n\t\t\t( option ) => option.value === noticeValue\n\t\t);\n\t\tconst noticeText = isViewportStyleState\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: 1: viewport name, 2: aspect ratio setting */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Gallery images in the %1$s viewport updated to aspect ratio: %2$s'\n\t\t\t\t\t),\n\t\t\t\t\tselectedStyleState.viewport.replace( '@', '' ),\n\t\t\t\t\taspectRatioText?.label || noticeValue\n\t\t\t\t)\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: %s: aspect ratio setting */\n\t\t\t\t\t__( 'All gallery images updated to aspect ratio: %s' ),\n\t\t\t\t\taspectRatioText?.label || noticeValue\n\t\t\t\t);\n\n\t\tcreateSuccessNotice( noticeText, {\n\t\t\tid: 'gallery-attributes-aspectRatio',\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tuseEffect( () => {\n\t\t// linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php.\n\t\tif ( ! linkTo ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tlinkTo:\n\t\t\t\t\twindow?.wp?.media?.view?.settings?.defaultProps?.link ||\n\t\t\t\t\tLINK_DESTINATION_NONE,\n\t\t\t} );\n\t\t}\n\t}, [ linkTo ] );\n\n\tconst hasImageIds = hasImages && images.some( ( image ) => !! image.id );\n\tconst imagesUploading = images.some(\n\t\t( img ) => ! img.id && img.url?.indexOf( 'blob:' ) === 0\n\t);\n\n\tconst mediaPlaceholderProps = {\n\t\taddToGallery: false,\n\t\tdisableMediaButtons: imagesUploading,\n\t\tvalue: {},\n\t};\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx(\n\t\t\tclassName,\n\t\t\t'has-nested-images',\n\t\t\t`wp-block-gallery-${ clientId }`,\n\t\t\t// In dynamic mode there are no inner blocks and the gallery isn't\n\t\t\t// rendered through the `Gallery` component, so the classes that\n\t\t\t// component normally composes onto the `<figure>` (see `gallery.jsx`)\n\t\t\t// must be added here to keep the preview's flex/crop layout matching\n\t\t\t// the static gallery and the frontend.\n\t\t\tisDynamic && [\n\t\t\t\tlayoutClassNames,\n\t\t\t\t'blocks-gallery-grid',\n\t\t\t\t{\n\t\t\t\t\t[ `align${ align }` ]: align,\n\t\t\t\t\t[ `columns-${ columns }` ]:\n\t\t\t\t\t\tisFlexLayout && columns !== undefined,\n\t\t\t\t\t'columns-default': isFlexLayout && columns === undefined,\n\t\t\t\t\t'is-cropped': isFlexLayout && imageCrop,\n\t\t\t\t},\n\t\t\t]\n\t\t),\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\tdirectInsert: true,\n\t\torientation: 'horizontal',\n\t\trenderAppender: false,\n\t\t// In dynamic mode nothing may be inserted: the images are resolved from\n\t\t// the source, not authored as inner blocks. `allowedBlocks: []` enforces\n\t\t// this in every context — unlike `templateLock: 'all'`, it isn't relaxed\n\t\t// to `contentOnly` by a content-locked ancestor — so it blocks insertion\n\t\t// and drag-and-drop (via `canInsertBlockType`). It's also what opts the\n\t\t// gallery out of the List View: a block that can't be inserted into and\n\t\t// has no inner blocks has nothing to navigate or add (see\n\t\t// `shouldRenderBlockListView`). This reaches the block's list settings\n\t\t// only while the inner blocks are mounted, which is why the dynamic view\n\t\t// still renders the (empty) inner blocks.\n\t\tallowedBlocks: isDynamic ? EMPTY_ARRAY : undefined,\n\t} );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tif ( ! hasImages && ! isDynamic ) {\n\t\treturn (\n\t\t\t<div { ...innerBlocksProps }>\n\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\thandleUpload={ false }\n\t\t\t\t\ticon={ sharedIcon }\n\t\t\t\t\tlabels={ {\n\t\t\t\t\t\ttitle: __( 'Gallery' ),\n\t\t\t\t\t\tinstructions: PLACEHOLDER_TEXT,\n\t\t\t\t\t} }\n\t\t\t\t\tonSelect={ updateImages }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tmultiple\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t{ ...mediaPlaceholderProps }\n\t\t\t\t>\n\t\t\t\t\t{ /*\n\t\t\t\t\t * Entry into dynamic mode. Gated on the editing mode so it's\n\t\t\t\t\t * hidden in content-only editing (where this structural change\n\t\t\t\t\t * isn't allowed), but intentionally not hidden by\n\t\t\t\t\t * `canUseDynamicSource` the way the inspector is (see\n\t\t\t\t\t * `dynamic-gallery.jsx`): even with no\n\t\t\t\t\t * post type to preview against, the source still resolves at\n\t\t\t\t\t * render time via `get_the_ID()` (see `index.php`) — e.g. in a\n\t\t\t\t\t * template part or pattern shown on a singular page.\n\t\t\t\t\t */ }\n\t\t\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ dynamic.enableDynamicMode }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ getDynamicSource( ATTACHED_MEDIA ).title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t</MediaPlaceholder>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst hasLinkTo = linkTo && linkTo !== 'none';\n\t// Columns and crop to fit are Flex-only, so a Gallery in another layout has\n\t// viewport settings to show only when aspect ratios are available. Without\n\t// this the viewport Settings panel would render empty.\n\tconst hasViewportSettings = isFlexLayout || aspectRatioOptions.length > 1;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls\n\t\t\t\tgroup={\n\t\t\t\t\tisViewportStyleState && hasViewportSettings\n\t\t\t\t\t\t? 'viewport'\n\t\t\t\t\t\t: 'default'\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{ ! isViewportStyleState && (\n\t\t\t\t\t<GallerySourcePanel\n\t\t\t\t\t\tdynamic={ dynamic }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t\thasImages={ hasImages }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tif ( isViewportStyleState ) {\n\t\t\t\t\t\t\tsetGallerySettings( {\n\t\t\t\t\t\t\t\tcolumns: undefined,\n\t\t\t\t\t\t\t\timageCrop: undefined,\n\t\t\t\t\t\t\t\taspectRatio: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tnavigationButtonType: 'icon',\n\t\t\t\t\t\t\trandomOrder: false,\n\t\t\t\t\t\t\t...( isFlexLayout && {\n\t\t\t\t\t\t\t\tcolumns: undefined,\n\t\t\t\t\t\t\t\timageCrop: true,\n\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tsetAspectRatio( 'auto' );\n\n\t\t\t\t\t\tif ( sizeSlug !== DEFAULT_MEDIA_SIZE_SLUG ) {\n\t\t\t\t\t\t\tupdateImagesSize( DEFAULT_MEDIA_SIZE_SLUG );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( linkTarget ) {\n\t\t\t\t\t\t\ttoggleOpenInNewTab( false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t{ isFlexLayout && displayedImageCount > 1 && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\tisViewportStyleState\n\t\t\t\t\t\t\t\t\t? hasViewportColumns\n\t\t\t\t\t\t\t\t\t: !! activeColumns &&\n\t\t\t\t\t\t\t\t\t\tactiveColumns !== displayedImageCount\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDeselect={ () => setColumnsNumber( undefined ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\t\tactiveColumns\n\t\t\t\t\t\t\t\t\t\t? activeColumns\n\t\t\t\t\t\t\t\t\t\t: defaultColumnsNumber(\n\t\t\t\t\t\t\t\t\t\t\t\tdisplayedImageCount\n\t\t\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\tonChange={ setColumnsNumber }\n\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\tmax={ Math.min(\n\t\t\t\t\t\t\t\t\tMAX_COLUMNS,\n\t\t\t\t\t\t\t\t\tdisplayedImageCount\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isViewportStyleState &&\n\t\t\t\t\t\timageSizeOptions?.length > 0 && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t\tsizeSlug !== DEFAULT_MEDIA_SIZE_SLUG\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tupdateImagesSize( DEFAULT_MEDIA_SIZE_SLUG )\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<WCSelectControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Select the size of the source images.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\t\t\tonChange={ updateImagesSize }\n\t\t\t\t\t\t\t\t\thideCancelButton\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{ isFlexLayout && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Crop images to fit' ) }\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\tisViewportStyleState\n\t\t\t\t\t\t\t\t\t? hasViewportImageCrop\n\t\t\t\t\t\t\t\t\t: ! activeImageCrop\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetGallerySettings( {\n\t\t\t\t\t\t\t\t\timageCrop: isViewportStyleState\n\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t: true,\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\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Crop images to fit' ) }\n\t\t\t\t\t\t\t\tchecked={ activeImageCrop }\n\t\t\t\t\t\t\t\tonChange={ toggleImageCrop }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isViewportStyleState && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Randomize order' ) }\n\t\t\t\t\t\t\thasValue={ () => !! randomOrder }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { randomOrder: false } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Randomize order' ) }\n\t\t\t\t\t\t\t\tchecked={ !! randomOrder }\n\t\t\t\t\t\t\t\tonChange={ toggleRandomOrder }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isViewportStyleState && hasLinkTo && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Open images in new tab' ) }\n\t\t\t\t\t\t\thasValue={ () => !! linkTarget }\n\t\t\t\t\t\t\tonDeselect={ () => toggleOpenInNewTab( false ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Open images in new tab' ) }\n\t\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t\tonChange={ toggleOpenInNewTab }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ aspectRatioOptions.length > 1 && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\tisViewportStyleState\n\t\t\t\t\t\t\t\t\t? hasViewportAspectRatio\n\t\t\t\t\t\t\t\t\t: activeAspectRatio !== 'auto'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t// In a viewport state this clears the override\n\t\t\t\t\t\t\t\t// so the base ratio applies again, rather than\n\t\t\t\t\t\t\t\t// overriding it with Original.\n\t\t\t\t\t\t\t\tsetAspectRatio(\n\t\t\t\t\t\t\t\t\tisViewportStyleState ? undefined : 'auto'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<WCSelectControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Set a consistent aspect ratio for all images in the gallery.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvalue={ activeAspectRatio }\n\t\t\t\t\t\t\t\toptions={ aspectRatioOptions }\n\t\t\t\t\t\t\t\tonChange={ setAspectRatio }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isViewportStyleState &&\n\t\t\t\t\t\tlightboxSetting?.allowEditing &&\n\t\t\t\t\t\thasLightboxImages && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Navigation button type' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t\tnavigationButtonType !== 'icon'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tnavigationButtonType: 'icon',\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\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Navigation button type' ) }\n\t\t\t\t\t\t\t\t\tvalue={ navigationButtonType }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tnavigationButtonType: value,\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\tisBlock\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Adjust the appearance of buttons in the lightbox.'\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\t\t{ NAVIGATION_BUTTON_TYPE_OPTIONS.map(\n\t\t\t\t\t\t\t\t\t\t( option ) => (\n\t\t\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ option.label }\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</ToggleGroupControl>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<ToolbarDropdownMenu icon={ linkIcon } label={ __( 'Link' ) }>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ linkOptions.map( ( linkItem ) => {\n\t\t\t\t\t\t\t\tconst isOptionSelected =\n\t\t\t\t\t\t\t\t\tlinkTo === linkItem.value;\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tkey={ linkItem.value }\n\t\t\t\t\t\t\t\t\t\tisSelected={ isOptionSelected }\n\t\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t\t'components-dropdown-menu__menu-item',\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'is-active': isOptionSelected,\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\ticonPosition=\"left\"\n\t\t\t\t\t\t\t\t\t\ticon={ linkItem.icon }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetLinkTo( linkItem.value );\n\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t\tinfo={ linkItem.infoText }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ linkItem.label }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<>\n\t\t\t\t{ ! multiGallerySelection && ! isDynamic && (\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\thandleUpload={ false }\n\t\t\t\t\t\t\tonSelect={ updateImages }\n\t\t\t\t\t\t\tname={ __( 'Add' ) }\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\tmediaIds={ images\n\t\t\t\t\t\t\t\t.filter( ( image ) => image.id )\n\t\t\t\t\t\t\t\t.map( ( image ) => image.id ) }\n\t\t\t\t\t\t\taddToGallery={ hasImageIds }\n\t\t\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t) }\n\t\t\t\t<GalleryStyles\n\t\t\t\t\tstyle={ attributes.style }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisFlexLayout={ isFlexLayout }\n\t\t\t\t/>\n\t\t\t</>\n\t\t\t{ isDynamic ? (\n\t\t\t\t<GalleryDynamicView\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tdynamic={ dynamic }\n\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\tinnerBlocksProps={ innerBlocksProps }\n\t\t\t\t\tmultiGallerySelection={ multiGallerySelection }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Gallery\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tisContentLocked={ isContentLocked }\n\t\t\t\t\timages={ images }\n\t\t\t\t\tblockProps={ innerBlocksProps }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tmultiGallerySelection={ multiGallerySelection }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
5
- "mappings": ";AAAA,OAAO,UAAU;AACjB;AAAA,EACC,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,EAChC,oCAAoC;AAAA,EACpC,0CAA0C;AAAA,EAC1C;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,WAAW,SAAS,cAAc;AAC3C,SAAS,IAAI,IAAI,eAAe;AAChC,SAAS,WAAW,mBAAmB;AACvC,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,SAAS,oBAAoB;AACtC;AAAA,EACC,QAAQ;AAAA,EACR;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,OACM;AACP,SAAS,kBAAkB;AAC3B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;A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C,YAAM,mBACL,WAAW,SAAS;AACrB,aACC;AAAA,QAAC;AAAA;AAAA,UAEA,YAAa;AAAA,UACb,WAAY;AAAA,YACX;AAAA,YACA;AAAA,cACC,aAAa;AAAA,YACd;AAAA,UACD;AAAA,UACA,cAAa;AAAA,UACb,MAAO,SAAS;AAAA,UAChB,SAAU,MAAM;AACf,sBAAW,SAAS,KAAM;AAC1B,oBAAQ;AAAA,UACT;AAAA,UACA,MAAK;AAAA,UACL,MAAO,SAAS;AAAA,UAEd,mBAAS;AAAA;AAAA,QAjBL,SAAS;AAAA,MAkBhB;AAAA,IAEF,CAAE,GACH,GAEF,GACD;AAAA,IACA,iCACG;AAAA,OAAE,yBAAyB,CAAE,aAC9B,oBAAC,iBAAc,OAAM,SACpB;AAAA,QAAC;AAAA;AAAA,UACA,cAAe;AAAA,UACf,cAAe;AAAA,UACf,UAAW;AAAA,UACX,MAAO,GAAI,KAAM;AAAA,UACjB,UAAQ;AAAA,UACR,UAAW,OACT,OAAQ,CAAE,UAAW,MAAM,EAAG,EAC9B,IAAK,CAAE,UAAW,MAAM,EAAG;AAAA,UAC7B,cAAe;AAAA,UACf,SAAQ;AAAA;AAAA,MACT,GACD;AAAA,MAED;AAAA,QAAC;AAAA;AAAA,UACA,OAAQ,WAAW;AAAA,UACnB;AAAA,UACA;AAAA;AAAA,MACD;AAAA,OACD;AAAA,IACE,YACD;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD,IAEA;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACL;AAAA,QACA;AAAA,QACA,YAAa;AAAA,QACb;AAAA,QACA;AAAA;AAAA,IACD;AAAA,KAEF;AAEF;",
4
+ "sourcesContent": ["import clsx from 'clsx';\nimport {\n\tSelectControl as WCSelectControl,\n\tToggleControl,\n\tRangeControl,\n\tMenuGroup,\n\tMenuItem,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tToolbarDropdownMenu,\n\tButton,\n} from '@wordpress/components';\nimport {\n\tstore as blockEditorStore,\n\tMediaPlaceholder,\n\tInspectorControls,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tuseBlockEditingMode,\n\tBlockControls,\n\tMediaReplaceFlow,\n\tuseSettings,\n} from '@wordpress/block-editor';\nimport { useEffect, useMemo, useRef, useState } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { createBlock } from '@wordpress/blocks';\nimport { createBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\nimport {\n\tlink as linkIcon,\n\tcustomLink,\n\timage as imageIcon,\n\tlinkOff,\n\tfullscreen,\n} from '@wordpress/icons';\nimport { sharedIcon } from './shared-icon';\nimport {\n\tdefaultColumnsNumber,\n\tisGalleryFlexLayout,\n\tisObject,\n\tpickRelevantMediaFiles,\n} from './shared';\nimport { getHrefAndDestination } from './utils';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\nimport {\n\tgetUpdatedLinkTargetSettings,\n\tgetImageSizeAttributes,\n} from '../image/utils';\nimport Gallery from './gallery';\nimport {\n\tLINK_DESTINATION_ATTACHMENT,\n\tLINK_DESTINATION_MEDIA,\n\tLINK_DESTINATION_NONE,\n\tLINK_DESTINATION_LIGHTBOX,\n\tDEFAULT_MEDIA_SIZE_SLUG,\n\tMAX_COLUMNS,\n} from './constants';\nimport useImageSizes from './use-image-sizes';\nimport useGetNewImages from './use-get-new-images';\nimport useGetMedia from './use-get-media';\nimport GalleryStyles from './gallery-styles';\nimport useDynamicGallery from './use-dynamic-gallery';\nimport { GallerySourcePanel, GalleryDynamicView } from './dynamic-gallery';\nimport { SortImagesControl, SourceOrderControl } from './order-controls';\nimport {\n\tgetDynamicSource,\n\tATTACHED_MEDIA,\n\tDEFAULT_ORDERBY,\n\tDEFAULT_ORDER,\n} from './dynamic-source';\nimport { hasSortableImages, sortImageBlocks } from './order-images';\nimport {\n\tgetViewportGalleryStyle,\n\tgetUpdatedGalleryStyle,\n\tisValidGalleryColumns,\n} from './responsive-styles';\n\nconst LINK_OPTIONS = [\n\t{\n\t\ticon: customLink,\n\t\tlabel: __( 'Link images to attachment pages' ),\n\t\tvalue: LINK_DESTINATION_ATTACHMENT,\n\t\tnoticeText: __( 'Attachment Pages' ),\n\t},\n\t{\n\t\ticon: imageIcon,\n\t\tlabel: __( 'Link images to media files' ),\n\t\tvalue: LINK_DESTINATION_MEDIA,\n\t\tnoticeText: __( 'Media Files' ),\n\t},\n\t{\n\t\ticon: fullscreen,\n\t\tlabel: __( 'Enlarge on click' ),\n\t\tvalue: LINK_DESTINATION_LIGHTBOX,\n\t\tnoticeText: __( 'Lightbox effect' ),\n\t\tinfoText: __( 'Scale images with a lightbox effect' ),\n\t},\n\t{\n\t\ticon: linkOff,\n\t\tlabel: _x( 'None', 'Media item link option' ),\n\t\tvalue: LINK_DESTINATION_NONE,\n\t\tnoticeText: __( 'None' ),\n\t},\n];\nconst NAVIGATION_BUTTON_TYPE_OPTIONS = [\n\t{\n\t\tlabel: __( 'Icon' ),\n\t\tvalue: 'icon',\n\t},\n\t{\n\t\tlabel: __( 'Text' ),\n\t\tvalue: 'text',\n\t},\n\t{\n\t\tlabel: __( 'Both' ),\n\t\tvalue: 'both',\n\t},\n];\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nconst PLACEHOLDER_TEXT = __(\n\t'Drag and drop images, upload, or choose from your library.'\n);\n\nconst DEFAULT_BLOCK = { name: 'core/image' };\nconst EMPTY_ARRAY = [];\n\nexport default function GalleryEdit( props ) {\n\tconst {\n\t\tsetAttributes,\n\t\tattributes,\n\t\tclassName,\n\t\tclientId,\n\t\tisSelected,\n\t\tinsertBlocksAfter,\n\t\tisContentLocked,\n\t\tcontext,\n\t\t__unstableLayoutClassNames: layoutClassNames,\n\t} = props;\n\n\tconst postId = context?.postId;\n\tconst postType = context?.postType;\n\n\t// Entering dynamic mode is a structural change (it discards inner blocks and\n\t// switches the block's mode), so the entry point is only offered when the\n\t// block is fully editable — mirroring the dynamic view's \"Edit images\"\n\t// toolbar control. Under a content lock the mode is `'contentOnly'`/\n\t// `'disabled'`, where structural affordances are hidden.\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst [ lightboxSetting, defaultRatios, themeRatios, showDefaultRatios ] =\n\t\tuseSettings(\n\t\t\t'blocks.core/image.lightbox',\n\t\t\t'dimensions.aspectRatios.default',\n\t\t\t'dimensions.aspectRatios.theme',\n\t\t\t'dimensions.defaultAspectRatios'\n\t\t);\n\n\tconst linkOptions = ! lightboxSetting?.allowEditing\n\t\t? LINK_OPTIONS.filter(\n\t\t\t\t( option ) => option.value !== LINK_DESTINATION_LIGHTBOX\n\t\t\t)\n\t\t: LINK_OPTIONS;\n\n\tconst {\n\t\talign,\n\t\tnavigationButtonType,\n\t\tcolumns,\n\t\timageCrop,\n\t\trandomOrder,\n\t\tlinkTarget,\n\t\tlinkTo,\n\t\tsizeSlug,\n\t\taspectRatio,\n\t\tlayout,\n\t} = attributes;\n\tconst isFlexLayout = isGalleryFlexLayout( layout );\n\tconst previousLayoutRef = useRef( layout );\n\n\tconst {\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceInnerBlocks,\n\t\tupdateBlockAttributes,\n\t\tselectBlock,\n\t} = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tuseEffect( () => {\n\t\t// Variations replace the whole layout object. Carry Grid-only settings\n\t\t// across a layout type change so switching back restores them.\n\t\tconst previousLayout = previousLayoutRef.current;\n\t\tpreviousLayoutRef.current = layout;\n\n\t\tif (\n\t\t\t! isObject( previousLayout ) ||\n\t\t\t! isObject( layout ) ||\n\t\t\tpreviousLayout.type === layout.type\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst nextLayout = { ...layout };\n\t\tlet hasPreservedGridSetting = false;\n\n\t\tif (\n\t\t\t! Object.hasOwn( layout, 'columnCount' ) &&\n\t\t\tNumber.isInteger( previousLayout.columnCount ) &&\n\t\t\tpreviousLayout.columnCount > 0\n\t\t) {\n\t\t\tnextLayout.columnCount = previousLayout.columnCount;\n\t\t\thasPreservedGridSetting = true;\n\t\t}\n\n\t\tif (\n\t\t\t! Object.hasOwn( layout, 'minimumColumnWidth' ) &&\n\t\t\ttypeof previousLayout.minimumColumnWidth === 'string'\n\t\t) {\n\t\t\tnextLayout.minimumColumnWidth = previousLayout.minimumColumnWidth;\n\t\t\thasPreservedGridSetting = true;\n\t\t}\n\n\t\tif ( hasPreservedGridSetting ) {\n\t\t\tpreviousLayoutRef.current = nextLayout;\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { layout: nextLayout } );\n\t\t}\n\t}, [ layout, setAttributes, __unstableMarkNextChangeAsNotPersistent ] );\n\n\tconst {\n\t\tgetBlock,\n\t\tgetSettings,\n\t\tinnerBlockImages,\n\t\tmultiGallerySelection,\n\t\tselectedStyleState,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockName,\n\t\t\t\tgetMultiSelectedBlockClientIds,\n\t\t\t\tgetSettings: _getSettings,\n\t\t\t\tgetBlock: _getBlock,\n\t\t\t\tgetSelectedBlockStyleState,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst multiSelectedClientIds = getMultiSelectedBlockClientIds();\n\n\t\t\treturn {\n\t\t\t\tgetBlock: _getBlock,\n\t\t\t\tgetSettings: _getSettings,\n\t\t\t\tinnerBlockImages:\n\t\t\t\t\t_getBlock( clientId )?.innerBlocks ?? EMPTY_ARRAY,\n\t\t\t\tmultiGallerySelection:\n\t\t\t\t\tmultiSelectedClientIds.length &&\n\t\t\t\t\tmultiSelectedClientIds.every(\n\t\t\t\t\t\t( _clientId ) =>\n\t\t\t\t\t\t\tgetBlockName( _clientId ) === 'core/gallery'\n\t\t\t\t\t),\n\t\t\t\tselectedStyleState: getSelectedBlockStyleState( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst isViewportStyleState =\n\t\tselectedStyleState?.viewport &&\n\t\tselectedStyleState.viewport !== 'default';\n\tconst viewportStyle = isViewportStyleState\n\t\t? getViewportGalleryStyle(\n\t\t\t\tattributes.style,\n\t\t\t\tselectedStyleState.viewport\n\t\t\t)\n\t\t: {};\n\tconst baseColumns = isValidGalleryColumns( columns ) ? columns : undefined;\n\tconst baseImageCrop = typeof imageCrop === 'boolean' ? imageCrop : true;\n\t// Normalized so a Gallery with no aspect ratio and one explicitly set to\n\t// Original compare equal, and a viewport override matching either is\n\t// dropped rather than stored.\n\tconst baseAspectRatio = aspectRatio || 'auto';\n\tconst hasViewportColumns =\n\t\tisViewportStyleState &&\n\t\tObject.hasOwn( viewportStyle, 'columns' ) &&\n\t\tisValidGalleryColumns( viewportStyle.columns );\n\tconst hasViewportImageCrop =\n\t\tisViewportStyleState &&\n\t\tObject.hasOwn( viewportStyle, 'imageCrop' ) &&\n\t\ttypeof viewportStyle.imageCrop === 'boolean';\n\tconst hasViewportAspectRatio =\n\t\tisViewportStyleState &&\n\t\tObject.hasOwn( viewportStyle, 'aspectRatio' ) &&\n\t\ttypeof viewportStyle.aspectRatio === 'string' &&\n\t\t!! viewportStyle.aspectRatio;\n\tconst activeColumns = hasViewportColumns\n\t\t? viewportStyle.columns\n\t\t: baseColumns;\n\tconst activeImageCrop = hasViewportImageCrop\n\t\t? viewportStyle.imageCrop\n\t\t: baseImageCrop;\n\tconst activeAspectRatio = hasViewportAspectRatio\n\t\t? viewportStyle.aspectRatio\n\t\t: baseAspectRatio;\n\n\tconst images = useMemo(\n\t\t() =>\n\t\t\tinnerBlockImages?.map( ( block ) => ( {\n\t\t\t\tclientId: block.clientId,\n\t\t\t\tid: block.attributes.id,\n\t\t\t\turl: block.attributes.url,\n\t\t\t\tattributes: block.attributes,\n\t\t\t\tfromSavedContent: Boolean( block.originalContent ),\n\t\t\t} ) ),\n\t\t[ innerBlockImages ]\n\t);\n\n\tconst imageData = useGetMedia( innerBlockImages );\n\n\tconst newImages = useGetNewImages( images, imageData );\n\n\tconst hasImages = !! images.length;\n\tconst isDynamic = !! attributes.dynamicContent;\n\n\t// The static \"Order by\" control shows the last sort applied from it, for as\n\t// long as the images stay in the sequence that sort produced. Any other\n\t// change to the images (a drag, an addition, a removal) drops it back to\n\t// \"Custom\"; it never reports an order the user didn't choose. Nothing is\n\t// stored, so this is local state rather than an attribute.\n\tconst [ appliedSort, setAppliedSort ] = useState( null );\n\tconst currentOrder =\n\t\tappliedSort &&\n\t\tappliedSort.clientIds.length === innerBlockImages.length &&\n\t\tappliedSort.clientIds.every(\n\t\t\t( id, index ) => innerBlockImages[ index ].clientId === id\n\t\t)\n\t\t\t? appliedSort.order\n\t\t\t: null;\n\tconst canSortImages = hasSortableImages( innerBlockImages, imageData );\n\n\t// Dynamic mode (resolving images from a source instead of inner blocks):\n\t// source resolution, the editor-preview blocks, and the mode/ordering\n\t// actions.\n\tconst dynamic = useDynamicGallery( {\n\t\tattributes,\n\t\tsetAttributes,\n\t\tclientId,\n\t\tpostId,\n\t\tpostType,\n\t} );\n\n\t// State that drives counts/size options should reflect the dynamic media\n\t// when the gallery is in dynamic mode.\n\tconst displayedImageCount = isDynamic\n\t\t? dynamic.dynamicMedia.length\n\t\t: images.length;\n\n\t// Check if there is at least one image with lightbox enabled. In dynamic\n\t// mode the images inherit the gallery's link setting, so the lightbox is on\n\t// when the gallery links images to the lightbox.\n\tlet hasLightboxImages;\n\tif ( isDynamic ) {\n\t\thasLightboxImages = linkTo === LINK_DESTINATION_LIGHTBOX;\n\t} else if ( lightboxSetting?.enabled ) {\n\t\thasLightboxImages =\n\t\t\timages.filter(\n\t\t\t\t( image ) =>\n\t\t\t\t\timage.attributes?.lightbox?.enabled === undefined ||\n\t\t\t\t\timage.attributes?.lightbox?.enabled === true\n\t\t\t).length > 0;\n\t} else {\n\t\thasLightboxImages =\n\t\t\timages.filter( ( image ) => image.attributes.lightbox?.enabled )\n\t\t\t\t.length > 0;\n\t}\n\n\tconst themeOptions = themeRatios?.map( ( { name, ratio } ) => ( {\n\t\tlabel: name,\n\t\tvalue: ratio,\n\t} ) );\n\tconst defaultOptions = defaultRatios?.map( ( { name, ratio } ) => ( {\n\t\tlabel: name,\n\t\tvalue: ratio,\n\t} ) );\n\tconst aspectRatioOptions = [\n\t\t{\n\t\t\tlabel: _x(\n\t\t\t\t'Original',\n\t\t\t\t'Aspect ratio option for dimensions control'\n\t\t\t),\n\t\t\tvalue: 'auto',\n\t\t},\n\t\t...( showDefaultRatios ? defaultOptions || [] : [] ),\n\t\t...( themeOptions || [] ),\n\t];\n\n\tuseEffect( () => {\n\t\tnewImages?.forEach( ( newImage ) => {\n\t\t\t// Update the images data without creating new undo levels.\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tupdateBlockAttributes( newImage.clientId, {\n\t\t\t\t...buildImageAttributes( newImage.attributes ),\n\t\t\t\tid: newImage.id,\n\t\t\t\talign: undefined,\n\t\t\t} );\n\t\t} );\n\t}, [ newImages ] );\n\n\tconst imageSizeOptions = useImageSizes(\n\t\tisDynamic ? dynamic.dynamicMedia : imageData,\n\t\tisSelected,\n\t\tgetSettings\n\t);\n\n\t/**\n\t * Determines the image attributes that should be applied to an image block\n\t * after the gallery updates.\n\t *\n\t * The gallery will receive the full collection of images when a new image\n\t * is added. As a result we need to reapply the image's original settings if\n\t * it already existed in the gallery. If the image is in fact new, we need\n\t * to apply the gallery's current settings to the image.\n\t *\n\t * @param {Object} imageAttributes Media object for the actual image.\n\t * @return {Object} Attributes to set on the new image block.\n\t */\n\tfunction buildImageAttributes( imageAttributes ) {\n\t\tconst image = imageAttributes.id\n\t\t\t? imageData.find( ( { id } ) => id === imageAttributes.id )\n\t\t\t: null;\n\n\t\tlet newClassName;\n\t\tif ( imageAttributes.className && imageAttributes.className !== '' ) {\n\t\t\tnewClassName = imageAttributes.className;\n\t\t}\n\n\t\tlet newLinkTarget;\n\t\tif ( imageAttributes.linkTarget || imageAttributes.rel ) {\n\t\t\t// When transformed from image blocks, the link destination and rel attributes are inherited.\n\t\t\tnewLinkTarget = {\n\t\t\t\tlinkTarget: imageAttributes.linkTarget,\n\t\t\t\trel: imageAttributes.rel,\n\t\t\t};\n\t\t} else {\n\t\t\t// When an image is added, update the link destination and rel attributes according to the gallery settings\n\t\t\tnewLinkTarget = getUpdatedLinkTargetSettings(\n\t\t\t\tlinkTarget,\n\t\t\t\tattributes\n\t\t\t);\n\t\t}\n\n\t\treturn {\n\t\t\t...pickRelevantMediaFiles( image, sizeSlug ),\n\t\t\t...getHrefAndDestination(\n\t\t\t\timage,\n\t\t\t\tlinkTo,\n\t\t\t\timageAttributes?.linkDestination\n\t\t\t),\n\t\t\t...newLinkTarget,\n\t\t\tclassName: newClassName,\n\t\t\tsizeSlug,\n\t\t\tcaption:\n\t\t\t\timageAttributes.caption.length > 0\n\t\t\t\t\t? imageAttributes.caption\n\t\t\t\t\t: image.caption?.raw,\n\t\t\talt: imageAttributes.alt || image.alt_text,\n\t\t\taspectRatio: aspectRatio === 'auto' ? undefined : aspectRatio,\n\t\t\tscale: aspectRatio && aspectRatio !== 'auto' ? 'cover' : undefined,\n\t\t};\n\t}\n\n\tfunction isValidFileType( file ) {\n\t\tconst mediaTypeSelector = file.type;\n\n\t\treturn (\n\t\t\tALLOWED_MEDIA_TYPES.some(\n\t\t\t\t( mediaType ) => mediaTypeSelector?.indexOf( mediaType ) === 0\n\t\t\t) || file.blob\n\t\t);\n\t}\n\n\tfunction updateImages( selectedImages ) {\n\t\tconst newFileUploads =\n\t\t\tObject.prototype.toString.call( selectedImages ) ===\n\t\t\t'[object FileList]';\n\n\t\tconst imageArray = newFileUploads\n\t\t\t? Array.from( selectedImages ).map( ( file ) => {\n\t\t\t\t\tif ( ! file.url ) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tblob: createBlobURL( file ),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t\treturn file;\n\t\t\t\t} )\n\t\t\t: selectedImages;\n\n\t\tif ( ! imageArray.every( isValidFileType ) ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'If uploading to a gallery all files need to be image formats'\n\t\t\t\t),\n\t\t\t\t{ id: 'gallery-upload-invalid-file', type: 'snackbar' }\n\t\t\t);\n\t\t}\n\n\t\tconst processedImages = imageArray\n\t\t\t.filter( ( file ) => file.url || isValidFileType( file ) )\n\t\t\t.map( ( file ) => {\n\t\t\t\tif ( ! file.url ) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tblob: file.blob || createBlobURL( file ),\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\treturn file;\n\t\t\t} );\n\n\t\t// Because we are reusing existing innerImage blocks any reordering\n\t\t// done in the media library will be lost so we need to reapply that ordering\n\t\t// once the new image blocks are merged in with existing.\n\t\tconst newOrderMap = processedImages.reduce(\n\t\t\t( result, image, index ) => (\n\t\t\t\t( result[ image.id ] = index ),\n\t\t\t\tresult\n\t\t\t ),\n\t\t\t{}\n\t\t);\n\n\t\tconst existingImageBlocks = ! newFileUploads\n\t\t\t? innerBlockImages.filter( ( block ) =>\n\t\t\t\t\tprocessedImages.find(\n\t\t\t\t\t\t( img ) => img.id === block.attributes.id\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t: innerBlockImages;\n\n\t\tconst newImageList = processedImages.filter(\n\t\t\t( img ) =>\n\t\t\t\t! existingImageBlocks.find(\n\t\t\t\t\t( existingImg ) => img.id === existingImg.attributes.id\n\t\t\t\t)\n\t\t);\n\n\t\tconst newBlocks = newImageList.map( ( image ) => {\n\t\t\treturn createBlock( 'core/image', {\n\t\t\t\tid: image.id,\n\t\t\t\tblob: image.blob,\n\t\t\t\turl: image.url,\n\t\t\t\tcaption: image.caption,\n\t\t\t\talt: image.alt,\n\t\t\t} );\n\t\t} );\n\n\t\treplaceInnerBlocks(\n\t\t\tclientId,\n\t\t\texistingImageBlocks\n\t\t\t\t.concat( newBlocks )\n\t\t\t\t.sort(\n\t\t\t\t\t( a, b ) =>\n\t\t\t\t\t\tnewOrderMap[ a.attributes.id ] -\n\t\t\t\t\t\tnewOrderMap[ b.attributes.id ]\n\t\t\t\t)\n\t\t);\n\n\t\t// Select the first block to scroll into view when new blocks are added.\n\t\tif ( newBlocks?.length > 0 ) {\n\t\t\tselectBlock( newBlocks[ 0 ].clientId );\n\t\t}\n\t}\n\n\tfunction selectRandomOrder() {\n\t\tsetAttributes( { randomOrder: true } );\n\t}\n\n\t// Choosing any other order turns \"Random\" off. Called straight after the\n\t// edit that applies the order, and marked non-persistent so the two writes\n\t// share one undo level: a single undo restores both the order and Random.\n\tfunction clearRandomOrderAfterEdit() {\n\t\tif ( randomOrder ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { randomOrder: false } );\n\t\t}\n\t}\n\n\t// Reorders the inner image blocks in place. Left persistent on purpose so\n\t// the sort is a single undoable step.\n\tfunction sortImages( order ) {\n\t\tconst sortedBlocks = sortImageBlocks(\n\t\t\tgetBlock( clientId ).innerBlocks,\n\t\t\timageData,\n\t\t\torder\n\t\t);\n\t\treplaceInnerBlocks( clientId, sortedBlocks );\n\t\tclearRandomOrderAfterEdit();\n\t\tsetAppliedSort( {\n\t\t\torder,\n\t\t\tclientIds: sortedBlocks.map( ( block ) => block.clientId ),\n\t\t} );\n\t}\n\n\t// \"Custom\" is the order arranged in the editor: it turns Random off and\n\t// forgets any sort applied earlier, so the control reads \"Custom\" from\n\t// here on rather than that sort.\n\tfunction selectCustomOrder() {\n\t\tsetAttributes( { randomOrder: false } );\n\t\tsetAppliedSort( null );\n\t}\n\n\tfunction changeSourceOrder( { orderby, order } ) {\n\t\tdynamic.setSourceOrder( orderby, order );\n\t\tclearRandomOrderAfterEdit();\n\t}\n\n\tfunction onUploadError( message ) {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t}\n\n\tfunction setLinkTo( value ) {\n\t\tsetAttributes( { linkTo: value } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tconst image = block.attributes.id\n\t\t\t\t? imageData.find( ( { id } ) => id === block.attributes.id )\n\t\t\t\t: null;\n\n\t\t\tchangedAttributes[ block.clientId ] = getHrefAndDestination(\n\t\t\t\timage,\n\t\t\t\tvalue,\n\t\t\t\tfalse,\n\t\t\t\tblock.attributes,\n\t\t\t\tlightboxSetting\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, {\n\t\t\tuniqueByBlock: true,\n\t\t} );\n\t\tconst linkToText = [ ...linkOptions ].find(\n\t\t\t( linkType ) => linkType.value === value\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: image size settings */\n\t\t\t\t__( 'All gallery image links updated to: %s' ),\n\t\t\t\tlinkToText.noticeText\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-linkTo',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction setGallerySettings( settings ) {\n\t\tif ( ! isViewportStyleState ) {\n\t\t\tsetAttributes( settings );\n\t\t\treturn;\n\t\t}\n\n\t\tsetAttributes( {\n\t\t\tstyle: getUpdatedGalleryStyle( {\n\t\t\t\tstyle: attributes.style,\n\t\t\t\tviewport: selectedStyleState.viewport,\n\t\t\t\tbaseSettings: {\n\t\t\t\t\tcolumns: baseColumns,\n\t\t\t\t\timageCrop: baseImageCrop,\n\t\t\t\t\taspectRatio: baseAspectRatio,\n\t\t\t\t},\n\t\t\t\tsettings,\n\t\t\t} ),\n\t\t} );\n\t}\n\n\tfunction setColumnsNumber( value ) {\n\t\tsetGallerySettings( { columns: value } );\n\t}\n\n\tfunction toggleImageCrop() {\n\t\tsetGallerySettings( { imageCrop: ! activeImageCrop } );\n\t}\n\n\tfunction toggleOpenInNewTab( openInNewTab ) {\n\t\tconst newLinkTarget = openInNewTab ? '_blank' : undefined;\n\t\tsetAttributes( { linkTarget: newLinkTarget } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tchangedAttributes[ block.clientId ] = getUpdatedLinkTargetSettings(\n\t\t\t\tnewLinkTarget,\n\t\t\t\tblock.attributes\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, {\n\t\t\tuniqueByBlock: true,\n\t\t} );\n\t\tconst noticeText = openInNewTab\n\t\t\t? __( 'All gallery images updated to open in new tab' )\n\t\t\t: __( 'All gallery images updated to not open in new tab' );\n\t\tcreateSuccessNotice( noticeText, {\n\t\t\tid: 'gallery-attributes-openInNewTab',\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tfunction updateImagesSize( newSizeSlug ) {\n\t\tsetAttributes( { sizeSlug: newSizeSlug } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tconst image = block.attributes.id\n\t\t\t\t? imageData.find( ( { id } ) => id === block.attributes.id )\n\t\t\t\t: null;\n\t\t\tchangedAttributes[ block.clientId ] = getImageSizeAttributes(\n\t\t\t\timage,\n\t\t\t\tnewSizeSlug\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, {\n\t\t\tuniqueByBlock: true,\n\t\t} );\n\t\tconst imageSize = imageSizeOptions.find(\n\t\t\t( size ) => size.value === newSizeSlug\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: image size settings */\n\t\t\t\t__( 'All gallery image sizes updated to: %s' ),\n\t\t\t\timageSize?.label ?? newSizeSlug\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-sizeSlug',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\t/**\n\t * Sets the Gallery's aspect ratio.\n\t *\n\t * The base value is added to the img element as an inline\n\t * style. A viewport value is instead rendered\n\t * from the Gallery's responsive CSS, which overrides that inline style.\n\t *\n\t * @param {string|undefined} value Aspect ratio to set. In a viewport state\n\t * `'auto'` is an override that cancels the\n\t * base ratio, while `undefined` removes the\n\t * override so the base value applies again.\n\t */\n\tfunction setAspectRatio( value ) {\n\t\tif ( isViewportStyleState ) {\n\t\t\tsetGallerySettings( { aspectRatio: value } );\n\t\t} else {\n\t\t\tconst cleanValue = ! value || value === 'auto' ? undefined : value;\n\t\t\tsetAttributes( { aspectRatio: value ?? 'auto' } );\n\n\t\t\t// Update all inner image blocks with the new aspect ratio\n\t\t\tconst changedAttributes = {};\n\t\t\tconst blocks = [];\n\n\t\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\t\tblocks.push( block.clientId );\n\t\t\t\tchangedAttributes[ block.clientId ] = {\n\t\t\t\t\taspectRatio: cleanValue,\n\t\t\t\t\tscale: cleanValue ? 'cover' : undefined,\n\t\t\t\t};\n\t\t\t} );\n\n\t\t\tupdateBlockAttributes( blocks, changedAttributes, true );\n\t\t}\n\n\t\tconst noticeValue = value ?? baseAspectRatio;\n\t\tconst aspectRatioText = aspectRatioOptions.find(\n\t\t\t( option ) => option.value === noticeValue\n\t\t);\n\t\tconst noticeText = isViewportStyleState\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: 1: viewport name, 2: aspect ratio setting */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Gallery images in the %1$s viewport updated to aspect ratio: %2$s'\n\t\t\t\t\t),\n\t\t\t\t\tselectedStyleState.viewport.replace( '@', '' ),\n\t\t\t\t\taspectRatioText?.label || noticeValue\n\t\t\t\t)\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: %s: aspect ratio setting */\n\t\t\t\t\t__( 'All gallery images updated to aspect ratio: %s' ),\n\t\t\t\t\taspectRatioText?.label || noticeValue\n\t\t\t\t);\n\n\t\tcreateSuccessNotice( noticeText, {\n\t\t\tid: 'gallery-attributes-aspectRatio',\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tuseEffect( () => {\n\t\t// linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php.\n\t\tif ( ! linkTo ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tlinkTo:\n\t\t\t\t\twindow?.wp?.media?.view?.settings?.defaultProps?.link ||\n\t\t\t\t\tLINK_DESTINATION_NONE,\n\t\t\t} );\n\t\t}\n\t}, [ linkTo ] );\n\n\tconst hasImageIds = hasImages && images.some( ( image ) => !! image.id );\n\tconst imagesUploading = images.some(\n\t\t( img ) => ! img.id && img.url?.indexOf( 'blob:' ) === 0\n\t);\n\n\tconst mediaPlaceholderProps = {\n\t\taddToGallery: false,\n\t\tdisableMediaButtons: imagesUploading,\n\t\tvalue: {},\n\t};\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: clsx(\n\t\t\tclassName,\n\t\t\t'has-nested-images',\n\t\t\t`wp-block-gallery-${ clientId }`,\n\t\t\t// In dynamic mode there are no inner blocks and the gallery isn't\n\t\t\t// rendered through the `Gallery` component, so the classes that\n\t\t\t// component normally composes onto the `<figure>` (see `gallery.jsx`)\n\t\t\t// must be added here to keep the preview's flex/crop layout matching\n\t\t\t// the static gallery and the frontend.\n\t\t\tisDynamic && [\n\t\t\t\tlayoutClassNames,\n\t\t\t\t'blocks-gallery-grid',\n\t\t\t\t{\n\t\t\t\t\t[ `align${ align }` ]: align,\n\t\t\t\t\t[ `columns-${ columns }` ]:\n\t\t\t\t\t\tisFlexLayout && columns !== undefined,\n\t\t\t\t\t'columns-default': isFlexLayout && columns === undefined,\n\t\t\t\t\t'is-cropped': isFlexLayout && imageCrop,\n\t\t\t\t},\n\t\t\t]\n\t\t),\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\tdefaultBlock: DEFAULT_BLOCK,\n\t\tdirectInsert: true,\n\t\torientation: 'horizontal',\n\t\trenderAppender: false,\n\t\t// In dynamic mode nothing may be inserted: the images are resolved from\n\t\t// the source, not authored as inner blocks. `allowedBlocks: []` enforces\n\t\t// this in every context — unlike `templateLock: 'all'`, it isn't relaxed\n\t\t// to `contentOnly` by a content-locked ancestor — so it blocks insertion\n\t\t// and drag-and-drop (via `canInsertBlockType`). It's also what opts the\n\t\t// gallery out of the List View: a block that can't be inserted into and\n\t\t// has no inner blocks has nothing to navigate or add (see\n\t\t// `shouldRenderBlockListView`). This reaches the block's list settings\n\t\t// only while the inner blocks are mounted, which is why the dynamic view\n\t\t// still renders the (empty) inner blocks.\n\t\tallowedBlocks: isDynamic ? EMPTY_ARRAY : undefined,\n\t} );\n\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tif ( ! hasImages && ! isDynamic ) {\n\t\treturn (\n\t\t\t<div { ...innerBlocksProps }>\n\t\t\t\t{ innerBlocksProps.children }\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\thandleUpload={ false }\n\t\t\t\t\ticon={ sharedIcon }\n\t\t\t\t\tlabels={ {\n\t\t\t\t\t\ttitle: __( 'Gallery' ),\n\t\t\t\t\t\tinstructions: PLACEHOLDER_TEXT,\n\t\t\t\t\t} }\n\t\t\t\t\tonSelect={ updateImages }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tmultiple\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t{ ...mediaPlaceholderProps }\n\t\t\t\t>\n\t\t\t\t\t{ /*\n\t\t\t\t\t * Entry into dynamic mode. Gated on the editing mode so it's\n\t\t\t\t\t * hidden in content-only editing (where this structural change\n\t\t\t\t\t * isn't allowed), but intentionally not hidden by\n\t\t\t\t\t * `canUseDynamicSource` the way the inspector is (see\n\t\t\t\t\t * `dynamic-gallery.jsx`): even with no\n\t\t\t\t\t * post type to preview against, the source still resolves at\n\t\t\t\t\t * render time via `get_the_ID()` (see `index.php`) — e.g. in a\n\t\t\t\t\t * template part or pattern shown on a singular page.\n\t\t\t\t\t */ }\n\t\t\t\t\t{ blockEditingMode === 'default' && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ dynamic.enableDynamicMode }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ getDynamicSource( ATTACHED_MEDIA ).title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t\t</MediaPlaceholder>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst hasLinkTo = linkTo && linkTo !== 'none';\n\t// Columns and crop to fit are Flex-only, so a Gallery in another layout has\n\t// viewport settings to show only when aspect ratios are available. Without\n\t// this the viewport Settings panel would render empty.\n\tconst hasViewportSettings = isFlexLayout || aspectRatioOptions.length > 1;\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls\n\t\t\t\tgroup={\n\t\t\t\t\tisViewportStyleState && hasViewportSettings\n\t\t\t\t\t\t? 'viewport'\n\t\t\t\t\t\t: 'default'\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t{ ! isViewportStyleState && (\n\t\t\t\t\t<GallerySourcePanel\n\t\t\t\t\t\tdynamic={ dynamic }\n\t\t\t\t\t\thasImages={ hasImages }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\tif ( isViewportStyleState ) {\n\t\t\t\t\t\t\tsetGallerySettings( {\n\t\t\t\t\t\t\t\tcolumns: undefined,\n\t\t\t\t\t\t\t\timageCrop: undefined,\n\t\t\t\t\t\t\t\taspectRatio: undefined,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\tnavigationButtonType: 'icon',\n\t\t\t\t\t\t\trandomOrder: false,\n\t\t\t\t\t\t\t...( isFlexLayout && {\n\t\t\t\t\t\t\t\tcolumns: undefined,\n\t\t\t\t\t\t\t\timageCrop: true,\n\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\tsetAspectRatio( 'auto' );\n\n\t\t\t\t\t\tif ( isDynamic ) {\n\t\t\t\t\t\t\tdynamic.setSourceOrder( undefined, undefined );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( sizeSlug !== DEFAULT_MEDIA_SIZE_SLUG ) {\n\t\t\t\t\t\t\tupdateImagesSize( DEFAULT_MEDIA_SIZE_SLUG );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( linkTarget ) {\n\t\t\t\t\t\t\ttoggleOpenInNewTab( false );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t{ isFlexLayout && displayedImageCount > 1 && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\tisViewportStyleState\n\t\t\t\t\t\t\t\t\t? hasViewportColumns\n\t\t\t\t\t\t\t\t\t: !! activeColumns &&\n\t\t\t\t\t\t\t\t\t\tactiveColumns !== displayedImageCount\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDeselect={ () => setColumnsNumber( undefined ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\t\tactiveColumns\n\t\t\t\t\t\t\t\t\t\t? activeColumns\n\t\t\t\t\t\t\t\t\t\t: defaultColumnsNumber(\n\t\t\t\t\t\t\t\t\t\t\t\tdisplayedImageCount\n\t\t\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\tonChange={ setColumnsNumber }\n\t\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\t\tmax={ Math.min(\n\t\t\t\t\t\t\t\t\tMAX_COLUMNS,\n\t\t\t\t\t\t\t\t\tdisplayedImageCount\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isViewportStyleState && (\n\t\t\t\t\t\t// \"Random\" is stored in both modes. Beyond that, a\n\t\t\t\t\t\t// dynamic gallery's order is a stored query setting,\n\t\t\t\t\t\t// while a static gallery's orders are one-off actions.\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Order by' ) }\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t!! randomOrder ||\n\t\t\t\t\t\t\t\t( isDynamic &&\n\t\t\t\t\t\t\t\t\t( dynamic.sourceOrderby !==\n\t\t\t\t\t\t\t\t\t\tDEFAULT_ORDERBY ||\n\t\t\t\t\t\t\t\t\t\tdynamic.sourceOrder !==\n\t\t\t\t\t\t\t\t\t\t\tDEFAULT_ORDER ) )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\t\tif ( isDynamic ) {\n\t\t\t\t\t\t\t\t\t// Two writes, folded into one undo level.\n\t\t\t\t\t\t\t\t\tdynamic.setSourceOrder(\n\t\t\t\t\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t\t\t\t\tundefined\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tclearRandomOrderAfterEdit();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tselectCustomOrder();\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\t\t{ isDynamic ? (\n\t\t\t\t\t\t\t\t<SourceOrderControl\n\t\t\t\t\t\t\t\t\torder={ {\n\t\t\t\t\t\t\t\t\t\torderby: dynamic.sourceOrderby,\n\t\t\t\t\t\t\t\t\t\torder: dynamic.sourceOrder,\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tisRandom={ !! randomOrder }\n\t\t\t\t\t\t\t\t\tonChange={ changeSourceOrder }\n\t\t\t\t\t\t\t\t\tonSelectRandom={ selectRandomOrder }\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<SortImagesControl\n\t\t\t\t\t\t\t\t\tcurrentOrder={ currentOrder }\n\t\t\t\t\t\t\t\t\tisRandom={ !! randomOrder }\n\t\t\t\t\t\t\t\t\tcanSort={ canSortImages }\n\t\t\t\t\t\t\t\t\tonSort={ sortImages }\n\t\t\t\t\t\t\t\t\tonSelectCustom={ selectCustomOrder }\n\t\t\t\t\t\t\t\t\tonSelectRandom={ selectRandomOrder }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isViewportStyleState &&\n\t\t\t\t\t\timageSizeOptions?.length > 0 && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t\tsizeSlug !== DEFAULT_MEDIA_SIZE_SLUG\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tupdateImagesSize( DEFAULT_MEDIA_SIZE_SLUG )\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<WCSelectControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Select the size of the source images.'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\t\t\tonChange={ updateImagesSize }\n\t\t\t\t\t\t\t\t\thideCancelButton\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{ ! isViewportStyleState && hasLinkTo && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Open images in new tab' ) }\n\t\t\t\t\t\t\thasValue={ () => !! linkTarget }\n\t\t\t\t\t\t\tonDeselect={ () => toggleOpenInNewTab( false ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Open images in new tab' ) }\n\t\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t\tonChange={ toggleOpenInNewTab }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ aspectRatioOptions.length > 1 && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\tisViewportStyleState\n\t\t\t\t\t\t\t\t\t? hasViewportAspectRatio\n\t\t\t\t\t\t\t\t\t: activeAspectRatio !== 'auto'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t// In a viewport state this clears the override\n\t\t\t\t\t\t\t\t// so the base ratio applies again, rather than\n\t\t\t\t\t\t\t\t// overriding it with Original.\n\t\t\t\t\t\t\t\tsetAspectRatio(\n\t\t\t\t\t\t\t\t\tisViewportStyleState ? undefined : 'auto'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<WCSelectControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Aspect ratio' ) }\n\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t'Set a consistent aspect ratio for all images in the gallery.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tvalue={ activeAspectRatio }\n\t\t\t\t\t\t\t\toptions={ aspectRatioOptions }\n\t\t\t\t\t\t\t\tonChange={ setAspectRatio }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isFlexLayout && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\tlabel={ __( 'Crop images to fit' ) }\n\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\tisViewportStyleState\n\t\t\t\t\t\t\t\t\t? hasViewportImageCrop\n\t\t\t\t\t\t\t\t\t: ! activeImageCrop\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetGallerySettings( {\n\t\t\t\t\t\t\t\t\timageCrop: isViewportStyleState\n\t\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t\t: true,\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\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Crop images to fit' ) }\n\t\t\t\t\t\t\t\tchecked={ activeImageCrop }\n\t\t\t\t\t\t\t\tonChange={ toggleImageCrop }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! isViewportStyleState &&\n\t\t\t\t\t\tlightboxSetting?.allowEditing &&\n\t\t\t\t\t\thasLightboxImages && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Navigation button type' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () =>\n\t\t\t\t\t\t\t\t\tnavigationButtonType !== 'icon'\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tnavigationButtonType: 'icon',\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\t\t<ToggleGroupControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Navigation button type' ) }\n\t\t\t\t\t\t\t\t\tvalue={ navigationButtonType }\n\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\t\tnavigationButtonType: value,\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\tisBlock\n\t\t\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t\t\t'Adjust the appearance of buttons in the lightbox.'\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\t\t{ NAVIGATION_BUTTON_TYPE_OPTIONS.map(\n\t\t\t\t\t\t\t\t\t\t( option ) => (\n\t\t\t\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ option.value }\n\t\t\t\t\t\t\t\t\t\t\t\tvalue={ option.value }\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={ option.label }\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</ToggleGroupControl>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<ToolbarDropdownMenu icon={ linkIcon } label={ __( 'Link' ) }>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t{ linkOptions.map( ( linkItem ) => {\n\t\t\t\t\t\t\t\tconst isOptionSelected =\n\t\t\t\t\t\t\t\t\tlinkTo === linkItem.value;\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tkey={ linkItem.value }\n\t\t\t\t\t\t\t\t\t\tisSelected={ isOptionSelected }\n\t\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t\t'components-dropdown-menu__menu-item',\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'is-active': isOptionSelected,\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\ticonPosition=\"left\"\n\t\t\t\t\t\t\t\t\t\ticon={ linkItem.icon }\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetLinkTo( linkItem.value );\n\t\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t\trole=\"menuitemradio\"\n\t\t\t\t\t\t\t\t\t\tinfo={ linkItem.infoText }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ linkItem.label }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t) }\n\t\t\t\t</ToolbarDropdownMenu>\n\t\t\t</BlockControls>\n\t\t\t<>\n\t\t\t\t{ ! multiGallerySelection && ! isDynamic && (\n\t\t\t\t\t<BlockControls group=\"other\">\n\t\t\t\t\t\t<MediaReplaceFlow\n\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\thandleUpload={ false }\n\t\t\t\t\t\t\tonSelect={ updateImages }\n\t\t\t\t\t\t\tname={ __( 'Add' ) }\n\t\t\t\t\t\t\tmultiple\n\t\t\t\t\t\t\tmediaIds={ images\n\t\t\t\t\t\t\t\t.filter( ( image ) => image.id )\n\t\t\t\t\t\t\t\t.map( ( image ) => image.id ) }\n\t\t\t\t\t\t\taddToGallery={ hasImageIds }\n\t\t\t\t\t\t\tvariant=\"toolbar\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t) }\n\t\t\t\t<GalleryStyles\n\t\t\t\t\tstyle={ attributes.style }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tisFlexLayout={ isFlexLayout }\n\t\t\t\t/>\n\t\t\t</>\n\t\t\t{ isDynamic ? (\n\t\t\t\t<GalleryDynamicView\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tdynamic={ dynamic }\n\t\t\t\t\tblockProps={ blockProps }\n\t\t\t\t\tinnerBlocksProps={ innerBlocksProps }\n\t\t\t\t\tmultiGallerySelection={ multiGallerySelection }\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Gallery\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tisContentLocked={ isContentLocked }\n\t\t\t\t\timages={ images }\n\t\t\t\t\tblockProps={ innerBlocksProps }\n\t\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t\t\tmultiGallerySelection={ multiGallerySelection }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
5
+ "mappings": ";AAAA,OAAO,UAAU;AACjB;AAAA,EACC,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,EAChC,oCAAoC;AAAA,EACpC,0CAA0C;AAAA,EAC1C;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,WAAW,SAAS,QAAQ,gBAAgB;AACrD,SAAS,IAAI,IAAI,eAAe;AAChC,SAAS,WAAW,mBAAmB;AACvC,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAC9B,SAAS,SAAS,oBAAoB;AACtC;AAAA,EACC,QAAQ;AAAA,EACR;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,OACM;AACP,SAAS,kBAAkB;AAC3B;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,6BAA6B;AACtC,SAAS,sCAAsC;AAC/C;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,OAAO,aAAa;AACpB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,OAAO,mBAAmB;AAC1B,OAAO,qBAAqB;AAC5B,OAAO,iBAAiB;AACxB,OAAO,mBAAmB;AAC1B,OAAO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