@wordpress/block-library 8.9.0 → 8.11.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 (502) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/block/edit.native.js +17 -10
  3. package/build/block/edit.native.js.map +1 -1
  4. package/build/code/index.js +1 -0
  5. package/build/code/index.js.map +1 -1
  6. package/build/column/index.js +1 -1
  7. package/build/columns/transforms.js +1 -5
  8. package/build/columns/transforms.js.map +1 -1
  9. package/build/comment-author-name/edit.js +1 -1
  10. package/build/comment-author-name/edit.js.map +1 -1
  11. package/build/comment-edit-link/edit.js +1 -1
  12. package/build/comment-edit-link/edit.js.map +1 -1
  13. package/build/cover/edit/inspector-controls.js +1 -1
  14. package/build/cover/edit/inspector-controls.js.map +1 -1
  15. package/build/cover/edit/resizable-cover-popover.js +3 -3
  16. package/build/cover/edit/resizable-cover-popover.js.map +1 -1
  17. package/build/cover/index.js +1 -1
  18. package/build/cover/variations.js +1 -1
  19. package/build/cover/variations.js.map +1 -1
  20. package/build/details/edit.js +19 -5
  21. package/build/details/edit.js.map +1 -1
  22. package/build/details/index.js +14 -10
  23. package/build/details/index.js.map +1 -1
  24. package/build/details/save.js +4 -1
  25. package/build/details/save.js.map +1 -1
  26. package/build/embed/variations.js +2 -2
  27. package/build/embed/variations.js.map +1 -1
  28. package/build/file/interactivity.js +19 -0
  29. package/build/file/interactivity.js.map +1 -0
  30. package/build/file/{utils.js → utils/index.js} +1 -1
  31. package/build/file/utils/index.js.map +1 -0
  32. package/build/file/view.js +1 -1
  33. package/build/file/view.js.map +1 -1
  34. package/build/freeform/modal.js +20 -17
  35. package/build/freeform/modal.js.map +1 -1
  36. package/build/gallery/edit.js +2 -8
  37. package/build/gallery/edit.js.map +1 -1
  38. package/build/gallery/v1/edit.js +1 -7
  39. package/build/gallery/v1/edit.js.map +1 -1
  40. package/build/gallery/v1/gallery-image.native.js +1 -3
  41. package/build/gallery/v1/gallery-image.native.js.map +1 -1
  42. package/build/group/transforms.js +0 -5
  43. package/build/group/transforms.js.map +1 -1
  44. package/build/image/deprecated.js +2 -4
  45. package/build/image/deprecated.js.map +1 -1
  46. package/build/image/edit.js +13 -11
  47. package/build/image/edit.js.map +1 -1
  48. package/build/image/image.js +7 -12
  49. package/build/image/image.js.map +1 -1
  50. package/build/image/index.js +3 -0
  51. package/build/image/index.js.map +1 -1
  52. package/build/image/interactivity.js +102 -0
  53. package/build/image/interactivity.js.map +1 -0
  54. package/build/image/save.js +2 -4
  55. package/build/image/save.js.map +1 -1
  56. package/build/image/utils.js +10 -18
  57. package/build/image/utils.js.map +1 -1
  58. package/build/index.js +0 -6
  59. package/build/index.js.map +1 -1
  60. package/build/index.native.js +1 -1
  61. package/build/index.native.js.map +1 -1
  62. package/build/latest-posts/edit.native.js +1 -3
  63. package/build/latest-posts/edit.native.js.map +1 -1
  64. package/build/list/edit.js +1 -1
  65. package/build/list/edit.js.map +1 -1
  66. package/build/list-item/edit.native.js +1 -1
  67. package/build/list-item/edit.native.js.map +1 -1
  68. package/build/list-item/transforms.js +4 -1
  69. package/build/list-item/transforms.js.map +1 -1
  70. package/build/list-item/utils.js +5 -1
  71. package/build/list-item/utils.js.map +1 -1
  72. package/build/loginout/index.js +11 -1
  73. package/build/loginout/index.js.map +1 -1
  74. package/build/media-text/deprecated.js +4 -6
  75. package/build/media-text/deprecated.js.map +1 -1
  76. package/build/media-text/edit.js +13 -11
  77. package/build/media-text/edit.js.map +1 -1
  78. package/build/media-text/media-container.js +3 -3
  79. package/build/media-text/media-container.js.map +1 -1
  80. package/build/media-text/save.js +1 -3
  81. package/build/media-text/save.js.map +1 -1
  82. package/build/navigation/constants.js +15 -0
  83. package/build/navigation/constants.js.map +1 -0
  84. package/build/navigation/edit/index.js +16 -26
  85. package/build/navigation/edit/index.js.map +1 -1
  86. package/build/navigation/edit/inner-blocks.js +5 -7
  87. package/build/navigation/edit/inner-blocks.js.map +1 -1
  88. package/build/navigation/edit/leaf-more-menu.js +148 -0
  89. package/build/navigation/edit/leaf-more-menu.js.map +1 -0
  90. package/build/navigation/edit/menu-inspector-controls.js +53 -8
  91. package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
  92. package/build/navigation/edit/navigation-menu-delete-control.js +6 -6
  93. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  94. package/build/navigation/edit/unsaved-inner-blocks.js +12 -25
  95. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  96. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  97. package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  98. package/build/navigation/interactivity.js +157 -0
  99. package/build/navigation/interactivity.js.map +1 -0
  100. package/build/navigation-link/edit.js +7 -5
  101. package/build/navigation-link/edit.js.map +1 -1
  102. package/build/navigation-link/update-attributes.js +5 -5
  103. package/build/navigation-link/update-attributes.js.map +1 -1
  104. package/build/navigation-submenu/edit.js +7 -5
  105. package/build/navigation-submenu/edit.js.map +1 -1
  106. package/build/paragraph/index.js +5 -1
  107. package/build/paragraph/index.js.map +1 -1
  108. package/build/paragraph/transforms.js +5 -1
  109. package/build/paragraph/transforms.js.map +1 -1
  110. package/build/pattern/edit.js +42 -8
  111. package/build/pattern/edit.js.map +1 -1
  112. package/build/pattern/index.js +12 -5
  113. package/build/pattern/index.js.map +1 -1
  114. package/build/pattern/v1/edit.js +57 -0
  115. package/build/pattern/v1/edit.js.map +1 -0
  116. package/build/post-author-name/edit.js +1 -1
  117. package/build/post-author-name/edit.js.map +1 -1
  118. package/build/post-featured-image/edit.js +1 -2
  119. package/build/post-featured-image/edit.js.map +1 -1
  120. package/build/post-featured-image/overlay.js +5 -0
  121. package/build/post-featured-image/overlay.js.map +1 -1
  122. package/build/post-title/edit.js +24 -7
  123. package/build/post-title/edit.js.map +1 -1
  124. package/build/preformatted/edit.native.js +3 -2
  125. package/build/preformatted/edit.native.js.map +1 -1
  126. package/build/quote/transforms.js +23 -37
  127. package/build/quote/transforms.js.map +1 -1
  128. package/build/read-more/edit.js +1 -1
  129. package/build/read-more/edit.js.map +1 -1
  130. package/build/search/edit.js +9 -1
  131. package/build/search/edit.js.map +1 -1
  132. package/build/site-title/edit/index.js +1 -1
  133. package/build/site-title/edit/index.js.map +1 -1
  134. package/build/social-link/edit.js +21 -4
  135. package/build/social-link/edit.js.map +1 -1
  136. package/build/social-links/edit.js +2 -2
  137. package/build/social-links/edit.js.map +1 -1
  138. package/build/template-part/edit/index.js +1 -7
  139. package/build/template-part/edit/index.js.map +1 -1
  140. package/build/template-part/edit/utils/hooks.js +2 -2
  141. package/build/template-part/edit/utils/hooks.js.map +1 -1
  142. package/build/utils/interactivity/constants.js +9 -0
  143. package/build/utils/interactivity/constants.js.map +1 -0
  144. package/build/utils/interactivity/directives.js +236 -0
  145. package/build/utils/interactivity/directives.js.map +1 -0
  146. package/build/utils/interactivity/hooks.js +176 -0
  147. package/build/utils/interactivity/hooks.js.map +1 -0
  148. package/build/utils/interactivity/hydration.js +34 -0
  149. package/build/utils/interactivity/hydration.js.map +1 -0
  150. package/build/utils/interactivity/index.js +34 -0
  151. package/build/utils/interactivity/index.js.map +1 -0
  152. package/build/utils/interactivity/portals.js +108 -0
  153. package/build/utils/interactivity/portals.js.map +1 -0
  154. package/build/utils/interactivity/store.js +67 -0
  155. package/build/utils/interactivity/store.js.map +1 -0
  156. package/build/utils/interactivity/utils.js +87 -0
  157. package/build/utils/interactivity/utils.js.map +1 -0
  158. package/build/utils/interactivity/vdom.js +109 -0
  159. package/build/utils/interactivity/vdom.js.map +1 -0
  160. package/build-module/block/edit.native.js +7 -1
  161. package/build-module/block/edit.native.js.map +1 -1
  162. package/build-module/code/index.js +1 -0
  163. package/build-module/code/index.js.map +1 -1
  164. package/build-module/column/index.js +1 -1
  165. package/build-module/columns/transforms.js +1 -5
  166. package/build-module/columns/transforms.js.map +1 -1
  167. package/build-module/comment-author-name/edit.js +1 -1
  168. package/build-module/comment-author-name/edit.js.map +1 -1
  169. package/build-module/comment-edit-link/edit.js +1 -1
  170. package/build-module/comment-edit-link/edit.js.map +1 -1
  171. package/build-module/cover/edit/inspector-controls.js +1 -1
  172. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  173. package/build-module/cover/edit/resizable-cover-popover.js +3 -3
  174. package/build-module/cover/edit/resizable-cover-popover.js.map +1 -1
  175. package/build-module/cover/index.js +1 -1
  176. package/build-module/cover/variations.js +1 -1
  177. package/build-module/cover/variations.js.map +1 -1
  178. package/build-module/details/edit.js +20 -6
  179. package/build-module/details/edit.js.map +1 -1
  180. package/build-module/details/index.js +14 -10
  181. package/build-module/details/index.js.map +1 -1
  182. package/build-module/details/save.js +5 -2
  183. package/build-module/details/save.js.map +1 -1
  184. package/build-module/embed/variations.js +2 -2
  185. package/build-module/embed/variations.js.map +1 -1
  186. package/build-module/file/interactivity.js +15 -0
  187. package/build-module/file/interactivity.js.map +1 -0
  188. package/build-module/file/{utils.js → utils/index.js} +1 -1
  189. package/build-module/file/utils/index.js.map +1 -0
  190. package/build-module/file/view.js +1 -1
  191. package/build-module/file/view.js.map +1 -1
  192. package/build-module/freeform/modal.js +19 -18
  193. package/build-module/freeform/modal.js.map +1 -1
  194. package/build-module/gallery/edit.js +2 -8
  195. package/build-module/gallery/edit.js.map +1 -1
  196. package/build-module/gallery/v1/edit.js +1 -6
  197. package/build-module/gallery/v1/edit.js.map +1 -1
  198. package/build-module/gallery/v1/gallery-image.native.js +1 -2
  199. package/build-module/gallery/v1/gallery-image.native.js.map +1 -1
  200. package/build-module/group/transforms.js +0 -5
  201. package/build-module/group/transforms.js.map +1 -1
  202. package/build-module/image/deprecated.js +2 -3
  203. package/build-module/image/deprecated.js.map +1 -1
  204. package/build-module/image/edit.js +12 -11
  205. package/build-module/image/edit.js.map +1 -1
  206. package/build-module/image/image.js +7 -11
  207. package/build-module/image/image.js.map +1 -1
  208. package/build-module/image/index.js +3 -0
  209. package/build-module/image/index.js.map +1 -1
  210. package/build-module/image/interactivity.js +99 -0
  211. package/build-module/image/interactivity.js.map +1 -0
  212. package/build-module/image/save.js +2 -3
  213. package/build-module/image/save.js.map +1 -1
  214. package/build-module/image/utils.js +10 -17
  215. package/build-module/image/utils.js.map +1 -1
  216. package/build-module/index.js +0 -4
  217. package/build-module/index.js.map +1 -1
  218. package/build-module/index.native.js +1 -1
  219. package/build-module/index.native.js.map +1 -1
  220. package/build-module/latest-posts/edit.native.js +1 -2
  221. package/build-module/latest-posts/edit.native.js.map +1 -1
  222. package/build-module/list/edit.js +1 -1
  223. package/build-module/list/edit.js.map +1 -1
  224. package/build-module/list-item/edit.native.js +1 -1
  225. package/build-module/list-item/edit.native.js.map +1 -1
  226. package/build-module/list-item/transforms.js +5 -2
  227. package/build-module/list-item/transforms.js.map +1 -1
  228. package/build-module/list-item/utils.js +5 -1
  229. package/build-module/list-item/utils.js.map +1 -1
  230. package/build-module/loginout/index.js +11 -1
  231. package/build-module/loginout/index.js.map +1 -1
  232. package/build-module/media-text/deprecated.js +4 -5
  233. package/build-module/media-text/deprecated.js.map +1 -1
  234. package/build-module/media-text/edit.js +13 -12
  235. package/build-module/media-text/edit.js.map +1 -1
  236. package/build-module/media-text/media-container.js +3 -3
  237. package/build-module/media-text/media-container.js.map +1 -1
  238. package/build-module/media-text/save.js +1 -2
  239. package/build-module/media-text/save.js.map +1 -1
  240. package/build-module/navigation/constants.js +6 -0
  241. package/build-module/navigation/constants.js.map +1 -0
  242. package/build-module/navigation/edit/index.js +18 -27
  243. package/build-module/navigation/edit/index.js.map +1 -1
  244. package/build-module/navigation/edit/inner-blocks.js +2 -4
  245. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  246. package/build-module/navigation/edit/leaf-more-menu.js +132 -0
  247. package/build-module/navigation/edit/leaf-more-menu.js.map +1 -0
  248. package/build-module/navigation/edit/menu-inspector-controls.js +52 -9
  249. package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
  250. package/build-module/navigation/edit/navigation-menu-delete-control.js +7 -7
  251. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  252. package/build-module/navigation/edit/unsaved-inner-blocks.js +9 -20
  253. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  254. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  255. package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
  256. package/build-module/navigation/interactivity.js +154 -0
  257. package/build-module/navigation/interactivity.js.map +1 -0
  258. package/build-module/navigation-link/edit.js +7 -5
  259. package/build-module/navigation-link/edit.js.map +1 -1
  260. package/build-module/navigation-link/update-attributes.js +4 -4
  261. package/build-module/navigation-link/update-attributes.js.map +1 -1
  262. package/build-module/navigation-submenu/edit.js +7 -5
  263. package/build-module/navigation-submenu/edit.js.map +1 -1
  264. package/build-module/paragraph/index.js +5 -1
  265. package/build-module/paragraph/index.js.map +1 -1
  266. package/build-module/paragraph/transforms.js +5 -1
  267. package/build-module/paragraph/transforms.js.map +1 -1
  268. package/build-module/pattern/edit.js +42 -9
  269. package/build-module/pattern/edit.js.map +1 -1
  270. package/build-module/pattern/index.js +12 -3
  271. package/build-module/pattern/index.js.map +1 -1
  272. package/build-module/pattern/v1/edit.js +48 -0
  273. package/build-module/pattern/v1/edit.js.map +1 -0
  274. package/build-module/post-author-name/edit.js +1 -1
  275. package/build-module/post-author-name/edit.js.map +1 -1
  276. package/build-module/post-featured-image/edit.js +1 -2
  277. package/build-module/post-featured-image/edit.js.map +1 -1
  278. package/build-module/post-featured-image/overlay.js +5 -0
  279. package/build-module/post-featured-image/overlay.js.map +1 -1
  280. package/build-module/post-title/edit.js +23 -7
  281. package/build-module/post-title/edit.js.map +1 -1
  282. package/build-module/preformatted/edit.native.js +3 -2
  283. package/build-module/preformatted/edit.native.js.map +1 -1
  284. package/build-module/quote/transforms.js +23 -37
  285. package/build-module/quote/transforms.js.map +1 -1
  286. package/build-module/read-more/edit.js +1 -1
  287. package/build-module/read-more/edit.js.map +1 -1
  288. package/build-module/search/edit.js +9 -1
  289. package/build-module/search/edit.js.map +1 -1
  290. package/build-module/site-title/edit/index.js +1 -1
  291. package/build-module/site-title/edit/index.js.map +1 -1
  292. package/build-module/social-link/edit.js +20 -5
  293. package/build-module/social-link/edit.js.map +1 -1
  294. package/build-module/social-links/edit.js +2 -2
  295. package/build-module/social-links/edit.js.map +1 -1
  296. package/build-module/template-part/edit/index.js +1 -6
  297. package/build-module/template-part/edit/index.js.map +1 -1
  298. package/build-module/template-part/edit/utils/hooks.js +1 -1
  299. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  300. package/build-module/utils/interactivity/constants.js +2 -0
  301. package/build-module/utils/interactivity/constants.js.map +1 -0
  302. package/build-module/utils/interactivity/directives.js +220 -0
  303. package/build-module/utils/interactivity/directives.js.map +1 -0
  304. package/build-module/utils/interactivity/hooks.js +162 -0
  305. package/build-module/utils/interactivity/hooks.js.map +1 -0
  306. package/build-module/utils/interactivity/hydration.js +21 -0
  307. package/build-module/utils/interactivity/hydration.js.map +1 -0
  308. package/build-module/utils/interactivity/index.js +17 -0
  309. package/build-module/utils/interactivity/index.js.map +1 -0
  310. package/build-module/utils/interactivity/portals.js +100 -0
  311. package/build-module/utils/interactivity/portals.js.map +1 -0
  312. package/build-module/utils/interactivity/store.js +56 -0
  313. package/build-module/utils/interactivity/store.js.map +1 -0
  314. package/build-module/utils/interactivity/utils.js +75 -0
  315. package/build-module/utils/interactivity/utils.js.map +1 -0
  316. package/build-module/utils/interactivity/vdom.js +97 -0
  317. package/build-module/utils/interactivity/vdom.js.map +1 -0
  318. package/build-style/common-rtl.css +1 -1
  319. package/build-style/common.css +1 -1
  320. package/build-style/cover/style-rtl.css +3 -2
  321. package/build-style/cover/style.css +3 -2
  322. package/build-style/{details-summary → details}/editor-rtl.css +1 -1
  323. package/build-style/{details-summary → details}/editor.css +1 -1
  324. package/build-style/details/style-rtl.css +14 -0
  325. package/build-style/details/style.css +14 -0
  326. package/build-style/editor-rtl.css +71 -5
  327. package/build-style/editor.css +71 -5
  328. package/build-style/file/editor-rtl.css +3 -0
  329. package/build-style/file/editor.css +3 -0
  330. package/build-style/freeform/editor-rtl.css +29 -0
  331. package/build-style/freeform/editor.css +29 -0
  332. package/build-style/gallery/editor-rtl.css +0 -4
  333. package/build-style/gallery/editor.css +0 -4
  334. package/build-style/gallery/style-rtl.css +2 -4
  335. package/build-style/gallery/style.css +2 -4
  336. package/build-style/image/style-rtl.css +98 -0
  337. package/build-style/image/style.css +98 -0
  338. package/build-style/navigation/editor-rtl.css +36 -0
  339. package/build-style/navigation/editor.css +36 -0
  340. package/build-style/post-comments-form/style-rtl.css +1 -1
  341. package/build-style/post-comments-form/style.css +1 -1
  342. package/build-style/search/editor-rtl.css +1 -0
  343. package/build-style/search/editor.css +1 -0
  344. package/build-style/site-logo/editor-rtl.css +1 -0
  345. package/build-style/site-logo/editor.css +1 -0
  346. package/build-style/style-rtl.css +116 -10
  347. package/build-style/style.css +116 -10
  348. package/build-style/video/style-rtl.css +1 -2
  349. package/build-style/video/style.css +1 -2
  350. package/package.json +37 -33
  351. package/src/block/edit.native.js +18 -4
  352. package/src/buttons/test/edit.native.js +0 -9
  353. package/src/code/block.json +1 -0
  354. package/src/column/block.json +1 -1
  355. package/src/columns/test/__snapshots__/transforms.native.js.snap +1 -1
  356. package/src/columns/test/transforms.native.js +3 -5
  357. package/src/columns/transforms.js +2 -8
  358. package/src/comment-author-name/edit.js +1 -1
  359. package/src/comment-edit-link/edit.js +1 -1
  360. package/src/comment-template/index.php +8 -7
  361. package/src/comments/index.php +1 -6
  362. package/src/cover/block.json +1 -1
  363. package/src/cover/edit/inspector-controls.js +56 -54
  364. package/src/cover/edit/resizable-cover-popover.js +2 -1
  365. package/src/cover/style.scss +5 -0
  366. package/src/cover/test/edit.js +56 -2
  367. package/src/cover/variations.js +1 -3
  368. package/src/details/block.json +8 -6
  369. package/src/details/edit.js +27 -5
  370. package/src/details/editor.scss +3 -0
  371. package/src/details/index.js +10 -5
  372. package/src/details/save.js +5 -1
  373. package/src/details/style.scss +16 -0
  374. package/src/editor.scss +1 -1
  375. package/src/embed/variations.js +2 -2
  376. package/src/file/editor.scss +4 -0
  377. package/src/file/interactivity.js +15 -0
  378. package/src/file/view.js +4 -1
  379. package/src/freeform/editor.scss +45 -0
  380. package/src/freeform/modal.js +22 -19
  381. package/src/gallery/edit.js +5 -8
  382. package/src/gallery/editor.scss +0 -6
  383. package/src/gallery/test/index.native.js +48 -3
  384. package/src/gallery/v1/edit.js +1 -6
  385. package/src/gallery/v1/gallery-image.native.js +1 -2
  386. package/src/group/test/__snapshots__/transforms.native.js.snap +1 -1
  387. package/src/group/test/transforms.native.js +3 -5
  388. package/src/group/transforms.js +0 -7
  389. package/src/image/block.json +3 -0
  390. package/src/image/deprecated.js +2 -3
  391. package/src/image/edit.js +18 -18
  392. package/src/image/image.js +8 -11
  393. package/src/image/index.php +75 -2
  394. package/src/image/interactivity.js +113 -0
  395. package/src/image/save.js +4 -3
  396. package/src/image/style.scss +113 -0
  397. package/src/image/test/edit.native.js +38 -16
  398. package/src/image/utils.js +11 -18
  399. package/src/index.js +0 -4
  400. package/src/index.native.js +1 -0
  401. package/src/latest-posts/edit.native.js +1 -4
  402. package/src/list/edit.js +1 -1
  403. package/src/list/test/edit.native.js +80 -1
  404. package/src/list-item/edit.native.js +1 -1
  405. package/src/list-item/transforms.js +4 -2
  406. package/src/loginout/block.json +11 -1
  407. package/src/media-text/deprecated.js +4 -5
  408. package/src/media-text/edit.js +12 -10
  409. package/src/media-text/media-container.js +3 -3
  410. package/src/media-text/save.js +1 -2
  411. package/src/navigation/constants.js +21 -0
  412. package/src/navigation/edit/index.js +71 -83
  413. package/src/navigation/edit/inner-blocks.js +6 -16
  414. package/src/navigation/edit/leaf-more-menu.js +170 -0
  415. package/src/navigation/edit/menu-inspector-controls.js +78 -10
  416. package/src/navigation/edit/navigation-menu-delete-control.js +29 -29
  417. package/src/navigation/edit/unsaved-inner-blocks.js +12 -40
  418. package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
  419. package/src/navigation/editor.scss +10 -0
  420. package/src/navigation/index.php +213 -204
  421. package/src/navigation/interactivity.js +151 -0
  422. package/src/navigation-link/edit.js +9 -3
  423. package/src/navigation-link/update-attributes.js +2 -2
  424. package/src/navigation-submenu/edit.js +9 -3
  425. package/src/paragraph/block.json +5 -1
  426. package/src/pattern/block.json +4 -0
  427. package/src/pattern/edit.js +53 -16
  428. package/src/pattern/index.js +5 -4
  429. package/src/pattern/index.php +14 -1
  430. package/src/pattern/v1/edit.js +57 -0
  431. package/src/post-author-name/edit.js +1 -1
  432. package/src/post-comments-form/style.scss +3 -1
  433. package/src/post-featured-image/edit.js +1 -1
  434. package/src/post-featured-image/index.php +1 -1
  435. package/src/post-featured-image/overlay.js +4 -0
  436. package/src/post-terms/index.php +2 -2
  437. package/src/post-title/edit.js +57 -44
  438. package/src/preformatted/edit.native.js +1 -3
  439. package/src/quote/test/__snapshots__/transforms.native.js.snap +1 -1
  440. package/src/quote/test/transforms.native.js +3 -5
  441. package/src/quote/transforms.js +9 -19
  442. package/src/read-more/edit.js +1 -1
  443. package/src/search/edit.js +9 -4
  444. package/src/search/editor.scss +1 -0
  445. package/src/site-logo/editor.scss +2 -1
  446. package/src/site-title/edit/index.js +1 -1
  447. package/src/social-link/edit.js +51 -26
  448. package/src/social-links/edit.js +33 -31
  449. package/src/style.scss +0 -1
  450. package/src/template-part/edit/index.js +4 -6
  451. package/src/template-part/edit/utils/hooks.js +1 -1
  452. package/src/template-part/index.php +22 -7
  453. package/src/utils/interactivity/constants.js +1 -0
  454. package/src/utils/interactivity/directives.js +200 -0
  455. package/src/utils/interactivity/hooks.js +145 -0
  456. package/src/utils/interactivity/hydration.js +22 -0
  457. package/src/utils/interactivity/index.js +17 -0
  458. package/src/utils/interactivity/portals.js +98 -0
  459. package/src/utils/interactivity/store.js +45 -0
  460. package/src/utils/interactivity/utils.js +66 -0
  461. package/src/utils/interactivity/vdom.js +94 -0
  462. package/tsconfig.json +1 -0
  463. package/tsconfig.tsbuildinfo +1 -1
  464. package/build/details-content/edit.js +0 -34
  465. package/build/details-content/edit.js.map +0 -1
  466. package/build/details-content/index.js +0 -94
  467. package/build/details-content/index.js.map +0 -1
  468. package/build/details-content/save.js +0 -20
  469. package/build/details-content/save.js.map +0 -1
  470. package/build/details-summary/edit.js +0 -42
  471. package/build/details-summary/edit.js.map +0 -1
  472. package/build/details-summary/index.js +0 -97
  473. package/build/details-summary/index.js.map +0 -1
  474. package/build/details-summary/save.js +0 -24
  475. package/build/details-summary/save.js.map +0 -1
  476. package/build/file/utils.js.map +0 -1
  477. package/build-module/details-content/edit.js +0 -23
  478. package/build-module/details-content/edit.js.map +0 -1
  479. package/build-module/details-content/index.js +0 -76
  480. package/build-module/details-content/index.js.map +0 -1
  481. package/build-module/details-content/save.js +0 -11
  482. package/build-module/details-content/save.js.map +0 -1
  483. package/build-module/details-summary/edit.js +0 -30
  484. package/build-module/details-summary/edit.js.map +0 -1
  485. package/build-module/details-summary/index.js +0 -79
  486. package/build-module/details-summary/index.js.map +0 -1
  487. package/build-module/details-summary/save.js +0 -16
  488. package/build-module/details-summary/save.js.map +0 -1
  489. package/build-module/file/utils.js.map +0 -1
  490. package/build-style/details-summary/style-rtl.css +0 -91
  491. package/build-style/details-summary/style.css +0 -91
  492. package/src/details-content/block.json +0 -50
  493. package/src/details-content/edit.js +0 -29
  494. package/src/details-content/index.js +0 -23
  495. package/src/details-content/save.js +0 -12
  496. package/src/details-summary/block.json +0 -53
  497. package/src/details-summary/edit.js +0 -27
  498. package/src/details-summary/editor.scss +0 -3
  499. package/src/details-summary/index.js +0 -23
  500. package/src/details-summary/save.js +0 -13
  501. package/src/details-summary/style.scss +0 -3
  502. /package/src/file/{utils.js → utils/index.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "8.9.0",
3
+ "version": "8.11.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.34.0",
37
+ "@wordpress/api-fetch": "^6.31.0",
38
+ "@wordpress/autop": "^3.34.0",
39
+ "@wordpress/blob": "^3.34.0",
40
+ "@wordpress/block-editor": "^12.2.0",
41
+ "@wordpress/blocks": "^12.11.0",
42
+ "@wordpress/components": "^25.0.0",
43
+ "@wordpress/compose": "^6.11.0",
44
+ "@wordpress/core-data": "^6.11.0",
45
+ "@wordpress/data": "^9.4.0",
46
+ "@wordpress/date": "^4.34.0",
47
+ "@wordpress/deprecated": "^3.34.0",
48
+ "@wordpress/dom": "^3.34.0",
49
+ "@wordpress/element": "^5.11.0",
50
+ "@wordpress/escape-html": "^2.34.0",
51
+ "@wordpress/hooks": "^3.34.0",
52
+ "@wordpress/html-entities": "^3.34.0",
53
+ "@wordpress/i18n": "^4.34.0",
54
+ "@wordpress/icons": "^9.25.0",
55
+ "@wordpress/keycodes": "^3.34.0",
56
+ "@wordpress/notices": "^4.2.0",
57
+ "@wordpress/primitives": "^3.32.0",
58
+ "@wordpress/private-apis": "^0.16.0",
59
+ "@wordpress/reusable-blocks": "^4.11.0",
60
+ "@wordpress/rich-text": "^6.11.0",
61
+ "@wordpress/server-side-render": "^4.11.0",
62
+ "@wordpress/url": "^3.35.0",
63
+ "@wordpress/viewport": "^5.11.0",
64
+ "@wordpress/wordcount": "^3.34.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
- "memize": "^1.1.0",
73
+ "memize": "^2.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": "c7c79cb11b677adcbf06cf5f8cfb6c5ec1699f19"
82
86
  }
@@ -36,6 +36,7 @@ import {
36
36
  import { usePreferredColorSchemeStyle } from '@wordpress/compose';
37
37
  import { help } from '@wordpress/icons';
38
38
  import { store as reusableBlocksStore } from '@wordpress/reusable-blocks';
39
+ import { store as editorStore } from '@wordpress/editor';
39
40
  import { store as noticesStore } from '@wordpress/notices';
40
41
 
41
42
  /**
@@ -103,6 +104,11 @@ export default function ReusableBlockEdit( {
103
104
  },
104
105
  [ ref, clientId ]
105
106
  );
107
+ const hostAppNamespace = useSelect(
108
+ ( select ) =>
109
+ select( editorStore ).getEditorSettings().hostAppNamespace,
110
+ []
111
+ );
106
112
 
107
113
  const { createSuccessNotice } = useDispatch( noticesStore );
108
114
  const { __experimentalConvertBlockToStatic: convertBlockToStatic } =
@@ -143,11 +149,19 @@ export default function ReusableBlockEdit( {
143
149
  function renderSheet() {
144
150
  const infoTitle =
145
151
  Platform.OS === 'android'
146
- ? __(
147
- 'Editing reusable blocks is not yet supported on WordPress for Android'
152
+ ? sprintf(
153
+ /* translators: %s: name of the host app (e.g. WordPress) */
154
+ __(
155
+ 'Editing reusable blocks is not yet supported on %s for Android'
156
+ ),
157
+ hostAppNamespace
148
158
  )
149
- : __(
150
- 'Editing reusable blocks is not yet supported on WordPress for iOS'
159
+ : sprintf(
160
+ /* translators: %s: name of the host app (e.g. WordPress) */
161
+ __(
162
+ 'Editing reusable blocks is not yet supported on %s for iOS'
163
+ ),
164
+ hostAppNamespace
151
165
  );
152
166
 
153
167
  return (
@@ -19,15 +19,6 @@ import {
19
19
  import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks';
20
20
  import { registerCoreBlocks } from '@wordpress/block-library';
21
21
 
22
- // Mock debounce to prevent potentially belated state updates.
23
- jest.mock( 'lodash', () => ( {
24
- ...jest.requireActual( 'lodash' ),
25
- debounce: ( fn ) => {
26
- fn.cancel = jest.fn();
27
- return fn;
28
- },
29
- } ) );
30
-
31
22
  const BUTTONS_HTML = `<!-- wp:buttons -->
32
23
  <div class="wp-block-buttons"><!-- wp:button /--></div>
33
24
  <!-- /wp:buttons -->`;
@@ -14,6 +14,7 @@
14
14
  }
15
15
  },
16
16
  "supports": {
17
+ "align": [ "wide" ],
17
18
  "anchor": true,
18
19
  "typography": {
19
20
  "fontSize": true,
@@ -3,7 +3,7 @@
3
3
  "apiVersion": 2,
4
4
  "name": "core/column",
5
5
  "title": "Column",
6
- "category": "text",
6
+ "category": "design",
7
7
  "parent": [ "core/columns" ],
8
8
  "description": "A single column within a columns block.",
9
9
  "textdomain": "default",
@@ -34,7 +34,7 @@ exports[`Columns block transforms to Group block 1`] = `
34
34
  <!-- /wp:group -->"
35
35
  `;
36
36
 
37
- exports[`Columns block transforms unwraps content 1`] = `
37
+ exports[`Columns block transforms ungroups block 1`] = `
38
38
  "<!-- wp:paragraph {"align":"left"} -->
39
39
  <p class="has-text-align-left"><strong>Built with modern technology.</strong></p>
40
40
  <!-- /wp:paragraph -->
@@ -60,14 +60,13 @@ describe( `${ block } block transforms`, () => {
60
60
  expect( getEditorHtml() ).toMatchSnapshot();
61
61
  } );
62
62
 
63
- it( 'unwraps content', async () => {
63
+ it( 'ungroups block', async () => {
64
64
  const screen = await initializeEditor( { initialHtml } );
65
65
  const { getByText } = screen;
66
66
  fireEvent.press( getBlock( screen, block ) );
67
67
 
68
68
  await openBlockActionsMenu( screen );
69
- fireEvent.press( getByText( 'Transform block…' ) );
70
- fireEvent.press( getByText( 'Unwrap' ) );
69
+ fireEvent.press( getByText( 'Ungroup' ) );
71
70
 
72
71
  // The first block created is the content of the Paragraph block.
73
72
  const paragraph = getBlock( screen, 'Paragraph', 0 );
@@ -83,8 +82,7 @@ describe( `${ block } block transforms`, () => {
83
82
  const screen = await initializeEditor( { initialHtml } );
84
83
  const transformOptions = await getBlockTransformOptions(
85
84
  screen,
86
- block,
87
- { canUnwrap: true }
85
+ block
88
86
  );
89
87
  expect( transformOptions ).toHaveLength( blockTransforms.length );
90
88
  } );
@@ -105,14 +105,8 @@ const transforms = {
105
105
  },
106
106
  },
107
107
  ],
108
- to: [
109
- {
110
- type: 'block',
111
- blocks: [ '*' ],
112
- transform: ( attributes, innerBlocks ) =>
113
- innerBlocks.flatMap( ( innerBlock ) => innerBlock.innerBlocks ),
114
- },
115
- ],
108
+ ungroup: ( attributes, innerBlocks ) =>
109
+ innerBlocks.flatMap( ( innerBlock ) => innerBlock.innerBlocks ),
116
110
  };
117
111
 
118
112
  export default transforms;
@@ -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
 
@@ -29,13 +29,8 @@ function render_block_core_comments( $attributes, $content, $block ) {
29
29
  return '';
30
30
  }
31
31
 
32
- $comment_args = array(
33
- 'post_id' => $post_id,
34
- 'count' => true,
35
- 'status' => 'approve',
36
- );
37
32
  // Return early if there are no comments and comments are closed.
38
- if ( ! comments_open( $post_id ) && get_comments( $comment_args ) === 0 ) {
33
+ if ( ! comments_open( $post_id ) && (int) get_comments_number( $post_id ) === 0 ) {
39
34
  return '';
40
35
  }
41
36
 
@@ -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 }
@@ -25,6 +25,8 @@ const RESIZABLE_BOX_ENABLE_OPTION = {
25
25
  topLeft: false,
26
26
  };
27
27
 
28
+ const { ResizableBoxPopover } = unlock( blockEditorPrivateApis );
29
+
28
30
  export default function ResizableCoverPopover( {
29
31
  className,
30
32
  height,
@@ -37,7 +39,6 @@ export default function ResizableCoverPopover( {
37
39
  width,
38
40
  ...props
39
41
  } ) {
40
- const { ResizableBoxPopover } = unlock( blockEditorPrivateApis );
41
42
  const [ isResizing, setIsResizing ] = useState( false );
42
43
  const dimensions = useMemo(
43
44
  () => ( { height, minHeight, width } ),
@@ -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,
@@ -5,28 +5,29 @@
5
5
  "name": "core/details",
6
6
  "title": "Details",
7
7
  "category": "text",
8
- "description": "A block that displays a summary and shows or hides additional content.",
9
- "keywords": [ "disclosure", "summary", "hide", "transcript" ],
8
+ "description": "Hide and show additional content.",
9
+ "keywords": [ "disclosure", "summary", "hide", "accordion" ],
10
10
  "textdomain": "default",
11
11
  "attributes": {
12
12
  "showContent": {
13
13
  "type": "boolean",
14
14
  "default": false
15
+ },
16
+ "summary": {
17
+ "type": "string"
15
18
  }
16
19
  },
17
20
  "supports": {
18
- "align": true,
21
+ "align": [ "wide", "full" ],
19
22
  "color": {
20
23
  "gradients": true,
21
24
  "link": true,
22
25
  "__experimentalDefaultControls": {
23
26
  "background": true,
24
- "text": true,
25
- "link": true
27
+ "text": true
26
28
  }
27
29
  },
28
30
  "__experimentalBorder": {
29
- "radius": true,
30
31
  "color": true,
31
32
  "width": true,
32
33
  "style": true
@@ -50,5 +51,6 @@
50
51
  }
51
52
  }
52
53
  },
54
+ "editorStyle": "wp-block-details-editor",
53
55
  "style": "wp-block-details"
54
56
  }
@@ -2,6 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import {
5
+ RichText,
5
6
  useBlockProps,
6
7
  useInnerBlocksProps,
7
8
  store as blockEditorStore,
@@ -11,15 +12,21 @@ import { useSelect } from '@wordpress/data';
11
12
  import { PanelBody, ToggleControl } from '@wordpress/components';
12
13
  import { __ } from '@wordpress/i18n';
13
14
 
14
- const TEMPLATE = [ [ 'core/details-summary' ], [ 'core/details-content' ] ];
15
+ const TEMPLATE = [
16
+ [
17
+ 'core/paragraph',
18
+ {
19
+ placeholder: __( 'Type / to add a hidden block' ),
20
+ },
21
+ ],
22
+ ];
15
23
 
16
24
  function DetailsEdit( { attributes, setAttributes, clientId } ) {
17
- const { showContent } = attributes;
25
+ const { showContent, summary } = attributes;
18
26
  const blockProps = useBlockProps();
19
27
  const innerBlocksProps = useInnerBlocksProps( blockProps, {
20
- allowedBlocks: TEMPLATE,
21
28
  template: TEMPLATE,
22
- templateLock: 'all',
29
+ __experimentalCaptureToolbars: true,
23
30
  } );
24
31
 
25
32
  // Check if either the block or the inner blocks are selected.
@@ -51,7 +58,22 @@ function DetailsEdit( { attributes, setAttributes, clientId } ) {
51
58
  <details
52
59
  { ...innerBlocksProps }
53
60
  open={ hasSelection || showContent }
54
- ></details>
61
+ >
62
+ <summary onClick={ ( event ) => event.preventDefault() }>
63
+ <RichText
64
+ aria-label={ __( 'Write summary' ) }
65
+ placeholder={ __( 'Write summary…' ) }
66
+ allowedFormats={ [] }
67
+ withoutInteractiveFormatting
68
+ value={ summary }
69
+ onChange={ ( newSummary ) =>
70
+ setAttributes( { summary: newSummary } )
71
+ }
72
+ multiline={ false }
73
+ />
74
+ </summary>
75
+ { innerBlocksProps.children }
76
+ </details>
55
77
  </>
56
78
  );
57
79
  }
@@ -0,0 +1,3 @@
1
+ .wp-block-details summary div {
2
+ display: inline;
3
+ }