@wordpress/block-editor 14.6.0 → 14.7.1-next.082ed6819.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 (332) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-controls/slot.js +6 -3
  3. package/build/components/block-controls/slot.js.map +1 -1
  4. package/build/components/block-inspector/index.js +1 -2
  5. package/build/components/block-inspector/index.js.map +1 -1
  6. package/build/components/block-list/block.js +14 -28
  7. package/build/components/block-list/block.js.map +1 -1
  8. package/build/components/block-lock/modal.js +1 -1
  9. package/build/components/block-lock/modal.js.map +1 -1
  10. package/build/components/block-manager/category.js +79 -0
  11. package/build/components/block-manager/category.js.map +1 -0
  12. package/build/components/block-manager/checklist.js +40 -0
  13. package/build/components/block-manager/checklist.js.map +1 -0
  14. package/build/components/block-manager/index.js +108 -0
  15. package/build/components/block-manager/index.js.map +1 -0
  16. package/build/components/block-patterns-list/index.js +23 -26
  17. package/build/components/block-patterns-list/index.js.map +1 -1
  18. package/build/components/block-popover/index.js +1 -1
  19. package/build/components/block-popover/index.js.map +1 -1
  20. package/build/components/block-preview/async.js +51 -0
  21. package/build/components/block-preview/async.js.map +1 -0
  22. package/build/components/block-preview/index.js +4 -1
  23. package/build/components/block-preview/index.js.map +1 -1
  24. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  25. package/build/components/block-settings-menu/index.js.map +1 -1
  26. package/build/components/block-toolbar/change-design.js +1 -4
  27. package/build/components/block-toolbar/change-design.js.map +1 -1
  28. package/build/components/block-toolbar/index.js +7 -2
  29. package/build/components/block-toolbar/index.js.map +1 -1
  30. package/build/components/block-toolbar/switch-section-style.js +105 -0
  31. package/build/components/block-toolbar/switch-section-style.js.map +1 -0
  32. package/build/components/block-tools/index.js +12 -9
  33. package/build/components/block-tools/index.js.map +1 -1
  34. package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
  35. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  36. package/build/components/block-tools/use-show-block-tools.js +4 -1
  37. package/build/components/block-tools/use-show-block-tools.js.map +1 -1
  38. package/build/components/collab/block-comment-icon-slot.js +2 -6
  39. package/build/components/collab/block-comment-icon-slot.js.map +1 -1
  40. package/build/components/collab/block-comment-icon-toolbar-slot.js +2 -6
  41. package/build/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
  42. package/build/components/color-palette/with-color-context.js +4 -2
  43. package/build/components/color-palette/with-color-context.js.map +1 -1
  44. package/build/components/font-family/index.js +14 -13
  45. package/build/components/font-family/index.js.map +1 -1
  46. package/build/components/global-styles/dimensions-panel.js +26 -14
  47. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  48. package/build/components/global-styles/use-global-styles-output.js +1 -1
  49. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  50. package/build/components/iframe/get-compatibility-styles.js +4 -4
  51. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  52. package/build/components/iframe/index.js +156 -23
  53. package/build/components/iframe/index.js.map +1 -1
  54. package/build/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  55. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  56. package/build/components/inserter/block-patterns-tab/index.js +1 -2
  57. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  58. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +4 -6
  59. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  60. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +3 -0
  61. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  62. package/build/components/inserter/block-patterns-tab/utils.js +5 -1
  63. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  64. package/build/components/inserter/category-tabs/index.js +7 -8
  65. package/build/components/inserter/category-tabs/index.js.map +1 -1
  66. package/build/components/inserter/hooks/use-block-types-state.js +1 -1
  67. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  68. package/build/components/inserter/hooks/use-patterns-paging.js +0 -5
  69. package/build/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  70. package/build/components/inserter/search-results.js +0 -2
  71. package/build/components/inserter/search-results.js.map +1 -1
  72. package/build/components/inserter-draggable-blocks/index.js +2 -1
  73. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  74. package/build/components/inspector-controls/slot.js +7 -4
  75. package/build/components/inspector-controls/slot.js.map +1 -1
  76. package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  77. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  78. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
  79. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  80. package/build/components/media-placeholder/index.js +33 -25
  81. package/build/components/media-placeholder/index.js.map +1 -1
  82. package/build/components/rich-text/index.js +1 -1
  83. package/build/components/rich-text/index.js.map +1 -1
  84. package/build/components/tabbed-sidebar/index.js +1 -1
  85. package/build/components/tabbed-sidebar/index.js.map +1 -1
  86. package/build/components/url-input/index.js +3 -1
  87. package/build/components/url-input/index.js.map +1 -1
  88. package/build/components/use-block-commands/index.js +5 -6
  89. package/build/components/use-block-commands/index.js.map +1 -1
  90. package/build/hooks/border.js +3 -3
  91. package/build/hooks/border.js.map +1 -1
  92. package/build/hooks/color.js +1 -1
  93. package/build/hooks/color.js.map +1 -1
  94. package/build/hooks/dimensions.js +2 -2
  95. package/build/hooks/dimensions.js.map +1 -1
  96. package/build/hooks/font-family.js +1 -1
  97. package/build/hooks/font-family.js.map +1 -1
  98. package/build/hooks/style.js +6 -6
  99. package/build/hooks/style.js.map +1 -1
  100. package/build/hooks/supports.js +7 -7
  101. package/build/hooks/supports.js.map +1 -1
  102. package/build/hooks/typography.js +6 -6
  103. package/build/hooks/typography.js.map +1 -1
  104. package/build/hooks/utils.js +3 -3
  105. package/build/hooks/utils.js.map +1 -1
  106. package/build/layouts/flex.js +11 -9
  107. package/build/layouts/flex.js.map +1 -1
  108. package/build/lock-unlock.js.map +1 -1
  109. package/build/private-apis.js +4 -4
  110. package/build/private-apis.js.map +1 -1
  111. package/build/store/private-selectors.js +3 -3
  112. package/build/store/private-selectors.js.map +1 -1
  113. package/build/store/selectors.js +12 -8
  114. package/build/store/selectors.js.map +1 -1
  115. package/build/store/utils.js +5 -4
  116. package/build/store/utils.js.map +1 -1
  117. package/build/utils/dom.js +27 -22
  118. package/build/utils/dom.js.map +1 -1
  119. package/build-module/components/block-controls/slot.js +6 -3
  120. package/build-module/components/block-controls/slot.js.map +1 -1
  121. package/build-module/components/block-inspector/index.js +1 -2
  122. package/build-module/components/block-inspector/index.js.map +1 -1
  123. package/build-module/components/block-list/block.js +15 -27
  124. package/build-module/components/block-list/block.js.map +1 -1
  125. package/build-module/components/block-lock/modal.js +1 -1
  126. package/build-module/components/block-lock/modal.js.map +1 -1
  127. package/build-module/components/block-manager/category.js +71 -0
  128. package/build-module/components/block-manager/category.js.map +1 -0
  129. package/build-module/components/block-manager/checklist.js +32 -0
  130. package/build-module/components/block-manager/checklist.js.map +1 -0
  131. package/build-module/components/block-manager/index.js +102 -0
  132. package/build-module/components/block-manager/index.js.map +1 -0
  133. package/build-module/components/block-patterns-list/index.js +23 -26
  134. package/build-module/components/block-patterns-list/index.js.map +1 -1
  135. package/build-module/components/block-popover/index.js +2 -2
  136. package/build-module/components/block-popover/index.js.map +1 -1
  137. package/build-module/components/block-preview/async.js +44 -0
  138. package/build-module/components/block-preview/async.js.map +1 -0
  139. package/build-module/components/block-preview/index.js +4 -1
  140. package/build-module/components/block-preview/index.js.map +1 -1
  141. package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -2
  142. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  143. package/build-module/components/block-settings-menu/index.js +2 -2
  144. package/build-module/components/block-settings-menu/index.js.map +1 -1
  145. package/build-module/components/block-toolbar/change-design.js +1 -4
  146. package/build-module/components/block-toolbar/change-design.js.map +1 -1
  147. package/build-module/components/block-toolbar/index.js +7 -2
  148. package/build-module/components/block-toolbar/index.js.map +1 -1
  149. package/build-module/components/block-toolbar/switch-section-style.js +97 -0
  150. package/build-module/components/block-toolbar/switch-section-style.js.map +1 -0
  151. package/build-module/components/block-tools/index.js +13 -10
  152. package/build-module/components/block-tools/index.js.map +1 -1
  153. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  154. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  155. package/build-module/components/block-tools/use-show-block-tools.js +4 -1
  156. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -1
  157. package/build-module/components/collab/block-comment-icon-slot.js +2 -6
  158. package/build-module/components/collab/block-comment-icon-slot.js.map +1 -1
  159. package/build-module/components/collab/block-comment-icon-toolbar-slot.js +2 -6
  160. package/build-module/components/collab/block-comment-icon-toolbar-slot.js.map +1 -1
  161. package/build-module/components/color-palette/with-color-context.js +4 -2
  162. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  163. package/build-module/components/font-family/index.js +15 -14
  164. package/build-module/components/font-family/index.js.map +1 -1
  165. package/build-module/components/global-styles/dimensions-panel.js +26 -14
  166. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  167. package/build-module/components/global-styles/use-global-styles-output.js +1 -1
  168. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  169. package/build-module/components/iframe/get-compatibility-styles.js +4 -4
  170. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  171. package/build-module/components/iframe/index.js +157 -24
  172. package/build-module/components/iframe/index.js.map +1 -1
  173. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  174. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  175. package/build-module/components/inserter/block-patterns-tab/index.js +1 -2
  176. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  177. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -7
  178. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  179. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +4 -1
  180. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  181. package/build-module/components/inserter/block-patterns-tab/utils.js +4 -0
  182. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  183. package/build-module/components/inserter/category-tabs/index.js +8 -9
  184. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  185. package/build-module/components/inserter/hooks/use-block-types-state.js +1 -1
  186. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  187. package/build-module/components/inserter/hooks/use-patterns-paging.js +1 -6
  188. package/build-module/components/inserter/hooks/use-patterns-paging.js.map +1 -1
  189. package/build-module/components/inserter/search-results.js +0 -2
  190. package/build-module/components/inserter/search-results.js.map +1 -1
  191. package/build-module/components/inserter-draggable-blocks/index.js +2 -1
  192. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  193. package/build-module/components/inspector-controls/slot.js +7 -4
  194. package/build-module/components/inspector-controls/slot.js.map +1 -1
  195. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  196. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  197. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +4 -4
  198. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  199. package/build-module/components/media-placeholder/index.js +33 -25
  200. package/build-module/components/media-placeholder/index.js.map +1 -1
  201. package/build-module/components/rich-text/index.js +1 -1
  202. package/build-module/components/rich-text/index.js.map +1 -1
  203. package/build-module/components/tabbed-sidebar/index.js +1 -1
  204. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  205. package/build-module/components/url-input/index.js +3 -1
  206. package/build-module/components/url-input/index.js.map +1 -1
  207. package/build-module/components/use-block-commands/index.js +4 -4
  208. package/build-module/components/use-block-commands/index.js.map +1 -1
  209. package/build-module/hooks/border.js +3 -3
  210. package/build-module/hooks/border.js.map +1 -1
  211. package/build-module/hooks/color.js +1 -1
  212. package/build-module/hooks/color.js.map +1 -1
  213. package/build-module/hooks/dimensions.js +2 -2
  214. package/build-module/hooks/dimensions.js.map +1 -1
  215. package/build-module/hooks/font-family.js +1 -1
  216. package/build-module/hooks/font-family.js.map +1 -1
  217. package/build-module/hooks/style.js +6 -6
  218. package/build-module/hooks/style.js.map +1 -1
  219. package/build-module/hooks/supports.js +7 -7
  220. package/build-module/hooks/supports.js.map +1 -1
  221. package/build-module/hooks/typography.js +6 -6
  222. package/build-module/hooks/typography.js.map +1 -1
  223. package/build-module/hooks/utils.js +3 -3
  224. package/build-module/hooks/utils.js.map +1 -1
  225. package/build-module/layouts/flex.js +11 -9
  226. package/build-module/layouts/flex.js.map +1 -1
  227. package/build-module/lock-unlock.js.map +1 -1
  228. package/build-module/private-apis.js +6 -6
  229. package/build-module/private-apis.js.map +1 -1
  230. package/build-module/store/private-selectors.js +3 -3
  231. package/build-module/store/private-selectors.js.map +1 -1
  232. package/build-module/store/selectors.js +12 -8
  233. package/build-module/store/selectors.js.map +1 -1
  234. package/build-module/store/utils.js +3 -3
  235. package/build-module/store/utils.js.map +1 -1
  236. package/build-module/utils/dom.js +25 -21
  237. package/build-module/utils/dom.js.map +1 -1
  238. package/build-style/content-rtl.css +30 -15
  239. package/build-style/content.css +30 -15
  240. package/build-style/style-rtl.css +92 -3
  241. package/build-style/style.css +92 -3
  242. package/build-types/utils/dom.d.ts +7 -9
  243. package/build-types/utils/dom.d.ts.map +1 -1
  244. package/package.json +32 -31
  245. package/src/components/block-canvas/style.scss +1 -1
  246. package/src/components/block-controls/slot.js +5 -3
  247. package/src/components/block-inspector/index.js +0 -2
  248. package/src/components/block-inspector/style.scss +2 -1
  249. package/src/components/block-list/block.js +28 -48
  250. package/src/components/block-lock/modal.js +1 -1
  251. package/src/components/block-manager/category.js +102 -0
  252. package/src/components/block-manager/checklist.js +34 -0
  253. package/src/components/block-manager/index.js +127 -0
  254. package/src/components/block-manager/style.scss +82 -0
  255. package/src/components/block-mover/README.md +15 -8
  256. package/src/components/block-mover/stories/index.story.js +73 -71
  257. package/src/components/block-mover/style.scss +3 -0
  258. package/src/components/block-patterns-list/README.md +8 -8
  259. package/src/components/block-patterns-list/index.js +35 -51
  260. package/src/components/block-patterns-list/stories/index.story.js +2 -19
  261. package/src/components/block-popover/index.js +4 -4
  262. package/src/components/block-preview/async.js +43 -0
  263. package/src/components/block-preview/index.js +6 -1
  264. package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
  265. package/src/components/block-settings-menu/index.js +2 -2
  266. package/src/components/block-toolbar/change-design.js +1 -7
  267. package/src/components/block-toolbar/index.js +6 -0
  268. package/src/components/block-toolbar/switch-section-style.js +115 -0
  269. package/src/components/block-tools/index.js +26 -10
  270. package/src/components/block-tools/style.scss +12 -0
  271. package/src/components/block-tools/use-block-toolbar-popover-props.js +2 -2
  272. package/src/components/block-tools/use-show-block-tools.js +3 -1
  273. package/src/components/collab/block-comment-icon-slot.js +2 -6
  274. package/src/components/collab/block-comment-icon-toolbar-slot.js +3 -5
  275. package/src/components/color-palette/with-color-context.js +25 -7
  276. package/src/components/default-block-appender/content.scss +13 -19
  277. package/src/components/font-family/index.js +13 -13
  278. package/src/components/global-styles/dimensions-panel.js +22 -16
  279. package/src/components/global-styles/test/use-global-styles-output.js +1 -1
  280. package/src/components/global-styles/use-global-styles-output.js +1 -1
  281. package/src/components/iframe/content.scss +16 -3
  282. package/src/components/iframe/get-compatibility-styles.js +4 -9
  283. package/src/components/iframe/index.js +204 -44
  284. package/src/components/inserter/block-patterns-explorer/pattern-list.js +3 -6
  285. package/src/components/inserter/block-patterns-tab/index.js +0 -1
  286. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -17
  287. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +8 -0
  288. package/src/components/inserter/block-patterns-tab/utils.js +5 -0
  289. package/src/components/inserter/category-tabs/index.js +8 -9
  290. package/src/components/inserter/hooks/use-block-types-state.js +6 -1
  291. package/src/components/inserter/hooks/use-patterns-paging.js +1 -6
  292. package/src/components/inserter/search-results.js +0 -6
  293. package/src/components/inserter-draggable-blocks/index.js +10 -1
  294. package/src/components/inspector-controls/README.md +2 -0
  295. package/src/components/inspector-controls/slot.js +6 -4
  296. package/src/components/inspector-controls-tabs/position-controls-panel.js +1 -3
  297. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +10 -10
  298. package/src/components/media-placeholder/index.js +41 -37
  299. package/src/components/provider/test/use-block-sync.js +3 -1
  300. package/src/components/rich-text/content.scss +15 -10
  301. package/src/components/rich-text/index.js +8 -1
  302. package/src/components/tabbed-sidebar/index.js +1 -1
  303. package/src/components/tabbed-sidebar/style.scss +1 -1
  304. package/src/components/url-input/index.js +3 -4
  305. package/src/components/use-block-commands/index.js +245 -234
  306. package/src/hooks/border.js +3 -9
  307. package/src/hooks/color.js +1 -1
  308. package/src/hooks/dimensions.js +2 -2
  309. package/src/hooks/font-family.js +1 -1
  310. package/src/hooks/style.js +6 -12
  311. package/src/hooks/supports.js +7 -7
  312. package/src/hooks/test/style.js +1 -2
  313. package/src/hooks/typography.js +6 -6
  314. package/src/hooks/utils.js +8 -3
  315. package/src/layouts/flex.js +26 -18
  316. package/src/private-apis.js +6 -6
  317. package/src/store/private-selectors.js +6 -7
  318. package/src/store/selectors.js +60 -45
  319. package/src/store/test/private-selectors.js +5 -0
  320. package/src/store/test/selectors.js +87 -58
  321. package/src/store/utils.js +12 -11
  322. package/src/style.scss +1 -0
  323. package/src/utils/dom.js +26 -21
  324. package/src/utils/test/dom.js +224 -0
  325. package/tsconfig.json +1 -0
  326. package/tsconfig.tsbuildinfo +1 -1
  327. package/build/components/block-info-slot-fill/index.js +0 -39
  328. package/build/components/block-info-slot-fill/index.js.map +0 -1
  329. package/build-module/components/block-info-slot-fill/index.js +0 -32
  330. package/build-module/components/block-info-slot-fill/index.js.map +0 -1
  331. package/src/components/block-info-slot-fill/index.js +0 -27
  332. /package/src/{lock-unlock.js → lock-unlock.ts} +0 -0
@@ -27,12 +27,12 @@ function omit( object, keys ) {
27
27
  );
28
28
  }
29
29
 
30
- const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing';
31
- const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform';
32
- const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration';
30
+ const LETTER_SPACING_SUPPORT_KEY = 'typography.letterSpacing';
31
+ const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.textTransform';
32
+ const TEXT_DECORATION_SUPPORT_KEY = 'typography.textDecoration';
33
33
  const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns';
34
- const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle';
35
- const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight';
34
+ const FONT_STYLE_SUPPORT_KEY = 'typography.fontStyle';
35
+ const FONT_WEIGHT_SUPPORT_KEY = 'typography.fontWeight';
36
36
  const WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode';
37
37
  export const TYPOGRAPHY_SUPPORT_KEY = 'typography';
38
38
  export const TYPOGRAPHY_SUPPORT_KEYS = [
@@ -133,7 +133,7 @@ export function TypographyPanel( { clientId, name, setAttributes, settings } ) {
133
133
 
134
134
  const defaultControls = getBlockSupport( name, [
135
135
  TYPOGRAPHY_SUPPORT_KEY,
136
- '__experimentalDefaultControls',
136
+ 'defaultControls',
137
137
  ] );
138
138
 
139
139
  return (
@@ -124,7 +124,7 @@ export function shouldSkipSerialization(
124
124
  feature
125
125
  ) {
126
126
  const support = getBlockSupport( blockNameOrType, featureSet );
127
- const skipSerialization = support?.__experimentalSkipSerialization;
127
+ const skipSerialization = support?.skipSerialization;
128
128
 
129
129
  if ( Array.isArray( skipSerialization ) ) {
130
130
  return skipSerialization.includes( feature );
@@ -562,8 +562,13 @@ export function createBlockEditFilter( features ) {
562
562
  addFilter( 'editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks );
563
563
  }
564
564
 
565
- function BlockProps( { index, useBlockProps, setAllWrapperProps, ...props } ) {
566
- const wrapperProps = useBlockProps( props );
565
+ function BlockProps( {
566
+ index,
567
+ useBlockProps: hook,
568
+ setAllWrapperProps,
569
+ ...props
570
+ } ) {
571
+ const wrapperProps = hook( props );
567
572
  const setWrapperProps = ( next ) =>
568
573
  setAllWrapperProps( ( prev ) => {
569
574
  const nextAll = [ ...prev ];
@@ -66,24 +66,27 @@ export default {
66
66
  onChange,
67
67
  layoutBlockSupport = {},
68
68
  } ) {
69
- const { allowOrientation = true } = layoutBlockSupport;
69
+ const { allowOrientation = true, allowJustification = true } =
70
+ layoutBlockSupport;
70
71
  return (
71
72
  <>
72
73
  <Flex>
73
- <FlexItem>
74
- <FlexLayoutJustifyContentControl
75
- layout={ layout }
76
- onChange={ onChange }
77
- />
78
- </FlexItem>
79
- <FlexItem>
80
- { allowOrientation && (
74
+ { allowJustification && (
75
+ <FlexItem>
76
+ <FlexLayoutJustifyContentControl
77
+ layout={ layout }
78
+ onChange={ onChange }
79
+ />
80
+ </FlexItem>
81
+ ) }
82
+ { allowOrientation && (
83
+ <FlexItem>
81
84
  <OrientationControl
82
85
  layout={ layout }
83
86
  onChange={ onChange }
84
87
  />
85
- ) }
86
- </FlexItem>
88
+ </FlexItem>
89
+ ) }
87
90
  </Flex>
88
91
  <FlexWrapControl layout={ layout } onChange={ onChange } />
89
92
  </>
@@ -94,17 +97,22 @@ export default {
94
97
  onChange,
95
98
  layoutBlockSupport,
96
99
  } ) {
97
- if ( layoutBlockSupport?.allowSwitching ) {
100
+ const { allowVerticalAlignment = true, allowJustification = true } =
101
+ layoutBlockSupport;
102
+
103
+ if ( ! allowJustification && ! allowVerticalAlignment ) {
98
104
  return null;
99
105
  }
100
- const { allowVerticalAlignment = true } = layoutBlockSupport;
106
+
101
107
  return (
102
108
  <BlockControls group="block" __experimentalShareWithChildBlocks>
103
- <FlexLayoutJustifyContentControl
104
- layout={ layout }
105
- onChange={ onChange }
106
- isToolbar
107
- />
109
+ { allowJustification && (
110
+ <FlexLayoutJustifyContentControl
111
+ layout={ layout }
112
+ onChange={ onChange }
113
+ isToolbar
114
+ />
115
+ ) }
108
116
  { allowVerticalAlignment && (
109
117
  <FlexLayoutVerticalAlignmentControl
110
118
  layout={ layout }
@@ -13,11 +13,11 @@ import {
13
13
  normalizeString,
14
14
  } from './components/inserter/search-items';
15
15
  import { PrivateListView } from './components/list-view';
16
- import BlockInfo from './components/block-info-slot-fill';
17
16
  import { useHasBlockToolbar } from './components/block-toolbar/use-has-block-toolbar';
18
17
  import { cleanEmptyObject } from './hooks/utils';
19
18
  import BlockQuickNavigation from './components/block-quick-navigation';
20
19
  import { LayoutStyle } from './components/block-list/layout';
20
+ import BlockManager from './components/block-manager';
21
21
  import { BlockRemovalWarningModal } from './components/block-removal-warning-modal';
22
22
  import {
23
23
  setBackgroundStyleDefaults,
@@ -48,8 +48,8 @@ import { PrivatePublishDateTimePicker } from './components/publish-date-time-pic
48
48
  import useSpacingSizes from './components/spacing-sizes-control/hooks/use-spacing-sizes';
49
49
  import useBlockDisplayTitle from './components/block-title/use-block-display-title';
50
50
  import TabbedSidebar from './components/tabbed-sidebar';
51
- import __unstableCommentIconFill from './components/collab/block-comment-icon-slot';
52
- import __unstableCommentIconToolbarFill from './components/collab/block-comment-icon-toolbar-slot';
51
+ import CommentIconSlotFill from './components/collab/block-comment-icon-slot';
52
+ import CommentIconToolbarSlotFill from './components/collab/block-comment-icon-toolbar-slot';
53
53
  /**
54
54
  * Private @wordpress/block-editor APIs.
55
55
  */
@@ -66,11 +66,11 @@ lock( privateApis, {
66
66
  normalizeString,
67
67
  PrivateListView,
68
68
  ResizableBoxPopover,
69
- BlockInfo,
70
69
  useHasBlockToolbar,
71
70
  cleanEmptyObject,
72
71
  BlockQuickNavigation,
73
72
  LayoutStyle,
73
+ BlockManager,
74
74
  BlockRemovalWarningModal,
75
75
  useLayoutClasses,
76
76
  useLayoutStyles,
@@ -95,6 +95,6 @@ lock( privateApis, {
95
95
  __unstableBlockStyleVariationOverridesWithConfig,
96
96
  setBackgroundStyleDefaults,
97
97
  sectionRootClientIdKey,
98
- __unstableCommentIconFill,
99
- __unstableCommentIconToolbarFill,
98
+ CommentIconSlotFill,
99
+ CommentIconToolbarSlotFill,
100
100
  } );
@@ -109,17 +109,16 @@ function getEnabledClientIdsTreeUnmemoized( state, rootClientId ) {
109
109
  *
110
110
  * @return {Object[]} Tree of block objects with only clientID and innerBlocks set.
111
111
  */
112
- export const getEnabledClientIdsTree = createSelector(
113
- getEnabledClientIdsTreeUnmemoized,
114
- ( state ) => [
112
+ export const getEnabledClientIdsTree = createRegistrySelector( ( select ) =>
113
+ createSelector( getEnabledClientIdsTreeUnmemoized, ( state ) => [
115
114
  state.blocks.order,
116
115
  state.blockEditingModes,
117
116
  state.settings.templateLock,
118
117
  state.blockListSettings,
119
- state.editorMode,
118
+ select( STORE_NAME ).__unstableGetEditorMode( state ),
120
119
  state.zoomLevel,
121
120
  getSectionRootClientId( state ),
122
- ]
121
+ ] )
123
122
  );
124
123
 
125
124
  /**
@@ -317,7 +316,7 @@ export const hasAllowedPatterns = createRegistrySelector( ( select ) =>
317
316
  },
318
317
  ( state, rootClientId ) => [
319
318
  ...getAllPatternsDependants( select )( state ),
320
- ...getInsertBlockTypeDependants( state, rootClientId ),
319
+ ...getInsertBlockTypeDependants( select )( state, rootClientId ),
321
320
  ]
322
321
  )
323
322
  );
@@ -331,7 +330,7 @@ function mapUserPattern(
331
330
  id: userPattern.id,
332
331
  type: INSERTER_PATTERN_TYPES.user,
333
332
  title: userPattern.title.raw,
334
- categories: userPattern.wp_pattern_category.map( ( catId ) => {
333
+ categories: userPattern.wp_pattern_category?.map( ( catId ) => {
335
334
  const category = __experimentalUserPatternCategories.find(
336
335
  ( { id } ) => id === catId
337
336
  );
@@ -1794,10 +1794,12 @@ const canInsertBlockTypeUnmemoized = (
1794
1794
  *
1795
1795
  * @return {boolean} Whether the given block type is allowed to be inserted.
1796
1796
  */
1797
- export const canInsertBlockType = createSelector(
1798
- canInsertBlockTypeUnmemoized,
1799
- ( state, blockName, rootClientId ) =>
1800
- getInsertBlockTypeDependants( state, rootClientId )
1797
+ export const canInsertBlockType = createRegistrySelector( ( select ) =>
1798
+ createSelector(
1799
+ canInsertBlockTypeUnmemoized,
1800
+ ( state, blockName, rootClientId ) =>
1801
+ getInsertBlockTypeDependants( select )( state, rootClientId )
1802
+ )
1801
1803
  );
1802
1804
 
1803
1805
  /**
@@ -2224,7 +2226,7 @@ export const getInserterItems = createRegistrySelector( ( select ) =>
2224
2226
  unlock( select( STORE_NAME ) ).getReusableBlocks(),
2225
2227
  state.blocks.order,
2226
2228
  state.preferences.insertUsage,
2227
- ...getInsertBlockTypeDependants( state, rootClientId ),
2229
+ ...getInsertBlockTypeDependants( select )( state, rootClientId ),
2228
2230
  ]
2229
2231
  )
2230
2232
  );
@@ -2255,44 +2257,51 @@ export const getInserterItems = createRegistrySelector( ( select ) =>
2255
2257
  * this item.
2256
2258
  * @property {number} frecency Heuristic that combines frequency and recency.
2257
2259
  */
2258
- export const getBlockTransformItems = createSelector(
2259
- ( state, blocks, rootClientId = null ) => {
2260
- const normalizedBlocks = Array.isArray( blocks ) ? blocks : [ blocks ];
2261
- const buildBlockTypeTransformItem = buildBlockTypeItem( state, {
2262
- buildScope: 'transform',
2263
- } );
2264
- const blockTypeTransformItems = getBlockTypes()
2265
- .filter( ( blockType ) =>
2266
- canIncludeBlockTypeInInserter( state, blockType, rootClientId )
2267
- )
2268
- .map( buildBlockTypeTransformItem );
2260
+ export const getBlockTransformItems = createRegistrySelector( ( select ) =>
2261
+ createSelector(
2262
+ ( state, blocks, rootClientId = null ) => {
2263
+ const normalizedBlocks = Array.isArray( blocks )
2264
+ ? blocks
2265
+ : [ blocks ];
2266
+ const buildBlockTypeTransformItem = buildBlockTypeItem( state, {
2267
+ buildScope: 'transform',
2268
+ } );
2269
+ const blockTypeTransformItems = getBlockTypes()
2270
+ .filter( ( blockType ) =>
2271
+ canIncludeBlockTypeInInserter(
2272
+ state,
2273
+ blockType,
2274
+ rootClientId
2275
+ )
2276
+ )
2277
+ .map( buildBlockTypeTransformItem );
2269
2278
 
2270
- const itemsByName = Object.fromEntries(
2271
- Object.entries( blockTypeTransformItems ).map( ( [ , value ] ) => [
2272
- value.name,
2273
- value,
2274
- ] )
2275
- );
2279
+ const itemsByName = Object.fromEntries(
2280
+ Object.entries( blockTypeTransformItems ).map(
2281
+ ( [ , value ] ) => [ value.name, value ]
2282
+ )
2283
+ );
2276
2284
 
2277
- const possibleTransforms = getPossibleBlockTransformations(
2278
- normalizedBlocks
2279
- ).reduce( ( accumulator, block ) => {
2280
- if ( itemsByName[ block?.name ] ) {
2281
- accumulator.push( itemsByName[ block.name ] );
2282
- }
2283
- return accumulator;
2284
- }, [] );
2285
- return orderBy(
2286
- possibleTransforms,
2287
- ( block ) => itemsByName[ block.name ].frecency,
2288
- 'desc'
2289
- );
2290
- },
2291
- ( state, blocks, rootClientId ) => [
2292
- getBlockTypes(),
2293
- state.preferences.insertUsage,
2294
- ...getInsertBlockTypeDependants( state, rootClientId ),
2295
- ]
2285
+ const possibleTransforms = getPossibleBlockTransformations(
2286
+ normalizedBlocks
2287
+ ).reduce( ( accumulator, block ) => {
2288
+ if ( itemsByName[ block?.name ] ) {
2289
+ accumulator.push( itemsByName[ block.name ] );
2290
+ }
2291
+ return accumulator;
2292
+ }, [] );
2293
+ return orderBy(
2294
+ possibleTransforms,
2295
+ ( block ) => itemsByName[ block.name ].frecency,
2296
+ 'desc'
2297
+ );
2298
+ },
2299
+ ( state, blocks, rootClientId ) => [
2300
+ getBlockTypes(),
2301
+ state.preferences.insertUsage,
2302
+ ...getInsertBlockTypeDependants( select )( state, rootClientId ),
2303
+ ]
2304
+ )
2296
2305
  );
2297
2306
 
2298
2307
  /**
@@ -2360,7 +2369,7 @@ export const getAllowedBlocks = createRegistrySelector( ( select ) =>
2360
2369
  ( state, rootClientId ) => [
2361
2370
  getBlockTypes(),
2362
2371
  unlock( select( STORE_NAME ) ).getReusableBlocks(),
2363
- ...getInsertBlockTypeDependants( state, rootClientId ),
2372
+ ...getInsertBlockTypeDependants( select )( state, rootClientId ),
2364
2373
  ]
2365
2374
  )
2366
2375
  );
@@ -2435,7 +2444,7 @@ export const __experimentalGetParsedPattern = createRegistrySelector(
2435
2444
 
2436
2445
  const getAllowedPatternsDependants = ( select ) => ( state, rootClientId ) => [
2437
2446
  ...getAllPatternsDependants( select )( state ),
2438
- ...getInsertBlockTypeDependants( state, rootClientId ),
2447
+ ...getInsertBlockTypeDependants( select )( state, rootClientId ),
2439
2448
  ];
2440
2449
 
2441
2450
  const patternsWithParsedBlocks = new WeakMap();
@@ -2764,8 +2773,14 @@ export function isNavigationMode( state ) {
2764
2773
  * @return {string} the editor mode.
2765
2774
  */
2766
2775
  export const __unstableGetEditorMode = createRegistrySelector(
2767
- ( select ) => () => {
2768
- return select( preferencesStore ).get( 'core', 'editorTool' );
2776
+ ( select ) => ( state ) => {
2777
+ if ( ! window?.__experimentalEditorWriteMode ) {
2778
+ return 'edit';
2779
+ }
2780
+ return (
2781
+ state.settings.editorTool ??
2782
+ select( preferencesStore ).get( 'core', 'editorTool' )
2783
+ );
2769
2784
  }
2770
2785
  );
2771
2786
 
@@ -292,6 +292,11 @@ describe( 'private selectors', () => {
292
292
  '9b9c5c3f-2e46-4f02-9e14-9fe9515b958f': {},
293
293
  },
294
294
  };
295
+ getEnabledClientIdsTree.registry = {
296
+ select: jest.fn( () => ( {
297
+ __unstableGetEditorMode: () => 'edit',
298
+ } ) ),
299
+ };
295
300
 
296
301
  it( 'should return tree containing only clientId and innerBlocks', () => {
297
302
  const state = {
@@ -4615,68 +4615,97 @@ describe( 'getBlockEditingMode', () => {
4615
4615
  ).toBe( 'contentOnly' );
4616
4616
  } );
4617
4617
 
4618
- it( 'in navigation mode, the root section container is default', () => {
4619
- dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
4620
- expect(
4621
- getBlockEditingMode(
4622
- navigationModeStateWithRootSection,
4623
- 'ef45d5fd-5234-4fd5-ac4f-c3736c7f9337'
4624
- )
4625
- ).toBe( 'default' );
4626
- } );
4618
+ describe( 'navigation mode', () => {
4619
+ const writeModeExperiment = window.__experimentalEditorWriteMode;
4620
+ beforeAll( () => {
4621
+ window.__experimentalEditorWriteMode = true;
4622
+ } );
4623
+ afterAll( () => {
4624
+ window.__experimentalEditorWriteMode = writeModeExperiment;
4625
+ } );
4626
+ it( 'in navigation mode, the root section container is default', () => {
4627
+ dispatch( preferencesStore ).set(
4628
+ 'core',
4629
+ 'editorTool',
4630
+ 'navigation'
4631
+ );
4632
+ expect(
4633
+ getBlockEditingMode(
4634
+ navigationModeStateWithRootSection,
4635
+ 'ef45d5fd-5234-4fd5-ac4f-c3736c7f9337'
4636
+ )
4637
+ ).toBe( 'default' );
4638
+ } );
4627
4639
 
4628
- it( 'in navigation mode, anything outside the section container is disabled', () => {
4629
- dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
4630
- expect(
4631
- getBlockEditingMode(
4632
- navigationModeStateWithRootSection,
4633
- '6cf70164-9097-4460-bcbf-200560546988'
4634
- )
4635
- ).toBe( 'disabled' );
4636
- } );
4640
+ it( 'in navigation mode, anything outside the section container is disabled', () => {
4641
+ dispatch( preferencesStore ).set(
4642
+ 'core',
4643
+ 'editorTool',
4644
+ 'navigation'
4645
+ );
4646
+ expect(
4647
+ getBlockEditingMode(
4648
+ navigationModeStateWithRootSection,
4649
+ '6cf70164-9097-4460-bcbf-200560546988'
4650
+ )
4651
+ ).toBe( 'disabled' );
4652
+ } );
4637
4653
 
4638
- it( 'in navigation mode, sections are contentOnly', () => {
4639
- dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
4640
- expect(
4641
- getBlockEditingMode(
4642
- navigationModeStateWithRootSection,
4643
- 'b26fc763-417d-4f01-b81c-2ec61e14a972'
4644
- )
4645
- ).toBe( 'contentOnly' );
4646
- expect(
4647
- getBlockEditingMode(
4648
- navigationModeStateWithRootSection,
4649
- '9b9c5c3f-2e46-4f02-9e14-9fe9515b958f'
4650
- )
4651
- ).toBe( 'contentOnly' );
4652
- } );
4654
+ it( 'in navigation mode, sections are contentOnly', () => {
4655
+ dispatch( preferencesStore ).set(
4656
+ 'core',
4657
+ 'editorTool',
4658
+ 'navigation'
4659
+ );
4660
+ expect(
4661
+ getBlockEditingMode(
4662
+ navigationModeStateWithRootSection,
4663
+ 'b26fc763-417d-4f01-b81c-2ec61e14a972'
4664
+ )
4665
+ ).toBe( 'contentOnly' );
4666
+ expect(
4667
+ getBlockEditingMode(
4668
+ navigationModeStateWithRootSection,
4669
+ '9b9c5c3f-2e46-4f02-9e14-9fe9515b958f'
4670
+ )
4671
+ ).toBe( 'contentOnly' );
4672
+ } );
4653
4673
 
4654
- it( 'in navigation mode, blocks with content attributes within sections are contentOnly', () => {
4655
- dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
4656
- hasContentRoleAttribute.mockReturnValueOnce( true );
4657
- expect(
4658
- getBlockEditingMode(
4659
- navigationModeStateWithRootSection,
4660
- 'b3247f75-fd94-4fef-97f9-5bfd162cc416'
4661
- )
4662
- ).toBe( 'contentOnly' );
4674
+ it( 'in navigation mode, blocks with content attributes within sections are contentOnly', () => {
4675
+ dispatch( preferencesStore ).set(
4676
+ 'core',
4677
+ 'editorTool',
4678
+ 'navigation'
4679
+ );
4680
+ hasContentRoleAttribute.mockReturnValueOnce( true );
4681
+ expect(
4682
+ getBlockEditingMode(
4683
+ navigationModeStateWithRootSection,
4684
+ 'b3247f75-fd94-4fef-97f9-5bfd162cc416'
4685
+ )
4686
+ ).toBe( 'contentOnly' );
4663
4687
 
4664
- hasContentRoleAttribute.mockReturnValueOnce( true );
4665
- expect(
4666
- getBlockEditingMode(
4667
- navigationModeStateWithRootSection,
4668
- 'e178812d-ce5e-48c7-a945-8ae4ffcbbb7c'
4669
- )
4670
- ).toBe( 'contentOnly' );
4671
- } );
4688
+ hasContentRoleAttribute.mockReturnValueOnce( true );
4689
+ expect(
4690
+ getBlockEditingMode(
4691
+ navigationModeStateWithRootSection,
4692
+ 'e178812d-ce5e-48c7-a945-8ae4ffcbbb7c'
4693
+ )
4694
+ ).toBe( 'contentOnly' );
4695
+ } );
4672
4696
 
4673
- it( 'in navigation mode, blocks without content attributes within sections are disabled', () => {
4674
- dispatch( preferencesStore ).set( 'core', 'editorTool', 'navigation' );
4675
- expect(
4676
- getBlockEditingMode(
4677
- navigationModeStateWithRootSection,
4678
- '9b9c5c3f-2e46-4f02-9e14-9fed515b958s'
4679
- )
4680
- ).toBe( 'disabled' );
4697
+ it( 'in navigation mode, blocks without content attributes within sections are disabled', () => {
4698
+ dispatch( preferencesStore ).set(
4699
+ 'core',
4700
+ 'editorTool',
4701
+ 'navigation'
4702
+ );
4703
+ expect(
4704
+ getBlockEditingMode(
4705
+ navigationModeStateWithRootSection,
4706
+ '9b9c5c3f-2e46-4f02-9e14-9fed515b958s'
4707
+ )
4708
+ ).toBe( 'disabled' );
4709
+ } );
4681
4710
  } );
4682
4711
  } );
@@ -110,14 +110,15 @@ export const getAllPatternsDependants = ( select ) => ( state ) => {
110
110
  ];
111
111
  };
112
112
 
113
- export function getInsertBlockTypeDependants( state, rootClientId ) {
114
- return [
115
- state.blockListSettings[ rootClientId ],
116
- state.blocks.byClientId.get( rootClientId ),
117
- state.settings.allowedBlockTypes,
118
- state.settings.templateLock,
119
- state.blockEditingModes,
120
- state.editorMode,
121
- getSectionRootClientId( state ),
122
- ];
123
- }
113
+ export const getInsertBlockTypeDependants =
114
+ ( select ) => ( state, rootClientId ) => {
115
+ return [
116
+ state.blockListSettings[ rootClientId ],
117
+ state.blocks.byClientId.get( rootClientId ),
118
+ state.settings.allowedBlockTypes,
119
+ state.settings.templateLock,
120
+ state.blockEditingModes,
121
+ select( STORE_NAME ).__unstableGetEditorMode( state ),
122
+ getSectionRootClientId( state ),
123
+ ];
124
+ };
package/src/style.scss CHANGED
@@ -10,6 +10,7 @@
10
10
  @import "./components/block-card/style.scss";
11
11
  @import "./components/block-compare/style.scss";
12
12
  @import "./components/block-draggable/style.scss";
13
+ @import "./components/block-manager/style.scss";
13
14
  @import "./components/block-mover/style.scss";
14
15
  @import "./components/block-navigation/style.scss";
15
16
  @import "./components/block-patterns-list/style.scss";
package/src/utils/dom.js CHANGED
@@ -134,23 +134,21 @@ function isScrollable( element ) {
134
134
  );
135
135
  }
136
136
 
137
+ export const WITH_OVERFLOW_ELEMENT_BLOCKS = [ 'core/navigation' ];
137
138
  /**
138
- * Returns the rect of the element including all visible nested elements.
139
- *
140
- * Visible nested elements, including elements that overflow the parent, are
141
- * taken into account.
142
- *
143
- * This function is useful for calculating the visible area of a block that
144
- * contains nested elements that overflow the block, e.g. the Navigation block,
145
- * which can contain overflowing Submenu blocks.
139
+ * Returns the bounding rectangle of an element, with special handling for blocks
140
+ * that have visible overflowing children (defined in WITH_OVERFLOW_ELEMENT_BLOCKS).
146
141
  *
142
+ * For blocks like Navigation that can have overflowing elements (e.g. submenus),
143
+ * this function calculates the combined bounds of both the parent and its visible
144
+ * children. The returned rect may extend beyond the viewport.
147
145
  * The returned rect represents the full extent of the element and its visible
148
146
  * children, which may extend beyond the viewport.
149
147
  *
150
148
  * @param {Element} element Element.
151
149
  * @return {DOMRect} Bounding client rect of the element and its visible children.
152
150
  */
153
- export function getVisibleElementBounds( element ) {
151
+ export function getElementBounds( element ) {
154
152
  const viewport = element.ownerDocument.defaultView;
155
153
 
156
154
  if ( ! viewport ) {
@@ -158,19 +156,26 @@ export function getVisibleElementBounds( element ) {
158
156
  }
159
157
 
160
158
  let bounds = element.getBoundingClientRect();
161
- const stack = [ element ];
162
- let currentElement;
163
-
164
- while ( ( currentElement = stack.pop() ) ) {
165
- for ( const child of currentElement.children ) {
166
- if ( isElementVisible( child ) ) {
167
- let childBounds = child.getBoundingClientRect();
168
- // If the parent is scrollable, use parent's scrollable bounds.
169
- if ( isScrollable( currentElement ) ) {
170
- childBounds = currentElement.getBoundingClientRect();
159
+ const dataType = element.getAttribute( 'data-type' );
160
+
161
+ /*
162
+ * For blocks with overflowing elements (like Navigation), include the bounds
163
+ * of visible children that extend beyond the parent container.
164
+ */
165
+ if ( dataType && WITH_OVERFLOW_ELEMENT_BLOCKS.includes( dataType ) ) {
166
+ const stack = [ element ];
167
+ let currentElement;
168
+
169
+ while ( ( currentElement = stack.pop() ) ) {
170
+ // Children won’t affect bounds unless the element is not scrollable.
171
+ if ( ! isScrollable( currentElement ) ) {
172
+ for ( const child of currentElement.children ) {
173
+ if ( isElementVisible( child ) ) {
174
+ const childBounds = child.getBoundingClientRect();
175
+ bounds = rectUnion( bounds, childBounds );
176
+ stack.push( child );
177
+ }
171
178
  }
172
- bounds = rectUnion( bounds, childBounds );
173
- stack.push( child );
174
179
  }
175
180
  }
176
181
  }