@wordpress/block-library 8.9.0 → 8.10.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 (284) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/comment-author-name/edit.js +1 -1
  3. package/build/comment-author-name/edit.js.map +1 -1
  4. package/build/comment-edit-link/edit.js +1 -1
  5. package/build/comment-edit-link/edit.js.map +1 -1
  6. package/build/cover/edit/inspector-controls.js +1 -1
  7. package/build/cover/edit/inspector-controls.js.map +1 -1
  8. package/build/cover/index.js +1 -1
  9. package/build/cover/variations.js +1 -1
  10. package/build/cover/variations.js.map +1 -1
  11. package/build/details/edit.js +19 -5
  12. package/build/details/edit.js.map +1 -1
  13. package/build/details/index.js +14 -10
  14. package/build/details/index.js.map +1 -1
  15. package/build/details/save.js +4 -1
  16. package/build/details/save.js.map +1 -1
  17. package/build/embed/variations.js +2 -2
  18. package/build/embed/variations.js.map +1 -1
  19. package/build/file/view.js +1 -1
  20. package/build/file/view.js.map +1 -1
  21. package/build/gallery/edit.js +2 -8
  22. package/build/gallery/edit.js.map +1 -1
  23. package/build/index.js +0 -6
  24. package/build/index.js.map +1 -1
  25. package/build/index.native.js +1 -1
  26. package/build/index.native.js.map +1 -1
  27. package/build/list-item/utils.js +5 -1
  28. package/build/list-item/utils.js.map +1 -1
  29. package/build/loginout/index.js +11 -1
  30. package/build/loginout/index.js.map +1 -1
  31. package/build/navigation/constants.js +13 -0
  32. package/build/navigation/constants.js.map +1 -0
  33. package/build/navigation/edit/index.js +16 -26
  34. package/build/navigation/edit/index.js.map +1 -1
  35. package/build/navigation/edit/inner-blocks.js +4 -7
  36. package/build/navigation/edit/inner-blocks.js.map +1 -1
  37. package/build/navigation/edit/unsaved-inner-blocks.js +4 -6
  38. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  39. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  40. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  41. package/build/navigation/interactivity.js +139 -0
  42. package/build/navigation/interactivity.js.map +1 -0
  43. package/build/navigation-link/edit.js +1 -1
  44. package/build/navigation-link/edit.js.map +1 -1
  45. package/build/navigation-submenu/edit.js +1 -1
  46. package/build/navigation-submenu/edit.js.map +1 -1
  47. package/build/paragraph/index.js +5 -1
  48. package/build/paragraph/index.js.map +1 -1
  49. package/build/paragraph/transforms.js +5 -1
  50. package/build/paragraph/transforms.js.map +1 -1
  51. package/build/post-author-name/edit.js +1 -1
  52. package/build/post-author-name/edit.js.map +1 -1
  53. package/build/post-featured-image/edit.js +1 -2
  54. package/build/post-featured-image/edit.js.map +1 -1
  55. package/build/post-featured-image/overlay.js +5 -0
  56. package/build/post-featured-image/overlay.js.map +1 -1
  57. package/build/post-title/edit.js +14 -4
  58. package/build/post-title/edit.js.map +1 -1
  59. package/build/preformatted/edit.native.js +3 -2
  60. package/build/preformatted/edit.native.js.map +1 -1
  61. package/build/quote/transforms.js +16 -27
  62. package/build/quote/transforms.js.map +1 -1
  63. package/build/read-more/edit.js +1 -1
  64. package/build/read-more/edit.js.map +1 -1
  65. package/build/search/edit.js +9 -1
  66. package/build/search/edit.js.map +1 -1
  67. package/build/site-title/edit/index.js +1 -1
  68. package/build/site-title/edit/index.js.map +1 -1
  69. package/build/social-links/edit.js +2 -2
  70. package/build/social-links/edit.js.map +1 -1
  71. package/build/utils/interactivity/constants.js +9 -0
  72. package/build/utils/interactivity/constants.js.map +1 -0
  73. package/build/utils/interactivity/directives.js +208 -0
  74. package/build/utils/interactivity/directives.js.map +1 -0
  75. package/build/utils/interactivity/hooks.js +112 -0
  76. package/build/utils/interactivity/hooks.js.map +1 -0
  77. package/build/utils/interactivity/hydration.js +34 -0
  78. package/build/utils/interactivity/hydration.js.map +1 -0
  79. package/build/utils/interactivity/index.js +34 -0
  80. package/build/utils/interactivity/index.js.map +1 -0
  81. package/build/utils/interactivity/store.js +67 -0
  82. package/build/utils/interactivity/store.js.map +1 -0
  83. package/build/utils/interactivity/utils.js +87 -0
  84. package/build/utils/interactivity/utils.js.map +1 -0
  85. package/build/utils/interactivity/vdom.js +109 -0
  86. package/build/utils/interactivity/vdom.js.map +1 -0
  87. package/build-module/comment-author-name/edit.js +1 -1
  88. package/build-module/comment-author-name/edit.js.map +1 -1
  89. package/build-module/comment-edit-link/edit.js +1 -1
  90. package/build-module/comment-edit-link/edit.js.map +1 -1
  91. package/build-module/cover/edit/inspector-controls.js +1 -1
  92. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  93. package/build-module/cover/index.js +1 -1
  94. package/build-module/cover/variations.js +1 -1
  95. package/build-module/cover/variations.js.map +1 -1
  96. package/build-module/details/edit.js +20 -6
  97. package/build-module/details/edit.js.map +1 -1
  98. package/build-module/details/index.js +14 -10
  99. package/build-module/details/index.js.map +1 -1
  100. package/build-module/details/save.js +5 -2
  101. package/build-module/details/save.js.map +1 -1
  102. package/build-module/embed/variations.js +2 -2
  103. package/build-module/embed/variations.js.map +1 -1
  104. package/build-module/file/view.js +1 -1
  105. package/build-module/file/view.js.map +1 -1
  106. package/build-module/gallery/edit.js +2 -8
  107. package/build-module/gallery/edit.js.map +1 -1
  108. package/build-module/index.js +0 -4
  109. package/build-module/index.js.map +1 -1
  110. package/build-module/index.native.js +1 -1
  111. package/build-module/index.native.js.map +1 -1
  112. package/build-module/list-item/utils.js +5 -1
  113. package/build-module/list-item/utils.js.map +1 -1
  114. package/build-module/loginout/index.js +11 -1
  115. package/build-module/loginout/index.js.map +1 -1
  116. package/build-module/navigation/constants.js +5 -0
  117. package/build-module/navigation/constants.js.map +1 -0
  118. package/build-module/navigation/edit/index.js +18 -27
  119. package/build-module/navigation/edit/index.js.map +1 -1
  120. package/build-module/navigation/edit/inner-blocks.js +1 -4
  121. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  122. package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -4
  123. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  124. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  125. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  126. package/build-module/navigation/interactivity.js +136 -0
  127. package/build-module/navigation/interactivity.js.map +1 -0
  128. package/build-module/navigation-link/edit.js +1 -1
  129. package/build-module/navigation-link/edit.js.map +1 -1
  130. package/build-module/navigation-submenu/edit.js +1 -1
  131. package/build-module/navigation-submenu/edit.js.map +1 -1
  132. package/build-module/paragraph/index.js +5 -1
  133. package/build-module/paragraph/index.js.map +1 -1
  134. package/build-module/paragraph/transforms.js +5 -1
  135. package/build-module/paragraph/transforms.js.map +1 -1
  136. package/build-module/post-author-name/edit.js +1 -1
  137. package/build-module/post-author-name/edit.js.map +1 -1
  138. package/build-module/post-featured-image/edit.js +1 -2
  139. package/build-module/post-featured-image/edit.js.map +1 -1
  140. package/build-module/post-featured-image/overlay.js +5 -0
  141. package/build-module/post-featured-image/overlay.js.map +1 -1
  142. package/build-module/post-title/edit.js +13 -4
  143. package/build-module/post-title/edit.js.map +1 -1
  144. package/build-module/preformatted/edit.native.js +3 -2
  145. package/build-module/preformatted/edit.native.js.map +1 -1
  146. package/build-module/quote/transforms.js +16 -27
  147. package/build-module/quote/transforms.js.map +1 -1
  148. package/build-module/read-more/edit.js +1 -1
  149. package/build-module/read-more/edit.js.map +1 -1
  150. package/build-module/search/edit.js +9 -1
  151. package/build-module/search/edit.js.map +1 -1
  152. package/build-module/site-title/edit/index.js +1 -1
  153. package/build-module/site-title/edit/index.js.map +1 -1
  154. package/build-module/social-links/edit.js +2 -2
  155. package/build-module/social-links/edit.js.map +1 -1
  156. package/build-module/utils/interactivity/constants.js +2 -0
  157. package/build-module/utils/interactivity/constants.js.map +1 -0
  158. package/build-module/utils/interactivity/directives.js +193 -0
  159. package/build-module/utils/interactivity/directives.js.map +1 -0
  160. package/build-module/utils/interactivity/hooks.js +98 -0
  161. package/build-module/utils/interactivity/hooks.js.map +1 -0
  162. package/build-module/utils/interactivity/hydration.js +21 -0
  163. package/build-module/utils/interactivity/hydration.js.map +1 -0
  164. package/build-module/utils/interactivity/index.js +17 -0
  165. package/build-module/utils/interactivity/index.js.map +1 -0
  166. package/build-module/utils/interactivity/store.js +56 -0
  167. package/build-module/utils/interactivity/store.js.map +1 -0
  168. package/build-module/utils/interactivity/utils.js +75 -0
  169. package/build-module/utils/interactivity/utils.js.map +1 -0
  170. package/build-module/utils/interactivity/vdom.js +97 -0
  171. package/build-module/utils/interactivity/vdom.js.map +1 -0
  172. package/build-style/cover/style-rtl.css +2 -0
  173. package/build-style/cover/style.css +2 -0
  174. package/build-style/{details-summary → details}/editor-rtl.css +1 -1
  175. package/build-style/{details-summary → details}/editor.css +1 -1
  176. package/build-style/details/style-rtl.css +14 -0
  177. package/build-style/details/style.css +14 -0
  178. package/build-style/editor-rtl.css +3 -5
  179. package/build-style/editor.css +3 -5
  180. package/build-style/gallery/editor-rtl.css +0 -4
  181. package/build-style/gallery/editor.css +0 -4
  182. package/build-style/search/editor-rtl.css +1 -0
  183. package/build-style/search/editor.css +1 -0
  184. package/build-style/site-logo/editor-rtl.css +1 -0
  185. package/build-style/site-logo/editor.css +1 -0
  186. package/build-style/style-rtl.css +13 -1
  187. package/build-style/style.css +13 -1
  188. package/package.json +36 -32
  189. package/src/comment-author-name/edit.js +1 -1
  190. package/src/comment-edit-link/edit.js +1 -1
  191. package/src/comment-template/index.php +8 -7
  192. package/src/cover/block.json +1 -1
  193. package/src/cover/edit/inspector-controls.js +56 -54
  194. package/src/cover/style.scss +5 -0
  195. package/src/cover/test/edit.js +56 -2
  196. package/src/cover/variations.js +1 -3
  197. package/src/details/block.json +8 -6
  198. package/src/details/edit.js +27 -5
  199. package/src/details/editor.scss +3 -0
  200. package/src/details/index.js +10 -5
  201. package/src/details/save.js +5 -1
  202. package/src/details/style.scss +16 -0
  203. package/src/editor.scss +1 -1
  204. package/src/embed/variations.js +2 -2
  205. package/src/file/view.js +4 -1
  206. package/src/gallery/edit.js +5 -8
  207. package/src/gallery/editor.scss +0 -6
  208. package/src/gallery/test/index.native.js +48 -3
  209. package/src/image/test/edit.native.js +38 -16
  210. package/src/index.js +0 -4
  211. package/src/index.native.js +1 -0
  212. package/src/loginout/block.json +11 -1
  213. package/src/navigation/constants.js +16 -0
  214. package/src/navigation/edit/index.js +71 -83
  215. package/src/navigation/edit/inner-blocks.js +1 -16
  216. package/src/navigation/edit/unsaved-inner-blocks.js +1 -16
  217. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  218. package/src/navigation/index.php +209 -203
  219. package/src/navigation/interactivity.js +144 -0
  220. package/src/navigation-link/edit.js +1 -1
  221. package/src/navigation-submenu/edit.js +1 -1
  222. package/src/paragraph/block.json +5 -1
  223. package/src/post-author-name/edit.js +1 -1
  224. package/src/post-featured-image/edit.js +1 -1
  225. package/src/post-featured-image/index.php +1 -1
  226. package/src/post-featured-image/overlay.js +4 -0
  227. package/src/post-terms/index.php +2 -2
  228. package/src/post-title/edit.js +8 -1
  229. package/src/preformatted/edit.native.js +1 -3
  230. package/src/quote/transforms.js +0 -6
  231. package/src/read-more/edit.js +1 -1
  232. package/src/search/edit.js +9 -4
  233. package/src/search/editor.scss +1 -0
  234. package/src/site-logo/editor.scss +2 -1
  235. package/src/site-title/edit/index.js +1 -1
  236. package/src/social-links/edit.js +33 -31
  237. package/src/style.scss +0 -1
  238. package/src/template-part/index.php +20 -5
  239. package/src/utils/interactivity/constants.js +1 -0
  240. package/src/utils/interactivity/directives.js +179 -0
  241. package/src/utils/interactivity/hooks.js +76 -0
  242. package/src/utils/interactivity/hydration.js +22 -0
  243. package/src/utils/interactivity/index.js +17 -0
  244. package/src/utils/interactivity/store.js +45 -0
  245. package/src/utils/interactivity/utils.js +66 -0
  246. package/src/utils/interactivity/vdom.js +94 -0
  247. package/tsconfig.json +1 -0
  248. package/tsconfig.tsbuildinfo +1 -1
  249. package/build/details-content/edit.js +0 -34
  250. package/build/details-content/edit.js.map +0 -1
  251. package/build/details-content/index.js +0 -94
  252. package/build/details-content/index.js.map +0 -1
  253. package/build/details-content/save.js +0 -20
  254. package/build/details-content/save.js.map +0 -1
  255. package/build/details-summary/edit.js +0 -42
  256. package/build/details-summary/edit.js.map +0 -1
  257. package/build/details-summary/index.js +0 -97
  258. package/build/details-summary/index.js.map +0 -1
  259. package/build/details-summary/save.js +0 -24
  260. package/build/details-summary/save.js.map +0 -1
  261. package/build-module/details-content/edit.js +0 -23
  262. package/build-module/details-content/edit.js.map +0 -1
  263. package/build-module/details-content/index.js +0 -76
  264. package/build-module/details-content/index.js.map +0 -1
  265. package/build-module/details-content/save.js +0 -11
  266. package/build-module/details-content/save.js.map +0 -1
  267. package/build-module/details-summary/edit.js +0 -30
  268. package/build-module/details-summary/edit.js.map +0 -1
  269. package/build-module/details-summary/index.js +0 -79
  270. package/build-module/details-summary/index.js.map +0 -1
  271. package/build-module/details-summary/save.js +0 -16
  272. package/build-module/details-summary/save.js.map +0 -1
  273. package/build-style/details-summary/style-rtl.css +0 -91
  274. package/build-style/details-summary/style.css +0 -91
  275. package/src/details-content/block.json +0 -50
  276. package/src/details-content/edit.js +0 -29
  277. package/src/details-content/index.js +0 -23
  278. package/src/details-content/save.js +0 -12
  279. package/src/details-summary/block.json +0 -53
  280. package/src/details-summary/edit.js +0 -27
  281. package/src/details-summary/editor.scss +0 -3
  282. package/src/details-summary/index.js +0 -23
  283. package/src/details-summary/save.js +0 -13
  284. package/src/details-summary/style.scss +0 -3
@@ -86,6 +86,6 @@
86
86
  /**
87
87
  * Reset the WP Admin page styles for Gutenberg-like pages.
88
88
  */
89
- .wp-block-details-summary div {
89
+ .wp-block-details summary div {
90
90
  display: inline;
91
91
  }
@@ -86,6 +86,6 @@
86
86
  /**
87
87
  * Reset the WP Admin page styles for Gutenberg-like pages.
88
88
  */
89
- .wp-block-details-summary div {
89
+ .wp-block-details summary div {
90
90
  display: inline;
91
91
  }
@@ -87,5 +87,19 @@
87
87
  * Reset the WP Admin page styles for Gutenberg-like pages.
88
88
  */
89
89
  .wp-block-details {
90
+ box-sizing: border-box;
90
91
  overflow: hidden;
92
+ }
93
+
94
+ .wp-block-details summary {
95
+ cursor: pointer;
96
+ }
97
+
98
+ .wp-block-details > *:not(summary) {
99
+ margin-block-start: var(--wp--style--block-gap);
100
+ margin-block-end: 0;
101
+ }
102
+
103
+ .wp-block-details > *:last-child {
104
+ margin-bottom: 0;
91
105
  }
@@ -87,5 +87,19 @@
87
87
  * Reset the WP Admin page styles for Gutenberg-like pages.
88
88
  */
89
89
  .wp-block-details {
90
+ box-sizing: border-box;
90
91
  overflow: hidden;
92
+ }
93
+
94
+ .wp-block-details summary {
95
+ cursor: pointer;
96
+ }
97
+
98
+ .wp-block-details > *:not(summary) {
99
+ margin-block-start: var(--wp--style--block-gap);
100
+ margin-block-end: 0;
101
+ }
102
+
103
+ .wp-block-details > *:last-child {
104
+ margin-bottom: 0;
91
105
  }
@@ -574,7 +574,7 @@ html :where(.wp-block-column) {
574
574
  min-height: auto;
575
575
  }
576
576
 
577
- .wp-block-details-summary div {
577
+ .wp-block-details summary div {
578
578
  display: inline;
579
579
  }
580
580
 
@@ -976,10 +976,6 @@ div[data-type="core/freeform"].is-selected .block-library-classic__toolbar {
976
976
  figure.wp-block-gallery {
977
977
  display: block;
978
978
  }
979
- figure.wp-block-gallery.has-nested-images .components-drop-zone {
980
- display: none;
981
- pointer-events: none;
982
- }
983
979
  figure.wp-block-gallery > .blocks-gallery-caption {
984
980
  flex: 0 0 100%;
985
981
  }
@@ -2279,6 +2275,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2279
2275
  border-radius: initial;
2280
2276
  display: flex;
2281
2277
  align-items: center;
2278
+ justify-content: center;
2282
2279
  }
2283
2280
  .wp-block-search__components-button-group {
2284
2281
  margin-top: 10px;
@@ -2425,6 +2422,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2425
2422
  }
2426
2423
  .block-library-site-logo__inspector-media-replace-container img {
2427
2424
  width: 20px;
2425
+ min-width: 20px;
2428
2426
  aspect-ratio: 1;
2429
2427
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
2430
2428
  border-radius: 50% !important;
@@ -578,7 +578,7 @@ html :where(.wp-block-column) {
578
578
  min-height: auto;
579
579
  }
580
580
 
581
- .wp-block-details-summary div {
581
+ .wp-block-details summary div {
582
582
  display: inline;
583
583
  }
584
584
 
@@ -984,10 +984,6 @@ div[data-type="core/freeform"].is-selected .block-library-classic__toolbar {
984
984
  figure.wp-block-gallery {
985
985
  display: block;
986
986
  }
987
- figure.wp-block-gallery.has-nested-images .components-drop-zone {
988
- display: none;
989
- pointer-events: none;
990
- }
991
987
  figure.wp-block-gallery > .blocks-gallery-caption {
992
988
  flex: 0 0 100%;
993
989
  }
@@ -2287,6 +2283,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2287
2283
  border-radius: initial;
2288
2284
  display: flex;
2289
2285
  align-items: center;
2286
+ justify-content: center;
2290
2287
  }
2291
2288
  .wp-block-search__components-button-group {
2292
2289
  margin-top: 10px;
@@ -2433,6 +2430,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2433
2430
  }
2434
2431
  .block-library-site-logo__inspector-media-replace-container img {
2435
2432
  width: 20px;
2433
+ min-width: 20px;
2436
2434
  aspect-ratio: 1;
2437
2435
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
2438
2436
  border-radius: 50% !important;
@@ -89,10 +89,6 @@
89
89
  figure.wp-block-gallery {
90
90
  display: block;
91
91
  }
92
- figure.wp-block-gallery.has-nested-images .components-drop-zone {
93
- display: none;
94
- pointer-events: none;
95
- }
96
92
  figure.wp-block-gallery > .blocks-gallery-caption {
97
93
  flex: 0 0 100%;
98
94
  }
@@ -89,10 +89,6 @@
89
89
  figure.wp-block-gallery {
90
90
  display: block;
91
91
  }
92
- figure.wp-block-gallery.has-nested-images .components-drop-zone {
93
- display: none;
94
- pointer-events: none;
95
- }
96
92
  figure.wp-block-gallery > .blocks-gallery-caption {
97
93
  flex: 0 0 100%;
98
94
  }
@@ -95,6 +95,7 @@
95
95
  border-radius: initial;
96
96
  display: flex;
97
97
  align-items: center;
98
+ justify-content: center;
98
99
  }
99
100
  .wp-block-search__components-button-group {
100
101
  margin-top: 10px;
@@ -95,6 +95,7 @@
95
95
  border-radius: initial;
96
96
  display: flex;
97
97
  align-items: center;
98
+ justify-content: center;
98
99
  }
99
100
  .wp-block-search__components-button-group {
100
101
  margin-top: 10px;
@@ -190,6 +190,7 @@
190
190
  }
191
191
  .block-library-site-logo__inspector-media-replace-container img {
192
192
  width: 20px;
193
+ min-width: 20px;
193
194
  aspect-ratio: 1;
194
195
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
195
196
  border-radius: 50% !important;
@@ -190,6 +190,7 @@
190
190
  }
191
191
  .block-library-site-logo__inspector-media-replace-container img {
192
192
  width: 20px;
193
+ min-width: 20px;
193
194
  aspect-ratio: 1;
194
195
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
195
196
  border-radius: 50% !important;
@@ -609,6 +609,8 @@
609
609
  justify-content: center;
610
610
  align-items: center;
611
611
  padding: 1em;
612
+ overflow: hidden;
613
+ overflow: clip;
612
614
  box-sizing: border-box; direction: ltr;
613
615
  /**
614
616
  * Set a default background color for has-background-dim _unless_ it includes another
@@ -1019,13 +1021,23 @@ section.wp-block-cover-image > h2,
1019
1021
  }
1020
1022
 
1021
1023
  .wp-block-details {
1024
+ box-sizing: border-box;
1022
1025
  overflow: hidden;
1023
1026
  }
1024
1027
 
1025
- .wp-block-details-summary {
1028
+ .wp-block-details summary {
1026
1029
  cursor: pointer;
1027
1030
  }
1028
1031
 
1032
+ .wp-block-details > *:not(summary) {
1033
+ margin-block-start: var(--wp--style--block-gap);
1034
+ margin-block-end: 0;
1035
+ }
1036
+
1037
+ .wp-block-details > *:last-child {
1038
+ margin-bottom: 0;
1039
+ }
1040
+
1029
1041
  .wp-block[data-align=left] > [data-type="core/embed"],
1030
1042
  .wp-block[data-align=right] > [data-type="core/embed"],
1031
1043
  .wp-block-embed.alignleft,
@@ -614,6 +614,8 @@
614
614
  justify-content: center;
615
615
  align-items: center;
616
616
  padding: 1em;
617
+ overflow: hidden;
618
+ overflow: clip;
617
619
  box-sizing: border-box;
618
620
  /*rtl:raw: direction: ltr; */
619
621
  /**
@@ -1026,13 +1028,23 @@ section.wp-block-cover-image > h2,
1026
1028
  }
1027
1029
 
1028
1030
  .wp-block-details {
1031
+ box-sizing: border-box;
1029
1032
  overflow: hidden;
1030
1033
  }
1031
1034
 
1032
- .wp-block-details-summary {
1035
+ .wp-block-details summary {
1033
1036
  cursor: pointer;
1034
1037
  }
1035
1038
 
1039
+ .wp-block-details > *:not(summary) {
1040
+ margin-block-start: var(--wp--style--block-gap);
1041
+ margin-block-end: 0;
1042
+ }
1043
+
1044
+ .wp-block-details > *:last-child {
1045
+ margin-bottom: 0;
1046
+ }
1047
+
1036
1048
  .wp-block[data-align=left] > [data-type="core/embed"],
1037
1049
  .wp-block[data-align=right] > [data-type="core/embed"],
1038
1050
  .wp-block-embed.alignleft,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "8.9.0",
3
+ "version": "8.10.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,48 +27,52 @@
27
27
  "sideEffects": [
28
28
  "build-style/**",
29
29
  "src/**/*.scss",
30
- "{src,build,build-module}/*/init.js"
30
+ "{src,build,build-module}/*/init.js",
31
+ "{src,build,build-module}/utils/interactivity/index.js"
31
32
  ],
32
33
  "dependencies": {
33
34
  "@babel/runtime": "^7.16.0",
34
- "@wordpress/a11y": "^3.32.0",
35
- "@wordpress/api-fetch": "^6.29.0",
36
- "@wordpress/autop": "^3.32.0",
37
- "@wordpress/blob": "^3.32.0",
38
- "@wordpress/block-editor": "^12.0.0",
39
- "@wordpress/blocks": "^12.9.0",
40
- "@wordpress/components": "^23.9.0",
41
- "@wordpress/compose": "^6.9.0",
42
- "@wordpress/core-data": "^6.9.0",
43
- "@wordpress/data": "^9.2.0",
44
- "@wordpress/date": "^4.32.0",
45
- "@wordpress/deprecated": "^3.32.0",
46
- "@wordpress/dom": "^3.32.0",
47
- "@wordpress/element": "^5.9.0",
48
- "@wordpress/escape-html": "^2.32.0",
49
- "@wordpress/hooks": "^3.32.0",
50
- "@wordpress/html-entities": "^3.32.0",
51
- "@wordpress/i18n": "^4.32.0",
52
- "@wordpress/icons": "^9.23.0",
53
- "@wordpress/keycodes": "^3.32.0",
54
- "@wordpress/notices": "^4.0.0",
55
- "@wordpress/primitives": "^3.30.0",
56
- "@wordpress/private-apis": "^0.14.0",
57
- "@wordpress/reusable-blocks": "^4.9.0",
58
- "@wordpress/rich-text": "^6.9.0",
59
- "@wordpress/server-side-render": "^4.9.0",
60
- "@wordpress/url": "^3.33.0",
61
- "@wordpress/viewport": "^5.9.0",
62
- "@wordpress/wordcount": "^3.32.0",
35
+ "@preact/signals": "^1.1.3",
36
+ "@wordpress/a11y": "^3.33.0",
37
+ "@wordpress/api-fetch": "^6.30.0",
38
+ "@wordpress/autop": "^3.33.0",
39
+ "@wordpress/blob": "^3.33.0",
40
+ "@wordpress/block-editor": "^12.1.0",
41
+ "@wordpress/blocks": "^12.10.0",
42
+ "@wordpress/components": "^24.0.0",
43
+ "@wordpress/compose": "^6.10.0",
44
+ "@wordpress/core-data": "^6.10.0",
45
+ "@wordpress/data": "^9.3.0",
46
+ "@wordpress/date": "^4.33.0",
47
+ "@wordpress/deprecated": "^3.33.0",
48
+ "@wordpress/dom": "^3.33.0",
49
+ "@wordpress/element": "^5.10.0",
50
+ "@wordpress/escape-html": "^2.33.0",
51
+ "@wordpress/hooks": "^3.33.0",
52
+ "@wordpress/html-entities": "^3.33.0",
53
+ "@wordpress/i18n": "^4.33.0",
54
+ "@wordpress/icons": "^9.24.0",
55
+ "@wordpress/keycodes": "^3.33.0",
56
+ "@wordpress/notices": "^4.1.0",
57
+ "@wordpress/primitives": "^3.31.0",
58
+ "@wordpress/private-apis": "^0.15.0",
59
+ "@wordpress/reusable-blocks": "^4.10.0",
60
+ "@wordpress/rich-text": "^6.10.0",
61
+ "@wordpress/server-side-render": "^4.10.0",
62
+ "@wordpress/url": "^3.34.0",
63
+ "@wordpress/viewport": "^5.10.0",
64
+ "@wordpress/wordcount": "^3.33.0",
63
65
  "change-case": "^4.1.2",
64
66
  "classnames": "^2.3.1",
65
67
  "colord": "^2.7.0",
68
+ "deepsignal": "^1.3.0",
66
69
  "escape-html": "^1.0.3",
67
70
  "fast-average-color": "^9.1.1",
68
71
  "fast-deep-equal": "^3.1.3",
69
72
  "lodash": "^4.17.21",
70
73
  "memize": "^1.1.0",
71
74
  "micromodal": "^0.4.10",
75
+ "preact": "^10.13.2",
72
76
  "remove-accents": "^0.4.2"
73
77
  },
74
78
  "peerDependencies": {
@@ -78,5 +82,5 @@
78
82
  "publishConfig": {
79
83
  "access": "public"
80
84
  },
81
- "gitHead": "6df0c62d43b8901414ccd22ffbe56eaa99d012a6"
85
+ "gitHead": "e936127e1e13881f1a940b7bd1593a9e500147f3"
82
86
  }
@@ -70,7 +70,7 @@ export default function Edit( {
70
70
 
71
71
  const inspectorControls = (
72
72
  <InspectorControls>
73
- <PanelBody title={ __( 'Link settings' ) }>
73
+ <PanelBody title={ __( 'Settings' ) }>
74
74
  <ToggleControl
75
75
  __nextHasNoMarginBottom
76
76
  label={ __( 'Link to authors URL' ) }
@@ -37,7 +37,7 @@ export default function Edit( {
37
37
  );
38
38
  const inspectorControls = (
39
39
  <InspectorControls>
40
- <PanelBody title={ __( 'Link settings' ) }>
40
+ <PanelBody title={ __( 'Settings' ) }>
41
41
  <ToggleControl
42
42
  __nextHasNoMarginBottom
43
43
  label={ __( 'Open in new tab' ) }
@@ -25,13 +25,14 @@ function block_core_comment_template_render_comments( $comments, $block ) {
25
25
 
26
26
  $content = '';
27
27
  foreach ( $comments as $comment ) {
28
-
29
- $block_content = ( new WP_Block(
30
- $block->parsed_block,
31
- array(
32
- 'commentId' => $comment->comment_ID,
33
- )
34
- ) )->render( array( 'dynamic' => false ) );
28
+ $comment_id = $comment->comment_ID;
29
+ $filter_block_context = static function( $context ) use ( $comment_id ) {
30
+ $context['commentId'] = $comment_id;
31
+ return $context;
32
+ };
33
+ add_filter( 'render_block_context', $filter_block_context );
34
+ $block_content = $block->render( array( 'dynamic' => false ) );
35
+ remove_filter( 'render_block_context', $filter_block_context );
35
36
 
36
37
  $children = $comment->get_children();
37
38
 
@@ -4,7 +4,7 @@
4
4
  "name": "core/cover",
5
5
  "title": "Cover",
6
6
  "category": "media",
7
- "description": "Add an image or video with a text overlay — great for headers.",
7
+ "description": "Add an image or video with a text overlay.",
8
8
  "textdomain": "default",
9
9
  "attributes": {
10
10
  "url": {
@@ -249,62 +249,64 @@ export default function CoverInspectorControls( {
249
249
  </PanelBody>
250
250
  ) }
251
251
  </InspectorControls>
252
- <InspectorControls group="color">
253
- <ColorGradientSettingsDropdown
254
- __experimentalIsRenderedInSidebar
255
- settings={ [
256
- {
257
- colorValue: overlayColor.color,
258
- gradientValue,
259
- label: __( 'Overlay' ),
260
- onColorChange: setOverlayColor,
261
- onGradientChange: setGradient,
262
- isShownByDefault: true,
263
- resetAllFilter: () => ( {
264
- overlayColor: undefined,
265
- customOverlayColor: undefined,
266
- gradient: undefined,
267
- customGradient: undefined,
268
- } ),
269
- },
270
- ] }
271
- panelId={ clientId }
272
- { ...colorGradientSettings }
273
- />
274
- <ToolsPanelItem
275
- hasValue={ () => {
276
- // If there's a media background the dimRatio will be
277
- // defaulted to 50 whereas it will be 100 for colors.
278
- return dimRatio === undefined
279
- ? false
280
- : dimRatio !== ( url ? 50 : 100 );
281
- } }
282
- label={ __( 'Overlay opacity' ) }
283
- onDeselect={ () =>
284
- setAttributes( { dimRatio: url ? 50 : 100 } )
285
- }
286
- resetAllFilter={ () => ( {
287
- dimRatio: url ? 50 : 100,
288
- } ) }
289
- isShownByDefault
290
- panelId={ clientId }
291
- >
292
- <RangeControl
293
- __nextHasNoMarginBottom
252
+ { colorGradientSettings.hasColorsOrGradients && (
253
+ <InspectorControls group="color">
254
+ <ColorGradientSettingsDropdown
255
+ __experimentalIsRenderedInSidebar
256
+ settings={ [
257
+ {
258
+ colorValue: overlayColor.color,
259
+ gradientValue,
260
+ label: __( 'Overlay' ),
261
+ onColorChange: setOverlayColor,
262
+ onGradientChange: setGradient,
263
+ isShownByDefault: true,
264
+ resetAllFilter: () => ( {
265
+ overlayColor: undefined,
266
+ customOverlayColor: undefined,
267
+ gradient: undefined,
268
+ customGradient: undefined,
269
+ } ),
270
+ },
271
+ ] }
272
+ panelId={ clientId }
273
+ { ...colorGradientSettings }
274
+ />
275
+ <ToolsPanelItem
276
+ hasValue={ () => {
277
+ // If there's a media background the dimRatio will be
278
+ // defaulted to 50 whereas it will be 100 for colors.
279
+ return dimRatio === undefined
280
+ ? false
281
+ : dimRatio !== ( url ? 50 : 100 );
282
+ } }
294
283
  label={ __( 'Overlay opacity' ) }
295
- value={ dimRatio }
296
- onChange={ ( newDimRation ) =>
297
- setAttributes( {
298
- dimRatio: newDimRation,
299
- } )
284
+ onDeselect={ () =>
285
+ setAttributes( { dimRatio: url ? 50 : 100 } )
300
286
  }
301
- min={ 0 }
302
- max={ 100 }
303
- step={ 10 }
304
- required
305
- />
306
- </ToolsPanelItem>
307
- </InspectorControls>
287
+ resetAllFilter={ () => ( {
288
+ dimRatio: url ? 50 : 100,
289
+ } ) }
290
+ isShownByDefault
291
+ panelId={ clientId }
292
+ >
293
+ <RangeControl
294
+ __nextHasNoMarginBottom
295
+ label={ __( 'Overlay opacity' ) }
296
+ value={ dimRatio }
297
+ onChange={ ( newDimRation ) =>
298
+ setAttributes( {
299
+ dimRatio: newDimRation,
300
+ } )
301
+ }
302
+ min={ 0 }
303
+ max={ 100 }
304
+ step={ 10 }
305
+ required
306
+ />
307
+ </ToolsPanelItem>
308
+ </InspectorControls>
309
+ ) }
308
310
  <InspectorControls group="dimensions">
309
311
  <ToolsPanelItem
310
312
  hasValue={ () => !! minHeight }
@@ -7,6 +7,11 @@
7
7
  justify-content: center;
8
8
  align-items: center;
9
9
  padding: 1em;
10
+ // Prevent the `wp-block-cover__background` span from overflowing the container when border-radius is applied.
11
+ // `overflow: hidden` is provided as a fallback for browsers that don't support `overflow: clip`.
12
+ overflow: hidden;
13
+ // Use clip instead of overflow: hidden so that sticky position works on child elements.
14
+ overflow: clip;
10
15
  // This block has customizable padding, border-box makes that more predictable.
11
16
  box-sizing: border-box;
12
17
  // Keep the flex layout direction to the physical direction (LTR) in RTL languages.
@@ -12,9 +12,34 @@ import {
12
12
  selectBlock,
13
13
  } from 'test/integration/helpers/integration-test-editor';
14
14
 
15
- async function setup( attributes ) {
15
+ const defaultSettings = {
16
+ __experimentalFeatures: {
17
+ color: {
18
+ defaultPalette: true,
19
+ defaultGradients: true,
20
+ palette: {
21
+ default: [ { name: 'Black', slug: 'black', color: '#000000' } ],
22
+ },
23
+ },
24
+ },
25
+ colors: [ { name: 'Black', slug: 'black', color: '#000000' } ],
26
+ disableCustomColors: false,
27
+ disableCustomGradients: false,
28
+ };
29
+
30
+ const disabledColorSettings = {
31
+ color: {
32
+ defaultPalette: false,
33
+ defaultGradients: false,
34
+ },
35
+ disableCustomColors: true,
36
+ disableCustomGradients: true,
37
+ };
38
+
39
+ async function setup( attributes, useCoreBlocks, customSettings ) {
16
40
  const testBlock = { name: 'core/cover', attributes };
17
- return initializeEditor( testBlock );
41
+ const settings = customSettings || defaultSettings;
42
+ return initializeEditor( testBlock, useCoreBlocks, settings );
18
43
  }
19
44
 
20
45
  async function createAndSelectBlock() {
@@ -296,6 +321,35 @@ describe( 'Cover block', () => {
296
321
 
297
322
  expect( overlay[ 0 ] ).toHaveClass( 'has-background-dim-30' );
298
323
  } );
324
+
325
+ describe( 'when colors are disabled', () => {
326
+ test( 'does not render overlay control', async () => {
327
+ await setup( undefined, true, disabledColorSettings );
328
+ await createAndSelectBlock();
329
+ await userEvent.click(
330
+ screen.getByRole( 'tab', { name: 'Styles' } )
331
+ );
332
+
333
+ const overlayControl = screen.queryByRole( 'button', {
334
+ name: 'Overlay',
335
+ } );
336
+
337
+ expect( overlayControl ).not.toBeInTheDocument();
338
+ } );
339
+ test( 'does not render opacity control', async () => {
340
+ await setup( undefined, true, disabledColorSettings );
341
+ await createAndSelectBlock();
342
+ await userEvent.click(
343
+ screen.getByRole( 'tab', { name: 'Styles' } )
344
+ );
345
+
346
+ const opacityControl = screen.queryByRole( 'slider', {
347
+ name: 'Overlay opacity',
348
+ } );
349
+
350
+ expect( opacityControl ).not.toBeInTheDocument();
351
+ } );
352
+ } );
299
353
  } );
300
354
 
301
355
  describe( 'Dimensions panel', () => {
@@ -8,9 +8,7 @@ const variations = [
8
8
  {
9
9
  name: 'cover',
10
10
  title: __( 'Cover' ),
11
- description: __(
12
- 'Add an image or video with a text overlay — great for headers.'
13
- ),
11
+ description: __( 'Add an image or video with a text overlay.' ),
14
12
  attributes: { layout: { type: 'constrained' } },
15
13
  isDefault: true,
16
14
  icon: cover,