@wordpress/block-library 7.17.0 → 7.19.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 (374) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/audio/edit.js +44 -4
  3. package/build/audio/edit.js.map +1 -1
  4. package/build/button/deprecated.js +16 -2
  5. package/build/button/deprecated.js.map +1 -1
  6. package/build/button/edit.js +14 -8
  7. package/build/button/edit.js.map +1 -1
  8. package/build/button/index.js +4 -1
  9. package/build/button/index.js.map +1 -1
  10. package/build/button/save.js +2 -0
  11. package/build/button/save.js.map +1 -1
  12. package/build/buttons/edit.native.js +1 -1
  13. package/build/buttons/edit.native.js.map +1 -1
  14. package/build/columns/transforms.js +5 -0
  15. package/build/columns/transforms.js.map +1 -1
  16. package/build/comment-template/index.js +6 -2
  17. package/build/comment-template/index.js.map +1 -1
  18. package/build/cover/edit/index.js +3 -1
  19. package/build/cover/edit/index.js.map +1 -1
  20. package/build/cover/edit/inspector-controls.js +3 -7
  21. package/build/cover/edit/inspector-controls.js.map +1 -1
  22. package/build/embed/deprecated.js +43 -4
  23. package/build/embed/deprecated.js.map +1 -1
  24. package/build/file/deprecated.js +108 -4
  25. package/build/file/deprecated.js.map +1 -1
  26. package/build/file/transforms.js +3 -9
  27. package/build/file/transforms.js.map +1 -1
  28. package/build/gallery/deprecated.js +148 -23
  29. package/build/gallery/deprecated.js.map +1 -1
  30. package/build/gallery/gallery.js +3 -2
  31. package/build/gallery/gallery.js.map +1 -1
  32. package/build/gallery/use-image-sizes.js +2 -1
  33. package/build/gallery/use-image-sizes.js.map +1 -1
  34. package/build/gallery/v1/edit.js +6 -3
  35. package/build/gallery/v1/edit.js.map +1 -1
  36. package/build/group/edit.js +105 -48
  37. package/build/group/edit.js.map +1 -1
  38. package/build/group/index.js +3 -0
  39. package/build/group/index.js.map +1 -1
  40. package/build/group/placeholder.js +168 -0
  41. package/build/group/placeholder.js.map +1 -0
  42. package/build/group/variations.js +3 -3
  43. package/build/group/variations.js.map +1 -1
  44. package/build/image/edit.native.js +1 -1
  45. package/build/image/edit.native.js.map +1 -1
  46. package/build/image/image.js +6 -9
  47. package/build/image/image.js.map +1 -1
  48. package/build/latest-comments/edit.js +2 -1
  49. package/build/latest-comments/edit.js.map +1 -1
  50. package/build/latest-comments/index.js +5 -1
  51. package/build/latest-comments/index.js.map +1 -1
  52. package/build/latest-posts/deprecated.js +13 -0
  53. package/build/latest-posts/deprecated.js.map +1 -1
  54. package/build/latest-posts/edit.js +1 -1
  55. package/build/latest-posts/edit.js.map +1 -1
  56. package/build/latest-posts/index.js +13 -0
  57. package/build/latest-posts/index.js.map +1 -1
  58. package/build/list/utils.js +4 -8
  59. package/build/list/utils.js.map +1 -1
  60. package/build/list-item/edit.js +2 -1
  61. package/build/list-item/edit.js.map +1 -1
  62. package/build/list-item/hooks/use-outdent-list-item.js +5 -7
  63. package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
  64. package/build/navigation/edit/index.js +94 -103
  65. package/build/navigation/edit/index.js.map +1 -1
  66. package/build/navigation/edit/manage-menus-button.js +36 -0
  67. package/build/navigation/edit/manage-menus-button.js.map +1 -0
  68. package/build/navigation/edit/navigation-menu-selector.js +12 -5
  69. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  70. package/build/navigation/edit/responsive-wrapper.js +2 -6
  71. package/build/navigation/edit/responsive-wrapper.js.map +1 -1
  72. package/build/navigation/edit/unsaved-inner-blocks.js +5 -17
  73. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  74. package/build/navigation-link/edit.js +14 -3
  75. package/build/navigation-link/edit.js.map +1 -1
  76. package/build/navigation-submenu/edit.js +4 -4
  77. package/build/navigation-submenu/edit.js.map +1 -1
  78. package/build/page-list/edit.js +29 -10
  79. package/build/page-list/edit.js.map +1 -1
  80. package/build/post-author/edit.js +35 -20
  81. package/build/post-author/edit.js.map +1 -1
  82. package/build/post-comments-count/index.js +4 -0
  83. package/build/post-comments-count/index.js.map +1 -1
  84. package/build/post-comments-form/index.js +4 -0
  85. package/build/post-comments-form/index.js.map +1 -1
  86. package/build/post-comments-link/index.js +4 -0
  87. package/build/post-comments-link/index.js.map +1 -1
  88. package/build/post-content/edit.js +14 -6
  89. package/build/post-content/edit.js.map +1 -1
  90. package/build/post-content/index.js +3 -0
  91. package/build/post-content/index.js.map +1 -1
  92. package/build/pullquote/deprecated.js +6 -6
  93. package/build/pullquote/deprecated.js.map +1 -1
  94. package/build/search/edit.js +1 -3
  95. package/build/search/edit.js.map +1 -1
  96. package/build/site-logo/edit.js +2 -2
  97. package/build/site-logo/edit.js.map +1 -1
  98. package/build/site-tagline/edit.js +21 -9
  99. package/build/site-tagline/edit.js.map +1 -1
  100. package/build/site-title/edit/index.js +20 -8
  101. package/build/site-title/edit/index.js.map +1 -1
  102. package/build/social-link/edit.js +11 -2
  103. package/build/social-link/edit.js.map +1 -1
  104. package/build/social-link/index.js +3 -0
  105. package/build/social-link/index.js.map +1 -1
  106. package/build/spacer/controls.js +3 -7
  107. package/build/spacer/controls.js.map +1 -1
  108. package/build/table/deprecated.js +282 -27
  109. package/build/table/deprecated.js.map +1 -1
  110. package/build/table/state.js +1 -1
  111. package/build/table/state.js.map +1 -1
  112. package/build/template-part/variations.js +5 -0
  113. package/build/template-part/variations.js.map +1 -1
  114. package/build/utils/clean-empty-object.js +5 -4
  115. package/build/utils/clean-empty-object.js.map +1 -1
  116. package/build/video/deprecated.js +159 -0
  117. package/build/video/deprecated.js.map +1 -0
  118. package/build/video/edit.js +41 -5
  119. package/build/video/edit.js.map +1 -1
  120. package/build/video/index.js +3 -0
  121. package/build/video/index.js.map +1 -1
  122. package/build/video/tracks-editor.js +3 -28
  123. package/build/video/tracks-editor.js.map +1 -1
  124. package/build-module/audio/edit.js +46 -7
  125. package/build-module/audio/edit.js.map +1 -1
  126. package/build-module/button/deprecated.js +16 -2
  127. package/build-module/button/deprecated.js.map +1 -1
  128. package/build-module/button/edit.js +16 -10
  129. package/build-module/button/edit.js.map +1 -1
  130. package/build-module/button/index.js +4 -1
  131. package/build-module/button/index.js.map +1 -1
  132. package/build-module/button/save.js +2 -0
  133. package/build-module/button/save.js.map +1 -1
  134. package/build-module/buttons/edit.native.js +1 -1
  135. package/build-module/buttons/edit.native.js.map +1 -1
  136. package/build-module/columns/transforms.js +5 -0
  137. package/build-module/columns/transforms.js.map +1 -1
  138. package/build-module/comment-template/index.js +6 -2
  139. package/build-module/comment-template/index.js.map +1 -1
  140. package/build-module/cover/edit/index.js +3 -1
  141. package/build-module/cover/edit/index.js.map +1 -1
  142. package/build-module/cover/edit/inspector-controls.js +4 -8
  143. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  144. package/build-module/embed/deprecated.js +44 -5
  145. package/build-module/embed/deprecated.js.map +1 -1
  146. package/build-module/file/deprecated.js +108 -4
  147. package/build-module/file/deprecated.js.map +1 -1
  148. package/build-module/file/transforms.js +3 -8
  149. package/build-module/file/transforms.js.map +1 -1
  150. package/build-module/gallery/deprecated.js +147 -25
  151. package/build-module/gallery/deprecated.js.map +1 -1
  152. package/build-module/gallery/gallery.js +3 -2
  153. package/build-module/gallery/gallery.js.map +1 -1
  154. package/build-module/gallery/use-image-sizes.js +3 -2
  155. package/build-module/gallery/use-image-sizes.js.map +1 -1
  156. package/build-module/gallery/v1/edit.js +7 -4
  157. package/build-module/gallery/v1/edit.js.map +1 -1
  158. package/build-module/group/edit.js +101 -48
  159. package/build-module/group/edit.js.map +1 -1
  160. package/build-module/group/index.js +3 -0
  161. package/build-module/group/index.js.map +1 -1
  162. package/build-module/group/placeholder.js +154 -0
  163. package/build-module/group/placeholder.js.map +1 -0
  164. package/build-module/group/variations.js +3 -3
  165. package/build-module/group/variations.js.map +1 -1
  166. package/build-module/image/edit.native.js +1 -1
  167. package/build-module/image/edit.native.js.map +1 -1
  168. package/build-module/image/image.js +8 -11
  169. package/build-module/image/image.js.map +1 -1
  170. package/build-module/latest-comments/edit.js +2 -1
  171. package/build-module/latest-comments/edit.js.map +1 -1
  172. package/build-module/latest-comments/index.js +5 -1
  173. package/build-module/latest-comments/index.js.map +1 -1
  174. package/build-module/latest-posts/deprecated.js +13 -0
  175. package/build-module/latest-posts/deprecated.js.map +1 -1
  176. package/build-module/latest-posts/edit.js +2 -2
  177. package/build-module/latest-posts/edit.js.map +1 -1
  178. package/build-module/latest-posts/index.js +13 -0
  179. package/build-module/latest-posts/index.js.map +1 -1
  180. package/build-module/list/utils.js +5 -9
  181. package/build-module/list/utils.js.map +1 -1
  182. package/build-module/list-item/edit.js +2 -1
  183. package/build-module/list-item/edit.js.map +1 -1
  184. package/build-module/list-item/hooks/use-outdent-list-item.js +5 -6
  185. package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
  186. package/build-module/navigation/edit/index.js +96 -105
  187. package/build-module/navigation/edit/index.js.map +1 -1
  188. package/build-module/navigation/edit/manage-menus-button.js +26 -0
  189. package/build-module/navigation/edit/manage-menus-button.js.map +1 -0
  190. package/build-module/navigation/edit/navigation-menu-selector.js +13 -6
  191. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  192. package/build-module/navigation/edit/responsive-wrapper.js +2 -6
  193. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
  194. package/build-module/navigation/edit/unsaved-inner-blocks.js +7 -18
  195. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  196. package/build-module/navigation-link/edit.js +14 -4
  197. package/build-module/navigation-link/edit.js.map +1 -1
  198. package/build-module/navigation-submenu/edit.js +4 -4
  199. package/build-module/navigation-submenu/edit.js.map +1 -1
  200. package/build-module/page-list/edit.js +29 -10
  201. package/build-module/page-list/edit.js.map +1 -1
  202. package/build-module/post-author/edit.js +35 -21
  203. package/build-module/post-author/edit.js.map +1 -1
  204. package/build-module/post-comments-count/index.js +4 -0
  205. package/build-module/post-comments-count/index.js.map +1 -1
  206. package/build-module/post-comments-form/index.js +4 -0
  207. package/build-module/post-comments-form/index.js.map +1 -1
  208. package/build-module/post-comments-link/index.js +4 -0
  209. package/build-module/post-comments-link/index.js.map +1 -1
  210. package/build-module/post-content/edit.js +14 -6
  211. package/build-module/post-content/edit.js.map +1 -1
  212. package/build-module/post-content/index.js +3 -0
  213. package/build-module/post-content/index.js.map +1 -1
  214. package/build-module/pullquote/deprecated.js +7 -7
  215. package/build-module/pullquote/deprecated.js.map +1 -1
  216. package/build-module/search/edit.js +1 -3
  217. package/build-module/search/edit.js.map +1 -1
  218. package/build-module/site-logo/edit.js +3 -3
  219. package/build-module/site-logo/edit.js.map +1 -1
  220. package/build-module/site-tagline/edit.js +23 -11
  221. package/build-module/site-tagline/edit.js.map +1 -1
  222. package/build-module/site-title/edit/index.js +22 -10
  223. package/build-module/site-title/edit/index.js.map +1 -1
  224. package/build-module/social-link/edit.js +11 -2
  225. package/build-module/social-link/edit.js.map +1 -1
  226. package/build-module/social-link/index.js +3 -0
  227. package/build-module/social-link/index.js.map +1 -1
  228. package/build-module/spacer/controls.js +4 -8
  229. package/build-module/spacer/controls.js.map +1 -1
  230. package/build-module/table/deprecated.js +282 -27
  231. package/build-module/table/deprecated.js.map +1 -1
  232. package/build-module/table/state.js +1 -1
  233. package/build-module/table/state.js.map +1 -1
  234. package/build-module/template-part/variations.js +5 -0
  235. package/build-module/template-part/variations.js.map +1 -1
  236. package/build-module/utils/clean-empty-object.js +5 -5
  237. package/build-module/utils/clean-empty-object.js.map +1 -1
  238. package/build-module/video/deprecated.js +147 -0
  239. package/build-module/video/deprecated.js.map +1 -0
  240. package/build-module/video/edit.js +45 -9
  241. package/build-module/video/edit.js.map +1 -1
  242. package/build-module/video/index.js +2 -0
  243. package/build-module/video/index.js.map +1 -1
  244. package/build-module/video/tracks-editor.js +4 -29
  245. package/build-module/video/tracks-editor.js.map +1 -1
  246. package/build-style/button/style-rtl.css +1 -0
  247. package/build-style/button/style.css +1 -0
  248. package/build-style/comment-template/style-rtl.css +1 -0
  249. package/build-style/comment-template/style.css +1 -0
  250. package/build-style/editor-rtl.css +80 -5
  251. package/build-style/editor.css +80 -5
  252. package/build-style/group/editor-rtl.css +44 -0
  253. package/build-style/group/editor.css +44 -0
  254. package/build-style/latest-comments/style-rtl.css +1 -0
  255. package/build-style/latest-comments/style.css +1 -0
  256. package/build-style/latest-posts/style-rtl.css +3 -0
  257. package/build-style/latest-posts/style.css +3 -0
  258. package/build-style/navigation/editor-rtl.css +27 -4
  259. package/build-style/navigation/editor.css +27 -4
  260. package/build-style/navigation/style-rtl.css +13 -1
  261. package/build-style/navigation/style.css +13 -1
  262. package/build-style/navigation-link/editor-rtl.css +8 -1
  263. package/build-style/navigation-link/editor.css +8 -1
  264. package/build-style/post-comments-form/style-rtl.css +3 -0
  265. package/build-style/post-comments-form/style.css +3 -0
  266. package/build-style/query/editor-rtl.css +1 -1
  267. package/build-style/query/editor.css +1 -1
  268. package/build-style/query-pagination/style-rtl.css +1 -1
  269. package/build-style/query-pagination/style.css +1 -1
  270. package/build-style/style-rtl.css +28 -2
  271. package/build-style/style.css +28 -2
  272. package/build-style/table/editor-rtl.css +1 -0
  273. package/build-style/table/editor.css +1 -0
  274. package/build-style/table/style-rtl.css +5 -0
  275. package/build-style/table/style.css +5 -0
  276. package/build-style/table/theme-rtl.css +1 -3
  277. package/build-style/table/theme.css +1 -3
  278. package/build-style/theme-rtl.css +1 -3
  279. package/build-style/theme.css +1 -3
  280. package/package.json +29 -28
  281. package/src/audio/edit.js +79 -24
  282. package/src/avatar/index.php +1 -1
  283. package/src/block/test/edit.native.js +8 -8
  284. package/src/button/block.json +4 -1
  285. package/src/button/deprecated.js +18 -2
  286. package/src/button/edit.js +12 -10
  287. package/src/button/save.js +12 -2
  288. package/src/button/style.scss +2 -0
  289. package/src/buttons/edit.native.js +1 -1
  290. package/src/buttons/test/edit.native.js +19 -19
  291. package/src/columns/test/edit.native.js +32 -32
  292. package/src/columns/transforms.js +8 -0
  293. package/src/comment-template/block.json +6 -2
  294. package/src/comment-template/style.scss +2 -0
  295. package/src/cover/edit/index.js +3 -1
  296. package/src/cover/edit/inspector-controls.js +11 -13
  297. package/src/cover/test/edit.native.js +26 -26
  298. package/src/embed/deprecated.js +53 -26
  299. package/src/embed/test/index.native.js +43 -43
  300. package/src/file/deprecated.js +130 -2
  301. package/src/file/transforms.js +3 -8
  302. package/src/gallery/deprecated.js +129 -4
  303. package/src/gallery/gallery.js +2 -0
  304. package/src/gallery/index.php +19 -10
  305. package/src/gallery/test/index.native.js +11 -11
  306. package/src/gallery/use-image-sizes.js +3 -2
  307. package/src/gallery/v1/edit.js +21 -25
  308. package/src/group/block.json +3 -0
  309. package/src/group/edit.js +105 -46
  310. package/src/group/editor.scss +48 -0
  311. package/src/group/placeholder.js +187 -0
  312. package/src/group/test/edit.native.js +3 -3
  313. package/src/group/test/placeholder.js +78 -0
  314. package/src/group/variations.js +3 -3
  315. package/src/image/edit.native.js +1 -1
  316. package/src/image/image.js +22 -10
  317. package/src/image/test/edit.native.js +17 -17
  318. package/src/latest-comments/block.json +5 -1
  319. package/src/latest-comments/edit.js +1 -0
  320. package/src/latest-comments/style.scss +3 -0
  321. package/src/latest-posts/block.json +13 -0
  322. package/src/latest-posts/edit.js +2 -2
  323. package/src/latest-posts/style.scss +3 -0
  324. package/src/list/test/edit.native.js +36 -36
  325. package/src/list/utils.js +3 -11
  326. package/src/list-item/edit.js +1 -0
  327. package/src/list-item/hooks/use-outdent-list-item.js +3 -6
  328. package/src/missing/test/edit-integration.native.js +5 -5
  329. package/src/navigation/edit/index.js +186 -161
  330. package/src/navigation/edit/manage-menus-button.js +21 -0
  331. package/src/navigation/edit/navigation-menu-selector.js +20 -5
  332. package/src/navigation/edit/responsive-wrapper.js +2 -10
  333. package/src/navigation/edit/unsaved-inner-blocks.js +5 -22
  334. package/src/navigation/editor.scss +29 -4
  335. package/src/navigation/style.scss +19 -1
  336. package/src/navigation-link/edit.js +13 -4
  337. package/src/navigation-link/editor.scss +8 -0
  338. package/src/navigation-submenu/edit.js +7 -5
  339. package/src/page-list/edit.js +36 -22
  340. package/src/post-author/edit.js +44 -20
  341. package/src/post-comments-count/block.json +4 -0
  342. package/src/post-comments-form/block.json +4 -0
  343. package/src/post-comments-form/style.scss +3 -0
  344. package/src/post-comments-link/block.json +4 -0
  345. package/src/post-content/block.json +3 -0
  346. package/src/post-content/edit.js +8 -4
  347. package/src/pullquote/deprecated.js +7 -7
  348. package/src/query/editor.scss +1 -1
  349. package/src/query-pagination/style.scss +1 -1
  350. package/src/read-more/index.php +9 -2
  351. package/src/search/edit.js +1 -1
  352. package/src/shortcode/test/edit.native.js +5 -5
  353. package/src/site-logo/edit.js +3 -3
  354. package/src/site-tagline/edit.js +25 -18
  355. package/src/site-title/edit/index.js +26 -12
  356. package/src/social-link/block.json +3 -0
  357. package/src/social-link/edit.js +8 -1
  358. package/src/social-link/index.php +11 -7
  359. package/src/social-link/test/index.native.js +10 -10
  360. package/src/social-links/test/edit.native.js +4 -4
  361. package/src/spacer/controls.js +10 -12
  362. package/src/spacer/test/index.native.js +17 -17
  363. package/src/table/deprecated.js +587 -348
  364. package/src/table/editor.scss +1 -0
  365. package/src/table/state.js +1 -1
  366. package/src/table/style.scss +7 -0
  367. package/src/table/theme.scss +1 -3
  368. package/src/template-part/index.php +5 -0
  369. package/src/template-part/variations.js +4 -0
  370. package/src/utils/clean-empty-object.js +5 -6
  371. package/src/video/deprecated.js +57 -0
  372. package/src/video/edit.js +71 -23
  373. package/src/video/index.js +2 -0
  374. package/src/video/tracks-editor.js +12 -28
@@ -207,7 +207,7 @@
207
207
  }
208
208
 
209
209
  .wp-block-table {
210
- margin: "0 0 1em 0";
210
+ margin: 0 0 1em 0;
211
211
  }
212
212
  .wp-block-table thead {
213
213
  border-bottom: 3px solid;
@@ -217,8 +217,6 @@
217
217
  }
218
218
  .wp-block-table td,
219
219
  .wp-block-table th {
220
- padding: 0.5em;
221
- border: 1px solid;
222
220
  word-break: normal;
223
221
  }
224
222
  .wp-block-table figcaption {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "7.17.0",
3
+ "version": "7.19.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -31,35 +31,36 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.16.0",
34
- "@wordpress/a11y": "^3.20.0",
35
- "@wordpress/api-fetch": "^6.17.0",
36
- "@wordpress/autop": "^3.20.0",
37
- "@wordpress/blob": "^3.20.0",
38
- "@wordpress/block-editor": "^10.3.0",
39
- "@wordpress/blocks": "^11.19.0",
40
- "@wordpress/components": "^21.3.0",
41
- "@wordpress/compose": "^5.18.0",
42
- "@wordpress/core-data": "^5.3.0",
43
- "@wordpress/data": "^7.4.0",
44
- "@wordpress/date": "^4.20.0",
45
- "@wordpress/deprecated": "^3.20.0",
46
- "@wordpress/dom": "^3.20.0",
47
- "@wordpress/element": "^4.18.0",
48
- "@wordpress/hooks": "^3.20.0",
49
- "@wordpress/html-entities": "^3.20.0",
50
- "@wordpress/i18n": "^4.20.0",
51
- "@wordpress/icons": "^9.11.0",
52
- "@wordpress/keycodes": "^3.20.0",
53
- "@wordpress/notices": "^3.20.0",
54
- "@wordpress/primitives": "^3.18.0",
55
- "@wordpress/reusable-blocks": "^3.18.0",
56
- "@wordpress/rich-text": "^5.18.0",
57
- "@wordpress/server-side-render": "^3.18.0",
58
- "@wordpress/url": "^3.21.0",
59
- "@wordpress/viewport": "^4.18.0",
34
+ "@wordpress/a11y": "^3.22.0",
35
+ "@wordpress/api-fetch": "^6.19.0",
36
+ "@wordpress/autop": "^3.22.0",
37
+ "@wordpress/blob": "^3.22.0",
38
+ "@wordpress/block-editor": "^10.5.0",
39
+ "@wordpress/blocks": "^11.21.0",
40
+ "@wordpress/components": "^22.1.0",
41
+ "@wordpress/compose": "^5.20.0",
42
+ "@wordpress/core-data": "^5.5.0",
43
+ "@wordpress/data": "^7.6.0",
44
+ "@wordpress/date": "^4.22.0",
45
+ "@wordpress/deprecated": "^3.22.0",
46
+ "@wordpress/dom": "^3.22.0",
47
+ "@wordpress/element": "^4.20.0",
48
+ "@wordpress/hooks": "^3.22.0",
49
+ "@wordpress/html-entities": "^3.22.0",
50
+ "@wordpress/i18n": "^4.22.0",
51
+ "@wordpress/icons": "^9.13.0",
52
+ "@wordpress/keycodes": "^3.22.0",
53
+ "@wordpress/notices": "^3.22.0",
54
+ "@wordpress/primitives": "^3.20.0",
55
+ "@wordpress/reusable-blocks": "^3.20.0",
56
+ "@wordpress/rich-text": "^5.20.0",
57
+ "@wordpress/server-side-render": "^3.20.0",
58
+ "@wordpress/url": "^3.23.0",
59
+ "@wordpress/viewport": "^4.20.0",
60
60
  "change-case": "^4.1.2",
61
61
  "classnames": "^2.3.1",
62
62
  "colord": "^2.7.0",
63
+ "escape-html": "^1.0.3",
63
64
  "fast-average-color": "^9.1.1",
64
65
  "lodash": "^4.17.21",
65
66
  "memize": "^1.1.0",
@@ -73,5 +74,5 @@
73
74
  "publishConfig": {
74
75
  "access": "public"
75
76
  },
76
- "gitHead": "a2ff0e6471c88436dad0287beb88d1729aa6f5dd"
77
+ "gitHead": "7ac04f446242452d3cb24372f9ca58f0cae97715"
77
78
  }
package/src/audio/edit.js CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  SelectControl,
14
14
  Spinner,
15
15
  ToggleControl,
16
+ ToolbarButton,
16
17
  } from '@wordpress/components';
17
18
  import {
18
19
  BlockControls,
@@ -25,12 +26,13 @@ import {
25
26
  store as blockEditorStore,
26
27
  __experimentalGetElementClassName,
27
28
  } from '@wordpress/block-editor';
28
- import { useEffect } from '@wordpress/element';
29
+ import { useEffect, useState, useCallback } from '@wordpress/element';
29
30
  import { __, _x } from '@wordpress/i18n';
30
31
  import { useDispatch, useSelect } from '@wordpress/data';
31
- import { audio as icon } from '@wordpress/icons';
32
+ import { audio as icon, caption as captionIcon } from '@wordpress/icons';
32
33
  import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
33
34
  import { store as noticesStore } from '@wordpress/notices';
35
+ import { usePrevious } from '@wordpress/compose';
34
36
 
35
37
  /**
36
38
  * Internal dependencies
@@ -48,6 +50,8 @@ function AudioEdit( {
48
50
  insertBlocksAfter,
49
51
  } ) {
50
52
  const { id, autoplay, caption, loop, preload, src } = attributes;
53
+ const prevCaption = usePrevious( caption );
54
+ const [ showCaption, setShowCaption ] = useState( !! caption );
51
55
  const isTemporaryAudio = ! id && isBlobURL( src );
52
56
  const mediaUpload = useSelect( ( select ) => {
53
57
  const { getSettings } = select( blockEditorStore );
@@ -69,6 +73,30 @@ function AudioEdit( {
69
73
  }
70
74
  }, [] );
71
75
 
76
+ // We need to show the caption when changes come from
77
+ // history navigation(undo/redo).
78
+ useEffect( () => {
79
+ if ( caption && ! prevCaption ) {
80
+ setShowCaption( true );
81
+ }
82
+ }, [ caption, prevCaption ] );
83
+
84
+ // Focus the caption when we click to add one.
85
+ const captionRef = useCallback(
86
+ ( node ) => {
87
+ if ( node && ! caption ) {
88
+ node.focus();
89
+ }
90
+ },
91
+ [ caption ]
92
+ );
93
+
94
+ useEffect( () => {
95
+ if ( ! isSelected && ! caption ) {
96
+ setShowCaption( false );
97
+ }
98
+ }, [ isSelected, caption ] );
99
+
72
100
  function toggleAttribute( attribute ) {
73
101
  return ( newValue ) => {
74
102
  setAttributes( { [ attribute ]: newValue } );
@@ -106,12 +134,20 @@ function AudioEdit( {
106
134
  if ( ! media || ! media.url ) {
107
135
  // In this case there was an error and we should continue in the editing state
108
136
  // previous attributes should be removed because they may be temporary blob urls.
109
- setAttributes( { src: undefined, id: undefined } );
137
+ setAttributes( {
138
+ src: undefined,
139
+ id: undefined,
140
+ caption: undefined,
141
+ } );
110
142
  return;
111
143
  }
112
144
  // Sets the block's attribute and updates the edit component from the
113
145
  // selected media, then switches off the editing UI.
114
- setAttributes( { src: media.url, id: media.id } );
146
+ setAttributes( {
147
+ src: media.url,
148
+ id: media.id,
149
+ caption: media.caption,
150
+ } );
115
151
  }
116
152
 
117
153
  const classes = classnames( className, {
@@ -140,6 +176,23 @@ function AudioEdit( {
140
176
 
141
177
  return (
142
178
  <>
179
+ <BlockControls group="block">
180
+ <ToolbarButton
181
+ onClick={ () => {
182
+ setShowCaption( ! showCaption );
183
+ if ( showCaption && caption ) {
184
+ setAttributes( { caption: undefined } );
185
+ }
186
+ } }
187
+ icon={ captionIcon }
188
+ isPressed={ showCaption }
189
+ label={
190
+ showCaption
191
+ ? __( 'Remove caption' )
192
+ : __( 'Add caption' )
193
+ }
194
+ />
195
+ </BlockControls>
143
196
  <BlockControls group="other">
144
197
  <MediaReplaceFlow
145
198
  mediaId={ id }
@@ -195,26 +248,28 @@ function AudioEdit( {
195
248
  <audio controls="controls" src={ src } />
196
249
  </Disabled>
197
250
  { isTemporaryAudio && <Spinner /> }
198
- { ( ! RichText.isEmpty( caption ) || isSelected ) && (
199
- <RichText
200
- tagName="figcaption"
201
- className={ __experimentalGetElementClassName(
202
- 'caption'
203
- ) }
204
- aria-label={ __( 'Audio caption text' ) }
205
- placeholder={ __( 'Add caption' ) }
206
- value={ caption }
207
- onChange={ ( value ) =>
208
- setAttributes( { caption: value } )
209
- }
210
- inlineToolbar
211
- __unstableOnSplitAtEnd={ () =>
212
- insertBlocksAfter(
213
- createBlock( getDefaultBlockName() )
214
- )
215
- }
216
- />
217
- ) }
251
+ { showCaption &&
252
+ ( ! RichText.isEmpty( caption ) || isSelected ) && (
253
+ <RichText
254
+ tagName="figcaption"
255
+ className={ __experimentalGetElementClassName(
256
+ 'caption'
257
+ ) }
258
+ ref={ captionRef }
259
+ aria-label={ __( 'Audio caption text' ) }
260
+ placeholder={ __( 'Add caption' ) }
261
+ value={ caption }
262
+ onChange={ ( value ) =>
263
+ setAttributes( { caption: value } )
264
+ }
265
+ inlineToolbar
266
+ __unstableOnSplitAtEnd={ () =>
267
+ insertBlocksAfter(
268
+ createBlock( getDefaultBlockName() )
269
+ )
270
+ }
271
+ />
272
+ ) }
218
273
  </figure>
219
274
  </>
220
275
  );
@@ -100,7 +100,7 @@ function render_block_core_avatar( $attributes, $content, $block ) {
100
100
  $label = 'aria-label="' . sprintf( esc_attr__( '(%s author archive, opens in a new tab)' ), $author_name ) . '"';
101
101
  }
102
102
  // translators: %1$s: Author archive link. %2$s: Link target. %3$s Aria label. %4$s Avatar image.
103
- $avatar_block = sprintf( '<a href="%1$s" target="%2$s" %3$s class="wp-block-avatar__link">%4$s</a>', get_author_posts_url( $author_id ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );
103
+ $avatar_block = sprintf( '<a href="%1$s" target="%2$s" %3$s class="wp-block-avatar__link">%4$s</a>', esc_url( get_author_posts_url( $author_id ) ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block );
104
104
  }
105
105
  return sprintf( '<div %1s>%2s</div>', $wrapper_attributes, $avatar_block );
106
106
  }
@@ -78,14 +78,14 @@ describe( 'Reusable block', () => {
78
78
  return Promise.resolve( response );
79
79
  } );
80
80
 
81
- const { getByA11yLabel, getByTestId, getByText } =
81
+ const { getByLabelText, getByTestId, getByText } =
82
82
  await initializeEditor( {
83
83
  initialHtml: '',
84
84
  capabilities: { reusableBlock: true },
85
85
  } );
86
86
 
87
87
  // Open the inserter menu.
88
- fireEvent.press( await waitFor( () => getByA11yLabel( 'Add block' ) ) );
88
+ fireEvent.press( await waitFor( () => getByLabelText( 'Add block' ) ) );
89
89
 
90
90
  // Navigate to reusable tab.
91
91
  const reusableSegment = await waitFor( () => getByText( 'Reusable' ) );
@@ -116,7 +116,7 @@ describe( 'Reusable block', () => {
116
116
 
117
117
  // Get the reusable block.
118
118
  const reusableBlock = await waitFor( () =>
119
- getByA11yLabel( /Reusable block Block\. Row 1/ )
119
+ getByLabelText( /Reusable block Block\. Row 1/ )
120
120
  );
121
121
 
122
122
  expect( reusableBlock ).toBeDefined();
@@ -128,12 +128,12 @@ describe( 'Reusable block', () => {
128
128
  const id = 3;
129
129
  const initialHtml = `<!-- wp:block {"ref":${ id }} /-->`;
130
130
 
131
- const { getByA11yLabel } = await initializeEditor( {
131
+ const { getByLabelText } = await initializeEditor( {
132
132
  initialHtml,
133
133
  } );
134
134
 
135
135
  const reusableBlock = await waitFor( () =>
136
- getByA11yLabel( /Reusable block Block\. Row 1/ )
136
+ getByLabelText( /Reusable block Block\. Row 1/ )
137
137
  );
138
138
 
139
139
  const blockDeleted = await waitFor( () =>
@@ -163,12 +163,12 @@ describe( 'Reusable block', () => {
163
163
  return Promise.resolve( response );
164
164
  } );
165
165
 
166
- const { getByA11yLabel } = await initializeEditor( {
166
+ const { getByLabelText } = await initializeEditor( {
167
167
  initialHtml,
168
168
  } );
169
169
 
170
170
  const reusableBlock = await waitFor( () =>
171
- getByA11yLabel( /Reusable block Block\. Row 1/ )
171
+ getByLabelText( /Reusable block Block\. Row 1/ )
172
172
  );
173
173
 
174
174
  const innerBlockListWrapper = await waitFor( () =>
@@ -186,7 +186,7 @@ describe( 'Reusable block', () => {
186
186
  } );
187
187
 
188
188
  const headingInnerBlock = await waitFor( () =>
189
- within( reusableBlock ).getByA11yLabel(
189
+ within( reusableBlock ).getByLabelText(
190
190
  'Heading Block. Row 1. Level 2. First Reusable block'
191
191
  )
192
192
  );
@@ -9,6 +9,9 @@
9
9
  "keywords": [ "link" ],
10
10
  "textdomain": "default",
11
11
  "attributes": {
12
+ "textAlign": {
13
+ "type": "string"
14
+ },
12
15
  "url": {
13
16
  "type": "string",
14
17
  "source": "attribute",
@@ -56,7 +59,7 @@
56
59
  },
57
60
  "supports": {
58
61
  "anchor": true,
59
- "align": true,
62
+ "align": false,
60
63
  "alignWide": false,
61
64
  "color": {
62
65
  "__experimentalSkipSerialization": true,
@@ -51,6 +51,20 @@ const migrateBorderRadius = ( attributes ) => {
51
51
  };
52
52
  };
53
53
 
54
+ function migrateAlign( attributes ) {
55
+ if ( ! attributes.align ) {
56
+ return attributes;
57
+ }
58
+ const { align, ...otherAttributes } = attributes;
59
+ return {
60
+ ...otherAttributes,
61
+ className: classnames(
62
+ otherAttributes.className,
63
+ `align${ attributes.align }`
64
+ ),
65
+ };
66
+ }
67
+
54
68
  const migrateCustomColorsAndGradients = ( attributes ) => {
55
69
  if (
56
70
  ! attributes.customTextColor &&
@@ -780,10 +794,12 @@ const deprecated = [
780
794
  isEligible: ( attributes ) =>
781
795
  !! attributes.customTextColor ||
782
796
  !! attributes.customBackgroundColor ||
783
- !! attributes.customGradient,
797
+ !! attributes.customGradient ||
798
+ !! attributes.align,
784
799
  migrate: compose(
785
800
  migrateBorderRadius,
786
- migrateCustomColorsAndGradients
801
+ migrateCustomColorsAndGradients,
802
+ migrateAlign
787
803
  ),
788
804
  save( { attributes } ) {
789
805
  const {
@@ -7,7 +7,7 @@ import classnames from 'classnames';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { __ } from '@wordpress/i18n';
10
- import { useCallback, useEffect, useState, useRef } from '@wordpress/element';
10
+ import { useEffect, useState, useRef } from '@wordpress/element';
11
11
  import {
12
12
  Button,
13
13
  ButtonGroup,
@@ -17,6 +17,7 @@ import {
17
17
  Popover,
18
18
  } from '@wordpress/components';
19
19
  import {
20
+ AlignmentControl,
20
21
  BlockControls,
21
22
  InspectorControls,
22
23
  RichText,
@@ -76,14 +77,8 @@ function ButtonEdit( props ) {
76
77
  onReplace,
77
78
  mergeBlocks,
78
79
  } = props;
79
- const { linkTarget, placeholder, rel, style, text, url, width } =
80
+ const { textAlign, linkTarget, placeholder, rel, style, text, url, width } =
80
81
  attributes;
81
- const onSetLinkRel = useCallback(
82
- ( value ) => {
83
- setAttributes( { rel: value } );
84
- },
85
- [ setAttributes ]
86
- );
87
82
 
88
83
  function onToggleOpenInNewTab( value ) {
89
84
  const newLinkTarget = value ? '_blank' : undefined;
@@ -176,6 +171,7 @@ function ButtonEdit( props ) {
176
171
  colorProps.className,
177
172
  borderProps.className,
178
173
  {
174
+ [ `has-text-align-${ textAlign }` ]: textAlign,
179
175
  // For backwards compatibility add style that isn't
180
176
  // provided via block support.
181
177
  'no-border-radius': style?.border?.radius === 0,
@@ -199,6 +195,12 @@ function ButtonEdit( props ) {
199
195
  />
200
196
  </div>
201
197
  <BlockControls group="block">
198
+ <AlignmentControl
199
+ value={ textAlign }
200
+ onChange={ ( nextAlign ) => {
201
+ setAttributes( { textAlign: nextAlign } );
202
+ } }
203
+ />
202
204
  { ! isURLSet && (
203
205
  <ToolbarButton
204
206
  name="link"
@@ -221,7 +223,7 @@ function ButtonEdit( props ) {
221
223
  </BlockControls>
222
224
  { isSelected && ( isEditingURL || isURLSet ) && (
223
225
  <Popover
224
- position="bottom center"
226
+ placement="bottom"
225
227
  onClose={ () => {
226
228
  setIsEditingURL( false );
227
229
  richTextRef.current?.focus();
@@ -262,7 +264,7 @@ function ButtonEdit( props ) {
262
264
  <TextControl
263
265
  label={ __( 'Link rel' ) }
264
266
  value={ rel || '' }
265
- onChange={ onSetLinkRel }
267
+ onChange={ ( newRel ) => setAttributes( { rel: newRel } ) }
266
268
  />
267
269
  </InspectorControls>
268
270
  </>
@@ -16,8 +16,17 @@ import {
16
16
  } from '@wordpress/block-editor';
17
17
 
18
18
  export default function save( { attributes, className } ) {
19
- const { fontSize, linkTarget, rel, style, text, title, url, width } =
20
- attributes;
19
+ const {
20
+ textAlign,
21
+ fontSize,
22
+ linkTarget,
23
+ rel,
24
+ style,
25
+ text,
26
+ title,
27
+ url,
28
+ width,
29
+ } = attributes;
21
30
 
22
31
  if ( ! text ) {
23
32
  return null;
@@ -31,6 +40,7 @@ export default function save( { attributes, className } ) {
31
40
  colorProps.className,
32
41
  borderProps.className,
33
42
  {
43
+ [ `has-text-align-${ textAlign }` ]: textAlign,
34
44
  // For backwards compatibility add style that isn't provided via
35
45
  // block support.
36
46
  'no-border-radius': style?.border?.radius === 0,
@@ -113,4 +113,6 @@ $blocks-block__margin: 0.5em;
113
113
  .wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background),
114
114
  .wp-block-button .wp-block-button__link.is-style-outline:not(.has-background) {
115
115
  background-color: transparent;
116
+ // background-image is required to overwrite a gradient background
117
+ background-image: none;
116
118
  }
@@ -139,7 +139,7 @@ export default function ButtonsEdit( {
139
139
  }
140
140
  popoverProps={ {
141
141
  position: 'bottom right',
142
- isAlternate: true,
142
+ variant: 'toolbar',
143
143
  } }
144
144
  />
145
145
  </BlockControls>
@@ -50,12 +50,12 @@ describe( 'Buttons block', () => {
50
50
  <div class="wp-block-button"><a class="wp-block-button__link wp-element-button" style="border-radius:5px" >Hello</a></div>
51
51
  <!-- /wp:button --></div>
52
52
  <!-- /wp:buttons -->`;
53
- const { getByA11yLabel } = await initializeEditor( {
53
+ const { getByLabelText } = await initializeEditor( {
54
54
  initialHtml,
55
55
  } );
56
56
 
57
57
  const buttonsBlock = await waitFor( () =>
58
- getByA11yLabel( /Buttons Block\. Row 1/ )
58
+ getByLabelText( /Buttons Block\. Row 1/ )
59
59
  );
60
60
  fireEvent.press( buttonsBlock );
61
61
 
@@ -73,17 +73,17 @@ describe( 'Buttons block', () => {
73
73
  } );
74
74
 
75
75
  const buttonInnerBlock = await waitFor( () =>
76
- within( buttonsBlock ).getByA11yLabel( /Button Block\. Row 1/ )
76
+ within( buttonsBlock ).getByLabelText( /Button Block\. Row 1/ )
77
77
  );
78
78
  fireEvent.press( buttonInnerBlock );
79
79
 
80
80
  const settingsButton = await waitFor( () =>
81
- getByA11yLabel( 'Open Settings' )
81
+ getByLabelText( 'Open Settings' )
82
82
  );
83
83
  fireEvent.press( settingsButton );
84
84
 
85
85
  const radiusStepper = await waitFor( () =>
86
- getByA11yLabel( /Border Radius/ )
86
+ getByLabelText( /Border Radius/ )
87
87
  );
88
88
 
89
89
  const incrementButton = await waitFor( () =>
@@ -98,7 +98,7 @@ describe( 'Buttons block', () => {
98
98
  const screen = await initializeEditor( {
99
99
  initialHtml: BUTTONS_HTML,
100
100
  } );
101
- const { getByA11yLabel } = screen;
101
+ const { getByLabelText } = screen;
102
102
 
103
103
  // Get block
104
104
  const buttonsBlock = await getBlock( screen, 'Buttons' );
@@ -126,13 +126,13 @@ describe( 'Buttons block', () => {
126
126
 
127
127
  // Check for new button
128
128
  const secondButtonBlock = await waitFor( () =>
129
- within( buttonsBlock ).getByA11yLabel( /Button Block\. Row 2/ )
129
+ within( buttonsBlock ).getByLabelText( /Button Block\. Row 2/ )
130
130
  );
131
131
  expect( secondButtonBlock ).toBeVisible();
132
132
 
133
133
  // Add a Paragraph block using the empty placeholder at the bottom
134
134
  const paragraphPlaceholder = await waitFor( () =>
135
- getByA11yLabel( 'Add paragraph block' )
135
+ getByLabelText( 'Add paragraph block' )
136
136
  );
137
137
  fireEvent.press( paragraphPlaceholder );
138
138
 
@@ -149,9 +149,9 @@ describe( 'Buttons block', () => {
149
149
  initialHtml: BUTTONS_HTML,
150
150
  } );
151
151
  const {
152
- getByA11yLabel,
152
+ getByLabelText,
153
153
  getByTestId,
154
- queryAllByA11yLabel,
154
+ queryAllByLabelText,
155
155
  getByText,
156
156
  } = screen;
157
157
 
@@ -176,7 +176,7 @@ describe( 'Buttons block', () => {
176
176
  fireEvent.press( buttonBlock );
177
177
 
178
178
  // Open the block inserter
179
- fireEvent.press( getByA11yLabel( 'Add block' ) );
179
+ fireEvent.press( getByLabelText( 'Add block' ) );
180
180
 
181
181
  const blockList = getByTestId( 'InserterUI-Blocks' );
182
182
  // onScroll event used to force the FlatList to render all items
@@ -190,7 +190,7 @@ describe( 'Buttons block', () => {
190
190
 
191
191
  // Check the Add block here placeholder is not visible
192
192
  const addBlockHerePlaceholders =
193
- queryAllByA11yLabel( 'ADD BLOCK HERE' );
193
+ queryAllByLabelText( 'ADD BLOCK HERE' );
194
194
  expect( addBlockHerePlaceholders.length ).toBe( 0 );
195
195
 
196
196
  // Add a new Button block
@@ -201,7 +201,7 @@ describe( 'Buttons block', () => {
201
201
  rowIndex: 2,
202
202
  } );
203
203
  const secondButtonInput =
204
- within( secondButtonBlock ).getByA11yLabel(
204
+ within( secondButtonBlock ).getByLabelText(
205
205
  'Text input. Empty'
206
206
  );
207
207
  changeTextOfRichText( secondButtonInput, 'Hello!' );
@@ -214,7 +214,7 @@ describe( 'Buttons block', () => {
214
214
  const screen = await initializeEditor( {
215
215
  initialHtml: BUTTONS_HTML,
216
216
  } );
217
- const { getByA11yLabel } = screen;
217
+ const { getByLabelText } = screen;
218
218
 
219
219
  // Get block
220
220
  const buttonsBlock = await getBlock( screen, 'Buttons' );
@@ -236,13 +236,13 @@ describe( 'Buttons block', () => {
236
236
  fireEvent.press( buttonBlock );
237
237
 
238
238
  // Open block actions menu
239
- const blockActionsButton = getByA11yLabel(
239
+ const blockActionsButton = getByLabelText(
240
240
  /Open Block Actions Menu/
241
241
  );
242
242
  fireEvent.press( blockActionsButton );
243
243
 
244
244
  // Delete block
245
- const deleteButton = getByA11yLabel( /Remove block/ );
245
+ const deleteButton = getByLabelText( /Remove block/ );
246
246
  fireEvent.press( deleteButton );
247
247
 
248
248
  expect( getEditorHtml() ).toMatchSnapshot();
@@ -260,17 +260,17 @@ describe( 'Buttons block', () => {
260
260
  const initialHtml = `<!-- wp:buttons -->
261
261
  <div class="wp-block-buttons"><!-- wp:button /--></div>
262
262
  <!-- /wp:buttons -->`;
263
- const { getByA11yLabel, getByText } = await initializeEditor( {
263
+ const { getByLabelText, getByText } = await initializeEditor( {
264
264
  initialHtml,
265
265
  } );
266
266
 
267
267
  const block = await waitFor( () =>
268
- getByA11yLabel( /Buttons Block\. Row 1/ )
268
+ getByLabelText( /Buttons Block\. Row 1/ )
269
269
  );
270
270
  fireEvent.press( block );
271
271
 
272
272
  fireEvent.press(
273
- getByA11yLabel( 'Change items justification' )
273
+ getByLabelText( 'Change items justification' )
274
274
  );
275
275
 
276
276
  // Select alignment option.