@wordpress/block-library 8.30.0 → 8.32.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 (362) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/block/edit.js +22 -16
  3. package/build/block/edit.js.map +1 -1
  4. package/build/button/edit.native.js +1 -1
  5. package/build/button/edit.native.js.map +1 -1
  6. package/build/code/save.js +3 -1
  7. package/build/code/save.js.map +1 -1
  8. package/build/cover/edit/index.js +2 -1
  9. package/build/cover/edit/index.js.map +1 -1
  10. package/build/details/edit.js +1 -0
  11. package/build/details/edit.js.map +1 -1
  12. package/build/file/edit.js +2 -0
  13. package/build/file/edit.js.map +1 -1
  14. package/build/heading/index.js +4 -3
  15. package/build/heading/index.js.map +1 -1
  16. package/build/image/edit.js +10 -39
  17. package/build/image/edit.js.map +1 -1
  18. package/build/image/image.js +27 -6
  19. package/build/image/image.js.map +1 -1
  20. package/build/media-text/edit.js +33 -9
  21. package/build/media-text/edit.js.map +1 -1
  22. package/build/media-text/index.js +5 -0
  23. package/build/media-text/index.js.map +1 -1
  24. package/build/media-text/media-container.js +30 -11
  25. package/build/media-text/media-container.js.map +1 -1
  26. package/build/media-text/save.js +2 -2
  27. package/build/media-text/save.js.map +1 -1
  28. package/build/navigation/edit/index.js +23 -29
  29. package/build/navigation/edit/index.js.map +1 -1
  30. package/build/navigation/edit/navigation-menu-delete-control.js +12 -20
  31. package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  32. package/build/navigation/edit/navigation-menu-selector.js +24 -23
  33. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  34. package/build/navigation/edit/placeholder/index.js +4 -4
  35. package/build/navigation/edit/placeholder/index.js.map +1 -1
  36. package/build/navigation/use-navigation-menu.js +15 -12
  37. package/build/navigation/use-navigation-menu.js.map +1 -1
  38. package/build/navigation/view.js +12 -2
  39. package/build/navigation/view.js.map +1 -1
  40. package/build/navigation-link/edit.js +52 -27
  41. package/build/navigation-link/edit.js.map +1 -1
  42. package/build/navigation-submenu/edit.js +31 -9
  43. package/build/navigation-submenu/edit.js.map +1 -1
  44. package/build/pattern/edit.js +3 -1
  45. package/build/pattern/edit.js.map +1 -1
  46. package/build/post-author/edit.js +1 -0
  47. package/build/post-author/edit.js.map +1 -1
  48. package/build/post-excerpt/edit.js +1 -0
  49. package/build/post-excerpt/edit.js.map +1 -1
  50. package/build/post-featured-image/edit.js +16 -4
  51. package/build/post-featured-image/edit.js.map +1 -1
  52. package/build/post-featured-image/index.js +13 -2
  53. package/build/post-featured-image/index.js.map +1 -1
  54. package/build/post-featured-image/overlay-controls.js +82 -0
  55. package/build/post-featured-image/overlay-controls.js.map +1 -0
  56. package/build/post-featured-image/overlay.js +5 -54
  57. package/build/post-featured-image/overlay.js.map +1 -1
  58. package/build/post-navigation-link/edit.js +1 -0
  59. package/build/post-navigation-link/edit.js.map +1 -1
  60. package/build/post-terms/edit.js +2 -0
  61. package/build/post-terms/edit.js.map +1 -1
  62. package/build/quote/edit.js +18 -23
  63. package/build/quote/edit.js.map +1 -1
  64. package/build/read-more/edit.js +1 -0
  65. package/build/read-more/edit.js.map +1 -1
  66. package/build/search/edit.js +2 -0
  67. package/build/search/edit.js.map +1 -1
  68. package/build/search/edit.native.js +2 -2
  69. package/build/search/edit.native.js.map +1 -1
  70. package/build/site-tagline/edit.js +13 -4
  71. package/build/site-tagline/edit.js.map +1 -1
  72. package/build/site-tagline/index.js +4 -0
  73. package/build/site-tagline/index.js.map +1 -1
  74. package/build/social-link/edit.js +1 -1
  75. package/build/social-link/edit.js.map +1 -1
  76. package/build/social-link/icons/medium.js +1 -1
  77. package/build/social-link/icons/medium.js.map +1 -1
  78. package/build/social-link/icons/reddit.js +1 -1
  79. package/build/social-link/icons/reddit.js.map +1 -1
  80. package/build/table/deprecated.js +285 -175
  81. package/build/table/deprecated.js.map +1 -1
  82. package/build/table/index.js +1 -1
  83. package/build/template-part/edit/index.js +55 -47
  84. package/build/template-part/edit/index.js.map +1 -1
  85. package/build/template-part/edit/inner-blocks.js +106 -10
  86. package/build/template-part/edit/inner-blocks.js.map +1 -1
  87. package/build/template-part/edit/selection-modal.js +1 -9
  88. package/build/template-part/edit/selection-modal.js.map +1 -1
  89. package/build/utils/caption.js +19 -13
  90. package/build/utils/caption.js.map +1 -1
  91. package/build/utils/hooks.js +1 -0
  92. package/build/utils/hooks.js.map +1 -1
  93. package/build/video/edit.native.js +1 -1
  94. package/build/video/edit.native.js.map +1 -1
  95. package/build-module/block/edit.js +23 -17
  96. package/build-module/block/edit.js.map +1 -1
  97. package/build-module/button/edit.native.js +1 -1
  98. package/build-module/button/edit.native.js.map +1 -1
  99. package/build-module/code/save.js +3 -1
  100. package/build-module/code/save.js.map +1 -1
  101. package/build-module/cover/edit/index.js +2 -1
  102. package/build-module/cover/edit/index.js.map +1 -1
  103. package/build-module/details/edit.js +1 -0
  104. package/build-module/details/edit.js.map +1 -1
  105. package/build-module/file/edit.js +2 -0
  106. package/build-module/file/edit.js.map +1 -1
  107. package/build-module/heading/index.js +4 -3
  108. package/build-module/heading/index.js.map +1 -1
  109. package/build-module/image/edit.js +11 -40
  110. package/build-module/image/edit.js.map +1 -1
  111. package/build-module/image/image.js +27 -6
  112. package/build-module/image/image.js.map +1 -1
  113. package/build-module/media-text/edit.js +34 -10
  114. package/build-module/media-text/edit.js.map +1 -1
  115. package/build-module/media-text/index.js +5 -0
  116. package/build-module/media-text/index.js.map +1 -1
  117. package/build-module/media-text/media-container.js +31 -12
  118. package/build-module/media-text/media-container.js.map +1 -1
  119. package/build-module/media-text/save.js +2 -2
  120. package/build-module/media-text/save.js.map +1 -1
  121. package/build-module/navigation/edit/index.js +24 -30
  122. package/build-module/navigation/edit/index.js.map +1 -1
  123. package/build-module/navigation/edit/navigation-menu-delete-control.js +15 -23
  124. package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
  125. package/build-module/navigation/edit/navigation-menu-selector.js +24 -23
  126. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  127. package/build-module/navigation/edit/placeholder/index.js +4 -4
  128. package/build-module/navigation/edit/placeholder/index.js.map +1 -1
  129. package/build-module/navigation/use-navigation-menu.js +15 -12
  130. package/build-module/navigation/use-navigation-menu.js.map +1 -1
  131. package/build-module/navigation/view.js +12 -2
  132. package/build-module/navigation/view.js.map +1 -1
  133. package/build-module/navigation-link/edit.js +55 -30
  134. package/build-module/navigation-link/edit.js.map +1 -1
  135. package/build-module/navigation-submenu/edit.js +31 -9
  136. package/build-module/navigation-submenu/edit.js.map +1 -1
  137. package/build-module/pattern/edit.js +3 -1
  138. package/build-module/pattern/edit.js.map +1 -1
  139. package/build-module/post-author/edit.js +1 -0
  140. package/build-module/post-author/edit.js.map +1 -1
  141. package/build-module/post-excerpt/edit.js +1 -0
  142. package/build-module/post-excerpt/edit.js.map +1 -1
  143. package/build-module/post-featured-image/edit.js +17 -5
  144. package/build-module/post-featured-image/edit.js.map +1 -1
  145. package/build-module/post-featured-image/index.js +13 -2
  146. package/build-module/post-featured-image/index.js.map +1 -1
  147. package/build-module/post-featured-image/overlay-controls.js +75 -0
  148. package/build-module/post-featured-image/overlay-controls.js.map +1 -0
  149. package/build-module/post-featured-image/overlay.js +7 -56
  150. package/build-module/post-featured-image/overlay.js.map +1 -1
  151. package/build-module/post-navigation-link/edit.js +1 -0
  152. package/build-module/post-navigation-link/edit.js.map +1 -1
  153. package/build-module/post-terms/edit.js +2 -0
  154. package/build-module/post-terms/edit.js.map +1 -1
  155. package/build-module/quote/edit.js +20 -25
  156. package/build-module/quote/edit.js.map +1 -1
  157. package/build-module/read-more/edit.js +1 -0
  158. package/build-module/read-more/edit.js.map +1 -1
  159. package/build-module/search/edit.js +2 -0
  160. package/build-module/search/edit.js.map +1 -1
  161. package/build-module/search/edit.native.js +2 -2
  162. package/build-module/search/edit.native.js.map +1 -1
  163. package/build-module/site-tagline/edit.js +14 -5
  164. package/build-module/site-tagline/edit.js.map +1 -1
  165. package/build-module/site-tagline/index.js +4 -0
  166. package/build-module/site-tagline/index.js.map +1 -1
  167. package/build-module/social-link/edit.js +1 -1
  168. package/build-module/social-link/edit.js.map +1 -1
  169. package/build-module/social-link/icons/medium.js +1 -1
  170. package/build-module/social-link/icons/medium.js.map +1 -1
  171. package/build-module/social-link/icons/reddit.js +1 -1
  172. package/build-module/social-link/icons/reddit.js.map +1 -1
  173. package/build-module/table/deprecated.js +286 -176
  174. package/build-module/table/deprecated.js.map +1 -1
  175. package/build-module/table/index.js +1 -1
  176. package/build-module/template-part/edit/index.js +58 -50
  177. package/build-module/template-part/edit/index.js.map +1 -1
  178. package/build-module/template-part/edit/inner-blocks.js +108 -12
  179. package/build-module/template-part/edit/inner-blocks.js.map +1 -1
  180. package/build-module/template-part/edit/selection-modal.js +2 -10
  181. package/build-module/template-part/edit/selection-modal.js.map +1 -1
  182. package/build-module/utils/caption.js +19 -13
  183. package/build-module/utils/caption.js.map +1 -1
  184. package/build-module/utils/hooks.js +1 -0
  185. package/build-module/utils/hooks.js.map +1 -1
  186. package/build-module/video/edit.native.js +1 -1
  187. package/build-module/video/edit.native.js.map +1 -1
  188. package/build-style/audio/theme-rtl.css +1 -1
  189. package/build-style/audio/theme.css +1 -1
  190. package/build-style/cover/style-rtl.css +5 -2
  191. package/build-style/cover/style.css +5 -2
  192. package/build-style/editor-rtl.css +22 -12
  193. package/build-style/editor.css +22 -12
  194. package/build-style/embed/theme-rtl.css +1 -1
  195. package/build-style/embed/theme.css +1 -1
  196. package/build-style/file/editor-rtl.css +3 -0
  197. package/build-style/file/editor.css +3 -0
  198. package/build-style/image/editor-rtl.css +0 -3
  199. package/build-style/image/editor.css +0 -3
  200. package/build-style/image/theme-rtl.css +1 -1
  201. package/build-style/image/theme.css +1 -1
  202. package/build-style/media-text/editor-rtl.css +7 -1
  203. package/build-style/media-text/editor.css +7 -1
  204. package/build-style/pullquote/theme-rtl.css +2 -1
  205. package/build-style/pullquote/theme.css +2 -1
  206. package/build-style/quote/theme-rtl.css +6 -6
  207. package/build-style/quote/theme.css +6 -6
  208. package/build-style/search/style-rtl.css +10 -0
  209. package/build-style/search/style.css +10 -0
  210. package/build-style/social-links/editor-rtl.css +0 -4
  211. package/build-style/social-links/editor.css +0 -4
  212. package/build-style/social-links/style-rtl.css +2 -2
  213. package/build-style/social-links/style.css +2 -2
  214. package/build-style/style-rtl.css +17 -4
  215. package/build-style/style.css +17 -4
  216. package/build-style/table/theme-rtl.css +4 -3
  217. package/build-style/table/theme.css +4 -3
  218. package/build-style/template-part/editor-rtl.css +12 -4
  219. package/build-style/template-part/editor.css +12 -4
  220. package/build-style/template-part/theme-rtl.css +1 -1
  221. package/build-style/template-part/theme.css +1 -1
  222. package/build-style/theme-rtl.css +17 -15
  223. package/build-style/theme.css +17 -15
  224. package/build-style/video/theme-rtl.css +1 -1
  225. package/build-style/video/theme.css +1 -1
  226. package/package.json +34 -34
  227. package/src/archives/index.php +4 -0
  228. package/src/audio/theme.scss +1 -1
  229. package/src/avatar/index.php +6 -0
  230. package/src/block/edit.js +43 -32
  231. package/src/block/index.php +4 -0
  232. package/src/block/test/edit.native.js +67 -0
  233. package/src/button/edit.native.js +1 -1
  234. package/src/calendar/index.php +12 -0
  235. package/src/categories/index.php +6 -0
  236. package/src/code/save.js +7 -1
  237. package/src/comment-author-name/index.php +4 -0
  238. package/src/comment-content/index.php +4 -0
  239. package/src/comment-date/index.php +4 -0
  240. package/src/comment-edit-link/index.php +4 -0
  241. package/src/comment-reply-link/index.php +4 -0
  242. package/src/comment-template/index.php +4 -0
  243. package/src/comments/index.php +10 -0
  244. package/src/comments-pagination/index.php +4 -0
  245. package/src/comments-pagination-next/index.php +4 -0
  246. package/src/comments-pagination-numbers/index.php +4 -0
  247. package/src/comments-pagination-previous/index.php +4 -0
  248. package/src/comments-title/index.php +4 -0
  249. package/src/cover/edit/index.js +4 -1
  250. package/src/cover/index.php +4 -0
  251. package/src/cover/style.scss +6 -2
  252. package/src/details/edit.js +1 -0
  253. package/src/embed/theme.scss +1 -1
  254. package/src/file/edit.js +2 -0
  255. package/src/file/editor.scss +3 -0
  256. package/src/file/index.php +4 -0
  257. package/src/gallery/editor.scss +1 -1
  258. package/src/gallery/index.php +7 -1
  259. package/src/heading/index.js +4 -3
  260. package/src/heading/index.php +4 -0
  261. package/src/home-link/index.php +10 -0
  262. package/src/image/edit.js +11 -40
  263. package/src/image/editor.scss +2 -7
  264. package/src/image/image.js +25 -7
  265. package/src/image/index.php +12 -1
  266. package/src/image/theme.scss +1 -1
  267. package/src/latest-comments/index.php +4 -0
  268. package/src/latest-posts/index.php +8 -0
  269. package/src/loginout/index.php +4 -0
  270. package/src/media-text/block.json +5 -0
  271. package/src/media-text/edit.js +70 -19
  272. package/src/media-text/editor.scss +7 -1
  273. package/src/media-text/index.php +70 -0
  274. package/src/media-text/media-container.js +49 -9
  275. package/src/media-text/save.js +2 -2
  276. package/src/navigation/edit/index.js +67 -71
  277. package/src/navigation/edit/navigation-menu-delete-control.js +22 -49
  278. package/src/navigation/edit/navigation-menu-selector.js +39 -21
  279. package/src/navigation/edit/placeholder/index.js +4 -4
  280. package/src/navigation/edit/test/navigation-menu-selector.js +75 -53
  281. package/src/navigation/index.php +109 -26
  282. package/src/navigation/test/use-navigation-menu.js +21 -21
  283. package/src/navigation/use-navigation-menu.js +23 -9
  284. package/src/navigation/view.js +11 -2
  285. package/src/navigation-link/edit.js +64 -39
  286. package/src/navigation-link/index.php +14 -0
  287. package/src/navigation-submenu/edit.js +34 -10
  288. package/src/navigation-submenu/index.php +8 -0
  289. package/src/page-list/index.php +12 -0
  290. package/src/page-list-item/index.php +2 -0
  291. package/src/pattern/edit.js +4 -0
  292. package/src/pattern/index.php +2 -0
  293. package/src/post-author/edit.js +1 -0
  294. package/src/post-author/index.php +4 -0
  295. package/src/post-author-biography/index.php +4 -0
  296. package/src/post-author-name/index.php +4 -0
  297. package/src/post-comments-form/index.php +6 -0
  298. package/src/post-content/index.php +4 -0
  299. package/src/post-date/index.php +4 -0
  300. package/src/post-excerpt/edit.js +1 -0
  301. package/src/post-excerpt/index.php +4 -0
  302. package/src/post-featured-image/block.json +13 -2
  303. package/src/post-featured-image/edit.js +16 -1
  304. package/src/post-featured-image/editor.scss +1 -1
  305. package/src/post-featured-image/index.php +15 -0
  306. package/src/post-featured-image/overlay-controls.js +88 -0
  307. package/src/post-featured-image/overlay.js +17 -84
  308. package/src/post-navigation-link/edit.js +1 -0
  309. package/src/post-navigation-link/index.php +4 -0
  310. package/src/post-template/index.php +4 -0
  311. package/src/post-terms/edit.js +2 -0
  312. package/src/post-terms/index.php +6 -0
  313. package/src/post-title/index.php +2 -0
  314. package/src/pullquote/theme.scss +3 -1
  315. package/src/query/index.php +2 -0
  316. package/src/query-no-results/index.php +6 -0
  317. package/src/query-pagination/index.php +4 -0
  318. package/src/query-pagination-next/index.php +6 -0
  319. package/src/query-pagination-numbers/index.php +6 -0
  320. package/src/query-pagination-previous/index.php +4 -0
  321. package/src/query-title/index.php +4 -0
  322. package/src/quote/edit.js +27 -37
  323. package/src/quote/test/edit.native.js +4 -6
  324. package/src/quote/theme.scss +1 -2
  325. package/src/read-more/edit.js +1 -0
  326. package/src/read-more/index.php +4 -0
  327. package/src/rss/index.php +4 -0
  328. package/src/search/edit.js +2 -0
  329. package/src/search/edit.native.js +2 -2
  330. package/src/search/index.php +19 -1
  331. package/src/search/style.scss +11 -0
  332. package/src/shortcode/index.php +4 -0
  333. package/src/site-logo/editor.scss +2 -2
  334. package/src/site-logo/index.php +20 -0
  335. package/src/site-tagline/block.json +4 -0
  336. package/src/site-tagline/edit.js +16 -3
  337. package/src/site-tagline/index.php +13 -1
  338. package/src/site-title/index.php +4 -0
  339. package/src/social-link/edit.js +1 -1
  340. package/src/social-link/icons/medium.js +1 -1
  341. package/src/social-link/icons/reddit.js +1 -1
  342. package/src/social-link/index.php +22 -9
  343. package/src/social-link/socials-with-bg.scss +1 -1
  344. package/src/social-link/socials-without-bg.scss +1 -1
  345. package/src/social-links/editor.scss +1 -9
  346. package/src/table/block.json +1 -1
  347. package/src/table/deprecated.js +308 -175
  348. package/src/table/theme.scss +4 -2
  349. package/src/tag-cloud/index.php +4 -0
  350. package/src/template-part/edit/index.js +87 -79
  351. package/src/template-part/edit/inner-blocks.js +126 -13
  352. package/src/template-part/edit/selection-modal.js +1 -22
  353. package/src/template-part/editor.scss +11 -3
  354. package/src/template-part/index.php +12 -0
  355. package/src/template-part/theme.scss +1 -1
  356. package/src/term-description/index.php +4 -0
  357. package/src/utils/caption.js +19 -16
  358. package/src/utils/hooks.js +1 -0
  359. package/src/video/edit.native.js +2 -0
  360. package/src/video/editor.scss +2 -2
  361. package/src/video/theme.scss +1 -1
  362. package/tsconfig.json +1 -0
@@ -9,6 +9,8 @@
9
9
  * Build an array with CSS classes and inline styles defining the colors
10
10
  * which will be applied to the pages markup in the front-end when it is a descendant of navigation.
11
11
  *
12
+ * @since 5.8.0
13
+ *
12
14
  * @param array $attributes Block attributes.
13
15
  * @param array $context Navigation block context.
14
16
  * @return array Colors CSS classes and inline styles.
@@ -101,6 +103,8 @@ function block_core_page_list_build_css_colors( $attributes, $context ) {
101
103
  * Build an array with CSS classes and inline styles defining the font sizes
102
104
  * which will be applied to the pages markup in the front-end when it is a descendant of navigation.
103
105
  *
106
+ * @since 5.8.0
107
+ *
104
108
  * @param array $context Navigation block context.
105
109
  * @return array Font size CSS classes and inline styles.
106
110
  */
@@ -135,6 +139,8 @@ function block_core_page_list_build_css_font_sizes( $context ) {
135
139
  /**
136
140
  * Outputs Page list markup from an array of pages with nested children.
137
141
  *
142
+ * @since 5.8.0
143
+ *
138
144
  * @param boolean $open_submenus_on_click Whether to open submenus on click instead of hover.
139
145
  * @param boolean $show_submenu_icons Whether to show submenu indicator icons.
140
146
  * @param boolean $is_navigation_child If block is a child of Navigation block.
@@ -220,6 +226,8 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
220
226
  /**
221
227
  * Outputs nested array of pages
222
228
  *
229
+ * @since 5.8.0
230
+ *
223
231
  * @param array $current_level The level being iterated through.
224
232
  * @param array $children The children grouped by parent post ID.
225
233
  *
@@ -240,6 +248,8 @@ function block_core_page_list_nest_pages( $current_level, $children ) {
240
248
  /**
241
249
  * Renders the `core/page-list` block on server.
242
250
  *
251
+ * @since 5.8.0
252
+ *
243
253
  * @param array $attributes The block attributes.
244
254
  * @param string $content The saved content.
245
255
  * @param WP_Block $block The parsed block.
@@ -345,6 +355,8 @@ function render_block_core_page_list( $attributes, $content, $block ) {
345
355
 
346
356
  /**
347
357
  * Registers the `core/pages` block on server.
358
+ *
359
+ * @since 5.8.0
348
360
  */
349
361
  function register_block_core_page_list() {
350
362
  register_block_type_from_metadata(
@@ -7,6 +7,8 @@
7
7
 
8
8
  /**
9
9
  * Registers the `core/page-list-item` block on server.
10
+ *
11
+ * @since 6.3.0
10
12
  */
11
13
  function register_block_core_page_list_item() {
12
14
  register_block_type_from_metadata( __DIR__ . '/page-list-item' );
@@ -108,6 +108,10 @@ const PatternEdit = ( { attributes, clientId } ) => {
108
108
  metadata: {
109
109
  ...clonedBlocks[ 0 ].attributes.metadata,
110
110
  categories: selectedPattern.categories,
111
+ patternName: selectedPattern.name,
112
+ name:
113
+ clonedBlocks[ 0 ].attributes.metadata.name ||
114
+ selectedPattern.title,
111
115
  },
112
116
  };
113
117
  }
@@ -7,6 +7,8 @@
7
7
 
8
8
  /**
9
9
  * Registers the `core/pattern` block on the server.
10
+ *
11
+ * @since 5.9.0
10
12
  */
11
13
  function register_block_core_pattern() {
12
14
  register_block_type_from_metadata(
@@ -195,6 +195,7 @@ function PostAuthorEdit( {
195
195
  <div className="wp-block-post-author__content">
196
196
  { ( ! RichText.isEmpty( byline ) || isSelected ) && (
197
197
  <RichText
198
+ identifier="byline"
198
199
  className="wp-block-post-author__byline"
199
200
  aria-label={ __( 'Post author byline text' ) }
200
201
  placeholder={ __( 'Write byline…' ) }
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-author` block on the server.
10
10
  *
11
+ * @since 5.9.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -61,6 +63,8 @@ function render_block_core_post_author( $attributes, $content, $block ) {
61
63
 
62
64
  /**
63
65
  * Registers the `core/post-author` block on the server.
66
+ *
67
+ * @since 5.9.0
64
68
  */
65
69
  function register_block_core_post_author() {
66
70
  register_block_type_from_metadata(
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-author-biography` block on the server.
10
10
  *
11
+ * @since 6.0.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -37,6 +39,8 @@ function render_block_core_post_author_biography( $attributes, $content, $block
37
39
 
38
40
  /**
39
41
  * Registers the `core/post-author-biography` block on the server.
42
+ *
43
+ * @since 6.0.0
40
44
  */
41
45
  function register_block_core_post_author_biography() {
42
46
  register_block_type_from_metadata(
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-author-name` block on the server.
10
10
  *
11
+ * @since 6.2.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -43,6 +45,8 @@ function render_block_core_post_author_name( $attributes, $content, $block ) {
43
45
 
44
46
  /**
45
47
  * Registers the `core/post-author-name` block on the server.
48
+ *
49
+ * @since 6.2.0
46
50
  */
47
51
  function register_block_core_post_author_name() {
48
52
  register_block_type_from_metadata(
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-comments-form` block on the server.
10
10
  *
11
+ * @since 6.0.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -54,6 +56,8 @@ function render_block_core_post_comments_form( $attributes, $content, $block ) {
54
56
 
55
57
  /**
56
58
  * Registers the `core/post-comments-form` block on the server.
59
+ *
60
+ * @since 6.0.0
57
61
  */
58
62
  function register_block_core_post_comments_form() {
59
63
  register_block_type_from_metadata(
@@ -68,6 +72,8 @@ add_action( 'init', 'register_block_core_post_comments_form' );
68
72
  /**
69
73
  * Use the button block classes for the form-submit button.
70
74
  *
75
+ * @since 6.0.0
76
+ *
71
77
  * @param array $fields The default comment form arguments.
72
78
  *
73
79
  * @return array Returns the modified fields.
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-content` block on the server.
10
10
  *
11
+ * @since 5.8.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -63,6 +65,8 @@ function render_block_core_post_content( $attributes, $content, $block ) {
63
65
 
64
66
  /**
65
67
  * Registers the `core/post-content` block on the server.
68
+ *
69
+ * @since 5.8.0
66
70
  */
67
71
  function register_block_core_post_content() {
68
72
  register_block_type_from_metadata(
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-date` block on the server.
10
10
  *
11
+ * @since 5.8.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -60,6 +62,8 @@ function render_block_core_post_date( $attributes, $content, $block ) {
60
62
 
61
63
  /**
62
64
  * Registers the `core/post-date` block on the server.
65
+ *
66
+ * @since 5.8.0
63
67
  */
64
68
  function register_block_core_post_date() {
65
69
  register_block_type_from_metadata(
@@ -127,6 +127,7 @@ export default function PostExcerptEditor( {
127
127
  }
128
128
  const readMoreLink = (
129
129
  <RichText
130
+ identifier="moreText"
130
131
  className="wp-block-post-excerpt__more-link"
131
132
  tagName="a"
132
133
  aria-label={ __( '“Read more” link text' ) }
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-excerpt` block on the server.
10
10
  *
11
+ * @since 5.8.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -66,6 +68,8 @@ function render_block_core_post_excerpt( $attributes, $content, $block ) {
66
68
 
67
69
  /**
68
70
  * Registers the `core/post-excerpt` block on the server.
71
+ *
72
+ * @since 5.8.0
69
73
  */
70
74
  function register_block_core_post_excerpt() {
71
75
  register_block_type_from_metadata(
@@ -61,7 +61,6 @@
61
61
  "supports": {
62
62
  "align": [ "left", "right", "center", "wide", "full" ],
63
63
  "color": {
64
- "__experimentalDuotone": "img, .wp-block-post-featured-image__placeholder, .components-placeholder__illustration, .components-placeholder::before",
65
64
  "text": false,
66
65
  "background": false
67
66
  },
@@ -69,7 +68,6 @@
69
68
  "color": true,
70
69
  "radius": true,
71
70
  "width": true,
72
- "__experimentalSelector": "img, .block-editor-media-placeholder, .wp-block-post-featured-image__overlay",
73
71
  "__experimentalSkipSerialization": true,
74
72
  "__experimentalDefaultControls": {
75
73
  "color": true,
@@ -77,6 +75,12 @@
77
75
  "width": true
78
76
  }
79
77
  },
78
+ "filter": {
79
+ "duotone": true
80
+ },
81
+ "shadow": {
82
+ "__experimentalSkipSerialization": true
83
+ },
80
84
  "html": false,
81
85
  "spacing": {
82
86
  "margin": true,
@@ -86,6 +90,13 @@
86
90
  "clientNavigation": true
87
91
  }
88
92
  },
93
+ "selectors": {
94
+ "border": ".wp-block-post-featured-image img, .wp-block-post-featured-image .block-editor-media-placeholder, .wp-block-post-featured-image .wp-block-post-featured-image__overlay",
95
+ "shadow": ".wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder",
96
+ "filter": {
97
+ "duotone": ".wp-block-post-featured-image img, .wp-block-post-featured-image .wp-block-post-featured-image__placeholder, .wp-block-post-featured-image .components-placeholder__illustration, .wp-block-post-featured-image .components-placeholder::before"
98
+ }
99
+ },
89
100
  "editorStyle": "wp-block-post-featured-image-editor",
90
101
  "style": "wp-block-post-featured-image"
91
102
  }
@@ -24,6 +24,7 @@ import {
24
24
  useBlockProps,
25
25
  store as blockEditorStore,
26
26
  __experimentalUseBorderProps as useBorderProps,
27
+ __experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles,
27
28
  useBlockEditingMode,
28
29
  } from '@wordpress/block-editor';
29
30
  import { useMemo } from '@wordpress/element';
@@ -35,6 +36,7 @@ import { store as noticesStore } from '@wordpress/notices';
35
36
  * Internal dependencies
36
37
  */
37
38
  import DimensionControls from './dimension-controls';
39
+ import OverlayControls from './overlay-controls';
38
40
  import Overlay from './overlay';
39
41
 
40
42
  const ALLOWED_MEDIA_TYPES = [ 'image' ];
@@ -144,6 +146,7 @@ export default function PostFeaturedImageEdit( {
144
146
  style: { width, height, aspectRatio },
145
147
  } );
146
148
  const borderProps = useBorderProps( attributes );
149
+ const shadowProps = getShadowClassesAndStyles( attributes );
147
150
  const blockEditingMode = useBlockEditingMode();
148
151
 
149
152
  const placeholder = ( content ) => {
@@ -158,6 +161,7 @@ export default function PostFeaturedImageEdit( {
158
161
  height: !! aspectRatio && '100%',
159
162
  width: !! aspectRatio && '100%',
160
163
  ...borderProps.style,
164
+ ...shadowProps.style,
161
165
  } }
162
166
  >
163
167
  { content }
@@ -178,7 +182,7 @@ export default function PostFeaturedImageEdit( {
178
182
 
179
183
  const controls = blockEditingMode === 'default' && (
180
184
  <>
181
- <Overlay
185
+ <OverlayControls
182
186
  attributes={ attributes }
183
187
  setAttributes={ setAttributes }
184
188
  clientId={ clientId }
@@ -259,6 +263,11 @@ export default function PostFeaturedImageEdit( {
259
263
  ) : (
260
264
  placeholder()
261
265
  ) }
266
+ <Overlay
267
+ attributes={ attributes }
268
+ setAttributes={ setAttributes }
269
+ clientId={ clientId }
270
+ />
262
271
  </div>
263
272
  </>
264
273
  );
@@ -267,6 +276,7 @@ export default function PostFeaturedImageEdit( {
267
276
  const label = __( 'Add a featured image' );
268
277
  const imageStyles = {
269
278
  ...borderProps.style,
279
+ ...shadowProps.style,
270
280
  height: aspectRatio ? '100%' : height,
271
281
  width: !! aspectRatio && '100%',
272
282
  objectFit: !! ( height || aspectRatio ) && scale,
@@ -363,6 +373,11 @@ export default function PostFeaturedImageEdit( {
363
373
  ) : (
364
374
  image
365
375
  ) }
376
+ <Overlay
377
+ attributes={ attributes }
378
+ setAttributes={ setAttributes }
379
+ clientId={ clientId }
380
+ />
366
381
  </figure>
367
382
  </>
368
383
  );
@@ -1,5 +1,5 @@
1
1
  // Provide special styling for the placeholder.
2
- // @todo: this particular minimal style of placeholder could be componentized further.
2
+ // @todo this particular minimal style of placeholder could be componentized further.
3
3
  .wp-block-post-featured-image {
4
4
  .block-editor-media-placeholder {
5
5
  z-index: 1; // Need to put it above the overlay so the upload button works.
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-featured-image` block on the server.
10
10
  *
11
+ * @since 5.8.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  * @param WP_Block $block Block instance.
@@ -48,6 +50,13 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
48
50
  if ( ! empty( $attributes['scale'] ) ) {
49
51
  $extra_styles .= "object-fit:{$attributes['scale']};";
50
52
  }
53
+ if ( ! empty( $attributes['style']['shadow'] ) ) {
54
+ $shadow_styles = wp_style_engine_get_styles( array( 'shadow' => $attributes['style']['shadow'] ) );
55
+
56
+ if ( ! empty( $shadow_styles['css'] ) ) {
57
+ $extra_styles .= $shadow_styles['css'];
58
+ }
59
+ }
51
60
 
52
61
  if ( ! empty( $extra_styles ) ) {
53
62
  $attr['style'] = empty( $attr['style'] ) ? $extra_styles : $attr['style'] . $extra_styles;
@@ -125,6 +134,8 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
125
134
  /**
126
135
  * Generate markup for the HTML element that will be used for the overlay.
127
136
  *
137
+ * @since 6.1.0
138
+ *
128
139
  * @param array $attributes Block attributes.
129
140
  *
130
141
  * @return string HTML markup in string format.
@@ -191,6 +202,8 @@ function get_block_core_post_featured_image_overlay_element_markup( $attributes
191
202
  * Generates class names and styles to apply the border support styles for
192
203
  * the Post Featured Image block.
193
204
  *
205
+ * @since 6.1.0
206
+ *
194
207
  * @param array $attributes The block attributes.
195
208
  * @return array The border-related classnames and styles for the block.
196
209
  */
@@ -241,6 +254,8 @@ function get_block_core_post_featured_image_border_attributes( $attributes ) {
241
254
 
242
255
  /**
243
256
  * Registers the `core/post-featured-image` block on the server.
257
+ *
258
+ * @since 5.8.0
244
259
  */
245
260
  function register_block_core_post_featured_image() {
246
261
  register_block_type_from_metadata(
@@ -0,0 +1,88 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import {
5
+ RangeControl,
6
+ __experimentalToolsPanelItem as ToolsPanelItem,
7
+ } from '@wordpress/components';
8
+ import {
9
+ InspectorControls,
10
+ withColors,
11
+ __experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,
12
+ __experimentalUseGradient,
13
+ __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,
14
+ } from '@wordpress/block-editor';
15
+ import { compose } from '@wordpress/compose';
16
+ import { __ } from '@wordpress/i18n';
17
+
18
+ const Overlay = ( {
19
+ clientId,
20
+ attributes,
21
+ setAttributes,
22
+ overlayColor,
23
+ setOverlayColor,
24
+ } ) => {
25
+ const { dimRatio } = attributes;
26
+ const { gradientValue, setGradient } = __experimentalUseGradient();
27
+ const colorGradientSettings = useMultipleOriginColorsAndGradients();
28
+
29
+ if ( ! colorGradientSettings.hasColorsOrGradients ) {
30
+ return null;
31
+ }
32
+
33
+ return (
34
+ <InspectorControls group="color">
35
+ <ColorGradientSettingsDropdown
36
+ __experimentalIsRenderedInSidebar
37
+ settings={ [
38
+ {
39
+ colorValue: overlayColor.color,
40
+ gradientValue,
41
+ label: __( 'Overlay' ),
42
+ onColorChange: setOverlayColor,
43
+ onGradientChange: setGradient,
44
+ isShownByDefault: true,
45
+ resetAllFilter: () => ( {
46
+ overlayColor: undefined,
47
+ customOverlayColor: undefined,
48
+ gradient: undefined,
49
+ customGradient: undefined,
50
+ } ),
51
+ },
52
+ ] }
53
+ panelId={ clientId }
54
+ { ...colorGradientSettings }
55
+ />
56
+ <ToolsPanelItem
57
+ hasValue={ () => dimRatio !== undefined }
58
+ label={ __( 'Overlay opacity' ) }
59
+ onDeselect={ () => setAttributes( { dimRatio: 0 } ) }
60
+ resetAllFilter={ () => ( {
61
+ dimRatio: 0,
62
+ } ) }
63
+ isShownByDefault
64
+ panelId={ clientId }
65
+ >
66
+ <RangeControl
67
+ __nextHasNoMarginBottom
68
+ label={ __( 'Overlay opacity' ) }
69
+ value={ dimRatio }
70
+ onChange={ ( newDimRatio ) =>
71
+ setAttributes( {
72
+ dimRatio: newDimRatio,
73
+ } )
74
+ }
75
+ min={ 0 }
76
+ max={ 100 }
77
+ step={ 10 }
78
+ required
79
+ __next40pxDefaultSize
80
+ />
81
+ </ToolsPanelItem>
82
+ </InspectorControls>
83
+ );
84
+ };
85
+
86
+ export default compose( [
87
+ withColors( { overlayColor: 'background-color' } ),
88
+ ] )( Overlay );
@@ -7,35 +7,21 @@ import classnames from 'classnames';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import {
10
- RangeControl,
11
- __experimentalToolsPanelItem as ToolsPanelItem,
12
- } from '@wordpress/components';
13
- import {
14
- InspectorControls,
15
10
  withColors,
16
- __experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,
17
11
  __experimentalUseGradient,
18
12
  __experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,
19
13
  __experimentalUseBorderProps as useBorderProps,
20
14
  } from '@wordpress/block-editor';
21
15
  import { compose } from '@wordpress/compose';
22
- import { __ } from '@wordpress/i18n';
23
16
 
24
17
  /**
25
18
  * Internal dependencies
26
19
  */
27
20
  import { dimRatioToClass } from './utils';
28
21
 
29
- const Overlay = ( {
30
- clientId,
31
- attributes,
32
- setAttributes,
33
- overlayColor,
34
- setOverlayColor,
35
- } ) => {
22
+ const Overlay = ( { attributes, overlayColor } ) => {
36
23
  const { dimRatio } = attributes;
37
- const { gradientClass, gradientValue, setGradient } =
38
- __experimentalUseGradient();
24
+ const { gradientClass, gradientValue } = __experimentalUseGradient();
39
25
  const colorGradientSettings = useMultipleOriginColorsAndGradients();
40
26
 
41
27
  const borderProps = useBorderProps( attributes );
@@ -45,79 +31,26 @@ const Overlay = ( {
45
31
  ...borderProps.style,
46
32
  };
47
33
 
48
- if ( ! colorGradientSettings.hasColorsOrGradients ) {
34
+ if ( ! colorGradientSettings.hasColorsOrGradients || ! dimRatio ) {
49
35
  return null;
50
36
  }
51
37
 
52
38
  return (
53
- <>
54
- { !! dimRatio && (
55
- <span
56
- aria-hidden="true"
57
- className={ classnames(
58
- 'wp-block-post-featured-image__overlay',
59
- dimRatioToClass( dimRatio ),
60
- {
61
- [ overlayColor.class ]: overlayColor.class,
62
- 'has-background-dim': dimRatio !== undefined,
63
- 'has-background-gradient': gradientValue,
64
- [ gradientClass ]: gradientClass,
65
- },
66
- borderProps.className
67
- ) }
68
- style={ overlayStyles }
69
- />
39
+ <span
40
+ aria-hidden="true"
41
+ className={ classnames(
42
+ 'wp-block-post-featured-image__overlay',
43
+ dimRatioToClass( dimRatio ),
44
+ {
45
+ [ overlayColor.class ]: overlayColor.class,
46
+ 'has-background-dim': dimRatio !== undefined,
47
+ 'has-background-gradient': gradientValue,
48
+ [ gradientClass ]: gradientClass,
49
+ },
50
+ borderProps.className
70
51
  ) }
71
- <InspectorControls group="color">
72
- <ColorGradientSettingsDropdown
73
- __experimentalIsRenderedInSidebar
74
- settings={ [
75
- {
76
- colorValue: overlayColor.color,
77
- gradientValue,
78
- label: __( 'Overlay' ),
79
- onColorChange: setOverlayColor,
80
- onGradientChange: setGradient,
81
- isShownByDefault: true,
82
- resetAllFilter: () => ( {
83
- overlayColor: undefined,
84
- customOverlayColor: undefined,
85
- gradient: undefined,
86
- customGradient: undefined,
87
- } ),
88
- },
89
- ] }
90
- panelId={ clientId }
91
- { ...colorGradientSettings }
92
- />
93
- <ToolsPanelItem
94
- hasValue={ () => dimRatio !== undefined }
95
- label={ __( 'Overlay opacity' ) }
96
- onDeselect={ () => setAttributes( { dimRatio: 0 } ) }
97
- resetAllFilter={ () => ( {
98
- dimRatio: 0,
99
- } ) }
100
- isShownByDefault
101
- panelId={ clientId }
102
- >
103
- <RangeControl
104
- __nextHasNoMarginBottom
105
- label={ __( 'Overlay opacity' ) }
106
- value={ dimRatio }
107
- onChange={ ( newDimRatio ) =>
108
- setAttributes( {
109
- dimRatio: newDimRatio,
110
- } )
111
- }
112
- min={ 0 }
113
- max={ 100 }
114
- step={ 10 }
115
- required
116
- __next40pxDefaultSize
117
- />
118
- </ToolsPanelItem>
119
- </InspectorControls>
120
- </>
52
+ style={ overlayStyles }
53
+ />
121
54
  );
122
55
  };
123
56
 
@@ -188,6 +188,7 @@ export default function PostNavigationLinkEdit( {
188
188
  ) }
189
189
  <RichText
190
190
  tagName="a"
191
+ identifier="label"
191
192
  aria-label={ ariaLabel }
192
193
  placeholder={ placeholder }
193
194
  value={ label }
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Renders the `core/post-navigation-link` block on the server.
10
10
  *
11
+ * @since 5.9.0
12
+ *
11
13
  * @param array $attributes Block attributes.
12
14
  * @param string $content Block default content.
13
15
  *
@@ -123,6 +125,8 @@ function render_block_core_post_navigation_link( $attributes, $content ) {
123
125
 
124
126
  /**
125
127
  * Registers the `core/post-navigation-link` block on the server.
128
+ *
129
+ * @since 5.9.0
126
130
  */
127
131
  function register_block_core_post_navigation_link() {
128
132
  register_block_type_from_metadata(
@@ -8,6 +8,8 @@
8
8
  /**
9
9
  * Determines whether a block list contains a block that uses the featured image.
10
10
  *
11
+ * @since 6.0.0
12
+ *
11
13
  * @param WP_Block_List $inner_blocks Inner block instance.
12
14
  *
13
15
  * @return bool Whether the block list contains a block that uses the featured image.
@@ -145,6 +147,8 @@ function render_block_core_post_template( $attributes, $content, $block ) {
145
147
 
146
148
  /**
147
149
  * Registers the `core/post-template` block on the server.
150
+ *
151
+ * @since 5.8.0
148
152
  */
149
153
  function register_block_core_post_template() {
150
154
  register_block_type_from_metadata(