@wordpress/block-library 8.6.0 → 8.8.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 (425) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/buttons/index.js +1 -0
  3. package/build/buttons/index.js.map +1 -1
  4. package/build/buttons/transforms.js +1 -0
  5. package/build/buttons/transforms.js.map +1 -1
  6. package/build/column/index.js +2 -1
  7. package/build/column/index.js.map +1 -1
  8. package/build/columns/edit.js +28 -8
  9. package/build/columns/edit.js.map +1 -1
  10. package/build/columns/index.js +6 -1
  11. package/build/columns/index.js.map +1 -1
  12. package/build/columns/utils.js +4 -9
  13. package/build/columns/utils.js.map +1 -1
  14. package/build/cover/edit/index.js +46 -50
  15. package/build/cover/edit/index.js.map +1 -1
  16. package/build/cover/edit/inspector-controls.js +2 -2
  17. package/build/cover/edit/inspector-controls.js.map +1 -1
  18. package/build/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +32 -6
  19. package/build/cover/edit/resizable-cover-popover.js.map +1 -0
  20. package/build/cover/index.js +12 -0
  21. package/build/cover/index.js.map +1 -1
  22. package/build/details/edit.js +67 -0
  23. package/build/details/edit.js.map +1 -0
  24. package/build/details/index.js +110 -0
  25. package/build/details/index.js.map +1 -0
  26. package/build/details/save.js +33 -0
  27. package/build/details/save.js.map +1 -0
  28. package/build/details-content/edit.js +34 -0
  29. package/build/details-content/edit.js.map +1 -0
  30. package/build/details-content/index.js +94 -0
  31. package/build/details-content/index.js.map +1 -0
  32. package/build/details-content/save.js +20 -0
  33. package/build/details-content/save.js.map +1 -0
  34. package/build/details-summary/edit.js +42 -0
  35. package/build/details-summary/edit.js.map +1 -0
  36. package/build/details-summary/index.js +97 -0
  37. package/build/details-summary/index.js.map +1 -0
  38. package/build/details-summary/save.js +24 -0
  39. package/build/details-summary/save.js.map +1 -0
  40. package/build/embed/deprecated.js +4 -1
  41. package/build/embed/deprecated.js.map +1 -1
  42. package/build/embed/embed-link-settings.native.js +1 -1
  43. package/build/embed/embed-link-settings.native.js.map +1 -1
  44. package/build/embed/embed-placeholder.js +1 -1
  45. package/build/embed/embed-placeholder.js.map +1 -1
  46. package/build/embed/index.js +4 -1
  47. package/build/embed/index.js.map +1 -1
  48. package/build/embed/transforms.js +4 -1
  49. package/build/embed/transforms.js.map +1 -1
  50. package/build/embed/util.js +4 -1
  51. package/build/embed/util.js.map +1 -1
  52. package/build/file/edit.native.js +0 -2
  53. package/build/file/edit.native.js.map +1 -1
  54. package/build/gallery/edit.js +8 -5
  55. package/build/gallery/edit.js.map +1 -1
  56. package/build/gallery/use-get-media.native.js +2 -1
  57. package/build/gallery/use-get-media.native.js.map +1 -1
  58. package/build/gallery/use-image-sizes.js +1 -1
  59. package/build/gallery/use-image-sizes.js.map +1 -1
  60. package/build/group/deprecated.js +4 -2
  61. package/build/group/deprecated.js.map +1 -1
  62. package/build/group/edit.js +22 -5
  63. package/build/group/edit.js.map +1 -1
  64. package/build/group/placeholder.js +11 -1
  65. package/build/group/placeholder.js.map +1 -1
  66. package/build/group/variations.js +23 -3
  67. package/build/group/variations.js.map +1 -1
  68. package/build/image/edit.js +1 -1
  69. package/build/image/edit.js.map +1 -1
  70. package/build/image/edit.native.js +1 -1
  71. package/build/image/edit.native.js.map +1 -1
  72. package/build/image/image.js +8 -6
  73. package/build/image/image.js.map +1 -1
  74. package/build/image/index.js +9 -2
  75. package/build/image/index.js.map +1 -1
  76. package/build/index.js +24 -6
  77. package/build/index.js.map +1 -1
  78. package/build/latest-posts/edit.js +1 -0
  79. package/build/latest-posts/edit.js.map +1 -1
  80. package/build/media-text/deprecated.js +228 -18
  81. package/build/media-text/deprecated.js.map +1 -1
  82. package/build/media-text/edit.js +3 -3
  83. package/build/media-text/edit.js.map +1 -1
  84. package/build/media-text/index.js +1 -1
  85. package/build/media-text/media-container.js +2 -6
  86. package/build/media-text/media-container.js.map +1 -1
  87. package/build/media-text/media-container.native.js +3 -3
  88. package/build/media-text/media-container.native.js.map +1 -1
  89. package/build/navigation/deprecated.js +8 -11
  90. package/build/navigation/deprecated.js.map +1 -1
  91. package/build/navigation/edit/index.js +1 -12
  92. package/build/navigation/edit/index.js.map +1 -1
  93. package/build/navigation/edit/inner-blocks.js +1 -4
  94. package/build/navigation/edit/inner-blocks.js.map +1 -1
  95. package/build/navigation/edit/unsaved-inner-blocks.js +1 -14
  96. package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  97. package/build/navigation/index.js +0 -1
  98. package/build/navigation/index.js.map +1 -1
  99. package/build/post-author/index.js +0 -1
  100. package/build/post-author/index.js.map +1 -1
  101. package/build/post-date/edit.js +2 -1
  102. package/build/post-date/edit.js.map +1 -1
  103. package/build/post-date/index.js +4 -1
  104. package/build/post-date/index.js.map +1 -1
  105. package/build/post-date/variations.js +28 -0
  106. package/build/post-date/variations.js.map +1 -0
  107. package/build/post-excerpt/edit.js +39 -10
  108. package/build/post-excerpt/edit.js.map +1 -1
  109. package/build/post-featured-image/dimension-controls.js +4 -3
  110. package/build/post-featured-image/dimension-controls.js.map +1 -1
  111. package/build/post-featured-image/edit.js +8 -22
  112. package/build/post-featured-image/edit.js.map +1 -1
  113. package/build/post-template/index.js +1 -1
  114. package/build/post-time-to-read/edit.js +1 -1
  115. package/build/post-time-to-read/edit.js.map +1 -1
  116. package/build/post-time-to-read/index.js +24 -1
  117. package/build/post-time-to-read/index.js.map +1 -1
  118. package/build/quote/index.js +1 -0
  119. package/build/quote/index.js.map +1 -1
  120. package/build/spacer/controls.js +25 -6
  121. package/build/spacer/controls.js.map +1 -1
  122. package/build/spacer/edit.js +27 -7
  123. package/build/spacer/edit.js.map +1 -1
  124. package/build/spacer/save.js +2 -2
  125. package/build/spacer/save.js.map +1 -1
  126. package/build/table/state.js +35 -35
  127. package/build/table/state.js.map +1 -1
  128. package/build/term-description/index.js +1 -2
  129. package/build/term-description/index.js.map +1 -1
  130. package/build/utils/clean-empty-object.js +5 -2
  131. package/build/utils/clean-empty-object.js.map +1 -1
  132. package/build-module/buttons/index.js +1 -0
  133. package/build-module/buttons/index.js.map +1 -1
  134. package/build-module/buttons/transforms.js +1 -0
  135. package/build-module/buttons/transforms.js.map +1 -1
  136. package/build-module/column/index.js +2 -1
  137. package/build-module/column/index.js.map +1 -1
  138. package/build-module/columns/edit.js +28 -8
  139. package/build-module/columns/edit.js.map +1 -1
  140. package/build-module/columns/index.js +6 -1
  141. package/build-module/columns/index.js.map +1 -1
  142. package/build-module/columns/utils.js +4 -8
  143. package/build-module/columns/utils.js.map +1 -1
  144. package/build-module/cover/edit/index.js +48 -52
  145. package/build-module/cover/edit/index.js.map +1 -1
  146. package/build-module/cover/edit/inspector-controls.js +2 -2
  147. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  148. package/build-module/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +31 -6
  149. package/build-module/cover/edit/resizable-cover-popover.js.map +1 -0
  150. package/build-module/cover/index.js +12 -0
  151. package/build-module/cover/index.js.map +1 -1
  152. package/build-module/details/edit.js +52 -0
  153. package/build-module/details/edit.js.map +1 -0
  154. package/build-module/details/index.js +91 -0
  155. package/build-module/details/index.js.map +1 -0
  156. package/build-module/details/save.js +20 -0
  157. package/build-module/details/save.js.map +1 -0
  158. package/build-module/details-content/edit.js +23 -0
  159. package/build-module/details-content/edit.js.map +1 -0
  160. package/build-module/details-content/index.js +76 -0
  161. package/build-module/details-content/index.js.map +1 -0
  162. package/build-module/details-content/save.js +11 -0
  163. package/build-module/details-content/save.js.map +1 -0
  164. package/build-module/details-summary/edit.js +30 -0
  165. package/build-module/details-summary/edit.js.map +1 -0
  166. package/build-module/details-summary/index.js +79 -0
  167. package/build-module/details-summary/index.js.map +1 -0
  168. package/build-module/details-summary/save.js +16 -0
  169. package/build-module/details-summary/save.js.map +1 -0
  170. package/build-module/embed/deprecated.js +4 -1
  171. package/build-module/embed/deprecated.js.map +1 -1
  172. package/build-module/embed/embed-link-settings.native.js +1 -1
  173. package/build-module/embed/embed-link-settings.native.js.map +1 -1
  174. package/build-module/embed/embed-placeholder.js +1 -1
  175. package/build-module/embed/embed-placeholder.js.map +1 -1
  176. package/build-module/embed/index.js +4 -1
  177. package/build-module/embed/index.js.map +1 -1
  178. package/build-module/embed/transforms.js +4 -1
  179. package/build-module/embed/transforms.js.map +1 -1
  180. package/build-module/embed/util.js +4 -1
  181. package/build-module/embed/util.js.map +1 -1
  182. package/build-module/file/edit.native.js +0 -2
  183. package/build-module/file/edit.native.js.map +1 -1
  184. package/build-module/gallery/edit.js +8 -5
  185. package/build-module/gallery/edit.js.map +1 -1
  186. package/build-module/gallery/use-get-media.native.js +2 -1
  187. package/build-module/gallery/use-get-media.native.js.map +1 -1
  188. package/build-module/gallery/use-image-sizes.js +1 -1
  189. package/build-module/gallery/use-image-sizes.js.map +1 -1
  190. package/build-module/group/deprecated.js +4 -2
  191. package/build-module/group/deprecated.js.map +1 -1
  192. package/build-module/group/edit.js +21 -5
  193. package/build-module/group/edit.js.map +1 -1
  194. package/build-module/group/placeholder.js +11 -1
  195. package/build-module/group/placeholder.js.map +1 -1
  196. package/build-module/group/variations.js +24 -1
  197. package/build-module/group/variations.js.map +1 -1
  198. package/build-module/image/edit.js +1 -1
  199. package/build-module/image/edit.js.map +1 -1
  200. package/build-module/image/edit.native.js +1 -1
  201. package/build-module/image/edit.native.js.map +1 -1
  202. package/build-module/image/image.js +8 -6
  203. package/build-module/image/image.js.map +1 -1
  204. package/build-module/image/index.js +9 -2
  205. package/build-module/image/index.js.map +1 -1
  206. package/build-module/index.js +21 -6
  207. package/build-module/index.js.map +1 -1
  208. package/build-module/latest-posts/edit.js +1 -0
  209. package/build-module/latest-posts/edit.js.map +1 -1
  210. package/build-module/media-text/deprecated.js +227 -18
  211. package/build-module/media-text/deprecated.js.map +1 -1
  212. package/build-module/media-text/edit.js +3 -3
  213. package/build-module/media-text/edit.js.map +1 -1
  214. package/build-module/media-text/index.js +1 -1
  215. package/build-module/media-text/media-container.js +1 -5
  216. package/build-module/media-text/media-container.js.map +1 -1
  217. package/build-module/media-text/media-container.native.js +1 -1
  218. package/build-module/media-text/media-container.native.js.map +1 -1
  219. package/build-module/navigation/deprecated.js +8 -10
  220. package/build-module/navigation/deprecated.js.map +1 -1
  221. package/build-module/navigation/edit/index.js +1 -12
  222. package/build-module/navigation/edit/index.js.map +1 -1
  223. package/build-module/navigation/edit/inner-blocks.js +1 -4
  224. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  225. package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -14
  226. package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
  227. package/build-module/navigation/index.js +0 -1
  228. package/build-module/navigation/index.js.map +1 -1
  229. package/build-module/post-author/index.js +0 -1
  230. package/build-module/post-author/index.js.map +1 -1
  231. package/build-module/post-date/edit.js +2 -1
  232. package/build-module/post-date/edit.js.map +1 -1
  233. package/build-module/post-date/index.js +3 -1
  234. package/build-module/post-date/index.js.map +1 -1
  235. package/build-module/post-date/variations.js +18 -0
  236. package/build-module/post-date/variations.js.map +1 -0
  237. package/build-module/post-excerpt/edit.js +38 -11
  238. package/build-module/post-excerpt/edit.js.map +1 -1
  239. package/build-module/post-featured-image/dimension-controls.js +4 -3
  240. package/build-module/post-featured-image/dimension-controls.js.map +1 -1
  241. package/build-module/post-featured-image/edit.js +8 -22
  242. package/build-module/post-featured-image/edit.js.map +1 -1
  243. package/build-module/post-template/index.js +1 -1
  244. package/build-module/post-time-to-read/edit.js +1 -1
  245. package/build-module/post-time-to-read/edit.js.map +1 -1
  246. package/build-module/post-time-to-read/index.js +24 -1
  247. package/build-module/post-time-to-read/index.js.map +1 -1
  248. package/build-module/quote/index.js +1 -0
  249. package/build-module/quote/index.js.map +1 -1
  250. package/build-module/spacer/controls.js +27 -9
  251. package/build-module/spacer/controls.js.map +1 -1
  252. package/build-module/spacer/edit.js +27 -8
  253. package/build-module/spacer/edit.js.map +1 -1
  254. package/build-module/spacer/save.js +3 -3
  255. package/build-module/spacer/save.js.map +1 -1
  256. package/build-module/table/state.js +35 -33
  257. package/build-module/table/state.js.map +1 -1
  258. package/build-module/term-description/index.js +1 -2
  259. package/build-module/term-description/index.js.map +1 -1
  260. package/build-module/utils/clean-empty-object.js +6 -3
  261. package/build-module/utils/clean-empty-object.js.map +1 -1
  262. package/build-style/categories/editor-rtl.css +5 -0
  263. package/build-style/categories/editor.css +5 -0
  264. package/build-style/categories/style-rtl.css +4 -0
  265. package/build-style/categories/style.css +4 -0
  266. package/build-style/columns/style-rtl.css +4 -1
  267. package/build-style/columns/style.css +4 -1
  268. package/build-style/common-rtl.css +1 -1
  269. package/build-style/common.css +1 -1
  270. package/build-style/cover/editor-rtl.css +11 -12
  271. package/build-style/cover/editor.css +11 -12
  272. package/build-style/cover/style-rtl.css +3 -2
  273. package/build-style/cover/style.css +3 -2
  274. package/build-style/details/style-rtl.css +91 -0
  275. package/build-style/details/style.css +91 -0
  276. package/build-style/details-summary/editor-rtl.css +91 -0
  277. package/build-style/details-summary/editor.css +91 -0
  278. package/build-style/details-summary/style-rtl.css +91 -0
  279. package/build-style/details-summary/style.css +91 -0
  280. package/build-style/editor-rtl.css +40 -48
  281. package/build-style/editor.css +40 -48
  282. package/build-style/file/style-rtl.css +4 -3
  283. package/build-style/file/style.css +4 -3
  284. package/build-style/navigation/style-rtl.css +2 -0
  285. package/build-style/navigation/style.css +2 -0
  286. package/build-style/post-excerpt/style-rtl.css +1 -1
  287. package/build-style/post-excerpt/style.css +1 -1
  288. package/build-style/post-featured-image/editor-rtl.css +1 -0
  289. package/build-style/post-featured-image/editor.css +1 -0
  290. package/build-style/post-template/style-rtl.css +1 -1
  291. package/build-style/post-template/style.css +1 -1
  292. package/build-style/post-time-to-read/style-rtl.css +91 -0
  293. package/build-style/post-time-to-read/style.css +91 -0
  294. package/build-style/pullquote/style-rtl.css +4 -1
  295. package/build-style/pullquote/style.css +4 -1
  296. package/build-style/search/style-rtl.css +8 -7
  297. package/build-style/search/style.css +8 -7
  298. package/build-style/shortcode/editor-rtl.css +15 -34
  299. package/build-style/shortcode/editor.css +15 -34
  300. package/build-style/spacer/editor-rtl.css +4 -2
  301. package/build-style/spacer/editor.css +4 -2
  302. package/build-style/style-rtl.css +44 -17
  303. package/build-style/style.css +44 -17
  304. package/package.json +31 -31
  305. package/src/buttons/block.json +1 -0
  306. package/src/categories/editor.scss +5 -0
  307. package/src/categories/style.scss +4 -0
  308. package/src/column/block.json +2 -1
  309. package/src/columns/block.json +6 -1
  310. package/src/columns/edit.js +35 -10
  311. package/src/columns/style.scss +5 -1
  312. package/src/columns/utils.js +8 -9
  313. package/src/comments/index.php +1 -0
  314. package/src/common.scss +1 -1
  315. package/src/cover/block.json +12 -0
  316. package/src/cover/edit/index.js +44 -37
  317. package/src/cover/edit/inspector-controls.js +4 -5
  318. package/src/cover/edit/resizable-cover-popover.js +82 -0
  319. package/src/cover/editor.scss +20 -13
  320. package/src/cover/index.php +9 -10
  321. package/src/cover/style.scss +2 -1
  322. package/src/cover/test/__snapshots__/transforms.native.js.snap +2 -2
  323. package/src/cover/test/edit.js +324 -0
  324. package/src/details/block.json +54 -0
  325. package/src/details/edit.js +59 -0
  326. package/src/details/index.js +35 -0
  327. package/src/details/save.js +15 -0
  328. package/src/details/style.scss +3 -0
  329. package/src/details-content/block.json +50 -0
  330. package/src/details-content/edit.js +29 -0
  331. package/src/details-content/index.js +23 -0
  332. package/src/details-content/save.js +12 -0
  333. package/src/details-summary/block.json +53 -0
  334. package/src/details-summary/edit.js +27 -0
  335. package/src/details-summary/editor.scss +3 -0
  336. package/src/details-summary/index.js +23 -0
  337. package/src/details-summary/save.js +13 -0
  338. package/src/details-summary/style.scss +3 -0
  339. package/src/editor.scss +1 -0
  340. package/src/embed/block.json +4 -1
  341. package/src/embed/embed-link-settings.native.js +1 -1
  342. package/src/embed/embed-placeholder.js +1 -1
  343. package/src/file/edit.native.js +0 -2
  344. package/src/file/style.scss +5 -2
  345. package/src/gallery/edit.js +5 -2
  346. package/src/gallery/test/use-get-media.native.js +24 -0
  347. package/src/gallery/use-get-media.native.js +1 -1
  348. package/src/gallery/use-image-sizes.js +1 -1
  349. package/src/group/deprecated.js +4 -2
  350. package/src/group/edit.js +27 -9
  351. package/src/group/placeholder.js +13 -1
  352. package/src/group/variations.js +14 -1
  353. package/src/home-link/index.php +2 -2
  354. package/src/image/block.json +9 -2
  355. package/src/image/edit.js +1 -1
  356. package/src/image/edit.native.js +1 -1
  357. package/src/image/image.js +15 -7
  358. package/src/image/index.php +7 -2
  359. package/src/image/test/__snapshots__/transforms.native.js.snap +1 -1
  360. package/src/index.js +13 -3
  361. package/src/latest-comments/style.scss +1 -1
  362. package/src/latest-posts/edit.js +3 -0
  363. package/src/media-text/block.json +1 -1
  364. package/src/media-text/deprecated.js +235 -3
  365. package/src/media-text/edit.js +7 -6
  366. package/src/media-text/media-container.js +1 -5
  367. package/src/media-text/media-container.native.js +1 -1
  368. package/src/media-text/test/__snapshots__/transforms.native.js.snap +4 -4
  369. package/src/navigation/block.json +0 -1
  370. package/src/navigation/deprecated.js +15 -19
  371. package/src/navigation/edit/index.js +0 -13
  372. package/src/navigation/edit/inner-blocks.js +0 -3
  373. package/src/navigation/edit/unsaved-inner-blocks.js +34 -46
  374. package/src/navigation/index.php +0 -4
  375. package/src/navigation/style.scss +6 -4
  376. package/src/navigation-link/index.php +2 -1
  377. package/src/navigation-submenu/index.php +30 -76
  378. package/src/paragraph/test/edit.native.js +356 -1
  379. package/src/post-author/block.json +0 -1
  380. package/src/post-author/index.php +1 -1
  381. package/src/post-date/edit.js +4 -1
  382. package/src/post-date/index.js +2 -0
  383. package/src/post-date/variations.js +20 -0
  384. package/src/post-excerpt/edit.js +48 -16
  385. package/src/post-excerpt/index.php +3 -3
  386. package/src/post-excerpt/style.scss +2 -1
  387. package/src/post-featured-image/dimension-controls.js +7 -3
  388. package/src/post-featured-image/edit.js +8 -29
  389. package/src/post-featured-image/editor.scss +1 -0
  390. package/src/post-template/block.json +1 -1
  391. package/src/post-template/style.scss +1 -1
  392. package/src/post-time-to-read/block.json +24 -1
  393. package/src/post-time-to-read/edit.js +1 -1
  394. package/src/post-time-to-read/index.php +3 -3
  395. package/src/post-time-to-read/style.scss +4 -0
  396. package/src/preformatted/test/__snapshots__/edit.native.js.snap +2 -2
  397. package/src/preformatted/test/edit.native.js +45 -2
  398. package/src/pullquote/style.scss +5 -1
  399. package/src/pullquote/test/edit.native.js +70 -0
  400. package/src/query-title/index.php +2 -5
  401. package/src/quote/block.json +1 -0
  402. package/src/quote/test/edit.native.js +92 -0
  403. package/src/search/index.php +1 -1
  404. package/src/search/style.scss +16 -12
  405. package/src/shortcode/editor.scss +26 -5
  406. package/src/spacer/controls.js +42 -17
  407. package/src/spacer/edit.js +41 -9
  408. package/src/spacer/editor.scss +2 -1
  409. package/src/spacer/save.js +3 -3
  410. package/src/style.scss +3 -0
  411. package/src/table/state.js +83 -66
  412. package/src/term-description/block.json +1 -2
  413. package/src/utils/clean-empty-object.js +4 -4
  414. package/src/verse/test/edit.native.js +33 -0
  415. package/src/video/test/__snapshots__/transforms.native.js.snap +1 -1
  416. package/tsconfig.tsbuildinfo +1 -1
  417. package/build/cover/edit/resizable-cover.js.map +0 -1
  418. package/build/media-text/media-container-icon.js +0 -27
  419. package/build/media-text/media-container-icon.js.map +0 -1
  420. package/build-module/cover/edit/resizable-cover.js.map +0 -1
  421. package/build-module/media-text/media-container-icon.js +0 -17
  422. package/build-module/media-text/media-container-icon.js.map +0 -1
  423. package/src/cover/edit/resizable-cover.js +0 -61
  424. package/src/cover/test/block-controls.js +0 -62
  425. package/src/media-text/media-container-icon.js +0 -12
@@ -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
  }
@@ -562,6 +562,7 @@ function GalleryEdit( props ) {
562
562
  max={ Math.min( MAX_COLUMNS, images.length ) }
563
563
  { ...MOBILE_CONTROL_PROPS_RANGE_CONTROL }
564
564
  required
565
+ size="__unstable-large"
565
566
  />
566
567
  ) }
567
568
  <ToggleControl
@@ -578,6 +579,7 @@ function GalleryEdit( props ) {
578
579
  onChange={ setLinkTo }
579
580
  options={ linkOptions }
580
581
  hideCancelButton={ true }
582
+ size="__unstable-large"
581
583
  />
582
584
  { hasLinkTo && (
583
585
  <ToggleControl
@@ -590,7 +592,7 @@ function GalleryEdit( props ) {
590
592
  { imageSizeOptions?.length > 0 && (
591
593
  <SelectControl
592
594
  __nextHasNoMarginBottom
593
- label={ __( 'Image size' ) }
595
+ label={ __( 'Resolution' ) }
594
596
  help={ __(
595
597
  'Select the size of the source images.'
596
598
  ) }
@@ -598,12 +600,13 @@ function GalleryEdit( props ) {
598
600
  options={ imageSizeOptions }
599
601
  onChange={ updateImagesSize }
600
602
  hideCancelButton={ true }
603
+ size="__unstable-large"
601
604
  />
602
605
  ) }
603
606
  { Platform.isWeb && ! imageSizeOptions && hasImageIds && (
604
607
  <BaseControl className={ 'gallery-image-sizes' }>
605
608
  <BaseControl.VisualLabel>
606
- { __( 'Image size' ) }
609
+ { __( 'Resolution' ) }
607
610
  </BaseControl.VisualLabel>
608
611
  <View className={ 'gallery-image-sizes__loading' }>
609
612
  <Spinner />
@@ -0,0 +1,24 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { render } from 'test/helpers';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import useGetMedia from '../use-get-media';
10
+
11
+ describe( 'useGetMedia', () => {
12
+ // TODO: Explore why a Gallery block would ever be without inner blocks.
13
+ // This test and the associated default function parameter might be unnecessary.
14
+ it( 'should not error when receiving zero images', () => {
15
+ // Arrange
16
+ const TestSubject = () => {
17
+ useGetMedia( undefined );
18
+ return null;
19
+ };
20
+
21
+ // Assert
22
+ expect( () => render( <TestSubject /> ) ).not.toThrow();
23
+ } );
24
+ } );
@@ -14,7 +14,7 @@ const EMPTY_IMAGE_MEDIA = [];
14
14
  *
15
15
  * @return {Array} An array of media info options for each gallery image.
16
16
  */
17
- export default function useGetMedia( innerBlockImages ) {
17
+ export default function useGetMedia( innerBlockImages = [] ) {
18
18
  return useSelect(
19
19
  ( select ) => {
20
20
  const imagesUploading = innerBlockImages.some(
@@ -5,7 +5,7 @@ import { useMemo } from '@wordpress/element';
5
5
 
6
6
  /**
7
7
  * Calculates the image sizes that are avaible for the current gallery images in order to
8
- * populate the 'Image size' selector.
8
+ * populate the 'Resolution' selector.
9
9
  *
10
10
  * @param {Array} images Basic image block data taken from current gallery innerBlock
11
11
  * @param {boolean} isSelected Is the block currently selected in the editor.
@@ -50,7 +50,8 @@ const deprecated = [
50
50
  default: 'div',
51
51
  },
52
52
  templateLock: {
53
- type: 'string',
53
+ type: [ 'string', 'boolean' ],
54
+ enum: [ 'all', 'insert', false ],
54
55
  },
55
56
  },
56
57
  supports: {
@@ -135,7 +136,8 @@ const deprecated = [
135
136
  default: 'div',
136
137
  },
137
138
  templateLock: {
138
- type: 'string',
139
+ type: [ 'string', 'boolean' ],
140
+ enum: [ 'all', 'insert', false ],
139
141
  },
140
142
  },
141
143
  supports: {
package/src/group/edit.js CHANGED
@@ -12,6 +12,7 @@ import {
12
12
  } from '@wordpress/block-editor';
13
13
  import { SelectControl } from '@wordpress/components';
14
14
  import { __ } from '@wordpress/i18n';
15
+ import { View } from '@wordpress/primitives';
15
16
 
16
17
  /**
17
18
  * Internal dependencies
@@ -97,7 +98,8 @@ function GroupEdit( {
97
98
  ? { ...defaultLayout, ...layout, type: 'default' }
98
99
  : { ...defaultLayout, ...layout };
99
100
  const { type = 'default' } = usedLayout;
100
- const layoutSupportEnabled = themeSupportsLayout || type === 'flex';
101
+ const layoutSupportEnabled =
102
+ themeSupportsLayout || type === 'flex' || type === 'grid';
101
103
 
102
104
  // Hooks.
103
105
  const blockProps = useBlockProps( {
@@ -108,15 +110,28 @@ function GroupEdit( {
108
110
  usedLayoutType: usedLayout?.type,
109
111
  hasInnerBlocks,
110
112
  } );
113
+
114
+ // Default to the regular appender being rendered.
115
+ let renderAppender;
116
+ if ( showPlaceholder ) {
117
+ // In the placeholder state, ensure the appender is not rendered.
118
+ // This is needed because `...innerBlocksProps` is used in the placeholder
119
+ // state so that blocks can dragged onto the placeholder area
120
+ // from both the list view and in the editor canvas.
121
+ renderAppender = false;
122
+ } else if ( ! hasInnerBlocks ) {
123
+ // When there is no placeholder, but the block is also empty,
124
+ // use the larger button appender.
125
+ renderAppender = InnerBlocks.ButtonBlockAppender;
126
+ }
127
+
111
128
  const innerBlocksProps = useInnerBlocksProps(
112
129
  layoutSupportEnabled
113
130
  ? blockProps
114
131
  : { className: 'wp-block-group__inner-container' },
115
132
  {
116
133
  templateLock,
117
- renderAppender: hasInnerBlocks
118
- ? undefined
119
- : InnerBlocks.ButtonBlockAppender,
134
+ renderAppender,
120
135
  __unstableDisableLayoutClassNames: ! layoutSupportEnabled,
121
136
  }
122
137
  );
@@ -138,11 +153,14 @@ function GroupEdit( {
138
153
  }
139
154
  />
140
155
  { showPlaceholder && (
141
- <GroupPlaceHolder
142
- clientId={ clientId }
143
- name={ name }
144
- onSelect={ selectVariation }
145
- />
156
+ <View { ...innerBlocksProps }>
157
+ { innerBlocksProps.children }
158
+ <GroupPlaceHolder
159
+ clientId={ clientId }
160
+ name={ name }
161
+ onSelect={ selectVariation }
162
+ />
163
+ </View>
146
164
  ) }
147
165
  { layoutSupportEnabled && ! showPlaceholder && (
148
166
  <TagName { ...innerBlocksProps } />
@@ -47,6 +47,17 @@ const getGroupPlaceholderIcons = ( name = 'group' ) => {
47
47
  <Path d="M42 0H2C.9 0 0 .9 0 2v12.5c0 .6.4 1 1 1h42c.6 0 1-.4 1-1V2c0-1.1-.9-2-2-2zm1 16.5H1c-.6 0-1 .4-1 1V30c0 1.1.9 2 2 2h40c1.1 0 2-.9 2-2V17.5c0-.6-.4-1-1-1z" />
48
48
  </SVG>
49
49
  ),
50
+ 'group-grid': (
51
+ <SVG
52
+ xmlns="http://www.w3.org/2000/svg"
53
+ width="44"
54
+ height="32"
55
+ viewBox="0 0 44 32"
56
+ >
57
+ <Path d="m20.30137,-0.00025l-18.9728,0c-0.86524,0.07234 -1.41711,0.79149 -1.41711,1.89149l0,12.64468c0,0.6 0.73401,0.96383 1.0304,0.96383l19.67469,0.03617c0.29639,0 1.0304,-0.4 1.0304,-1l-0.03576,-12.7532c0,-1.1 -0.76644,-1.78297 -1.30983,-1.78297zm0.52975,16.60851l-19.99654,-0.03617c-0.29639,0 -0.92312,0.36383 -0.92312,0.96383l-0.03576,12.68085c0,1.1 0.8022,1.81915 1.34559,1.81915l19.00857,0c0.54339,0 1.45287,-0.71915 1.45287,-1.81915l0,-12.53617c0,-0.6 -0.5552,-1.07234 -0.8516,-1.07234z" />
58
+ <Path d="m42.73056,-0.03617l-18.59217,0c-0.84788,0.07234 -1.38868,0.79149 -1.38868,1.89149l0,12.64468c0,0.6 0.71928,0.96383 1.00973,0.96383l19.27997,0.03617c0.29045,0 1.00973,-0.4 1.00973,-1l-0.03504,-12.7532c0,-1.1 -0.75106,-1.78297 -1.28355,-1.78297zm0.51912,16.60851l-19.59537,-0.03617c-0.29045,0 -0.9046,0.36383 -0.9046,0.96383l-0.03504,12.68085c0,1.1 0.78611,1.81915 1.31859,1.81915l18.62721,0c0.53249,0 1.42372,-0.71915 1.42372,-1.81915l0,-12.53617c0,-0.6 -0.54407,-1.07234 -0.83451,-1.07234z" />
59
+ </SVG>
60
+ ),
50
61
  };
51
62
  return icons?.[ name ];
52
63
  };
@@ -85,7 +96,8 @@ export function useShouldShowPlaceHolder( {
85
96
  ! fontSize &&
86
97
  ! textColor &&
87
98
  ! style &&
88
- usedLayoutType !== 'flex'
99
+ usedLayoutType !== 'flex' &&
100
+ usedLayoutType !== 'grid'
89
101
  );
90
102
 
91
103
  useEffect( () => {
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __, _x } from '@wordpress/i18n';
5
- import { group, row, stack } from '@wordpress/icons';
5
+ import { group, row, stack, grid } from '@wordpress/icons';
6
6
 
7
7
  const variations = [
8
8
  {
@@ -44,4 +44,17 @@ const variations = [
44
44
  },
45
45
  ];
46
46
 
47
+ if ( window?.__experimentalEnableGroupGridVariation ) {
48
+ variations.push( {
49
+ name: 'group-grid',
50
+ title: __( 'Grid' ),
51
+ description: __( 'Arrange blocks in a grid.' ),
52
+ attributes: { layout: { type: 'grid' } },
53
+ scope: [ 'block', 'inserter', 'transform' ],
54
+ isActive: ( blockAttributes ) =>
55
+ blockAttributes.layout?.type === 'grid',
56
+ icon: grid,
57
+ } );
58
+ }
59
+
47
60
  export default variations;
@@ -98,12 +98,12 @@ function block_core_home_link_build_li_wrapper_attributes( $context ) {
98
98
  $colors['css_classes'],
99
99
  $font_sizes['css_classes']
100
100
  );
101
+ $classes[] = 'wp-block-navigation-item';
101
102
  $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] );
102
- $css_classes = trim( implode( ' ', $classes ) ) . ' wp-block-navigation-item';
103
103
 
104
104
  $wrapper_attributes = get_block_wrapper_attributes(
105
105
  array(
106
- 'class' => $css_classes,
106
+ 'class' => implode( ' ', $classes ),
107
107
  'style' => $style_attribute,
108
108
  )
109
109
  );
@@ -85,15 +85,16 @@
85
85
  "supports": {
86
86
  "anchor": true,
87
87
  "color": {
88
- "__experimentalDuotone": "img, .components-placeholder",
89
88
  "text": false,
90
89
  "background": false
91
90
  },
91
+ "filter": {
92
+ "duotone": true
93
+ },
92
94
  "__experimentalBorder": {
93
95
  "color": true,
94
96
  "radius": true,
95
97
  "width": true,
96
- "__experimentalSelector": "img, .wp-block-image__crop-area",
97
98
  "__experimentalSkipSerialization": true,
98
99
  "__experimentalDefaultControls": {
99
100
  "color": true,
@@ -102,6 +103,12 @@
102
103
  }
103
104
  }
104
105
  },
106
+ "selectors": {
107
+ "border": ".wp-block-image img, .wp-block-image .wp-block-image__crop-area",
108
+ "filter": {
109
+ "duotone": ".wp-block-image img, .wp-block-image .components-placeholder"
110
+ }
111
+ },
105
112
  "styles": [
106
113
  {
107
114
  "name": "default",
package/src/image/edit.js CHANGED
@@ -211,7 +211,7 @@ export function ImageEdit( {
211
211
  : 'full',
212
212
  };
213
213
  } else {
214
- // Keep the same url when selecting the same file, so "Image Size"
214
+ // Keep the same url when selecting the same file, so "Resolution"
215
215
  // option is not changed.
216
216
  additionalAttributes = { url };
217
217
  }