@wordpress/block-library 7.3.0 → 7.4.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 (310) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/archives/edit.js +1 -1
  3. package/build/archives/edit.js.map +1 -1
  4. package/build/audio/edit.js +2 -2
  5. package/build/audio/edit.js.map +1 -1
  6. package/build/audio/edit.native.js +1 -1
  7. package/build/audio/edit.native.js.map +1 -1
  8. package/build/categories/edit.js +8 -3
  9. package/build/categories/edit.js.map +1 -1
  10. package/build/categories/index.js +4 -0
  11. package/build/categories/index.js.map +1 -1
  12. package/build/column/index.js +10 -0
  13. package/build/column/index.js.map +1 -1
  14. package/build/comment-template/edit.js +3 -1
  15. package/build/comment-template/edit.js.map +1 -1
  16. package/build/comment-template/hooks.js +14 -4
  17. package/build/comment-template/hooks.js.map +1 -1
  18. package/build/comments-pagination/edit.js +18 -1
  19. package/build/comments-pagination/edit.js.map +1 -1
  20. package/build/comments-query-loop/edit.js +1 -1
  21. package/build/comments-query-loop/edit.js.map +1 -1
  22. package/build/comments-title/edit.js +149 -0
  23. package/build/comments-title/edit.js.map +1 -0
  24. package/build/comments-title/index.js +101 -0
  25. package/build/comments-title/index.js.map +1 -0
  26. package/build/cover/transforms.js +33 -32
  27. package/build/cover/transforms.js.map +1 -1
  28. package/build/embed/edit.js +12 -18
  29. package/build/embed/edit.js.map +1 -1
  30. package/build/embed/edit.native.js +1 -7
  31. package/build/embed/edit.native.js.map +1 -1
  32. package/build/embed/util.js +29 -4
  33. package/build/embed/util.js.map +1 -1
  34. package/build/file/inspector.js +2 -4
  35. package/build/file/inspector.js.map +1 -1
  36. package/build/gallery/edit.js +1 -1
  37. package/build/gallery/edit.js.map +1 -1
  38. package/build/gallery/v1/edit.js +1 -1
  39. package/build/gallery/v1/edit.js.map +1 -1
  40. package/build/html/edit.js +2 -2
  41. package/build/html/edit.js.map +1 -1
  42. package/build/image/edit.js +4 -6
  43. package/build/image/edit.js.map +1 -1
  44. package/build/image/edit.native.js +1 -1
  45. package/build/image/edit.native.js.map +1 -1
  46. package/build/image/image.js +1 -1
  47. package/build/image/image.js.map +1 -1
  48. package/build/index.js +5 -3
  49. package/build/index.js.map +1 -1
  50. package/build/index.native.js +14 -3
  51. package/build/index.native.js.map +1 -1
  52. package/build/latest-comments/edit.js +1 -1
  53. package/build/latest-comments/edit.js.map +1 -1
  54. package/build/list/index.js +13 -2
  55. package/build/list/index.js.map +1 -1
  56. package/build/loginout/edit.js +1 -1
  57. package/build/loginout/edit.js.map +1 -1
  58. package/build/media-text/edit.js +1 -2
  59. package/build/media-text/edit.js.map +1 -1
  60. package/build/media-text/edit.native.js +1 -1
  61. package/build/media-text/edit.native.js.map +1 -1
  62. package/build/navigation/edit/index.js +17 -1
  63. package/build/navigation/edit/index.js.map +1 -1
  64. package/build/navigation/edit/navigation-menu-selector.js +7 -2
  65. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  66. package/build/navigation/edit/unsaved-inner-blocks.js +5 -4
  67. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  68. package/build/navigation/index.js +1 -1
  69. package/build/navigation/view-modal.js +37 -0
  70. package/build/navigation/view-modal.js.map +1 -0
  71. package/build/navigation/view.js +1 -34
  72. package/build/navigation/view.js.map +1 -1
  73. package/build/paragraph/edit.native.js +6 -2
  74. package/build/paragraph/edit.native.js.map +1 -1
  75. package/build/post-author/edit.js +1 -1
  76. package/build/post-author/edit.js.map +1 -1
  77. package/build/post-comments/index.js +4 -3
  78. package/build/post-comments/index.js.map +1 -1
  79. package/build/post-excerpt/edit.js +1 -1
  80. package/build/post-excerpt/edit.js.map +1 -1
  81. package/build/post-featured-image/edit.js +19 -7
  82. package/build/post-featured-image/edit.js.map +1 -1
  83. package/build/query/edit/index.js +84 -22
  84. package/build/query/edit/index.js.map +1 -1
  85. package/build/query/edit/query-placeholder.js +7 -14
  86. package/build/query/edit/query-placeholder.js.map +1 -1
  87. package/build/query/edit/query-toolbar.js +6 -1
  88. package/build/query/edit/query-toolbar.js.map +1 -1
  89. package/build/quote/index.js +19 -2
  90. package/build/quote/index.js.map +1 -1
  91. package/build/quote/v2/edit.js +11 -3
  92. package/build/quote/v2/edit.js.map +1 -1
  93. package/build/rss/edit.js +1 -1
  94. package/build/rss/edit.js.map +1 -1
  95. package/build/search/edit.js +11 -9
  96. package/build/search/edit.js.map +1 -1
  97. package/build/spacer/constants.js +9 -0
  98. package/build/spacer/constants.js.map +1 -0
  99. package/build/spacer/controls.js +3 -3
  100. package/build/spacer/controls.js.map +1 -1
  101. package/build/spacer/controls.native.js +2 -2
  102. package/build/spacer/controls.native.js.map +1 -1
  103. package/build/spacer/edit.js +5 -6
  104. package/build/spacer/edit.js.map +1 -1
  105. package/build/table/edit.js +8 -2
  106. package/build/table/edit.js.map +1 -1
  107. package/build/tag-cloud/edit.js +1 -1
  108. package/build/tag-cloud/edit.js.map +1 -1
  109. package/build/video/edit.js +1 -1
  110. package/build/video/edit.js.map +1 -1
  111. package/build/video/edit.native.js +1 -1
  112. package/build/video/edit.native.js.map +1 -1
  113. package/build-module/archives/edit.js +1 -1
  114. package/build-module/archives/edit.js.map +1 -1
  115. package/build-module/audio/edit.js +2 -2
  116. package/build-module/audio/edit.js.map +1 -1
  117. package/build-module/audio/edit.native.js +1 -1
  118. package/build-module/audio/edit.native.js.map +1 -1
  119. package/build-module/categories/edit.js +8 -3
  120. package/build-module/categories/edit.js.map +1 -1
  121. package/build-module/categories/index.js +4 -0
  122. package/build-module/categories/index.js.map +1 -1
  123. package/build-module/column/index.js +10 -0
  124. package/build-module/column/index.js.map +1 -1
  125. package/build-module/comment-template/edit.js +3 -1
  126. package/build-module/comment-template/edit.js.map +1 -1
  127. package/build-module/comment-template/hooks.js +14 -4
  128. package/build-module/comment-template/hooks.js.map +1 -1
  129. package/build-module/comments-pagination/edit.js +19 -2
  130. package/build-module/comments-pagination/edit.js.map +1 -1
  131. package/build-module/comments-query-loop/edit.js +1 -1
  132. package/build-module/comments-query-loop/edit.js.map +1 -1
  133. package/build-module/comments-title/edit.js +133 -0
  134. package/build-module/comments-title/edit.js.map +1 -0
  135. package/build-module/comments-title/index.js +88 -0
  136. package/build-module/comments-title/index.js.map +1 -0
  137. package/build-module/cover/transforms.js +33 -32
  138. package/build-module/cover/transforms.js.map +1 -1
  139. package/build-module/embed/edit.js +13 -19
  140. package/build-module/embed/edit.js.map +1 -1
  141. package/build-module/embed/edit.native.js +2 -8
  142. package/build-module/embed/edit.native.js.map +1 -1
  143. package/build-module/embed/util.js +25 -3
  144. package/build-module/embed/util.js.map +1 -1
  145. package/build-module/file/inspector.js +2 -4
  146. package/build-module/file/inspector.js.map +1 -1
  147. package/build-module/gallery/edit.js +1 -1
  148. package/build-module/gallery/edit.js.map +1 -1
  149. package/build-module/gallery/v1/edit.js +1 -1
  150. package/build-module/gallery/v1/edit.js.map +1 -1
  151. package/build-module/html/edit.js +2 -2
  152. package/build-module/html/edit.js.map +1 -1
  153. package/build-module/image/edit.js +4 -6
  154. package/build-module/image/edit.js.map +1 -1
  155. package/build-module/image/edit.native.js +1 -1
  156. package/build-module/image/edit.native.js.map +1 -1
  157. package/build-module/image/image.js +1 -1
  158. package/build-module/image/image.js.map +1 -1
  159. package/build-module/index.js +4 -3
  160. package/build-module/index.js.map +1 -1
  161. package/build-module/index.native.js +14 -3
  162. package/build-module/index.native.js.map +1 -1
  163. package/build-module/latest-comments/edit.js +1 -1
  164. package/build-module/latest-comments/edit.js.map +1 -1
  165. package/build-module/list/index.js +9 -3
  166. package/build-module/list/index.js.map +1 -1
  167. package/build-module/loginout/edit.js +1 -1
  168. package/build-module/loginout/edit.js.map +1 -1
  169. package/build-module/media-text/edit.js +1 -2
  170. package/build-module/media-text/edit.js.map +1 -1
  171. package/build-module/media-text/edit.native.js +1 -1
  172. package/build-module/media-text/edit.native.js.map +1 -1
  173. package/build-module/navigation/edit/index.js +17 -1
  174. package/build-module/navigation/edit/index.js.map +1 -1
  175. package/build-module/navigation/edit/navigation-menu-selector.js +6 -2
  176. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  177. package/build-module/navigation/edit/unsaved-inner-blocks.js +5 -4
  178. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  179. package/build-module/navigation/index.js +1 -1
  180. package/build-module/navigation/view-modal.js +32 -0
  181. package/build-module/navigation/view-modal.js.map +1 -0
  182. package/build-module/navigation/view.js +1 -30
  183. package/build-module/navigation/view.js.map +1 -1
  184. package/build-module/paragraph/edit.native.js +6 -2
  185. package/build-module/paragraph/edit.native.js.map +1 -1
  186. package/build-module/post-author/edit.js +1 -1
  187. package/build-module/post-author/edit.js.map +1 -1
  188. package/build-module/post-comments/index.js +4 -3
  189. package/build-module/post-comments/index.js.map +1 -1
  190. package/build-module/post-excerpt/edit.js +1 -1
  191. package/build-module/post-excerpt/edit.js.map +1 -1
  192. package/build-module/post-featured-image/edit.js +19 -7
  193. package/build-module/post-featured-image/edit.js.map +1 -1
  194. package/build-module/query/edit/index.js +87 -26
  195. package/build-module/query/edit/index.js.map +1 -1
  196. package/build-module/query/edit/query-placeholder.js +8 -15
  197. package/build-module/query/edit/query-placeholder.js.map +1 -1
  198. package/build-module/query/edit/query-toolbar.js +6 -1
  199. package/build-module/query/edit/query-toolbar.js.map +1 -1
  200. package/build-module/quote/index.js +10 -4
  201. package/build-module/quote/index.js.map +1 -1
  202. package/build-module/quote/v2/edit.js +10 -3
  203. package/build-module/quote/v2/edit.js.map +1 -1
  204. package/build-module/rss/edit.js +1 -1
  205. package/build-module/rss/edit.js.map +1 -1
  206. package/build-module/search/edit.js +11 -9
  207. package/build-module/search/edit.js.map +1 -1
  208. package/build-module/spacer/constants.js +2 -0
  209. package/build-module/spacer/constants.js.map +1 -0
  210. package/build-module/spacer/controls.js +2 -2
  211. package/build-module/spacer/controls.js.map +1 -1
  212. package/build-module/spacer/controls.native.js +1 -1
  213. package/build-module/spacer/controls.native.js.map +1 -1
  214. package/build-module/spacer/edit.js +1 -1
  215. package/build-module/spacer/edit.js.map +1 -1
  216. package/build-module/table/edit.js +9 -3
  217. package/build-module/table/edit.js.map +1 -1
  218. package/build-module/tag-cloud/edit.js +1 -1
  219. package/build-module/tag-cloud/edit.js.map +1 -1
  220. package/build-module/video/edit.js +1 -1
  221. package/build-module/video/edit.js.map +1 -1
  222. package/build-module/video/edit.native.js +1 -1
  223. package/build-module/video/edit.native.js.map +1 -1
  224. package/build-style/comments-title/editor-rtl.css +79 -0
  225. package/build-style/comments-title/editor.css +79 -0
  226. package/build-style/common-rtl.css +32 -0
  227. package/build-style/common.css +32 -0
  228. package/build-style/editor-rtl.css +51 -0
  229. package/build-style/editor.css +51 -0
  230. package/build-style/post-comments-form/style-rtl.css +9 -0
  231. package/build-style/post-comments-form/style.css +9 -0
  232. package/build-style/query/editor-rtl.css +39 -0
  233. package/build-style/query/editor.css +39 -0
  234. package/build-style/style-rtl.css +79 -0
  235. package/build-style/style.css +79 -0
  236. package/build-style/table/editor-rtl.css +8 -0
  237. package/build-style/table/editor.css +8 -0
  238. package/build-style/table/style-rtl.css +38 -0
  239. package/build-style/table/style.css +38 -0
  240. package/package.json +28 -28
  241. package/src/archives/edit.js +1 -1
  242. package/src/audio/edit.js +2 -2
  243. package/src/audio/edit.native.js +1 -1
  244. package/src/categories/block.json +4 -0
  245. package/src/categories/edit.js +8 -2
  246. package/src/categories/index.php +1 -0
  247. package/src/column/block.json +10 -0
  248. package/src/comment-template/edit.js +5 -2
  249. package/src/comment-template/hooks.js +15 -2
  250. package/src/comment-template/index.php +23 -2
  251. package/src/comments-pagination/edit.js +23 -0
  252. package/src/comments-query-loop/edit.js +1 -0
  253. package/src/comments-title/block.json +70 -0
  254. package/src/comments-title/edit.js +197 -0
  255. package/src/comments-title/editor.scss +4 -0
  256. package/src/comments-title/index.js +18 -0
  257. package/src/comments-title/index.php +68 -0
  258. package/src/common.scss +24 -1
  259. package/src/cover/transforms.js +51 -28
  260. package/src/editor.scss +1 -0
  261. package/src/embed/edit.js +19 -24
  262. package/src/embed/edit.native.js +9 -14
  263. package/src/embed/util.js +34 -2
  264. package/src/file/inspector.js +1 -3
  265. package/src/gallery/edit.js +1 -1
  266. package/src/gallery/v1/edit.js +1 -1
  267. package/src/html/edit.js +2 -2
  268. package/src/image/edit.js +2 -4
  269. package/src/image/edit.native.js +1 -1
  270. package/src/image/image.js +1 -1
  271. package/src/index.js +7 -1
  272. package/src/index.native.js +12 -2
  273. package/src/latest-comments/edit.js +1 -1
  274. package/src/list/index.js +7 -3
  275. package/src/loginout/edit.js +1 -1
  276. package/src/media-text/edit.js +1 -2
  277. package/src/media-text/edit.native.js +1 -1
  278. package/src/navigation/block.json +1 -1
  279. package/src/navigation/edit/index.js +24 -0
  280. package/src/navigation/edit/navigation-menu-selector.js +15 -9
  281. package/src/navigation/edit/unsaved-inner-blocks.js +5 -4
  282. package/src/navigation/index.php +5 -0
  283. package/src/navigation/view-modal.js +36 -0
  284. package/src/navigation/view.js +0 -35
  285. package/src/paragraph/edit.native.js +13 -1
  286. package/src/post-author/edit.js +1 -1
  287. package/src/post-comments/block.json +4 -3
  288. package/src/post-comments-form/index.php +12 -4
  289. package/src/post-comments-form/style.scss +11 -0
  290. package/src/post-excerpt/edit.js +1 -1
  291. package/src/post-featured-image/edit.js +24 -12
  292. package/src/query/edit/index.js +125 -26
  293. package/src/query/edit/query-placeholder.js +3 -13
  294. package/src/query/edit/query-toolbar.js +6 -0
  295. package/src/query/editor.scss +38 -0
  296. package/src/quote/index.js +8 -4
  297. package/src/quote/v2/edit.js +3 -0
  298. package/src/rss/edit.js +1 -1
  299. package/src/search/edit.js +13 -7
  300. package/src/search/index.php +84 -33
  301. package/src/spacer/constants.js +1 -0
  302. package/src/spacer/controls.js +2 -2
  303. package/src/spacer/controls.native.js +1 -1
  304. package/src/spacer/edit.js +1 -2
  305. package/src/table/edit.js +11 -2
  306. package/src/table/editor.scss +13 -0
  307. package/src/table/style.scss +52 -0
  308. package/src/tag-cloud/edit.js +1 -1
  309. package/src/video/edit.js +1 -1
  310. package/src/video/edit.native.js +1 -1
@@ -143,6 +143,44 @@
143
143
  .wp-block-table .has-border-color td {
144
144
  border-color: inherit;
145
145
  }
146
+ .wp-block-table table[style*=border-top-color] > *,
147
+ .wp-block-table table[style*=border-top-color] tr:first-child {
148
+ border-top-color: inherit;
149
+ }
150
+ .wp-block-table table[style*=border-top-color] > * th,
151
+ .wp-block-table table[style*=border-top-color] > * td,
152
+ .wp-block-table table[style*=border-top-color] tr:first-child th,
153
+ .wp-block-table table[style*=border-top-color] tr:first-child td {
154
+ border-top-color: inherit;
155
+ }
156
+ .wp-block-table table[style*=border-top-color] tr:not(:first-child) {
157
+ border-top-color: currentColor;
158
+ }
159
+ .wp-block-table table[style*=border-right-color] > *,
160
+ .wp-block-table table[style*=border-right-color] tr,
161
+ .wp-block-table table[style*=border-right-color] th,
162
+ .wp-block-table table[style*=border-right-color] td:last-child {
163
+ border-left-color: inherit;
164
+ }
165
+ .wp-block-table table[style*=border-bottom-color] > *,
166
+ .wp-block-table table[style*=border-bottom-color] tr:last-child {
167
+ border-bottom-color: inherit;
168
+ }
169
+ .wp-block-table table[style*=border-bottom-color] > * th,
170
+ .wp-block-table table[style*=border-bottom-color] > * td,
171
+ .wp-block-table table[style*=border-bottom-color] tr:last-child th,
172
+ .wp-block-table table[style*=border-bottom-color] tr:last-child td {
173
+ border-bottom-color: inherit;
174
+ }
175
+ .wp-block-table table[style*=border-bottom-color] tr:not(:last-child) {
176
+ border-bottom-color: currentColor;
177
+ }
178
+ .wp-block-table table[style*=border-left-color] > *,
179
+ .wp-block-table table[style*=border-left-color] tr,
180
+ .wp-block-table table[style*=border-left-color] th,
181
+ .wp-block-table table[style*=border-left-color] td:first-child {
182
+ border-right-color: inherit;
183
+ }
146
184
  .wp-block-table table[style*=border-style] > *,
147
185
  .wp-block-table table[style*=border-style] tr,
148
186
  .wp-block-table table[style*=border-style] th,
@@ -143,6 +143,44 @@
143
143
  .wp-block-table .has-border-color td {
144
144
  border-color: inherit;
145
145
  }
146
+ .wp-block-table table[style*=border-top-color] > *,
147
+ .wp-block-table table[style*=border-top-color] tr:first-child {
148
+ border-top-color: inherit;
149
+ }
150
+ .wp-block-table table[style*=border-top-color] > * th,
151
+ .wp-block-table table[style*=border-top-color] > * td,
152
+ .wp-block-table table[style*=border-top-color] tr:first-child th,
153
+ .wp-block-table table[style*=border-top-color] tr:first-child td {
154
+ border-top-color: inherit;
155
+ }
156
+ .wp-block-table table[style*=border-top-color] tr:not(:first-child) {
157
+ border-top-color: currentColor;
158
+ }
159
+ .wp-block-table table[style*=border-right-color] > *,
160
+ .wp-block-table table[style*=border-right-color] tr,
161
+ .wp-block-table table[style*=border-right-color] th,
162
+ .wp-block-table table[style*=border-right-color] td:last-child {
163
+ border-right-color: inherit;
164
+ }
165
+ .wp-block-table table[style*=border-bottom-color] > *,
166
+ .wp-block-table table[style*=border-bottom-color] tr:last-child {
167
+ border-bottom-color: inherit;
168
+ }
169
+ .wp-block-table table[style*=border-bottom-color] > * th,
170
+ .wp-block-table table[style*=border-bottom-color] > * td,
171
+ .wp-block-table table[style*=border-bottom-color] tr:last-child th,
172
+ .wp-block-table table[style*=border-bottom-color] tr:last-child td {
173
+ border-bottom-color: inherit;
174
+ }
175
+ .wp-block-table table[style*=border-bottom-color] tr:not(:last-child) {
176
+ border-bottom-color: currentColor;
177
+ }
178
+ .wp-block-table table[style*=border-left-color] > *,
179
+ .wp-block-table table[style*=border-left-color] tr,
180
+ .wp-block-table table[style*=border-left-color] th,
181
+ .wp-block-table table[style*=border-left-color] td:first-child {
182
+ border-left-color: inherit;
183
+ }
146
184
  .wp-block-table table[style*=border-style] > *,
147
185
  .wp-block-table table[style*=border-style] tr,
148
186
  .wp-block-table table[style*=border-style] th,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "7.3.0",
3
+ "version": "7.4.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -33,32 +33,32 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7.16.0",
36
- "@wordpress/a11y": "^3.6.0",
37
- "@wordpress/api-fetch": "^6.3.0",
38
- "@wordpress/autop": "^3.6.0",
39
- "@wordpress/blob": "^3.6.0",
40
- "@wordpress/block-editor": "^8.5.0",
41
- "@wordpress/blocks": "^11.5.0",
42
- "@wordpress/components": "^19.8.0",
43
- "@wordpress/compose": "^5.4.0",
44
- "@wordpress/core-data": "^4.4.0",
45
- "@wordpress/data": "^6.6.0",
46
- "@wordpress/date": "^4.6.0",
47
- "@wordpress/deprecated": "^3.6.0",
48
- "@wordpress/dom": "^3.6.0",
49
- "@wordpress/element": "^4.4.0",
50
- "@wordpress/hooks": "^3.6.0",
51
- "@wordpress/html-entities": "^3.6.0",
52
- "@wordpress/i18n": "^4.6.0",
53
- "@wordpress/icons": "^8.2.0",
54
- "@wordpress/keycodes": "^3.6.0",
55
- "@wordpress/notices": "^3.6.0",
56
- "@wordpress/primitives": "^3.4.0",
57
- "@wordpress/reusable-blocks": "^3.4.0",
58
- "@wordpress/rich-text": "^5.4.0",
59
- "@wordpress/server-side-render": "^3.4.0",
60
- "@wordpress/url": "^3.7.0",
61
- "@wordpress/viewport": "^4.4.0",
36
+ "@wordpress/a11y": "^3.7.0",
37
+ "@wordpress/api-fetch": "^6.4.0",
38
+ "@wordpress/autop": "^3.7.0",
39
+ "@wordpress/blob": "^3.7.0",
40
+ "@wordpress/block-editor": "^8.6.0",
41
+ "@wordpress/blocks": "^11.6.0",
42
+ "@wordpress/components": "^19.9.0",
43
+ "@wordpress/compose": "^5.5.0",
44
+ "@wordpress/core-data": "^4.5.0",
45
+ "@wordpress/data": "^6.7.0",
46
+ "@wordpress/date": "^4.7.0",
47
+ "@wordpress/deprecated": "^3.7.0",
48
+ "@wordpress/dom": "^3.7.0",
49
+ "@wordpress/element": "^4.5.0",
50
+ "@wordpress/hooks": "^3.7.0",
51
+ "@wordpress/html-entities": "^3.7.0",
52
+ "@wordpress/i18n": "^4.7.0",
53
+ "@wordpress/icons": "^8.3.0",
54
+ "@wordpress/keycodes": "^3.7.0",
55
+ "@wordpress/notices": "^3.7.0",
56
+ "@wordpress/primitives": "^3.5.0",
57
+ "@wordpress/reusable-blocks": "^3.5.0",
58
+ "@wordpress/rich-text": "^5.5.0",
59
+ "@wordpress/server-side-render": "^3.5.0",
60
+ "@wordpress/url": "^3.8.0",
61
+ "@wordpress/viewport": "^4.5.0",
62
62
  "classnames": "^2.3.1",
63
63
  "colord": "^2.7.0",
64
64
  "fast-average-color": "4.3.0",
@@ -74,5 +74,5 @@
74
74
  "publishConfig": {
75
75
  "access": "public"
76
76
  },
77
- "gitHead": "11eb1241e63c9240018323551c6753f8a5fa96f9"
77
+ "gitHead": "1ba52312b56db563df2d8d4fba5b00613fb46d8c"
78
78
  }
@@ -17,7 +17,7 @@ export default function ArchivesEdit( { attributes, setAttributes } ) {
17
17
  return (
18
18
  <>
19
19
  <InspectorControls>
20
- <PanelBody title={ __( 'Archives settings' ) }>
20
+ <PanelBody title={ __( 'Settings' ) }>
21
21
  <ToggleControl
22
22
  label={ __( 'Display as dropdown' ) }
23
23
  checked={ displayAsDropdown }
package/src/audio/edit.js CHANGED
@@ -159,7 +159,7 @@ function AudioEdit( {
159
159
  />
160
160
  </BlockControls>
161
161
  <InspectorControls>
162
- <PanelBody title={ __( 'Audio settings' ) }>
162
+ <PanelBody title={ __( 'Settings' ) }>
163
163
  <ToggleControl
164
164
  label={ __( 'Autoplay' ) }
165
165
  onChange={ toggleAttribute( 'autoplay' ) }
@@ -186,7 +186,7 @@ function AudioEdit( {
186
186
  { value: 'metadata', label: __( 'Metadata' ) },
187
187
  {
188
188
  value: 'none',
189
- label: _x( 'None', '"Preload" value' ),
189
+ label: _x( 'None', 'Preload value' ),
190
190
  },
191
191
  ] }
192
192
  />
@@ -177,7 +177,7 @@ function AudioEdit( {
177
177
  >
178
178
  <View>
179
179
  <InspectorControls>
180
- <PanelBody title={ __( 'Audio settings' ) }>
180
+ <PanelBody title={ __( 'Settings' ) }>
181
181
  <ToggleControl
182
182
  label={ __( 'Autoplay' ) }
183
183
  onChange={ toggleAttribute( 'autoplay' ) }
@@ -22,6 +22,10 @@
22
22
  "showOnlyTopLevel": {
23
23
  "type": "boolean",
24
24
  "default": false
25
+ },
26
+ "showEmpty": {
27
+ "type": "boolean",
28
+ "default": false
25
29
  }
26
30
  },
27
31
  "supports": {
@@ -25,11 +25,12 @@ export default function CategoriesEdit( {
25
25
  showHierarchy,
26
26
  showPostCounts,
27
27
  showOnlyTopLevel,
28
+ showEmpty,
28
29
  },
29
30
  setAttributes,
30
31
  } ) {
31
32
  const selectId = useInstanceId( CategoriesEdit, 'blocks-category-select' );
32
- const query = { per_page: -1, hide_empty: true, context: 'view' };
33
+ const query = { per_page: -1, hide_empty: ! showEmpty, context: 'view' };
33
34
  if ( showOnlyTopLevel ) {
34
35
  query.parent = 0;
35
36
  }
@@ -128,7 +129,7 @@ export default function CategoriesEdit( {
128
129
  return (
129
130
  <div { ...useBlockProps() }>
130
131
  <InspectorControls>
131
- <PanelBody title={ __( 'Categories settings' ) }>
132
+ <PanelBody title={ __( 'Settings' ) }>
132
133
  <ToggleControl
133
134
  label={ __( 'Display as dropdown' ) }
134
135
  checked={ displayAsDropdown }
@@ -144,6 +145,11 @@ export default function CategoriesEdit( {
144
145
  checked={ showOnlyTopLevel }
145
146
  onChange={ toggleAttribute( 'showOnlyTopLevel' ) }
146
147
  />
148
+ <ToggleControl
149
+ label={ __( 'Show empty categories' ) }
150
+ checked={ showEmpty }
151
+ onChange={ toggleAttribute( 'showEmpty' ) }
152
+ />
147
153
  { ! showOnlyTopLevel && (
148
154
  <ToggleControl
149
155
  label={ __( 'Show hierarchy' ) }
@@ -22,6 +22,7 @@ function render_block_core_categories( $attributes ) {
22
22
  'orderby' => 'name',
23
23
  'show_count' => ! empty( $attributes['showPostCounts'] ),
24
24
  'title_li' => '',
25
+ 'hide_empty' => empty( $attributes['showEmpty'] ),
25
26
  );
26
27
  if ( ! empty( $attributes['showOnlyTopLevel'] ) && $attributes['showOnlyTopLevel'] ) {
27
28
  $args['parent'] = 0;
@@ -41,6 +41,16 @@
41
41
  "padding": true
42
42
  }
43
43
  },
44
+ "__experimentalBorder": {
45
+ "color": true,
46
+ "style": true,
47
+ "width": true,
48
+ "__experimentalDefaultControls": {
49
+ "color": true,
50
+ "style": true,
51
+ "width": true
52
+ }
53
+ },
44
54
  "__experimentalLayout": true
45
55
  }
46
56
  }
@@ -252,7 +252,6 @@ export default function CommentTemplateEdit( {
252
252
  ( select ) => {
253
253
  const { getEntityRecords } = select( coreStore );
254
254
  const { getBlocks } = select( blockEditorStore );
255
-
256
255
  return {
257
256
  // Request only top-level comments. Replies are embedded.
258
257
  topLevelComments: commentQuery
@@ -289,7 +288,11 @@ export default function CommentTemplateEdit( {
289
288
  }
290
289
 
291
290
  if ( ! commentTree.length ) {
292
- return <p { ...blockProps }> { __( 'No results found.' ) }</p>;
291
+ return (
292
+ <p { ...blockProps } data-testid="noresults">
293
+ { __( 'No results found.' ) }
294
+ </p>
295
+ );
293
296
  }
294
297
 
295
298
  return (
@@ -7,6 +7,9 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
7
7
  import { addQueryArgs } from '@wordpress/url';
8
8
  import apiFetch from '@wordpress/api-fetch';
9
9
 
10
+ // This is limited by WP REST API
11
+ const MAX_COMMENTS_PER_PAGE = 100;
12
+
10
13
  /**
11
14
  * Return an object with the query args needed to fetch the default page of
12
15
  * comments.
@@ -29,7 +32,8 @@ export const useCommentQueryArgs = ( { postId } ) => {
29
32
 
30
33
  // Get the Discussion settings that may be needed to query the comments.
31
34
  const {
32
- commentsPerPage: perPage,
35
+ pageComments,
36
+ commentsPerPage,
33
37
  defaultCommentsPage: defaultPage,
34
38
  } = useSelect( ( select ) => {
35
39
  const { getSettings } = select( blockEditorStore );
@@ -37,6 +41,14 @@ export const useCommentQueryArgs = ( { postId } ) => {
37
41
  return __experimentalDiscussionSettings;
38
42
  } );
39
43
 
44
+ // WP REST API doesn't allow fetching more than max items limit set per single page of data.
45
+ // As for the editor performance is more important than completeness of data and fetching only the
46
+ // max allowed for single page should be enough for the purpose of design and laying out the page.
47
+ // Fetching over the limit would return an error here but would work with backend query.
48
+ const perPage = pageComments
49
+ ? Math.min( commentsPerPage, MAX_COMMENTS_PER_PAGE )
50
+ : MAX_COMMENTS_PER_PAGE;
51
+
40
52
  // Get the number of the default page.
41
53
  const page = useDefaultPageIndex( {
42
54
  defaultPage,
@@ -96,9 +108,10 @@ const useDefaultPageIndex = ( { defaultPage, postId, perPage, queryArgs } ) => {
96
108
  method: 'HEAD',
97
109
  parse: false,
98
110
  } ).then( ( res ) => {
111
+ const pages = parseInt( res.headers.get( 'X-WP-TotalPages' ) );
99
112
  setDefaultPages( {
100
113
  ...defaultPages,
101
- [ key ]: parseInt( res.headers.get( 'X-WP-TotalPages' ) ),
114
+ [ key ]: pages <= 1 ? 1 : pages, // If there are 0 pages, it means that there are no comments, but there is no 0th page.
102
115
  } );
103
116
  } );
104
117
  }, [ defaultPage, postId, perPage, setDefaultPages ] );
@@ -8,11 +8,19 @@
8
8
  /**
9
9
  * Function that recursively renders a list of nested comments.
10
10
  *
11
- * @param WP_Comment[] $comments The array of comments.
11
+ * @global int $comment_depth
12
+ *
13
+ * @param WP_Comment[] $comments The array of comments.
12
14
  * @param WP_Block $block Block instance.
13
15
  * @return string
14
16
  */
15
17
  function block_core_comment_template_render_comments( $comments, $block ) {
18
+ global $comment_depth;
19
+
20
+ if ( empty( $comment_depth ) ) {
21
+ $comment_depth = 1;
22
+ }
23
+
16
24
  $content = '';
17
25
  foreach ( $comments as $comment ) {
18
26
 
@@ -25,17 +33,30 @@ function block_core_comment_template_render_comments( $comments, $block ) {
25
33
 
26
34
  $children = $comment->get_children();
27
35
 
36
+ /*
37
+ * We need to create the CSS classes BEFORE recursing into the children.
38
+ * This is because comment_class() uses globals like `$comment_alt`
39
+ * and `$comment_thread_alt` which are order-sensitive.
40
+ *
41
+ * The `false` parameter at the end means that we do NOT want the function
42
+ * to `echo` the output but to return a string.
43
+ * See https://developer.wordpress.org/reference/functions/comment_class/#parameters.
44
+ */
45
+ $comment_classes = comment_class( '', $comment->comment_ID, $comment->comment_post_ID, false );
46
+
28
47
  // If the comment has children, recurse to create the HTML for the nested
29
48
  // comments.
30
49
  if ( ! empty( $children ) ) {
50
+ $comment_depth += 1;
31
51
  $inner_content = block_core_comment_template_render_comments(
32
52
  $children,
33
53
  $block
34
54
  );
35
55
  $block_content .= sprintf( '<ol>%1$s</ol>', $inner_content );
56
+ $comment_depth -= 1;
36
57
  }
37
58
 
38
- $content .= '<li>' . $block_content . '</li>';
59
+ $content .= sprintf( '<li id="comment-%1$s" %2$s>%3$s</li>', $comment->comment_ID, $comment_classes, $block_content );
39
60
  }
40
61
 
41
62
  return $content;
@@ -7,6 +7,7 @@ import {
7
7
  useBlockProps,
8
8
  useInnerBlocksProps,
9
9
  store as blockEditorStore,
10
+ Warning,
10
11
  } from '@wordpress/block-editor';
11
12
  import { useSelect } from '@wordpress/data';
12
13
  import { getBlockSupport } from '@wordpress/blocks';
@@ -53,6 +54,7 @@ export default function QueryPaginationEdit( {
53
54
  ].includes( innerBlock.name );
54
55
  } );
55
56
  }, [] );
57
+
56
58
  const blockProps = useBlockProps();
57
59
  const innerBlocksProps = useInnerBlocksProps( blockProps, {
58
60
  template: TEMPLATE,
@@ -63,6 +65,27 @@ export default function QueryPaginationEdit( {
63
65
  ],
64
66
  __experimentalLayout: usedLayout,
65
67
  } );
68
+
69
+ // Get the Discussion settings
70
+ const pageComments = useSelect( ( select ) => {
71
+ const { getSettings } = select( blockEditorStore );
72
+ const { __experimentalDiscussionSettings } = getSettings();
73
+ return __experimentalDiscussionSettings?.pageComments;
74
+ }, [] );
75
+
76
+ // If paging comments is not enabled in the Discussion Settings then hide the pagination
77
+ // controls. We don't want to remove them from the template so that when the user enables
78
+ // paging comments, the controls will be visible.
79
+ if ( ! pageComments ) {
80
+ return (
81
+ <Warning>
82
+ { __(
83
+ 'Comments Pagination block: paging comments is disabled in the Discussion Settings'
84
+ ) }
85
+ </Warning>
86
+ );
87
+ }
88
+
66
89
  return (
67
90
  <>
68
91
  { hasNextPreviousBlocks && (
@@ -9,6 +9,7 @@ import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
9
9
  import CommentsInspectorControls from './edit/comments-inspector-controls';
10
10
 
11
11
  const TEMPLATE = [
12
+ [ 'core/comments-title' ],
12
13
  [
13
14
  'core/comment-template',
14
15
  {},
@@ -0,0 +1,70 @@
1
+ {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
3
+ "apiVersion": 2,
4
+ "name": "core/comments-title",
5
+ "title": "Comments Title",
6
+ "category": "theme",
7
+ "ancestor": [ "core/comments-query-loop" ],
8
+ "description": "Displays a title with the number of comments",
9
+ "textdomain": "default",
10
+ "usesContext": [ "postId", "postType" ],
11
+ "attributes": {
12
+ "textAlign": {
13
+ "type": "string"
14
+ },
15
+ "singleCommentLabel": {
16
+ "type": "string"
17
+ },
18
+ "multipleCommentsLabel": {
19
+ "type": "string"
20
+ },
21
+ "showPostTitle": {
22
+ "type": "boolean",
23
+ "default": true
24
+ },
25
+ "showCommentsCount": {
26
+ "type": "boolean",
27
+ "default": true
28
+ },
29
+ "level": {
30
+ "type": "number",
31
+ "default": 2
32
+ }
33
+ },
34
+ "supports": {
35
+ "anchor": false,
36
+ "align": true,
37
+ "html": false,
38
+ "__experimentalBorder": {
39
+ "radius": true,
40
+ "color": true,
41
+ "width": true,
42
+ "style": true
43
+ },
44
+ "color": {
45
+ "gradients": true,
46
+ "__experimentalDefaultControls": {
47
+ "background": true,
48
+ "text": true
49
+ }
50
+ },
51
+ "spacing": {
52
+ "margin": true,
53
+ "padding": true
54
+ },
55
+ "typography": {
56
+ "fontSize": true,
57
+ "lineHeight": true,
58
+ "__experimentalFontStyle": true,
59
+ "__experimentalFontWeight": true,
60
+ "__experimentalFontFamily": true,
61
+ "__experimentalTextTransform": true,
62
+ "__experimentalDefaultControls": {
63
+ "fontSize": true,
64
+ "__experimentalFontFamily": true,
65
+ "__experimentalFontStyle": true,
66
+ "__experimentalFontWeight": true
67
+ }
68
+ }
69
+ }
70
+ }