@wordpress/block-library 7.6.0 → 7.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (774) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/audio/edit.js +1 -0
  3. package/build/audio/edit.js.map +1 -1
  4. package/build/audio/index.js +6 -1
  5. package/build/audio/index.js.map +1 -1
  6. package/build/audio/save.js +2 -1
  7. package/build/audio/save.js.map +1 -1
  8. package/build/avatar/hooks.js +2 -2
  9. package/build/avatar/hooks.js.map +1 -1
  10. package/build/block/edit.js.map +1 -1
  11. package/build/block/edit.native.js.map +1 -1
  12. package/build/button/deprecated.js +175 -35
  13. package/build/button/deprecated.js.map +1 -1
  14. package/build/button/edit.js +1 -1
  15. package/build/button/edit.js.map +1 -1
  16. package/build/button/edit.native.js.map +1 -1
  17. package/build/button/save.js +1 -1
  18. package/build/button/save.js.map +1 -1
  19. package/build/buttons/deprecated.js.map +1 -1
  20. package/build/buttons/edit.js.map +1 -1
  21. package/build/buttons/edit.native.js.map +1 -1
  22. package/build/column/deprecated.js.map +1 -1
  23. package/build/column/edit.js.map +1 -1
  24. package/build/column/edit.native.js.map +1 -1
  25. package/build/columns/deprecated.js.map +1 -1
  26. package/build/columns/edit.js +1 -1
  27. package/build/columns/edit.js.map +1 -1
  28. package/build/columns/edit.native.js +1 -1
  29. package/build/columns/edit.native.js.map +1 -1
  30. package/build/columns/index.js +3 -1
  31. package/build/columns/index.js.map +1 -1
  32. package/build/columns/utils.js +1 -1
  33. package/build/columns/utils.js.map +1 -1
  34. package/build/columns/variations.js +2 -2
  35. package/build/columns/variations.js.map +1 -1
  36. package/build/comment-author-name/edit.js +3 -3
  37. package/build/comment-author-name/edit.js.map +1 -1
  38. package/build/comment-author-name/index.js +0 -4
  39. package/build/comment-author-name/index.js.map +1 -1
  40. package/build/comment-date/edit.js +4 -4
  41. package/build/comment-date/edit.js.map +1 -1
  42. package/build/comment-date/index.js +0 -4
  43. package/build/comment-date/index.js.map +1 -1
  44. package/build/comment-edit-link/index.js +0 -4
  45. package/build/comment-edit-link/index.js.map +1 -1
  46. package/build/comment-reply-link/index.js +0 -4
  47. package/build/comment-reply-link/index.js.map +1 -1
  48. package/build/comments/edit.js +10 -2
  49. package/build/comments/edit.js.map +1 -1
  50. package/build/comments-title/deprecated.js +0 -3
  51. package/build/comments-title/deprecated.js.map +1 -1
  52. package/build/comments-title/edit.js +1 -1
  53. package/build/comments-title/edit.js.map +1 -1
  54. package/build/cover/controls.native.js.map +1 -1
  55. package/build/cover/deprecated.js +212 -207
  56. package/build/cover/deprecated.js.map +1 -1
  57. package/build/cover/edit/block-controls.js +3 -10
  58. package/build/cover/edit/block-controls.js.map +1 -1
  59. package/build/cover/edit/index.js +34 -31
  60. package/build/cover/edit/index.js.map +1 -1
  61. package/build/cover/edit/inspector-controls.js +34 -6
  62. package/build/cover/edit/inspector-controls.js.map +1 -1
  63. package/build/cover/edit.native.js.map +1 -1
  64. package/build/cover/index.js +1 -0
  65. package/build/cover/index.js.map +1 -1
  66. package/build/cover/save.js +18 -5
  67. package/build/cover/save.js.map +1 -1
  68. package/build/cover/shared.js +14 -17
  69. package/build/cover/shared.js.map +1 -1
  70. package/build/cover/transforms.js.map +1 -1
  71. package/build/embed/deprecated.js +6 -1
  72. package/build/embed/deprecated.js.map +1 -1
  73. package/build/embed/edit.js.map +1 -1
  74. package/build/embed/edit.native.js.map +1 -1
  75. package/build/embed/embed-controls.native.js.map +1 -1
  76. package/build/embed/embed-preview.js +1 -0
  77. package/build/embed/embed-preview.js.map +1 -1
  78. package/build/embed/icons.js +21 -1
  79. package/build/embed/icons.js.map +1 -1
  80. package/build/embed/index.js +6 -1
  81. package/build/embed/index.js.map +1 -1
  82. package/build/embed/save.js +1 -0
  83. package/build/embed/save.js.map +1 -1
  84. package/build/embed/transforms.js +6 -1
  85. package/build/embed/transforms.js.map +1 -1
  86. package/build/embed/util.js +6 -1
  87. package/build/embed/util.js.map +1 -1
  88. package/build/embed/variations.js +11 -0
  89. package/build/embed/variations.js.map +1 -1
  90. package/build/file/edit.js +1 -1
  91. package/build/file/edit.js.map +1 -1
  92. package/build/file/edit.native.js.map +1 -1
  93. package/build/file/index.js.map +1 -1
  94. package/build/file/save.js +9 -1
  95. package/build/file/save.js.map +1 -1
  96. package/build/gallery/edit.js +1 -1
  97. package/build/gallery/edit.js.map +1 -1
  98. package/build/gallery/gallery.js +1 -1
  99. package/build/gallery/gallery.js.map +1 -1
  100. package/build/gallery/gallery.native.js.map +1 -1
  101. package/build/gallery/gap-styles.js +14 -4
  102. package/build/gallery/gap-styles.js.map +1 -1
  103. package/build/gallery/index.js +1 -1
  104. package/build/gallery/index.js.map +1 -1
  105. package/build/gallery/save.js +1 -1
  106. package/build/gallery/save.js.map +1 -1
  107. package/build/gallery/shared.js +27 -10
  108. package/build/gallery/shared.js.map +1 -1
  109. package/build/gallery/transforms.js +2 -2
  110. package/build/gallery/transforms.js.map +1 -1
  111. package/build/gallery/v1/edit.js +3 -3
  112. package/build/gallery/v1/edit.js.map +1 -1
  113. package/build/gallery/v1/gallery-image.js +1 -0
  114. package/build/gallery/v1/gallery-image.js.map +1 -1
  115. package/build/gallery/v1/gallery-image.native.js.map +1 -1
  116. package/build/gallery/v1/gallery.js +1 -1
  117. package/build/gallery/v1/gallery.js.map +1 -1
  118. package/build/gallery/v1/save.js +10 -2
  119. package/build/gallery/v1/save.js.map +1 -1
  120. package/build/group/index.js +1 -0
  121. package/build/group/index.js.map +1 -1
  122. package/build/heading/autogenerate-anchors.js +7 -2
  123. package/build/heading/autogenerate-anchors.js.map +1 -1
  124. package/build/heading/deprecated.js.map +1 -1
  125. package/build/heading/edit.js.map +1 -1
  126. package/build/html/edit.js +11 -20
  127. package/build/html/edit.js.map +1 -1
  128. package/build/html/preview.js +48 -0
  129. package/build/html/preview.js.map +1 -0
  130. package/build/image/deprecated.js.map +1 -1
  131. package/build/image/edit.js +5 -59
  132. package/build/image/edit.js.map +1 -1
  133. package/build/image/edit.native.js +58 -4
  134. package/build/image/edit.native.js.map +1 -1
  135. package/build/image/image.js +4 -13
  136. package/build/image/image.js.map +1 -1
  137. package/build/image/index.js +5 -0
  138. package/build/image/index.js.map +1 -1
  139. package/build/image/save.js +1 -0
  140. package/build/image/save.js.map +1 -1
  141. package/build/image/transforms.js.map +1 -1
  142. package/build/image/utils.js +2 -1
  143. package/build/image/utils.js.map +1 -1
  144. package/build/index.js +1 -1
  145. package/build/index.js.map +1 -1
  146. package/build/latest-comments/edit.js.map +1 -1
  147. package/build/latest-posts/edit.js +1 -1
  148. package/build/latest-posts/edit.js.map +1 -1
  149. package/build/latest-posts/edit.native.js.map +1 -1
  150. package/build/list/index.js.map +1 -1
  151. package/build/list/v2/edit.js.map +1 -1
  152. package/build/list/v2/transforms.js +33 -17
  153. package/build/list/v2/transforms.js.map +1 -1
  154. package/build/list-item/hooks/use-backspace.js.map +1 -1
  155. package/build/list-item/hooks/use-enter.js +7 -4
  156. package/build/list-item/hooks/use-enter.js.map +1 -1
  157. package/build/list-item/hooks/use-indent-list-item.js.map +1 -1
  158. package/build/list-item/hooks/use-outdent-list-item.js +36 -15
  159. package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
  160. package/build/list-item/hooks/use-space.js.map +1 -1
  161. package/build/list-item/hooks/use-split.js +17 -3
  162. package/build/list-item/hooks/use-split.js.map +1 -1
  163. package/build/media-text/deprecated.js +5 -3
  164. package/build/media-text/deprecated.js.map +1 -1
  165. package/build/media-text/edit.native.js.map +1 -1
  166. package/build/media-text/media-container.js +3 -3
  167. package/build/media-text/media-container.js.map +1 -1
  168. package/build/media-text/media-container.native.js.map +1 -1
  169. package/build/media-text/save.js +3 -1
  170. package/build/media-text/save.js.map +1 -1
  171. package/build/missing/edit.native.js.map +1 -1
  172. package/build/navigation/deprecated.js.map +1 -1
  173. package/build/navigation/edit/index.js +1 -1
  174. package/build/navigation/edit/index.js.map +1 -1
  175. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  176. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  177. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  178. package/build/navigation/index.js +9 -0
  179. package/build/navigation/index.js.map +1 -1
  180. package/build/navigation/use-navigation-entities.js.map +1 -1
  181. package/build/navigation/use-navigation-menu.js +72 -38
  182. package/build/navigation/use-navigation-menu.js.map +1 -1
  183. package/build/navigation/use-template-part-area-label.js +4 -1
  184. package/build/navigation/use-template-part-area-label.js.map +1 -1
  185. package/build/navigation/view.js +5 -3
  186. package/build/navigation/view.js.map +1 -1
  187. package/build/navigation-link/edit.js +44 -12
  188. package/build/navigation-link/edit.js.map +1 -1
  189. package/build/navigation-submenu/edit.js.map +1 -1
  190. package/build/navigation-submenu/view.js +5 -3
  191. package/build/navigation-submenu/view.js.map +1 -1
  192. package/build/page-list/convert-to-links-modal.js.map +1 -1
  193. package/build/page-list/edit.js.map +1 -1
  194. package/build/paragraph/deprecated.js +1 -1
  195. package/build/paragraph/deprecated.js.map +1 -1
  196. package/build/pattern/edit.js.map +1 -1
  197. package/build/post-author/edit.js.map +1 -1
  198. package/build/post-author-name/index.js +3 -0
  199. package/build/post-author-name/index.js.map +1 -1
  200. package/build/post-author-name/transforms.js +41 -0
  201. package/build/post-author-name/transforms.js.map +1 -0
  202. package/build/post-comments-form/edit.js +12 -2
  203. package/build/post-comments-form/edit.js.map +1 -1
  204. package/build/post-comments-form/form.js +11 -1
  205. package/build/post-comments-form/form.js.map +1 -1
  206. package/build/post-content/edit.js.map +1 -1
  207. package/build/post-date/edit.js +13 -7
  208. package/build/post-date/edit.js.map +1 -1
  209. package/build/post-featured-image/edit.js +10 -24
  210. package/build/post-featured-image/edit.js.map +1 -1
  211. package/build/post-navigation-link/index.js +4 -0
  212. package/build/post-navigation-link/index.js.map +1 -1
  213. package/build/pullquote/deprecated.js.map +1 -1
  214. package/build/query/edit/index.js +5 -1
  215. package/build/query/edit/index.js.map +1 -1
  216. package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
  217. package/build/query/edit/query-toolbar.js +16 -2
  218. package/build/query/edit/query-toolbar.js.map +1 -1
  219. package/build/quote/v2/edit.js.map +1 -1
  220. package/build/search/edit.js +1 -1
  221. package/build/search/edit.js.map +1 -1
  222. package/build/search/edit.native.js.map +1 -1
  223. package/build/search/index.js +4 -0
  224. package/build/search/index.js.map +1 -1
  225. package/build/separator/use-deprecated-opacity.js.map +1 -1
  226. package/build/shortcode/edit.native.js +16 -13
  227. package/build/shortcode/edit.native.js.map +1 -1
  228. package/build/site-logo/edit.js +3 -12
  229. package/build/site-logo/edit.js.map +1 -1
  230. package/build/social-links/deprecated.js.map +1 -1
  231. package/build/social-links/edit.js +2 -2
  232. package/build/social-links/edit.js.map +1 -1
  233. package/build/social-links/edit.native.js.map +1 -1
  234. package/build/spacer/controls.js.map +1 -1
  235. package/build/table/deprecated.js.map +1 -1
  236. package/build/table/edit.js +1 -0
  237. package/build/table/edit.js.map +1 -1
  238. package/build/table/index.js +6 -1
  239. package/build/table/index.js.map +1 -1
  240. package/build/table/save.js +2 -1
  241. package/build/table/save.js.map +1 -1
  242. package/build/table/state.js.map +1 -1
  243. package/build/table-of-contents/edit.js +11 -3
  244. package/build/table-of-contents/edit.js.map +1 -1
  245. package/build/tag-cloud/edit.js.map +1 -1
  246. package/build/template-part/edit/advanced-controls.js +4 -1
  247. package/build/template-part/edit/advanced-controls.js.map +1 -1
  248. package/build/template-part/edit/index.js.map +1 -1
  249. package/build/template-part/edit/utils/hooks.js +4 -1
  250. package/build/template-part/edit/utils/hooks.js.map +1 -1
  251. package/build/transformationCategories.native.js.map +1 -1
  252. package/build/video/edit-common-settings.js.map +1 -1
  253. package/build/video/edit.js +1 -0
  254. package/build/video/edit.js.map +1 -1
  255. package/build/video/edit.native.js +43 -0
  256. package/build/video/edit.native.js.map +1 -1
  257. package/build/video/index.js +6 -1
  258. package/build/video/index.js.map +1 -1
  259. package/build/video/save.js +1 -0
  260. package/build/video/save.js.map +1 -1
  261. package/build-module/audio/edit.js +2 -1
  262. package/build-module/audio/edit.js.map +1 -1
  263. package/build-module/audio/index.js +6 -1
  264. package/build-module/audio/index.js.map +1 -1
  265. package/build-module/audio/save.js +3 -2
  266. package/build-module/audio/save.js.map +1 -1
  267. package/build-module/avatar/hooks.js +2 -2
  268. package/build-module/avatar/hooks.js.map +1 -1
  269. package/build-module/block/edit.js.map +1 -1
  270. package/build-module/block/edit.native.js.map +1 -1
  271. package/build-module/button/deprecated.js +175 -35
  272. package/build-module/button/deprecated.js.map +1 -1
  273. package/build-module/button/edit.js +2 -2
  274. package/build-module/button/edit.js.map +1 -1
  275. package/build-module/button/edit.native.js.map +1 -1
  276. package/build-module/button/save.js +2 -2
  277. package/build-module/button/save.js.map +1 -1
  278. package/build-module/buttons/deprecated.js.map +1 -1
  279. package/build-module/buttons/edit.js.map +1 -1
  280. package/build-module/buttons/edit.native.js.map +1 -1
  281. package/build-module/column/deprecated.js.map +1 -1
  282. package/build-module/column/edit.js.map +1 -1
  283. package/build-module/column/edit.native.js.map +1 -1
  284. package/build-module/columns/deprecated.js.map +1 -1
  285. package/build-module/columns/edit.js +2 -2
  286. package/build-module/columns/edit.js.map +1 -1
  287. package/build-module/columns/edit.native.js +2 -2
  288. package/build-module/columns/edit.native.js.map +1 -1
  289. package/build-module/columns/index.js +3 -1
  290. package/build-module/columns/index.js.map +1 -1
  291. package/build-module/columns/utils.js +2 -2
  292. package/build-module/columns/utils.js.map +1 -1
  293. package/build-module/columns/variations.js +2 -2
  294. package/build-module/columns/variations.js.map +1 -1
  295. package/build-module/comment-author-name/edit.js +3 -3
  296. package/build-module/comment-author-name/edit.js.map +1 -1
  297. package/build-module/comment-author-name/index.js +0 -4
  298. package/build-module/comment-author-name/index.js.map +1 -1
  299. package/build-module/comment-date/edit.js +4 -4
  300. package/build-module/comment-date/edit.js.map +1 -1
  301. package/build-module/comment-date/index.js +0 -4
  302. package/build-module/comment-date/index.js.map +1 -1
  303. package/build-module/comment-edit-link/index.js +0 -4
  304. package/build-module/comment-edit-link/index.js.map +1 -1
  305. package/build-module/comment-reply-link/index.js +0 -4
  306. package/build-module/comment-reply-link/index.js.map +1 -1
  307. package/build-module/comments/edit.js +10 -2
  308. package/build-module/comments/edit.js.map +1 -1
  309. package/build-module/comments-title/deprecated.js +0 -3
  310. package/build-module/comments-title/deprecated.js.map +1 -1
  311. package/build-module/comments-title/edit.js +1 -1
  312. package/build-module/comments-title/edit.js.map +1 -1
  313. package/build-module/cover/controls.native.js.map +1 -1
  314. package/build-module/cover/deprecated.js +206 -198
  315. package/build-module/cover/deprecated.js.map +1 -1
  316. package/build-module/cover/edit/block-controls.js +3 -8
  317. package/build-module/cover/edit/block-controls.js.map +1 -1
  318. package/build-module/cover/edit/index.js +36 -33
  319. package/build-module/cover/edit/index.js.map +1 -1
  320. package/build-module/cover/edit/inspector-controls.js +32 -7
  321. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  322. package/build-module/cover/edit.native.js.map +1 -1
  323. package/build-module/cover/index.js +1 -0
  324. package/build-module/cover/index.js.map +1 -1
  325. package/build-module/cover/save.js +19 -6
  326. package/build-module/cover/save.js.map +1 -1
  327. package/build-module/cover/shared.js +11 -12
  328. package/build-module/cover/shared.js.map +1 -1
  329. package/build-module/cover/transforms.js.map +1 -1
  330. package/build-module/embed/deprecated.js +6 -1
  331. package/build-module/embed/deprecated.js.map +1 -1
  332. package/build-module/embed/edit.js.map +1 -1
  333. package/build-module/embed/edit.native.js.map +1 -1
  334. package/build-module/embed/embed-controls.native.js.map +1 -1
  335. package/build-module/embed/embed-preview.js +2 -1
  336. package/build-module/embed/embed-preview.js.map +1 -1
  337. package/build-module/embed/icons.js +19 -0
  338. package/build-module/embed/icons.js.map +1 -1
  339. package/build-module/embed/index.js +6 -1
  340. package/build-module/embed/index.js.map +1 -1
  341. package/build-module/embed/save.js +2 -1
  342. package/build-module/embed/save.js.map +1 -1
  343. package/build-module/embed/transforms.js +6 -1
  344. package/build-module/embed/transforms.js.map +1 -1
  345. package/build-module/embed/util.js +6 -1
  346. package/build-module/embed/util.js.map +1 -1
  347. package/build-module/embed/variations.js +12 -1
  348. package/build-module/embed/variations.js.map +1 -1
  349. package/build-module/file/edit.js +2 -2
  350. package/build-module/file/edit.js.map +1 -1
  351. package/build-module/file/edit.native.js.map +1 -1
  352. package/build-module/file/index.js.map +1 -1
  353. package/build-module/file/save.js +7 -2
  354. package/build-module/file/save.js.map +1 -1
  355. package/build-module/gallery/edit.js +2 -2
  356. package/build-module/gallery/edit.js.map +1 -1
  357. package/build-module/gallery/gallery.js +2 -2
  358. package/build-module/gallery/gallery.js.map +1 -1
  359. package/build-module/gallery/gallery.native.js.map +1 -1
  360. package/build-module/gallery/gap-styles.js +14 -4
  361. package/build-module/gallery/gap-styles.js.map +1 -1
  362. package/build-module/gallery/index.js +1 -1
  363. package/build-module/gallery/index.js.map +1 -1
  364. package/build-module/gallery/save.js +2 -2
  365. package/build-module/gallery/save.js.map +1 -1
  366. package/build-module/gallery/shared.js +25 -8
  367. package/build-module/gallery/shared.js.map +1 -1
  368. package/build-module/gallery/transforms.js +3 -3
  369. package/build-module/gallery/transforms.js.map +1 -1
  370. package/build-module/gallery/v1/edit.js +4 -4
  371. package/build-module/gallery/v1/edit.js.map +1 -1
  372. package/build-module/gallery/v1/gallery-image.js +2 -1
  373. package/build-module/gallery/v1/gallery-image.js.map +1 -1
  374. package/build-module/gallery/v1/gallery-image.native.js.map +1 -1
  375. package/build-module/gallery/v1/gallery.js +2 -2
  376. package/build-module/gallery/v1/gallery.js.map +1 -1
  377. package/build-module/gallery/v1/save.js +8 -3
  378. package/build-module/gallery/v1/save.js.map +1 -1
  379. package/build-module/group/index.js +1 -0
  380. package/build-module/group/index.js.map +1 -1
  381. package/build-module/heading/autogenerate-anchors.js +5 -2
  382. package/build-module/heading/autogenerate-anchors.js.map +1 -1
  383. package/build-module/heading/deprecated.js.map +1 -1
  384. package/build-module/heading/edit.js.map +1 -1
  385. package/build-module/html/edit.js +12 -23
  386. package/build-module/html/edit.js.map +1 -1
  387. package/build-module/html/preview.js +38 -0
  388. package/build-module/html/preview.js.map +1 -0
  389. package/build-module/image/deprecated.js.map +1 -1
  390. package/build-module/image/edit.js +5 -56
  391. package/build-module/image/edit.js.map +1 -1
  392. package/build-module/image/edit.native.js +59 -6
  393. package/build-module/image/edit.native.js.map +1 -1
  394. package/build-module/image/image.js +6 -15
  395. package/build-module/image/image.js.map +1 -1
  396. package/build-module/image/index.js +5 -0
  397. package/build-module/image/index.js.map +1 -1
  398. package/build-module/image/save.js +2 -1
  399. package/build-module/image/save.js.map +1 -1
  400. package/build-module/image/transforms.js.map +1 -1
  401. package/build-module/image/utils.js +2 -2
  402. package/build-module/image/utils.js.map +1 -1
  403. package/build-module/index.js +1 -1
  404. package/build-module/index.js.map +1 -1
  405. package/build-module/latest-comments/edit.js.map +1 -1
  406. package/build-module/latest-posts/edit.js +2 -2
  407. package/build-module/latest-posts/edit.js.map +1 -1
  408. package/build-module/latest-posts/edit.native.js.map +1 -1
  409. package/build-module/list/index.js.map +1 -1
  410. package/build-module/list/v2/edit.js.map +1 -1
  411. package/build-module/list/v2/transforms.js +32 -17
  412. package/build-module/list/v2/transforms.js.map +1 -1
  413. package/build-module/list-item/hooks/use-backspace.js.map +1 -1
  414. package/build-module/list-item/hooks/use-enter.js +7 -4
  415. package/build-module/list-item/hooks/use-enter.js.map +1 -1
  416. package/build-module/list-item/hooks/use-indent-list-item.js.map +1 -1
  417. package/build-module/list-item/hooks/use-outdent-list-item.js +34 -15
  418. package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
  419. package/build-module/list-item/hooks/use-space.js.map +1 -1
  420. package/build-module/list-item/hooks/use-split.js +19 -5
  421. package/build-module/list-item/hooks/use-split.js.map +1 -1
  422. package/build-module/media-text/deprecated.js +3 -1
  423. package/build-module/media-text/deprecated.js.map +1 -1
  424. package/build-module/media-text/edit.native.js.map +1 -1
  425. package/build-module/media-text/media-container.js +3 -1
  426. package/build-module/media-text/media-container.js.map +1 -1
  427. package/build-module/media-text/media-container.native.js.map +1 -1
  428. package/build-module/media-text/save.js +4 -1
  429. package/build-module/media-text/save.js.map +1 -1
  430. package/build-module/missing/edit.native.js.map +1 -1
  431. package/build-module/navigation/deprecated.js.map +1 -1
  432. package/build-module/navigation/edit/index.js +1 -1
  433. package/build-module/navigation/edit/index.js.map +1 -1
  434. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  435. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  436. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  437. package/build-module/navigation/index.js +9 -0
  438. package/build-module/navigation/index.js.map +1 -1
  439. package/build-module/navigation/use-navigation-entities.js.map +1 -1
  440. package/build-module/navigation/use-navigation-menu.js +73 -39
  441. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  442. package/build-module/navigation/use-template-part-area-label.js +4 -1
  443. package/build-module/navigation/use-template-part-area-label.js.map +1 -1
  444. package/build-module/navigation/view.js +5 -3
  445. package/build-module/navigation/view.js.map +1 -1
  446. package/build-module/navigation-link/edit.js +44 -13
  447. package/build-module/navigation-link/edit.js.map +1 -1
  448. package/build-module/navigation-submenu/edit.js.map +1 -1
  449. package/build-module/navigation-submenu/view.js +5 -3
  450. package/build-module/navigation-submenu/view.js.map +1 -1
  451. package/build-module/page-list/convert-to-links-modal.js.map +1 -1
  452. package/build-module/page-list/edit.js.map +1 -1
  453. package/build-module/paragraph/deprecated.js +2 -2
  454. package/build-module/paragraph/deprecated.js.map +1 -1
  455. package/build-module/pattern/edit.js.map +1 -1
  456. package/build-module/post-author/edit.js.map +1 -1
  457. package/build-module/post-author-name/index.js +2 -0
  458. package/build-module/post-author-name/index.js.map +1 -1
  459. package/build-module/post-author-name/transforms.js +32 -0
  460. package/build-module/post-author-name/transforms.js.map +1 -0
  461. package/build-module/post-comments-form/edit.js +12 -3
  462. package/build-module/post-comments-form/edit.js.map +1 -1
  463. package/build-module/post-comments-form/form.js +7 -1
  464. package/build-module/post-comments-form/form.js.map +1 -1
  465. package/build-module/post-content/edit.js.map +1 -1
  466. package/build-module/post-date/edit.js +15 -9
  467. package/build-module/post-date/edit.js.map +1 -1
  468. package/build-module/post-featured-image/edit.js +10 -23
  469. package/build-module/post-featured-image/edit.js.map +1 -1
  470. package/build-module/post-navigation-link/index.js +4 -0
  471. package/build-module/post-navigation-link/index.js.map +1 -1
  472. package/build-module/pullquote/deprecated.js.map +1 -1
  473. package/build-module/query/edit/index.js +5 -1
  474. package/build-module/query/edit/index.js.map +1 -1
  475. package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
  476. package/build-module/query/edit/query-toolbar.js +14 -2
  477. package/build-module/query/edit/query-toolbar.js.map +1 -1
  478. package/build-module/quote/v2/edit.js.map +1 -1
  479. package/build-module/search/edit.js +2 -2
  480. package/build-module/search/edit.js.map +1 -1
  481. package/build-module/search/edit.native.js.map +1 -1
  482. package/build-module/search/index.js +4 -0
  483. package/build-module/search/index.js.map +1 -1
  484. package/build-module/separator/use-deprecated-opacity.js.map +1 -1
  485. package/build-module/shortcode/edit.native.js +17 -13
  486. package/build-module/shortcode/edit.native.js.map +1 -1
  487. package/build-module/site-logo/edit.js +3 -11
  488. package/build-module/site-logo/edit.js.map +1 -1
  489. package/build-module/social-links/deprecated.js.map +1 -1
  490. package/build-module/social-links/edit.js +2 -2
  491. package/build-module/social-links/edit.js.map +1 -1
  492. package/build-module/social-links/edit.native.js.map +1 -1
  493. package/build-module/spacer/controls.js.map +1 -1
  494. package/build-module/table/deprecated.js.map +1 -1
  495. package/build-module/table/edit.js +2 -1
  496. package/build-module/table/edit.js.map +1 -1
  497. package/build-module/table/index.js +6 -1
  498. package/build-module/table/index.js.map +1 -1
  499. package/build-module/table/save.js +3 -2
  500. package/build-module/table/save.js.map +1 -1
  501. package/build-module/table/state.js.map +1 -1
  502. package/build-module/table-of-contents/edit.js +12 -4
  503. package/build-module/table-of-contents/edit.js.map +1 -1
  504. package/build-module/tag-cloud/edit.js.map +1 -1
  505. package/build-module/template-part/edit/advanced-controls.js +4 -1
  506. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  507. package/build-module/template-part/edit/index.js.map +1 -1
  508. package/build-module/template-part/edit/utils/hooks.js +4 -1
  509. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  510. package/build-module/transformationCategories.native.js.map +1 -1
  511. package/build-module/video/edit-common-settings.js.map +1 -1
  512. package/build-module/video/edit.js +2 -1
  513. package/build-module/video/edit.js.map +1 -1
  514. package/build-module/video/edit.native.js +42 -1
  515. package/build-module/video/edit.native.js.map +1 -1
  516. package/build-module/video/index.js +6 -1
  517. package/build-module/video/index.js.map +1 -1
  518. package/build-module/video/save.js +2 -1
  519. package/build-module/video/save.js.map +1 -1
  520. package/build-style/audio/style-rtl.css +0 -3
  521. package/build-style/audio/style.css +0 -3
  522. package/build-style/button/style-rtl.css +5 -5
  523. package/build-style/button/style.css +5 -5
  524. package/build-style/common-rtl.css +1 -3
  525. package/build-style/common.css +1 -3
  526. package/build-style/cover/editor-rtl.css +11 -0
  527. package/build-style/cover/editor.css +11 -0
  528. package/build-style/cover/style-rtl.css +33 -25
  529. package/build-style/cover/style.css +33 -25
  530. package/build-style/editor-rtl.css +14 -39
  531. package/build-style/editor.css +14 -39
  532. package/build-style/embed/style-rtl.css +0 -1
  533. package/build-style/embed/style.css +0 -1
  534. package/build-style/file/style-rtl.css +11 -12
  535. package/build-style/file/style.css +11 -12
  536. package/build-style/gallery/style-rtl.css +2 -4
  537. package/build-style/gallery/style.css +2 -4
  538. package/build-style/image/style-rtl.css +0 -3
  539. package/build-style/image/style.css +0 -3
  540. package/build-style/navigation/style-rtl.css +9 -1
  541. package/build-style/navigation/style.css +9 -1
  542. package/build-style/post-comments/style-rtl.css +2 -1
  543. package/build-style/post-comments/style.css +2 -1
  544. package/build-style/post-comments-form/editor-rtl.css +3 -0
  545. package/build-style/post-comments-form/editor.css +3 -0
  546. package/build-style/post-featured-image/editor-rtl.css +0 -27
  547. package/build-style/post-featured-image/editor.css +0 -27
  548. package/build-style/post-template/style-rtl.css +9 -18
  549. package/build-style/post-template/style.css +9 -18
  550. package/build-style/search/style-rtl.css +9 -11
  551. package/build-style/search/style.css +9 -11
  552. package/build-style/site-logo/editor-rtl.css +0 -12
  553. package/build-style/site-logo/editor.css +0 -12
  554. package/build-style/site-logo/style-rtl.css +4 -0
  555. package/build-style/site-logo/style.css +4 -0
  556. package/build-style/style-rtl.css +86 -93
  557. package/build-style/style.css +86 -93
  558. package/build-style/table/style-rtl.css +0 -1
  559. package/build-style/table/style.css +0 -1
  560. package/build-style/video/style-rtl.css +1 -5
  561. package/build-style/video/style.css +1 -5
  562. package/package.json +30 -29
  563. package/src/audio/block.json +6 -1
  564. package/src/audio/edit.js +4 -0
  565. package/src/audio/index.js +1 -2
  566. package/src/audio/save.js +12 -2
  567. package/src/audio/style.scss +0 -2
  568. package/src/avatar/hooks.js +2 -2
  569. package/src/block/edit.js +4 -6
  570. package/src/block/edit.native.js +12 -16
  571. package/src/block/test/edit.native.js +5 -8
  572. package/src/button/deprecated.js +145 -36
  573. package/src/button/edit.js +7 -11
  574. package/src/button/edit.native.js +2 -3
  575. package/src/button/save.js +5 -11
  576. package/src/button/style.scss +10 -5
  577. package/src/buttons/deprecated.js +4 -6
  578. package/src/buttons/edit.js +3 -3
  579. package/src/buttons/edit.native.js +7 -11
  580. package/src/buttons/test/__snapshots__/edit.native.js.snap +1 -1
  581. package/src/buttons/test/edit.native.js +1 -1
  582. package/src/column/deprecated.js +2 -1
  583. package/src/column/edit.js +2 -3
  584. package/src/column/edit.native.js +2 -2
  585. package/src/columns/block.json +3 -1
  586. package/src/columns/deprecated.js +4 -2
  587. package/src/columns/edit.js +6 -7
  588. package/src/columns/edit.native.js +12 -16
  589. package/src/columns/index.js +1 -2
  590. package/src/columns/utils.js +5 -3
  591. package/src/columns/variations.js +2 -2
  592. package/src/comment-author-name/block.json +0 -4
  593. package/src/comment-author-name/edit.js +3 -12
  594. package/src/comment-date/block.json +0 -4
  595. package/src/comment-date/edit.js +10 -14
  596. package/src/comment-date/index.php +0 -3
  597. package/src/comment-edit-link/block.json +0 -4
  598. package/src/comment-reply-link/block.json +0 -4
  599. package/src/comments/edit.js +24 -4
  600. package/src/comments-title/deprecated.js +0 -2
  601. package/src/comments-title/edit.js +1 -1
  602. package/src/comments-title/index.php +1 -1
  603. package/src/cover/block.json +1 -0
  604. package/src/cover/controls.native.js +2 -4
  605. package/src/cover/deprecated.js +237 -195
  606. package/src/cover/edit/block-controls.js +11 -20
  607. package/src/cover/edit/index.js +81 -66
  608. package/src/cover/edit/inspector-controls.js +38 -7
  609. package/src/cover/edit.native.js +8 -13
  610. package/src/cover/editor.scss +13 -0
  611. package/src/cover/index.php +21 -8
  612. package/src/cover/save.js +28 -16
  613. package/src/cover/shared.js +5 -7
  614. package/src/cover/style.scss +27 -22
  615. package/src/cover/test/edit.native.js +4 -7
  616. package/src/cover/transforms.js +2 -7
  617. package/src/embed/block.json +6 -1
  618. package/src/embed/edit.js +38 -40
  619. package/src/embed/edit.native.js +46 -49
  620. package/src/embed/embed-controls.native.js +2 -3
  621. package/src/embed/embed-preview.js +8 -1
  622. package/src/embed/icons.js +25 -0
  623. package/src/embed/save.js +10 -2
  624. package/src/embed/style.scss +0 -1
  625. package/src/embed/test/__snapshots__/index.native.js.snap +1 -1
  626. package/src/embed/test/index.native.js +24 -50
  627. package/src/embed/variations.js +10 -0
  628. package/src/file/edit.js +9 -5
  629. package/src/file/edit.native.js +14 -25
  630. package/src/file/index.js +1 -2
  631. package/src/file/save.js +14 -2
  632. package/src/file/style.scss +16 -15
  633. package/src/freeform/editor.scss +0 -2
  634. package/src/gallery/block.json +1 -1
  635. package/src/gallery/edit.js +8 -6
  636. package/src/gallery/gallery.js +9 -2
  637. package/src/gallery/gallery.native.js +2 -4
  638. package/src/gallery/gap-styles.js +21 -6
  639. package/src/gallery/index.js +2 -4
  640. package/src/gallery/index.php +27 -12
  641. package/src/gallery/save.js +5 -1
  642. package/src/gallery/shared.js +22 -9
  643. package/src/gallery/test/__snapshots__/index.native.js.snap +2 -2
  644. package/src/gallery/test/helpers.native.js +11 -198
  645. package/src/gallery/test/index.native.js +37 -63
  646. package/src/gallery/transforms.js +3 -3
  647. package/src/gallery/v1/edit.js +18 -24
  648. package/src/gallery/v1/gallery-image.js +10 -11
  649. package/src/gallery/v1/gallery-image.native.js +8 -17
  650. package/src/gallery/v1/gallery.js +8 -2
  651. package/src/gallery/v1/save.js +20 -3
  652. package/src/group/block.json +1 -0
  653. package/src/heading/autogenerate-anchors.js +8 -5
  654. package/src/heading/deprecated.js +6 -21
  655. package/src/heading/edit.js +2 -3
  656. package/src/html/edit.js +10 -40
  657. package/src/html/preview.js +46 -0
  658. package/src/image/block.json +5 -0
  659. package/src/image/deprecated.js +6 -29
  660. package/src/image/edit.js +1 -53
  661. package/src/image/edit.native.js +75 -24
  662. package/src/image/image.js +35 -49
  663. package/src/image/save.js +10 -2
  664. package/src/image/style.scss +0 -2
  665. package/src/image/styles.native.scss +11 -0
  666. package/src/image/test/edit.native.js +51 -19
  667. package/src/image/transforms.js +4 -3
  668. package/src/image/utils.js +2 -2
  669. package/src/index.js +1 -1
  670. package/src/latest-comments/edit.js +2 -6
  671. package/src/latest-posts/edit.js +6 -7
  672. package/src/latest-posts/edit.native.js +10 -15
  673. package/src/list/index.js +1 -2
  674. package/src/list/test/migrate.js +1 -2
  675. package/src/list/v2/edit.js +6 -9
  676. package/src/list/v2/transforms.js +22 -7
  677. package/src/list-item/hooks/use-backspace.js +2 -3
  678. package/src/list-item/hooks/use-enter.js +11 -9
  679. package/src/list-item/hooks/use-indent-list-item.js +2 -3
  680. package/src/list-item/hooks/use-outdent-list-item.js +50 -24
  681. package/src/list-item/hooks/use-space.js +2 -3
  682. package/src/list-item/hooks/use-split.js +18 -9
  683. package/src/media-text/deprecated.js +6 -3
  684. package/src/media-text/edit.native.js +2 -5
  685. package/src/media-text/media-container.js +1 -1
  686. package/src/media-text/media-container.native.js +6 -9
  687. package/src/media-text/save.js +2 -1
  688. package/src/missing/edit.native.js +2 -3
  689. package/src/missing/test/edit-integration.native.js +2 -3
  690. package/src/missing/test/edit.native.js +6 -9
  691. package/src/navigation/block.json +9 -0
  692. package/src/navigation/deprecated.js +2 -5
  693. package/src/navigation/edit/index.js +25 -36
  694. package/src/navigation/edit/navigation-menu-delete-control.js +2 -3
  695. package/src/navigation/edit/unsaved-inner-blocks.js +31 -30
  696. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +2 -3
  697. package/src/navigation/style.scss +10 -1
  698. package/src/navigation/test/use-navigation-menu.js +241 -0
  699. package/src/navigation/use-navigation-entities.js +11 -13
  700. package/src/navigation/use-navigation-menu.js +95 -82
  701. package/src/navigation/use-template-part-area-label.js +8 -7
  702. package/src/navigation/view.js +7 -2
  703. package/src/navigation-link/edit.js +59 -25
  704. package/src/navigation-link/test/edit.js +2 -24
  705. package/src/navigation-submenu/edit.js +10 -20
  706. package/src/navigation-submenu/view.js +7 -2
  707. package/src/page-list/convert-to-links-modal.js +51 -54
  708. package/src/page-list/edit.js +6 -6
  709. package/src/page-list/test/convert-to-links-modal.js +6 -12
  710. package/src/paragraph/deprecated.js +2 -2
  711. package/src/pattern/edit.js +2 -4
  712. package/src/post-author/edit.js +2 -3
  713. package/src/post-author/index.php +3 -2
  714. package/src/post-author-name/index.js +2 -0
  715. package/src/post-author-name/index.php +1 -1
  716. package/src/post-author-name/transforms.js +25 -0
  717. package/src/post-comments/index.php +1 -1
  718. package/src/post-comments/style.scss +7 -3
  719. package/src/post-comments-form/edit.js +20 -3
  720. package/src/post-comments-form/editor.scss +4 -0
  721. package/src/post-comments-form/form.js +11 -1
  722. package/src/post-comments-form/index.php +1 -1
  723. package/src/post-content/edit.js +2 -3
  724. package/src/post-date/edit.js +4 -3
  725. package/src/post-featured-image/edit.js +14 -30
  726. package/src/post-featured-image/editor.scss +0 -29
  727. package/src/post-featured-image/index.php +4 -2
  728. package/src/post-navigation-link/block.json +4 -0
  729. package/src/post-template/index.php +15 -3
  730. package/src/post-template/style.scss +1 -7
  731. package/src/pullquote/deprecated.js +2 -1
  732. package/src/query/edit/index.js +10 -10
  733. package/src/query/edit/inspector-controls/parent-control.js +2 -3
  734. package/src/query/edit/query-toolbar.js +25 -5
  735. package/src/query-pagination/index.php +0 -1
  736. package/src/quote/v2/edit.js +4 -6
  737. package/src/quote/v2/test/migrate.js +1 -2
  738. package/src/search/block.json +4 -0
  739. package/src/search/edit.js +9 -13
  740. package/src/search/edit.native.js +4 -6
  741. package/src/search/index.php +38 -23
  742. package/src/search/style.scss +11 -9
  743. package/src/separator/use-deprecated-opacity.js +2 -4
  744. package/src/shortcode/edit.native.js +30 -15
  745. package/src/shortcode/style.native.scss +11 -4
  746. package/src/shortcode/test/__snapshots__/edit.native.js.snap +9 -0
  747. package/src/shortcode/test/edit.native.js +55 -40
  748. package/src/site-logo/edit.js +3 -17
  749. package/src/site-logo/editor.scss +0 -14
  750. package/src/site-logo/style.scss +6 -0
  751. package/src/social-links/deprecated.js +4 -2
  752. package/src/social-links/edit.js +11 -10
  753. package/src/social-links/edit.native.js +3 -5
  754. package/src/spacer/controls.js +2 -3
  755. package/src/spacer/test/index.native.js +10 -21
  756. package/src/table/block.json +6 -1
  757. package/src/table/deprecated.js +4 -8
  758. package/src/table/edit.js +2 -0
  759. package/src/table/save.js +6 -1
  760. package/src/table/state.js +2 -4
  761. package/src/table/style.scss +0 -1
  762. package/src/table-of-contents/edit.js +22 -13
  763. package/src/tag-cloud/edit.js +4 -7
  764. package/src/template-part/edit/advanced-controls.js +4 -4
  765. package/src/template-part/edit/index.js +6 -10
  766. package/src/template-part/edit/utils/hooks.js +8 -7
  767. package/src/transformationCategories.native.js +3 -3
  768. package/src/video/block.json +6 -1
  769. package/src/video/edit-common-settings.js +2 -8
  770. package/src/video/edit.js +4 -0
  771. package/src/video/edit.native.js +38 -16
  772. package/src/video/index.js +1 -2
  773. package/src/video/save.js +10 -2
  774. package/src/video/style.scss +0 -2
@@ -1,6 +1,10 @@
1
1
  .wp-block-file {
2
2
  margin-bottom: 1.5em;
3
3
 
4
+ &:not(.wp-element-button) {
5
+ font-size: 0.8em;
6
+ }
7
+
4
8
  &.aligncenter {
5
9
  text-align: center;
6
10
  }
@@ -10,20 +14,21 @@
10
14
  text-align: right;
11
15
  }
12
16
 
13
- .wp-block-file__embed {
14
- margin-bottom: 1em;
17
+ * + .wp-block-file__button {
18
+ margin-left: 0.75em;
15
19
  }
20
+ }
16
21
 
17
- .wp-block-file__button {
18
- background: #32373c;
19
- border-radius: 2em;
20
- color: $white;
21
- font-size: 0.8em;
22
- padding: 0.5em 1em;
23
- }
22
+ .wp-block-file__embed {
23
+ margin-bottom: 1em;
24
+ }
24
25
 
25
- a.wp-block-file__button {
26
- text-decoration: none;
26
+ //This needs a low specificity so it won't override the rules from the button element if defined in theme.json.
27
+ :where(.wp-block-file__button) {
28
+ border-radius: 2em;
29
+ padding: 0.5em 1em;
30
+
31
+ &:is(a) {
27
32
 
28
33
  &:hover,
29
34
  &:visited,
@@ -35,8 +40,4 @@
35
40
  text-decoration: none;
36
41
  }
37
42
  }
38
-
39
- * + .wp-block-file__button {
40
- margin-left: 0.75em;
41
- }
42
43
  }
@@ -211,8 +211,6 @@
211
211
  margin: 0;
212
212
  text-align: center;
213
213
  padding: 6px;
214
- -webkit-box-sizing: border-box;
215
- -moz-box-sizing: border-box;
216
214
  box-sizing: border-box;
217
215
  }
218
216
 
@@ -110,7 +110,7 @@
110
110
  "html": false,
111
111
  "units": [ "px", "em", "rem", "vh", "vw" ],
112
112
  "spacing": {
113
- "blockGap": true,
113
+ "blockGap": [ "horizontal", "vertical" ],
114
114
  "__experimentalSkipSerialization": [ "blockGap" ],
115
115
  "__experimentalDefaultControls": {
116
116
  "blockGap": true
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { concat, find } from 'lodash';
5
+ import { find } from 'lodash';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -300,11 +300,13 @@ function GalleryEdit( props ) {
300
300
 
301
301
  replaceInnerBlocks(
302
302
  clientId,
303
- concat( existingImageBlocks, newBlocks ).sort(
304
- ( a, b ) =>
305
- newOrderMap[ a.attributes.id ] -
306
- newOrderMap[ b.attributes.id ]
307
- )
303
+ existingImageBlocks
304
+ .concat( newBlocks )
305
+ .sort(
306
+ ( a, b ) =>
307
+ newOrderMap[ a.attributes.id ] -
308
+ newOrderMap[ b.attributes.id ]
309
+ )
308
310
  );
309
311
  }
310
312
 
@@ -6,7 +6,11 @@ import classnames from 'classnames';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { RichText, useInnerBlocksProps } from '@wordpress/block-editor';
9
+ import {
10
+ RichText,
11
+ useInnerBlocksProps,
12
+ __experimentalGetElementClassName,
13
+ } from '@wordpress/block-editor';
10
14
  import { VisuallyHidden } from '@wordpress/components';
11
15
  import { useState, useEffect } from '@wordpress/element';
12
16
  import { __ } from '@wordpress/i18n';
@@ -82,7 +86,10 @@ export const Gallery = ( props ) => {
82
86
  captionFocused={ captionFocused }
83
87
  onFocusCaption={ onFocusCaption }
84
88
  tagName="figcaption"
85
- className="blocks-gallery-caption"
89
+ className={ classnames(
90
+ 'blocks-gallery-caption',
91
+ __experimentalGetElementClassName( 'caption' )
92
+ ) }
86
93
  aria-label={ __( 'Gallery caption text' ) }
87
94
  placeholder={ __( 'Write gallery caption…' ) }
88
95
  value={ caption }
@@ -49,10 +49,8 @@ export const Gallery = ( props ) => {
49
49
  }
50
50
  }, [ sizes ] );
51
51
 
52
- const {
53
- align,
54
- columns = defaultColumnsNumber( images.length ),
55
- } = attributes;
52
+ const { align, columns = defaultColumnsNumber( images.length ) } =
53
+ attributes;
56
54
 
57
55
  const displayedColumns = Math.min(
58
56
  columns,
@@ -8,12 +8,27 @@ export default function GapStyles( { blockGap, clientId } ) {
8
8
  const styleElement = useContext( BlockList.__unstableElementContext );
9
9
  // --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default
10
10
  // gap on the gallery.
11
- const gapValue = blockGap
12
- ? blockGap
13
- : `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`;
14
- const gap = `#block-${ clientId } {
15
- --wp--style--unstable-gallery-gap: ${ gapValue };
16
- gap: ${ gapValue }
11
+ const fallbackValue = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`;
12
+ let gapValue = fallbackValue;
13
+ let column = fallbackValue;
14
+ let row;
15
+
16
+ // Check for the possibility of split block gap values. See: https://github.com/WordPress/gutenberg/pull/37736
17
+ if ( !! blockGap ) {
18
+ row =
19
+ typeof blockGap === 'string'
20
+ ? blockGap
21
+ : blockGap?.top || fallbackValue;
22
+ column =
23
+ typeof blockGap === 'string'
24
+ ? blockGap
25
+ : blockGap?.left || fallbackValue;
26
+ gapValue = row === column ? row : `${ row } ${ column }`;
27
+ }
28
+
29
+ const gap = `#block-${ clientId } {
30
+ --wp--style--unstable-gallery-gap: ${ column };
31
+ gap: ${ gapValue }
17
32
  }`;
18
33
 
19
34
  const GapStyle = () => {
@@ -26,15 +26,13 @@ export const settings = {
26
26
  {
27
27
  name: 'core/image',
28
28
  attributes: {
29
- url:
30
- 'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg',
29
+ url: 'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg',
31
30
  },
32
31
  },
33
32
  {
34
33
  name: 'core/image',
35
34
  attributes: {
36
- url:
37
- 'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg',
35
+ url: 'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg',
38
36
  },
39
37
  },
40
38
  ],
@@ -48,7 +48,18 @@ function block_core_gallery_render( $attributes, $content ) {
48
48
  // Skip if gap value contains unsupported characters.
49
49
  // Regex for CSS value borrowed from `safecss_filter_attr`, and used here
50
50
  // because we only want to match against the value, not the CSS attribute.
51
- $gap = preg_match( '%[\\\(&=}]|/\*%', $gap ) ? null : $gap;
51
+ if ( is_array( $gap ) ) {
52
+ foreach ( $gap as $key => $value ) {
53
+ // Make sure $value is a string to avoid PHP 8.1 deprecation error in preg_match() when the value is null.
54
+ $value = is_string( $value ) ? $value : '';
55
+ $gap[ $key ] = $value && preg_match( '%[\\\(&=}]|/\*%', $value ) ? null : $value;
56
+ }
57
+ } else {
58
+ // Make sure $gap is a string to avoid PHP 8.1 deprecation error in preg_match() when the value is null.
59
+ $gap = is_string( $gap ) ? $gap : '';
60
+ $gap = $gap && preg_match( '%[\\\(&=}]|/\*%', $gap ) ? null : $gap;
61
+ }
62
+
52
63
  $class = wp_unique_id( 'wp-block-gallery-' );
53
64
  $content = preg_replace(
54
65
  '/' . preg_quote( 'class="', '/' ) . '/',
@@ -56,19 +67,23 @@ function block_core_gallery_render( $attributes, $content ) {
56
67
  $content,
57
68
  1
58
69
  );
70
+
59
71
  // --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default
60
72
  // gap on the gallery.
61
- $gap_value = $gap ? $gap : 'var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )';
62
- $style = '.' . $class . '{ --wp--style--unstable-gallery-gap: ' . $gap_value . '; gap: ' . $gap_value . '}';
63
- // Ideally styles should be loaded in the head, but blocks may be parsed
64
- // after that, so loading in the footer for now.
65
- // See https://core.trac.wordpress.org/ticket/53494.
66
- add_action(
67
- 'wp_footer',
68
- function () use ( $style ) {
69
- echo '<style> ' . $style . '</style>';
70
- }
71
- );
73
+ $fallback_gap = 'var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )';
74
+ $gap_value = $gap ? $gap : $fallback_gap;
75
+ $gap_column = $gap_value;
76
+
77
+ if ( is_array( $gap_value ) ) {
78
+ $gap_row = isset( $gap_value['top'] ) ? $gap_value['top'] : $fallback_gap;
79
+ $gap_column = isset( $gap_value['left'] ) ? $gap_value['left'] : $fallback_gap;
80
+ $gap_value = $gap_row === $gap_column ? $gap_row : $gap_row . ' ' . $gap_column;
81
+ }
82
+
83
+ // Set the CSS variable to the column value, and the `gap` property to the combined gap value.
84
+ $style = '.' . $class . '{ --wp--style--unstable-gallery-gap: ' . $gap_column . '; gap: ' . $gap_value . '}';
85
+
86
+ gutenberg_enqueue_block_support_styles( $style, 11 );
72
87
  return $content;
73
88
  }
74
89
  /**
@@ -10,6 +10,7 @@ import {
10
10
  RichText,
11
11
  useBlockProps,
12
12
  useInnerBlocksProps,
13
+ __experimentalGetElementClassName,
13
14
  } from '@wordpress/block-editor';
14
15
 
15
16
  /**
@@ -39,7 +40,10 @@ export default function saveWithInnerBlocks( { attributes } ) {
39
40
  { ! RichText.isEmpty( caption ) && (
40
41
  <RichText.Content
41
42
  tagName="figcaption"
42
- className="blocks-gallery-caption"
43
+ className={ classnames(
44
+ 'blocks-gallery-caption',
45
+ __experimentalGetElementClassName( 'caption' )
46
+ ) }
43
47
  value={ caption }
44
48
  />
45
49
  ) }
@@ -3,6 +3,11 @@
3
3
  */
4
4
  import { get, pick } from 'lodash';
5
5
 
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import { Platform } from '@wordpress/element';
10
+
6
11
  export function defaultColumnsNumber( imageCount ) {
7
12
  return imageCount ? Math.min( 3, imageCount ) : 3;
8
13
  }
@@ -23,6 +28,15 @@ export const pickRelevantMediaFiles = ( image, sizeSlug = 'large' ) => {
23
28
  return imageProps;
24
29
  };
25
30
 
31
+ function getGalleryBlockV2Enabled() {
32
+ // We want to fail early here, at least during beta testing phase, to ensure
33
+ // there aren't instances where undefined values cause false negatives.
34
+ if ( ! window.wp || typeof window.wp.galleryBlockV2Enabled !== 'boolean' ) {
35
+ throw 'window.wp.galleryBlockV2Enabled is not defined';
36
+ }
37
+ return window.wp.galleryBlockV2Enabled;
38
+ }
39
+
26
40
  /**
27
41
  * The new gallery block format is not compatible with the use_BalanceTags option
28
42
  * in WP versions <= 5.8 https://core.trac.wordpress.org/ticket/54130. The
@@ -30,18 +44,17 @@ export const pickRelevantMediaFiles = ( image, sizeSlug = 'large' ) => {
30
44
  * can be removed when minimum supported WP version >=5.9.
31
45
  */
32
46
  export function isGalleryV2Enabled() {
47
+ // The logic for the native version is located in a different if statement
48
+ // due to a lint rule that prohibits a single conditional combining
49
+ // `process.env.IS_GUTENBERG_PLUGIN` with a native platform check.
50
+ if ( Platform.isNative ) {
51
+ return getGalleryBlockV2Enabled();
52
+ }
53
+
33
54
  // Only run the Gallery version compat check if the plugin is running, otherwise
34
55
  // assume we are in 5.9 core and enable by default.
35
56
  if ( process.env.IS_GUTENBERG_PLUGIN ) {
36
- // We want to fail early here, at least during beta testing phase, to ensure
37
- // there aren't instances where undefined values cause false negatives.
38
- if (
39
- ! window.wp ||
40
- typeof window.wp.galleryBlockV2Enabled !== 'boolean'
41
- ) {
42
- throw 'window.wp.galleryBlockV2Enabled is not defined';
43
- }
44
- return window.wp.galleryBlockV2Enabled;
57
+ return getGalleryBlockV2Enabled();
45
58
  }
46
59
 
47
60
  return true;
@@ -114,14 +114,14 @@ exports[`Gallery block sets caption to gallery 1`] = `
114
114
  "<!-- wp:gallery {\\"linkTo\\":\\"none\\"} -->
115
115
  <figure class=\\"wp-block-gallery has-nested-images columns-default is-cropped\\"><!-- wp:image {\\"id\\":2000} -->
116
116
  <figure class=\\"wp-block-image\\"><img src=\\"https://test-site.files.wordpress.com/local-image-1.jpeg\\" alt=\\"\\" class=\\"wp-image-2000\\"/></figure>
117
- <!-- /wp:image --><figcaption class=\\"blocks-gallery-caption\\"><strong>Bold</strong> <em>italic</em> <s>strikethrough</s> gallery caption</figcaption></figure>
117
+ <!-- /wp:image --><figcaption class=\\"blocks-gallery-caption wp-element-caption\\"><strong>Bold</strong> <em>italic</em> <s>strikethrough</s> gallery caption</figcaption></figure>
118
118
  <!-- /wp:gallery -->"
119
119
  `;
120
120
 
121
121
  exports[`Gallery block sets caption to gallery items 1`] = `
122
122
  "<!-- wp:gallery {\\"linkTo\\":\\"none\\"} -->
123
123
  <figure class=\\"wp-block-gallery has-nested-images columns-default is-cropped\\"><!-- wp:image {\\"id\\":2000} -->
124
- <figure class=\\"wp-block-image\\"><img src=\\"https://test-site.files.wordpress.com/local-image-1.jpeg\\" alt=\\"\\" class=\\"wp-image-2000\\"/><figcaption><strong>Bold</strong> <em>italic</em> <s>strikethrough</s> image caption</figcaption></figure>
124
+ <figure class=\\"wp-block-image\\"><img src=\\"https://test-site.files.wordpress.com/local-image-1.jpeg\\" alt=\\"\\" class=\\"wp-image-2000\\"/><figcaption class=\\"wp-element-caption\\"><strong>Bold</strong> <em>italic</em> <s>strikethrough</s> image caption</figcaption></figure>
125
125
  <!-- /wp:image --></figure>
126
126
  <!-- /wp:gallery -->"
127
127
  `;
@@ -2,28 +2,14 @@
2
2
  * External dependencies
3
3
  */
4
4
  import {
5
- act,
6
- initializeEditor,
5
+ addBlock,
7
6
  fireEvent,
8
- waitFor,
9
- within,
10
- waitForStoreResolvers,
7
+ getBlock,
8
+ getInnerBlock,
9
+ initializeEditor,
10
+ triggerBlockListLayout,
11
11
  } from 'test/helpers';
12
12
 
13
- /**
14
- * WordPress dependencies
15
- */
16
- import {
17
- requestMediaPicker,
18
- subscribeMediaUpload,
19
- } from '@wordpress/react-native-bridge';
20
- import {
21
- MEDIA_UPLOAD_STATE_UPLOADING,
22
- MEDIA_UPLOAD_STATE_SUCCEEDED,
23
- MEDIA_UPLOAD_STATE_FAILED,
24
- MEDIA_UPLOAD_STATE_RESET,
25
- } from '@wordpress/block-editor';
26
-
27
13
  /**
28
14
  * Adds a Gallery block via the block picker.
29
15
  *
@@ -31,54 +17,10 @@ import {
31
17
  */
32
18
  export const addGalleryBlock = async () => {
33
19
  const screen = await initializeEditor();
34
- const { getByA11yLabel, getByTestId, getByText } = screen;
35
-
36
- fireEvent.press( getByA11yLabel( 'Add block' ) );
37
-
38
- const blockList = getByTestId( 'InserterUI-Blocks' );
39
- // onScroll event used to force the FlatList to render all items
40
- fireEvent.scroll( blockList, {
41
- nativeEvent: {
42
- contentOffset: { y: 0, x: 0 },
43
- contentSize: { width: 100, height: 100 },
44
- layoutMeasurement: { width: 100, height: 100 },
45
- },
46
- } );
47
-
48
- fireEvent.press( await waitFor( () => getByText( 'Gallery' ) ) );
49
-
20
+ await addBlock( screen, 'Gallery' );
50
21
  return screen;
51
22
  };
52
23
 
53
- /**
54
- * The gallery items are rendered via the FlatList of the inner block list.
55
- * In order to render the items of a FlatList, it's required to trigger the
56
- * "onLayout" event. Additionally, the call is wrapped over "waitForStoreResolvers"
57
- * because the gallery items request the media data associated with the image to
58
- * be rendered via the "getMedia" selector.
59
- *
60
- * @param {import('react-test-renderer').ReactTestInstance} galleryBlock Gallery block instance to trigger layout event.
61
- * @param {Object} [options] Configuration options for the event.
62
- * @param {number} [options.width] Width value to be passed to the event.
63
- */
64
- export const triggerGalleryLayout = async (
65
- galleryBlock,
66
- { width = 320 } = {}
67
- ) =>
68
- waitForStoreResolvers( () =>
69
- fireEvent(
70
- within( galleryBlock ).getByTestId( 'block-list-wrapper' ),
71
- 'layout',
72
- {
73
- nativeEvent: {
74
- layout: {
75
- width,
76
- },
77
- },
78
- }
79
- )
80
- );
81
-
82
24
  /**
83
25
  * Initialize the editor with HTML generated of Gallery block.
84
26
  *
@@ -106,12 +48,11 @@ export const initializeWithGalleryBlock = async ( {
106
48
  useLocalUrl,
107
49
  } );
108
50
  const screen = await initializeEditor( { initialHtml } );
109
- const { getByA11yLabel } = screen;
110
51
 
111
- const galleryBlock = getByA11yLabel( /Gallery Block\. Row 1/ );
52
+ const galleryBlock = getBlock( screen, 'Gallery' );
112
53
 
113
54
  if ( numberOfItems > 0 ) {
114
- await triggerGalleryLayout( galleryBlock, { width } );
55
+ await triggerBlockListLayout( galleryBlock, { width } );
115
56
  }
116
57
 
117
58
  if ( selected ) {
@@ -125,109 +66,11 @@ export const initializeWithGalleryBlock = async ( {
125
66
  * Gets a gallery item within a Gallery block.
126
67
  *
127
68
  * @param {import('react-test-renderer').ReactTestInstance} galleryBlock Gallery block instance.
128
- * @param {number} rowPosition Row position within the Gallery block.
69
+ * @param {number} rowIndex Row position within the Gallery block.
129
70
  * @return {import('react-test-renderer').ReactTestInstance} Gallery item.
130
71
  */
131
- export const getGalleryItem = ( galleryBlock, rowPosition ) => {
132
- return within( galleryBlock ).getByA11yLabel(
133
- new RegExp( `Image Block\\. Row ${ rowPosition }` )
134
- );
135
- };
136
-
137
- /**
138
- * Sets up the media upload mock functions for testing.
139
- *
140
- * @typedef {Object} MediaUploadMockFunctions
141
- * @property {Function} notifyUploadingState Notify uploading state for a media item.
142
- * @property {Function} notifySucceedState Notify succeed state for a media item.
143
- * @property {Function} notifyFailedState Notify failed state for a media item.
144
- * @property {Function} notifyResetState Notify reset state for a media item.
145
- *
146
- * @return {MediaUploadMockFunctions} Notify state functions.
147
- */
148
- export const setupMediaUpload = () => {
149
- const mediaUploadListeners = [];
150
- subscribeMediaUpload.mockImplementation( ( callback ) => {
151
- mediaUploadListeners.push( callback );
152
- return { remove: jest.fn() };
153
- } );
154
- const notifyMediaUpload = ( payload ) =>
155
- mediaUploadListeners.forEach( ( listener ) => listener( payload ) );
156
-
157
- return {
158
- notifyUploadingState: async ( mediaItem ) =>
159
- act( async () => {
160
- notifyMediaUpload( {
161
- state: MEDIA_UPLOAD_STATE_UPLOADING,
162
- mediaId: mediaItem.localId,
163
- progress: 0.25,
164
- } );
165
- } ),
166
- notifySucceedState: async ( mediaItem ) =>
167
- act( async () => {
168
- notifyMediaUpload( {
169
- state: MEDIA_UPLOAD_STATE_SUCCEEDED,
170
- mediaId: mediaItem.localId,
171
- mediaUrl: mediaItem.serverUrl,
172
- mediaServerId: mediaItem.serverId,
173
- } );
174
- } ),
175
- notifyFailedState: async ( mediaItem ) =>
176
- act( async () => {
177
- notifyMediaUpload( {
178
- state: MEDIA_UPLOAD_STATE_FAILED,
179
- mediaId: mediaItem.localId,
180
- progress: 0.5,
181
- } );
182
- } ),
183
- notifyResetState: async ( mediaItem ) =>
184
- act( async () => {
185
- notifyMediaUpload( {
186
- state: MEDIA_UPLOAD_STATE_RESET,
187
- mediaId: mediaItem.localId,
188
- progress: 0,
189
- } );
190
- } ),
191
- };
192
- };
193
-
194
- /**
195
- *
196
- * Sets up Media Picker mock functions.
197
- *
198
- * @typedef {Object} MediaPickerMockFunctions
199
- * @property {Function} expectMediaPickerCall Checks if the request media picker function has been called with specific arguments.
200
- * @property {Function} mediaPickerCallback Callback function to notify the media items picked from the media picker.
201
- *
202
- * @return {MediaPickerMockFunctions} Media picker mock functions.
203
- */
204
- export const setupMediaPicker = () => {
205
- let mediaPickerCallback;
206
- requestMediaPicker.mockImplementation(
207
- ( source, filter, multiple, callback ) => {
208
- mediaPickerCallback = callback;
209
- }
210
- );
211
- return {
212
- expectMediaPickerCall: ( source, filter, multiple ) =>
213
- expect( requestMediaPicker ).toHaveBeenCalledWith(
214
- source,
215
- filter,
216
- multiple,
217
- mediaPickerCallback
218
- ),
219
- mediaPickerCallback: async ( ...mediaItems ) =>
220
- act( async () =>
221
- mediaPickerCallback(
222
- mediaItems.map( ( { localId, localUrl } ) => ( {
223
- type: 'image',
224
- url: localUrl,
225
- id: localId,
226
- } ) )
227
- )
228
- ),
229
- };
230
- };
72
+ export const getGalleryItem = ( galleryBlock, rowIndex ) =>
73
+ getInnerBlock( galleryBlock, 'Image', { rowIndex } );
231
74
 
232
75
  /**
233
76
  * Generates the HTML of a Gallery block.
@@ -261,33 +104,3 @@ export const generateGalleryBlock = (
261
104
  <figure class="wp-block-gallery has-nested-images columns-default is-cropped">${ galleryItems }</figure>
262
105
  <!-- /wp:gallery -->`;
263
106
  };
264
-
265
- /**
266
- * Sets the text of a caption.
267
- *
268
- * @param {import('react-test-renderer').ReactTestInstance} element Caption test instance.
269
- * @param {string} text Text to be set.
270
- */
271
- export const setCaption = ( element, text ) => {
272
- fireEvent( element, 'focus' );
273
- fireEvent( element, 'onChange', {
274
- nativeEvent: {
275
- eventCount: 1,
276
- target: undefined,
277
- text,
278
- },
279
- } );
280
- };
281
-
282
- /**
283
- * Opens the block settings of the current selected block.
284
- *
285
- * @param {import('@testing-library/react-native').RenderAPI} screen The Testing Library screen.
286
- */
287
- export const openBlockSettings = async ( screen ) => {
288
- const { getByA11yLabel, getByTestId } = screen;
289
- fireEvent.press( getByA11yLabel( 'Open Settings' ) );
290
- await waitFor(
291
- () => getByTestId( 'block-settings-modal' ).props.isVisible
292
- );
293
- };