@wordpress/block-library 7.3.5 → 7.5.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 (400) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/archives/edit.js +1 -1
  3. package/build/archives/edit.js.map +1 -1
  4. package/build/audio/edit.js +4 -16
  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/button/edit.native.js +7 -3
  9. package/build/button/edit.native.js.map +1 -1
  10. package/build/categories/edit.js +8 -3
  11. package/build/categories/edit.js.map +1 -1
  12. package/build/categories/index.js +4 -0
  13. package/build/categories/index.js.map +1 -1
  14. package/build/column/index.js +10 -0
  15. package/build/column/index.js.map +1 -1
  16. package/build/comment-template/edit.js +1 -3
  17. package/build/comment-template/edit.js.map +1 -1
  18. package/build/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
  19. package/{build-module/comments-query-loop → build/comments}/edit/comments-inspector-controls.js.map +1 -1
  20. package/build/{comments-query-loop → comments}/edit.js +2 -2
  21. package/build/comments/edit.js.map +1 -0
  22. package/build/{comments-query-loop → comments}/index.js +1 -1
  23. package/build/comments/index.js.map +1 -0
  24. package/build/{comments-query-loop → comments}/save.js +2 -2
  25. package/build/comments/save.js.map +1 -0
  26. package/build/cover/edit.js +4 -71
  27. package/build/cover/edit.js.map +1 -1
  28. package/build/cover/edit.native.js +36 -15
  29. package/build/cover/edit.native.js.map +1 -1
  30. package/build/cover/transforms.js +77 -6
  31. package/build/cover/transforms.js.map +1 -1
  32. package/build/cover/use-cover-is-dark.js +81 -0
  33. package/build/cover/use-cover-is-dark.js.map +1 -0
  34. package/build/cover/use-cover-is-dark.native.js +60 -0
  35. package/build/cover/use-cover-is-dark.native.js.map +1 -0
  36. package/build/embed/edit.js +12 -18
  37. package/build/embed/edit.js.map +1 -1
  38. package/build/embed/edit.native.js +1 -7
  39. package/build/embed/edit.native.js.map +1 -1
  40. package/build/embed/util.js +29 -4
  41. package/build/embed/util.js.map +1 -1
  42. package/build/file/inspector.js +2 -4
  43. package/build/file/inspector.js.map +1 -1
  44. package/build/gallery/edit.js +1 -1
  45. package/build/gallery/edit.js.map +1 -1
  46. package/build/gallery/v1/edit.js +1 -1
  47. package/build/gallery/v1/edit.js.map +1 -1
  48. package/build/group/index.js +1 -0
  49. package/build/group/index.js.map +1 -1
  50. package/build/heading/transforms.js +8 -4
  51. package/build/heading/transforms.js.map +1 -1
  52. package/build/html/edit.js +2 -2
  53. package/build/html/edit.js.map +1 -1
  54. package/build/image/edit.js +4 -6
  55. package/build/image/edit.js.map +1 -1
  56. package/build/image/edit.native.js +1 -1
  57. package/build/image/edit.native.js.map +1 -1
  58. package/build/image/image.js +1 -1
  59. package/build/image/image.js.map +1 -1
  60. package/build/index.js +4 -6
  61. package/build/index.js.map +1 -1
  62. package/build/index.native.js +14 -3
  63. package/build/index.native.js.map +1 -1
  64. package/build/latest-comments/edit.js +1 -1
  65. package/build/latest-comments/edit.js.map +1 -1
  66. package/build/latest-posts/edit.native.js +49 -0
  67. package/build/latest-posts/edit.native.js.map +1 -1
  68. package/build/loginout/edit.js +1 -1
  69. package/build/loginout/edit.js.map +1 -1
  70. package/build/media-text/edit.js +1 -2
  71. package/build/media-text/edit.js.map +1 -1
  72. package/build/media-text/edit.native.js +1 -1
  73. package/build/media-text/edit.native.js.map +1 -1
  74. package/build/navigation/edit/index.js +5 -28
  75. package/build/navigation/edit/index.js.map +1 -1
  76. package/build/navigation/edit/unsaved-inner-blocks.js +5 -4
  77. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  78. package/build/navigation/index.js +1 -2
  79. package/build/navigation/index.js.map +1 -1
  80. package/build/navigation/view-modal.js +62 -0
  81. package/build/navigation/view-modal.js.map +1 -0
  82. package/build/navigation/view.js +1 -34
  83. package/build/navigation/view.js.map +1 -1
  84. package/build/navigation-link/edit.js +1 -1
  85. package/build/navigation-link/edit.js.map +1 -1
  86. package/build/paragraph/edit.js +10 -0
  87. package/build/paragraph/edit.js.map +1 -1
  88. package/build/paragraph/edit.native.js +6 -2
  89. package/build/paragraph/edit.native.js.map +1 -1
  90. package/build/paragraph/use-enter.js +94 -0
  91. package/build/paragraph/use-enter.js.map +1 -0
  92. package/build/post-author/edit.js +1 -1
  93. package/build/post-author/edit.js.map +1 -1
  94. package/build/post-comment/index.js +1 -1
  95. package/build/post-comments/edit.js +13 -34
  96. package/build/post-comments/edit.js.map +1 -1
  97. package/build/post-comments/index.js +1 -1
  98. package/build/post-comments-form/edit.js +37 -24
  99. package/build/post-comments-form/edit.js.map +1 -1
  100. package/build/post-comments-form/form.js +48 -0
  101. package/build/post-comments-form/form.js.map +1 -0
  102. package/build/post-excerpt/edit.js +1 -1
  103. package/build/post-excerpt/edit.js.map +1 -1
  104. package/build/post-terms/edit.js +25 -3
  105. package/build/post-terms/edit.js.map +1 -1
  106. package/build/post-terms/index.js +8 -0
  107. package/build/post-terms/index.js.map +1 -1
  108. package/build/quote/index.js +7 -0
  109. package/build/quote/index.js.map +1 -1
  110. package/build/quote/v2/edit.js +11 -3
  111. package/build/quote/v2/edit.js.map +1 -1
  112. package/build/rss/edit.js +1 -1
  113. package/build/rss/edit.js.map +1 -1
  114. package/build/search/edit.js +11 -9
  115. package/build/search/edit.js.map +1 -1
  116. package/build/separator/index.js +3 -0
  117. package/build/separator/index.js.map +1 -1
  118. package/build/spacer/constants.js +9 -0
  119. package/build/spacer/constants.js.map +1 -0
  120. package/build/spacer/controls.js +3 -3
  121. package/build/spacer/controls.js.map +1 -1
  122. package/build/spacer/controls.native.js +2 -2
  123. package/build/spacer/controls.native.js.map +1 -1
  124. package/build/spacer/edit.js +5 -6
  125. package/build/spacer/edit.js.map +1 -1
  126. package/build/table/edit.js +8 -2
  127. package/build/table/edit.js.map +1 -1
  128. package/build/tag-cloud/edit.js +1 -1
  129. package/build/tag-cloud/edit.js.map +1 -1
  130. package/build/video/edit.js +4 -8
  131. package/build/video/edit.js.map +1 -1
  132. package/build/video/edit.native.js +1 -1
  133. package/build/video/edit.native.js.map +1 -1
  134. package/build-module/archives/edit.js +1 -1
  135. package/build-module/archives/edit.js.map +1 -1
  136. package/build-module/audio/edit.js +4 -16
  137. package/build-module/audio/edit.js.map +1 -1
  138. package/build-module/audio/edit.native.js +1 -1
  139. package/build-module/audio/edit.native.js.map +1 -1
  140. package/build-module/button/edit.native.js +7 -3
  141. package/build-module/button/edit.native.js.map +1 -1
  142. package/build-module/categories/edit.js +8 -3
  143. package/build-module/categories/edit.js.map +1 -1
  144. package/build-module/categories/index.js +4 -0
  145. package/build-module/categories/index.js.map +1 -1
  146. package/build-module/column/index.js +10 -0
  147. package/build-module/column/index.js.map +1 -1
  148. package/build-module/comment-template/edit.js +1 -3
  149. package/build-module/comment-template/edit.js.map +1 -1
  150. package/build-module/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
  151. package/build-module/comments/edit/comments-inspector-controls.js.map +1 -0
  152. package/build-module/{comments-query-loop → comments}/edit.js +1 -1
  153. package/build-module/comments/edit.js.map +1 -0
  154. package/build-module/{comments-query-loop → comments}/index.js +1 -1
  155. package/build-module/comments/index.js.map +1 -0
  156. package/build-module/{comments-query-loop → comments}/save.js +1 -1
  157. package/build-module/comments/save.js.map +1 -0
  158. package/build-module/cover/edit.js +4 -71
  159. package/build-module/cover/edit.js.map +1 -1
  160. package/build-module/cover/edit.native.js +35 -16
  161. package/build-module/cover/edit.native.js.map +1 -1
  162. package/build-module/cover/transforms.js +74 -6
  163. package/build-module/cover/transforms.js.map +1 -1
  164. package/build-module/cover/use-cover-is-dark.js +70 -0
  165. package/build-module/cover/use-cover-is-dark.js.map +1 -0
  166. package/build-module/cover/use-cover-is-dark.native.js +51 -0
  167. package/build-module/cover/use-cover-is-dark.native.js.map +1 -0
  168. package/build-module/embed/edit.js +13 -19
  169. package/build-module/embed/edit.js.map +1 -1
  170. package/build-module/embed/edit.native.js +2 -8
  171. package/build-module/embed/edit.native.js.map +1 -1
  172. package/build-module/embed/util.js +25 -3
  173. package/build-module/embed/util.js.map +1 -1
  174. package/build-module/file/inspector.js +2 -4
  175. package/build-module/file/inspector.js.map +1 -1
  176. package/build-module/gallery/edit.js +1 -1
  177. package/build-module/gallery/edit.js.map +1 -1
  178. package/build-module/gallery/v1/edit.js +1 -1
  179. package/build-module/gallery/v1/edit.js.map +1 -1
  180. package/build-module/group/index.js +1 -0
  181. package/build-module/group/index.js.map +1 -1
  182. package/build-module/heading/transforms.js +8 -4
  183. package/build-module/heading/transforms.js.map +1 -1
  184. package/build-module/html/edit.js +2 -2
  185. package/build-module/html/edit.js.map +1 -1
  186. package/build-module/image/edit.js +4 -6
  187. package/build-module/image/edit.js.map +1 -1
  188. package/build-module/image/edit.native.js +1 -1
  189. package/build-module/image/edit.native.js.map +1 -1
  190. package/build-module/image/image.js +1 -1
  191. package/build-module/image/image.js.map +1 -1
  192. package/build-module/index.js +3 -4
  193. package/build-module/index.js.map +1 -1
  194. package/build-module/index.native.js +14 -3
  195. package/build-module/index.native.js.map +1 -1
  196. package/build-module/latest-comments/edit.js +1 -1
  197. package/build-module/latest-comments/edit.js.map +1 -1
  198. package/build-module/latest-posts/edit.native.js +51 -2
  199. package/build-module/latest-posts/edit.native.js.map +1 -1
  200. package/build-module/loginout/edit.js +1 -1
  201. package/build-module/loginout/edit.js.map +1 -1
  202. package/build-module/media-text/edit.js +1 -2
  203. package/build-module/media-text/edit.js.map +1 -1
  204. package/build-module/media-text/edit.native.js +1 -1
  205. package/build-module/media-text/edit.native.js.map +1 -1
  206. package/build-module/navigation/edit/index.js +6 -28
  207. package/build-module/navigation/edit/index.js.map +1 -1
  208. package/build-module/navigation/edit/unsaved-inner-blocks.js +5 -4
  209. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  210. package/build-module/navigation/index.js +1 -2
  211. package/build-module/navigation/index.js.map +1 -1
  212. package/build-module/navigation/view-modal.js +56 -0
  213. package/build-module/navigation/view-modal.js.map +1 -0
  214. package/build-module/navigation/view.js +1 -30
  215. package/build-module/navigation/view.js.map +1 -1
  216. package/build-module/navigation-link/edit.js +1 -1
  217. package/build-module/navigation-link/edit.js.map +1 -1
  218. package/build-module/paragraph/edit.js +9 -0
  219. package/build-module/paragraph/edit.js.map +1 -1
  220. package/build-module/paragraph/edit.native.js +6 -2
  221. package/build-module/paragraph/edit.native.js.map +1 -1
  222. package/build-module/paragraph/use-enter.js +81 -0
  223. package/build-module/paragraph/use-enter.js.map +1 -0
  224. package/build-module/post-author/edit.js +1 -1
  225. package/build-module/post-author/edit.js.map +1 -1
  226. package/build-module/post-comment/index.js +1 -1
  227. package/build-module/post-comments/edit.js +13 -35
  228. package/build-module/post-comments/edit.js.map +1 -1
  229. package/build-module/post-comments/index.js +1 -1
  230. package/build-module/post-comments-form/edit.js +38 -26
  231. package/build-module/post-comments-form/edit.js.map +1 -1
  232. package/build-module/post-comments-form/form.js +39 -0
  233. package/build-module/post-comments-form/form.js.map +1 -0
  234. package/build-module/post-excerpt/edit.js +1 -1
  235. package/build-module/post-excerpt/edit.js.map +1 -1
  236. package/build-module/post-terms/edit.js +26 -4
  237. package/build-module/post-terms/edit.js.map +1 -1
  238. package/build-module/post-terms/index.js +8 -0
  239. package/build-module/post-terms/index.js.map +1 -1
  240. package/build-module/quote/index.js +2 -1
  241. package/build-module/quote/index.js.map +1 -1
  242. package/build-module/quote/v2/edit.js +10 -3
  243. package/build-module/quote/v2/edit.js.map +1 -1
  244. package/build-module/rss/edit.js +1 -1
  245. package/build-module/rss/edit.js.map +1 -1
  246. package/build-module/search/edit.js +11 -9
  247. package/build-module/search/edit.js.map +1 -1
  248. package/build-module/separator/index.js +3 -0
  249. package/build-module/separator/index.js.map +1 -1
  250. package/build-module/spacer/constants.js +2 -0
  251. package/build-module/spacer/constants.js.map +1 -0
  252. package/build-module/spacer/controls.js +2 -2
  253. package/build-module/spacer/controls.js.map +1 -1
  254. package/build-module/spacer/controls.native.js +1 -1
  255. package/build-module/spacer/controls.native.js.map +1 -1
  256. package/build-module/spacer/edit.js +1 -1
  257. package/build-module/spacer/edit.js.map +1 -1
  258. package/build-module/table/edit.js +9 -3
  259. package/build-module/table/edit.js.map +1 -1
  260. package/build-module/tag-cloud/edit.js +1 -1
  261. package/build-module/tag-cloud/edit.js.map +1 -1
  262. package/build-module/video/edit.js +4 -8
  263. package/build-module/video/edit.js.map +1 -1
  264. package/build-module/video/edit.native.js +1 -1
  265. package/build-module/video/edit.native.js.map +1 -1
  266. package/build-style/{comments-query-loop → comments}/editor-rtl.css +0 -0
  267. package/build-style/{comments-query-loop → comments}/editor.css +0 -0
  268. package/build-style/common-rtl.css +32 -0
  269. package/build-style/common.css +32 -0
  270. package/build-style/cover/style-rtl.css +0 -4
  271. package/build-style/cover/style.css +0 -4
  272. package/build-style/editor-rtl.css +12 -4
  273. package/build-style/editor.css +12 -4
  274. package/build-style/navigation/style-rtl.css +3 -0
  275. package/build-style/navigation/style.css +3 -0
  276. package/build-style/style-rtl.css +73 -4
  277. package/build-style/style.css +73 -4
  278. package/build-style/table/editor-rtl.css +8 -0
  279. package/build-style/table/editor.css +8 -0
  280. package/build-style/table/style-rtl.css +38 -0
  281. package/build-style/table/style.css +38 -0
  282. package/package.json +28 -28
  283. package/src/archives/edit.js +1 -1
  284. package/src/audio/edit.js +3 -8
  285. package/src/audio/edit.native.js +1 -1
  286. package/src/button/edit.native.js +6 -3
  287. package/src/categories/block.json +4 -0
  288. package/src/categories/edit.js +8 -2
  289. package/src/categories/index.php +1 -0
  290. package/src/column/block.json +10 -0
  291. package/src/comment-template/edit.js +1 -5
  292. package/src/comment-template/index.php +4 -0
  293. package/src/{comments-query-loop → comments}/block.json +1 -1
  294. package/src/{comments-query-loop → comments}/edit/comments-inspector-controls.js +0 -0
  295. package/src/{comments-query-loop → comments}/edit.js +1 -1
  296. package/src/{comments-query-loop → comments}/editor.scss +0 -0
  297. package/src/{comments-query-loop → comments}/index.js +0 -0
  298. package/src/{comments-query-loop → comments}/save.js +1 -3
  299. package/src/comments-pagination/index.php +4 -0
  300. package/src/comments-title/index.php +4 -0
  301. package/src/common.scss +24 -1
  302. package/src/cover/edit.js +2 -67
  303. package/src/cover/edit.native.js +40 -13
  304. package/src/cover/style.native.scss +4 -0
  305. package/src/cover/style.scss +0 -4
  306. package/src/cover/test/__snapshots__/edit.native.js.snap +6 -6
  307. package/src/cover/test/transforms.js +301 -0
  308. package/src/cover/transforms.js +112 -7
  309. package/src/cover/use-cover-is-dark.js +71 -0
  310. package/src/cover/use-cover-is-dark.native.js +51 -0
  311. package/src/editor.scss +1 -1
  312. package/src/embed/edit.js +19 -24
  313. package/src/embed/edit.native.js +9 -14
  314. package/src/embed/util.js +34 -2
  315. package/src/file/inspector.js +1 -3
  316. package/src/gallery/edit.js +1 -1
  317. package/src/gallery/v1/edit.js +1 -1
  318. package/src/group/block.json +1 -0
  319. package/src/heading/transforms.js +4 -3
  320. package/src/html/edit.js +2 -2
  321. package/src/image/edit.js +2 -4
  322. package/src/image/edit.native.js +1 -1
  323. package/src/image/image.js +1 -1
  324. package/src/index.js +2 -5
  325. package/src/index.native.js +12 -2
  326. package/src/latest-comments/edit.js +1 -1
  327. package/src/latest-posts/edit.native.js +56 -1
  328. package/src/loginout/edit.js +1 -1
  329. package/src/media-text/edit.js +1 -2
  330. package/src/media-text/edit.native.js +1 -1
  331. package/src/navigation/block.json +1 -2
  332. package/src/navigation/edit/index.js +6 -36
  333. package/src/navigation/edit/unsaved-inner-blocks.js +5 -4
  334. package/src/navigation/index.php +5 -0
  335. package/src/navigation/style.scss +3 -0
  336. package/src/navigation/view-modal.js +68 -0
  337. package/src/navigation/view.js +0 -35
  338. package/src/navigation-link/edit.js +1 -1
  339. package/src/paragraph/edit.js +6 -0
  340. package/src/paragraph/edit.native.js +13 -1
  341. package/src/paragraph/use-enter.js +103 -0
  342. package/src/post-author/edit.js +1 -1
  343. package/src/post-author/index.php +1 -1
  344. package/src/post-comment/block.json +1 -1
  345. package/src/post-comments/block.json +1 -1
  346. package/src/post-comments/edit.js +13 -43
  347. package/src/post-comments/index.php +2 -0
  348. package/src/post-comments-form/edit.js +50 -58
  349. package/src/post-comments-form/form.js +43 -0
  350. package/src/post-comments-form/index.php +5 -1
  351. package/src/post-excerpt/edit.js +1 -1
  352. package/src/post-terms/block.json +8 -0
  353. package/src/post-terms/edit.js +28 -1
  354. package/src/post-terms/index.php +12 -2
  355. package/src/quote/block.json +1 -0
  356. package/src/quote/index.js +1 -1
  357. package/src/quote/v2/edit.js +3 -0
  358. package/src/rss/edit.js +1 -1
  359. package/src/search/edit.js +13 -7
  360. package/src/search/index.php +84 -33
  361. package/src/separator/block.json +3 -0
  362. package/src/spacer/constants.js +1 -0
  363. package/src/spacer/controls.js +2 -2
  364. package/src/spacer/controls.native.js +1 -1
  365. package/src/spacer/edit.js +1 -2
  366. package/src/table/edit.js +11 -2
  367. package/src/table/editor.scss +13 -0
  368. package/src/table/style.scss +52 -0
  369. package/src/tag-cloud/edit.js +1 -1
  370. package/src/video/edit.js +4 -5
  371. package/src/video/edit.native.js +1 -1
  372. package/build/comments-query-loop/edit/comments-inspector-controls.js.map +0 -1
  373. package/build/comments-query-loop/edit.js.map +0 -1
  374. package/build/comments-query-loop/index.js.map +0 -1
  375. package/build/comments-query-loop/save.js.map +0 -1
  376. package/build/navigation-area/edit.js +0 -110
  377. package/build/navigation-area/edit.js.map +0 -1
  378. package/build/navigation-area/index.js +0 -62
  379. package/build/navigation-area/index.js.map +0 -1
  380. package/build/navigation-area/inner-blocks.js +0 -34
  381. package/build/navigation-area/inner-blocks.js.map +0 -1
  382. package/build/navigation-area/save.js +0 -18
  383. package/build/navigation-area/save.js.map +0 -1
  384. package/build-module/comments-query-loop/edit.js.map +0 -1
  385. package/build-module/comments-query-loop/index.js.map +0 -1
  386. package/build-module/comments-query-loop/save.js.map +0 -1
  387. package/build-module/navigation-area/edit.js +0 -94
  388. package/build-module/navigation-area/edit.js.map +0 -1
  389. package/build-module/navigation-area/index.js +0 -48
  390. package/build-module/navigation-area/index.js.map +0 -1
  391. package/build-module/navigation-area/inner-blocks.js +0 -26
  392. package/build-module/navigation-area/inner-blocks.js.map +0 -1
  393. package/build-module/navigation-area/save.js +0 -10
  394. package/build-module/navigation-area/save.js.map +0 -1
  395. package/src/navigation-area/block.json +0 -23
  396. package/src/navigation-area/edit.js +0 -111
  397. package/src/navigation-area/index.js +0 -26
  398. package/src/navigation-area/index.php +0 -22
  399. package/src/navigation-area/inner-blocks.js +0 -24
  400. package/src/navigation-area/save.js +0 -8
@@ -16,10 +16,12 @@ import {
16
16
  import { __, sprintf } from '@wordpress/i18n';
17
17
  import { useSelect } from '@wordpress/data';
18
18
  import { useEntityProp, store as coreStore } from '@wordpress/core-data';
19
- import {
20
- __experimentalUseDisabled as useDisabled,
21
- useInstanceId,
22
- } from '@wordpress/compose';
19
+ import { __experimentalUseDisabled as useDisabled } from '@wordpress/compose';
20
+
21
+ /**
22
+ * Internal dependencies
23
+ */
24
+ import CommentsForm from '../post-comments-form/form';
23
25
 
24
26
  export default function PostCommentsEdit( {
25
27
  attributes: { textAlign },
@@ -51,9 +53,9 @@ export default function PostCommentsEdit( {
51
53
  );
52
54
 
53
55
  let warning = __(
54
- 'Post Comments block: This is just a placeholder, not a real comment. The final styling may differ because it also depends on the current theme. For better compatibility with the Block Editor, please consider replacing this block with the "Comments Query Loop" block.'
56
+ 'Post Comments block: This is just a placeholder, not a real comment. The final styling may differ because it also depends on the current theme. For better compatibility with the Block Editor, please consider replacing this block with the "Comments" block.'
55
57
  );
56
- let showPlacholder = true;
58
+ let showPlaceholder = true;
57
59
 
58
60
  if ( ! isSiteEditor && 'open' !== commentStatus ) {
59
61
  if ( 'closed' === commentStatus ) {
@@ -64,7 +66,7 @@ export default function PostCommentsEdit( {
64
66
  ),
65
67
  postType
66
68
  );
67
- showPlacholder = false;
69
+ showPlaceholder = false;
68
70
  } else if ( ! postTypeSupportsComments ) {
69
71
  warning = sprintf(
70
72
  /* translators: 1: Post type (i.e. "post", "page") */
@@ -73,10 +75,10 @@ export default function PostCommentsEdit( {
73
75
  ),
74
76
  postType
75
77
  );
76
- showPlacholder = false;
78
+ showPlaceholder = false;
77
79
  } else if ( 'open' !== defaultCommentStatus ) {
78
80
  warning = __( 'Post Comments block: Comments are not enabled.' );
79
- showPlacholder = false;
81
+ showPlaceholder = false;
80
82
  }
81
83
  }
82
84
 
@@ -88,8 +90,6 @@ export default function PostCommentsEdit( {
88
90
 
89
91
  const disabledRef = useDisabled();
90
92
 
91
- const textareaId = useInstanceId( PostCommentsEdit );
92
-
93
93
  return (
94
94
  <>
95
95
  <BlockControls group="block">
@@ -104,7 +104,7 @@ export default function PostCommentsEdit( {
104
104
  <div { ...blockProps }>
105
105
  <Warning>{ warning }</Warning>
106
106
 
107
- { showPlacholder && (
107
+ { showPlaceholder && (
108
108
  <div
109
109
  className="wp-block-post-comments__placeholder"
110
110
  ref={ disabledRef }
@@ -206,37 +206,7 @@ export default function PostCommentsEdit( {
206
206
  </div>
207
207
  </div>
208
208
 
209
- <div className="comment-respond">
210
- <h3 className="comment-reply-title">
211
- { __( 'Leave a Reply' ) }
212
- </h3>
213
-
214
- <form className="comment-form" noValidate>
215
- <p className="comment-form-comment">
216
- <label
217
- htmlFor={ `comment-${ textareaId }` }
218
- >
219
- { __( 'Comment' ) }{ ' ' }
220
- <span className="required">*</span>
221
- </label>
222
- <textarea
223
- id={ `comment-${ textareaId }` }
224
- name="comment"
225
- cols="45"
226
- rows="8"
227
- required
228
- />
229
- </p>
230
- <p className="form-submit wp-block-button">
231
- <input
232
- name="submit"
233
- type="submit"
234
- className="submit wp-block-button__link"
235
- value={ __( 'Post Comment' ) }
236
- />
237
- </p>
238
- </form>
239
- </div>
209
+ <CommentsForm />
240
210
  </div>
241
211
  ) }
242
212
  </div>
@@ -51,6 +51,8 @@ function render_block_core_post_comments( $attributes, $content, $block ) {
51
51
  $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
52
52
  $output = ob_get_clean();
53
53
 
54
+ wp_enqueue_script( 'comment-reply' );
55
+
54
56
  return sprintf( '<div %1$s>%2$s</div>', $wrapper_attributes, $output );
55
57
  }
56
58
 
@@ -11,13 +11,15 @@ import {
11
11
  BlockControls,
12
12
  Warning,
13
13
  useBlockProps,
14
+ store as blockEditorStore,
14
15
  } from '@wordpress/block-editor';
15
- import { useEntityProp } from '@wordpress/core-data';
16
+ import { useEntityProp, store as coreStore } from '@wordpress/core-data';
16
17
  import { __, sprintf } from '@wordpress/i18n';
17
- import {
18
- __experimentalUseDisabled as useDisabled,
19
- useInstanceId,
20
- } from '@wordpress/compose';
18
+ import { useSelect } from '@wordpress/data';
19
+ /**
20
+ * Internal dependencies
21
+ */
22
+ import CommentsForm from './form';
21
23
 
22
24
  export default function PostCommentsFormEdit( {
23
25
  attributes,
@@ -38,11 +40,49 @@ export default function PostCommentsFormEdit( {
38
40
  } ),
39
41
  } );
40
42
 
41
- const isInSiteEditor = postType === undefined || postId === undefined;
43
+ const isSiteEditor = postType === undefined || postId === undefined;
44
+
45
+ const { defaultCommentStatus } = useSelect(
46
+ ( select ) =>
47
+ select( blockEditorStore ).getSettings()
48
+ .__experimentalDiscussionSettings
49
+ );
50
+
51
+ const postTypeSupportsComments = useSelect( ( select ) =>
52
+ postType
53
+ ? !! select( coreStore ).getPostType( postType )?.supports.comments
54
+ : false
55
+ );
42
56
 
43
- const disabledFormRef = useDisabled();
57
+ let warning = false;
58
+ let showPlaceholder = true;
44
59
 
45
- const instanceId = useInstanceId( PostCommentsFormEdit );
60
+ if ( ! isSiteEditor && 'open' !== commentStatus ) {
61
+ if ( 'closed' === commentStatus ) {
62
+ warning = sprintf(
63
+ /* translators: 1: Post type (i.e. "post", "page") */
64
+ __(
65
+ 'Post Comments Form block: Comments on this %s are not allowed.'
66
+ ),
67
+ postType
68
+ );
69
+ showPlaceholder = false;
70
+ } else if ( ! postTypeSupportsComments ) {
71
+ warning = sprintf(
72
+ /* translators: 1: Post type (i.e. "post", "page") */
73
+ __(
74
+ 'Post Comments Form block: Comments for this post type (%s) are not enabled.'
75
+ ),
76
+ postType
77
+ );
78
+ showPlaceholder = false;
79
+ } else if ( 'open' !== defaultCommentStatus ) {
80
+ warning = __(
81
+ 'Post Comments Form block: Comments are not enabled.'
82
+ );
83
+ showPlaceholder = false;
84
+ }
85
+ }
46
86
 
47
87
  return (
48
88
  <>
@@ -55,57 +95,9 @@ export default function PostCommentsFormEdit( {
55
95
  />
56
96
  </BlockControls>
57
97
  <div { ...blockProps }>
58
- { ! commentStatus && ! isInSiteEditor && (
59
- <Warning>
60
- { __(
61
- 'Post Comments Form block: comments are not enabled for this post type.'
62
- ) }
63
- </Warning>
64
- ) }
65
-
66
- { 'open' !== commentStatus && ! isInSiteEditor && (
67
- <Warning>
68
- { sprintf(
69
- /* translators: 1: Post type (i.e. "post", "page") */
70
- __(
71
- 'Post Comments Form block: comments to this %s are not allowed.'
72
- ),
73
- postType
74
- ) }
75
- </Warning>
76
- ) }
98
+ { warning && <Warning>{ warning }</Warning> }
77
99
 
78
- { ( 'open' === commentStatus || isInSiteEditor ) && (
79
- <div>
80
- <h3>{ __( 'Leave a Reply' ) }</h3>
81
- <form
82
- noValidate
83
- className="comment-form"
84
- ref={ disabledFormRef }
85
- >
86
- <p>
87
- <label htmlFor={ `comment-${ instanceId }` }>
88
- { __( 'Comment' ) }
89
- </label>
90
- <textarea
91
- id={ `comment-${ instanceId }` }
92
- name="comment"
93
- cols="45"
94
- rows="8"
95
- />
96
- </p>
97
- <p>
98
- <input
99
- name="submit"
100
- className="submit wp-block-button__link"
101
- label={ __( 'Post Comment' ) }
102
- value={ __( 'Post Comment' ) }
103
- readOnly
104
- />
105
- </p>
106
- </form>
107
- </div>
108
- ) }
100
+ { showPlaceholder ? <CommentsForm /> : null }
109
101
  </div>
110
102
  </>
111
103
  );
@@ -0,0 +1,43 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import {
6
+ __experimentalUseDisabled as useDisabled,
7
+ useInstanceId,
8
+ } from '@wordpress/compose';
9
+
10
+ const CommentsForm = () => {
11
+ const disabledFormRef = useDisabled();
12
+ const instanceId = useInstanceId( CommentsForm );
13
+
14
+ return (
15
+ <div className="comment-respond">
16
+ <h3 className="comment-reply-title">{ __( 'Leave a Reply' ) }</h3>
17
+ <form noValidate className="comment-form" ref={ disabledFormRef }>
18
+ <p>
19
+ <label htmlFor={ `comment-${ instanceId }` }>
20
+ { __( 'Comment' ) }
21
+ </label>
22
+ <textarea
23
+ id={ `comment-${ instanceId }` }
24
+ name="comment"
25
+ cols="45"
26
+ rows="8"
27
+ />
28
+ </p>
29
+ <p className="form-submit wp-block-button">
30
+ <input
31
+ name="submit"
32
+ type="submit"
33
+ className="submit wp-block-button__link"
34
+ label={ __( 'Post Comment' ) }
35
+ value={ __( 'Post Comment' ) }
36
+ />
37
+ </p>
38
+ </form>
39
+ </div>
40
+ );
41
+ };
42
+
43
+ export default CommentsForm;
@@ -18,9 +18,13 @@ function render_block_core_post_comments_form( $attributes, $content, $block ) {
18
18
  return '';
19
19
  }
20
20
 
21
+ if ( post_password_required( $block->context['postId'] ) ) {
22
+ return;
23
+ }
24
+
21
25
  $classes = 'comment-respond'; // See comment further below.
22
26
  if ( isset( $attributes['textAlign'] ) ) {
23
- $classes .= 'has-text-align-' . $attributes['textAlign'];
27
+ $classes .= ' has-text-align-' . $attributes['textAlign'];
24
28
  }
25
29
 
26
30
  $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
@@ -127,7 +127,7 @@ export default function PostExcerptEditor( {
127
127
  />
128
128
  </BlockControls>
129
129
  <InspectorControls>
130
- <PanelBody title={ __( 'Post Excerpt Settings' ) }>
130
+ <PanelBody title={ __( 'Settings' ) }>
131
131
  <ToggleControl
132
132
  label={ __( 'Show link on new line' ) }
133
133
  checked={ showMoreOnNewLine }
@@ -16,6 +16,14 @@
16
16
  "separator": {
17
17
  "type": "string",
18
18
  "default": ", "
19
+ },
20
+ "prefix": {
21
+ "type": "string",
22
+ "default": ""
23
+ },
24
+ "suffix": {
25
+ "type": "string",
26
+ "default": ""
19
27
  }
20
28
  },
21
29
  "usesContext": [ "postId", "postType" ],
@@ -13,6 +13,7 @@ import {
13
13
  BlockControls,
14
14
  useBlockProps,
15
15
  useBlockDisplayInformation,
16
+ RichText,
16
17
  } from '@wordpress/block-editor';
17
18
  import { Spinner, TextControl } from '@wordpress/components';
18
19
  import { useSelect } from '@wordpress/data';
@@ -30,7 +31,7 @@ export default function PostTermsEdit( {
30
31
  context,
31
32
  setAttributes,
32
33
  } ) {
33
- const { term, textAlign, separator } = attributes;
34
+ const { term, textAlign, separator, prefix, suffix } = attributes;
34
35
  const { postId, postType } = context;
35
36
 
36
37
  const selectedTerm = useSelect(
@@ -83,6 +84,19 @@ export default function PostTermsEdit( {
83
84
  </InspectorControls>
84
85
  <div { ...blockProps }>
85
86
  { isLoading && <Spinner /> }
87
+ { ! isLoading && hasPostTerms && (
88
+ <RichText
89
+ className="wp-block-post-terms__prefix"
90
+ multiline={ false }
91
+ aria-label={ __( 'Prefix' ) }
92
+ placeholder={ __( 'Prefix' ) + ' ' }
93
+ value={ prefix }
94
+ onChange={ ( value ) =>
95
+ setAttributes( { prefix: value } )
96
+ }
97
+ tagName="span"
98
+ />
99
+ ) }
86
100
  { ! isLoading &&
87
101
  hasPostTerms &&
88
102
  postTerms
@@ -108,6 +122,19 @@ export default function PostTermsEdit( {
108
122
  ! hasPostTerms &&
109
123
  ( selectedTerm?.labels?.no_terms ||
110
124
  __( 'Term items not found.' ) ) }
125
+ { ! isLoading && hasPostTerms && (
126
+ <RichText
127
+ className="wp-block-post-terms__suffix"
128
+ multiline={ false }
129
+ aria-label={ __( 'Suffix' ) }
130
+ placeholder={ ' ' + __( 'Suffix' ) }
131
+ value={ suffix }
132
+ onChange={ ( value ) =>
133
+ setAttributes( { suffix: value } )
134
+ }
135
+ tagName="span"
136
+ />
137
+ ) }
111
138
  </div>
112
139
  </>
113
140
  );
@@ -36,12 +36,22 @@ function render_block_core_post_terms( $attributes, $content, $block ) {
36
36
 
37
37
  $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
38
38
 
39
+ $prefix = "<div $wrapper_attributes>";
40
+ if ( isset( $attributes['prefix'] ) && $attributes['prefix'] ) {
41
+ $prefix .= '<span class="wp-block-post-terms__prefix">' . $attributes['prefix'] . '</span>';
42
+ }
43
+
44
+ $suffix = '</div>';
45
+ if ( isset( $attributes['suffix'] ) && $attributes['suffix'] ) {
46
+ $suffix = '<span class="wp-block-post-terms__suffix">' . $attributes['suffix'] . '</span>' . $suffix;
47
+ }
48
+
39
49
  return get_the_term_list(
40
50
  $block->context['postId'],
41
51
  $attributes['term'],
42
- "<div $wrapper_attributes>",
52
+ $prefix,
43
53
  '<span class="wp-block-post-terms__separator">' . esc_html( $separator ) . '</span>',
44
- '</div>'
54
+ $suffix
45
55
  );
46
56
  }
47
57
 
@@ -30,6 +30,7 @@
30
30
  "supports": {
31
31
  "anchor": true,
32
32
  "__experimentalSlashInserter": true,
33
+ "__experimentalOnEnter": true,
33
34
  "typography": {
34
35
  "fontSize": true,
35
36
  "lineHeight": true,
@@ -16,7 +16,7 @@ import settingsV2 from './v2';
16
16
 
17
17
  const { name } = metadata;
18
18
 
19
- export { metadata, name };
19
+ export { metadata, name, settingsV2 };
20
20
 
21
21
  export const settingsV1 = {
22
22
  icon,
@@ -74,6 +74,7 @@ export default function QuoteEdit( {
74
74
  insertBlocksAfter,
75
75
  clientId,
76
76
  className,
77
+ style,
77
78
  } ) {
78
79
  const { citation, align } = attributes;
79
80
 
@@ -88,6 +89,7 @@ export default function QuoteEdit( {
88
89
  className: classNames( className, {
89
90
  [ `has-text-align-${ align }` ]: align,
90
91
  } ),
92
+ ...( ! isWebPlatform && { style } ),
91
93
  } );
92
94
  const innerBlocksProps = useInnerBlocksProps( blockProps, {
93
95
  template: TEMPLATE,
@@ -128,6 +130,7 @@ export default function QuoteEdit( {
128
130
  __unstableOnSplitAtEnd={ () =>
129
131
  insertBlocksAfter( createBlock( 'core/paragraph' ) )
130
132
  }
133
+ { ...( ! isWebPlatform ? { textAlign: align } : {} ) }
131
134
  />
132
135
  ) }
133
136
  </BlockQuotation>
package/src/rss/edit.js CHANGED
@@ -109,7 +109,7 @@ export default function RSSEdit( { attributes, setAttributes } ) {
109
109
  <ToolbarGroup controls={ toolbarControls } />
110
110
  </BlockControls>
111
111
  <InspectorControls>
112
- <PanelBody title={ __( 'RSS settings' ) }>
112
+ <PanelBody title={ __( 'Settings' ) }>
113
113
  <RangeControl
114
114
  label={ __( 'Number of items' ) }
115
115
  value={ itemsToShow }
@@ -103,8 +103,6 @@ export default function SearchEdit( {
103
103
  } );
104
104
  }, [ insertedInNavigationBlock ] );
105
105
  const borderRadius = style?.border?.radius;
106
- const borderColor = style?.border?.color;
107
- const borderWidth = style?.border?.width;
108
106
  const borderProps = useBorderProps( attributes );
109
107
 
110
108
  // Check for old deprecated numerical border radius. Done as a separate
@@ -392,10 +390,18 @@ export default function SearchEdit( {
392
390
  radius ? `calc(${ radius } + ${ DEFAULT_INNER_PADDING })` : undefined;
393
391
 
394
392
  const getWrapperStyles = () => {
395
- const styles = {
396
- borderColor,
397
- borderWidth: isButtonPositionInside ? borderWidth : undefined,
398
- };
393
+ const styles = isButtonPositionInside
394
+ ? borderProps.style
395
+ : {
396
+ borderRadius: borderProps.style?.borderRadius,
397
+ borderTopLeftRadius: borderProps.style?.borderTopLeftRadius,
398
+ borderTopRightRadius:
399
+ borderProps.style?.borderTopRightRadius,
400
+ borderBottomLeftRadius:
401
+ borderProps.style?.borderBottomLeftRadius,
402
+ borderBottomRightRadius:
403
+ borderProps.style?.borderBottomRightRadius,
404
+ };
399
405
 
400
406
  const isNonZeroBorderRadius =
401
407
  borderRadius !== undefined && parseInt( borderRadius, 10 ) !== 0;
@@ -417,11 +423,11 @@ export default function SearchEdit( {
417
423
  } = borderRadius;
418
424
 
419
425
  return {
426
+ ...styles,
420
427
  borderTopLeftRadius: padBorderRadius( topLeft ),
421
428
  borderTopRightRadius: padBorderRadius( topRight ),
422
429
  borderBottomLeftRadius: padBorderRadius( bottomLeft ),
423
430
  borderBottomRightRadius: padBorderRadius( bottomRight ),
424
- ...styles,
425
431
  };
426
432
  }
427
433
 
@@ -171,6 +171,75 @@ function classnames_for_block_core_search( $attributes ) {
171
171
  return implode( ' ', $classnames );
172
172
  }
173
173
 
174
+ /**
175
+ * This generates a CSS rule for the given border property and side if provided.
176
+ * Based on whether the Search block is configured to display the button inside
177
+ * or not, the generated rule is injected into the appropriate collection of
178
+ * styles for later application in the block's markup.
179
+ *
180
+ * @param array $attributes The block attributes.
181
+ * @param string $property Border property to generate rule for e.g. width or color.
182
+ * @param string $side Optional side border. The dictates the value retrieved and final CSS property.
183
+ * @param array $wrapper_styles Current collection of wrapper styles.
184
+ * @param array $button_styles Current collection of button styles.
185
+ * @param array $input_styles Current collection of input styles.
186
+ *
187
+ * @return void
188
+ */
189
+ function apply_block_core_search_border_style( $attributes, $property, $side, &$wrapper_styles, &$button_styles, &$input_styles ) {
190
+ $is_button_inside = 'button-inside' === _wp_array_get( $attributes, array( 'buttonPosition' ), false );
191
+
192
+ $path = array( 'style', 'border', $property );
193
+
194
+ if ( $side ) {
195
+ array_splice( $path, 2, 0, $side );
196
+ }
197
+
198
+ $value = _wp_array_get( $attributes, $path, false );
199
+
200
+ if ( empty( $value ) ) {
201
+ return;
202
+ }
203
+
204
+ if ( 'color' === $property && $side ) {
205
+ $has_color_preset = strpos( $value, 'var:preset|color|' ) !== false;
206
+ if ( $has_color_preset ) {
207
+ $named_color_value = substr( $value, strrpos( $value, '|' ) + 1 );
208
+ $value = sprintf( 'var(--wp--preset--color--%s)', $named_color_value );
209
+ }
210
+ }
211
+
212
+ $property_suffix = $side ? sprintf( '%s-%s', $side, $property ) : $property;
213
+
214
+ if ( $is_button_inside ) {
215
+ $wrapper_styles[] = sprintf( 'border-%s: %s;', $property_suffix, esc_attr( $value ) );
216
+ } else {
217
+ $button_styles[] = sprintf( 'border-%s: %s;', $property_suffix, esc_attr( $value ) );
218
+ $input_styles[] = sprintf( 'border-%s: %s;', $property_suffix, esc_attr( $value ) );
219
+ }
220
+ }
221
+
222
+ /**
223
+ * This adds CSS rules for a given border property e.g. width or color. It
224
+ * injects rules into the provided wrapper, button and input style arrays for
225
+ * uniform "flat" borders or those with individual sides configured.
226
+ *
227
+ * @param array $attributes The block attributes.
228
+ * @param string $property Border property to generate rule for e.g. width or color.
229
+ * @param array $wrapper_styles Current collection of wrapper styles.
230
+ * @param array $button_styles Current collection of button styles.
231
+ * @param array $input_styles Current collection of input styles.
232
+ *
233
+ * @return void
234
+ */
235
+ function apply_block_core_search_border_styles( $attributes, $property, &$wrapper_styles, &$button_styles, &$input_styles ) {
236
+ apply_block_core_search_border_style( $attributes, $property, null, $wrapper_styles, $button_styles, $input_styles );
237
+ apply_block_core_search_border_style( $attributes, $property, 'top', $wrapper_styles, $button_styles, $input_styles );
238
+ apply_block_core_search_border_style( $attributes, $property, 'right', $wrapper_styles, $button_styles, $input_styles );
239
+ apply_block_core_search_border_style( $attributes, $property, 'bottom', $wrapper_styles, $button_styles, $input_styles );
240
+ apply_block_core_search_border_style( $attributes, $property, 'left', $wrapper_styles, $button_styles, $input_styles );
241
+ }
242
+
174
243
  /**
175
244
  * Builds an array of inline styles for the search block.
176
245
  *
@@ -201,19 +270,10 @@ function styles_for_block_core_search( $attributes ) {
201
270
  );
202
271
  }
203
272
 
204
- // Add border width styles.
205
- $has_border_width = ! empty( $attributes['style']['border']['width'] );
206
-
207
- if ( $has_border_width ) {
208
- $border_width = $attributes['style']['border']['width'];
209
-
210
- if ( $is_button_inside ) {
211
- $wrapper_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) );
212
- } else {
213
- $button_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) );
214
- $input_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) );
215
- }
216
- }
273
+ // Add border width and color styles.
274
+ apply_block_core_search_border_styles( $attributes, 'width', $wrapper_styles, $button_styles, $input_styles );
275
+ apply_block_core_search_border_styles( $attributes, 'color', $wrapper_styles, $button_styles, $input_styles );
276
+ apply_block_core_search_border_styles( $attributes, 'style', $wrapper_styles, $button_styles, $input_styles );
217
277
 
218
278
  // Add border radius styles.
219
279
  $has_border_radius = ! empty( $attributes['style']['border']['radius'] );
@@ -269,21 +329,6 @@ function styles_for_block_core_search( $attributes ) {
269
329
  }
270
330
  }
271
331
 
272
- // Add border color styles.
273
- $has_border_color = ! empty( $attributes['style']['border']['color'] );
274
-
275
- if ( $has_border_color ) {
276
- $border_color = $attributes['style']['border']['color'];
277
-
278
- // Apply wrapper border color if button placed inside.
279
- if ( $is_button_inside ) {
280
- $wrapper_styles[] = sprintf( 'border-color: %s;', esc_attr( $border_color ) );
281
- } else {
282
- $button_styles[] = sprintf( 'border-color: %s;', esc_attr( $border_color ) );
283
- $input_styles[] = sprintf( 'border-color: %s;', esc_attr( $border_color ) );
284
- }
285
- }
286
-
287
332
  // Add color styles.
288
333
  $has_text_color = ! empty( $attributes['style']['color']['text'] );
289
334
  if ( $has_text_color ) {
@@ -315,13 +360,19 @@ function styles_for_block_core_search( $attributes ) {
315
360
  * @return string The border color classnames to be applied to the block elements.
316
361
  */
317
362
  function get_border_color_classes_for_block_core_search( $attributes ) {
363
+ $border_color_classes = array();
318
364
  $has_custom_border_color = ! empty( $attributes['style']['border']['color'] );
319
- $border_color_classes = ! empty( $attributes['borderColor'] ) ? sprintf( 'has-border-color has-%s-border-color', $attributes['borderColor'] ) : '';
320
- // If there's a border color style and no `borderColor` text string, we still want to add the generic `has-border-color` class name to the element.
321
- if ( $has_custom_border_color && empty( $attributes['borderColor'] ) ) {
322
- $border_color_classes = 'has-border-color';
365
+ $has_named_border_color = ! empty( $attributes['borderColor'] );
366
+
367
+ if ( $has_custom_border_color || $has_named_border_color ) {
368
+ $border_color_classes[] = 'has-border-color';
369
+ }
370
+
371
+ if ( $has_named_border_color ) {
372
+ $border_color_classes[] = sprintf( 'has-%s-border-color', esc_attr( $attributes['borderColor'] ) );
323
373
  }
324
- return $border_color_classes;
374
+
375
+ return implode( ' ', $border_color_classes );
325
376
  }
326
377
 
327
378
  /**
@@ -24,6 +24,9 @@
24
24
  "__experimentalDefaultControls": {
25
25
  "background": true
26
26
  }
27
+ },
28
+ "spacing": {
29
+ "margin": [ "top", "bottom" ]
27
30
  }
28
31
  },
29
32
  "styles": [
@@ -0,0 +1 @@
1
+ export const MIN_SPACER_SIZE = 0;