@wordpress/block-library 6.0.1 → 6.0.5

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 (1093) hide show
  1. package/build/block/edit.js +1 -1
  2. package/build/block/edit.js.map +1 -1
  3. package/build/button/deprecated.js +155 -10
  4. package/build/button/deprecated.js.map +1 -1
  5. package/build/button/edit.native.js +257 -330
  6. package/build/button/edit.native.js.map +1 -1
  7. package/build/button/index.js +4 -1
  8. package/build/button/index.js.map +1 -1
  9. package/build/buttons/deprecated.js +84 -2
  10. package/build/buttons/deprecated.js.map +1 -1
  11. package/build/buttons/edit.js +6 -42
  12. package/build/buttons/edit.js.map +1 -1
  13. package/build/buttons/index.js +16 -14
  14. package/build/buttons/index.js.map +1 -1
  15. package/build/buttons/save.js +4 -20
  16. package/build/buttons/save.js.map +1 -1
  17. package/build/buttons/transforms.js +15 -10
  18. package/build/buttons/transforms.js.map +1 -1
  19. package/build/categories/edit.js +16 -6
  20. package/build/categories/edit.js.map +1 -1
  21. package/build/categories/index.js +4 -0
  22. package/build/categories/index.js.map +1 -1
  23. package/build/code/edit.native.js +8 -5
  24. package/build/code/edit.native.js.map +1 -1
  25. package/build/code/index.js +24 -1
  26. package/build/code/index.js.map +1 -1
  27. package/build/column/edit.js +4 -2
  28. package/build/column/edit.js.map +1 -1
  29. package/build/column/index.js +4 -0
  30. package/build/column/index.js.map +1 -1
  31. package/build/column/save.js +7 -3
  32. package/build/column/save.js.map +1 -1
  33. package/build/columns/edit.js +1 -1
  34. package/build/columns/edit.js.map +1 -1
  35. package/build/columns/index.js +1 -0
  36. package/build/columns/index.js.map +1 -1
  37. package/build/columns/save.js +7 -2
  38. package/build/columns/save.js.map +1 -1
  39. package/build/comment-author-avatar/edit.js +83 -0
  40. package/build/comment-author-avatar/edit.js.map +1 -0
  41. package/build/{post-comment-date → comment-author-avatar}/index.js +25 -9
  42. package/build/comment-author-avatar/index.js.map +1 -0
  43. package/build/comment-author-name/deprecated.js +69 -0
  44. package/build/comment-author-name/deprecated.js.map +1 -0
  45. package/build/comment-author-name/edit.js +112 -0
  46. package/build/comment-author-name/edit.js.map +1 -0
  47. package/build/comment-author-name/index.js +77 -0
  48. package/build/comment-author-name/index.js.map +1 -0
  49. package/build/comment-content/edit.js +74 -0
  50. package/build/comment-content/edit.js.map +1 -0
  51. package/build/comment-content/index.js +68 -0
  52. package/build/comment-content/index.js.map +1 -0
  53. package/build/comment-date/deprecated.js +68 -0
  54. package/build/comment-date/deprecated.js.map +1 -0
  55. package/build/comment-date/edit.js +95 -0
  56. package/build/comment-date/edit.js.map +1 -0
  57. package/build/comment-date/index.js +72 -0
  58. package/build/comment-date/index.js.map +1 -0
  59. package/build/comment-edit-link/edit.js +61 -0
  60. package/build/comment-edit-link/edit.js.map +1 -0
  61. package/build/comment-edit-link/index.js +67 -0
  62. package/build/comment-edit-link/index.js.map +1 -0
  63. package/build/comment-reply-link/edit.js +63 -0
  64. package/build/comment-reply-link/edit.js.map +1 -0
  65. package/build/comment-reply-link/index.js +63 -0
  66. package/build/comment-reply-link/index.js.map +1 -0
  67. package/build/comment-template/edit.js +82 -0
  68. package/build/comment-template/edit.js.map +1 -0
  69. package/build/{post-comment-content → comment-template}/index.js +13 -8
  70. package/build/comment-template/index.js.map +1 -0
  71. package/build/comment-template/save.js +18 -0
  72. package/build/comment-template/save.js.map +1 -0
  73. package/build/comments-query-loop/edit.js +64 -0
  74. package/build/comments-query-loop/edit.js.map +1 -0
  75. package/build/comments-query-loop/index.js +67 -0
  76. package/build/comments-query-loop/index.js.map +1 -0
  77. package/build/comments-query-loop/save.js +22 -0
  78. package/build/comments-query-loop/save.js.map +1 -0
  79. package/build/comments-query-loop/toolbar.js +54 -0
  80. package/build/comments-query-loop/toolbar.js.map +1 -0
  81. package/build/cover/deprecated.js +180 -20
  82. package/build/cover/deprecated.js.map +1 -1
  83. package/build/cover/edit.js +62 -28
  84. package/build/cover/edit.js.map +1 -1
  85. package/build/cover/edit.native.js +6 -2
  86. package/build/cover/edit.native.js.map +1 -1
  87. package/build/cover/index.js +12 -1
  88. package/build/cover/index.js.map +1 -1
  89. package/build/cover/save.js +17 -14
  90. package/build/cover/save.js.map +1 -1
  91. package/build/cover/shared.js +3 -2
  92. package/build/cover/shared.js.map +1 -1
  93. package/build/embed/edit.native.js +4 -8
  94. package/build/embed/edit.native.js.map +1 -1
  95. package/build/embed/embed-bottom-sheet.native.js +4 -5
  96. package/build/embed/embed-bottom-sheet.native.js.map +1 -1
  97. package/build/embed/embed-no-preview.native.js +2 -1
  98. package/build/embed/embed-no-preview.native.js.map +1 -1
  99. package/build/embed/icons.js +16 -1
  100. package/build/embed/icons.js.map +1 -1
  101. package/build/embed/transforms.native.js +3 -1
  102. package/build/embed/transforms.native.js.map +1 -1
  103. package/build/embed/variations.js +20 -0
  104. package/build/embed/variations.js.map +1 -1
  105. package/build/freeform/edit.js +16 -4
  106. package/build/freeform/edit.js.map +1 -1
  107. package/build/gallery/edit.js +7 -0
  108. package/build/gallery/edit.js.map +1 -1
  109. package/build/gallery/gallery.js +1 -1
  110. package/build/gallery/gallery.js.map +1 -1
  111. package/build/gallery/gallery.native.js +1 -1
  112. package/build/gallery/gallery.native.js.map +1 -1
  113. package/build/gallery/index.js +6 -1
  114. package/build/gallery/index.js.map +1 -1
  115. package/build/gallery/save.js +7 -2
  116. package/build/gallery/save.js.map +1 -1
  117. package/build/gallery/shared.js +0 -7
  118. package/build/gallery/shared.js.map +1 -1
  119. package/build/gallery/use-get-media.js +4 -10
  120. package/build/gallery/use-get-media.js.map +1 -1
  121. package/build/gallery/use-mobile-warning.js +43 -0
  122. package/build/gallery/use-mobile-warning.js.map +1 -0
  123. package/build/group/edit.js +1 -1
  124. package/build/group/edit.js.map +1 -1
  125. package/build/group/index.js +1 -0
  126. package/build/group/index.js.map +1 -1
  127. package/build/group/save.js +4 -5
  128. package/build/group/save.js.map +1 -1
  129. package/build/group/variations.js +2 -1
  130. package/build/group/variations.js.map +1 -1
  131. package/build/heading/autogenerate-anchors.js +90 -0
  132. package/build/heading/autogenerate-anchors.js.map +1 -0
  133. package/build/heading/edit.js +42 -5
  134. package/build/heading/edit.js.map +1 -1
  135. package/build/heading/index.js +14 -2
  136. package/build/heading/index.js.map +1 -1
  137. package/build/heading/transforms.js +14 -2
  138. package/build/heading/transforms.js.map +1 -1
  139. package/build/image/edit.native.js +126 -60
  140. package/build/image/edit.native.js.map +1 -1
  141. package/build/image/index.js +1 -1
  142. package/build/image/transforms.js +2 -1
  143. package/build/image/transforms.js.map +1 -1
  144. package/build/index.js +83 -70
  145. package/build/index.js.map +1 -1
  146. package/build/index.native.js +3 -1
  147. package/build/index.native.js.map +1 -1
  148. package/build/list/deprecated.js +111 -0
  149. package/build/list/deprecated.js.map +1 -0
  150. package/build/list/index.js +15 -3
  151. package/build/list/index.js.map +1 -1
  152. package/build/media-text/edit.js +1 -1
  153. package/build/media-text/edit.js.map +1 -1
  154. package/build/media-text/save.js +3 -3
  155. package/build/media-text/save.js.map +1 -1
  156. package/build/navigation/deprecated.js +340 -23
  157. package/build/navigation/deprecated.js.map +1 -1
  158. package/build/navigation/edit/index.js +372 -0
  159. package/build/navigation/edit/index.js.map +1 -0
  160. package/build/navigation/edit/inner-blocks.js +100 -0
  161. package/build/navigation/edit/inner-blocks.js.map +1 -0
  162. package/build/navigation/edit/navigation-menu-delete-control.js +60 -0
  163. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -0
  164. package/build/navigation/edit/navigation-menu-name-control.js +27 -0
  165. package/build/navigation/edit/navigation-menu-name-control.js.map +1 -0
  166. package/build/navigation/edit/navigation-menu-name-modal.js +54 -0
  167. package/build/navigation/edit/navigation-menu-name-modal.js.map +1 -0
  168. package/build/navigation/edit/navigation-menu-publish-button.js +53 -0
  169. package/build/navigation/edit/navigation-menu-publish-button.js.map +1 -0
  170. package/build/navigation/edit/navigation-menu-selector.js +49 -0
  171. package/build/navigation/edit/navigation-menu-selector.js.map +1 -0
  172. package/build/navigation/edit/placeholder/index.js +207 -0
  173. package/build/navigation/edit/placeholder/index.js.map +1 -0
  174. package/build/navigation/{placeholder-preview.js → edit/placeholder/placeholder-preview.js} +14 -2
  175. package/build/navigation/edit/placeholder/placeholder-preview.js.map +1 -0
  176. package/build/navigation/{responsive-wrapper.js → edit/responsive-wrapper.js} +9 -5
  177. package/build/navigation/edit/responsive-wrapper.js.map +1 -0
  178. package/build/navigation/edit/unsaved-inner-blocks.js +153 -0
  179. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -0
  180. package/build/navigation/{block-navigation-list.js → edit/use-list-view-modal.js} +34 -3
  181. package/build/navigation/edit/use-list-view-modal.js.map +1 -0
  182. package/build/navigation/index.js +25 -13
  183. package/build/navigation/index.js.map +1 -1
  184. package/build/navigation/save.js +10 -1
  185. package/build/navigation/save.js.map +1 -1
  186. package/build/navigation/use-navigation-menu.js +40 -0
  187. package/build/navigation/use-navigation-menu.js.map +1 -0
  188. package/build/navigation/use-template-part-area-label.js +74 -0
  189. package/build/navigation/use-template-part-area-label.js.map +1 -0
  190. package/build/navigation/view.js +29 -26
  191. package/build/navigation/view.js.map +1 -1
  192. package/build/navigation-area/edit.js +97 -0
  193. package/build/navigation-area/edit.js.map +1 -0
  194. package/build/navigation-area/index.js +61 -0
  195. package/build/navigation-area/index.js.map +1 -0
  196. package/build/navigation-area/inner-blocks.js +33 -0
  197. package/build/navigation-area/inner-blocks.js.map +1 -0
  198. package/build/navigation-area/save.js +18 -0
  199. package/build/navigation-area/save.js.map +1 -0
  200. package/build/navigation-link/edit.js +69 -7
  201. package/build/navigation-link/edit.js.map +1 -1
  202. package/build/navigation-link/transforms.js +5 -1
  203. package/build/navigation-link/transforms.js.map +1 -1
  204. package/build/navigation-submenu/edit.js +2 -2
  205. package/build/navigation-submenu/edit.js.map +1 -1
  206. package/build/page-list/edit.js +125 -84
  207. package/build/page-list/edit.js.map +1 -1
  208. package/build/page-list/index.js +1 -35
  209. package/build/page-list/index.js.map +1 -1
  210. package/build/paragraph/edit.native.js +2 -1
  211. package/build/paragraph/edit.native.js.map +1 -1
  212. package/build/paragraph/index.js +8 -1
  213. package/build/paragraph/index.js.map +1 -1
  214. package/build/paragraph/transforms.js +8 -1
  215. package/build/paragraph/transforms.js.map +1 -1
  216. package/build/pattern/edit.js +43 -0
  217. package/build/pattern/edit.js.map +1 -0
  218. package/build/{post-comment-author → pattern}/index.js +11 -10
  219. package/build/pattern/index.js.map +1 -0
  220. package/build/post-author/index.js +12 -1
  221. package/build/post-author/index.js.map +1 -1
  222. package/build/post-comment/edit.js +7 -8
  223. package/build/post-comment/edit.js.map +1 -1
  224. package/build/post-comment/index.js +4 -3
  225. package/build/post-comment/index.js.map +1 -1
  226. package/build/post-comment/save.js +5 -1
  227. package/build/post-comment/save.js.map +1 -1
  228. package/build/post-comments/index.js +8 -1
  229. package/build/post-comments/index.js.map +1 -1
  230. package/build/post-comments-count/index.js +7 -1
  231. package/build/post-comments-count/index.js.map +1 -1
  232. package/build/post-comments-form/index.js +9 -2
  233. package/build/post-comments-form/index.js.map +1 -1
  234. package/build/post-comments-link/index.js +8 -1
  235. package/build/post-comments-link/index.js.map +1 -1
  236. package/build/post-content/edit.js +2 -2
  237. package/build/post-content/edit.js.map +1 -1
  238. package/build/post-date/deprecated.js +71 -0
  239. package/build/post-date/deprecated.js.map +1 -0
  240. package/build/post-date/edit.js +1 -1
  241. package/build/post-date/edit.js.map +1 -1
  242. package/build/post-date/index.js +12 -2
  243. package/build/post-date/index.js.map +1 -1
  244. package/build/post-excerpt/edit.js +1 -1
  245. package/build/post-excerpt/edit.js.map +1 -1
  246. package/build/post-excerpt/index.js +12 -1
  247. package/build/post-excerpt/index.js.map +1 -1
  248. package/build/post-featured-image/index.js +5 -1
  249. package/build/post-featured-image/index.js.map +1 -1
  250. package/build/post-navigation-link/index.js +8 -1
  251. package/build/post-navigation-link/index.js.map +1 -1
  252. package/build/post-template/edit.js +8 -4
  253. package/build/post-template/edit.js.map +1 -1
  254. package/build/post-terms/edit.js +2 -6
  255. package/build/post-terms/edit.js.map +1 -1
  256. package/build/post-terms/index.js +7 -1
  257. package/build/post-terms/index.js.map +1 -1
  258. package/build/post-terms/use-post-terms.js +3 -1
  259. package/build/post-terms/use-post-terms.js.map +1 -1
  260. package/build/post-title/deprecated.js +84 -0
  261. package/build/post-title/deprecated.js.map +1 -0
  262. package/build/post-title/edit.js +1 -1
  263. package/build/post-title/edit.js.map +1 -1
  264. package/build/post-title/index.js +14 -2
  265. package/build/post-title/index.js.map +1 -1
  266. package/build/preformatted/edit.js +5 -2
  267. package/build/preformatted/edit.js.map +1 -1
  268. package/build/preformatted/edit.native.js +16 -6
  269. package/build/preformatted/edit.native.js.map +1 -1
  270. package/build/preformatted/index.js +9 -1
  271. package/build/preformatted/index.js.map +1 -1
  272. package/build/pullquote/blockquote.native.js +14 -2
  273. package/build/pullquote/blockquote.native.js.map +1 -1
  274. package/build/pullquote/edit.native.js +124 -0
  275. package/build/pullquote/edit.native.js.map +1 -0
  276. package/build/pullquote/figure.native.js +20 -8
  277. package/build/pullquote/figure.native.js.map +1 -1
  278. package/build/pullquote/index.js +12 -0
  279. package/build/pullquote/index.js.map +1 -1
  280. package/build/query/edit/index.js +1 -1
  281. package/build/query/edit/index.js.map +1 -1
  282. package/build/query/save.js +5 -1
  283. package/build/query/save.js.map +1 -1
  284. package/build/query-pagination/edit.js +1 -1
  285. package/build/query-pagination/edit.js.map +1 -1
  286. package/build/query-pagination-next/index.js +8 -1
  287. package/build/query-pagination-next/index.js.map +1 -1
  288. package/build/query-pagination-previous/index.js +8 -1
  289. package/build/query-pagination-previous/index.js.map +1 -1
  290. package/build/query-title/deprecated.js +70 -0
  291. package/build/query-title/deprecated.js.map +1 -0
  292. package/build/query-title/index.js +17 -2
  293. package/build/query-title/index.js.map +1 -1
  294. package/build/quote/deprecated.js +9 -0
  295. package/build/quote/deprecated.js.map +1 -1
  296. package/build/quote/index.js +17 -1
  297. package/build/quote/index.js.map +1 -1
  298. package/build/search/edit.js +27 -1
  299. package/build/search/edit.js.map +1 -1
  300. package/build/search/edit.native.js +38 -7
  301. package/build/search/edit.native.js.map +1 -1
  302. package/build/separator/separator-settings.js +1 -0
  303. package/build/separator/separator-settings.js.map +1 -1
  304. package/build/site-logo/edit.js +46 -21
  305. package/build/site-logo/edit.js.map +1 -1
  306. package/build/site-logo/index.js +6 -0
  307. package/build/site-logo/index.js.map +1 -1
  308. package/build/site-tagline/deprecated.js +68 -0
  309. package/build/site-tagline/deprecated.js.map +1 -0
  310. package/build/site-tagline/index.js +11 -3
  311. package/build/site-tagline/index.js.map +1 -1
  312. package/build/site-title/deprecated.js +81 -0
  313. package/build/site-title/deprecated.js.map +1 -0
  314. package/build/site-title/index.js +15 -2
  315. package/build/site-title/index.js.map +1 -1
  316. package/build/social-links/edit.js +2 -1
  317. package/build/social-links/edit.js.map +1 -1
  318. package/build/social-links/index.js +1 -0
  319. package/build/social-links/index.js.map +1 -1
  320. package/build/social-links/save.js +7 -2
  321. package/build/social-links/save.js.map +1 -1
  322. package/build/table/index.js +11 -0
  323. package/build/table/index.js.map +1 -1
  324. package/build/template-part/edit/inner-blocks.js +1 -1
  325. package/build/template-part/edit/inner-blocks.js.map +1 -1
  326. package/build/template-part/edit/placeholder/index.js +3 -3
  327. package/build/template-part/edit/placeholder/index.js.map +1 -1
  328. package/build/template-part/edit/placeholder/patterns-setup.js +3 -2
  329. package/build/template-part/edit/placeholder/patterns-setup.js.map +1 -1
  330. package/build/template-part/edit/selection/template-part-previews.js +1 -1
  331. package/build/template-part/edit/selection/template-part-previews.js.map +1 -1
  332. package/build/template-part/variations.js +1 -1
  333. package/build/template-part/variations.js.map +1 -1
  334. package/build/term-description/edit.js +1 -1
  335. package/build/term-description/edit.js.map +1 -1
  336. package/build/term-description/index.js +4 -1
  337. package/build/term-description/index.js.map +1 -1
  338. package/build/utils/clean-empty-object.js +31 -0
  339. package/build/utils/clean-empty-object.js.map +1 -0
  340. package/build/utils/migrate-font-family.js +49 -0
  341. package/build/utils/migrate-font-family.js.map +1 -0
  342. package/build/verse/deprecated.js +93 -14
  343. package/build/verse/deprecated.js.map +1 -1
  344. package/build/verse/index.js +10 -1
  345. package/build/verse/index.js.map +1 -1
  346. package/build-module/block/edit.js +1 -1
  347. package/build-module/block/edit.js.map +1 -1
  348. package/build-module/button/deprecated.js +155 -11
  349. package/build-module/button/deprecated.js.map +1 -1
  350. package/build-module/button/edit.native.js +259 -331
  351. package/build-module/button/edit.native.js.map +1 -1
  352. package/build-module/button/index.js +4 -1
  353. package/build-module/button/index.js.map +1 -1
  354. package/build-module/buttons/deprecated.js +82 -3
  355. package/build-module/buttons/deprecated.js.map +1 -1
  356. package/build-module/buttons/edit.js +6 -39
  357. package/build-module/buttons/edit.js.map +1 -1
  358. package/build-module/buttons/index.js +16 -13
  359. package/build-module/buttons/index.js.map +1 -1
  360. package/build-module/buttons/save.js +4 -18
  361. package/build-module/buttons/save.js.map +1 -1
  362. package/build-module/buttons/transforms.js +15 -10
  363. package/build-module/buttons/transforms.js.map +1 -1
  364. package/build-module/categories/edit.js +16 -6
  365. package/build-module/categories/edit.js.map +1 -1
  366. package/build-module/categories/index.js +4 -0
  367. package/build-module/categories/index.js.map +1 -1
  368. package/build-module/code/edit.native.js +9 -5
  369. package/build-module/code/edit.native.js.map +1 -1
  370. package/build-module/code/index.js +24 -1
  371. package/build-module/code/index.js.map +1 -1
  372. package/build-module/column/edit.js +4 -2
  373. package/build-module/column/edit.js.map +1 -1
  374. package/build-module/column/index.js +4 -0
  375. package/build-module/column/index.js.map +1 -1
  376. package/build-module/column/save.js +6 -4
  377. package/build-module/column/save.js.map +1 -1
  378. package/build-module/columns/edit.js +1 -1
  379. package/build-module/columns/edit.js.map +1 -1
  380. package/build-module/columns/index.js +1 -0
  381. package/build-module/columns/index.js.map +1 -1
  382. package/build-module/columns/save.js +5 -3
  383. package/build-module/columns/save.js.map +1 -1
  384. package/build-module/comment-author-avatar/edit.js +69 -0
  385. package/build-module/comment-author-avatar/edit.js.map +1 -0
  386. package/build-module/comment-author-avatar/index.js +52 -0
  387. package/build-module/comment-author-avatar/index.js.map +1 -0
  388. package/build-module/comment-author-name/deprecated.js +58 -0
  389. package/build-module/comment-author-name/deprecated.js.map +1 -0
  390. package/build-module/comment-author-name/edit.js +97 -0
  391. package/build-module/comment-author-name/edit.js.map +1 -0
  392. package/build-module/comment-author-name/index.js +63 -0
  393. package/build-module/comment-author-name/index.js.map +1 -0
  394. package/build-module/comment-content/edit.js +61 -0
  395. package/build-module/comment-content/edit.js.map +1 -0
  396. package/build-module/comment-content/index.js +55 -0
  397. package/build-module/comment-content/index.js.map +1 -0
  398. package/build-module/comment-date/deprecated.js +57 -0
  399. package/build-module/comment-date/deprecated.js.map +1 -0
  400. package/build-module/comment-date/edit.js +85 -0
  401. package/build-module/comment-date/edit.js.map +1 -0
  402. package/build-module/comment-date/index.js +58 -0
  403. package/build-module/comment-date/index.js.map +1 -0
  404. package/build-module/comment-edit-link/edit.js +48 -0
  405. package/build-module/comment-edit-link/edit.js.map +1 -0
  406. package/build-module/comment-edit-link/index.js +54 -0
  407. package/build-module/comment-edit-link/index.js.map +1 -0
  408. package/build-module/comment-reply-link/edit.js +50 -0
  409. package/build-module/comment-reply-link/edit.js.map +1 -0
  410. package/build-module/comment-reply-link/index.js +50 -0
  411. package/build-module/comment-reply-link/index.js.map +1 -0
  412. package/build-module/comment-template/edit.js +71 -0
  413. package/build-module/comment-template/edit.js.map +1 -0
  414. package/build-module/comment-template/index.js +35 -0
  415. package/build-module/comment-template/index.js.map +1 -0
  416. package/build-module/comment-template/save.js +10 -0
  417. package/build-module/comment-template/save.js.map +1 -0
  418. package/build-module/comments-query-loop/edit.js +50 -0
  419. package/build-module/comments-query-loop/edit.js.map +1 -0
  420. package/build-module/comments-query-loop/index.js +53 -0
  421. package/build-module/comments-query-loop/index.js.map +1 -0
  422. package/build-module/comments-query-loop/save.js +14 -0
  423. package/build-module/comments-query-loop/save.js.map +1 -0
  424. package/build-module/comments-query-loop/toolbar.js +44 -0
  425. package/build-module/comments-query-loop/toolbar.js.map +1 -0
  426. package/build-module/cover/deprecated.js +183 -21
  427. package/build-module/cover/deprecated.js.map +1 -1
  428. package/build-module/cover/edit.js +62 -28
  429. package/build-module/cover/edit.js.map +1 -1
  430. package/build-module/cover/edit.native.js +6 -2
  431. package/build-module/cover/edit.native.js.map +1 -1
  432. package/build-module/cover/index.js +12 -1
  433. package/build-module/cover/index.js.map +1 -1
  434. package/build-module/cover/save.js +18 -15
  435. package/build-module/cover/save.js.map +1 -1
  436. package/build-module/cover/shared.js +3 -2
  437. package/build-module/cover/shared.js.map +1 -1
  438. package/build-module/embed/edit.native.js +4 -8
  439. package/build-module/embed/edit.native.js.map +1 -1
  440. package/build-module/embed/embed-bottom-sheet.native.js +4 -5
  441. package/build-module/embed/embed-bottom-sheet.native.js.map +1 -1
  442. package/build-module/embed/embed-no-preview.native.js +2 -1
  443. package/build-module/embed/embed-no-preview.native.js.map +1 -1
  444. package/build-module/embed/icons.js +13 -0
  445. package/build-module/embed/icons.js.map +1 -1
  446. package/build-module/embed/transforms.native.js +2 -1
  447. package/build-module/embed/transforms.native.js.map +1 -1
  448. package/build-module/embed/variations.js +21 -1
  449. package/build-module/embed/variations.js.map +1 -1
  450. package/build-module/freeform/edit.js +16 -5
  451. package/build-module/freeform/edit.js.map +1 -1
  452. package/build-module/gallery/edit.js +6 -0
  453. package/build-module/gallery/edit.js.map +1 -1
  454. package/build-module/gallery/gallery.js +1 -1
  455. package/build-module/gallery/gallery.js.map +1 -1
  456. package/build-module/gallery/gallery.native.js +1 -1
  457. package/build-module/gallery/gallery.native.js.map +1 -1
  458. package/build-module/gallery/index.js +6 -1
  459. package/build-module/gallery/index.js.map +1 -1
  460. package/build-module/gallery/save.js +5 -3
  461. package/build-module/gallery/save.js.map +1 -1
  462. package/build-module/gallery/shared.js +0 -6
  463. package/build-module/gallery/shared.js.map +1 -1
  464. package/build-module/gallery/use-get-media.js +4 -10
  465. package/build-module/gallery/use-get-media.js.map +1 -1
  466. package/build-module/gallery/use-mobile-warning.js +32 -0
  467. package/build-module/gallery/use-mobile-warning.js.map +1 -0
  468. package/build-module/group/edit.js +1 -1
  469. package/build-module/group/edit.js.map +1 -1
  470. package/build-module/group/index.js +1 -0
  471. package/build-module/group/index.js.map +1 -1
  472. package/build-module/group/save.js +5 -6
  473. package/build-module/group/save.js.map +1 -1
  474. package/build-module/group/variations.js +2 -1
  475. package/build-module/group/variations.js.map +1 -1
  476. package/build-module/heading/autogenerate-anchors.js +77 -0
  477. package/build-module/heading/autogenerate-anchors.js.map +1 -0
  478. package/build-module/heading/edit.js +43 -7
  479. package/build-module/heading/edit.js.map +1 -1
  480. package/build-module/heading/index.js +14 -2
  481. package/build-module/heading/index.js.map +1 -1
  482. package/build-module/heading/transforms.js +14 -2
  483. package/build-module/heading/transforms.js.map +1 -1
  484. package/build-module/image/edit.native.js +128 -63
  485. package/build-module/image/edit.native.js.map +1 -1
  486. package/build-module/image/index.js +1 -1
  487. package/build-module/image/transforms.js +2 -1
  488. package/build-module/image/transforms.js.map +1 -1
  489. package/build-module/index.js +59 -53
  490. package/build-module/index.js.map +1 -1
  491. package/build-module/index.native.js +1 -2
  492. package/build-module/index.native.js.map +1 -1
  493. package/build-module/list/deprecated.js +99 -0
  494. package/build-module/list/deprecated.js.map +1 -0
  495. package/build-module/list/index.js +14 -3
  496. package/build-module/list/index.js.map +1 -1
  497. package/build-module/media-text/edit.js +1 -1
  498. package/build-module/media-text/edit.js.map +1 -1
  499. package/build-module/media-text/save.js +4 -4
  500. package/build-module/media-text/save.js.map +1 -1
  501. package/build-module/navigation/deprecated.js +336 -23
  502. package/build-module/navigation/deprecated.js.map +1 -1
  503. package/build-module/navigation/edit/index.js +346 -0
  504. package/build-module/navigation/edit/index.js.map +1 -0
  505. package/build-module/navigation/edit/inner-blocks.js +87 -0
  506. package/build-module/navigation/edit/inner-blocks.js.map +1 -0
  507. package/build-module/navigation/edit/navigation-menu-delete-control.js +50 -0
  508. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -0
  509. package/build-module/navigation/edit/navigation-menu-name-control.js +17 -0
  510. package/build-module/navigation/edit/navigation-menu-name-control.js.map +1 -0
  511. package/build-module/navigation/edit/navigation-menu-name-modal.js +46 -0
  512. package/build-module/navigation/edit/navigation-menu-name-modal.js.map +1 -0
  513. package/build-module/navigation/edit/navigation-menu-publish-button.js +40 -0
  514. package/build-module/navigation/edit/navigation-menu-publish-button.js.map +1 -0
  515. package/build-module/navigation/edit/navigation-menu-selector.js +36 -0
  516. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -0
  517. package/build-module/navigation/edit/placeholder/index.js +189 -0
  518. package/build-module/navigation/edit/placeholder/index.js.map +1 -0
  519. package/build-module/navigation/{placeholder-preview.js → edit/placeholder/placeholder-preview.js} +11 -2
  520. package/build-module/navigation/edit/placeholder/placeholder-preview.js.map +1 -0
  521. package/build-module/navigation/{responsive-wrapper.js → edit/responsive-wrapper.js} +9 -5
  522. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -0
  523. package/build-module/navigation/edit/unsaved-inner-blocks.js +136 -0
  524. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -0
  525. package/build-module/navigation/{block-navigation-list.js → edit/use-list-view-modal.js} +31 -2
  526. package/build-module/navigation/edit/use-list-view-modal.js.map +1 -0
  527. package/build-module/navigation/index.js +25 -12
  528. package/build-module/navigation/index.js.map +1 -1
  529. package/build-module/navigation/save.js +10 -1
  530. package/build-module/navigation/save.js.map +1 -1
  531. package/build-module/navigation/use-navigation-menu.js +31 -0
  532. package/build-module/navigation/use-navigation-menu.js.map +1 -0
  533. package/build-module/navigation/use-template-part-area-label.js +63 -0
  534. package/build-module/navigation/use-template-part-area-label.js.map +1 -0
  535. package/build-module/navigation/view.js +28 -26
  536. package/build-module/navigation/view.js.map +1 -1
  537. package/build-module/navigation-area/edit.js +82 -0
  538. package/build-module/navigation-area/edit.js.map +1 -0
  539. package/build-module/navigation-area/index.js +47 -0
  540. package/build-module/navigation-area/index.js.map +1 -0
  541. package/build-module/navigation-area/inner-blocks.js +25 -0
  542. package/build-module/navigation-area/inner-blocks.js.map +1 -0
  543. package/build-module/navigation-area/save.js +10 -0
  544. package/build-module/navigation-area/save.js.map +1 -0
  545. package/build-module/navigation-link/edit.js +72 -10
  546. package/build-module/navigation-link/edit.js.map +1 -1
  547. package/build-module/navigation-link/transforms.js +5 -1
  548. package/build-module/navigation-link/transforms.js.map +1 -1
  549. package/build-module/navigation-submenu/edit.js +2 -2
  550. package/build-module/navigation-submenu/edit.js.map +1 -1
  551. package/build-module/page-list/edit.js +127 -86
  552. package/build-module/page-list/edit.js.map +1 -1
  553. package/build-module/page-list/index.js +1 -35
  554. package/build-module/page-list/index.js.map +1 -1
  555. package/build-module/paragraph/edit.native.js +2 -1
  556. package/build-module/paragraph/edit.native.js.map +1 -1
  557. package/build-module/paragraph/index.js +8 -1
  558. package/build-module/paragraph/index.js.map +1 -1
  559. package/build-module/paragraph/transforms.js +8 -1
  560. package/build-module/paragraph/transforms.js.map +1 -1
  561. package/build-module/pattern/edit.js +35 -0
  562. package/build-module/pattern/edit.js.map +1 -0
  563. package/build-module/pattern/index.js +29 -0
  564. package/build-module/pattern/index.js.map +1 -0
  565. package/build-module/post-author/index.js +12 -1
  566. package/build-module/post-author/index.js.map +1 -1
  567. package/build-module/post-comment/edit.js +8 -9
  568. package/build-module/post-comment/edit.js.map +1 -1
  569. package/build-module/post-comment/index.js +4 -3
  570. package/build-module/post-comment/index.js.map +1 -1
  571. package/build-module/post-comment/save.js +4 -2
  572. package/build-module/post-comment/save.js.map +1 -1
  573. package/build-module/post-comments/index.js +8 -1
  574. package/build-module/post-comments/index.js.map +1 -1
  575. package/build-module/post-comments-count/index.js +7 -1
  576. package/build-module/post-comments-count/index.js.map +1 -1
  577. package/build-module/post-comments-form/index.js +9 -2
  578. package/build-module/post-comments-form/index.js.map +1 -1
  579. package/build-module/post-comments-link/index.js +8 -1
  580. package/build-module/post-comments-link/index.js.map +1 -1
  581. package/build-module/post-content/edit.js +2 -2
  582. package/build-module/post-content/edit.js.map +1 -1
  583. package/build-module/post-date/deprecated.js +60 -0
  584. package/build-module/post-date/deprecated.js.map +1 -0
  585. package/build-module/post-date/edit.js +1 -1
  586. package/build-module/post-date/edit.js.map +1 -1
  587. package/build-module/post-date/index.js +11 -2
  588. package/build-module/post-date/index.js.map +1 -1
  589. package/build-module/post-excerpt/edit.js +1 -1
  590. package/build-module/post-excerpt/edit.js.map +1 -1
  591. package/build-module/post-excerpt/index.js +12 -1
  592. package/build-module/post-excerpt/index.js.map +1 -1
  593. package/build-module/post-featured-image/index.js +5 -1
  594. package/build-module/post-featured-image/index.js.map +1 -1
  595. package/build-module/post-navigation-link/index.js +8 -1
  596. package/build-module/post-navigation-link/index.js.map +1 -1
  597. package/build-module/post-template/edit.js +10 -5
  598. package/build-module/post-template/edit.js.map +1 -1
  599. package/build-module/post-terms/edit.js +2 -6
  600. package/build-module/post-terms/edit.js.map +1 -1
  601. package/build-module/post-terms/index.js +7 -1
  602. package/build-module/post-terms/index.js.map +1 -1
  603. package/build-module/post-terms/use-post-terms.js +3 -1
  604. package/build-module/post-terms/use-post-terms.js.map +1 -1
  605. package/build-module/post-title/deprecated.js +73 -0
  606. package/build-module/post-title/deprecated.js.map +1 -0
  607. package/build-module/post-title/edit.js +1 -1
  608. package/build-module/post-title/edit.js.map +1 -1
  609. package/build-module/post-title/index.js +13 -2
  610. package/build-module/post-title/index.js.map +1 -1
  611. package/build-module/preformatted/edit.js +5 -2
  612. package/build-module/preformatted/edit.js.map +1 -1
  613. package/build-module/preformatted/edit.native.js +17 -6
  614. package/build-module/preformatted/edit.native.js.map +1 -1
  615. package/build-module/preformatted/index.js +9 -1
  616. package/build-module/preformatted/index.js.map +1 -1
  617. package/build-module/pullquote/blockquote.native.js +14 -2
  618. package/build-module/pullquote/blockquote.native.js.map +1 -1
  619. package/build-module/pullquote/edit.native.js +112 -0
  620. package/build-module/pullquote/edit.native.js.map +1 -0
  621. package/build-module/pullquote/figure.native.js +20 -9
  622. package/build-module/pullquote/figure.native.js.map +1 -1
  623. package/build-module/pullquote/index.js +12 -0
  624. package/build-module/pullquote/index.js.map +1 -1
  625. package/build-module/query/edit/index.js +1 -1
  626. package/build-module/query/edit/index.js.map +1 -1
  627. package/build-module/query/save.js +4 -2
  628. package/build-module/query/save.js.map +1 -1
  629. package/build-module/query-pagination/edit.js +1 -1
  630. package/build-module/query-pagination/edit.js.map +1 -1
  631. package/build-module/query-pagination-next/index.js +8 -1
  632. package/build-module/query-pagination-next/index.js.map +1 -1
  633. package/build-module/query-pagination-previous/index.js +8 -1
  634. package/build-module/query-pagination-previous/index.js.map +1 -1
  635. package/build-module/query-title/deprecated.js +59 -0
  636. package/build-module/query-title/deprecated.js.map +1 -0
  637. package/build-module/query-title/index.js +16 -2
  638. package/build-module/query-title/index.js.map +1 -1
  639. package/build-module/quote/deprecated.js +9 -0
  640. package/build-module/quote/deprecated.js.map +1 -1
  641. package/build-module/quote/index.js +17 -1
  642. package/build-module/quote/index.js.map +1 -1
  643. package/build-module/search/edit.js +28 -2
  644. package/build-module/search/edit.js.map +1 -1
  645. package/build-module/search/edit.native.js +38 -7
  646. package/build-module/search/edit.native.js.map +1 -1
  647. package/build-module/separator/separator-settings.js +1 -0
  648. package/build-module/separator/separator-settings.js.map +1 -1
  649. package/build-module/site-logo/edit.js +49 -26
  650. package/build-module/site-logo/edit.js.map +1 -1
  651. package/build-module/site-logo/index.js +6 -0
  652. package/build-module/site-logo/index.js.map +1 -1
  653. package/build-module/site-tagline/deprecated.js +57 -0
  654. package/build-module/site-tagline/deprecated.js.map +1 -0
  655. package/build-module/site-tagline/index.js +10 -3
  656. package/build-module/site-tagline/index.js.map +1 -1
  657. package/build-module/site-title/deprecated.js +70 -0
  658. package/build-module/site-title/deprecated.js.map +1 -0
  659. package/build-module/site-title/index.js +14 -2
  660. package/build-module/site-title/index.js.map +1 -1
  661. package/build-module/social-links/edit.js +2 -1
  662. package/build-module/social-links/edit.js.map +1 -1
  663. package/build-module/social-links/index.js +1 -0
  664. package/build-module/social-links/index.js.map +1 -1
  665. package/build-module/social-links/save.js +5 -3
  666. package/build-module/social-links/save.js.map +1 -1
  667. package/build-module/table/index.js +11 -0
  668. package/build-module/table/index.js.map +1 -1
  669. package/build-module/template-part/edit/inner-blocks.js +1 -1
  670. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  671. package/build-module/template-part/edit/placeholder/index.js +3 -3
  672. package/build-module/template-part/edit/placeholder/index.js.map +1 -1
  673. package/build-module/template-part/edit/placeholder/patterns-setup.js +3 -2
  674. package/build-module/template-part/edit/placeholder/patterns-setup.js.map +1 -1
  675. package/build-module/template-part/edit/selection/template-part-previews.js +1 -1
  676. package/build-module/template-part/edit/selection/template-part-previews.js.map +1 -1
  677. package/build-module/template-part/variations.js +2 -2
  678. package/build-module/template-part/variations.js.map +1 -1
  679. package/build-module/term-description/edit.js +1 -1
  680. package/build-module/term-description/edit.js.map +1 -1
  681. package/build-module/term-description/index.js +4 -1
  682. package/build-module/term-description/index.js.map +1 -1
  683. package/build-module/utils/clean-empty-object.js +22 -0
  684. package/build-module/utils/clean-empty-object.js.map +1 -0
  685. package/build-module/utils/migrate-font-family.js +38 -0
  686. package/build-module/utils/migrate-font-family.js.map +1 -0
  687. package/build-module/verse/deprecated.js +90 -15
  688. package/build-module/verse/deprecated.js.map +1 -1
  689. package/build-module/verse/index.js +10 -1
  690. package/build-module/verse/index.js.map +1 -1
  691. package/build-style/button/editor-rtl.css +0 -1
  692. package/build-style/button/editor.css +0 -1
  693. package/build-style/button/style-rtl.css +15 -27
  694. package/build-style/button/style.css +15 -27
  695. package/build-style/buttons/editor-rtl.css +4 -8
  696. package/build-style/buttons/editor.css +4 -8
  697. package/build-style/buttons/style-rtl.css +1 -35
  698. package/build-style/buttons/style.css +1 -48
  699. package/build-style/columns/style-rtl.css +1 -1
  700. package/build-style/columns/style.css +1 -1
  701. package/build-style/common-rtl.css +2 -16
  702. package/build-style/common.css +2 -16
  703. package/build-style/cover/editor-rtl.css +14 -32
  704. package/build-style/cover/editor.css +14 -32
  705. package/build-style/cover/style-rtl.css +28 -40
  706. package/build-style/cover/style.css +28 -40
  707. package/build-style/editor-rtl.css +198 -145
  708. package/build-style/editor.css +198 -145
  709. package/build-style/image/editor-rtl.css +1 -0
  710. package/build-style/image/editor.css +1 -0
  711. package/build-style/image/style-rtl.css +4 -0
  712. package/build-style/image/style.css +4 -0
  713. package/build-style/media-text/style-rtl.css +1 -0
  714. package/build-style/media-text/style.css +1 -0
  715. package/build-style/navigation/editor-rtl.css +58 -16
  716. package/build-style/navigation/editor.css +58 -16
  717. package/build-style/navigation/style-rtl.css +51 -112
  718. package/build-style/navigation/style.css +51 -112
  719. package/build-style/navigation-link/editor-rtl.css +31 -14
  720. package/build-style/navigation-link/editor.css +31 -14
  721. package/build-style/navigation-link/style-rtl.css +1 -1
  722. package/build-style/navigation-link/style.css +1 -1
  723. package/build-style/navigation-submenu/editor-rtl.css +1 -1
  724. package/build-style/navigation-submenu/editor.css +1 -1
  725. package/build-style/navigation-submenu/style-rtl.css +2 -0
  726. package/build-style/navigation-submenu/style.css +2 -0
  727. package/build-style/page-list/style-rtl.css +4 -16
  728. package/build-style/page-list/style.css +4 -16
  729. package/build-style/post-author/style-rtl.css +0 -1
  730. package/build-style/post-author/style.css +0 -1
  731. package/build-style/post-comments/style-rtl.css +21 -1
  732. package/build-style/post-comments/style.css +21 -1
  733. package/build-style/post-comments-form/style-rtl.css +29 -0
  734. package/build-style/post-comments-form/style.css +29 -0
  735. package/build-style/post-featured-image/editor-rtl.css +1 -1
  736. package/build-style/post-featured-image/editor.css +1 -1
  737. package/build-style/post-featured-image/style-rtl.css +1 -1
  738. package/build-style/post-featured-image/style.css +1 -1
  739. package/build-style/quote/theme-rtl.css +1 -1
  740. package/build-style/quote/theme.css +1 -1
  741. package/build-style/reset-rtl.css +0 -5
  742. package/build-style/reset.css +0 -5
  743. package/build-style/search/style-rtl.css +18 -6
  744. package/build-style/search/style.css +18 -6
  745. package/build-style/separator/style-rtl.css +0 -1
  746. package/build-style/separator/style.css +0 -1
  747. package/build-style/site-logo/editor-rtl.css +82 -14
  748. package/build-style/site-logo/editor.css +82 -14
  749. package/build-style/site-logo/style-rtl.css +6 -2
  750. package/build-style/site-logo/style.css +6 -2
  751. package/build-style/social-link/editor-rtl.css +4 -0
  752. package/build-style/social-link/editor.css +4 -0
  753. package/build-style/social-links/editor-rtl.css +4 -0
  754. package/build-style/social-links/editor.css +4 -0
  755. package/build-style/social-links/style-rtl.css +7 -1
  756. package/build-style/social-links/style.css +7 -1
  757. package/build-style/style-rtl.css +192 -261
  758. package/build-style/style.css +192 -274
  759. package/build-style/template-part/editor-rtl.css +0 -7
  760. package/build-style/template-part/editor.css +0 -7
  761. package/build-style/theme-rtl.css +1 -1
  762. package/build-style/theme.css +1 -1
  763. package/package.json +20 -19
  764. package/src/audio/test/edit.native.js +4 -0
  765. package/src/block/edit.js +1 -1
  766. package/src/button/block.json +4 -1
  767. package/src/button/deprecated.js +149 -4
  768. package/src/button/edit.native.js +319 -366
  769. package/src/button/editor.scss +0 -1
  770. package/src/button/style.scss +18 -41
  771. package/src/buttons/block.json +15 -10
  772. package/src/buttons/deprecated.js +76 -3
  773. package/src/buttons/edit.js +4 -49
  774. package/src/buttons/editor.scss +8 -9
  775. package/src/buttons/index.js +0 -2
  776. package/src/buttons/save.js +4 -21
  777. package/src/buttons/style.scss +1 -51
  778. package/src/categories/block.json +4 -0
  779. package/src/categories/edit.js +36 -18
  780. package/src/categories/index.php +3 -0
  781. package/src/code/block.json +24 -1
  782. package/src/code/edit.native.js +12 -14
  783. package/src/column/block.json +4 -0
  784. package/src/column/edit.js +8 -2
  785. package/src/column/save.js +9 -12
  786. package/src/columns/block.json +1 -0
  787. package/src/columns/edit.js +1 -1
  788. package/src/columns/save.js +5 -6
  789. package/src/columns/style.scss +1 -1
  790. package/src/comment-author-avatar/block.json +34 -0
  791. package/src/comment-author-avatar/edit.js +96 -0
  792. package/src/comment-author-avatar/index.js +18 -0
  793. package/src/comment-author-avatar/index.php +62 -0
  794. package/src/comment-author-name/block.json +43 -0
  795. package/src/comment-author-name/deprecated.js +50 -0
  796. package/src/comment-author-name/edit.js +124 -0
  797. package/src/comment-author-name/index.js +20 -0
  798. package/src/comment-author-name/index.php +57 -0
  799. package/src/comment-content/block.json +37 -0
  800. package/src/comment-content/edit.js +80 -0
  801. package/src/{post-comment-content → comment-content}/index.js +1 -1
  802. package/src/comment-content/index.php +56 -0
  803. package/src/comment-date/block.json +38 -0
  804. package/src/comment-date/deprecated.js +49 -0
  805. package/src/comment-date/edit.js +106 -0
  806. package/src/{post-comment-date → comment-date}/index.js +2 -0
  807. package/src/comment-date/index.php +56 -0
  808. package/src/comment-edit-link/block.json +36 -0
  809. package/src/comment-edit-link/edit.js +68 -0
  810. package/src/{post-comment-author → comment-edit-link}/index.js +5 -5
  811. package/src/comment-edit-link/index.php +58 -0
  812. package/src/comment-reply-link/block.json +32 -0
  813. package/src/comment-reply-link/edit.js +59 -0
  814. package/src/comment-reply-link/index.js +18 -0
  815. package/src/comment-reply-link/index.php +80 -0
  816. package/src/comment-template/block.json +15 -0
  817. package/src/comment-template/edit.js +100 -0
  818. package/src/comment-template/index.js +20 -0
  819. package/src/comment-template/index.php +65 -0
  820. package/src/comment-template/save.js +8 -0
  821. package/src/comments-query-loop/block.json +33 -0
  822. package/src/comments-query-loop/edit.js +53 -0
  823. package/src/comments-query-loop/index.js +20 -0
  824. package/src/comments-query-loop/save.js +14 -0
  825. package/src/comments-query-loop/toolbar.js +57 -0
  826. package/src/common.scss +3 -17
  827. package/src/cover/block.json +12 -1
  828. package/src/cover/deprecated.js +707 -510
  829. package/src/cover/edit.js +70 -42
  830. package/src/cover/edit.native.js +5 -1
  831. package/src/cover/editor.scss +20 -38
  832. package/src/cover/save.js +30 -26
  833. package/src/cover/shared.js +3 -2
  834. package/src/cover/style.scss +9 -7
  835. package/src/editor.scss +4 -20
  836. package/src/embed/edit.native.js +6 -9
  837. package/src/embed/embed-bottom-sheet.native.js +4 -5
  838. package/src/embed/embed-no-preview.native.js +1 -0
  839. package/src/embed/icons.js +11 -0
  840. package/src/embed/test/__snapshots__/index.native.js.snap +181 -0
  841. package/src/embed/test/index.native.js +991 -0
  842. package/src/embed/transforms.native.js +2 -0
  843. package/src/embed/variations.js +21 -0
  844. package/src/file/test/__snapshots__/edit.native.js.snap +6 -3
  845. package/src/file/test/edit.native.js +4 -0
  846. package/src/freeform/edit.js +14 -4
  847. package/src/gallery/block.json +6 -1
  848. package/src/gallery/edit.js +7 -0
  849. package/src/gallery/editor.scss +0 -1
  850. package/src/gallery/gallery.js +1 -4
  851. package/src/gallery/gallery.native.js +1 -4
  852. package/src/gallery/index.php +52 -0
  853. package/src/gallery/save.js +9 -3
  854. package/src/gallery/shared.js +0 -7
  855. package/src/gallery/use-get-media.js +6 -11
  856. package/src/gallery/use-mobile-warning.js +28 -0
  857. package/src/group/block.json +1 -0
  858. package/src/group/edit.js +1 -1
  859. package/src/group/save.js +3 -8
  860. package/src/group/variations.js +1 -1
  861. package/src/heading/autogenerate-anchors.js +81 -0
  862. package/src/heading/block.json +14 -2
  863. package/src/heading/edit.js +42 -4
  864. package/src/home-link/index.php +3 -1
  865. package/src/image/block.json +1 -1
  866. package/src/image/edit.native.js +120 -64
  867. package/src/image/editor.scss +1 -0
  868. package/src/image/index.php +42 -0
  869. package/src/image/style.scss +8 -2
  870. package/src/image/test/edit.native.js +225 -40
  871. package/src/image/transforms.js +4 -0
  872. package/src/index.js +96 -88
  873. package/src/index.native.js +1 -1
  874. package/src/list/block.json +11 -2
  875. package/src/list/deprecated.js +79 -0
  876. package/src/list/index.js +2 -0
  877. package/src/media-text/edit.js +1 -1
  878. package/src/media-text/save.js +6 -4
  879. package/src/media-text/style.scss +1 -0
  880. package/src/navigation/block.json +41 -13
  881. package/src/navigation/deprecated.js +336 -27
  882. package/src/navigation/edit/index.js +510 -0
  883. package/src/navigation/edit/inner-blocks.js +134 -0
  884. package/src/navigation/edit/navigation-menu-delete-control.js +81 -0
  885. package/src/navigation/edit/navigation-menu-name-control.js +22 -0
  886. package/src/navigation/edit/navigation-menu-name-modal.js +69 -0
  887. package/src/navigation/edit/navigation-menu-publish-button.js +57 -0
  888. package/src/navigation/edit/navigation-menu-selector.js +42 -0
  889. package/src/navigation/edit/placeholder/index.js +257 -0
  890. package/src/navigation/{placeholder-preview.js → edit/placeholder/placeholder-preview.js} +13 -2
  891. package/src/navigation/{responsive-wrapper.js → edit/responsive-wrapper.js} +8 -6
  892. package/src/navigation/edit/unsaved-inner-blocks.js +197 -0
  893. package/src/navigation/edit/use-list-view-modal.js +72 -0
  894. package/src/navigation/editor.scss +86 -31
  895. package/src/navigation/index.js +0 -2
  896. package/src/navigation/index.php +54 -107
  897. package/src/navigation/save.js +7 -1
  898. package/src/navigation/style.scss +81 -155
  899. package/src/navigation/use-navigation-menu.js +60 -0
  900. package/src/navigation/use-template-part-area-label.js +78 -0
  901. package/src/navigation/view.js +33 -32
  902. package/src/navigation-area/block.json +27 -0
  903. package/src/navigation-area/edit.js +105 -0
  904. package/src/navigation-area/index.js +26 -0
  905. package/src/navigation-area/index.php +21 -0
  906. package/src/navigation-area/inner-blocks.js +24 -0
  907. package/src/navigation-area/save.js +8 -0
  908. package/src/navigation-link/edit.js +97 -12
  909. package/src/navigation-link/editor.scss +30 -19
  910. package/src/navigation-link/index.php +8 -10
  911. package/src/navigation-link/style.scss +1 -1
  912. package/src/navigation-link/transforms.js +5 -1
  913. package/src/navigation-submenu/edit.js +2 -2
  914. package/src/navigation-submenu/editor.scss +1 -1
  915. package/src/navigation-submenu/index.php +10 -9
  916. package/src/navigation-submenu/style.scss +5 -0
  917. package/src/page-list/block.json +0 -33
  918. package/src/page-list/edit.js +168 -110
  919. package/src/page-list/index.php +27 -26
  920. package/src/page-list/style.scss +4 -23
  921. package/src/paragraph/block.json +8 -1
  922. package/src/paragraph/edit.native.js +1 -0
  923. package/src/pattern/block.json +17 -0
  924. package/src/pattern/edit.js +41 -0
  925. package/src/pattern/index.js +12 -0
  926. package/src/pattern/index.php +44 -0
  927. package/src/post-author/block.json +12 -1
  928. package/src/post-author/style.scss +0 -1
  929. package/src/post-comment/block.json +4 -3
  930. package/src/post-comment/edit.js +16 -13
  931. package/src/post-comment/save.js +4 -6
  932. package/src/post-comments/block.json +8 -1
  933. package/src/post-comments/index.php +12 -3
  934. package/src/post-comments/style.scss +27 -1
  935. package/src/post-comments-count/block.json +7 -1
  936. package/src/post-comments-form/block.json +9 -2
  937. package/src/post-comments-form/index.php +0 -14
  938. package/src/post-comments-form/style.scss +47 -7
  939. package/src/post-comments-link/block.json +8 -1
  940. package/src/post-content/edit.js +2 -2
  941. package/src/post-date/block.json +8 -1
  942. package/src/post-date/deprecated.js +52 -0
  943. package/src/post-date/edit.js +1 -1
  944. package/src/post-date/index.js +2 -0
  945. package/src/post-excerpt/block.json +12 -1
  946. package/src/post-excerpt/edit.js +1 -7
  947. package/src/post-excerpt/index.php +7 -1
  948. package/src/post-featured-image/block.json +5 -1
  949. package/src/post-featured-image/editor.scss +1 -1
  950. package/src/post-featured-image/style.scss +1 -1
  951. package/src/post-navigation-link/block.json +8 -1
  952. package/src/post-navigation-link/index.php +1 -2
  953. package/src/post-template/edit.js +8 -3
  954. package/src/post-template/index.php +0 -11
  955. package/src/post-terms/block.json +7 -1
  956. package/src/post-terms/edit.js +2 -14
  957. package/src/post-terms/use-post-terms.js +1 -1
  958. package/src/post-title/block.json +10 -1
  959. package/src/post-title/deprecated.js +65 -0
  960. package/src/post-title/edit.js +1 -1
  961. package/src/post-title/index.js +2 -0
  962. package/src/post-title/index.php +7 -2
  963. package/src/preformatted/block.json +9 -1
  964. package/src/preformatted/edit.js +2 -1
  965. package/src/preformatted/edit.native.js +20 -6
  966. package/src/preformatted/styles.native.scss +5 -0
  967. package/src/preformatted/test/__snapshots__/edit.native.js.snap +20 -2
  968. package/src/pullquote/block.json +12 -0
  969. package/src/pullquote/blockquote.native.js +12 -2
  970. package/src/pullquote/edit.native.js +129 -0
  971. package/src/pullquote/figure.native.js +17 -7
  972. package/src/query/edit/index.js +1 -1
  973. package/src/query/save.js +4 -6
  974. package/src/query-pagination/edit.js +1 -1
  975. package/src/query-pagination-next/block.json +8 -1
  976. package/src/query-pagination-previous/block.json +8 -1
  977. package/src/query-title/block.json +13 -1
  978. package/src/query-title/deprecated.js +51 -0
  979. package/src/query-title/index.js +2 -0
  980. package/src/quote/block.json +15 -1
  981. package/src/quote/deprecated.js +10 -0
  982. package/src/quote/theme.scss +1 -0
  983. package/src/reset.scss +0 -9
  984. package/src/search/edit.js +29 -0
  985. package/src/search/edit.native.js +46 -12
  986. package/src/search/style.scss +54 -52
  987. package/src/search/test/__snapshots__/edit.native.js.snap +33 -5
  988. package/src/search/test/edit.native.js +4 -0
  989. package/src/separator/separator-settings.js +1 -0
  990. package/src/separator/style.scss +0 -1
  991. package/src/site-logo/block.json +6 -0
  992. package/src/site-logo/edit.js +59 -34
  993. package/src/site-logo/editor.scss +101 -16
  994. package/src/site-logo/index.php +20 -19
  995. package/src/site-logo/style.scss +8 -2
  996. package/src/site-tagline/block.json +7 -2
  997. package/src/site-tagline/deprecated.js +49 -0
  998. package/src/site-tagline/index.js +2 -0
  999. package/src/site-title/block.json +11 -1
  1000. package/src/site-title/deprecated.js +62 -0
  1001. package/src/site-title/index.js +2 -0
  1002. package/src/site-title/index.php +3 -0
  1003. package/src/social-link/editor.scss +4 -0
  1004. package/src/social-links/block.json +1 -0
  1005. package/src/social-links/edit.js +2 -1
  1006. package/src/social-links/editor.scss +4 -0
  1007. package/src/social-links/save.js +4 -6
  1008. package/src/social-links/style.scss +8 -1
  1009. package/src/table/block.json +11 -0
  1010. package/src/template-part/edit/inner-blocks.js +1 -1
  1011. package/src/template-part/edit/placeholder/index.js +5 -3
  1012. package/src/template-part/edit/placeholder/patterns-setup.js +3 -2
  1013. package/src/template-part/edit/selection/template-part-previews.js +3 -1
  1014. package/src/template-part/editor.scss +0 -16
  1015. package/src/template-part/index.php +6 -3
  1016. package/src/template-part/variations.js +2 -2
  1017. package/src/term-description/block.json +4 -1
  1018. package/src/term-description/edit.js +1 -1
  1019. package/src/utils/clean-empty-object.js +23 -0
  1020. package/src/utils/migrate-font-family.js +37 -0
  1021. package/src/verse/block.json +10 -1
  1022. package/src/verse/deprecated.js +86 -25
  1023. package/build/buttons/variations.js +0 -33
  1024. package/build/buttons/variations.js.map +0 -1
  1025. package/build/navigation/block-navigation-list.js.map +0 -1
  1026. package/build/navigation/edit.js +0 -304
  1027. package/build/navigation/edit.js.map +0 -1
  1028. package/build/navigation/placeholder-preview.js.map +0 -1
  1029. package/build/navigation/placeholder.js +0 -129
  1030. package/build/navigation/placeholder.js.map +0 -1
  1031. package/build/navigation/responsive-wrapper.js.map +0 -1
  1032. package/build/navigation/use-block-navigator.js +0 -51
  1033. package/build/navigation/use-block-navigator.js.map +0 -1
  1034. package/build/navigation/variations.js +0 -32
  1035. package/build/navigation/variations.js.map +0 -1
  1036. package/build/post-comment-author/edit.js +0 -51
  1037. package/build/post-comment-author/edit.js.map +0 -1
  1038. package/build/post-comment-author/index.js.map +0 -1
  1039. package/build/post-comment-content/edit.js +0 -37
  1040. package/build/post-comment-content/edit.js.map +0 -1
  1041. package/build/post-comment-content/index.js.map +0 -1
  1042. package/build/post-comment-date/edit.js +0 -62
  1043. package/build/post-comment-date/edit.js.map +0 -1
  1044. package/build/post-comment-date/index.js.map +0 -1
  1045. package/build-module/buttons/variations.js +0 -24
  1046. package/build-module/buttons/variations.js.map +0 -1
  1047. package/build-module/navigation/block-navigation-list.js.map +0 -1
  1048. package/build-module/navigation/edit.js +0 -284
  1049. package/build-module/navigation/edit.js.map +0 -1
  1050. package/build-module/navigation/placeholder-preview.js.map +0 -1
  1051. package/build-module/navigation/placeholder.js +0 -113
  1052. package/build-module/navigation/placeholder.js.map +0 -1
  1053. package/build-module/navigation/responsive-wrapper.js.map +0 -1
  1054. package/build-module/navigation/use-block-navigator.js +0 -39
  1055. package/build-module/navigation/use-block-navigator.js.map +0 -1
  1056. package/build-module/navigation/variations.js +0 -23
  1057. package/build-module/navigation/variations.js.map +0 -1
  1058. package/build-module/post-comment-author/edit.js +0 -40
  1059. package/build-module/post-comment-author/edit.js.map +0 -1
  1060. package/build-module/post-comment-author/index.js +0 -31
  1061. package/build-module/post-comment-author/index.js.map +0 -1
  1062. package/build-module/post-comment-content/edit.js +0 -27
  1063. package/build-module/post-comment-content/edit.js.map +0 -1
  1064. package/build-module/post-comment-content/index.js +0 -31
  1065. package/build-module/post-comment-content/index.js.map +0 -1
  1066. package/build-module/post-comment-date/edit.js +0 -52
  1067. package/build-module/post-comment-date/edit.js.map +0 -1
  1068. package/build-module/post-comment-date/index.js +0 -36
  1069. package/build-module/post-comment-date/index.js.map +0 -1
  1070. package/build-style/post-author/editor-rtl.css +0 -104
  1071. package/build-style/post-author/editor.css +0 -104
  1072. package/build-style/query-title/editor-rtl.css +0 -80
  1073. package/build-style/query-title/editor.css +0 -80
  1074. package/build-style/term-description/editor-rtl.css +0 -80
  1075. package/build-style/term-description/editor.css +0 -80
  1076. package/src/buttons/variations.js +0 -24
  1077. package/src/navigation/block-navigation-list.js +0 -38
  1078. package/src/navigation/edit.js +0 -411
  1079. package/src/navigation/placeholder.js +0 -154
  1080. package/src/navigation/use-block-navigator.js +0 -46
  1081. package/src/navigation/variations.js +0 -23
  1082. package/src/post-author/editor.scss +0 -35
  1083. package/src/post-comment-author/block.json +0 -13
  1084. package/src/post-comment-author/edit.js +0 -35
  1085. package/src/post-comment-author/index.php +0 -41
  1086. package/src/post-comment-content/block.json +0 -13
  1087. package/src/post-comment-content/edit.js +0 -32
  1088. package/src/post-comment-content/index.php +0 -42
  1089. package/src/post-comment-date/block.json +0 -18
  1090. package/src/post-comment-date/edit.js +0 -54
  1091. package/src/post-comment-date/index.php +0 -44
  1092. package/src/query-title/editor.scss +0 -4
  1093. package/src/term-description/editor.scss +0 -4
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/gallery/edit.js"],"names":["classnames","concat","find","compose","BaseControl","PanelBody","SelectControl","ToggleControl","withNotices","RangeControl","Spinner","store","blockEditorStore","MediaPlaceholder","InspectorControls","useBlockProps","Platform","useEffect","useMemo","__","_x","sprintf","useSelect","useDispatch","withViewportMatch","View","createBlock","createBlobURL","noticesStore","sharedIcon","defaultColumnsNumber","pickRelevantMediaFiles","getHrefAndDestination","getUpdatedLinkTargetSettings","getImageSizeAttributes","Gallery","LINK_DESTINATION_ATTACHMENT","LINK_DESTINATION_MEDIA","LINK_DESTINATION_NONE","useImageSizes","useShortCodeTransform","useGetNewImages","useGetMedia","MAX_COLUMNS","linkOptions","value","label","ALLOWED_MEDIA_TYPES","PLACEHOLDER_TEXT","isNative","MOBILE_CONTROL_PROPS_RANGE_CONTROL","type","GalleryEdit","props","setAttributes","attributes","className","clientId","noticeOperations","isSelected","noticeUI","insertBlocksAfter","columns","imageCrop","linkTarget","linkTo","shortCodeTransforms","sizeSlug","__unstableMarkNextChangeAsNotPersistent","replaceInnerBlocks","updateBlockAttributes","createSuccessNotice","getBlock","getSettings","preferredStyle","select","settings","preferredStyleVariations","__experimentalPreferredStyleVariations","innerBlockImages","innerBlocks","images","map","block","id","url","fromSavedContent","Boolean","originalContent","imageData","newImages","forEach","newImage","buildImageAttributes","align","undefined","shortCodeImages","updateImages","imageSizeOptions","existingBlock","image","newClassName","isValidFileType","file","some","mediaType","indexOf","selectedImages","newFileUploads","Object","prototype","toString","call","imageArray","Array","from","every","removeAllNotices","createErrorNotice","processedImages","filter","newOrderMap","reduce","result","index","existingImageBlocks","img","newImageList","existingImg","newBlocks","caption","alt","sort","a","b","onUploadError","message","setLinkTo","changedAttributes","blocks","push","linkToText","linkType","setColumnsNumber","toggleImageCrop","getImageCropHelp","checked","toggleOpenInNewTab","openInNewTab","newLinkTarget","noticeText","updateImagesSize","newSizeSlug","imageSize","size","window","wp","media","view","defaultProps","link","hasImages","length","hasImageIds","imagesUploading","mediaPlaceholder","title","instructions","blockProps","hasLinkTo","Math","min","isWeb","isNarrow"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,MAAT,EAAiBC,IAAjB,QAA6B,QAA7B;AAEA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SACCC,WADD,EAECC,SAFD,EAGCC,aAHD,EAICC,aAJD,EAKCC,WALD,EAMCC,YAND,EAOCC,OAPD,QAQO,uBARP;AASA,SACCC,KAAK,IAAIC,gBADV,EAECC,gBAFD,EAGCC,iBAHD,EAICC,aAJD,QAKO,yBALP;AAMA,SAASC,QAAT,EAAmBC,SAAnB,EAA8BC,OAA9B,QAA6C,oBAA7C;AACA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,iBAAT,QAAkC,qBAAlC;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,WAAT,QAA4B,mBAA5B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAAShB,KAAK,IAAIiB,YAAlB,QAAsC,oBAAtC;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,eAA3B;AACA,SAASC,oBAAT,EAA+BC,sBAA/B,QAA6D,UAA7D;AACA,SAASC,qBAAT,QAAsC,SAAtC;AACA,SACCC,4BADD,EAECC,sBAFD,QAGO,gBAHP;AAIA,OAAOC,OAAP,MAAoB,WAApB;AACA,SACCC,2BADD,EAECC,sBAFD,EAGCC,qBAHD,QAIO,aAJP;AAKA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,OAAOC,eAAP,MAA4B,sBAA5B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AAEA,MAAMC,WAAW,GAAG,CAApB;AACA,MAAMC,WAAW,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AAM,EAAG4B,MAFV;AAGC,IAAA,gBAAgB,EAAGoF,gBAHpB;AAIC,IAAA,UAAU,EAAGG,UAJd;AAKC,IAAA,iBAAiB,EAAG3G;AALrB,KA7DD,CADD;AAuEA;;AACD,eAAe1D,OAAO,CAAE,CACvBK,WADuB,EAEvBgB,iBAAiB,CAAE;AAAEqJ,EAAAA,QAAQ,EAAE;AAAZ,CAAF,CAFM,CAAF,CAAP,CAGVzH,WAHU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { concat, find } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport {\n\tBaseControl,\n\tPanelBody,\n\tSelectControl,\n\tToggleControl,\n\twithNotices,\n\tRangeControl,\n\tSpinner,\n} from '@wordpress/components';\nimport {\n\tstore as blockEditorStore,\n\tMediaPlaceholder,\n\tInspectorControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { Platform, useEffect, useMemo } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { View } from '@wordpress/primitives';\nimport { createBlock } from '@wordpress/blocks';\nimport { createBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { sharedIcon } from './shared-icon';\nimport { defaultColumnsNumber, pickRelevantMediaFiles } from './shared';\nimport { getHrefAndDestination } from './utils';\nimport {\n\tgetUpdatedLinkTargetSettings,\n\tgetImageSizeAttributes,\n} from '../image/utils';\nimport Gallery from './gallery';\nimport {\n\tLINK_DESTINATION_ATTACHMENT,\n\tLINK_DESTINATION_MEDIA,\n\tLINK_DESTINATION_NONE,\n} from './constants';\nimport useImageSizes from './use-image-sizes';\nimport useShortCodeTransform from './use-short-code-transform';\nimport useGetNewImages from './use-get-new-images';\nimport useGetMedia from './use-get-media';\n\nconst MAX_COLUMNS = 8;\nconst linkOptions = [\n\t{ value: LINK_DESTINATION_ATTACHMENT, label: __( 'Attachment Page' ) },\n\t{ value: LINK_DESTINATION_MEDIA, label: __( 'Media File' ) },\n\t{\n\t\tvalue: LINK_DESTINATION_NONE,\n\t\tlabel: _x( 'None', 'Media item link option' ),\n\t},\n];\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nconst PLACEHOLDER_TEXT = Platform.isNative\n\t? __( 'ADD MEDIA' )\n\t: __( 'Drag images, upload new ones or select files from your library.' );\n\nconst MOBILE_CONTROL_PROPS_RANGE_CONTROL = Platform.isNative\n\t? { type: 'stepper' }\n\t: {};\n\nfunction GalleryEdit( props ) {\n\tconst {\n\t\tsetAttributes,\n\t\tattributes,\n\t\tclassName,\n\t\tclientId,\n\t\tnoticeOperations,\n\t\tisSelected,\n\t\tnoticeUI,\n\t\tinsertBlocksAfter,\n\t} = props;\n\n\tconst {\n\t\tcolumns,\n\t\timageCrop,\n\t\tlinkTarget,\n\t\tlinkTo,\n\t\tshortCodeTransforms,\n\t\tsizeSlug,\n\t} = attributes;\n\n\tconst {\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceInnerBlocks,\n\t\tupdateBlockAttributes,\n\t} = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst { getBlock, getSettings, preferredStyle } = useSelect( ( select ) => {\n\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\tconst preferredStyleVariations =\n\t\t\tsettings.__experimentalPreferredStyleVariations;\n\t\treturn {\n\t\t\tgetBlock: select( blockEditorStore ).getBlock,\n\t\t\tgetSettings: select( blockEditorStore ).getSettings,\n\t\t\tpreferredStyle: preferredStyleVariations?.value?.[ 'core/image' ],\n\t\t};\n\t}, [] );\n\n\tconst innerBlockImages = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( blockEditorStore ).getBlock( clientId )?.innerBlocks;\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst images = useMemo(\n\t\t() =>\n\t\t\tinnerBlockImages?.map( ( block ) => ( {\n\t\t\t\tclientId: block.clientId,\n\t\t\t\tid: block.attributes.id,\n\t\t\t\turl: block.attributes.url,\n\t\t\t\tattributes: block.attributes,\n\t\t\t\tfromSavedContent: Boolean( block.originalContent ),\n\t\t\t} ) ),\n\t\t[ innerBlockImages ]\n\t);\n\n\tconst imageData = useGetMedia( innerBlockImages );\n\n\tconst newImages = useGetNewImages( images, imageData );\n\n\tuseEffect( () => {\n\t\tnewImages?.forEach( ( newImage ) => {\n\t\t\tupdateBlockAttributes( newImage.clientId, {\n\t\t\t\t...buildImageAttributes( false, newImage.attributes ),\n\t\t\t\tid: newImage.id,\n\t\t\t\talign: undefined,\n\t\t\t} );\n\t\t} );\n\t}, [ newImages ] );\n\n\tconst shortCodeImages = useShortCodeTransform( shortCodeTransforms );\n\n\tuseEffect( () => {\n\t\tif ( ! shortCodeTransforms || ! shortCodeImages ) {\n\t\t\treturn;\n\t\t}\n\t\tupdateImages( shortCodeImages );\n\t\tsetAttributes( { shortCodeTransforms: undefined } );\n\t}, [ shortCodeTransforms, shortCodeImages ] );\n\n\tconst imageSizeOptions = useImageSizes(\n\t\timageData,\n\t\tisSelected,\n\t\tgetSettings\n\t);\n\n\t/**\n\t * Determines the image attributes that should be applied to an image block\n\t * after the gallery updates.\n\t *\n\t * The gallery will receive the full collection of images when a new image\n\t * is added. As a result we need to reapply the image's original settings if\n\t * it already existed in the gallery. If the image is in fact new, we need\n\t * to apply the gallery's current settings to the image.\n\t *\n\t * @param {Object} existingBlock Existing Image block that still exists after gallery update.\n\t * @param {Object} image Media object for the actual image.\n\t * @return {Object} Attributes to set on the new image block.\n\t */\n\tfunction buildImageAttributes( existingBlock, image ) {\n\t\tif ( existingBlock ) {\n\t\t\treturn existingBlock.attributes;\n\t\t}\n\n\t\tlet newClassName;\n\t\tif ( image.className && image.className !== '' ) {\n\t\t\tnewClassName = image.className;\n\t\t} else {\n\t\t\tnewClassName = preferredStyle\n\t\t\t\t? `is-style-${ preferredStyle }`\n\t\t\t\t: undefined;\n\t\t}\n\n\t\treturn {\n\t\t\t...pickRelevantMediaFiles( image, sizeSlug ),\n\t\t\t...getHrefAndDestination( image, linkTo ),\n\t\t\t...getUpdatedLinkTargetSettings( linkTarget, attributes ),\n\t\t\tclassName: newClassName,\n\t\t\tsizeSlug,\n\t\t};\n\t}\n\n\tfunction isValidFileType( file ) {\n\t\treturn (\n\t\t\tALLOWED_MEDIA_TYPES.some(\n\t\t\t\t( mediaType ) => file.type?.indexOf( mediaType ) === 0\n\t\t\t) || file.url?.indexOf( 'blob:' ) === 0\n\t\t);\n\t}\n\n\tfunction updateImages( selectedImages ) {\n\t\tconst newFileUploads =\n\t\t\tObject.prototype.toString.call( selectedImages ) ===\n\t\t\t'[object FileList]';\n\n\t\tconst imageArray = newFileUploads\n\t\t\t? Array.from( selectedImages ).map( ( file ) => {\n\t\t\t\t\tif ( ! file.url ) {\n\t\t\t\t\t\treturn pickRelevantMediaFiles( {\n\t\t\t\t\t\t\turl: createBlobURL( file ),\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn file;\n\t\t\t } )\n\t\t\t: selectedImages;\n\n\t\tif ( ! imageArray.every( isValidFileType ) ) {\n\t\t\tnoticeOperations.removeAllNotices();\n\t\t\tnoticeOperations.createErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'If uploading to a gallery all files need to be image formats'\n\t\t\t\t),\n\t\t\t\t{ id: 'gallery-upload-invalid-file' }\n\t\t\t);\n\t\t}\n\n\t\tconst processedImages = imageArray\n\t\t\t.filter( ( file ) => file.url || isValidFileType( file ) )\n\t\t\t.map( ( file ) => {\n\t\t\t\tif ( ! file.url ) {\n\t\t\t\t\treturn pickRelevantMediaFiles( {\n\t\t\t\t\t\turl: createBlobURL( file ),\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\treturn file;\n\t\t\t} );\n\n\t\t// Because we are reusing existing innerImage blocks any reordering\n\t\t// done in the media library will be lost so we need to reapply that ordering\n\t\t// once the new image blocks are merged in with existing.\n\t\tconst newOrderMap = processedImages.reduce(\n\t\t\t( result, image, index ) => (\n\t\t\t\t( result[ image.id ] = index ), result\n\t\t\t),\n\t\t\t{}\n\t\t);\n\n\t\tconst existingImageBlocks = ! newFileUploads\n\t\t\t? innerBlockImages.filter( ( block ) =>\n\t\t\t\t\tprocessedImages.find(\n\t\t\t\t\t\t( img ) => img.id === block.attributes.id\n\t\t\t\t\t)\n\t\t\t )\n\t\t\t: innerBlockImages;\n\n\t\tconst newImageList = processedImages.filter(\n\t\t\t( img ) =>\n\t\t\t\t! existingImageBlocks.find(\n\t\t\t\t\t( existingImg ) => img.id === existingImg.attributes.id\n\t\t\t\t)\n\t\t);\n\n\t\tconst newBlocks = newImageList.map( ( image ) => {\n\t\t\treturn createBlock( 'core/image', {\n\t\t\t\tid: image.id,\n\t\t\t\turl: image.url,\n\t\t\t\tcaption: image.caption,\n\t\t\t\talt: image.alt,\n\t\t\t} );\n\t\t} );\n\n\t\treplaceInnerBlocks(\n\t\t\tclientId,\n\t\t\tconcat( existingImageBlocks, newBlocks ).sort(\n\t\t\t\t( a, b ) =>\n\t\t\t\t\tnewOrderMap[ a.attributes.id ] -\n\t\t\t\t\tnewOrderMap[ b.attributes.id ]\n\t\t\t)\n\t\t);\n\t}\n\n\tfunction onUploadError( message ) {\n\t\tnoticeOperations.removeAllNotices();\n\t\tnoticeOperations.createErrorNotice( message );\n\t}\n\n\tfunction setLinkTo( value ) {\n\t\tsetAttributes( { linkTo: value } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tconst image = block.attributes.id\n\t\t\t\t? find( imageData, { id: block.attributes.id } )\n\t\t\t\t: null;\n\t\t\tchangedAttributes[ block.clientId ] = getHrefAndDestination(\n\t\t\t\timage,\n\t\t\t\tvalue\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, true );\n\t\tconst linkToText = [ ...linkOptions ].find(\n\t\t\t( linkType ) => linkType.value === value\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: image size settings */\n\t\t\t\t__( 'All gallery image links updated to: %s' ),\n\t\t\t\tlinkToText.label\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-linkTo',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction setColumnsNumber( value ) {\n\t\tsetAttributes( { columns: value } );\n\t}\n\n\tfunction toggleImageCrop() {\n\t\tsetAttributes( { imageCrop: ! imageCrop } );\n\t}\n\n\tfunction getImageCropHelp( checked ) {\n\t\treturn checked\n\t\t\t? __( 'Thumbnails are cropped to align.' )\n\t\t\t: __( 'Thumbnails are not cropped.' );\n\t}\n\n\tfunction toggleOpenInNewTab( openInNewTab ) {\n\t\tconst newLinkTarget = openInNewTab ? '_blank' : undefined;\n\t\tsetAttributes( { linkTarget: newLinkTarget } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tchangedAttributes[ block.clientId ] = getUpdatedLinkTargetSettings(\n\t\t\t\tnewLinkTarget,\n\t\t\t\tblock.attributes\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, true );\n\t\tconst noticeText = openInNewTab\n\t\t\t? __( 'All gallery images updated to open in new tab' )\n\t\t\t: __( 'All gallery images updated to not open in new tab' );\n\t\tcreateSuccessNotice( noticeText, {\n\t\t\tid: 'gallery-attributes-openInNewTab',\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tfunction updateImagesSize( newSizeSlug ) {\n\t\tsetAttributes( { sizeSlug: newSizeSlug } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tconst image = block.attributes.id\n\t\t\t\t? find( imageData, { id: block.attributes.id } )\n\t\t\t\t: null;\n\t\t\tchangedAttributes[ block.clientId ] = getImageSizeAttributes(\n\t\t\t\timage,\n\t\t\t\tnewSizeSlug\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, true );\n\t\tconst imageSize = imageSizeOptions.find(\n\t\t\t( size ) => size.value === newSizeSlug\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: image size settings */\n\t\t\t\t__( 'All gallery image sizes updated to: %s' ),\n\t\t\t\timageSize.label\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-sizeSlug',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\tuseEffect( () => {\n\t\t// linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php\n\t\tif ( ! linkTo ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tlinkTo:\n\t\t\t\t\twindow?.wp?.media?.view?.settings?.defaultProps?.link ||\n\t\t\t\t\tLINK_DESTINATION_NONE,\n\t\t\t} );\n\t\t}\n\t}, [ linkTo ] );\n\n\tconst hasImages = !! images.length;\n\tconst hasImageIds = hasImages && images.some( ( image ) => !! image.id );\n\tconst imagesUploading = images.some(\n\t\t( img ) => ! img.id && img.url?.indexOf( 'blob:' ) === 0\n\t);\n\n\tconst mediaPlaceholder = (\n\t\t<MediaPlaceholder\n\t\t\taddToGallery={ hasImageIds }\n\t\t\thandleUpload={ false }\n\t\t\tisAppender={ hasImages }\n\t\t\tdisableMediaButtons={\n\t\t\t\t( hasImages && ! isSelected ) || imagesUploading\n\t\t\t}\n\t\t\ticon={ ! hasImages && sharedIcon }\n\t\t\tlabels={ {\n\t\t\t\ttitle: ! hasImages && __( 'Gallery' ),\n\t\t\t\tinstructions: ! hasImages && PLACEHOLDER_TEXT,\n\t\t\t} }\n\t\t\tonSelect={ updateImages }\n\t\t\taccept=\"image/*\"\n\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\tmultiple\n\t\t\tvalue={ hasImageIds ? images : {} }\n\t\t\tonError={ onUploadError }\n\t\t\tnotices={ hasImages ? undefined : noticeUI }\n\t\t/>\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( className, 'has-nested-images' ),\n\t} );\n\n\tif ( ! hasImages ) {\n\t\treturn <View { ...blockProps }>{ mediaPlaceholder }</View>;\n\t}\n\n\tconst hasLinkTo = linkTo && linkTo !== 'none';\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Gallery settings' ) }>\n\t\t\t\t\t{ images.length > 1 && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tcolumns\n\t\t\t\t\t\t\t\t\t? columns\n\t\t\t\t\t\t\t\t\t: defaultColumnsNumber( images.length )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={ setColumnsNumber }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tmax={ Math.min( MAX_COLUMNS, images.length ) }\n\t\t\t\t\t\t\t{ ...MOBILE_CONTROL_PROPS_RANGE_CONTROL }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Crop images' ) }\n\t\t\t\t\t\tchecked={ !! imageCrop }\n\t\t\t\t\t\tonChange={ toggleImageCrop }\n\t\t\t\t\t\thelp={ getImageCropHelp }\n\t\t\t\t\t/>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\tlabel={ __( 'Link to' ) }\n\t\t\t\t\t\tvalue={ linkTo }\n\t\t\t\t\t\tonChange={ setLinkTo }\n\t\t\t\t\t\toptions={ linkOptions }\n\t\t\t\t\t\thideCancelButton={ true }\n\t\t\t\t\t/>\n\t\t\t\t\t{ hasLinkTo && (\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={ linkTarget === '_blank' }\n\t\t\t\t\t\t\tonChange={ toggleOpenInNewTab }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ imageSizeOptions?.length > 0 && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Image size' ) }\n\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\tonChange={ updateImagesSize }\n\t\t\t\t\t\t\thideCancelButton={ true }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ Platform.isWeb && ! imageSizeOptions && (\n\t\t\t\t\t\t<BaseControl className={ 'gallery-image-sizes' }>\n\t\t\t\t\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t\t\t\t\t{ __( 'Image size' ) }\n\t\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t\t\t<View className={ 'gallery-image-sizes__loading' }>\n\t\t\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t\t\t\t{ __( 'Loading options…' ) }\n\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t</BaseControl>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ noticeUI }\n\t\t\t<Gallery\n\t\t\t\t{ ...props }\n\t\t\t\timages={ images }\n\t\t\t\tmediaPlaceholder={ mediaPlaceholder }\n\t\t\t\tblockProps={ blockProps }\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t/>\n\t\t</>\n\t);\n}\nexport default compose( [\n\twithNotices,\n\twithViewportMatch( { isNarrow: '< small' } ),\n] )( GalleryEdit );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/gallery/edit.js"],"names":["classnames","concat","find","compose","BaseControl","PanelBody","SelectControl","ToggleControl","withNotices","RangeControl","Spinner","store","blockEditorStore","MediaPlaceholder","InspectorControls","useBlockProps","Platform","useEffect","useMemo","__","_x","sprintf","useSelect","useDispatch","withViewportMatch","View","createBlock","createBlobURL","noticesStore","sharedIcon","defaultColumnsNumber","pickRelevantMediaFiles","getHrefAndDestination","getUpdatedLinkTargetSettings","getImageSizeAttributes","Gallery","LINK_DESTINATION_ATTACHMENT","LINK_DESTINATION_MEDIA","LINK_DESTINATION_NONE","useImageSizes","useShortCodeTransform","useGetNewImages","useGetMedia","useMobileWarning","MAX_COLUMNS","linkOptions","value","label","ALLOWED_MEDIA_TYPES","PLACEHOLDER_TEXT","isNative","MOBILE_CONTROL_PROPS_RANGE_CONTROL","type","GalleryEdit","props","setAttributes","attributes","className","clientId","noticeOperations","isSelected","noticeUI","insertBlocksAfter","columns","imageCrop","linkTarget","linkTo","shortCodeTransforms","sizeSlug","__unstableMarkNextChangeAsNotPersistent","replaceInnerBlocks","updateBlockAttributes","createSuccessNotice","getBlock","getSettings","preferredStyle","select","settings","preferredStyleVariations","__experimentalPreferredStyleVariations","innerBlockImages","innerBlocks","images","map","block","id","url","fromSavedContent","Boolean","originalContent","imageData","newImages","forEach","newImage","buildImageAttributes","align","undefined","shortCodeImages","updateImages","imageSizeOptions","existingBlock","image","newClassName","isValidFileType","file","some","mediaType","indexOf","selectedImages","newFileUploads","Object","prototype","toString","call","imageArray","Array","from","every","removeAllNotices","createErrorNotice","processedImages","filter","newOrderMap","reduce","result","index","existingImageBlocks","img","newImageList","existingImg","newBlocks","caption","alt","sort","a","b","onUploadError","message","setLinkTo","changedAttributes","blocks","push","linkToText","linkType","setColumnsNumber","toggleImageCrop","getImageCropHelp","checked","toggleOpenInNewTab","openInNewTab","newLinkTarget","noticeText","updateImagesSize","newSizeSlug","imageSize","size","window","wp","media","view","defaultProps","link","hasImages","length","hasImageIds","imagesUploading","mediaPlaceholder","title","instructions","blockProps","hasLinkTo","Math","min","isWeb","isNarrow"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,MAAT,EAAiBC,IAAjB,QAA6B,QAA7B;AAEA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SACCC,WADD,EAECC,SAFD,EAGCC,aAHD,EAICC,aAJD,EAKCC,WALD,EAMCC,YAND,EAOCC,OAPD,QAQO,uBARP;AASA,SACCC,KAAK,IAAIC,gBADV,EAECC,gBAFD,EAGCC,iBAHD,EAICC,aAJD,QAKO,yBALP;AAMA,SAASC,QAAT,EAAmBC,SAAnB,EAA8BC,OAA9B,QAA6C,oBAA7C;AACA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,iBAAT,QAAkC,qBAAlC;AACA,SAASC,IAAT,QAAqB,uBAArB;AACA,SAASC,WAAT,QAA4B,mBAA5B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAAShB,KAAK,IAAIiB,YAAlB,QAAsC,oBAAtC;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,eAA3B;AACA,SAASC,oBAAT,EAA+BC,sBAA/B,QAA6D,UAA7D;AACA,SAASC,qBAAT,QAAsC,SAAtC;AACA,SACCC,4BADD,EAECC,sBAFD,QAGO,gBAHP;AAIA,OAAOC,OAAP,MAAoB,WAApB;AACA,SACCC,2BADD,EAECC,sBAFD,EAGCC,qBAHD,QAIO,aAJP;AAKA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,OAAOC,eAAP,MAA4B,sBAA5B;AACA,OAAOC,WAAP,MAAwB,iBAAxB;A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AG;AAAlB,KACC,cAAC,OAAD,OADD,EAEGA,EAAE,CAAE,kBAAF,CAFL,CAJD,CA9CF,CADD,CADD,EA4DG0C,QA5DH,EA6DC,cAAC,OAAD,eACMP,KADN;AAEC,IAAA,MAAM,EAAG4B,MAFV;AAGC,IAAA,gBAAgB,EAAGoF,gBAHpB;AAIC,IAAA,UAAU,EAAGG,UAJd;AAKC,IAAA,iBAAiB,EAAG3G;AALrB,KA7DD,CADD;AAuEA;;AACD,eAAe3D,OAAO,CAAE,CACvBK,WADuB,EAEvBgB,iBAAiB,CAAE;AAAEsJ,EAAAA,QAAQ,EAAE;AAAZ,CAAF,CAFM,CAAF,CAAP,CAGVzH,WAHU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { concat, find } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { compose } from '@wordpress/compose';\nimport {\n\tBaseControl,\n\tPanelBody,\n\tSelectControl,\n\tToggleControl,\n\twithNotices,\n\tRangeControl,\n\tSpinner,\n} from '@wordpress/components';\nimport {\n\tstore as blockEditorStore,\n\tMediaPlaceholder,\n\tInspectorControls,\n\tuseBlockProps,\n} from '@wordpress/block-editor';\nimport { Platform, useEffect, useMemo } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { withViewportMatch } from '@wordpress/viewport';\nimport { View } from '@wordpress/primitives';\nimport { createBlock } from '@wordpress/blocks';\nimport { createBlobURL } from '@wordpress/blob';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { sharedIcon } from './shared-icon';\nimport { defaultColumnsNumber, pickRelevantMediaFiles } from './shared';\nimport { getHrefAndDestination } from './utils';\nimport {\n\tgetUpdatedLinkTargetSettings,\n\tgetImageSizeAttributes,\n} from '../image/utils';\nimport Gallery from './gallery';\nimport {\n\tLINK_DESTINATION_ATTACHMENT,\n\tLINK_DESTINATION_MEDIA,\n\tLINK_DESTINATION_NONE,\n} from './constants';\nimport useImageSizes from './use-image-sizes';\nimport useShortCodeTransform from './use-short-code-transform';\nimport useGetNewImages from './use-get-new-images';\nimport useGetMedia from './use-get-media';\n\n/**\n * Internal dependencies\n */\nimport useMobileWarning from './use-mobile-warning';\n\nconst MAX_COLUMNS = 8;\nconst linkOptions = [\n\t{ value: LINK_DESTINATION_ATTACHMENT, label: __( 'Attachment Page' ) },\n\t{ value: LINK_DESTINATION_MEDIA, label: __( 'Media File' ) },\n\t{\n\t\tvalue: LINK_DESTINATION_NONE,\n\t\tlabel: _x( 'None', 'Media item link option' ),\n\t},\n];\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\n\nconst PLACEHOLDER_TEXT = Platform.isNative\n\t? __( 'ADD MEDIA' )\n\t: __( 'Drag images, upload new ones or select files from your library.' );\n\nconst MOBILE_CONTROL_PROPS_RANGE_CONTROL = Platform.isNative\n\t? { type: 'stepper' }\n\t: {};\n\nfunction GalleryEdit( props ) {\n\tconst {\n\t\tsetAttributes,\n\t\tattributes,\n\t\tclassName,\n\t\tclientId,\n\t\tnoticeOperations,\n\t\tisSelected,\n\t\tnoticeUI,\n\t\tinsertBlocksAfter,\n\t} = props;\n\n\tconst {\n\t\tcolumns,\n\t\timageCrop,\n\t\tlinkTarget,\n\t\tlinkTo,\n\t\tshortCodeTransforms,\n\t\tsizeSlug,\n\t} = attributes;\n\n\tconst {\n\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\treplaceInnerBlocks,\n\t\tupdateBlockAttributes,\n\t} = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\n\tconst { getBlock, getSettings, preferredStyle } = useSelect( ( select ) => {\n\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\tconst preferredStyleVariations =\n\t\t\tsettings.__experimentalPreferredStyleVariations;\n\t\treturn {\n\t\t\tgetBlock: select( blockEditorStore ).getBlock,\n\t\t\tgetSettings: select( blockEditorStore ).getSettings,\n\t\t\tpreferredStyle: preferredStyleVariations?.value?.[ 'core/image' ],\n\t\t};\n\t}, [] );\n\n\tconst innerBlockImages = useSelect(\n\t\t( select ) => {\n\t\t\treturn select( blockEditorStore ).getBlock( clientId )?.innerBlocks;\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst images = useMemo(\n\t\t() =>\n\t\t\tinnerBlockImages?.map( ( block ) => ( {\n\t\t\t\tclientId: block.clientId,\n\t\t\t\tid: block.attributes.id,\n\t\t\t\turl: block.attributes.url,\n\t\t\t\tattributes: block.attributes,\n\t\t\t\tfromSavedContent: Boolean( block.originalContent ),\n\t\t\t} ) ),\n\t\t[ innerBlockImages ]\n\t);\n\n\tconst imageData = useGetMedia( innerBlockImages );\n\n\tconst newImages = useGetNewImages( images, imageData );\n\n\tuseMobileWarning( newImages );\n\n\tuseEffect( () => {\n\t\tnewImages?.forEach( ( newImage ) => {\n\t\t\tupdateBlockAttributes( newImage.clientId, {\n\t\t\t\t...buildImageAttributes( false, newImage.attributes ),\n\t\t\t\tid: newImage.id,\n\t\t\t\talign: undefined,\n\t\t\t} );\n\t\t} );\n\t}, [ newImages ] );\n\n\tconst shortCodeImages = useShortCodeTransform( shortCodeTransforms );\n\n\tuseEffect( () => {\n\t\tif ( ! shortCodeTransforms || ! shortCodeImages ) {\n\t\t\treturn;\n\t\t}\n\t\tupdateImages( shortCodeImages );\n\t\tsetAttributes( { shortCodeTransforms: undefined } );\n\t}, [ shortCodeTransforms, shortCodeImages ] );\n\n\tconst imageSizeOptions = useImageSizes(\n\t\timageData,\n\t\tisSelected,\n\t\tgetSettings\n\t);\n\n\t/**\n\t * Determines the image attributes that should be applied to an image block\n\t * after the gallery updates.\n\t *\n\t * The gallery will receive the full collection of images when a new image\n\t * is added. As a result we need to reapply the image's original settings if\n\t * it already existed in the gallery. If the image is in fact new, we need\n\t * to apply the gallery's current settings to the image.\n\t *\n\t * @param {Object} existingBlock Existing Image block that still exists after gallery update.\n\t * @param {Object} image Media object for the actual image.\n\t * @return {Object} Attributes to set on the new image block.\n\t */\n\tfunction buildImageAttributes( existingBlock, image ) {\n\t\tif ( existingBlock ) {\n\t\t\treturn existingBlock.attributes;\n\t\t}\n\n\t\tlet newClassName;\n\t\tif ( image.className && image.className !== '' ) {\n\t\t\tnewClassName = image.className;\n\t\t} else {\n\t\t\tnewClassName = preferredStyle\n\t\t\t\t? `is-style-${ preferredStyle }`\n\t\t\t\t: undefined;\n\t\t}\n\n\t\treturn {\n\t\t\t...pickRelevantMediaFiles( image, sizeSlug ),\n\t\t\t...getHrefAndDestination( image, linkTo ),\n\t\t\t...getUpdatedLinkTargetSettings( linkTarget, attributes ),\n\t\t\tclassName: newClassName,\n\t\t\tsizeSlug,\n\t\t};\n\t}\n\n\tfunction isValidFileType( file ) {\n\t\treturn (\n\t\t\tALLOWED_MEDIA_TYPES.some(\n\t\t\t\t( mediaType ) => file.type?.indexOf( mediaType ) === 0\n\t\t\t) || file.url?.indexOf( 'blob:' ) === 0\n\t\t);\n\t}\n\n\tfunction updateImages( selectedImages ) {\n\t\tconst newFileUploads =\n\t\t\tObject.prototype.toString.call( selectedImages ) ===\n\t\t\t'[object FileList]';\n\n\t\tconst imageArray = newFileUploads\n\t\t\t? Array.from( selectedImages ).map( ( file ) => {\n\t\t\t\t\tif ( ! file.url ) {\n\t\t\t\t\t\treturn pickRelevantMediaFiles( {\n\t\t\t\t\t\t\turl: createBlobURL( file ),\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn file;\n\t\t\t } )\n\t\t\t: selectedImages;\n\n\t\tif ( ! imageArray.every( isValidFileType ) ) {\n\t\t\tnoticeOperations.removeAllNotices();\n\t\t\tnoticeOperations.createErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'If uploading to a gallery all files need to be image formats'\n\t\t\t\t),\n\t\t\t\t{ id: 'gallery-upload-invalid-file' }\n\t\t\t);\n\t\t}\n\n\t\tconst processedImages = imageArray\n\t\t\t.filter( ( file ) => file.url || isValidFileType( file ) )\n\t\t\t.map( ( file ) => {\n\t\t\t\tif ( ! file.url ) {\n\t\t\t\t\treturn pickRelevantMediaFiles( {\n\t\t\t\t\t\turl: createBlobURL( file ),\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\treturn file;\n\t\t\t} );\n\n\t\t// Because we are reusing existing innerImage blocks any reordering\n\t\t// done in the media library will be lost so we need to reapply that ordering\n\t\t// once the new image blocks are merged in with existing.\n\t\tconst newOrderMap = processedImages.reduce(\n\t\t\t( result, image, index ) => (\n\t\t\t\t( result[ image.id ] = index ), result\n\t\t\t),\n\t\t\t{}\n\t\t);\n\n\t\tconst existingImageBlocks = ! newFileUploads\n\t\t\t? innerBlockImages.filter( ( block ) =>\n\t\t\t\t\tprocessedImages.find(\n\t\t\t\t\t\t( img ) => img.id === block.attributes.id\n\t\t\t\t\t)\n\t\t\t )\n\t\t\t: innerBlockImages;\n\n\t\tconst newImageList = processedImages.filter(\n\t\t\t( img ) =>\n\t\t\t\t! existingImageBlocks.find(\n\t\t\t\t\t( existingImg ) => img.id === existingImg.attributes.id\n\t\t\t\t)\n\t\t);\n\n\t\tconst newBlocks = newImageList.map( ( image ) => {\n\t\t\treturn createBlock( 'core/image', {\n\t\t\t\tid: image.id,\n\t\t\t\turl: image.url,\n\t\t\t\tcaption: image.caption,\n\t\t\t\talt: image.alt,\n\t\t\t} );\n\t\t} );\n\n\t\treplaceInnerBlocks(\n\t\t\tclientId,\n\t\t\tconcat( existingImageBlocks, newBlocks ).sort(\n\t\t\t\t( a, b ) =>\n\t\t\t\t\tnewOrderMap[ a.attributes.id ] -\n\t\t\t\t\tnewOrderMap[ b.attributes.id ]\n\t\t\t)\n\t\t);\n\t}\n\n\tfunction onUploadError( message ) {\n\t\tnoticeOperations.removeAllNotices();\n\t\tnoticeOperations.createErrorNotice( message );\n\t}\n\n\tfunction setLinkTo( value ) {\n\t\tsetAttributes( { linkTo: value } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tconst image = block.attributes.id\n\t\t\t\t? find( imageData, { id: block.attributes.id } )\n\t\t\t\t: null;\n\t\t\tchangedAttributes[ block.clientId ] = getHrefAndDestination(\n\t\t\t\timage,\n\t\t\t\tvalue\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, true );\n\t\tconst linkToText = [ ...linkOptions ].find(\n\t\t\t( linkType ) => linkType.value === value\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: image size settings */\n\t\t\t\t__( 'All gallery image links updated to: %s' ),\n\t\t\t\tlinkToText.label\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-linkTo',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\tfunction setColumnsNumber( value ) {\n\t\tsetAttributes( { columns: value } );\n\t}\n\n\tfunction toggleImageCrop() {\n\t\tsetAttributes( { imageCrop: ! imageCrop } );\n\t}\n\n\tfunction getImageCropHelp( checked ) {\n\t\treturn checked\n\t\t\t? __( 'Thumbnails are cropped to align.' )\n\t\t\t: __( 'Thumbnails are not cropped.' );\n\t}\n\n\tfunction toggleOpenInNewTab( openInNewTab ) {\n\t\tconst newLinkTarget = openInNewTab ? '_blank' : undefined;\n\t\tsetAttributes( { linkTarget: newLinkTarget } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tchangedAttributes[ block.clientId ] = getUpdatedLinkTargetSettings(\n\t\t\t\tnewLinkTarget,\n\t\t\t\tblock.attributes\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, true );\n\t\tconst noticeText = openInNewTab\n\t\t\t? __( 'All gallery images updated to open in new tab' )\n\t\t\t: __( 'All gallery images updated to not open in new tab' );\n\t\tcreateSuccessNotice( noticeText, {\n\t\t\tid: 'gallery-attributes-openInNewTab',\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t}\n\n\tfunction updateImagesSize( newSizeSlug ) {\n\t\tsetAttributes( { sizeSlug: newSizeSlug } );\n\t\tconst changedAttributes = {};\n\t\tconst blocks = [];\n\t\tgetBlock( clientId ).innerBlocks.forEach( ( block ) => {\n\t\t\tblocks.push( block.clientId );\n\t\t\tconst image = block.attributes.id\n\t\t\t\t? find( imageData, { id: block.attributes.id } )\n\t\t\t\t: null;\n\t\t\tchangedAttributes[ block.clientId ] = getImageSizeAttributes(\n\t\t\t\timage,\n\t\t\t\tnewSizeSlug\n\t\t\t);\n\t\t} );\n\t\tupdateBlockAttributes( blocks, changedAttributes, true );\n\t\tconst imageSize = imageSizeOptions.find(\n\t\t\t( size ) => size.value === newSizeSlug\n\t\t);\n\n\t\tcreateSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: image size settings */\n\t\t\t\t__( 'All gallery image sizes updated to: %s' ),\n\t\t\t\timageSize.label\n\t\t\t),\n\t\t\t{\n\t\t\t\tid: 'gallery-attributes-sizeSlug',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\t}\n\n\tuseEffect( () => {\n\t\t// linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php\n\t\tif ( ! linkTo ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( {\n\t\t\t\tlinkTo:\n\t\t\t\t\twindow?.wp?.media?.view?.settings?.defaultProps?.link ||\n\t\t\t\t\tLINK_DESTINATION_NONE,\n\t\t\t} );\n\t\t}\n\t}, [ linkTo ] );\n\n\tconst hasImages = !! images.length;\n\tconst hasImageIds = hasImages && images.some( ( image ) => !! image.id );\n\tconst imagesUploading = images.some(\n\t\t( img ) => ! img.id && img.url?.indexOf( 'blob:' ) === 0\n\t);\n\n\tconst mediaPlaceholder = (\n\t\t<MediaPlaceholder\n\t\t\taddToGallery={ hasImageIds }\n\t\t\thandleUpload={ false }\n\t\t\tisAppender={ hasImages }\n\t\t\tdisableMediaButtons={\n\t\t\t\t( hasImages && ! isSelected ) || imagesUploading\n\t\t\t}\n\t\t\ticon={ ! hasImages && sharedIcon }\n\t\t\tlabels={ {\n\t\t\t\ttitle: ! hasImages && __( 'Gallery' ),\n\t\t\t\tinstructions: ! hasImages && PLACEHOLDER_TEXT,\n\t\t\t} }\n\t\t\tonSelect={ updateImages }\n\t\t\taccept=\"image/*\"\n\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\tmultiple\n\t\t\tvalue={ hasImageIds ? images : {} }\n\t\t\tonError={ onUploadError }\n\t\t\tnotices={ hasImages ? undefined : noticeUI }\n\t\t/>\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\tclassName: classnames( className, 'has-nested-images' ),\n\t} );\n\n\tif ( ! hasImages ) {\n\t\treturn <View { ...blockProps }>{ mediaPlaceholder }</View>;\n\t}\n\n\tconst hasLinkTo = linkTo && linkTo !== 'none';\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Gallery settings' ) }>\n\t\t\t\t\t{ images.length > 1 && (\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\tcolumns\n\t\t\t\t\t\t\t\t\t? columns\n\t\t\t\t\t\t\t\t\t: defaultColumnsNumber( images.length )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonChange={ setColumnsNumber }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tmax={ Math.min( MAX_COLUMNS, images.length ) }\n\t\t\t\t\t\t\t{ ...MOBILE_CONTROL_PROPS_RANGE_CONTROL }\n\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\tlabel={ __( 'Crop images' ) }\n\t\t\t\t\t\tchecked={ !! imageCrop }\n\t\t\t\t\t\tonChange={ toggleImageCrop }\n\t\t\t\t\t\thelp={ getImageCropHelp }\n\t\t\t\t\t/>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\tlabel={ __( 'Link to' ) }\n\t\t\t\t\t\tvalue={ linkTo }\n\t\t\t\t\t\tonChange={ setLinkTo }\n\t\t\t\t\t\toptions={ linkOptions }\n\t\t\t\t\t\thideCancelButton={ true }\n\t\t\t\t\t/>\n\t\t\t\t\t{ hasLinkTo && (\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={ linkTarget === '_blank' }\n\t\t\t\t\t\t\tonChange={ toggleOpenInNewTab }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ imageSizeOptions?.length > 0 && (\n\t\t\t\t\t\t<SelectControl\n\t\t\t\t\t\t\tlabel={ __( 'Image size' ) }\n\t\t\t\t\t\t\tvalue={ sizeSlug }\n\t\t\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\t\t\tonChange={ updateImagesSize }\n\t\t\t\t\t\t\thideCancelButton={ true }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ Platform.isWeb && ! imageSizeOptions && (\n\t\t\t\t\t\t<BaseControl className={ 'gallery-image-sizes' }>\n\t\t\t\t\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t\t\t\t\t{ __( 'Image size' ) }\n\t\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t\t\t<View className={ 'gallery-image-sizes__loading' }>\n\t\t\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t\t\t\t{ __( 'Loading options…' ) }\n\t\t\t\t\t\t\t</View>\n\t\t\t\t\t\t</BaseControl>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ noticeUI }\n\t\t\t<Gallery\n\t\t\t\t{ ...props }\n\t\t\t\timages={ images }\n\t\t\t\tmediaPlaceholder={ mediaPlaceholder }\n\t\t\t\tblockProps={ blockProps }\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t/>\n\t\t</>\n\t);\n}\nexport default compose( [\n\twithNotices,\n\twithViewportMatch( { isNarrow: '< small' } ),\n] )( GalleryEdit );\n"]}
@@ -9,7 +9,7 @@ import classnames from 'classnames';
9
9
  * WordPress dependencies
10
10
  */
11
11
 
12
- import { RichText, __experimentalUseInnerBlocksProps as useInnerBlocksProps } from '@wordpress/block-editor';
12
+ import { RichText, useInnerBlocksProps } from '@wordpress/block-editor';
13
13
  import { VisuallyHidden } from '@wordpress/components';
14
14
  import { useState, useEffect } from '@wordpress/element';
15
15
  import { __ } from '@wordpress/i18n';
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/gallery/gallery.js"],"names":["classnames","RichText","__experimentalUseInnerBlocksProps","useInnerBlocksProps","VisuallyHidden","useState","useEffect","__","createBlock","View","allowedBlocks","Gallery","props","attributes","isSelected","setAttributes","mediaPlaceholder","insertBlocksAfter","blockProps","align","columns","caption","imageCrop","children","innerBlocksProps","orientation","renderAppender","__experimentalLayout","type","alignments","captionFocused","setCaptionFocused","onFocusCaption","removeCaptionFocus","className","undefined","isEmpty","value","RichTextVisibilityHelper","isHidden","placeholder","tagName","captionRef","richTextProps"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,QADD,EAECC,iCAAiC,IAAIC,mBAFtC,QAGO,yBAHP;AAIA,SAASC,cAAT,QAA+B,uBAA/B;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,mBAA5B;AACA,SAASC,IAAT,QAAqB,uBAArB;AAEA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;AACC,IAAA,GAAG,EAAGD,UADP;AAEC,IAAA,KAAK,EAAGL,KAFT;AAGC,IAAA,WAAW,EAAGG,WAHf;AAIC,IAAA,SAAS,EAAGN,SAJb;AAKC,IAAA,OAAO,EAAGO,OALX;AAMC,IAAA,UAAU,EAAGX,cANd;AAOC,IAAA,OAAO,EAAGE;AAPX,KAQMW,aARN,EADD;AAYA;;AAED,eAAehC,OAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\t__experimentalUseInnerBlocksProps as useInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { VisuallyHidden } from '@wordpress/components';\nimport { useState, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { createBlock } from '@wordpress/blocks';\nimport { View } from '@wordpress/primitives';\n\nconst allowedBlocks = [ 'core/image' ];\n\nexport const Gallery = ( props ) => {\n\tconst {\n\t\tattributes,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tmediaPlaceholder,\n\t\tinsertBlocksAfter,\n\t\tblockProps,\n\t} = props;\n\n\tconst { align, columns, caption, imageCrop } = attributes;\n\n\tconst { children, ...innerBlocksProps } = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks,\n\t\torientation: 'horizontal',\n\t\trenderAppender: false,\n\t\t__experimentalLayout: { type: 'default', alignments: [] },\n\t} );\n\n\tconst [ captionFocused, setCaptionFocused ] = useState( false );\n\n\tfunction onFocusCaption() {\n\t\tif ( ! captionFocused ) {\n\t\t\tsetCaptionFocused( true );\n\t\t}\n\t}\n\n\tfunction removeCaptionFocus() {\n\t\tif ( captionFocused ) {\n\t\t\tsetCaptionFocused( false );\n\t\t}\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetCaptionFocused( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\treturn (\n\t\t<figure\n\t\t\t{ ...innerBlocksProps }\n\t\t\tclassName={ classnames(\n\t\t\t\tblockProps.className,\n\t\t\t\t'blocks-gallery-grid',\n\t\t\t\t{\n\t\t\t\t\t[ `align${ align }` ]: align,\n\t\t\t\t\t[ `columns-${ columns }` ]: columns !== undefined,\n\t\t\t\t\t[ `columns-default` ]: columns === undefined,\n\t\t\t\t\t'is-cropped': imageCrop,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\n\t\t\t<View\n\t\t\t\tclassName=\"blocks-gallery-media-placeholder-wrapper\"\n\t\t\t\tonClick={ removeCaptionFocus }\n\t\t\t>\n\t\t\t\t{ mediaPlaceholder }\n\t\t\t</View>\n\t\t\t<RichTextVisibilityHelper\n\t\t\t\tisHidden={ ! isSelected && RichText.isEmpty( caption ) }\n\t\t\t\tcaptionFocused={ captionFocused }\n\t\t\t\tonFocusCaption={ onFocusCaption }\n\t\t\t\ttagName=\"figcaption\"\n\t\t\t\tclassName=\"blocks-gallery-caption\"\n\t\t\t\taria-label={ __( 'Gallery caption text' ) }\n\t\t\t\tplaceholder={ __( 'Write gallery caption…' ) }\n\t\t\t\tvalue={ caption }\n\t\t\t\tonChange={ ( value ) => setAttributes( { caption: value } ) }\n\t\t\t\tinlineToolbar\n\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\tinsertBlocksAfter( createBlock( 'core/paragraph' ) )\n\t\t\t\t}\n\t\t\t/>\n\t\t</figure>\n\t);\n};\n\nfunction RichTextVisibilityHelper( {\n\tisHidden,\n\tcaptionFocused,\n\tonFocusCaption,\n\tclassName,\n\tvalue,\n\tplaceholder,\n\ttagName,\n\tcaptionRef,\n\t...richTextProps\n} ) {\n\tif ( isHidden ) {\n\t\treturn <VisuallyHidden as={ RichText } { ...richTextProps } />;\n\t}\n\n\treturn (\n\t\t<RichText\n\t\t\tref={ captionRef }\n\t\t\tvalue={ value }\n\t\t\tplaceholder={ placeholder }\n\t\t\tclassName={ className }\n\t\t\ttagName={ tagName }\n\t\t\tisSelected={ captionFocused }\n\t\t\tonClick={ onFocusCaption }\n\t\t\t{ ...richTextProps }\n\t\t/>\n\t);\n}\n\nexport default Gallery;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/gallery/gallery.js"],"names":["classnames","RichText","useInnerBlocksProps","VisuallyHidden","useState","useEffect","__","createBlock","View","allowedBlocks","Gallery","props","attributes","isSelected","setAttributes","mediaPlaceholder","insertBlocksAfter","blockProps","align","columns","caption","imageCrop","children","innerBlocksProps","orientation","renderAppender","__experimentalLayout","type","alignments","captionFocused","setCaptionFocused","onFocusCaption","removeCaptionFocus","className","undefined","isEmpty","value","RichTextVisibilityHelper","isHidden","placeholder","tagName","captionRef","richTextProps"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,QAAT,EAAmBC,mBAAnB,QAA8C,yBAA9C;AACA,SAASC,cAAT,QAA+B,uBAA/B;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,mBAA5B;AACA,SAASC,IAAT,QAAqB,uBAArB;AAEA,MAAMC,aAAa,GAAG,CAAE,YAAF,CAAtB;AAEA,OAAO,MAAMC,OAAO,GAAKC,KAAF,IAAa;AACnC,QAAM;AACLC,IAAAA,UADK;AAELC,IAAAA,UAFK;AAGLC,IAAAA,aAHK;AAILC,IAAAA,gBAJK;AAKLC,IAAAA,iBALK;AAMLC,IAAAA;AANK,MAOFN,KAPJ;AASA,QAAM;AAAEO,IAAAA,KAAF;AAASC,IAAAA,OAAT;AAAkBC,IAAAA,OAAlB;AAA2BC,IAAAA;AAA3B,MAAyCT,UAA/C;AAEA,QAAM;AAAEU,IAAAA,QAAF;AAAY,OAAGC;AAAf,MAAoCrB,mBAAmB,CAAEe,UAAF,EAAc;AAC1ER,IAAAA,aAD0E;AAE1Ee,IAAAA,WAAW,EAAE,YAF6D;AAG1EC,IAAAA,cAAc,EAAE,K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kBAAazB,EAAE,CAAE,sBAAF,CANhB;AAOC,IAAA,WAAW,EAAGA,EAAE,CAAE,wBAAF,CAPjB;AAQC,IAAA,KAAK,EAAGc,OART;AASC,IAAA,QAAQ,EAAKgB,KAAF,IAAatB,aAAa,CAAE;AAAEM,MAAAA,OAAO,EAAEgB;AAAX,KAAF,CATtC;AAUC,IAAA,aAAa,MAVd;AAWC,IAAA,sBAAsB,EAAG,MACxBpB,iBAAiB,CAAET,WAAW,CAAE,gBAAF,CAAb;AAZnB,IArBD,CADD;AAuCA,CA9EM;;AAgFP,SAAS8B,wBAAT,CAAmC;AAClCC,EAAAA,QADkC;AAElCT,EAAAA,cAFkC;AAGlCE,EAAAA,cAHkC;AAIlCE,EAAAA,SAJkC;AAKlCG,EAAAA,KALkC;AAMlCG,EAAAA,WANkC;AAOlCC,EAAAA,OAPkC;AAQlCC,EAAAA,UARkC;AASlC,KAAGC;AAT+B,CAAnC,EAUI;AACH,MAAKJ,QAAL,EAAgB;AACf,WAAO,cAAC,cAAD;AAAgB,MAAA,EAAE,EAAGrC;AAArB,OAAqCyC,aAArC,EAAP;AACA;;AAED,SACC,cAAC,QAAD;AACC,IAAA,GAAG,EAAGD,UADP;AAEC,IAAA,KAAK,EAAGL,KAFT;AAGC,IAAA,WAAW,EAAGG,WAHf;AAIC,IAAA,SAAS,EAAGN,SAJb;AAKC,IAAA,OAAO,EAAGO,OALX;AAMC,IAAA,UAAU,EAAGX,cANd;AAOC,IAAA,OAAO,EAAGE;AAPX,KAQMW,aARN,EADD;AAYA;;AAED,eAAehC,OAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { RichText, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { VisuallyHidden } from '@wordpress/components';\nimport { useState, useEffect } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { createBlock } from '@wordpress/blocks';\nimport { View } from '@wordpress/primitives';\n\nconst allowedBlocks = [ 'core/image' ];\n\nexport const Gallery = ( props ) => {\n\tconst {\n\t\tattributes,\n\t\tisSelected,\n\t\tsetAttributes,\n\t\tmediaPlaceholder,\n\t\tinsertBlocksAfter,\n\t\tblockProps,\n\t} = props;\n\n\tconst { align, columns, caption, imageCrop } = attributes;\n\n\tconst { children, ...innerBlocksProps } = useInnerBlocksProps( blockProps, {\n\t\tallowedBlocks,\n\t\torientation: 'horizontal',\n\t\trenderAppender: false,\n\t\t__experimentalLayout: { type: 'default', alignments: [] },\n\t} );\n\n\tconst [ captionFocused, setCaptionFocused ] = useState( false );\n\n\tfunction onFocusCaption() {\n\t\tif ( ! captionFocused ) {\n\t\t\tsetCaptionFocused( true );\n\t\t}\n\t}\n\n\tfunction removeCaptionFocus() {\n\t\tif ( captionFocused ) {\n\t\t\tsetCaptionFocused( false );\n\t\t}\n\t}\n\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetCaptionFocused( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\treturn (\n\t\t<figure\n\t\t\t{ ...innerBlocksProps }\n\t\t\tclassName={ classnames(\n\t\t\t\tblockProps.className,\n\t\t\t\t'blocks-gallery-grid',\n\t\t\t\t{\n\t\t\t\t\t[ `align${ align }` ]: align,\n\t\t\t\t\t[ `columns-${ columns }` ]: columns !== undefined,\n\t\t\t\t\t[ `columns-default` ]: columns === undefined,\n\t\t\t\t\t'is-cropped': imageCrop,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\n\t\t\t<View\n\t\t\t\tclassName=\"blocks-gallery-media-placeholder-wrapper\"\n\t\t\t\tonClick={ removeCaptionFocus }\n\t\t\t>\n\t\t\t\t{ mediaPlaceholder }\n\t\t\t</View>\n\t\t\t<RichTextVisibilityHelper\n\t\t\t\tisHidden={ ! isSelected && RichText.isEmpty( caption ) }\n\t\t\t\tcaptionFocused={ captionFocused }\n\t\t\t\tonFocusCaption={ onFocusCaption }\n\t\t\t\ttagName=\"figcaption\"\n\t\t\t\tclassName=\"blocks-gallery-caption\"\n\t\t\t\taria-label={ __( 'Gallery caption text' ) }\n\t\t\t\tplaceholder={ __( 'Write gallery caption…' ) }\n\t\t\t\tvalue={ caption }\n\t\t\t\tonChange={ ( value ) => setAttributes( { caption: value } ) }\n\t\t\t\tinlineToolbar\n\t\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\t\tinsertBlocksAfter( createBlock( 'core/paragraph' ) )\n\t\t\t\t}\n\t\t\t/>\n\t\t</figure>\n\t);\n};\n\nfunction RichTextVisibilityHelper( {\n\tisHidden,\n\tcaptionFocused,\n\tonFocusCaption,\n\tclassName,\n\tvalue,\n\tplaceholder,\n\ttagName,\n\tcaptionRef,\n\t...richTextProps\n} ) {\n\tif ( isHidden ) {\n\t\treturn <VisuallyHidden as={ RichText } { ...richTextProps } />;\n\t}\n\n\treturn (\n\t\t<RichText\n\t\t\tref={ captionRef }\n\t\t\tvalue={ value }\n\t\t\tplaceholder={ placeholder }\n\t\t\tclassName={ className }\n\t\t\ttagName={ tagName }\n\t\t\tisSelected={ captionFocused }\n\t\t\tonClick={ onFocusCaption }\n\t\t\t{ ...richTextProps }\n\t\t/>\n\t);\n}\n\nexport default Gallery;\n"]}
@@ -16,7 +16,7 @@ import styles from './gallery-styles.scss';
16
16
  */
17
17
 
18
18
  import { __, sprintf } from '@wordpress/i18n';
19
- import { BlockCaption, __experimentalUseInnerBlocksProps as useInnerBlocksProps } from '@wordpress/block-editor';
19
+ import { BlockCaption, useInnerBlocksProps } from '@wordpress/block-editor';
20
20
  import { useState, useEffect } from '@wordpress/element';
21
21
  import { mediaUploadSync } from '@wordpress/react-native-bridge';
22
22
  import { WIDE_ALIGNMENTS } from '@wordpress/components';
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/gallery/gallery.native.js"],"names":["View","isEmpty","defaultColumnsNumber","styles","__","sprintf","BlockCaption","__experimentalUseInnerBlocksProps","useInnerBlocksProps","useState","useEffect","mediaUploadSync","WIDE_ALIGNMENTS","useResizeObserver","TILE_SPACING","MAX_DISPLAYED_COLUMNS","MAX_DISPLAYED_COLUMNS_NARROW","Gallery","props","isCaptionSelected","setIsCaptionSelected","resizeObserver","sizes","maxWidth","setMaxWidth","mediaPlaceholder","attributes","isNarrow","onBlur","insertBlocksAfter","clientId","width","images","align","columns","length","displayedColumns","Math","min","innerBlocksProps","contentResizeMode","allowedBlocks","orientation","renderAppender","numColumns","marginHorizontal","marginVertical","__experimentalLayout","type","alignments","gridProperties","parentWidth","focusGalleryCaption","isFullWidth","full","fullWidth","galleryAppender","caption"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,cAArB;AACA,SAASC,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,UAArC;AACA,OAAOC,MAAP,MAAmB,uBAAnB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,YADD,EAECC,iCAAiC,IAAIC,mBAFtC,QAGO,yBAHP;AAIA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,oBAApC;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,eAAT,QAAgC,uBAAhC;AACA,SAASC,iBAAT,QAAkC,oBAAlC;AAEA,MAAMC,YAAY,GAAG,CAArB,C,CAEA;;AACA,MAAMC,qBAAqB,GAAG,CAA9B;AACA,MAAMC,4BAA4B,GAAG,CAArC;AAEA,OAAO,MAAMC,OAAO,GAAKC,KAAF,IAAa;AACnC,QAAM,CAAEC,iBAAF,EAAqBC,oBAArB,IAA8CX,QAAQ,CAAE,KAAF,CAA5D;AACA,QAAM,CAAEY,cAAF,EAAkBC,KAAlB,IAA4BT,iBAAiB,EAAnD;AACA,QAAM,CAAEU,QAAF,EAAYC,WAAZ,IAA4Bf,QAAQ,CAAE,CAAF,CAA1C;AACAC,EAAAA,SAAS,CAAEC,eAAF,EAAmB,EAAnB,CAAT;AAEA,QAAM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AE,IAAF,CAApB;AACA;AACD,GAJD;;AAMA,QAAMiC,WAAW,GAAGpB,KAAK,KAAKrB,eAAe,CAACqC,UAAhB,CAA2BK,IAAzD;AAEA,SACC,cAAC,IAAD;AAAM,IAAA,KAAK,EAAGD,WAAW,IAAIlD,MAAM,CAACoD;AAApC,KACGlC,cADH,EAEC,cAAC,IAAD,EAAWkB,gBAAX,CAFD,EAGC,cAAC,IAAD;AACC,IAAA,KAAK,EAAG,CACPc,WAAW,IAAIlD,MAAM,CAACoD,SADf,EAEPpD,MAAM,CAACqD,eAFA;AADT,KAMG/B,gBANH,CAHD,EAWC,cAAC,YAAD;AACC,IAAA,QAAQ,EAAGK,QADZ;AAEC,IAAA,UAAU,EAAGX,iBAFd;AAGC,IAAA,UAAU,EAAG,IAHd;AAIC,IAAA,yBAAyB,EAAKsC,OAAF,IAC3BxD,OAAO,CAAEwD,OAAF,CAAP;AACG;AAEA,4BAHH,GAIGpD,OAAO;AACP;AACAD,IAAAA,EAAE,CAAE,qBAAF,CAFK,EAGPqD,OAHO,CATZ;AAeC,IAAA,OAAO,EAAGL,mBAfX;AAgBC,IAAA,MAAM,EAAGxB,MAhBV,CAgBmB;AAhBnB;AAiBC,IAAA,iBAAiB,EAAGC;AAjBrB,IAXD,CADD;AAiCA,CA5FM;AA8FP,eAAeZ,OAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\nimport { isEmpty } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport { defaultColumnsNumber } from './shared';\nimport styles from './gallery-styles.scss';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tBlockCaption,\n\t__experimentalUseInnerBlocksProps as useInnerBlocksProps,\n} from '@wordpress/block-editor';\nimport { useState, useEffect } from '@wordpress/element';\nimport { mediaUploadSync } from '@wordpress/react-native-bridge';\nimport { WIDE_ALIGNMENTS } from '@wordpress/components';\nimport { useResizeObserver } from '@wordpress/compose';\n\nconst TILE_SPACING = 8;\n\n// we must limit displayed columns since readable content max-width is 580px\nconst MAX_DISPLAYED_COLUMNS = 4;\nconst MAX_DISPLAYED_COLUMNS_NARROW = 2;\n\nexport const Gallery = ( props ) => {\n\tconst [ isCaptionSelected, setIsCaptionSelected ] = useState( false );\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst [ maxWidth, setMaxWidth ] = useState( 0 );\n\tuseEffect( mediaUploadSync, [] );\n\n\tconst {\n\t\tmediaPlaceholder,\n\t\tattributes,\n\t\tisNarrow,\n\t\tonBlur,\n\t\tinsertBlocksAfter,\n\t\tclientId,\n\t} = props;\n\n\tuseEffect( () => {\n\t\tconst { width } = sizes || {};\n\t\tif ( width ) {\n\t\t\tsetMaxWidth( width );\n\t\t}\n\t}, [ sizes ] );\n\n\tconst {\n\t\timages,\n\t\talign,\n\t\tcolumns = defaultColumnsNumber( images.length ),\n\t} = attributes;\n\n\tconst displayedColumns = Math.min(\n\t\tcolumns,\n\t\tisNarrow ? MAX_DISPLAYED_COLUMNS_NARROW : MAX_DISPLAYED_COLUMNS\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{},\n\t\t{\n\t\t\tcontentResizeMode: 'stretch',\n\t\t\tallowedBlocks: [ 'core/image' ],\n\t\t\torientation: 'horizontal',\n\t\t\trenderAppender: false,\n\t\t\tnumColumns: displayedColumns,\n\t\t\tmarginHorizontal: TILE_SPACING,\n\t\t\tmarginVertical: TILE_SPACING,\n\t\t\t__experimentalLayout: { type: 'default', alignments: [] },\n\t\t\tgridProperties: {\n\t\t\t\tnumColumns: displayedColumns,\n\t\t\t},\n\t\t\tparentWidth: maxWidth + 2 * TILE_SPACING,\n\t\t}\n\t);\n\n\tconst focusGalleryCaption = () => {\n\t\tif ( ! isCaptionSelected ) {\n\t\t\tsetIsCaptionSelected( true );\n\t\t}\n\t};\n\n\tconst isFullWidth = align === WIDE_ALIGNMENTS.alignments.full;\n\n\treturn (\n\t\t<View style={ isFullWidth && styles.fullWidth }>\n\t\t\t{ resizeObserver }\n\t\t\t<View { ...innerBlocksProps } />\n\t\t\t<View\n\t\t\t\tstyle={ [\n\t\t\t\t\tisFullWidth && styles.fullWidth,\n\t\t\t\t\tstyles.galleryAppender,\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ mediaPlaceholder }\n\t\t\t</View>\n\t\t\t<BlockCaption\n\t\t\t\tclientId={ clientId }\n\t\t\t\tisSelected={ isCaptionSelected }\n\t\t\t\taccessible={ true }\n\t\t\t\taccessibilityLabelCreator={ ( caption ) =>\n\t\t\t\t\tisEmpty( caption )\n\t\t\t\t\t\t? /* translators: accessibility text. Empty gallery caption. */\n\n\t\t\t\t\t\t 'Gallery caption. Empty'\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: accessibility text. %s: gallery caption. */\n\t\t\t\t\t\t\t\t__( 'Gallery caption. %s' ),\n\t\t\t\t\t\t\t\tcaption\n\t\t\t\t\t\t )\n\t\t\t\t}\n\t\t\t\tonFocus={ focusGalleryCaption }\n\t\t\t\tonBlur={ onBlur } // always assign onBlur as props\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t/>\n\t\t</View>\n\t);\n};\n\nexport default Gallery;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/gallery/gallery.native.js"],"names":["View","isEmpty","defaultColumnsNumber","styles","__","sprintf","BlockCaption","useInnerBlocksProps","useState","useEffect","mediaUploadSync","WIDE_ALIGNMENTS","useResizeObserver","TILE_SPACING","MAX_DISPLAYED_COLUMNS","MAX_DISPLAYED_COLUMNS_NARROW","Gallery","props","isCaptionSelected","setIsCaptionSelected","resizeObserver","sizes","maxWidth","setMaxWidth","mediaPlaceholder","attributes","isNarrow","onBlur","insertBlocksAfter","clientId","width","images","align","columns","length","displayedColumns","Math","min","innerBlocksProps","contentResizeMode","allowedBlocks","orientation","renderAppender","numColumns","marginHorizontal","marginVertical","__experimentalLayout","type","alignments","gridProperties","parentWidth","focusGal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,CAACoD,eAFA;AADT,KAMG/B,gBANH,CAHD,EAWC,cAAC,YAAD;AACC,IAAA,QAAQ,EAAGK,QADZ;AAEC,IAAA,UAAU,EAAGX,iBAFd;AAGC,IAAA,UAAU,EAAG,IAHd;AAIC,IAAA,yBAAyB,EAAKsC,OAAF,IAC3BvD,OAAO,CAAEuD,OAAF,CAAP;AACG;AAEA,4BAHH,GAIGnD,OAAO;AACP;AACAD,IAAAA,EAAE,CAAE,qBAAF,CAFK,EAGPoD,OAHO,CATZ;AAeC,IAAA,OAAO,EAAGL,mBAfX;AAgBC,IAAA,MAAM,EAAGxB,MAhBV,CAgBmB;AAhBnB;AAiBC,IAAA,iBAAiB,EAAGC;AAjBrB,IAXD,CADD;AAiCA,CA5FM;AA8FP,eAAeZ,OAAf","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\nimport { isEmpty } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport { defaultColumnsNumber } from './shared';\nimport styles from './gallery-styles.scss';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { BlockCaption, useInnerBlocksProps } from '@wordpress/block-editor';\nimport { useState, useEffect } from '@wordpress/element';\nimport { mediaUploadSync } from '@wordpress/react-native-bridge';\nimport { WIDE_ALIGNMENTS } from '@wordpress/components';\nimport { useResizeObserver } from '@wordpress/compose';\n\nconst TILE_SPACING = 8;\n\n// we must limit displayed columns since readable content max-width is 580px\nconst MAX_DISPLAYED_COLUMNS = 4;\nconst MAX_DISPLAYED_COLUMNS_NARROW = 2;\n\nexport const Gallery = ( props ) => {\n\tconst [ isCaptionSelected, setIsCaptionSelected ] = useState( false );\n\tconst [ resizeObserver, sizes ] = useResizeObserver();\n\tconst [ maxWidth, setMaxWidth ] = useState( 0 );\n\tuseEffect( mediaUploadSync, [] );\n\n\tconst {\n\t\tmediaPlaceholder,\n\t\tattributes,\n\t\tisNarrow,\n\t\tonBlur,\n\t\tinsertBlocksAfter,\n\t\tclientId,\n\t} = props;\n\n\tuseEffect( () => {\n\t\tconst { width } = sizes || {};\n\t\tif ( width ) {\n\t\t\tsetMaxWidth( width );\n\t\t}\n\t}, [ sizes ] );\n\n\tconst {\n\t\timages,\n\t\talign,\n\t\tcolumns = defaultColumnsNumber( images.length ),\n\t} = attributes;\n\n\tconst displayedColumns = Math.min(\n\t\tcolumns,\n\t\tisNarrow ? MAX_DISPLAYED_COLUMNS_NARROW : MAX_DISPLAYED_COLUMNS\n\t);\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{},\n\t\t{\n\t\t\tcontentResizeMode: 'stretch',\n\t\t\tallowedBlocks: [ 'core/image' ],\n\t\t\torientation: 'horizontal',\n\t\t\trenderAppender: false,\n\t\t\tnumColumns: displayedColumns,\n\t\t\tmarginHorizontal: TILE_SPACING,\n\t\t\tmarginVertical: TILE_SPACING,\n\t\t\t__experimentalLayout: { type: 'default', alignments: [] },\n\t\t\tgridProperties: {\n\t\t\t\tnumColumns: displayedColumns,\n\t\t\t},\n\t\t\tparentWidth: maxWidth + 2 * TILE_SPACING,\n\t\t}\n\t);\n\n\tconst focusGalleryCaption = () => {\n\t\tif ( ! isCaptionSelected ) {\n\t\t\tsetIsCaptionSelected( true );\n\t\t}\n\t};\n\n\tconst isFullWidth = align === WIDE_ALIGNMENTS.alignments.full;\n\n\treturn (\n\t\t<View style={ isFullWidth && styles.fullWidth }>\n\t\t\t{ resizeObserver }\n\t\t\t<View { ...innerBlocksProps } />\n\t\t\t<View\n\t\t\t\tstyle={ [\n\t\t\t\t\tisFullWidth && styles.fullWidth,\n\t\t\t\t\tstyles.galleryAppender,\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t{ mediaPlaceholder }\n\t\t\t</View>\n\t\t\t<BlockCaption\n\t\t\t\tclientId={ clientId }\n\t\t\t\tisSelected={ isCaptionSelected }\n\t\t\t\taccessible={ true }\n\t\t\t\taccessibilityLabelCreator={ ( caption ) =>\n\t\t\t\t\tisEmpty( caption )\n\t\t\t\t\t\t? /* translators: accessibility text. Empty gallery caption. */\n\n\t\t\t\t\t\t 'Gallery caption. Empty'\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: accessibility text. %s: gallery caption. */\n\t\t\t\t\t\t\t\t__( 'Gallery caption. %s' ),\n\t\t\t\t\t\t\t\tcaption\n\t\t\t\t\t\t )\n\t\t\t\t}\n\t\t\t\tonFocus={ focusGalleryCaption }\n\t\t\t\tonBlur={ onBlur } // always assign onBlur as props\n\t\t\t\tinsertBlocksAfter={ insertBlocksAfter }\n\t\t\t/>\n\t\t</View>\n\t);\n};\n\nexport default Gallery;\n"]}
@@ -89,6 +89,10 @@ const metadata = {
89
89
  type: "boolean",
90
90
  "default": true
91
91
  },
92
+ fixedHeight: {
93
+ type: "boolean",
94
+ "default": true
95
+ },
92
96
  linkTarget: {
93
97
  type: "string"
94
98
  },
@@ -106,7 +110,8 @@ const metadata = {
106
110
  },
107
111
  providesContext: {
108
112
  allowResize: "allowResize",
109
- imageCrop: "imageCrop"
113
+ imageCrop: "imageCrop",
114
+ fixedHeight: "fixedHeight"
110
115
  },
111
116
  supports: {
112
117
  anchor: true,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/gallery/index.js"],"names":["gallery","icon","deprecated","edit","save","transforms","name","metadata","settings","example","attributes","columns","innerBlocks","url"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,IAAIC,IAApB,QAAgC,kBAAhC;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AAEA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBP,EAAAA,IADuB;AAEvBQ,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,OAAO,EAAE;AADE,KADJ;AAIRC,IAAAA,WAAW,EAAE,CACZ;AACCN,MAAAA,IAAI,EAAE,YADP;AAECI,MAAAA,UAAU,EAAE;AACXG,QAAAA,GAAG,EACF;AAFU;AAFb,KADY,EAQZ;AACCP,MAAAA,IAAI,EAAE,YADP;AAECI,MAAAA,UAAU,EAAE;AACXG,QAAAA,GAAG,EACF;AAFU;AAFb,KARY;AAJL,GAFc;AAuBvBR,EAAAA,UAvBuB;AAwBvBF,EAAAA,IAxBuB;AAyBvBC,EAAAA,IAzBuB;AA0BvBF,EAAAA;AA1BuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { gallery as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit-wrapper';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcolumns: 2,\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/image',\n\t\t\t\tattributes: {\n\t\t\t\t\turl:\n\t\t\t\t\t\t'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/image',\n\t\t\t\tattributes: {\n\t\t\t\t\turl:\n\t\t\t\t\t\t'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/gallery/index.js"],"names":["gallery","icon","deprecated","edit","save","transforms","name","metadata","settings","example","attributes","columns","innerBlocks","url"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,IAAIC,IAApB,QAAgC,kBAAhC;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,gBAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AAEA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBP,EAAAA,IADuB;AAEvBQ,EAAAA,OAAO,EAAE;AACRC,IAAAA,UAAU,EAAE;AACXC,MAAAA,OAAO,EAAE;AADE,KADJ;AAIRC,IAAAA,WAAW,EAAE,CACZ;AACCN,MAAAA,IAAI,EAAE,YADP;AAECI,MAAAA,UAAU,EAAE;AACXG,QAAAA,GAAG,EACF;AAFU;AAFb,KADY,EAQZ;AACCP,MAAAA,IAAI,EAAE,YADP;AAECI,MAAAA,UAAU,EAAE;AACXG,QAAAA,GAAG,EACF;AAFU;AAFb,KARY;AAJL,GAFc;AAuBvBR,EAAAA,UAvBuB;AAwBvBF,EAAAA,IAxBuB;AAyBvBC,EAAAA,IAzBuB;AA0BvBF,EAAAA;AA1BuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { gallery as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit-wrapper';\nimport metadata from './block.json';\nimport save from './save';\nimport transforms from './transforms';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tcolumns: 2,\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/image',\n\t\t\t\tattributes: {\n\t\t\t\t\turl:\n\t\t\t\t\t\t'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/image',\n\t\t\t\tattributes: {\n\t\t\t\t\turl:\n\t\t\t\t\t\t'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg',\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms,\n\tedit,\n\tsave,\n\tdeprecated,\n};\n"]}
@@ -8,7 +8,7 @@ import classnames from 'classnames';
8
8
  * WordPress dependencies
9
9
  */
10
10
 
11
- import { RichText, useBlockProps, InnerBlocks } from '@wordpress/block-editor';
11
+ import { RichText, useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
12
12
  /**
13
13
  * Internal dependencies
14
14
  */
@@ -35,9 +35,11 @@ export default function saveWithInnerBlocks({
35
35
  [`columns-default`]: columns === undefined,
36
36
  'is-cropped': imageCrop
37
37
  });
38
- return createElement("figure", useBlockProps.save({
38
+ const blockProps = useBlockProps.save({
39
39
  className
40
- }), createElement(InnerBlocks.Content, null), !RichText.isEmpty(caption) && createElement(RichText.Content, {
40
+ });
41
+ const innerBlocksProps = useInnerBlocksProps.save(blockProps);
42
+ return createElement("figure", innerBlocksProps, innerBlocksProps.children, !RichText.isEmpty(caption) && createElement(RichText.Content, {
41
43
  tagName: "figcaption",
42
44
  className: "blocks-gallery-caption",
43
45
  value: caption
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/gallery/save.js"],"names":["classnames","RichText","useBlockProps","InnerBlocks","saveWithoutInnerBlocks","saveWithInnerBlocks","attributes","ids","length","images","caption","columns","imageCrop","className","undefined","save","isEmpty"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,QAAT,EAAmBC,aAAnB,EAAkCC,WAAlC,QAAqD,yBAArD;AAEA;AACA;AACA;;AACA,OAAOC,sBAAP,MAAmC,WAAnC;AAEA,eAAe,SAASC,mBAAT,CAA8B;AAAEC,EAAAA;AAAF,CAA9B,EAA+C;AAAA;;AAC7D,MAAK,CAAAA,UAAU,SAAV,IAAAA,UAAU,WAAV,+BAAAA,UAAU,CAAEC,GAAZ,oEAAiBC,MAAjB,IAA0B,CAA1B,IAA+B,CAAAF,UAAU,SAAV,IAAAA,UAAU,WAAV,kCAAAA,UAAU,CAAEG,MAAZ,0EAAoBD,MAApB,IAA6B,CAAjE,EAAqE;AACpE,WAAOJ,sBAAsB,CAAE;AAAEE,MAAAA;AAAF,KAAF,CAA7B;AACA;;AAED,QAAM;AAAEI,IAAAA,OAAF;AAAWC,IAAAA,OAAX;AAAoBC,IAAAA;AAApB,MAAkCN,UAAxC;AAEA,QAAMO,SAAS,GAAGb,UAAU,CAAE,mBAAF,EAAuB;AAClD,KAAG,WAAWW,OAAS,EAAvB,GAA4BA,OAAO,KAAKG,SADU;AAElD,KAAG,iBAAH,GAAuBH,OAAO,KAAKG,SAFe;AAGlD,kBAAcF;AAHoC,GAAvB,CAA5B;AAMA,SACC,wBAAaV,aAAa,CAACa,IAAd,CAAoB;AAAEF,IAAAA;AAAF,GAApB,CAAb,EACC,cAAC,WAAD,CAAa,OAAb,OADD,EAEG,CAAEZ,QAAQ,CAACe,OAAT,CAAkBN,OAAlB,CAAF,IACD,cAAC,QAAD,CAAU,OAAV;AACC,IAAA,OAAO,EAAC,YADT;AAEC,IAAA,SAAS,EAAC,wBAFX;AAGC,IAAA,KAAK,EAAGA;AAHT,IAHF,CADD;AAYA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { RichText, useBlockProps, InnerBlocks } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport saveWithoutInnerBlocks from './v1/save';\n\nexport default function saveWithInnerBlocks( { attributes } ) {\n\tif ( attributes?.ids?.length > 0 || attributes?.images?.length > 0 ) {\n\t\treturn saveWithoutInnerBlocks( { attributes } );\n\t}\n\n\tconst { caption, columns, imageCrop } = attributes;\n\n\tconst className = classnames( 'has-nested-images', {\n\t\t[ `columns-${ columns }` ]: columns !== undefined,\n\t\t[ `columns-default` ]: columns === undefined,\n\t\t'is-cropped': imageCrop,\n\t} );\n\n\treturn (\n\t\t<figure { ...useBlockProps.save( { className } ) }>\n\t\t\t<InnerBlocks.Content />\n\t\t\t{ ! RichText.isEmpty( caption ) && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\tclassName=\"blocks-gallery-caption\"\n\t\t\t\t\tvalue={ caption }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/gallery/save.js"],"names":["classnames","RichText","useBlockProps","useInnerBlocksProps","saveWithoutInnerBlocks","saveWithInnerBlocks","attributes","ids","length","images","caption","columns","imageCrop","className","undefined","blockProps","save","innerBlocksProps","children","isEmpty"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,QADD,EAECC,aAFD,EAGCC,mBAHD,QAIO,yBAJP;AAMA;AACA;AACA;;AACA,OAAOC,sBAAP,MAAmC,WAAnC;AAEA,eAAe,SAASC,mBAAT,CAA8B;AAAEC,EAAAA;AAAF,CAA9B,EAA+C;AAAA;;AAC7D,MAAK,CAAAA,UAAU,SAAV,IAAAA,UAAU,WAAV,+BAAAA,UAAU,CAAEC,GAAZ,oEAAiBC,MAAjB,IAA0B,CAA1B,IAA+B,CAAAF,UAAU,SAAV,IAAAA,UAAU,WAAV,kCAAAA,UAAU,CAAEG,MAAZ,0EAAoBD,MAApB,IAA6B,CAAjE,EAAqE;AACpE,WAAOJ,sBAAsB,CAAE;AAAEE,MAAAA;AAAF,KAAF,CAA7B;AACA;;AAED,QAAM;AAAEI,IAAAA,OAAF;AAAWC,IAAAA,OAAX;AAAoBC,IAAAA;AAApB,MAAkCN,UAAxC;AAEA,QAAMO,SAAS,GAAGb,UAAU,CAAE,mBAAF,EAAuB;AAClD,KAAG,WAAWW,OAAS,EAAvB,GAA4BA,OAAO,KAAKG,SADU;AAElD,KAAG,iBAAH,GAAuBH,OAAO,KAAKG,SAFe;AAGlD,kBAAcF;AAHoC,GAAvB,CAA5B;AAKA,QAAMG,UAAU,GAAGb,aAAa,CAACc,IAAd,CAAoB;AAAEH,IAAAA;AAAF,GAApB,CAAnB;AACA,QAAMI,gBAAgB,GAAGd,mBAAmB,CAACa,IAApB,CAA0BD,UAA1B,CAAzB;AAEA,SACC,wBAAaE,gBAAb,EACGA,gBAAgB,CAACC,QADpB,EAEG,CAAEjB,QAAQ,CAACkB,OAAT,CAAkBT,OAAlB,CAAF,IACD,cAAC,QAAD,CAAU,OAAV;AACC,IAAA,OAAO,EAAC,YADT;AAEC,IAAA,SAAS,EAAC,wBAFX;AAGC,IAAA,KAAK,EAAGA;AAHT,IAHF,CADD;AAYA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport saveWithoutInnerBlocks from './v1/save';\n\nexport default function saveWithInnerBlocks( { attributes } ) {\n\tif ( attributes?.ids?.length > 0 || attributes?.images?.length > 0 ) {\n\t\treturn saveWithoutInnerBlocks( { attributes } );\n\t}\n\n\tconst { caption, columns, imageCrop } = attributes;\n\n\tconst className = classnames( 'has-nested-images', {\n\t\t[ `columns-${ columns }` ]: columns !== undefined,\n\t\t[ `columns-default` ]: columns === undefined,\n\t\t'is-cropped': imageCrop,\n\t} );\n\tconst blockProps = useBlockProps.save( { className } );\n\tconst innerBlocksProps = useInnerBlocksProps.save( blockProps );\n\n\treturn (\n\t\t<figure { ...innerBlocksProps }>\n\t\t\t{ innerBlocksProps.children }\n\t\t\t{ ! RichText.isEmpty( caption ) && (\n\t\t\t\t<RichText.Content\n\t\t\t\t\ttagName=\"figcaption\"\n\t\t\t\t\tclassName=\"blocks-gallery-caption\"\n\t\t\t\t\tvalue={ caption }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</figure>\n\t);\n}\n"]}
@@ -2,11 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { get, pick } from 'lodash';
5
- /**
6
- * WordPress dependencies
7
- */
8
-
9
- import { __ } from '@wordpress/i18n';
10
5
  export function defaultColumnsNumber(imageCount) {
11
6
  return imageCount ? Math.min(3, imageCount) : 3;
12
7
  }
@@ -19,7 +14,6 @@ export const pickRelevantMediaFiles = (image, sizeSlug = 'large') => {
19
14
  imageProps.fullUrl = fullUrl;
20
15
  }
21
16
 
22
- imageProps.alt = imageProps.alt !== '' ? imageProps.alt : __('Image gallery image');
23
17
  return imageProps;
24
18
  };
25
19
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/gallery/shared.js"],"names":["get","pick","__","defaultColumnsNumber","imageCount","Math","min","pickRelevantMediaFiles","image","sizeSlug","imageProps","url","fullUrl","alt"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,IAAd,QAA0B,QAA1B;AAEA;AACA;AACA;;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,OAAO,SAASC,oBAAT,CAA+BC,UAA/B,EAA4C;AAClD,SAAOA,UAAU,GAAGC,IAAI,CAACC,GAAL,CAAU,CAAV,EAAaF,UAAb,CAAH,GAA+B,CAAhD;AACA;AAED,OAAO,MAAMG,sBAAsB,GAAG,CAAEC,KAAF,EAASC,QAAQ,GAAG,OAApB,KAAiC;AACtE,QAAMC,UAAU,GAAGT,IAAI,CAAEO,KAAF,EAAS,CAAE,KAAF,EAAS,IAAT,EAAe,MAAf,EAAuB,SAAvB,CAAT,CAAvB;AACAE,EAAAA,UAAU,CAACC,GAAX,GACCX,GAAG,CAAEQ,KAAF,EAAS,CAAE,OAAF,EAAWC,QAAX,EAAqB,KAArB,CAAT,CAAH,IACAT,GAAG,CAAEQ,KAAF,EAAS,CAAE,eAAF,EAAmB,OAAnB,EAA4BC,QAA5B,EAAsC,YAAtC,CAAT,CADH,IAEAD,KAAK,CAACG,GAHP;AAIA,QAAMC,OAAO,GACZZ,GAAG,CAAEQ,KAAF,EAAS,CAAE,OAAF,EAAW,MAAX,EAAmB,KAAnB,CAAT,CAAH,IACAR,GAAG,CAAEQ,KAAF,EAAS,CAAE,eAAF,EAAmB,OAAnB,EAA4B,MAA5B,EAAoC,YAApC,CAAT,CAFJ;;AAGA,MAAKI,OAAL,EAAe;AACdF,IAAAA,UAAU,CAACE,OAAX,GAAqBA,OAArB;AACA;;AACDF,EAAAA,UAAU,CAACG,GAAX,GACCH,UAAU,CAACG,GAAX,KAAmB,EAAnB,GAAwBH,UAAU,CAACG,GAAnC,GAAyCX,EAAE,CAAE,qBAAF,CAD5C;AAEA,SAAOQ,UAAP;AACA,CAfM","sourcesContent":["/**\n * External dependencies\n */\nimport { get, pick } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport function defaultColumnsNumber( imageCount ) {\n\treturn imageCount ? Math.min( 3, imageCount ) : 3;\n}\n\nexport const pickRelevantMediaFiles = ( image, sizeSlug = 'large' ) => {\n\tconst imageProps = pick( image, [ 'alt', 'id', 'link', 'caption' ] );\n\timageProps.url =\n\t\tget( image, [ 'sizes', sizeSlug, 'url' ] ) ||\n\t\tget( image, [ 'media_details', 'sizes', sizeSlug, 'source_url' ] ) ||\n\t\timage.url;\n\tconst fullUrl =\n\t\tget( image, [ 'sizes', 'full', 'url' ] ) ||\n\t\tget( image, [ 'media_details', 'sizes', 'full', 'source_url' ] );\n\tif ( fullUrl ) {\n\t\timageProps.fullUrl = fullUrl;\n\t}\n\timageProps.alt =\n\t\timageProps.alt !== '' ? imageProps.alt : __( 'Image gallery image' );\n\treturn imageProps;\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/gallery/shared.js"],"names":["get","pick","defaultColumnsNumber","imageCount","Math","min","pickRelevantMediaFiles","image","sizeSlug","imageProps","url","fullUrl"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,IAAd,QAA0B,QAA1B;AAEA,OAAO,SAASC,oBAAT,CAA+BC,UAA/B,EAA4C;AAClD,SAAOA,UAAU,GAAGC,IAAI,CAACC,GAAL,CAAU,CAAV,EAAaF,UAAb,CAAH,GAA+B,CAAhD;AACA;AAED,OAAO,MAAMG,sBAAsB,GAAG,CAAEC,KAAF,EAASC,QAAQ,GAAG,OAApB,KAAiC;AACtE,QAAMC,UAAU,GAAGR,IAAI,CAAEM,KAAF,EAAS,CAAE,KAAF,EAAS,IAAT,EAAe,MAAf,EAAuB,SAAvB,CAAT,CAAvB;AACAE,EAAAA,UAAU,CAACC,GAAX,GACCV,GAAG,CAAEO,KAAF,EAAS,CAAE,OAAF,EAAWC,QAAX,EAAqB,KAArB,CAAT,CAAH,IACAR,GAAG,CAAEO,KAAF,EAAS,CAAE,eAAF,EAAmB,OAAnB,EAA4BC,QAA5B,EAAsC,YAAtC,CAAT,CADH,IAEAD,KAAK,CAACG,GAHP;AAIA,QAAMC,OAAO,GACZX,GAAG,CAAEO,KAAF,EAAS,CAAE,OAAF,EAAW,MAAX,EAAmB,KAAnB,CAAT,CAAH,IACAP,GAAG,CAAEO,KAAF,EAAS,CAAE,eAAF,EAAmB,OAAnB,EAA4B,MAA5B,EAAoC,YAApC,CAAT,CAFJ;;AAGA,MAAKI,OAAL,EAAe;AACdF,IAAAA,UAAU,CAACE,OAAX,GAAqBA,OAArB;AACA;;AACD,SAAOF,UAAP;AACA,CAbM","sourcesContent":["/**\n * External dependencies\n */\nimport { get, pick } from 'lodash';\n\nexport function defaultColumnsNumber( imageCount ) {\n\treturn imageCount ? Math.min( 3, imageCount ) : 3;\n}\n\nexport const pickRelevantMediaFiles = ( image, sizeSlug = 'large' ) => {\n\tconst imageProps = pick( image, [ 'alt', 'id', 'link', 'caption' ] );\n\timageProps.url =\n\t\tget( image, [ 'sizes', sizeSlug, 'url' ] ) ||\n\t\tget( image, [ 'media_details', 'sizes', sizeSlug, 'source_url' ] ) ||\n\t\timage.url;\n\tconst fullUrl =\n\t\tget( image, [ 'sizes', 'full', 'url' ] ) ||\n\t\tget( image, [ 'media_details', 'sizes', 'full', 'source_url' ] );\n\tif ( fullUrl ) {\n\t\timageProps.fullUrl = fullUrl;\n\t}\n\treturn imageProps;\n};\n"]}
@@ -26,19 +26,13 @@ export default function useGetMedia(innerBlockImages) {
26
26
  return currentImageMedia;
27
27
  }
28
28
 
29
- const getMedia = select(coreStore).getMedia;
30
- const newImageMedia = imageIds.map(img => {
31
- return getMedia(img);
29
+ return select(coreStore).getMediaItems({
30
+ include: imageIds.join(','),
31
+ per_page: -1
32
32
  });
33
-
34
- if (newImageMedia.some(img => !img)) {
35
- return currentImageMedia;
36
- }
37
-
38
- return newImageMedia;
39
33
  }, [innerBlockImages]);
40
34
 
41
- if ((imageMedia === null || imageMedia === void 0 ? void 0 : imageMedia.length) !== currentImageMedia.length || imageMedia.some(newImage => !currentImageMedia.find(currentImage => currentImage.id === newImage.id))) {
35
+ if ((imageMedia === null || imageMedia === void 0 ? void 0 : imageMedia.length) !== (currentImageMedia === null || currentImageMedia === void 0 ? void 0 : currentImageMedia.length) || imageMedia !== null && imageMedia !== void 0 && imageMedia.some(newImage => !currentImageMedia.find(currentImage => currentImage.id === newImage.id))) {
42
36
  setCurrentImageMedia(imageMedia);
43
37
  return imageMedia;
44
38
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/gallery/use-get-media.js"],"names":["useState","useSelect","store","coreStore","useGetMedia","innerBlockImages","currentImageMedia","setCurrentImageMedia","imageMedia","select","length","imageIds","map","imageBlock","attributes","id","filter","undefined","getMedia","newImageMedia","img","some","newImage","find","currentImage"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,oBAAzB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,WAAT,CAAsBC,gBAAtB,EAAyC;AACvD,QAAM,CAAEC,iBAAF,EAAqBC,oBAArB,IAA8CP,QAAQ,CAAE,EAAF,CAA5D;AAEA,QAAMQ,UAAU,GAAGP,SAAS,CACzBQ,MAAF,IAAc;AACb,QAAK,EAAEJ,gBAAF,aAAEA,gBAAF,eAAEA,gBAAgB,CAAEK,MAApB,CAAL,EAAkC;AACjC,aAAOJ,iBAAP;AACA;;AAED,UAAMK,QAAQ,GAAGN,gBAAgB,CAC/BO,GADe,CACRC,UAAF,IAAkBA,UAAU,CAACC,UAAX,CAAsBC,EAD9B,EAEfC,MAFe,CAELD,EAAF,IAAUA,EAAE,KAAKE,SAFV,CAAjB;;AAIA,QAAKN,QAAQ,CAACD,MAAT,KAAoB,CAAzB,EAA6B;AAC5B,aAAOJ,iBAAP;AACA;;AACD,UAAMY,QAAQ,GAAGT,MAAM,CAAEN,SAAF,CAAN,CAAoBe,QAArC;AACA,UAAMC,aAAa,GAAGR,QAAQ,CAACC,GAAT,CAAgBQ,GAAF,IAAW;AAC9C,aAAOF,QAAQ,CAAEE,GAAF,CAAf;AACA,KAFqB,CAAtB;;AAIA,QAAKD,aAAa,CAACE,IAAd,CAAsBD,GAAF,IAAW,CAAEA,GAAjC,CAAL,EAA8C;AAC7C,aAAOd,iBAAP;AACA;;AAED,WAAOa,aAAP;AACA,GAvB0B,EAwB3B,CAAEd,gBAAF,CAxB2B,CAA5B;;AA2BA,MACC,CAAAG,UAAU,SAAV,IAAAA,UAAU,WAAV,YAAAA,UAAU,CAAEE,MAAZ,MAAuBJ,iBAAiB,CAACI,MAAzC,IACAF,UAAU,CAACa,IAAX,CACGC,QAAF,IACC,CAAEhB,iBAAiB,CAACiB,IAAlB,CACCC,YAAF,IAAoBA,YAAY,CAACT,EAAb,KAAoBO,QAAQ,CAACP,EADhD,CAFJ,CAFD,EAQE;AACDR,IAAAA,oBAAoB,CAAEC,UAAF,CAApB;AACA,WAAOA,UAAP;AACA;;AACD,SAAOF,iBAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Retrieves the extended media info for each gallery image from the store. This is used to\n * determine which image size options are available for the current gallery.\n *\n * @param {Array} innerBlockImages An array of the innerBlock images currently in the gallery.\n *\n * @return {Array} An array of media info options for each gallery image.\n */\nexport default function useGetMedia( innerBlockImages ) {\n\tconst [ currentImageMedia, setCurrentImageMedia ] = useState( [] );\n\n\tconst imageMedia = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! innerBlockImages?.length ) {\n\t\t\t\treturn currentImageMedia;\n\t\t\t}\n\n\t\t\tconst imageIds = innerBlockImages\n\t\t\t\t.map( ( imageBlock ) => imageBlock.attributes.id )\n\t\t\t\t.filter( ( id ) => id !== undefined );\n\n\t\t\tif ( imageIds.length === 0 ) {\n\t\t\t\treturn currentImageMedia;\n\t\t\t}\n\t\t\tconst getMedia = select( coreStore ).getMedia;\n\t\t\tconst newImageMedia = imageIds.map( ( img ) => {\n\t\t\t\treturn getMedia( img );\n\t\t\t} );\n\n\t\t\tif ( newImageMedia.some( ( img ) => ! img ) ) {\n\t\t\t\treturn currentImageMedia;\n\t\t\t}\n\n\t\t\treturn newImageMedia;\n\t\t},\n\t\t[ innerBlockImages ]\n\t);\n\n\tif (\n\t\timageMedia?.length !== currentImageMedia.length ||\n\t\timageMedia.some(\n\t\t\t( newImage ) =>\n\t\t\t\t! currentImageMedia.find(\n\t\t\t\t\t( currentImage ) => currentImage.id === newImage.id\n\t\t\t\t)\n\t\t)\n\t) {\n\t\tsetCurrentImageMedia( imageMedia );\n\t\treturn imageMedia;\n\t}\n\treturn currentImageMedia;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/gallery/use-get-media.js"],"names":["useState","useSelect","store","coreStore","useGetMedia","innerBlockImages","currentImageMedia","setCurrentImageMedia","imageMedia","select","length","imageIds","map","imageBlock","attributes","id","filter","undefined","getMediaItems","include","join","per_page","some","newImage","find","currentImage"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,oBAAzB;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,WAAT,CAAsBC,gBAAtB,EAAyC;AACvD,QAAM,CAAEC,iBAAF,EAAqBC,oBAArB,IAA8CP,QAAQ,CAAE,EAAF,CAA5D;AAEA,QAAMQ,UAAU,GAAGP,SAAS,CACzBQ,MAAF,IAAc;AACb,QAAK,EAAEJ,gBAAF,aAAEA,gBAAF,eAAEA,gBAAgB,CAAEK,MAApB,CAAL,EAAkC;AACjC,aAAOJ,iBAAP;AACA;;AAED,UAAMK,QAAQ,GAAGN,gBAAgB,CAC/BO,GADe,CACRC,UAAF,IAAkBA,UAAU,CAACC,UAAX,CAAsBC,EAD9B,EAEfC,MAFe,CAELD,EAAF,IAAUA,EAAE,KAAKE,SAFV,CAAjB;;AAIA,QAAKN,QAAQ,CAACD,MAAT,KAAoB,CAAzB,EAA6B;AAC5B,aAAOJ,iBAAP;AACA;;AAED,WAAOG,MAAM,CAAEN,SAAF,CAAN,CAAoBe,aAApB,CAAmC;AACzCC,MAAAA,OAAO,EAAER,QAAQ,CAACS,IAAT,CAAe,GAAf,CADgC;AAEzCC,MAAAA,QAAQ,EAAE,CAAC;AAF8B,KAAnC,CAAP;AAIA,GAlB0B,EAmB3B,CAAEhB,gBAAF,CAnB2B,CAA5B;;AAsBA,MACC,CAAAG,UAAU,SAAV,IAAAA,UAAU,WAAV,YAAAA,UAAU,CAAEE,MAAZ,OAAuBJ,iBAAvB,aAAuBA,iBAAvB,uBAAuBA,iBAAiB,CAAEI,MAA1C,KACAF,UADA,aACAA,UADA,eACAA,UAAU,CAAEc,IAAZ,CACGC,QAAF,IACC,CAAEjB,iBAAiB,CAACkB,IAAlB,CACCC,YAAF,IAAoBA,YAAY,CAACV,EAAb,KAAoBQ,QAAQ,CAACR,EADhD,CAFJ,CAFD,EAQE;AACDR,IAAAA,oBAAoB,CAAEC,UAAF,CAApB;AACA,WAAOA,UAAP;AACA;;AACD,SAAOF,iBAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Retrieves the extended media info for each gallery image from the store. This is used to\n * determine which image size options are available for the current gallery.\n *\n * @param {Array} innerBlockImages An array of the innerBlock images currently in the gallery.\n *\n * @return {Array} An array of media info options for each gallery image.\n */\nexport default function useGetMedia( innerBlockImages ) {\n\tconst [ currentImageMedia, setCurrentImageMedia ] = useState( [] );\n\n\tconst imageMedia = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! innerBlockImages?.length ) {\n\t\t\t\treturn currentImageMedia;\n\t\t\t}\n\n\t\t\tconst imageIds = innerBlockImages\n\t\t\t\t.map( ( imageBlock ) => imageBlock.attributes.id )\n\t\t\t\t.filter( ( id ) => id !== undefined );\n\n\t\t\tif ( imageIds.length === 0 ) {\n\t\t\t\treturn currentImageMedia;\n\t\t\t}\n\n\t\t\treturn select( coreStore ).getMediaItems( {\n\t\t\t\tinclude: imageIds.join( ',' ),\n\t\t\t\tper_page: -1,\n\t\t\t} );\n\t\t},\n\t\t[ innerBlockImages ]\n\t);\n\n\tif (\n\t\timageMedia?.length !== currentImageMedia?.length ||\n\t\timageMedia?.some(\n\t\t\t( newImage ) =>\n\t\t\t\t! currentImageMedia.find(\n\t\t\t\t\t( currentImage ) => currentImage.id === newImage.id\n\t\t\t\t)\n\t\t)\n\t) {\n\t\tsetCurrentImageMedia( imageMedia );\n\t\treturn imageMedia;\n\t}\n\treturn currentImageMedia;\n}\n"]}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { useDispatch, useSelect } from '@wordpress/data';
6
+ import { store as interfaceStore } from '@wordpress/interface';
7
+ import { store as noticesStore } from '@wordpress/notices';
8
+ export default function useMobileWarning(newImages) {
9
+ const {
10
+ createWarningNotice
11
+ } = useDispatch(noticesStore);
12
+ const {
13
+ toggleFeature
14
+ } = useDispatch(interfaceStore);
15
+ const isMobileWarningActive = useSelect(select => {
16
+ const {
17
+ isFeatureActive
18
+ } = select(interfaceStore);
19
+ return isFeatureActive('core/edit-post', 'mobileGalleryWarning');
20
+ }, []);
21
+
22
+ if (!isMobileWarningActive || !newImages) {
23
+ return;
24
+ }
25
+
26
+ createWarningNotice(__('Editing this Gallery in the WordPress mobile app requires version 18.2 or higher.'), {
27
+ type: 'snackbar',
28
+ explicitDismiss: true
29
+ });
30
+ toggleFeature('core/edit-post', 'mobileGalleryWarning');
31
+ }
32
+ //# sourceMappingURL=use-mobile-warning.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/block-library/src/gallery/use-mobile-warning.js"],"names":["__","useDispatch","useSelect","store","interfaceStore","noticesStore","useMobileWarning","newImages","createWarningNotice","toggleFeature","isMobileWarningActive","select","isFeatureActive","type","explicitDismiss"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AACA,SAASD,KAAK,IAAIE,YAAlB,QAAsC,oBAAtC;AAEA,eAAe,SAASC,gBAAT,CAA2BC,SAA3B,EAAuC;AACrD,QAAM;AAAEC,IAAAA;AAAF,MAA0BP,WAAW,CAAEI,YAAF,CAA3C;AACA,QAAM;AAAEI,IAAAA;AAAF,MAAoBR,WAAW,CAAEG,cAAF,CAArC;AACA,QAAMM,qBAAqB,GAAGR,SAAS,CAAIS,MAAF,IAAc;AACtD,UAAM;AAAEC,MAAAA;AAAF,QAAsBD,MAAM,CAAEP,cAAF,CAAlC;AACA,WAAOQ,eAAe,CAAE,gBAAF,EAAoB,sBAApB,CAAtB;AACA,GAHsC,EAGpC,EAHoC,CAAvC;;AAKA,MAAK,CAAEF,qBAAF,IAA2B,CAAEH,SAAlC,EAA8C;AAC7C;AACA;;AAEDC,EAAAA,mBAAmB,CAClBR,EAAE,CACD,mFADC,CADgB,EAIlB;AAAEa,IAAAA,IAAI,EAAE,UAAR;AAAoBC,IAAAA,eAAe,EAAE;AAArC,GAJkB,CAAnB;AAMAL,EAAAA,aAAa,CAAE,gBAAF,EAAoB,sBAApB,CAAb;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as noticesStore } from '@wordpress/notices';\n\nexport default function useMobileWarning( newImages ) {\n\tconst { createWarningNotice } = useDispatch( noticesStore );\n\tconst { toggleFeature } = useDispatch( interfaceStore );\n\tconst isMobileWarningActive = useSelect( ( select ) => {\n\t\tconst { isFeatureActive } = select( interfaceStore );\n\t\treturn isFeatureActive( 'core/edit-post', 'mobileGalleryWarning' );\n\t}, [] );\n\n\tif ( ! isMobileWarningActive || ! newImages ) {\n\t\treturn;\n\t}\n\n\tcreateWarningNotice(\n\t\t__(\n\t\t\t'Editing this Gallery in the WordPress mobile app requires version 18.2 or higher.'\n\t\t),\n\t\t{ type: 'snackbar', explicitDismiss: true }\n\t);\n\ttoggleFeature( 'core/edit-post', 'mobileGalleryWarning' );\n}\n"]}
@@ -4,7 +4,7 @@ import { createElement, Fragment } from "@wordpress/element";
4
4
  * WordPress dependencies
5
5
  */
6
6
  import { useSelect } from '@wordpress/data';
7
- import { InnerBlocks, useBlockProps, InspectorControls, __experimentalUseInnerBlocksProps as useInnerBlocksProps, useSetting, store as blockEditorStore } from '@wordpress/block-editor';
7
+ import { InnerBlocks, useBlockProps, InspectorControls, useInnerBlocksProps, useSetting, store as blockEditorStore } from '@wordpress/block-editor';
8
8
  import { SelectControl } from '@wordpress/components';
9
9
  import { __ } from '@wordpress/i18n';
10
10
  const htmlElementMessages = {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/group/edit.js"],"names":["useSelect","InnerBlocks","useBlockProps","InspectorControls","__experimentalUseInnerBlocksProps","useInnerBlocksProps","useSetting","store","blockEditorStore","SelectControl","__","htmlElementMessages","header","main","section","article","aside","footer","GroupEdit","attributes","setAttributes","clientId","hasInnerBlocks","themeSupportsLayout","select","getBlock","getSettings","block","innerBlocks","length","supportsLayout","defaultLayout","tagName","TagName","templateLock","layout","usedLayout","inherit","type","layoutSupportEnabled","blockProps","innerBlocksProps","className","renderAppender","undefined","ButtonBlockAppender","__experimentalLayout","label","value"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SACCC,WADD,EAECC,aAFD,EAGCC,iBAHD,EAICC,iCAAiC,IAAIC,mBAJtC,EAKCC,UALD,EAMCC,KAAK,IAAIC,gBANV,QAOO,yBAPP;AAQA,SAASC,aAAT,QAA8B,uBAA9B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,MAAMC,mBAAmB,GAAG;AAC3BC,EAAAA,MAAM,EAAEF,EAAE,CACT,qHADS,CADiB;AAI3BG,EAAAA,IAAI,EAAEH,EAAE,CACP,mFADO,CAJmB;AAO3BI,EAAAA,OAAO,EAAEJ,EAAE,CACV,kIADU,CAPgB;AAU3BK,EAAAA,OAAO,EAAEL,EAAE,CACV,gGADU,CAVgB;AAa3BM,EAAAA,KA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ACC,qBAAUC,gBAAV,CADD,CAxBF,CADD;AA+BA;;AAED,eAAevB,SAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tInspectorControls,\n\t__experimentalUseInnerBlocksProps as useInnerBlocksProps,\n\tuseSetting,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst htmlElementMessages = {\n\theader: __(\n\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t),\n\tmain: __(\n\t\t'The <main> element should be used for the primary content of your document only. '\n\t),\n\tsection: __(\n\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t),\n\tarticle: __(\n\t\t'The <article> element should represent a self contained, syndicatable portion of the document.'\n\t),\n\taside: __(\n\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t),\n\tfooter: __(\n\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t),\n};\n\nfunction GroupEdit( { attributes, setAttributes, clientId } ) {\n\tconst { hasInnerBlocks, themeSupportsLayout } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock, getSettings } = select( blockEditorStore );\n\t\t\tconst block = getBlock( clientId );\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: !! ( block && block.innerBlocks.length ),\n\t\t\t\tthemeSupportsLayout: getSettings()?.supportsLayout,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst defaultLayout = useSetting( 'layout' ) || {};\n\tconst { tagName: TagName = 'div', templateLock, layout = {} } = attributes;\n\tconst usedLayout = !! layout && layout.inherit ? defaultLayout : layout;\n\tconst { type = 'default' } = usedLayout;\n\tconst layoutSupportEnabled = themeSupportsLayout || type !== 'default';\n\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\tlayoutSupportEnabled\n\t\t\t? blockProps\n\t\t\t: { className: 'wp-block-group__inner-container' },\n\t\t{\n\t\t\ttemplateLock,\n\t\t\trenderAppender: hasInnerBlocks\n\t\t\t\t? undefined\n\t\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t\t\t__experimentalLayout: layoutSupportEnabled ? usedLayout : undefined,\n\t\t}\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls __experimentalGroup=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ TagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ TagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t{ layoutSupportEnabled && <TagName { ...innerBlocksProps } /> }\n\t\t\t{ /* Ideally this is not needed but it's there for backward compatibility reason\n\t\t\t\tto keep this div for themes that might rely on its presence */ }\n\t\t\t{ ! layoutSupportEnabled && (\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t\t</TagName>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default GroupEdit;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/group/edit.js"],"names":["useSelect","InnerBlocks","useBlockProps","InspectorControls","useInnerBlocksProps","useSetting","store","blockEditorStore","SelectControl","__","htmlElementMessages","header","main","section","article","aside","footer","GroupEdit","attributes","setAttributes","clientId","hasInnerBlocks","themeSupportsLayout","select","getBlock","getSettings","block","innerBlocks","length","supportsLayout","defaultLayout","tagName","TagName","templateLock","layout","usedLayout","inherit","type","layoutSupportEnabled","blockProps","innerBlocksProps","className","renderAppender","undefined","ButtonBlockAppender","__experimentalLayout","label","value"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SACCC,WADD,EAECC,aAFD,EAGCC,iBAHD,EAICC,mBAJD,EAKCC,UALD,EAMCC,KAAK,IAAIC,gBANV,QAOO,yBAPP;AAQA,SAASC,aAAT,QAA8B,uBAA9B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,MAAMC,mBAAmB,GAAG;AAC3BC,EAAAA,MAAM,EAAEF,EAAE,CACT,qHADS,CADiB;AAI3BG,EAAAA,IAAI,EAAEH,EAAE,CACP,mFADO,CAJmB;AAO3BI,EAAAA,OAAO,EAAEJ,EAAE,CACV,kIADU,CAPgB;AAU3BK,EAAAA,OAAO,EAAEL,EAAE,CACV,gGADU,CAVgB;AAa3BM,EAAAA,KAAK,EAAEN,EAAE,CACR,uIADQ,CAbkB;AAgB3BO,EAAAA,MAAM,EAAEP,EAAE,CACT,8HADS;AAhBiB,CAA5B;;AAqBA,SAASQ,SAAT,CAAoB;AAAEC,EAAAA,UAAF;AAAcC,EAAAA,aAAd;AAA6BC,EAAAA;AAA7B,CAApB,EAA8D;AAC7D,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA;AAAlB,MAA0CtB,SAAS,CACtDuB,MAAF,IAAc;AAAA;;AACb,UAAM;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ,QAA4BF,MAAM,CAAEhB,gBAAF,CAAxC;AACA,UAAMmB,KAAK,GAAGF,QAAQ,CAAEJ,QAAF,CAAtB;AACA,WAAO;AACNC,MAAAA,cAAc,EAAE,CAAC,EAAIK,KAAK,IAA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AK,EAAE;AAA5B,KAFS,EAGT;AAAED,MAAAA,KAAK,EAAE,QAAT;AAAmBC,MAAAA,KAAK,EAAE;AAA1B,KAHS,EAIT;AAAED,MAAAA,KAAK,EAAE,WAAT;AAAsBC,MAAAA,KAAK,EAAE;AAA7B,KAJS,EAKT;AAAED,MAAAA,KAAK,EAAE,WAAT;AAAsBC,MAAAA,KAAK,EAAE;AAA7B,KALS,EAMT;AAAED,MAAAA,KAAK,EAAE,SAAT;AAAoBC,MAAAA,KAAK,EAAE;AAA3B,KANS,EAOT;AAAED,MAAAA,KAAK,EAAE,UAAT;AAAqBC,MAAAA,KAAK,EAAE;AAA5B,KAPS,CAFX;AAWC,IAAA,KAAK,EAAGf,OAXT;AAYC,IAAA,QAAQ,EAAKe,KAAF,IACV5B,aAAa,CAAE;AAAEY,MAAAA,OAAO,EAAEgB;AAAX,KAAF,CAbf;AAeC,IAAA,IAAI,EAAGrC,mBAAmB,CAAEsB,OAAF;AAf3B,IADD,CADD,EAoBGM,oBAAoB,IAAI,cAAC,OAAD,EAAcE,gBAAd,CApB3B,EAuBG,CAAEF,oBAAF,IACD,cAAC,OAAD,EAAcC,UAAd,EACC,qBAAUC,gBAAV,CADD,CAxBF,CADD;AA+BA;;AAED,eAAevB,SAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tInnerBlocks,\n\tuseBlockProps,\n\tInspectorControls,\n\tuseInnerBlocksProps,\n\tuseSetting,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { SelectControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst htmlElementMessages = {\n\theader: __(\n\t\t'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'\n\t),\n\tmain: __(\n\t\t'The <main> element should be used for the primary content of your document only. '\n\t),\n\tsection: __(\n\t\t\"The <section> element should represent a standalone portion of the document that can't be better represented by another element.\"\n\t),\n\tarticle: __(\n\t\t'The <article> element should represent a self contained, syndicatable portion of the document.'\n\t),\n\taside: __(\n\t\t\"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content.\"\n\t),\n\tfooter: __(\n\t\t'The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'\n\t),\n};\n\nfunction GroupEdit( { attributes, setAttributes, clientId } ) {\n\tconst { hasInnerBlocks, themeSupportsLayout } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock, getSettings } = select( blockEditorStore );\n\t\t\tconst block = getBlock( clientId );\n\t\t\treturn {\n\t\t\t\thasInnerBlocks: !! ( block && block.innerBlocks.length ),\n\t\t\t\tthemeSupportsLayout: getSettings()?.supportsLayout,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst defaultLayout = useSetting( 'layout' ) || {};\n\tconst { tagName: TagName = 'div', templateLock, layout = {} } = attributes;\n\tconst usedLayout = !! layout && layout.inherit ? defaultLayout : layout;\n\tconst { type = 'default' } = usedLayout;\n\tconst layoutSupportEnabled = themeSupportsLayout || type !== 'default';\n\n\tconst blockProps = useBlockProps();\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\tlayoutSupportEnabled\n\t\t\t? blockProps\n\t\t\t: { className: 'wp-block-group__inner-container' },\n\t\t{\n\t\t\ttemplateLock,\n\t\t\trenderAppender: hasInnerBlocks\n\t\t\t\t? undefined\n\t\t\t\t: InnerBlocks.ButtonBlockAppender,\n\t\t\t__experimentalLayout: layoutSupportEnabled ? usedLayout : undefined,\n\t\t}\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls __experimentalGroup=\"advanced\">\n\t\t\t\t<SelectControl\n\t\t\t\t\tlabel={ __( 'HTML element' ) }\n\t\t\t\t\toptions={ [\n\t\t\t\t\t\t{ label: __( 'Default (<div>)' ), value: 'div' },\n\t\t\t\t\t\t{ label: '<header>', value: 'header' },\n\t\t\t\t\t\t{ label: '<main>', value: 'main' },\n\t\t\t\t\t\t{ label: '<section>', value: 'section' },\n\t\t\t\t\t\t{ label: '<article>', value: 'article' },\n\t\t\t\t\t\t{ label: '<aside>', value: 'aside' },\n\t\t\t\t\t\t{ label: '<footer>', value: 'footer' },\n\t\t\t\t\t] }\n\t\t\t\t\tvalue={ TagName }\n\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\tsetAttributes( { tagName: value } )\n\t\t\t\t\t}\n\t\t\t\t\thelp={ htmlElementMessages[ TagName ] }\n\t\t\t\t/>\n\t\t\t</InspectorControls>\n\t\t\t{ layoutSupportEnabled && <TagName { ...innerBlocksProps } /> }\n\t\t\t{ /* Ideally this is not needed but it's there for backward compatibility reason\n\t\t\t\tto keep this div for themes that might rely on its presence */ }\n\t\t\t{ ! layoutSupportEnabled && (\n\t\t\t\t<TagName { ...blockProps }>\n\t\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t\t</TagName>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default GroupEdit;\n"]}
@@ -24,6 +24,7 @@ const metadata = {
24
24
  "default": "div"
25
25
  },
26
26
  templateLock: {
27
+ type: ["string", "boolean"],
27
28
  "enum": ["all", "insert", false]
28
29
  }
29
30
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/group/index.js"],"names":["__","createBlock","group","icon","deprecated","edit","save","variations","name","metadata","settings","example","attributes","style","color","text","background","innerBlocks","customTextColor","fontSize","content","transforms","from","type","isMultiBlock","blocks","__experimentalConvert","length","alignments","widestAlignment","reduce","accumulator","block","align","indexOf","undefined","groupInnerBlocks","map"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,mBAA5B;AACA,SAASC,KAAK,IAAIC,IAAlB,QAA8B,kBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IA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,CAACf,WAHW,CAAlB;AAKA,SANwB,CAAzB;AAQA,eAAOhB,WAAW,CACjB,YADiB,EAEjB;AACCgC,UAAAA,KAAK,EAAEJ;AADR,SAFiB,EAKjBO,gBALiB,CAAlB;AAOA;;AA/CF,KADK;AADK,GA9DW;AAmHvB/B,EAAAA,IAnHuB;AAoHvBC,EAAAA,IApHuB;AAqHvBF,EAAAA,UArHuB;AAsHvBG,EAAAA;AAtHuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { createBlock } from '@wordpress/blocks';\nimport { group as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tstyle: {\n\t\t\t\tcolor: {\n\t\t\t\t\ttext: '#000000',\n\t\t\t\t\tbackground: '#ffffff',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#cf2e2e',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'One.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#ff6900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Two.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#fcb900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Three.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#00d084',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Four.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#0693e3',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Five.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#9b51e0',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Six.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms: {\n\t\tfrom: [\n\t\t\t{\n\t\t\t\ttype: 'block',\n\t\t\t\tisMultiBlock: true,\n\t\t\t\tblocks: [ '*' ],\n\t\t\t\t__experimentalConvert( blocks ) {\n\t\t\t\t\t// Avoid transforming a single `core/group` Block\n\t\t\t\t\tif (\n\t\t\t\t\t\tblocks.length === 1 &&\n\t\t\t\t\t\tblocks[ 0 ].name === 'core/group'\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst alignments = [ 'wide', 'full' ];\n\n\t\t\t\t\t// Determine the widest setting of all the blocks to be grouped\n\t\t\t\t\tconst widestAlignment = blocks.reduce(\n\t\t\t\t\t\t( accumulator, block ) => {\n\t\t\t\t\t\t\tconst { align } = block.attributes;\n\t\t\t\t\t\t\treturn alignments.indexOf( align ) >\n\t\t\t\t\t\t\t\talignments.indexOf( accumulator )\n\t\t\t\t\t\t\t\t? align\n\t\t\t\t\t\t\t\t: accumulator;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tundefined\n\t\t\t\t\t);\n\n\t\t\t\t\t// Clone the Blocks to be Grouped\n\t\t\t\t\t// Failing to create new block references causes the original blocks\n\t\t\t\t\t// to be replaced in the switchToBlockType call thereby meaning they\n\t\t\t\t\t// are removed both from their original location and within the\n\t\t\t\t\t// new group block.\n\t\t\t\t\tconst groupInnerBlocks = blocks.map( ( block ) => {\n\t\t\t\t\t\treturn createBlock(\n\t\t\t\t\t\t\tblock.name,\n\t\t\t\t\t\t\tblock.attributes,\n\t\t\t\t\t\t\tblock.innerBlocks\n\t\t\t\t\t\t);\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn createBlock(\n\t\t\t\t\t\t'core/group',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\talign: widestAlignment,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tgroupInnerBlocks\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n\tvariations,\n};\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/group/index.js"],"names":["__","createBlock","group","icon","deprecated","edit","save","variations","name","metadata","settings","example","attributes","style","color","text","background","innerBlocks","customTextColor","fontSize","content","transforms","from","type","isMultiBlock","blocks","__experimentalConvert","length","alignments","widestAlignment","reduce","accumulator","block","align","indexOf","undefined","groupInnerBlocks","map"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,mBAA5B;AACA,SAASC,KAAK,IAAIC,IAAlB,QAA8B,kBAA9B;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,cAAvB;AACA,OAAOC,IAAP,MAAiB,QAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAOC,IAAP,MAAiB,QAAjB;AACA,OAAOC,UAAP,MAAuB,cAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAWC,QAAjB;AAEA,SAASA,QAAT,EAAmBD,IAAnB;AAEA,OAAO,MAAME,QAAQ,GAAG;AACvBP,EAAAA,IADuB;AAEvBQ,EAAAA,OAAO,EAAE;AACRC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,IApHuB;AAqHvBF,EAAAA,UArHuB;AAsHvBG,EAAAA;AAtHuB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { createBlock } from '@wordpress/blocks';\nimport { group as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\nimport variations from './variations';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tstyle: {\n\t\t\t\tcolor: {\n\t\t\t\t\ttext: '#000000',\n\t\t\t\t\tbackground: '#ffffff',\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\tinnerBlocks: [\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#cf2e2e',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'One.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#ff6900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Two.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#fcb900',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Three.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#00d084',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Four.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#0693e3',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Five.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'core/paragraph',\n\t\t\t\tattributes: {\n\t\t\t\t\tcustomTextColor: '#9b51e0',\n\t\t\t\t\tfontSize: 'large',\n\t\t\t\t\tcontent: __( 'Six.' ),\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\ttransforms: {\n\t\tfrom: [\n\t\t\t{\n\t\t\t\ttype: 'block',\n\t\t\t\tisMultiBlock: true,\n\t\t\t\tblocks: [ '*' ],\n\t\t\t\t__experimentalConvert( blocks ) {\n\t\t\t\t\t// Avoid transforming a single `core/group` Block\n\t\t\t\t\tif (\n\t\t\t\t\t\tblocks.length === 1 &&\n\t\t\t\t\t\tblocks[ 0 ].name === 'core/group'\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst alignments = [ 'wide', 'full' ];\n\n\t\t\t\t\t// Determine the widest setting of all the blocks to be grouped\n\t\t\t\t\tconst widestAlignment = blocks.reduce(\n\t\t\t\t\t\t( accumulator, block ) => {\n\t\t\t\t\t\t\tconst { align } = block.attributes;\n\t\t\t\t\t\t\treturn alignments.indexOf( align ) >\n\t\t\t\t\t\t\t\talignments.indexOf( accumulator )\n\t\t\t\t\t\t\t\t? align\n\t\t\t\t\t\t\t\t: accumulator;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tundefined\n\t\t\t\t\t);\n\n\t\t\t\t\t// Clone the Blocks to be Grouped\n\t\t\t\t\t// Failing to create new block references causes the original blocks\n\t\t\t\t\t// to be replaced in the switchToBlockType call thereby meaning they\n\t\t\t\t\t// are removed both from their original location and within the\n\t\t\t\t\t// new group block.\n\t\t\t\t\tconst groupInnerBlocks = blocks.map( ( block ) => {\n\t\t\t\t\t\treturn createBlock(\n\t\t\t\t\t\t\tblock.name,\n\t\t\t\t\t\t\tblock.attributes,\n\t\t\t\t\t\t\tblock.innerBlocks\n\t\t\t\t\t\t);\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn createBlock(\n\t\t\t\t\t\t'core/group',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\talign: widestAlignment,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tgroupInnerBlocks\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n\tvariations,\n};\n"]}
@@ -3,13 +3,12 @@ import { createElement } from "@wordpress/element";
3
3
  /**
4
4
  * WordPress dependencies
5
5
  */
6
- import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
6
+ import { useInnerBlocksProps, useBlockProps } from '@wordpress/block-editor';
7
7
  export default function save({
8
- attributes
9
- }) {
10
- const {
8
+ attributes: {
11
9
  tagName: Tag
12
- } = attributes;
13
- return createElement(Tag, useBlockProps.save(), createElement(InnerBlocks.Content, null));
10
+ }
11
+ }) {
12
+ return createElement(Tag, useInnerBlocksProps.save(useBlockProps.save()));
14
13
  }
15
14
  //# sourceMappingURL=save.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-library/src/group/save.js"],"names":["InnerBlocks","useBlockProps","save","attributes","tagName","Tag"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,aAAtB,QAA2C,yBAA3C;AAEA,eAAe,SAASC,IAAT,CAAe;AAAEC,EAAAA;AAAF,CAAf,EAAgC;AAC9C,QAAM;AAAEC,IAAAA,OAAO,EAAEC;AAAX,MAAmBF,UAAzB;AACA,SACC,cAAC,GAAD,EAAUF,aAAa,CAACC,IAAd,EAAV,EACC,cAAC,WAAD,CAAa,OAAb,OADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { InnerBlocks, useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes } ) {\n\tconst { tagName: Tag } = attributes;\n\treturn (\n\t\t<Tag { ...useBlockProps.save() }>\n\t\t\t<InnerBlocks.Content />\n\t\t</Tag>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-library/src/group/save.js"],"names":["useInnerBlocksProps","useBlockProps","save","attributes","tagName","Tag"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,mBAAT,EAA8BC,aAA9B,QAAmD,yBAAnD;AAEA,eAAe,SAASC,IAAT,CAAe;AAAEC,EAAAA,UAAU,EAAE;AAAEC,IAAAA,OAAO,EAAEC;AAAX;AAAd,CAAf,EAAkD;AAChE,SAAO,cAAC,GAAD,EAAUL,mBAAmB,CAACE,IAApB,CAA0BD,aAAa,CAACC,IAAd,EAA1B,CAAV,CAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInnerBlocksProps, useBlockProps } from '@wordpress/block-editor';\n\nexport default function save( { attributes: { tagName: Tag } } ) {\n\treturn <Tag { ...useInnerBlocksProps.save( useBlockProps.save() ) } />;\n}\n"]}
@@ -8,7 +8,8 @@ const variations = [{
8
8
  description: __('Blocks shown in a row.'),
9
9
  attributes: {
10
10
  layout: {
11
- type: 'flex'
11
+ type: 'flex',
12
+ allowOrientation: false
12
13
  }
13
14
  },
14
15
  scope: ['inserter'],