@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
@@ -20,6 +20,7 @@ import {
20
20
  useMergeRefs,
21
21
  useRefEffect,
22
22
  useDisabled,
23
+ useReducedMotion,
23
24
  } from '@wordpress/compose';
24
25
  import { __experimentalStyleProvider as StyleProvider } from '@wordpress/components';
25
26
  import { useSelect } from '@wordpress/data';
@@ -121,6 +122,7 @@ function Iframe( {
121
122
  };
122
123
  }, [] );
123
124
  const { styles = '', scripts = '' } = resolvedAssets;
125
+ /** @type {[Document, import('react').Dispatch<Document>]} */
124
126
  const [ iframeDocument, setIframeDocument ] = useState();
125
127
  const initialContainerWidthRef = useRef( 0 );
126
128
  const [ bodyClasses, setBodyClasses ] = useState( [] );
@@ -130,6 +132,7 @@ function Iframe( {
130
132
  useResizeObserver();
131
133
  const [ containerResizeListener, { width: containerWidth } ] =
132
134
  useResizeObserver();
135
+ const prefersReducedMotion = useReducedMotion();
133
136
 
134
137
  const setRef = useRefEffect( ( node ) => {
135
138
  node._load = () => {
@@ -191,6 +194,22 @@ function Iframe( {
191
194
  preventFileDropDefault,
192
195
  false
193
196
  );
197
+ // Prevent clicks on links from navigating away. Note that links
198
+ // inside `contenteditable` are already disabled by the browser, so
199
+ // this is for links in blocks outside of `contenteditable`.
200
+ iFrameDocument.addEventListener( 'click', ( event ) => {
201
+ if ( event.target.tagName === 'A' ) {
202
+ event.preventDefault();
203
+
204
+ // Appending a hash to the current URL will not reload the
205
+ // page. This is useful for e.g. footnotes.
206
+ const href = event.target.getAttribute( 'href' );
207
+ if ( href.startsWith( '#' ) ) {
208
+ iFrameDocument.defaultView.location.hash =
209
+ href.slice( 1 );
210
+ }
211
+ }
212
+ } );
194
213
  }
195
214
 
196
215
  node.addEventListener( 'load', onLoad );
@@ -252,6 +271,19 @@ function Iframe( {
252
271
  containerWidth
253
272
  );
254
273
 
274
+ const frameSizeValue = parseInt( frameSize );
275
+
276
+ const maxWidth = 750;
277
+ const scaleValue =
278
+ scale === 'auto-scaled'
279
+ ? ( Math.min( containerWidth, maxWidth ) - frameSizeValue * 2 ) /
280
+ scaleContainerWidth
281
+ : scale;
282
+
283
+ const prevScaleRef = useRef( scaleValue );
284
+ const prevFrameSizeRef = useRef( frameSizeValue );
285
+ const prevClientHeightRef = useRef( /* Initialized in the useEffect. */ );
286
+
255
287
  const disabledRef = useDisabled( { isDisabled: ! readonly } );
256
288
  const bodyRef = useMergeRefs( [
257
289
  useBubbleEvents( iframeDocument ),
@@ -272,6 +304,7 @@ function Iframe( {
272
304
  <html>
273
305
  <head>
274
306
  <meta charset="utf-8">
307
+ <base href="${ window.location.origin }">
275
308
  <script>window.frameElement._load()</script>
276
309
  <style>
277
310
  html{
@@ -303,47 +336,176 @@ function Iframe( {
303
336
 
304
337
  useEffect( () => cleanup, [ cleanup ] );
305
338
 
306
- const zoomOutAnimationClassnameRef = useRef( null );
307
-
308
- // Toggle zoom out CSS Classes only when zoom out mode changes. We could add these into the useEffect
309
- // that controls settings the CSS variables, but then we would need to do more work to ensure we're
310
- // only toggling these when the zoom out mode changes, as that useEffect is also triggered by a large
311
- // number of dependencies.
312
339
  useEffect( () => {
313
- if ( ! iframeDocument || ! isZoomedOut ) {
340
+ if (
341
+ ! iframeDocument ||
342
+ // HACK: Checking if isZoomedOut differs from prevIsZoomedOut here
343
+ // instead of the dependency array to appease the linter.
344
+ ( scaleValue === 1 ) === ( prevScaleRef.current === 1 )
345
+ ) {
314
346
  return;
315
347
  }
316
348
 
317
- const handleZoomOutAnimationClassname = () => {
318
- clearTimeout( zoomOutAnimationClassnameRef.current );
349
+ // Unscaled height of the current iframe container.
350
+ const clientHeight = iframeDocument.documentElement.clientHeight;
351
+
352
+ // Scaled height of the current iframe content.
353
+ const scrollHeight = iframeDocument.documentElement.scrollHeight;
354
+
355
+ // Previous scale value.
356
+ const prevScale = prevScaleRef.current;
357
+
358
+ // Unscaled size of the previous padding around the iframe content.
359
+ const prevFrameSize = prevFrameSizeRef.current;
360
+
361
+ // Unscaled height of the previous iframe container.
362
+ const prevClientHeight = prevClientHeightRef.current ?? clientHeight;
363
+
364
+ // We can't trust the set value from contentHeight, as it was measured
365
+ // before the zoom out mode was changed. After zoom out mode is changed,
366
+ // appenders may appear or disappear, so we need to get the height from
367
+ // the iframe at this point when we're about to animate the zoom out.
368
+ // The iframe scrollTop, scrollHeight, and clientHeight will all be
369
+ // accurate. The client height also does change when the zoom out mode
370
+ // is toggled, as the bottom bar about selecting the template is
371
+ // added/removed when toggling zoom out mode.
372
+ const scrollTop = iframeDocument.documentElement.scrollTop;
373
+
374
+ // Step 0: Start with the current scrollTop.
375
+ let scrollTopNext = scrollTop;
376
+
377
+ // Step 1: Undo the effects of the previous scale and frame around the
378
+ // midpoint of the visible area.
379
+ scrollTopNext =
380
+ ( scrollTopNext + prevClientHeight / 2 - prevFrameSize ) /
381
+ prevScale -
382
+ prevClientHeight / 2;
383
+
384
+ // Step 2: Apply the new scale and frame around the midpoint of the
385
+ // visible area.
386
+ scrollTopNext =
387
+ ( scrollTopNext + clientHeight / 2 ) * scaleValue +
388
+ frameSizeValue -
389
+ clientHeight / 2;
390
+
391
+ // Step 3: Handle an edge case so that you scroll to the top of the
392
+ // iframe if the top of the iframe content is visible in the container.
393
+ // The same edge case for the bottom is skipped because changing content
394
+ // makes calculating it impossible.
395
+ scrollTopNext = scrollTop <= prevFrameSize ? 0 : scrollTopNext;
396
+
397
+ // This is the scrollTop value if you are scrolled to the bottom of the
398
+ // iframe. We can't just let the browser handle it because we need to
399
+ // animate the scaling.
400
+ const maxScrollTop =
401
+ scrollHeight * ( scaleValue / prevScale ) +
402
+ frameSizeValue * 2 -
403
+ clientHeight;
404
+
405
+ // Step 4: Clamp the scrollTopNext between the minimum and maximum
406
+ // possible scrollTop positions. Round the value to avoid subpixel
407
+ // truncation by the browser which sometimes causes a 1px error.
408
+ scrollTopNext = Math.round(
409
+ Math.min(
410
+ Math.max( 0, scrollTopNext ),
411
+ Math.max( 0, maxScrollTop )
412
+ )
413
+ );
414
+
415
+ iframeDocument.documentElement.style.setProperty(
416
+ '--wp-block-editor-iframe-zoom-out-scroll-top',
417
+ `${ scrollTop }px`
418
+ );
419
+
420
+ iframeDocument.documentElement.style.setProperty(
421
+ '--wp-block-editor-iframe-zoom-out-scroll-top-next',
422
+ `${ scrollTopNext }px`
423
+ );
424
+
425
+ iframeDocument.documentElement.classList.add( 'zoom-out-animation' );
319
426
 
320
- iframeDocument.documentElement.classList.add(
427
+ function onZoomOutTransitionEnd() {
428
+ // Remove the position fixed for the animation.
429
+ iframeDocument.documentElement.classList.remove(
321
430
  'zoom-out-animation'
322
431
  );
323
432
 
324
- zoomOutAnimationClassnameRef.current = setTimeout( () => {
325
- iframeDocument.documentElement.classList.remove(
326
- 'zoom-out-animation'
433
+ // Update previous values.
434
+ prevClientHeightRef.current = clientHeight;
435
+ prevFrameSizeRef.current = frameSizeValue;
436
+ prevScaleRef.current = scaleValue;
437
+
438
+ // Set the final scroll position that was just animated to.
439
+ // Disable reason: Eslint isn't smart enough to know that this is a
440
+ // DOM element. https://github.com/facebook/react/issues/31483
441
+ // eslint-disable-next-line react-compiler/react-compiler
442
+ iframeDocument.documentElement.scrollTop = scrollTopNext;
443
+ }
444
+
445
+ let raf;
446
+ if ( prefersReducedMotion ) {
447
+ // Hack: Wait for the window values to recalculate.
448
+ raf = iframeDocument.defaultView.requestAnimationFrame(
449
+ onZoomOutTransitionEnd
450
+ );
451
+ } else {
452
+ iframeDocument.documentElement.addEventListener(
453
+ 'transitionend',
454
+ onZoomOutTransitionEnd,
455
+ { once: true }
456
+ );
457
+ }
458
+
459
+ return () => {
460
+ iframeDocument.documentElement.style.removeProperty(
461
+ '--wp-block-editor-iframe-zoom-out-scroll-top'
462
+ );
463
+ iframeDocument.documentElement.style.removeProperty(
464
+ '--wp-block-editor-iframe-zoom-out-scroll-top-next'
465
+ );
466
+ iframeDocument.documentElement.classList.remove(
467
+ 'zoom-out-animation'
468
+ );
469
+ if ( prefersReducedMotion ) {
470
+ iframeDocument.defaultView.cancelAnimationFrame( raf );
471
+ } else {
472
+ iframeDocument.documentElement.removeEventListener(
473
+ 'transitionend',
474
+ onZoomOutTransitionEnd
327
475
  );
328
- }, 400 ); // 400ms should match the animation speed used in components/iframe/content.scss
476
+ }
329
477
  };
478
+ }, [ iframeDocument, scaleValue, frameSizeValue, prefersReducedMotion ] );
330
479
 
331
- handleZoomOutAnimationClassname();
332
- iframeDocument.documentElement.classList.add( 'is-zoomed-out' );
480
+ // Toggle zoom out CSS Classes only when zoom out mode changes. We could add these into the useEffect
481
+ // that controls settings the CSS variables, but then we would need to do more work to ensure we're
482
+ // only toggling these when the zoom out mode changes, as that useEffect is also triggered by a large
483
+ // number of dependencies.
484
+ useEffect( () => {
485
+ if ( ! iframeDocument ) {
486
+ return;
487
+ }
333
488
 
334
- return () => {
335
- handleZoomOutAnimationClassname();
489
+ if ( isZoomedOut ) {
490
+ iframeDocument.documentElement.classList.add( 'is-zoomed-out' );
491
+ } else {
492
+ // HACK: Since we can't remove this in the cleanup, we need to do it here.
336
493
  iframeDocument.documentElement.classList.remove( 'is-zoomed-out' );
494
+ }
495
+
496
+ return () => {
497
+ // HACK: Skipping cleanup because it causes issues with the zoom out
498
+ // animation. More refactoring is needed to fix this properly.
499
+ // iframeDocument.documentElement.classList.remove( 'is-zoomed-out' );
337
500
  };
338
501
  }, [ iframeDocument, isZoomedOut ] );
339
502
 
340
503
  // Calculate the scaling and CSS variables for the zoom out canvas
341
504
  useEffect( () => {
342
- if ( ! iframeDocument || ! isZoomedOut ) {
505
+ if ( ! iframeDocument ) {
343
506
  return;
344
507
  }
345
508
 
346
- const maxWidth = 750;
347
509
  // Note: When we initialize the zoom out when the canvas is smaller (sidebars open),
348
510
  // initialContainerWidthRef will be smaller than the full page, and reflow will happen
349
511
  // when the canvas area becomes larger due to sidebars closing. This is a known but
@@ -354,11 +516,7 @@ function Iframe( {
354
516
  // but calc( 100px / 2px ) is not.
355
517
  iframeDocument.documentElement.style.setProperty(
356
518
  '--wp-block-editor-iframe-zoom-out-scale',
357
- scale === 'auto-scaled'
358
- ? ( Math.min( containerWidth, maxWidth ) -
359
- parseInt( frameSize ) * 2 ) /
360
- scaleContainerWidth
361
- : scale
519
+ scaleValue
362
520
  );
363
521
 
364
522
  // frameSize has to be a px value for the scaling and frame size to be computed correctly.
@@ -384,27 +542,29 @@ function Iframe( {
384
542
  );
385
543
 
386
544
  return () => {
387
- iframeDocument.documentElement.style.removeProperty(
388
- '--wp-block-editor-iframe-zoom-out-scale'
389
- );
390
- iframeDocument.documentElement.style.removeProperty(
391
- '--wp-block-editor-iframe-zoom-out-frame-size'
392
- );
393
- iframeDocument.documentElement.style.removeProperty(
394
- '--wp-block-editor-iframe-zoom-out-content-height'
395
- );
396
- iframeDocument.documentElement.style.removeProperty(
397
- '--wp-block-editor-iframe-zoom-out-inner-height'
398
- );
399
- iframeDocument.documentElement.style.removeProperty(
400
- '--wp-block-editor-iframe-zoom-out-container-width'
401
- );
402
- iframeDocument.documentElement.style.removeProperty(
403
- '--wp-block-editor-iframe-zoom-out-scale-container-width'
404
- );
545
+ // HACK: Skipping cleanup because it causes issues with the zoom out
546
+ // animation. More refactoring is needed to fix this properly.
547
+ // iframeDocument.documentElement.style.removeProperty(
548
+ // '--wp-block-editor-iframe-zoom-out-scale'
549
+ // );
550
+ // iframeDocument.documentElement.style.removeProperty(
551
+ // '--wp-block-editor-iframe-zoom-out-frame-size'
552
+ // );
553
+ // iframeDocument.documentElement.style.removeProperty(
554
+ // '--wp-block-editor-iframe-zoom-out-content-height'
555
+ // );
556
+ // iframeDocument.documentElement.style.removeProperty(
557
+ // '--wp-block-editor-iframe-zoom-out-inner-height'
558
+ // );
559
+ // iframeDocument.documentElement.style.removeProperty(
560
+ // '--wp-block-editor-iframe-zoom-out-container-width'
561
+ // );
562
+ // iframeDocument.documentElement.style.removeProperty(
563
+ // '--wp-block-editor-iframe-zoom-out-scale-container-width'
564
+ // );
405
565
  };
406
566
  }, [
407
- scale,
567
+ scaleValue,
408
568
  frameSize,
409
569
  iframeDocument,
410
570
  iframeWindowInnerHeight,
@@ -85,10 +85,10 @@ function PatternList( {
85
85
  return true;
86
86
  }
87
87
  if ( selectedCategory === 'uncategorized' ) {
88
- const hasKnownCategory = pattern.categories.some(
89
- ( category ) =>
88
+ const hasKnownCategory =
89
+ pattern.categories?.some( ( category ) =>
90
90
  registeredPatternCategories.includes( category )
91
- );
91
+ ) ?? false;
92
92
 
93
93
  return ! pattern.categories?.length || ! hasKnownCategory;
94
94
  }
@@ -151,9 +151,6 @@ function PatternList( {
151
151
  { hasItems && (
152
152
  <>
153
153
  <BlockPatternsList
154
- shownPatterns={
155
- pagingProps.categoryPatternsAsyncList
156
- }
157
154
  blockPatterns={ pagingProps.categoryPatterns }
158
155
  onClickPattern={ onClickPattern }
159
156
  isDraggable={ false }
@@ -79,7 +79,6 @@ function BlockPatternsTab( {
79
79
  onInsert={ onInsert }
80
80
  rootClientId={ rootClientId }
81
81
  category={ category }
82
- showTitlesAsTooltip={ false }
83
82
  />
84
83
  </div>
85
84
  ) }
@@ -17,7 +17,6 @@ import {
17
17
  __experimentalText as Text,
18
18
  FlexBlock,
19
19
  } from '@wordpress/components';
20
- import { useSelect } from '@wordpress/data';
21
20
 
22
21
  /**
23
22
  * Internal dependencies
@@ -31,10 +30,9 @@ import {
31
30
  isPatternFiltered,
32
31
  allPatternsCategory,
33
32
  myPatternsCategory,
33
+ starterPatternsCategory,
34
34
  INSERTER_PATTERN_TYPES,
35
35
  } from './utils';
36
- import { store as blockEditorStore } from '../../../store';
37
- import { unlock } from '../../../lock-unlock';
38
36
 
39
37
  const noop = () => {};
40
38
 
@@ -45,10 +43,6 @@ export function PatternCategoryPreviews( {
45
43
  category,
46
44
  showTitlesAsTooltip,
47
45
  } ) {
48
- const isZoomOutMode = useSelect(
49
- ( select ) => unlock( select( blockEditorStore ) ).isZoomOut(),
50
- []
51
- );
52
46
  const [ allPatterns, , onClickPattern ] = usePatternsState(
53
47
  onInsert,
54
48
  rootClientId,
@@ -86,6 +80,13 @@ export function PatternCategoryPreviews( {
86
80
  return true;
87
81
  }
88
82
 
83
+ if (
84
+ category.name === starterPatternsCategory.name &&
85
+ pattern.blockTypes?.includes( 'core/post-content' )
86
+ ) {
87
+ return true;
88
+ }
89
+
89
90
  if ( category.name === 'uncategorized' ) {
90
91
  // The uncategorized category should show all the patterns without any category...
91
92
  if ( ! pattern.categories ) {
@@ -171,18 +172,15 @@ export function PatternCategoryPreviews( {
171
172
  </VStack>
172
173
  { currentCategoryPatterns.length > 0 && (
173
174
  <>
174
- { isZoomOutMode && (
175
- <Text
176
- size="12"
177
- as="p"
178
- className="block-editor-inserter__help-text"
179
- >
180
- { __( 'Drag and drop patterns into the canvas.' ) }
181
- </Text>
182
- ) }
175
+ <Text
176
+ size="12"
177
+ as="p"
178
+ className="block-editor-inserter__help-text"
179
+ >
180
+ { __( 'Drag and drop patterns into the canvas.' ) }
181
+ </Text>
183
182
  <BlockPatternsList
184
183
  ref={ scrollContainerRef }
185
- shownPatterns={ pagingProps.categoryPatternsAsyncList }
186
184
  blockPatterns={ pagingProps.categoryPatterns }
187
185
  onClickPattern={ onClickPattern }
188
186
  onHover={ onHover }
@@ -14,6 +14,7 @@ import {
14
14
  isPatternFiltered,
15
15
  allPatternsCategory,
16
16
  myPatternsCategory,
17
+ starterPatternsCategory,
17
18
  INSERTER_PATTERN_TYPES,
18
19
  } from './utils';
19
20
 
@@ -67,6 +68,13 @@ export function usePatternCategories( rootClientId, sourceFilter = 'all' ) {
67
68
  label: _x( 'Uncategorized' ),
68
69
  } );
69
70
  }
71
+ if (
72
+ filteredPatterns.some( ( pattern ) =>
73
+ pattern.blockTypes?.includes( 'core/post-content' )
74
+ )
75
+ ) {
76
+ categories.unshift( starterPatternsCategory );
77
+ }
70
78
  if (
71
79
  filteredPatterns.some(
72
80
  ( pattern ) => pattern.type === INSERTER_PATTERN_TYPES.user
@@ -25,6 +25,11 @@ export const myPatternsCategory = {
25
25
  label: __( 'My patterns' ),
26
26
  };
27
27
 
28
+ export const starterPatternsCategory = {
29
+ name: 'core/starter-content',
30
+ label: __( 'Starter content' ),
31
+ };
32
+
28
33
  export function isPatternFiltered( pattern, sourceFilter, syncFilter ) {
29
34
  const isUserPattern = pattern.name.startsWith( 'core/block' );
30
35
  const isDirectoryPattern =
@@ -6,7 +6,7 @@ import {
6
6
  privateApis as componentsPrivateApis,
7
7
  __unstableMotion as motion,
8
8
  } from '@wordpress/components';
9
- import { useState, useEffect } from '@wordpress/element';
9
+ import { useState } from '@wordpress/element';
10
10
 
11
11
  /**
12
12
  * Internal dependencies
@@ -35,14 +35,13 @@ function CategoryTabs( {
35
35
  const selectedTabId = selectedCategory ? selectedCategory.name : null;
36
36
  const [ activeTabId, setActiveId ] = useState();
37
37
  const firstTabId = categories?.[ 0 ]?.name;
38
- useEffect( () => {
39
- // If there is no active tab, make the first tab the active tab, so that
40
- // when focus is moved to the tablist, the first tab will be focused
41
- // despite not being selected
42
- if ( selectedTabId === null && ! activeTabId && firstTabId ) {
43
- setActiveId( firstTabId );
44
- }
45
- }, [ selectedTabId, activeTabId, firstTabId, setActiveId ] );
38
+
39
+ // If there is no active tab, make the first tab the active tab, so that
40
+ // when focus is moved to the tablist, the first tab will be focused
41
+ // despite not being selected
42
+ if ( selectedTabId === null && ! activeTabId && firstTabId ) {
43
+ setActiveId( firstTabId );
44
+ }
46
45
 
47
46
  return (
48
47
  <Tabs
@@ -94,7 +94,12 @@ const useBlockTypesState = ( rootClientId, onInsert, isQuick ) => {
94
94
  destinationClientId
95
95
  );
96
96
  },
97
- [ onInsert, getClosestAllowedInsertionPoint, rootClientId ]
97
+ [
98
+ getClosestAllowedInsertionPoint,
99
+ rootClientId,
100
+ onInsert,
101
+ createErrorNotice,
102
+ ]
98
103
  );
99
104
 
100
105
  return [ items, categories, collections, onSelectItem ];
@@ -2,11 +2,10 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { useMemo, useState, useEffect } from '@wordpress/element';
5
- import { useAsyncList, usePrevious } from '@wordpress/compose';
5
+ import { usePrevious } from '@wordpress/compose';
6
6
  import { getScrollContainer } from '@wordpress/dom';
7
7
 
8
8
  const PAGE_SIZE = 20;
9
- const INITIAL_INSERTER_RESULTS = 5;
10
9
 
11
10
  /**
12
11
  * Supplies values needed to page the patterns list client side.
@@ -42,9 +41,6 @@ export default function usePatternsPaging(
42
41
  pageIndex * PAGE_SIZE + PAGE_SIZE
43
42
  );
44
43
  }, [ pageIndex, currentCategoryPatterns ] );
45
- const categoryPatternsAsyncList = useAsyncList( categoryPatterns, {
46
- step: INITIAL_INSERTER_RESULTS,
47
- } );
48
44
  const numPages = Math.ceil( currentCategoryPatterns.length / PAGE_SIZE );
49
45
  const changePage = ( page ) => {
50
46
  const scrollContainer = getScrollContainer(
@@ -68,7 +64,6 @@ export default function usePatternsPaging(
68
64
  return {
69
65
  totalItems,
70
66
  categoryPatterns,
71
- categoryPatternsAsyncList,
72
67
  numPages,
73
68
  changePage,
74
69
  currentPage,
@@ -159,11 +159,6 @@ function InserterSearchResults( {
159
159
  const currentShownBlockTypes = useAsyncList( filteredBlockTypes, {
160
160
  step: INITIAL_INSERTER_RESULTS,
161
161
  } );
162
- const currentShownPatterns = useAsyncList(
163
- currentShownBlockTypes.length === filteredBlockTypes.length
164
- ? filteredBlockPatterns
165
- : EMPTY_ARRAY
166
- );
167
162
 
168
163
  const hasItems =
169
164
  filteredBlockTypes.length > 0 || filteredBlockPatterns.length > 0;
@@ -190,7 +185,6 @@ function InserterSearchResults( {
190
185
  >
191
186
  <div className="block-editor-inserter__quick-inserter-patterns">
192
187
  <BlockPatternsList
193
- shownPatterns={ currentShownPatterns }
194
188
  blockPatterns={ filteredBlockPatterns }
195
189
  onClickPattern={ onClickPattern }
196
190
  onHover={ onHoverPattern }
@@ -29,6 +29,15 @@ const InserterDraggableBlocks = ( {
29
29
  blocks,
30
30
  };
31
31
 
32
+ const blocksContainMedia =
33
+ blocks.filter(
34
+ ( block ) =>
35
+ ( block.name === 'core/image' ||
36
+ block.name === 'core/audio' ||
37
+ block.name === 'core/video' ) &&
38
+ ( block.attributes.url || block.attributes.src )
39
+ ).length > 0;
40
+
32
41
  const blockTypeIcon = useSelect(
33
42
  ( select ) => {
34
43
  const { getBlockType } = select( blocksStore );
@@ -63,7 +72,7 @@ const InserterDraggableBlocks = ( {
63
72
  ? [ createBlock( 'core/block', { ref: pattern.id } ) ]
64
73
  : blocks;
65
74
  event.dataTransfer.setData(
66
- 'text/html',
75
+ blocksContainMedia ? 'default' : 'text/html',
67
76
  serialize( parsedBlocks )
68
77
  );
69
78
  } }
@@ -116,6 +116,7 @@ registerBlockType( 'my-plugin/inspector-controls-example', {
116
116
 
117
117
  <TextControl
118
118
  __nextHasNoMarginBottom
119
+ __next40pxDefaultSize
119
120
  label="Text Field"
120
121
  help="Additional help text"
121
122
  value={ textField }
@@ -208,6 +209,7 @@ function MyBlockEdit( { attributes, setAttributes } ) {
208
209
  <InspectorAdvancedControls>
209
210
  <TextControl
210
211
  __nextHasNoMarginBottom
212
+ __next40pxDefaultSize
211
213
  label="HTML anchor"
212
214
  value={ attributes.anchor }
213
215
  onChange={ ( nextValue ) => {
@@ -34,14 +34,14 @@ export default function InspectorControlsSlot( {
34
34
  );
35
35
  group = __experimentalGroup;
36
36
  }
37
- const Slot = groups[ group ]?.Slot;
38
- const fills = useSlotFills( Slot?.__unstableName );
37
+ const slotFill = groups[ group ];
38
+ const fills = useSlotFills( slotFill?.name );
39
39
 
40
40
  const motionContextValue = useContext( MotionContext );
41
41
 
42
42
  const computedFillProps = useMemo(
43
43
  () => ( {
44
- ...( fillProps ?? {} ),
44
+ ...fillProps,
45
45
  forwardedContext: [
46
46
  ...( fillProps?.forwardedContext ?? [] ),
47
47
  [ MotionContext.Provider, { value: motionContextValue } ],
@@ -50,7 +50,7 @@ export default function InspectorControlsSlot( {
50
50
  [ motionContextValue, fillProps ]
51
51
  );
52
52
 
53
- if ( ! Slot ) {
53
+ if ( ! slotFill ) {
54
54
  warning( `Unknown InspectorControls group "${ group }" provided.` );
55
55
  return null;
56
56
  }
@@ -59,6 +59,8 @@ export default function InspectorControlsSlot( {
59
59
  return null;
60
60
  }
61
61
 
62
+ const { Slot } = slotFill;
63
+
62
64
  if ( label ) {
63
65
  return (
64
66
  <BlockSupportToolsPanel group={ group } label={ label }>
@@ -53,9 +53,7 @@ const PositionControlsPanel = () => {
53
53
  };
54
54
 
55
55
  const PositionControls = () => {
56
- const fills = useSlotFills(
57
- InspectorControlsGroups.position.Slot.__unstableName
58
- );
56
+ const fills = useSlotFills( InspectorControlsGroups.position.name );
59
57
  const hasFills = Boolean( fills && fills.length );
60
58
 
61
59
  if ( ! hasFills ) {