@wordpress/block-library 6.0.2 → 6.0.3

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 (791) hide show
  1. package/build/block/edit.js +1 -1
  2. package/build/block/edit.js.map +1 -1
  3. package/build/button/index.js +4 -1
  4. package/build/button/index.js.map +1 -1
  5. package/build/buttons/deprecated.js +80 -2
  6. package/build/buttons/deprecated.js.map +1 -1
  7. package/build/buttons/edit.js +6 -39
  8. package/build/buttons/edit.js.map +1 -1
  9. package/build/buttons/index.js +8 -13
  10. package/build/buttons/index.js.map +1 -1
  11. package/build/buttons/save.js +4 -20
  12. package/build/buttons/save.js.map +1 -1
  13. package/build/buttons/transforms.js +7 -9
  14. package/build/buttons/transforms.js.map +1 -1
  15. package/build/code/index.js +24 -1
  16. package/build/code/index.js.map +1 -1
  17. package/build/column/edit.js +1 -1
  18. package/build/column/edit.js.map +1 -1
  19. package/build/column/index.js +1 -0
  20. package/build/column/index.js.map +1 -1
  21. package/build/column/save.js +7 -3
  22. package/build/column/save.js.map +1 -1
  23. package/build/columns/edit.js +1 -1
  24. package/build/columns/edit.js.map +1 -1
  25. package/build/columns/index.js +1 -0
  26. package/build/columns/index.js.map +1 -1
  27. package/build/columns/save.js +7 -2
  28. package/build/columns/save.js.map +1 -1
  29. package/build/comment-author-avatar/edit.js +83 -0
  30. package/build/comment-author-avatar/edit.js.map +1 -0
  31. package/build/comment-author-avatar/index.js +65 -0
  32. package/build/comment-author-avatar/index.js.map +1 -0
  33. package/build/{post-comment-author → comment-author-name}/deprecated.js +0 -0
  34. package/build/{post-comment-author → comment-author-name}/deprecated.js.map +1 -1
  35. package/build/{post-comment-author → comment-author-name}/edit.js +48 -22
  36. package/build/comment-author-name/edit.js.map +1 -0
  37. package/build/{post-comment-author → comment-author-name}/index.js +18 -7
  38. package/build/comment-author-name/index.js.map +1 -0
  39. package/build/{post-comment-content → comment-content}/edit.js +9 -3
  40. package/build/comment-content/edit.js.map +1 -0
  41. package/build/{post-comment-content → comment-content}/index.js +6 -6
  42. package/build/comment-content/index.js.map +1 -0
  43. package/build/{post-comment-date → comment-date}/deprecated.js +0 -0
  44. package/build/comment-date/deprecated.js.map +1 -0
  45. package/build/{post-comment-date → comment-date}/edit.js +43 -28
  46. package/build/comment-date/edit.js.map +1 -0
  47. package/build/{post-comment-date → comment-date}/index.js +9 -6
  48. package/build/comment-date/index.js.map +1 -0
  49. package/build/comment-edit-link/edit.js +61 -0
  50. package/build/comment-edit-link/edit.js.map +1 -0
  51. package/build/comment-edit-link/index.js +67 -0
  52. package/build/comment-edit-link/index.js.map +1 -0
  53. package/build/comment-reply-link/edit.js +63 -0
  54. package/build/comment-reply-link/edit.js.map +1 -0
  55. package/build/comment-reply-link/index.js +63 -0
  56. package/build/comment-reply-link/index.js.map +1 -0
  57. package/build/comment-template/edit.js +82 -0
  58. package/build/comment-template/edit.js.map +1 -0
  59. package/build/comment-template/index.js +49 -0
  60. package/build/comment-template/index.js.map +1 -0
  61. package/build/comment-template/save.js +18 -0
  62. package/build/comment-template/save.js.map +1 -0
  63. package/build/comments-query-loop/edit.js +64 -0
  64. package/build/comments-query-loop/edit.js.map +1 -0
  65. package/build/comments-query-loop/index.js +67 -0
  66. package/build/comments-query-loop/index.js.map +1 -0
  67. package/build/comments-query-loop/save.js +22 -0
  68. package/build/comments-query-loop/save.js.map +1 -0
  69. package/build/comments-query-loop/toolbar.js +54 -0
  70. package/build/comments-query-loop/toolbar.js.map +1 -0
  71. package/build/cover/edit.js +2 -1
  72. package/build/cover/edit.js.map +1 -1
  73. package/build/cover/index.js +1 -0
  74. package/build/cover/index.js.map +1 -1
  75. package/build/cover/save.js +3 -3
  76. package/build/cover/save.js.map +1 -1
  77. package/build/embed/edit.native.js +4 -8
  78. package/build/embed/edit.native.js.map +1 -1
  79. package/build/embed/embed-bottom-sheet.native.js +1 -0
  80. package/build/embed/embed-bottom-sheet.native.js.map +1 -1
  81. package/build/embed/embed-no-preview.native.js +2 -1
  82. package/build/embed/embed-no-preview.native.js.map +1 -1
  83. package/build/embed/icons.js +7 -1
  84. package/build/embed/icons.js.map +1 -1
  85. package/build/embed/variations.js +10 -0
  86. package/build/embed/variations.js.map +1 -1
  87. package/build/freeform/edit.js +16 -4
  88. package/build/freeform/edit.js.map +1 -1
  89. package/build/gallery/edit.js +7 -0
  90. package/build/gallery/edit.js.map +1 -1
  91. package/build/gallery/gallery.js +1 -1
  92. package/build/gallery/gallery.js.map +1 -1
  93. package/build/gallery/gallery.native.js +1 -1
  94. package/build/gallery/gallery.native.js.map +1 -1
  95. package/build/gallery/index.js +6 -1
  96. package/build/gallery/index.js.map +1 -1
  97. package/build/gallery/save.js +7 -2
  98. package/build/gallery/save.js.map +1 -1
  99. package/build/gallery/shared.js +0 -7
  100. package/build/gallery/shared.js.map +1 -1
  101. package/build/gallery/use-mobile-warning.js +43 -0
  102. package/build/gallery/use-mobile-warning.js.map +1 -0
  103. package/build/group/edit.js +1 -1
  104. package/build/group/edit.js.map +1 -1
  105. package/build/group/index.js +1 -0
  106. package/build/group/index.js.map +1 -1
  107. package/build/group/save.js +4 -5
  108. package/build/group/save.js.map +1 -1
  109. package/build/group/variations.js +2 -1
  110. package/build/group/variations.js.map +1 -1
  111. package/build/heading/autogenerate-anchors.js +26 -7
  112. package/build/heading/autogenerate-anchors.js.map +1 -1
  113. package/build/heading/edit.js +9 -10
  114. package/build/heading/edit.js.map +1 -1
  115. package/build/heading/index.js +9 -1
  116. package/build/heading/index.js.map +1 -1
  117. package/build/heading/transforms.js +9 -1
  118. package/build/heading/transforms.js.map +1 -1
  119. package/build/image/edit.native.js +125 -59
  120. package/build/image/edit.native.js.map +1 -1
  121. package/build/image/index.js +1 -1
  122. package/build/image/transforms.js +2 -1
  123. package/build/image/transforms.js.map +1 -1
  124. package/build/index.js +83 -70
  125. package/build/index.js.map +1 -1
  126. package/build/index.native.js +3 -1
  127. package/build/index.native.js.map +1 -1
  128. package/build/list/index.js +9 -1
  129. package/build/list/index.js.map +1 -1
  130. package/build/media-text/edit.js +1 -1
  131. package/build/media-text/edit.js.map +1 -1
  132. package/build/media-text/save.js +3 -3
  133. package/build/media-text/save.js.map +1 -1
  134. package/build/navigation/deprecated.js +126 -4
  135. package/build/navigation/deprecated.js.map +1 -1
  136. package/build/navigation/edit/index.js +372 -0
  137. package/build/navigation/edit/index.js.map +1 -0
  138. package/build/navigation/edit/inner-blocks.js +100 -0
  139. package/build/navigation/edit/inner-blocks.js.map +1 -0
  140. package/build/navigation/edit/navigation-menu-delete-control.js +60 -0
  141. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -0
  142. package/build/navigation/edit/navigation-menu-name-control.js +27 -0
  143. package/build/navigation/edit/navigation-menu-name-control.js.map +1 -0
  144. package/build/navigation/edit/navigation-menu-name-modal.js +54 -0
  145. package/build/navigation/edit/navigation-menu-name-modal.js.map +1 -0
  146. package/build/navigation/edit/navigation-menu-publish-button.js +53 -0
  147. package/build/navigation/edit/navigation-menu-publish-button.js.map +1 -0
  148. package/build/navigation/edit/navigation-menu-selector.js +49 -0
  149. package/build/navigation/edit/navigation-menu-selector.js.map +1 -0
  150. package/build/navigation/edit/placeholder/index.js +207 -0
  151. package/build/navigation/edit/placeholder/index.js.map +1 -0
  152. package/build/navigation/{placeholder-preview.js → edit/placeholder/placeholder-preview.js} +14 -2
  153. package/build/navigation/edit/placeholder/placeholder-preview.js.map +1 -0
  154. package/build/navigation/{responsive-wrapper.js → edit/responsive-wrapper.js} +0 -0
  155. package/build/navigation/edit/responsive-wrapper.js.map +1 -0
  156. package/build/navigation/edit/unsaved-inner-blocks.js +153 -0
  157. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -0
  158. package/build/navigation/{block-navigation-list.js → edit/use-list-view-modal.js} +34 -3
  159. package/build/navigation/edit/use-list-view-modal.js.map +1 -0
  160. package/build/navigation/index.js +15 -11
  161. package/build/navigation/index.js.map +1 -1
  162. package/build/navigation/save.js +10 -1
  163. package/build/navigation/save.js.map +1 -1
  164. package/build/navigation/use-navigation-menu.js +40 -0
  165. package/build/navigation/use-navigation-menu.js.map +1 -0
  166. package/build/navigation/use-template-part-area-label.js +74 -0
  167. package/build/navigation/use-template-part-area-label.js.map +1 -0
  168. package/build/navigation-area/edit.js +97 -0
  169. package/build/navigation-area/edit.js.map +1 -0
  170. package/build/navigation-area/index.js +61 -0
  171. package/build/navigation-area/index.js.map +1 -0
  172. package/build/navigation-area/inner-blocks.js +33 -0
  173. package/build/navigation-area/inner-blocks.js.map +1 -0
  174. package/build/navigation-area/save.js +18 -0
  175. package/build/navigation-area/save.js.map +1 -0
  176. package/build/navigation-link/edit.js +67 -5
  177. package/build/navigation-link/edit.js.map +1 -1
  178. package/build/navigation-link/transforms.js +5 -1
  179. package/build/navigation-link/transforms.js.map +1 -1
  180. package/build/navigation-submenu/edit.js +1 -1
  181. package/build/navigation-submenu/edit.js.map +1 -1
  182. package/build/page-list/edit.js +125 -85
  183. package/build/page-list/edit.js.map +1 -1
  184. package/build/page-list/index.js +1 -35
  185. package/build/page-list/index.js.map +1 -1
  186. package/build/paragraph/index.js +8 -1
  187. package/build/paragraph/index.js.map +1 -1
  188. package/build/paragraph/transforms.js +8 -1
  189. package/build/paragraph/transforms.js.map +1 -1
  190. package/build/pattern/edit.js +43 -0
  191. package/build/pattern/edit.js.map +1 -0
  192. package/build/pattern/index.js +41 -0
  193. package/build/pattern/index.js.map +1 -0
  194. package/build/post-author/index.js +12 -1
  195. package/build/post-author/index.js.map +1 -1
  196. package/build/post-comment/edit.js +7 -8
  197. package/build/post-comment/edit.js.map +1 -1
  198. package/build/post-comment/index.js +4 -3
  199. package/build/post-comment/index.js.map +1 -1
  200. package/build/post-comment/save.js +5 -1
  201. package/build/post-comment/save.js.map +1 -1
  202. package/build/post-comments/index.js +8 -1
  203. package/build/post-comments/index.js.map +1 -1
  204. package/build/post-comments-count/index.js +7 -1
  205. package/build/post-comments-count/index.js.map +1 -1
  206. package/build/post-comments-form/index.js +8 -1
  207. package/build/post-comments-form/index.js.map +1 -1
  208. package/build/post-comments-link/index.js +8 -1
  209. package/build/post-comments-link/index.js.map +1 -1
  210. package/build/post-content/edit.js +1 -1
  211. package/build/post-content/edit.js.map +1 -1
  212. package/build/post-date/index.js +4 -1
  213. package/build/post-date/index.js.map +1 -1
  214. package/build/post-excerpt/index.js +12 -1
  215. package/build/post-excerpt/index.js.map +1 -1
  216. package/build/post-navigation-link/index.js +8 -1
  217. package/build/post-navigation-link/index.js.map +1 -1
  218. package/build/post-template/edit.js +8 -4
  219. package/build/post-template/edit.js.map +1 -1
  220. package/build/post-terms/index.js +7 -1
  221. package/build/post-terms/index.js.map +1 -1
  222. package/build/post-terms/use-post-terms.js +3 -1
  223. package/build/post-terms/use-post-terms.js.map +1 -1
  224. package/build/post-title/index.js +7 -1
  225. package/build/post-title/index.js.map +1 -1
  226. package/build/preformatted/index.js +9 -1
  227. package/build/preformatted/index.js.map +1 -1
  228. package/build/pullquote/index.js +12 -0
  229. package/build/pullquote/index.js.map +1 -1
  230. package/build/query/edit/index.js +1 -1
  231. package/build/query/edit/index.js.map +1 -1
  232. package/build/query/save.js +5 -1
  233. package/build/query/save.js.map +1 -1
  234. package/build/query-pagination/edit.js +1 -1
  235. package/build/query-pagination/edit.js.map +1 -1
  236. package/build/query-pagination-next/index.js +8 -1
  237. package/build/query-pagination-next/index.js.map +1 -1
  238. package/build/query-pagination-previous/index.js +8 -1
  239. package/build/query-pagination-previous/index.js.map +1 -1
  240. package/build/query-title/index.js +10 -1
  241. package/build/query-title/index.js.map +1 -1
  242. package/build/quote/index.js +13 -1
  243. package/build/quote/index.js.map +1 -1
  244. package/build/search/edit.js +27 -1
  245. package/build/search/edit.js.map +1 -1
  246. package/build/separator/separator-settings.js +1 -0
  247. package/build/separator/separator-settings.js.map +1 -1
  248. package/build/site-tagline/index.js +4 -1
  249. package/build/site-tagline/index.js.map +1 -1
  250. package/build/site-title/index.js +8 -1
  251. package/build/site-title/index.js.map +1 -1
  252. package/build/social-links/edit.js +2 -1
  253. package/build/social-links/edit.js.map +1 -1
  254. package/build/social-links/save.js +7 -2
  255. package/build/social-links/save.js.map +1 -1
  256. package/build/table/index.js +11 -0
  257. package/build/table/index.js.map +1 -1
  258. package/build/template-part/edit/inner-blocks.js +1 -1
  259. package/build/template-part/edit/inner-blocks.js.map +1 -1
  260. package/build/term-description/index.js +4 -1
  261. package/build/term-description/index.js.map +1 -1
  262. package/build/verse/index.js +10 -1
  263. package/build/verse/index.js.map +1 -1
  264. package/build-module/block/edit.js +1 -1
  265. package/build-module/block/edit.js.map +1 -1
  266. package/build-module/button/index.js +4 -1
  267. package/build-module/button/index.js.map +1 -1
  268. package/build-module/buttons/deprecated.js +78 -3
  269. package/build-module/buttons/deprecated.js.map +1 -1
  270. package/build-module/buttons/edit.js +6 -36
  271. package/build-module/buttons/edit.js.map +1 -1
  272. package/build-module/buttons/index.js +8 -12
  273. package/build-module/buttons/index.js.map +1 -1
  274. package/build-module/buttons/save.js +4 -18
  275. package/build-module/buttons/save.js.map +1 -1
  276. package/build-module/buttons/transforms.js +7 -9
  277. package/build-module/buttons/transforms.js.map +1 -1
  278. package/build-module/code/index.js +24 -1
  279. package/build-module/code/index.js.map +1 -1
  280. package/build-module/column/edit.js +1 -1
  281. package/build-module/column/edit.js.map +1 -1
  282. package/build-module/column/index.js +1 -0
  283. package/build-module/column/index.js.map +1 -1
  284. package/build-module/column/save.js +6 -4
  285. package/build-module/column/save.js.map +1 -1
  286. package/build-module/columns/edit.js +1 -1
  287. package/build-module/columns/edit.js.map +1 -1
  288. package/build-module/columns/index.js +1 -0
  289. package/build-module/columns/index.js.map +1 -1
  290. package/build-module/columns/save.js +5 -3
  291. package/build-module/columns/save.js.map +1 -1
  292. package/build-module/comment-author-avatar/edit.js +69 -0
  293. package/build-module/comment-author-avatar/edit.js.map +1 -0
  294. package/build-module/comment-author-avatar/index.js +52 -0
  295. package/build-module/comment-author-avatar/index.js.map +1 -0
  296. package/build-module/{post-comment-author → comment-author-name}/deprecated.js +0 -0
  297. package/build-module/{post-comment-author → comment-author-name}/deprecated.js.map +1 -1
  298. package/build-module/{post-comment-author → comment-author-name}/edit.js +47 -24
  299. package/build-module/comment-author-name/edit.js.map +1 -0
  300. package/build-module/{post-comment-author → comment-author-name}/index.js +17 -10
  301. package/build-module/comment-author-name/index.js.map +1 -0
  302. package/build-module/{post-comment-content → comment-content}/edit.js +10 -4
  303. package/build-module/comment-content/edit.js.map +1 -0
  304. package/build-module/{post-comment-content → comment-content}/index.js +6 -6
  305. package/build-module/comment-content/index.js.map +1 -0
  306. package/build-module/{post-comment-date → comment-date}/deprecated.js +0 -0
  307. package/build-module/comment-date/deprecated.js.map +1 -0
  308. package/build-module/{post-comment-date → comment-date}/edit.js +44 -29
  309. package/build-module/comment-date/edit.js.map +1 -0
  310. package/build-module/{post-comment-date → comment-date}/index.js +9 -6
  311. package/build-module/comment-date/index.js.map +1 -0
  312. package/build-module/comment-edit-link/edit.js +48 -0
  313. package/build-module/comment-edit-link/edit.js.map +1 -0
  314. package/build-module/comment-edit-link/index.js +54 -0
  315. package/build-module/comment-edit-link/index.js.map +1 -0
  316. package/build-module/comment-reply-link/edit.js +50 -0
  317. package/build-module/comment-reply-link/edit.js.map +1 -0
  318. package/build-module/comment-reply-link/index.js +50 -0
  319. package/build-module/comment-reply-link/index.js.map +1 -0
  320. package/build-module/comment-template/edit.js +71 -0
  321. package/build-module/comment-template/edit.js.map +1 -0
  322. package/build-module/comment-template/index.js +35 -0
  323. package/build-module/comment-template/index.js.map +1 -0
  324. package/build-module/comment-template/save.js +10 -0
  325. package/build-module/comment-template/save.js.map +1 -0
  326. package/build-module/comments-query-loop/edit.js +50 -0
  327. package/build-module/comments-query-loop/edit.js.map +1 -0
  328. package/build-module/comments-query-loop/index.js +53 -0
  329. package/build-module/comments-query-loop/index.js.map +1 -0
  330. package/build-module/comments-query-loop/save.js +14 -0
  331. package/build-module/comments-query-loop/save.js.map +1 -0
  332. package/build-module/comments-query-loop/toolbar.js +44 -0
  333. package/build-module/comments-query-loop/toolbar.js.map +1 -0
  334. package/build-module/cover/edit.js +2 -1
  335. package/build-module/cover/edit.js.map +1 -1
  336. package/build-module/cover/index.js +1 -0
  337. package/build-module/cover/index.js.map +1 -1
  338. package/build-module/cover/save.js +4 -4
  339. package/build-module/cover/save.js.map +1 -1
  340. package/build-module/embed/edit.native.js +4 -8
  341. package/build-module/embed/edit.native.js.map +1 -1
  342. package/build-module/embed/embed-bottom-sheet.native.js +1 -0
  343. package/build-module/embed/embed-bottom-sheet.native.js.map +1 -1
  344. package/build-module/embed/embed-no-preview.native.js +2 -1
  345. package/build-module/embed/embed-no-preview.native.js.map +1 -1
  346. package/build-module/embed/icons.js +5 -0
  347. package/build-module/embed/icons.js.map +1 -1
  348. package/build-module/embed/variations.js +11 -1
  349. package/build-module/embed/variations.js.map +1 -1
  350. package/build-module/freeform/edit.js +16 -5
  351. package/build-module/freeform/edit.js.map +1 -1
  352. package/build-module/gallery/edit.js +6 -0
  353. package/build-module/gallery/edit.js.map +1 -1
  354. package/build-module/gallery/gallery.js +1 -1
  355. package/build-module/gallery/gallery.js.map +1 -1
  356. package/build-module/gallery/gallery.native.js +1 -1
  357. package/build-module/gallery/gallery.native.js.map +1 -1
  358. package/build-module/gallery/index.js +6 -1
  359. package/build-module/gallery/index.js.map +1 -1
  360. package/build-module/gallery/save.js +5 -3
  361. package/build-module/gallery/save.js.map +1 -1
  362. package/build-module/gallery/shared.js +0 -6
  363. package/build-module/gallery/shared.js.map +1 -1
  364. package/build-module/gallery/use-mobile-warning.js +32 -0
  365. package/build-module/gallery/use-mobile-warning.js.map +1 -0
  366. package/build-module/group/edit.js +1 -1
  367. package/build-module/group/edit.js.map +1 -1
  368. package/build-module/group/index.js +1 -0
  369. package/build-module/group/index.js.map +1 -1
  370. package/build-module/group/save.js +5 -6
  371. package/build-module/group/save.js.map +1 -1
  372. package/build-module/group/variations.js +2 -1
  373. package/build-module/group/variations.js.map +1 -1
  374. package/build-module/heading/autogenerate-anchors.js +22 -6
  375. package/build-module/heading/autogenerate-anchors.js.map +1 -1
  376. package/build-module/heading/edit.js +11 -11
  377. package/build-module/heading/edit.js.map +1 -1
  378. package/build-module/heading/index.js +9 -1
  379. package/build-module/heading/index.js.map +1 -1
  380. package/build-module/heading/transforms.js +9 -1
  381. package/build-module/heading/transforms.js.map +1 -1
  382. package/build-module/image/edit.native.js +127 -62
  383. package/build-module/image/edit.native.js.map +1 -1
  384. package/build-module/image/index.js +1 -1
  385. package/build-module/image/transforms.js +2 -1
  386. package/build-module/image/transforms.js.map +1 -1
  387. package/build-module/index.js +59 -53
  388. package/build-module/index.js.map +1 -1
  389. package/build-module/index.native.js +1 -2
  390. package/build-module/index.native.js.map +1 -1
  391. package/build-module/list/index.js +9 -1
  392. package/build-module/list/index.js.map +1 -1
  393. package/build-module/media-text/edit.js +1 -1
  394. package/build-module/media-text/edit.js.map +1 -1
  395. package/build-module/media-text/save.js +4 -4
  396. package/build-module/media-text/save.js.map +1 -1
  397. package/build-module/navigation/deprecated.js +126 -4
  398. package/build-module/navigation/deprecated.js.map +1 -1
  399. package/build-module/navigation/edit/index.js +346 -0
  400. package/build-module/navigation/edit/index.js.map +1 -0
  401. package/build-module/navigation/edit/inner-blocks.js +87 -0
  402. package/build-module/navigation/edit/inner-blocks.js.map +1 -0
  403. package/build-module/navigation/edit/navigation-menu-delete-control.js +50 -0
  404. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -0
  405. package/build-module/navigation/edit/navigation-menu-name-control.js +17 -0
  406. package/build-module/navigation/edit/navigation-menu-name-control.js.map +1 -0
  407. package/build-module/navigation/edit/navigation-menu-name-modal.js +46 -0
  408. package/build-module/navigation/edit/navigation-menu-name-modal.js.map +1 -0
  409. package/build-module/navigation/edit/navigation-menu-publish-button.js +40 -0
  410. package/build-module/navigation/edit/navigation-menu-publish-button.js.map +1 -0
  411. package/build-module/navigation/edit/navigation-menu-selector.js +36 -0
  412. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -0
  413. package/build-module/navigation/edit/placeholder/index.js +189 -0
  414. package/build-module/navigation/edit/placeholder/index.js.map +1 -0
  415. package/build-module/navigation/{placeholder-preview.js → edit/placeholder/placeholder-preview.js} +11 -2
  416. package/build-module/navigation/edit/placeholder/placeholder-preview.js.map +1 -0
  417. package/build-module/navigation/{responsive-wrapper.js → edit/responsive-wrapper.js} +0 -0
  418. package/build-module/navigation/edit/responsive-wrapper.js.map +1 -0
  419. package/build-module/navigation/edit/unsaved-inner-blocks.js +136 -0
  420. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -0
  421. package/build-module/navigation/{block-navigation-list.js → edit/use-list-view-modal.js} +31 -2
  422. package/build-module/navigation/edit/use-list-view-modal.js.map +1 -0
  423. package/build-module/navigation/index.js +15 -10
  424. package/build-module/navigation/index.js.map +1 -1
  425. package/build-module/navigation/save.js +10 -1
  426. package/build-module/navigation/save.js.map +1 -1
  427. package/build-module/navigation/use-navigation-menu.js +31 -0
  428. package/build-module/navigation/use-navigation-menu.js.map +1 -0
  429. package/build-module/navigation/use-template-part-area-label.js +63 -0
  430. package/build-module/navigation/use-template-part-area-label.js.map +1 -0
  431. package/build-module/navigation-area/edit.js +82 -0
  432. package/build-module/navigation-area/edit.js.map +1 -0
  433. package/build-module/navigation-area/index.js +47 -0
  434. package/build-module/navigation-area/index.js.map +1 -0
  435. package/build-module/navigation-area/inner-blocks.js +25 -0
  436. package/build-module/navigation-area/inner-blocks.js.map +1 -0
  437. package/build-module/navigation-area/save.js +10 -0
  438. package/build-module/navigation-area/save.js.map +1 -0
  439. package/build-module/navigation-link/edit.js +70 -8
  440. package/build-module/navigation-link/edit.js.map +1 -1
  441. package/build-module/navigation-link/transforms.js +5 -1
  442. package/build-module/navigation-link/transforms.js.map +1 -1
  443. package/build-module/navigation-submenu/edit.js +1 -1
  444. package/build-module/navigation-submenu/edit.js.map +1 -1
  445. package/build-module/page-list/edit.js +127 -87
  446. package/build-module/page-list/edit.js.map +1 -1
  447. package/build-module/page-list/index.js +1 -35
  448. package/build-module/page-list/index.js.map +1 -1
  449. package/build-module/paragraph/index.js +8 -1
  450. package/build-module/paragraph/index.js.map +1 -1
  451. package/build-module/paragraph/transforms.js +8 -1
  452. package/build-module/paragraph/transforms.js.map +1 -1
  453. package/build-module/pattern/edit.js +35 -0
  454. package/build-module/pattern/edit.js.map +1 -0
  455. package/build-module/pattern/index.js +29 -0
  456. package/build-module/pattern/index.js.map +1 -0
  457. package/build-module/post-author/index.js +12 -1
  458. package/build-module/post-author/index.js.map +1 -1
  459. package/build-module/post-comment/edit.js +8 -9
  460. package/build-module/post-comment/edit.js.map +1 -1
  461. package/build-module/post-comment/index.js +4 -3
  462. package/build-module/post-comment/index.js.map +1 -1
  463. package/build-module/post-comment/save.js +4 -2
  464. package/build-module/post-comment/save.js.map +1 -1
  465. package/build-module/post-comments/index.js +8 -1
  466. package/build-module/post-comments/index.js.map +1 -1
  467. package/build-module/post-comments-count/index.js +7 -1
  468. package/build-module/post-comments-count/index.js.map +1 -1
  469. package/build-module/post-comments-form/index.js +8 -1
  470. package/build-module/post-comments-form/index.js.map +1 -1
  471. package/build-module/post-comments-link/index.js +8 -1
  472. package/build-module/post-comments-link/index.js.map +1 -1
  473. package/build-module/post-content/edit.js +1 -1
  474. package/build-module/post-content/edit.js.map +1 -1
  475. package/build-module/post-date/index.js +4 -1
  476. package/build-module/post-date/index.js.map +1 -1
  477. package/build-module/post-excerpt/index.js +12 -1
  478. package/build-module/post-excerpt/index.js.map +1 -1
  479. package/build-module/post-navigation-link/index.js +8 -1
  480. package/build-module/post-navigation-link/index.js.map +1 -1
  481. package/build-module/post-template/edit.js +10 -5
  482. package/build-module/post-template/edit.js.map +1 -1
  483. package/build-module/post-terms/index.js +7 -1
  484. package/build-module/post-terms/index.js.map +1 -1
  485. package/build-module/post-terms/use-post-terms.js +3 -1
  486. package/build-module/post-terms/use-post-terms.js.map +1 -1
  487. package/build-module/post-title/index.js +7 -1
  488. package/build-module/post-title/index.js.map +1 -1
  489. package/build-module/preformatted/index.js +9 -1
  490. package/build-module/preformatted/index.js.map +1 -1
  491. package/build-module/pullquote/index.js +12 -0
  492. package/build-module/pullquote/index.js.map +1 -1
  493. package/build-module/query/edit/index.js +1 -1
  494. package/build-module/query/edit/index.js.map +1 -1
  495. package/build-module/query/save.js +4 -2
  496. package/build-module/query/save.js.map +1 -1
  497. package/build-module/query-pagination/edit.js +1 -1
  498. package/build-module/query-pagination/edit.js.map +1 -1
  499. package/build-module/query-pagination-next/index.js +8 -1
  500. package/build-module/query-pagination-next/index.js.map +1 -1
  501. package/build-module/query-pagination-previous/index.js +8 -1
  502. package/build-module/query-pagination-previous/index.js.map +1 -1
  503. package/build-module/query-title/index.js +10 -1
  504. package/build-module/query-title/index.js.map +1 -1
  505. package/build-module/quote/index.js +13 -1
  506. package/build-module/quote/index.js.map +1 -1
  507. package/build-module/search/edit.js +28 -2
  508. package/build-module/search/edit.js.map +1 -1
  509. package/build-module/separator/separator-settings.js +1 -0
  510. package/build-module/separator/separator-settings.js.map +1 -1
  511. package/build-module/site-tagline/index.js +4 -1
  512. package/build-module/site-tagline/index.js.map +1 -1
  513. package/build-module/site-title/index.js +8 -1
  514. package/build-module/site-title/index.js.map +1 -1
  515. package/build-module/social-links/edit.js +2 -1
  516. package/build-module/social-links/edit.js.map +1 -1
  517. package/build-module/social-links/save.js +5 -3
  518. package/build-module/social-links/save.js.map +1 -1
  519. package/build-module/table/index.js +11 -0
  520. package/build-module/table/index.js.map +1 -1
  521. package/build-module/template-part/edit/inner-blocks.js +1 -1
  522. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  523. package/build-module/term-description/index.js +4 -1
  524. package/build-module/term-description/index.js.map +1 -1
  525. package/build-module/verse/index.js +10 -1
  526. package/build-module/verse/index.js.map +1 -1
  527. package/build-style/button/style-rtl.css +2 -2
  528. package/build-style/button/style.css +2 -2
  529. package/build-style/buttons/editor-rtl.css +0 -5
  530. package/build-style/buttons/editor.css +0 -5
  531. package/build-style/buttons/style-rtl.css +0 -4
  532. package/build-style/buttons/style.css +0 -4
  533. package/build-style/columns/style-rtl.css +1 -1
  534. package/build-style/columns/style.css +1 -1
  535. package/build-style/editor-rtl.css +82 -24
  536. package/build-style/editor.css +82 -24
  537. package/build-style/navigation/editor-rtl.css +56 -9
  538. package/build-style/navigation/editor.css +56 -9
  539. package/build-style/navigation/style-rtl.css +35 -96
  540. package/build-style/navigation/style.css +35 -96
  541. package/build-style/navigation-link/editor-rtl.css +30 -14
  542. package/build-style/navigation-link/editor.css +30 -14
  543. package/build-style/page-list/style-rtl.css +1 -16
  544. package/build-style/page-list/style.css +1 -16
  545. package/build-style/post-comments/style-rtl.css +21 -1
  546. package/build-style/post-comments/style.css +21 -1
  547. package/build-style/post-comments-form/style-rtl.css +29 -0
  548. package/build-style/post-comments-form/style.css +29 -0
  549. package/build-style/post-content/style-rtl.css +79 -0
  550. package/build-style/post-content/style.css +79 -0
  551. package/build-style/separator/style-rtl.css +0 -1
  552. package/build-style/separator/style.css +0 -1
  553. package/build-style/site-logo/style-rtl.css +1 -1
  554. package/build-style/site-logo/style.css +1 -1
  555. package/build-style/style-rtl.css +94 -122
  556. package/build-style/style.css +94 -122
  557. package/package.json +18 -17
  558. package/src/audio/test/edit.native.js +4 -0
  559. package/src/block/edit.js +1 -1
  560. package/src/button/block.json +4 -1
  561. package/src/button/style.scss +2 -2
  562. package/src/buttons/block.json +7 -9
  563. package/src/buttons/deprecated.js +73 -3
  564. package/src/buttons/edit.js +8 -48
  565. package/src/buttons/editor.scss +0 -5
  566. package/src/buttons/index.js +0 -2
  567. package/src/buttons/save.js +4 -21
  568. package/src/buttons/style.scss +0 -4
  569. package/src/code/block.json +24 -1
  570. package/src/column/block.json +1 -0
  571. package/src/column/edit.js +1 -1
  572. package/src/column/save.js +9 -12
  573. package/src/columns/block.json +1 -0
  574. package/src/columns/edit.js +1 -1
  575. package/src/columns/save.js +5 -6
  576. package/src/columns/style.scss +1 -1
  577. package/src/comment-author-avatar/block.json +34 -0
  578. package/src/comment-author-avatar/edit.js +96 -0
  579. package/src/comment-author-avatar/index.js +18 -0
  580. package/src/comment-author-avatar/index.php +62 -0
  581. package/src/{post-comment-author → comment-author-name}/block.json +12 -5
  582. package/src/{post-comment-author → comment-author-name}/deprecated.js +0 -0
  583. package/src/comment-author-name/edit.js +124 -0
  584. package/src/{post-comment-author → comment-author-name}/index.js +5 -5
  585. package/src/comment-author-name/index.php +57 -0
  586. package/src/{post-comment-content → comment-content}/block.json +5 -5
  587. package/src/{post-comment-content → comment-content}/edit.js +28 -18
  588. package/src/{post-comment-content → comment-content}/index.js +1 -1
  589. package/src/{post-comment-content → comment-content}/index.php +14 -9
  590. package/src/{post-comment-date → comment-date}/block.json +9 -6
  591. package/src/{post-comment-date → comment-date}/deprecated.js +0 -0
  592. package/src/comment-date/edit.js +106 -0
  593. package/src/{post-comment-date → comment-date}/index.js +0 -0
  594. package/src/{post-comment-date → comment-date}/index.php +16 -11
  595. package/src/comment-edit-link/block.json +36 -0
  596. package/src/comment-edit-link/edit.js +68 -0
  597. package/src/comment-edit-link/index.js +18 -0
  598. package/src/comment-edit-link/index.php +58 -0
  599. package/src/comment-reply-link/block.json +32 -0
  600. package/src/comment-reply-link/edit.js +59 -0
  601. package/src/comment-reply-link/index.js +18 -0
  602. package/src/comment-reply-link/index.php +80 -0
  603. package/src/comment-template/block.json +15 -0
  604. package/src/comment-template/edit.js +100 -0
  605. package/src/comment-template/index.js +20 -0
  606. package/src/comment-template/index.php +65 -0
  607. package/src/comment-template/save.js +8 -0
  608. package/src/comments-query-loop/block.json +33 -0
  609. package/src/comments-query-loop/edit.js +53 -0
  610. package/src/comments-query-loop/index.js +20 -0
  611. package/src/comments-query-loop/save.js +14 -0
  612. package/src/comments-query-loop/toolbar.js +57 -0
  613. package/src/cover/block.json +1 -0
  614. package/src/cover/edit.js +2 -1
  615. package/src/cover/save.js +6 -4
  616. package/src/embed/edit.native.js +6 -9
  617. package/src/embed/embed-bottom-sheet.native.js +1 -0
  618. package/src/embed/embed-no-preview.native.js +1 -0
  619. package/src/embed/icons.js +6 -0
  620. package/src/embed/test/__snapshots__/index.native.js.snap +181 -0
  621. package/src/embed/test/index.native.js +991 -0
  622. package/src/embed/variations.js +9 -0
  623. package/src/file/test/edit.native.js +4 -0
  624. package/src/freeform/edit.js +14 -4
  625. package/src/gallery/block.json +6 -1
  626. package/src/gallery/edit.js +6 -1
  627. package/src/gallery/editor.scss +0 -1
  628. package/src/gallery/gallery.js +1 -4
  629. package/src/gallery/gallery.native.js +1 -4
  630. package/src/gallery/index.php +52 -0
  631. package/src/gallery/save.js +9 -3
  632. package/src/gallery/shared.js +0 -7
  633. package/src/gallery/use-mobile-warning.js +28 -0
  634. package/src/group/block.json +1 -0
  635. package/src/group/edit.js +1 -1
  636. package/src/group/save.js +3 -8
  637. package/src/group/variations.js +1 -1
  638. package/src/heading/autogenerate-anchors.js +22 -6
  639. package/src/heading/block.json +9 -1
  640. package/src/heading/edit.js +11 -16
  641. package/src/home-link/index.php +3 -1
  642. package/src/image/block.json +1 -1
  643. package/src/image/edit.native.js +117 -63
  644. package/src/image/index.php +42 -0
  645. package/src/image/test/edit.native.js +225 -40
  646. package/src/image/transforms.js +4 -0
  647. package/src/index.js +96 -88
  648. package/src/index.native.js +1 -1
  649. package/src/list/block.json +9 -1
  650. package/src/media-text/edit.js +1 -1
  651. package/src/media-text/save.js +6 -4
  652. package/src/navigation/block.json +15 -8
  653. package/src/navigation/deprecated.js +129 -3
  654. package/src/navigation/edit/index.js +510 -0
  655. package/src/navigation/edit/inner-blocks.js +134 -0
  656. package/src/navigation/edit/navigation-menu-delete-control.js +81 -0
  657. package/src/navigation/edit/navigation-menu-name-control.js +22 -0
  658. package/src/navigation/edit/navigation-menu-name-modal.js +69 -0
  659. package/src/navigation/edit/navigation-menu-publish-button.js +57 -0
  660. package/src/navigation/edit/navigation-menu-selector.js +42 -0
  661. package/src/navigation/edit/placeholder/index.js +257 -0
  662. package/src/navigation/{placeholder-preview.js → edit/placeholder/placeholder-preview.js} +13 -2
  663. package/src/navigation/{responsive-wrapper.js → edit/responsive-wrapper.js} +0 -0
  664. package/src/navigation/edit/unsaved-inner-blocks.js +197 -0
  665. package/src/navigation/edit/use-list-view-modal.js +72 -0
  666. package/src/navigation/editor.scss +84 -24
  667. package/src/navigation/index.js +0 -2
  668. package/src/navigation/index.php +46 -6
  669. package/src/navigation/save.js +7 -1
  670. package/src/navigation/style.scss +47 -125
  671. package/src/navigation/use-navigation-menu.js +60 -0
  672. package/src/navigation/use-template-part-area-label.js +78 -0
  673. package/src/navigation-area/block.json +27 -0
  674. package/src/navigation-area/edit.js +105 -0
  675. package/src/navigation-area/index.js +26 -0
  676. package/src/navigation-area/index.php +21 -0
  677. package/src/navigation-area/inner-blocks.js +24 -0
  678. package/src/navigation-area/save.js +8 -0
  679. package/src/navigation-link/edit.js +93 -4
  680. package/src/navigation-link/editor.scss +29 -19
  681. package/src/navigation-link/index.php +4 -6
  682. package/src/navigation-link/transforms.js +5 -1
  683. package/src/navigation-submenu/edit.js +1 -1
  684. package/src/navigation-submenu/index.php +9 -8
  685. package/src/page-list/block.json +0 -33
  686. package/src/page-list/edit.js +168 -113
  687. package/src/page-list/index.php +22 -27
  688. package/src/page-list/style.scss +1 -23
  689. package/src/paragraph/block.json +8 -1
  690. package/src/pattern/block.json +17 -0
  691. package/src/pattern/edit.js +41 -0
  692. package/src/pattern/index.js +12 -0
  693. package/src/pattern/index.php +44 -0
  694. package/src/post-author/block.json +12 -1
  695. package/src/post-comment/block.json +4 -3
  696. package/src/post-comment/edit.js +16 -13
  697. package/src/post-comment/save.js +4 -6
  698. package/src/post-comments/block.json +8 -1
  699. package/src/post-comments/index.php +12 -3
  700. package/src/post-comments/style.scss +27 -1
  701. package/src/post-comments-count/block.json +7 -1
  702. package/src/post-comments-form/block.json +8 -1
  703. package/src/post-comments-form/style.scss +47 -7
  704. package/src/post-comments-link/block.json +8 -1
  705. package/src/post-content/edit.js +1 -1
  706. package/src/post-content/style.scss +4 -0
  707. package/src/post-date/block.json +4 -1
  708. package/src/post-excerpt/block.json +12 -1
  709. package/src/post-excerpt/index.php +7 -1
  710. package/src/post-navigation-link/block.json +8 -1
  711. package/src/post-navigation-link/index.php +1 -2
  712. package/src/post-template/edit.js +8 -3
  713. package/src/post-terms/block.json +7 -1
  714. package/src/post-terms/use-post-terms.js +1 -1
  715. package/src/post-title/block.json +7 -1
  716. package/src/post-title/index.php +7 -2
  717. package/src/preformatted/block.json +9 -1
  718. package/src/pullquote/block.json +12 -0
  719. package/src/query/edit/index.js +1 -1
  720. package/src/query/save.js +4 -6
  721. package/src/query-pagination/edit.js +1 -1
  722. package/src/query-pagination-next/block.json +8 -1
  723. package/src/query-pagination-previous/block.json +8 -1
  724. package/src/query-title/block.json +10 -1
  725. package/src/quote/block.json +13 -1
  726. package/src/search/edit.js +29 -0
  727. package/src/search/test/edit.native.js +4 -0
  728. package/src/separator/separator-settings.js +1 -0
  729. package/src/separator/style.scss +0 -1
  730. package/src/site-logo/index.php +20 -19
  731. package/src/site-logo/style.scss +1 -1
  732. package/src/site-tagline/block.json +4 -1
  733. package/src/site-title/block.json +8 -1
  734. package/src/site-title/index.php +3 -0
  735. package/src/social-links/edit.js +2 -1
  736. package/src/social-links/save.js +4 -6
  737. package/src/style.scss +1 -0
  738. package/src/table/block.json +11 -0
  739. package/src/template-part/edit/inner-blocks.js +1 -1
  740. package/src/template-part/index.php +3 -3
  741. package/src/term-description/block.json +4 -1
  742. package/src/verse/block.json +10 -1
  743. package/build/buttons/variations.js +0 -33
  744. package/build/buttons/variations.js.map +0 -1
  745. package/build/navigation/block-navigation-list.js.map +0 -1
  746. package/build/navigation/edit.js +0 -315
  747. package/build/navigation/edit.js.map +0 -1
  748. package/build/navigation/placeholder-preview.js.map +0 -1
  749. package/build/navigation/placeholder.js +0 -129
  750. package/build/navigation/placeholder.js.map +0 -1
  751. package/build/navigation/responsive-wrapper.js.map +0 -1
  752. package/build/navigation/use-block-navigator.js +0 -51
  753. package/build/navigation/use-block-navigator.js.map +0 -1
  754. package/build/navigation/variations.js +0 -32
  755. package/build/navigation/variations.js.map +0 -1
  756. package/build/post-comment-author/edit.js.map +0 -1
  757. package/build/post-comment-author/index.js.map +0 -1
  758. package/build/post-comment-content/edit.js.map +0 -1
  759. package/build/post-comment-content/index.js.map +0 -1
  760. package/build/post-comment-date/deprecated.js.map +0 -1
  761. package/build/post-comment-date/edit.js.map +0 -1
  762. package/build/post-comment-date/index.js.map +0 -1
  763. package/build-module/buttons/variations.js +0 -24
  764. package/build-module/buttons/variations.js.map +0 -1
  765. package/build-module/navigation/block-navigation-list.js.map +0 -1
  766. package/build-module/navigation/edit.js +0 -295
  767. package/build-module/navigation/edit.js.map +0 -1
  768. package/build-module/navigation/placeholder-preview.js.map +0 -1
  769. package/build-module/navigation/placeholder.js +0 -113
  770. package/build-module/navigation/placeholder.js.map +0 -1
  771. package/build-module/navigation/responsive-wrapper.js.map +0 -1
  772. package/build-module/navigation/use-block-navigator.js +0 -39
  773. package/build-module/navigation/use-block-navigator.js.map +0 -1
  774. package/build-module/navigation/variations.js +0 -23
  775. package/build-module/navigation/variations.js.map +0 -1
  776. package/build-module/post-comment-author/edit.js.map +0 -1
  777. package/build-module/post-comment-author/index.js.map +0 -1
  778. package/build-module/post-comment-content/edit.js.map +0 -1
  779. package/build-module/post-comment-content/index.js.map +0 -1
  780. package/build-module/post-comment-date/deprecated.js.map +0 -1
  781. package/build-module/post-comment-date/edit.js.map +0 -1
  782. package/build-module/post-comment-date/index.js.map +0 -1
  783. package/src/buttons/variations.js +0 -24
  784. package/src/navigation/block-navigation-list.js +0 -38
  785. package/src/navigation/edit.js +0 -436
  786. package/src/navigation/placeholder.js +0 -154
  787. package/src/navigation/use-block-navigator.js +0 -46
  788. package/src/navigation/variations.js +0 -23
  789. package/src/post-comment-author/edit.js +0 -77
  790. package/src/post-comment-author/index.php +0 -47
  791. package/src/post-comment-date/edit.js +0 -77
@@ -1,3 +1,8 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { commentAuthorName as icon } from '@wordpress/icons';
5
+
1
6
  /**
2
7
  * Internal dependencies
3
8
  */
@@ -5,11 +10,6 @@ import metadata from './block.json';
5
10
  import edit from './edit';
6
11
  import deprecated from './deprecated';
7
12
 
8
- /**
9
- * WordPress dependencies
10
- */
11
- import { commentAuthor as icon } from '@wordpress/icons';
12
-
13
13
  const { name } = metadata;
14
14
  export { metadata, name };
15
15
 
@@ -0,0 +1,57 @@
1
+ <?php
2
+ /**
3
+ * Server-side rendering of the `core/comment-author-name` block.
4
+ *
5
+ * @package WordPress
6
+ */
7
+
8
+ /**
9
+ * Renders the `core/comment-author-name` block on the server.
10
+ *
11
+ * @param array $attributes Block attributes.
12
+ * @param string $content Block default content.
13
+ * @param WP_Block $block Block instance.
14
+ * @return string Return the post comment's author.
15
+ */
16
+ function render_block_core_comment_author_name( $attributes, $content, $block ) {
17
+ if ( ! isset( $block->context['commentId'] ) ) {
18
+ return '';
19
+ }
20
+
21
+ $comment = get_comment( $block->context['commentId'] );
22
+ if ( empty( $comment ) ) {
23
+ return '';
24
+ }
25
+
26
+ $classes = '';
27
+ if ( isset( $attributes['textAlign'] ) ) {
28
+ $classes .= 'has-text-align-' . esc_attr( $attributes['textAlign'] );
29
+ }
30
+
31
+ $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
32
+ $comment_author = get_comment_author( $comment );
33
+ $link = get_comment_author_url( $comment );
34
+
35
+ if ( ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) {
36
+ $comment_author = sprintf( '<a rel="external nofollow ugc" href="%1s" target="%2s" >%3s</a>', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author );
37
+ }
38
+
39
+ return sprintf(
40
+ '<div %1$s>%2$s</div>',
41
+ $wrapper_attributes,
42
+ $comment_author
43
+ );
44
+ }
45
+
46
+ /**
47
+ * Registers the `core/comment-author-name` block on the server.
48
+ */
49
+ function register_block_core_comment_author_name() {
50
+ register_block_type_from_metadata(
51
+ __DIR__ . '/comment-author-name',
52
+ array(
53
+ 'render_callback' => 'render_block_core_comment_author_name',
54
+ )
55
+ );
56
+ }
57
+ add_action( 'init', 'register_block_core_comment_author_name' );
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "apiVersion": 2,
3
- "name": "core/post-comment-content",
4
- "title": "Post Comment Content",
5
- "category": "design",
6
- "parent": [ "core/post-comment" ],
7
- "description": "Post comment content",
3
+ "name": "core/comment-content",
4
+ "title": "Comment Content",
5
+ "category": "theme",
6
+ "parent": [ "core/comment-template" ],
7
+ "description": "Displays the contents of a comment.",
8
8
  "textdomain": "default",
9
9
  "usesContext": [ "commentId" ],
10
10
  "attributes": {
@@ -6,7 +6,7 @@ import classnames from 'classnames';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import { __ } from '@wordpress/i18n';
9
+ import { _x } from '@wordpress/i18n';
10
10
  import { RawHTML } from '@wordpress/element';
11
11
  import { Disabled } from '@wordpress/components';
12
12
  import { useEntityProp } from '@wordpress/core-data';
@@ -17,7 +17,7 @@ import {
17
17
  } from '@wordpress/block-editor';
18
18
 
19
19
  /**
20
- * Renders the `core/post-comment-content` block on the editor.
20
+ * Renders the `core/comment-content` block on the editor.
21
21
  *
22
22
  * @param {Object} props React props.
23
23
  * @param {Object} props.setAttributes Callback for updating block attributes.
@@ -38,7 +38,6 @@ export default function Edit( {
38
38
  [ `has-text-align-${ textAlign }` ]: textAlign,
39
39
  } ),
40
40
  } );
41
-
42
41
  const [ content ] = useEntityProp(
43
42
  'root',
44
43
  'comment',
@@ -46,24 +45,35 @@ export default function Edit( {
46
45
  commentId
47
46
  );
48
47
 
48
+ const blockControls = (
49
+ <BlockControls group="block">
50
+ <AlignmentControl
51
+ value={ textAlign }
52
+ onChange={ ( newAlign ) =>
53
+ setAttributes( { textAlign: newAlign } )
54
+ }
55
+ />
56
+ </BlockControls>
57
+ );
58
+
59
+ if ( ! commentId || ! content ) {
60
+ return (
61
+ <>
62
+ { blockControls }
63
+ <div { ...blockProps }>
64
+ <p>{ _x( 'Comment Content', 'block title' ) }</p>
65
+ </div>
66
+ </>
67
+ );
68
+ }
69
+
49
70
  return (
50
71
  <>
51
- <BlockControls group="block">
52
- <AlignmentControl
53
- value={ textAlign }
54
- onChange={ ( newAlign ) =>
55
- setAttributes( { textAlign: newAlign } )
56
- }
57
- />
58
- </BlockControls>
72
+ { blockControls }
59
73
  <div { ...blockProps }>
60
- { ! commentId || ! content ? (
61
- <p>{ __( 'Post Comment Content' ) }</p>
62
- ) : (
63
- <Disabled>
64
- <RawHTML key="html">{ content.rendered }</RawHTML>
65
- </Disabled>
66
- ) }
74
+ <Disabled>
75
+ <RawHTML key="html">{ content.rendered }</RawHTML>
76
+ </Disabled>
67
77
  </div>
68
78
  </>
69
79
  );
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { postCommentContent as icon } from '@wordpress/icons';
4
+ import { commentContent as icon } from '@wordpress/icons';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -1,24 +1,29 @@
1
1
  <?php
2
2
  /**
3
- * Server-side rendering of the `core/post-comment-content` block.
3
+ * Server-side rendering of the `core/comment-content` block.
4
4
  *
5
5
  * @package WordPress
6
6
  */
7
7
 
8
8
  /**
9
- * Renders the `core/post-comment-content` block on the server.
9
+ * Renders the `core/comment-content` block on the server.
10
10
  *
11
11
  * @param array $attributes Block attributes.
12
12
  * @param string $content Block default content.
13
13
  * @param WP_Block $block Block instance.
14
14
  * @return string Return the post comment's content.
15
15
  */
16
- function render_block_core_post_comment_content( $attributes, $content, $block ) {
16
+ function render_block_core_comment_content( $attributes, $content, $block ) {
17
17
  if ( ! isset( $block->context['commentId'] ) ) {
18
18
  return '';
19
19
  }
20
20
 
21
- $comment_text = get_comment_text( $block->context['commentId'] );
21
+ $comment = get_comment( $block->context['commentId'] );
22
+ if ( empty( $comment ) ) {
23
+ return '';
24
+ }
25
+
26
+ $comment_text = get_comment_text( $comment );
22
27
  if ( ! $comment_text ) {
23
28
  return '';
24
29
  }
@@ -38,14 +43,14 @@ function render_block_core_post_comment_content( $attributes, $content, $block )
38
43
  }
39
44
 
40
45
  /**
41
- * Registers the `core/post-comment-content` block on the server.
46
+ * Registers the `core/comment-content` block on the server.
42
47
  */
43
- function register_block_core_post_comment_content() {
48
+ function register_block_core_comment_content() {
44
49
  register_block_type_from_metadata(
45
- __DIR__ . '/post-comment-content',
50
+ __DIR__ . '/comment-content',
46
51
  array(
47
- 'render_callback' => 'render_block_core_post_comment_content',
52
+ 'render_callback' => 'render_block_core_comment_content',
48
53
  )
49
54
  );
50
55
  }
51
- add_action( 'init', 'register_block_core_post_comment_content' );
56
+ add_action( 'init', 'register_block_core_comment_content' );
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "apiVersion": 2,
3
- "name": "core/post-comment-date",
4
- "title": "Post Comment Date",
5
- "category": "design",
6
- "parent": [ "core/post-comment" ],
7
- "description": "Post comment date.",
3
+ "name": "core/comment-date",
4
+ "title": "Comment Date",
5
+ "category": "theme",
6
+ "parent": [ "core/comment-template" ],
7
+ "description": "Add the date of this comment.",
8
8
  "textdomain": "default",
9
9
  "attributes": {
10
10
  "format": {
@@ -29,7 +29,10 @@
29
29
  "__experimentalFontWeight": true,
30
30
  "__experimentalFontStyle": true,
31
31
  "__experimentalTextTransform": true,
32
- "__experimentalLetterSpacing": true
32
+ "__experimentalLetterSpacing": true,
33
+ "__experimentalDefaultControls": {
34
+ "fontSize": true
35
+ }
33
36
  }
34
37
  }
35
38
  }
@@ -0,0 +1,106 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useEntityProp } from '@wordpress/core-data';
5
+ import { __experimentalGetSettings, dateI18n } from '@wordpress/date';
6
+ import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
7
+ import {
8
+ PanelBody,
9
+ CustomSelectControl,
10
+ ToggleControl,
11
+ } from '@wordpress/components';
12
+ import { __, _x } from '@wordpress/i18n';
13
+
14
+ /**
15
+ * Renders the `core/comment-date` block on the editor.
16
+ *
17
+ * @param {Object} props React props.
18
+ * @param {Object} props.setAttributes Callback for updating block attributes.
19
+ * @param {Object} props.attributes Block attributes.
20
+ * @param {string} props.attributes.format Format of the date.
21
+ * @param {string} props.attributes.isLink Whether the author name should be linked.
22
+ * @param {Object} props.context Inherited context.
23
+ * @param {string} props.context.commentId The comment ID.
24
+ *
25
+ * @return {JSX.Element} React element.
26
+ */
27
+ export default function Edit( {
28
+ attributes: { format, isLink },
29
+ context: { commentId },
30
+ setAttributes,
31
+ } ) {
32
+ const blockProps = useBlockProps();
33
+ const [ date ] = useEntityProp( 'root', 'comment', 'date', commentId );
34
+ const [ siteDateFormat ] = useEntityProp( 'root', 'site', 'date_format' );
35
+
36
+ const settings = __experimentalGetSettings();
37
+ const formatOptions = Object.values( settings.formats ).map(
38
+ ( formatOption ) => ( {
39
+ key: formatOption,
40
+ name: dateI18n( formatOption, date || new Date() ),
41
+ } )
42
+ );
43
+ const resolvedFormat = format || siteDateFormat || settings.formats.date;
44
+
45
+ const inspectorControls = (
46
+ <InspectorControls>
47
+ <PanelBody title={ __( 'Format settings' ) }>
48
+ <CustomSelectControl
49
+ hideLabelFromVision
50
+ label={ __( 'Date Format' ) }
51
+ options={ formatOptions }
52
+ onChange={ ( { selectedItem } ) =>
53
+ setAttributes( {
54
+ format: selectedItem.key,
55
+ } )
56
+ }
57
+ value={ formatOptions.find(
58
+ ( option ) => option.key === resolvedFormat
59
+ ) }
60
+ />
61
+ </PanelBody>
62
+ <PanelBody title={ __( 'Link settings' ) }>
63
+ <ToggleControl
64
+ label={ __( 'Link to comment' ) }
65
+ onChange={ () => setAttributes( { isLink: ! isLink } ) }
66
+ checked={ isLink }
67
+ />
68
+ </PanelBody>
69
+ </InspectorControls>
70
+ );
71
+
72
+ if ( ! commentId || ! date ) {
73
+ return (
74
+ <>
75
+ { inspectorControls }
76
+ <div { ...blockProps }>
77
+ <p>{ _x( 'Comment Date', 'block title' ) }</p>
78
+ </div>
79
+ </>
80
+ );
81
+ }
82
+
83
+ let commentDate = (
84
+ <time dateTime={ dateI18n( 'c', date ) }>
85
+ { dateI18n( resolvedFormat, date ) }
86
+ </time>
87
+ );
88
+
89
+ if ( isLink ) {
90
+ commentDate = (
91
+ <a
92
+ href="#comment-date-pseudo-link"
93
+ onClick={ ( event ) => event.preventDefault() }
94
+ >
95
+ { commentDate }
96
+ </a>
97
+ );
98
+ }
99
+
100
+ return (
101
+ <>
102
+ { inspectorControls }
103
+ <div { ...blockProps }>{ commentDate }</div>
104
+ </>
105
+ );
106
+ }
File without changes
@@ -1,29 +1,34 @@
1
1
  <?php
2
2
  /**
3
- * Server-side rendering of the `core/post-comment-date` block.
3
+ * Server-side rendering of the `core/comment-date` block.
4
4
  *
5
5
  * @package WordPress
6
6
  */
7
7
 
8
8
  /**
9
- * Renders the `core/post-comment-date` block on the server.
9
+ * Renders the `core/comment-date` block on the server.
10
10
  *
11
11
  * @param array $attributes Block attributes.
12
12
  * @param string $content Block default content.
13
13
  * @param WP_Block $block Block instance.
14
14
  * @return string Return the post comment's date.
15
15
  */
16
- function render_block_core_post_comment_date( $attributes, $content, $block ) {
16
+ function render_block_core_comment_date( $attributes, $content, $block ) {
17
17
  if ( ! isset( $block->context['commentId'] ) ) {
18
18
  return '';
19
19
  }
20
20
 
21
+ $comment = get_comment( $block->context['commentId'] );
22
+ if ( empty( $comment ) ) {
23
+ return '';
24
+ }
25
+
21
26
  $wrapper_attributes = get_block_wrapper_attributes();
22
27
  $formatted_date = get_comment_date(
23
28
  isset( $attributes['format'] ) ? $attributes['format'] : '',
24
- $block->context['commentId']
29
+ $comment
25
30
  );
26
- $link = get_comment_link( $block->context['commentId'] );
31
+ $link = get_comment_link( $comment );
27
32
 
28
33
  if ( ! empty( $attributes['isLink'] ) ) {
29
34
  $formatted_date = sprintf( '<a href="%1s">%2s</a>', $link, $formatted_date );
@@ -32,20 +37,20 @@ function render_block_core_post_comment_date( $attributes, $content, $block ) {
32
37
  return sprintf(
33
38
  '<div %1$s><time datetime="%2$s">%3$s</time></div>',
34
39
  $wrapper_attributes,
35
- get_comment_date( 'c', $block->context['commentId'] ),
40
+ get_comment_date( 'c', $comment ),
36
41
  $formatted_date
37
42
  );
38
43
  }
39
44
 
40
45
  /**
41
- * Registers the `core/post-comment-date` block on the server.
46
+ * Registers the `core/comment-date` block on the server.
42
47
  */
43
- function register_block_core_post_comment_date() {
48
+ function register_block_core_comment_date() {
44
49
  register_block_type_from_metadata(
45
- __DIR__ . '/post-comment-date',
50
+ __DIR__ . '/comment-date',
46
51
  array(
47
- 'render_callback' => 'render_block_core_post_comment_date',
52
+ 'render_callback' => 'render_block_core_comment_date',
48
53
  )
49
54
  );
50
55
  }
51
- add_action( 'init', 'register_block_core_post_comment_date' );
56
+ add_action( 'init', 'register_block_core_comment_date' );
@@ -0,0 +1,36 @@
1
+ {
2
+ "apiVersion": 2,
3
+ "name": "core/comment-edit-link",
4
+ "title": "Comment Edit Link",
5
+ "category": "theme",
6
+ "parent": [ "core/comment-template" ],
7
+ "description": "Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.",
8
+ "textdomain": "default",
9
+ "usesContext": [ "commentId" ],
10
+ "attributes": {
11
+ "linkTarget": {
12
+ "type": "string",
13
+ "default": "_self"
14
+ },
15
+ "textAlign": {
16
+ "type": "string"
17
+ }
18
+ },
19
+ "supports": {
20
+ "html": false,
21
+ "color": {
22
+ "link": true,
23
+ "gradients": true,
24
+ "text": false
25
+ },
26
+ "typography": {
27
+ "fontSize": true,
28
+ "lineHeight": true,
29
+ "__experimentalFontFamily": true,
30
+ "__experimentalFontWeight": true,
31
+ "__experimentalFontStyle": true,
32
+ "__experimentalTextTransform": true,
33
+ "__experimentalLetterSpacing": true
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import classnames from 'classnames';
5
+
6
+ /**
7
+ * WordPress dependencies
8
+ */
9
+ import {
10
+ AlignmentControl,
11
+ BlockControls,
12
+ InspectorControls,
13
+ useBlockProps,
14
+ } from '@wordpress/block-editor';
15
+ import { PanelBody, ToggleControl } from '@wordpress/components';
16
+ import { __ } from '@wordpress/i18n';
17
+
18
+ export default function Edit( {
19
+ attributes: { linkTarget, textAlign },
20
+ setAttributes,
21
+ } ) {
22
+ const blockProps = useBlockProps( {
23
+ className: classnames( {
24
+ [ `has-text-align-${ textAlign }` ]: textAlign,
25
+ } ),
26
+ } );
27
+
28
+ const blockControls = (
29
+ <BlockControls group="block">
30
+ <AlignmentControl
31
+ value={ textAlign }
32
+ onChange={ ( newAlign ) =>
33
+ setAttributes( { textAlign: newAlign } )
34
+ }
35
+ />
36
+ </BlockControls>
37
+ );
38
+ const inspectorControls = (
39
+ <InspectorControls>
40
+ <PanelBody title={ __( 'Link settings' ) }>
41
+ <ToggleControl
42
+ label={ __( 'Open in new tab' ) }
43
+ onChange={ ( value ) =>
44
+ setAttributes( {
45
+ linkTarget: value ? '_blank' : '_self',
46
+ } )
47
+ }
48
+ checked={ linkTarget === '_blank' }
49
+ />
50
+ </PanelBody>
51
+ </InspectorControls>
52
+ );
53
+
54
+ return (
55
+ <>
56
+ { blockControls }
57
+ { inspectorControls }
58
+ <div { ...blockProps }>
59
+ <a
60
+ href="#edit-comment-pseudo-link"
61
+ onClick={ ( event ) => event.preventDefault() }
62
+ >
63
+ { __( 'Edit' ) }
64
+ </a>
65
+ </div>
66
+ </>
67
+ );
68
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { edit as icon } from '@wordpress/icons';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import metadata from './block.json';
10
+ import edit from './edit';
11
+
12
+ const { name } = metadata;
13
+ export { metadata, name };
14
+
15
+ export const settings = {
16
+ icon,
17
+ edit,
18
+ };
@@ -0,0 +1,58 @@
1
+ <?php
2
+ /**
3
+ * Server-side rendering of the `core/comment-edit-link` block.
4
+ *
5
+ * @package WordPress
6
+ */
7
+
8
+ /**
9
+ * Renders the `core/comment-edit-link` block on the server.
10
+ *
11
+ * @param array $attributes Block attributes.
12
+ * @param string $content Block default content.
13
+ * @param WP_Block $block Block instance.
14
+ *
15
+ * @return string Return the post comment's date.
16
+ */
17
+ function render_block_core_comment_edit_link( $attributes, $content, $block ) {
18
+ if ( ! isset( $block->context['commentId'] ) || ! current_user_can( 'edit_comment', $block->context['commentId'] ) ) {
19
+ return '';
20
+ }
21
+
22
+ $edit_comment_link = get_edit_comment_link( $block->context['commentId'] );
23
+
24
+ $link_atts = '';
25
+
26
+ if ( ! empty( $attributes['linkTarget'] ) ) {
27
+ $link_atts .= sprintf( 'target="%s"', esc_attr( $attributes['linkTarget'] ) );
28
+ }
29
+
30
+ $classes = '';
31
+ if ( isset( $attributes['textAlign'] ) ) {
32
+ $classes .= 'has-text-align-' . esc_attr( $attributes['textAlign'] );
33
+ }
34
+
35
+ $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
36
+
37
+ return sprintf(
38
+ '<div %1$s><a href="%2$s" %3$s>%4$s</a></div>',
39
+ $wrapper_attributes,
40
+ esc_url( $edit_comment_link ),
41
+ $link_atts,
42
+ esc_html__( 'Edit' )
43
+ );
44
+ }
45
+
46
+ /**
47
+ * Registers the `core/comment-edit-link` block on the server.
48
+ */
49
+ function register_block_core_comment_edit_link() {
50
+ register_block_type_from_metadata(
51
+ __DIR__ . '/comment-edit-link',
52
+ array(
53
+ 'render_callback' => 'render_block_core_comment_edit_link',
54
+ )
55
+ );
56
+ }
57
+
58
+ add_action( 'init', 'register_block_core_comment_edit_link' );
@@ -0,0 +1,32 @@
1
+ {
2
+ "apiVersion": 2,
3
+ "name": "core/comment-reply-link",
4
+ "title": "Comment Reply Link",
5
+ "category": "theme",
6
+ "parent": [ "core/comment-template" ],
7
+ "description": "Displays a link to reply to a comment.",
8
+ "textdomain": "default",
9
+ "usesContext": [ "commentId" ],
10
+ "attributes": {
11
+ "textAlign": {
12
+ "type": "string"
13
+ }
14
+ },
15
+ "supports": {
16
+ "color": {
17
+ "gradients": true,
18
+ "link": true,
19
+ "text": false
20
+ },
21
+ "typography": {
22
+ "fontSize": true,
23
+ "lineHeight": true,
24
+ "__experimentalFontFamily": true,
25
+ "__experimentalFontWeight": true,
26
+ "__experimentalFontStyle": true,
27
+ "__experimentalTextTransform": true,
28
+ "__experimentalLetterSpacing": true
29
+ },
30
+ "html": false
31
+ }
32
+ }