@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
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { useInnerBlocksProps } from '@wordpress/block-editor';
5
- import { Disabled, Spinner } from '@wordpress/components';
5
+ import { Disabled } from '@wordpress/components';
6
6
  import { store as coreStore } from '@wordpress/core-data';
7
7
  import { useSelect } from '@wordpress/data';
8
8
  import { useContext, useEffect, useRef, useMemo } from '@wordpress/element';
@@ -11,7 +11,6 @@ import { useContext, useEffect, useRef, useMemo } from '@wordpress/element';
11
11
  * Internal dependencies
12
12
  */
13
13
  import useNavigationMenu from '../use-navigation-menu';
14
- import useCreateNavigationMenu from './use-create-navigation-menu';
15
14
 
16
15
  const EMPTY_OBJECT = {};
17
16
  const DRAFT_MENU_PARAMS = [
@@ -38,9 +37,8 @@ const ALLOWED_BLOCKS = [
38
37
 
39
38
  export default function UnsavedInnerBlocks( {
40
39
  blocks,
41
- clientId,
42
- hasSavedUnsavedInnerBlocks,
43
- onSave,
40
+ createNavigationMenu,
41
+
44
42
  hasSelection,
45
43
  } ) {
46
44
  const originalBlocks = useRef();
@@ -75,7 +73,6 @@ export default function UnsavedInnerBlocks( {
75
73
  // The block will be disabled in a block preview, use this as a way of
76
74
  // avoiding the side-effects of this component for block previews.
77
75
  const isDisabled = useContext( Disabled.Context );
78
- const savingLock = useRef( false );
79
76
 
80
77
  const innerBlocksProps = useInnerBlocksProps(
81
78
  {
@@ -121,9 +118,6 @@ export default function UnsavedInnerBlocks( {
121
118
 
122
119
  const { hasResolvedNavigationMenus, navigationMenus } = useNavigationMenu();
123
120
 
124
- const { create: createNavigationMenu } =
125
- useCreateNavigationMenu( clientId );
126
-
127
121
  // Automatically save the uncontrolled blocks.
128
122
  useEffect( () => {
129
123
  // The block will be disabled when used in a BlockPreview.
@@ -140,9 +134,7 @@ export default function UnsavedInnerBlocks( {
140
134
  // which is an indication they want to start editing.
141
135
  if (
142
136
  isDisabled ||
143
- hasSavedUnsavedInnerBlocks ||
144
137
  isSaving ||
145
- savingLock.current ||
146
138
  ! hasResolvedDraftNavigationMenus ||
147
139
  ! hasResolvedNavigationMenus ||
148
140
  ! hasSelection ||
@@ -151,11 +143,7 @@ export default function UnsavedInnerBlocks( {
151
143
  return;
152
144
  }
153
145
 
154
- savingLock.current = true;
155
- createNavigationMenu( null, blocks ).then( ( menu ) => {
156
- onSave( menu );
157
- savingLock.current = false;
158
- } );
146
+ createNavigationMenu( null, blocks );
159
147
  }, [
160
148
  isDisabled,
161
149
  isSaving,
@@ -170,10 +158,5 @@ export default function UnsavedInnerBlocks( {
170
158
 
171
159
  const Wrapper = isSaving ? Disabled : 'div';
172
160
 
173
- return (
174
- <>
175
- <Wrapper { ...innerBlocksProps } />
176
- { isSaving && <Spinner /> }
177
- </>
178
- );
161
+ return <Wrapper { ...innerBlocksProps } />;
179
162
  }
@@ -261,10 +261,6 @@ $color-control-label-height: 20px;
261
261
  }
262
262
  }
263
263
 
264
- .wp-block-navigation-placeholder .components-spinner {
265
- margin-top: 0;
266
- }
267
-
268
264
  // Unselected state.
269
265
  .wp-block-navigation-placeholder__preview {
270
266
  display: flex;
@@ -544,6 +540,13 @@ body.editor-styles-wrapper
544
540
  color: inherit;
545
541
  }
546
542
 
543
+ .components-heading.wp-block-navigation-off-canvas-editor__title {
544
+ margin: 0;
545
+ }
546
+ .wp-block-navigation-off-canvas-editor__header {
547
+ margin-bottom: $grid-unit-10;
548
+ }
549
+
547
550
  // Customize the mobile editing.
548
551
  // This can be revisited in the future, but for now, inherit design from the parent.
549
552
  .is-menu-open .wp-block-navigation__responsive-container-content * {
@@ -567,6 +570,10 @@ body.editor-styles-wrapper
567
570
  padding: $grid-unit-10 $grid-unit-15;
568
571
  }
569
572
 
573
+ .wp-block-navigation .wp-block-navigation__uncontrolled-inner-blocks-loading-indicator {
574
+ margin-top: 0;
575
+ }
576
+
570
577
  @keyframes fadeouthalf {
571
578
  0% {
572
579
  opacity: 1;
@@ -582,6 +589,13 @@ body.editor-styles-wrapper
582
589
  margin-bottom: $grid-unit-20;
583
590
  }
584
591
 
592
+ // increased specificity to override button variant
593
+ // for the manage menus button in the advanced area
594
+ // of the navigation block
595
+ .components-button.is-link.wp-block-navigation-manage-menus-button {
596
+ margin-bottom: $grid-unit-20;
597
+ }
598
+
585
599
  .wp-block-navigation__overlay-menu-preview {
586
600
  display: flex;
587
601
  align-items: center;
@@ -625,6 +639,17 @@ body.editor-styles-wrapper
625
639
  width: 100%;
626
640
  }
627
641
 
642
+ .wp-block-navigation__navigation-selector-button__icon {
643
+ flex: 0 0 auto;
644
+ }
645
+
646
+ .wp-block-navigation__navigation-selector-button__label {
647
+ flex: 0 1 auto;
648
+ overflow: hidden;
649
+ text-overflow: ellipsis;
650
+ white-space: nowrap;
651
+ }
652
+
628
653
  .wp-block-navigation__navigation-selector-button--createnew {
629
654
  border: 1px solid;
630
655
  margin-bottom: $grid-unit-20;
@@ -359,7 +359,9 @@ button.wp-block-navigation-item__content {
359
359
 
360
360
  // Provide a default padding for submenus who should always have some, regardless of the top level menu items.
361
361
  :where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item a:not(.wp-element-button)),
362
- :where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-submenu a:not(.wp-element-button)) {
362
+ :where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-submenu a:not(.wp-element-button)),
363
+ :where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-submenu button.wp-block-navigation-item__content),
364
+ :where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-pages-list__item button.wp-block-navigation-item__content) {
363
365
  padding: 0.5em 1em;
364
366
  }
365
367
 
@@ -653,6 +655,14 @@ button.wp-block-navigation-item__content {
653
655
  .wp-block-navigation__responsive-container-open {
654
656
  display: flex;
655
657
 
658
+ // When set to collapse into a text button, it should inherit the parent font.
659
+ // This needs specificity to override inherited properties by the button element and component.
660
+ &.wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open {
661
+ font-family: inherit;
662
+ font-weight: inherit;
663
+ font-size: inherit;
664
+ }
665
+
656
666
  &:not(.always-shown) {
657
667
  @include break-small {
658
668
  display: none;
@@ -666,6 +676,14 @@ button.wp-block-navigation-item__content {
666
676
  top: 0;
667
677
  right: 0;
668
678
  z-index: 2; // Needs to be above the modal z index itself.
679
+
680
+ // When set to collapse into a text button, it should inherit the parent font.
681
+ // This needs specificity to override inherited properties by the button element and component.
682
+ &.wp-block-navigation__responsive-container-close.wp-block-navigation__responsive-container-close {
683
+ font-family: inherit;
684
+ font-weight: inherit;
685
+ font-size: inherit;
686
+ }
669
687
  }
670
688
 
671
689
  // The menu adds wrapping containers.
@@ -2,7 +2,8 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { escape, unescape } from 'lodash';
5
+ import escapeHtml from 'escape-html';
6
+ import { unescape } from 'lodash';
6
7
 
7
8
  /**
8
9
  * WordPress dependencies
@@ -262,8 +263,8 @@ export const updateNavigationLinkBlockAttributes = (
262
263
  // - https://github.com/WordPress/gutenberg/pull/41063
263
264
  // - https://github.com/WordPress/gutenberg/pull/18617.
264
265
  const label = useNewLabel
265
- ? escape( newLabel )
266
- : originalLabel || escape( newUrlWithoutHttp );
266
+ ? escapeHtml( newLabel )
267
+ : originalLabel || escapeHtml( newUrlWithoutHttp );
267
268
 
268
269
  // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
269
270
  const type = newType === 'post_tag' ? 'tag' : newType.replace( '-', '_' );
@@ -715,6 +716,14 @@ export default function NavigationLinkEdit( {
715
716
  </BlockControls>
716
717
  <InspectorControls>
717
718
  <PanelBody title={ __( 'Link settings' ) }>
719
+ <TextControl
720
+ value={ url || '' }
721
+ onChange={ ( urlValue ) => {
722
+ setAttributes( { url: urlValue } );
723
+ } }
724
+ label={ __( 'URL' ) }
725
+ autoComplete="off"
726
+ />
718
727
  <TextareaControl
719
728
  value={ description || '' }
720
729
  onChange={ ( descriptionValue ) => {
@@ -846,7 +855,7 @@ export default function NavigationLinkEdit( {
846
855
  ) }
847
856
  { isLinkOpen && (
848
857
  <Popover
849
- position="bottom center"
858
+ placement="bottom"
850
859
  onClose={ () => setIsLinkOpen( false ) }
851
860
  anchor={ popoverAnchor }
852
861
  shift
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Appender
3
+ */
4
+
5
+ .wp-block-navigation .block-list-appender {
6
+ position: relative;
7
+ }
8
+
1
9
  /**
2
10
  * Submenus.
3
11
  */
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { escape, without } from 'lodash';
5
+ import escapeHtml from 'escape-html';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -248,8 +248,8 @@ export const updateNavigationLinkBlockAttributes = (
248
248
  normalizedTitle !== normalizedURL &&
249
249
  originalLabel !== title;
250
250
  const label = escapeTitle
251
- ? escape( title )
252
- : originalLabel || escape( normalizedURL );
251
+ ? escapeHtml( title )
252
+ : originalLabel || escapeHtml( normalizedURL );
253
253
 
254
254
  // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
255
255
  const type = newType === 'post_tag' ? 'tag' : newType.replace( '-', '_' );
@@ -486,7 +486,9 @@ export default function NavigationSubmenuEdit( {
486
486
  const innerBlocksColors = getColors( context, true );
487
487
 
488
488
  const allowedBlocks = isAtMaxNesting
489
- ? without( ALLOWED_BLOCKS, 'core/navigation-submenu' )
489
+ ? ALLOWED_BLOCKS.filter(
490
+ ( blockName ) => blockName !== 'core/navigation-submenu'
491
+ )
490
492
  : ALLOWED_BLOCKS;
491
493
 
492
494
  const innerBlocksProps = useInnerBlocksProps(
@@ -631,7 +633,7 @@ export default function NavigationSubmenuEdit( {
631
633
  }
632
634
  { ! openSubmenusOnClick && isLinkOpen && (
633
635
  <Popover
634
- position="bottom center"
636
+ placement="bottom"
635
637
  onClose={ () => setIsLinkOpen( false ) }
636
638
  anchor={ popoverAnchor }
637
639
  shift
@@ -52,50 +52,64 @@ export default function PageListEdit( { context, clientId } ) {
52
52
  style: { ...context.style?.color },
53
53
  } );
54
54
 
55
- return (
56
- <>
57
- { allowConvertToLinks && (
58
- <BlockControls group="other">
59
- <ToolbarButton title={ __( 'Edit' ) } onClick={ openModal }>
60
- { __( 'Edit' ) }
61
- </ToolbarButton>
62
- </BlockControls>
63
- ) }
64
- { allowConvertToLinks && isOpen && (
65
- <ConvertToLinksModal
66
- onClose={ closeModal }
67
- clientId={ clientId }
68
- />
69
- ) }
70
- { ! hasResolvedPages && (
55
+ const getBlockContent = () => {
56
+ if ( ! hasResolvedPages ) {
57
+ return (
71
58
  <div { ...blockProps }>
72
59
  <Spinner />
73
60
  </div>
74
- ) }
61
+ );
62
+ }
75
63
 
76
- { hasResolvedPages && totalPages === null && (
64
+ if ( totalPages === null ) {
65
+ return (
77
66
  <div { ...blockProps }>
78
67
  <Notice status={ 'warning' } isDismissible={ false }>
79
68
  { __( 'Page List: Cannot retrieve Pages.' ) }
80
69
  </Notice>
81
70
  </div>
82
- ) }
71
+ );
72
+ }
83
73
 
84
- { totalPages === 0 && (
74
+ if ( totalPages === 0 ) {
75
+ return (
85
76
  <div { ...blockProps }>
86
77
  <Notice status={ 'info' } isDismissible={ false }>
87
78
  { __( 'Page List: Cannot retrieve Pages.' ) }
88
79
  </Notice>
89
80
  </div>
90
- ) }
91
- { totalPages > 0 && (
81
+ );
82
+ }
83
+
84
+ if ( totalPages > 0 ) {
85
+ return (
92
86
  <ul { ...blockProps }>
93
87
  <PageItems
94
88
  context={ context }
95
89
  pagesByParentId={ pagesByParentId }
96
90
  />
97
91
  </ul>
92
+ );
93
+ }
94
+ };
95
+
96
+ return (
97
+ <>
98
+ { allowConvertToLinks && (
99
+ <BlockControls group="other">
100
+ <ToolbarButton title={ __( 'Edit' ) } onClick={ openModal }>
101
+ { __( 'Edit' ) }
102
+ </ToolbarButton>
103
+ </BlockControls>
98
104
  ) }
105
+ { allowConvertToLinks && isOpen && (
106
+ <ConvertToLinksModal
107
+ onClose={ closeModal }
108
+ clientId={ clientId }
109
+ />
110
+ ) }
111
+
112
+ { getBlockContent() }
99
113
  </>
100
114
  );
101
115
  }
@@ -13,11 +13,23 @@ import {
13
13
  RichText,
14
14
  useBlockProps,
15
15
  } from '@wordpress/block-editor';
16
- import { PanelBody, SelectControl, ToggleControl } from '@wordpress/components';
16
+ import {
17
+ ComboboxControl,
18
+ PanelBody,
19
+ SelectControl,
20
+ ToggleControl,
21
+ } from '@wordpress/components';
17
22
  import { useSelect, useDispatch } from '@wordpress/data';
18
23
  import { __ } from '@wordpress/i18n';
19
24
  import { store as coreStore } from '@wordpress/core-data';
20
25
 
26
+ const minimumUsersForCombobox = 25;
27
+
28
+ const AUTHORS_QUERY = {
29
+ who: 'authors',
30
+ per_page: 100,
31
+ };
32
+
21
33
  function PostAuthorEdit( {
22
34
  isSelected,
23
35
  context: { postType, postId, queryId },
@@ -38,7 +50,7 @@ function PostAuthorEdit( {
38
50
  return {
39
51
  authorId: _authorId,
40
52
  authorDetails: _authorId ? getUser( _authorId ) : null,
41
- authors: getUsers( { who: 'authors' } ),
53
+ authors: getUsers( AUTHORS_QUERY ),
42
54
  };
43
55
  },
44
56
  [ postType, postId ]
@@ -65,34 +77,46 @@ function PostAuthorEdit( {
65
77
  } ),
66
78
  } );
67
79
 
80
+ const authorOptions = authors?.length
81
+ ? authors.map( ( { id, name } ) => {
82
+ return {
83
+ value: id,
84
+ label: name,
85
+ };
86
+ } )
87
+ : [];
88
+
89
+ const handleSelect = ( nextAuthorId ) => {
90
+ editEntityRecord( 'postType', postType, postId, {
91
+ author: nextAuthorId,
92
+ } );
93
+ };
94
+
95
+ const showCombobox = authorOptions.length >= minimumUsersForCombobox;
96
+
68
97
  return (
69
98
  <>
70
99
  <InspectorControls>
71
100
  <PanelBody title={ __( 'Settings' ) }>
72
101
  { !! postId &&
73
102
  ! isDescendentOfQueryLoop &&
74
- !! authors?.length && (
103
+ authorOptions.length &&
104
+ ( ( showCombobox && (
105
+ <ComboboxControl
106
+ label={ __( 'Author' ) }
107
+ options={ authorOptions }
108
+ value={ authorId }
109
+ onChange={ handleSelect }
110
+ allowReset={ false }
111
+ />
112
+ ) ) || (
75
113
  <SelectControl
76
114
  label={ __( 'Author' ) }
77
115
  value={ authorId }
78
- options={ authors.map( ( { id, name } ) => {
79
- return {
80
- value: id,
81
- label: name,
82
- };
83
- } ) }
84
- onChange={ ( nextAuthorId ) => {
85
- editEntityRecord(
86
- 'postType',
87
- postType,
88
- postId,
89
- {
90
- author: nextAuthorId,
91
- }
92
- );
93
- } }
116
+ options={ authorOptions }
117
+ onChange={ handleSelect }
94
118
  />
95
- ) }
119
+ ) ) }
96
120
  <ToggleControl
97
121
  label={ __( 'Show avatar' ) }
98
122
  checked={ showAvatar }
@@ -22,6 +22,10 @@
22
22
  "text": true
23
23
  }
24
24
  },
25
+ "spacing": {
26
+ "margin": true,
27
+ "padding": true
28
+ },
25
29
  "typography": {
26
30
  "fontSize": true,
27
31
  "lineHeight": true,
@@ -22,6 +22,10 @@
22
22
  "text": true
23
23
  }
24
24
  },
25
+ "spacing": {
26
+ "margin": true,
27
+ "padding": true
28
+ },
25
29
  "typography": {
26
30
  "fontSize": true,
27
31
  "lineHeight": true,
@@ -1,4 +1,7 @@
1
1
  .wp-block-post-comments-form {
2
+ // This block has customizable padding, border-box makes that more predictable.
3
+ box-sizing: border-box;
4
+
2
5
  &[style*="font-weight"] :where(.comment-reply-title) {
3
6
  font-weight: inherit;
4
7
  }
@@ -23,6 +23,10 @@
23
23
  "link": true
24
24
  }
25
25
  },
26
+ "spacing": {
27
+ "margin": true,
28
+ "padding": true
29
+ },
26
30
  "typography": {
27
31
  "fontSize": true,
28
32
  "lineHeight": true,
@@ -11,6 +11,9 @@
11
11
  "align": [ "wide", "full" ],
12
12
  "html": false,
13
13
  "__experimentalLayout": true,
14
+ "dimensions": {
15
+ "minHeight": true
16
+ },
14
17
  "typography": {
15
18
  "fontSize": true,
16
19
  "lineHeight": true,
@@ -84,8 +84,8 @@ function Content( props ) {
84
84
  );
85
85
  }
86
86
 
87
- function Placeholder() {
88
- const blockProps = useBlockProps();
87
+ function Placeholder( { layoutClassNames } ) {
88
+ const blockProps = useBlockProps( { className: layoutClassNames } );
89
89
  return (
90
90
  <div { ...blockProps }>
91
91
  <p>
@@ -118,7 +118,11 @@ function RecursionError() {
118
118
  );
119
119
  }
120
120
 
121
- export default function PostContentEdit( { context, attributes } ) {
121
+ export default function PostContentEdit( {
122
+ context,
123
+ attributes,
124
+ __unstableLayoutClassNames: layoutClassNames,
125
+ } ) {
122
126
  const { postId: contextPostId, postType: contextPostType } = context;
123
127
  const { layout = {} } = attributes;
124
128
  const hasAlreadyRendered = useHasRecursion( contextPostId );
@@ -132,7 +136,7 @@ export default function PostContentEdit( { context, attributes } ) {
132
136
  { contextPostId && contextPostType ? (
133
137
  <Content context={ context } layout={ layout } />
134
138
  ) : (
135
- <Placeholder />
139
+ <Placeholder layoutClassNames={ layoutClassNames } />
136
140
  ) }
137
141
  </RecursionProvider>
138
142
  );
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { get, includes } from 'lodash';
5
+ import { get } from 'lodash';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -140,7 +140,7 @@ const v4 = {
140
140
  className,
141
141
  } = attributes;
142
142
 
143
- const isSolidColorStyle = includes( className, SOLID_COLOR_CLASS );
143
+ const isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );
144
144
 
145
145
  let figureClasses, figureStyles;
146
146
 
@@ -206,7 +206,7 @@ const v4 = {
206
206
  customTextColor,
207
207
  ...attributes
208
208
  } ) {
209
- const isSolidColorStyle = includes( className, SOLID_COLOR_CLASS );
209
+ const isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );
210
210
  let style;
211
211
 
212
212
  if ( customMainColor ) {
@@ -270,7 +270,7 @@ const v3 = {
270
270
  figureStyle,
271
271
  } = attributes;
272
272
 
273
- const isSolidColorStyle = includes( className, SOLID_COLOR_CLASS );
273
+ const isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );
274
274
 
275
275
  let figureClasses, figureStyles;
276
276
 
@@ -345,7 +345,7 @@ const v3 = {
345
345
  customTextColor,
346
346
  ...attributes
347
347
  } ) {
348
- const isSolidColorStyle = includes( className, SOLID_COLOR_CLASS );
348
+ const isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );
349
349
  let style;
350
350
 
351
351
  if ( customMainColor ) {
@@ -416,7 +416,7 @@ const v2 = {
416
416
  citation,
417
417
  className,
418
418
  } = attributes;
419
- const isSolidColorStyle = includes( className, SOLID_COLOR_CLASS );
419
+ const isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );
420
420
 
421
421
  let figureClass, figureStyles;
422
422
  // Is solid color style
@@ -484,7 +484,7 @@ const v2 = {
484
484
  customTextColor,
485
485
  ...attributes
486
486
  } ) {
487
- const isSolidColorStyle = includes( className, SOLID_COLOR_CLASS );
487
+ const isSolidColorStyle = className?.includes( SOLID_COLOR_CLASS );
488
488
  let style = {};
489
489
 
490
490
  if ( customMainColor ) {
@@ -3,7 +3,7 @@
3
3
  }
4
4
 
5
5
  .wp-block-query__create-new-link {
6
- padding: 0 $grid-unit-20 $grid-unit-20 56px;
6
+ padding: 0 $grid-unit-20 $grid-unit-20 52px;
7
7
  }
8
8
 
9
9
  .block-library-query__pattern-selection-content .block-editor-block-patterns-list {
@@ -18,7 +18,7 @@ $pagination-margin: 0.5em;
18
18
  // which is important when it's the only block displayed
19
19
  // and the block has a "space-between" justification.
20
20
  &.is-content-justification-space-between {
21
- > .wp-block-query-pagination-next:last-child {
21
+ > .wp-block-query-pagination-next:last-of-type {
22
22
  margin-inline-start: auto;
23
23
  }
24
24
  > .wp-block-query-pagination-previous:first-child {
@@ -19,15 +19,22 @@ function render_block_core_read_more( $attributes, $content, $block ) {
19
19
  }
20
20
 
21
21
  $post_ID = $block->context['postId'];
22
+ $post_title = get_the_title( $post_ID );
23
+ $screen_reader_text = sprintf(
24
+ /* translators: %s is either the post title or post ID to describe the link for screen readers. */
25
+ __( ': %s' ),
26
+ '' !== $post_title ? $post_title : __( 'untitled post ' ) . $post_ID
27
+ );
22
28
  $justify_class_name = empty( $attributes['justifyContent'] ) ? '' : "is-justified-{$attributes['justifyContent']}";
23
29
  $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $justify_class_name ) );
24
30
  $more_text = ! empty( $attributes['content'] ) ? wp_kses_post( $attributes['content'] ) : __( 'Read more' );
25
31
  return sprintf(
26
- '<a %1s href="%2s" target="%3s">%4s</a>',
32
+ '<a %1s href="%2s" target="%3s">%4s<span class="screen-reader-text">%5s</span></a>',
27
33
  $wrapper_attributes,
28
34
  get_the_permalink( $post_ID ),
29
35
  esc_attr( $attributes['linkTarget'] ),
30
- $more_text
36
+ $more_text,
37
+ $screen_reader_text
31
38
  );
32
39
  }
33
40
 
@@ -363,7 +363,7 @@ export default function SearchEdit( {
363
363
  widthUnit: newUnit,
364
364
  } );
365
365
  } }
366
- style={ { maxWidth: 80 } }
366
+ __unstableInputWidth={ '80px' }
367
367
  value={ `${ width }${ widthUnit }` }
368
368
  units={ units }
369
369
  />