@wordpress/block-library 8.7.0 → 8.9.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 (416) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/column/index.js +2 -1
  3. package/build/column/index.js.map +1 -1
  4. package/build/columns/edit.js +24 -6
  5. package/build/columns/edit.js.map +1 -1
  6. package/build/columns/index.js +2 -1
  7. package/build/columns/index.js.map +1 -1
  8. package/build/columns/utils.js +4 -9
  9. package/build/columns/utils.js.map +1 -1
  10. package/build/cover/edit/index.js +46 -50
  11. package/build/cover/edit/index.js.map +1 -1
  12. package/build/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +32 -6
  13. package/build/cover/edit/resizable-cover-popover.js.map +1 -0
  14. package/build/cover/index.js +12 -0
  15. package/build/cover/index.js.map +1 -1
  16. package/build/cover/transforms.js +10 -7
  17. package/build/cover/transforms.js.map +1 -1
  18. package/build/details/edit.js +67 -0
  19. package/build/details/edit.js.map +1 -0
  20. package/build/details/index.js +110 -0
  21. package/build/details/index.js.map +1 -0
  22. package/build/details/save.js +33 -0
  23. package/build/details/save.js.map +1 -0
  24. package/build/details-content/edit.js +34 -0
  25. package/build/details-content/edit.js.map +1 -0
  26. package/build/details-content/index.js +94 -0
  27. package/build/details-content/index.js.map +1 -0
  28. package/build/details-content/save.js +20 -0
  29. package/build/details-content/save.js.map +1 -0
  30. package/build/details-summary/edit.js +42 -0
  31. package/build/details-summary/edit.js.map +1 -0
  32. package/build/details-summary/index.js +97 -0
  33. package/build/details-summary/index.js.map +1 -0
  34. package/build/details-summary/save.js +24 -0
  35. package/build/details-summary/save.js.map +1 -0
  36. package/build/embed/deprecated.js +4 -1
  37. package/build/embed/deprecated.js.map +1 -1
  38. package/build/embed/embed-link-settings.native.js +1 -1
  39. package/build/embed/embed-link-settings.native.js.map +1 -1
  40. package/build/embed/embed-placeholder.js +1 -1
  41. package/build/embed/embed-placeholder.js.map +1 -1
  42. package/build/embed/index.js +4 -1
  43. package/build/embed/index.js.map +1 -1
  44. package/build/embed/transforms.js +4 -1
  45. package/build/embed/transforms.js.map +1 -1
  46. package/build/embed/util.js +4 -1
  47. package/build/embed/util.js.map +1 -1
  48. package/build/file/edit.native.js +0 -2
  49. package/build/file/edit.native.js.map +1 -1
  50. package/build/gallery/use-get-media.native.js +2 -1
  51. package/build/gallery/use-get-media.native.js.map +1 -1
  52. package/build/group/edit.js +3 -1
  53. package/build/group/edit.js.map +1 -1
  54. package/build/group/index.js +3 -0
  55. package/build/group/index.js.map +1 -1
  56. package/build/image/edit.js +16 -13
  57. package/build/image/edit.js.map +1 -1
  58. package/build/image/index.js +5 -3
  59. package/build/image/index.js.map +1 -1
  60. package/build/index.js +24 -6
  61. package/build/index.js.map +1 -1
  62. package/build/index.native.js +9 -5
  63. package/build/index.native.js.map +1 -1
  64. package/build/media-text/edit.js +4 -2
  65. package/build/media-text/edit.js.map +1 -1
  66. package/build/media-text/index.js +3 -0
  67. package/build/media-text/index.js.map +1 -1
  68. package/build/media-text/media-container.js +2 -6
  69. package/build/media-text/media-container.js.map +1 -1
  70. package/build/media-text/media-container.native.js +3 -3
  71. package/build/media-text/media-container.native.js.map +1 -1
  72. package/build/navigation/deprecated.js +8 -11
  73. package/build/navigation/deprecated.js.map +1 -1
  74. package/build/navigation/edit/index.js +32 -64
  75. package/build/navigation/edit/index.js.map +1 -1
  76. package/build/navigation/edit/unsaved-inner-blocks.js +1 -14
  77. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  78. package/build/post-author/index.js +0 -1
  79. package/build/post-author/index.js.map +1 -1
  80. package/build/post-date/edit.js +4 -2
  81. package/build/post-date/edit.js.map +1 -1
  82. package/build/post-excerpt/edit.js +2 -2
  83. package/build/post-excerpt/edit.js.map +1 -1
  84. package/build/post-featured-image/dimension-controls.js +2 -1
  85. package/build/post-featured-image/dimension-controls.js.map +1 -1
  86. package/build/post-featured-image/edit.js +16 -27
  87. package/build/post-featured-image/edit.js.map +1 -1
  88. package/build/post-time-to-read/edit.js +1 -1
  89. package/build/post-time-to-read/edit.js.map +1 -1
  90. package/build/post-time-to-read/index.js +7 -0
  91. package/build/post-time-to-read/index.js.map +1 -1
  92. package/build/query/deprecated.js +8 -6
  93. package/build/query/deprecated.js.map +1 -1
  94. package/build/query/edit/inspector-controls/create-new-post-link.js +41 -0
  95. package/build/query/edit/inspector-controls/create-new-post-link.js.map +1 -0
  96. package/build/query/edit/inspector-controls/index.js +14 -6
  97. package/build/query/edit/inspector-controls/index.js.map +1 -1
  98. package/build/query/edit/pattern-selection-modal.js +2 -1
  99. package/build/query/edit/pattern-selection-modal.js.map +1 -1
  100. package/build/query/index.js +5 -12
  101. package/build/query/index.js.map +1 -1
  102. package/build/site-logo/edit.js +114 -16
  103. package/build/site-logo/edit.js.map +1 -1
  104. package/build/site-logo/index.js +1 -1
  105. package/build/social-link/icons/chain.js +1 -1
  106. package/build/social-link/icons/chain.js.map +1 -1
  107. package/build/social-link/icons/mail.js +1 -1
  108. package/build/social-link/icons/mail.js.map +1 -1
  109. package/build/spacer/controls.js +25 -6
  110. package/build/spacer/controls.js.map +1 -1
  111. package/build/spacer/edit.js +129 -13
  112. package/build/spacer/edit.js.map +1 -1
  113. package/build/spacer/save.js +2 -2
  114. package/build/spacer/save.js.map +1 -1
  115. package/build/table/state.js +35 -35
  116. package/build/table/state.js.map +1 -1
  117. package/build/template-part/edit/index.js +2 -1
  118. package/build/template-part/edit/index.js.map +1 -1
  119. package/build/template-part/edit/utils/hooks.js +2 -2
  120. package/build/template-part/edit/utils/hooks.js.map +1 -1
  121. package/build/term-description/index.js +1 -2
  122. package/build/term-description/index.js.map +1 -1
  123. package/build/utils/migrate-font-family.js +12 -5
  124. package/build/utils/migrate-font-family.js.map +1 -1
  125. package/build/video/edit.native.js +4 -3
  126. package/build/video/edit.native.js.map +1 -1
  127. package/build-module/column/index.js +2 -1
  128. package/build-module/column/index.js.map +1 -1
  129. package/build-module/columns/edit.js +24 -6
  130. package/build-module/columns/edit.js.map +1 -1
  131. package/build-module/columns/index.js +2 -1
  132. package/build-module/columns/index.js.map +1 -1
  133. package/build-module/columns/utils.js +4 -8
  134. package/build-module/columns/utils.js.map +1 -1
  135. package/build-module/cover/edit/index.js +48 -52
  136. package/build-module/cover/edit/index.js.map +1 -1
  137. package/build-module/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +31 -6
  138. package/build-module/cover/edit/resizable-cover-popover.js.map +1 -0
  139. package/build-module/cover/index.js +12 -0
  140. package/build-module/cover/index.js.map +1 -1
  141. package/build-module/cover/transforms.js +5 -1
  142. package/build-module/cover/transforms.js.map +1 -1
  143. package/build-module/details/edit.js +52 -0
  144. package/build-module/details/edit.js.map +1 -0
  145. package/build-module/details/index.js +91 -0
  146. package/build-module/details/index.js.map +1 -0
  147. package/build-module/details/save.js +20 -0
  148. package/build-module/details/save.js.map +1 -0
  149. package/build-module/details-content/edit.js +23 -0
  150. package/build-module/details-content/edit.js.map +1 -0
  151. package/build-module/details-content/index.js +76 -0
  152. package/build-module/details-content/index.js.map +1 -0
  153. package/build-module/details-content/save.js +11 -0
  154. package/build-module/details-content/save.js.map +1 -0
  155. package/build-module/details-summary/edit.js +30 -0
  156. package/build-module/details-summary/edit.js.map +1 -0
  157. package/build-module/details-summary/index.js +79 -0
  158. package/build-module/details-summary/index.js.map +1 -0
  159. package/build-module/details-summary/save.js +16 -0
  160. package/build-module/details-summary/save.js.map +1 -0
  161. package/build-module/embed/deprecated.js +4 -1
  162. package/build-module/embed/deprecated.js.map +1 -1
  163. package/build-module/embed/embed-link-settings.native.js +1 -1
  164. package/build-module/embed/embed-link-settings.native.js.map +1 -1
  165. package/build-module/embed/embed-placeholder.js +1 -1
  166. package/build-module/embed/embed-placeholder.js.map +1 -1
  167. package/build-module/embed/index.js +4 -1
  168. package/build-module/embed/index.js.map +1 -1
  169. package/build-module/embed/transforms.js +4 -1
  170. package/build-module/embed/transforms.js.map +1 -1
  171. package/build-module/embed/util.js +4 -1
  172. package/build-module/embed/util.js.map +1 -1
  173. package/build-module/file/edit.native.js +0 -2
  174. package/build-module/file/edit.native.js.map +1 -1
  175. package/build-module/gallery/use-get-media.native.js +2 -1
  176. package/build-module/gallery/use-get-media.native.js.map +1 -1
  177. package/build-module/group/edit.js +3 -1
  178. package/build-module/group/edit.js.map +1 -1
  179. package/build-module/group/index.js +3 -0
  180. package/build-module/group/index.js.map +1 -1
  181. package/build-module/image/edit.js +16 -13
  182. package/build-module/image/edit.js.map +1 -1
  183. package/build-module/image/index.js +5 -3
  184. package/build-module/image/index.js.map +1 -1
  185. package/build-module/index.js +21 -6
  186. package/build-module/index.js.map +1 -1
  187. package/build-module/index.native.js +9 -5
  188. package/build-module/index.native.js.map +1 -1
  189. package/build-module/media-text/edit.js +4 -2
  190. package/build-module/media-text/edit.js.map +1 -1
  191. package/build-module/media-text/index.js +3 -0
  192. package/build-module/media-text/index.js.map +1 -1
  193. package/build-module/media-text/media-container.js +1 -5
  194. package/build-module/media-text/media-container.js.map +1 -1
  195. package/build-module/media-text/media-container.native.js +1 -1
  196. package/build-module/media-text/media-container.native.js.map +1 -1
  197. package/build-module/navigation/deprecated.js +8 -10
  198. package/build-module/navigation/deprecated.js.map +1 -1
  199. package/build-module/navigation/edit/index.js +31 -63
  200. package/build-module/navigation/edit/index.js.map +1 -1
  201. package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -14
  202. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  203. package/build-module/post-author/index.js +0 -1
  204. package/build-module/post-author/index.js.map +1 -1
  205. package/build-module/post-date/edit.js +4 -2
  206. package/build-module/post-date/edit.js.map +1 -1
  207. package/build-module/post-excerpt/edit.js +2 -2
  208. package/build-module/post-excerpt/edit.js.map +1 -1
  209. package/build-module/post-featured-image/dimension-controls.js +2 -1
  210. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  211. package/build-module/post-featured-image/edit.js +16 -27
  212. package/build-module/post-featured-image/edit.js.map +1 -1
  213. package/build-module/post-time-to-read/edit.js +1 -1
  214. package/build-module/post-time-to-read/edit.js.map +1 -1
  215. package/build-module/post-time-to-read/index.js +7 -0
  216. package/build-module/post-time-to-read/index.js.map +1 -1
  217. package/build-module/query/deprecated.js +5 -2
  218. package/build-module/query/deprecated.js.map +1 -1
  219. package/build-module/query/edit/inspector-controls/create-new-post-link.js +33 -0
  220. package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +1 -0
  221. package/build-module/query/edit/inspector-controls/index.js +12 -7
  222. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  223. package/build-module/query/edit/pattern-selection-modal.js +2 -1
  224. package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
  225. package/build-module/query/index.js +5 -10
  226. package/build-module/query/index.js.map +1 -1
  227. package/build-module/site-logo/edit.js +115 -18
  228. package/build-module/site-logo/edit.js.map +1 -1
  229. package/build-module/site-logo/index.js +1 -1
  230. package/build-module/social-link/icons/chain.js +1 -1
  231. package/build-module/social-link/icons/chain.js.map +1 -1
  232. package/build-module/social-link/icons/mail.js +1 -1
  233. package/build-module/social-link/icons/mail.js.map +1 -1
  234. package/build-module/spacer/controls.js +27 -9
  235. package/build-module/spacer/controls.js.map +1 -1
  236. package/build-module/spacer/edit.js +129 -14
  237. package/build-module/spacer/edit.js.map +1 -1
  238. package/build-module/spacer/save.js +3 -3
  239. package/build-module/spacer/save.js.map +1 -1
  240. package/build-module/table/state.js +35 -33
  241. package/build-module/table/state.js.map +1 -1
  242. package/build-module/template-part/edit/index.js +2 -1
  243. package/build-module/template-part/edit/index.js.map +1 -1
  244. package/build-module/template-part/edit/utils/hooks.js +2 -2
  245. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  246. package/build-module/term-description/index.js +1 -2
  247. package/build-module/term-description/index.js.map +1 -1
  248. package/build-module/utils/migrate-font-family.js +9 -1
  249. package/build-module/utils/migrate-font-family.js.map +1 -1
  250. package/build-module/video/edit.native.js +4 -3
  251. package/build-module/video/edit.native.js.map +1 -1
  252. package/build-style/columns/style-rtl.css +4 -1
  253. package/build-style/columns/style.css +4 -1
  254. package/build-style/common-rtl.css +1 -1
  255. package/build-style/common.css +1 -1
  256. package/build-style/cover/editor-rtl.css +9 -10
  257. package/build-style/cover/editor.css +9 -10
  258. package/build-style/cover/style-rtl.css +1 -1
  259. package/build-style/cover/style.css +1 -1
  260. package/build-style/details/style-rtl.css +91 -0
  261. package/build-style/details/style.css +91 -0
  262. package/build-style/details-summary/editor-rtl.css +91 -0
  263. package/build-style/details-summary/editor.css +91 -0
  264. package/build-style/details-summary/style-rtl.css +91 -0
  265. package/build-style/details-summary/style.css +91 -0
  266. package/build-style/editor-rtl.css +97 -74
  267. package/build-style/editor.css +97 -74
  268. package/build-style/file/style-rtl.css +4 -3
  269. package/build-style/file/style.css +4 -3
  270. package/build-style/html/editor-rtl.css +2 -2
  271. package/build-style/html/editor.css +2 -2
  272. package/build-style/image/editor-rtl.css +1 -1
  273. package/build-style/image/editor.css +1 -1
  274. package/build-style/post-excerpt/style-rtl.css +1 -1
  275. package/build-style/post-excerpt/style.css +1 -1
  276. package/build-style/pullquote/style-rtl.css +4 -1
  277. package/build-style/pullquote/style.css +4 -1
  278. package/build-style/query/editor-rtl.css +8 -12
  279. package/build-style/query/editor.css +8 -12
  280. package/build-style/search/style-rtl.css +2 -0
  281. package/build-style/search/style.css +2 -0
  282. package/build-style/shortcode/editor-rtl.css +15 -35
  283. package/build-style/shortcode/editor.css +15 -35
  284. package/build-style/site-logo/editor-rtl.css +46 -0
  285. package/build-style/site-logo/editor.css +46 -0
  286. package/build-style/spacer/editor-rtl.css +4 -2
  287. package/build-style/spacer/editor.css +4 -2
  288. package/build-style/style-rtl.css +25 -8
  289. package/build-style/style.css +25 -8
  290. package/build-style/template-part/editor-rtl.css +8 -12
  291. package/build-style/template-part/editor.css +8 -12
  292. package/package.json +31 -31
  293. package/src/buttons/test/__snapshots__/edit.native.js.snap +18 -0
  294. package/src/buttons/test/edit.native.js +123 -2
  295. package/src/column/block.json +2 -1
  296. package/src/columns/block.json +2 -1
  297. package/src/columns/edit.js +33 -9
  298. package/src/columns/style.scss +5 -1
  299. package/src/columns/utils.js +8 -9
  300. package/src/common.scss +1 -1
  301. package/src/cover/block.json +12 -0
  302. package/src/cover/edit/index.js +44 -37
  303. package/src/cover/edit/resizable-cover-popover.js +82 -0
  304. package/src/cover/editor.scss +20 -13
  305. package/src/cover/index.php +9 -10
  306. package/src/cover/style.scss +1 -1
  307. package/src/cover/test/edit.js +1 -1
  308. package/src/cover/transforms.js +4 -1
  309. package/src/details/block.json +54 -0
  310. package/src/details/edit.js +59 -0
  311. package/src/details/index.js +35 -0
  312. package/src/details/save.js +15 -0
  313. package/src/details/style.scss +3 -0
  314. package/src/details-content/block.json +50 -0
  315. package/src/details-content/edit.js +29 -0
  316. package/src/details-content/index.js +23 -0
  317. package/src/details-content/save.js +12 -0
  318. package/src/details-summary/block.json +53 -0
  319. package/src/details-summary/edit.js +27 -0
  320. package/src/details-summary/editor.scss +3 -0
  321. package/src/details-summary/index.js +23 -0
  322. package/src/details-summary/save.js +13 -0
  323. package/src/details-summary/style.scss +3 -0
  324. package/src/editor.scss +1 -0
  325. package/src/embed/block.json +4 -1
  326. package/src/embed/embed-link-settings.native.js +1 -1
  327. package/src/embed/embed-placeholder.js +1 -1
  328. package/src/file/edit.native.js +0 -2
  329. package/src/file/style.scss +5 -2
  330. package/src/gallery/test/index.native.js +4 -4
  331. package/src/gallery/test/use-get-media.native.js +24 -0
  332. package/src/gallery/use-get-media.native.js +1 -1
  333. package/src/group/block.json +3 -0
  334. package/src/group/edit.js +8 -2
  335. package/src/heading/test/__snapshots__/index.native.js.snap +12 -0
  336. package/src/heading/test/index.native.js +71 -0
  337. package/src/html/editor.scss +2 -21
  338. package/src/image/block.json +5 -3
  339. package/src/image/edit.js +21 -17
  340. package/src/image/editor.scss +1 -1
  341. package/src/index.js +13 -3
  342. package/src/index.native.js +9 -5
  343. package/src/list/test/edit.native.js +7 -7
  344. package/src/media-text/block.json +3 -0
  345. package/src/media-text/edit.js +2 -1
  346. package/src/media-text/media-container.js +1 -5
  347. package/src/media-text/media-container.native.js +1 -1
  348. package/src/navigation/deprecated.js +15 -19
  349. package/src/navigation/edit/index.js +32 -106
  350. package/src/navigation/edit/unsaved-inner-blocks.js +34 -46
  351. package/src/navigation/index.php +15 -12
  352. package/src/paragraph/test/edit.native.js +616 -1
  353. package/src/post-author/block.json +0 -1
  354. package/src/post-date/edit.js +4 -0
  355. package/src/post-date/index.php +17 -8
  356. package/src/post-excerpt/edit.js +1 -1
  357. package/src/post-excerpt/index.php +3 -3
  358. package/src/post-excerpt/style.scss +2 -1
  359. package/src/post-featured-image/dimension-controls.js +5 -1
  360. package/src/post-featured-image/edit.js +14 -34
  361. package/src/post-featured-image/index.php +1 -1
  362. package/src/post-time-to-read/block.json +7 -0
  363. package/src/post-time-to-read/edit.js +1 -1
  364. package/src/post-time-to-read/index.php +3 -3
  365. package/src/preformatted/test/__snapshots__/edit.native.js.snap +2 -2
  366. package/src/preformatted/test/edit.native.js +42 -2
  367. package/src/pullquote/style.scss +5 -1
  368. package/src/pullquote/test/edit.native.js +65 -0
  369. package/src/query/deprecated.js +4 -1
  370. package/src/query/edit/inspector-controls/create-new-post-link.js +26 -0
  371. package/src/query/edit/inspector-controls/index.js +13 -6
  372. package/src/query/edit/pattern-selection-modal.js +1 -0
  373. package/src/query/editor.scss +8 -11
  374. package/src/query/index.js +1 -7
  375. package/src/quote/test/edit.native.js +88 -0
  376. package/src/search/index.php +1 -1
  377. package/src/search/style.scss +3 -0
  378. package/src/shortcode/editor.scss +6 -5
  379. package/src/site-logo/block.json +1 -1
  380. package/src/site-logo/edit.js +123 -9
  381. package/src/site-logo/editor.scss +57 -0
  382. package/src/social-link/icons/chain.js +1 -1
  383. package/src/social-link/icons/mail.js +1 -1
  384. package/src/social-link/index.php +2 -2
  385. package/src/spacer/controls.js +42 -17
  386. package/src/spacer/edit.js +176 -18
  387. package/src/spacer/editor.scss +2 -1
  388. package/src/spacer/save.js +3 -3
  389. package/src/style.scss +2 -0
  390. package/src/table/state.js +83 -66
  391. package/src/template-part/edit/index.js +1 -0
  392. package/src/template-part/edit/utils/hooks.js +2 -2
  393. package/src/template-part/editor.scss +9 -11
  394. package/src/term-description/block.json +1 -2
  395. package/src/utils/migrate-font-family.js +8 -1
  396. package/src/verse/test/edit.native.js +28 -0
  397. package/src/video/edit.native.js +2 -2
  398. package/tsconfig.json +1 -0
  399. package/build/cover/edit/resizable-cover.js.map +0 -1
  400. package/build/media-text/media-container-icon.js +0 -27
  401. package/build/media-text/media-container-icon.js.map +0 -1
  402. package/build/query/hooks.js +0 -72
  403. package/build/query/hooks.js.map +0 -1
  404. package/build/utils/clean-empty-object.js +0 -34
  405. package/build/utils/clean-empty-object.js.map +0 -1
  406. package/build-module/cover/edit/resizable-cover.js.map +0 -1
  407. package/build-module/media-text/media-container-icon.js +0 -17
  408. package/build-module/media-text/media-container-icon.js.map +0 -1
  409. package/build-module/query/hooks.js +0 -59
  410. package/build-module/query/hooks.js.map +0 -1
  411. package/build-module/utils/clean-empty-object.js +0 -25
  412. package/build-module/utils/clean-empty-object.js.map +0 -1
  413. package/src/cover/edit/resizable-cover.js +0 -61
  414. package/src/media-text/media-container-icon.js +0 -12
  415. package/src/query/hooks.js +0 -53
  416. package/src/utils/clean-empty-object.js +0 -28
@@ -7,24 +7,22 @@
7
7
  // Override default cover styles
8
8
  // because we're not ready yet to show the cover block.
9
9
  &.is-placeholder {
10
- min-height: auto !important;
11
10
  padding: 0 !important;
11
+ display: flex;
12
+ align-items: stretch;
13
+ min-height: 240px;
12
14
 
13
- // Resizable placeholder for placeholder.
14
- .block-library-cover__resize-container {
15
- display: none;
16
- }
17
15
  .components-placeholder {
18
16
  &.is-large {
19
- min-height: 240px;
20
17
  justify-content: flex-start;
21
18
  z-index: z-index(".wp-block-cover.is-placeholder .components-placeholder.is-large");
22
- + .block-library-cover__resize-container {
23
- min-height: 240px;
24
- display: block;
25
- }
26
19
  }
27
20
  }
21
+
22
+ // Allow focus outline/box-shadow to align with block's min height.
23
+ &:focus::after {
24
+ min-height: auto;
25
+ }
28
26
  }
29
27
 
30
28
  &.components-placeholder h2 {
@@ -88,9 +86,18 @@
88
86
  min-height: 50px;
89
87
  }
90
88
 
91
- .block-library-cover__resize-container:not(.is-resizing) {
92
- // Important is used to have higher specificity than the inline style set by re-resizable library.
93
- height: auto !important;
89
+ // Prevent resizable box popover form preventing inner block selection.
90
+ .components-popover.block-editor-block-popover.block-library-cover__resizable-box-popover {
91
+ // Additional specificity is required to overcome default block popover
92
+ // pointer events only for the intended wrappers. The default pointer events
93
+ // are still needed for the inner resize handles of the resizable box.
94
+ .components-popover__content > div,
95
+ .block-library-cover__resize-container {
96
+ // The inner drag handle will still have `pointer-events: all` allowing
97
+ // it to continue to be interacted with.
98
+ pointer-events: none;
99
+ overflow: visible;
100
+ }
94
101
  }
95
102
 
96
103
  // When uploading background images, show a transparent overlay.
@@ -34,7 +34,7 @@ function render_block_core_cover( $attributes, $content ) {
34
34
 
35
35
  /*
36
36
  * Inserts the featured image between the (1st) cover 'background' `span` and 'inner_container' `div`,
37
- * and removes eventual withespace characters between the two (typically introduced at template level)
37
+ * and removes eventual whitespace characters between the two (typically introduced at template level)
38
38
  */
39
39
  $inner_container_start = '/<div\b[^>]+wp-block-cover__inner-container[\s|"][^>]*>/U';
40
40
  if ( 1 === preg_match( $inner_container_start, $content, $matches, PREG_OFFSET_CAPTURE ) ) {
@@ -46,19 +46,18 @@ function render_block_core_cover( $attributes, $content ) {
46
46
  update_post_thumbnail_cache();
47
47
  }
48
48
  $current_featured_image = get_the_post_thumbnail_url();
49
-
50
- $styles = 'background-image:url(' . esc_url( $current_featured_image ) . '); ';
51
-
52
- if ( isset( $attributes['minHeight'] ) ) {
53
- $height_unit = empty( $attributes['minHeightUnit'] ) ? 'px' : $attributes['minHeightUnit'];
54
- $height = " min-height:{$attributes['minHeight']}{$height_unit}";
55
-
56
- $styles .= $height;
49
+ if ( ! $current_featured_image ) {
50
+ return $content;
57
51
  }
58
52
 
59
53
  $processor = new WP_HTML_Tag_Processor( $content );
60
54
  $processor->next_tag();
61
- $processor->set_attribute( 'style', $styles );
55
+
56
+ $styles = $processor->get_attribute( 'style' );
57
+ $merged_styles = ! empty( $styles ) ? $styles . ';' : '';
58
+ $merged_styles .= 'background-image:url(' . esc_url( $current_featured_image ) . ');';
59
+
60
+ $processor->set_attribute( 'style', $merged_styles );
62
61
  $content = $processor->get_updated_html();
63
62
  }
64
63
 
@@ -203,7 +203,7 @@ video.wp-block-cover__video-background {
203
203
  // Mobile Safari does not support fixed background attachment properly.
204
204
  // See also https://stackoverflow.com/questions/24154666/background-size-cover-not-working-on-ios
205
205
  // Chrome on Android does not appear to support the attachment at all: https://issuetracker.google.com/issues/36908439
206
- @supports (-webkit-overflow-scrolling: touch) {
206
+ @supports (-webkit-touch-callout: inherit) {
207
207
  background-attachment: scroll;
208
208
  }
209
209
 
@@ -208,7 +208,7 @@ describe( 'Cover block', () => {
208
208
 
209
209
  await selectBlock( 'Block: Cover' );
210
210
  await userEvent.type(
211
- screen.getByLabelText( 'Alt text (alternative text)' ),
211
+ screen.getByLabelText( 'Alternative text' ),
212
212
  'Me'
213
213
  );
214
214
  expect( screen.getByAltText( 'Me' ) ).toBeInTheDocument();
@@ -2,12 +2,15 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { createBlock } from '@wordpress/blocks';
5
+ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
5
6
 
6
7
  /**
7
8
  * Internal dependencies
8
9
  */
9
10
  import { IMAGE_BACKGROUND_TYPE, VIDEO_BACKGROUND_TYPE } from './shared';
10
- import cleanEmptyObject from '../utils/clean-empty-object';
11
+ import { unlock } from '../private-apis';
12
+
13
+ const { cleanEmptyObject } = unlock( blockEditorPrivateApis );
11
14
 
12
15
  const transforms = {
13
16
  from: [
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
3
+ "apiVersion": 2,
4
+ "__experimental": true,
5
+ "name": "core/details",
6
+ "title": "Details",
7
+ "category": "text",
8
+ "description": "A block that displays a summary and shows or hides additional content.",
9
+ "keywords": [ "disclosure", "summary", "hide", "transcript" ],
10
+ "textdomain": "default",
11
+ "attributes": {
12
+ "showContent": {
13
+ "type": "boolean",
14
+ "default": false
15
+ }
16
+ },
17
+ "supports": {
18
+ "align": true,
19
+ "color": {
20
+ "gradients": true,
21
+ "link": true,
22
+ "__experimentalDefaultControls": {
23
+ "background": true,
24
+ "text": true,
25
+ "link": true
26
+ }
27
+ },
28
+ "__experimentalBorder": {
29
+ "radius": true,
30
+ "color": true,
31
+ "width": true,
32
+ "style": true
33
+ },
34
+ "html": false,
35
+ "spacing": {
36
+ "margin": true,
37
+ "padding": true
38
+ },
39
+ "typography": {
40
+ "fontSize": true,
41
+ "lineHeight": true,
42
+ "__experimentalFontFamily": true,
43
+ "__experimentalFontWeight": true,
44
+ "__experimentalFontStyle": true,
45
+ "__experimentalTextTransform": true,
46
+ "__experimentalTextDecoration": true,
47
+ "__experimentalLetterSpacing": true,
48
+ "__experimentalDefaultControls": {
49
+ "fontSize": true
50
+ }
51
+ }
52
+ },
53
+ "style": "wp-block-details"
54
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import {
5
+ useBlockProps,
6
+ useInnerBlocksProps,
7
+ store as blockEditorStore,
8
+ InspectorControls,
9
+ } from '@wordpress/block-editor';
10
+ import { useSelect } from '@wordpress/data';
11
+ import { PanelBody, ToggleControl } from '@wordpress/components';
12
+ import { __ } from '@wordpress/i18n';
13
+
14
+ const TEMPLATE = [ [ 'core/details-summary' ], [ 'core/details-content' ] ];
15
+
16
+ function DetailsEdit( { attributes, setAttributes, clientId } ) {
17
+ const { showContent } = attributes;
18
+ const blockProps = useBlockProps();
19
+ const innerBlocksProps = useInnerBlocksProps( blockProps, {
20
+ allowedBlocks: TEMPLATE,
21
+ template: TEMPLATE,
22
+ templateLock: 'all',
23
+ } );
24
+
25
+ // Check if either the block or the inner blocks are selected.
26
+ const hasSelection = useSelect( ( select ) => {
27
+ const { isBlockSelected, hasSelectedInnerBlock } =
28
+ select( blockEditorStore );
29
+ /* Sets deep to true to also find blocks inside the details content block. */
30
+ return (
31
+ hasSelectedInnerBlock( clientId, true ) ||
32
+ isBlockSelected( clientId )
33
+ );
34
+ }, [] );
35
+
36
+ return (
37
+ <>
38
+ <InspectorControls>
39
+ <PanelBody title={ __( 'Settings' ) }>
40
+ <ToggleControl
41
+ label={ __( 'Open by default' ) }
42
+ checked={ showContent }
43
+ onChange={ () =>
44
+ setAttributes( {
45
+ showContent: ! showContent,
46
+ } )
47
+ }
48
+ />
49
+ </PanelBody>
50
+ </InspectorControls>
51
+ <details
52
+ { ...innerBlocksProps }
53
+ open={ hasSelection || showContent }
54
+ ></details>
55
+ </>
56
+ );
57
+ }
58
+
59
+ export default DetailsEdit;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { details as icon } from '@wordpress/icons';
5
+ import { __ } from '@wordpress/i18n';
6
+
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import initBlock from '../utils/init-block';
11
+ import metadata from './block.json';
12
+ import edit from './edit';
13
+ import save from './save';
14
+
15
+ const { name } = metadata;
16
+ export { metadata, name };
17
+
18
+ export const settings = {
19
+ icon,
20
+ example: {
21
+ innerBlocks: [
22
+ {
23
+ name: 'core/details-summary',
24
+ attributes: { summary: __( 'Details' ) },
25
+ },
26
+ {
27
+ name: 'core/details-content',
28
+ },
29
+ ],
30
+ },
31
+ save,
32
+ edit,
33
+ };
34
+
35
+ export const init = () => initBlock( { name, metadata, settings } );
@@ -0,0 +1,15 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useBlockProps, InnerBlocks } from '@wordpress/block-editor';
5
+
6
+ export default function save( { attributes } ) {
7
+ const { showContent } = attributes;
8
+ const blockProps = useBlockProps.save();
9
+
10
+ return (
11
+ <details { ...blockProps } open={ showContent }>
12
+ <InnerBlocks.Content />
13
+ </details>
14
+ );
15
+ }
@@ -0,0 +1,3 @@
1
+ .wp-block-details {
2
+ overflow: hidden;
3
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
3
+ "apiVersion": 2,
4
+ "__experimental": true,
5
+ "name": "core/details-content",
6
+ "title": "Details Content",
7
+ "category": "text",
8
+ "parent": [ "core/details" ],
9
+ "description": "Add content that may be shown or hidden via a Details block.",
10
+ "textdomain": "default",
11
+ "supports": {
12
+ "align": false,
13
+ "color": {
14
+ "gradients": true,
15
+ "link": true,
16
+ "__experimentalDefaultControls": {
17
+ "background": true,
18
+ "text": true,
19
+ "link": true
20
+ }
21
+ },
22
+ "__experimentalBorder": {
23
+ "radius": true,
24
+ "color": true,
25
+ "width": true,
26
+ "style": true
27
+ },
28
+ "html": false,
29
+ "lock": false,
30
+ "multiple": false,
31
+ "reusable": false,
32
+ "spacing": {
33
+ "margin": true,
34
+ "padding": true
35
+ },
36
+ "typography": {
37
+ "fontSize": true,
38
+ "lineHeight": true,
39
+ "__experimentalFontFamily": true,
40
+ "__experimentalFontWeight": true,
41
+ "__experimentalFontStyle": true,
42
+ "__experimentalTextTransform": true,
43
+ "__experimentalTextDecoration": true,
44
+ "__experimentalLetterSpacing": true,
45
+ "__experimentalDefaultControls": {
46
+ "fontSize": true
47
+ }
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
5
+ import { __ } from '@wordpress/i18n';
6
+ import { View } from '@wordpress/primitives';
7
+
8
+ const TEMPLATE = [
9
+ [
10
+ 'core/paragraph',
11
+ {
12
+ placeholder: __(
13
+ 'Add text or blocks that will display when the details block is opened.'
14
+ ),
15
+ },
16
+ ],
17
+ ];
18
+
19
+ function DetailsContentEdit() {
20
+ const blockProps = useBlockProps();
21
+ const innerBlocksProps = useInnerBlocksProps( blockProps, {
22
+ template: TEMPLATE,
23
+ templateLock: false,
24
+ } );
25
+
26
+ return <View { ...innerBlocksProps }></View>;
27
+ }
28
+
29
+ export default DetailsContentEdit;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { postContent as icon } from '@wordpress/icons';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import initBlock from '../utils/init-block';
10
+ import metadata from './block.json';
11
+ import edit from './edit';
12
+ import save from './save';
13
+
14
+ const { name } = metadata;
15
+ export { metadata, name };
16
+
17
+ export const settings = {
18
+ icon,
19
+ save,
20
+ edit,
21
+ };
22
+
23
+ export const init = () => initBlock( { name, metadata, settings } );
@@ -0,0 +1,12 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useBlockProps, InnerBlocks } from '@wordpress/block-editor';
5
+ export default function save() {
6
+ const blockProps = useBlockProps.save();
7
+ return (
8
+ <div { ...blockProps }>
9
+ <InnerBlocks.Content />
10
+ </div>
11
+ );
12
+ }
@@ -0,0 +1,53 @@
1
+ {
2
+ "$schema": "https://schemas.wp.org/trunk/block.json",
3
+ "apiVersion": 2,
4
+ "__experimental": true,
5
+ "name": "core/details-summary",
6
+ "title": "Details Summary",
7
+ "category": "text",
8
+ "parent": [ "core/details" ],
9
+ "description": "Provide summary text used to toggle the display of content inside a Details block.",
10
+ "textdomain": "default",
11
+ "attributes": {
12
+ "summary": {
13
+ "type": "string"
14
+ }
15
+ },
16
+ "supports": {
17
+ "align": false,
18
+ "color": {
19
+ "gradients": true,
20
+ "__experimentalDefaultControls": {
21
+ "background": true,
22
+ "text": true
23
+ }
24
+ },
25
+ "__experimentalBorder": {
26
+ "radius": true,
27
+ "color": true,
28
+ "width": true,
29
+ "style": true
30
+ },
31
+ "html": false,
32
+ "lock": false,
33
+ "multiple": false,
34
+ "reusable": false,
35
+ "spacing": {
36
+ "margin": true,
37
+ "padding": true
38
+ },
39
+ "typography": {
40
+ "fontSize": true,
41
+ "lineHeight": true,
42
+ "__experimentalFontFamily": true,
43
+ "__experimentalFontWeight": true,
44
+ "__experimentalFontStyle": true,
45
+ "__experimentalTextTransform": true,
46
+ "__experimentalTextDecoration": true,
47
+ "__experimentalLetterSpacing": true,
48
+ "__experimentalDefaultControls": {
49
+ "fontSize": true
50
+ }
51
+ }
52
+ }
53
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { RichText, useBlockProps } from '@wordpress/block-editor';
5
+ import { __ } from '@wordpress/i18n';
6
+
7
+ function DetailsSummaryEdit( { attributes, setAttributes } ) {
8
+ const summary = attributes.summary ? attributes.summary : __( 'Details' );
9
+ return (
10
+ <summary
11
+ { ...useBlockProps() }
12
+ onClick={ ( event ) => event.preventDefault() }
13
+ >
14
+ <RichText
15
+ aria-label={ __( 'Add summary' ) }
16
+ allowedFormats={ [] }
17
+ withoutInteractiveFormatting
18
+ value={ summary }
19
+ onChange={ ( newSummary ) =>
20
+ setAttributes( { summary: newSummary } )
21
+ }
22
+ />
23
+ </summary>
24
+ );
25
+ }
26
+
27
+ export default DetailsSummaryEdit;
@@ -0,0 +1,3 @@
1
+ .wp-block-details-summary div {
2
+ display: inline;
3
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { heading as icon } from '@wordpress/icons';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import initBlock from '../utils/init-block';
10
+ import metadata from './block.json';
11
+ import edit from './edit';
12
+ import save from './save';
13
+
14
+ const { name } = metadata;
15
+ export { metadata, name };
16
+
17
+ export const settings = {
18
+ icon,
19
+ save,
20
+ edit,
21
+ };
22
+
23
+ export const init = () => initBlock( { name, metadata, settings } );
@@ -0,0 +1,13 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { RichText, useBlockProps } from '@wordpress/block-editor';
5
+
6
+ export default function save( { attributes } ) {
7
+ const summary = attributes.summary ? attributes.summary : 'Details';
8
+ return (
9
+ <summary { ...useBlockProps.save() }>
10
+ <RichText.Content value={ summary } />
11
+ </summary>
12
+ );
13
+ }
@@ -0,0 +1,3 @@
1
+ .wp-block-details-summary {
2
+ cursor: pointer;
3
+ }
package/src/editor.scss CHANGED
@@ -13,6 +13,7 @@
13
13
  @import "./comments-pagination-numbers/editor.scss";
14
14
  @import "./comments-title/editor.scss";
15
15
  @import "./cover/editor.scss";
16
+ @import "./details-summary/editor.scss";
16
17
  @import "./embed/editor.scss";
17
18
  @import "./file/editor.scss";
18
19
  @import "./freeform/editor.scss";
@@ -41,7 +41,10 @@
41
41
  }
42
42
  },
43
43
  "supports": {
44
- "align": true
44
+ "align": true,
45
+ "spacing": {
46
+ "margin": true
47
+ }
45
48
  },
46
49
  "editorStyle": "wp-block-embed-editor",
47
50
  "style": "wp-block-embed"
@@ -39,7 +39,7 @@ const EmbedLinkSettings = ( {
39
39
  label: (
40
40
  <FooterMessageLink
41
41
  href={ __(
42
- 'https://wordpress.org/support/article/embeds/'
42
+ 'https://wordpress.org/documentation/article/embeds/'
43
43
  ) }
44
44
  value={ __( 'Learn more about embeds' ) }
45
45
  />
@@ -40,7 +40,7 @@ const EmbedPlaceholder = ( {
40
40
  <div className="components-placeholder__learn-more">
41
41
  <ExternalLink
42
42
  href={ __(
43
- 'https://wordpress.org/support/article/embeds/'
43
+ 'https://wordpress.org/documentation/article/embeds/'
44
44
  ) }
45
45
  >
46
46
  { __( 'Learn more about embeds' ) }
@@ -466,7 +466,6 @@ export class FileEdit extends Component {
466
466
  __unstableMobileNoFocusOnMount
467
467
  onChange={ this.onChangeFileName }
468
468
  placeholder={ __( 'File name' ) }
469
- rootTagsToEliminate={ [ 'p' ] }
470
469
  tagName="p"
471
470
  underlineColorAndroid="transparent"
472
471
  value={ fileName }
@@ -502,7 +501,6 @@ export class FileEdit extends Component {
502
501
  <RichText
503
502
  withoutInteractiveFormatting
504
503
  __unstableMobileNoFocusOnMount
505
- rootTagsToEliminate={ [ 'p' ] }
506
504
  tagName="p"
507
505
  textAlign="center"
508
506
  minWidth={ minWidth }
@@ -1,6 +1,4 @@
1
1
  .wp-block-file {
2
- margin-bottom: 1.5em;
3
-
4
2
  &:not(.wp-element-button) {
5
3
  font-size: 0.8em;
6
4
  }
@@ -19,6 +17,11 @@
19
17
  }
20
18
  }
21
19
 
20
+ // Lowest specificity to avoid overriding layout styles.
21
+ :where(.wp-block-file) {
22
+ margin-bottom: 1.5em;
23
+ }
24
+
22
25
  .wp-block-file__embed {
23
26
  margin-bottom: 1em;
24
27
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import {
5
5
  act,
6
- changeTextOfRichText,
6
+ typeInRichText,
7
7
  fireEvent,
8
8
  getBlock,
9
9
  getEditorHtml,
@@ -173,7 +173,7 @@ describe( 'Gallery block', () => {
173
173
  const captionField = within(
174
174
  getByLabelText( /Gallery caption. Empty/ )
175
175
  ).getByPlaceholderText( 'Add caption' );
176
- changeTextOfRichText(
176
+ typeInRichText(
177
177
  captionField,
178
178
  '<strong>Bold</strong> <em>italic</em> <s>strikethrough</s> gallery caption'
179
179
  );
@@ -197,7 +197,7 @@ describe( 'Gallery block', () => {
197
197
  // Set gallery item caption
198
198
  const captionField =
199
199
  within( galleryItem ).getByPlaceholderText( 'Add caption' );
200
- changeTextOfRichText(
200
+ typeInRichText(
201
201
  captionField,
202
202
  '<strong>Bold</strong> <em>italic</em> <s>strikethrough</s> image caption'
203
203
  );
@@ -537,7 +537,7 @@ describe( 'Gallery block', () => {
537
537
  <figure class="wp-block-gallery has-nested-images columns-default is-cropped"><!-- wp:image {"id":${ media[ 0 ].localId }} -->
538
538
  <figure class="wp-block-image"><img src="${ media[ 0 ].localUrl }" alt="" class="wp-image-${ media[ 0 ].localId }"/></figure>
539
539
  <!-- /wp:image -->
540
-
540
+
541
541
  <!-- wp:image {"id":${ media[ 1 ].localId },"linkDestination":"attachment"} -->
542
542
  <figure class="wp-block-image"><img src="${ media[ 1 ].localUrl }" alt="" class="wp-image-${ media[ 1 ].localId }"/></figure>
543
543
  <!-- /wp:image --></figure>