@wordpress/block-library 7.12.0 → 7.12.2-next.d6164808d3.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 (626) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/build/archives/index.js +5 -1
  3. package/build/archives/index.js.map +1 -1
  4. package/build/audio/index.js +4 -0
  5. package/build/audio/index.js.map +1 -1
  6. package/build/button/deprecated.js +14 -5
  7. package/build/button/deprecated.js.map +1 -1
  8. package/build/button/index.js +1 -1
  9. package/build/categories/edit.js +3 -1
  10. package/build/categories/edit.js.map +1 -1
  11. package/build/categories/index.js +14 -1
  12. package/build/categories/index.js.map +1 -1
  13. package/build/code/index.js +4 -2
  14. package/build/code/index.js.map +1 -1
  15. package/build/column/index.js +13 -0
  16. package/build/column/index.js.map +1 -1
  17. package/build/columns/deprecated.js +16 -5
  18. package/build/columns/deprecated.js.map +1 -1
  19. package/build/columns/edit.js +6 -2
  20. package/build/columns/edit.js.map +1 -1
  21. package/build/columns/edit.native.js +6 -2
  22. package/build/columns/edit.native.js.map +1 -1
  23. package/build/columns/index.js +13 -0
  24. package/build/columns/index.js.map +1 -1
  25. package/build/comment-author-name/index.js +5 -1
  26. package/build/comment-author-name/index.js.map +1 -1
  27. package/build/comment-content/index.js +5 -1
  28. package/build/comment-content/index.js.map +1 -1
  29. package/build/comment-date/index.js +1 -0
  30. package/build/comment-date/index.js.map +1 -1
  31. package/build/comment-edit-link/index.js +5 -1
  32. package/build/comment-edit-link/index.js.map +1 -1
  33. package/build/comment-reply-link/index.js +5 -1
  34. package/build/comment-reply-link/index.js.map +1 -1
  35. package/build/comment-template/index.js +14 -1
  36. package/build/comment-template/index.js.map +1 -1
  37. package/build/comments/index.js +13 -0
  38. package/build/comments/index.js.map +1 -1
  39. package/build/comments-pagination/index.js +13 -0
  40. package/build/comments-pagination/index.js.map +1 -1
  41. package/build/comments-pagination-next/index.js +4 -2
  42. package/build/comments-pagination-next/index.js.map +1 -1
  43. package/build/comments-pagination-numbers/edit.js +5 -1
  44. package/build/comments-pagination-numbers/edit.js.map +1 -1
  45. package/build/comments-pagination-numbers/index.js +14 -1
  46. package/build/comments-pagination-numbers/index.js.map +1 -1
  47. package/build/comments-pagination-previous/index.js +4 -2
  48. package/build/comments-pagination-previous/index.js.map +1 -1
  49. package/build/comments-title/deprecated.js +4 -2
  50. package/build/comments-title/deprecated.js.map +1 -1
  51. package/build/comments-title/index.js +4 -2
  52. package/build/comments-title/index.js.map +1 -1
  53. package/build/cover/deprecated.js +20 -5
  54. package/build/cover/deprecated.js.map +1 -1
  55. package/build/cover/index.js +13 -0
  56. package/build/cover/index.js.map +1 -1
  57. package/build/cover/shared.js +1 -1
  58. package/build/cover/shared.js.map +1 -1
  59. package/build/embed/icons.js +1 -1
  60. package/build/embed/icons.js.map +1 -1
  61. package/build/gallery/deprecated.js +6 -1
  62. package/build/gallery/deprecated.js.map +1 -1
  63. package/build/gallery/edit.js +15 -2
  64. package/build/gallery/edit.js.map +1 -1
  65. package/build/gallery/index.js +5 -0
  66. package/build/gallery/index.js.map +1 -1
  67. package/build/gallery/transforms.js +20 -7
  68. package/build/gallery/transforms.js.map +1 -1
  69. package/build/gallery/utils.js +7 -6
  70. package/build/gallery/utils.js.map +1 -1
  71. package/build/group/deprecated.js +108 -12
  72. package/build/group/deprecated.js.map +1 -1
  73. package/build/group/edit.js +23 -1
  74. package/build/group/edit.js.map +1 -1
  75. package/build/group/index.js +10 -2
  76. package/build/group/index.js.map +1 -1
  77. package/build/group/variations.js +8 -8
  78. package/build/group/variations.js.map +1 -1
  79. package/build/heading/deprecated.js +5 -3
  80. package/build/heading/deprecated.js.map +1 -1
  81. package/build/heading/index.js +3 -1
  82. package/build/heading/index.js.map +1 -1
  83. package/build/heading/transforms.js +3 -1
  84. package/build/heading/transforms.js.map +1 -1
  85. package/build/home-link/edit.js +8 -4
  86. package/build/home-link/edit.js.map +1 -1
  87. package/build/image/edit.js +13 -1
  88. package/build/image/edit.js.map +1 -1
  89. package/build/image/index.js +13 -7
  90. package/build/image/index.js.map +1 -1
  91. package/build/index.native.js +6 -3
  92. package/build/index.native.js.map +1 -1
  93. package/build/list-item/edit.js +3 -1
  94. package/build/list-item/edit.js.map +1 -1
  95. package/build/list-item/hooks/index.js +8 -0
  96. package/build/list-item/hooks/index.js.map +1 -1
  97. package/build/list-item/hooks/use-copy.js +42 -0
  98. package/build/list-item/hooks/use-copy.js.map +1 -0
  99. package/build/list-item/list-style-type.native.js +4 -1
  100. package/build/list-item/list-style-type.native.js.map +1 -1
  101. package/build/media-text/deprecated.js +5 -1
  102. package/build/media-text/deprecated.js.map +1 -1
  103. package/build/media-text/index.js +13 -0
  104. package/build/media-text/index.js.map +1 -1
  105. package/build/navigation/deprecated.js +6 -1
  106. package/build/navigation/deprecated.js.map +1 -1
  107. package/build/navigation/edit/index.js +119 -38
  108. package/build/navigation/edit/index.js.map +1 -1
  109. package/build/navigation/edit/unsaved-inner-blocks.js +2 -1
  110. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  111. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -7
  112. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  113. package/build/navigation/menu-items-to-blocks.js +1 -7
  114. package/build/navigation/menu-items-to-blocks.js.map +1 -1
  115. package/build/navigation/use-navigation-menu.js +8 -7
  116. package/build/navigation/use-navigation-menu.js.map +1 -1
  117. package/build/navigation-link/edit.js +6 -8
  118. package/build/navigation-link/edit.js.map +1 -1
  119. package/build/navigation-submenu/edit.js +4 -6
  120. package/build/navigation-submenu/edit.js.map +1 -1
  121. package/build/page-list/edit.js +7 -3
  122. package/build/page-list/edit.js.map +1 -1
  123. package/build/paragraph/deprecated.js +18 -10
  124. package/build/paragraph/deprecated.js.map +1 -1
  125. package/build/paragraph/edit.js +1 -0
  126. package/build/paragraph/edit.js.map +1 -1
  127. package/build/paragraph/index.js +5 -0
  128. package/build/paragraph/index.js.map +1 -1
  129. package/build/paragraph/transforms.js +5 -0
  130. package/build/paragraph/transforms.js.map +1 -1
  131. package/build/post-author/index.js +4 -2
  132. package/build/post-author/index.js.map +1 -1
  133. package/build/post-author-biography/index.js +1 -0
  134. package/build/post-author-biography/index.js.map +1 -1
  135. package/build/post-author-name/index.js +5 -1
  136. package/build/post-author-name/index.js.map +1 -1
  137. package/build/post-comments-count/edit.js +11 -1
  138. package/build/post-comments-count/edit.js.map +1 -1
  139. package/build/post-comments-count/index.js +4 -1
  140. package/build/post-comments-count/index.js.map +1 -1
  141. package/build/post-comments-link/index.js +4 -2
  142. package/build/post-comments-link/index.js.map +1 -1
  143. package/build/post-date/edit.js +9 -2
  144. package/build/post-date/edit.js.map +1 -1
  145. package/build/post-date/index.js +9 -0
  146. package/build/post-date/index.js.map +1 -1
  147. package/build/post-featured-image/edit.js +27 -12
  148. package/build/post-featured-image/edit.js.map +1 -1
  149. package/build/post-featured-image/index.js +12 -0
  150. package/build/post-featured-image/index.js.map +1 -1
  151. package/build/post-navigation-link/index.js +3 -2
  152. package/build/post-navigation-link/index.js.map +1 -1
  153. package/build/post-template/edit.js +8 -4
  154. package/build/post-template/edit.js.map +1 -1
  155. package/build/post-template/index.js +14 -1
  156. package/build/post-template/index.js.map +1 -1
  157. package/build/post-terms/index.js +5 -3
  158. package/build/post-terms/index.js.map +1 -1
  159. package/build/post-title/index.js +2 -1
  160. package/build/post-title/index.js.map +1 -1
  161. package/build/preformatted/index.js +4 -2
  162. package/build/preformatted/index.js.map +1 -1
  163. package/build/pullquote/deprecated.js +135 -25
  164. package/build/pullquote/deprecated.js.map +1 -1
  165. package/build/pullquote/edit.js +1 -1
  166. package/build/pullquote/edit.js.map +1 -1
  167. package/build/pullquote/edit.native.js +0 -1
  168. package/build/pullquote/edit.native.js.map +1 -1
  169. package/build/pullquote/index.js +13 -6
  170. package/build/pullquote/index.js.map +1 -1
  171. package/build/pullquote/save.js +2 -2
  172. package/build/pullquote/save.js.map +1 -1
  173. package/build/pullquote/transforms.js +14 -33
  174. package/build/pullquote/transforms.js.map +1 -1
  175. package/build/query/deprecated.js +10 -9
  176. package/build/query/deprecated.js.map +1 -1
  177. package/build/query/edit/index.js +19 -8
  178. package/build/query/edit/index.js.map +1 -1
  179. package/build/query/edit/inspector-controls/taxonomy-controls.js +1 -0
  180. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  181. package/build/query/edit/query-placeholder.js +6 -1
  182. package/build/query/edit/query-placeholder.js.map +1 -1
  183. package/build/query/utils.js +35 -9
  184. package/build/query/utils.js.map +1 -1
  185. package/build/query-no-results/edit.js +1 -1
  186. package/build/query-no-results/edit.js.map +1 -1
  187. package/build/query-title/edit.js +10 -1
  188. package/build/query-title/edit.js.map +1 -1
  189. package/build/query-title/index.js +7 -2
  190. package/build/query-title/index.js.map +1 -1
  191. package/build/quote/deprecated.js +13 -6
  192. package/build/quote/deprecated.js.map +1 -1
  193. package/build/quote/transforms.js +22 -37
  194. package/build/quote/transforms.js.map +1 -1
  195. package/build/separator/deprecated.js +3 -4
  196. package/build/separator/deprecated.js.map +1 -1
  197. package/build/separator/index.js +1 -0
  198. package/build/separator/index.js.map +1 -1
  199. package/build/social-link/icons/reddit.js +1 -1
  200. package/build/social-link/icons/reddit.js.map +1 -1
  201. package/build/social-links/edit.js +2 -1
  202. package/build/social-links/edit.js.map +1 -1
  203. package/build/spacer/index.js +7 -1
  204. package/build/spacer/index.js.map +1 -1
  205. package/build/table/index.js +4 -0
  206. package/build/table/index.js.map +1 -1
  207. package/build/table/state.js +9 -3
  208. package/build/table/state.js.map +1 -1
  209. package/build/table-of-contents/index.js +11 -1
  210. package/build/table-of-contents/index.js.map +1 -1
  211. package/build/tag-cloud/index.js +5 -1
  212. package/build/tag-cloud/index.js.map +1 -1
  213. package/build/template-part/index.js +2 -2
  214. package/build/template-part/index.js.map +1 -1
  215. package/build/term-description/index.js +4 -0
  216. package/build/term-description/index.js.map +1 -1
  217. package/build/text-columns/edit.js +3 -1
  218. package/build/text-columns/edit.js.map +1 -1
  219. package/build/text-columns/save.js +3 -1
  220. package/build/text-columns/save.js.map +1 -1
  221. package/build/verse/index.js +1 -0
  222. package/build/verse/index.js.map +1 -1
  223. package/build/video/index.js +4 -0
  224. package/build/video/index.js.map +1 -1
  225. package/build-module/archives/index.js +5 -1
  226. package/build-module/archives/index.js.map +1 -1
  227. package/build-module/audio/index.js +4 -0
  228. package/build-module/audio/index.js.map +1 -1
  229. package/build-module/button/deprecated.js +14 -4
  230. package/build-module/button/deprecated.js.map +1 -1
  231. package/build-module/button/index.js +1 -1
  232. package/build-module/categories/edit.js +4 -2
  233. package/build-module/categories/edit.js.map +1 -1
  234. package/build-module/categories/index.js +14 -1
  235. package/build-module/categories/index.js.map +1 -1
  236. package/build-module/code/index.js +4 -2
  237. package/build-module/code/index.js.map +1 -1
  238. package/build-module/column/index.js +13 -0
  239. package/build-module/column/index.js.map +1 -1
  240. package/build-module/columns/deprecated.js +16 -4
  241. package/build-module/columns/deprecated.js.map +1 -1
  242. package/build-module/columns/edit.js +7 -3
  243. package/build-module/columns/edit.js.map +1 -1
  244. package/build-module/columns/edit.native.js +7 -3
  245. package/build-module/columns/edit.native.js.map +1 -1
  246. package/build-module/columns/index.js +13 -0
  247. package/build-module/columns/index.js.map +1 -1
  248. package/build-module/comment-author-name/index.js +5 -1
  249. package/build-module/comment-author-name/index.js.map +1 -1
  250. package/build-module/comment-content/index.js +5 -1
  251. package/build-module/comment-content/index.js.map +1 -1
  252. package/build-module/comment-date/index.js +1 -0
  253. package/build-module/comment-date/index.js.map +1 -1
  254. package/build-module/comment-edit-link/index.js +5 -1
  255. package/build-module/comment-edit-link/index.js.map +1 -1
  256. package/build-module/comment-reply-link/index.js +5 -1
  257. package/build-module/comment-reply-link/index.js.map +1 -1
  258. package/build-module/comment-template/index.js +14 -1
  259. package/build-module/comment-template/index.js.map +1 -1
  260. package/build-module/comments/index.js +13 -0
  261. package/build-module/comments/index.js.map +1 -1
  262. package/build-module/comments-pagination/index.js +13 -0
  263. package/build-module/comments-pagination/index.js.map +1 -1
  264. package/build-module/comments-pagination-next/index.js +4 -2
  265. package/build-module/comments-pagination-next/index.js.map +1 -1
  266. package/build-module/comments-pagination-numbers/edit.js +5 -1
  267. package/build-module/comments-pagination-numbers/edit.js.map +1 -1
  268. package/build-module/comments-pagination-numbers/index.js +14 -1
  269. package/build-module/comments-pagination-numbers/index.js.map +1 -1
  270. package/build-module/comments-pagination-previous/index.js +4 -2
  271. package/build-module/comments-pagination-previous/index.js.map +1 -1
  272. package/build-module/comments-title/deprecated.js +4 -2
  273. package/build-module/comments-title/deprecated.js.map +1 -1
  274. package/build-module/comments-title/index.js +4 -2
  275. package/build-module/comments-title/index.js.map +1 -1
  276. package/build-module/cover/deprecated.js +20 -4
  277. package/build-module/cover/deprecated.js.map +1 -1
  278. package/build-module/cover/index.js +13 -0
  279. package/build-module/cover/index.js.map +1 -1
  280. package/build-module/cover/shared.js +1 -1
  281. package/build-module/cover/shared.js.map +1 -1
  282. package/build-module/embed/icons.js +1 -1
  283. package/build-module/embed/icons.js.map +1 -1
  284. package/build-module/gallery/deprecated.js +7 -2
  285. package/build-module/gallery/deprecated.js.map +1 -1
  286. package/build-module/gallery/edit.js +15 -2
  287. package/build-module/gallery/edit.js.map +1 -1
  288. package/build-module/gallery/index.js +5 -0
  289. package/build-module/gallery/index.js.map +1 -1
  290. package/build-module/gallery/transforms.js +20 -7
  291. package/build-module/gallery/transforms.js.map +1 -1
  292. package/build-module/gallery/utils.js +7 -6
  293. package/build-module/gallery/utils.js.map +1 -1
  294. package/build-module/group/deprecated.js +109 -12
  295. package/build-module/group/deprecated.js.map +1 -1
  296. package/build-module/group/edit.js +25 -2
  297. package/build-module/group/edit.js.map +1 -1
  298. package/build-module/group/index.js +10 -2
  299. package/build-module/group/index.js.map +1 -1
  300. package/build-module/group/variations.js +8 -8
  301. package/build-module/group/variations.js.map +1 -1
  302. package/build-module/heading/deprecated.js +5 -2
  303. package/build-module/heading/deprecated.js.map +1 -1
  304. package/build-module/heading/index.js +3 -1
  305. package/build-module/heading/index.js.map +1 -1
  306. package/build-module/heading/transforms.js +3 -1
  307. package/build-module/heading/transforms.js.map +1 -1
  308. package/build-module/home-link/edit.js +10 -6
  309. package/build-module/home-link/edit.js.map +1 -1
  310. package/build-module/image/edit.js +14 -2
  311. package/build-module/image/edit.js.map +1 -1
  312. package/build-module/image/index.js +13 -7
  313. package/build-module/image/index.js.map +1 -1
  314. package/build-module/index.native.js +6 -2
  315. package/build-module/index.native.js.map +1 -1
  316. package/build-module/list-item/edit.js +4 -2
  317. package/build-module/list-item/edit.js.map +1 -1
  318. package/build-module/list-item/hooks/index.js +1 -0
  319. package/build-module/list-item/hooks/index.js.map +1 -1
  320. package/build-module/list-item/hooks/use-copy.js +32 -0
  321. package/build-module/list-item/hooks/use-copy.js.map +1 -0
  322. package/build-module/list-item/list-style-type.native.js +3 -1
  323. package/build-module/list-item/list-style-type.native.js.map +1 -1
  324. package/build-module/media-text/deprecated.js +6 -2
  325. package/build-module/media-text/deprecated.js.map +1 -1
  326. package/build-module/media-text/index.js +13 -0
  327. package/build-module/media-text/index.js.map +1 -1
  328. package/build-module/navigation/deprecated.js +7 -2
  329. package/build-module/navigation/deprecated.js.map +1 -1
  330. package/build-module/navigation/edit/index.js +120 -40
  331. package/build-module/navigation/edit/index.js.map +1 -1
  332. package/build-module/navigation/edit/unsaved-inner-blocks.js +2 -1
  333. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  334. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -7
  335. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  336. package/build-module/navigation/menu-items-to-blocks.js +1 -6
  337. package/build-module/navigation/menu-items-to-blocks.js.map +1 -1
  338. package/build-module/navigation/use-navigation-menu.js +8 -7
  339. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  340. package/build-module/navigation-link/edit.js +7 -9
  341. package/build-module/navigation-link/edit.js.map +1 -1
  342. package/build-module/navigation-submenu/edit.js +5 -7
  343. package/build-module/navigation-submenu/edit.js.map +1 -1
  344. package/build-module/page-list/edit.js +7 -2
  345. package/build-module/page-list/edit.js.map +1 -1
  346. package/build-module/paragraph/deprecated.js +18 -9
  347. package/build-module/paragraph/deprecated.js.map +1 -1
  348. package/build-module/paragraph/edit.js +1 -0
  349. package/build-module/paragraph/edit.js.map +1 -1
  350. package/build-module/paragraph/index.js +5 -0
  351. package/build-module/paragraph/index.js.map +1 -1
  352. package/build-module/paragraph/transforms.js +5 -0
  353. package/build-module/paragraph/transforms.js.map +1 -1
  354. package/build-module/post-author/index.js +4 -2
  355. package/build-module/post-author/index.js.map +1 -1
  356. package/build-module/post-author-biography/index.js +1 -0
  357. package/build-module/post-author-biography/index.js.map +1 -1
  358. package/build-module/post-author-name/index.js +5 -1
  359. package/build-module/post-author-name/index.js.map +1 -1
  360. package/build-module/post-comments-count/edit.js +10 -1
  361. package/build-module/post-comments-count/edit.js.map +1 -1
  362. package/build-module/post-comments-count/index.js +4 -1
  363. package/build-module/post-comments-count/index.js.map +1 -1
  364. package/build-module/post-comments-link/index.js +4 -2
  365. package/build-module/post-comments-link/index.js.map +1 -1
  366. package/build-module/post-date/edit.js +9 -2
  367. package/build-module/post-date/edit.js.map +1 -1
  368. package/build-module/post-date/index.js +9 -0
  369. package/build-module/post-date/index.js.map +1 -1
  370. package/build-module/post-featured-image/edit.js +28 -13
  371. package/build-module/post-featured-image/edit.js.map +1 -1
  372. package/build-module/post-featured-image/index.js +12 -0
  373. package/build-module/post-featured-image/index.js.map +1 -1
  374. package/build-module/post-navigation-link/index.js +3 -2
  375. package/build-module/post-navigation-link/index.js.map +1 -1
  376. package/build-module/post-template/edit.js +8 -4
  377. package/build-module/post-template/edit.js.map +1 -1
  378. package/build-module/post-template/index.js +14 -1
  379. package/build-module/post-template/index.js.map +1 -1
  380. package/build-module/post-terms/index.js +5 -3
  381. package/build-module/post-terms/index.js.map +1 -1
  382. package/build-module/post-title/index.js +2 -1
  383. package/build-module/post-title/index.js.map +1 -1
  384. package/build-module/preformatted/index.js +4 -2
  385. package/build-module/preformatted/index.js.map +1 -1
  386. package/build-module/pullquote/deprecated.js +134 -25
  387. package/build-module/pullquote/deprecated.js.map +1 -1
  388. package/build-module/pullquote/edit.js +1 -1
  389. package/build-module/pullquote/edit.js.map +1 -1
  390. package/build-module/pullquote/edit.native.js +0 -1
  391. package/build-module/pullquote/edit.native.js.map +1 -1
  392. package/build-module/pullquote/index.js +13 -6
  393. package/build-module/pullquote/index.js.map +1 -1
  394. package/build-module/pullquote/save.js +2 -2
  395. package/build-module/pullquote/save.js.map +1 -1
  396. package/build-module/pullquote/transforms.js +15 -34
  397. package/build-module/pullquote/transforms.js.map +1 -1
  398. package/build-module/query/deprecated.js +10 -8
  399. package/build-module/query/deprecated.js.map +1 -1
  400. package/build-module/query/edit/index.js +23 -12
  401. package/build-module/query/edit/index.js.map +1 -1
  402. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +1 -0
  403. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  404. package/build-module/query/edit/query-placeholder.js +6 -1
  405. package/build-module/query/edit/query-placeholder.js.map +1 -1
  406. package/build-module/query/utils.js +32 -7
  407. package/build-module/query/utils.js.map +1 -1
  408. package/build-module/query-no-results/edit.js +1 -1
  409. package/build-module/query-no-results/edit.js.map +1 -1
  410. package/build-module/query-title/edit.js +10 -1
  411. package/build-module/query-title/edit.js.map +1 -1
  412. package/build-module/query-title/index.js +7 -2
  413. package/build-module/query-title/index.js.map +1 -1
  414. package/build-module/quote/deprecated.js +13 -5
  415. package/build-module/quote/deprecated.js.map +1 -1
  416. package/build-module/quote/transforms.js +23 -38
  417. package/build-module/quote/transforms.js.map +1 -1
  418. package/build-module/separator/deprecated.js +3 -3
  419. package/build-module/separator/deprecated.js.map +1 -1
  420. package/build-module/separator/index.js +1 -0
  421. package/build-module/separator/index.js.map +1 -1
  422. package/build-module/social-link/icons/reddit.js +1 -1
  423. package/build-module/social-link/icons/reddit.js.map +1 -1
  424. package/build-module/social-links/edit.js +2 -1
  425. package/build-module/social-links/edit.js.map +1 -1
  426. package/build-module/spacer/index.js +7 -1
  427. package/build-module/spacer/index.js.map +1 -1
  428. package/build-module/table/index.js +4 -0
  429. package/build-module/table/index.js.map +1 -1
  430. package/build-module/table/state.js +10 -4
  431. package/build-module/table/state.js.map +1 -1
  432. package/build-module/table-of-contents/index.js +11 -1
  433. package/build-module/table-of-contents/index.js.map +1 -1
  434. package/build-module/tag-cloud/index.js +5 -1
  435. package/build-module/tag-cloud/index.js.map +1 -1
  436. package/build-module/template-part/index.js +2 -2
  437. package/build-module/template-part/index.js.map +1 -1
  438. package/build-module/term-description/index.js +4 -0
  439. package/build-module/term-description/index.js.map +1 -1
  440. package/build-module/text-columns/edit.js +4 -2
  441. package/build-module/text-columns/edit.js.map +1 -1
  442. package/build-module/text-columns/save.js +4 -2
  443. package/build-module/text-columns/save.js.map +1 -1
  444. package/build-module/verse/index.js +1 -0
  445. package/build-module/verse/index.js.map +1 -1
  446. package/build-module/video/index.js +4 -0
  447. package/build-module/video/index.js.map +1 -1
  448. package/build-style/audio/style-rtl.css +3 -0
  449. package/build-style/audio/style.css +3 -0
  450. package/build-style/button/style-rtl.css +6 -6
  451. package/build-style/button/style.css +6 -6
  452. package/build-style/editor-rtl.css +105 -122
  453. package/build-style/editor.css +105 -122
  454. package/build-style/group/editor-rtl.css +27 -8
  455. package/build-style/group/editor.css +27 -8
  456. package/build-style/image/editor-rtl.css +21 -2
  457. package/build-style/image/editor.css +21 -2
  458. package/build-style/navigation/editor-rtl.css +8 -4
  459. package/build-style/navigation/editor.css +8 -4
  460. package/build-style/navigation/style-rtl.css +2 -2
  461. package/build-style/navigation/style.css +2 -2
  462. package/build-style/paragraph/editor-rtl.css +1 -1
  463. package/build-style/paragraph/editor.css +1 -1
  464. package/build-style/post-date/style-rtl.css +79 -0
  465. package/build-style/post-date/style.css +79 -0
  466. package/build-style/post-featured-image/editor-rtl.css +45 -43
  467. package/build-style/post-featured-image/editor.css +45 -43
  468. package/build-style/post-featured-image/style-rtl.css +1 -0
  469. package/build-style/post-featured-image/style.css +1 -0
  470. package/build-style/post-title/style-rtl.css +1 -0
  471. package/build-style/post-title/style.css +1 -0
  472. package/build-style/pullquote/editor-rtl.css +0 -12
  473. package/build-style/pullquote/editor.css +0 -12
  474. package/build-style/pullquote/style-rtl.css +1 -8
  475. package/build-style/pullquote/style.css +1 -8
  476. package/build-style/query-title/style-rtl.css +79 -0
  477. package/build-style/query-title/style.css +79 -0
  478. package/build-style/site-logo/editor-rtl.css +3 -52
  479. package/build-style/site-logo/editor.css +3 -52
  480. package/build-style/social-links/style-rtl.css +2 -2
  481. package/build-style/social-links/style.css +2 -2
  482. package/build-style/style-rtl.css +27 -18
  483. package/build-style/style.css +27 -18
  484. package/build-style/video/style-rtl.css +3 -0
  485. package/build-style/video/style.css +3 -0
  486. package/package.json +30 -29
  487. package/src/archives/block.json +5 -1
  488. package/src/audio/block.json +4 -0
  489. package/src/audio/style.scss +2 -0
  490. package/src/button/block.json +1 -1
  491. package/src/button/deprecated.js +21 -22
  492. package/src/button/style.scss +6 -6
  493. package/src/calendar/index.php +2 -2
  494. package/src/categories/block.json +14 -1
  495. package/src/categories/edit.js +2 -2
  496. package/src/code/block.json +4 -2
  497. package/src/column/block.json +13 -0
  498. package/src/columns/block.json +13 -0
  499. package/src/columns/deprecated.js +10 -4
  500. package/src/columns/edit.js +7 -3
  501. package/src/columns/edit.native.js +7 -3
  502. package/src/comment-author-name/block.json +5 -1
  503. package/src/comment-content/block.json +5 -1
  504. package/src/comment-date/block.json +1 -0
  505. package/src/comment-edit-link/block.json +5 -1
  506. package/src/comment-reply-link/block.json +5 -1
  507. package/src/comment-template/block.json +14 -1
  508. package/src/comments/block.json +13 -0
  509. package/src/comments/index.php +6 -5
  510. package/src/comments-pagination/block.json +13 -0
  511. package/src/comments-pagination-next/block.json +4 -2
  512. package/src/comments-pagination-numbers/block.json +14 -1
  513. package/src/comments-pagination-numbers/edit.js +12 -3
  514. package/src/comments-pagination-previous/block.json +4 -2
  515. package/src/comments-title/block.json +4 -2
  516. package/src/cover/block.json +13 -0
  517. package/src/cover/deprecated.js +11 -4
  518. package/src/cover/shared.js +2 -1
  519. package/src/embed/icons.js +1 -1
  520. package/src/gallery/block.json +5 -0
  521. package/src/gallery/deprecated.js +4 -2
  522. package/src/gallery/edit.js +22 -2
  523. package/src/gallery/transforms.js +18 -5
  524. package/src/gallery/utils.js +11 -7
  525. package/src/group/block.json +10 -2
  526. package/src/group/deprecated.js +89 -2
  527. package/src/group/edit.js +15 -2
  528. package/src/group/editor.scss +28 -3
  529. package/src/group/variations.js +4 -3
  530. package/src/heading/block.json +3 -1
  531. package/src/heading/deprecated.js +4 -2
  532. package/src/home-link/edit.js +19 -20
  533. package/src/image/block.json +13 -7
  534. package/src/image/edit.js +19 -1
  535. package/src/image/editor.scss +39 -3
  536. package/src/image/index.php +1 -1
  537. package/src/index.native.js +15 -10
  538. package/src/list-item/edit.js +2 -1
  539. package/src/list-item/hooks/index.js +1 -0
  540. package/src/list-item/hooks/use-copy.js +36 -0
  541. package/src/list-item/list-style-type.native.js +8 -1
  542. package/src/list-item/style.native.scss +4 -0
  543. package/src/media-text/block.json +13 -0
  544. package/src/media-text/deprecated.js +3 -2
  545. package/src/navigation/deprecated.js +4 -2
  546. package/src/navigation/edit/index.js +159 -81
  547. package/src/navigation/edit/unsaved-inner-blocks.js +3 -1
  548. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +31 -37
  549. package/src/navigation/editor.scss +3 -2
  550. package/src/navigation/index.php +11 -16
  551. package/src/navigation/menu-items-to-blocks.js +3 -6
  552. package/src/navigation/style.scss +3 -2
  553. package/src/navigation/use-navigation-menu.js +11 -8
  554. package/src/navigation-link/edit.js +9 -13
  555. package/src/navigation-submenu/edit.js +9 -13
  556. package/src/page-list/edit.js +6 -2
  557. package/src/paragraph/block.json +5 -0
  558. package/src/paragraph/deprecated.js +33 -35
  559. package/src/paragraph/edit.js +1 -0
  560. package/src/paragraph/editor.scss +5 -3
  561. package/src/post-author/block.json +4 -2
  562. package/src/post-author-biography/block.json +1 -0
  563. package/src/post-author-name/block.json +5 -1
  564. package/src/post-comments-count/block.json +4 -1
  565. package/src/post-comments-count/edit.js +10 -2
  566. package/src/post-comments-link/block.json +4 -2
  567. package/src/post-date/block.json +9 -0
  568. package/src/post-date/edit.js +12 -2
  569. package/src/post-date/index.php +10 -2
  570. package/src/post-date/style.scss +4 -0
  571. package/src/post-featured-image/block.json +12 -0
  572. package/src/post-featured-image/edit.js +43 -13
  573. package/src/post-featured-image/editor.scss +44 -53
  574. package/src/post-featured-image/index.php +61 -4
  575. package/src/post-featured-image/style.scss +1 -0
  576. package/src/post-navigation-link/block.json +3 -2
  577. package/src/post-template/block.json +15 -1
  578. package/src/post-template/edit.js +6 -1
  579. package/src/post-template/index.php +7 -4
  580. package/src/post-terms/block.json +5 -3
  581. package/src/post-title/block.json +2 -1
  582. package/src/post-title/style.scss +2 -0
  583. package/src/preformatted/block.json +4 -2
  584. package/src/pullquote/block.json +11 -4
  585. package/src/pullquote/deprecated.js +490 -412
  586. package/src/pullquote/edit.js +1 -1
  587. package/src/pullquote/edit.native.js +0 -1
  588. package/src/pullquote/editor.scss +0 -16
  589. package/src/pullquote/index.js +1 -3
  590. package/src/pullquote/save.js +1 -1
  591. package/src/pullquote/style.scss +0 -11
  592. package/src/pullquote/transforms.js +17 -33
  593. package/src/query/deprecated.js +4 -9
  594. package/src/query/edit/index.js +28 -15
  595. package/src/query/edit/inspector-controls/taxonomy-controls.js +1 -1
  596. package/src/query/edit/query-placeholder.js +17 -2
  597. package/src/query/utils.js +29 -7
  598. package/src/query-no-results/edit.js +1 -1
  599. package/src/query-title/block.json +7 -2
  600. package/src/query-title/edit.js +19 -2
  601. package/src/query-title/index.php +11 -1
  602. package/src/query-title/style.scss +4 -0
  603. package/src/quote/deprecated.js +6 -5
  604. package/src/quote/transforms.js +4 -18
  605. package/src/search/index.php +1 -1
  606. package/src/separator/block.json +1 -0
  607. package/src/separator/deprecated.js +2 -3
  608. package/src/site-logo/editor.scss +8 -66
  609. package/src/social-link/icons/reddit.js +1 -1
  610. package/src/social-link/index.php +1 -1
  611. package/src/social-link/socials-with-bg.scss +1 -1
  612. package/src/social-link/socials-without-bg.scss +1 -1
  613. package/src/social-links/edit.js +1 -0
  614. package/src/spacer/block.json +7 -1
  615. package/src/style.scss +2 -0
  616. package/src/table/block.json +4 -0
  617. package/src/table/state.js +21 -19
  618. package/src/table-of-contents/block.json +11 -1
  619. package/src/tag-cloud/block.json +5 -1
  620. package/src/template-part/index.js +3 -2
  621. package/src/term-description/block.json +4 -0
  622. package/src/text-columns/edit.js +2 -2
  623. package/src/text-columns/save.js +2 -2
  624. package/src/verse/block.json +1 -0
  625. package/src/video/block.json +4 -0
  626. package/src/video/style.scss +2 -0
@@ -200,9 +200,9 @@ $color-control-label-height: 20px;
200
200
 
201
201
  // Override inner padding on default appender.
202
202
  // This should be a temporary fix, to be replaced by improvements to
203
- // the sibling inserter.
203
+ // the sibling inserter. Or by the dropdown appender that is used in Group, instead of the "Button block appender".
204
204
  // See https://github.com/WordPress/gutenberg/issues/37572.
205
- .wp-block-navigation .block-editor-button-block-appender {
205
+ .wp-block-navigation .wp-block + .block-list-appender .block-editor-button-block-appender {
206
206
  background-color: $gray-900;
207
207
  color: $white;
208
208
 
@@ -520,6 +520,7 @@ body.editor-styles-wrapper
520
520
  // so focus is applied naturally on the block container.
521
521
  // It's important the right container has focus, otherwise you can't press
522
522
  // "Delete" to remove the block.
523
+ .wp-block-navigation__responsive-container,
523
524
  .wp-block-navigation__responsive-close {
524
525
  @include break-small() {
525
526
  pointer-events: none;
@@ -250,29 +250,24 @@ function block_core_navigation_render_submenu_icon() {
250
250
 
251
251
 
252
252
  /**
253
- * Finds the first non-empty `wp_navigation` Post.
253
+ * Finds the most recently published `wp_navigation` Post.
254
254
  *
255
255
  * @return WP_Post|null the first non-empty Navigation or null.
256
256
  */
257
- function block_core_navigation_get_first_non_empty_navigation() {
258
- // Order and orderby args set to mirror those in `wp_get_nav_menus`
259
- // see:
260
- // - https://github.com/WordPress/wordpress-develop/blob/ba943e113d3b31b121f77a2d30aebe14b047c69d/src/wp-includes/nav-menu.php#L613-L619.
261
- // - https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters.
257
+ function block_core_navigation_get_most_recently_published_navigation() {
258
+ // We default to the most recently created menu.
262
259
  $parsed_args = array(
263
260
  'post_type' => 'wp_navigation',
264
261
  'no_found_rows' => true,
265
- 'order' => 'ASC',
266
- 'orderby' => 'name',
262
+ 'order' => 'DESC',
263
+ 'orderby' => 'date',
267
264
  'post_status' => 'publish',
268
- 'posts_per_page' => 20, // Try the first 20 posts.
265
+ 'posts_per_page' => 1, // get only the most recent.
269
266
  );
270
267
 
271
- $navigation_posts = new WP_Query( $parsed_args );
272
- foreach ( $navigation_posts->posts as $navigation_post ) {
273
- if ( has_blocks( $navigation_post ) ) {
274
- return $navigation_post;
275
- }
268
+ $navigation_post = new WP_Query( $parsed_args );
269
+ if ( count( $navigation_post->posts ) > 0 ) {
270
+ return $navigation_post->posts[0];
276
271
  }
277
272
 
278
273
  return null;
@@ -325,7 +320,7 @@ function block_core_navigation_get_fallback_blocks() {
325
320
 
326
321
  // Default to a list of Pages.
327
322
 
328
- $navigation_post = block_core_navigation_get_first_non_empty_navigation();
323
+ $navigation_post = block_core_navigation_get_most_recently_published_navigation();
329
324
 
330
325
  // Prefer using the first non-empty Navigation as fallback if available.
331
326
  if ( $navigation_post ) {
@@ -377,7 +372,7 @@ function block_core_navigation_from_block_get_post_ids( $block ) {
377
372
  }
378
373
 
379
374
  if ( 'core/navigation-link' === $block->name || 'core/navigation-submenu' === $block->name ) {
380
- if ( $block->attributes && isset( $block->attributes['kind'] ) && 'post-type' === $block->attributes['kind'] ) {
375
+ if ( $block->attributes && isset( $block->attributes['kind'] ) && 'post-type' === $block->attributes['kind'] && isset( $block->attributes['id'] ) ) {
381
376
  $post_ids[] = $block->attributes['id'];
382
377
  }
383
378
  }
@@ -1,8 +1,3 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { sortBy } from 'lodash';
5
-
6
1
  /**
7
2
  * WordPress dependencies
8
3
  */
@@ -40,7 +35,9 @@ function mapMenuItemsToBlocks( menuItems ) {
40
35
  let mapping = {};
41
36
 
42
37
  // The menuItem should be in menu_order sort order.
43
- const sortedItems = sortBy( menuItems, 'menu_order' );
38
+ const sortedItems = [ ...menuItems ].sort(
39
+ ( a, b ) => a.menu_order - b.menu_order
40
+ );
44
41
 
45
42
  const innerBlocks = sortedItems.map( ( menuItem ) => {
46
43
  if ( menuItem.type === 'block' ) {
@@ -341,16 +341,17 @@ button.wp-block-navigation-item__content {
341
341
  // We use :where to keep specificity minimal, yet still scope it to only the navigation block.
342
342
  // That way if padding is set in theme.json, it still wins.
343
343
  // https://css-tricks.com/almanac/selectors/w/where/
344
+ // Note: .wp-block-navigation-item targets both Page List and custom menu items. .wp-block-navigation-link targets only custom.
344
345
 
345
346
  // When the menu has a background, items have paddings, reduce margins to compensate.
346
347
  // Treat margins and paddings differently when the block has a background.
347
- :where(.wp-block-navigation.has-background .wp-block-navigation-link a:not(.wp-element-button)),
348
+ :where(.wp-block-navigation.has-background .wp-block-navigation-item a:not(.wp-element-button)),
348
349
  :where(.wp-block-navigation.has-background .wp-block-navigation-submenu a:not(.wp-element-button)) {
349
350
  padding: 0.5em 1em;
350
351
  }
351
352
 
352
353
  // Provide a default padding for submenus who should always have some, regardless of the top level menu items.
353
- :where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-link a:not(.wp-element-button)),
354
+ :where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item a:not(.wp-element-button)),
354
355
  :where(.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-submenu a:not(.wp-element-button)) {
355
356
  padding: 0.5em 1em;
356
357
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import {
5
5
  store as coreStore,
6
- __experimentalUseResourcePermissions as useResourcePermissions,
6
+ useResourcePermissions,
7
7
  } from '@wordpress/core-data';
8
8
  import { useSelect } from '@wordpress/data';
9
9
 
@@ -12,10 +12,13 @@ export default function useNavigationMenu( ref ) {
12
12
 
13
13
  return useSelect(
14
14
  ( select ) => {
15
- const [
16
- hasResolvedPermissions,
17
- { canCreate, canUpdate, canDelete, isResolving },
18
- ] = permissions;
15
+ const {
16
+ canCreate,
17
+ canUpdate,
18
+ canDelete,
19
+ isResolving,
20
+ hasResolved,
21
+ } = permissions;
19
22
 
20
23
  const {
21
24
  navigationMenus,
@@ -44,16 +47,16 @@ export default function useNavigationMenu( ref ) {
44
47
 
45
48
  canUserCreateNavigationMenu: canCreate,
46
49
  isResolvingCanUserCreateNavigationMenu: isResolving,
47
- hasResolvedCanUserCreateNavigationMenu: hasResolvedPermissions,
50
+ hasResolvedCanUserCreateNavigationMenu: hasResolved,
48
51
 
49
52
  canUserUpdateNavigationMenu: canUpdate,
50
53
  hasResolvedCanUserUpdateNavigationMenu: ref
51
- ? hasResolvedPermissions
54
+ ? hasResolved
52
55
  : undefined,
53
56
 
54
57
  canUserDeleteNavigationMenu: canDelete,
55
58
  hasResolvedCanUserDeleteNavigationMenu: ref
56
- ? hasResolvedPermissions
59
+ ? hasResolved
57
60
  : undefined,
58
61
  };
59
62
  },
@@ -42,7 +42,10 @@ import {
42
42
  } from '@wordpress/element';
43
43
  import { placeCaretAtHorizontalEdge } from '@wordpress/dom';
44
44
  import { link as linkIcon, addSubmenu } from '@wordpress/icons';
45
- import { store as coreStore } from '@wordpress/core-data';
45
+ import {
46
+ store as coreStore,
47
+ useResourcePermissions,
48
+ } from '@wordpress/core-data';
46
49
  import { decodeEntities } from '@wordpress/html-entities';
47
50
 
48
51
  /**
@@ -463,14 +466,15 @@ export default function NavigationLinkEdit( {
463
466
  const itemLabelPlaceholder = __( 'Add link…' );
464
467
  const ref = useRef();
465
468
 
469
+ const pagesPermissions = useResourcePermissions( 'pages' );
470
+ const postsPermissions = useResourcePermissions( 'posts' );
471
+
466
472
  const {
467
473
  innerBlocks,
468
474
  isAtMaxNesting,
469
475
  isTopLevelLink,
470
476
  isParentOfSelectedBlock,
471
477
  hasChildren,
472
- userCanCreatePages,
473
- userCanCreatePosts,
474
478
  } = useSelect(
475
479
  ( select ) => {
476
480
  const {
@@ -497,14 +501,6 @@ export default function NavigationLinkEdit( {
497
501
  true
498
502
  ),
499
503
  hasChildren: !! getBlockCount( clientId ),
500
- userCanCreatePages: select( coreStore ).canUser(
501
- 'create',
502
- 'pages'
503
- ),
504
- userCanCreatePosts: select( coreStore ).canUser(
505
- 'create',
506
- 'posts'
507
- ),
508
504
  };
509
505
  },
510
506
  [ clientId ]
@@ -606,9 +602,9 @@ export default function NavigationLinkEdit( {
606
602
 
607
603
  let userCanCreate = false;
608
604
  if ( ! type || type === 'page' ) {
609
- userCanCreate = userCanCreatePages;
605
+ userCanCreate = pagesPermissions.canCreate;
610
606
  } else if ( type === 'post' ) {
611
- userCanCreate = userCanCreatePosts;
607
+ userCanCreate = postsPermissions.canCreate;
612
608
  }
613
609
 
614
610
  async function handleCreate( pageTitle ) {
@@ -39,7 +39,10 @@ import {
39
39
  } from '@wordpress/element';
40
40
  import { placeCaretAtHorizontalEdge } from '@wordpress/dom';
41
41
  import { link as linkIcon, removeSubmenu } from '@wordpress/icons';
42
- import { store as coreStore } from '@wordpress/core-data';
42
+ import {
43
+ useResourcePermissions,
44
+ store as coreStore,
45
+ } from '@wordpress/core-data';
43
46
  import { speak } from '@wordpress/a11y';
44
47
  import { createBlock } from '@wordpress/blocks';
45
48
 
@@ -294,6 +297,9 @@ export default function NavigationSubmenuEdit( {
294
297
  const itemLabelPlaceholder = __( 'Add text…' );
295
298
  const ref = useRef();
296
299
 
300
+ const pagesPermissions = useResourcePermissions( 'pages' );
301
+ const postsPermissions = useResourcePermissions( 'posts' );
302
+
297
303
  const {
298
304
  isAtMaxNesting,
299
305
  isTopLevelItem,
@@ -301,8 +307,6 @@ export default function NavigationSubmenuEdit( {
301
307
  isImmediateParentOfSelectedBlock,
302
308
  hasChildren,
303
309
  selectedBlockHasChildren,
304
- userCanCreatePages,
305
- userCanCreatePosts,
306
310
  onlyDescendantIsEmptyLink,
307
311
  } = useSelect(
308
312
  ( select ) => {
@@ -348,14 +352,6 @@ export default function NavigationSubmenuEdit( {
348
352
  ),
349
353
  hasChildren: !! getBlockCount( clientId ),
350
354
  selectedBlockHasChildren: !! selectedBlockChildren?.length,
351
- userCanCreatePages: select( coreStore ).canUser(
352
- 'create',
353
- 'pages'
354
- ),
355
- userCanCreatePosts: select( coreStore ).canUser(
356
- 'create',
357
- 'posts'
358
- ),
359
355
  onlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink,
360
356
  };
361
357
  },
@@ -426,9 +422,9 @@ export default function NavigationSubmenuEdit( {
426
422
 
427
423
  let userCanCreate = false;
428
424
  if ( ! type || type === 'page' ) {
429
- userCanCreate = userCanCreatePages;
425
+ userCanCreate = pagesPermissions.canCreate;
430
426
  } else if ( type === 'post' ) {
431
- userCanCreate = userCanCreatePosts;
427
+ userCanCreate = postsPermissions.canCreate;
432
428
  }
433
429
 
434
430
  async function handleCreate( pageTitle ) {
@@ -2,7 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { sortBy } from 'lodash';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -133,7 +132,12 @@ function usePageData() {
133
132
  // TODO: Once the REST API supports passing multiple values to
134
133
  // 'orderby', this can be removed.
135
134
  // https://core.trac.wordpress.org/ticket/39037
136
- const sortedPages = sortBy( pages, [ 'menu_order', 'title.rendered' ] );
135
+ const sortedPages = [ ...( pages ?? [] ) ].sort( ( a, b ) => {
136
+ if ( a.menu_order === b.menu_order ) {
137
+ return a.title.rendered.localeCompare( b.title.rendered );
138
+ }
139
+ return a.menu_order - b.menu_order;
140
+ } );
137
141
  const pagesByParentId = sortedPages.reduce( ( accumulator, page ) => {
138
142
  const { parent } = page;
139
143
  if ( accumulator.has( parent ) ) {
@@ -34,12 +34,17 @@
34
34
  "anchor": true,
35
35
  "className": false,
36
36
  "color": {
37
+ "gradients": true,
37
38
  "link": true,
38
39
  "__experimentalDefaultControls": {
39
40
  "background": true,
40
41
  "text": true
41
42
  }
42
43
  },
44
+ "spacing": {
45
+ "margin": true,
46
+ "padding": true
47
+ },
43
48
  "typography": {
44
49
  "fontSize": true,
45
50
  "lineHeight": true,
@@ -2,7 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { omit } from 'lodash';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -74,21 +73,27 @@ const migrateCustomColorsAndFontSizes = ( attributes ) => {
74
73
  if ( attributes.customFontSize ) {
75
74
  style.typography = { fontSize: attributes.customFontSize };
76
75
  }
76
+
77
+ const {
78
+ customTextColor,
79
+ customBackgroundColor,
80
+ customFontSize,
81
+ ...restAttributes
82
+ } = attributes;
83
+
77
84
  return {
78
- ...omit( attributes, [
79
- 'customTextColor',
80
- 'customBackgroundColor',
81
- 'customFontSize',
82
- ] ),
85
+ ...restAttributes,
83
86
  style,
84
87
  };
85
88
  };
86
89
 
90
+ const { style, ...restBlockAttributes } = blockAttributes;
91
+
87
92
  const deprecated = [
88
93
  {
89
94
  supports,
90
95
  attributes: {
91
- ...omit( blockAttributes, [ 'style' ] ),
96
+ ...restBlockAttributes,
92
97
  customTextColor: {
93
98
  type: 'string',
94
99
  },
@@ -153,7 +158,7 @@ const deprecated = [
153
158
  {
154
159
  supports,
155
160
  attributes: {
156
- ...omit( blockAttributes, [ 'style' ] ),
161
+ ...restBlockAttributes,
157
162
  customTextColor: {
158
163
  type: 'string',
159
164
  },
@@ -218,7 +223,7 @@ const deprecated = [
218
223
  {
219
224
  supports,
220
225
  attributes: {
221
- ...omit( blockAttributes, [ 'style' ] ),
226
+ ...restBlockAttributes,
222
227
  customTextColor: {
223
228
  type: 'string',
224
229
  },
@@ -284,15 +289,12 @@ const deprecated = [
284
289
  },
285
290
  {
286
291
  supports,
287
- attributes: omit(
288
- {
289
- ...blockAttributes,
290
- fontSize: {
291
- type: 'number',
292
- },
292
+ attributes: {
293
+ ...restBlockAttributes,
294
+ fontSize: {
295
+ type: 'number',
293
296
  },
294
- [ 'style' ]
295
- ),
297
+ },
296
298
  save( { attributes } ) {
297
299
  const {
298
300
  width,
@@ -325,25 +327,21 @@ const deprecated = [
325
327
  );
326
328
  },
327
329
  migrate( attributes ) {
328
- return migrateCustomColorsAndFontSizes(
329
- omit( {
330
- ...attributes,
331
- customFontSize: Number.isFinite( attributes.fontSize )
332
- ? attributes.fontSize
330
+ return migrateCustomColorsAndFontSizes( {
331
+ ...attributes,
332
+ customFontSize: Number.isFinite( attributes.fontSize )
333
+ ? attributes.fontSize
334
+ : undefined,
335
+ customTextColor:
336
+ attributes.textColor && '#' === attributes.textColor[ 0 ]
337
+ ? attributes.textColor
333
338
  : undefined,
334
- customTextColor:
335
- attributes.textColor &&
336
- '#' === attributes.textColor[ 0 ]
337
- ? attributes.textColor
338
- : undefined,
339
- customBackgroundColor:
340
- attributes.backgroundColor &&
341
- '#' === attributes.backgroundColor[ 0 ]
342
- ? attributes.backgroundColor
343
- : undefined,
344
- } ),
345
- [ 'fontSize', 'textColor', 'backgroundColor', 'style' ]
346
- );
339
+ customBackgroundColor:
340
+ attributes.backgroundColor &&
341
+ '#' === attributes.backgroundColor[ 0 ]
342
+ ? attributes.backgroundColor
343
+ : undefined,
344
+ } );
347
345
  },
348
346
  },
349
347
  {
@@ -146,6 +146,7 @@ function ParagraphBlock( {
146
146
  }
147
147
  data-empty={ content ? false : true }
148
148
  placeholder={ placeholder || __( 'Type / to choose a block' ) }
149
+ data-custom-placeholder={ placeholder ? true : undefined }
149
150
  __unstableEmbedURLOnPaste
150
151
  __unstableAllowPrefixTransformations
151
152
  />
@@ -3,7 +3,7 @@
3
3
  min-height: auto !important;
4
4
  }
5
5
 
6
- // Hide multiple sequential paragraphs.
6
+ // Hide multiple sequential paragraphs, but don't hide placeholders if a custom placeholder is set.
7
7
  .block-editor-block-list__block[data-empty="true"] {
8
8
  [data-rich-text-placeholder] {
9
9
  opacity: 1;
@@ -11,7 +11,9 @@
11
11
  }
12
12
 
13
13
  .block-editor-block-list__block[data-empty="true"] + .block-editor-block-list__block[data-empty="true"] {
14
- [data-rich-text-placeholder] {
15
- opacity: 0;
14
+ &:not([data-custom-placeholder="true"]) {
15
+ [data-rich-text-placeholder] {
16
+ opacity: 0;
17
+ }
16
18
  }
17
19
  }
@@ -35,10 +35,12 @@
35
35
  "typography": {
36
36
  "fontSize": true,
37
37
  "lineHeight": true,
38
- "__experimentalFontStyle": true,
38
+ "__experimentalFontFamily": true,
39
39
  "__experimentalFontWeight": true,
40
- "__experimentalLetterSpacing": true,
40
+ "__experimentalFontStyle": true,
41
41
  "__experimentalTextTransform": true,
42
+ "__experimentalTextDecoration": true,
43
+ "__experimentalLetterSpacing": true,
42
44
  "__experimentalDefaultControls": {
43
45
  "fontSize": true
44
46
  }
@@ -32,6 +32,7 @@
32
32
  "__experimentalFontWeight": true,
33
33
  "__experimentalFontStyle": true,
34
34
  "__experimentalTextTransform": true,
35
+ "__experimentalTextDecoration": true,
35
36
  "__experimentalLetterSpacing": true,
36
37
  "__experimentalDefaultControls": {
37
38
  "fontSize": true
@@ -43,7 +43,11 @@
43
43
  "__experimentalFontWeight": true,
44
44
  "__experimentalFontStyle": true,
45
45
  "__experimentalTextTransform": true,
46
- "__experimentalLetterSpacing": true
46
+ "__experimentalTextDecoration": true,
47
+ "__experimentalLetterSpacing": true,
48
+ "__experimentalDefaultControls": {
49
+ "fontSize": true
50
+ }
47
51
  }
48
52
  }
49
53
  }
@@ -25,8 +25,11 @@
25
25
  "typography": {
26
26
  "fontSize": true,
27
27
  "lineHeight": true,
28
- "__experimentalFontStyle": true,
28
+ "__experimentalFontFamily": true,
29
29
  "__experimentalFontWeight": true,
30
+ "__experimentalFontStyle": true,
31
+ "__experimentalTextTransform": true,
32
+ "__experimentalTextDecoration": true,
30
33
  "__experimentalLetterSpacing": true,
31
34
  "__experimentalDefaultControls": {
32
35
  "fontSize": true
@@ -49,6 +49,14 @@ export default function PostCommentsCountEdit( {
49
49
  } );
50
50
  }, [ postId ] );
51
51
 
52
+ const hasPostAndComments = postId && commentsCount !== undefined;
53
+ const blockStyles = {
54
+ ...blockProps.style,
55
+ textDecoration: hasPostAndComments
56
+ ? blockProps.style?.textDecoration
57
+ : undefined,
58
+ };
59
+
52
60
  return (
53
61
  <>
54
62
  <BlockControls group="block">
@@ -59,8 +67,8 @@ export default function PostCommentsCountEdit( {
59
67
  } }
60
68
  />
61
69
  </BlockControls>
62
- <div { ...blockProps }>
63
- { postId && commentsCount !== undefined ? (
70
+ <div { ...blockProps } style={ blockStyles }>
71
+ { hasPostAndComments ? (
64
72
  commentsCount
65
73
  ) : (
66
74
  <Warning>
@@ -26,10 +26,12 @@
26
26
  "typography": {
27
27
  "fontSize": true,
28
28
  "lineHeight": true,
29
- "__experimentalFontStyle": true,
29
+ "__experimentalFontFamily": true,
30
30
  "__experimentalFontWeight": true,
31
- "__experimentalLetterSpacing": true,
31
+ "__experimentalFontStyle": true,
32
32
  "__experimentalTextTransform": true,
33
+ "__experimentalTextDecoration": true,
34
+ "__experimentalLetterSpacing": true,
33
35
  "__experimentalDefaultControls": {
34
36
  "fontSize": true
35
37
  }
@@ -16,6 +16,10 @@
16
16
  "isLink": {
17
17
  "type": "boolean",
18
18
  "default": false
19
+ },
20
+ "displayType": {
21
+ "type": "string",
22
+ "default": "date"
19
23
  }
20
24
  },
21
25
  "usesContext": [ "postId", "postType", "queryId" ],
@@ -30,6 +34,10 @@
30
34
  "link": true
31
35
  }
32
36
  },
37
+ "spacing": {
38
+ "margin": true,
39
+ "padding": true
40
+ },
33
41
  "typography": {
34
42
  "fontSize": true,
35
43
  "lineHeight": true,
@@ -37,6 +45,7 @@
37
45
  "__experimentalFontWeight": true,
38
46
  "__experimentalFontStyle": true,
39
47
  "__experimentalTextTransform": true,
48
+ "__experimentalTextDecoration": true,
40
49
  "__experimentalLetterSpacing": true,
41
50
  "__experimentalDefaultControls": {
42
51
  "fontSize": true
@@ -33,7 +33,7 @@ import { DOWN } from '@wordpress/keycodes';
33
33
  import { useSelect } from '@wordpress/data';
34
34
 
35
35
  export default function PostDateEdit( {
36
- attributes: { textAlign, format, isLink },
36
+ attributes: { textAlign, format, isLink, displayType },
37
37
  context: { postId, postType: postTypeSlug, queryId },
38
38
  setAttributes,
39
39
  } ) {
@@ -58,9 +58,10 @@ export default function PostDateEdit( {
58
58
  const [ date, setDate ] = useEntityProp(
59
59
  'postType',
60
60
  postTypeSlug,
61
- 'date',
61
+ displayType,
62
62
  postId
63
63
  );
64
+
64
65
  const postType = useSelect(
65
66
  ( select ) =>
66
67
  postTypeSlug
@@ -155,6 +156,15 @@ export default function PostDateEdit( {
155
156
  onChange={ () => setAttributes( { isLink: ! isLink } ) }
156
157
  checked={ isLink }
157
158
  />
159
+ <ToggleControl
160
+ label={ __( 'Display last modified date' ) }
161
+ onChange={ ( value ) =>
162
+ setAttributes( {
163
+ displayType: value ? 'modified' : 'date',
164
+ } )
165
+ }
166
+ checked={ displayType === 'modified' }
167
+ />
158
168
  </PanelBody>
159
169
  </InspectorControls>
160
170
 
@@ -21,7 +21,15 @@ function render_block_core_post_date( $attributes, $content, $block ) {
21
21
  $post_ID = $block->context['postId'];
22
22
  $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
23
23
  $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
24
- $formatted_date = get_the_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID );
24
+
25
+ if ( isset( $attributes['displayType'] ) && 'modified' === $attributes['displayType'] ) {
26
+ $formatted_date = get_the_modified_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID );
27
+ $unformatted_date = esc_attr( get_the_modified_date( 'c', $post_ID ) );
28
+ } else {
29
+ $formatted_date = get_the_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID );
30
+ $unformatted_date = esc_attr( get_the_date( 'c', $post_ID ) );
31
+ }
32
+
25
33
  if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
26
34
  $formatted_date = sprintf( '<a href="%1s">%2s</a>', get_the_permalink( $post_ID ), $formatted_date );
27
35
  }
@@ -29,7 +37,7 @@ function render_block_core_post_date( $attributes, $content, $block ) {
29
37
  return sprintf(
30
38
  '<div %1$s><time datetime="%2$s">%3$s</time></div>',
31
39
  $wrapper_attributes,
32
- esc_attr( get_the_date( 'c', $post_ID ) ),
40
+ $unformatted_date,
33
41
  $formatted_date
34
42
  );
35
43
  }
@@ -0,0 +1,4 @@
1
+ .wp-block-post-date {
2
+ // This block has customizable padding, border-box makes that more predictable.
3
+ box-sizing: border-box;
4
+ }