@wordpress/block-library 10.1.1-next.v.202607070741.0 → 10.3.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 (580) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/build/accordion/block.json +1 -0
  3. package/build/accordion-panel/block.json +1 -0
  4. package/build/button/edit.cjs +18 -8
  5. package/build/button/edit.cjs.map +2 -2
  6. package/build/code/edit.cjs +3 -1
  7. package/build/code/edit.cjs.map +2 -2
  8. package/build/cover/block.json +12 -0
  9. package/build/cover/edit/block-controls.cjs +14 -5
  10. package/build/cover/edit/block-controls.cjs.map +2 -2
  11. package/build/cover/edit/embed-video-url-input.cjs +5 -3
  12. package/build/cover/edit/embed-video-url-input.cjs.map +3 -3
  13. package/build/cover/edit/index.cjs +76 -32
  14. package/build/cover/edit/index.cjs.map +2 -2
  15. package/build/cover/embed-video-utils.cjs +17 -7
  16. package/build/cover/embed-video-utils.cjs.map +2 -2
  17. package/build/details/transforms.cjs +1 -3
  18. package/build/details/transforms.cjs.map +2 -2
  19. package/build/embed/edit.cjs +1 -1
  20. package/build/embed/edit.cjs.map +2 -2
  21. package/build/embed/embed-placeholder.cjs +1 -2
  22. package/build/embed/embed-placeholder.cjs.map +2 -2
  23. package/build/file/edit.cjs +4 -3
  24. package/build/file/edit.cjs.map +2 -2
  25. package/build/file/transforms.cjs +25 -60
  26. package/build/file/transforms.cjs.map +2 -2
  27. package/build/gallery/block.json +4 -2
  28. package/build/gallery/dynamic-gallery.cjs +104 -61
  29. package/build/gallery/dynamic-gallery.cjs.map +3 -3
  30. package/build/gallery/edit.cjs +1 -1
  31. package/build/gallery/edit.cjs.map +3 -3
  32. package/build/gallery/gap-styles.cjs +49 -13
  33. package/build/gallery/gap-styles.cjs.map +3 -3
  34. package/build/gallery/use-dynamic-gallery.cjs +15 -8
  35. package/build/gallery/use-dynamic-gallery.cjs.map +2 -2
  36. package/build/group/transforms.cjs +1 -1
  37. package/build/group/transforms.cjs.map +2 -2
  38. package/build/heading/edit.cjs +1 -1
  39. package/build/heading/edit.cjs.map +2 -2
  40. package/build/html/modal.cjs +63 -54
  41. package/build/html/modal.cjs.map +3 -3
  42. package/build/icon/block.json +5 -3
  43. package/build/icon/components/custom-inserter/icon-grid.cjs +25 -12
  44. package/build/icon/components/custom-inserter/icon-grid.cjs.map +2 -2
  45. package/build/icon/components/custom-inserter/index.cjs +100 -31
  46. package/build/icon/components/custom-inserter/index.cjs.map +3 -3
  47. package/build/icon/edit.cjs +11 -12
  48. package/build/icon/edit.cjs.map +2 -2
  49. package/build/image/block.json +1 -1
  50. package/build/image/edit.cjs +1 -35
  51. package/build/image/edit.cjs.map +2 -2
  52. package/build/image/image.cjs +23 -18
  53. package/build/image/image.cjs.map +3 -3
  54. package/build/image/transforms.cjs +78 -0
  55. package/build/image/transforms.cjs.map +3 -3
  56. package/build/image/use-open-image-media-editor-modal.cjs +6 -2
  57. package/build/image/use-open-image-media-editor-modal.cjs.map +2 -2
  58. package/build/index.cjs +18 -8
  59. package/build/index.cjs.map +2 -2
  60. package/build/latest-posts/edit.cjs +5 -8
  61. package/build/latest-posts/edit.cjs.map +2 -2
  62. package/build/list-item/edit.cjs +1 -1
  63. package/build/list-item/edit.cjs.map +2 -2
  64. package/build/list-item/hooks/use-enter.cjs +14 -17
  65. package/build/list-item/hooks/use-enter.cjs.map +3 -3
  66. package/build/list-item/hooks/use-indent-list-item.cjs +10 -2
  67. package/build/list-item/hooks/use-indent-list-item.cjs.map +2 -2
  68. package/build/list-item/hooks/use-space.cjs +3 -2
  69. package/build/list-item/hooks/use-space.cjs.map +3 -3
  70. package/build/math/edit.cjs +39 -56
  71. package/build/math/edit.cjs.map +3 -3
  72. package/build/media-text/edit.cjs +2 -1
  73. package/build/media-text/edit.cjs.map +2 -2
  74. package/build/more/edit.cjs +2 -2
  75. package/build/more/edit.cjs.map +2 -2
  76. package/build/navigation/edit/index.cjs +30 -16
  77. package/build/navigation/edit/index.cjs.map +3 -3
  78. package/build/navigation/edit/use-layout-custom-properties.cjs +72 -0
  79. package/build/navigation/edit/use-layout-custom-properties.cjs.map +7 -0
  80. package/build/navigation/view.cjs +9 -6
  81. package/build/navigation/view.cjs.map +2 -2
  82. package/build/navigation-link/edit.cjs +3 -3
  83. package/build/navigation-link/edit.cjs.map +2 -2
  84. package/build/navigation-link/link-ui/index.cjs +2 -2
  85. package/build/navigation-link/link-ui/index.cjs.map +2 -2
  86. package/build/paragraph/edit.cjs +5 -2
  87. package/build/paragraph/edit.cjs.map +3 -3
  88. package/build/paragraph/index.cjs +4 -1
  89. package/build/paragraph/index.cjs.map +2 -2
  90. package/build/paragraph/use-enter.cjs +3 -7
  91. package/build/paragraph/use-enter.cjs.map +3 -3
  92. package/build/playlist/block.json +29 -10
  93. package/build/playlist/context.cjs +2 -1
  94. package/build/playlist/context.cjs.map +2 -2
  95. package/build/playlist/edit.cjs +328 -39
  96. package/build/playlist/edit.cjs.map +3 -3
  97. package/build/playlist/index.cjs +1 -1
  98. package/build/playlist/index.cjs.map +2 -2
  99. package/build/playlist/utils.cjs +37 -8
  100. package/build/playlist/utils.cjs.map +2 -2
  101. package/build/playlist/view.cjs +83 -13
  102. package/build/playlist/view.cjs.map +2 -2
  103. package/build/playlist-track/block.json +4 -2
  104. package/build/playlist-track/edit.cjs +115 -70
  105. package/build/playlist-track/edit.cjs.map +2 -2
  106. package/build/post-content/block.json +1 -0
  107. package/build/post-content/edit.cjs +36 -15
  108. package/build/post-content/edit.cjs.map +2 -2
  109. package/build/post-featured-image/edit.cjs +3 -2
  110. package/build/post-featured-image/edit.cjs.map +2 -2
  111. package/build/post-template/block.json +2 -1
  112. package/build/post-template/edit.cjs +10 -1
  113. package/build/post-template/edit.cjs.map +2 -2
  114. package/build/post-terms/edit.cjs +2 -2
  115. package/build/post-terms/edit.cjs.map +2 -2
  116. package/build/post-title/edit.cjs +2 -2
  117. package/build/post-title/edit.cjs.map +2 -2
  118. package/build/preformatted/edit.cjs +3 -1
  119. package/build/preformatted/edit.cjs.map +2 -2
  120. package/build/pullquote/block.json +3 -1
  121. package/build/pullquote/edit.cjs +5 -3
  122. package/build/pullquote/edit.cjs.map +2 -2
  123. package/build/query/block.json +3 -2
  124. package/build/query/edit/inspector-controls/index.cjs +42 -5
  125. package/build/query/edit/inspector-controls/index.cjs.map +2 -2
  126. package/build/query/edit/inspector-controls/offset-controls.cjs +1 -2
  127. package/build/query/edit/inspector-controls/offset-controls.cjs.map +2 -2
  128. package/build/query/edit/inspector-controls/pages-control.cjs +0 -1
  129. package/build/query/edit/inspector-controls/pages-control.cjs.map +2 -2
  130. package/build/query/edit/query-content.cjs +10 -3
  131. package/build/query/edit/query-content.cjs.map +2 -2
  132. package/build/query/index.cjs +2 -1
  133. package/build/query/index.cjs.map +2 -2
  134. package/build/quote/block.json +3 -1
  135. package/build/quote/transforms.cjs +1 -3
  136. package/build/quote/transforms.cjs.map +2 -2
  137. package/build/read-more/edit.cjs +3 -1
  138. package/build/read-more/edit.cjs.map +2 -2
  139. package/build/rss/edit.cjs +0 -1
  140. package/build/rss/edit.cjs.map +2 -2
  141. package/build/site-tagline/edit.cjs +3 -1
  142. package/build/site-tagline/edit.cjs.map +2 -2
  143. package/build/site-title/edit.cjs +3 -1
  144. package/build/site-title/edit.cjs.map +2 -2
  145. package/build/social-links/edit.cjs +11 -4
  146. package/build/social-links/edit.cjs.map +2 -2
  147. package/build/tab-list/block.json +4 -3
  148. package/build/tab-list/edit.cjs +67 -11
  149. package/build/tab-list/edit.cjs.map +3 -3
  150. package/build/tab-list/tab-movers.cjs +87 -0
  151. package/build/tab-list/tab-movers.cjs.map +7 -0
  152. package/build/tab-panel/block.json +1 -6
  153. package/build/tab-panel/edit.cjs +16 -24
  154. package/build/tab-panel/edit.cjs.map +2 -2
  155. package/build/tab-panels/block.json +0 -1
  156. package/build/table/edit.cjs +1 -1
  157. package/build/table/edit.cjs.map +2 -2
  158. package/build/tabs/block.json +0 -5
  159. package/build/tabs/edit.cjs +4 -39
  160. package/build/tabs/edit.cjs.map +3 -3
  161. package/build/tabs/use-tab-actions.cjs +23 -1
  162. package/build/tabs/use-tab-actions.cjs.map +2 -2
  163. package/build/tabs/use-tab-list-items-sync.cjs +19 -1
  164. package/build/tabs/use-tab-list-items-sync.cjs.map +2 -2
  165. package/build/term-name/block.json +1 -3
  166. package/build/term-name/deprecated.cjs +105 -0
  167. package/build/term-name/deprecated.cjs.map +7 -0
  168. package/build/term-name/edit.cjs +11 -37
  169. package/build/term-name/edit.cjs.map +3 -3
  170. package/build/term-name/index.cjs +3 -1
  171. package/build/term-name/index.cjs.map +3 -3
  172. package/build/utils/caption.cjs +2 -2
  173. package/build/utils/caption.cjs.map +2 -2
  174. package/build/utils/waveform-player.cjs +138 -22
  175. package/build/utils/waveform-player.cjs.map +2 -2
  176. package/build/utils/waveform-utils.cjs +315 -17
  177. package/build/utils/waveform-utils.cjs.map +2 -2
  178. package/build/verse/edit.cjs +3 -1
  179. package/build/verse/edit.cjs.map +2 -2
  180. package/build/video/edit.cjs +2 -11
  181. package/build/video/edit.cjs.map +3 -3
  182. package/build/video/tracks-editor.cjs +0 -1
  183. package/build/video/tracks-editor.cjs.map +2 -2
  184. package/build-module/accordion/block.json +1 -0
  185. package/build-module/accordion-panel/block.json +1 -0
  186. package/build-module/button/edit.mjs +19 -14
  187. package/build-module/button/edit.mjs.map +2 -2
  188. package/build-module/code/edit.mjs +3 -1
  189. package/build-module/code/edit.mjs.map +2 -2
  190. package/build-module/cover/block.json +12 -0
  191. package/build-module/cover/edit/block-controls.mjs +14 -5
  192. package/build-module/cover/edit/block-controls.mjs.map +2 -2
  193. package/build-module/cover/edit/embed-video-url-input.mjs +5 -4
  194. package/build-module/cover/edit/embed-video-url-input.mjs.map +2 -2
  195. package/build-module/cover/edit/index.mjs +79 -35
  196. package/build-module/cover/edit/index.mjs.map +2 -2
  197. package/build-module/cover/embed-video-utils.mjs +16 -7
  198. package/build-module/cover/embed-video-utils.mjs.map +2 -2
  199. package/build-module/details/transforms.mjs +2 -7
  200. package/build-module/details/transforms.mjs.map +2 -2
  201. package/build-module/embed/edit.mjs +1 -1
  202. package/build-module/embed/edit.mjs.map +2 -2
  203. package/build-module/embed/embed-placeholder.mjs +1 -2
  204. package/build-module/embed/embed-placeholder.mjs.map +2 -2
  205. package/build-module/file/edit.mjs +4 -3
  206. package/build-module/file/edit.mjs.map +2 -2
  207. package/build-module/file/transforms.mjs +25 -60
  208. package/build-module/file/transforms.mjs.map +2 -2
  209. package/build-module/gallery/block.json +4 -2
  210. package/build-module/gallery/dynamic-gallery.mjs +104 -61
  211. package/build-module/gallery/dynamic-gallery.mjs.map +2 -2
  212. package/build-module/gallery/edit.mjs +3 -3
  213. package/build-module/gallery/edit.mjs.map +2 -2
  214. package/build-module/gallery/gap-styles.mjs +53 -14
  215. package/build-module/gallery/gap-styles.mjs.map +2 -2
  216. package/build-module/gallery/use-dynamic-gallery.mjs +16 -9
  217. package/build-module/gallery/use-dynamic-gallery.mjs.map +2 -2
  218. package/build-module/group/transforms.mjs +2 -5
  219. package/build-module/group/transforms.mjs.map +2 -2
  220. package/build-module/heading/edit.mjs +1 -1
  221. package/build-module/heading/edit.mjs.map +2 -2
  222. package/build-module/html/modal.mjs +68 -55
  223. package/build-module/html/modal.mjs.map +2 -2
  224. package/build-module/icon/block.json +5 -3
  225. package/build-module/icon/components/custom-inserter/icon-grid.mjs +25 -12
  226. package/build-module/icon/components/custom-inserter/icon-grid.mjs.map +2 -2
  227. package/build-module/icon/components/custom-inserter/index.mjs +102 -33
  228. package/build-module/icon/components/custom-inserter/index.mjs.map +2 -2
  229. package/build-module/icon/edit.mjs +11 -12
  230. package/build-module/icon/edit.mjs.map +2 -2
  231. package/build-module/image/block.json +1 -1
  232. package/build-module/image/edit.mjs +1 -35
  233. package/build-module/image/edit.mjs.map +2 -2
  234. package/build-module/image/image.mjs +23 -18
  235. package/build-module/image/image.mjs.map +2 -2
  236. package/build-module/image/transforms.mjs +78 -0
  237. package/build-module/image/transforms.mjs.map +2 -2
  238. package/build-module/image/use-open-image-media-editor-modal.mjs +6 -2
  239. package/build-module/image/use-open-image-media-editor-modal.mjs.map +2 -2
  240. package/build-module/index.mjs +18 -8
  241. package/build-module/index.mjs.map +2 -2
  242. package/build-module/latest-posts/edit.mjs +5 -8
  243. package/build-module/latest-posts/edit.mjs.map +2 -2
  244. package/build-module/list-item/edit.mjs +1 -1
  245. package/build-module/list-item/edit.mjs.map +2 -2
  246. package/build-module/list-item/hooks/use-enter.mjs +15 -21
  247. package/build-module/list-item/hooks/use-enter.mjs.map +2 -2
  248. package/build-module/list-item/hooks/use-indent-list-item.mjs +10 -2
  249. package/build-module/list-item/hooks/use-indent-list-item.mjs.map +2 -2
  250. package/build-module/list-item/hooks/use-space.mjs +4 -6
  251. package/build-module/list-item/hooks/use-space.mjs.map +2 -2
  252. package/build-module/math/edit.mjs +41 -60
  253. package/build-module/math/edit.mjs.map +2 -2
  254. package/build-module/media-text/edit.mjs +2 -1
  255. package/build-module/media-text/edit.mjs.map +2 -2
  256. package/build-module/more/edit.mjs +2 -2
  257. package/build-module/more/edit.mjs.map +2 -2
  258. package/build-module/navigation/edit/index.mjs +30 -16
  259. package/build-module/navigation/edit/index.mjs.map +2 -2
  260. package/build-module/navigation/edit/use-layout-custom-properties.mjs +51 -0
  261. package/build-module/navigation/edit/use-layout-custom-properties.mjs.map +7 -0
  262. package/build-module/navigation/view.mjs +9 -6
  263. package/build-module/navigation/view.mjs.map +2 -2
  264. package/build-module/navigation-link/edit.mjs +3 -3
  265. package/build-module/navigation-link/edit.mjs.map +2 -2
  266. package/build-module/navigation-link/link-ui/index.mjs +2 -2
  267. package/build-module/navigation-link/link-ui/index.mjs.map +2 -2
  268. package/build-module/paragraph/edit.mjs +6 -2
  269. package/build-module/paragraph/edit.mjs.map +2 -2
  270. package/build-module/paragraph/index.mjs +4 -1
  271. package/build-module/paragraph/index.mjs.map +2 -2
  272. package/build-module/paragraph/use-enter.mjs +4 -11
  273. package/build-module/paragraph/use-enter.mjs.map +2 -2
  274. package/build-module/playlist/block.json +29 -10
  275. package/build-module/playlist/context.mjs +2 -1
  276. package/build-module/playlist/context.mjs.map +2 -2
  277. package/build-module/playlist/edit.mjs +331 -41
  278. package/build-module/playlist/edit.mjs.map +2 -2
  279. package/build-module/playlist/index.mjs +1 -1
  280. package/build-module/playlist/index.mjs.map +2 -2
  281. package/build-module/playlist/utils.mjs +35 -7
  282. package/build-module/playlist/utils.mjs.map +2 -2
  283. package/build-module/playlist/view.mjs +89 -14
  284. package/build-module/playlist/view.mjs.map +2 -2
  285. package/build-module/playlist-track/block.json +4 -2
  286. package/build-module/playlist-track/edit.mjs +117 -71
  287. package/build-module/playlist-track/edit.mjs.map +2 -2
  288. package/build-module/post-content/block.json +1 -0
  289. package/build-module/post-content/edit.mjs +37 -15
  290. package/build-module/post-content/edit.mjs.map +2 -2
  291. package/build-module/post-featured-image/edit.mjs +3 -2
  292. package/build-module/post-featured-image/edit.mjs.map +2 -2
  293. package/build-module/post-template/block.json +2 -1
  294. package/build-module/post-template/edit.mjs +10 -1
  295. package/build-module/post-template/edit.mjs.map +2 -2
  296. package/build-module/post-terms/edit.mjs +2 -2
  297. package/build-module/post-terms/edit.mjs.map +2 -2
  298. package/build-module/post-title/edit.mjs +2 -2
  299. package/build-module/post-title/edit.mjs.map +2 -2
  300. package/build-module/preformatted/edit.mjs +3 -1
  301. package/build-module/preformatted/edit.mjs.map +2 -2
  302. package/build-module/pullquote/block.json +3 -1
  303. package/build-module/pullquote/edit.mjs +5 -3
  304. package/build-module/pullquote/edit.mjs.map +2 -2
  305. package/build-module/query/block.json +3 -2
  306. package/build-module/query/edit/inspector-controls/index.mjs +44 -6
  307. package/build-module/query/edit/inspector-controls/index.mjs.map +2 -2
  308. package/build-module/query/edit/inspector-controls/offset-controls.mjs +2 -3
  309. package/build-module/query/edit/inspector-controls/offset-controls.mjs.map +2 -2
  310. package/build-module/query/edit/inspector-controls/pages-control.mjs +0 -1
  311. package/build-module/query/edit/inspector-controls/pages-control.mjs.map +2 -2
  312. package/build-module/query/edit/query-content.mjs +10 -3
  313. package/build-module/query/edit/query-content.mjs.map +2 -2
  314. package/build-module/query/index.mjs +2 -1
  315. package/build-module/query/index.mjs.map +2 -2
  316. package/build-module/quote/block.json +3 -1
  317. package/build-module/quote/transforms.mjs +2 -4
  318. package/build-module/quote/transforms.mjs.map +2 -2
  319. package/build-module/read-more/edit.mjs +3 -1
  320. package/build-module/read-more/edit.mjs.map +2 -2
  321. package/build-module/rss/edit.mjs +0 -1
  322. package/build-module/rss/edit.mjs.map +2 -2
  323. package/build-module/site-tagline/edit.mjs +3 -1
  324. package/build-module/site-tagline/edit.mjs.map +2 -2
  325. package/build-module/site-title/edit.mjs +3 -1
  326. package/build-module/site-title/edit.mjs.map +2 -2
  327. package/build-module/social-links/edit.mjs +11 -4
  328. package/build-module/social-links/edit.mjs.map +2 -2
  329. package/build-module/tab-list/block.json +4 -3
  330. package/build-module/tab-list/edit.mjs +74 -13
  331. package/build-module/tab-list/edit.mjs.map +2 -2
  332. package/build-module/tab-list/tab-movers.mjs +59 -0
  333. package/build-module/tab-list/tab-movers.mjs.map +7 -0
  334. package/build-module/tab-panel/block.json +1 -6
  335. package/build-module/tab-panel/edit.mjs +17 -25
  336. package/build-module/tab-panel/edit.mjs.map +2 -2
  337. package/build-module/tab-panels/block.json +0 -1
  338. package/build-module/table/edit.mjs +1 -1
  339. package/build-module/table/edit.mjs.map +2 -2
  340. package/build-module/tabs/block.json +0 -5
  341. package/build-module/tabs/edit.mjs +5 -45
  342. package/build-module/tabs/edit.mjs.map +2 -2
  343. package/build-module/tabs/use-tab-actions.mjs +23 -1
  344. package/build-module/tabs/use-tab-actions.mjs.map +2 -2
  345. package/build-module/tabs/use-tab-list-items-sync.mjs +19 -1
  346. package/build-module/tabs/use-tab-list-items-sync.mjs.map +2 -2
  347. package/build-module/term-name/block.json +1 -3
  348. package/build-module/term-name/deprecated.mjs +74 -0
  349. package/build-module/term-name/deprecated.mjs.map +7 -0
  350. package/build-module/term-name/edit.mjs +11 -28
  351. package/build-module/term-name/edit.mjs.map +2 -2
  352. package/build-module/term-name/index.mjs +3 -1
  353. package/build-module/term-name/index.mjs.map +2 -2
  354. package/build-module/utils/caption.mjs +2 -2
  355. package/build-module/utils/caption.mjs.map +2 -2
  356. package/build-module/utils/waveform-player.mjs +144 -23
  357. package/build-module/utils/waveform-player.mjs.map +2 -2
  358. package/build-module/utils/waveform-utils.mjs +310 -16
  359. package/build-module/utils/waveform-utils.mjs.map +2 -2
  360. package/build-module/verse/edit.mjs +3 -1
  361. package/build-module/verse/edit.mjs.map +2 -2
  362. package/build-module/video/edit.mjs +2 -11
  363. package/build-module/video/edit.mjs.map +2 -2
  364. package/build-module/video/tracks-editor.mjs +0 -1
  365. package/build-module/video/tracks-editor.mjs.map +2 -2
  366. package/build-style/cover/editor-rtl.css +3 -0
  367. package/build-style/cover/editor.css +3 -0
  368. package/build-style/editor-rtl.css +61 -59
  369. package/build-style/editor.css +61 -59
  370. package/build-style/icon/editor-rtl.css +80 -10
  371. package/build-style/icon/editor.css +80 -10
  372. package/build-style/image/editor-rtl.css +3 -32
  373. package/build-style/image/editor.css +3 -32
  374. package/build-style/more/editor-rtl.css +2 -2
  375. package/build-style/more/editor.css +2 -2
  376. package/build-style/navigation/editor-rtl.css +3 -4
  377. package/build-style/navigation/editor.css +3 -4
  378. package/build-style/navigation-link/editor-rtl.css +1 -1
  379. package/build-style/navigation-link/editor.css +1 -1
  380. package/build-style/nextpage/editor-rtl.css +2 -2
  381. package/build-style/nextpage/editor.css +2 -2
  382. package/build-style/playlist/editor-rtl.css +4 -3
  383. package/build-style/playlist/editor.css +4 -3
  384. package/build-style/playlist/style-rtl.css +81 -5
  385. package/build-style/playlist/style.css +81 -5
  386. package/build-style/playlist-track/style-rtl.css +10 -0
  387. package/build-style/playlist-track/style.css +10 -0
  388. package/build-style/pullquote/editor-rtl.css +4 -0
  389. package/build-style/pullquote/editor.css +4 -0
  390. package/build-style/style-rtl.css +91 -5
  391. package/build-style/style.css +91 -5
  392. package/build-style/tab-list/editor-rtl.css +101 -0
  393. package/build-style/tab-list/editor.css +101 -0
  394. package/build-style/video/editor-rtl.css +1 -1
  395. package/build-style/video/editor.css +1 -1
  396. package/build-types/table-of-contents/list.d.ts +1 -1
  397. package/build-types/table-of-contents/list.d.ts.map +1 -1
  398. package/package.json +47 -45
  399. package/src/accordion/README.md +1 -0
  400. package/src/accordion/block.json +1 -0
  401. package/src/accordion-panel/block.json +1 -0
  402. package/src/breadcrumbs/index.php +3 -1
  403. package/src/button/edit.js +21 -15
  404. package/src/button/index.php +1 -1
  405. package/src/code/edit.js +7 -2
  406. package/src/cover/README.md +60 -0
  407. package/src/cover/block.json +12 -0
  408. package/src/cover/edit/block-controls.js +26 -11
  409. package/src/cover/edit/embed-video-url-input.js +5 -4
  410. package/src/cover/edit/index.js +109 -46
  411. package/src/cover/editor.scss +6 -0
  412. package/src/cover/embed-video-utils.js +38 -13
  413. package/src/cover/index.php +9 -2
  414. package/src/details/transforms.js +2 -7
  415. package/src/editor.scss +1 -0
  416. package/src/embed/edit.js +3 -1
  417. package/src/embed/embed-placeholder.js +9 -8
  418. package/src/file/edit.js +8 -8
  419. package/src/file/transforms.js +28 -60
  420. package/src/form/index.php +6 -4
  421. package/src/gallery/README.md +1 -1
  422. package/src/gallery/block.json +4 -2
  423. package/src/gallery/dynamic-gallery.js +133 -74
  424. package/src/gallery/edit.js +3 -3
  425. package/src/gallery/gap-styles.js +79 -20
  426. package/src/gallery/index.php +103 -43
  427. package/src/gallery/use-dynamic-gallery.js +27 -12
  428. package/src/group/transforms.js +2 -5
  429. package/src/heading/edit.js +1 -1
  430. package/src/html/modal.js +13 -2
  431. package/src/icon/README.md +1 -3
  432. package/src/icon/block.json +5 -3
  433. package/src/icon/components/custom-inserter/icon-grid.js +40 -11
  434. package/src/icon/components/custom-inserter/index.js +98 -25
  435. package/src/icon/edit.js +11 -17
  436. package/src/icon/editor.scss +33 -11
  437. package/src/image/README.md +1 -1
  438. package/src/image/block.json +1 -1
  439. package/src/image/edit.js +1 -57
  440. package/src/image/editor.scss +6 -44
  441. package/src/image/image.js +56 -27
  442. package/src/image/test/use-open-image-media-editor-modal.js +37 -1
  443. package/src/image/transforms.js +128 -0
  444. package/src/image/use-open-image-media-editor-modal.js +8 -1
  445. package/src/index.js +19 -7
  446. package/src/latest-posts/edit.js +5 -8
  447. package/src/latest-posts/index.php +49 -18
  448. package/src/list-item/edit.js +1 -1
  449. package/src/list-item/hooks/use-enter.js +15 -22
  450. package/src/list-item/hooks/use-indent-list-item.js +10 -1
  451. package/src/list-item/hooks/use-space.js +4 -6
  452. package/src/math/edit.js +42 -59
  453. package/src/media-text/edit.js +1 -0
  454. package/src/media-text/editor.scss +1 -0
  455. package/src/media-text/index.php +11 -2
  456. package/src/more/edit.js +7 -4
  457. package/src/more/editor.scss +1 -1
  458. package/src/navigation/edit/index.js +52 -36
  459. package/src/navigation/edit/test/layout-custom-properties.js +138 -0
  460. package/src/navigation/edit/use-layout-custom-properties.js +84 -0
  461. package/src/navigation/editor.scss +1 -2
  462. package/src/navigation/index.php +123 -12
  463. package/src/navigation/test/view.js +51 -0
  464. package/src/navigation/view.js +15 -14
  465. package/src/navigation-link/edit.js +11 -7
  466. package/src/navigation-link/editor.scss +1 -1
  467. package/src/navigation-link/index.php +70 -3
  468. package/src/navigation-link/link-ui/index.js +2 -1
  469. package/src/navigation-link/test/__snapshots__/hooks.js.snap +1 -1
  470. package/src/navigation-submenu/index.php +6 -3
  471. package/src/nextpage/editor.scss +1 -1
  472. package/src/page-list/index.php +4 -3
  473. package/src/paragraph/edit.js +9 -2
  474. package/src/paragraph/index.js +4 -1
  475. package/src/paragraph/use-enter.js +4 -11
  476. package/src/pattern/index.php +5 -5
  477. package/src/playlist/README.md +17 -18
  478. package/src/playlist/block.json +29 -10
  479. package/src/playlist/context.js +1 -0
  480. package/src/playlist/edit.js +395 -59
  481. package/src/playlist/editor.scss +4 -5
  482. package/src/playlist/index.js +1 -1
  483. package/src/playlist/index.php +71 -22
  484. package/src/playlist/style.scss +54 -1
  485. package/src/playlist/test/edit-component.js +139 -0
  486. package/src/playlist/test/edit.js +43 -2
  487. package/src/playlist/utils.js +49 -10
  488. package/src/playlist/view.js +97 -16
  489. package/src/playlist-track/README.md +3 -3
  490. package/src/playlist-track/block.json +4 -2
  491. package/src/playlist-track/edit.js +116 -75
  492. package/src/playlist-track/index.php +26 -11
  493. package/src/playlist-track/style.scss +10 -0
  494. package/src/playlist-track/test/edit.js +253 -0
  495. package/src/post-content/README.md +1 -0
  496. package/src/post-content/block.json +1 -0
  497. package/src/post-content/edit.js +45 -16
  498. package/src/post-excerpt/index.php +4 -1
  499. package/src/post-featured-image/edit.js +3 -2
  500. package/src/post-featured-image/index.php +4 -1
  501. package/src/post-template/README.md +1 -0
  502. package/src/post-template/block.json +2 -1
  503. package/src/post-template/edit.js +9 -0
  504. package/src/post-terms/edit.js +7 -4
  505. package/src/post-title/edit.js +5 -3
  506. package/src/preformatted/edit.js +7 -2
  507. package/src/pullquote/README.md +1 -0
  508. package/src/pullquote/block.json +3 -1
  509. package/src/pullquote/edit.js +9 -4
  510. package/src/pullquote/editor.scss +6 -0
  511. package/src/query/README.md +2 -1
  512. package/src/query/block.json +3 -2
  513. package/src/query/edit/inspector-controls/index.js +47 -4
  514. package/src/query/edit/inspector-controls/offset-controls.js +2 -3
  515. package/src/query/edit/inspector-controls/pages-control.js +0 -1
  516. package/src/query/edit/query-content.js +19 -3
  517. package/src/query/index.js +1 -0
  518. package/src/quote/README.md +1 -0
  519. package/src/quote/block.json +3 -1
  520. package/src/quote/transforms.js +2 -4
  521. package/src/read-more/edit.js +7 -2
  522. package/src/rss/edit.js +0 -1
  523. package/src/rss/index.php +10 -4
  524. package/src/site-tagline/edit.js +7 -2
  525. package/src/site-title/edit.js +7 -2
  526. package/src/social-link/index.php +19 -9
  527. package/src/social-links/edit.js +21 -12
  528. package/src/tab-list/README.md +4 -5
  529. package/src/tab-list/block.json +4 -3
  530. package/src/tab-list/edit.js +92 -28
  531. package/src/tab-list/editor.scss +9 -0
  532. package/src/tab-list/index.php +9 -4
  533. package/src/tab-list/tab-movers.js +72 -0
  534. package/src/tab-panel/README.md +4 -6
  535. package/src/tab-panel/block.json +1 -6
  536. package/src/tab-panel/edit.js +20 -33
  537. package/src/tab-panels/README.md +5 -3
  538. package/src/tab-panels/block.json +0 -1
  539. package/src/table/edit.js +1 -1
  540. package/src/table-of-contents/index.php +386 -1
  541. package/src/tabs/README.md +18 -9
  542. package/src/tabs/block.json +0 -5
  543. package/src/tabs/edit.js +7 -64
  544. package/src/tabs/use-tab-actions.js +32 -3
  545. package/src/tabs/use-tab-list-items-sync.js +24 -4
  546. package/src/tag-cloud/index.php +3 -2
  547. package/src/template-part/index.php +3 -17
  548. package/src/term-name/README.md +1 -1
  549. package/src/term-name/block.json +1 -3
  550. package/src/term-name/deprecated.js +74 -0
  551. package/src/term-name/edit.js +2 -18
  552. package/src/term-name/index.js +2 -0
  553. package/src/utils/caption.js +7 -4
  554. package/src/utils/media-control.scss +1 -5
  555. package/src/utils/test/waveform-player.js +297 -34
  556. package/src/utils/test/waveform-utils.js +473 -5
  557. package/src/utils/waveform-player.js +189 -59
  558. package/src/utils/waveform-utils.js +443 -40
  559. package/src/verse/edit.js +7 -2
  560. package/src/video/edit.js +0 -8
  561. package/src/video/editor.scss +1 -1
  562. package/src/video/index.php +2 -2
  563. package/src/video/tracks-editor.js +0 -1
  564. package/build/image/animated-gif-convert-control.cjs +0 -105
  565. package/build/image/animated-gif-convert-control.cjs.map +0 -7
  566. package/build/utils/gif-conversion-attributes.cjs +0 -40
  567. package/build/utils/gif-conversion-attributes.cjs.map +0 -7
  568. package/build/video/gif-restore-control.cjs +0 -73
  569. package/build/video/gif-restore-control.cjs.map +0 -7
  570. package/build-module/image/animated-gif-convert-control.mjs +0 -87
  571. package/build-module/image/animated-gif-convert-control.mjs.map +0 -7
  572. package/build-module/utils/gif-conversion-attributes.mjs +0 -15
  573. package/build-module/utils/gif-conversion-attributes.mjs.map +0 -7
  574. package/build-module/video/gif-restore-control.mjs +0 -55
  575. package/build-module/video/gif-restore-control.mjs.map +0 -7
  576. package/src/image/animated-gif-convert-control.js +0 -135
  577. package/src/image/test/animated-gif-convert-control.js +0 -276
  578. package/src/utils/gif-conversion-attributes.js +0 -30
  579. package/src/utils/test/gif-conversion-attributes.js +0 -60
  580. package/src/video/gif-restore-control.js +0 -92
@@ -576,8 +576,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
576
576
  grid-column: span 2;
577
577
 
578
578
  &.open {
579
- box-shadow: inset 0 0 0 $border-width $gray-200;
580
- outline: 1px solid transparent; // Box shadow is removed in high contrast mode, a transparent outline is made opaque.
579
+ border-color: $gray-200;
581
580
  background-color: $white;
582
581
  }
583
582
  }
@@ -16,7 +16,7 @@
16
16
  * will always have a value even for legacy blocks. We check the legacy openSubmenusOnClick
17
17
  * attribute first to preserve original behavior for blocks saved before the migration.
18
18
  *
19
- * @since 6.9.0
19
+ * @since 7.0.0
20
20
  *
21
21
  * @param array $attributes Block attributes containing submenuVisibility and/or openSubmenusOnClick.
22
22
  * @return string The visibility mode: 'hover', 'click', or 'always'.
@@ -40,6 +40,45 @@ function block_core_navigation_get_submenu_visibility( $attributes ) {
40
40
  return $submenu_visibility ?? 'hover';
41
41
  }
42
42
 
43
+ /**
44
+ * Returns the custom properties used by the Navigation block for a layout.
45
+ *
46
+ * @since 7.1.0
47
+ *
48
+ * @param array $layout Layout configuration.
49
+ * @return array Navigation layout custom property declarations.
50
+ */
51
+ function block_core_navigation_get_layout_custom_property_declarations( $layout ) {
52
+ $justification_values = array(
53
+ 'left' => 'flex-start',
54
+ 'center' => 'center',
55
+ 'right' => 'flex-end',
56
+ 'space-between' => 'space-between',
57
+ );
58
+ $justify_content = is_array( $layout ) ? ( $layout['justifyContent'] ?? 'left' ) : 'left';
59
+ if ( ! is_string( $justify_content ) || ! isset( $justification_values[ $justify_content ] ) ) {
60
+ $justify_content = 'left';
61
+ }
62
+
63
+ $justification = $justification_values[ $justify_content ];
64
+ $is_vertical = is_array( $layout ) && 'vertical' === ( $layout['orientation'] ?? null );
65
+ $align = 'center';
66
+ $justify = $justification;
67
+
68
+ if ( $is_vertical ) {
69
+ $align = in_array( $justify_content, array( 'center', 'right' ), true ) ? $justification : 'flex-start';
70
+ $justify = 'left' === $justify_content ? 'initial' : $justification;
71
+ }
72
+
73
+ return array(
74
+ '--navigation-layout-justification-setting' => $justification,
75
+ '--navigation-layout-direction' => $is_vertical ? 'column' : 'row',
76
+ '--navigation-layout-wrap' => is_array( $layout ) && 'nowrap' === ( $layout['flexWrap'] ?? null ) ? 'nowrap' : 'wrap',
77
+ '--navigation-layout-justify' => $justify,
78
+ '--navigation-layout-align' => $align,
79
+ );
80
+ }
81
+
43
82
  /**
44
83
  * Helper functions used to render the navigation block.
45
84
  *
@@ -576,12 +615,13 @@ class WP_Navigation_Block_Renderer {
576
615
  'space-between' => 'items-justified-space-between',
577
616
  );
578
617
 
579
- $layout_class = '';
618
+ $layout_class = '';
619
+ $nav_justify_content = $attributes['layout']['justifyContent'] ?? null;
580
620
  if (
581
- isset( $attributes['layout']['justifyContent'] ) &&
582
- isset( $layout_justification[ $attributes['layout']['justifyContent'] ] )
621
+ is_string( $nav_justify_content ) &&
622
+ isset( $layout_justification[ $nav_justify_content ] )
583
623
  ) {
584
- $layout_class .= $layout_justification[ $attributes['layout']['justifyContent'] ];
624
+ $layout_class .= $layout_justification[ $nav_justify_content ];
585
625
  }
586
626
  if ( isset( $attributes['layout']['orientation'] ) && 'vertical' === $attributes['layout']['orientation'] ) {
587
627
  $layout_class .= ' is-vertical';
@@ -1211,7 +1251,7 @@ function block_core_navigation_add_directives_to_submenu( $tags, $block_attribut
1211
1251
  )
1212
1252
  ) ) {
1213
1253
  $tags->set_attribute( 'data-wp-on--click', 'actions.toggleMenuOnClick' );
1214
- $tags->set_attribute( 'data-wp-bind--aria-expanded', 'state.isMenuOpen' );
1254
+ $tags->set_attribute( 'data-wp-bind--aria-expanded', 'state.isSubmenuOpen' );
1215
1255
  // The `aria-expanded` attribute for SSR is already added in the submenu block.
1216
1256
  }
1217
1257
  // Add directives to the submenu.
@@ -1558,13 +1598,18 @@ function register_block_core_navigation() {
1558
1598
  add_action( 'init', 'register_block_core_navigation' );
1559
1599
 
1560
1600
  /**
1561
- * Adds the Navigation block state class to inner list containers.
1601
+ * Adds Navigation block support classes to inner list containers.
1562
1602
  *
1563
1603
  * State block support adds the generated `wp-states-*` class to the outer
1564
1604
  * block wrapper. The Navigation block renders its menu items inside an inner
1565
1605
  * `wp-block-navigation__container` list, so the same state class is also needed
1566
1606
  * there for state styles to apply directly to the menu list.
1567
1607
  *
1608
+ * Navigation also uses layout classes on its outer wrapper to define custom
1609
+ * properties consumed by its inner containers. Viewport layout styles cannot
1610
+ * change those classes, so equivalent custom properties and a scoping class
1611
+ * are generated for each configured viewport layout.
1612
+ *
1568
1613
  * Currently this is required as a workaround because of how difficult it is for nav
1569
1614
  * child blocks to inherit styles through the complex responsive nav block html. The
1570
1615
  * bug in https://github.com/WordPress/gutenberg/issues/62690 also prevents inheritance.
@@ -1575,25 +1620,83 @@ add_action( 'init', 'register_block_core_navigation' );
1575
1620
  * @param array $block The full block, including name and attributes.
1576
1621
  * @return string The updated block content.
1577
1622
  */
1578
- function block_core_navigation_add_state_class_to_container( $block_content, $block ) {
1623
+ function block_core_navigation_add_support_classes_to_container( $block_content, $block ) {
1579
1624
  if ( 'core/navigation' !== ( $block['blockName'] ?? null ) || empty( $block_content ) ) {
1580
1625
  return $block_content;
1581
1626
  }
1582
1627
 
1628
+ $attributes = is_array( $block['attrs'] ?? null ) ? $block['attrs'] : array();
1629
+ $style = is_array( $attributes['style'] ?? null ) ? $attributes['style'] : array();
1630
+ if (
1631
+ defined( 'IS_GUTENBERG_PLUGIN' ) &&
1632
+ IS_GUTENBERG_PLUGIN &&
1633
+ function_exists( 'gutenberg_resolve_style_state_aliases' )
1634
+ ) {
1635
+ $style = gutenberg_resolve_style_state_aliases( $style, 'core/navigation' );
1636
+ }
1637
+
1638
+ $global_settings = wp_get_global_settings();
1639
+ $viewport_settings = $global_settings['viewport'] ?? null;
1640
+ $responsive_media_queries = array();
1641
+ if ( method_exists( 'WP_Theme_JSON_Gutenberg', 'get_viewport_media_queries' ) ) {
1642
+ $responsive_media_queries = WP_Theme_JSON_Gutenberg::get_viewport_media_queries( $viewport_settings );
1643
+ } elseif ( method_exists( 'WP_Theme_JSON', 'get_viewport_media_queries' ) ) {
1644
+ $responsive_media_queries = WP_Theme_JSON::get_viewport_media_queries( $viewport_settings );
1645
+ }
1646
+
1647
+ $styles = array();
1648
+ $base_layout = is_array( $attributes['layout'] ?? null ) ? $attributes['layout'] : array();
1649
+ foreach ( $responsive_media_queries as $breakpoint => $media_query ) {
1650
+ $viewport_style = is_array( $style[ $breakpoint ] ?? null ) ? $style[ $breakpoint ] : array();
1651
+ $viewport_layout = is_array( $viewport_style['layout'] ?? null ) ? $viewport_style['layout'] : array();
1652
+ if ( empty( $viewport_layout ) ) {
1653
+ continue;
1654
+ }
1655
+
1656
+ $styles[] = array(
1657
+ 'declarations' => block_core_navigation_get_layout_custom_property_declarations(
1658
+ array_replace( $base_layout, $viewport_layout )
1659
+ ),
1660
+ 'rules_group' => $media_query,
1661
+ );
1662
+ }
1663
+
1583
1664
  $processor = new WP_HTML_Tag_Processor( $block_content );
1584
1665
  if ( ! $processor->next_tag() ) {
1585
1666
  return $block_content;
1586
1667
  }
1587
1668
 
1588
1669
  $class_attribute = $processor->get_attribute( 'class' );
1589
- if ( ! is_string( $class_attribute ) || ! preg_match( '/\bwp-states-[a-f0-9]{8}\b/', $class_attribute, $matches ) ) {
1670
+ $state_class = null;
1671
+ if ( is_string( $class_attribute ) && preg_match( '/\bwp-states-[a-f0-9]{8}\b/', $class_attribute, $matches ) ) {
1672
+ $state_class = $matches[0];
1673
+ }
1674
+
1675
+ $layout_class = null;
1676
+ if ( ! empty( $styles ) ) {
1677
+ $layout_class = wp_unique_id( 'wp-block-navigation-' );
1678
+ // The inner selector includes both Navigation classes so it overrides the
1679
+ // default layout custom properties set by `.wp-block-navigation.items-*`.
1680
+ $selector = ".wp-block-navigation.{$layout_class},.wp-block-navigation.wp-block-navigation__container.{$layout_class}";
1681
+ foreach ( $styles as &$style_rule ) {
1682
+ $style_rule['selector'] = $selector;
1683
+ }
1684
+ unset( $style_rule );
1685
+
1686
+ $processor->add_class( $layout_class );
1687
+ wp_style_engine_get_stylesheet_from_css_rules(
1688
+ $styles,
1689
+ array( 'context' => 'block-supports' )
1690
+ );
1691
+ }
1692
+
1693
+ if ( null === $state_class && null === $layout_class ) {
1590
1694
  return $block_content;
1591
1695
  }
1592
1696
 
1593
- $state_class = $matches[0];
1594
1697
  while ( $processor->next_tag() ) {
1595
1698
  // Custom overlay content can include nested Navigation blocks.
1596
- // Avoid applying the outer Navigation state class to an inner nav block.
1699
+ // Avoid applying the outer Navigation classes to an inner nav block.
1597
1700
  if ( $processor->has_class( 'wp-block-navigation' ) && ! $processor->has_class( 'wp-block-navigation__container' ) ) {
1598
1701
  break;
1599
1702
  }
@@ -1602,6 +1705,14 @@ function block_core_navigation_add_state_class_to_container( $block_content, $bl
1602
1705
  continue;
1603
1706
  }
1604
1707
 
1708
+ if ( null !== $layout_class ) {
1709
+ $processor->add_class( $layout_class );
1710
+ }
1711
+
1712
+ if ( null === $state_class ) {
1713
+ continue;
1714
+ }
1715
+
1605
1716
  $class_attribute = $processor->get_attribute( 'class' );
1606
1717
  if ( is_string( $class_attribute ) && preg_match( '/\bwp-states-[a-f0-9]{8}\b/', $class_attribute ) ) {
1607
1718
  continue;
@@ -1613,7 +1724,7 @@ function block_core_navigation_add_state_class_to_container( $block_content, $bl
1613
1724
  return $processor->get_updated_html();
1614
1725
  }
1615
1726
 
1616
- add_filter( 'render_block', 'block_core_navigation_add_state_class_to_container', 11, 2 );
1727
+ add_filter( 'render_block', 'block_core_navigation_add_support_classes_to_container', 11, 2 );
1617
1728
 
1618
1729
  /**
1619
1730
  * Filter that changes the parsed attribute values of navigation blocks contain typographic presets to contain the values directly.
@@ -0,0 +1,51 @@
1
+ let mockRegisteredStore;
2
+ let mockCurrentContext;
3
+
4
+ jest.mock( '@wordpress/interactivity', () => ( {
5
+ store: ( name, config ) => {
6
+ mockRegisteredStore = config;
7
+ return config;
8
+ },
9
+ getContext: () => mockCurrentContext,
10
+ getElement: () => ( { ref: {} } ),
11
+ withSyncEvent: ( fn ) => fn,
12
+ } ) );
13
+
14
+ describe( 'Navigation view script', () => {
15
+ beforeEach( async () => {
16
+ jest.resetModules();
17
+ mockRegisteredStore = null;
18
+ mockCurrentContext = null;
19
+ // Import the view.js script to register the store
20
+ await import( '../view.js' );
21
+ } );
22
+
23
+ it( 'updates submenuOpenedBy.hover when hovering a submenu inside an open overlay', () => {
24
+ // Mock the context for a submenu inside an open overlay
25
+ mockCurrentContext = {
26
+ type: 'submenu',
27
+ submenuOpenedBy: { click: false, hover: false, focus: false },
28
+ overlayOpenedBy: { click: true, hover: false, focus: false },
29
+ };
30
+
31
+ const { state, actions } = mockRegisteredStore;
32
+
33
+ // Verify initial state
34
+ expect( state.isSubmenuOpen ).toBe( true ); // because overlay is open
35
+ expect( mockCurrentContext.submenuOpenedBy.hover ).toBe( false );
36
+
37
+ // Simulate hover enter
38
+ actions.openMenuOnHover( { pointerType: 'mouse' } );
39
+
40
+ // Verify that hover state is tracked even though submenu is already "open" visually
41
+ expect( mockCurrentContext.submenuOpenedBy.hover ).toBe( true );
42
+ expect( state.isSubmenuOpen ).toBe( true ); // remains true
43
+
44
+ // Simulate hover leave
45
+ actions.closeMenuOnHover( { pointerType: 'mouse' } );
46
+
47
+ // Verify hover state is cleared
48
+ expect( mockCurrentContext.submenuOpenedBy.hover ).toBe( false );
49
+ expect( state.isSubmenuOpen ).toBe( true ); // remains true because overlay is still open
50
+ } );
51
+ } );
@@ -80,6 +80,17 @@ const { state, actions } = store(
80
80
  ? ctx.overlayOpenedBy
81
81
  : ctx.submenuOpenedBy;
82
82
  },
83
+ get isSubmenuOpen() {
84
+ const ctx = getContext();
85
+ // Once the overlay itself is open, its styles always expand
86
+ // every submenu regardless of hover/click/focus state, so the
87
+ // toggle's `aria-expanded` should reflect that immediately
88
+ // instead of waiting for a hover/click/focus interaction.
89
+ const isOverlayOpen =
90
+ Object.values( ctx.overlayOpenedBy || {} ).filter( Boolean )
91
+ .length > 0;
92
+ return isOverlayOpen || state.isMenuOpen;
93
+ },
83
94
  },
84
95
  actions: {
85
96
  openMenuOnHover( event ) {
@@ -88,13 +99,8 @@ const { state, actions } = store(
88
99
  if ( event?.pointerType === 'touch' ) {
89
100
  return;
90
101
  }
91
- const { type, overlayOpenedBy } = getContext();
92
- if (
93
- type === 'submenu' &&
94
- // Only open on hover if the overlay is closed.
95
- Object.values( overlayOpenedBy || {} ).filter( Boolean )
96
- .length === 0
97
- ) {
102
+ const { type } = getContext();
103
+ if ( type === 'submenu' ) {
98
104
  actions.openMenu( 'hover' );
99
105
  }
100
106
  },
@@ -102,13 +108,8 @@ const { state, actions } = store(
102
108
  if ( event?.pointerType === 'touch' ) {
103
109
  return;
104
110
  }
105
- const { type, overlayOpenedBy } = getContext();
106
- if (
107
- type === 'submenu' &&
108
- // Only close on hover if the overlay is closed.
109
- Object.values( overlayOpenedBy || {} ).filter( Boolean )
110
- .length === 0
111
- ) {
111
+ const { type } = getContext();
112
+ if ( type === 'submenu' ) {
112
113
  actions.closeMenu( 'hover' );
113
114
  }
114
115
  },
@@ -425,12 +425,15 @@ export default function NavigationLinkEdit( {
425
425
  }
426
426
  onMerge={ mergeBlocks }
427
427
  onReplace={ onReplace }
428
- __unstableOnSplitAtEnd={ () =>
429
- insertBlocksAfter(
430
- createBlock(
431
- 'core/navigation-link'
432
- )
433
- )
428
+ __unstableOnSplitAtEnd={
429
+ insertBlocksAfter
430
+ ? () =>
431
+ insertBlocksAfter(
432
+ createBlock(
433
+ 'core/navigation-link'
434
+ )
435
+ )
436
+ : undefined
434
437
  }
435
438
  aria-label={ __(
436
439
  'Navigation link text'
@@ -470,7 +473,8 @@ export default function NavigationLinkEdit( {
470
473
  // If there is no link and no binding, remove the auto-inserted block.
471
474
  // This avoids empty blocks which can provided a poor UX.
472
475
  // Don't remove if binding exists (even if entity is unavailable) so user can fix it.
473
- if ( ! url && ! hasUrlBinding ) {
476
+ // `onReplace` is undefined when the block can't be removed.
477
+ if ( ! url && ! hasUrlBinding && onReplace ) {
474
478
  onReplace( [] );
475
479
  return;
476
480
  }
@@ -110,7 +110,7 @@
110
110
  .link-control-transform__subheading {
111
111
  font-size: 11px;
112
112
  text-transform: uppercase;
113
- font-weight: $font-weight-medium;
113
+ font-weight: var(--wpds-typography-font-weight-emphasis);
114
114
  color: $gray-900;
115
115
  margin-bottom: 1.5em;
116
116
  }
@@ -80,6 +80,66 @@ function block_core_navigation_link_build_css_colors( $context, $attributes, $is
80
80
  return $colors;
81
81
  }
82
82
 
83
+ /**
84
+ * Build an array with CSS classes and inline styles defining the font sizes
85
+ * which will be applied to the navigation markup in the front-end.
86
+ *
87
+ * This function is no longer used internally and is kept only for backward
88
+ * compatibility with third-party code that may call it directly.
89
+ *
90
+ * @since 5.9.0
91
+ * @deprecated 7.0.0
92
+ *
93
+ * @param array $context Navigation block context.
94
+ * @return array Font size CSS classes and inline styles.
95
+ */
96
+ function block_core_navigation_link_build_css_font_sizes( $context ) {
97
+ _deprecated_function( __FUNCTION__, '7.0.0' );
98
+
99
+ // CSS classes.
100
+ $font_sizes = array(
101
+ 'css_classes' => array(),
102
+ 'inline_styles' => '',
103
+ );
104
+
105
+ $has_named_font_size = array_key_exists( 'fontSize', $context );
106
+ $has_custom_font_size = isset( $context['style']['typography']['fontSize'] );
107
+
108
+ if ( $has_named_font_size ) {
109
+ // Add the font size class.
110
+ $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
111
+ } elseif ( $has_custom_font_size ) {
112
+ // Add the custom font size inline style.
113
+ $font_sizes['inline_styles'] = sprintf(
114
+ 'font-size: %s;',
115
+ wp_get_typography_font_size_value(
116
+ array(
117
+ 'size' => $context['style']['typography']['fontSize'],
118
+ )
119
+ )
120
+ );
121
+ }
122
+
123
+ return $font_sizes;
124
+ }
125
+
126
+ /**
127
+ * Returns the top-level submenu SVG chevron icon.
128
+ *
129
+ * @since 5.9.0
130
+ * @deprecated 7.0.0 Use block_core_shared_navigation_render_submenu_icon() instead.
131
+ *
132
+ * @return string
133
+ */
134
+ function block_core_navigation_link_render_submenu_icon() {
135
+ _deprecated_function(
136
+ __FUNCTION__,
137
+ '7.0.0',
138
+ 'block_core_shared_navigation_render_submenu_icon()'
139
+ );
140
+ return block_core_shared_navigation_render_submenu_icon();
141
+ }
142
+
83
143
  /**
84
144
  * Decodes a url if it's encoded, returning the same url if not.
85
145
  *
@@ -90,6 +150,10 @@ function block_core_navigation_link_build_css_colors( $context, $attributes, $is
90
150
  * @return string $url Returns the decoded url.
91
151
  */
92
152
  function block_core_navigation_link_maybe_urldecode( $url ) {
153
+ if ( ! is_string( $url ) ) {
154
+ return '';
155
+ }
156
+
93
157
  $is_url_encoded = false;
94
158
  $query = parse_url( $url, PHP_URL_QUERY );
95
159
  $query_params = wp_parse_args( $query );
@@ -127,9 +191,12 @@ function block_core_navigation_link_maybe_urldecode( $url ) {
127
191
  function render_block_core_navigation_link( $attributes, $content, $block ) {
128
192
  // Check if this navigation item should render based on post status.
129
193
  if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
130
- if ( ! gutenberg_block_core_shared_navigation_item_should_render( $attributes, $block ) ) {
131
- return '';
132
- }
194
+ $should_render = gutenberg_block_core_shared_navigation_item_should_render( $attributes, $block );
195
+ } else {
196
+ $should_render = block_core_shared_navigation_item_should_render( $attributes, $block );
197
+ }
198
+ if ( ! $should_render ) {
199
+ return '';
133
200
  }
134
201
 
135
202
  // Don't render the block's subtree if it has no label.
@@ -248,11 +248,12 @@ function UnforwardedLinkUI( props, ref ) {
248
248
  setAddingPage( true );
249
249
  } }
250
250
  canAddPage={
251
+ blockEditingMode !== 'disabled' &&
251
252
  permissions?.canCreate &&
252
253
  type === 'page'
253
254
  }
254
255
  canAddBlock={
255
- blockEditingMode === 'default'
256
+ blockEditingMode !== 'disabled'
256
257
  }
257
258
  />
258
259
  );
@@ -1,4 +1,4 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
2
 
3
3
  exports[`hooks enhanceNavigationLinkVariations enhances variations with icon and isActive functions 1`] = `
4
4
  {
@@ -76,9 +76,12 @@ function block_core_navigation_submenu_get_submenu_visibility( $context ) {
76
76
  function render_block_core_navigation_submenu( $attributes, $content, $block ) {
77
77
  // Check if this navigation item should render based on post status.
78
78
  if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
79
- if ( ! gutenberg_block_core_shared_navigation_item_should_render( $attributes, $block ) ) {
80
- return '';
81
- }
79
+ $should_render = gutenberg_block_core_shared_navigation_item_should_render( $attributes, $block );
80
+ } else {
81
+ $should_render = block_core_shared_navigation_item_should_render( $attributes, $block );
82
+ }
83
+ if ( ! $should_render ) {
84
+ return '';
82
85
  }
83
86
 
84
87
  // Don't render the block's subtree if it has no label.
@@ -18,7 +18,7 @@
18
18
  font-size: $default-font-size;
19
19
  position: relative;
20
20
  text-transform: uppercase;
21
- font-weight: 600;
21
+ font-weight: var(--wpds-typography-font-weight-emphasis);
22
22
  font-family: $default-font;
23
23
  color: $gray-700;
24
24
  border-radius: 4px;
@@ -9,7 +9,7 @@
9
9
  * Returns the submenu visibility value with backward compatibility
10
10
  * for the deprecated openSubmenusOnClick attribute.
11
11
  *
12
- * @since 6.9.0
12
+ * @since 7.0.0
13
13
  *
14
14
  * @param array $context Block context from parent Navigation block.
15
15
  * @return string The visibility mode: 'hover', 'click', or 'always'.
@@ -258,8 +258,9 @@ function render_block_core_page_list( $attributes, $content, $block ) {
258
258
  static $block_id = 0;
259
259
  ++$block_id;
260
260
 
261
- $parent_page_id = $attributes['parentPageID'];
262
- $is_nested = ! empty( $block->context['core/isInsideSubmenu'] );
261
+ $parent_page_id_attr = $attributes['parentPageID'] ?? null;
262
+ $parent_page_id = is_scalar( $parent_page_id_attr ) ? (int) $parent_page_id_attr : 0;
263
+ $is_nested = ! empty( $block->context['core/isInsideSubmenu'] );
263
264
 
264
265
  $all_pages = get_pages(
265
266
  array(
@@ -19,11 +19,14 @@ import {
19
19
  useBlockProps,
20
20
  useSettings,
21
21
  useBlockEditingMode,
22
+ privateApis as blockEditorPrivateApis,
22
23
  store as blockEditorStore,
23
24
  } from '@wordpress/block-editor';
24
25
  import { useSelect } from '@wordpress/data';
25
26
  import { getBlockSupport } from '@wordpress/blocks';
26
27
  import { formatLTR } from '@wordpress/icons';
28
+ import { useContext } from '@wordpress/element';
29
+
27
30
  /**
28
31
  * Internal dependencies
29
32
  */
@@ -31,6 +34,8 @@ import { useOnEnter } from './use-enter';
31
34
  import useDeprecatedAlign from './deprecated-attributes';
32
35
  import { unlock } from '../lock-unlock';
33
36
 
37
+ const { PrivateBlockContext } = unlock( blockEditorPrivateApis );
38
+
34
39
  function ParagraphRTLControl( { direction, setDirection } ) {
35
40
  return (
36
41
  isRTL() && (
@@ -131,6 +136,7 @@ function ParagraphBlock( {
131
136
  style: { direction },
132
137
  } );
133
138
  const blockEditingMode = useBlockEditingMode();
139
+ const { ariaLabel } = useContext( PrivateBlockContext );
134
140
 
135
141
  return (
136
142
  <>
@@ -164,11 +170,12 @@ function ParagraphBlock( {
164
170
  onReplace={ onReplace }
165
171
  onRemove={ onRemove }
166
172
  aria-label={
167
- RichText.isEmpty( content )
173
+ ariaLabel ??
174
+ ( RichText.isEmpty( content )
168
175
  ? __(
169
176
  'Empty block; start writing or type forward slash to choose a block'
170
177
  )
171
- : __( 'Block: Paragraph' )
178
+ : __( 'Block: Paragraph' ) )
172
179
  }
173
180
  data-empty={ RichText.isEmpty( content ) }
174
181
  placeholder={ placeholder || __( 'Type / to choose a block' ) }
@@ -16,7 +16,7 @@ import save from './save';
16
16
  import transforms from './transforms';
17
17
  import { unlock } from '../lock-unlock';
18
18
 
19
- const { fieldsKey, formKey } = unlock( blocksPrivateApis );
19
+ const { fieldsKey, formKey, editableRootKey } = unlock( blocksPrivateApis );
20
20
 
21
21
  const { name } = metadata;
22
22
 
@@ -24,6 +24,9 @@ export { metadata, name };
24
24
 
25
25
  export const settings = {
26
26
  icon,
27
+ // Opt into the editing host behaviour privately. It's a Symbol setting
28
+ // rather than a public `supports` key so it stays an internal detail.
29
+ [ editableRootKey ]: true,
27
30
  example: {
28
31
  attributes: {
29
32
  content: __(
@@ -2,10 +2,8 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { useRef } from '@wordpress/element';
5
- import {
6
- useRefEffect,
7
- privateApis as composePrivateApis,
8
- } from '@wordpress/compose';
5
+ import { useRefEffect } from '@wordpress/compose';
6
+ import { privateApis as richTextPrivateApis } from '@wordpress/rich-text';
9
7
  import { ENTER } from '@wordpress/keycodes';
10
8
  import { useSelect, useDispatch, useRegistry } from '@wordpress/data';
11
9
  import { store as blockEditorStore } from '@wordpress/block-editor';
@@ -21,7 +19,7 @@ import {
21
19
  */
22
20
  import { unlock } from '../lock-unlock';
23
21
 
24
- const { subscribeDelegatedListener } = unlock( composePrivateApis );
22
+ const { subscribeOwnedListener } = unlock( richTextPrivateApis );
25
23
 
26
24
  export function useOnEnter( props ) {
27
25
  const { batch } = useRegistry();
@@ -131,11 +129,6 @@ export function useOnEnter( props ) {
131
129
 
132
130
  // Capture phase so we run before writing-flow's ancestor-bubble
133
131
  // keydown handlers that gate on `event.defaultPrevented`.
134
- return subscribeDelegatedListener(
135
- element,
136
- 'keydown',
137
- onKeyDown,
138
- true
139
- );
132
+ return subscribeOwnedListener( element, 'keydown', onKeyDown, true );
140
133
  }, [] );
141
134
  }
@@ -33,18 +33,18 @@ function register_block_core_pattern() {
33
33
  function render_block_core_pattern( $attributes ) {
34
34
  static $seen_refs = array();
35
35
 
36
- if ( empty( $attributes['slug'] ) ) {
36
+ $slug = $attributes['slug'] ?? null;
37
+ if ( empty( $slug ) || ! is_string( $slug ) ) {
37
38
  return '';
38
39
  }
39
40
 
40
- $slug = $attributes['slug'];
41
41
  $registry = WP_Block_Patterns_Registry::get_instance();
42
42
 
43
43
  if ( ! $registry->is_registered( $slug ) ) {
44
44
  return '';
45
45
  }
46
46
 
47
- if ( isset( $seen_refs[ $attributes['slug'] ] ) ) {
47
+ if ( isset( $seen_refs[ $slug ] ) ) {
48
48
  // WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent
49
49
  // is set in `wp_debug_mode()`.
50
50
  $is_debug = WP_DEBUG && WP_DEBUG_DISPLAY;
@@ -58,14 +58,14 @@ function render_block_core_pattern( $attributes ) {
58
58
  $pattern = $registry->get_registered( $slug );
59
59
  $content = $pattern['content'];
60
60
 
61
- $seen_refs[ $attributes['slug'] ] = true;
61
+ $seen_refs[ $slug ] = true;
62
62
 
63
63
  $content = do_blocks( $content );
64
64
 
65
65
  global $wp_embed;
66
66
  $content = $wp_embed->autoembed( $content );
67
67
 
68
- unset( $seen_refs[ $attributes['slug'] ] );
68
+ unset( $seen_refs[ $slug ] );
69
69
  return $content;
70
70
  }
71
71