@wordpress/block-editor 16.0.1-next.v.202607070741.0 → 16.1.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 (679) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/README.md +8 -0
  3. package/build/components/alignment-control/ui.cjs +2 -4
  4. package/build/components/alignment-control/ui.cjs.map +2 -2
  5. package/build/components/background-image-control/index.cjs +40 -10
  6. package/build/components/background-image-control/index.cjs.map +2 -2
  7. package/build/components/block-alignment-control/ui.cjs +5 -3
  8. package/build/components/block-alignment-control/ui.cjs.map +2 -2
  9. package/build/components/block-canvas/index.cjs +6 -1
  10. package/build/components/block-canvas/index.cjs.map +2 -2
  11. package/build/components/block-controls/groups.cjs +3 -1
  12. package/build/components/block-controls/groups.cjs.map +2 -2
  13. package/build/components/block-edit/edit.cjs +10 -18
  14. package/build/components/block-edit/edit.cjs.map +2 -2
  15. package/build/components/block-inspector/index.cjs +73 -46
  16. package/build/components/block-inspector/index.cjs.map +2 -2
  17. package/build/components/block-list/block-html.cjs +4 -1
  18. package/build/components/block-list/block-html.cjs.map +2 -2
  19. package/build/components/block-list/block.cjs +9 -3
  20. package/build/components/block-list/block.cjs.map +3 -3
  21. package/build/components/block-list/index.cjs +1 -3
  22. package/build/components/block-list/index.cjs.map +2 -2
  23. package/build/components/block-list/use-block-props/index.cjs +7 -2
  24. package/build/components/block-list/use-block-props/index.cjs.map +2 -2
  25. package/build/components/block-list/use-block-props/use-focus-first-element.cjs +9 -4
  26. package/build/components/block-list/use-block-props/use-focus-first-element.cjs.map +2 -2
  27. package/build/components/block-list/use-block-props/use-focus-handler.cjs +11 -4
  28. package/build/components/block-list/use-block-props/use-focus-handler.cjs.map +2 -2
  29. package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs +48 -0
  30. package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs.map +7 -0
  31. package/build/components/block-parent-selector/index.cjs +2 -2
  32. package/build/components/block-parent-selector/index.cjs.map +2 -2
  33. package/build/components/block-toolbar/index.cjs +43 -24
  34. package/build/components/block-toolbar/index.cjs.map +2 -2
  35. package/build/components/block-toolbar/switch-section-style.cjs +4 -2
  36. package/build/components/block-toolbar/switch-section-style.cjs.map +3 -3
  37. package/build/components/block-tools/empty-block-inserter.cjs +2 -7
  38. package/build/components/block-tools/empty-block-inserter.cjs.map +2 -2
  39. package/build/components/block-tools/index.cjs +7 -2
  40. package/build/components/block-tools/index.cjs.map +2 -2
  41. package/build/components/block-vertical-alignment-control/ui.cjs +3 -5
  42. package/build/components/block-vertical-alignment-control/ui.cjs.map +2 -2
  43. package/build/components/block-visibility/modal.cjs +20 -6
  44. package/build/components/block-visibility/modal.cjs.map +2 -2
  45. package/build/components/block-visibility/use-block-visibility.cjs +16 -6
  46. package/build/components/block-visibility/use-block-visibility.cjs.map +3 -3
  47. package/build/components/block-visibility/utils.cjs +15 -2
  48. package/build/components/block-visibility/utils.cjs.map +3 -3
  49. package/build/components/block-visibility/viewport-menu-item.cjs +7 -1
  50. package/build/components/block-visibility/viewport-menu-item.cjs.map +2 -2
  51. package/build/components/block-visibility/viewport-toolbar.cjs +5 -0
  52. package/build/components/block-visibility/viewport-toolbar.cjs.map +2 -2
  53. package/build/components/block-visibility/viewport-visibility-info.cjs +5 -1
  54. package/build/components/block-visibility/viewport-visibility-info.cjs.map +2 -2
  55. package/build/components/border-radius-control/utils.cjs +8 -58
  56. package/build/components/border-radius-control/utils.cjs.map +2 -2
  57. package/build/components/child-layout-control/index.cjs +0 -4
  58. package/build/components/child-layout-control/index.cjs.map +2 -2
  59. package/build/components/colors-gradients/control.cjs +5 -3
  60. package/build/components/colors-gradients/control.cjs.map +2 -2
  61. package/build/components/dimension-control/index.cjs +30 -20
  62. package/build/components/dimension-control/index.cjs.map +3 -3
  63. package/build/components/dimensions-tool/aspect-ratio-tool.cjs +9 -2
  64. package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +3 -3
  65. package/build/components/editor-styles/index.cjs +9 -1
  66. package/build/components/editor-styles/index.cjs.map +2 -2
  67. package/build/components/global-styles/background-panel.cjs +66 -25
  68. package/build/components/global-styles/background-panel.cjs.map +3 -3
  69. package/build/components/global-styles/border-panel.cjs +153 -55
  70. package/build/components/global-styles/border-panel.cjs.map +3 -3
  71. package/build/components/global-styles/color-gradient-dropdown-item.cjs +46 -14
  72. package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +3 -3
  73. package/build/components/global-styles/color-panel.cjs +63 -17
  74. package/build/components/global-styles/color-panel.cjs.map +2 -2
  75. package/build/components/global-styles/dimensions-panel.cjs +242 -64
  76. package/build/components/global-styles/dimensions-panel.cjs.map +3 -3
  77. package/build/components/global-styles/filters-panel.cjs +59 -20
  78. package/build/components/global-styles/filters-panel.cjs.map +3 -3
  79. package/build/components/global-styles/hooks.cjs +4 -1
  80. package/build/components/global-styles/hooks.cjs.map +2 -2
  81. package/build/components/global-styles/inheritance/index.cjs +142 -0
  82. package/build/components/global-styles/inheritance/index.cjs.map +7 -0
  83. package/build/components/global-styles/inherited-value-context.cjs +173 -0
  84. package/build/components/global-styles/inherited-value-context.cjs.map +7 -0
  85. package/build/components/global-styles/shadow-panel-components.cjs +38 -20
  86. package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
  87. package/build/components/global-styles/state-control-badges.cjs +39 -3
  88. package/build/components/global-styles/state-control-badges.cjs.map +2 -2
  89. package/build/components/global-styles/state-control.cjs +1 -1
  90. package/build/components/global-styles/state-control.cjs.map +2 -2
  91. package/build/components/global-styles/typography-panel.cjs +271 -79
  92. package/build/components/global-styles/typography-panel.cjs.map +3 -3
  93. package/build/components/image-size-control/index.cjs +2 -4
  94. package/build/components/image-size-control/index.cjs.map +2 -2
  95. package/build/components/inserter/media-tab/hooks.cjs +33 -6
  96. package/build/components/inserter/media-tab/hooks.cjs.map +2 -2
  97. package/build/components/inserter/media-tab/media-panel.cjs +78 -16
  98. package/build/components/inserter/media-tab/media-panel.cjs.map +3 -3
  99. package/build/components/inspector-controls-tabs/styles-tab.cjs +10 -1
  100. package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
  101. package/build/components/keyboard-shortcuts/index.cjs +19 -11
  102. package/build/components/keyboard-shortcuts/index.cjs.map +2 -2
  103. package/build/components/line-height-control/index.cjs +1 -2
  104. package/build/components/line-height-control/index.cjs.map +2 -2
  105. package/build/components/link-control/index.cjs +3 -1
  106. package/build/components/link-control/index.cjs.map +2 -2
  107. package/build/components/list-view/block.cjs +13 -4
  108. package/build/components/list-view/block.cjs.map +2 -2
  109. package/build/components/media-placeholder/index.cjs +0 -1
  110. package/build/components/media-placeholder/index.cjs.map +2 -2
  111. package/build/components/preset-input-control/index.cjs +2 -1
  112. package/build/components/preset-input-control/index.cjs.map +2 -2
  113. package/build/components/provider/block-refs-provider.cjs +8 -2
  114. package/build/components/provider/block-refs-provider.cjs.map +2 -2
  115. package/build/components/provider/index.cjs +1 -1
  116. package/build/components/provider/index.cjs.map +2 -2
  117. package/build/components/provider/use-block-sync.cjs +18 -6
  118. package/build/components/provider/use-block-sync.cjs.map +2 -2
  119. package/build/components/provider/use-media-upload-settings.cjs +3 -1
  120. package/build/components/provider/use-media-upload-settings.cjs.map +2 -2
  121. package/build/components/rich-text/event-listeners/before-input-rules.cjs +3 -4
  122. package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
  123. package/build/components/rich-text/event-listeners/delete.cjs +2 -3
  124. package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
  125. package/build/components/rich-text/event-listeners/enter.cjs +3 -2
  126. package/build/components/rich-text/event-listeners/enter.cjs.map +3 -3
  127. package/build/components/rich-text/event-listeners/input-events.cjs +3 -3
  128. package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
  129. package/build/components/rich-text/event-listeners/input-rules.cjs +3 -4
  130. package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
  131. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +3 -3
  132. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
  133. package/build/components/rich-text/event-listeners/paste-handler.cjs +2 -1
  134. package/build/components/rich-text/event-listeners/paste-handler.cjs.map +3 -3
  135. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +3 -3
  136. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
  137. package/build/components/rich-text/event-listeners/shortcuts.cjs +3 -3
  138. package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
  139. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +3 -3
  140. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
  141. package/build/components/rich-text/index.cjs +76 -17
  142. package/build/components/rich-text/index.cjs.map +2 -2
  143. package/build/components/spacing-sizes-control/utils.cjs +6 -19
  144. package/build/components/spacing-sizes-control/utils.cjs.map +2 -2
  145. package/build/components/text-indent-control/index.cjs +8 -2
  146. package/build/components/text-indent-control/index.cjs.map +2 -2
  147. package/build/components/typewriter/index.cjs +129 -136
  148. package/build/components/typewriter/index.cjs.map +3 -3
  149. package/build/components/url-input/index.cjs +303 -344
  150. package/build/components/url-input/index.cjs.map +3 -3
  151. package/build/components/use-block-commands/index.cjs +21 -17
  152. package/build/components/use-block-commands/index.cjs.map +2 -2
  153. package/build/components/use-on-block-drop/index.cjs +1 -1
  154. package/build/components/use-on-block-drop/index.cjs.map +2 -2
  155. package/build/components/writing-flow/index.cjs +14 -1
  156. package/build/components/writing-flow/index.cjs.map +3 -3
  157. package/build/components/writing-flow/use-arrow-nav.cjs +42 -6
  158. package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
  159. package/build/components/writing-flow/use-click-selection.cjs +29 -3
  160. package/build/components/writing-flow/use-click-selection.cjs.map +2 -2
  161. package/build/components/writing-flow/use-clipboard-handler.cjs +4 -1
  162. package/build/components/writing-flow/use-clipboard-handler.cjs.map +2 -2
  163. package/build/components/writing-flow/use-drag-selection.cjs +3 -8
  164. package/build/components/writing-flow/use-drag-selection.cjs.map +2 -2
  165. package/build/components/writing-flow/use-editable-root-event-handlers.cjs +179 -0
  166. package/build/components/writing-flow/use-editable-root-event-handlers.cjs.map +7 -0
  167. package/build/components/writing-flow/use-editable-root.cjs +75 -0
  168. package/build/components/writing-flow/use-editable-root.cjs.map +7 -0
  169. package/build/components/writing-flow/use-home-end.cjs +64 -0
  170. package/build/components/writing-flow/use-home-end.cjs.map +7 -0
  171. package/build/components/writing-flow/use-input.cjs +15 -5
  172. package/build/components/writing-flow/use-input.cjs.map +2 -2
  173. package/build/components/writing-flow/use-multi-selection.cjs +2 -2
  174. package/build/components/writing-flow/use-multi-selection.cjs.map +2 -2
  175. package/build/components/writing-flow/use-select-all.cjs +14 -2
  176. package/build/components/writing-flow/use-select-all.cjs.map +2 -2
  177. package/build/components/writing-flow/use-selection-observer.cjs +132 -22
  178. package/build/components/writing-flow/use-selection-observer.cjs.map +3 -3
  179. package/build/components/writing-flow/utils.cjs +28 -2
  180. package/build/components/writing-flow/utils.cjs.map +2 -2
  181. package/build/hooks/background.cjs +14 -10
  182. package/build/hooks/background.cjs.map +2 -2
  183. package/build/hooks/block-fields/rich-text/index.cjs +2 -3
  184. package/build/hooks/block-fields/rich-text/index.cjs.map +3 -3
  185. package/build/hooks/block-style-variation.cjs +4 -45
  186. package/build/hooks/block-style-variation.cjs.map +3 -3
  187. package/build/hooks/border.cjs +19 -4
  188. package/build/hooks/border.cjs.map +2 -2
  189. package/build/hooks/custom-css.cjs +6 -2
  190. package/build/hooks/custom-css.cjs.map +2 -2
  191. package/build/hooks/dimensions.cjs +15 -4
  192. package/build/hooks/dimensions.cjs.map +2 -2
  193. package/build/hooks/duotone.cjs +26 -14
  194. package/build/hooks/duotone.cjs.map +3 -3
  195. package/build/hooks/elements.cjs +15 -5
  196. package/build/hooks/elements.cjs.map +2 -2
  197. package/build/hooks/grid-visualizer.cjs +5 -3
  198. package/build/hooks/grid-visualizer.cjs.map +2 -2
  199. package/build/hooks/layout-child.cjs +22 -12
  200. package/build/hooks/layout-child.cjs.map +3 -3
  201. package/build/hooks/layout.cjs +28 -13
  202. package/build/hooks/layout.cjs.map +3 -3
  203. package/build/hooks/line-height.cjs +1 -2
  204. package/build/hooks/line-height.cjs.map +2 -2
  205. package/build/hooks/states.cjs +27 -7
  206. package/build/hooks/states.cjs.map +3 -3
  207. package/build/hooks/style.cjs +31 -9
  208. package/build/hooks/style.cjs.map +3 -3
  209. package/build/hooks/text-align.cjs +36 -6
  210. package/build/hooks/text-align.cjs.map +3 -3
  211. package/build/hooks/typography.cjs +14 -5
  212. package/build/hooks/typography.cjs.map +2 -2
  213. package/build/layouts/constrained.cjs +14 -6
  214. package/build/layouts/constrained.cjs.map +2 -2
  215. package/build/layouts/flex.cjs +27 -19
  216. package/build/layouts/flex.cjs.map +2 -2
  217. package/build/layouts/grid.cjs +0 -2
  218. package/build/layouts/grid.cjs.map +2 -2
  219. package/build/private-apis.cjs +9 -5
  220. package/build/private-apis.cjs.map +3 -3
  221. package/build/store/actions.cjs +11 -6
  222. package/build/store/actions.cjs.map +2 -2
  223. package/build/store/private-selectors.cjs +41 -3
  224. package/build/store/private-selectors.cjs.map +3 -3
  225. package/build/store/reducer.cjs +6 -6
  226. package/build/store/reducer.cjs.map +2 -2
  227. package/build/store/selectors.cjs +23 -0
  228. package/build/store/selectors.cjs.map +2 -2
  229. package/build/utils/block-bindings.cjs +29 -0
  230. package/build/utils/block-bindings.cjs.map +2 -2
  231. package/build/utils/dom.cjs +14 -0
  232. package/build/utils/dom.cjs.map +2 -2
  233. package/build/{components/rich-text/input-event.cjs → utils/native-undo.cjs} +29 -24
  234. package/build/utils/native-undo.cjs.map +7 -0
  235. package/build-module/components/alignment-control/ui.mjs +2 -4
  236. package/build-module/components/alignment-control/ui.mjs.map +2 -2
  237. package/build-module/components/background-image-control/index.mjs +43 -10
  238. package/build-module/components/background-image-control/index.mjs.map +2 -2
  239. package/build-module/components/block-alignment-control/ui.mjs +5 -3
  240. package/build-module/components/block-alignment-control/ui.mjs.map +2 -2
  241. package/build-module/components/block-canvas/index.mjs +7 -2
  242. package/build-module/components/block-canvas/index.mjs.map +2 -2
  243. package/build-module/components/block-controls/groups.mjs +3 -1
  244. package/build-module/components/block-controls/groups.mjs.map +2 -2
  245. package/build-module/components/block-edit/edit.mjs +11 -18
  246. package/build-module/components/block-edit/edit.mjs.map +2 -2
  247. package/build-module/components/block-inspector/index.mjs +74 -46
  248. package/build-module/components/block-inspector/index.mjs.map +2 -2
  249. package/build-module/components/block-list/block-html.mjs +4 -1
  250. package/build-module/components/block-list/block-html.mjs.map +2 -2
  251. package/build-module/components/block-list/block.mjs +9 -3
  252. package/build-module/components/block-list/block.mjs.map +3 -3
  253. package/build-module/components/block-list/index.mjs +1 -3
  254. package/build-module/components/block-list/index.mjs.map +2 -2
  255. package/build-module/components/block-list/use-block-props/index.mjs +7 -2
  256. package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
  257. package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs +9 -4
  258. package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs.map +2 -2
  259. package/build-module/components/block-list/use-block-props/use-focus-handler.mjs +11 -4
  260. package/build-module/components/block-list/use-block-props/use-focus-handler.mjs.map +2 -2
  261. package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs +28 -0
  262. package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs.map +7 -0
  263. package/build-module/components/block-parent-selector/index.mjs +2 -2
  264. package/build-module/components/block-parent-selector/index.mjs.map +2 -2
  265. package/build-module/components/block-toolbar/index.mjs +43 -24
  266. package/build-module/components/block-toolbar/index.mjs.map +2 -2
  267. package/build-module/components/block-toolbar/switch-section-style.mjs +4 -2
  268. package/build-module/components/block-toolbar/switch-section-style.mjs.map +2 -2
  269. package/build-module/components/block-tools/empty-block-inserter.mjs +2 -7
  270. package/build-module/components/block-tools/empty-block-inserter.mjs.map +2 -2
  271. package/build-module/components/block-tools/index.mjs +7 -2
  272. package/build-module/components/block-tools/index.mjs.map +2 -2
  273. package/build-module/components/block-vertical-alignment-control/ui.mjs +4 -6
  274. package/build-module/components/block-vertical-alignment-control/ui.mjs.map +2 -2
  275. package/build-module/components/block-visibility/modal.mjs +22 -10
  276. package/build-module/components/block-visibility/modal.mjs.map +2 -2
  277. package/build-module/components/block-visibility/use-block-visibility.mjs +17 -7
  278. package/build-module/components/block-visibility/use-block-visibility.mjs.map +2 -2
  279. package/build-module/components/block-visibility/utils.mjs +18 -3
  280. package/build-module/components/block-visibility/utils.mjs.map +2 -2
  281. package/build-module/components/block-visibility/viewport-menu-item.mjs +7 -1
  282. package/build-module/components/block-visibility/viewport-menu-item.mjs.map +2 -2
  283. package/build-module/components/block-visibility/viewport-toolbar.mjs +5 -0
  284. package/build-module/components/block-visibility/viewport-toolbar.mjs.map +2 -2
  285. package/build-module/components/block-visibility/viewport-visibility-info.mjs +5 -1
  286. package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
  287. package/build-module/components/border-radius-control/utils.mjs +11 -53
  288. package/build-module/components/border-radius-control/utils.mjs.map +2 -2
  289. package/build-module/components/child-layout-control/index.mjs +0 -4
  290. package/build-module/components/child-layout-control/index.mjs.map +2 -2
  291. package/build-module/components/colors-gradients/control.mjs +5 -3
  292. package/build-module/components/colors-gradients/control.mjs.map +2 -2
  293. package/build-module/components/dimension-control/index.mjs +30 -20
  294. package/build-module/components/dimension-control/index.mjs.map +2 -2
  295. package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +10 -6
  296. package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
  297. package/build-module/components/editor-styles/index.mjs +9 -1
  298. package/build-module/components/editor-styles/index.mjs.map +2 -2
  299. package/build-module/components/global-styles/background-panel.mjs +71 -29
  300. package/build-module/components/global-styles/background-panel.mjs.map +2 -2
  301. package/build-module/components/global-styles/border-panel.mjs +157 -56
  302. package/build-module/components/global-styles/border-panel.mjs.map +2 -2
  303. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +51 -15
  304. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +2 -2
  305. package/build-module/components/global-styles/color-panel.mjs +63 -17
  306. package/build-module/components/global-styles/color-panel.mjs.map +2 -2
  307. package/build-module/components/global-styles/dimensions-panel.mjs +248 -66
  308. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  309. package/build-module/components/global-styles/filters-panel.mjs +64 -21
  310. package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
  311. package/build-module/components/global-styles/hooks.mjs +4 -1
  312. package/build-module/components/global-styles/hooks.mjs.map +2 -2
  313. package/build-module/components/global-styles/inheritance/index.mjs +108 -0
  314. package/build-module/components/global-styles/inheritance/index.mjs.map +7 -0
  315. package/build-module/components/global-styles/inherited-value-context.mjs +141 -0
  316. package/build-module/components/global-styles/inherited-value-context.mjs.map +7 -0
  317. package/build-module/components/global-styles/shadow-panel-components.mjs +38 -20
  318. package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
  319. package/build-module/components/global-styles/state-control-badges.mjs +41 -5
  320. package/build-module/components/global-styles/state-control-badges.mjs.map +2 -2
  321. package/build-module/components/global-styles/state-control.mjs +1 -1
  322. package/build-module/components/global-styles/state-control.mjs.map +2 -2
  323. package/build-module/components/global-styles/typography-panel.mjs +276 -80
  324. package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
  325. package/build-module/components/image-size-control/index.mjs +2 -4
  326. package/build-module/components/image-size-control/index.mjs.map +2 -2
  327. package/build-module/components/inserter/media-tab/hooks.mjs +33 -6
  328. package/build-module/components/inserter/media-tab/hooks.mjs.map +2 -2
  329. package/build-module/components/inserter/media-tab/media-panel.mjs +86 -18
  330. package/build-module/components/inserter/media-tab/media-panel.mjs.map +2 -2
  331. package/build-module/components/inspector-controls-tabs/styles-tab.mjs +6 -1
  332. package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
  333. package/build-module/components/keyboard-shortcuts/index.mjs +19 -11
  334. package/build-module/components/keyboard-shortcuts/index.mjs.map +2 -2
  335. package/build-module/components/line-height-control/index.mjs +1 -2
  336. package/build-module/components/line-height-control/index.mjs.map +2 -2
  337. package/build-module/components/link-control/index.mjs +4 -2
  338. package/build-module/components/link-control/index.mjs.map +2 -2
  339. package/build-module/components/list-view/block.mjs +13 -4
  340. package/build-module/components/list-view/block.mjs.map +2 -2
  341. package/build-module/components/media-placeholder/index.mjs +0 -1
  342. package/build-module/components/media-placeholder/index.mjs.map +2 -2
  343. package/build-module/components/preset-input-control/index.mjs +2 -1
  344. package/build-module/components/preset-input-control/index.mjs.map +2 -2
  345. package/build-module/components/provider/block-refs-provider.mjs +8 -2
  346. package/build-module/components/provider/block-refs-provider.mjs.map +2 -2
  347. package/build-module/components/provider/index.mjs +1 -1
  348. package/build-module/components/provider/index.mjs.map +2 -2
  349. package/build-module/components/provider/use-block-sync.mjs +18 -6
  350. package/build-module/components/provider/use-block-sync.mjs.map +2 -2
  351. package/build-module/components/provider/use-media-upload-settings.mjs +3 -1
  352. package/build-module/components/provider/use-media-upload-settings.mjs.map +2 -2
  353. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +8 -5
  354. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
  355. package/build-module/components/rich-text/event-listeners/delete.mjs +7 -4
  356. package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
  357. package/build-module/components/rich-text/event-listeners/enter.mjs +8 -3
  358. package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
  359. package/build-module/components/rich-text/event-listeners/input-events.mjs +3 -3
  360. package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
  361. package/build-module/components/rich-text/event-listeners/input-rules.mjs +8 -5
  362. package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
  363. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +3 -3
  364. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
  365. package/build-module/components/rich-text/event-listeners/paste-handler.mjs +8 -2
  366. package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
  367. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +3 -3
  368. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
  369. package/build-module/components/rich-text/event-listeners/shortcuts.mjs +3 -3
  370. package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
  371. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +3 -3
  372. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
  373. package/build-module/components/rich-text/index.mjs +79 -14
  374. package/build-module/components/rich-text/index.mjs.map +2 -2
  375. package/build-module/components/spacing-sizes-control/utils.mjs +6 -18
  376. package/build-module/components/spacing-sizes-control/utils.mjs.map +2 -2
  377. package/build-module/components/text-indent-control/index.mjs +8 -2
  378. package/build-module/components/text-indent-control/index.mjs.map +2 -2
  379. package/build-module/components/typewriter/index.mjs +129 -136
  380. package/build-module/components/typewriter/index.mjs.map +2 -2
  381. package/build-module/components/url-input/index.mjs +306 -353
  382. package/build-module/components/url-input/index.mjs.map +2 -2
  383. package/build-module/components/use-block-commands/index.mjs +21 -17
  384. package/build-module/components/use-block-commands/index.mjs.map +2 -2
  385. package/build-module/components/use-on-block-drop/index.mjs +2 -2
  386. package/build-module/components/use-on-block-drop/index.mjs.map +2 -2
  387. package/build-module/components/writing-flow/index.mjs +14 -1
  388. package/build-module/components/writing-flow/index.mjs.map +2 -2
  389. package/build-module/components/writing-flow/use-arrow-nav.mjs +43 -7
  390. package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
  391. package/build-module/components/writing-flow/use-click-selection.mjs +29 -3
  392. package/build-module/components/writing-flow/use-click-selection.mjs.map +2 -2
  393. package/build-module/components/writing-flow/use-clipboard-handler.mjs +5 -2
  394. package/build-module/components/writing-flow/use-clipboard-handler.mjs.map +2 -2
  395. package/build-module/components/writing-flow/use-drag-selection.mjs +1 -6
  396. package/build-module/components/writing-flow/use-drag-selection.mjs.map +2 -2
  397. package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs +154 -0
  398. package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs.map +7 -0
  399. package/build-module/components/writing-flow/use-editable-root.mjs +54 -0
  400. package/build-module/components/writing-flow/use-editable-root.mjs.map +7 -0
  401. package/build-module/components/writing-flow/use-home-end.mjs +43 -0
  402. package/build-module/components/writing-flow/use-home-end.mjs.map +7 -0
  403. package/build-module/components/writing-flow/use-input.mjs +15 -5
  404. package/build-module/components/writing-flow/use-input.mjs.map +2 -2
  405. package/build-module/components/writing-flow/use-multi-selection.mjs +2 -2
  406. package/build-module/components/writing-flow/use-multi-selection.mjs.map +2 -2
  407. package/build-module/components/writing-flow/use-select-all.mjs +19 -3
  408. package/build-module/components/writing-flow/use-select-all.mjs.map +2 -2
  409. package/build-module/components/writing-flow/use-selection-observer.mjs +134 -21
  410. package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
  411. package/build-module/components/writing-flow/utils.mjs +26 -1
  412. package/build-module/components/writing-flow/utils.mjs.map +2 -2
  413. package/build-module/hooks/background.mjs +14 -10
  414. package/build-module/hooks/background.mjs.map +2 -2
  415. package/build-module/hooks/block-fields/rich-text/index.mjs +2 -6
  416. package/build-module/hooks/block-fields/rich-text/index.mjs.map +2 -2
  417. package/build-module/hooks/block-style-variation.mjs +8 -44
  418. package/build-module/hooks/block-style-variation.mjs.map +2 -2
  419. package/build-module/hooks/border.mjs +19 -4
  420. package/build-module/hooks/border.mjs.map +2 -2
  421. package/build-module/hooks/custom-css.mjs +7 -3
  422. package/build-module/hooks/custom-css.mjs.map +2 -2
  423. package/build-module/hooks/dimensions.mjs +15 -4
  424. package/build-module/hooks/dimensions.mjs.map +2 -2
  425. package/build-module/hooks/duotone.mjs +20 -9
  426. package/build-module/hooks/duotone.mjs.map +2 -2
  427. package/build-module/hooks/elements.mjs +15 -5
  428. package/build-module/hooks/elements.mjs.map +2 -2
  429. package/build-module/hooks/grid-visualizer.mjs +5 -3
  430. package/build-module/hooks/grid-visualizer.mjs.map +2 -2
  431. package/build-module/hooks/layout-child.mjs +22 -12
  432. package/build-module/hooks/layout-child.mjs.map +2 -2
  433. package/build-module/hooks/layout.mjs +28 -13
  434. package/build-module/hooks/layout.mjs.map +2 -2
  435. package/build-module/hooks/line-height.mjs +1 -2
  436. package/build-module/hooks/line-height.mjs.map +2 -2
  437. package/build-module/hooks/states.mjs +27 -7
  438. package/build-module/hooks/states.mjs.map +2 -2
  439. package/build-module/hooks/style.mjs +40 -11
  440. package/build-module/hooks/style.mjs.map +2 -2
  441. package/build-module/hooks/text-align.mjs +39 -10
  442. package/build-module/hooks/text-align.mjs.map +2 -2
  443. package/build-module/hooks/typography.mjs +14 -5
  444. package/build-module/hooks/typography.mjs.map +2 -2
  445. package/build-module/layouts/constrained.mjs +14 -6
  446. package/build-module/layouts/constrained.mjs.map +2 -2
  447. package/build-module/layouts/flex.mjs +27 -19
  448. package/build-module/layouts/flex.mjs.map +2 -2
  449. package/build-module/layouts/grid.mjs +0 -2
  450. package/build-module/layouts/grid.mjs.map +2 -2
  451. package/build-module/private-apis.mjs +7 -3
  452. package/build-module/private-apis.mjs.map +2 -2
  453. package/build-module/store/actions.mjs +12 -7
  454. package/build-module/store/actions.mjs.map +2 -2
  455. package/build-module/store/private-selectors.mjs +42 -3
  456. package/build-module/store/private-selectors.mjs.map +2 -2
  457. package/build-module/store/reducer.mjs +6 -6
  458. package/build-module/store/reducer.mjs.map +2 -2
  459. package/build-module/store/selectors.mjs +23 -0
  460. package/build-module/store/selectors.mjs.map +2 -2
  461. package/build-module/utils/block-bindings.mjs +28 -0
  462. package/build-module/utils/block-bindings.mjs.map +2 -2
  463. package/build-module/utils/dom.mjs +13 -0
  464. package/build-module/utils/dom.mjs.map +2 -2
  465. package/build-module/utils/native-undo.mjs +29 -0
  466. package/build-module/utils/native-undo.mjs.map +7 -0
  467. package/build-style/content-rtl.css +14 -27
  468. package/build-style/content.css +14 -27
  469. package/build-style/default-editor-styles-rtl.css +1 -1
  470. package/build-style/default-editor-styles.css +1 -1
  471. package/build-style/style-rtl.css +191 -61
  472. package/build-style/style.css +191 -61
  473. package/build-types/components/block-context/index.d.ts +7 -0
  474. package/build-types/components/block-context/index.d.ts.map +1 -1
  475. package/build-types/utils/block-bindings.d.ts +19 -0
  476. package/build-types/utils/block-bindings.d.ts.map +1 -1
  477. package/build-types/utils/dom.d.ts +11 -0
  478. package/build-types/utils/dom.d.ts.map +1 -1
  479. package/build-types/utils/get-px-from-css-unit.d.ts +2 -2
  480. package/build-types/utils/get-px-from-css-unit.d.ts.map +1 -1
  481. package/build-types/utils/pasting.d.ts +1 -1
  482. package/build-types/utils/pasting.d.ts.map +1 -1
  483. package/package.json +43 -44
  484. package/src/components/alignment-control/test/__snapshots__/index.js.snap +1 -1
  485. package/src/components/alignment-control/ui.js +2 -4
  486. package/src/components/background-image-control/index.js +74 -37
  487. package/src/components/background-image-control/style.scss +13 -4
  488. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +3 -3
  489. package/src/components/block-alignment-control/test/index.js +1 -1
  490. package/src/components/block-alignment-control/ui.js +4 -2
  491. package/src/components/block-breadcrumb/test/__snapshots__/index.js.snap +1 -1
  492. package/src/components/block-canvas/index.js +9 -2
  493. package/src/components/block-card/style.scss +1 -1
  494. package/src/components/block-compare/test/__snapshots__/block-view.js.snap +1 -1
  495. package/src/components/block-controls/groups.js +2 -0
  496. package/src/components/block-edit/edit.js +13 -31
  497. package/src/components/block-icon/test/__snapshots__/index.js.snap +1 -1
  498. package/src/components/block-inspector/index.js +60 -31
  499. package/src/components/block-list/block-html.js +5 -0
  500. package/src/components/block-list/block.js +6 -0
  501. package/src/components/block-list/content.scss +1 -11
  502. package/src/components/block-list/index.js +0 -2
  503. package/src/components/block-list/use-block-props/index.js +7 -1
  504. package/src/components/block-list/use-block-props/use-focus-first-element.js +23 -4
  505. package/src/components/block-list/use-block-props/use-focus-handler.js +35 -9
  506. package/src/components/block-list/use-block-props/use-register-block-event-handlers.js +45 -0
  507. package/src/components/block-lock/style.scss +1 -1
  508. package/src/components/block-manager/style.scss +1 -1
  509. package/src/components/block-navigation/style.scss +1 -1
  510. package/src/components/block-parent-selector/index.js +5 -2
  511. package/src/components/block-quick-navigation/style.scss +1 -3
  512. package/src/components/block-styles/style.scss +2 -2
  513. package/src/components/block-toolbar/index.js +41 -18
  514. package/src/components/block-toolbar/switch-section-style.js +5 -2
  515. package/src/components/block-tools/empty-block-inserter.js +3 -7
  516. package/src/components/block-tools/index.js +7 -0
  517. package/src/components/block-types-list/style.scss +0 -1
  518. package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +3 -3
  519. package/src/components/block-vertical-alignment-control/test/index.js +18 -2
  520. package/src/components/block-vertical-alignment-control/ui.js +3 -5
  521. package/src/components/block-visibility/modal.js +24 -10
  522. package/src/components/block-visibility/style.scss +1 -1
  523. package/src/components/block-visibility/test/use-block-visibility.js +128 -35
  524. package/src/components/block-visibility/test/utils.js +11 -0
  525. package/src/components/block-visibility/use-block-visibility.js +33 -11
  526. package/src/components/block-visibility/utils.js +31 -6
  527. package/src/components/block-visibility/viewport-menu-item.js +10 -1
  528. package/src/components/block-visibility/viewport-toolbar.js +6 -0
  529. package/src/components/block-visibility/viewport-visibility-info.js +5 -1
  530. package/src/components/border-radius-control/test/utils.js +0 -41
  531. package/src/components/border-radius-control/utils.js +16 -107
  532. package/src/components/button-block-appender/content.scss +7 -9
  533. package/src/components/child-layout-control/index.js +0 -4
  534. package/src/components/color-palette/test/__snapshots__/control.js.snap +3 -3
  535. package/src/components/colors-gradients/control.js +6 -3
  536. package/src/components/default-block-appender/test/__snapshots__/index.js.snap +1 -1
  537. package/src/components/dimension-control/index.js +13 -1
  538. package/src/components/dimensions-tool/aspect-ratio-tool.js +13 -6
  539. package/src/components/editor-styles/index.js +16 -1
  540. package/src/components/font-family/stories/index.story.jsx +1 -1
  541. package/src/components/global-styles/background-panel.js +107 -34
  542. package/src/components/global-styles/border-panel.js +219 -48
  543. package/src/components/global-styles/color-gradient-dropdown-item.js +93 -28
  544. package/src/components/global-styles/color-panel.js +92 -11
  545. package/src/components/global-styles/dimensions-panel.js +422 -71
  546. package/src/components/global-styles/filters-panel.js +88 -28
  547. package/src/components/global-styles/hooks.js +8 -1
  548. package/src/components/global-styles/inheritance/index.js +204 -0
  549. package/src/components/global-styles/inheritance/style.scss +184 -0
  550. package/src/components/global-styles/inheritance/test/index.js +281 -0
  551. package/src/components/global-styles/inherited-value-context.js +271 -0
  552. package/src/components/global-styles/shadow-panel-components.js +48 -26
  553. package/src/components/global-styles/state-control-badges.js +45 -6
  554. package/src/components/global-styles/state-control.js +2 -2
  555. package/src/components/global-styles/style.scss +5 -0
  556. package/src/components/global-styles/test/background-panel.js +338 -1
  557. package/src/components/global-styles/test/border-panel.js +441 -0
  558. package/src/components/global-styles/test/color-panel.js +182 -2
  559. package/src/components/global-styles/test/dimensions-panel.js +753 -0
  560. package/src/components/global-styles/test/filters-panel.js +194 -0
  561. package/src/components/global-styles/test/inherited-value-context-core.js +98 -0
  562. package/src/components/global-styles/test/inherited-value-context.js +454 -0
  563. package/src/components/global-styles/test/state-control-badges.js +65 -0
  564. package/src/components/global-styles/test/typography-panel-core.js +185 -0
  565. package/src/components/global-styles/test/typography-panel.js +849 -12
  566. package/src/components/global-styles/typography-panel.js +449 -101
  567. package/src/components/image-editor/style.scss +33 -0
  568. package/src/components/image-size-control/index.js +0 -2
  569. package/src/components/inner-blocks/test/__snapshots__/index.js.snap +1 -1
  570. package/src/components/inserter/media-tab/hooks.js +55 -7
  571. package/src/components/inserter/media-tab/media-panel.js +117 -21
  572. package/src/components/inserter/media-tab/test/hooks.js +63 -0
  573. package/src/components/inserter/media-tab/test/media-panel.js +127 -0
  574. package/src/components/inserter/style.scss +19 -16
  575. package/src/components/inserter-list-item/style.scss +0 -15
  576. package/src/components/inspector-controls-tabs/styles-tab.js +5 -1
  577. package/src/components/keyboard-shortcuts/index.js +28 -11
  578. package/src/components/line-height-control/index.js +1 -2
  579. package/src/components/link-control/index.js +7 -2
  580. package/src/components/link-control/style.scss +2 -2
  581. package/src/components/link-control/test/index.js +6 -6
  582. package/src/components/link-picker/style.scss +1 -2
  583. package/src/components/list-view/block.js +13 -4
  584. package/src/components/list-view/style.scss +4 -5
  585. package/src/components/media-placeholder/index.js +0 -1
  586. package/src/components/multi-selection-inspector/style.scss +1 -1
  587. package/src/components/preset-input-control/index.js +4 -1
  588. package/src/components/provider/block-refs-provider.js +12 -2
  589. package/src/components/provider/index.js +2 -2
  590. package/src/components/provider/use-block-sync.js +18 -6
  591. package/src/components/provider/use-media-upload-settings.js +2 -0
  592. package/src/components/responsive-block-control/style.scss +1 -1
  593. package/src/components/rich-text/event-listeners/before-input-rules.js +8 -5
  594. package/src/components/rich-text/event-listeners/delete.js +7 -4
  595. package/src/components/rich-text/event-listeners/enter.js +10 -4
  596. package/src/components/rich-text/event-listeners/input-events.js +4 -3
  597. package/src/components/rich-text/event-listeners/input-rules.js +8 -5
  598. package/src/components/rich-text/event-listeners/insert-replacement-text.js +4 -3
  599. package/src/components/rich-text/event-listeners/paste-handler.js +15 -3
  600. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +4 -3
  601. package/src/components/rich-text/event-listeners/shortcuts.js +4 -3
  602. package/src/components/rich-text/event-listeners/undo-automatic-change.js +4 -3
  603. package/src/components/rich-text/index.js +116 -26
  604. package/src/components/skip-to-selected-block/style.scss +1 -1
  605. package/src/components/spacing-sizes-control/test/utils.js +16 -5
  606. package/src/components/spacing-sizes-control/utils.js +11 -28
  607. package/src/components/text-indent-control/index.js +8 -0
  608. package/src/components/typewriter/index.js +228 -224
  609. package/src/components/url-input/index.js +363 -431
  610. package/src/components/url-input/test/index.js +592 -0
  611. package/src/components/use-block-commands/index.js +27 -17
  612. package/src/components/use-on-block-drop/index.js +2 -2
  613. package/src/components/warning/test/__snapshots__/index.js.snap +1 -1
  614. package/src/components/writing-flow/index.js +17 -1
  615. package/src/components/writing-flow/use-arrow-nav.js +90 -13
  616. package/src/components/writing-flow/use-click-selection.js +55 -5
  617. package/src/components/writing-flow/use-clipboard-handler.js +5 -2
  618. package/src/components/writing-flow/use-drag-selection.js +1 -14
  619. package/src/components/writing-flow/use-editable-root-event-handlers.js +266 -0
  620. package/src/components/writing-flow/use-editable-root.js +112 -0
  621. package/src/components/writing-flow/use-home-end.js +71 -0
  622. package/src/components/writing-flow/use-input.js +25 -8
  623. package/src/components/writing-flow/use-multi-selection.js +2 -3
  624. package/src/components/writing-flow/use-select-all.js +33 -3
  625. package/src/components/writing-flow/use-selection-observer.js +218 -42
  626. package/src/components/writing-flow/utils.js +62 -0
  627. package/src/hooks/background.js +27 -24
  628. package/src/hooks/block-fields/link/styles.scss +1 -6
  629. package/src/hooks/block-fields/media/styles.scss +1 -6
  630. package/src/hooks/block-fields/rich-text/index.js +6 -9
  631. package/src/hooks/block-fields/rich-text/styles.scss +1 -1
  632. package/src/hooks/block-style-variation.js +8 -74
  633. package/src/hooks/border.js +19 -4
  634. package/src/hooks/custom-css.js +15 -6
  635. package/src/hooks/dimensions.js +17 -4
  636. package/src/hooks/duotone.js +26 -8
  637. package/src/hooks/elements.js +14 -4
  638. package/src/hooks/grid-visualizer.js +40 -36
  639. package/src/hooks/layout-child.js +19 -9
  640. package/src/hooks/layout.js +48 -31
  641. package/src/hooks/line-height.js +0 -1
  642. package/src/hooks/states.js +38 -9
  643. package/src/hooks/style.js +67 -17
  644. package/src/hooks/test/inherited-value-wiring.js +411 -0
  645. package/src/hooks/test/preset-round-trip.js +456 -0
  646. package/src/hooks/test/style.js +29 -0
  647. package/src/hooks/test/text-align.js +34 -1
  648. package/src/hooks/text-align.js +41 -10
  649. package/src/hooks/typography.js +35 -24
  650. package/src/layouts/constrained.js +5 -1
  651. package/src/layouts/flex.js +5 -1
  652. package/src/layouts/grid.js +0 -2
  653. package/src/private-apis.js +11 -2
  654. package/src/store/actions.js +53 -19
  655. package/src/store/private-selectors.js +82 -6
  656. package/src/store/reducer.js +9 -9
  657. package/src/store/selectors.js +56 -8
  658. package/src/store/test/actions.js +1 -1
  659. package/src/store/test/private-selectors.js +271 -1
  660. package/src/style.scss +2 -0
  661. package/src/utils/block-bindings.ts +50 -0
  662. package/src/utils/dom.ts +33 -0
  663. package/src/utils/native-undo.js +56 -0
  664. package/src/utils/test/block-bindings.js +181 -0
  665. package/build/components/duotone/utils.cjs +0 -87
  666. package/build/components/duotone/utils.cjs.map +0 -7
  667. package/build/components/rich-text/input-event.cjs.map +0 -7
  668. package/build/components/rich-text/shortcut.cjs +0 -51
  669. package/build/components/rich-text/shortcut.cjs.map +0 -7
  670. package/build-module/components/duotone/utils.mjs +0 -59
  671. package/build-module/components/duotone/utils.mjs.map +0 -7
  672. package/build-module/components/rich-text/input-event.mjs +0 -25
  673. package/build-module/components/rich-text/input-event.mjs.map +0 -7
  674. package/build-module/components/rich-text/shortcut.mjs +0 -26
  675. package/build-module/components/rich-text/shortcut.mjs.map +0 -7
  676. package/src/components/duotone/utils.js +0 -90
  677. package/src/components/rich-text/input-event.js +0 -31
  678. package/src/components/rich-text/shortcut.js +0 -32
  679. package/src/hooks/test/get-variation-styles-with-ref-values.js +0 -91
@@ -14,6 +14,7 @@ import {
14
14
  default as StylesTypographyPanel,
15
15
  useHasTypographyPanel,
16
16
  } from '../components/global-styles/typography-panel';
17
+ import { useResolvedStyle } from '../components/global-styles/inherited-value-context';
17
18
 
18
19
  import { LINE_HEIGHT_SUPPORT_KEY } from './line-height';
19
20
  import { FONT_FAMILY_SUPPORT_KEY } from './font-family';
@@ -151,32 +152,42 @@ export function TypographyPanel( {
151
152
  const selectedState = useBlockStyleState();
152
153
  const isEnabled = useHasTypographyPanel( settings );
153
154
 
154
- const { style, fontFamily, fontSize, fitText, textColor } = useSelect(
155
- ( select ) => {
156
- // Early return to avoid subscription when disabled.
157
- if ( ! isEnabled ) {
158
- return {};
159
- }
160
- const {
161
- style: _style,
162
- fontFamily: _fontFamily,
163
- fontSize: _fontSize,
164
- fitText: _fitText,
165
- textColor: _textColor,
166
- } = select( blockEditorStore ).getBlockAttributes( clientId ) || {};
167
- return {
168
- style: _style,
169
- fontFamily: _fontFamily,
170
- fontSize: _fontSize,
171
- fitText: _fitText,
172
- textColor: _textColor,
173
- };
174
- },
175
- [ clientId, isEnabled ]
176
- );
155
+ const { style, fontFamily, fontSize, fitText, textColor, className } =
156
+ useSelect(
157
+ ( select ) => {
158
+ // Early return to avoid subscription when disabled.
159
+ if ( ! isEnabled ) {
160
+ return {};
161
+ }
162
+ const {
163
+ style: _style,
164
+ fontFamily: _fontFamily,
165
+ fontSize: _fontSize,
166
+ fitText: _fitText,
167
+ textColor: _textColor,
168
+ className: _className,
169
+ } = select( blockEditorStore ).getBlockAttributes( clientId ) ||
170
+ {};
171
+ return {
172
+ style: _style,
173
+ fontFamily: _fontFamily,
174
+ fontSize: _fontSize,
175
+ fitText: _fitText,
176
+ textColor: _textColor,
177
+ className: _className,
178
+ };
179
+ },
180
+ [ clientId, isEnabled ]
181
+ );
177
182
 
178
183
  const isStateSelected = ! isDefaultBlockStyleState( selectedState );
179
184
 
185
+ const { value: inheritedValue } = useResolvedStyle(
186
+ name,
187
+ className,
188
+ selectedState
189
+ );
190
+
180
191
  const value = useMemo( () => {
181
192
  if ( isStateSelected ) {
182
193
  return getStyleForState( style, selectedState );
@@ -214,7 +225,6 @@ export function TypographyPanel( {
214
225
  // Link color failures are reported by the Elements panel, which owns the
215
226
  // link color selection.
216
227
  const enableContrastChecking =
217
- ! isStateSelected &&
218
228
  ! value?.color?.gradient &&
219
229
  !! value?.color?.text &&
220
230
  settings?.color?.text &&
@@ -258,6 +268,7 @@ export function TypographyPanel( {
258
268
  onChange={ onChange }
259
269
  defaultControls={ defaultControls }
260
270
  contrastWarning={ contrastWarning }
271
+ inheritedValue={ inheritedValue }
261
272
  />
262
273
  );
263
274
  }
@@ -219,6 +219,7 @@ export default {
219
219
  layout = {},
220
220
  onChange,
221
221
  layoutBlockSupport,
222
+ controlsGroup = 'block',
222
223
  } ) {
223
224
  const { allowJustification = true } = layoutBlockSupport;
224
225
 
@@ -226,7 +227,10 @@ export default {
226
227
  return null;
227
228
  }
228
229
  return (
229
- <BlockControls group="block" __experimentalShareWithChildBlocks>
230
+ <BlockControls
231
+ group={ controlsGroup }
232
+ __experimentalShareWithChildBlocks
233
+ >
230
234
  <DefaultLayoutJustifyContentControl
231
235
  layout={ layout }
232
236
  onChange={ onChange }
@@ -240,6 +240,7 @@ export default {
240
240
  layout = {},
241
241
  onChange,
242
242
  layoutBlockSupport,
243
+ controlsGroup = 'block',
243
244
  } ) {
244
245
  const { allowVerticalAlignment = true, allowJustification = true } =
245
246
  layoutBlockSupport;
@@ -249,7 +250,10 @@ export default {
249
250
  }
250
251
 
251
252
  return (
252
- <BlockControls group="block" __experimentalShareWithChildBlocks>
253
+ <BlockControls
254
+ group={ controlsGroup }
255
+ __experimentalShareWithChildBlocks
256
+ >
253
257
  { allowJustification && (
254
258
  <FlexLayoutJustifyContentControl
255
259
  layout={ layout }
@@ -452,7 +452,6 @@ function GridLayoutColumnsAndRowsControl( {
452
452
  <Flex gap={ 4 }>
453
453
  <FlexItem isBlock>
454
454
  <NumberControl
455
- size="__unstable-large"
456
455
  onChange={ ( value ) => {
457
456
  // Allow unsetting the column count when in auto mode.
458
457
  const defaultNewColumnCount = isManualPlacement
@@ -477,7 +476,6 @@ function GridLayoutColumnsAndRowsControl( {
477
476
  <FlexItem isBlock>
478
477
  { allowSizingOnChildren && isManualPlacement ? (
479
478
  <NumberControl
480
- size="__unstable-large"
481
479
  onChange={ ( value ) => {
482
480
  // Don't allow unsetting the row count.
483
481
  const newRowCount =
@@ -1,9 +1,14 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { privateApis as globalStylesEnginePrivateApis } from '@wordpress/global-styles-engine';
5
+
1
6
  /**
2
7
  * Internal dependencies
3
8
  */
4
9
  import * as globalStyles from './components/global-styles';
5
10
  import { ExperimentalBlockEditorProvider } from './components/provider';
6
- import { lock } from './lock-unlock';
11
+ import { lock, unlock } from './lock-unlock';
7
12
  import { getRichTextValues } from './components/rich-text/get-rich-text-values';
8
13
  import ResizableBoxPopover from './components/resizable-box-popover';
9
14
  import { default as PrivateQuickInserter } from './components/inserter/quick-inserter';
@@ -40,7 +45,6 @@ import {
40
45
  ExperimentalBlockCanvas,
41
46
  BlockCanvasCover,
42
47
  } from './components/block-canvas';
43
- import { getDuotoneFilter } from './components/duotone/utils';
44
48
  import { useFlashEditableBlocks } from './components/use-flash-editable-blocks';
45
49
  import {
46
50
  selectBlockPatternsKey,
@@ -79,11 +83,14 @@ import useRemoteUrlData from './components/link-control/use-rich-url-data';
79
83
  import { PrivateBlockContext } from './components/block-list/private-block-context';
80
84
  import useListViewPanelState from './components/use-list-view-panel-state';
81
85
  import InnerContent from './components/inner-content';
86
+ import { useNativeUndo, usesNativeUndo } from './utils/native-undo';
82
87
  import {
83
88
  isHashLink,
84
89
  isRelativePath,
85
90
  } from './components/link-control/is-url-like';
86
91
 
92
+ const { getDuotoneFilter } = unlock( globalStylesEnginePrivateApis );
93
+
87
94
  /**
88
95
  * Private @wordpress/block-editor APIs.
89
96
  */
@@ -157,4 +164,6 @@ lock( privateApis, {
157
164
  isHashLink,
158
165
  isRelativePath,
159
166
  InnerContent,
167
+ useNativeUndo,
168
+ usesNativeUndo,
160
169
  } );
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import {
6
6
  cloneBlock,
7
- __experimentalCloneSanitizedBlock,
7
+ cloneSanitizedBlock,
8
8
  createBlock,
9
9
  doBlocksMatchTemplate,
10
10
  getBlockType,
@@ -1253,10 +1253,16 @@ export const mergeBlocks =
1253
1253
  }
1254
1254
 
1255
1255
  if ( isUnmodifiedDefaultBlock( blockA ) ) {
1256
- dispatch.removeBlock(
1257
- clientIdA,
1258
- select.isBlockSelected( clientIdA )
1259
- );
1256
+ const isASelected = select.isBlockSelected( clientIdA );
1257
+
1258
+ if ( isASelected ) {
1259
+ registry.batch( () => {
1260
+ dispatch.removeBlock( clientIdA, false );
1261
+ dispatch.selectBlock( clientIdB, 0 );
1262
+ } );
1263
+ } else {
1264
+ dispatch.removeBlock( clientIdA, false );
1265
+ }
1260
1266
  return;
1261
1267
  }
1262
1268
 
@@ -1755,7 +1761,7 @@ export const duplicateBlocks =
1755
1761
  clientIdsArray[ clientIdsArray.length - 1 ]
1756
1762
  );
1757
1763
  const clonedBlocks = blocks.map( ( block ) =>
1758
- __experimentalCloneSanitizedBlock( block )
1764
+ cloneSanitizedBlock( block )
1759
1765
  );
1760
1766
  dispatch.insertBlocks(
1761
1767
  clonedBlocks,
@@ -1935,6 +1941,7 @@ export function __unstableSetTemporarilyEditingAsBlocks( clientId ) {
1935
1941
  *
1936
1942
  * @typedef {Object} InserterMediaRequest
1937
1943
  * @property {number} per_page How many items to fetch per page.
1944
+ * @property {number} [page] Which page of results to fetch. Defaults to the first page.
1938
1945
  * @property {string} search The search term to use for filtering the results.
1939
1946
  */
1940
1947
 
@@ -1953,6 +1960,17 @@ export function __unstableSetTemporarilyEditingAsBlocks( clientId ) {
1953
1960
  * @property {string} [caption] The caption of the media item.
1954
1961
  */
1955
1962
 
1963
+ /**
1964
+ * Interface for paginated inserter media responses. A media category's `fetch`
1965
+ * may return this instead of a plain array to opt into pagination, in which case
1966
+ * the media tab renders paging controls for the category.
1967
+ *
1968
+ * @typedef {Object} InserterMediaResponse
1969
+ * @property {InserterMediaItem[]} mediaItems The media items for the requested page.
1970
+ * @property {number} totalItems The total number of items across all pages.
1971
+ * @property {number} totalPages The total number of pages available.
1972
+ */
1973
+
1956
1974
  /**
1957
1975
  * Registers a new inserter media category. Once registered, the media category is
1958
1976
  * available in the inserter's media tab.
@@ -1966,6 +1984,7 @@ export function __unstableSetTemporarilyEditingAsBlocks( clientId ) {
1966
1984
  * _Properties_
1967
1985
  *
1968
1986
  * - _per_page_ `number`: How many items to fetch per page.
1987
+ * - _page_ `[number]`: Which page of results to fetch. Defaults to the first page.
1969
1988
  * - _search_ `string`: The search term to use for filtering the results.
1970
1989
  *
1971
1990
  * _Type Definition_
@@ -1984,7 +2003,19 @@ export function __unstableSetTemporarilyEditingAsBlocks( clientId ) {
1984
2003
  * - _alt_ `[string]`: The alt text of the media item.
1985
2004
  * - _caption_ `[string]`: The caption of the media item.
1986
2005
  *
1987
- * @param {InserterMediaCategory} category The inserter media category to register.
2006
+ * _Type Definition_
2007
+ *
2008
+ * - _InserterMediaResponse_ `Object`: Interface for paginated inserter media responses. A media
2009
+ * category's `fetch` may return this instead of a plain array to opt into pagination, in which
2010
+ * case the media tab renders paging controls for the category.
2011
+ *
2012
+ * _Properties_
2013
+ *
2014
+ * - _mediaItems_ `InserterMediaItem[]`: The media items for the requested page.
2015
+ * - _totalItems_ `number`: The total number of items across all pages.
2016
+ * - _totalPages_ `number`: The total number of pages available.
2017
+ *
2018
+ * @param {InserterMediaCategory} category The inserter media category to register.
1988
2019
  *
1989
2020
  * @example
1990
2021
  * ```js
@@ -2041,17 +2072,20 @@ export function __unstableSetTemporarilyEditingAsBlocks( clientId ) {
2041
2072
  * ```
2042
2073
  *
2043
2074
  * @typedef {Object} InserterMediaCategory Interface for inserter media category.
2044
- * @property {string} name The name of the media category, that should be unique among all media categories.
2045
- * @property {Object} labels Labels for the media category.
2046
- * @property {string} labels.name General name of the media category. It's used in the inserter media items list.
2047
- * @property {string} [labels.search_items='Search'] Label for searching items. Default is ‘Search Posts’ / ‘Search Pages’.
2048
- * @property {('image'|'audio'|'video')} mediaType The media type of the media category.
2049
- * @property {(InserterMediaRequest) => Promise<InserterMediaItem[]>} fetch The function to fetch media items for the category.
2050
- * @property {(InserterMediaItem) => string} [getReportUrl] If the media category supports reporting media items, this function should return
2051
- * the report url for the media item. It accepts the `InserterMediaItem` as an argument.
2052
- * @property {boolean} [isExternalResource] If the media category is an external resource, this should be set to true.
2053
- * This is used to avoid making a request to the external resource when the user
2054
- * @property {string} [emptyMessage] Optional message shown in place of the generic "No results found." when the source has no items and there is no active search. Providing it also keeps the source in the tab list while empty, so the message stays reachable.
2075
+ * @property {string} name The name of the media category, that should be unique among all media categories.
2076
+ * @property {Object} labels Labels for the media category.
2077
+ * @property {string} labels.name General name of the media category. It's used in the inserter media items list.
2078
+ * @property {string} [labels.search_items='Search'] Label for searching items. Default is ‘Search Posts’ / ‘Search Pages’.
2079
+ * @property {('image'|'audio'|'video')} mediaType The media type of the media category.
2080
+ * @property {(InserterMediaRequest) => Promise<InserterMediaItem[]|InserterMediaResponse>} fetch The function to fetch media items for the category. Returning an
2081
+ * `InserterMediaResponse` instead of a plain array opts the category into
2082
+ * pagination.
2083
+ * @property {(InserterMediaItem) => string} [getReportUrl] If the media category supports reporting media items, this function should return
2084
+ * the report url for the media item. It accepts the `InserterMediaItem` as an argument.
2085
+ * @property {boolean} [isExternalResource] If the media category is an external resource, this should be set to true.
2086
+ * This is used to avoid making a request to the external resource when checking
2087
+ * whether the category has any media items to display in the media tab.
2088
+ * @property {string} [emptyMessage] Optional message shown in place of the generic "No results found." when the source has no items and there is no active search. Providing it also keeps the source in the tab list while empty, so the message stays reachable.
2055
2089
  */
2056
2090
  export const registerInserterMediaCategory =
2057
2091
  ( category ) =>
@@ -2080,7 +2114,7 @@ export const registerInserterMediaCategory =
2080
2114
  }
2081
2115
  if ( ! category.fetch || typeof category.fetch !== 'function' ) {
2082
2116
  console.error(
2083
- 'Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise<InserterMediaItem[]>`.'
2117
+ 'Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise<InserterMediaItem[]|InserterMediaResponse>`.'
2084
2118
  );
2085
2119
  return;
2086
2120
  }
@@ -3,9 +3,11 @@
3
3
  */
4
4
  import { createSelector, createRegistrySelector } from '@wordpress/data';
5
5
  import {
6
+ getBlockType,
6
7
  hasBlockSupport,
7
8
  privateApis as blocksPrivateApis,
8
9
  } from '@wordpress/blocks';
10
+ import { privateApis as globalStylesEnginePrivateApis } from '@wordpress/global-styles-engine';
9
11
 
10
12
  /**
11
13
  * Internal dependencies
@@ -14,6 +16,7 @@ import {
14
16
  getBlockOrder,
15
17
  getBlockParents,
16
18
  getBlockEditingMode,
19
+ getBlockMode,
17
20
  getBlockListSettings,
18
21
  getSettings,
19
22
  canInsertBlockType,
@@ -41,10 +44,23 @@ import {
41
44
  } from './private-keys';
42
45
  import { BLOCK_VISIBILITY_VIEWPORTS } from '../components/block-visibility/constants';
43
46
 
44
- const { isContentBlock } = unlock( blocksPrivateApis );
47
+ const { isContentBlock, editableRootKey } = unlock( blocksPrivateApis );
48
+ const { getViewportBreakpoints } = unlock( globalStylesEnginePrivateApis );
45
49
 
46
50
  export { getBlockSettings } from './get-block-settings';
47
51
 
52
+ function isViewportAvailable( state, viewport ) {
53
+ if ( viewport === BLOCK_VISIBILITY_VIEWPORTS.desktop.key ) {
54
+ return true;
55
+ }
56
+
57
+ return (
58
+ getViewportBreakpoints(
59
+ getSettings( state )?.__experimentalFeatures?.viewport
60
+ )[ viewport ] !== undefined
61
+ );
62
+ }
63
+
48
64
  /**
49
65
  * Returns true if the block interface is hidden, or false otherwise.
50
66
  *
@@ -229,6 +245,60 @@ function hasExplicitDisabledParent( state, clientId ) {
229
245
  return false;
230
246
  }
231
247
 
248
+ /**
249
+ * Returns true when the writing flow wrapper can host editing for the given
250
+ * block: it supports `editableRoot`, is edited visually in the default
251
+ * editing mode, and has sibling blocks for a native selection to extend
252
+ * into, all of them editable.
253
+ *
254
+ * @param {Object} state Global application state.
255
+ * @param {string} clientId Block client ID.
256
+ *
257
+ * @return {boolean} Whether an editing host can host the block.
258
+ */
259
+ export const canHostEditableRoot = createSelector(
260
+ ( state, clientId ) => {
261
+ if (
262
+ ! clientId ||
263
+ getBlockEditingMode( state, clientId ) !== 'default' ||
264
+ // Not when the block is edited as HTML: there is no rich text to
265
+ // host then, only a textarea, which the editing host would
266
+ // interfere with.
267
+ getBlockMode( state, clientId ) !== 'visual' ||
268
+ ! getBlockType( getBlockName( state, clientId ) )?.[
269
+ editableRootKey
270
+ ]
271
+ ) {
272
+ return false;
273
+ }
274
+
275
+ // Only host when the block has sibling blocks for a native selection to
276
+ // extend into, all of them editable. A lone block (e.g. a single
277
+ // paragraph nested in an HTML block) is edited on its own element, and
278
+ // read-only siblings (e.g. pattern content without overrides enabled)
279
+ // must not become editable by inheriting from the host.
280
+ const siblings = getBlockOrder(
281
+ state,
282
+ getBlockRootClientId( state, clientId )
283
+ );
284
+ return (
285
+ siblings.length > 1 &&
286
+ siblings.every(
287
+ ( siblingClientId ) =>
288
+ getBlockEditingMode( state, siblingClientId ) === 'default'
289
+ )
290
+ );
291
+ },
292
+ ( state ) => [
293
+ state.blocks.order,
294
+ state.blocks.parents,
295
+ state.blocks.byClientId,
296
+ state.blocks.blockEditingModes,
297
+ state.derivedBlockEditingModes,
298
+ state.blocksMode,
299
+ ]
300
+ );
301
+
232
302
  /**
233
303
  * Returns the block tree displayed by List View.
234
304
  *
@@ -925,12 +995,12 @@ export function getInsertionPoint( state ) {
925
995
  * Returns true if the block is hidden anywhere, or false otherwise.
926
996
  *
927
997
  * This selector checks whether a block has visibility metadata set that would
928
- * hide it at any viewport or everywhere. It's useful for flagging blocks that
929
- * have visibility restrictions.
998
+ * hide it at any available viewport or everywhere. It's useful for flagging
999
+ * blocks that have active visibility restrictions.
930
1000
  *
931
1001
  * A block is considered hidden anywhere if:
932
1002
  * - blockVisibility is false (hidden everywhere)
933
- * - blockVisibility.viewport has any viewport set to false (hidden at specific screen sizes)
1003
+ * - blockVisibility.viewport has any available viewport set to false (hidden at specific screen sizes)
934
1004
  *
935
1005
  * @param {Object} state Global application state.
936
1006
  * @param {string} clientId Client ID of the block.
@@ -956,6 +1026,7 @@ export const isBlockHiddenAnywhere = ( state, clientId ) => {
956
1026
  // Check if the block is hidden at any viewport.
957
1027
  return Object.values( BLOCK_VISIBILITY_VIEWPORTS ).some(
958
1028
  ( viewport ) =>
1029
+ isViewportAvailable( state, viewport.key ) &&
959
1030
  blockVisibility?.viewport?.[ viewport.key ] === false
960
1031
  );
961
1032
  }
@@ -1010,7 +1081,7 @@ export const isBlockParentHiddenEverywhere = ( state, clientId ) => {
1010
1081
  *
1011
1082
  * A block is considered hidden at a viewport if:
1012
1083
  * - blockVisibility is false (hidden everywhere)
1013
- * - blockVisibility is an object with the specified viewport set to false
1084
+ * - blockVisibility is an object with an available specified viewport set to false
1014
1085
  *
1015
1086
  * @param {Object} state Global application state.
1016
1087
  * @param {string} clientId Client ID of the block.
@@ -1031,7 +1102,12 @@ export const isBlockHiddenAtViewport = ( state, clientId, viewport ) => {
1031
1102
  blockVisibilityViewport !== null &&
1032
1103
  typeof viewport === 'string'
1033
1104
  ) {
1034
- return blockVisibilityViewport?.[ viewport.toLowerCase() ] === false;
1105
+ const viewportKey = viewport.toLowerCase();
1106
+
1107
+ return (
1108
+ isViewportAvailable( state, viewportKey ) &&
1109
+ blockVisibilityViewport?.[ viewportKey ] === false
1110
+ );
1035
1111
  }
1036
1112
  return false;
1037
1113
  };
@@ -1442,19 +1442,19 @@ export function selection( state = {}, action ) {
1442
1442
  selectionEnd,
1443
1443
  };
1444
1444
  case 'MULTI_SELECT':
1445
- const { start, end } = action;
1445
+ const nextSelection = {
1446
+ selectionStart: { clientId: action.start },
1447
+ selectionEnd: { clientId: action.end },
1448
+ };
1446
1449
 
1447
- if (
1448
- start === state.selectionStart?.clientId &&
1449
- end === state.selectionEnd?.clientId
1450
- ) {
1450
+ // A text selection between the same blocks is not the same
1451
+ // selection: it carries attribute keys and offsets, making it
1452
+ // partial rather than a block multi-selection.
1453
+ if ( fastDeepEqual( state, nextSelection ) ) {
1451
1454
  return state;
1452
1455
  }
1453
1456
 
1454
- return {
1455
- selectionStart: { clientId: start },
1456
- selectionEnd: { clientId: end },
1457
- };
1457
+ return nextSelection;
1458
1458
  case 'RESET_BLOCKS':
1459
1459
  const startClientId = state?.selectionStart?.clientId;
1460
1460
  const endClientId = state?.selectionEnd?.clientId;
@@ -149,14 +149,26 @@ export function getBlockAttributes( state, clientId ) {
149
149
  * blocks module registration store.
150
150
  *
151
151
  * getBlock recurses through its inner blocks until all its children blocks have
152
- * been retrieved. Note that getBlock will not return the child inner blocks of
153
- * an inner block controller. This is because an inner block controller syncs
154
- * itself with its own entity, and should therefore not be included with the
155
- * blocks of a different entity. For example, say you call `getBlocks( TP )` to
156
- * get the blocks of a template part. If another template part is a child of TP,
157
- * then the nested template part's child blocks will not be returned. This way,
158
- * the template block itself is considered part of the parent, but the children
159
- * are not.
152
+ * been retrieved, with one exception: the children of an "inner block
153
+ * controller" are not part of its tree, so `innerBlocks` usually comes back
154
+ * empty even though the block clearly has children in the editor. Never rely on
155
+ * a controller's `innerBlocks`; ask for its children directly:
156
+ *
157
+ * ```js
158
+ * getBlock( syncedPatternClientId ).innerBlocks; // Usually [].
159
+ * getBlocks( syncedPatternClientId ); // The pattern's blocks.
160
+ * ```
161
+ *
162
+ * A block is an inner block controller when its children belong to, and are
163
+ * synced with, an entity other than the one being edited. Synced patterns
164
+ * (`core/block`) and template parts (`core/template-part`) are the usual
165
+ * examples: each owns its own blocks, and editing them saves to that pattern or
166
+ * template part, not to the post or template it sits in. Leaving their children
167
+ * out of the tree is what keeps the two entities separate, so walking a
168
+ * template's blocks stops at a template part placed inside it.
169
+ *
170
+ * `areInnerBlocksControlled( clientId )` tells whether a block is such a
171
+ * controller.
160
172
  *
161
173
  * @param {Object} state Editor state.
162
174
  * @param {string} clientId Block client ID.
@@ -789,6 +801,30 @@ export function getSelectedBlocksInitialCaretPosition( state ) {
789
801
  return state.initialPosition;
790
802
  }
791
803
 
804
+ /**
805
+ * Returns the ancestor client ID when one selection endpoint is nested
806
+ * inside the other, or undefined for any other selection shape. Such a
807
+ * selection has no sibling range; the ancestor contains all of it.
808
+ *
809
+ * @param {Object} state Editor state.
810
+ * @return {?string} The ancestor client ID, if any.
811
+ */
812
+ function getSelectionNestingAncestor( state ) {
813
+ const { selectionStart, selectionEnd } = state.selection;
814
+ const startClientId = selectionStart.clientId;
815
+ const endClientId = selectionEnd.clientId;
816
+ if ( ! startClientId || ! endClientId || startClientId === endClientId ) {
817
+ return undefined;
818
+ }
819
+ if ( getBlockParents( state, endClientId ).includes( startClientId ) ) {
820
+ return startClientId;
821
+ }
822
+ if ( getBlockParents( state, startClientId ).includes( endClientId ) ) {
823
+ return endClientId;
824
+ }
825
+ return undefined;
826
+ }
827
+
792
828
  /**
793
829
  * Returns the current selection set of block client IDs (multiselection or single selection).
794
830
  *
@@ -808,6 +844,11 @@ export const getSelectedBlockClientIds = createSelector(
808
844
  return [ selectionStart.clientId ];
809
845
  }
810
846
 
847
+ const nestingAncestorClientId = getSelectionNestingAncestor( state );
848
+ if ( nestingAncestorClientId ) {
849
+ return [ nestingAncestorClientId ];
850
+ }
851
+
811
852
  // Retrieve root client ID to aid in retrieving relevant nested block
812
853
  // order, being careful to allow the falsey empty string top-level root
813
854
  // by explicitly testing against null.
@@ -832,6 +873,7 @@ export const getSelectedBlockClientIds = createSelector(
832
873
  },
833
874
  ( state ) => [
834
875
  state.blocks.order,
876
+ state.blocks.parents,
835
877
  state.selection.selectionStart.clientId,
836
878
  state.selection.selectionEnd.clientId,
837
879
  ]
@@ -1014,6 +1056,12 @@ export function getMultiSelectedBlocksEndClientId( state ) {
1014
1056
  * @return {boolean} Whether the selection is mergeable.
1015
1057
  */
1016
1058
  export function __unstableIsFullySelected( state ) {
1059
+ // A text selection with one endpoint nested inside the other has no
1060
+ // sibling range; it resolves to the ancestor, which is presented and
1061
+ // treated as fully selected.
1062
+ if ( getSelectionNestingAncestor( state ) ) {
1063
+ return true;
1064
+ }
1017
1065
  const selectionAnchor = getSelectionStart( state );
1018
1066
  const selectionFocus = getSelectionEnd( state );
1019
1067
  return (
@@ -1379,7 +1379,7 @@ describe( 'actions', () => {
1379
1379
  fetch: 'c',
1380
1380
  } )( {} );
1381
1381
  expect( console ).toHaveErroredWith(
1382
- 'Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise<InserterMediaItem[]>`.'
1382
+ 'Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise<InserterMediaItem[]|InserterMediaResponse>`.'
1383
1383
  );
1384
1384
  } );
1385
1385
  it( 'has unique name', () => {