@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
@@ -3,9 +3,7 @@
3
3
  */
4
4
  import { InnerBlocks, useBlockProps } from '@wordpress/block-editor';
5
5
 
6
- export default function CommentsQueryLoopSave( {
7
- attributes: { tagName: Tag },
8
- } ) {
6
+ export default function CommentsSave( { attributes: { tagName: Tag } } ) {
9
7
  return (
10
8
  <Tag { ...useBlockProps.save() }>
11
9
  <InnerBlocks.Content />
@@ -18,6 +18,10 @@ function render_block_core_comments_pagination( $attributes, $content ) {
18
18
  return '';
19
19
  }
20
20
 
21
+ if ( post_password_required() ) {
22
+ return;
23
+ }
24
+
21
25
  return sprintf(
22
26
  '<div %1$s>%2$s</div>',
23
27
  get_block_wrapper_attributes(),
@@ -14,6 +14,10 @@
14
14
  */
15
15
  function render_block_core_comments_title( $attributes ) {
16
16
 
17
+ if ( post_password_required() ) {
18
+ return;
19
+ }
20
+
17
21
  $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}";
18
22
  $show_post_title = ! empty( $attributes['showPostTitle'] ) && $attributes['showPostTitle'];
19
23
  $show_comments_count = ! empty( $attributes['showCommentsCount'] ) && $attributes['showCommentsCount'];
package/src/common.scss CHANGED
@@ -116,11 +116,34 @@
116
116
  html :where(.has-border-color) {
117
117
  border-style: solid;
118
118
  }
119
+ html :where([style*="border-top-color"]) {
120
+ border-top-style: solid;
121
+ }
122
+ html :where([style*="border-right-color"]) {
123
+ border-right-style: solid;
124
+ }
125
+ html :where([style*="border-bottom-color"]) {
126
+ border-bottom-style: solid;
127
+ }
128
+ html :where([style*="border-left-color"]) {
129
+ border-left-style: solid;
130
+ }
119
131
 
120
132
  html :where([style*="border-width"]) {
121
133
  border-style: solid;
122
134
  }
123
-
135
+ html :where([style*="border-top-width"]) {
136
+ border-top-style: solid;
137
+ }
138
+ html :where([style*="border-right-width"]) {
139
+ border-right-style: solid;
140
+ }
141
+ html :where([style*="border-bottom-width"]) {
142
+ border-bottom-style: solid;
143
+ }
144
+ html :where([style*="border-left-width"]) {
145
+ border-left-style: solid;
146
+ }
124
147
 
125
148
  /**
126
149
  * Provide baseline responsiveness for images.
package/src/cover/edit.js CHANGED
@@ -2,8 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import FastAverageColor from 'fast-average-color';
6
- import { colord, extend } from 'colord';
5
+ import { extend } from 'colord';
7
6
  import namesPlugin from 'colord/plugins/names';
8
7
 
9
8
  /**
@@ -31,7 +30,6 @@ import {
31
30
  ToggleControl,
32
31
  ToolbarButton,
33
32
  __experimentalUseCustomUnits as useCustomUnits,
34
- __experimentalBoxControl as BoxControl,
35
33
  __experimentalToolsPanelItem as ToolsPanelItem,
36
34
  __experimentalUnitControl as UnitControl,
37
35
  __experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,
@@ -74,11 +72,10 @@ import {
74
72
  isContentPositionCenter,
75
73
  getPositionClassName,
76
74
  } from './shared';
75
+ import useCoverIsDark from './use-cover-is-dark';
77
76
 
78
77
  extend( [ namesPlugin ] );
79
78
 
80
- const { __Visualizer: BoxControlVisualizer } = BoxControl;
81
-
82
79
  function getInnerBlocksTemplate( attributes ) {
83
80
  return [
84
81
  [
@@ -92,13 +89,6 @@ function getInnerBlocksTemplate( attributes ) {
92
89
  ];
93
90
  }
94
91
 
95
- function retrieveFastAverageColor() {
96
- if ( ! retrieveFastAverageColor.fastAverageColor ) {
97
- retrieveFastAverageColor.fastAverageColor = new FastAverageColor();
98
- }
99
- return retrieveFastAverageColor.fastAverageColor;
100
- }
101
-
102
92
  function CoverHeightInput( {
103
93
  onChange,
104
94
  onUnitChange,
@@ -200,55 +190,6 @@ function ResizableCover( {
200
190
  );
201
191
  }
202
192
 
203
- /**
204
- * useCoverIsDark is a hook that returns a boolean variable specifying if the cover
205
- * background is dark or not.
206
- *
207
- * @param {?string} url Url of the media background.
208
- * @param {?number} dimRatio Transparency of the overlay color. If an image and
209
- * color are set, dimRatio is used to decide what is used
210
- * for background darkness checking purposes.
211
- * @param {?string} overlayColor String containing the overlay color value if one exists.
212
- * @param {?Object} elementRef If a media background is set, elementRef should contain a reference to a
213
- * dom element that renders that media.
214
- *
215
- * @return {boolean} True if the cover background is considered "dark" and false otherwise.
216
- */
217
- function useCoverIsDark( url, dimRatio = 50, overlayColor, elementRef ) {
218
- const [ isDark, setIsDark ] = useState( false );
219
- useEffect( () => {
220
- // If opacity is lower than 50 the dominant color is the image or video color,
221
- // so use that color for the dark mode computation.
222
- if ( url && dimRatio <= 50 && elementRef.current ) {
223
- retrieveFastAverageColor().getColorAsync(
224
- elementRef.current,
225
- ( color ) => {
226
- setIsDark( color.isDark );
227
- }
228
- );
229
- }
230
- }, [ url, url && dimRatio <= 50 && elementRef.current, setIsDark ] );
231
- useEffect( () => {
232
- // If opacity is greater than 50 the dominant color is the overlay color,
233
- // so use that color for the dark mode computation.
234
- if ( dimRatio > 50 || ! url ) {
235
- if ( ! overlayColor ) {
236
- // If no overlay color exists the overlay color is black (isDark )
237
- setIsDark( true );
238
- return;
239
- }
240
- setIsDark( colord( overlayColor ).isDark() );
241
- }
242
- }, [ overlayColor, dimRatio > 50 || ! url, setIsDark ] );
243
- useEffect( () => {
244
- if ( ! url && ! overlayColor ) {
245
- // Reset isDark.
246
- setIsDark( false );
247
- }
248
- }, [ ! url && ! overlayColor, setIsDark ] );
249
- return isDark;
250
- }
251
-
252
193
  function mediaPosition( { x, y } ) {
253
194
  return `${ Math.round( x * 100 ) }% ${ Math.round( y * 100 ) }%`;
254
195
  }
@@ -313,7 +254,6 @@ function CoverEdit( {
313
254
  isRepeated,
314
255
  minHeight,
315
256
  minHeightUnit,
316
- style: styleAttribute,
317
257
  alt,
318
258
  allowedBlocks,
319
259
  templateLock,
@@ -744,11 +684,6 @@ function CoverEdit( {
744
684
  style={ { ...style, ...blockProps.style } }
745
685
  data-url={ url }
746
686
  >
747
- <BoxControlVisualizer
748
- values={ styleAttribute?.spacing?.padding }
749
- showValues={ styleAttribute?.visualizers?.padding }
750
- className="block-library-cover__padding-visualizer"
751
- />
752
687
  <ResizableCover
753
688
  className="block-library-cover__resize-container"
754
689
  onResizeStart={ () => {
@@ -9,6 +9,7 @@ import {
9
9
  Platform,
10
10
  } from 'react-native';
11
11
  import Video from 'react-native-video';
12
+ import classnames from 'classnames/dedupe';
12
13
 
13
14
  /**
14
15
  * WordPress dependencies
@@ -47,7 +48,7 @@ import {
47
48
  store as blockEditorStore,
48
49
  } from '@wordpress/block-editor';
49
50
  import { compose, withPreferredColorScheme } from '@wordpress/compose';
50
- import { withSelect, withDispatch } from '@wordpress/data';
51
+ import { useDispatch, withSelect, withDispatch } from '@wordpress/data';
51
52
  import {
52
53
  useEffect,
53
54
  useState,
@@ -71,6 +72,7 @@ import {
71
72
  COVER_DEFAULT_HEIGHT,
72
73
  } from './shared';
73
74
  import Controls from './controls';
75
+ import useCoverIsDark from './use-cover-is-dark';
74
76
 
75
77
  /**
76
78
  * Constants
@@ -113,6 +115,7 @@ const Cover = ( {
113
115
  customGradient,
114
116
  gradient,
115
117
  overlayColor,
118
+ isDark,
116
119
  } = attributes;
117
120
  const [ isScreenReaderEnabled, setIsScreenReaderEnabled ] = useState(
118
121
  false
@@ -180,18 +183,6 @@ const Cover = ( {
180
183
 
181
184
  const openMediaOptionsRef = useRef();
182
185
 
183
- // Used to set a default color for its InnerBlocks
184
- // since there's no system to inherit styles yet
185
- // the RichText component will check if there are
186
- // parent styles for the current block. If there are,
187
- // it will use that color instead.
188
- useEffect( () => {
189
- // While we don't support theme colors.
190
- if ( ! attributes.overlayColor || ( ! attributes.overlay && url ) ) {
191
- setAttributes( { childrenStyles: styles.defaultColor } );
192
- }
193
- }, [ setAttributes ] );
194
-
195
186
  // Initialize uploading flag to false, awaiting sync.
196
187
  const [ isUploadInProgress, setIsUploadInProgress ] = useState( false );
197
188
 
@@ -257,6 +248,42 @@ const Cover = ( {
257
248
  openGeneralSidebar();
258
249
  }
259
250
 
251
+ const { __unstableMarkNextChangeAsNotPersistent } = useDispatch(
252
+ blockEditorStore
253
+ );
254
+ const isCoverDark = useCoverIsDark(
255
+ isDark,
256
+ url,
257
+ dimRatio,
258
+ overlayColorValue?.color
259
+ );
260
+
261
+ useEffect( () => {
262
+ // This side-effect should not create an undo level.
263
+ __unstableMarkNextChangeAsNotPersistent();
264
+ // Used to set a default color for its InnerBlocks
265
+ // since there's no system to inherit styles yet
266
+ // the RichText component will check if there are
267
+ // parent styles for the current block. If there are,
268
+ // it will use that color instead.
269
+ setAttributes( {
270
+ isDark: isCoverDark,
271
+ childrenStyles: isCoverDark
272
+ ? styles.defaultColor
273
+ : styles.defaultColorLightMode,
274
+ } );
275
+
276
+ // Ensure that "is-light" is removed from "className" attribute if cover background is dark.
277
+ if ( isCoverDark && attributes.className?.includes( 'is-light' ) ) {
278
+ const className = classnames( attributes.className, {
279
+ 'is-light': false,
280
+ } );
281
+ setAttributes( {
282
+ className: className !== '' ? className : undefined,
283
+ } );
284
+ }
285
+ }, [ isCoverDark ] );
286
+
260
287
  const backgroundColor = getStylesFromColorScheme(
261
288
  styles.backgroundSolid,
262
289
  styles.backgroundSolidDark
@@ -49,6 +49,10 @@
49
49
  color: $white;
50
50
  }
51
51
 
52
+ .defaultColorLightMode {
53
+ color: $black;
54
+ }
55
+
52
56
  .background {
53
57
  width: 100%;
54
58
  height: 100%;
@@ -96,10 +96,6 @@
96
96
  }
97
97
  }
98
98
 
99
- .block-library-cover__padding-visualizer {
100
- z-index: z-index(".block-library-cover__padding-visualizer");
101
- }
102
-
103
99
  // Apply max-width to floated items that have no intrinsic width
104
100
  &.alignleft,
105
101
  &.alignright {
@@ -1,8 +1,8 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
3
  exports[`color settings clears the selected overlay color and mantains the inner blocks 1`] = `
4
- "<!-- wp:cover -->
5
- <div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"wp-block-cover__background has-background-dim-100 has-background-dim\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} -->
4
+ "<!-- wp:cover {\\"isDark\\":false} -->
5
+ <div class=\\"wp-block-cover is-light\\"><span aria-hidden=\\"true\\" class=\\"wp-block-cover__background has-background-dim-100 has-background-dim\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} -->
6
6
  <p class=\\"has-text-align-center\\"></p>
7
7
  <!-- /wp:paragraph --></div></div>
8
8
  <!-- /wp:cover -->"
@@ -17,16 +17,16 @@ exports[`color settings sets a color for the overlay background when the placeho
17
17
  `;
18
18
 
19
19
  exports[`color settings sets a gradient overlay background when a solid background was already selected 1`] = `
20
- "<!-- wp:cover {\\"gradient\\":\\"light-green-cyan-to-vivid-green-cyan\\"} -->
21
- <div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"wp-block-cover__background has-background-dim-100 has-background-dim has-background-gradient has-light-green-cyan-to-vivid-green-cyan-gradient-background\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} -->
20
+ "<!-- wp:cover {\\"gradient\\":\\"light-green-cyan-to-vivid-green-cyan\\",\\"isDark\\":false} -->
21
+ <div class=\\"wp-block-cover is-light\\"><span aria-hidden=\\"true\\" class=\\"wp-block-cover__background has-background-dim-100 has-background-dim has-background-gradient has-light-green-cyan-to-vivid-green-cyan-gradient-background\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} -->
22
22
  <p class=\\"has-text-align-center\\"></p>
23
23
  <!-- /wp:paragraph --></div></div>
24
24
  <!-- /wp:cover -->"
25
25
  `;
26
26
 
27
27
  exports[`color settings toggles between solid colors and gradients 1`] = `
28
- "<!-- wp:cover {\\"gradient\\":\\"light-green-cyan-to-vivid-green-cyan\\"} -->
29
- <div class=\\"wp-block-cover\\"><span aria-hidden=\\"true\\" class=\\"wp-block-cover__background has-background-dim-100 has-background-dim has-background-gradient has-light-green-cyan-to-vivid-green-cyan-gradient-background\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} -->
28
+ "<!-- wp:cover {\\"gradient\\":\\"light-green-cyan-to-vivid-green-cyan\\",\\"isDark\\":false} -->
29
+ <div class=\\"wp-block-cover is-light\\"><span aria-hidden=\\"true\\" class=\\"wp-block-cover__background has-background-dim-100 has-background-dim has-background-gradient has-light-green-cyan-to-vivid-green-cyan-gradient-background\\"></span><div class=\\"wp-block-cover__inner-container\\"><!-- wp:paragraph {\\"align\\":\\"center\\",\\"placeholder\\":\\"Write title…\\"} -->
30
30
  <p class=\\"has-text-align-center\\"></p>
31
31
  <!-- /wp:paragraph --></div></div>
32
32
  <!-- /wp:cover -->"
@@ -0,0 +1,301 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import {
5
+ createBlock,
6
+ getBlockTypes,
7
+ registerBlockType,
8
+ switchToBlockType,
9
+ unregisterBlockType,
10
+ } from '@wordpress/blocks';
11
+
12
+ /**
13
+ * Internal dependencies
14
+ */
15
+ import { metadata as coverMetadata, settings as coverSettings } from '../index';
16
+ import {
17
+ metadata as groupMetadata,
18
+ settings as groupSettings,
19
+ } from '../../group';
20
+
21
+ describe( 'transforms', () => {
22
+ beforeAll( () => {
23
+ registerBlockType( coverMetadata, coverSettings );
24
+ registerBlockType( groupMetadata, groupSettings );
25
+ } );
26
+
27
+ afterAll( () => {
28
+ getBlockTypes().forEach( ( block ) => {
29
+ unregisterBlockType( block.name );
30
+ } );
31
+ } );
32
+
33
+ describe( 'transform from Group to Cover', () => {
34
+ it( 'should return child Cover block when Group block contains only a single Cover block', () => {
35
+ const block = createBlock(
36
+ 'core/group',
37
+ { gradient: 'my-gradient' },
38
+ [ createBlock( 'core/cover', { dimRatio: 10 } ) ]
39
+ );
40
+
41
+ const transformedBlocks = switchToBlockType( block, 'core/cover' );
42
+
43
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
44
+ attributes: { dimRatio: 10 },
45
+ innerBlocks: [],
46
+ name: 'core/cover',
47
+ } );
48
+ } );
49
+
50
+ it( 'should wrap Group in a Cover block and move named gradient up to the parent Cover block', () => {
51
+ const block = createBlock( 'core/group', {
52
+ gradient: 'my-gradient',
53
+ } );
54
+
55
+ const transformedBlocks = switchToBlockType( block, 'core/cover' );
56
+ const innerGroupBlock = transformedBlocks[ 0 ].innerBlocks[ 0 ];
57
+
58
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
59
+ attributes: { gradient: 'my-gradient' },
60
+ name: 'core/cover',
61
+ } );
62
+
63
+ expect( innerGroupBlock.name ).toBe( 'core/group' );
64
+ expect( innerGroupBlock.attributes ).not.toHaveProperty(
65
+ 'gradient'
66
+ );
67
+ } );
68
+
69
+ it( 'should wrap Group in a Cover block and move custom gradient up to the parent Cover block', () => {
70
+ const gradient =
71
+ 'linear-gradient(90deg,rgb(188,138,51) 0%,rgb(65,88,208) 100%)';
72
+ const block = createBlock( 'core/group', {
73
+ style: {
74
+ color: {
75
+ gradient,
76
+ },
77
+ },
78
+ } );
79
+
80
+ const transformedBlocks = switchToBlockType( block, 'core/cover' );
81
+ const innerGroupBlock = transformedBlocks[ 0 ].innerBlocks[ 0 ];
82
+
83
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
84
+ attributes: { customGradient: gradient },
85
+ name: 'core/cover',
86
+ } );
87
+
88
+ expect( innerGroupBlock.name ).toBe( 'core/group' );
89
+ expect( innerGroupBlock.attributes ).not.toHaveProperty( 'style' );
90
+ } );
91
+
92
+ it( 'should wrap Group in a Cover block and move named background color up to the parent Cover block', () => {
93
+ const block = createBlock( 'core/group', {
94
+ backgroundColor: 'my-background-color',
95
+ } );
96
+
97
+ const transformedBlocks = switchToBlockType( block, 'core/cover' );
98
+ const innerGroupBlock = transformedBlocks[ 0 ].innerBlocks[ 0 ];
99
+
100
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
101
+ attributes: { overlayColor: 'my-background-color' },
102
+ name: 'core/cover',
103
+ } );
104
+
105
+ expect( innerGroupBlock.name ).toBe( 'core/group' );
106
+ expect( innerGroupBlock.attributes ).not.toHaveProperty(
107
+ 'backgroundColor'
108
+ );
109
+ } );
110
+
111
+ it( 'should wrap Group in a Cover block and move custom background color up to the parent Cover block', () => {
112
+ const background = '#ff0000';
113
+ const block = createBlock( 'core/group', {
114
+ style: {
115
+ color: {
116
+ background,
117
+ },
118
+ },
119
+ } );
120
+
121
+ const transformedBlocks = switchToBlockType( block, 'core/cover' );
122
+ const innerGroupBlock = transformedBlocks[ 0 ].innerBlocks[ 0 ];
123
+
124
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
125
+ attributes: { customOverlayColor: background },
126
+ name: 'core/cover',
127
+ } );
128
+
129
+ expect( innerGroupBlock.name ).toBe( 'core/group' );
130
+ expect( innerGroupBlock.attributes ).not.toHaveProperty( 'style' );
131
+ } );
132
+ } );
133
+
134
+ describe( 'transform from Cover to Group', () => {
135
+ it( 'should transfer named gradient color to Group block', () => {
136
+ const block = createBlock( 'core/cover', {
137
+ gradient: 'my-gradient',
138
+ } );
139
+
140
+ const transformedBlocks = switchToBlockType( block, 'core/group' );
141
+
142
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
143
+ attributes: { gradient: 'my-gradient' },
144
+ name: 'core/group',
145
+ } );
146
+ } );
147
+
148
+ it( 'should transfer custom gradient color to style object in Group block', () => {
149
+ const gradient =
150
+ 'linear-gradient(90deg,rgb(188,138,51) 0%,rgb(65,88,208) 100%)';
151
+ const block = createBlock( 'core/cover', {
152
+ customGradient: gradient,
153
+ } );
154
+
155
+ const transformedBlocks = switchToBlockType( block, 'core/group' );
156
+
157
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
158
+ attributes: { style: { color: { gradient } } },
159
+ name: 'core/group',
160
+ } );
161
+ } );
162
+
163
+ it( 'should transfer named background color to backgroundColor attribute in Group block', () => {
164
+ const block = createBlock( 'core/cover', {
165
+ overlayColor: 'my-background-color',
166
+ } );
167
+
168
+ const transformedBlocks = switchToBlockType( block, 'core/group' );
169
+
170
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
171
+ attributes: { backgroundColor: 'my-background-color' },
172
+ name: 'core/group',
173
+ } );
174
+ } );
175
+
176
+ it( 'should transfer custom background color to style object in Group block', () => {
177
+ const block = createBlock( 'core/cover', {
178
+ customOverlayColor: '#ff0000',
179
+ } );
180
+
181
+ const transformedBlocks = switchToBlockType( block, 'core/group' );
182
+
183
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
184
+ attributes: { style: { color: { background: '#ff0000' } } },
185
+ name: 'core/group',
186
+ } );
187
+ } );
188
+
189
+ it( 'should merge Cover block named gradient color into child Group block', () => {
190
+ const block = createBlock(
191
+ 'core/cover',
192
+ {
193
+ gradient: 'my-gradient',
194
+ },
195
+ [ createBlock( 'core/group', { fontSize: 'medium' } ) ]
196
+ );
197
+
198
+ const transformedBlocks = switchToBlockType( block, 'core/group' );
199
+
200
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
201
+ attributes: { fontSize: 'medium', gradient: 'my-gradient' },
202
+ innerBlocks: [],
203
+ name: 'core/group',
204
+ } );
205
+ } );
206
+
207
+ it( 'should merge Cover block custom gradient color to style object in child Group block', () => {
208
+ const gradient =
209
+ 'linear-gradient(90deg,rgb(188,138,51) 0%,rgb(65,88,208) 100%)';
210
+ const block = createBlock(
211
+ 'core/cover',
212
+ {
213
+ customGradient: gradient,
214
+ },
215
+ [ createBlock( 'core/group', { fontSize: 'medium' } ) ]
216
+ );
217
+
218
+ const transformedBlocks = switchToBlockType( block, 'core/group' );
219
+
220
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
221
+ attributes: {
222
+ fontSize: 'medium',
223
+ style: { color: { gradient } },
224
+ },
225
+ innerBlocks: [],
226
+ name: 'core/group',
227
+ } );
228
+ } );
229
+
230
+ it( 'should merge Cover block named background color to backgroundColor attribute in child Group block', () => {
231
+ const block = createBlock(
232
+ 'core/cover',
233
+ {
234
+ overlayColor: 'my-background-color',
235
+ },
236
+ [ createBlock( 'core/group', { fontSize: 'medium' } ) ]
237
+ );
238
+
239
+ const transformedBlocks = switchToBlockType( block, 'core/group' );
240
+
241
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
242
+ attributes: {
243
+ backgroundColor: 'my-background-color',
244
+ fontSize: 'medium',
245
+ },
246
+ innerBlocks: [],
247
+ name: 'core/group',
248
+ } );
249
+ } );
250
+
251
+ it( 'should merge Cover block custom background color into child Group block', () => {
252
+ const block = createBlock(
253
+ 'core/cover',
254
+ {
255
+ customOverlayColor: '#ff0000',
256
+ },
257
+ [ createBlock( 'core/group', { fontSize: 'medium' } ) ]
258
+ );
259
+
260
+ const transformedBlocks = switchToBlockType( block, 'core/group' );
261
+
262
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
263
+ attributes: {
264
+ fontSize: 'medium',
265
+ style: { color: { background: '#ff0000' } },
266
+ },
267
+ innerBlocks: [],
268
+ name: 'core/group',
269
+ } );
270
+ } );
271
+
272
+ it( 'should skip merging Cover block gradient into child Group block if Group block has background color', () => {
273
+ const block = createBlock(
274
+ 'core/cover',
275
+ {
276
+ gradient: 'my-gradient',
277
+ },
278
+ [
279
+ createBlock( 'core/group', {
280
+ fontSize: 'medium',
281
+ style: { color: { background: '#ff0000' } },
282
+ } ),
283
+ ]
284
+ );
285
+
286
+ const transformedBlocks = switchToBlockType( block, 'core/group' );
287
+
288
+ expect( transformedBlocks[ 0 ] ).toMatchObject( {
289
+ attributes: {
290
+ fontSize: 'medium',
291
+ style: { color: { background: '#ff0000' } },
292
+ },
293
+ innerBlocks: [],
294
+ name: 'core/group',
295
+ } );
296
+ expect( transformedBlocks[ 0 ].attributes ).not.toHaveProperty(
297
+ 'gradient'
298
+ );
299
+ } );
300
+ } );
301
+ } );