@wordpress/block-library 11.0.0 → 11.1.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 (811) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +7 -7
  3. package/build/accordion/block.json +4 -1
  4. package/build/accordion-item/block.json +7 -1
  5. package/build/accordion-panel/block.json +9 -1
  6. package/build/archives/block.json +9 -0
  7. package/build/archives/edit.cjs.map +3 -3
  8. package/build/audio/block.json +8 -0
  9. package/build/audio/edit.cjs.map +3 -3
  10. package/build/avatar/hooks.cjs.map +2 -2
  11. package/build/breadcrumbs/block.json +3 -0
  12. package/build/breadcrumbs/edit.cjs.map +3 -3
  13. package/build/button/edit.cjs.map +2 -2
  14. package/build/buttons/block.json +9 -0
  15. package/build/categories/block.json +12 -1
  16. package/build/categories/edit.cjs.map +3 -3
  17. package/build/code/block.json +10 -0
  18. package/build/code/save.cjs.map +2 -2
  19. package/build/column/block.json +9 -0
  20. package/build/columns/block.json +9 -0
  21. package/build/comment-author-name/block.json +3 -0
  22. package/build/comment-content/block.json +5 -0
  23. package/build/comment-date/block.json +3 -0
  24. package/build/comment-edit-link/block.json +3 -0
  25. package/build/comment-reply-link/block.json +3 -0
  26. package/build/comment-template/hooks.cjs.map +2 -2
  27. package/build/comments/block.json +10 -0
  28. package/build/comments-pagination/block.json +3 -0
  29. package/build/comments-pagination-next/block.json +3 -0
  30. package/build/comments-pagination-numbers/block.json +3 -0
  31. package/build/comments-pagination-previous/block.json +6 -0
  32. package/build/comments-title/block.json +3 -0
  33. package/build/cover/edit/index.cjs +4 -1
  34. package/build/cover/edit/index.cjs.map +2 -2
  35. package/build/cover/edit/inspector-controls.cjs +52 -13
  36. package/build/cover/edit/inspector-controls.cjs.map +2 -2
  37. package/build/cover/transforms.cjs.map +2 -2
  38. package/build/details/block.json +12 -0
  39. package/build/details/index.cjs.map +2 -2
  40. package/build/embed/embed-controls.cjs.map +2 -2
  41. package/build/file/block.json +9 -0
  42. package/build/file/deprecated.cjs.map +2 -2
  43. package/build/file/edit.cjs.map +2 -2
  44. package/build/file/inspector.cjs.map +3 -3
  45. package/build/file/save.cjs.map +2 -2
  46. package/build/footnotes/block.json +10 -0
  47. package/build/footnotes/edit.cjs.map +2 -2
  48. package/build/gallery/block.json +9 -0
  49. package/build/gallery/dynamic-gallery.cjs.map +3 -3
  50. package/build/gallery/edit.cjs +65 -39
  51. package/build/gallery/edit.cjs.map +3 -3
  52. package/build/gallery/{flex-styles.cjs → gallery-styles.cjs} +31 -32
  53. package/build/gallery/gallery-styles.cjs.map +7 -0
  54. package/build/gallery/responsive-styles.cjs +27 -5
  55. package/build/gallery/responsive-styles.cjs.map +2 -2
  56. package/build/group/block.json +1 -0
  57. package/build/heading/block.json +11 -0
  58. package/build/heading/index.cjs.map +2 -2
  59. package/build/home-link/block.json +18 -0
  60. package/build/home-link/edit.cjs.map +3 -3
  61. package/build/html/modal.cjs +3 -6
  62. package/build/html/modal.cjs.map +2 -2
  63. package/build/image/edit.cjs.map +2 -2
  64. package/build/image/image.cjs +10 -8
  65. package/build/image/image.cjs.map +3 -3
  66. package/build/image/use-open-image-media-editor-modal.cjs +20 -0
  67. package/build/image/use-open-image-media-editor-modal.cjs.map +2 -2
  68. package/build/index.cjs.map +2 -2
  69. package/build/latest-comments/block.json +10 -0
  70. package/build/latest-comments/edit.cjs.map +3 -3
  71. package/build/latest-posts/block.json +10 -0
  72. package/build/latest-posts/edit.cjs.map +2 -2
  73. package/build/list/ordered-list-settings.cjs.map +3 -3
  74. package/build/list-item/hooks/use-enter.cjs.map +2 -2
  75. package/build/loginout/block.json +10 -0
  76. package/build/math/block.json +12 -0
  77. package/build/math/deprecated.cjs +29 -12
  78. package/build/math/deprecated.cjs.map +2 -2
  79. package/build/math/edit.cjs +67 -46
  80. package/build/math/edit.cjs.map +2 -2
  81. package/build/math/save.cjs +2 -2
  82. package/build/math/save.cjs.map +2 -2
  83. package/build/media-text/block.json +1 -0
  84. package/build/media-text/constants.cjs +3 -0
  85. package/build/media-text/constants.cjs.map +2 -2
  86. package/build/media-text/deprecated.cjs.map +2 -2
  87. package/build/media-text/edit.cjs +40 -0
  88. package/build/media-text/edit.cjs.map +3 -3
  89. package/build/media-text/image-fill.cjs.map +2 -2
  90. package/build/media-text/media-container.cjs +3 -3
  91. package/build/media-text/media-container.cjs.map +2 -2
  92. package/build/navigation/edit/index.cjs +1 -4
  93. package/build/navigation/edit/index.cjs.map +2 -2
  94. package/build/navigation/edit/menu-inspector-controls.cjs.map +2 -2
  95. package/build/navigation/edit/overlay-template-part-selector.cjs.map +3 -3
  96. package/build/navigation/edit/responsive-wrapper.cjs.map +2 -2
  97. package/build/navigation/edit/use-generate-default-navigation-title.cjs.map +2 -2
  98. package/build/navigation/view.cjs +2 -2
  99. package/build/navigation/view.cjs.map +2 -2
  100. package/build/navigation-link/edit.cjs.map +2 -2
  101. package/build/navigation-link/link-ui/page-creator.cjs.map +3 -3
  102. package/build/navigation-link/shared/controls.cjs.map +3 -3
  103. package/build/navigation-link/shared/invalid-draft-display.cjs.map +2 -2
  104. package/build/navigation-link/shared/use-link-preview.cjs +13 -13
  105. package/build/navigation-link/shared/use-link-preview.cjs.map +2 -2
  106. package/build/navigation-overlay-close/block.json +7 -0
  107. package/build/navigation-submenu/block.json +6 -0
  108. package/build/navigation-submenu/edit.cjs +9 -1
  109. package/build/navigation-submenu/edit.cjs.map +3 -3
  110. package/build/page-list/block.json +10 -0
  111. package/build/paragraph/block.json +1 -0
  112. package/build/paragraph/edit.cjs +1 -2
  113. package/build/paragraph/edit.cjs.map +2 -2
  114. package/build/paragraph/index.cjs +6 -0
  115. package/build/paragraph/index.cjs.map +3 -3
  116. package/build/playlist/block.json +1 -0
  117. package/build/playlist/edit.cjs +2 -1
  118. package/build/playlist/edit.cjs.map +3 -3
  119. package/build/post-author/edit.cjs.map +3 -3
  120. package/build/post-author-biography/block.json +4 -0
  121. package/build/post-author-name/block.json +5 -0
  122. package/build/post-author-name/edit.cjs.map +2 -2
  123. package/build/post-comments-count/block.json +3 -0
  124. package/build/post-comments-form/block.json +10 -0
  125. package/build/post-content/block.json +3 -0
  126. package/build/post-date/block.json +3 -0
  127. package/build/post-date/edit.cjs.map +2 -2
  128. package/build/post-excerpt/block.json +6 -0
  129. package/build/post-excerpt/edit.cjs.map +2 -2
  130. package/build/post-featured-image/edit.cjs +11 -9
  131. package/build/post-featured-image/edit.cjs.map +2 -2
  132. package/build/post-navigation-link/block.json +30 -0
  133. package/build/post-navigation-link/edit.cjs +13 -2
  134. package/build/post-navigation-link/edit.cjs.map +3 -3
  135. package/build/post-template/block.json +13 -1
  136. package/build/post-terms/block.json +6 -0
  137. package/build/post-time-to-read/block.json +6 -0
  138. package/build/post-time-to-read/edit.cjs.map +2 -2
  139. package/build/post-title/block.json +10 -0
  140. package/build/preformatted/block.json +7 -0
  141. package/build/pullquote/block.json +1 -0
  142. package/build/pullquote/deprecated.cjs.map +2 -2
  143. package/build/query/deprecated.cjs.map +2 -2
  144. package/build/query/edit/inspector-controls/index.cjs.map +3 -3
  145. package/build/query/edit/inspector-controls/order-control.cjs.map +3 -3
  146. package/build/query/edit/inspector-controls/sticky-control.cjs.map +3 -3
  147. package/build/query/view.cjs.map +2 -2
  148. package/build/query-no-results/block.json +10 -2
  149. package/build/query-pagination/block.json +3 -0
  150. package/build/query-pagination-next/block.json +3 -0
  151. package/build/query-pagination-numbers/block.json +3 -0
  152. package/build/query-pagination-previous/block.json +3 -0
  153. package/build/query-title/block.json +3 -0
  154. package/build/query-title/use-archive-label.cjs.map +2 -2
  155. package/build/query-total/block.json +6 -0
  156. package/build/quote/block.json +1 -0
  157. package/build/quote/deprecated.cjs.map +2 -2
  158. package/build/quote/transforms.cjs.map +2 -2
  159. package/build/read-more/block.json +6 -0
  160. package/build/rss/block.json +6 -0
  161. package/build/search/edit.cjs.map +3 -3
  162. package/build/separator/edit.cjs.map +3 -3
  163. package/build/site-tagline/block.json +8 -1
  164. package/build/site-title/block.json +7 -1
  165. package/build/social-links/block.json +3 -0
  166. package/build/social-links/edit.cjs +2 -3
  167. package/build/social-links/edit.cjs.map +3 -3
  168. package/build/tab-panel/block.json +25 -0
  169. package/build/tab-panel/controls.cjs.map +3 -3
  170. package/build/tab-panels/block.json +18 -1
  171. package/build/table/state.cjs.map +2 -2
  172. package/build/table-of-contents/block.json +7 -0
  173. package/build/table-of-contents/edit.cjs.map +3 -3
  174. package/build/table-of-contents/utils.cjs.map +2 -2
  175. package/build/tabs/block.json +24 -1
  176. package/build/tabs/use-tab-actions.cjs.map +2 -2
  177. package/build/tag-cloud/block.json +19 -0
  178. package/build/tag-cloud/edit.cjs.map +3 -3
  179. package/build/template-part/edit/advanced-controls.cjs.map +3 -3
  180. package/build/template-part/edit/import-controls.cjs.map +3 -3
  181. package/build/template-part/edit/index.cjs.map +2 -2
  182. package/build/template-part/edit/inner-blocks.cjs.map +2 -2
  183. package/build/template-part/edit/placeholder.cjs.map +2 -2
  184. package/build/template-part/edit/selection-modal.cjs.map +1 -1
  185. package/build/term-count/block.json +7 -0
  186. package/build/term-count/use-term-count.cjs.map +2 -2
  187. package/build/term-description/block.json +9 -0
  188. package/build/term-description/use-term-description.cjs.map +2 -2
  189. package/build/term-name/block.json +10 -0
  190. package/build/term-name/use-term-name.cjs.map +2 -2
  191. package/build/term-template/block.json +10 -1
  192. package/build/terms-query/edit/inspector-controls/index.cjs.map +2 -2
  193. package/build/terms-query/edit/inspector-controls/inherit-control.cjs.map +2 -2
  194. package/build/terms-query/edit/inspector-controls/order-control.cjs.map +3 -3
  195. package/build/terms-query/edit/inspector-controls/taxonomy-control.cjs.map +3 -3
  196. package/build/utils/hooks.cjs.map +2 -2
  197. package/build/utils/media-control.cjs +5 -1
  198. package/build/utils/media-control.cjs.map +2 -2
  199. package/build/utils/poster-image.cjs.map +2 -2
  200. package/build/utils/search-patterns.cjs +7 -43
  201. package/build/utils/search-patterns.cjs.map +3 -3
  202. package/build/utils/style-state.cjs +4 -6
  203. package/build/utils/style-state.cjs.map +2 -2
  204. package/build/verse/block.json +1 -0
  205. package/build/video/block.json +6 -0
  206. package/build/video/edit-common-settings.cjs.map +3 -3
  207. package/build/video/edit.cjs +23 -15
  208. package/build/video/edit.cjs.map +3 -3
  209. package/build/video/index.cjs +0 -2
  210. package/build/video/index.cjs.map +3 -3
  211. package/build/video/save.cjs +5 -1
  212. package/build/video/save.cjs.map +3 -3
  213. package/build/video/tracks-editor.cjs.map +3 -3
  214. package/build-module/accordion/block.json +4 -1
  215. package/build-module/accordion-item/block.json +7 -1
  216. package/build-module/accordion-panel/block.json +9 -1
  217. package/build-module/archives/block.json +9 -0
  218. package/build-module/archives/edit.mjs +2 -2
  219. package/build-module/archives/edit.mjs.map +2 -2
  220. package/build-module/audio/block.json +8 -0
  221. package/build-module/audio/edit.mjs +2 -2
  222. package/build-module/audio/edit.mjs.map +2 -2
  223. package/build-module/avatar/hooks.mjs.map +2 -2
  224. package/build-module/breadcrumbs/block.json +3 -0
  225. package/build-module/breadcrumbs/edit.mjs +3 -3
  226. package/build-module/breadcrumbs/edit.mjs.map +2 -2
  227. package/build-module/button/edit.mjs.map +2 -2
  228. package/build-module/buttons/block.json +9 -0
  229. package/build-module/categories/block.json +12 -1
  230. package/build-module/categories/edit.mjs +2 -2
  231. package/build-module/categories/edit.mjs.map +2 -2
  232. package/build-module/code/block.json +10 -0
  233. package/build-module/code/save.mjs.map +2 -2
  234. package/build-module/column/block.json +9 -0
  235. package/build-module/columns/block.json +9 -0
  236. package/build-module/comment-author-name/block.json +3 -0
  237. package/build-module/comment-content/block.json +5 -0
  238. package/build-module/comment-date/block.json +3 -0
  239. package/build-module/comment-edit-link/block.json +3 -0
  240. package/build-module/comment-reply-link/block.json +3 -0
  241. package/build-module/comment-template/hooks.mjs.map +2 -2
  242. package/build-module/comments/block.json +10 -0
  243. package/build-module/comments-pagination/block.json +3 -0
  244. package/build-module/comments-pagination-next/block.json +3 -0
  245. package/build-module/comments-pagination-numbers/block.json +3 -0
  246. package/build-module/comments-pagination-previous/block.json +6 -0
  247. package/build-module/comments-title/block.json +3 -0
  248. package/build-module/cover/edit/index.mjs +4 -1
  249. package/build-module/cover/edit/index.mjs.map +2 -2
  250. package/build-module/cover/edit/inspector-controls.mjs +57 -14
  251. package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
  252. package/build-module/cover/transforms.mjs.map +2 -2
  253. package/build-module/details/block.json +12 -0
  254. package/build-module/details/index.mjs.map +2 -2
  255. package/build-module/embed/embed-controls.mjs.map +2 -2
  256. package/build-module/file/block.json +9 -0
  257. package/build-module/file/deprecated.mjs.map +2 -2
  258. package/build-module/file/edit.mjs.map +2 -2
  259. package/build-module/file/inspector.mjs +2 -2
  260. package/build-module/file/inspector.mjs.map +2 -2
  261. package/build-module/file/save.mjs.map +2 -2
  262. package/build-module/footnotes/block.json +10 -0
  263. package/build-module/footnotes/edit.mjs.map +2 -2
  264. package/build-module/gallery/block.json +9 -0
  265. package/build-module/gallery/dynamic-gallery.mjs +2 -2
  266. package/build-module/gallery/dynamic-gallery.mjs.map +2 -2
  267. package/build-module/gallery/edit.mjs +68 -42
  268. package/build-module/gallery/edit.mjs.map +2 -2
  269. package/build-module/gallery/{flex-styles.mjs → gallery-styles.mjs} +29 -30
  270. package/build-module/gallery/gallery-styles.mjs.map +7 -0
  271. package/build-module/gallery/responsive-styles.mjs +25 -4
  272. package/build-module/gallery/responsive-styles.mjs.map +2 -2
  273. package/build-module/group/block.json +1 -0
  274. package/build-module/heading/block.json +11 -0
  275. package/build-module/heading/index.mjs.map +2 -2
  276. package/build-module/home-link/block.json +18 -0
  277. package/build-module/home-link/edit.mjs +2 -2
  278. package/build-module/home-link/edit.mjs.map +2 -2
  279. package/build-module/html/modal.mjs +3 -6
  280. package/build-module/html/modal.mjs.map +2 -2
  281. package/build-module/image/edit.mjs.map +2 -2
  282. package/build-module/image/image.mjs +12 -10
  283. package/build-module/image/image.mjs.map +2 -2
  284. package/build-module/image/use-open-image-media-editor-modal.mjs +20 -0
  285. package/build-module/image/use-open-image-media-editor-modal.mjs.map +2 -2
  286. package/build-module/index.mjs.map +2 -2
  287. package/build-module/latest-comments/block.json +10 -0
  288. package/build-module/latest-comments/edit.mjs +2 -2
  289. package/build-module/latest-comments/edit.mjs.map +2 -2
  290. package/build-module/latest-posts/block.json +10 -0
  291. package/build-module/latest-posts/edit.mjs.map +2 -2
  292. package/build-module/list/ordered-list-settings.mjs +2 -2
  293. package/build-module/list/ordered-list-settings.mjs.map +2 -2
  294. package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
  295. package/build-module/loginout/block.json +10 -0
  296. package/build-module/math/block.json +12 -0
  297. package/build-module/math/deprecated.mjs +29 -12
  298. package/build-module/math/deprecated.mjs.map +2 -2
  299. package/build-module/math/edit.mjs +68 -47
  300. package/build-module/math/edit.mjs.map +2 -2
  301. package/build-module/math/save.mjs +2 -2
  302. package/build-module/math/save.mjs.map +2 -2
  303. package/build-module/media-text/block.json +1 -0
  304. package/build-module/media-text/constants.mjs +2 -0
  305. package/build-module/media-text/constants.mjs.map +2 -2
  306. package/build-module/media-text/deprecated.mjs.map +2 -2
  307. package/build-module/media-text/edit.mjs +42 -1
  308. package/build-module/media-text/edit.mjs.map +2 -2
  309. package/build-module/media-text/image-fill.mjs.map +2 -2
  310. package/build-module/media-text/media-container.mjs +1 -1
  311. package/build-module/media-text/media-container.mjs.map +2 -2
  312. package/build-module/navigation/edit/index.mjs +1 -4
  313. package/build-module/navigation/edit/index.mjs.map +2 -2
  314. package/build-module/navigation/edit/menu-inspector-controls.mjs.map +2 -2
  315. package/build-module/navigation/edit/overlay-template-part-selector.mjs +2 -2
  316. package/build-module/navigation/edit/overlay-template-part-selector.mjs.map +2 -2
  317. package/build-module/navigation/edit/responsive-wrapper.mjs.map +2 -2
  318. package/build-module/navigation/edit/use-generate-default-navigation-title.mjs.map +2 -2
  319. package/build-module/navigation/view.mjs +2 -2
  320. package/build-module/navigation/view.mjs.map +2 -2
  321. package/build-module/navigation-link/edit.mjs.map +2 -2
  322. package/build-module/navigation-link/link-ui/page-creator.mjs +2 -2
  323. package/build-module/navigation-link/link-ui/page-creator.mjs.map +2 -2
  324. package/build-module/navigation-link/shared/controls.mjs +2 -2
  325. package/build-module/navigation-link/shared/controls.mjs.map +2 -2
  326. package/build-module/navigation-link/shared/invalid-draft-display.mjs.map +2 -2
  327. package/build-module/navigation-link/shared/use-link-preview.mjs +13 -13
  328. package/build-module/navigation-link/shared/use-link-preview.mjs.map +2 -2
  329. package/build-module/navigation-overlay-close/block.json +7 -0
  330. package/build-module/navigation-submenu/block.json +6 -0
  331. package/build-module/navigation-submenu/edit.mjs +11 -2
  332. package/build-module/navigation-submenu/edit.mjs.map +2 -2
  333. package/build-module/page-list/block.json +10 -0
  334. package/build-module/paragraph/block.json +1 -0
  335. package/build-module/paragraph/edit.mjs +1 -2
  336. package/build-module/paragraph/edit.mjs.map +2 -2
  337. package/build-module/paragraph/index.mjs +6 -0
  338. package/build-module/paragraph/index.mjs.map +2 -2
  339. package/build-module/playlist/block.json +1 -0
  340. package/build-module/playlist/edit.mjs +5 -4
  341. package/build-module/playlist/edit.mjs.map +2 -2
  342. package/build-module/post-author/edit.mjs +2 -2
  343. package/build-module/post-author/edit.mjs.map +2 -2
  344. package/build-module/post-author-biography/block.json +4 -0
  345. package/build-module/post-author-name/block.json +5 -0
  346. package/build-module/post-author-name/edit.mjs.map +2 -2
  347. package/build-module/post-comments-count/block.json +3 -0
  348. package/build-module/post-comments-form/block.json +10 -0
  349. package/build-module/post-content/block.json +3 -0
  350. package/build-module/post-date/block.json +3 -0
  351. package/build-module/post-date/edit.mjs.map +2 -2
  352. package/build-module/post-excerpt/block.json +6 -0
  353. package/build-module/post-excerpt/edit.mjs.map +2 -2
  354. package/build-module/post-featured-image/edit.mjs +11 -9
  355. package/build-module/post-featured-image/edit.mjs.map +2 -2
  356. package/build-module/post-navigation-link/block.json +30 -0
  357. package/build-module/post-navigation-link/edit.mjs +19 -5
  358. package/build-module/post-navigation-link/edit.mjs.map +2 -2
  359. package/build-module/post-template/block.json +13 -1
  360. package/build-module/post-terms/block.json +6 -0
  361. package/build-module/post-time-to-read/block.json +6 -0
  362. package/build-module/post-time-to-read/edit.mjs.map +2 -2
  363. package/build-module/post-title/block.json +10 -0
  364. package/build-module/preformatted/block.json +7 -0
  365. package/build-module/pullquote/block.json +1 -0
  366. package/build-module/pullquote/deprecated.mjs.map +2 -2
  367. package/build-module/query/deprecated.mjs.map +2 -2
  368. package/build-module/query/edit/inspector-controls/index.mjs +2 -2
  369. package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
  370. package/build-module/query/edit/inspector-controls/order-control.mjs +2 -2
  371. package/build-module/query/edit/inspector-controls/order-control.mjs.map +2 -2
  372. package/build-module/query/edit/inspector-controls/sticky-control.mjs +2 -2
  373. package/build-module/query/edit/inspector-controls/sticky-control.mjs.map +2 -2
  374. package/build-module/query/view.mjs.map +2 -2
  375. package/build-module/query-no-results/block.json +10 -2
  376. package/build-module/query-pagination/block.json +3 -0
  377. package/build-module/query-pagination-next/block.json +3 -0
  378. package/build-module/query-pagination-numbers/block.json +3 -0
  379. package/build-module/query-pagination-previous/block.json +3 -0
  380. package/build-module/query-title/block.json +3 -0
  381. package/build-module/query-title/use-archive-label.mjs.map +2 -2
  382. package/build-module/query-total/block.json +6 -0
  383. package/build-module/quote/block.json +1 -0
  384. package/build-module/quote/deprecated.mjs.map +2 -2
  385. package/build-module/quote/transforms.mjs.map +2 -2
  386. package/build-module/read-more/block.json +6 -0
  387. package/build-module/rss/block.json +6 -0
  388. package/build-module/search/edit.mjs +3 -3
  389. package/build-module/search/edit.mjs.map +2 -2
  390. package/build-module/separator/edit.mjs +5 -2
  391. package/build-module/separator/edit.mjs.map +2 -2
  392. package/build-module/site-tagline/block.json +8 -1
  393. package/build-module/site-title/block.json +7 -1
  394. package/build-module/social-links/block.json +3 -0
  395. package/build-module/social-links/edit.mjs +4 -5
  396. package/build-module/social-links/edit.mjs.map +2 -2
  397. package/build-module/tab-panel/block.json +25 -0
  398. package/build-module/tab-panel/controls.mjs +2 -2
  399. package/build-module/tab-panel/controls.mjs.map +2 -2
  400. package/build-module/tab-panels/block.json +18 -1
  401. package/build-module/table/state.mjs.map +2 -2
  402. package/build-module/table-of-contents/block.json +7 -0
  403. package/build-module/table-of-contents/edit.mjs +2 -2
  404. package/build-module/table-of-contents/edit.mjs.map +2 -2
  405. package/build-module/table-of-contents/utils.mjs.map +2 -2
  406. package/build-module/tabs/block.json +24 -1
  407. package/build-module/tabs/use-tab-actions.mjs.map +2 -2
  408. package/build-module/tag-cloud/block.json +19 -0
  409. package/build-module/tag-cloud/edit.mjs +2 -2
  410. package/build-module/tag-cloud/edit.mjs.map +2 -2
  411. package/build-module/template-part/edit/advanced-controls.mjs +5 -2
  412. package/build-module/template-part/edit/advanced-controls.mjs.map +2 -2
  413. package/build-module/template-part/edit/import-controls.mjs +2 -2
  414. package/build-module/template-part/edit/import-controls.mjs.map +2 -2
  415. package/build-module/template-part/edit/index.mjs.map +2 -2
  416. package/build-module/template-part/edit/inner-blocks.mjs.map +2 -2
  417. package/build-module/template-part/edit/placeholder.mjs.map +2 -2
  418. package/build-module/template-part/edit/selection-modal.mjs.map +1 -1
  419. package/build-module/term-count/block.json +7 -0
  420. package/build-module/term-count/use-term-count.mjs.map +2 -2
  421. package/build-module/term-description/block.json +9 -0
  422. package/build-module/term-description/use-term-description.mjs.map +2 -2
  423. package/build-module/term-name/block.json +10 -0
  424. package/build-module/term-name/use-term-name.mjs.map +2 -2
  425. package/build-module/term-template/block.json +10 -1
  426. package/build-module/terms-query/edit/inspector-controls/index.mjs.map +2 -2
  427. package/build-module/terms-query/edit/inspector-controls/inherit-control.mjs.map +2 -2
  428. package/build-module/terms-query/edit/inspector-controls/order-control.mjs +2 -2
  429. package/build-module/terms-query/edit/inspector-controls/order-control.mjs.map +2 -2
  430. package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs +2 -2
  431. package/build-module/terms-query/edit/inspector-controls/taxonomy-control.mjs.map +2 -2
  432. package/build-module/utils/hooks.mjs.map +2 -2
  433. package/build-module/utils/media-control.mjs +5 -1
  434. package/build-module/utils/media-control.mjs.map +2 -2
  435. package/build-module/utils/poster-image.mjs.map +2 -2
  436. package/build-module/utils/search-patterns.mjs +7 -32
  437. package/build-module/utils/search-patterns.mjs.map +2 -2
  438. package/build-module/utils/style-state.mjs +6 -4
  439. package/build-module/utils/style-state.mjs.map +2 -2
  440. package/build-module/verse/block.json +1 -0
  441. package/build-module/video/block.json +6 -0
  442. package/build-module/video/edit-common-settings.mjs +2 -2
  443. package/build-module/video/edit-common-settings.mjs.map +2 -2
  444. package/build-module/video/edit.mjs +25 -16
  445. package/build-module/video/edit.mjs.map +2 -2
  446. package/build-module/video/index.mjs +0 -2
  447. package/build-module/video/index.mjs.map +2 -2
  448. package/build-module/video/save.mjs +7 -2
  449. package/build-module/video/save.mjs.map +2 -2
  450. package/build-module/video/tracks-editor.mjs +2 -2
  451. package/build-module/video/tracks-editor.mjs.map +2 -2
  452. package/build-style/button/style-rtl.css +2 -1
  453. package/build-style/button/style.css +2 -1
  454. package/build-style/columns/style-rtl.css +1 -1
  455. package/build-style/columns/style.css +1 -1
  456. package/build-style/comments/editor-rtl.css +1 -1
  457. package/build-style/comments/editor.css +1 -1
  458. package/build-style/comments/style-rtl.css +1 -1
  459. package/build-style/comments/style.css +1 -1
  460. package/build-style/common-rtl.css +1 -1
  461. package/build-style/common.css +1 -1
  462. package/build-style/cover/style-rtl.css +6 -0
  463. package/build-style/cover/style.css +6 -0
  464. package/build-style/editor-rtl.css +21 -7
  465. package/build-style/editor.css +21 -7
  466. package/build-style/embed/editor-rtl.css +2 -1
  467. package/build-style/embed/editor.css +2 -1
  468. package/build-style/gallery/style-rtl.css +1 -2
  469. package/build-style/gallery/style.css +1 -2
  470. package/build-style/image/editor-rtl.css +6 -0
  471. package/build-style/image/editor.css +6 -0
  472. package/build-style/image/style-rtl.css +6 -9
  473. package/build-style/image/style.css +6 -9
  474. package/build-style/math/editor-rtl.css +5 -0
  475. package/build-style/math/editor.css +5 -0
  476. package/build-style/navigation/editor-rtl.css +1 -0
  477. package/build-style/navigation/editor.css +1 -0
  478. package/build-style/navigation/style-rtl.css +19 -4
  479. package/build-style/navigation/style.css +19 -4
  480. package/build-style/navigation-link/editor-rtl.css +3 -1
  481. package/build-style/navigation-link/editor.css +3 -1
  482. package/build-style/navigation-overlay-close/style-rtl.css +1 -1
  483. package/build-style/navigation-overlay-close/style.css +1 -1
  484. package/build-style/navigation-submenu/editor-rtl.css +3 -1
  485. package/build-style/navigation-submenu/editor.css +3 -1
  486. package/build-style/post-navigation-link/style-rtl.css +3 -0
  487. package/build-style/post-navigation-link/style.css +3 -0
  488. package/build-style/post-title/style-rtl.css +2 -2
  489. package/build-style/post-title/style.css +2 -2
  490. package/build-style/query-pagination/editor-rtl.css +0 -3
  491. package/build-style/query-pagination/editor.css +0 -3
  492. package/build-style/search/theme-rtl.css +1 -1
  493. package/build-style/search/theme.css +1 -1
  494. package/build-style/style-rtl.css +47 -23
  495. package/build-style/style.css +47 -23
  496. package/build-style/tab-panel/style-rtl.css +2 -0
  497. package/build-style/tab-panel/style.css +2 -0
  498. package/build-style/theme-rtl.css +1 -1
  499. package/build-style/theme.css +1 -1
  500. package/build-style/verse/style-rtl.css +2 -1
  501. package/build-style/verse/style.css +2 -1
  502. package/package.json +42 -43
  503. package/src/accordion/README.md +3 -0
  504. package/src/accordion/block.json +4 -1
  505. package/src/accordion-item/README.md +5 -0
  506. package/src/accordion-item/block.json +7 -1
  507. package/src/accordion-panel/README.md +7 -0
  508. package/src/accordion-panel/block.json +9 -1
  509. package/src/archives/README.md +4 -0
  510. package/src/archives/block.json +9 -0
  511. package/src/archives/edit.jsx +2 -2
  512. package/src/audio/README.md +4 -0
  513. package/src/audio/block.json +8 -0
  514. package/src/audio/edit.jsx +2 -2
  515. package/src/avatar/hooks.js +2 -2
  516. package/src/breadcrumbs/README.md +2 -0
  517. package/src/breadcrumbs/block.json +3 -0
  518. package/src/breadcrumbs/edit.jsx +3 -3
  519. package/src/breadcrumbs/index.php +1 -1
  520. package/src/button/edit.jsx +1 -1
  521. package/src/button/style.scss +2 -2
  522. package/src/buttons/README.md +4 -0
  523. package/src/buttons/block.json +9 -0
  524. package/src/calendar/index.php +1 -1
  525. package/src/categories/README.md +6 -0
  526. package/src/categories/block.json +12 -1
  527. package/src/categories/edit.jsx +2 -2
  528. package/src/code/README.md +5 -0
  529. package/src/code/block.json +10 -0
  530. package/src/code/save.jsx +1 -1
  531. package/src/column/README.md +4 -0
  532. package/src/column/block.json +9 -0
  533. package/src/columns/README.md +4 -0
  534. package/src/columns/block.json +9 -0
  535. package/src/columns/style.scss +2 -3
  536. package/src/comment-author-name/README.md +2 -0
  537. package/src/comment-author-name/block.json +3 -0
  538. package/src/comment-content/README.md +4 -0
  539. package/src/comment-content/block.json +5 -0
  540. package/src/comment-date/README.md +2 -0
  541. package/src/comment-date/block.json +3 -0
  542. package/src/comment-edit-link/README.md +2 -0
  543. package/src/comment-edit-link/block.json +3 -0
  544. package/src/comment-reply-link/README.md +2 -0
  545. package/src/comment-reply-link/block.json +3 -0
  546. package/src/comment-template/hooks.js +1 -1
  547. package/src/comments/README.md +5 -0
  548. package/src/comments/block.json +10 -0
  549. package/src/comments/style.scss +1 -1
  550. package/src/comments-pagination/README.md +2 -0
  551. package/src/comments-pagination/block.json +3 -0
  552. package/src/comments-pagination-next/README.md +2 -0
  553. package/src/comments-pagination-next/block.json +3 -0
  554. package/src/comments-pagination-numbers/README.md +2 -0
  555. package/src/comments-pagination-numbers/block.json +3 -0
  556. package/src/comments-pagination-previous/README.md +2 -0
  557. package/src/comments-pagination-previous/block.json +6 -0
  558. package/src/comments-title/README.md +2 -0
  559. package/src/comments-title/block.json +3 -0
  560. package/src/common.scss +1 -2
  561. package/src/cover/edit/index.jsx +5 -2
  562. package/src/cover/edit/inspector-controls.jsx +66 -15
  563. package/src/cover/style.scss +10 -0
  564. package/src/cover/test/{edit.jsdom.test.js → edit.browser.test.js} +122 -147
  565. package/src/cover/transforms.js +3 -3
  566. package/src/details/README.md +7 -0
  567. package/src/details/block.json +12 -0
  568. package/src/details/index.js +1 -1
  569. package/src/embed/editor.scss +2 -2
  570. package/src/embed/embed-controls.jsx +2 -2
  571. package/src/file/README.md +4 -0
  572. package/src/file/block.json +9 -0
  573. package/src/file/deprecated.jsx +3 -3
  574. package/src/file/edit.jsx +5 -3
  575. package/src/file/inspector.jsx +3 -3
  576. package/src/file/save.jsx +2 -2
  577. package/src/footnotes/README.md +5 -0
  578. package/src/footnotes/block.json +10 -0
  579. package/src/footnotes/edit.jsx +1 -1
  580. package/src/gallery/README.md +4 -0
  581. package/src/gallery/block.json +9 -0
  582. package/src/gallery/dynamic-gallery.jsx +4 -4
  583. package/src/gallery/edit.jsx +122 -70
  584. package/src/gallery/gallery-styles.js +117 -0
  585. package/src/gallery/index.php +181 -67
  586. package/src/gallery/responsive-styles.js +59 -5
  587. package/src/gallery/test/edit.jsdom.test.js +71 -3
  588. package/src/gallery/test/responsive-styles.js +59 -5
  589. package/src/group/README.md +1 -0
  590. package/src/group/block.json +1 -0
  591. package/src/heading/README.md +6 -0
  592. package/src/heading/block.json +11 -0
  593. package/src/heading/index.js +2 -2
  594. package/src/home-link/README.md +5 -0
  595. package/src/home-link/block.json +18 -0
  596. package/src/home-link/edit.jsx +2 -2
  597. package/src/html/modal.jsx +0 -3
  598. package/src/icon/index.php +9 -0
  599. package/src/image/edit.jsx +1 -1
  600. package/src/image/editor.scss +8 -0
  601. package/src/image/image.jsx +20 -18
  602. package/src/image/index.php +10 -4
  603. package/src/image/style.scss +1 -0
  604. package/src/image/test/use-open-image-media-editor-modal.jsdom.test.js +140 -1
  605. package/src/image/use-open-image-media-editor-modal.js +37 -0
  606. package/src/index.jsx +1 -1
  607. package/src/latest-comments/README.md +5 -0
  608. package/src/latest-comments/block.json +10 -0
  609. package/src/latest-comments/edit.jsx +2 -2
  610. package/src/latest-posts/README.md +5 -0
  611. package/src/latest-posts/block.json +10 -0
  612. package/src/latest-posts/edit.jsx +1 -1
  613. package/src/list/ordered-list-settings.jsx +2 -2
  614. package/src/list-item/hooks/use-enter.js +1 -1
  615. package/src/loginout/README.md +5 -0
  616. package/src/loginout/block.json +10 -0
  617. package/src/math/README.md +7 -2
  618. package/src/math/block.json +12 -0
  619. package/src/math/deprecated.jsx +38 -12
  620. package/src/math/edit.jsx +49 -20
  621. package/src/math/editor.scss +5 -0
  622. package/src/math/save.jsx +20 -4
  623. package/src/media-text/README.md +1 -0
  624. package/src/media-text/block.json +1 -0
  625. package/src/media-text/constants.js +1 -0
  626. package/src/media-text/deprecated.jsx +3 -3
  627. package/src/media-text/edit.jsx +48 -3
  628. package/src/media-text/image-fill.js +2 -2
  629. package/src/media-text/media-container.jsx +1 -1
  630. package/src/navigation/edit/index.jsx +3 -5
  631. package/src/navigation/edit/menu-inspector-controls.jsx +2 -2
  632. package/src/navigation/edit/overlay-template-part-selector.jsx +3 -3
  633. package/src/navigation/edit/responsive-wrapper.jsx +1 -1
  634. package/src/navigation/edit/use-generate-default-navigation-title.js +2 -2
  635. package/src/navigation/editor.scss +1 -0
  636. package/src/navigation/index.php +12 -0
  637. package/src/navigation/style.scss +41 -5
  638. package/src/navigation/test/use-navigation-menu.jsdom.test.js +6 -28
  639. package/src/navigation/test/view.jsdom.test.js +23 -0
  640. package/src/navigation/view.js +9 -6
  641. package/src/navigation-link/edit.jsx +1 -1
  642. package/src/navigation-link/editor.scss +6 -1
  643. package/src/navigation-link/link-ui/page-creator.jsx +2 -2
  644. package/src/navigation-link/shared/controls.jsx +2 -2
  645. package/src/navigation-link/shared/invalid-draft-display.jsx +2 -2
  646. package/src/navigation-link/shared/test/use-link-preview.jsdom.test.js +22 -22
  647. package/src/navigation-link/shared/use-link-preview.js +15 -14
  648. package/src/navigation-link/test/__snapshots__/hooks.jsdom.test.js.snap +41 -11
  649. package/src/navigation-overlay-close/README.md +1 -0
  650. package/src/navigation-overlay-close/block.json +7 -0
  651. package/src/navigation-overlay-close/style.scss +1 -1
  652. package/src/navigation-submenu/README.md +7 -0
  653. package/src/navigation-submenu/block.json +6 -0
  654. package/src/navigation-submenu/edit.jsx +12 -2
  655. package/src/navigation-submenu/editor.scss +6 -1
  656. package/src/navigation-submenu/index.php +11 -0
  657. package/src/page-list/README.md +5 -0
  658. package/src/page-list/block.json +10 -0
  659. package/src/paragraph/README.md +1 -0
  660. package/src/paragraph/block.json +1 -0
  661. package/src/paragraph/edit.jsx +2 -4
  662. package/src/paragraph/index.js +7 -0
  663. package/src/pattern/index.php +2 -2
  664. package/src/playlist/README.md +1 -0
  665. package/src/playlist/block.json +1 -0
  666. package/src/playlist/edit.jsx +6 -4
  667. package/src/playlist-track/test/edit.jsdom.test.jsx +2 -3
  668. package/src/post-author/edit.jsx +2 -2
  669. package/src/post-author-biography/README.md +3 -0
  670. package/src/post-author-biography/block.json +4 -0
  671. package/src/post-author-name/README.md +4 -0
  672. package/src/post-author-name/block.json +5 -0
  673. package/src/post-author-name/edit.jsx +1 -1
  674. package/src/post-comments-count/README.md +2 -0
  675. package/src/post-comments-count/block.json +3 -0
  676. package/src/post-comments-form/README.md +5 -0
  677. package/src/post-comments-form/block.json +10 -0
  678. package/src/post-content/README.md +3 -0
  679. package/src/post-content/block.json +3 -0
  680. package/src/post-date/README.md +2 -0
  681. package/src/post-date/block.json +3 -0
  682. package/src/post-date/edit.jsx +2 -2
  683. package/src/post-excerpt/README.md +5 -0
  684. package/src/post-excerpt/block.json +6 -0
  685. package/src/post-excerpt/edit.jsx +1 -1
  686. package/src/post-featured-image/edit.jsx +13 -11
  687. package/src/post-navigation-link/README.md +12 -0
  688. package/src/post-navigation-link/block.json +30 -0
  689. package/src/post-navigation-link/edit.jsx +27 -6
  690. package/src/post-navigation-link/index.php +94 -5
  691. package/src/post-navigation-link/style.scss +2 -0
  692. package/src/post-template/README.md +7 -0
  693. package/src/post-template/block.json +13 -1
  694. package/src/post-terms/README.md +5 -0
  695. package/src/post-terms/block.json +6 -0
  696. package/src/post-time-to-read/README.md +5 -0
  697. package/src/post-time-to-read/block.json +6 -0
  698. package/src/post-time-to-read/edit.jsx +2 -2
  699. package/src/post-title/README.md +5 -0
  700. package/src/post-title/block.json +10 -0
  701. package/src/post-title/style.scss +2 -3
  702. package/src/preformatted/README.md +6 -0
  703. package/src/preformatted/block.json +7 -0
  704. package/src/pullquote/README.md +1 -0
  705. package/src/pullquote/block.json +1 -0
  706. package/src/pullquote/deprecated.jsx +1 -1
  707. package/src/query/deprecated.jsx +1 -1
  708. package/src/query/edit/inspector-controls/index.jsx +4 -4
  709. package/src/query/edit/inspector-controls/order-control.jsx +2 -2
  710. package/src/query/edit/inspector-controls/sticky-control.jsx +2 -2
  711. package/src/query/view.js +6 -9
  712. package/src/query-no-results/README.md +7 -0
  713. package/src/query-no-results/block.json +10 -2
  714. package/src/query-pagination/README.md +2 -0
  715. package/src/query-pagination/block.json +3 -0
  716. package/src/query-pagination/editor.scss +0 -3
  717. package/src/query-pagination-next/README.md +2 -0
  718. package/src/query-pagination-next/block.json +3 -0
  719. package/src/query-pagination-numbers/README.md +2 -0
  720. package/src/query-pagination-numbers/block.json +3 -0
  721. package/src/query-pagination-previous/README.md +2 -0
  722. package/src/query-pagination-previous/block.json +3 -0
  723. package/src/query-title/README.md +2 -0
  724. package/src/query-title/block.json +3 -0
  725. package/src/query-title/use-archive-label.js +1 -1
  726. package/src/query-total/README.md +5 -0
  727. package/src/query-total/block.json +6 -0
  728. package/src/quote/README.md +1 -0
  729. package/src/quote/block.json +1 -0
  730. package/src/quote/deprecated.jsx +2 -2
  731. package/src/quote/transforms.js +3 -3
  732. package/src/read-more/README.md +5 -0
  733. package/src/read-more/block.json +6 -0
  734. package/src/rss/README.md +5 -0
  735. package/src/rss/block.json +6 -0
  736. package/src/search/edit.jsx +6 -6
  737. package/src/search/theme.scss +1 -1
  738. package/src/separator/edit.jsx +7 -4
  739. package/src/site-tagline/README.md +6 -0
  740. package/src/site-tagline/block.json +8 -1
  741. package/src/site-title/README.md +5 -0
  742. package/src/site-title/block.json +7 -1
  743. package/src/social-links/README.md +2 -0
  744. package/src/social-links/block.json +3 -0
  745. package/src/social-links/edit.jsx +4 -5
  746. package/src/tab-panel/README.md +9 -0
  747. package/src/tab-panel/block.json +25 -0
  748. package/src/tab-panel/controls.jsx +2 -2
  749. package/src/tab-panel/style.scss +5 -2
  750. package/src/tab-panels/README.md +7 -0
  751. package/src/tab-panels/block.json +18 -1
  752. package/src/table/state.js +1 -1
  753. package/src/table-of-contents/README.md +6 -0
  754. package/src/table-of-contents/block.json +7 -0
  755. package/src/table-of-contents/edit.jsx +6 -6
  756. package/src/table-of-contents/utils.ts +2 -2
  757. package/src/tabs/README.md +9 -0
  758. package/src/tabs/block.json +24 -1
  759. package/src/tabs/use-tab-actions.js +1 -1
  760. package/src/tag-cloud/README.md +9 -0
  761. package/src/tag-cloud/block.json +19 -0
  762. package/src/tag-cloud/edit.jsx +2 -2
  763. package/src/template-part/edit/advanced-controls.jsx +5 -2
  764. package/src/template-part/edit/import-controls.jsx +2 -2
  765. package/src/template-part/edit/index.jsx +2 -2
  766. package/src/template-part/edit/inner-blocks.jsx +1 -1
  767. package/src/template-part/edit/placeholder.jsx +2 -2
  768. package/src/template-part/edit/selection-modal.jsx +1 -1
  769. package/src/term-count/README.md +6 -0
  770. package/src/term-count/block.json +7 -0
  771. package/src/term-count/use-term-count.js +1 -1
  772. package/src/term-description/README.md +5 -0
  773. package/src/term-description/block.json +9 -0
  774. package/src/term-description/use-term-description.js +1 -1
  775. package/src/term-name/README.md +5 -0
  776. package/src/term-name/block.json +10 -0
  777. package/src/term-name/index.php +1 -1
  778. package/src/term-name/use-term-name.js +1 -1
  779. package/src/term-template/README.md +5 -0
  780. package/src/term-template/block.json +10 -1
  781. package/src/terms-query/edit/inspector-controls/index.jsx +2 -2
  782. package/src/terms-query/edit/inspector-controls/inherit-control.jsx +1 -1
  783. package/src/terms-query/edit/inspector-controls/order-control.jsx +2 -2
  784. package/src/terms-query/edit/inspector-controls/taxonomy-control.jsx +2 -2
  785. package/src/utils/hooks.js +1 -1
  786. package/src/utils/media-control.jsx +16 -10
  787. package/src/utils/poster-image.jsx +2 -2
  788. package/src/utils/search-patterns.js +9 -53
  789. package/src/utils/style-state.js +6 -4
  790. package/src/utils/test/{search-patterns.js → search-patterns.jsdom.test.js} +1 -22
  791. package/src/utils/test/waveform-player.jsdom.test.jsx +36 -38
  792. package/src/utils/test/{waveform-utils.jsdom.test.js → waveform-utils.browser.test.js} +64 -44
  793. package/src/verse/README.md +1 -0
  794. package/src/verse/block.json +1 -0
  795. package/src/verse/style.scss +2 -2
  796. package/src/video/README.md +7 -0
  797. package/src/video/block.json +6 -0
  798. package/src/video/edit-common-settings.jsx +3 -3
  799. package/src/video/edit.jsx +56 -51
  800. package/src/video/index.js +0 -2
  801. package/src/video/save.jsx +10 -1
  802. package/src/video/tracks-editor.jsx +2 -2
  803. package/build/gallery/flex-styles.cjs.map +0 -7
  804. package/build/video/variations.cjs +0 -75
  805. package/build/video/variations.cjs.map +0 -7
  806. package/build-module/gallery/flex-styles.mjs.map +0 -7
  807. package/build-module/video/variations.mjs +0 -50
  808. package/build-module/video/variations.mjs.map +0 -7
  809. package/src/gallery/flex-styles.js +0 -99
  810. package/src/video/test/variations.js +0 -63
  811. package/src/video/variations.js +0 -62
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/file/inspector.jsx"],
4
- "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport {\n\tRangeControl,\n\tSelectControl,\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport { MIN_PREVIEW_HEIGHT, MAX_PREVIEW_HEIGHT } from './edit';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function FileBlockInspector( {\n\threfs,\n\topenInNewWindow,\n\tshowDownloadButton,\n\tchangeLinkDestinationOption,\n\tchangeOpenInNewWindow,\n\tchangeShowDownloadButton,\n\tdisplayPreview,\n\tchangeDisplayPreview,\n\tpreviewHeight,\n\tchangePreviewHeight,\n} ) {\n\tconst { href, textLinkHref, attachmentPage } = hrefs;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tlet linkDestinationOptions = [ { value: href, label: __( 'URL' ) } ];\n\tif ( attachmentPage ) {\n\t\tlinkDestinationOptions = [\n\t\t\t{ value: href, label: __( 'Media file' ) },\n\t\t\t{ value: attachmentPage, label: __( 'Attachment page' ) },\n\t\t];\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t{ href.endsWith( '.pdf' ) && (\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'PDF settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tchangeDisplayPreview( true );\n\t\t\t\t\t\t\tchangePreviewHeight( 600 );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Show inline embed' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => ! displayPreview }\n\t\t\t\t\t\t\tonDeselect={ () => changeDisplayPreview( true ) }\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={ __( 'Show inline embed' ) }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tdisplayPreview\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t\"Note: Most phone and tablet browsers won't display embedded PDFs.\"\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tchecked={ !! displayPreview }\n\t\t\t\t\t\t\t\tonChange={ changeDisplayPreview }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t{ displayPreview && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Height in pixels' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => previewHeight !== 600 }\n\t\t\t\t\t\t\t\tonDeselect={ () => changePreviewHeight( 600 ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Height in pixels' ) }\n\t\t\t\t\t\t\t\t\tmin={ MIN_PREVIEW_HEIGHT }\n\t\t\t\t\t\t\t\t\tmax={ Math.max(\n\t\t\t\t\t\t\t\t\t\tMAX_PREVIEW_HEIGHT,\n\t\t\t\t\t\t\t\t\t\tpreviewHeight\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tvalue={ previewHeight }\n\t\t\t\t\t\t\t\t\tonChange={ changePreviewHeight }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t) }\n\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\tchangeLinkDestinationOption( href );\n\t\t\t\t\t\tchangeOpenInNewWindow( false );\n\t\t\t\t\t\tchangeShowDownloadButton( true );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Link to' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => textLinkHref !== href }\n\t\t\t\t\t\tonDeselect={ () => changeLinkDestinationOption( href ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Link to' ) }\n\t\t\t\t\t\t\tvalue={ textLinkHref }\n\t\t\t\t\t\t\toptions={ linkDestinationOptions }\n\t\t\t\t\t\t\tonChange={ changeLinkDestinationOption }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! openInNewWindow }\n\t\t\t\t\t\tonDeselect={ () => changeOpenInNewWindow( false ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tchecked={ openInNewWindow }\n\t\t\t\t\t\t\tonChange={ changeOpenInNewWindow }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show download button' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => ! showDownloadButton }\n\t\t\t\t\t\tonDeselect={ () => changeShowDownloadButton( true ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Show download button' ) }\n\t\t\t\t\t\t\tchecked={ showDownloadButton }\n\t\t\t\t\t\t\tonChange={ changeShowDownloadButton }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAMO;AACP,0BAAkC;AAClC,kBAAuD;AACvD,mBAA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MAAM,yBAA0B,IAAK;AAAA,cAElD;AAAA,gBAAC;AAAA;AAAA,kBACA,WAAQ,gBAAI,sBAAuB;AAAA,kBACnC,SAAU;AAAA,kBACV,UAAW;AAAA;AAAA,cACZ;AAAA;AAAA,UACD;AAAA;AAAA;AAAA,IACD;AAAA,KACD,GACD;AAEF;",
6
- "names": ["ToolsPanel", "ToolsPanelItem"]
4
+ "sourcesContent": ["import { __ } from '@wordpress/i18n';\nimport {\n\tRangeControl,\n\tSelectControl as WCSelectControl,\n\tToggleControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { InspectorControls } from '@wordpress/block-editor';\nimport { MIN_PREVIEW_HEIGHT, MAX_PREVIEW_HEIGHT } from './edit';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nexport default function FileBlockInspector( {\n\threfs,\n\topenInNewWindow,\n\tshowDownloadButton,\n\tchangeLinkDestinationOption,\n\tchangeOpenInNewWindow,\n\tchangeShowDownloadButton,\n\tdisplayPreview,\n\tchangeDisplayPreview,\n\tpreviewHeight,\n\tchangePreviewHeight,\n} ) {\n\tconst { href, textLinkHref, attachmentPage } = hrefs;\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tlet linkDestinationOptions = [ { value: href, label: __( 'URL' ) } ];\n\tif ( attachmentPage ) {\n\t\tlinkDestinationOptions = [\n\t\t\t{ value: href, label: __( 'Media file' ) },\n\t\t\t{ value: attachmentPage, label: __( 'Attachment page' ) },\n\t\t];\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t{ href.endsWith( '.pdf' ) && (\n\t\t\t\t\t<ToolsPanel\n\t\t\t\t\t\tlabel={ __( 'PDF settings' ) }\n\t\t\t\t\t\tresetAll={ () => {\n\t\t\t\t\t\t\tchangeDisplayPreview( true );\n\t\t\t\t\t\t\tchangePreviewHeight( 600 );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tlabel={ __( 'Show inline embed' ) }\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => ! displayPreview }\n\t\t\t\t\t\t\tonDeselect={ () => changeDisplayPreview( true ) }\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={ __( 'Show inline embed' ) }\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tdisplayPreview\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t\"Note: Most phone and tablet browsers won't display embedded PDFs.\"\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tchecked={ !! displayPreview }\n\t\t\t\t\t\t\t\tonChange={ changeDisplayPreview }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t{ displayPreview && (\n\t\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\t\tlabel={ __( 'Height in pixels' ) }\n\t\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\t\thasValue={ () => previewHeight !== 600 }\n\t\t\t\t\t\t\t\tonDeselect={ () => changePreviewHeight( 600 ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Height in pixels' ) }\n\t\t\t\t\t\t\t\t\tmin={ MIN_PREVIEW_HEIGHT }\n\t\t\t\t\t\t\t\t\tmax={ Math.max(\n\t\t\t\t\t\t\t\t\t\tMAX_PREVIEW_HEIGHT,\n\t\t\t\t\t\t\t\t\t\tpreviewHeight\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\tvalue={ previewHeight }\n\t\t\t\t\t\t\t\t\tonChange={ changePreviewHeight }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</ToolsPanel>\n\t\t\t\t) }\n\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\tchangeLinkDestinationOption( href );\n\t\t\t\t\t\tchangeOpenInNewWindow( false );\n\t\t\t\t\t\tchangeShowDownloadButton( true );\n\t\t\t\t\t} }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Link to' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => textLinkHref !== href }\n\t\t\t\t\t\tonDeselect={ () => changeLinkDestinationOption( href ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<WCSelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Link to' ) }\n\t\t\t\t\t\t\tvalue={ textLinkHref }\n\t\t\t\t\t\t\toptions={ linkDestinationOptions }\n\t\t\t\t\t\t\tonChange={ changeLinkDestinationOption }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! openInNewWindow }\n\t\t\t\t\t\tonDeselect={ () => changeOpenInNewWindow( false ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tchecked={ openInNewWindow }\n\t\t\t\t\t\t\tonChange={ changeOpenInNewWindow }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tlabel={ __( 'Show download button' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => ! showDownloadButton }\n\t\t\t\t\t\tonDeselect={ () => changeShowDownloadButton( true ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Show download button' ) }\n\t\t\t\t\t\t\tchecked={ showDownloadButton }\n\t\t\t\t\t\t\tonChange={ changeShowDownloadButton }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t</>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmB;AACnB,wBAMO;AACP,0BAAkC;AAClC,kBAAuD;AACvD,mBAA+C;AA0B7C;AAxBa,SAAR,mBAAqC;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,EAAE,MAAM,cAAc,eAAe,IAAI;AAC/C,QAAM,wBAAoB,6CAA+B;AAEzD,MAAI,yBAAyB,CAAE,EAAE,OAAO,MAAM,WAAO,gBAAI,KAAM,EAAE,CAAE;AACnE,MAAK,gBAAiB;AACrB,6BAAyB;AAAA,MACxB,EAAE,OAAO,MAAM,WAAO,gBAAI,YAAa,EAAE;AAAA,MACzC,EAAE,OAAO,gBAAgB,WAAO,gBAAI,iBAAkB,EAAE;AAAA,IACzD;AAAA,EACD;AAEA,SACC,2EACC,uDAAC,yCACE;AAAA,SAAK,SAAU,MAAO,KACvB;AAAA,MAAC,kBAAAA;AAAA,MAAA;AAAA,QACA,WAAQ,gBAAI,cAAe;AAAA,QAC3B,UAAW,MAAM;AAChB,+BAAsB,IAAK;AAC3B,8BAAqB,GAAI;AAAA,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A,WAAQ,gBAAI,SAAU;AAAA,kBACtB,OAAQ;AAAA,kBACR,SAAU;AAAA,kBACV,UAAW;AAAA;AAAA,cACZ;AAAA;AAAA,UACD;AAAA,UACA;AAAA,YAAC,kBAAAD;AAAA,YAAA;AAAA,cACA,WAAQ,gBAAI,iBAAkB;AAAA,cAC9B,kBAAgB;AAAA,cAChB,UAAW,MAAM,CAAC,CAAE;AAAA,cACpB,YAAa,MAAM,sBAAuB,KAAM;AAAA,cAEhD;AAAA,gBAAC;AAAA;AAAA,kBACA,WAAQ,gBAAI,iBAAkB;AAAA,kBAC9B,SAAU;AAAA,kBACV,UAAW;AAAA;AAAA,cACZ;AAAA;AAAA,UACD;AAAA,UACA;AAAA,YAAC,kBAAAA;AAAA,YAAA;AAAA,cACA,WAAQ,gBAAI,sBAAuB;AAAA,cACnC,kBAAgB;AAAA,cAChB,UAAW,MAAM,CAAE;AAAA,cACnB,YAAa,MAAM,yBAA0B,IAAK;AAAA,cAElD;AAAA,gBAAC;AAAA;AAAA,kBACA,WAAQ,gBAAI,sBAAuB;AAAA,kBACnC,SAAU;AAAA,kBACV,UAAW;AAAA;AAAA,cACZ;AAAA;AAAA,UACD;AAAA;AAAA;AAAA,IACD;AAAA,KACD,GACD;AAEF;",
6
+ "names": ["ToolsPanel", "ToolsPanelItem", "WCSelectControl"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/file/save.jsx"],
4
- "sourcesContent": ["import clsx from 'clsx';\nimport {\n\tRichText,\n\tuseBlockProps,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst {\n\t\thref,\n\t\tfileId,\n\t\tfileName,\n\t\ttextLinkHref,\n\t\ttextLinkTarget,\n\t\tshowDownloadButton,\n\t\tdownloadButtonText,\n\t\tdisplayPreview,\n\t\tpreviewHeight,\n\t} = attributes;\n\n\tconst pdfEmbedLabel = RichText.isEmpty( fileName )\n\t\t? 'PDF embed'\n\t\t: // To do: use toPlainText, but we need ensure it's RichTextData. See\n\t\t // https://github.com/WordPress/gutenberg/pull/56710.\n\t\t fileName.toString();\n\n\tconst hasFilename = ! RichText.isEmpty( fileName );\n\n\t// Only output an `aria-describedby` when the element it's referring to is\n\t// actually rendered.\n\tconst describedById = hasFilename ? fileId : undefined;\n\n\treturn (\n\t\thref && (\n\t\t\t<div { ...useBlockProps.save() }>\n\t\t\t\t{ displayPreview && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<object\n\t\t\t\t\t\t\tclassName=\"wp-block-file__embed\"\n\t\t\t\t\t\t\tdata={ href }\n\t\t\t\t\t\t\ttype=\"application/pdf\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t\theight: `${ previewHeight }px`,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\taria-label={ pdfEmbedLabel }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ hasFilename && (\n\t\t\t\t\t<a\n\t\t\t\t\t\tid={ describedById }\n\t\t\t\t\t\thref={ textLinkHref }\n\t\t\t\t\t\ttarget={ textLinkTarget }\n\t\t\t\t\t\trel={\n\t\t\t\t\t\t\ttextLinkTarget ? 'noreferrer noopener' : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RichText.Content value={ fileName } />\n\t\t\t\t\t</a>\n\t\t\t\t) }\n\t\t\t\t{ showDownloadButton && (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={ href }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-file__button',\n\t\t\t\t\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tdownload\n\t\t\t\t\t\taria-describedby={ describedById }\n\t\t\t\t\t>\n\t\t\t\t\t\t<RichText.Content value={ downloadButtonText } />\n\t\t\t\t\t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x';\nimport {\n\tRichText,\n\tuseBlockProps,\n\t__experimentalGetElementClassName,\n} from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst {\n\t\thref,\n\t\tfileId,\n\t\tfileName,\n\t\ttextLinkHref,\n\t\ttextLinkTarget,\n\t\tshowDownloadButton,\n\t\tdownloadButtonText,\n\t\tdisplayPreview,\n\t\tpreviewHeight,\n\t} = attributes;\n\n\tconst pdfEmbedLabel = RichText.isEmpty( fileName )\n\t\t? 'PDF embed'\n\t\t: // To do: use toPlainText, but we need ensure it's RichTextData. See\n\t\t\t// https://github.com/WordPress/gutenberg/pull/56710.\n\t\t\tfileName.toString();\n\n\tconst hasFilename = ! RichText.isEmpty( fileName );\n\n\t// Only output an `aria-describedby` when the element it's referring to is\n\t// actually rendered.\n\tconst describedById = hasFilename ? fileId : undefined;\n\n\treturn (\n\t\thref && (\n\t\t\t<div { ...useBlockProps.save() }>\n\t\t\t\t{ displayPreview && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<object\n\t\t\t\t\t\t\tclassName=\"wp-block-file__embed\"\n\t\t\t\t\t\t\tdata={ href }\n\t\t\t\t\t\t\ttype=\"application/pdf\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t\t\theight: `${ previewHeight }px`,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\taria-label={ pdfEmbedLabel }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ hasFilename && (\n\t\t\t\t\t<a\n\t\t\t\t\t\tid={ describedById }\n\t\t\t\t\t\thref={ textLinkHref }\n\t\t\t\t\t\ttarget={ textLinkTarget }\n\t\t\t\t\t\trel={\n\t\t\t\t\t\t\ttextLinkTarget ? 'noreferrer noopener' : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RichText.Content value={ fileName } />\n\t\t\t\t\t</a>\n\t\t\t\t) }\n\t\t\t\t{ showDownloadButton && (\n\t\t\t\t\t<a\n\t\t\t\t\t\thref={ href }\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'wp-block-file__button',\n\t\t\t\t\t\t\t__experimentalGetElementClassName( 'button' )\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tdownload\n\t\t\t\t\t\taria-describedby={ describedById }\n\t\t\t\t\t>\n\t\t\t\t\t\t<RichText.Content value={ downloadButtonText } />\n\t\t\t\t\t</a>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t)\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,0BAIO;AA6BJ;AA3BY,SAAR,KAAuB,EAAE,WAAW,GAAI;AAC9C,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI;AAEJ,QAAM,gBAAgB,6BAAS,QAAS,QAAS,IAC9C;AAAA;AAAA;AAAA,IAGD,SAAS,SAAS;AAAA;AAEpB,QAAM,cAAc,CAAE,6BAAS,QAAS,QAAS;AAIjD,QAAM,gBAAgB,cAAc,SAAS;AAE7C,SACC,QACC,6CAAC,SAAM,GAAG,kCAAc,KAAK,GAC1B;AAAA,sBACD,2EACC;AAAA,MAAC;AAAA;AAAA,QACA,WAAU;AAAA,QACV,MAAO;AAAA,QACP,MAAK;AAAA,QACL,OAAQ;AAAA,UACP,OAAO;AAAA,UACP,QAAQ,GAAI,aAAc;AAAA,QAC3B;AAAA,QACA,cAAa;AAAA;AAAA,IACd,GACD;AAAA,IAEC,eACD;AAAA,MAAC;AAAA;AAAA,QACA,IAAK;AAAA,QACL,MAAO;AAAA,QACP,QAAS;AAAA,QACT,KACC,iBAAiB,wBAAwB;AAAA,QAG1C,sDAAC,6BAAS,SAAT,EAAiB,OAAQ,UAAW;AAAA;AAAA,IACtC;AAAA,IAEC,sBACD;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA,eAAY,YAAAA;AAAA,UACX;AAAA,cACA,uDAAmC,QAAS;AAAA,QAC7C;AAAA,QACA,UAAQ;AAAA,QACR,oBAAmB;AAAA,QAEnB,sDAAC,6BAAS,SAAT,EAAiB,OAAQ,oBAAqB;AAAA;AAAA,IAChD;AAAA,KAEF;AAGH;",
6
6
  "names": ["clsx"]
7
7
  }
@@ -10,6 +10,15 @@
10
10
  "usesContext": [ "postId", "postType" ],
11
11
  "supports": {
12
12
  "anchor": true,
13
+ "background": {
14
+ "backgroundImage": true,
15
+ "backgroundSize": true,
16
+ "gradient": true,
17
+ "__experimentalDefaultControls": {
18
+ "backgroundImage": true,
19
+ "gradient": true
20
+ }
21
+ },
13
22
  "__experimentalBorder": {
14
23
  "radius": true,
15
24
  "color": true,
@@ -35,6 +44,7 @@
35
44
  "multiple": false,
36
45
  "reusable": false,
37
46
  "inserter": false,
47
+ "shadow": true,
38
48
  "spacing": {
39
49
  "margin": true,
40
50
  "padding": true,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/footnotes/edit.jsx"],
4
- "sourcesContent": ["import { BlockIcon, RichText, useBlockProps } from '@wordpress/block-editor';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { Placeholder } from '@wordpress/components';\nimport { formatListNumbered as icon } from '@wordpress/icons';\n\nexport default function FootnotesEdit( { context: { postType, postId } } ) {\n\tconst [ meta, updateMeta ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'meta',\n\t\tpostId\n\t);\n\tconst footnotesSupported = 'string' === typeof meta?.footnotes;\n\t// The meta is a string that something else may have written, so it can be\n\t// malformed or hold something other than an array. Treat anything\n\t// unreadable as no footnotes and fall through to the placeholder below.\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse( meta?.footnotes || '[]' );\n\t} catch {\n\t\t// Left undefined, which the check below treats as no footnotes, along\n\t\t// with a value of the wrong shape.\n\t}\n\tconst footnotes = Array.isArray( parsed ) ? parsed : [];\n\tconst blockProps = useBlockProps();\n\n\tif ( ! footnotesSupported ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tlabel={ __( 'Footnotes' ) }\n\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t'Footnotes are not supported here. Add this block to post or page content.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( ! footnotes.length ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tlabel={ __( 'Footnotes' ) }\n\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t'Footnotes found in blocks within this document will be displayed here.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<ol { ...blockProps }>\n\t\t\t{ footnotes.map( ( { id, content } ) => (\n\t\t\t\t/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t<li\n\t\t\t\t\tkey={ id }\n\t\t\t\t\tonMouseDown={ ( event ) => {\n\t\t\t\t\t\t// When clicking on the list item (not on descendants),\n\t\t\t\t\t\t// focus the rich text element since it's only 1px wide when\n\t\t\t\t\t\t// empty.\n\t\t\t\t\t\tif ( event.target === event.currentTarget ) {\n\t\t\t\t\t\t\tevent.target.firstElementChild.focus();\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tid={ id }\n\t\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\t\tvalue={ content }\n\t\t\t\t\t\tidentifier={ id }\n\t\t\t\t\t\t// To do: figure out why the browser is not scrolling\n\t\t\t\t\t\t// into view when it receives focus.\n\t\t\t\t\t\tonFocus={ ( event ) => {\n\t\t\t\t\t\t\tif ( ! event.target.textContent.trim() ) {\n\t\t\t\t\t\t\t\tevent.target.scrollIntoView();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonChange={ ( nextFootnote ) => {\n\t\t\t\t\t\t\tupdateMeta( {\n\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\tfootnotes: JSON.stringify(\n\t\t\t\t\t\t\t\t\tfootnotes.map( ( footnote ) => {\n\t\t\t\t\t\t\t\t\t\treturn footnote.id === id\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\tcontent: nextFootnote,\n\t\t\t\t\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t: footnote;\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>{ ' ' }\n\t\t\t\t\t<a href={ `#${ id }-link` }>↩︎</a>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ol>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAmD;AACnD,uBAA8B;AAC9B,kBAAmB;AACnB,wBAA4B;AAC5B,mBAA2C;AA2B/B;AAzBG,SAAR,cAAgC,EAAE,SAAS,EAAE,UAAU,OAAO,EAAE,GAAI;AAC1E,QAAM,CAAE,MAAM,UAAW,QAAI;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACA,QAAM,qBAAqB,aAAa,OAAO,MAAM;AAIrD,MAAI;AACJ,MAAI;AACH,aAAS,KAAK,MAAO,MAA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,SAAS,OAAO,KACpB;AAAA,wBACA,SAAS;AAAA,wBACT;AAAA,sBACA,IACA;AAAA,oBACJ,CAAE;AAAA,kBACH;AAAA,gBACD,CAAE;AAAA,cACH;AAAA;AAAA,UACD;AAAA,UAAI;AAAA,UACJ,4CAAC,OAAE,MAAO,IAAK,EAAG,SAAU,gBAAE;AAAA;AAAA;AAAA,MAvCxB;AAAA,IAwCP;AAAA,GACC,GACH;AAEF;",
4
+ "sourcesContent": ["import { BlockIcon, RichText, useBlockProps } from '@wordpress/block-editor';\nimport { useEntityProp } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { Placeholder } from '@wordpress/components';\nimport { formatListNumbered as icon } from '@wordpress/icons';\n\nexport default function FootnotesEdit( { context: { postType, postId } } ) {\n\tconst [ meta, updateMeta ] = useEntityProp(\n\t\t'postType',\n\t\tpostType,\n\t\t'meta',\n\t\tpostId\n\t);\n\tconst footnotesSupported = 'string' === typeof meta?.footnotes;\n\t// The meta is a string that something else may have written, so it can be\n\t// malformed or hold something other than an array. Treat anything\n\t// unreadable as no footnotes and fall through to the placeholder below.\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse( meta?.footnotes || '[]' );\n\t} catch {\n\t\t// Left undefined, which the check below treats as no footnotes, along\n\t\t// with a value of the wrong shape.\n\t}\n\tconst footnotes = Array.isArray( parsed ) ? parsed : [];\n\tconst blockProps = useBlockProps();\n\n\tif ( ! footnotesSupported ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tlabel={ __( 'Footnotes' ) }\n\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t'Footnotes are not supported here. Add this block to post or page content.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tif ( ! footnotes.length ) {\n\t\treturn (\n\t\t\t<div { ...blockProps }>\n\t\t\t\t<Placeholder\n\t\t\t\t\ticon={ <BlockIcon icon={ icon } /> }\n\t\t\t\t\tlabel={ __( 'Footnotes' ) }\n\t\t\t\t\tinstructions={ __(\n\t\t\t\t\t\t'Footnotes found in blocks within this document will be displayed here.'\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<ol { ...blockProps }>\n\t\t\t{ footnotes.map( ( { id, content } ) => (\n\t\t\t\t/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */\n\t\t\t\t<li\n\t\t\t\t\tkey={ id }\n\t\t\t\t\tonMouseDown={ ( event ) => {\n\t\t\t\t\t\t// When clicking on the list item (not on descendants),\n\t\t\t\t\t\t// focus the rich text element since it's only 1px wide when\n\t\t\t\t\t\t// empty.\n\t\t\t\t\t\tif ( event.target === event.currentTarget ) {\n\t\t\t\t\t\t\tevent.target.firstElementChild.focus();\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tid={ id }\n\t\t\t\t\t\ttagName=\"span\"\n\t\t\t\t\t\tvalue={ content }\n\t\t\t\t\t\tidentifier={ id }\n\t\t\t\t\t\t// To do: figure out why the browser is not scrolling\n\t\t\t\t\t\t// into view when it receives focus.\n\t\t\t\t\t\tonFocus={ ( event ) => {\n\t\t\t\t\t\t\tif ( ! event.target.textContent.trim() ) {\n\t\t\t\t\t\t\t\tevent.target.scrollIntoView();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonChange={ ( nextFootnote ) => {\n\t\t\t\t\t\t\tupdateMeta( {\n\t\t\t\t\t\t\t\t...meta,\n\t\t\t\t\t\t\t\tfootnotes: JSON.stringify(\n\t\t\t\t\t\t\t\t\tfootnotes.map( ( footnote ) => {\n\t\t\t\t\t\t\t\t\t\treturn footnote.id === id\n\t\t\t\t\t\t\t\t\t\t\t? {\n\t\t\t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MAAO,aAAAA,oBAAO;AAAA,QAChC,WAAQ,gBAAI,WAAY;AAAA,QACxB,kBAAe;AAAA,UACd;AAAA,QACD;AAAA;AAAA,IACD,GACD;AAAA,EAEF;AAEA,SACC,4CAAC,QAAK,GAAG,YACN,oBAAU,IAAK,CAAE,EAAE,IAAI,QAAQ;AAAA;AAAA,IAEhC;AAAA,MAAC;AAAA;AAAA,QAEA,aAAc,CAAE,UAAW;AAI1B,cAAK,MAAM,WAAW,MAAM,eAAgB;AAC3C,kBAAM,OAAO,kBAAkB,MAAM;AACrC,kBAAM,eAAe;AAAA,UACtB;AAAA,QACD;AAAA,QAEA;AAAA;AAAA,YAAC;AAAA;AAAA,cACA;AAAA,cACA,SAAQ;AAAA,cACR,OAAQ;AAAA,cACR,YAAa;AAAA,cAGb,SAAU,CAAE,UAAW;AACtB,oBAAK,CAAE,MAAM,OAAO,YAAY,KAAK,GAAI;AACxC,wBAAM,OAAO,eAAe;AAAA,gBAC7B;AAAA,cACD;AAAA,cACA,UAAW,CAAE,iBAAkB;AAC9B,2BAAY;AAAA,kBACX,GAAG;AAAA,kBACH,WAAW,KAAK;AAAA,oBACf,UAAU,IAAK,CAAE,aAAc;AAC9B,6BAAO,SAAS,OAAO,KACpB;AAAA,wBACA,SAAS;AAAA,wBACT;AAAA,sBACD,IACC;AAAA,oBACJ,CAAE;AAAA,kBACH;AAAA,gBACD,CAAE;AAAA,cACH;AAAA;AAAA,UACD;AAAA,UAAI;AAAA,UACJ,4CAAC,OAAE,MAAO,IAAK,EAAG,SAAU,gBAAE;AAAA;AAAA;AAAA,MAvCxB;AAAA,IAwCP;AAAA,GACC,GACH;AAEF;",
6
6
  "names": ["icon"]
7
7
  }
@@ -127,6 +127,15 @@
127
127
  "supports": {
128
128
  "anchor": true,
129
129
  "align": true,
130
+ "background": {
131
+ "backgroundImage": true,
132
+ "backgroundSize": true,
133
+ "gradient": true,
134
+ "__experimentalDefaultControls": {
135
+ "backgroundImage": true,
136
+ "gradient": true
137
+ }
138
+ },
130
139
  "__experimentalBorder": {
131
140
  "radius": true,
132
141
  "color": true,
@@ -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,\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<SelectControl\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 __( '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": ";;;;;;;;;;;;;;;;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UAEb,gCAAsB,4CAAC,6BAAQ;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,WAAQ,gBAAI,sBAAuB;AAAA,UACnC,iBAAc,gBAAI,qBAAsB;AAAA;AAAA,MACzC;AAAA,OACD;AAAA,IAWE,iBAAiB;AAAA,KACpB;AAEF;",
6
- "names": ["ConfirmDialog", "ToolsPanel", "ToolsPanelItem", "useBlockPreview"]
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
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA4B;AAC5B,qBAAkC;AAClC,wBAWO;AACP,0BAKO;AACP,yBAA2B;AAC3B,oBAAoC;AACpC,qBAAwB;AACxB,4BAA2D;AAmCzD;AA3BF,IAAM,gBAAgB;AAAA,EACrB,EAAE,WAAO,gBAAI,kBAAmB,GAAG,OAAO,YAAY;AAAA,EACtD,EAAE,WAAO,gBAAI,kBAAmB,GAAG,OAAO,WAAW;AAAA,EACrD;AAAA;AAAA,IAEC,WAAO,gBAAI,OAAQ;AAAA,IACnB,OAAO;AAAA,EACR;AAAA,EACA;AAAA;AAAA,IAEC,WAAO,gBAAI,OAAQ;AAAA,IACnB,OAAO;AAAA,EACR;AACD;AAYA,SAAS,aAAc,EAAE,SAAS,OAAO,SAAS,GAAI;AACrD,SACC;AAAA,IAAC,kBAAAA;AAAA,IAAA;AAAA,MACA,WAAQ,gBAAI,UAAW;AAAA,MACvB,OAAQ,GAAI,OAAQ,IAAK,KAAM;AAAA,MAC/B,SAAU;AAAA,MACV,UAAW,CAAE,UAAW;AACvB,cAAM,CAAE,YAAY,QAAS,IAAI,MAAM,MAAO,GAAI;AAClD,iBAAU,EAAE,SAAS,YAAY,OAAO,SAAS,CAAE;AAAA,MACpD;AAAA;AAAA,EACD;AAEF;AAcA,SAAS,oBAAqB,EAAE,WAAW,SAAS,GAAI;AACvD,SACC;AAAA,IAAC,kBAAAC;AAAA,IAAA;AAAA,MACA,QAAM;AAAA,MACN,WAAQ,gBAAI,gBAAiB;AAAA,MAC7B,0BAA2B;AAAA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AA,OAEF;AAAA,IAED,6CAAC,YAAS,GAAG,YACV;AAAA,yBAAmB,SACpB,4CAAC,4CAAqB,OAAQ,gBAC7B;AAAA,QAAC;AAAA;AAAA,UACA,aAAc;AAAA,UACd,QAAS;AAAA;AAAA,MACV,GACD,IAEA;AAAA,QAAC;AAAA;AAAA,UACA,MAAO;AAAA,UACP,WAAQ,gBAAI,SAAU;AAAA,UACtB,cAAe;AAAA,UAEb,gCAAsB,4CAAC,6BAAQ;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,WAAQ,gBAAI,sBAAuB;AAAA,UACnC,iBAAc,gBAAI,qBAAsB;AAAA;AAAA,MACzC;AAAA,OACD;AAAA,IAWE,iBAAiB;AAAA,KACpB;AAEF;",
6
+ "names": ["WCSelectControl", "ConfirmDialog", "ToolsPanel", "ToolsPanelItem", "useBlockPreview"]
7
7
  }
@@ -53,11 +53,10 @@ var import_constants = require("./constants.cjs");
53
53
  var import_use_image_sizes = __toESM(require("./use-image-sizes.cjs"));
54
54
  var import_use_get_new_images = __toESM(require("./use-get-new-images.cjs"));
55
55
  var import_use_get_media = __toESM(require("./use-get-media.cjs"));
56
- var import_flex_styles = __toESM(require("./flex-styles.cjs"));
56
+ var import_gallery_styles = __toESM(require("./gallery-styles.cjs"));
57
57
  var import_use_dynamic_gallery = __toESM(require("./use-dynamic-gallery.cjs"));
58
58
  var import_dynamic_gallery = require("./dynamic-gallery.cjs");
59
59
  var import_dynamic_source = require("./dynamic-source.cjs");
60
- var import_lock_unlock = require("../lock-unlock.cjs");
61
60
  var import_responsive_styles = require("./responsive-styles.cjs");
62
61
  var import_jsx_runtime = require("react/jsx-runtime");
63
62
  var LINK_OPTIONS = [
@@ -188,7 +187,7 @@ function GalleryEdit(props) {
188
187
  getSettings: _getSettings,
189
188
  getBlock: _getBlock,
190
189
  getSelectedBlockStyleState
191
- } = (0, import_lock_unlock.unlock)(select(import_block_editor.store));
190
+ } = select(import_block_editor.store);
192
191
  const multiSelectedClientIds = getMultiSelectedBlockClientIds();
193
192
  return {
194
193
  getBlock: _getBlock,
@@ -209,10 +208,13 @@ function GalleryEdit(props) {
209
208
  ) : {};
210
209
  const baseColumns = (0, import_responsive_styles.isValidGalleryColumns)(columns) ? columns : void 0;
211
210
  const baseImageCrop = typeof imageCrop === "boolean" ? imageCrop : true;
211
+ const baseAspectRatio = aspectRatio || "auto";
212
212
  const hasViewportColumns = isViewportStyleState && Object.hasOwn(viewportStyle, "columns") && (0, import_responsive_styles.isValidGalleryColumns)(viewportStyle.columns);
213
213
  const hasViewportImageCrop = isViewportStyleState && Object.hasOwn(viewportStyle, "imageCrop") && typeof viewportStyle.imageCrop === "boolean";
214
+ const hasViewportAspectRatio = isViewportStyleState && Object.hasOwn(viewportStyle, "aspectRatio") && typeof viewportStyle.aspectRatio === "string" && !!viewportStyle.aspectRatio;
214
215
  const activeColumns = hasViewportColumns ? viewportStyle.columns : baseColumns;
215
216
  const activeImageCrop = hasViewportImageCrop ? viewportStyle.imageCrop : baseImageCrop;
217
+ const activeAspectRatio = hasViewportAspectRatio ? viewportStyle.aspectRatio : baseAspectRatio;
216
218
  const images = (0, import_element.useMemo)(
217
219
  () => innerBlockImages?.map((block) => ({
218
220
  clientId: block.clientId,
@@ -309,7 +311,8 @@ function GalleryEdit(props) {
309
311
  sizeSlug,
310
312
  caption: imageAttributes.caption.length > 0 ? imageAttributes.caption : image.caption?.raw,
311
313
  alt: imageAttributes.alt || image.alt_text,
312
- aspectRatio: aspectRatio === "auto" ? void 0 : aspectRatio
314
+ aspectRatio: aspectRatio === "auto" ? void 0 : aspectRatio,
315
+ scale: aspectRatio && aspectRatio !== "auto" ? "cover" : void 0
313
316
  };
314
317
  }
315
318
  function isValidFileType(file) {
@@ -413,7 +416,7 @@ function GalleryEdit(props) {
413
416
  }
414
417
  );
415
418
  }
416
- function setGalleryFlexSettings(settings) {
419
+ function setGallerySettings(settings) {
417
420
  if (!isViewportStyleState) {
418
421
  setAttributes(settings);
419
422
  return;
@@ -424,17 +427,18 @@ function GalleryEdit(props) {
424
427
  viewport: selectedStyleState.viewport,
425
428
  baseSettings: {
426
429
  columns: baseColumns,
427
- imageCrop: baseImageCrop
430
+ imageCrop: baseImageCrop,
431
+ aspectRatio: baseAspectRatio
428
432
  },
429
433
  settings
430
434
  })
431
435
  });
432
436
  }
433
437
  function setColumnsNumber(value) {
434
- setGalleryFlexSettings({ columns: value });
438
+ setGallerySettings({ columns: value });
435
439
  }
436
440
  function toggleImageCrop() {
437
- setGalleryFlexSettings({ imageCrop: !activeImageCrop });
441
+ setGallerySettings({ imageCrop: !activeImageCrop });
438
442
  }
439
443
  function toggleRandomOrder() {
440
444
  setAttributes({ randomOrder: !randomOrder });
@@ -491,30 +495,42 @@ function GalleryEdit(props) {
491
495
  );
492
496
  }
493
497
  function setAspectRatio(value) {
494
- setAttributes({ aspectRatio: value });
495
- const changedAttributes = {};
496
- const blocks = [];
497
- getBlock(clientId).innerBlocks.forEach((block) => {
498
- blocks.push(block.clientId);
499
- changedAttributes[block.clientId] = {
500
- aspectRatio: value === "auto" ? void 0 : value
501
- };
502
- });
503
- updateBlockAttributes(blocks, changedAttributes, true);
498
+ if (isViewportStyleState) {
499
+ setGallerySettings({ aspectRatio: value });
500
+ } else {
501
+ const cleanValue = !value || value === "auto" ? void 0 : value;
502
+ setAttributes({ aspectRatio: value ?? "auto" });
503
+ const changedAttributes = {};
504
+ const blocks = [];
505
+ getBlock(clientId).innerBlocks.forEach((block) => {
506
+ blocks.push(block.clientId);
507
+ changedAttributes[block.clientId] = {
508
+ aspectRatio: cleanValue,
509
+ scale: cleanValue ? "cover" : void 0
510
+ };
511
+ });
512
+ updateBlockAttributes(blocks, changedAttributes, true);
513
+ }
514
+ const noticeValue = value ?? baseAspectRatio;
504
515
  const aspectRatioText = aspectRatioOptions.find(
505
- (option) => option.value === value
516
+ (option) => option.value === noticeValue
506
517
  );
507
- createSuccessNotice(
508
- (0, import_i18n.sprintf)(
509
- /* translators: %s: aspect ratio setting */
510
- (0, import_i18n.__)("All gallery images updated to aspect ratio: %s"),
511
- aspectRatioText?.label || value
518
+ const noticeText = isViewportStyleState ? (0, import_i18n.sprintf)(
519
+ /* translators: 1: viewport name, 2: aspect ratio setting */
520
+ (0, import_i18n.__)(
521
+ "Gallery images in the %1$s viewport updated to aspect ratio: %2$s"
512
522
  ),
513
- {
514
- id: "gallery-attributes-aspectRatio",
515
- type: "snackbar"
516
- }
523
+ selectedStyleState.viewport.replace("@", ""),
524
+ aspectRatioText?.label || noticeValue
525
+ ) : (0, import_i18n.sprintf)(
526
+ /* translators: %s: aspect ratio setting */
527
+ (0, import_i18n.__)("All gallery images updated to aspect ratio: %s"),
528
+ aspectRatioText?.label || noticeValue
517
529
  );
530
+ createSuccessNotice(noticeText, {
531
+ id: "gallery-attributes-aspectRatio",
532
+ type: "snackbar"
533
+ });
518
534
  }
519
535
  (0, import_element.useEffect)(() => {
520
536
  if (!linkTo) {
@@ -604,11 +620,12 @@ function GalleryEdit(props) {
604
620
  ] });
605
621
  }
606
622
  const hasLinkTo = linkTo && linkTo !== "none";
623
+ const hasViewportSettings = isFlexLayout || aspectRatioOptions.length > 1;
607
624
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
608
625
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
609
626
  import_block_editor.InspectorControls,
610
627
  {
611
- group: isViewportStyleState && isFlexLayout ? "viewport" : "default",
628
+ group: isViewportStyleState && hasViewportSettings ? "viewport" : "default",
612
629
  children: [
613
630
  !isViewportStyleState && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
614
631
  import_dynamic_gallery.GallerySourcePanel,
@@ -624,9 +641,10 @@ function GalleryEdit(props) {
624
641
  label: (0, import_i18n.__)("Settings"),
625
642
  resetAll: () => {
626
643
  if (isViewportStyleState) {
627
- setGalleryFlexSettings({
644
+ setGallerySettings({
628
645
  columns: void 0,
629
- imageCrop: void 0
646
+ imageCrop: void 0,
647
+ aspectRatio: void 0
630
648
  });
631
649
  return;
632
650
  }
@@ -701,7 +719,7 @@ function GalleryEdit(props) {
701
719
  isShownByDefault: true,
702
720
  label: (0, import_i18n.__)("Crop images to fit"),
703
721
  hasValue: () => isViewportStyleState ? hasViewportImageCrop : !activeImageCrop,
704
- onDeselect: () => setGalleryFlexSettings({
722
+ onDeselect: () => setGallerySettings({
705
723
  imageCrop: isViewportStyleState ? void 0 : true
706
724
  }),
707
725
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -748,12 +766,19 @@ function GalleryEdit(props) {
748
766
  )
749
767
  }
750
768
  ),
751
- !isViewportStyleState && aspectRatioOptions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
769
+ aspectRatioOptions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
752
770
  import_components.__experimentalToolsPanelItem,
753
771
  {
754
- hasValue: () => !!aspectRatio && aspectRatio !== "auto",
772
+ hasValue: () => isViewportStyleState ? hasViewportAspectRatio : activeAspectRatio !== "auto",
755
773
  label: (0, import_i18n.__)("Aspect ratio"),
756
- onDeselect: () => setAspectRatio("auto"),
774
+ onDeselect: () => (
775
+ // In a viewport state this clears the override
776
+ // so the base ratio applies again, rather than
777
+ // overriding it with Original.
778
+ setAspectRatio(
779
+ isViewportStyleState ? void 0 : "auto"
780
+ )
781
+ ),
757
782
  isShownByDefault: true,
758
783
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
759
784
  import_components.SelectControl,
@@ -762,7 +787,7 @@ function GalleryEdit(props) {
762
787
  help: (0, import_i18n.__)(
763
788
  "Set a consistent aspect ratio for all images in the gallery."
764
789
  ),
765
- value: aspectRatio,
790
+ value: activeAspectRatio,
766
791
  options: aspectRatioOptions,
767
792
  onChange: setAspectRatio
768
793
  }
@@ -849,11 +874,12 @@ function GalleryEdit(props) {
849
874
  variant: "toolbar"
850
875
  }
851
876
  ) }),
852
- isFlexLayout && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
853
- import_flex_styles.default,
877
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
878
+ import_gallery_styles.default,
854
879
  {
855
880
  style: attributes.style,
856
- clientId
881
+ clientId,
882
+ isFlexLayout
857
883
  }
858
884
  )
859
885
  ] }),