@wordpress/block-library 9.48.1 → 10.0.1-next.v.202606191442.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 (480) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/build/breadcrumbs/edit.cjs +1 -1
  3. package/build/breadcrumbs/edit.cjs.map +1 -1
  4. package/build/button/edit.cjs +1 -1
  5. package/build/button/edit.cjs.map +2 -2
  6. package/build/categories/edit.cjs +1 -1
  7. package/build/categories/edit.cjs.map +1 -1
  8. package/build/code/edit.cjs +1 -1
  9. package/build/code/edit.cjs.map +2 -2
  10. package/build/code/index.cjs +1 -1
  11. package/build/code/index.cjs.map +1 -1
  12. package/build/columns/utils.cjs.map +1 -1
  13. package/build/comments/edit/comments-legacy.cjs +1 -1
  14. package/build/comments/edit/comments-legacy.cjs.map +1 -1
  15. package/build/comments/edit/placeholder.cjs +4 -4
  16. package/build/comments/edit/placeholder.cjs.map +1 -1
  17. package/build/comments-pagination-next/edit.cjs +2 -2
  18. package/build/comments-pagination-next/edit.cjs.map +1 -1
  19. package/build/comments-pagination-previous/edit.cjs +2 -2
  20. package/build/comments-pagination-previous/edit.cjs.map +1 -1
  21. package/build/cover/deprecated.cjs +3 -3
  22. package/build/cover/deprecated.cjs.map +2 -2
  23. package/build/cover/edit/block-controls.cjs +13 -0
  24. package/build/cover/edit/block-controls.cjs.map +2 -2
  25. package/build/cover/edit/index.cjs +61 -2
  26. package/build/cover/edit/index.cjs.map +3 -3
  27. package/build/cover/edit/inspector-controls.cjs +93 -35
  28. package/build/cover/edit/inspector-controls.cjs.map +2 -2
  29. package/build/details/edit.cjs +1 -1
  30. package/build/details/edit.cjs.map +2 -2
  31. package/build/embed/embed-placeholder.cjs +1 -1
  32. package/build/embed/embed-placeholder.cjs.map +2 -2
  33. package/build/file/edit.cjs +3 -11
  34. package/build/file/edit.cjs.map +2 -2
  35. package/build/file/index.cjs +3 -1
  36. package/build/file/index.cjs.map +3 -3
  37. package/build/file/transforms.cjs +11 -32
  38. package/build/file/transforms.cjs.map +2 -2
  39. package/build/file/variations.cjs +38 -0
  40. package/build/file/variations.cjs.map +7 -0
  41. package/build/footnotes/edit.cjs +1 -1
  42. package/build/footnotes/edit.cjs.map +2 -2
  43. package/build/form-input/edit.cjs +1 -1
  44. package/build/form-input/edit.cjs.map +2 -2
  45. package/build/freeform/edit.cjs +1 -1
  46. package/build/freeform/edit.cjs.map +1 -1
  47. package/build/gallery/edit.cjs +2 -2
  48. package/build/gallery/edit.cjs.map +2 -2
  49. package/build/home-link/edit.cjs +1 -1
  50. package/build/home-link/edit.cjs.map +2 -2
  51. package/build/html/index.cjs +1 -1
  52. package/build/html/index.cjs.map +2 -2
  53. package/build/html/modal.cjs +3 -3
  54. package/build/html/modal.cjs.map +2 -2
  55. package/build/icon/block.json +12 -0
  56. package/build/icon/edit.cjs +90 -39
  57. package/build/icon/edit.cjs.map +3 -3
  58. package/build/icon/index.cjs +3 -1
  59. package/build/icon/index.cjs.map +3 -3
  60. package/build/{tab/save.cjs → icon/variations.cjs} +14 -15
  61. package/build/icon/variations.cjs.map +7 -0
  62. package/build/image/block.json +1 -0
  63. package/build/image/edit.cjs +4 -3
  64. package/build/image/edit.cjs.map +2 -2
  65. package/build/image/image.cjs +91 -27
  66. package/build/image/image.cjs.map +2 -2
  67. package/build/image/index.cjs +1 -1
  68. package/build/image/index.cjs.map +2 -2
  69. package/build/image/transforms.cjs +9 -3
  70. package/build/image/transforms.cjs.map +2 -2
  71. package/build/index.cjs +1 -3
  72. package/build/index.cjs.map +2 -2
  73. package/build/latest-posts/edit.cjs +1 -1
  74. package/build/latest-posts/edit.cjs.map +1 -1
  75. package/build/math/edit.cjs +1 -1
  76. package/build/math/index.cjs +1 -1
  77. package/build/math/index.cjs.map +1 -1
  78. package/build/media-text/constants.cjs +1 -1
  79. package/build/media-text/constants.cjs.map +2 -2
  80. package/build/media-text/index.cjs +1 -1
  81. package/build/media-text/index.cjs.map +2 -2
  82. package/build/missing/edit.cjs +2 -2
  83. package/build/missing/edit.cjs.map +1 -1
  84. package/build/navigation/edit/index.cjs +14 -8
  85. package/build/navigation/edit/index.cjs.map +2 -2
  86. package/build/navigation/edit/navigation-menu-selector.cjs +1 -1
  87. package/build/navigation/edit/navigation-menu-selector.cjs.map +2 -2
  88. package/build/navigation/edit/placeholder/index.cjs +1 -1
  89. package/build/navigation/edit/placeholder/index.cjs.map +2 -2
  90. package/build/navigation-link/edit.cjs +1 -1
  91. package/build/navigation-link/edit.cjs.map +2 -2
  92. package/build/navigation-submenu/block.json +7 -0
  93. package/build/navigation-submenu/edit.cjs +1 -1
  94. package/build/navigation-submenu/edit.cjs.map +2 -2
  95. package/build/page-list/block.json +2 -5
  96. package/build/page-list/edit.cjs +1 -11
  97. package/build/page-list/edit.cjs.map +2 -2
  98. package/build/post-author/edit.cjs +1 -1
  99. package/build/post-author/edit.cjs.map +2 -2
  100. package/build/post-author/utils.cjs +1 -1
  101. package/build/post-author/utils.cjs.map +2 -2
  102. package/build/post-date/edit.cjs +2 -2
  103. package/build/post-date/edit.cjs.map +2 -2
  104. package/build/post-excerpt/edit.cjs +2 -2
  105. package/build/post-excerpt/edit.cjs.map +2 -2
  106. package/build/post-featured-image/block.json +1 -0
  107. package/build/post-featured-image/dimension-controls.cjs +90 -178
  108. package/build/post-featured-image/dimension-controls.cjs.map +3 -3
  109. package/build/post-featured-image/edit.cjs +47 -17
  110. package/build/post-featured-image/edit.cjs.map +2 -2
  111. package/build/post-navigation-link/edit.cjs +2 -2
  112. package/build/post-navigation-link/edit.cjs.map +2 -2
  113. package/build/post-time-to-read/edit.cjs +1 -1
  114. package/build/post-time-to-read/edit.cjs.map +1 -1
  115. package/build/preformatted/edit.cjs +1 -1
  116. package/build/preformatted/edit.cjs.map +2 -2
  117. package/build/pullquote/block.json +1 -3
  118. package/build/pullquote/deprecated.cjs +114 -9
  119. package/build/pullquote/deprecated.cjs.map +3 -3
  120. package/build/pullquote/edit.cjs +43 -61
  121. package/build/pullquote/edit.cjs.map +3 -3
  122. package/build/pullquote/save.cjs +5 -26
  123. package/build/pullquote/save.cjs.map +3 -3
  124. package/build/query/edit/inspector-controls/enhanced-pagination-control.cjs +1 -1
  125. package/build/query/edit/inspector-controls/enhanced-pagination-control.cjs.map +1 -1
  126. package/build/query/edit/inspector-controls/order-control.cjs +2 -2
  127. package/build/query/edit/inspector-controls/order-control.cjs.map +2 -2
  128. package/build/query/utils.cjs +2 -2
  129. package/build/query/utils.cjs.map +2 -2
  130. package/build/query-pagination-next/edit.cjs +2 -2
  131. package/build/query-pagination-next/edit.cjs.map +1 -1
  132. package/build/query-pagination-previous/edit.cjs +2 -2
  133. package/build/query-pagination-previous/edit.cjs.map +1 -1
  134. package/build/query-title/edit.cjs +1 -1
  135. package/build/query-title/edit.cjs.map +2 -2
  136. package/build/query-total/edit.cjs +1 -1
  137. package/build/query-total/edit.cjs.map +2 -2
  138. package/build/quote/index.cjs +1 -1
  139. package/build/quote/index.cjs.map +2 -2
  140. package/build/read-more/edit.cjs +1 -1
  141. package/build/read-more/edit.cjs.map +2 -2
  142. package/build/rss/edit.cjs +1 -1
  143. package/build/rss/edit.cjs.map +2 -2
  144. package/build/search/edit.cjs +3 -3
  145. package/build/search/edit.cjs.map +2 -2
  146. package/build/shortcode/edit.cjs +1 -1
  147. package/build/shortcode/edit.cjs.map +2 -2
  148. package/build/site-tagline/edit.cjs +1 -1
  149. package/build/site-tagline/edit.cjs.map +2 -2
  150. package/build/site-title/edit.cjs +1 -1
  151. package/build/site-title/edit.cjs.map +2 -2
  152. package/build/tab-list/block.json +34 -21
  153. package/build/tab-list/edit.cjs +116 -12
  154. package/build/tab-list/edit.cjs.map +3 -3
  155. package/build/tab-list/save.cjs +33 -3
  156. package/build/tab-list/save.cjs.map +3 -3
  157. package/build/tab-panel/add-tab-toolbar-control.cjs +19 -8
  158. package/build/tab-panel/add-tab-toolbar-control.cjs.map +2 -2
  159. package/build/tab-panel/block.json +2 -6
  160. package/build/tab-panel/remove-tab-toolbar-control.cjs +9 -14
  161. package/build/tab-panel/remove-tab-toolbar-control.cjs.map +2 -2
  162. package/build/tab-panels/block.json +2 -27
  163. package/build/table/index.cjs +1 -1
  164. package/build/table/index.cjs.map +2 -2
  165. package/build/tabs/block.json +3 -17
  166. package/build/tabs/edit.cjs +7 -21
  167. package/build/tabs/edit.cjs.map +3 -3
  168. package/build/tabs/index.cjs +6 -10
  169. package/build/tabs/index.cjs.map +2 -2
  170. package/build/tabs/use-tab-list-items-sync.cjs +53 -0
  171. package/build/tabs/use-tab-list-items-sync.cjs.map +7 -0
  172. package/build/tabs/view.cjs +2 -10
  173. package/build/tabs/view.cjs.map +2 -2
  174. package/build/terms-query/edit/inspector-controls/order-control.cjs +2 -2
  175. package/build/terms-query/edit/inspector-controls/order-control.cjs.map +2 -2
  176. package/build/utils/style-state.cjs +164 -0
  177. package/build/utils/style-state.cjs.map +7 -0
  178. package/build/utils/waveform-player.cjs +1 -1
  179. package/build/verse/edit.cjs +1 -1
  180. package/build/verse/edit.cjs.map +2 -2
  181. package/build-module/breadcrumbs/edit.mjs +1 -1
  182. package/build-module/breadcrumbs/edit.mjs.map +1 -1
  183. package/build-module/button/edit.mjs +1 -1
  184. package/build-module/button/edit.mjs.map +2 -2
  185. package/build-module/categories/edit.mjs +1 -1
  186. package/build-module/categories/edit.mjs.map +1 -1
  187. package/build-module/code/edit.mjs +1 -1
  188. package/build-module/code/edit.mjs.map +2 -2
  189. package/build-module/code/index.mjs +1 -1
  190. package/build-module/code/index.mjs.map +1 -1
  191. package/build-module/columns/utils.mjs.map +1 -1
  192. package/build-module/comments/edit/comments-legacy.mjs +1 -1
  193. package/build-module/comments/edit/comments-legacy.mjs.map +1 -1
  194. package/build-module/comments/edit/placeholder.mjs +4 -4
  195. package/build-module/comments/edit/placeholder.mjs.map +1 -1
  196. package/build-module/comments-pagination-next/edit.mjs +2 -2
  197. package/build-module/comments-pagination-next/edit.mjs.map +1 -1
  198. package/build-module/comments-pagination-previous/edit.mjs +2 -2
  199. package/build-module/comments-pagination-previous/edit.mjs.map +1 -1
  200. package/build-module/cover/deprecated.mjs +3 -3
  201. package/build-module/cover/deprecated.mjs.map +2 -2
  202. package/build-module/cover/edit/block-controls.mjs +15 -2
  203. package/build-module/cover/edit/block-controls.mjs.map +2 -2
  204. package/build-module/cover/edit/index.mjs +64 -3
  205. package/build-module/cover/edit/index.mjs.map +2 -2
  206. package/build-module/cover/edit/inspector-controls.mjs +98 -35
  207. package/build-module/cover/edit/inspector-controls.mjs.map +2 -2
  208. package/build-module/details/edit.mjs +1 -1
  209. package/build-module/details/edit.mjs.map +2 -2
  210. package/build-module/embed/embed-placeholder.mjs +1 -1
  211. package/build-module/embed/embed-placeholder.mjs.map +2 -2
  212. package/build-module/file/edit.mjs +5 -13
  213. package/build-module/file/edit.mjs.map +2 -2
  214. package/build-module/file/index.mjs +3 -1
  215. package/build-module/file/index.mjs.map +2 -2
  216. package/build-module/file/transforms.mjs +11 -32
  217. package/build-module/file/transforms.mjs.map +2 -2
  218. package/build-module/file/variations.mjs +17 -0
  219. package/build-module/file/variations.mjs.map +7 -0
  220. package/build-module/footnotes/edit.mjs +1 -1
  221. package/build-module/footnotes/edit.mjs.map +2 -2
  222. package/build-module/form-input/edit.mjs +1 -1
  223. package/build-module/form-input/edit.mjs.map +2 -2
  224. package/build-module/freeform/edit.mjs +1 -1
  225. package/build-module/freeform/edit.mjs.map +1 -1
  226. package/build-module/gallery/edit.mjs +2 -2
  227. package/build-module/gallery/edit.mjs.map +2 -2
  228. package/build-module/home-link/edit.mjs +1 -1
  229. package/build-module/home-link/edit.mjs.map +2 -2
  230. package/build-module/html/index.mjs +1 -1
  231. package/build-module/html/index.mjs.map +2 -2
  232. package/build-module/html/modal.mjs +3 -3
  233. package/build-module/html/modal.mjs.map +2 -2
  234. package/build-module/icon/block.json +12 -0
  235. package/build-module/icon/edit.mjs +94 -40
  236. package/build-module/icon/edit.mjs.map +2 -2
  237. package/build-module/icon/index.mjs +3 -1
  238. package/build-module/icon/index.mjs.map +2 -2
  239. package/build-module/icon/variations.mjs +13 -0
  240. package/build-module/icon/variations.mjs.map +7 -0
  241. package/build-module/image/block.json +1 -0
  242. package/build-module/image/edit.mjs +4 -3
  243. package/build-module/image/edit.mjs.map +2 -2
  244. package/build-module/image/image.mjs +96 -27
  245. package/build-module/image/image.mjs.map +2 -2
  246. package/build-module/image/index.mjs +1 -1
  247. package/build-module/image/index.mjs.map +2 -2
  248. package/build-module/image/transforms.mjs +9 -3
  249. package/build-module/image/transforms.mjs.map +2 -2
  250. package/build-module/index.mjs +1 -3
  251. package/build-module/index.mjs.map +2 -2
  252. package/build-module/latest-posts/edit.mjs +1 -1
  253. package/build-module/latest-posts/edit.mjs.map +1 -1
  254. package/build-module/math/edit.mjs +1 -1
  255. package/build-module/math/index.mjs +1 -1
  256. package/build-module/math/index.mjs.map +1 -1
  257. package/build-module/media-text/constants.mjs +1 -1
  258. package/build-module/media-text/constants.mjs.map +2 -2
  259. package/build-module/media-text/index.mjs +1 -1
  260. package/build-module/media-text/index.mjs.map +2 -2
  261. package/build-module/missing/edit.mjs +2 -2
  262. package/build-module/missing/edit.mjs.map +1 -1
  263. package/build-module/navigation/edit/index.mjs +14 -8
  264. package/build-module/navigation/edit/index.mjs.map +2 -2
  265. package/build-module/navigation/edit/navigation-menu-selector.mjs +1 -1
  266. package/build-module/navigation/edit/navigation-menu-selector.mjs.map +2 -2
  267. package/build-module/navigation/edit/placeholder/index.mjs +1 -1
  268. package/build-module/navigation/edit/placeholder/index.mjs.map +2 -2
  269. package/build-module/navigation-link/edit.mjs +1 -1
  270. package/build-module/navigation-link/edit.mjs.map +2 -2
  271. package/build-module/navigation-submenu/block.json +7 -0
  272. package/build-module/navigation-submenu/edit.mjs +1 -1
  273. package/build-module/navigation-submenu/edit.mjs.map +2 -2
  274. package/build-module/page-list/block.json +2 -5
  275. package/build-module/page-list/edit.mjs +1 -11
  276. package/build-module/page-list/edit.mjs.map +2 -2
  277. package/build-module/post-author/edit.mjs +1 -1
  278. package/build-module/post-author/edit.mjs.map +2 -2
  279. package/build-module/post-author/utils.mjs +1 -1
  280. package/build-module/post-author/utils.mjs.map +2 -2
  281. package/build-module/post-date/edit.mjs +2 -2
  282. package/build-module/post-date/edit.mjs.map +2 -2
  283. package/build-module/post-excerpt/edit.mjs +2 -2
  284. package/build-module/post-excerpt/edit.mjs.map +2 -2
  285. package/build-module/post-featured-image/block.json +1 -0
  286. package/build-module/post-featured-image/dimension-controls.mjs +99 -187
  287. package/build-module/post-featured-image/dimension-controls.mjs.map +2 -2
  288. package/build-module/post-featured-image/edit.mjs +47 -17
  289. package/build-module/post-featured-image/edit.mjs.map +2 -2
  290. package/build-module/post-navigation-link/edit.mjs +2 -2
  291. package/build-module/post-navigation-link/edit.mjs.map +2 -2
  292. package/build-module/post-time-to-read/edit.mjs +1 -1
  293. package/build-module/post-time-to-read/edit.mjs.map +1 -1
  294. package/build-module/preformatted/edit.mjs +1 -1
  295. package/build-module/preformatted/edit.mjs.map +2 -2
  296. package/build-module/pullquote/block.json +1 -3
  297. package/build-module/pullquote/deprecated.mjs +114 -9
  298. package/build-module/pullquote/deprecated.mjs.map +2 -2
  299. package/build-module/pullquote/edit.mjs +44 -67
  300. package/build-module/pullquote/edit.mjs.map +2 -2
  301. package/build-module/pullquote/save.mjs +5 -16
  302. package/build-module/pullquote/save.mjs.map +2 -2
  303. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.mjs +1 -1
  304. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.mjs.map +1 -1
  305. package/build-module/query/edit/inspector-controls/order-control.mjs +2 -2
  306. package/build-module/query/edit/inspector-controls/order-control.mjs.map +2 -2
  307. package/build-module/query/utils.mjs +2 -2
  308. package/build-module/query/utils.mjs.map +2 -2
  309. package/build-module/query-pagination-next/edit.mjs +2 -2
  310. package/build-module/query-pagination-next/edit.mjs.map +1 -1
  311. package/build-module/query-pagination-previous/edit.mjs +2 -2
  312. package/build-module/query-pagination-previous/edit.mjs.map +1 -1
  313. package/build-module/query-title/edit.mjs +1 -1
  314. package/build-module/query-title/edit.mjs.map +2 -2
  315. package/build-module/query-total/edit.mjs +1 -1
  316. package/build-module/query-total/edit.mjs.map +2 -2
  317. package/build-module/quote/index.mjs +1 -1
  318. package/build-module/quote/index.mjs.map +2 -2
  319. package/build-module/read-more/edit.mjs +1 -1
  320. package/build-module/read-more/edit.mjs.map +2 -2
  321. package/build-module/rss/edit.mjs +1 -1
  322. package/build-module/rss/edit.mjs.map +2 -2
  323. package/build-module/search/edit.mjs +3 -3
  324. package/build-module/search/edit.mjs.map +2 -2
  325. package/build-module/shortcode/edit.mjs +1 -1
  326. package/build-module/shortcode/edit.mjs.map +2 -2
  327. package/build-module/site-tagline/edit.mjs +1 -1
  328. package/build-module/site-tagline/edit.mjs.map +2 -2
  329. package/build-module/site-title/edit.mjs +1 -1
  330. package/build-module/site-title/edit.mjs.map +2 -2
  331. package/build-module/tab-list/block.json +34 -21
  332. package/build-module/tab-list/edit.mjs +122 -15
  333. package/build-module/tab-list/edit.mjs.map +2 -2
  334. package/build-module/tab-list/save.mjs +29 -4
  335. package/build-module/tab-list/save.mjs.map +2 -2
  336. package/build-module/tab-panel/add-tab-toolbar-control.mjs +19 -8
  337. package/build-module/tab-panel/add-tab-toolbar-control.mjs.map +2 -2
  338. package/build-module/tab-panel/block.json +2 -6
  339. package/build-module/tab-panel/remove-tab-toolbar-control.mjs +9 -14
  340. package/build-module/tab-panel/remove-tab-toolbar-control.mjs.map +2 -2
  341. package/build-module/tab-panels/block.json +2 -27
  342. package/build-module/table/index.mjs +1 -1
  343. package/build-module/table/index.mjs.map +2 -2
  344. package/build-module/tabs/block.json +3 -17
  345. package/build-module/tabs/edit.mjs +7 -21
  346. package/build-module/tabs/edit.mjs.map +2 -2
  347. package/build-module/tabs/index.mjs +6 -10
  348. package/build-module/tabs/index.mjs.map +2 -2
  349. package/build-module/tabs/use-tab-list-items-sync.mjs +32 -0
  350. package/build-module/tabs/use-tab-list-items-sync.mjs.map +7 -0
  351. package/build-module/tabs/view.mjs +2 -10
  352. package/build-module/tabs/view.mjs.map +2 -2
  353. package/build-module/terms-query/edit/inspector-controls/order-control.mjs +2 -2
  354. package/build-module/terms-query/edit/inspector-controls/order-control.mjs.map +2 -2
  355. package/build-module/utils/style-state.mjs +132 -0
  356. package/build-module/utils/style-state.mjs.map +7 -0
  357. package/build-module/utils/waveform-player.mjs +1 -1
  358. package/build-module/verse/edit.mjs +1 -1
  359. package/build-module/verse/edit.mjs.map +2 -2
  360. package/build-style/editor-rtl.css +12 -16
  361. package/build-style/editor.css +12 -16
  362. package/build-style/icon/style-rtl.css +9 -0
  363. package/build-style/icon/style.css +9 -0
  364. package/build-style/style-rtl.css +11 -24
  365. package/build-style/style.css +11 -24
  366. package/build-style/tab-list/editor-rtl.css +12 -4
  367. package/build-style/tab-list/editor.css +12 -4
  368. package/build-style/{tab → tab-list}/style-rtl.css +2 -2
  369. package/build-style/{tab → tab-list}/style.css +2 -2
  370. package/build-style/tab-panel/style-rtl.css +0 -17
  371. package/build-style/tab-panel/style.css +0 -17
  372. package/package.json +48 -45
  373. package/src/avatar/index.php +2 -2
  374. package/src/block/index.php +2 -26
  375. package/src/comment-author-avatar/index.php +3 -3
  376. package/src/comment-author-name/index.php +1 -1
  377. package/src/comment-date/index.php +1 -1
  378. package/src/cover/edit/block-controls.js +14 -2
  379. package/src/cover/edit/index.js +86 -0
  380. package/src/cover/edit/inspector-controls.js +124 -54
  381. package/src/editor.scss +0 -1
  382. package/src/file/edit.js +3 -16
  383. package/src/file/index.js +2 -0
  384. package/src/file/transforms.js +12 -31
  385. package/src/file/variations.js +17 -0
  386. package/src/gallery/edit.js +13 -13
  387. package/src/icon/README.md +3 -0
  388. package/src/icon/block.json +12 -0
  389. package/src/icon/edit.js +86 -36
  390. package/src/icon/index.js +3 -1
  391. package/src/icon/index.php +23 -0
  392. package/src/icon/style.scss +12 -0
  393. package/src/icon/variations.js +9 -0
  394. package/src/image/README.md +1 -0
  395. package/src/image/block.json +1 -0
  396. package/src/image/edit.js +8 -3
  397. package/src/image/image.js +120 -54
  398. package/src/image/index.php +0 -1
  399. package/src/image/transforms.js +34 -8
  400. package/src/index.js +4 -11
  401. package/src/navigation/edit/index.js +23 -10
  402. package/src/navigation/index.php +58 -0
  403. package/src/navigation-submenu/README.md +5 -0
  404. package/src/navigation-submenu/block.json +7 -0
  405. package/src/page-list/README.md +1 -1
  406. package/src/page-list/block.json +2 -5
  407. package/src/page-list/edit.js +0 -11
  408. package/src/page-list/index.php +1 -1
  409. package/src/post-date/edit.js +2 -2
  410. package/src/post-featured-image/README.md +1 -0
  411. package/src/post-featured-image/block.json +1 -0
  412. package/src/post-featured-image/dimension-controls.js +105 -184
  413. package/src/post-featured-image/edit.js +53 -21
  414. package/src/post-featured-image/index.php +24 -22
  415. package/src/pullquote/README.md +1 -1
  416. package/src/pullquote/block.json +1 -3
  417. package/src/pullquote/deprecated.js +121 -9
  418. package/src/pullquote/edit.js +7 -31
  419. package/src/pullquote/save.js +2 -13
  420. package/src/search/index.php +1 -1
  421. package/src/style.scss +1 -2
  422. package/src/tab-list/README.md +19 -17
  423. package/src/tab-list/block.json +34 -21
  424. package/src/tab-list/edit.js +147 -15
  425. package/src/tab-list/editor.scss +13 -6
  426. package/src/tab-list/index.php +23 -30
  427. package/src/tab-list/save.js +39 -4
  428. package/src/{tab → tab-list}/style.scss +1 -1
  429. package/src/tab-panel/README.md +0 -3
  430. package/src/tab-panel/add-tab-toolbar-control.js +24 -11
  431. package/src/tab-panel/block.json +2 -6
  432. package/src/tab-panel/remove-tab-toolbar-control.js +10 -14
  433. package/src/tab-panel/style.scss +0 -17
  434. package/src/tab-panels/README.md +0 -16
  435. package/src/tab-panels/block.json +2 -27
  436. package/src/tabs/README.md +1 -7
  437. package/src/tabs/block.json +3 -17
  438. package/src/tabs/edit.js +8 -19
  439. package/src/tabs/index.js +6 -10
  440. package/src/tabs/index.php +0 -13
  441. package/src/tabs/use-tab-list-items-sync.js +49 -0
  442. package/src/tabs/view.js +2 -10
  443. package/src/utils/style-state.js +151 -0
  444. package/src/utils/test/style-state.js +307 -0
  445. package/babel-plugin.cjs +0 -150
  446. package/build/tab/block.json +0 -56
  447. package/build/tab/controls.cjs +0 -46
  448. package/build/tab/controls.cjs.map +0 -7
  449. package/build/tab/edit.cjs +0 -135
  450. package/build/tab/edit.cjs.map +0 -7
  451. package/build/tab/index.cjs +0 -58
  452. package/build/tab/index.cjs.map +0 -7
  453. package/build/tab/save.cjs.map +0 -7
  454. package/build/tabs/use-tab-list-sync.cjs +0 -190
  455. package/build/tabs/use-tab-list-sync.cjs.map +0 -7
  456. package/build-module/tab/block.json +0 -56
  457. package/build-module/tab/controls.mjs +0 -15
  458. package/build-module/tab/controls.mjs.map +0 -7
  459. package/build-module/tab/edit.mjs +0 -108
  460. package/build-module/tab/edit.mjs.map +0 -7
  461. package/build-module/tab/index.mjs +0 -20
  462. package/build-module/tab/index.mjs.map +0 -7
  463. package/build-module/tab/save.mjs +0 -14
  464. package/build-module/tab/save.mjs.map +0 -7
  465. package/build-module/tabs/use-tab-list-sync.mjs +0 -169
  466. package/build-module/tabs/use-tab-list-sync.mjs.map +0 -7
  467. package/build-style/tab/editor-rtl.css +0 -11
  468. package/build-style/tab/editor.css +0 -11
  469. package/build-style/tab-panels/style-rtl.css +0 -4
  470. package/build-style/tab-panels/style.css +0 -4
  471. package/src/tab/README.md +0 -69
  472. package/src/tab/block.json +0 -56
  473. package/src/tab/controls.js +0 -19
  474. package/src/tab/edit.js +0 -141
  475. package/src/tab/editor.scss +0 -14
  476. package/src/tab/index.js +0 -24
  477. package/src/tab/index.php +0 -70
  478. package/src/tab/save.js +0 -13
  479. package/src/tab-panels/style.scss +0 -4
  480. package/src/tabs/use-tab-list-sync.js +0 -237
@@ -64,6 +64,12 @@ import { isExternalImage } from './edit';
64
64
  import { Caption } from '../utils/caption';
65
65
  import { MediaControl } from '../utils/media-control';
66
66
  import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
67
+ import {
68
+ getActiveDimensionValue,
69
+ getDimensionResetAttributes,
70
+ getDimensionUpdateAttributes,
71
+ getStyleStateKey,
72
+ } from '../utils/style-state';
67
73
  import { useOpenImageMediaEditorModal } from './use-open-image-media-editor-modal';
68
74
  import {
69
75
  MIN_SIZE,
@@ -73,9 +79,12 @@ import {
73
79
  } from './constants';
74
80
  import { evalAspectRatio, mediaPosition } from './utils';
75
81
 
76
- const { DimensionsTool, ResolutionTool, mediaEditKey } = unlock(
77
- blockEditorPrivateApis
78
- );
82
+ const {
83
+ DimensionsTool,
84
+ isDefaultBlockStyleState,
85
+ ResolutionTool,
86
+ mediaEditKey,
87
+ } = unlock( blockEditorPrivateApis );
79
88
 
80
89
  const scaleOptions = [
81
90
  {
@@ -644,7 +653,8 @@ export default function Image( {
644
653
  isSingleSelected &&
645
654
  canEditImage &&
646
655
  ! isEditingImage &&
647
- ! isContentOnlyMode;
656
+ ! isContentOnlyMode &&
657
+ ! isUploading;
648
658
 
649
659
  function switchToCover() {
650
660
  replaceBlocks(
@@ -673,14 +683,67 @@ export default function Image( {
673
683
 
674
684
  const dropdownMenuProps = useToolsPanelDropdownMenuProps();
675
685
 
686
+ const selectedStyleState = useSelect(
687
+ ( select ) => {
688
+ if ( ! isSingleSelected ) {
689
+ return undefined;
690
+ }
691
+ const { getSelectedBlockStyleState } = unlock(
692
+ select( blockEditorStore )
693
+ );
694
+ return getSelectedBlockStyleState( clientId );
695
+ },
696
+ [ clientId, isSingleSelected ]
697
+ );
698
+ const hasSelectedStyleState =
699
+ ! isDefaultBlockStyleState( selectedStyleState );
700
+ const selectedStyleStateKey = getStyleStateKey( selectedStyleState );
701
+ const activeWidth = getActiveDimensionValue( {
702
+ attributes,
703
+ selectedState: selectedStyleState,
704
+ hasSelectedStyleState,
705
+ attributeKey: 'width',
706
+ } );
707
+ const activeHeight = getActiveDimensionValue( {
708
+ attributes,
709
+ selectedState: selectedStyleState,
710
+ hasSelectedStyleState,
711
+ attributeKey: 'height',
712
+ } );
713
+ const activeAspectRatio = getActiveDimensionValue( {
714
+ attributes,
715
+ selectedState: selectedStyleState,
716
+ hasSelectedStyleState,
717
+ attributeKey: 'aspectRatio',
718
+ } );
719
+ const activeScale = getActiveDimensionValue( {
720
+ attributes,
721
+ selectedState: selectedStyleState,
722
+ hasSelectedStyleState,
723
+ attributeKey: 'scale',
724
+ styleKey: 'objectFit',
725
+ } );
726
+ const setDimensionAttributes = ( nextDimensions ) => {
727
+ setAttributes(
728
+ getDimensionUpdateAttributes( {
729
+ style: attributes.style,
730
+ selectedState: selectedStyleState,
731
+ hasSelectedStyleState,
732
+ nextDimensions,
733
+ dimensionKeyMap: { scale: 'objectFit' },
734
+ } )
735
+ );
736
+ };
737
+
676
738
  const dimensionsControl =
677
739
  showDimensionsControls &&
678
740
  ( SIZED_LAYOUTS.includes( parentLayoutType ) ? (
679
741
  <DimensionsTool
742
+ key={ selectedStyleStateKey }
680
743
  panelId={ clientId }
681
- value={ { aspectRatio } }
744
+ value={ { aspectRatio: activeAspectRatio, scale: activeScale } }
682
745
  onChange={ ( { aspectRatio: newAspectRatio } ) => {
683
- setAttributes( {
746
+ setDimensionAttributes( {
684
747
  aspectRatio: newAspectRatio,
685
748
  scale: 'cover',
686
749
  } );
@@ -690,26 +753,29 @@ export default function Image( {
690
753
  />
691
754
  ) : (
692
755
  <DimensionsTool
756
+ key={ selectedStyleStateKey }
693
757
  panelId={ clientId }
694
- value={ { width, height, scale, aspectRatio } }
758
+ value={ {
759
+ width: activeWidth,
760
+ height: activeHeight,
761
+ scale: activeScale,
762
+ aspectRatio: activeAspectRatio,
763
+ } }
695
764
  onChange={ ( {
696
765
  width: newWidth,
697
766
  height: newHeight,
698
767
  scale: newScale,
699
768
  aspectRatio: newAspectRatio,
700
769
  } ) => {
701
- // Rebuilding the object forces setting `undefined`
702
- // for values that are removed since setAttributes
703
- // doesn't do anything with keys that aren't set.
704
- setAttributes( {
770
+ setDimensionAttributes( {
705
771
  // CSS includes `height: auto`, but we need
706
772
  // `width: auto` to fix the aspect ratio when
707
773
  // only height is set due to the width and
708
774
  // height attributes set via the server.
709
775
  width: ! newWidth && newHeight ? 'auto' : newWidth,
710
776
  height: newHeight,
711
- scale: newScale,
712
777
  aspectRatio: newAspectRatio,
778
+ scale: newScale,
713
779
  } );
714
780
  } }
715
781
  defaultScale="cover"
@@ -742,14 +808,11 @@ export default function Image( {
742
808
  lockTitleControls = false,
743
809
  lockTitleControlsMessage,
744
810
  hideCaptionControls = false,
745
- hasSelectedStyleState = false,
746
811
  } = useSelect(
747
812
  ( select ) => {
748
813
  if ( ! isSingleSelected ) {
749
814
  return {};
750
815
  }
751
- const { hasSelectedStyleState: hasSelectedBlockStyleState } =
752
- unlock( select( blockEditorStore ) );
753
816
  const {
754
817
  url: urlBinding,
755
818
  alt: altBinding,
@@ -767,7 +830,6 @@ export default function Image( {
767
830
  titleBinding?.source
768
831
  );
769
832
  return {
770
- hasSelectedStyleState: hasSelectedBlockStyleState( clientId ),
771
833
  lockUrlControls:
772
834
  !! urlBinding &&
773
835
  ! urlBindingSource?.canUserEditValue?.( {
@@ -812,7 +874,6 @@ export default function Image( {
812
874
  },
813
875
  [
814
876
  arePatternOverridesEnabled,
815
- clientId,
816
877
  context,
817
878
  isSingleSelected,
818
879
  metadata?.bindings,
@@ -1018,47 +1079,52 @@ export default function Image( {
1018
1079
  </ToolsPanel>
1019
1080
  </InspectorControls>
1020
1081
  ) }
1021
- { ! hasSelectedStyleState && (
1022
- <InspectorControls
1023
- group="dimensions"
1024
- resetAllFilter={ ( attrs ) => ( {
1025
- ...attrs,
1026
- aspectRatio: undefined,
1027
- width: undefined,
1028
- height: undefined,
1029
- scale: undefined,
1030
- focalPoint: undefined,
1031
- } ) }
1032
- >
1033
- { dimensionsControl }
1034
- { url && scale && (
1035
- <ToolsPanelItem
1082
+ <InspectorControls
1083
+ group="dimensions"
1084
+ resetAllFilter={ ( attrs ) => {
1085
+ return getDimensionResetAttributes( {
1086
+ attributes: attrs,
1087
+ selectedState: selectedStyleState,
1088
+ hasSelectedStyleState,
1089
+ keys: [ 'aspectRatio', 'height', 'objectFit', 'width' ],
1090
+ defaultAttributes: {
1091
+ aspectRatio: undefined,
1092
+ width: undefined,
1093
+ height: undefined,
1094
+ scale: undefined,
1095
+ focalPoint: undefined,
1096
+ },
1097
+ } );
1098
+ } }
1099
+ >
1100
+ { dimensionsControl }
1101
+ { ! hasSelectedStyleState && url && scale && (
1102
+ <ToolsPanelItem
1103
+ label={ __( 'Focal point' ) }
1104
+ isShownByDefault
1105
+ hasValue={ () => !! focalPoint }
1106
+ onDeselect={ () =>
1107
+ setAttributes( {
1108
+ focalPoint: undefined,
1109
+ } )
1110
+ }
1111
+ panelId={ clientId }
1112
+ >
1113
+ <FocalPointPicker
1036
1114
  label={ __( 'Focal point' ) }
1037
- isShownByDefault
1038
- hasValue={ () => !! focalPoint }
1039
- onDeselect={ () =>
1115
+ url={ url }
1116
+ value={ focalPoint }
1117
+ onDragStart={ imperativeFocalPointPreview }
1118
+ onDrag={ imperativeFocalPointPreview }
1119
+ onChange={ ( newFocalPoint ) =>
1040
1120
  setAttributes( {
1041
- focalPoint: undefined,
1121
+ focalPoint: newFocalPoint,
1042
1122
  } )
1043
1123
  }
1044
- panelId={ clientId }
1045
- >
1046
- <FocalPointPicker
1047
- label={ __( 'Focal point' ) }
1048
- url={ url }
1049
- value={ focalPoint }
1050
- onDragStart={ imperativeFocalPointPreview }
1051
- onDrag={ imperativeFocalPointPreview }
1052
- onChange={ ( newFocalPoint ) =>
1053
- setAttributes( {
1054
- focalPoint: newFocalPoint,
1055
- } )
1056
- }
1057
- />
1058
- </ToolsPanelItem>
1059
- ) }
1060
- </InspectorControls>
1061
- ) }
1124
+ />
1125
+ </ToolsPanelItem>
1126
+ ) }
1127
+ </InspectorControls>
1062
1128
  { !! imageSizeOptions.length && (
1063
1129
  <InspectorControls>
1064
1130
  <ToolsPanel
@@ -390,7 +390,6 @@ function block_core_image_print_lightbox_overlay() {
390
390
  data-wp-bind--style="state.imgStyles"
391
391
  data-wp-bind--src="state.enlargedSrc"
392
392
  data-wp-bind--srcset="state.enlargedSrcset"
393
- data-wp-bind--srcset="state.enlargedSrcset"
394
393
  sizes="100vw"
395
394
  >
396
395
  </figure>
@@ -52,10 +52,10 @@ const imageSchema = {
52
52
  },
53
53
  };
54
54
 
55
- // Read a pixel dimension from an `<img>` HTML attribute and normalise it to
56
- // the `<value>px` form the Image block stores in its `width` / `height`
57
- // attributes. Non-integer values (e.g. `50%`) are dropped because the block
58
- // attribute round-trips through inline styles that expect pixel units.
55
+ // Normalise an `<img>` pixel dimension attribute to the `<value>px` form the
56
+ // Image block stores in its `width`/`height` attributes. Non-integer values
57
+ // (e.g. `50%`) are dropped because the attribute round-trips through inline
58
+ // styles that expect pixel units.
59
59
  function parsePixelDimension( value ) {
60
60
  return value && /^\d+$/.test( value ) ? `${ value }px` : undefined;
61
61
  }
@@ -114,14 +114,39 @@ const transforms = {
114
114
  anchorElement && anchorElement.className
115
115
  ? anchorElement.className
116
116
  : undefined;
117
- // Preserve explicit pixel dimensions set on the source `<img>`
118
- // (e.g. legacy "Add Media" output: `<img width="77" height="77">`).
119
- const width = parsePixelDimension(
117
+ // Pin only one dimension and let the other follow the aspect
118
+ // ratio via `auto`. Pinning both as fixed pixels stretches the
119
+ // image when a theme caps the width while the height stays
120
+ // fixed. So width sources use `height: 'auto'`; height-only
121
+ // sources use `width: 'auto'`.
122
+ const widthValue = parsePixelDimension(
120
123
  img.getAttribute( 'width' )
121
124
  );
122
- const height = parsePixelDimension(
125
+ const heightValue = parsePixelDimension(
123
126
  img.getAttribute( 'height' )
124
127
  );
128
+ // When both dimensions are declared, preserve the source's
129
+ // shape via `aspectRatio` (mirroring the resize handle). CSS
130
+ // `aspect-ratio` needs no fixed dimensions, so the image keeps
131
+ // its proportions even when the `src` can't resolve to natural
132
+ // dimensions (e.g. an empty or blob `src`) — without it the
133
+ // `height: 'auto'` would collapse to `0`.
134
+ // `parseInt` is `NaN` for an absent dimension and `0` for a
135
+ // zero one (both falsy), so a bogus ratio is never stored.
136
+ const widthNumber = parseInt( widthValue, 10 );
137
+ const heightNumber = parseInt( heightValue, 10 );
138
+ const aspectRatio =
139
+ widthNumber && heightNumber
140
+ ? String( widthNumber / heightNumber )
141
+ : undefined;
142
+ // A height-only source declares a single dimension, so it can't
143
+ // carry an aspect ratio: `width: 'auto'` is capped by
144
+ // `max-width: 100%` while the fixed height can still stretch a
145
+ // wide source. This is a known edge case (a panoramic image
146
+ // pinned by height only) left unsolved here.
147
+ const width =
148
+ widthValue || ( heightValue ? 'auto' : undefined );
149
+ const height = widthValue ? 'auto' : heightValue;
125
150
  const attributes = getBlockAttributes(
126
151
  'core/image',
127
152
  node.outerHTML,
@@ -135,6 +160,7 @@ const transforms = {
135
160
  anchor,
136
161
  width,
137
162
  height,
163
+ aspectRatio,
138
164
  }
139
165
  );
140
166
 
package/src/index.js CHANGED
@@ -23,15 +23,10 @@ import HtmlRenderer from './utils/html-renderer';
23
23
  /**
24
24
  * Internal dependencies
25
25
  */
26
- // When IS_GUTENBERG_PLUGIN is set to false, imports of experimental blocks
27
- // are transformed by packages/block-library/src/index.js as follows:
28
- // import * as experimentalBlock from './experimental-block'
29
- // becomes
30
- // const experimentalBlock = null;
31
- // This enables webpack to eliminate the experimental blocks code from the
32
- // production build to make the final bundle smaller.
33
- //
34
- // See https://github.com/WordPress/gutenberg/pull/40655 for more context.
26
+ // Experimental blocks are only registered in the Gutenberg plugin (see
27
+ // `__experimentalRegisterExperimentalCoreBlocks`). `registerCoreBlocks`
28
+ // filters them out via `isBlockMetadataExperimental`, so they are never
29
+ // available in WordPress core regardless of what ends up in the bundle.
35
30
  import * as accordion from './accordion';
36
31
  import * as accordionItem from './accordion-item';
37
32
  import * as accordionHeading from './accordion-heading';
@@ -135,7 +130,6 @@ import * as siteTitle from './site-title';
135
130
  import * as socialLink from './social-link';
136
131
  import * as socialLinks from './social-links';
137
132
  import * as spacer from './spacer';
138
- import * as tab from './tab';
139
133
  import * as tabPanel from './tab-panel';
140
134
  import * as tabPanels from './tab-panels';
141
135
  import * as table from './table';
@@ -287,7 +281,6 @@ const getAllBlocks = () => {
287
281
  }
288
282
 
289
283
  if ( window?.__experimentalEnableBlockExperiments ) {
290
- blocks.push( tab );
291
284
  blocks.push( tabList );
292
285
  blocks.push( tabs );
293
286
  blocks.push( tabPanel );
@@ -288,16 +288,6 @@ function Navigation( {
288
288
  [ setAttributes ]
289
289
  );
290
290
 
291
- // Reset submenuVisibility to default if orientation changes to horizontal while "always" is selected
292
- useEffect( () => {
293
- if ( orientation === 'horizontal' && submenuVisibility === 'always' ) {
294
- setAttributes( {
295
- submenuVisibility: 'hover',
296
- showSubmenuIcon: true,
297
- } );
298
- }
299
- }, [ orientation, submenuVisibility, setAttributes ] );
300
-
301
291
  const recursionId = `navigationMenu/${ ref }`;
302
292
 
303
293
  // Skip recursion check when in preview mode.
@@ -372,6 +362,29 @@ function Navigation( {
372
362
  innerBlocks,
373
363
  } = useInnerBlocks( clientId );
374
364
 
365
+ // Reset submenuVisibility to default if orientation changes to horizontal
366
+ // while "always" is selected, but only when the Navigation block or one
367
+ // of its inner blocks is being edited. Rendering related template parts
368
+ // should not mark them dirty.
369
+ useEffect( () => {
370
+ if (
371
+ ( isSelected || isInnerBlockSelected ) &&
372
+ orientation === 'horizontal' &&
373
+ submenuVisibility === 'always'
374
+ ) {
375
+ setAttributes( {
376
+ submenuVisibility: 'hover',
377
+ showSubmenuIcon: true,
378
+ } );
379
+ }
380
+ }, [
381
+ isSelected,
382
+ isInnerBlockSelected,
383
+ orientation,
384
+ submenuVisibility,
385
+ setAttributes,
386
+ ] );
387
+
375
388
  // Use a ref to store whether we've confirmed a page-list has submenus.
376
389
  // Once confirmed, we don't need to keep checking the page-list blocks.
377
390
  const hasPageListWithSubmenuRef = useRef( false );
@@ -1557,6 +1557,64 @@ function register_block_core_navigation() {
1557
1557
 
1558
1558
  add_action( 'init', 'register_block_core_navigation' );
1559
1559
 
1560
+ /**
1561
+ * Adds the Navigation block state class to inner list containers.
1562
+ *
1563
+ * State block support adds the generated `wp-states-*` class to the outer
1564
+ * block wrapper. The Navigation block renders its menu items inside an inner
1565
+ * `wp-block-navigation__container` list, so the same state class is also needed
1566
+ * there for state styles to apply directly to the menu list.
1567
+ *
1568
+ * Currently this is required as a workaround because of how difficult it is for nav
1569
+ * child blocks to inherit styles through the complex responsive nav block html. The
1570
+ * bug in https://github.com/WordPress/gutenberg/issues/62690 also prevents inheritance.
1571
+ *
1572
+ * @since 7.1.0
1573
+ *
1574
+ * @param string $block_content The block content.
1575
+ * @param array $block The full block, including name and attributes.
1576
+ * @return string The updated block content.
1577
+ */
1578
+ function block_core_navigation_add_state_class_to_container( $block_content, $block ) {
1579
+ if ( 'core/navigation' !== ( $block['blockName'] ?? null ) || empty( $block_content ) ) {
1580
+ return $block_content;
1581
+ }
1582
+
1583
+ $processor = new WP_HTML_Tag_Processor( $block_content );
1584
+ if ( ! $processor->next_tag() ) {
1585
+ return $block_content;
1586
+ }
1587
+
1588
+ $class_attribute = $processor->get_attribute( 'class' );
1589
+ if ( ! is_string( $class_attribute ) || ! preg_match( '/\bwp-states-[a-f0-9]{8}\b/', $class_attribute, $matches ) ) {
1590
+ return $block_content;
1591
+ }
1592
+
1593
+ $state_class = $matches[0];
1594
+ while ( $processor->next_tag() ) {
1595
+ // Custom overlay content can include nested Navigation blocks.
1596
+ // Avoid applying the outer Navigation state class to an inner nav block.
1597
+ if ( $processor->has_class( 'wp-block-navigation' ) && ! $processor->has_class( 'wp-block-navigation__container' ) ) {
1598
+ break;
1599
+ }
1600
+
1601
+ if ( ! $processor->has_class( 'wp-block-navigation__container' ) ) {
1602
+ continue;
1603
+ }
1604
+
1605
+ $class_attribute = $processor->get_attribute( 'class' );
1606
+ if ( is_string( $class_attribute ) && preg_match( '/\bwp-states-[a-f0-9]{8}\b/', $class_attribute ) ) {
1607
+ continue;
1608
+ }
1609
+
1610
+ $processor->add_class( $state_class );
1611
+ }
1612
+
1613
+ return $processor->get_updated_html();
1614
+ }
1615
+
1616
+ add_filter( 'render_block', 'block_core_navigation_add_state_class_to_container', 11, 2 );
1617
+
1560
1618
  /**
1561
1619
  * Filter that changes the parsed attribute values of navigation blocks contain typographic presets to contain the values directly.
1562
1620
  *
@@ -29,6 +29,7 @@ _Defined via the [`attributes`](https://developer.wordpress.org/block-editor/ref
29
29
  | `title` | `string` | — | — |
30
30
  | `kind` | `string` | — | — |
31
31
  | `isTopLevelItem` | `boolean` | — | — |
32
+ | `isParentSubmenu` | `boolean` | `true` | — |
32
33
 
33
34
  ## Supports
34
35
 
@@ -65,6 +66,10 @@ _Defined via the [`usesContext` and `providesContext`](https://developer.wordpre
65
66
  - `submenuVisibility`
66
67
  - `style`
67
68
 
69
+ **Provides context:**
70
+
71
+ - `core/isInsideSubmenu` → attribute `isParentSubmenu`
72
+
68
73
  ## Block Markup
69
74
 
70
75
  This is a [**hybrid block**](https://developer.wordpress.org/block-editor/getting-started/fundamentals/static-dynamic-rendering/). It saves static markup that the server may enhance during rendering.
@@ -40,8 +40,15 @@
40
40
  },
41
41
  "isTopLevelItem": {
42
42
  "type": "boolean"
43
+ },
44
+ "isParentSubmenu": {
45
+ "type": "boolean",
46
+ "default": true
43
47
  }
44
48
  },
49
+ "providesContext": {
50
+ "core/isInsideSubmenu": "isParentSubmenu"
51
+ },
45
52
  "usesContext": [
46
53
  "textColor",
47
54
  "customTextColor",
@@ -21,7 +21,6 @@ _Defined via the [`attributes`](https://developer.wordpress.org/block-editor/ref
21
21
  | Attribute | [Type](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#type-validation) | [Default](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-attributes/#default-value) | Description |
22
22
  |-----------|------|---------|-------------|
23
23
  | `parentPageID` | `integer` | `0` | — |
24
- | `isNested` | `boolean` | `false` | — |
25
24
 
26
25
  ## Supports
27
26
 
@@ -65,6 +64,7 @@ _Defined via the [`usesContext` and `providesContext`](https://developer.wordpre
65
64
  - `style`
66
65
  - `openSubmenusOnClick`
67
66
  - `submenuVisibility`
67
+ - `core/isInsideSubmenu`
68
68
 
69
69
  ## Block Markup
70
70
 
@@ -12,10 +12,6 @@
12
12
  "parentPageID": {
13
13
  "type": "integer",
14
14
  "default": 0
15
- },
16
- "isNested": {
17
- "type": "boolean",
18
- "default": false
19
15
  }
20
16
  },
21
17
  "usesContext": [
@@ -32,7 +28,8 @@
32
28
  "showSubmenuIcon",
33
29
  "style",
34
30
  "openSubmenusOnClick",
35
- "submenuVisibility"
31
+ "submenuVisibility",
32
+ "core/isInsideSubmenu"
36
33
  ],
37
34
  "supports": {
38
35
  "anchor": true,
@@ -254,7 +254,6 @@ export default function PageListEdit( {
254
254
  );
255
255
 
256
256
  const {
257
- isNested,
258
257
  hasSelectedChild,
259
258
  parentClientId,
260
259
  hasDraggedChild,
@@ -266,18 +265,12 @@ export default function PageListEdit( {
266
265
  hasSelectedInnerBlock,
267
266
  hasDraggedInnerBlock,
268
267
  } = select( blockEditorStore );
269
- const blockParents = getBlockParentsByBlockName(
270
- clientId,
271
- 'core/navigation-submenu',
272
- true
273
- );
274
268
  const navigationBlockParents = getBlockParentsByBlockName(
275
269
  clientId,
276
270
  'core/navigation',
277
271
  true
278
272
  );
279
273
  return {
280
- isNested: blockParents.length > 0,
281
274
  isChildOfNavigation: navigationBlockParents.length > 0,
282
275
  hasSelectedChild: hasSelectedInnerBlock( clientId, true ),
283
276
  hasDraggedChild: hasDraggedInnerBlock( clientId, true ),
@@ -318,10 +311,6 @@ export default function PageListEdit( {
318
311
  openModal,
319
312
  ] );
320
313
 
321
- useEffect( () => {
322
- setAttributes( { isNested } );
323
- }, [ isNested, setAttributes ] );
324
-
325
314
  return (
326
315
  <>
327
316
  { ( pagesTree.length > 0 || allowConvertToLinks ) && (
@@ -259,7 +259,7 @@ function render_block_core_page_list( $attributes, $content, $block ) {
259
259
  ++$block_id;
260
260
 
261
261
  $parent_page_id = $attributes['parentPageID'];
262
- $is_nested = $attributes['isNested'];
262
+ $is_nested = ! empty( $block->context['core/isInsideSubmenu'] );
263
263
 
264
264
  $all_pages = get_pages(
265
265
  array(
@@ -210,7 +210,7 @@ export default function PostDateEdit( props ) {
210
210
  <ToolsPanelItem
211
211
  hasValue={ () => isLink !== false }
212
212
  label={
213
- postType?.labels.singular_name
213
+ postType?.labels?.singular_name
214
214
  ? sprintf(
215
215
  // translators: %s: Name of the post type e.g: "post".
216
216
  __( 'Link to %s' ),
@@ -223,7 +223,7 @@ export default function PostDateEdit( props ) {
223
223
  >
224
224
  <ToggleControl
225
225
  label={
226
- postType?.labels.singular_name
226
+ postType?.labels?.singular_name
227
227
  ? sprintf(
228
228
  // translators: %s: Name of the post type e.g: "post".
229
229
  __( 'Link to %s' ),
@@ -62,6 +62,7 @@ _Defined via the [`usesContext` and `providesContext`](https://developer.wordpre
62
62
 
63
63
  _Defined via the [`selectors`](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-selectors/) property in block.json._
64
64
 
65
+ - **dimensions**: `.wp-block-post-featured-image img`
65
66
  - **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`
66
67
  - **shadow**: `.wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder`
67
68
  - **filter**:
@@ -98,6 +98,7 @@
98
98
  }
99
99
  },
100
100
  "selectors": {
101
+ "dimensions": ".wp-block-post-featured-image img",
101
102
  "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",
102
103
  "shadow": ".wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder",
103
104
  "filter": {