@wordpress/block-library 7.9.0 → 7.12.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 (756) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/archives/edit.js +7 -0
  3. package/build/archives/edit.js.map +1 -1
  4. package/build/archives/index.js +4 -0
  5. package/build/archives/index.js.map +1 -1
  6. package/build/block/edit.js +4 -2
  7. package/build/block/edit.js.map +1 -1
  8. package/build/block/edit.native.js +4 -2
  9. package/build/block/edit.native.js.map +1 -1
  10. package/build/button/edit.js +2 -1
  11. package/build/button/edit.js.map +1 -1
  12. package/build/buttons/edit.js +1 -1
  13. package/build/buttons/edit.js.map +1 -1
  14. package/build/calendar/edit.js +12 -5
  15. package/build/calendar/edit.js.map +1 -1
  16. package/build/columns/edit.native.js +3 -2
  17. package/build/columns/edit.native.js.map +1 -1
  18. package/build/comment-template/index.js +1 -1
  19. package/build/comments/deprecated.js +65 -0
  20. package/build/comments/deprecated.js.map +1 -0
  21. package/build/comments/edit/comments-legacy.js +73 -0
  22. package/build/comments/edit/comments-legacy.js.map +1 -0
  23. package/build/comments/{edit.js → edit/index.js} +17 -38
  24. package/build/comments/edit/index.js.map +1 -0
  25. package/build/comments/edit/placeholder.js +117 -0
  26. package/build/comments/edit/placeholder.js.map +1 -0
  27. package/build/comments/edit/template.js +39 -0
  28. package/build/comments/edit/template.js.map +1 -0
  29. package/build/comments/index.js +11 -3
  30. package/build/comments/index.js.map +1 -1
  31. package/build/comments/save.js +12 -4
  32. package/build/comments/save.js.map +1 -1
  33. package/build/comments-pagination/index.js +1 -1
  34. package/build/comments-title/deprecated.js +1 -1
  35. package/build/comments-title/index.js +1 -1
  36. package/build/cover/edit/block-controls.js +2 -12
  37. package/build/cover/edit/block-controls.js.map +1 -1
  38. package/build/cover/edit/cover-placeholder.js +3 -1
  39. package/build/cover/edit/cover-placeholder.js.map +1 -1
  40. package/build/cover/edit/index.js +19 -4
  41. package/build/cover/edit/index.js.map +1 -1
  42. package/build/cover/edit/resizable-cover.js +6 -0
  43. package/build/cover/edit/resizable-cover.js.map +1 -1
  44. package/build/cover/transforms.js +3 -2
  45. package/build/cover/transforms.js.map +1 -1
  46. package/build/embed/embed-placeholder.native.js +1 -3
  47. package/build/embed/embed-placeholder.native.js.map +1 -1
  48. package/build/gallery/edit.js +11 -19
  49. package/build/gallery/edit.js.map +1 -1
  50. package/build/gallery/transforms.js +30 -20
  51. package/build/gallery/transforms.js.map +1 -1
  52. package/build/gallery/use-get-media.js +7 -18
  53. package/build/gallery/use-get-media.js.map +1 -1
  54. package/build/gallery/use-get-media.native.js +59 -0
  55. package/build/gallery/use-get-media.native.js.map +1 -0
  56. package/build/group/edit.js +1 -3
  57. package/build/group/edit.js.map +1 -1
  58. package/build/group/index.js +1 -0
  59. package/build/group/index.js.map +1 -1
  60. package/build/group/transforms.js +5 -0
  61. package/build/group/transforms.js.map +1 -1
  62. package/build/group/variations.js +1 -1
  63. package/build/group/variations.js.map +1 -1
  64. package/build/heading/heading-level-dropdown.js +2 -1
  65. package/build/heading/heading-level-dropdown.js.map +1 -1
  66. package/build/heading/index.js +9 -4
  67. package/build/heading/index.js.map +1 -1
  68. package/build/image/deprecated.js +77 -9
  69. package/build/image/deprecated.js.map +1 -1
  70. package/build/image/edit.js +3 -1
  71. package/build/image/edit.js.map +1 -1
  72. package/build/image/edit.native.js +18 -8
  73. package/build/image/edit.native.js.map +1 -1
  74. package/build/image/image.js +27 -20
  75. package/build/image/image.js.map +1 -1
  76. package/build/image/index.js +7 -1
  77. package/build/image/index.js.map +1 -1
  78. package/build/image/save.js +8 -2
  79. package/build/image/save.js.map +1 -1
  80. package/build/index.js +1 -3
  81. package/build/index.js.map +1 -1
  82. package/build/index.native.js +10 -7
  83. package/build/index.native.js.map +1 -1
  84. package/build/latest-posts/edit.js +1 -1
  85. package/build/latest-posts/edit.js.map +1 -1
  86. package/build/list/index.js +6 -0
  87. package/build/list/index.js.map +1 -1
  88. package/build/list/transforms.js +4 -63
  89. package/build/list/transforms.js.map +1 -1
  90. package/build/list/v2/edit.js +16 -5
  91. package/build/list/v2/edit.js.map +1 -1
  92. package/build/list/v2/tag-name.js +31 -0
  93. package/build/list/v2/tag-name.js.map +1 -0
  94. package/build/list/v2/tag-name.native.js +32 -0
  95. package/build/list/v2/tag-name.native.js.map +1 -0
  96. package/build/list/v2/transforms.js +1 -38
  97. package/build/list/v2/transforms.js.map +1 -1
  98. package/build/list-item/edit.js +15 -9
  99. package/build/list-item/edit.js.map +1 -1
  100. package/build/list-item/edit.native.js +158 -0
  101. package/build/list-item/edit.native.js.map +1 -0
  102. package/build/list-item/hooks/index.js +8 -8
  103. package/build/list-item/hooks/index.js.map +1 -1
  104. package/build/list-item/hooks/use-merge.js +174 -0
  105. package/build/list-item/hooks/use-merge.js.map +1 -0
  106. package/build/list-item/hooks/use-outdent-list-item.js +86 -50
  107. package/build/list-item/hooks/use-outdent-list-item.js.map +1 -1
  108. package/build/list-item/icons.native.js +53 -0
  109. package/build/list-item/icons.native.js.map +1 -0
  110. package/build/list-item/list-style-type.native.js +136 -0
  111. package/build/list-item/list-style-type.native.js.map +1 -0
  112. package/build/list-item/utils.js +125 -1
  113. package/build/list-item/utils.js.map +1 -1
  114. package/build/media-text/deprecated.js +265 -16
  115. package/build/media-text/deprecated.js.map +1 -1
  116. package/build/media-text/edit.js +4 -3
  117. package/build/media-text/edit.js.map +1 -1
  118. package/build/media-text/media-container.js +1 -1
  119. package/build/media-text/media-container.js.map +1 -1
  120. package/build/media-text/save.js +13 -0
  121. package/build/media-text/save.js.map +1 -1
  122. package/build/more/edit.js +2 -4
  123. package/build/more/edit.js.map +1 -1
  124. package/build/more/save.js +1 -7
  125. package/build/more/save.js.map +1 -1
  126. package/build/navigation/edit/index.js +68 -123
  127. package/build/navigation/edit/index.js.map +1 -1
  128. package/build/navigation/edit/navigation-menu-selector.js +11 -14
  129. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  130. package/build/navigation/edit/placeholder/index.js +4 -2
  131. package/build/navigation/edit/placeholder/index.js.map +1 -1
  132. package/build/navigation/edit/responsive-wrapper.js +13 -3
  133. package/build/navigation/edit/responsive-wrapper.js.map +1 -1
  134. package/build/navigation/edit/use-create-navigation-menu.js +5 -1
  135. package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
  136. package/build/navigation/edit/use-inner-blocks.js +43 -0
  137. package/build/navigation/edit/use-inner-blocks.js.map +1 -0
  138. package/build/navigation/edit/utils.js +28 -0
  139. package/build/navigation/edit/utils.js.map +1 -0
  140. package/build/navigation/use-navigation-menu.js +7 -3
  141. package/build/navigation/use-navigation-menu.js.map +1 -1
  142. package/build/navigation/view.js +7 -4
  143. package/build/navigation/view.js.map +1 -1
  144. package/build/navigation-link/edit.js +5 -4
  145. package/build/navigation-link/edit.js.map +1 -1
  146. package/build/navigation-link/hooks.js +0 -16
  147. package/build/navigation-link/hooks.js.map +1 -1
  148. package/build/navigation-link/index.js +1 -1
  149. package/build/navigation-link/index.js.map +1 -1
  150. package/build/navigation-submenu/edit.js +2 -1
  151. package/build/navigation-submenu/edit.js.map +1 -1
  152. package/build/navigation-submenu/view.js +7 -4
  153. package/build/navigation-submenu/view.js.map +1 -1
  154. package/build/nextpage/edit.js +1 -3
  155. package/build/nextpage/edit.js.map +1 -1
  156. package/build/page-list/edit.js +10 -3
  157. package/build/page-list/edit.js.map +1 -1
  158. package/build/paragraph/edit.js +7 -11
  159. package/build/paragraph/edit.js.map +1 -1
  160. package/build/post-author/edit.js +5 -2
  161. package/build/post-author/edit.js.map +1 -1
  162. package/build/post-author-biography/edit.js +7 -1
  163. package/build/post-author-biography/edit.js.map +1 -1
  164. package/build/post-comments-form/edit.js +4 -47
  165. package/build/post-comments-form/edit.js.map +1 -1
  166. package/build/post-comments-form/form.js +47 -3
  167. package/build/post-comments-form/form.js.map +1 -1
  168. package/build/post-content/edit.js +4 -2
  169. package/build/post-content/edit.js.map +1 -1
  170. package/build/post-featured-image/edit.js +16 -2
  171. package/build/post-featured-image/edit.js.map +1 -1
  172. package/build/post-featured-image/index.js +9 -0
  173. package/build/post-featured-image/index.js.map +1 -1
  174. package/build/post-terms/edit.js +3 -2
  175. package/build/post-terms/edit.js.map +1 -1
  176. package/build/post-terms/index.js +1 -1
  177. package/build/post-terms/index.js.map +1 -1
  178. package/build/post-title/index.js +1 -0
  179. package/build/post-title/index.js.map +1 -1
  180. package/build/query/edit/inspector-controls/index.js +43 -10
  181. package/build/query/edit/inspector-controls/index.js.map +1 -1
  182. package/build/query/edit/inspector-controls/taxonomy-controls.js +21 -14
  183. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  184. package/build/query/index.js +1 -1
  185. package/build/query/index.js.map +1 -1
  186. package/build/query-no-results/edit.js +1 -1
  187. package/build/query-no-results/edit.js.map +1 -1
  188. package/build/query-pagination-next/edit.js +2 -1
  189. package/build/query-pagination-next/edit.js.map +1 -1
  190. package/build/query-pagination-previous/edit.js +2 -1
  191. package/build/query-pagination-previous/edit.js.map +1 -1
  192. package/build/query-title/edit.js +20 -7
  193. package/build/query-title/edit.js.map +1 -1
  194. package/build/query-title/index.js +4 -0
  195. package/build/query-title/index.js.map +1 -1
  196. package/build/query-title/variations.js +10 -0
  197. package/build/query-title/variations.js.map +1 -1
  198. package/build/quote/deprecated.js +168 -36
  199. package/build/quote/deprecated.js.map +1 -1
  200. package/build/quote/edit.js +76 -39
  201. package/build/quote/edit.js.map +1 -1
  202. package/build/quote/index.js +9 -45
  203. package/build/quote/index.js.map +1 -1
  204. package/build/quote/save.js +1 -5
  205. package/build/quote/save.js.map +1 -1
  206. package/build/quote/transforms.js +110 -158
  207. package/build/quote/transforms.js.map +1 -1
  208. package/build/separator/edit.js +1 -1
  209. package/build/separator/edit.js.map +1 -1
  210. package/build/site-logo/edit.js +5 -13
  211. package/build/site-logo/edit.js.map +1 -1
  212. package/build/site-title/edit/level-toolbar.js +2 -1
  213. package/build/site-title/edit/level-toolbar.js.map +1 -1
  214. package/build/social-link/icons/index.js +13 -0
  215. package/build/social-link/icons/index.js.map +1 -1
  216. package/build/social-link/icons/whatsapp.js +25 -0
  217. package/build/social-link/icons/whatsapp.js.map +1 -0
  218. package/build/social-link/variations.js +7 -0
  219. package/build/social-link/variations.js.map +1 -1
  220. package/build/social-links/edit.js +1 -0
  221. package/build/social-links/edit.js.map +1 -1
  222. package/build/template-part/edit/index.js +21 -10
  223. package/build/template-part/edit/index.js.map +1 -1
  224. package/build/template-part/edit/selection-modal.js +33 -13
  225. package/build/template-part/edit/selection-modal.js.map +1 -1
  226. package/build/template-part/edit/utils/search.js +94 -0
  227. package/build/template-part/edit/utils/search.js.map +1 -0
  228. package/build/template-part/index.js +1 -1
  229. package/build/template-part/index.js.map +1 -1
  230. package/build/template-part/variations.js +0 -16
  231. package/build/template-part/variations.js.map +1 -1
  232. package/build/utils/clean-empty-object.js +5 -3
  233. package/build/utils/clean-empty-object.js.map +1 -1
  234. package/build/video/tracks-editor.js +9 -11
  235. package/build/video/tracks-editor.js.map +1 -1
  236. package/build-module/archives/edit.js +7 -0
  237. package/build-module/archives/edit.js.map +1 -1
  238. package/build-module/archives/index.js +4 -0
  239. package/build-module/archives/index.js.map +1 -1
  240. package/build-module/block/edit.js +5 -3
  241. package/build-module/block/edit.js.map +1 -1
  242. package/build-module/block/edit.native.js +5 -3
  243. package/build-module/block/edit.native.js.map +1 -1
  244. package/build-module/button/edit.js +2 -1
  245. package/build-module/button/edit.js.map +1 -1
  246. package/build-module/buttons/edit.js +2 -2
  247. package/build-module/buttons/edit.js.map +1 -1
  248. package/build-module/calendar/edit.js +12 -4
  249. package/build-module/calendar/edit.js.map +1 -1
  250. package/build-module/columns/edit.native.js +4 -3
  251. package/build-module/columns/edit.native.js.map +1 -1
  252. package/build-module/comment-template/index.js +1 -1
  253. package/build-module/comments/deprecated.js +54 -0
  254. package/build-module/comments/deprecated.js.map +1 -0
  255. package/build-module/comments/edit/comments-legacy.js +59 -0
  256. package/build-module/comments/edit/comments-legacy.js.map +1 -0
  257. package/build-module/comments/edit/index.js +37 -0
  258. package/build-module/comments/edit/index.js.map +1 -0
  259. package/build-module/comments/edit/placeholder.js +102 -0
  260. package/build-module/comments/edit/placeholder.js.map +1 -0
  261. package/build-module/comments/edit/template.js +32 -0
  262. package/build-module/comments/edit/template.js.map +1 -0
  263. package/build-module/comments/index.js +10 -3
  264. package/build-module/comments/index.js.map +1 -1
  265. package/build-module/comments/save.js +9 -4
  266. package/build-module/comments/save.js.map +1 -1
  267. package/build-module/comments-pagination/index.js +1 -1
  268. package/build-module/comments-title/deprecated.js +1 -1
  269. package/build-module/comments-title/index.js +1 -1
  270. package/build-module/cover/edit/block-controls.js +3 -13
  271. package/build-module/cover/edit/block-controls.js.map +1 -1
  272. package/build-module/cover/edit/cover-placeholder.js +3 -1
  273. package/build-module/cover/edit/cover-placeholder.js.map +1 -1
  274. package/build-module/cover/edit/index.js +19 -4
  275. package/build-module/cover/edit/index.js.map +1 -1
  276. package/build-module/cover/edit/resizable-cover.js +6 -0
  277. package/build-module/cover/edit/resizable-cover.js.map +1 -1
  278. package/build-module/cover/transforms.js +3 -2
  279. package/build-module/cover/transforms.js.map +1 -1
  280. package/build-module/embed/embed-placeholder.native.js +1 -2
  281. package/build-module/embed/embed-placeholder.native.js.map +1 -1
  282. package/build-module/gallery/edit.js +11 -18
  283. package/build-module/gallery/edit.js.map +1 -1
  284. package/build-module/gallery/transforms.js +30 -20
  285. package/build-module/gallery/transforms.js.map +1 -1
  286. package/build-module/gallery/use-get-media.js +6 -16
  287. package/build-module/gallery/use-get-media.js.map +1 -1
  288. package/build-module/gallery/use-get-media.native.js +50 -0
  289. package/build-module/gallery/use-get-media.native.js.map +1 -0
  290. package/build-module/group/edit.js +1 -3
  291. package/build-module/group/edit.js.map +1 -1
  292. package/build-module/group/index.js +1 -0
  293. package/build-module/group/index.js.map +1 -1
  294. package/build-module/group/transforms.js +5 -0
  295. package/build-module/group/transforms.js.map +1 -1
  296. package/build-module/group/variations.js +2 -2
  297. package/build-module/group/variations.js.map +1 -1
  298. package/build-module/heading/heading-level-dropdown.js +2 -1
  299. package/build-module/heading/heading-level-dropdown.js.map +1 -1
  300. package/build-module/heading/index.js +9 -4
  301. package/build-module/heading/index.js.map +1 -1
  302. package/build-module/image/deprecated.js +77 -9
  303. package/build-module/image/deprecated.js.map +1 -1
  304. package/build-module/image/edit.js +5 -3
  305. package/build-module/image/edit.js.map +1 -1
  306. package/build-module/image/edit.native.js +18 -8
  307. package/build-module/image/edit.native.js.map +1 -1
  308. package/build-module/image/image.js +29 -22
  309. package/build-module/image/image.js.map +1 -1
  310. package/build-module/image/index.js +7 -1
  311. package/build-module/image/index.js.map +1 -1
  312. package/build-module/image/save.js +9 -3
  313. package/build-module/image/save.js.map +1 -1
  314. package/build-module/index.js +1 -2
  315. package/build-module/index.js.map +1 -1
  316. package/build-module/index.native.js +9 -7
  317. package/build-module/index.native.js.map +1 -1
  318. package/build-module/latest-posts/edit.js +2 -2
  319. package/build-module/latest-posts/edit.js.map +1 -1
  320. package/build-module/list/index.js +1 -1
  321. package/build-module/list/index.js.map +1 -1
  322. package/build-module/list/transforms.js +4 -63
  323. package/build-module/list/transforms.js.map +1 -1
  324. package/build-module/list/v2/edit.js +15 -5
  325. package/build-module/list/v2/edit.js.map +1 -1
  326. package/build-module/list/v2/tag-name.js +21 -0
  327. package/build-module/list/v2/tag-name.js.map +1 -0
  328. package/build-module/list/v2/tag-name.native.js +21 -0
  329. package/build-module/list/v2/tag-name.native.js.map +1 -0
  330. package/build-module/list/v2/transforms.js +3 -39
  331. package/build-module/list/v2/transforms.js.map +1 -1
  332. package/build-module/list-item/edit.js +15 -13
  333. package/build-module/list-item/edit.js.map +1 -1
  334. package/build-module/list-item/edit.native.js +141 -0
  335. package/build-module/list-item/edit.native.js.map +1 -0
  336. package/build-module/list-item/hooks/index.js +1 -1
  337. package/build-module/list-item/hooks/index.js.map +1 -1
  338. package/build-module/list-item/hooks/use-merge.js +160 -0
  339. package/build-module/list-item/hooks/use-merge.js.map +1 -0
  340. package/build-module/list-item/hooks/use-outdent-list-item.js +82 -46
  341. package/build-module/list-item/hooks/use-outdent-list-item.js.map +1 -1
  342. package/build-module/list-item/icons.native.js +37 -0
  343. package/build-module/list-item/icons.native.js.map +1 -0
  344. package/build-module/list-item/list-style-type.native.js +124 -0
  345. package/build-module/list-item/list-style-type.native.js.map +1 -0
  346. package/build-module/list-item/utils.js +123 -2
  347. package/build-module/list-item/utils.js.map +1 -1
  348. package/build-module/media-text/deprecated.js +267 -17
  349. package/build-module/media-text/deprecated.js.map +1 -1
  350. package/build-module/media-text/edit.js +4 -3
  351. package/build-module/media-text/edit.js.map +1 -1
  352. package/build-module/media-text/media-container.js +1 -1
  353. package/build-module/media-text/media-container.js.map +1 -1
  354. package/build-module/media-text/save.js +13 -0
  355. package/build-module/media-text/save.js.map +1 -1
  356. package/build-module/more/edit.js +2 -4
  357. package/build-module/more/edit.js.map +1 -1
  358. package/build-module/more/save.js +1 -6
  359. package/build-module/more/save.js.map +1 -1
  360. package/build-module/navigation/edit/index.js +66 -122
  361. package/build-module/navigation/edit/index.js.map +1 -1
  362. package/build-module/navigation/edit/navigation-menu-selector.js +12 -15
  363. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  364. package/build-module/navigation/edit/placeholder/index.js +4 -2
  365. package/build-module/navigation/edit/placeholder/index.js.map +1 -1
  366. package/build-module/navigation/edit/responsive-wrapper.js +12 -3
  367. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
  368. package/build-module/navigation/edit/use-create-navigation-menu.js +5 -1
  369. package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
  370. package/build-module/navigation/edit/use-inner-blocks.js +33 -0
  371. package/build-module/navigation/edit/use-inner-blocks.js.map +1 -0
  372. package/build-module/navigation/edit/utils.js +21 -0
  373. package/build-module/navigation/edit/utils.js.map +1 -0
  374. package/build-module/navigation/use-navigation-menu.js +7 -3
  375. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  376. package/build-module/navigation/view.js +7 -4
  377. package/build-module/navigation/view.js.map +1 -1
  378. package/build-module/navigation-link/edit.js +5 -4
  379. package/build-module/navigation-link/edit.js.map +1 -1
  380. package/build-module/navigation-link/hooks.js +0 -13
  381. package/build-module/navigation-link/hooks.js.map +1 -1
  382. package/build-module/navigation-link/index.js +1 -1
  383. package/build-module/navigation-link/index.js.map +1 -1
  384. package/build-module/navigation-submenu/edit.js +2 -1
  385. package/build-module/navigation-submenu/edit.js.map +1 -1
  386. package/build-module/navigation-submenu/view.js +7 -4
  387. package/build-module/navigation-submenu/view.js.map +1 -1
  388. package/build-module/nextpage/edit.js +1 -3
  389. package/build-module/nextpage/edit.js.map +1 -1
  390. package/build-module/page-list/edit.js +10 -3
  391. package/build-module/page-list/edit.js.map +1 -1
  392. package/build-module/paragraph/edit.js +8 -12
  393. package/build-module/paragraph/edit.js.map +1 -1
  394. package/build-module/post-author/edit.js +5 -2
  395. package/build-module/post-author/edit.js.map +1 -1
  396. package/build-module/post-author-biography/edit.js +6 -1
  397. package/build-module/post-author-biography/edit.js.map +1 -1
  398. package/build-module/post-comments-form/edit.js +5 -44
  399. package/build-module/post-comments-form/edit.js.map +1 -1
  400. package/build-module/post-comments-form/form.js +46 -5
  401. package/build-module/post-comments-form/form.js.map +1 -1
  402. package/build-module/post-content/edit.js +5 -3
  403. package/build-module/post-content/edit.js.map +1 -1
  404. package/build-module/post-featured-image/edit.js +17 -3
  405. package/build-module/post-featured-image/edit.js.map +1 -1
  406. package/build-module/post-featured-image/index.js +9 -0
  407. package/build-module/post-featured-image/index.js.map +1 -1
  408. package/build-module/post-terms/edit.js +3 -2
  409. package/build-module/post-terms/edit.js.map +1 -1
  410. package/build-module/post-terms/index.js +1 -1
  411. package/build-module/post-terms/index.js.map +1 -1
  412. package/build-module/post-title/index.js +1 -0
  413. package/build-module/post-title/index.js.map +1 -1
  414. package/build-module/query/edit/inspector-controls/index.js +43 -10
  415. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  416. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +16 -12
  417. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  418. package/build-module/query/index.js +1 -1
  419. package/build-module/query/index.js.map +1 -1
  420. package/build-module/query-no-results/edit.js +2 -2
  421. package/build-module/query-no-results/edit.js.map +1 -1
  422. package/build-module/query-pagination-next/edit.js +2 -1
  423. package/build-module/query-pagination-next/edit.js.map +1 -1
  424. package/build-module/query-pagination-previous/edit.js +2 -1
  425. package/build-module/query-pagination-previous/edit.js.map +1 -1
  426. package/build-module/query-title/edit.js +20 -8
  427. package/build-module/query-title/edit.js.map +1 -1
  428. package/build-module/query-title/index.js +4 -0
  429. package/build-module/query-title/index.js.map +1 -1
  430. package/build-module/query-title/variations.js +10 -0
  431. package/build-module/query-title/variations.js.map +1 -1
  432. package/build-module/quote/deprecated.js +162 -36
  433. package/build-module/quote/deprecated.js.map +1 -1
  434. package/build-module/quote/edit.js +77 -43
  435. package/build-module/quote/edit.js.map +1 -1
  436. package/build-module/quote/index.js +9 -39
  437. package/build-module/quote/index.js.map +1 -1
  438. package/build-module/quote/save.js +4 -8
  439. package/build-module/quote/save.js.map +1 -1
  440. package/build-module/quote/transforms.js +111 -158
  441. package/build-module/quote/transforms.js.map +1 -1
  442. package/build-module/separator/edit.js +1 -1
  443. package/build-module/separator/edit.js.map +1 -1
  444. package/build-module/site-logo/edit.js +5 -13
  445. package/build-module/site-logo/edit.js.map +1 -1
  446. package/build-module/site-title/edit/level-toolbar.js +2 -1
  447. package/build-module/site-title/edit/level-toolbar.js.map +1 -1
  448. package/build-module/social-link/icons/index.js +1 -0
  449. package/build-module/social-link/icons/index.js.map +1 -1
  450. package/build-module/social-link/icons/whatsapp.js +15 -0
  451. package/build-module/social-link/icons/whatsapp.js.map +1 -0
  452. package/build-module/social-link/variations.js +8 -1
  453. package/build-module/social-link/variations.js.map +1 -1
  454. package/build-module/social-links/edit.js +1 -0
  455. package/build-module/social-links/edit.js.map +1 -1
  456. package/build-module/template-part/edit/index.js +24 -13
  457. package/build-module/template-part/edit/index.js.map +1 -1
  458. package/build-module/template-part/edit/selection-modal.js +33 -15
  459. package/build-module/template-part/edit/selection-modal.js.map +1 -1
  460. package/build-module/template-part/edit/utils/search.js +84 -0
  461. package/build-module/template-part/edit/utils/search.js.map +1 -0
  462. package/build-module/template-part/index.js +1 -1
  463. package/build-module/template-part/index.js.map +1 -1
  464. package/build-module/template-part/variations.js +0 -13
  465. package/build-module/template-part/variations.js.map +1 -1
  466. package/build-module/utils/clean-empty-object.js +5 -2
  467. package/build-module/utils/clean-empty-object.js.map +1 -1
  468. package/build-module/video/tracks-editor.js +9 -11
  469. package/build-module/video/tracks-editor.js.map +1 -1
  470. package/build-style/button/style-rtl.css +1 -1
  471. package/build-style/button/style.css +1 -1
  472. package/build-style/comment-template/style-rtl.css +12 -0
  473. package/build-style/comment-template/style.css +12 -0
  474. package/build-style/comments/editor-rtl.css +122 -0
  475. package/build-style/comments/editor.css +122 -0
  476. package/build-style/{post-comments → comments}/style-rtl.css +1 -0
  477. package/build-style/{post-comments → comments}/style.css +1 -0
  478. package/build-style/common-rtl.css +7 -0
  479. package/build-style/common.css +7 -0
  480. package/build-style/cover/style-rtl.css +2 -2
  481. package/build-style/cover/style.css +2 -2
  482. package/build-style/editor-elements-rtl.css +85 -0
  483. package/build-style/editor-elements.css +85 -0
  484. package/build-style/editor-rtl.css +162 -11
  485. package/build-style/editor.css +162 -11
  486. package/build-style/{post-comments/editor-rtl.css → elements-rtl.css} +5 -2
  487. package/build-style/{post-comments/editor.css → elements.css} +5 -2
  488. package/build-style/gallery/style-rtl.css +7 -2
  489. package/build-style/gallery/style.css +7 -2
  490. package/build-style/image/editor-rtl.css +4 -3
  491. package/build-style/image/editor.css +4 -3
  492. package/build-style/image/style-rtl.css +33 -3
  493. package/build-style/image/style.css +33 -3
  494. package/build-style/latest-posts/editor-rtl.css +3 -0
  495. package/build-style/latest-posts/editor.css +3 -0
  496. package/build-style/navigation/style-rtl.css +17 -19
  497. package/build-style/navigation/style.css +17 -19
  498. package/build-style/post-comments-form/style-rtl.css +0 -1
  499. package/build-style/post-comments-form/style.css +0 -1
  500. package/build-style/query/editor-rtl.css +8 -1
  501. package/build-style/query/editor.css +8 -1
  502. package/build-style/query-pagination/style-rtl.css +6 -0
  503. package/build-style/query-pagination/style.css +6 -0
  504. package/build-style/search/style-rtl.css +2 -0
  505. package/build-style/search/style.css +2 -0
  506. package/build-style/search/theme-rtl.css +5 -0
  507. package/build-style/search/theme.css +5 -0
  508. package/build-style/social-link/editor-rtl.css +1 -0
  509. package/build-style/social-link/editor.css +1 -0
  510. package/build-style/social-links/style-rtl.css +8 -0
  511. package/build-style/social-links/style.css +8 -0
  512. package/build-style/style-rtl.css +208 -139
  513. package/build-style/style.css +208 -139
  514. package/build-style/tag-cloud/style-rtl.css +1 -0
  515. package/build-style/tag-cloud/style.css +1 -0
  516. package/build-style/template-part/editor-rtl.css +14 -3
  517. package/build-style/template-part/editor.css +14 -3
  518. package/build-style/theme-rtl.css +5 -0
  519. package/build-style/theme.css +5 -0
  520. package/package.json +28 -29
  521. package/src/archives/block.json +4 -0
  522. package/src/archives/edit.js +12 -1
  523. package/src/archives/index.php +5 -3
  524. package/src/audio/test/__snapshots__/edit.native.js.snap +16 -2
  525. package/src/block/edit.js +4 -4
  526. package/src/block/edit.native.js +4 -4
  527. package/src/button/edit.js +1 -0
  528. package/src/button/style.scss +3 -1
  529. package/src/buttons/edit.js +1 -5
  530. package/src/calendar/edit.js +11 -4
  531. package/src/columns/edit.native.js +5 -3
  532. package/src/comment-template/block.json +1 -1
  533. package/src/comment-template/style.scss +14 -0
  534. package/src/comments/block.json +7 -2
  535. package/src/comments/deprecated.js +53 -0
  536. package/src/comments/edit/comments-legacy.js +71 -0
  537. package/src/comments/edit/index.js +35 -0
  538. package/src/comments/edit/placeholder.js +124 -0
  539. package/src/comments/{edit.js → edit/template.js} +1 -28
  540. package/src/comments/editor.scss +9 -0
  541. package/src/comments/index.js +2 -0
  542. package/src/comments/index.php +219 -0
  543. package/src/comments/save.js +8 -7
  544. package/src/{post-comments → comments}/style.scss +7 -0
  545. package/src/comments-pagination/block.json +1 -1
  546. package/src/comments-title/block.json +1 -1
  547. package/src/common.scss +2 -0
  548. package/src/cover/edit/block-controls.js +4 -20
  549. package/src/cover/edit/cover-placeholder.js +2 -0
  550. package/src/cover/edit/index.js +16 -0
  551. package/src/cover/edit/resizable-cover.js +6 -0
  552. package/src/cover/index.php +2 -2
  553. package/src/cover/style.scss +2 -2
  554. package/src/cover/transforms.js +2 -2
  555. package/src/editor-elements.scss +10 -0
  556. package/src/editor.scss +2 -1
  557. package/src/elements.scss +6 -0
  558. package/src/embed/embed-placeholder.native.js +2 -3
  559. package/src/file/test/__snapshots__/edit.native.js.snap +32 -4
  560. package/src/gallery/edit.js +12 -23
  561. package/src/gallery/index.php +1 -1
  562. package/src/gallery/style.scss +10 -1
  563. package/src/gallery/transforms.js +25 -10
  564. package/src/gallery/use-get-media.js +11 -28
  565. package/src/gallery/use-get-media.native.js +44 -0
  566. package/src/group/block.json +1 -0
  567. package/src/group/edit.js +1 -3
  568. package/src/group/transforms.js +7 -0
  569. package/src/group/variations.js +2 -2
  570. package/src/heading/heading-level-dropdown.js +1 -0
  571. package/src/heading/index.js +8 -2
  572. package/src/home-link/index.php +8 -17
  573. package/src/image/block.json +7 -1
  574. package/src/image/deprecated.js +86 -0
  575. package/src/image/edit.js +6 -1
  576. package/src/image/edit.native.js +18 -7
  577. package/src/image/editor.scss +9 -4
  578. package/src/image/image.js +26 -16
  579. package/src/image/save.js +10 -1
  580. package/src/image/style.scss +39 -3
  581. package/src/image/test/edit.native.js +6 -10
  582. package/src/index.js +0 -2
  583. package/src/index.native.js +11 -7
  584. package/src/latest-posts/edit.js +2 -6
  585. package/src/latest-posts/editor.scss +5 -0
  586. package/src/list/index.js +1 -1
  587. package/src/list/test/__snapshots__/edit.native.js.snap +133 -0
  588. package/src/list/test/edit.native.js +511 -7
  589. package/src/list/transforms.js +0 -47
  590. package/src/list/v2/edit.js +12 -4
  591. package/src/list/v2/tag-name.js +13 -0
  592. package/src/list/v2/tag-name.native.js +12 -0
  593. package/src/list/v2/transforms.js +3 -49
  594. package/src/list-item/edit.js +11 -13
  595. package/src/list-item/edit.native.js +148 -0
  596. package/src/list-item/hooks/index.js +1 -1
  597. package/src/list-item/hooks/use-merge.js +141 -0
  598. package/src/list-item/hooks/use-outdent-list-item.js +72 -74
  599. package/src/list-item/icons.native.js +34 -0
  600. package/src/list-item/list-style-type.native.js +139 -0
  601. package/src/list-item/style.native.scss +45 -0
  602. package/src/list-item/utils.js +27 -3
  603. package/src/media-text/deprecated.js +581 -288
  604. package/src/media-text/edit.js +3 -1
  605. package/src/media-text/media-container.js +3 -1
  606. package/src/media-text/save.js +18 -0
  607. package/src/media-text/test/media-container.js +24 -0
  608. package/src/more/edit.js +9 -11
  609. package/src/more/save.js +3 -6
  610. package/src/navigation/edit/index.js +83 -164
  611. package/src/navigation/edit/navigation-menu-selector.js +12 -26
  612. package/src/navigation/edit/placeholder/index.js +4 -2
  613. package/src/navigation/edit/responsive-wrapper.js +24 -3
  614. package/src/navigation/edit/use-create-navigation-menu.js +4 -0
  615. package/src/navigation/edit/use-inner-blocks.js +39 -0
  616. package/src/navigation/edit/utils.js +30 -0
  617. package/src/navigation/index.php +6 -0
  618. package/src/navigation/style.scss +13 -23
  619. package/src/navigation/use-navigation-menu.js +9 -5
  620. package/src/navigation/view.js +6 -6
  621. package/src/navigation-link/edit.js +4 -3
  622. package/src/navigation-link/hooks.js +0 -14
  623. package/src/navigation-link/index.js +1 -1
  624. package/src/navigation-link/index.php +1 -1
  625. package/src/navigation-link/test/__snapshots__/hooks.js.snap +0 -93
  626. package/src/navigation-link/test/hooks.js +0 -12
  627. package/src/navigation-submenu/edit.js +1 -0
  628. package/src/navigation-submenu/index.php +1 -1
  629. package/src/navigation-submenu/view.js +6 -6
  630. package/src/nextpage/edit.js +1 -3
  631. package/src/page-list/edit.js +12 -5
  632. package/src/page-list/index.php +4 -4
  633. package/src/paragraph/edit.js +8 -14
  634. package/src/post-author/edit.js +6 -3
  635. package/src/post-author-biography/edit.js +4 -1
  636. package/src/post-comments-form/edit.js +2 -74
  637. package/src/post-comments-form/form.js +80 -5
  638. package/src/post-comments-form/index.php +1 -1
  639. package/src/post-comments-form/style.scss +0 -1
  640. package/src/post-content/edit.js +4 -4
  641. package/src/post-featured-image/block.json +9 -0
  642. package/src/post-featured-image/edit.js +23 -1
  643. package/src/post-featured-image/index.php +3 -1
  644. package/src/post-template/index.php +8 -14
  645. package/src/post-terms/edit.js +3 -2
  646. package/src/post-terms/index.js +1 -1
  647. package/src/post-title/block.json +1 -0
  648. package/src/post-title/index.php +2 -1
  649. package/src/preformatted/test/__snapshots__/edit.native.js.snap +16 -2
  650. package/src/query/edit/inspector-controls/index.js +129 -65
  651. package/src/query/edit/inspector-controls/taxonomy-controls.js +17 -10
  652. package/src/query/editor.scss +10 -1
  653. package/src/query/index.js +1 -1
  654. package/src/query-no-results/edit.js +2 -5
  655. package/src/query-no-results/index.php +10 -8
  656. package/src/query-pagination/style.scss +14 -0
  657. package/src/query-pagination-next/edit.js +1 -0
  658. package/src/query-pagination-previous/edit.js +1 -0
  659. package/src/query-title/block.json +4 -0
  660. package/src/query-title/edit.js +33 -6
  661. package/src/query-title/index.php +17 -1
  662. package/src/query-title/variations.js +13 -0
  663. package/src/quote/deprecated.js +213 -99
  664. package/src/quote/edit.js +77 -52
  665. package/src/quote/index.js +10 -33
  666. package/src/quote/save.js +5 -5
  667. package/src/quote/{v2/test → test}/migrate.js +2 -7
  668. package/src/quote/transforms.js +113 -147
  669. package/src/search/style.scss +2 -0
  670. package/src/search/test/__snapshots__/edit.native.js.snap +56 -7
  671. package/src/search/theme.scss +5 -0
  672. package/src/separator/edit.js +1 -1
  673. package/src/separator/test/edit.js +5 -3
  674. package/src/site-logo/edit.js +2 -11
  675. package/src/site-title/edit/level-toolbar.js +1 -0
  676. package/src/site-title/index.php +8 -9
  677. package/src/social-link/editor.scss +3 -0
  678. package/src/social-link/icons/index.js +1 -0
  679. package/src/social-link/icons/whatsapp.js +10 -0
  680. package/src/social-link/index.php +21 -1
  681. package/src/social-link/socials-with-bg.scss +5 -0
  682. package/src/social-link/socials-without-bg.scss +5 -0
  683. package/src/social-link/variations.js +7 -0
  684. package/src/social-links/edit.js +1 -0
  685. package/src/style.scss +1 -1
  686. package/src/tag-cloud/style.scss +1 -0
  687. package/src/template-part/edit/index.js +40 -27
  688. package/src/template-part/edit/selection-modal.js +68 -40
  689. package/src/template-part/edit/utils/search.js +76 -0
  690. package/src/template-part/editor.scss +21 -9
  691. package/src/template-part/index.js +1 -1
  692. package/src/template-part/index.php +56 -2
  693. package/src/template-part/variations.js +0 -11
  694. package/src/utils/clean-empty-object.js +8 -2
  695. package/src/video/tracks-editor.js +1 -1
  696. package/build/comments/edit.js.map +0 -1
  697. package/build/gallery/use-short-code-transform.js +0 -64
  698. package/build/gallery/use-short-code-transform.js.map +0 -1
  699. package/build/list-item/hooks/use-backspace.js +0 -59
  700. package/build/list-item/hooks/use-backspace.js.map +0 -1
  701. package/build/navigation-link/fallback-variations.js +0 -75
  702. package/build/navigation-link/fallback-variations.js.map +0 -1
  703. package/build/post-comments/edit.js +0 -184
  704. package/build/post-comments/edit.js.map +0 -1
  705. package/build/post-comments/index.js +0 -72
  706. package/build/post-comments/index.js.map +0 -1
  707. package/build/quote/v2/deprecated.js +0 -133
  708. package/build/quote/v2/deprecated.js.map +0 -1
  709. package/build/quote/v2/edit.js +0 -139
  710. package/build/quote/v2/edit.js.map +0 -1
  711. package/build/quote/v2/index.js +0 -49
  712. package/build/quote/v2/index.js.map +0 -1
  713. package/build/quote/v2/save.js +0 -43
  714. package/build/quote/v2/save.js.map +0 -1
  715. package/build/quote/v2/transforms.js +0 -156
  716. package/build/quote/v2/transforms.js.map +0 -1
  717. package/build/template-part/fallback-variations.js +0 -59
  718. package/build/template-part/fallback-variations.js.map +0 -1
  719. package/build-module/comments/edit.js +0 -59
  720. package/build-module/comments/edit.js.map +0 -1
  721. package/build-module/gallery/use-short-code-transform.js +0 -54
  722. package/build-module/gallery/use-short-code-transform.js.map +0 -1
  723. package/build-module/list-item/hooks/use-backspace.js +0 -44
  724. package/build-module/list-item/hooks/use-backspace.js.map +0 -1
  725. package/build-module/navigation-link/fallback-variations.js +0 -65
  726. package/build-module/navigation-link/fallback-variations.js.map +0 -1
  727. package/build-module/post-comments/edit.js +0 -171
  728. package/build-module/post-comments/edit.js.map +0 -1
  729. package/build-module/post-comments/index.js +0 -59
  730. package/build-module/post-comments/index.js.map +0 -1
  731. package/build-module/quote/v2/deprecated.js +0 -116
  732. package/build-module/quote/v2/deprecated.js.map +0 -1
  733. package/build-module/quote/v2/edit.js +0 -122
  734. package/build-module/quote/v2/edit.js.map +0 -1
  735. package/build-module/quote/v2/index.js +0 -33
  736. package/build-module/quote/v2/index.js.map +0 -1
  737. package/build-module/quote/v2/save.js +0 -30
  738. package/build-module/quote/v2/save.js.map +0 -1
  739. package/build-module/quote/v2/transforms.js +0 -147
  740. package/build-module/quote/v2/transforms.js.map +0 -1
  741. package/build-module/template-part/fallback-variations.js +0 -47
  742. package/build-module/template-part/fallback-variations.js.map +0 -1
  743. package/src/gallery/use-short-code-transform.js +0 -55
  744. package/src/list-item/hooks/use-backspace.js +0 -51
  745. package/src/navigation-link/fallback-variations.js +0 -65
  746. package/src/post-comments/block.json +0 -45
  747. package/src/post-comments/edit.js +0 -247
  748. package/src/post-comments/editor.scss +0 -3
  749. package/src/post-comments/index.js +0 -18
  750. package/src/post-comments/index.php +0 -87
  751. package/src/quote/v2/deprecated.js +0 -107
  752. package/src/quote/v2/edit.js +0 -139
  753. package/src/quote/v2/index.js +0 -36
  754. package/src/quote/v2/save.js +0 -26
  755. package/src/quote/v2/transforms.js +0 -155
  756. package/src/template-part/fallback-variations.js +0 -51
@@ -1,13 +1,3 @@
1
- /**
2
- * WordPress dependencies
3
- */
4
- import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
5
-
6
- /**
7
- * Internal dependencies
8
- */
9
- import CommentsInspectorControls from './edit/comments-inspector-controls';
10
-
11
1
  const TEMPLATE = [
12
2
  [ 'core/comments-title' ],
13
3
  [
@@ -88,21 +78,4 @@ const TEMPLATE = [
88
78
  [ 'core/post-comments-form' ],
89
79
  ];
90
80
 
91
- export default function CommentsEdit( { attributes, setAttributes } ) {
92
- const { tagName: TagName } = attributes;
93
-
94
- const blockProps = useBlockProps();
95
- const innerBlocksProps = useInnerBlocksProps( blockProps, {
96
- template: TEMPLATE,
97
- } );
98
-
99
- return (
100
- <>
101
- <CommentsInspectorControls
102
- attributes={ attributes }
103
- setAttributes={ setAttributes }
104
- />
105
- <TagName { ...innerBlocksProps } />
106
- </>
107
- );
108
- }
81
+ export default TEMPLATE;
@@ -1,3 +1,12 @@
1
+ @import "./style.scss";
2
+
1
3
  .block-library-comments-toolbar__popover .components-popover__content {
2
4
  min-width: 230px;
3
5
  }
6
+
7
+ .wp-block-comments__legacy-placeholder {
8
+ @extend .wp-block-post-comments;
9
+ * {
10
+ pointer-events: none;
11
+ }
12
+ }
@@ -7,6 +7,7 @@ import { postComments as icon } from '@wordpress/icons';
7
7
  * Internal dependencies
8
8
  */
9
9
  import metadata from './block.json';
10
+ import deprecated from './deprecated';
10
11
  import edit from './edit';
11
12
  import save from './save';
12
13
 
@@ -17,4 +18,5 @@ export const settings = {
17
18
  icon,
18
19
  edit,
19
20
  save,
21
+ deprecated,
20
22
  };
@@ -0,0 +1,219 @@
1
+ <?php
2
+ /**
3
+ * Server-side rendering of the `core/comments` block.
4
+ *
5
+ * @package WordPress
6
+ */
7
+
8
+ /**
9
+ * Renders the `core/comments` block on the server.
10
+ *
11
+ * This render callback is mainly for rendering a dynamic, legacy version of
12
+ * this block (the old `core/post-comments`). It uses the `comments_template()`
13
+ * function to generate the output, in the same way as classic PHP themes.
14
+ *
15
+ * As this callback will always run during SSR, first we need to check whether
16
+ * the block is in legacy mode. If not, the HTML generated in the editor is
17
+ * returned instead.
18
+ *
19
+ * @param array $attributes Block attributes.
20
+ * @param string $content Block default content.
21
+ * @param WP_Block $block Block instance.
22
+ * @return string Returns the filtered post comments for the current post wrapped inside "p" tags.
23
+ */
24
+ function render_block_core_comments( $attributes, $content, $block ) {
25
+ global $post;
26
+
27
+ $is_legacy = 'core/post-comments' === $block->name || ! empty( $attributes['legacy'] );
28
+ if ( ! $is_legacy ) {
29
+ return $block->render( array( 'dynamic' => false ) );
30
+ }
31
+
32
+ $post_id = $block->context['postId'];
33
+ if ( ! isset( $post_id ) ) {
34
+ return '';
35
+ }
36
+
37
+ $comment_args = array(
38
+ 'post_id' => $post_id,
39
+ 'count' => true,
40
+ 'status' => 'approve',
41
+ );
42
+ // Return early if there are no comments and comments are closed.
43
+ if ( ! comments_open( $post_id ) && get_comments( $comment_args ) === 0 ) {
44
+ return '';
45
+ }
46
+
47
+ $post_before = $post;
48
+ $post = get_post( $post_id );
49
+ setup_postdata( $post );
50
+
51
+ ob_start();
52
+
53
+ /*
54
+ * There's a deprecation warning generated by WP Core.
55
+ * Ideally this deprecation is removed from Core.
56
+ * In the meantime, this removes it from the output.
57
+ */
58
+ add_filter( 'deprecated_file_trigger_error', '__return_false' );
59
+ comments_template();
60
+ remove_filter( 'deprecated_file_trigger_error', '__return_false' );
61
+
62
+ $output = ob_get_clean();
63
+ $post = $post_before;
64
+
65
+ $classnames = array();
66
+ // Adds the old class name for styles' backwards compatibility.
67
+ if ( isset( $attributes['legacy'] ) ) {
68
+ $classnames[] = 'wp-block-post-comments';
69
+ }
70
+ if ( isset( $attributes['textAlign'] ) ) {
71
+ $classnames[] = 'has-text-align-' . $attributes['textAlign'];
72
+ }
73
+
74
+ $wrapper_attributes = get_block_wrapper_attributes(
75
+ array( 'class' => implode( ' ', $classnames ) )
76
+ );
77
+
78
+ /*
79
+ * Enqueues scripts and styles required only for the legacy version. That is
80
+ * why they are not defined in `block.json`.
81
+ */
82
+ wp_enqueue_script( 'comment-reply' );
83
+ enqueue_legacy_post_comments_block_styles( $block->name );
84
+
85
+ return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $output );
86
+ }
87
+
88
+ /**
89
+ * Registers the `core/comments` block on the server.
90
+ */
91
+ function register_block_core_comments() {
92
+ register_block_type_from_metadata(
93
+ __DIR__ . '/comments',
94
+ array(
95
+ 'render_callback' => 'render_block_core_comments',
96
+ 'skip_inner_blocks' => true,
97
+ )
98
+ );
99
+ }
100
+ add_action( 'init', 'register_block_core_comments' );
101
+
102
+ /**
103
+ * Use the button block classes for the form-submit button.
104
+ *
105
+ * @param array $fields The default comment form arguments.
106
+ *
107
+ * @return array Returns the modified fields.
108
+ */
109
+ function comments_block_form_defaults( $fields ) {
110
+ if ( wp_is_block_theme() ) {
111
+ $fields['submit_button'] = '<input name="%1$s" type="submit" id="%2$s" class="%3$s wp-block-button__link ' . WP_Theme_JSON_Gutenberg::get_element_class_name( 'button' ) . '" value="%4$s" />';
112
+ $fields['submit_field'] = '<p class="form-submit wp-block-button">%1$s %2$s</p>';
113
+ }
114
+
115
+ return $fields;
116
+ }
117
+ add_filter( 'comment_form_defaults', 'comments_block_form_defaults' );
118
+
119
+ /**
120
+ * Enqueues styles from the legacy `core/post-comments` block. These styles are
121
+ * required only by the block's fallback.
122
+ *
123
+ * @param string $block_name Name of the new block type.
124
+ */
125
+ function enqueue_legacy_post_comments_block_styles( $block_name ) {
126
+ static $are_styles_enqueued = false;
127
+
128
+ if ( ! $are_styles_enqueued ) {
129
+ $handles = array(
130
+ 'wp-block-post-comments',
131
+ 'wp-block-buttons',
132
+ 'wp-block-button',
133
+ );
134
+ foreach ( $handles as $handle ) {
135
+ wp_enqueue_block_style( $block_name, array( 'handle' => $handle ) );
136
+ }
137
+ $are_styles_enqueued = true;
138
+ }
139
+ }
140
+
141
+ /**
142
+ * Ensures backwards compatibility for any users running the Gutenberg plugin
143
+ * who have used Post Comments before it was merged into Comments Query Loop.
144
+ *
145
+ * The same approach was followed when core/query-loop was renamed to
146
+ * core/post-template.
147
+ *
148
+ * @see https://github.com/WordPress/gutenberg/pull/41807
149
+ * @see https://github.com/WordPress/gutenberg/pull/32514
150
+ */
151
+ function register_legacy_post_comments_block() {
152
+ $registry = WP_Block_Type_Registry::get_instance();
153
+
154
+ /*
155
+ * Remove the old `post-comments` block if it was already registered, as it
156
+ * is about to be replaced by the type defined below.
157
+ */
158
+ if ( $registry->is_registered( 'core/post-comments' ) ) {
159
+ unregister_block_type( 'core/post-comments' );
160
+ }
161
+
162
+ // Recreate the legacy block metadata.
163
+ $metadata = array(
164
+ 'name' => 'core/post-comments',
165
+ 'category' => 'theme',
166
+ 'attributes' => array(
167
+ 'textAlign' => array(
168
+ 'type' => 'string',
169
+ ),
170
+ ),
171
+ 'uses_context' => array(
172
+ 'postId',
173
+ 'postType',
174
+ ),
175
+ 'supports' => array(
176
+ 'html' => false,
177
+ 'align' => array( 'wide', 'full' ),
178
+ 'typography' => array(
179
+ 'fontSize' => true,
180
+ 'lineHeight' => true,
181
+ '__experimentalFontStyle' => true,
182
+ '__experimentalFontWeight' => true,
183
+ '__experimentalLetterSpacing' => true,
184
+ '__experimentalTextTransform' => true,
185
+ '__experimentalDefaultControls' => array(
186
+ 'fontSize' => true,
187
+ ),
188
+ ),
189
+ 'color' => array(
190
+ 'gradients' => true,
191
+ 'link' => true,
192
+ '__experimentalDefaultControls' => array(
193
+ 'background' => true,
194
+ 'text' => true,
195
+ ),
196
+ ),
197
+ 'inserter' => false,
198
+ ),
199
+ 'style' => array(
200
+ 'wp-block-post-comments',
201
+ 'wp-block-buttons',
202
+ 'wp-block-button',
203
+ ),
204
+ 'editorStyle' => 'wp-block-post-comments-editor',
205
+ 'render_callback' => 'render_block_core_comments',
206
+ 'skip_inner_blocks' => true,
207
+ );
208
+
209
+ /*
210
+ * Filters the metadata object, the same way it's done inside
211
+ * `register_block_type_from_metadata()`. This applies some default filters,
212
+ * like `_wp_multiple_block_styles`, which is required in this case because
213
+ * the block has multiple styles.
214
+ */
215
+ $metadata = apply_filters( 'block_type_metadata', $metadata );
216
+
217
+ register_block_type( 'core/post-comments', $metadata );
218
+ }
219
+ add_action( 'init', 'register_legacy_post_comments_block', 21 );
@@ -1,12 +1,13 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
4
+ import { useInnerBlocksProps, useBlockProps } from '@wordpress/block-editor';
5
5
 
6
- export default function CommentsSave( { attributes: { tagName: Tag } } ) {
7
- return (
8
- <Tag { ...useBlockProps.save() }>
9
- <InnerBlocks.Content />
10
- </Tag>
11
- );
6
+ export default function save( { attributes: { tagName: Tag, legacy } } ) {
7
+ const blockProps = useBlockProps.save();
8
+ const innerBlocksProps = useInnerBlocksProps.save( blockProps );
9
+
10
+ // The legacy version is dynamic (i.e. PHP rendered) and doesn't allow inner
11
+ // blocks, so nothing is saved in that case.
12
+ return legacy ? null : <Tag { ...innerBlocksProps } />;
12
13
  }
@@ -1,4 +1,6 @@
1
+ /* Styles for backwards compatibility with the legacy `post-comments` block */
1
2
  .wp-block-post-comments {
3
+
2
4
  /* utility classes */
3
5
  .alignleft {
4
6
  float: left;
@@ -7,6 +9,7 @@
7
9
  .alignright {
8
10
  float: right;
9
11
  }
12
+
10
13
  /* end utility classes */
11
14
 
12
15
  .navigation {
@@ -62,9 +65,11 @@
62
65
  .comment-meta {
63
66
  font-size: 0.875em;
64
67
  line-height: 1.5;
68
+
65
69
  b {
66
70
  font-weight: normal;
67
71
  }
72
+
68
73
  .comment-awaiting-moderation {
69
74
  margin-top: 1em;
70
75
  margin-bottom: 1em;
@@ -87,6 +92,7 @@
87
92
  }
88
93
 
89
94
  .comment-form {
95
+
90
96
  textarea,
91
97
  input:not([type="submit"]):not([type="checkbox"]) {
92
98
  display: block;
@@ -106,6 +112,7 @@
106
112
 
107
113
  .comment-reply-title {
108
114
  margin-bottom: 0;
115
+
109
116
  :where(small) {
110
117
  font-size: var(--wp--preset--font-size--medium, smaller);
111
118
  margin-left: 0.5em;
@@ -4,7 +4,7 @@
4
4
  "name": "core/comments-pagination",
5
5
  "title": "Comments Pagination",
6
6
  "category": "theme",
7
- "parent": [ "core/comments-query-loop" ],
7
+ "parent": [ "core/comments" ],
8
8
  "description": "Displays a paginated navigation to next/previous set of comments, when applicable.",
9
9
  "textdomain": "default",
10
10
  "attributes": {
@@ -4,7 +4,7 @@
4
4
  "name": "core/comments-title",
5
5
  "title": "Comments Title",
6
6
  "category": "theme",
7
- "ancestor": [ "core/comments-query-loop" ],
7
+ "ancestor": [ "core/comments" ],
8
8
  "description": "Displays a title with the number of comments",
9
9
  "textdomain": "default",
10
10
  "usesContext": [ "postId", "postType" ],
package/src/common.scss CHANGED
@@ -1,3 +1,5 @@
1
+ @import "./elements.scss";
2
+
1
3
  // The following selectors have increased specificity (using the :root prefix)
2
4
  // to assure colors take effect over another base class color, mainly to let
3
5
  // the colors override the added specificity by link states such as :hover.
@@ -14,22 +14,17 @@ import { __ } from '@wordpress/i18n';
14
14
  /**
15
15
  * Internal dependencies
16
16
  */
17
- import { ALLOWED_MEDIA_TYPES, IMAGE_BACKGROUND_TYPE } from '../shared';
17
+ import { ALLOWED_MEDIA_TYPES } from '../shared';
18
18
 
19
19
  export default function CoverBlockControls( {
20
20
  attributes,
21
21
  setAttributes,
22
22
  onSelectMedia,
23
23
  currentSettings,
24
+ toggleUseFeaturedImage,
24
25
  } ) {
25
- const {
26
- contentPosition,
27
- id,
28
- useFeaturedImage,
29
- dimRatio,
30
- minHeight,
31
- minHeightUnit,
32
- } = attributes;
26
+ const { contentPosition, id, useFeaturedImage, minHeight, minHeightUnit } =
27
+ attributes;
33
28
  const { hasInnerBlocks, url } = currentSettings;
34
29
 
35
30
  const [ prevMinHeightValue, setPrevMinHeightValue ] = useState( minHeight );
@@ -63,17 +58,6 @@ export default function CoverBlockControls( {
63
58
  } );
64
59
  };
65
60
 
66
- const toggleUseFeaturedImage = () => {
67
- setAttributes( {
68
- id: undefined,
69
- url: undefined,
70
- useFeaturedImage: ! useFeaturedImage,
71
- dimRatio: dimRatio === 100 ? 50 : dimRatio,
72
- backgroundType: useFeaturedImage
73
- ? IMAGE_BACKGROUND_TYPE
74
- : undefined,
75
- } );
76
- };
77
61
  return (
78
62
  <>
79
63
  <BlockControls group="block">
@@ -16,6 +16,7 @@ export default function CoverPlaceholder( {
16
16
  onSelectMedia,
17
17
  onError,
18
18
  style,
19
+ toggleUseFeaturedImage,
19
20
  } ) {
20
21
  return (
21
22
  <MediaPlaceholder
@@ -30,6 +31,7 @@ export default function CoverPlaceholder( {
30
31
  accept="image/*,video/*"
31
32
  allowedTypes={ ALLOWED_MEDIA_TYPES }
32
33
  disableMediaButtons={ disableMediaButtons }
34
+ onToggleFeaturedImage={ toggleUseFeaturedImage }
33
35
  onError={ onError }
34
36
  style={ style }
35
37
  >
@@ -211,12 +211,25 @@ function CoverEdit( {
211
211
  overlayColor,
212
212
  };
213
213
 
214
+ const toggleUseFeaturedImage = () => {
215
+ setAttributes( {
216
+ id: undefined,
217
+ url: undefined,
218
+ useFeaturedImage: ! useFeaturedImage,
219
+ dimRatio: dimRatio === 100 ? 50 : dimRatio,
220
+ backgroundType: useFeaturedImage
221
+ ? IMAGE_BACKGROUND_TYPE
222
+ : undefined,
223
+ } );
224
+ };
225
+
214
226
  const blockControls = (
215
227
  <CoverBlockControls
216
228
  attributes={ attributes }
217
229
  setAttributes={ setAttributes }
218
230
  onSelectMedia={ onSelectMedia }
219
231
  currentSettings={ currentSettings }
232
+ toggleUseFeaturedImage={ toggleUseFeaturedImage }
220
233
  />
221
234
  );
222
235
 
@@ -228,6 +241,7 @@ function CoverEdit( {
228
241
  setOverlayColor={ setOverlayColor }
229
242
  coverRef={ ref }
230
243
  currentSettings={ currentSettings }
244
+ toggleUseFeaturedImage={ toggleUseFeaturedImage }
231
245
  />
232
246
  );
233
247
 
@@ -249,6 +263,7 @@ function CoverEdit( {
249
263
  style={ {
250
264
  minHeight: minHeightWithUnit || undefined,
251
265
  } }
266
+ toggleUseFeaturedImage={ toggleUseFeaturedImage }
252
267
  >
253
268
  <div className="wp-block-cover__placeholder-background-options">
254
269
  <ColorPalette
@@ -384,6 +399,7 @@ function CoverEdit( {
384
399
  disableMediaButtons
385
400
  onSelectMedia={ onSelectMedia }
386
401
  onError={ onUploadError }
402
+ toggleUseFeaturedImage={ toggleUseFeaturedImage }
387
403
  />
388
404
  <div { ...innerBlocksProps } />
389
405
  </div>
@@ -49,6 +49,12 @@ export default function ResizableCover( {
49
49
  onResizeStop( elt.clientHeight );
50
50
  setIsResizing( false );
51
51
  } }
52
+ __experimentalShowTooltip
53
+ __experimentalTooltipProps={ {
54
+ axis: 'y',
55
+ position: 'bottom',
56
+ isVisible: isResizing,
57
+ } }
52
58
  { ...props }
53
59
  />
54
60
  );
@@ -8,8 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/cover` block on server.
10
10
  *
11
- * @param array $attributes The block attributes.
12
- * @param array $content The block rendered content.
11
+ * @param array $attributes The block attributes.
12
+ * @param string $content The block rendered content.
13
13
  *
14
14
  * @return string Returns the cover block markup, if useFeaturedImage is true.
15
15
  */
@@ -1,10 +1,8 @@
1
1
  .wp-block-cover-image,
2
2
  .wp-block-cover {
3
3
  position: relative;
4
- background-size: cover;
5
4
  background-position: center center;
6
5
  min-height: 430px;
7
- width: 100%;
8
6
  display: flex;
9
7
  justify-content: center;
10
8
  align-items: center;
@@ -201,6 +199,8 @@
201
199
  video.wp-block-cover__video-background {
202
200
  &.has-parallax {
203
201
  background-attachment: fixed;
202
+ background-size: cover;
203
+ background-repeat: no-repeat;
204
204
 
205
205
  // Mobile Safari does not support fixed background attachment properly.
206
206
  // See also https://stackoverflow.com/questions/24154666/background-size-cover-not-working-on-ios
@@ -206,10 +206,10 @@ const transforms = {
206
206
  {
207
207
  type: 'block',
208
208
  blocks: [ 'core/group' ],
209
- isMatch: ( { url } ) => {
209
+ isMatch: ( { url, useFeaturedImage } ) => {
210
210
  // If the Cover block uses background media, skip this transform,
211
211
  // and instead use the Group block's default transform.
212
- if ( url ) {
212
+ if ( url || useFeaturedImage ) {
213
213
  return false;
214
214
  }
215
215
  return true;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Element styles for the editor
3
+ */
4
+ .wp-element-button {
5
+ cursor: revert;
6
+
7
+ &[role="textbox"] {
8
+ cursor: text;
9
+ }
10
+ }
package/src/editor.scss CHANGED
@@ -49,9 +49,10 @@
49
49
  @import "./query-pagination/editor.scss";
50
50
  @import "./query-pagination-numbers/editor.scss";
51
51
  @import "./post-featured-image/editor.scss";
52
- @import "./post-comments/editor.scss";
53
52
  @import "./post-comments-form/editor.scss";
54
53
 
54
+ @import "./editor-elements.scss";
55
+
55
56
  :root .editor-styles-wrapper {
56
57
  @include background-colors-deprecated();
57
58
  @include foreground-colors-deprecated();
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Element styles.
3
+ */
4
+ .wp-element-button {
5
+ cursor: pointer;
6
+ }
@@ -2,7 +2,6 @@
2
2
  * External dependencies
3
3
  */
4
4
  import { View, Text, TouchableWithoutFeedback } from 'react-native';
5
- import { compact } from 'lodash';
6
5
 
7
6
  /**
8
7
  * WordPress dependencies
@@ -68,11 +67,11 @@ const EmbedPlaceholder = ( {
68
67
  },
69
68
  };
70
69
 
71
- const options = compact( [
70
+ const options = [
72
71
  cannotEmbed && errorPickerOptions.retry,
73
72
  cannotEmbed && errorPickerOptions.convertToLink,
74
73
  cannotEmbed && errorPickerOptions.editLink,
75
- ] );
74
+ ].filter( Boolean );
76
75
 
77
76
  function onPickerSelect( value ) {
78
77
  const selectedItem = options.find( ( item ) => item.value === value );
@@ -54,7 +54,14 @@ exports[`File block renders file error state without crashing 1`] = `
54
54
  }
55
55
  }
56
56
  >
57
- <View>
57
+ <View
58
+ style={
59
+ Array [
60
+ undefined,
61
+ undefined,
62
+ ]
63
+ }
64
+ >
58
65
  <RCTAztecView
59
66
  accessible={true}
60
67
  activeFormats={Array []}
@@ -144,7 +151,14 @@ exports[`File block renders file error state without crashing 1`] = `
144
151
  ]
145
152
  }
146
153
  >
147
- <View>
154
+ <View
155
+ style={
156
+ Array [
157
+ undefined,
158
+ undefined,
159
+ ]
160
+ }
161
+ >
148
162
  <RCTAztecView
149
163
  accessible={true}
150
164
  activeFormats={Array []}
@@ -262,7 +276,14 @@ exports[`File block renders file without crashing 1`] = `
262
276
  }
263
277
  }
264
278
  >
265
- <View>
279
+ <View
280
+ style={
281
+ Array [
282
+ undefined,
283
+ undefined,
284
+ ]
285
+ }
286
+ >
266
287
  <RCTAztecView
267
288
  accessible={true}
268
289
  activeFormats={Array []}
@@ -334,7 +355,14 @@ exports[`File block renders file without crashing 1`] = `
334
355
  ]
335
356
  }
336
357
  >
337
- <View>
358
+ <View
359
+ style={
360
+ Array [
361
+ undefined,
362
+ undefined,
363
+ ]
364
+ }
365
+ >
338
366
  <RCTAztecView
339
367
  accessible={true}
340
368
  activeFormats={Array []}