@wordpress/block-editor 12.10.2 → 12.11.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 (1275) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +13 -11
  3. package/build/autocompleters/block.js +3 -2
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/autocompleters/link.js +3 -3
  6. package/build/autocompleters/link.js.map +1 -1
  7. package/build/components/alignment-control/index.js +3 -3
  8. package/build/components/alignment-control/index.js.map +1 -1
  9. package/build/components/alignment-control/ui.js +2 -2
  10. package/build/components/alignment-control/ui.js.map +1 -1
  11. package/build/components/autocomplete/index.js +3 -2
  12. package/build/components/autocomplete/index.js.map +1 -1
  13. package/build/components/block-actions/index.js +2 -2
  14. package/build/components/block-actions/index.js.map +1 -1
  15. package/build/components/block-alignment-control/index.js +3 -3
  16. package/build/components/block-alignment-control/index.js.map +1 -1
  17. package/build/components/block-alignment-control/ui.js +4 -4
  18. package/build/components/block-alignment-control/ui.js.map +1 -1
  19. package/build/components/block-alignment-control/ui.native.js +2 -2
  20. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  21. package/build/components/block-alignment-matrix-control/index.js +5 -5
  22. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  23. package/build/components/block-breadcrumb/index.js +12 -12
  24. package/build/components/block-breadcrumb/index.js.map +1 -1
  25. package/build/components/block-canvas/index.js +13 -15
  26. package/build/components/block-canvas/index.js.map +1 -1
  27. package/build/components/block-caption/index.native.js +3 -3
  28. package/build/components/block-caption/index.native.js.map +1 -1
  29. package/build/components/block-card/index.js +7 -7
  30. package/build/components/block-card/index.js.map +1 -1
  31. package/build/components/block-compare/block-view.js +9 -8
  32. package/build/components/block-compare/block-view.js.map +1 -1
  33. package/build/components/block-compare/index.js +5 -5
  34. package/build/components/block-compare/index.js.map +1 -1
  35. package/build/components/block-context/index.js +2 -1
  36. package/build/components/block-context/index.js.map +1 -1
  37. package/build/components/block-controls/fill.js +5 -5
  38. package/build/components/block-controls/fill.js.map +1 -1
  39. package/build/components/block-controls/index.js +3 -3
  40. package/build/components/block-controls/index.js.map +1 -1
  41. package/build/components/block-controls/slot.js +3 -2
  42. package/build/components/block-controls/slot.js.map +1 -1
  43. package/build/components/block-controls/slot.native.js +4 -4
  44. package/build/components/block-controls/slot.native.js.map +1 -1
  45. package/build/components/block-draggable/draggable-chip.js +6 -6
  46. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  47. package/build/components/block-draggable/draggable-chip.native.js +4 -4
  48. package/build/components/block-draggable/draggable-chip.native.js.map +1 -1
  49. package/build/components/block-draggable/dropping-insertion-point.native.js +2 -2
  50. package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  51. package/build/components/block-draggable/index.js +4 -3
  52. package/build/components/block-draggable/index.js.map +1 -1
  53. package/build/components/block-draggable/index.native.js +9 -8
  54. package/build/components/block-draggable/index.native.js.map +1 -1
  55. package/build/components/block-edit/edit.js +5 -4
  56. package/build/components/block-edit/edit.js.map +1 -1
  57. package/build/components/block-edit/edit.native.js +3 -2
  58. package/build/components/block-edit/edit.native.js.map +1 -1
  59. package/build/components/block-edit/index.js +3 -2
  60. package/build/components/block-edit/index.js.map +1 -1
  61. package/build/components/block-edit-visually-button/index.js +2 -2
  62. package/build/components/block-edit-visually-button/index.js.map +1 -1
  63. package/build/components/block-full-height-alignment-control/index.js +2 -2
  64. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  65. package/build/components/block-heading-level-dropdown/heading-level-icon.js +4 -4
  66. package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
  67. package/build/components/block-heading-level-dropdown/index.js +6 -6
  68. package/build/components/block-heading-level-dropdown/index.js.map +1 -1
  69. package/build/components/block-heading-level-dropdown/index.native.js +6 -6
  70. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
  71. package/build/components/block-icon/index.js +4 -3
  72. package/build/components/block-icon/index.js.map +1 -1
  73. package/build/components/block-icon/index.native.js +3 -3
  74. package/build/components/block-icon/index.native.js.map +1 -1
  75. package/build/components/block-info-slot-fill/index.js +3 -3
  76. package/build/components/block-info-slot-fill/index.js.map +1 -1
  77. package/build/components/block-inspector/index.js +34 -34
  78. package/build/components/block-inspector/index.js.map +1 -1
  79. package/build/components/block-list/block-crash-warning.js +2 -2
  80. package/build/components/block-list/block-crash-warning.js.map +1 -1
  81. package/build/components/block-list/block-html.js +3 -2
  82. package/build/components/block-list/block-html.js.map +1 -1
  83. package/build/components/block-list/block-invalid-warning.js +6 -5
  84. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  85. package/build/components/block-list/block-invalid-warning.native.js +3 -3
  86. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  87. package/build/components/block-list/block-list-item-cell.native.js +3 -2
  88. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  89. package/build/components/block-list/block-list-item.native.js +10 -10
  90. package/build/components/block-list/block-list-item.native.js.map +1 -1
  91. package/build/components/block-list/block-outline.native.js +2 -2
  92. package/build/components/block-list/block-outline.native.js.map +1 -1
  93. package/build/components/block-list/block-selection-button.native.js +9 -9
  94. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  95. package/build/components/block-list/block.js +16 -15
  96. package/build/components/block-list/block.js.map +1 -1
  97. package/build/components/block-list/block.native.js +10 -9
  98. package/build/components/block-list/block.native.js.map +1 -1
  99. package/build/components/block-list/grid-item.native.js +2 -2
  100. package/build/components/block-list/grid-item.native.js.map +1 -1
  101. package/build/components/block-list/index.js +14 -13
  102. package/build/components/block-list/index.js.map +1 -1
  103. package/build/components/block-list/index.native.js +21 -20
  104. package/build/components/block-list/index.native.js.map +1 -1
  105. package/build/components/block-list/insertion-point.native.js +5 -5
  106. package/build/components/block-list/insertion-point.native.js.map +1 -1
  107. package/build/components/block-list/layout.js +3 -2
  108. package/build/components/block-list/layout.js.map +1 -1
  109. package/build/components/block-list/subdirectory-icon.js +3 -3
  110. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  111. package/build/components/block-list-appender/index.js +5 -5
  112. package/build/components/block-list-appender/index.js.map +1 -1
  113. package/build/components/block-list-appender/index.native.js +4 -4
  114. package/build/components/block-list-appender/index.native.js.map +1 -1
  115. package/build/components/block-lock/menu-item.js +4 -3
  116. package/build/components/block-lock/menu-item.js.map +1 -1
  117. package/build/components/block-lock/modal.js +21 -20
  118. package/build/components/block-lock/modal.js.map +1 -1
  119. package/build/components/block-lock/toolbar.js +5 -4
  120. package/build/components/block-lock/toolbar.js.map +1 -1
  121. package/build/components/block-media-update-progress/index.native.js +5 -4
  122. package/build/components/block-media-update-progress/index.native.js.map +1 -1
  123. package/build/components/block-mover/button.js +6 -5
  124. package/build/components/block-mover/button.js.map +1 -1
  125. package/build/components/block-mover/index.js +7 -7
  126. package/build/components/block-mover/index.js.map +1 -1
  127. package/build/components/block-mover/index.native.js +5 -4
  128. package/build/components/block-mover/index.native.js.map +1 -1
  129. package/build/components/block-navigation/dropdown.js +8 -7
  130. package/build/components/block-navigation/dropdown.js.map +1 -1
  131. package/build/components/block-parent-selector/index.js +6 -5
  132. package/build/components/block-parent-selector/index.js.map +1 -1
  133. package/build/components/block-pattern-setup/index.js +20 -19
  134. package/build/components/block-pattern-setup/index.js.map +1 -1
  135. package/build/components/block-pattern-setup/setup-toolbar.js +12 -12
  136. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  137. package/build/components/block-patterns-list/index.js +19 -18
  138. package/build/components/block-patterns-list/index.js.map +1 -1
  139. package/build/components/block-patterns-paging/index.js +12 -12
  140. package/build/components/block-patterns-paging/index.js.map +1 -1
  141. package/build/components/block-popover/drop-zone.js +3 -3
  142. package/build/components/block-popover/drop-zone.js.map +1 -1
  143. package/build/components/block-popover/inbetween.js +4 -3
  144. package/build/components/block-popover/inbetween.js.map +1 -1
  145. package/build/components/block-popover/index.js +4 -3
  146. package/build/components/block-popover/index.js.map +1 -1
  147. package/build/components/block-preview/auto.js +9 -8
  148. package/build/components/block-preview/auto.js.map +1 -1
  149. package/build/components/block-preview/index.js +7 -6
  150. package/build/components/block-preview/index.js.map +1 -1
  151. package/build/components/block-quick-navigation/index.js +7 -7
  152. package/build/components/block-quick-navigation/index.js.map +1 -1
  153. package/build/components/block-removal-warning-modal/index.js +7 -6
  154. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  155. package/build/components/block-selection-clearer/index.js +2 -2
  156. package/build/components/block-selection-clearer/index.js.map +1 -1
  157. package/build/components/block-settings/button.native.js +3 -3
  158. package/build/components/block-settings/button.native.js.map +1 -1
  159. package/build/components/block-settings/container.native.js +12 -12
  160. package/build/components/block-settings/container.native.js.map +1 -1
  161. package/build/components/block-settings-menu/block-html-convert-button.js +21 -17
  162. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  163. package/build/components/block-settings-menu/block-mode-toggle.js +2 -2
  164. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  165. package/build/components/block-settings-menu/block-settings-dropdown.js +17 -16
  166. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  167. package/build/components/block-settings-menu/index.js +2 -2
  168. package/build/components/block-settings-menu/index.js.map +1 -1
  169. package/build/components/block-settings-menu-controls/index.js +9 -9
  170. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  171. package/build/components/block-styles/index.js +9 -8
  172. package/build/components/block-styles/index.js.map +1 -1
  173. package/build/components/block-styles/index.native.js +4 -3
  174. package/build/components/block-styles/index.native.js.map +1 -1
  175. package/build/components/block-styles/menu-items.js +4 -4
  176. package/build/components/block-styles/menu-items.js.map +1 -1
  177. package/build/components/block-styles/preview-panel.js +3 -2
  178. package/build/components/block-styles/preview-panel.js.map +1 -1
  179. package/build/components/block-styles/preview.native.js +8 -7
  180. package/build/components/block-styles/preview.native.js.map +1 -1
  181. package/build/components/block-switcher/block-styles-menu.js +3 -3
  182. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  183. package/build/components/block-switcher/block-transformations-menu.js +11 -10
  184. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  185. package/build/components/block-switcher/block-transformations-menu.native.js +2 -2
  186. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  187. package/build/components/block-switcher/block-variation-transformations.js +6 -5
  188. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  189. package/build/components/block-switcher/index.js +17 -17
  190. package/build/components/block-switcher/index.js.map +1 -1
  191. package/build/components/block-switcher/pattern-transformations-menu.js +18 -17
  192. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  193. package/build/components/block-switcher/preview-block-popover.js +7 -7
  194. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  195. package/build/components/block-toolbar/block-toolbar-menu.native.js +6 -5
  196. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  197. package/build/components/block-toolbar/index.js +16 -15
  198. package/build/components/block-toolbar/index.js.map +1 -1
  199. package/build/components/block-toolbar/index.native.js +8 -7
  200. package/build/components/block-toolbar/index.native.js.map +1 -1
  201. package/build/components/block-tools/back-compat.js +3 -2
  202. package/build/components/block-tools/back-compat.js.map +1 -1
  203. package/build/components/block-tools/block-contextual-toolbar.js +6 -5
  204. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  205. package/build/components/block-tools/block-selection-button.js +11 -10
  206. package/build/components/block-tools/block-selection-button.js.map +1 -1
  207. package/build/components/block-tools/index.js +10 -9
  208. package/build/components/block-tools/index.js.map +1 -1
  209. package/build/components/block-tools/insertion-point.js +9 -8
  210. package/build/components/block-tools/insertion-point.js.map +1 -1
  211. package/build/components/block-tools/selected-block-popover.js +9 -8
  212. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  213. package/build/components/block-tools/zoom-out-mode-inserters.js +5 -4
  214. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  215. package/build/components/block-types-list/index.js +4 -4
  216. package/build/components/block-types-list/index.js.map +1 -1
  217. package/build/components/block-types-list/index.native.js +11 -10
  218. package/build/components/block-types-list/index.native.js.map +1 -1
  219. package/build/components/block-variation-picker/index.js +8 -8
  220. package/build/components/block-variation-picker/index.js.map +1 -1
  221. package/build/components/block-variation-picker/index.native.js +8 -8
  222. package/build/components/block-variation-picker/index.native.js.map +1 -1
  223. package/build/components/block-variation-transforms/index.js +10 -9
  224. package/build/components/block-variation-transforms/index.js.map +1 -1
  225. package/build/components/block-vertical-alignment-control/icons.js +11 -11
  226. package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
  227. package/build/components/block-vertical-alignment-control/index.js +3 -3
  228. package/build/components/block-vertical-alignment-control/index.js.map +1 -1
  229. package/build/components/block-vertical-alignment-control/ui.js +2 -2
  230. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  231. package/build/components/border-radius-control/all-input-control.js +2 -2
  232. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  233. package/build/components/border-radius-control/index.js +10 -9
  234. package/build/components/border-radius-control/index.js.map +1 -1
  235. package/build/components/border-radius-control/input-controls.js +5 -5
  236. package/build/components/border-radius-control/input-controls.js.map +1 -1
  237. package/build/components/border-radius-control/linked-button.js +3 -3
  238. package/build/components/border-radius-control/linked-button.js.map +1 -1
  239. package/build/components/button-block-appender/index.js +7 -6
  240. package/build/components/button-block-appender/index.js.map +1 -1
  241. package/build/components/button-block-appender/index.native.js +5 -5
  242. package/build/components/button-block-appender/index.native.js.map +1 -1
  243. package/build/components/caption/index.native.js +3 -3
  244. package/build/components/caption/index.native.js.map +1 -1
  245. package/build/components/child-layout-control/index.js +8 -7
  246. package/build/components/child-layout-control/index.js.map +1 -1
  247. package/build/components/color-palette/control.js +2 -2
  248. package/build/components/color-palette/control.js.map +1 -1
  249. package/build/components/color-palette/with-color-context.js +2 -2
  250. package/build/components/color-palette/with-color-context.js.map +1 -1
  251. package/build/components/color-style-selector/index.js +9 -9
  252. package/build/components/color-style-selector/index.js.map +1 -1
  253. package/build/components/colors/with-colors.js +5 -4
  254. package/build/components/colors/with-colors.js.map +1 -1
  255. package/build/components/colors-gradients/control.js +12 -12
  256. package/build/components/colors-gradients/control.js.map +1 -1
  257. package/build/components/colors-gradients/dropdown.js +13 -13
  258. package/build/components/colors-gradients/dropdown.js.map +1 -1
  259. package/build/components/colors-gradients/panel-color-gradient-settings.js +7 -7
  260. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  261. package/build/components/colors-gradients/panel-color-gradient-settings.native.js +5 -4
  262. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  263. package/build/components/contrast-checker/index.js +3 -3
  264. package/build/components/contrast-checker/index.js.map +1 -1
  265. package/build/components/contrast-checker/index.native.js +6 -5
  266. package/build/components/contrast-checker/index.native.js.map +1 -1
  267. package/build/components/convert-to-group-buttons/index.js +3 -3
  268. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  269. package/build/components/convert-to-group-buttons/toolbar.js +4 -4
  270. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  271. package/build/components/copy-handler/index.js +29 -209
  272. package/build/components/copy-handler/index.js.map +1 -1
  273. package/build/components/date-format-picker/index.js +9 -8
  274. package/build/components/date-format-picker/index.js.map +1 -1
  275. package/build/components/default-block-appender/index.js +4 -4
  276. package/build/components/default-block-appender/index.js.map +1 -1
  277. package/build/components/default-block-appender/index.native.js +4 -4
  278. package/build/components/default-block-appender/index.native.js.map +1 -1
  279. package/build/components/default-style-picker/index.js +4 -3
  280. package/build/components/default-style-picker/index.js.map +1 -1
  281. package/build/components/dimensions-tool/aspect-ratio-tool.js +3 -3
  282. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  283. package/build/components/dimensions-tool/index.js +5 -4
  284. package/build/components/dimensions-tool/index.js.map +1 -1
  285. package/build/components/dimensions-tool/scale-tool.js +6 -5
  286. package/build/components/dimensions-tool/scale-tool.js.map +1 -1
  287. package/build/components/dimensions-tool/width-height-tool.js +7 -7
  288. package/build/components/dimensions-tool/width-height-tool.js.map +1 -1
  289. package/build/components/duotone-control/index.js +18 -10
  290. package/build/components/duotone-control/index.js.map +1 -1
  291. package/build/components/editable-text/index.js +3 -2
  292. package/build/components/editable-text/index.js.map +1 -1
  293. package/build/components/editor-styles/index.js +5 -4
  294. package/build/components/editor-styles/index.js.map +1 -1
  295. package/build/components/floating-toolbar/index.native.js +8 -7
  296. package/build/components/floating-toolbar/index.native.js.map +1 -1
  297. package/build/components/floating-toolbar/nav-up-icon.js +4 -4
  298. package/build/components/floating-toolbar/nav-up-icon.js.map +1 -1
  299. package/build/components/font-appearance-control/index.js +4 -3
  300. package/build/components/font-appearance-control/index.js.map +1 -1
  301. package/build/components/font-family/index.js +2 -2
  302. package/build/components/font-family/index.js.map +1 -1
  303. package/build/components/font-sizes/font-size-picker.js +2 -2
  304. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  305. package/build/components/font-sizes/with-font-sizes.js +4 -3
  306. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  307. package/build/components/global-styles/advanced-panel.js +7 -6
  308. package/build/components/global-styles/advanced-panel.js.map +1 -1
  309. package/build/components/global-styles/border-panel.js +8 -7
  310. package/build/components/global-styles/border-panel.js.map +1 -1
  311. package/build/components/global-styles/color-panel.js +21 -20
  312. package/build/components/global-styles/color-panel.js.map +1 -1
  313. package/build/components/global-styles/color-panel.native.js +4 -3
  314. package/build/components/global-styles/color-panel.native.js.map +1 -1
  315. package/build/components/global-styles/dimensions-panel.js +27 -26
  316. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  317. package/build/components/global-styles/effects-panel.js +23 -22
  318. package/build/components/global-styles/effects-panel.js.map +1 -1
  319. package/build/components/global-styles/filters-panel.js +17 -16
  320. package/build/components/global-styles/filters-panel.js.map +1 -1
  321. package/build/components/global-styles/hooks.js +1 -1
  322. package/build/components/global-styles/hooks.js.map +1 -1
  323. package/build/components/global-styles/image-settings-panel.js +4 -4
  324. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  325. package/build/components/global-styles/typography-panel.js +22 -21
  326. package/build/components/global-styles/typography-panel.js.map +1 -1
  327. package/build/components/global-styles/use-global-styles-output.js +17 -5
  328. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  329. package/build/components/global-styles/utils.js +22 -0
  330. package/build/components/global-styles/utils.js.map +1 -1
  331. package/build/components/gradients/with-gradient.js +2 -2
  332. package/build/components/gradients/with-gradient.js.map +1 -1
  333. package/build/components/height-control/index.js +9 -8
  334. package/build/components/height-control/index.js.map +1 -1
  335. package/build/components/iframe/index.js +6 -5
  336. package/build/components/iframe/index.js.map +1 -1
  337. package/build/components/image-editor/aspect-ratio-dropdown.js +7 -7
  338. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  339. package/build/components/image-editor/context.js +2 -1
  340. package/build/components/image-editor/context.js.map +1 -1
  341. package/build/components/image-editor/cropper.js +4 -4
  342. package/build/components/image-editor/cropper.js.map +1 -1
  343. package/build/components/image-editor/form-controls.js +3 -3
  344. package/build/components/image-editor/form-controls.js.map +1 -1
  345. package/build/components/image-editor/index.js +5 -5
  346. package/build/components/image-editor/index.js.map +1 -1
  347. package/build/components/image-editor/rotation-button.js +2 -2
  348. package/build/components/image-editor/rotation-button.js.map +1 -1
  349. package/build/components/image-editor/zoom-dropdown.js +4 -4
  350. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  351. package/build/components/image-size-control/index.js +9 -9
  352. package/build/components/image-size-control/index.js.map +1 -1
  353. package/build/components/index.js +1 -1
  354. package/build/components/index.js.map +1 -1
  355. package/build/components/inner-blocks/button-block-appender.js +2 -2
  356. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  357. package/build/components/inner-blocks/constants.native.js +13 -0
  358. package/build/components/inner-blocks/constants.native.js.map +1 -0
  359. package/build/components/inner-blocks/default-block-appender.js +2 -2
  360. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  361. package/build/components/inner-blocks/index.js +9 -8
  362. package/build/components/inner-blocks/index.js.map +1 -1
  363. package/build/components/inner-blocks/index.native.js +21 -8
  364. package/build/components/inner-blocks/index.native.js.map +1 -1
  365. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js +95 -0
  366. package/build/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -0
  367. package/build/components/inner-blocks/with-client-id.js +2 -2
  368. package/build/components/inner-blocks/with-client-id.js.map +1 -1
  369. package/build/components/inserter/block-patterns-explorer/explorer.js +7 -6
  370. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  371. package/build/components/inserter/block-patterns-explorer/patterns-list.js +6 -5
  372. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  373. package/build/components/inserter/block-patterns-explorer/sidebar.js +8 -8
  374. package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  375. package/build/components/inserter/block-patterns-filter.js +21 -19
  376. package/build/components/inserter/block-patterns-filter.js.map +1 -1
  377. package/build/components/inserter/block-patterns-tab.js +19 -18
  378. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  379. package/build/components/inserter/block-types-tab.js +10 -9
  380. package/build/components/inserter/block-types-tab.js.map +1 -1
  381. package/build/components/inserter/block-types-tab.native.js +2 -1
  382. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  383. package/build/components/inserter/index.js +9 -8
  384. package/build/components/inserter/index.js.map +1 -1
  385. package/build/components/inserter/index.native.js +11 -10
  386. package/build/components/inserter/index.native.js.map +1 -1
  387. package/build/components/inserter/library.js +3 -2
  388. package/build/components/inserter/library.js.map +1 -1
  389. package/build/components/inserter/media-tab/hooks.js +4 -33
  390. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  391. package/build/components/inserter/media-tab/media-list.js +3 -3
  392. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  393. package/build/components/inserter/media-tab/media-panel.js +7 -6
  394. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  395. package/build/components/inserter/media-tab/media-preview.js +18 -17
  396. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  397. package/build/components/inserter/media-tab/media-tab.js +12 -11
  398. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  399. package/build/components/inserter/media-tab/utils.js +2 -2
  400. package/build/components/inserter/media-tab/utils.js.map +1 -1
  401. package/build/components/inserter/menu.js +19 -18
  402. package/build/components/inserter/menu.js.map +1 -1
  403. package/build/components/inserter/menu.native.js +9 -8
  404. package/build/components/inserter/menu.native.js.map +1 -1
  405. package/build/components/inserter/mobile-tab-navigation.js +12 -12
  406. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  407. package/build/components/inserter/no-results.js +4 -4
  408. package/build/components/inserter/no-results.js.map +1 -1
  409. package/build/components/inserter/no-results.native.js +4 -4
  410. package/build/components/inserter/no-results.native.js.map +1 -1
  411. package/build/components/inserter/panel.js +5 -5
  412. package/build/components/inserter/panel.js.map +1 -1
  413. package/build/components/inserter/preview-panel.js +8 -7
  414. package/build/components/inserter/preview-panel.js.map +1 -1
  415. package/build/components/inserter/quick-inserter.js +7 -6
  416. package/build/components/inserter/quick-inserter.js.map +1 -1
  417. package/build/components/inserter/reusable-block-rename-hint.js +5 -4
  418. package/build/components/inserter/reusable-block-rename-hint.js.map +1 -1
  419. package/build/components/inserter/reusable-blocks-tab.native.js +3 -2
  420. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  421. package/build/components/inserter/search-results.js +11 -10
  422. package/build/components/inserter/search-results.js.map +1 -1
  423. package/build/components/inserter/search-results.native.js +4 -3
  424. package/build/components/inserter/search-results.native.js.map +1 -1
  425. package/build/components/inserter/tabs.js +2 -1
  426. package/build/components/inserter/tabs.js.map +1 -1
  427. package/build/components/inserter/tabs.native.js +7 -6
  428. package/build/components/inserter/tabs.native.js.map +1 -1
  429. package/build/components/inserter/tips.js +6 -5
  430. package/build/components/inserter/tips.js.map +1 -1
  431. package/build/components/inserter-draggable-blocks/index.js +3 -3
  432. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  433. package/build/components/inserter-list-item/index.js +9 -8
  434. package/build/components/inserter-list-item/index.js.map +1 -1
  435. package/build/components/inserter-listbox/group.js +2 -1
  436. package/build/components/inserter-listbox/group.js.map +1 -1
  437. package/build/components/inserter-listbox/index.js +2 -2
  438. package/build/components/inserter-listbox/index.js.map +1 -1
  439. package/build/components/inserter-listbox/item.js +5 -4
  440. package/build/components/inserter-listbox/item.js.map +1 -1
  441. package/build/components/inserter-listbox/row.js +2 -1
  442. package/build/components/inserter-listbox/row.js.map +1 -1
  443. package/build/components/inspector-controls/block-support-slot-container.js +3 -2
  444. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  445. package/build/components/inspector-controls/block-support-tools-panel.js +3 -2
  446. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  447. package/build/components/inspector-controls/fill.js +7 -6
  448. package/build/components/inspector-controls/fill.js.map +1 -1
  449. package/build/components/inspector-controls/fill.native.js +4 -3
  450. package/build/components/inspector-controls/fill.native.js.map +1 -1
  451. package/build/components/inspector-controls/index.js +3 -3
  452. package/build/components/inspector-controls/index.js.map +1 -1
  453. package/build/components/inspector-controls/slot.js +5 -4
  454. package/build/components/inspector-controls/slot.js.map +1 -1
  455. package/build/components/inspector-controls/slot.native.js +2 -2
  456. package/build/components/inspector-controls/slot.native.js.map +1 -1
  457. package/build/components/inspector-controls-tabs/advanced-controls-panel.js +3 -3
  458. package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  459. package/build/components/inspector-controls-tabs/index.js +5 -5
  460. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  461. package/build/components/inspector-controls-tabs/position-controls-panel.js +5 -4
  462. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  463. package/build/components/inspector-controls-tabs/settings-tab-hint.js +5 -4
  464. package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  465. package/build/components/inspector-controls-tabs/settings-tab.js +2 -2
  466. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  467. package/build/components/inspector-controls-tabs/styles-tab.js +11 -11
  468. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  469. package/build/components/inspector-popover-header/index.js +8 -8
  470. package/build/components/inspector-popover-header/index.js.map +1 -1
  471. package/build/components/justify-content-control/index.js +3 -3
  472. package/build/components/justify-content-control/index.js.map +1 -1
  473. package/build/components/justify-content-control/ui.js +2 -2
  474. package/build/components/justify-content-control/ui.js.map +1 -1
  475. package/build/components/letter-spacing-control/index.js +3 -3
  476. package/build/components/letter-spacing-control/index.js.map +1 -1
  477. package/build/components/line-height-control/index.js +3 -3
  478. package/build/components/line-height-control/index.js.map +1 -1
  479. package/build/components/line-height-control/index.native.js +2 -2
  480. package/build/components/line-height-control/index.native.js.map +1 -1
  481. package/build/components/link-control/index.js +18 -17
  482. package/build/components/link-control/index.js.map +1 -1
  483. package/build/components/link-control/link-preview.js +20 -20
  484. package/build/components/link-control/link-preview.js.map +1 -1
  485. package/build/components/link-control/search-create-button.js +4 -3
  486. package/build/components/link-control/search-create-button.js.map +1 -1
  487. package/build/components/link-control/search-input.js +5 -4
  488. package/build/components/link-control/search-input.js.map +1 -1
  489. package/build/components/link-control/search-item.js +41 -6
  490. package/build/components/link-control/search-item.js.map +1 -1
  491. package/build/components/link-control/search-results.js +7 -7
  492. package/build/components/link-control/search-results.js.map +1 -1
  493. package/build/components/link-control/settings-drawer.js +5 -4
  494. package/build/components/link-control/settings-drawer.js.map +1 -1
  495. package/build/components/link-control/settings.js +4 -4
  496. package/build/components/link-control/settings.js.map +1 -1
  497. package/build/components/list-view/appender.js +5 -4
  498. package/build/components/list-view/appender.js.map +1 -1
  499. package/build/components/list-view/aria-referenced-text.js +2 -1
  500. package/build/components/list-view/aria-referenced-text.js.map +1 -1
  501. package/build/components/list-view/block-contents.js +5 -4
  502. package/build/components/list-view/block-contents.js.map +1 -1
  503. package/build/components/list-view/block-select-button.js +16 -15
  504. package/build/components/list-view/block-select-button.js.map +1 -1
  505. package/build/components/list-view/block.js +15 -45
  506. package/build/components/list-view/block.js.map +1 -1
  507. package/build/components/list-view/branch.js +17 -9
  508. package/build/components/list-view/branch.js.map +1 -1
  509. package/build/components/list-view/drop-indicator.js +4 -3
  510. package/build/components/list-view/drop-indicator.js.map +1 -1
  511. package/build/components/list-view/expander.js +3 -3
  512. package/build/components/list-view/expander.js.map +1 -1
  513. package/build/components/list-view/index.js +16 -10
  514. package/build/components/list-view/index.js.map +1 -1
  515. package/build/components/list-view/leaf.js +3 -2
  516. package/build/components/list-view/leaf.js.map +1 -1
  517. package/build/components/list-view/utils.js +35 -0
  518. package/build/components/list-view/utils.js.map +1 -1
  519. package/build/components/media-placeholder/index.js +22 -21
  520. package/build/components/media-placeholder/index.js.map +1 -1
  521. package/build/components/media-placeholder/index.native.js +13 -12
  522. package/build/components/media-placeholder/index.native.js.map +1 -1
  523. package/build/components/media-replace-flow/index.js +14 -13
  524. package/build/components/media-replace-flow/index.js.map +1 -1
  525. package/build/components/media-replace-flow/index.native.js +2 -2
  526. package/build/components/media-replace-flow/index.native.js.map +1 -1
  527. package/build/components/media-upload/{constants.js → constants.native.js} +2 -4
  528. package/build/components/media-upload/constants.native.js.map +1 -0
  529. package/build/components/media-upload/index.js +1 -1
  530. package/build/components/media-upload/index.js.map +1 -1
  531. package/build/components/media-upload/index.native.js +12 -11
  532. package/build/components/media-upload/index.native.js.map +1 -1
  533. package/build/components/media-upload-progress/index.native.js +5 -4
  534. package/build/components/media-upload-progress/index.native.js.map +1 -1
  535. package/build/components/multi-selection-inspector/index.js +6 -6
  536. package/build/components/multi-selection-inspector/index.js.map +1 -1
  537. package/build/components/navigable-toolbar/index.js +4 -3
  538. package/build/components/navigable-toolbar/index.js.map +1 -1
  539. package/build/components/observe-typing/index.js +2 -2
  540. package/build/components/observe-typing/index.js.map +1 -1
  541. package/build/components/panel-color-settings/index.js +2 -2
  542. package/build/components/panel-color-settings/index.js.map +1 -1
  543. package/build/components/plain-text/index.js +4 -3
  544. package/build/components/plain-text/index.js.map +1 -1
  545. package/build/components/plain-text/index.native.js +4 -3
  546. package/build/components/plain-text/index.native.js.map +1 -1
  547. package/build/components/preview-options/index.js +5 -5
  548. package/build/components/preview-options/index.js.map +1 -1
  549. package/build/components/provider/block-refs-provider.js +2 -1
  550. package/build/components/provider/block-refs-provider.js.map +1 -1
  551. package/build/components/provider/index.js +4 -3
  552. package/build/components/provider/index.js.map +1 -1
  553. package/build/components/provider/index.native.js +3 -2
  554. package/build/components/provider/index.native.js.map +1 -1
  555. package/build/components/provider/use-block-sync.js +1 -1
  556. package/build/components/provider/use-block-sync.js.map +1 -1
  557. package/build/components/provider/with-registry-provider.js +4 -3
  558. package/build/components/provider/with-registry-provider.js.map +1 -1
  559. package/build/components/publish-date-time-picker/index.js +5 -4
  560. package/build/components/publish-date-time-picker/index.js.map +1 -1
  561. package/build/components/recursion-provider/index.js +2 -1
  562. package/build/components/recursion-provider/index.js.map +1 -1
  563. package/build/components/resizable-box-popover/index.js +3 -3
  564. package/build/components/resizable-box-popover/index.js.map +1 -1
  565. package/build/components/resolution-tool/index.js +3 -3
  566. package/build/components/resolution-tool/index.js.map +1 -1
  567. package/build/components/responsive-block-control/index.js +10 -9
  568. package/build/components/responsive-block-control/index.js.map +1 -1
  569. package/build/components/responsive-block-control/label.js +3 -3
  570. package/build/components/responsive-block-control/label.js.map +1 -1
  571. package/build/components/rich-text/content.js +3 -2
  572. package/build/components/rich-text/content.js.map +1 -1
  573. package/build/components/rich-text/embed-handler-picker.native.js +2 -1
  574. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  575. package/build/components/rich-text/format-edit.js +4 -3
  576. package/build/components/rich-text/format-edit.js.map +1 -1
  577. package/build/components/rich-text/format-toolbar/index.js +4 -4
  578. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  579. package/build/components/rich-text/format-toolbar/index.native.js +3 -3
  580. package/build/components/rich-text/format-toolbar/index.native.js.map +1 -1
  581. package/build/components/rich-text/format-toolbar-container.js +9 -9
  582. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  583. package/build/components/rich-text/format-toolbar-container.native.js +3 -3
  584. package/build/components/rich-text/format-toolbar-container.native.js.map +1 -1
  585. package/build/components/rich-text/get-rich-text-values.js +2 -1
  586. package/build/components/rich-text/get-rich-text-values.js.map +1 -1
  587. package/build/components/rich-text/index.js +9 -8
  588. package/build/components/rich-text/index.js.map +1 -1
  589. package/build/components/rich-text/index.native.js +8 -15
  590. package/build/components/rich-text/index.native.js.map +1 -1
  591. package/build/components/rich-text/multiline.js +3 -2
  592. package/build/components/rich-text/multiline.js.map +1 -1
  593. package/build/components/rich-text/toolbar-button.js +3 -3
  594. package/build/components/rich-text/toolbar-button.js.map +1 -1
  595. package/build/components/rich-text/use-paste-handler.js +5 -87
  596. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  597. package/build/components/rich-text/utils.js +2 -5
  598. package/build/components/rich-text/utils.js.map +1 -1
  599. package/build/components/skip-to-selected-block/index.js +2 -2
  600. package/build/components/skip-to-selected-block/index.js.map +1 -1
  601. package/build/components/spacing-sizes-control/index.js +9 -8
  602. package/build/components/spacing-sizes-control/index.js.map +1 -1
  603. package/build/components/spacing-sizes-control/input-controls/axial.js +3 -3
  604. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  605. package/build/components/spacing-sizes-control/input-controls/separated.js +3 -3
  606. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  607. package/build/components/spacing-sizes-control/input-controls/single.js +2 -2
  608. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  609. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +9 -8
  610. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  611. package/build/components/spacing-sizes-control/sides-dropdown/index.js +6 -6
  612. package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  613. package/build/components/text-decoration-control/index.js +6 -6
  614. package/build/components/text-decoration-control/index.js.map +1 -1
  615. package/build/components/text-transform-control/index.js +6 -6
  616. package/build/components/text-transform-control/index.js.map +1 -1
  617. package/build/components/tool-selector/index.js +13 -11
  618. package/build/components/tool-selector/index.js.map +1 -1
  619. package/build/components/typewriter/index.js +3 -3
  620. package/build/components/typewriter/index.js.map +1 -1
  621. package/build/components/ungroup-button/index.native.js +2 -2
  622. package/build/components/ungroup-button/index.native.js.map +1 -1
  623. package/build/components/unit-control/index.js +2 -2
  624. package/build/components/unit-control/index.js.map +1 -1
  625. package/build/components/unsupported-block-details/index.native.js +127 -0
  626. package/build/components/unsupported-block-details/index.native.js.map +1 -0
  627. package/build/components/url-input/button.js +9 -8
  628. package/build/components/url-input/button.js.map +1 -1
  629. package/build/components/url-input/index.js +9 -8
  630. package/build/components/url-input/index.js.map +1 -1
  631. package/build/components/url-input/index.native.js +2 -2
  632. package/build/components/url-input/index.native.js.map +1 -1
  633. package/build/components/url-popover/image-url-input-ui.js +19 -18
  634. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  635. package/build/components/url-popover/index.js +8 -7
  636. package/build/components/url-popover/index.js.map +1 -1
  637. package/build/components/url-popover/link-editor.js +4 -4
  638. package/build/components/url-popover/link-editor.js.map +1 -1
  639. package/build/components/url-popover/link-viewer-url.js +3 -3
  640. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  641. package/build/components/url-popover/link-viewer.js +4 -4
  642. package/build/components/url-popover/link-viewer.js.map +1 -1
  643. package/build/components/use-on-block-drop/index.js +2 -2
  644. package/build/components/use-on-block-drop/index.js.map +1 -1
  645. package/build/components/use-unsupported-block-editor/index.native.js +57 -0
  646. package/build/components/use-unsupported-block-editor/index.native.js.map +1 -0
  647. package/build/components/video-player/gridicon-play.native.js +3 -3
  648. package/build/components/video-player/gridicon-play.native.js.map +1 -1
  649. package/build/components/video-player/index.native.js +6 -5
  650. package/build/components/video-player/index.native.js.map +1 -1
  651. package/build/components/warning/index.js +10 -9
  652. package/build/components/warning/index.js.map +1 -1
  653. package/build/components/warning/index.native.js +6 -6
  654. package/build/components/warning/index.native.js.map +1 -1
  655. package/build/components/writing-flow/index.js +7 -5
  656. package/build/components/writing-flow/index.js.map +1 -1
  657. package/build/components/writing-flow/use-clipboard-handler.js +179 -0
  658. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -0
  659. package/build/components/writing-flow/use-tab-nav.js +4 -3
  660. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  661. package/build/components/writing-mode-control/index.js +6 -6
  662. package/build/components/writing-mode-control/index.js.map +1 -1
  663. package/build/hooks/align.js +6 -6
  664. package/build/hooks/align.js.map +1 -1
  665. package/build/hooks/anchor.js +10 -9
  666. package/build/hooks/anchor.js.map +1 -1
  667. package/build/hooks/background.js +17 -16
  668. package/build/hooks/background.js.map +1 -1
  669. package/build/hooks/block-hooks.js +11 -10
  670. package/build/hooks/block-hooks.js.map +1 -1
  671. package/build/hooks/block-rename-ui.js +22 -18
  672. package/build/hooks/block-rename-ui.js.map +1 -1
  673. package/build/hooks/border.js +6 -5
  674. package/build/hooks/border.js.map +1 -1
  675. package/build/hooks/color.js +7 -6
  676. package/build/hooks/color.js.map +1 -1
  677. package/build/hooks/content-lock-ui.js +9 -8
  678. package/build/hooks/content-lock-ui.js.map +1 -1
  679. package/build/hooks/contrast-checker.js +2 -1
  680. package/build/hooks/contrast-checker.js.map +1 -1
  681. package/build/hooks/custom-class-name.js +7 -7
  682. package/build/hooks/custom-class-name.js.map +1 -1
  683. package/build/hooks/custom-fields.js +8 -8
  684. package/build/hooks/custom-fields.js.map +1 -1
  685. package/build/hooks/dimensions.js +5 -4
  686. package/build/hooks/dimensions.js.map +1 -1
  687. package/build/hooks/duotone.js +10 -9
  688. package/build/hooks/duotone.js.map +1 -1
  689. package/build/hooks/font-size.js +5 -5
  690. package/build/hooks/font-size.js.map +1 -1
  691. package/build/hooks/layout.js +14 -13
  692. package/build/hooks/layout.js.map +1 -1
  693. package/build/hooks/line-height.js +3 -3
  694. package/build/hooks/line-height.js.map +1 -1
  695. package/build/hooks/margin.js +3 -2
  696. package/build/hooks/margin.js.map +1 -1
  697. package/build/hooks/padding.js +3 -2
  698. package/build/hooks/padding.js.map +1 -1
  699. package/build/hooks/position.js +10 -9
  700. package/build/hooks/position.js.map +1 -1
  701. package/build/hooks/style.js +11 -10
  702. package/build/hooks/style.js.map +1 -1
  703. package/build/hooks/typography.js +4 -3
  704. package/build/hooks/typography.js.map +1 -1
  705. package/build/hooks/typography.native.js +4 -4
  706. package/build/hooks/typography.native.js.map +1 -1
  707. package/build/layouts/constrained.js +11 -11
  708. package/build/layouts/constrained.js.map +1 -1
  709. package/build/layouts/flex.js +18 -18
  710. package/build/layouts/flex.js.map +1 -1
  711. package/build/layouts/grid.js +10 -10
  712. package/build/layouts/grid.js.map +1 -1
  713. package/build/private-apis.js +2 -0
  714. package/build/private-apis.js.map +1 -1
  715. package/build/store/actions.js +8 -12
  716. package/build/store/actions.js.map +1 -1
  717. package/build/store/private-selectors.js +55 -1
  718. package/build/store/private-selectors.js.map +1 -1
  719. package/build/store/reducer.js +19 -1
  720. package/build/store/reducer.js.map +1 -1
  721. package/build/store/selectors.js +1 -1
  722. package/build/store/selectors.js.map +1 -1
  723. package/build/utils/pasting.js +46 -0
  724. package/build/utils/pasting.js.map +1 -1
  725. package/build/utils/transform-styles/transforms/wrap.js +5 -0
  726. package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
  727. package/build/utils/use-notify-copy.js +53 -0
  728. package/build/utils/use-notify-copy.js.map +1 -0
  729. package/build-module/autocompleters/block.js +1 -1
  730. package/build-module/autocompleters/link.js +1 -1
  731. package/build-module/components/alignment-control/index.js +1 -1
  732. package/build-module/components/alignment-control/ui.js +1 -1
  733. package/build-module/components/autocomplete/index.js +1 -1
  734. package/build-module/components/block-actions/index.js +1 -1
  735. package/build-module/components/block-actions/index.js.map +1 -1
  736. package/build-module/components/block-alignment-control/index.js +1 -1
  737. package/build-module/components/block-alignment-control/ui.js +1 -1
  738. package/build-module/components/block-alignment-control/ui.native.js +1 -1
  739. package/build-module/components/block-alignment-matrix-control/index.js +1 -1
  740. package/build-module/components/block-breadcrumb/index.js +2 -2
  741. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  742. package/build-module/components/block-canvas/index.js +7 -9
  743. package/build-module/components/block-canvas/index.js.map +1 -1
  744. package/build-module/components/block-caption/index.native.js +1 -1
  745. package/build-module/components/block-card/index.js +1 -1
  746. package/build-module/components/block-compare/block-view.js +1 -1
  747. package/build-module/components/block-compare/index.js +1 -1
  748. package/build-module/components/block-context/index.js +1 -1
  749. package/build-module/components/block-controls/fill.js +1 -1
  750. package/build-module/components/block-controls/index.js +1 -1
  751. package/build-module/components/block-controls/slot.js +1 -1
  752. package/build-module/components/block-controls/slot.native.js +1 -1
  753. package/build-module/components/block-draggable/draggable-chip.js +1 -1
  754. package/build-module/components/block-draggable/draggable-chip.native.js +1 -1
  755. package/build-module/components/block-draggable/dropping-insertion-point.native.js +1 -1
  756. package/build-module/components/block-draggable/index.js +1 -1
  757. package/build-module/components/block-draggable/index.native.js +1 -1
  758. package/build-module/components/block-edit/edit.js +1 -1
  759. package/build-module/components/block-edit/edit.native.js +1 -1
  760. package/build-module/components/block-edit/index.js +1 -1
  761. package/build-module/components/block-edit-visually-button/index.js +1 -1
  762. package/build-module/components/block-full-height-alignment-control/index.js +1 -1
  763. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js +3 -3
  764. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -1
  765. package/build-module/components/block-heading-level-dropdown/index.js +3 -3
  766. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
  767. package/build-module/components/block-heading-level-dropdown/index.native.js +3 -3
  768. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
  769. package/build-module/components/block-icon/index.js +1 -1
  770. package/build-module/components/block-icon/index.native.js +1 -1
  771. package/build-module/components/block-info-slot-fill/index.js +1 -1
  772. package/build-module/components/block-inspector/index.js +1 -1
  773. package/build-module/components/block-list/block-crash-warning.js +1 -1
  774. package/build-module/components/block-list/block-html.js +1 -1
  775. package/build-module/components/block-list/block-invalid-warning.js +1 -1
  776. package/build-module/components/block-list/block-invalid-warning.native.js +1 -1
  777. package/build-module/components/block-list/block-list-item-cell.native.js +1 -1
  778. package/build-module/components/block-list/block-list-item.native.js +3 -3
  779. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  780. package/build-module/components/block-list/block-outline.native.js +1 -1
  781. package/build-module/components/block-list/block-selection-button.native.js +1 -1
  782. package/build-module/components/block-list/block.js +1 -1
  783. package/build-module/components/block-list/block.native.js +1 -1
  784. package/build-module/components/block-list/grid-item.native.js +1 -1
  785. package/build-module/components/block-list/index.js +1 -1
  786. package/build-module/components/block-list/index.native.js +1 -1
  787. package/build-module/components/block-list/insertion-point.native.js +1 -1
  788. package/build-module/components/block-list/layout.js +1 -1
  789. package/build-module/components/block-list/subdirectory-icon.js +1 -1
  790. package/build-module/components/block-list-appender/index.js +1 -1
  791. package/build-module/components/block-list-appender/index.native.js +1 -1
  792. package/build-module/components/block-lock/menu-item.js +1 -1
  793. package/build-module/components/block-lock/modal.js +1 -1
  794. package/build-module/components/block-lock/toolbar.js +1 -1
  795. package/build-module/components/block-media-update-progress/index.native.js +1 -1
  796. package/build-module/components/block-mover/button.js +1 -1
  797. package/build-module/components/block-mover/index.js +1 -1
  798. package/build-module/components/block-mover/index.native.js +1 -1
  799. package/build-module/components/block-navigation/dropdown.js +1 -1
  800. package/build-module/components/block-parent-selector/index.js +2 -2
  801. package/build-module/components/block-parent-selector/index.js.map +1 -1
  802. package/build-module/components/block-pattern-setup/index.js +1 -1
  803. package/build-module/components/block-pattern-setup/setup-toolbar.js +1 -1
  804. package/build-module/components/block-patterns-list/index.js +1 -1
  805. package/build-module/components/block-patterns-paging/index.js +1 -1
  806. package/build-module/components/block-popover/drop-zone.js +1 -1
  807. package/build-module/components/block-popover/inbetween.js +1 -1
  808. package/build-module/components/block-popover/index.js +1 -1
  809. package/build-module/components/block-preview/auto.js +1 -1
  810. package/build-module/components/block-preview/index.js +2 -2
  811. package/build-module/components/block-preview/index.js.map +1 -1
  812. package/build-module/components/block-quick-navigation/index.js +1 -1
  813. package/build-module/components/block-removal-warning-modal/index.js +1 -1
  814. package/build-module/components/block-selection-clearer/index.js +1 -1
  815. package/build-module/components/block-settings/button.native.js +1 -1
  816. package/build-module/components/block-settings/container.native.js +1 -1
  817. package/build-module/components/block-settings-menu/block-html-convert-button.js +20 -17
  818. package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  819. package/build-module/components/block-settings-menu/block-mode-toggle.js +1 -1
  820. package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -1
  821. package/build-module/components/block-settings-menu/index.js +1 -1
  822. package/build-module/components/block-settings-menu-controls/index.js +2 -2
  823. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  824. package/build-module/components/block-styles/index.js +1 -1
  825. package/build-module/components/block-styles/index.native.js +1 -1
  826. package/build-module/components/block-styles/menu-items.js +1 -1
  827. package/build-module/components/block-styles/preview-panel.js +1 -1
  828. package/build-module/components/block-styles/preview.native.js +1 -1
  829. package/build-module/components/block-switcher/block-styles-menu.js +1 -1
  830. package/build-module/components/block-switcher/block-transformations-menu.js +1 -1
  831. package/build-module/components/block-switcher/block-transformations-menu.native.js +1 -1
  832. package/build-module/components/block-switcher/block-variation-transformations.js +1 -1
  833. package/build-module/components/block-switcher/index.js +6 -6
  834. package/build-module/components/block-switcher/index.js.map +1 -1
  835. package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -1
  836. package/build-module/components/block-switcher/preview-block-popover.js +1 -1
  837. package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -1
  838. package/build-module/components/block-toolbar/index.js +1 -1
  839. package/build-module/components/block-toolbar/index.native.js +1 -1
  840. package/build-module/components/block-tools/back-compat.js +1 -1
  841. package/build-module/components/block-tools/block-contextual-toolbar.js +1 -1
  842. package/build-module/components/block-tools/block-selection-button.js +2 -2
  843. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  844. package/build-module/components/block-tools/index.js +1 -1
  845. package/build-module/components/block-tools/insertion-point.js +1 -1
  846. package/build-module/components/block-tools/selected-block-popover.js +1 -1
  847. package/build-module/components/block-tools/zoom-out-mode-inserters.js +1 -1
  848. package/build-module/components/block-types-list/index.js +1 -1
  849. package/build-module/components/block-types-list/index.native.js +1 -1
  850. package/build-module/components/block-variation-picker/index.js +1 -1
  851. package/build-module/components/block-variation-picker/index.native.js +1 -1
  852. package/build-module/components/block-variation-transforms/index.js +1 -1
  853. package/build-module/components/block-vertical-alignment-control/icons.js +1 -1
  854. package/build-module/components/block-vertical-alignment-control/index.js +1 -1
  855. package/build-module/components/block-vertical-alignment-control/ui.js +1 -1
  856. package/build-module/components/border-radius-control/all-input-control.js +1 -1
  857. package/build-module/components/border-radius-control/index.js +2 -2
  858. package/build-module/components/border-radius-control/index.js.map +1 -1
  859. package/build-module/components/border-radius-control/input-controls.js +1 -1
  860. package/build-module/components/border-radius-control/linked-button.js +1 -1
  861. package/build-module/components/button-block-appender/index.js +1 -1
  862. package/build-module/components/button-block-appender/index.native.js +1 -1
  863. package/build-module/components/caption/index.native.js +1 -1
  864. package/build-module/components/child-layout-control/index.js +2 -2
  865. package/build-module/components/child-layout-control/index.js.map +1 -1
  866. package/build-module/components/color-palette/control.js +1 -1
  867. package/build-module/components/color-palette/with-color-context.js +1 -1
  868. package/build-module/components/color-style-selector/index.js +1 -1
  869. package/build-module/components/colors/with-colors.js +2 -2
  870. package/build-module/components/colors/with-colors.js.map +1 -1
  871. package/build-module/components/colors-gradients/control.js +1 -1
  872. package/build-module/components/colors-gradients/dropdown.js +1 -1
  873. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +1 -1
  874. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +1 -1
  875. package/build-module/components/contrast-checker/index.js +1 -1
  876. package/build-module/components/contrast-checker/index.native.js +1 -1
  877. package/build-module/components/convert-to-group-buttons/index.js +1 -1
  878. package/build-module/components/convert-to-group-buttons/toolbar.js +1 -1
  879. package/build-module/components/copy-handler/index.js +25 -205
  880. package/build-module/components/copy-handler/index.js.map +1 -1
  881. package/build-module/components/date-format-picker/index.js +1 -1
  882. package/build-module/components/default-block-appender/index.js +1 -1
  883. package/build-module/components/default-block-appender/index.native.js +1 -1
  884. package/build-module/components/default-style-picker/index.js +1 -1
  885. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +1 -1
  886. package/build-module/components/dimensions-tool/index.js +2 -2
  887. package/build-module/components/dimensions-tool/index.js.map +1 -1
  888. package/build-module/components/dimensions-tool/scale-tool.js +2 -2
  889. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
  890. package/build-module/components/dimensions-tool/width-height-tool.js +3 -3
  891. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -1
  892. package/build-module/components/duotone-control/index.js +10 -2
  893. package/build-module/components/duotone-control/index.js.map +1 -1
  894. package/build-module/components/editable-text/index.js +1 -1
  895. package/build-module/components/editor-styles/index.js +1 -1
  896. package/build-module/components/floating-toolbar/index.native.js +1 -1
  897. package/build-module/components/floating-toolbar/nav-up-icon.js +1 -1
  898. package/build-module/components/font-appearance-control/index.js +2 -2
  899. package/build-module/components/font-appearance-control/index.js.map +1 -1
  900. package/build-module/components/font-family/index.js +1 -1
  901. package/build-module/components/font-sizes/font-size-picker.js +1 -1
  902. package/build-module/components/font-sizes/with-font-sizes.js +1 -1
  903. package/build-module/components/global-styles/advanced-panel.js +1 -1
  904. package/build-module/components/global-styles/border-panel.js +1 -1
  905. package/build-module/components/global-styles/color-panel.js +1 -1
  906. package/build-module/components/global-styles/color-panel.native.js +1 -1
  907. package/build-module/components/global-styles/dimensions-panel.js +1 -1
  908. package/build-module/components/global-styles/effects-panel.js +1 -1
  909. package/build-module/components/global-styles/filters-panel.js +1 -1
  910. package/build-module/components/global-styles/hooks.js +1 -1
  911. package/build-module/components/global-styles/hooks.js.map +1 -1
  912. package/build-module/components/global-styles/image-settings-panel.js +1 -1
  913. package/build-module/components/global-styles/typography-panel.js +1 -1
  914. package/build-module/components/global-styles/use-global-styles-output.js +17 -6
  915. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  916. package/build-module/components/global-styles/utils.js +21 -0
  917. package/build-module/components/global-styles/utils.js.map +1 -1
  918. package/build-module/components/gradients/with-gradient.js +1 -1
  919. package/build-module/components/height-control/index.js +2 -2
  920. package/build-module/components/height-control/index.js.map +1 -1
  921. package/build-module/components/iframe/index.js +1 -1
  922. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -1
  923. package/build-module/components/image-editor/context.js +1 -1
  924. package/build-module/components/image-editor/cropper.js +1 -1
  925. package/build-module/components/image-editor/form-controls.js +1 -1
  926. package/build-module/components/image-editor/index.js +1 -1
  927. package/build-module/components/image-editor/rotation-button.js +1 -1
  928. package/build-module/components/image-editor/zoom-dropdown.js +1 -1
  929. package/build-module/components/image-size-control/index.js +1 -1
  930. package/build-module/components/index.js +1 -1
  931. package/build-module/components/index.js.map +1 -1
  932. package/build-module/components/inner-blocks/button-block-appender.js +1 -1
  933. package/build-module/components/inner-blocks/constants.native.js +6 -0
  934. package/build-module/components/inner-blocks/constants.native.js.map +1 -0
  935. package/build-module/components/inner-blocks/default-block-appender.js +1 -1
  936. package/build-module/components/inner-blocks/index.js +1 -1
  937. package/build-module/components/inner-blocks/index.native.js +13 -1
  938. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  939. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js +86 -0
  940. package/build-module/components/inner-blocks/warning-max-depth-exceeded.native.js.map +1 -0
  941. package/build-module/components/inner-blocks/with-client-id.js +1 -1
  942. package/build-module/components/inserter/block-patterns-explorer/explorer.js +1 -1
  943. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +1 -1
  944. package/build-module/components/inserter/block-patterns-explorer/sidebar.js +1 -1
  945. package/build-module/components/inserter/block-patterns-filter.js +14 -13
  946. package/build-module/components/inserter/block-patterns-filter.js.map +1 -1
  947. package/build-module/components/inserter/block-patterns-tab.js +2 -2
  948. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  949. package/build-module/components/inserter/block-types-tab.js +1 -1
  950. package/build-module/components/inserter/block-types-tab.native.js +1 -1
  951. package/build-module/components/inserter/index.js +3 -3
  952. package/build-module/components/inserter/index.js.map +1 -1
  953. package/build-module/components/inserter/index.native.js +3 -3
  954. package/build-module/components/inserter/index.native.js.map +1 -1
  955. package/build-module/components/inserter/library.js +1 -1
  956. package/build-module/components/inserter/media-tab/hooks.js +5 -34
  957. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  958. package/build-module/components/inserter/media-tab/media-list.js +1 -1
  959. package/build-module/components/inserter/media-tab/media-panel.js +1 -1
  960. package/build-module/components/inserter/media-tab/media-preview.js +1 -1
  961. package/build-module/components/inserter/media-tab/media-tab.js +1 -1
  962. package/build-module/components/inserter/media-tab/utils.js +1 -1
  963. package/build-module/components/inserter/menu.js +1 -1
  964. package/build-module/components/inserter/menu.native.js +1 -1
  965. package/build-module/components/inserter/mobile-tab-navigation.js +1 -1
  966. package/build-module/components/inserter/no-results.js +1 -1
  967. package/build-module/components/inserter/no-results.native.js +1 -1
  968. package/build-module/components/inserter/panel.js +1 -1
  969. package/build-module/components/inserter/preview-panel.js +1 -1
  970. package/build-module/components/inserter/quick-inserter.js +1 -1
  971. package/build-module/components/inserter/reusable-block-rename-hint.js +1 -1
  972. package/build-module/components/inserter/reusable-blocks-tab.native.js +1 -1
  973. package/build-module/components/inserter/search-results.js +1 -1
  974. package/build-module/components/inserter/search-results.native.js +1 -1
  975. package/build-module/components/inserter/tabs.js +1 -1
  976. package/build-module/components/inserter/tabs.native.js +1 -1
  977. package/build-module/components/inserter/tips.js +1 -1
  978. package/build-module/components/inserter-draggable-blocks/index.js +1 -1
  979. package/build-module/components/inserter-list-item/index.js +1 -1
  980. package/build-module/components/inserter-listbox/group.js +1 -1
  981. package/build-module/components/inserter-listbox/index.js +1 -1
  982. package/build-module/components/inserter-listbox/item.js +1 -1
  983. package/build-module/components/inserter-listbox/row.js +1 -1
  984. package/build-module/components/inspector-controls/block-support-slot-container.js +1 -1
  985. package/build-module/components/inspector-controls/block-support-tools-panel.js +1 -1
  986. package/build-module/components/inspector-controls/fill.js +1 -1
  987. package/build-module/components/inspector-controls/fill.native.js +1 -1
  988. package/build-module/components/inspector-controls/index.js +1 -1
  989. package/build-module/components/inspector-controls/slot.js +1 -1
  990. package/build-module/components/inspector-controls/slot.native.js +1 -1
  991. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  992. package/build-module/components/inspector-controls-tabs/index.js +1 -1
  993. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -1
  994. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +1 -1
  995. package/build-module/components/inspector-controls-tabs/settings-tab.js +1 -1
  996. package/build-module/components/inspector-controls-tabs/styles-tab.js +1 -1
  997. package/build-module/components/inspector-popover-header/index.js +1 -1
  998. package/build-module/components/justify-content-control/index.js +1 -1
  999. package/build-module/components/justify-content-control/ui.js +1 -1
  1000. package/build-module/components/letter-spacing-control/index.js +2 -2
  1001. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  1002. package/build-module/components/line-height-control/index.js +1 -1
  1003. package/build-module/components/line-height-control/index.native.js +1 -1
  1004. package/build-module/components/link-control/index.js +1 -1
  1005. package/build-module/components/link-control/link-preview.js +1 -1
  1006. package/build-module/components/link-control/search-create-button.js +1 -1
  1007. package/build-module/components/link-control/search-input.js +1 -1
  1008. package/build-module/components/link-control/search-item.js +38 -3
  1009. package/build-module/components/link-control/search-item.js.map +1 -1
  1010. package/build-module/components/link-control/search-results.js +1 -1
  1011. package/build-module/components/link-control/settings-drawer.js +1 -1
  1012. package/build-module/components/link-control/settings.js +1 -1
  1013. package/build-module/components/list-view/appender.js +1 -1
  1014. package/build-module/components/list-view/aria-referenced-text.js +1 -1
  1015. package/build-module/components/list-view/block-contents.js +1 -1
  1016. package/build-module/components/list-view/block-select-button.js +1 -1
  1017. package/build-module/components/list-view/block.js +4 -35
  1018. package/build-module/components/list-view/block.js.map +1 -1
  1019. package/build-module/components/list-view/branch.js +9 -2
  1020. package/build-module/components/list-view/branch.js.map +1 -1
  1021. package/build-module/components/list-view/drop-indicator.js +1 -1
  1022. package/build-module/components/list-view/expander.js +1 -1
  1023. package/build-module/components/list-view/index.js +9 -4
  1024. package/build-module/components/list-view/index.js.map +1 -1
  1025. package/build-module/components/list-view/leaf.js +1 -1
  1026. package/build-module/components/list-view/utils.js +34 -0
  1027. package/build-module/components/list-view/utils.js.map +1 -1
  1028. package/build-module/components/media-placeholder/index.js +1 -1
  1029. package/build-module/components/media-placeholder/index.native.js +1 -1
  1030. package/build-module/components/media-replace-flow/index.js +1 -1
  1031. package/build-module/components/media-replace-flow/index.native.js +1 -1
  1032. package/build-module/components/media-upload/{constants.js → constants.native.js} +1 -2
  1033. package/build-module/components/media-upload/constants.native.js.map +1 -0
  1034. package/build-module/components/media-upload/index.js +1 -1
  1035. package/build-module/components/media-upload/index.js.map +1 -1
  1036. package/build-module/components/media-upload/index.native.js +7 -7
  1037. package/build-module/components/media-upload/index.native.js.map +1 -1
  1038. package/build-module/components/media-upload-progress/index.native.js +1 -1
  1039. package/build-module/components/multi-selection-inspector/index.js +1 -1
  1040. package/build-module/components/navigable-toolbar/index.js +1 -1
  1041. package/build-module/components/observe-typing/index.js +1 -1
  1042. package/build-module/components/panel-color-settings/index.js +1 -1
  1043. package/build-module/components/plain-text/index.js +1 -1
  1044. package/build-module/components/plain-text/index.native.js +1 -1
  1045. package/build-module/components/preview-options/index.js +1 -1
  1046. package/build-module/components/provider/block-refs-provider.js +1 -1
  1047. package/build-module/components/provider/index.js +1 -1
  1048. package/build-module/components/provider/index.native.js +1 -1
  1049. package/build-module/components/provider/use-block-sync.js +1 -1
  1050. package/build-module/components/provider/use-block-sync.js.map +1 -1
  1051. package/build-module/components/provider/with-registry-provider.js +1 -1
  1052. package/build-module/components/publish-date-time-picker/index.js +1 -1
  1053. package/build-module/components/recursion-provider/index.js +1 -1
  1054. package/build-module/components/resizable-box-popover/index.js +1 -1
  1055. package/build-module/components/resolution-tool/index.js +1 -1
  1056. package/build-module/components/responsive-block-control/index.js +1 -1
  1057. package/build-module/components/responsive-block-control/label.js +1 -1
  1058. package/build-module/components/rich-text/content.js +1 -1
  1059. package/build-module/components/rich-text/embed-handler-picker.native.js +1 -1
  1060. package/build-module/components/rich-text/format-edit.js +1 -1
  1061. package/build-module/components/rich-text/format-toolbar/index.js +1 -1
  1062. package/build-module/components/rich-text/format-toolbar/index.native.js +1 -1
  1063. package/build-module/components/rich-text/format-toolbar-container.js +1 -1
  1064. package/build-module/components/rich-text/format-toolbar-container.native.js +1 -1
  1065. package/build-module/components/rich-text/get-rich-text-values.js +1 -1
  1066. package/build-module/components/rich-text/index.js +1 -1
  1067. package/build-module/components/rich-text/index.native.js +2 -10
  1068. package/build-module/components/rich-text/index.native.js.map +1 -1
  1069. package/build-module/components/rich-text/multiline.js +1 -1
  1070. package/build-module/components/rich-text/toolbar-button.js +1 -1
  1071. package/build-module/components/rich-text/use-paste-handler.js +7 -89
  1072. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  1073. package/build-module/components/rich-text/utils.js +1 -3
  1074. package/build-module/components/rich-text/utils.js.map +1 -1
  1075. package/build-module/components/skip-to-selected-block/index.js +1 -1
  1076. package/build-module/components/spacing-sizes-control/index.js +1 -1
  1077. package/build-module/components/spacing-sizes-control/input-controls/axial.js +1 -1
  1078. package/build-module/components/spacing-sizes-control/input-controls/separated.js +1 -1
  1079. package/build-module/components/spacing-sizes-control/input-controls/single.js +1 -1
  1080. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  1081. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
  1082. package/build-module/components/text-decoration-control/index.js +2 -2
  1083. package/build-module/components/text-decoration-control/index.js.map +1 -1
  1084. package/build-module/components/text-transform-control/index.js +2 -2
  1085. package/build-module/components/text-transform-control/index.js.map +1 -1
  1086. package/build-module/components/tool-selector/index.js +3 -2
  1087. package/build-module/components/tool-selector/index.js.map +1 -1
  1088. package/build-module/components/typewriter/index.js +2 -2
  1089. package/build-module/components/typewriter/index.js.map +1 -1
  1090. package/build-module/components/ungroup-button/index.native.js +1 -1
  1091. package/build-module/components/unit-control/index.js +1 -1
  1092. package/build-module/components/unsupported-block-details/index.native.js +118 -0
  1093. package/build-module/components/unsupported-block-details/index.native.js.map +1 -0
  1094. package/build-module/components/url-input/button.js +1 -1
  1095. package/build-module/components/url-input/index.js +1 -1
  1096. package/build-module/components/url-input/index.native.js +1 -1
  1097. package/build-module/components/url-popover/image-url-input-ui.js +1 -1
  1098. package/build-module/components/url-popover/index.js +1 -1
  1099. package/build-module/components/url-popover/link-editor.js +1 -1
  1100. package/build-module/components/url-popover/link-viewer-url.js +1 -1
  1101. package/build-module/components/url-popover/link-viewer.js +1 -1
  1102. package/build-module/components/use-on-block-drop/index.js +2 -2
  1103. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  1104. package/build-module/components/use-unsupported-block-editor/index.native.js +51 -0
  1105. package/build-module/components/use-unsupported-block-editor/index.native.js.map +1 -0
  1106. package/build-module/components/video-player/gridicon-play.native.js +1 -1
  1107. package/build-module/components/video-player/index.native.js +1 -1
  1108. package/build-module/components/warning/index.js +1 -1
  1109. package/build-module/components/warning/index.native.js +1 -1
  1110. package/build-module/components/writing-flow/index.js +5 -4
  1111. package/build-module/components/writing-flow/index.js.map +1 -1
  1112. package/build-module/components/writing-flow/use-clipboard-handler.js +172 -0
  1113. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -0
  1114. package/build-module/components/writing-flow/use-tab-nav.js +1 -1
  1115. package/build-module/components/writing-mode-control/index.js +2 -2
  1116. package/build-module/components/writing-mode-control/index.js.map +1 -1
  1117. package/build-module/hooks/align.js +1 -1
  1118. package/build-module/hooks/anchor.js +3 -3
  1119. package/build-module/hooks/anchor.js.map +1 -1
  1120. package/build-module/hooks/background.js +1 -1
  1121. package/build-module/hooks/block-hooks.js +1 -1
  1122. package/build-module/hooks/block-rename-ui.js +6 -3
  1123. package/build-module/hooks/block-rename-ui.js.map +1 -1
  1124. package/build-module/hooks/border.js +1 -1
  1125. package/build-module/hooks/color.js +1 -1
  1126. package/build-module/hooks/content-lock-ui.js +1 -1
  1127. package/build-module/hooks/contrast-checker.js +1 -1
  1128. package/build-module/hooks/custom-class-name.js +3 -3
  1129. package/build-module/hooks/custom-class-name.js.map +1 -1
  1130. package/build-module/hooks/custom-fields.js +3 -3
  1131. package/build-module/hooks/custom-fields.js.map +1 -1
  1132. package/build-module/hooks/dimensions.js +1 -1
  1133. package/build-module/hooks/duotone.js +1 -1
  1134. package/build-module/hooks/font-size.js +2 -2
  1135. package/build-module/hooks/font-size.js.map +1 -1
  1136. package/build-module/hooks/layout.js +1 -1
  1137. package/build-module/hooks/line-height.js +2 -2
  1138. package/build-module/hooks/line-height.js.map +1 -1
  1139. package/build-module/hooks/margin.js +1 -1
  1140. package/build-module/hooks/padding.js +1 -1
  1141. package/build-module/hooks/position.js +3 -3
  1142. package/build-module/hooks/position.js.map +1 -1
  1143. package/build-module/hooks/style.js +1 -1
  1144. package/build-module/hooks/typography.js +1 -1
  1145. package/build-module/hooks/typography.native.js +1 -1
  1146. package/build-module/layouts/constrained.js +1 -1
  1147. package/build-module/layouts/flex.js +1 -1
  1148. package/build-module/layouts/grid.js +1 -1
  1149. package/build-module/private-apis.js +2 -0
  1150. package/build-module/private-apis.js.map +1 -1
  1151. package/build-module/store/actions.js +8 -12
  1152. package/build-module/store/actions.js.map +1 -1
  1153. package/build-module/store/private-selectors.js +52 -0
  1154. package/build-module/store/private-selectors.js.map +1 -1
  1155. package/build-module/store/reducer.js +18 -1
  1156. package/build-module/store/reducer.js.map +1 -1
  1157. package/build-module/store/selectors.js +1 -1
  1158. package/build-module/store/selectors.js.map +1 -1
  1159. package/build-module/utils/pasting.js +47 -0
  1160. package/build-module/utils/pasting.js.map +1 -1
  1161. package/build-module/utils/transform-styles/transforms/wrap.js +5 -0
  1162. package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
  1163. package/build-module/utils/use-notify-copy.js +46 -0
  1164. package/build-module/utils/use-notify-copy.js.map +1 -0
  1165. package/build-style/content-rtl.css +10 -11
  1166. package/build-style/content.css +10 -11
  1167. package/build-style/default-editor-styles-rtl.css +1 -1
  1168. package/build-style/default-editor-styles.css +1 -1
  1169. package/build-style/style-rtl.css +11 -12
  1170. package/build-style/style.css +11 -12
  1171. package/package.json +31 -32
  1172. package/src/components/block-actions/index.js +1 -1
  1173. package/src/components/block-breadcrumb/index.js +1 -1
  1174. package/src/components/block-canvas/index.js +6 -12
  1175. package/src/components/block-context/README.md +1 -1
  1176. package/src/components/block-heading-level-dropdown/heading-level-icon.js +2 -2
  1177. package/src/components/block-heading-level-dropdown/index.js +2 -2
  1178. package/src/components/block-heading-level-dropdown/index.native.js +2 -2
  1179. package/src/components/block-list/block-list-item.native.js +2 -2
  1180. package/src/components/block-parent-selector/index.js +1 -1
  1181. package/src/components/block-preview/index.js +1 -1
  1182. package/src/components/block-settings-menu/block-html-convert-button.js +28 -19
  1183. package/src/components/block-settings-menu-controls/index.js +1 -1
  1184. package/src/components/block-switcher/index.js +17 -18
  1185. package/src/components/block-switcher/test/__snapshots__/index.js.snap +2 -2
  1186. package/src/components/block-tools/block-selection-button.js +1 -1
  1187. package/src/components/border-radius-control/index.js +1 -1
  1188. package/src/components/child-layout-control/index.js +1 -1
  1189. package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
  1190. package/src/components/colors/with-colors.js +1 -1
  1191. package/src/components/copy-handler/README.md +2 -0
  1192. package/src/components/copy-handler/index.js +21 -291
  1193. package/src/components/dimensions-tool/index.js +1 -1
  1194. package/src/components/dimensions-tool/scale-tool.js +1 -1
  1195. package/src/components/dimensions-tool/width-height-tool.js +1 -1
  1196. package/src/components/duotone-control/index.js +14 -2
  1197. package/src/components/editable-text/README.md +2 -2
  1198. package/src/components/font-appearance-control/index.js +1 -1
  1199. package/src/components/font-family/README.md +1 -1
  1200. package/src/components/global-styles/hooks.js +1 -1
  1201. package/src/components/global-styles/test/use-global-styles-output.js +39 -0
  1202. package/src/components/global-styles/use-global-styles-output.js +26 -6
  1203. package/src/components/global-styles/utils.js +21 -0
  1204. package/src/components/height-control/README.md +1 -1
  1205. package/src/components/height-control/index.js +1 -1
  1206. package/src/components/image-size-control/README.md +2 -2
  1207. package/src/components/index.js +1 -1
  1208. package/src/components/inner-blocks/constants.native.js +5 -0
  1209. package/src/components/inner-blocks/index.native.js +15 -0
  1210. package/src/components/inner-blocks/warning-max-depth-exceeded.native.js +100 -0
  1211. package/src/components/inserter/block-patterns-filter.js +22 -10
  1212. package/src/components/inserter/block-patterns-tab.js +0 -3
  1213. package/src/components/inserter/index.js +2 -2
  1214. package/src/components/inserter/index.native.js +2 -2
  1215. package/src/components/inserter/media-tab/hooks.js +10 -44
  1216. package/src/components/inserter/style.scss +1 -1
  1217. package/src/components/letter-spacing-control/index.js +1 -1
  1218. package/src/components/link-control/search-item.js +55 -2
  1219. package/src/components/list-view/block.js +3 -43
  1220. package/src/components/list-view/branch.js +11 -1
  1221. package/src/components/list-view/index.js +8 -4
  1222. package/src/components/list-view/utils.js +37 -0
  1223. package/src/components/media-placeholder/README.md +3 -3
  1224. package/src/components/media-upload/{constants.js → constants.native.js} +0 -1
  1225. package/src/components/media-upload/index.js +1 -1
  1226. package/src/components/media-upload/index.native.js +9 -5
  1227. package/src/components/panel-color-settings/README.md +5 -1
  1228. package/src/components/plain-text/README.md +1 -1
  1229. package/src/components/provider/README.md +1 -1
  1230. package/src/components/provider/use-block-sync.js +1 -1
  1231. package/src/components/publish-date-time-picker/README.md +1 -1
  1232. package/src/components/responsive-block-control/README.md +1 -3
  1233. package/src/components/rich-text/README.md +3 -3
  1234. package/src/components/rich-text/index.native.js +0 -13
  1235. package/src/components/rich-text/use-paste-handler.js +5 -99
  1236. package/src/components/rich-text/utils.js +0 -3
  1237. package/src/components/text-decoration-control/index.js +1 -1
  1238. package/src/components/text-transform-control/index.js +1 -1
  1239. package/src/components/tool-selector/index.js +1 -1
  1240. package/src/components/typewriter/index.js +1 -1
  1241. package/src/components/unit-control/README.md +1 -1
  1242. package/src/components/unsupported-block-details/index.native.js +183 -0
  1243. package/src/components/unsupported-block-details/style.native.scss +56 -0
  1244. package/src/components/url-input/README.md +4 -4
  1245. package/src/components/use-on-block-drop/index.js +2 -2
  1246. package/src/components/use-unsupported-block-editor/index.native.js +59 -0
  1247. package/src/components/writing-flow/index.js +4 -2
  1248. package/src/components/writing-flow/use-clipboard-handler.js +242 -0
  1249. package/src/components/writing-mode-control/index.js +1 -1
  1250. package/src/hooks/anchor.js +2 -2
  1251. package/src/hooks/block-rename-ui.js +14 -10
  1252. package/src/hooks/custom-class-name.js +2 -2
  1253. package/src/hooks/custom-fields.js +2 -2
  1254. package/src/hooks/font-size.js +1 -1
  1255. package/src/hooks/line-height.js +1 -1
  1256. package/src/hooks/position.js +2 -2
  1257. package/src/private-apis.js +2 -0
  1258. package/src/store/actions.js +7 -11
  1259. package/src/store/private-selectors.js +72 -0
  1260. package/src/store/reducer.js +17 -0
  1261. package/src/store/selectors.js +1 -1
  1262. package/src/store/test/actions.js +10 -16
  1263. package/src/utils/pasting.js +51 -0
  1264. package/src/utils/transform-styles/transforms/test/__snapshots__/wrap.js.snap +13 -6
  1265. package/src/utils/transform-styles/transforms/test/wrap.js +9 -0
  1266. package/src/utils/transform-styles/transforms/wrap.js +5 -0
  1267. package/src/utils/use-notify-copy.js +63 -0
  1268. package/tsconfig.tsbuildinfo +1 -1
  1269. package/build/components/block-settings-menu/block-convert-button.js +0 -27
  1270. package/build/components/block-settings-menu/block-convert-button.js.map +0 -1
  1271. package/build/components/media-upload/constants.js.map +0 -1
  1272. package/build-module/components/block-settings-menu/block-convert-button.js +0 -20
  1273. package/build-module/components/block-settings-menu/block-convert-button.js.map +0 -1
  1274. package/build-module/components/media-upload/constants.js.map +0 -1
  1275. package/src/components/block-settings-menu/block-convert-button.js +0 -14
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
@@ -11,10 +11,9 @@ import { hasBlockSupport } from '@wordpress/blocks';
11
11
  import { __experimentalTreeGridCell as TreeGridCell, __experimentalTreeGridItem as TreeGridItem } from '@wordpress/components';
12
12
  import { useInstanceId } from '@wordpress/compose';
13
13
  import { moreVertical } from '@wordpress/icons';
14
- import { useState, useRef, useEffect, useCallback, memo } from '@wordpress/element';
14
+ import { useState, useRef, useCallback, memo } from '@wordpress/element';
15
15
  import { useDispatch, useSelect } from '@wordpress/data';
16
16
  import { sprintf, __ } from '@wordpress/i18n';
17
- import { focus } from '@wordpress/dom';
18
17
  import { ESCAPE } from '@wordpress/keycodes';
19
18
 
20
19
  /**
@@ -25,7 +24,7 @@ import useListViewScrollIntoView from './use-list-view-scroll-into-view';
25
24
  import { BlockMoverUpButton, BlockMoverDownButton } from '../block-mover/button';
26
25
  import ListViewBlockContents from './block-contents';
27
26
  import { useListViewContext } from './context';
28
- import { getBlockPositionDescription } from './utils';
27
+ import { getBlockPositionDescription, focusListItem } from './utils';
29
28
  import { store as blockEditorStore } from '../../store';
30
29
  import useBlockDisplayInformation from '../use-block-display-information';
31
30
  import { useBlockLock } from '../block-lock';
@@ -82,7 +81,6 @@ function ListViewBlock({
82
81
  // translators: %s: The title of the block.
83
82
  __('Options for %s'), blockTitle);
84
83
  const {
85
- isTreeGridMounted,
86
84
  expand,
87
85
  collapse,
88
86
  BlockSettingsMenu,
@@ -100,15 +98,6 @@ function ListViewBlock({
100
98
  'is-visible': isHovered || isFirstSelectedBlock
101
99
  });
102
100
 
103
- // If ListView has experimental features related to the Persistent List View,
104
- // only focus the selected list item on mount; otherwise the list would always
105
- // try to steal the focus from the editor canvas.
106
- useEffect(() => {
107
- if (!isTreeGridMounted && isSelected) {
108
- cellRef.current.focus();
109
- }
110
- }, []);
111
-
112
101
  // If multiple blocks are selected, deselect all blocks when the user
113
102
  // presses the escape key.
114
103
  const onKeyDown = event => {
@@ -134,27 +123,7 @@ function ListViewBlock({
134
123
  if (shouldSelectBlock) {
135
124
  selectBlock(undefined, focusClientId, null, null);
136
125
  }
137
- const getFocusElement = () => {
138
- const row = treeGridElementRef.current?.querySelector(`[role=row][data-block="${focusClientId}"]`);
139
- if (!row) return null;
140
- // Focus the first focusable in the row, which is the ListViewBlockSelectButton.
141
- return focus.focusable.find(row)[0];
142
- };
143
- let focusElement = getFocusElement();
144
- if (focusElement) {
145
- focusElement.focus();
146
- } else {
147
- // The element hasn't been painted yet. Defer focusing on the next frame.
148
- // This could happen when all blocks have been deleted and the default block
149
- // hasn't been added to the editor yet.
150
- window.requestAnimationFrame(() => {
151
- focusElement = getFocusElement();
152
- // Ignore if the element still doesn't exist.
153
- if (focusElement) {
154
- focusElement.focus();
155
- }
156
- });
157
- }
126
+ focusListItem(focusClientId, treeGridElementRef);
158
127
  }, [selectBlock, treeGridElementRef]);
159
128
  const toggleExpanded = useCallback(event => {
160
129
  // Prevent shift+click from opening link in a new window when toggling.
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","hasBlockSupport","__experimentalTreeGridCell","TreeGridCell","__experimentalTreeGridItem","TreeGridItem","useInstanceId","moreVertical","useState","useRef","useEffect","useCallback","memo","useDispatch","useSelect","sprintf","__","focus","ESCAPE","ListViewLeaf","useListViewScrollIntoView","BlockMoverUpButton","BlockMoverDownButton","ListViewBlockContents","useListViewContext","getBlockPositionDescription","store","blockEditorStore","useBlockDisplayInformation","useBlockLock","AriaReferencedText","ListViewBlock","block","clientId","isDragged","isSelected","isBranchSelected","selectBlock","position","level","rowCount","siblingBlockCount","showBlockMovers","path","isExpanded","selectedClientIds","isSyncedBranch","cellRef","rowRef","isHovered","setIsHovered","isLocked","canEdit","isFirstSelectedBlock","isLastSelectedBlock","length","toggleBlockHighlight","blockInformation","blockTitle","name","title","select","getBlock","blockName","getBlockName","blockEditingMode","getBlockEditingMode","showBlockActions","instanceId","descriptionId","blockPositionDescription","blockAriaLabel","settingsAriaLabel","isTreeGridMounted","expand","collapse","BlockSettingsMenu","listViewInstanceId","expandedState","setInsertedBlock","treeGridElementRef","hasSiblings","hasRenderedMovers","moverCellClassName","listViewBlockSettingsClassName","current","onKeyDown","event","keyCode","defaultPrevented","stopPropagation","preventDefault","undefined","onMouseEnter","onMouseLeave","selectEditorBlock","updateFocusAndSelection","focusClientId","shouldSelectBlock","getFocusElement","row","querySelector","focusable","find","focusElement","window","requestAnimationFrame","toggleExpanded","colSpan","classes","isSynced","dropdownClientIds","includes","rowItemRef","currentlyEditingBlockInCanvas","createElement","className","onFocus","onBlur","id","ref","tabIndex","onClick","onToggleExpanded","ariaLabel","ariaDescribedBy","Fragment","withoutGridItem","orientation","clientIds","icon","label","toggleProps","disableOpenOnArrowDown","__experimentalSelectBlock"],"sources":["@wordpress/block-editor/src/components/list-view/block.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport {\n\t__experimentalTreeGridCell as TreeGridCell,\n\t__experimentalTreeGridItem as TreeGridItem,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { moreVertical } from '@wordpress/icons';\nimport {\n\tuseState,\n\tuseRef,\n\tuseEffect,\n\tuseCallback,\n\tmemo,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { focus } from '@wordpress/dom';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport ListViewLeaf from './leaf';\nimport useListViewScrollIntoView from './use-list-view-scroll-into-view';\nimport {\n\tBlockMoverUpButton,\n\tBlockMoverDownButton,\n} from '../block-mover/button';\nimport ListViewBlockContents from './block-contents';\nimport { useListViewContext } from './context';\nimport { getBlockPositionDescription } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { useBlockLock } from '../block-lock';\nimport AriaReferencedText from './aria-referenced-text';\n\nfunction ListViewBlock( {\n\tblock: { clientId },\n\tisDragged,\n\tisSelected,\n\tisBranchSelected,\n\tselectBlock,\n\tposition,\n\tlevel,\n\trowCount,\n\tsiblingBlockCount,\n\tshowBlockMovers,\n\tpath,\n\tisExpanded,\n\tselectedClientIds,\n\tisSyncedBranch,\n} ) {\n\tconst cellRef = useRef( null );\n\tconst rowRef = useRef( null );\n\tconst [ isHovered, setIsHovered ] = useState( false );\n\n\tconst { isLocked, canEdit } = useBlockLock( clientId );\n\n\tconst isFirstSelectedBlock =\n\t\tisSelected && selectedClientIds[ 0 ] === clientId;\n\tconst isLastSelectedBlock =\n\t\tisSelected &&\n\t\tselectedClientIds[ selectedClientIds.length - 1 ] === clientId;\n\n\tconst { toggleBlockHighlight } = useDispatch( blockEditorStore );\n\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst blockTitle =\n\t\tblockInformation?.name || blockInformation?.title || __( 'Untitled' );\n\n\tconst block = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\tconst blockName = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockName( clientId ),\n\t\t[ clientId ]\n\t);\n\tconst blockEditingMode = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlockEditingMode( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tconst showBlockActions =\n\t\t// When a block hides its toolbar it also hides the block settings menu,\n\t\t// since that menu is part of the toolbar in the editor canvas.\n\t\t// List View respects this by also hiding the block settings menu.\n\t\thasBlockSupport( blockName, '__experimentalToolbar', true ) &&\n\t\t// Don't show the settings menu if block is disabled or content only.\n\t\tblockEditingMode === 'default';\n\tconst instanceId = useInstanceId( ListViewBlock );\n\tconst descriptionId = `list-view-block-select-button__${ instanceId }`;\n\tconst blockPositionDescription = getBlockPositionDescription(\n\t\tposition,\n\t\tsiblingBlockCount,\n\t\tlevel\n\t);\n\n\tconst blockAriaLabel = isLocked\n\t\t? sprintf(\n\t\t\t\t// translators: %s: The title of the block. This string indicates a link to select the locked block.\n\t\t\t\t__( '%s (locked)' ),\n\t\t\t\tblockTitle\n\t\t )\n\t\t: blockTitle;\n\n\tconst settingsAriaLabel = sprintf(\n\t\t// translators: %s: The title of the block.\n\t\t__( 'Options for %s' ),\n\t\tblockTitle\n\t);\n\n\tconst {\n\t\tisTreeGridMounted,\n\t\texpand,\n\t\tcollapse,\n\t\tBlockSettingsMenu,\n\t\tlistViewInstanceId,\n\t\texpandedState,\n\t\tsetInsertedBlock,\n\t\ttreeGridElementRef,\n\t} = useListViewContext();\n\n\tconst hasSiblings = siblingBlockCount > 0;\n\tconst hasRenderedMovers = showBlockMovers && hasSiblings;\n\tconst moverCellClassName = classnames(\n\t\t'block-editor-list-view-block__mover-cell',\n\t\t{ 'is-visible': isHovered || isSelected }\n\t);\n\n\tconst listViewBlockSettingsClassName = classnames(\n\t\t'block-editor-list-view-block__menu-cell',\n\t\t{ 'is-visible': isHovered || isFirstSelectedBlock }\n\t);\n\n\t// If ListView has experimental features related to the Persistent List View,\n\t// only focus the selected list item on mount; otherwise the list would always\n\t// try to steal the focus from the editor canvas.\n\tuseEffect( () => {\n\t\tif ( ! isTreeGridMounted && isSelected ) {\n\t\t\tcellRef.current.focus();\n\t\t}\n\t}, [] );\n\n\t// If multiple blocks are selected, deselect all blocks when the user\n\t// presses the escape key.\n\tconst onKeyDown = ( event ) => {\n\t\tif (\n\t\t\tevent.keyCode === ESCAPE &&\n\t\t\t! event.defaultPrevented &&\n\t\t\tselectedClientIds.length > 0\n\t\t) {\n\t\t\tevent.stopPropagation();\n\t\t\tevent.preventDefault();\n\t\t\tselectBlock( event, undefined );\n\t\t}\n\t};\n\n\tconst onMouseEnter = useCallback( () => {\n\t\tsetIsHovered( true );\n\t\ttoggleBlockHighlight( clientId, true );\n\t}, [ clientId, setIsHovered, toggleBlockHighlight ] );\n\tconst onMouseLeave = useCallback( () => {\n\t\tsetIsHovered( false );\n\t\ttoggleBlockHighlight( clientId, false );\n\t}, [ clientId, setIsHovered, toggleBlockHighlight ] );\n\n\tconst selectEditorBlock = useCallback(\n\t\t( event ) => {\n\t\t\tselectBlock( event, clientId );\n\t\t\tevent.preventDefault();\n\t\t},\n\t\t[ clientId, selectBlock ]\n\t);\n\n\tconst updateFocusAndSelection = useCallback(\n\t\t( focusClientId, shouldSelectBlock ) => {\n\t\t\tif ( shouldSelectBlock ) {\n\t\t\t\tselectBlock( undefined, focusClientId, null, null );\n\t\t\t}\n\n\t\t\tconst getFocusElement = () => {\n\t\t\t\tconst row = treeGridElementRef.current?.querySelector(\n\t\t\t\t\t`[role=row][data-block=\"${ focusClientId }\"]`\n\t\t\t\t);\n\t\t\t\tif ( ! row ) return null;\n\t\t\t\t// Focus the first focusable in the row, which is the ListViewBlockSelectButton.\n\t\t\t\treturn focus.focusable.find( row )[ 0 ];\n\t\t\t};\n\n\t\t\tlet focusElement = getFocusElement();\n\t\t\tif ( focusElement ) {\n\t\t\t\tfocusElement.focus();\n\t\t\t} else {\n\t\t\t\t// The element hasn't been painted yet. Defer focusing on the next frame.\n\t\t\t\t// This could happen when all blocks have been deleted and the default block\n\t\t\t\t// hasn't been added to the editor yet.\n\t\t\t\twindow.requestAnimationFrame( () => {\n\t\t\t\t\tfocusElement = getFocusElement();\n\t\t\t\t\t// Ignore if the element still doesn't exist.\n\t\t\t\t\tif ( focusElement ) {\n\t\t\t\t\t\tfocusElement.focus();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ selectBlock, treeGridElementRef ]\n\t);\n\n\tconst toggleExpanded = useCallback(\n\t\t( event ) => {\n\t\t\t// Prevent shift+click from opening link in a new window when toggling.\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tif ( isExpanded === true ) {\n\t\t\t\tcollapse( clientId );\n\t\t\t} else if ( isExpanded === false ) {\n\t\t\t\texpand( clientId );\n\t\t\t}\n\t\t},\n\t\t[ clientId, expand, collapse, isExpanded ]\n\t);\n\n\tlet colSpan;\n\tif ( hasRenderedMovers ) {\n\t\tcolSpan = 2;\n\t} else if ( ! showBlockActions ) {\n\t\tcolSpan = 3;\n\t}\n\n\tconst classes = classnames( {\n\t\t'is-selected': isSelected,\n\t\t'is-first-selected': isFirstSelectedBlock,\n\t\t'is-last-selected': isLastSelectedBlock,\n\t\t'is-branch-selected': isBranchSelected,\n\t\t'is-synced-branch': isSyncedBranch,\n\t\t'is-dragging': isDragged,\n\t\t'has-single-cell': ! showBlockActions,\n\t\t'is-synced': blockInformation?.isSynced,\n\t} );\n\n\t// Only include all selected blocks if the currently clicked on block\n\t// is one of the selected blocks. This ensures that if a user attempts\n\t// to alter a block that isn't part of the selection, they're still able\n\t// to do so.\n\tconst dropdownClientIds = selectedClientIds.includes( clientId )\n\t\t? selectedClientIds\n\t\t: [ clientId ];\n\n\t// Pass in a ref to the row, so that it can be scrolled\n\t// into view when selected. For long lists, the placeholder for the\n\t// selected block is also observed, within ListViewLeafPlaceholder.\n\tuseListViewScrollIntoView( {\n\t\tisSelected,\n\t\trowItemRef: rowRef,\n\t\tselectedClientIds,\n\t} );\n\n\t// Detect if there is a block in the canvas currently being edited and multi-selection is not happening.\n\tconst currentlyEditingBlockInCanvas =\n\t\tisSelected && selectedClientIds.length === 1;\n\n\treturn (\n\t\t<ListViewLeaf\n\t\t\tclassName={ classes }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t\tonMouseEnter={ onMouseEnter }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\tonFocus={ onMouseEnter }\n\t\t\tonBlur={ onMouseLeave }\n\t\t\tlevel={ level }\n\t\t\tposition={ position }\n\t\t\trowCount={ rowCount }\n\t\t\tpath={ path }\n\t\t\tid={ `list-view-${ listViewInstanceId }-block-${ clientId }` }\n\t\t\tdata-block={ clientId }\n\t\t\tdata-expanded={ canEdit ? isExpanded : undefined }\n\t\t\tref={ rowRef }\n\t\t>\n\t\t\t<TreeGridCell\n\t\t\t\tclassName=\"block-editor-list-view-block__contents-cell\"\n\t\t\t\tcolSpan={ colSpan }\n\t\t\t\tref={ cellRef }\n\t\t\t\taria-selected={ !! isSelected }\n\t\t\t>\n\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t<div className=\"block-editor-list-view-block__contents-container\">\n\t\t\t\t\t\t<ListViewBlockContents\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\tonClick={ selectEditorBlock }\n\t\t\t\t\t\t\tonToggleExpanded={ toggleExpanded }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\tsiblingBlockCount={ siblingBlockCount }\n\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\ttabIndex={\n\t\t\t\t\t\t\t\tcurrentlyEditingBlockInCanvas ? 0 : tabIndex\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tisExpanded={ canEdit ? isExpanded : undefined }\n\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\tariaLabel={ blockAriaLabel }\n\t\t\t\t\t\t\tariaDescribedBy={ descriptionId }\n\t\t\t\t\t\t\tupdateFocusAndSelection={ updateFocusAndSelection }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<AriaReferencedText id={ descriptionId }>\n\t\t\t\t\t\t\t{ blockPositionDescription }\n\t\t\t\t\t\t</AriaReferencedText>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TreeGridCell>\n\t\t\t{ hasRenderedMovers && (\n\t\t\t\t<>\n\t\t\t\t\t<TreeGridCell\n\t\t\t\t\t\tclassName={ moverCellClassName }\n\t\t\t\t\t\twithoutGridItem\n\t\t\t\t\t>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverUpButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverDownButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t</TreeGridCell>\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t{ showBlockActions && BlockSettingsMenu && (\n\t\t\t\t<TreeGridCell\n\t\t\t\t\tclassName={ listViewBlockSettingsClassName }\n\t\t\t\t\taria-selected={ !! isSelected }\n\t\t\t\t>\n\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t<BlockSettingsMenu\n\t\t\t\t\t\t\tclientIds={ dropdownClientIds }\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ settingsAriaLabel }\n\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\tref,\n\t\t\t\t\t\t\t\tclassName: 'block-editor-list-view-block__menu',\n\t\t\t\t\t\t\t\ttabIndex,\n\t\t\t\t\t\t\t\tonFocus,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tdisableOpenOnArrowDown\n\t\t\t\t\t\t\texpand={ expand }\n\t\t\t\t\t\t\texpandedState={ expandedState }\n\t\t\t\t\t\t\tsetInsertedBlock={ setInsertedBlock }\n\t\t\t\t\t\t\t__experimentalSelectBlock={\n\t\t\t\t\t\t\t\tupdateFocusAndSelection\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</TreeGridCell>\n\t\t\t) }\n\t\t</ListViewLeaf>\n\t);\n}\n\nexport default memo( ListViewBlock );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SACCC,0BAA0B,IAAIC,YAAY,EAC1CC,0BAA0B,IAAIC,YAAY,QACpC,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACCC,QAAQ,EACRC,MAAM,EACNC,SAAS,EACTC,WAAW,EACXC,IAAI,QACE,oBAAoB;AAC3B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,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EmB,aAAc,CAAC"}
1
+ {"version":3,"names":["classnames","hasBlockSupport","__experimentalTreeGridCell","TreeGridCell","__experimentalTreeGridItem","TreeGridItem","useInstanceId","moreVertical","useState","useRef","useCallback","memo","useDispatch","useSelect","sprintf","__","ESCAPE","ListViewLeaf","useListViewScrollIntoView","BlockMoverUpButton","BlockMoverDownButton","ListViewBlockContents","useListViewContext","getBlockPositionDescription","focusListItem","store","blockEditorStore","useBlockDisplayInformation","useBlockLock","AriaReferencedText","ListViewBlock","block","clientId","isDragged","isSelected","isBranchSelected","selectBlock","position","level","rowCount","siblingBlockCount","showBlockMovers","path","isExpanded","selectedClientIds","isSyncedBranch","cellRef","rowRef","isHovered","setIsHovered","isLocked","canEdit","isFirstSelectedBlock","isLastSelectedBlock","length","toggleBlockHighlight","blockInformation","blockTitle","name","title","select","getBlock","blockName","getBlockName","blockEditingMode","getBlockEditingMode","showBlockActions","instanceId","descriptionId","blockPositionDescription","blockAriaLabel","settingsAriaLabel","expand","collapse","BlockSettingsMenu","listViewInstanceId","expandedState","setInsertedBlock","treeGridElementRef","hasSiblings","hasRenderedMovers","moverCellClassName","listViewBlockSettingsClassName","onKeyDown","event","keyCode","defaultPrevented","stopPropagation","preventDefault","undefined","onMouseEnter","onMouseLeave","selectEditorBlock","updateFocusAndSelection","focusClientId","shouldSelectBlock","toggleExpanded","colSpan","classes","isSynced","dropdownClientIds","includes","rowItemRef","currentlyEditingBlockInCanvas","createElement","className","onFocus","onBlur","id","ref","tabIndex","onClick","onToggleExpanded","ariaLabel","ariaDescribedBy","Fragment","withoutGridItem","orientation","clientIds","icon","label","toggleProps","disableOpenOnArrowDown","__experimentalSelectBlock"],"sources":["@wordpress/block-editor/src/components/list-view/block.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport {\n\t__experimentalTreeGridCell as TreeGridCell,\n\t__experimentalTreeGridItem as TreeGridItem,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { moreVertical } from '@wordpress/icons';\nimport { useState, useRef, useCallback, memo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport ListViewLeaf from './leaf';\nimport useListViewScrollIntoView from './use-list-view-scroll-into-view';\nimport {\n\tBlockMoverUpButton,\n\tBlockMoverDownButton,\n} from '../block-mover/button';\nimport ListViewBlockContents from './block-contents';\nimport { useListViewContext } from './context';\nimport { getBlockPositionDescription, focusListItem } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { useBlockLock } from '../block-lock';\nimport AriaReferencedText from './aria-referenced-text';\n\nfunction ListViewBlock( {\n\tblock: { clientId },\n\tisDragged,\n\tisSelected,\n\tisBranchSelected,\n\tselectBlock,\n\tposition,\n\tlevel,\n\trowCount,\n\tsiblingBlockCount,\n\tshowBlockMovers,\n\tpath,\n\tisExpanded,\n\tselectedClientIds,\n\tisSyncedBranch,\n} ) {\n\tconst cellRef = useRef( null );\n\tconst rowRef = useRef( null );\n\tconst [ isHovered, setIsHovered ] = useState( false );\n\n\tconst { isLocked, canEdit } = useBlockLock( clientId );\n\n\tconst isFirstSelectedBlock =\n\t\tisSelected && selectedClientIds[ 0 ] === clientId;\n\tconst isLastSelectedBlock =\n\t\tisSelected &&\n\t\tselectedClientIds[ selectedClientIds.length - 1 ] === clientId;\n\n\tconst { toggleBlockHighlight } = useDispatch( blockEditorStore );\n\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst blockTitle =\n\t\tblockInformation?.name || blockInformation?.title || __( 'Untitled' );\n\n\tconst block = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\tconst blockName = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockName( clientId ),\n\t\t[ clientId ]\n\t);\n\tconst blockEditingMode = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getBlockEditingMode( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tconst showBlockActions =\n\t\t// When a block hides its toolbar it also hides the block settings menu,\n\t\t// since that menu is part of the toolbar in the editor canvas.\n\t\t// List View respects this by also hiding the block settings menu.\n\t\thasBlockSupport( blockName, '__experimentalToolbar', true ) &&\n\t\t// Don't show the settings menu if block is disabled or content only.\n\t\tblockEditingMode === 'default';\n\tconst instanceId = useInstanceId( ListViewBlock );\n\tconst descriptionId = `list-view-block-select-button__${ instanceId }`;\n\tconst blockPositionDescription = getBlockPositionDescription(\n\t\tposition,\n\t\tsiblingBlockCount,\n\t\tlevel\n\t);\n\n\tconst blockAriaLabel = isLocked\n\t\t? sprintf(\n\t\t\t\t// translators: %s: The title of the block. This string indicates a link to select the locked block.\n\t\t\t\t__( '%s (locked)' ),\n\t\t\t\tblockTitle\n\t\t )\n\t\t: blockTitle;\n\n\tconst settingsAriaLabel = sprintf(\n\t\t// translators: %s: The title of the block.\n\t\t__( 'Options for %s' ),\n\t\tblockTitle\n\t);\n\n\tconst {\n\t\texpand,\n\t\tcollapse,\n\t\tBlockSettingsMenu,\n\t\tlistViewInstanceId,\n\t\texpandedState,\n\t\tsetInsertedBlock,\n\t\ttreeGridElementRef,\n\t} = useListViewContext();\n\n\tconst hasSiblings = siblingBlockCount > 0;\n\tconst hasRenderedMovers = showBlockMovers && hasSiblings;\n\tconst moverCellClassName = classnames(\n\t\t'block-editor-list-view-block__mover-cell',\n\t\t{ 'is-visible': isHovered || isSelected }\n\t);\n\n\tconst listViewBlockSettingsClassName = classnames(\n\t\t'block-editor-list-view-block__menu-cell',\n\t\t{ 'is-visible': isHovered || isFirstSelectedBlock }\n\t);\n\n\t// If multiple blocks are selected, deselect all blocks when the user\n\t// presses the escape key.\n\tconst onKeyDown = ( event ) => {\n\t\tif (\n\t\t\tevent.keyCode === ESCAPE &&\n\t\t\t! event.defaultPrevented &&\n\t\t\tselectedClientIds.length > 0\n\t\t) {\n\t\t\tevent.stopPropagation();\n\t\t\tevent.preventDefault();\n\t\t\tselectBlock( event, undefined );\n\t\t}\n\t};\n\n\tconst onMouseEnter = useCallback( () => {\n\t\tsetIsHovered( true );\n\t\ttoggleBlockHighlight( clientId, true );\n\t}, [ clientId, setIsHovered, toggleBlockHighlight ] );\n\tconst onMouseLeave = useCallback( () => {\n\t\tsetIsHovered( false );\n\t\ttoggleBlockHighlight( clientId, false );\n\t}, [ clientId, setIsHovered, toggleBlockHighlight ] );\n\n\tconst selectEditorBlock = useCallback(\n\t\t( event ) => {\n\t\t\tselectBlock( event, clientId );\n\t\t\tevent.preventDefault();\n\t\t},\n\t\t[ clientId, selectBlock ]\n\t);\n\n\tconst updateFocusAndSelection = useCallback(\n\t\t( focusClientId, shouldSelectBlock ) => {\n\t\t\tif ( shouldSelectBlock ) {\n\t\t\t\tselectBlock( undefined, focusClientId, null, null );\n\t\t\t}\n\n\t\t\tfocusListItem( focusClientId, treeGridElementRef );\n\t\t},\n\t\t[ selectBlock, treeGridElementRef ]\n\t);\n\n\tconst toggleExpanded = useCallback(\n\t\t( event ) => {\n\t\t\t// Prevent shift+click from opening link in a new window when toggling.\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tif ( isExpanded === true ) {\n\t\t\t\tcollapse( clientId );\n\t\t\t} else if ( isExpanded === false ) {\n\t\t\t\texpand( clientId );\n\t\t\t}\n\t\t},\n\t\t[ clientId, expand, collapse, isExpanded ]\n\t);\n\n\tlet colSpan;\n\tif ( hasRenderedMovers ) {\n\t\tcolSpan = 2;\n\t} else if ( ! showBlockActions ) {\n\t\tcolSpan = 3;\n\t}\n\n\tconst classes = classnames( {\n\t\t'is-selected': isSelected,\n\t\t'is-first-selected': isFirstSelectedBlock,\n\t\t'is-last-selected': isLastSelectedBlock,\n\t\t'is-branch-selected': isBranchSelected,\n\t\t'is-synced-branch': isSyncedBranch,\n\t\t'is-dragging': isDragged,\n\t\t'has-single-cell': ! showBlockActions,\n\t\t'is-synced': blockInformation?.isSynced,\n\t} );\n\n\t// Only include all selected blocks if the currently clicked on block\n\t// is one of the selected blocks. This ensures that if a user attempts\n\t// to alter a block that isn't part of the selection, they're still able\n\t// to do so.\n\tconst dropdownClientIds = selectedClientIds.includes( clientId )\n\t\t? selectedClientIds\n\t\t: [ clientId ];\n\n\t// Pass in a ref to the row, so that it can be scrolled\n\t// into view when selected. For long lists, the placeholder for the\n\t// selected block is also observed, within ListViewLeafPlaceholder.\n\tuseListViewScrollIntoView( {\n\t\tisSelected,\n\t\trowItemRef: rowRef,\n\t\tselectedClientIds,\n\t} );\n\n\t// Detect if there is a block in the canvas currently being edited and multi-selection is not happening.\n\tconst currentlyEditingBlockInCanvas =\n\t\tisSelected && selectedClientIds.length === 1;\n\n\treturn (\n\t\t<ListViewLeaf\n\t\t\tclassName={ classes }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t\tonMouseEnter={ onMouseEnter }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\tonFocus={ onMouseEnter }\n\t\t\tonBlur={ onMouseLeave }\n\t\t\tlevel={ level }\n\t\t\tposition={ position }\n\t\t\trowCount={ rowCount }\n\t\t\tpath={ path }\n\t\t\tid={ `list-view-${ listViewInstanceId }-block-${ clientId }` }\n\t\t\tdata-block={ clientId }\n\t\t\tdata-expanded={ canEdit ? isExpanded : undefined }\n\t\t\tref={ rowRef }\n\t\t>\n\t\t\t<TreeGridCell\n\t\t\t\tclassName=\"block-editor-list-view-block__contents-cell\"\n\t\t\t\tcolSpan={ colSpan }\n\t\t\t\tref={ cellRef }\n\t\t\t\taria-selected={ !! isSelected }\n\t\t\t>\n\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t<div className=\"block-editor-list-view-block__contents-container\">\n\t\t\t\t\t\t<ListViewBlockContents\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\tonClick={ selectEditorBlock }\n\t\t\t\t\t\t\tonToggleExpanded={ toggleExpanded }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\tsiblingBlockCount={ siblingBlockCount }\n\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\ttabIndex={\n\t\t\t\t\t\t\t\tcurrentlyEditingBlockInCanvas ? 0 : tabIndex\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tisExpanded={ canEdit ? isExpanded : undefined }\n\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\tariaLabel={ blockAriaLabel }\n\t\t\t\t\t\t\tariaDescribedBy={ descriptionId }\n\t\t\t\t\t\t\tupdateFocusAndSelection={ updateFocusAndSelection }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<AriaReferencedText id={ descriptionId }>\n\t\t\t\t\t\t\t{ blockPositionDescription }\n\t\t\t\t\t\t</AriaReferencedText>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TreeGridCell>\n\t\t\t{ hasRenderedMovers && (\n\t\t\t\t<>\n\t\t\t\t\t<TreeGridCell\n\t\t\t\t\t\tclassName={ moverCellClassName }\n\t\t\t\t\t\twithoutGridItem\n\t\t\t\t\t>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverUpButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverDownButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t</TreeGridCell>\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t{ showBlockActions && BlockSettingsMenu && (\n\t\t\t\t<TreeGridCell\n\t\t\t\t\tclassName={ listViewBlockSettingsClassName }\n\t\t\t\t\taria-selected={ !! isSelected }\n\t\t\t\t>\n\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t<BlockSettingsMenu\n\t\t\t\t\t\t\tclientIds={ dropdownClientIds }\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ settingsAriaLabel }\n\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\tref,\n\t\t\t\t\t\t\t\tclassName: 'block-editor-list-view-block__menu',\n\t\t\t\t\t\t\t\ttabIndex,\n\t\t\t\t\t\t\t\tonFocus,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tdisableOpenOnArrowDown\n\t\t\t\t\t\t\texpand={ expand }\n\t\t\t\t\t\t\texpandedState={ expandedState }\n\t\t\t\t\t\t\tsetInsertedBlock={ setInsertedBlock }\n\t\t\t\t\t\t\t__experimentalSelectBlock={\n\t\t\t\t\t\t\t\tupdateFocusAndSelection\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\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,GAAK;IACXC,QAAQ,EAAGA,QAAU;IACrBJ,OAAO,EAAGA;EAAS,CACnB,CAEW,CAAC,EACfF,aAAA,CAACnG,YAAY,QACV,CAAE;IAAEwG,GAAG;IAAEC,QAAQ;IAAEJ;EAAQ,CAAC,KAC7BF,aAAA,CAACpF,oBAAoB;IACpBiG,WAAW,EAAC,UAAU;IACtBC,SAAS,EAAG,CAAEtF,QAAQ,CAAI;IAC1B6E,GAAG,EAAGA,GAAK;IACXC,QAAQ,EAAGA,QAAU;IACrBJ,OAAO,EAAGA;EAAS,CACnB,CAEW,CACD,CACb,CACF,EAECxC,gBAAgB,IAAIQ,iBAAiB,IACtC8B,aAAA,CAACrG,YAAY;IACZsG,SAAS,EAAGvB,8BAAgC;IAC5C,iBAAgB,CAAC,CAAEhD;EAAY,GAE7B,CAAE;IAAE2E,GAAG;IAAEC,QAAQ;IAAEJ;EAAQ,CAAC,KAC7BF,aAAA,CAAC9B,iBAAiB;IACjB4C,SAAS,EAAGlB,iBAAmB;IAC/BrE,KAAK,EAAGA,KAAO;IACfwF,IAAI,EAAGhH,YAAc;IACrBiH,KAAK,EAAGjD,iBAAmB;IAC3BkD,WAAW,EAAG;MACbZ,GAAG;MACHJ,SAAS,EAAE,oCAAoC;MAC/CK,QAAQ;MACRJ;IACD,CAAG;IACHgB,sBAAsB;IACtBlD,MAAM,EAAGA,MAAQ;IACjBI,aAAa,EAAGA,aAAe;IAC/BC,gBAAgB,EAAGA,gBAAkB;IACrC8C,yBAAyB,EACxB9B;EACA,CACD,CAEW,CAEF,CAAC;AAEjB;AAEA,eAAelF,IAAI,CAAEmB,aAAc,CAAC"}
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -118,7 +118,14 @@ function ListViewBranch(props) {
118
118
  // but asynchronous for any other block.
119
119
  const isSelected = isClientIdSelected(clientId, selectedClientIds);
120
120
  const isSelectedBranch = isBranchSelected || isSelected && hasNestedBlocks;
121
- const showBlock = isDragged || blockInView || isSelected || isBranchDragged;
121
+
122
+ // To avoid performance issues, we only render blocks that are in view,
123
+ // or blocks that are selected or dragged. If a block is selected,
124
+ // it is only counted if it is the first of the block selection.
125
+ // This prevents the entire tree from being rendered when a branch is
126
+ // selected, or a user selects all blocks, while still enabling scroll
127
+ // into view behavior when selecting a block or opening the list view.
128
+ const showBlock = isDragged || blockInView || isBranchDragged || isSelected && clientId === selectedClientIds[0];
122
129
  return createElement(AsyncModeProvider, {
123
130
  key: clientId,
124
131
  value: !isSelected
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalTreeGridRow","TreeGridRow","__experimentalTreeGridCell","TreeGridCell","memo","AsyncModeProvider","useSelect","Appender","ListViewBlock","useListViewContext","isClientIdSelected","store","blockEditorStore","useBlockDisplayInformation","countBlocks","block","expandedState","draggedClientIds","isExpandedByDefault","_expandedState$block$","isDragged","includes","clientId","isExpanded","innerBlocks","reduce","countReducer","count","_expandedState$block$2","length","noop","ListViewBranch","props","blocks","selectBlock","showBlockMovers","selectedClientIds","level","path","isBranchDragged","isBranchSelected","listPosition","fixedListWindow","parentId","shouldShowInnerBlocks","isSyncedBranch","showAppender","showAppenderProp","parentBlockInformation","syncedBranch","isSynced","canParentExpand","select","canEditBlock","filteredBlocks","filter","Boolean","blockCount","rowCount","nextPosition","createElement","Fragment","map","index","_expandedState$client","itemInView","blockInView","position","updatedPath","hasNestedBlocks","shouldExpand","undefined","isSelected","isSelectedBranch","showBlock","key","value","siblingBlockCount","className","setSize","positionInSet","treeGridCellProps","nestingLevel"],"sources":["@wordpress/block-editor/src/components/list-view/branch.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalTreeGridRow as TreeGridRow,\n\t__experimentalTreeGridCell as TreeGridCell,\n} from '@wordpress/components';\nimport { memo } from '@wordpress/element';\nimport { AsyncModeProvider, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { Appender } from './appender';\nimport ListViewBlock from './block';\nimport { useListViewContext } from './context';\nimport { isClientIdSelected } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayInformation from '../use-block-display-information';\n\n/**\n * Given a block, returns the total number of blocks in that subtree. This is used to help determine\n * the list position of a block.\n *\n * When a block is collapsed, we do not count their children as part of that total. In the current drag\n * implementation dragged blocks and their children are not counted.\n *\n * @param {Object} block block tree\n * @param {Object} expandedState state that notes which branches are collapsed\n * @param {Array} draggedClientIds a list of dragged client ids\n * @param {boolean} isExpandedByDefault flag to determine the default fallback expanded state.\n * @return {number} block count\n */\nfunction countBlocks(\n\tblock,\n\texpandedState,\n\tdraggedClientIds,\n\tisExpandedByDefault\n) {\n\tconst isDragged = draggedClientIds?.includes( block.clientId );\n\tif ( isDragged ) {\n\t\treturn 0;\n\t}\n\tconst isExpanded = expandedState[ block.clientId ] ?? isExpandedByDefault;\n\n\tif ( isExpanded ) {\n\t\treturn (\n\t\t\t1 +\n\t\t\tblock.innerBlocks.reduce(\n\t\t\t\tcountReducer(\n\t\t\t\t\texpandedState,\n\t\t\t\t\tdraggedClientIds,\n\t\t\t\t\tisExpandedByDefault\n\t\t\t\t),\n\t\t\t\t0\n\t\t\t)\n\t\t);\n\t}\n\treturn 1;\n}\nconst countReducer =\n\t( expandedState, draggedClientIds, isExpandedByDefault ) =>\n\t( count, block ) => {\n\t\tconst isDragged = draggedClientIds?.includes( block.clientId );\n\t\tif ( isDragged ) {\n\t\t\treturn count;\n\t\t}\n\t\tconst isExpanded =\n\t\t\texpandedState[ block.clientId ] ?? isExpandedByDefault;\n\t\tif ( isExpanded && block.innerBlocks.length > 0 ) {\n\t\t\treturn (\n\t\t\t\tcount +\n\t\t\t\tcountBlocks(\n\t\t\t\t\tblock,\n\t\t\t\t\texpandedState,\n\t\t\t\t\tdraggedClientIds,\n\t\t\t\t\tisExpandedByDefault\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn count + 1;\n\t};\n\nconst noop = () => {};\n\nfunction ListViewBranch( props ) {\n\tconst {\n\t\tblocks,\n\t\tselectBlock = noop,\n\t\tshowBlockMovers,\n\t\tselectedClientIds,\n\t\tlevel = 1,\n\t\tpath = '',\n\t\tisBranchDragged = false,\n\t\tisBranchSelected = false,\n\t\tlistPosition = 0,\n\t\tfixedListWindow,\n\t\tisExpanded,\n\t\tparentId,\n\t\tshouldShowInnerBlocks = true,\n\t\tisSyncedBranch = false,\n\t\tshowAppender: showAppenderProp = true,\n\t} = props;\n\n\tconst parentBlockInformation = useBlockDisplayInformation( parentId );\n\tconst syncedBranch = isSyncedBranch || !! parentBlockInformation?.isSynced;\n\n\tconst canParentExpand = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! parentId ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn select( blockEditorStore ).canEditBlock( parentId );\n\t\t},\n\t\t[ parentId ]\n\t);\n\n\tconst { expandedState, draggedClientIds } = useListViewContext();\n\n\tif ( ! canParentExpand ) {\n\t\treturn null;\n\t}\n\n\t// Only show the appender at the first level.\n\tconst showAppender = showAppenderProp && level === 1;\n\tconst filteredBlocks = blocks.filter( Boolean );\n\tconst blockCount = filteredBlocks.length;\n\t// The appender means an extra row in List View, so add 1 to the row count.\n\tconst rowCount = showAppender ? blockCount + 1 : blockCount;\n\tlet nextPosition = listPosition;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredBlocks.map( ( block, index ) => {\n\t\t\t\tconst { clientId, innerBlocks } = block;\n\n\t\t\t\tif ( index > 0 ) {\n\t\t\t\t\tnextPosition += countBlocks(\n\t\t\t\t\t\tfilteredBlocks[ index - 1 ],\n\t\t\t\t\t\texpandedState,\n\t\t\t\t\t\tdraggedClientIds,\n\t\t\t\t\t\tisExpanded\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst { itemInView } = fixedListWindow;\n\t\t\t\tconst blockInView = itemInView( nextPosition );\n\n\t\t\t\tconst position = index + 1;\n\t\t\t\tconst updatedPath =\n\t\t\t\t\tpath.length > 0\n\t\t\t\t\t\t? `${ path }_${ position }`\n\t\t\t\t\t\t: `${ position }`;\n\t\t\t\tconst hasNestedBlocks = !! innerBlocks?.length;\n\n\t\t\t\tconst shouldExpand =\n\t\t\t\t\thasNestedBlocks && shouldShowInnerBlocks\n\t\t\t\t\t\t? expandedState[ clientId ] ?? isExpanded\n\t\t\t\t\t\t: undefined;\n\n\t\t\t\tconst isDragged = !! draggedClientIds?.includes( clientId );\n\n\t\t\t\t// Make updates to the selected or dragged blocks synchronous,\n\t\t\t\t// but asynchronous for any other block.\n\t\t\t\tconst isSelected = isClientIdSelected(\n\t\t\t\t\tclientId,\n\t\t\t\t\tselectedClientIds\n\t\t\t\t);\n\t\t\t\tconst isSelectedBranch =\n\t\t\t\t\tisBranchSelected || ( isSelected && hasNestedBlocks );\n\t\t\t\tconst showBlock =\n\t\t\t\t\tisDragged || blockInView || isSelected || isBranchDragged;\n\t\t\t\treturn (\n\t\t\t\t\t<AsyncModeProvider key={ clientId } value={ ! isSelected }>\n\t\t\t\t\t\t{ showBlock && (\n\t\t\t\t\t\t\t<ListViewBlock\n\t\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\t\tselectBlock={ selectBlock }\n\t\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\t\tisBranchSelected={ isSelectedBranch }\n\t\t\t\t\t\t\t\tisDragged={ isDragged || isBranchDragged }\n\t\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\t\trowCount={ rowCount }\n\t\t\t\t\t\t\t\tsiblingBlockCount={ blockCount }\n\t\t\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\t\t\tpath={ updatedPath }\n\t\t\t\t\t\t\t\tisExpanded={ shouldExpand }\n\t\t\t\t\t\t\t\tlistPosition={ nextPosition }\n\t\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\t\tisSyncedBranch={ syncedBranch }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! showBlock && (\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td className=\"block-editor-list-view-placeholder\" />\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ hasNestedBlocks && shouldExpand && (\n\t\t\t\t\t\t\t<ListViewBranch\n\t\t\t\t\t\t\t\tparentId={ clientId }\n\t\t\t\t\t\t\t\tblocks={ innerBlocks }\n\t\t\t\t\t\t\t\tselectBlock={ selectBlock }\n\t\t\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\t\t\tlevel={ level + 1 }\n\t\t\t\t\t\t\t\tpath={ updatedPath }\n\t\t\t\t\t\t\t\tlistPosition={ nextPosition + 1 }\n\t\t\t\t\t\t\t\tfixedListWindow={ fixedListWindow }\n\t\t\t\t\t\t\t\tisBranchSelected={ isSelectedBranch }\n\t\t\t\t\t\t\t\tisBranchDragged={ isDragged || isBranchDragged }\n\t\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\t\t\tisSyncedBranch={ syncedBranch }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AsyncModeProvider>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t\t{ showAppender && (\n\t\t\t\t<TreeGridRow\n\t\t\t\t\tlevel={ level }\n\t\t\t\t\tsetSize={ rowCount }\n\t\t\t\t\tpositionInSet={ rowCount }\n\t\t\t\t\tisExpanded={ true }\n\t\t\t\t>\n\t\t\t\t\t<TreeGridCell>\n\t\t\t\t\t\t{ ( treeGridCellProps ) => (\n\t\t\t\t\t\t\t<Appender\n\t\t\t\t\t\t\t\tclientId={ parentId }\n\t\t\t\t\t\t\t\tnestingLevel={ level }\n\t\t\t\t\t\t\t\tblockCount={ blockCount }\n\t\t\t\t\t\t\t\t{ ...treeGridCellProps }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</TreeGridCell>\n\t\t\t\t</TreeGridRow>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default memo( ListViewBranch );\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,yBAAyB,IAAIC,WAAW,EACxCC,0BAA0B,IAAIC,YAAY,QACpC,uBAAuB;AAC9B,SAASC,IAAI,QAAQ,oBAAoB;AACzC,SAASC,iBAAiB,EAAEC,SAAS,QAAQ,iBAAiB;;AAE9D;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,YAAY;AACrC,OAAOC,aAAa,MAAM,SAAS;AACnC,SAASC,kBAAkB,QAAQ,WAAW;AAC9C,SAASC,kBAAkB,QAAQ,SAAS;AAC5C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,OAAOC,0BAA0B,MAAM,kCAAkC;;AAEzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,WAAWA,CACnBC,KAAK,EACLC,aAAa,EACbC,gBAAgB,EAChBC,mBAAmB,EAClB;EAAA,IAAAC,qBAAA;EACD,MAAMC,SAAS,GAAGH,gBAAgB,EAAEI,QAAQ,CAAEN,KAAK,CAACO,QAAS,CAAC;EAC9D,IAAKF,SAAS,EAAG;IAChB,OAAO,CAAC;EACT;EACA,MAAMG,UAAU,IAAAJ,qBAAA,GAAGH,aAAa,CAAED,KAAK,CAACO,QAAQ,CAAE,cAAAH,qBAAA,cAAAA,qBAAA,GAAID,mBAAmB;EAEzE,IAAKK,UAAU,EAAG;IACjB,OACC,CAAC,GACDR,KAAK,CAACS,WAAW,CAACC,MAAM,CACvBC,YAAY,CACXV,aAAa,EACbC,gBAAgB,EAChBC,mBACD,CAAC,EACD,CACD,CAAC;EAEH;EACA,OAAO,CAAC;AACT;AACA,MAAMQ,YA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Y,QAAQ,EAAGrB,QAAU;MACrBW,MAAM,EAAGT,WAAa;MACtBU,WAAW,EAAGA,WAAa;MAC3BC,eAAe,EAAGA,eAAiB;MACnCE,KAAK,EAAGA,KAAK,GAAG,CAAG;MACnBC,IAAI,EAAG8B,WAAa;MACpB3B,YAAY,EAAGkB,YAAY,GAAG,CAAG;MACjCjB,eAAe,EAAGA,eAAiB;MACnCF,gBAAgB,EAAGiC,gBAAkB;MACrClC,eAAe,EAAGnB,SAAS,IAAImB,eAAiB;MAChDH,iBAAiB,EAAGA,iBAAmB;MACvCb,UAAU,EAAGA,UAAY;MACzBsB,cAAc,EAAGI;IAAc,CAC/B,CAEgB,CAAC;EAEtB,CAAE,CAAC,EACDH,YAAY,IACbc,aAAA,CAAC3D,WAAW;IACXoC,KAAK,EAAGA,KAAO;IACf0C,OAAO,EAAGrB,QAAU;IACpBsB,aAAa,EAAGtB,QAAU;IAC1BnC,UAAU,EAAG;EAAM,GAEnBqC,aAAA,CAACzD,YAAY,QACR8E,iBAAiB,IACpBrB,aAAA,CAACrD,QAAQ;IACRe,QAAQ,EAAGqB,QAAU;IACrBuC,YAAY,EAAG7C,KAAO;IACtBoB,UAAU,EAAGA,UAAY;IAAA,GACpBwB;EAAiB,CACtB,CAEW,CACF,CAEb,CAAC;AAEL;AAEA,eAAe7E,IAAI,CAAE2B,cAAe,CAAC"}
1
+ {"version":3,"names":["__experimentalTreeGridRow","TreeGridRow","__experimentalTreeGridCell","TreeGridCell","memo","AsyncModeProvider","useSelect","Appender","ListViewBlock","useListViewContext","isClientIdSelected","store","blockEditorStore","useBlockDisplayInformation","countBlocks","block","expandedState","draggedClientIds","isExpandedByDefault","_expandedState$block$","isDragged","includes","clientId","isExpanded","innerBlocks","reduce","countReducer","count","_expandedState$block$2","length","noop","ListViewBranch","props","blocks","selectBlock","showBlockMovers","selectedClientIds","level","path","isBranchDragged","isBranchSelected","listPosition","fixedListWindow","parentId","shouldShowInnerBlocks","isSyncedBranch","showAppender","showAppenderProp","parentBlockInformation","syncedBranch","isSynced","canParentExpand","select","canEditBlock","filteredBlocks","filter","Boolean","blockCount","rowCount","nextPosition","createElement","Fragment","map","index","_expandedState$client","itemInView","blockInView","position","updatedPath","hasNestedBlocks","shouldExpand","undefined","isSelected","isSelectedBranch","showBlock","key","value","siblingBlockCount","className","setSize","positionInSet","treeGridCellProps","nestingLevel"],"sources":["@wordpress/block-editor/src/components/list-view/branch.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalTreeGridRow as TreeGridRow,\n\t__experimentalTreeGridCell as TreeGridCell,\n} from '@wordpress/components';\nimport { memo } from '@wordpress/element';\nimport { AsyncModeProvider, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { Appender } from './appender';\nimport ListViewBlock from './block';\nimport { useListViewContext } from './context';\nimport { isClientIdSelected } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayInformation from '../use-block-display-information';\n\n/**\n * Given a block, returns the total number of blocks in that subtree. This is used to help determine\n * the list position of a block.\n *\n * When a block is collapsed, we do not count their children as part of that total. In the current drag\n * implementation dragged blocks and their children are not counted.\n *\n * @param {Object} block block tree\n * @param {Object} expandedState state that notes which branches are collapsed\n * @param {Array} draggedClientIds a list of dragged client ids\n * @param {boolean} isExpandedByDefault flag to determine the default fallback expanded state.\n * @return {number} block count\n */\nfunction countBlocks(\n\tblock,\n\texpandedState,\n\tdraggedClientIds,\n\tisExpandedByDefault\n) {\n\tconst isDragged = draggedClientIds?.includes( block.clientId );\n\tif ( isDragged ) {\n\t\treturn 0;\n\t}\n\tconst isExpanded = expandedState[ block.clientId ] ?? isExpandedByDefault;\n\n\tif ( isExpanded ) {\n\t\treturn (\n\t\t\t1 +\n\t\t\tblock.innerBlocks.reduce(\n\t\t\t\tcountReducer(\n\t\t\t\t\texpandedState,\n\t\t\t\t\tdraggedClientIds,\n\t\t\t\t\tisExpandedByDefault\n\t\t\t\t),\n\t\t\t\t0\n\t\t\t)\n\t\t);\n\t}\n\treturn 1;\n}\nconst countReducer =\n\t( expandedState, draggedClientIds, isExpandedByDefault ) =>\n\t( count, block ) => {\n\t\tconst isDragged = draggedClientIds?.includes( block.clientId );\n\t\tif ( isDragged ) {\n\t\t\treturn count;\n\t\t}\n\t\tconst isExpanded =\n\t\t\texpandedState[ block.clientId ] ?? isExpandedByDefault;\n\t\tif ( isExpanded && block.innerBlocks.length > 0 ) {\n\t\t\treturn (\n\t\t\t\tcount +\n\t\t\t\tcountBlocks(\n\t\t\t\t\tblock,\n\t\t\t\t\texpandedState,\n\t\t\t\t\tdraggedClientIds,\n\t\t\t\t\tisExpandedByDefault\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn count + 1;\n\t};\n\nconst noop = () => {};\n\nfunction ListViewBranch( props ) {\n\tconst {\n\t\tblocks,\n\t\tselectBlock = noop,\n\t\tshowBlockMovers,\n\t\tselectedClientIds,\n\t\tlevel = 1,\n\t\tpath = '',\n\t\tisBranchDragged = false,\n\t\tisBranchSelected = false,\n\t\tlistPosition = 0,\n\t\tfixedListWindow,\n\t\tisExpanded,\n\t\tparentId,\n\t\tshouldShowInnerBlocks = true,\n\t\tisSyncedBranch = false,\n\t\tshowAppender: showAppenderProp = true,\n\t} = props;\n\n\tconst parentBlockInformation = useBlockDisplayInformation( parentId );\n\tconst syncedBranch = isSyncedBranch || !! parentBlockInformation?.isSynced;\n\n\tconst canParentExpand = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! parentId ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn select( blockEditorStore ).canEditBlock( parentId );\n\t\t},\n\t\t[ parentId ]\n\t);\n\n\tconst { expandedState, draggedClientIds } = useListViewContext();\n\n\tif ( ! canParentExpand ) {\n\t\treturn null;\n\t}\n\n\t// Only show the appender at the first level.\n\tconst showAppender = showAppenderProp && level === 1;\n\tconst filteredBlocks = blocks.filter( Boolean );\n\tconst blockCount = filteredBlocks.length;\n\t// The appender means an extra row in List View, so add 1 to the row count.\n\tconst rowCount = showAppender ? blockCount + 1 : blockCount;\n\tlet nextPosition = listPosition;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredBlocks.map( ( block, index ) => {\n\t\t\t\tconst { clientId, innerBlocks } = block;\n\n\t\t\t\tif ( index > 0 ) {\n\t\t\t\t\tnextPosition += countBlocks(\n\t\t\t\t\t\tfilteredBlocks[ index - 1 ],\n\t\t\t\t\t\texpandedState,\n\t\t\t\t\t\tdraggedClientIds,\n\t\t\t\t\t\tisExpanded\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst { itemInView } = fixedListWindow;\n\t\t\t\tconst blockInView = itemInView( nextPosition );\n\n\t\t\t\tconst position = index + 1;\n\t\t\t\tconst updatedPath =\n\t\t\t\t\tpath.length > 0\n\t\t\t\t\t\t? `${ path }_${ position }`\n\t\t\t\t\t\t: `${ position }`;\n\t\t\t\tconst hasNestedBlocks = !! innerBlocks?.length;\n\n\t\t\t\tconst shouldExpand =\n\t\t\t\t\thasNestedBlocks && shouldShowInnerBlocks\n\t\t\t\t\t\t? expandedState[ clientId ] ?? isExpanded\n\t\t\t\t\t\t: undefined;\n\n\t\t\t\tconst isDragged = !! draggedClientIds?.includes( clientId );\n\n\t\t\t\t// Make updates to the selected or dragged blocks synchronous,\n\t\t\t\t// but asynchronous for any other block.\n\t\t\t\tconst isSelected = isClientIdSelected(\n\t\t\t\t\tclientId,\n\t\t\t\t\tselectedClientIds\n\t\t\t\t);\n\t\t\t\tconst isSelectedBranch =\n\t\t\t\t\tisBranchSelected || ( isSelected && hasNestedBlocks );\n\n\t\t\t\t// To avoid performance issues, we only render blocks that are in view,\n\t\t\t\t// or blocks that are selected or dragged. If a block is selected,\n\t\t\t\t// it is only counted if it is the first of the block selection.\n\t\t\t\t// This prevents the entire tree from being rendered when a branch is\n\t\t\t\t// selected, or a user selects all blocks, while still enabling scroll\n\t\t\t\t// into view behavior when selecting a block or opening the list view.\n\t\t\t\tconst showBlock =\n\t\t\t\t\tisDragged ||\n\t\t\t\t\tblockInView ||\n\t\t\t\t\tisBranchDragged ||\n\t\t\t\t\t( isSelected && clientId === selectedClientIds[ 0 ] );\n\t\t\t\treturn (\n\t\t\t\t\t<AsyncModeProvider key={ clientId } value={ ! isSelected }>\n\t\t\t\t\t\t{ showBlock && (\n\t\t\t\t\t\t\t<ListViewBlock\n\t\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\t\tselectBlock={ selectBlock }\n\t\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\t\tisBranchSelected={ isSelectedBranch }\n\t\t\t\t\t\t\t\tisDragged={ isDragged || isBranchDragged }\n\t\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\t\trowCount={ rowCount }\n\t\t\t\t\t\t\t\tsiblingBlockCount={ blockCount }\n\t\t\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\t\t\tpath={ updatedPath }\n\t\t\t\t\t\t\t\tisExpanded={ shouldExpand }\n\t\t\t\t\t\t\t\tlistPosition={ nextPosition }\n\t\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\t\tisSyncedBranch={ syncedBranch }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! showBlock && (\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td className=\"block-editor-list-view-placeholder\" />\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ hasNestedBlocks && shouldExpand && (\n\t\t\t\t\t\t\t<ListViewBranch\n\t\t\t\t\t\t\t\tparentId={ clientId }\n\t\t\t\t\t\t\t\tblocks={ innerBlocks }\n\t\t\t\t\t\t\t\tselectBlock={ selectBlock }\n\t\t\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\t\t\tlevel={ level + 1 }\n\t\t\t\t\t\t\t\tpath={ updatedPath }\n\t\t\t\t\t\t\t\tlistPosition={ nextPosition + 1 }\n\t\t\t\t\t\t\t\tfixedListWindow={ fixedListWindow }\n\t\t\t\t\t\t\t\tisBranchSelected={ isSelectedBranch }\n\t\t\t\t\t\t\t\tisBranchDragged={ isDragged || isBranchDragged }\n\t\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\t\t\tisSyncedBranch={ syncedBranch }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AsyncModeProvider>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t\t{ showAppender && (\n\t\t\t\t<TreeGridRow\n\t\t\t\t\tlevel={ level }\n\t\t\t\t\tsetSize={ rowCount }\n\t\t\t\t\tpositionInSet={ rowCount }\n\t\t\t\t\tisExpanded={ true }\n\t\t\t\t>\n\t\t\t\t\t<TreeGridCell>\n\t\t\t\t\t\t{ ( treeGridCellProps ) => (\n\t\t\t\t\t\t\t<Appender\n\t\t\t\t\t\t\t\tclientId={ parentId }\n\t\t\t\t\t\t\t\tnestingLevel={ level }\n\t\t\t\t\t\t\t\tblockCount={ blockCount }\n\t\t\t\t\t\t\t\t{ ...treeGridCellProps }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</TreeGridCell>\n\t\t\t\t</TreeGridRow>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default memo( ListViewBranch );\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,yBAAyB,IAAIC,WAAW,EACxCC,0BAA0B,IAAIC,YAAY,QACpC,uBAAuB;AAC9B,SAASC,IAAI,QAAQ,oBAAoB;AACzC,SAASC,iBAAiB,EAAEC,SAAS,QAAQ,iBAAiB;;AAE9D;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,YAAY;AACrC,OAAOC,aAAa,MAAM,SAAS;AACnC,SAASC,kBAA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/B,CAEgB,CAAC;EAEtB,CAAE,CAAC,EACDH,YAAY,IACbc,aAAA,CAAC3D,WAAW;IACXoC,KAAK,EAAGA,KAAO;IACf0C,OAAO,EAAGrB,QAAU;IACpBsB,aAAa,EAAGtB,QAAU;IAC1BnC,UAAU,EAAG;EAAM,GAEnBqC,aAAA,CAACzD,YAAY,QACR8E,iBAAiB,IACpBrB,aAAA,CAACrD,QAAQ;IACRe,QAAQ,EAAGqB,QAAU;IACrBuC,YAAY,EAAG7C,KAAO;IACtBoB,UAAU,EAAGA,UAAY;IAAA,GACpBwB;EAAiB,CACtB,CAEW,CACF,CAEb,CAAC;AAEL;AAEA,eAAe7E,IAAI,CAAE2B,cAAe,CAAC"}
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
@@ -21,6 +21,7 @@ import useListViewDropZone from './use-list-view-drop-zone';
21
21
  import useListViewExpandSelectedItem from './use-list-view-expand-selected-item';
22
22
  import { store as blockEditorStore } from '../../store';
23
23
  import { BlockSettingsDropdown } from '../block-settings-menu/block-settings-dropdown';
24
+ import { focusListItem } from './utils';
24
25
  const expanded = (state, action) => {
25
26
  if (Array.isArray(action.clientIds)) {
26
27
  return {
@@ -114,7 +115,6 @@ function ListViewComponent({
114
115
  });
115
116
  const elementRef = useRef();
116
117
  const treeGridRef = useMergeRefs([elementRef, dropZoneRef, ref]);
117
- const isMounted = useRef(false);
118
118
  const [insertedBlock, setInsertedBlock] = useState(null);
119
119
  const {
120
120
  setSelectedTreeId
@@ -136,7 +136,13 @@ function ListViewComponent({
136
136
  }
137
137
  }, [setSelectedTreeId, updateBlockSelection, onSelect, getBlock]);
138
138
  useEffect(() => {
139
- isMounted.current = true;
139
+ // If a blocks are already selected when the list view is initially
140
+ // mounted, shift focus to the first selected block.
141
+ if (selectedClientIds?.length) {
142
+ focusListItem(selectedClientIds[0], elementRef);
143
+ }
144
+ // Disable reason: Only focus on the selected item when the list view is mounted.
145
+ // eslint-disable-next-line react-hooks/exhaustive-deps
140
146
  }, []);
141
147
  const expand = useCallback(clientId => {
142
148
  if (!clientId) {
@@ -168,7 +174,6 @@ function ListViewComponent({
168
174
  }
169
175
  }, [updateBlockSelection]);
170
176
  const contextValue = useMemo(() => ({
171
- isTreeGridMounted: isMounted.current,
172
177
  draggedClientIds,
173
178
  expandedState,
174
179
  expand,
@@ -1 +1 @@
1
- {"version":3,"names":["useInstanceId","useMergeRefs","__experimentalUseFixedWindowList","useFixedWindowList","__experimentalTreeGrid","TreeGrid","AsyncModeProvider","useSelect","deprecated","useCallback","useEffect","useMemo","useRef","useReducer","forwardRef","useState","__","ListViewBranch","ListViewContext","ListViewDropIndicator","useBlockSelection","useListViewClientIds","useListViewDropZone","useListViewExpandSelectedItem","store","blockEditorStore","BlockSettingsDropdown","expanded","state","action","Array","isArray","clientIds","reduce","newState","id","type","BLOCK_LIST_ITEM_HEIGHT","ListViewComponent","blocks","dropZoneElement","showBlockMovers","isExpanded","showAppender","blockSettingsMenu","BlockSettingsMenu","rootClientId","description","onSelect","additionalBlockContent","AdditionalBlockContent","ref","since","alternative","instanceId","clientIdsTree","draggedClientIds","selectedClientIds","getBlock","visibleBlockCount","shouldShowInnerBlocks","select","getGlobalBlockCount","getClientIdsOfDescendants","__unstableGetEditorMode","draggedBlockCount","length","updateBlockSelection","expandedState","setExpandedState","dropZoneRef","target","blockDropTarget","elementRef","treeGridRef","isMounted","insertedBlock","setInsertedBlock","setSelectedTreeId","firstSelectedBlockClientId","selectEditorBlock","event","blockClientId","focusPosition","current","expand","clientId","collapse","expandRow","row","dataset","block","collapseRow","focusRow","startRow","endRow","shiftKey","contextValue","isTreeGridMounted","listViewInstanceId","treeGridElementRef","fixedListWindow","useWindowing","windowOverscan","createElement","value","listViewRef","className","onCollapseRow","onExpandRow","onFocusRow","applicationAriaLabel","Provider","parentId","selectBlock","PrivateListView","props","undefined"],"sources":["@wordpress/block-editor/src/components/list-view/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tuseInstanceId,\n\tuseMergeRefs,\n\t__experimentalUseFixedWindowList as useFixedWindowList,\n} from '@wordpress/compose';\nimport { __experimentalTreeGrid as TreeGrid } from '@wordpress/components';\nimport { AsyncModeProvider, useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseReducer,\n\tforwardRef,\n\tuseState,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ListViewBranch from './branch';\nimport { ListViewContext } from './context';\nimport ListViewDropIndicator from './drop-indicator';\nimport useBlockSelection from './use-block-selection';\nimport useListViewClientIds from './use-list-view-client-ids';\nimport useListViewDropZone from './use-list-view-drop-zone';\nimport useListViewExpandSelectedItem from './use-list-view-expand-selected-item';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockSettingsDropdown } from '../block-settings-menu/block-settings-dropdown';\n\nconst expanded = ( state, action ) => {\n\tif ( Array.isArray( action.clientIds ) ) {\n\t\treturn {\n\t\t\t...state,\n\t\t\t...action.clientIds.reduce(\n\t\t\t\t( newState, id ) => ( {\n\t\t\t\t\t...newState,\n\t\t\t\t\t[ id ]: action.type === 'expand',\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t\t),\n\t\t};\n\t}\n\treturn state;\n};\n\nexport const BLOCK_LIST_ITEM_HEIGHT = 36;\n\n/** @typedef {import('react').ComponentType} ComponentType */\n/** @typedef {import('react').Ref<HTMLElement>} Ref */\n\n/**\n * Show a hierarchical list of blocks.\n *\n * @param {Object} props Components props.\n * @param {string} props.id An HTML element id for the root element of ListView.\n * @param {Array} props.blocks _deprecated_ Custom subset of block client IDs to be used instead of the default hierarchy.\n * @param {?HTMLElement} props.dropZoneElement Optional element to be used as the drop zone.\n * @param {?boolean} props.showBlockMovers Flag to enable block movers. Defaults to `false`.\n * @param {?boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. Defaults to `false`.\n * @param {?boolean} props.showAppender Flag to show or hide the block appender. Defaults to `false`.\n * @param {?ComponentType} props.blockSettingsMenu Optional more menu substitution. Defaults to the standard `BlockSettingsDropdown` component.\n * @param {string} props.rootClientId The client id of the root block from which we determine the blocks to show in the list.\n * @param {string} props.description Optional accessible description for the tree grid component.\n * @param {?Function} props.onSelect Optional callback to be invoked when a block is selected. Receives the block object that was selected.\n * @param {?ComponentType} props.additionalBlockContent Component that renders additional block content UI.\n * @param {Ref} ref Forwarded ref\n */\nfunction ListViewComponent(\n\t{\n\t\tid,\n\t\tblocks,\n\t\tdropZoneElement,\n\t\tshowBlockMovers = false,\n\t\tisExpanded = false,\n\t\tshowAppender = false,\n\t\tblockSettingsMenu: BlockSettingsMenu = BlockSettingsDropdown,\n\t\trootClientId,\n\t\tdescription,\n\t\tonSelect,\n\t\tadditionalBlockContent: AdditionalBlockContent,\n\t},\n\tref\n) {\n\t// This can be removed once we no longer need to support the blocks prop.\n\tif ( blocks ) {\n\t\tdeprecated(\n\t\t\t'`blocks` property in `wp.blockEditor.__experimentalListView`',\n\t\t\t{\n\t\t\t\tsince: '6.3',\n\t\t\t\talternative: '`rootClientId` property',\n\t\t\t}\n\t\t);\n\t}\n\n\tconst instanceId = useInstanceId( ListViewComponent );\n\tconst { clientIdsTree, draggedClientIds, selectedClientIds } =\n\t\tuseListViewClientIds( { blocks, rootClientId } );\n\n\tconst { getBlock } = useSelect( blockEditorStore );\n\tconst { visibleBlockCount, shouldShowInnerBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetGlobalBlockCount,\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst draggedBlockCount =\n\t\t\t\tdraggedClientIds?.length > 0\n\t\t\t\t\t? getClientIdsOfDescendants( draggedClientIds ).length + 1\n\t\t\t\t\t: 0;\n\t\t\treturn {\n\t\t\t\tvisibleBlockCount: getGlobalBlockCount() - draggedBlockCount,\n\t\t\t\tshouldShowInnerBlocks: __unstableGetEditorMode() !== 'zoom-out',\n\t\t\t};\n\t\t},\n\t\t[ draggedClientIds ]\n\t);\n\n\tconst { updateBlockSelection } = useBlockSelection();\n\n\tconst [ expandedState, setExpandedState ] = useReducer( expanded, {} );\n\n\tconst { ref: dropZoneRef, target: blockDropTarget } = useListViewDropZone( {\n\t\tdropZoneElement,\n\t} );\n\tconst elementRef = useRef();\n\tconst treeGridRef = useMergeRefs( [ elementRef, dropZoneRef, ref ] );\n\n\tconst isMounted = useRef( false );\n\n\tconst [ insertedBlock, setInsertedBlock ] = useState( null );\n\n\tconst { setSelectedTreeId } = useListViewExpandSelectedItem( {\n\t\tfirstSelectedBlockClientId: selectedClientIds[ 0 ],\n\t\tsetExpandedState,\n\t} );\n\tconst selectEditorBlock = useCallback(\n\t\t/**\n\t\t * @param {MouseEvent | KeyboardEvent | undefined} event\n\t\t * @param {string} blockClientId\n\t\t * @param {null | undefined | -1 | 1} focusPosition\n\t\t */\n\t\t( event, blockClientId, focusPosition ) => {\n\t\t\tupdateBlockSelection( event, blockClientId, null, focusPosition );\n\t\t\tsetSelectedTreeId( blockClientId );\n\t\t\tif ( onSelect ) {\n\t\t\t\tonSelect( getBlock( blockClientId ) );\n\t\t\t}\n\t\t},\n\t\t[ setSelectedTreeId, updateBlockSelection, onSelect, getBlock ]\n\t);\n\tuseEffect( () => {\n\t\tisMounted.current = true;\n\t}, [] );\n\n\tconst expand = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetExpandedState( { type: 'expand', clientIds: [ clientId ] } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapse = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetExpandedState( { type: 'collapse', clientIds: [ clientId ] } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst expandRow = useCallback(\n\t\t( row ) => {\n\t\t\texpand( row?.dataset?.block );\n\t\t},\n\t\t[ expand ]\n\t);\n\tconst collapseRow = useCallback(\n\t\t( row ) => {\n\t\t\tcollapse( row?.dataset?.block );\n\t\t},\n\t\t[ collapse ]\n\t);\n\tconst focusRow = useCallback(\n\t\t( event, startRow, endRow ) => {\n\t\t\tif ( event.shiftKey ) {\n\t\t\t\tupdateBlockSelection(\n\t\t\t\t\tevent,\n\t\t\t\t\tstartRow?.dataset?.block,\n\t\t\t\t\tendRow?.dataset?.block\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ updateBlockSelection ]\n\t);\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tisTreeGridMounted: isMounted.current,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tcollapse,\n\t\t\tBlockSettingsMenu,\n\t\t\tlistViewInstanceId: instanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\ttreeGridElementRef: elementRef,\n\t\t} ),\n\t\t[\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tcollapse,\n\t\t\tBlockSettingsMenu,\n\t\t\tinstanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t]\n\t);\n\n\t// List View renders a fixed number of items and relies on each having a fixed item height of 36px.\n\t// If this value changes, we should also change the itemHeight value set in useFixedWindowList.\n\t// See: https://github.com/WordPress/gutenberg/pull/35230 for additional context.\n\tconst [ fixedListWindow ] = useFixedWindowList(\n\t\telementRef,\n\t\tBLOCK_LIST_ITEM_HEIGHT,\n\t\tvisibleBlockCount,\n\t\t{\n\t\t\t// Ensure that the windowing logic is recalculated when the expanded state changes.\n\t\t\t// This is necessary because expanding a collapsed block in a short list view can\n\t\t\t// switch the list view to a tall list view with a scrollbar, and vice versa.\n\t\t\t// When this happens, the windowing logic needs to be recalculated to ensure that\n\t\t\t// the correct number of blocks are rendered, by rechecking for a scroll container.\n\t\t\texpandedState,\n\t\t\tuseWindowing: true,\n\t\t\twindowOverscan: 40,\n\t\t}\n\t);\n\n\t// If there are no blocks to show and we're not showing the appender, do not render the list view.\n\tif ( ! clientIdsTree.length && ! showAppender ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<AsyncModeProvider value={ true }>\n\t\t\t<ListViewDropIndicator\n\t\t\t\tlistViewRef={ elementRef }\n\t\t\t\tblockDropTarget={ blockDropTarget }\n\t\t\t/>\n\t\t\t<TreeGrid\n\t\t\t\tid={ id }\n\t\t\t\tclassName=\"block-editor-list-view-tree\"\n\t\t\t\taria-label={ __( 'Block navigation structure' ) }\n\t\t\t\tref={ treeGridRef }\n\t\t\t\tonCollapseRow={ collapseRow }\n\t\t\t\tonExpandRow={ expandRow }\n\t\t\t\tonFocusRow={ focusRow }\n\t\t\t\tapplicationAriaLabel={ __( 'Block navigation structure' ) }\n\t\t\t\t// eslint-disable-next-line jsx-a11y/aria-props\n\t\t\t\taria-description={ description }\n\t\t\t>\n\t\t\t\t<ListViewContext.Provider value={ contextValue }>\n\t\t\t\t\t<ListViewBranch\n\t\t\t\t\t\tblocks={ clientIdsTree }\n\t\t\t\t\t\tparentId={ rootClientId }\n\t\t\t\t\t\tselectBlock={ selectEditorBlock }\n\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\tfixedListWindow={ fixedListWindow }\n\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\tshouldShowInnerBlocks={ shouldShowInnerBlocks }\n\t\t\t\t\t\tshowAppender={ showAppender }\n\t\t\t\t\t/>\n\t\t\t\t</ListViewContext.Provider>\n\t\t\t</TreeGrid>\n\t\t</AsyncModeProvider>\n\t);\n}\n\n// This is the private API for the ListView component.\n// It allows access to all props, not just the public ones.\nexport const PrivateListView = forwardRef( ListViewComponent );\n\n// This is the public API for the ListView component.\n// We wrap the PrivateListView component to hide some props from the public API.\nexport default forwardRef( ( props, ref ) => {\n\treturn (\n\t\t<PrivateListView\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tshowAppender={ false }\n\t\t\trootClientId={ null }\n\t\t\tonSelect={ null }\n\t\t\tadditionalBlockContent={ null }\n\t\t\tblockSettingsMenu={ undefined }\n\t\t/>\n\t);\n} );\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,aAAa,EACbC,YAAY,EACZC,gCAAgC,IAAIC,kBAAkB,QAChD,oBAAoB;AAC3B,SAASC,sBAAsB,IAAIC,QAAQ,QAAQ,uBAAuB;AAC1E,SAASC,iBAAiB,EAAEC,SAAS,QAAQ,iBAAiB;AAC9D,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,SACCC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,UAAU,EACVC,UAAU,EACVC,QAAQ,QACF,oBAAoB;AAC3B,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,cAAc,MAAM,UAAU;AACrC,SAASC,eAAe,QAAQ,WAAW;AAC3C,OAAOC,qBAAqB,MAAM,kBAAkB;AACpD,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,OAAOC,mBAAmB,MAAM,2BAA2B;AAC3D,OAAOC,6BAA6B,MAAM,sCAAsC;AAChF,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,qBAA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AE,EAAGA,EAAI;IACTwE,SAAS,EAAC,6BAA6B;IACvC,cAAa3F,EAAE,CAAE,4BAA6B,CAAG;IACjDmC,GAAG,EAAGuB,WAAa;IACnBkC,aAAa,EAAGhB,WAAa;IAC7BiB,WAAW,EAAGrB,SAAW;IACzBsB,UAAU,EAAGjB,QAAU;IACvBkB,oBAAoB,EAAG/F,EAAE,CAAE,4BAA6B;IACxD;IAAA;IACA,oBAAmB+B;EAAa,GAEhCyD,aAAA,CAACtF,eAAe,CAAC8F,QAAQ;IAACP,KAAK,EAAGR;EAAc,GAC/CO,aAAA,CAACvF,cAAc;IACdsB,MAAM,EAAGgB,aAAe;IACxB0D,QAAQ,EAAGnE,YAAc;IACzBoE,WAAW,EAAGlC,iBAAmB;IACjCvC,eAAe,EAAGA,eAAiB;IACnC4D,eAAe,EAAGA,eAAiB;IACnC5C,iBAAiB,EAAGA,iBAAmB;IACvCf,UAAU,EAAGA,UAAY;IACzBkB,qBAAqB,EAAGA,qBAAuB;IAC/CjB,YAAY,EAAGA;EAAc,CAC7B,CACwB,CACjB,CACQ,CAAC;AAEtB;;AAEA;AACA;AACA,OAAO,MAAMwE,eAAe,GAAGrG,UAAU,CAAEwB,iBAAkB,CAAC;;AAE9D;AACA;AACA,eAAexB,UAAU,CAAE,CAAEsG,KAAK,EAAEjE,GAAG,KAAM;EAC5C,OACCqD,aAAA,CAACW,eAAe;IACfhE,GAAG,EAAGA,GAAK;IAAA,GACNiE,KAAK;IACVzE,YAAY,EAAG,KAAO;IACtBG,YAAY,EAAG,IAAM;IACrBE,QAAQ,EAAG,IAAM;IACjBC,sBAAsB,EAAG,IAAM;IAC/BL,iBAAiB,EAAGyE;EAAW,CAC/B,CAAC;AAEJ,CAAE,CAAC"}
1
+ {"version":3,"names":["useInstanceId","useMergeRefs","__experimentalUseFixedWindowList","useFixedWindowList","__experimentalTreeGrid","TreeGrid","AsyncModeProvider","useSelect","deprecated","useCallback","useEffect","useMemo","useRef","useReducer","forwardRef","useState","__","ListViewBranch","ListViewContext","ListViewDropIndicator","useBlockSelection","useListViewClientIds","useListViewDropZone","useListViewExpandSelectedItem","store","blockEditorStore","BlockSettingsDropdown","focusListItem","expanded","state","action","Array","isArray","clientIds","reduce","newState","id","type","BLOCK_LIST_ITEM_HEIGHT","ListViewComponent","blocks","dropZoneElement","showBlockMovers","isExpanded","showAppender","blockSettingsMenu","BlockSettingsMenu","rootClientId","description","onSelect","additionalBlockContent","AdditionalBlockContent","ref","since","alternative","instanceId","clientIdsTree","draggedClientIds","selectedClientIds","getBlock","visibleBlockCount","shouldShowInnerBlocks","select","getGlobalBlockCount","getClientIdsOfDescendants","__unstableGetEditorMode","draggedBlockCount","length","updateBlockSelection","expandedState","setExpandedState","dropZoneRef","target","blockDropTarget","elementRef","treeGridRef","insertedBlock","setInsertedBlock","setSelectedTreeId","firstSelectedBlockClientId","selectEditorBlock","event","blockClientId","focusPosition","expand","clientId","collapse","expandRow","row","dataset","block","collapseRow","focusRow","startRow","endRow","shiftKey","contextValue","listViewInstanceId","treeGridElementRef","fixedListWindow","useWindowing","windowOverscan","createElement","value","listViewRef","className","onCollapseRow","onExpandRow","onFocusRow","applicationAriaLabel","Provider","parentId","selectBlock","PrivateListView","props","undefined"],"sources":["@wordpress/block-editor/src/components/list-view/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tuseInstanceId,\n\tuseMergeRefs,\n\t__experimentalUseFixedWindowList as useFixedWindowList,\n} from '@wordpress/compose';\nimport { __experimentalTreeGrid as TreeGrid } from '@wordpress/components';\nimport { AsyncModeProvider, useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseReducer,\n\tforwardRef,\n\tuseState,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ListViewBranch from './branch';\nimport { ListViewContext } from './context';\nimport ListViewDropIndicator from './drop-indicator';\nimport useBlockSelection from './use-block-selection';\nimport useListViewClientIds from './use-list-view-client-ids';\nimport useListViewDropZone from './use-list-view-drop-zone';\nimport useListViewExpandSelectedItem from './use-list-view-expand-selected-item';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockSettingsDropdown } from '../block-settings-menu/block-settings-dropdown';\nimport { focusListItem } from './utils';\n\nconst expanded = ( state, action ) => {\n\tif ( Array.isArray( action.clientIds ) ) {\n\t\treturn {\n\t\t\t...state,\n\t\t\t...action.clientIds.reduce(\n\t\t\t\t( newState, id ) => ( {\n\t\t\t\t\t...newState,\n\t\t\t\t\t[ id ]: action.type === 'expand',\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t\t),\n\t\t};\n\t}\n\treturn state;\n};\n\nexport const BLOCK_LIST_ITEM_HEIGHT = 36;\n\n/** @typedef {import('react').ComponentType} ComponentType */\n/** @typedef {import('react').Ref<HTMLElement>} Ref */\n\n/**\n * Show a hierarchical list of blocks.\n *\n * @param {Object} props Components props.\n * @param {string} props.id An HTML element id for the root element of ListView.\n * @param {Array} props.blocks _deprecated_ Custom subset of block client IDs to be used instead of the default hierarchy.\n * @param {?HTMLElement} props.dropZoneElement Optional element to be used as the drop zone.\n * @param {?boolean} props.showBlockMovers Flag to enable block movers. Defaults to `false`.\n * @param {?boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. Defaults to `false`.\n * @param {?boolean} props.showAppender Flag to show or hide the block appender. Defaults to `false`.\n * @param {?ComponentType} props.blockSettingsMenu Optional more menu substitution. Defaults to the standard `BlockSettingsDropdown` component.\n * @param {string} props.rootClientId The client id of the root block from which we determine the blocks to show in the list.\n * @param {string} props.description Optional accessible description for the tree grid component.\n * @param {?Function} props.onSelect Optional callback to be invoked when a block is selected. Receives the block object that was selected.\n * @param {?ComponentType} props.additionalBlockContent Component that renders additional block content UI.\n * @param {Ref} ref Forwarded ref\n */\nfunction ListViewComponent(\n\t{\n\t\tid,\n\t\tblocks,\n\t\tdropZoneElement,\n\t\tshowBlockMovers = false,\n\t\tisExpanded = false,\n\t\tshowAppender = false,\n\t\tblockSettingsMenu: BlockSettingsMenu = BlockSettingsDropdown,\n\t\trootClientId,\n\t\tdescription,\n\t\tonSelect,\n\t\tadditionalBlockContent: AdditionalBlockContent,\n\t},\n\tref\n) {\n\t// This can be removed once we no longer need to support the blocks prop.\n\tif ( blocks ) {\n\t\tdeprecated(\n\t\t\t'`blocks` property in `wp.blockEditor.__experimentalListView`',\n\t\t\t{\n\t\t\t\tsince: '6.3',\n\t\t\t\talternative: '`rootClientId` property',\n\t\t\t}\n\t\t);\n\t}\n\n\tconst instanceId = useInstanceId( ListViewComponent );\n\tconst { clientIdsTree, draggedClientIds, selectedClientIds } =\n\t\tuseListViewClientIds( { blocks, rootClientId } );\n\n\tconst { getBlock } = useSelect( blockEditorStore );\n\tconst { visibleBlockCount, shouldShowInnerBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetGlobalBlockCount,\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst draggedBlockCount =\n\t\t\t\tdraggedClientIds?.length > 0\n\t\t\t\t\t? getClientIdsOfDescendants( draggedClientIds ).length + 1\n\t\t\t\t\t: 0;\n\t\t\treturn {\n\t\t\t\tvisibleBlockCount: getGlobalBlockCount() - draggedBlockCount,\n\t\t\t\tshouldShowInnerBlocks: __unstableGetEditorMode() !== 'zoom-out',\n\t\t\t};\n\t\t},\n\t\t[ draggedClientIds ]\n\t);\n\n\tconst { updateBlockSelection } = useBlockSelection();\n\n\tconst [ expandedState, setExpandedState ] = useReducer( expanded, {} );\n\n\tconst { ref: dropZoneRef, target: blockDropTarget } = useListViewDropZone( {\n\t\tdropZoneElement,\n\t} );\n\tconst elementRef = useRef();\n\tconst treeGridRef = useMergeRefs( [ elementRef, dropZoneRef, ref ] );\n\n\tconst [ insertedBlock, setInsertedBlock ] = useState( null );\n\n\tconst { setSelectedTreeId } = useListViewExpandSelectedItem( {\n\t\tfirstSelectedBlockClientId: selectedClientIds[ 0 ],\n\t\tsetExpandedState,\n\t} );\n\tconst selectEditorBlock = useCallback(\n\t\t/**\n\t\t * @param {MouseEvent | KeyboardEvent | undefined} event\n\t\t * @param {string} blockClientId\n\t\t * @param {null | undefined | -1 | 1} focusPosition\n\t\t */\n\t\t( event, blockClientId, focusPosition ) => {\n\t\t\tupdateBlockSelection( event, blockClientId, null, focusPosition );\n\t\t\tsetSelectedTreeId( blockClientId );\n\t\t\tif ( onSelect ) {\n\t\t\t\tonSelect( getBlock( blockClientId ) );\n\t\t\t}\n\t\t},\n\t\t[ setSelectedTreeId, updateBlockSelection, onSelect, getBlock ]\n\t);\n\tuseEffect( () => {\n\t\t// If a blocks are already selected when the list view is initially\n\t\t// mounted, shift focus to the first selected block.\n\t\tif ( selectedClientIds?.length ) {\n\t\t\tfocusListItem( selectedClientIds[ 0 ], elementRef );\n\t\t}\n\t\t// Disable reason: Only focus on the selected item when the list view is mounted.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tconst expand = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetExpandedState( { type: 'expand', clientIds: [ clientId ] } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapse = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetExpandedState( { type: 'collapse', clientIds: [ clientId ] } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst expandRow = useCallback(\n\t\t( row ) => {\n\t\t\texpand( row?.dataset?.block );\n\t\t},\n\t\t[ expand ]\n\t);\n\tconst collapseRow = useCallback(\n\t\t( row ) => {\n\t\t\tcollapse( row?.dataset?.block );\n\t\t},\n\t\t[ collapse ]\n\t);\n\tconst focusRow = useCallback(\n\t\t( event, startRow, endRow ) => {\n\t\t\tif ( event.shiftKey ) {\n\t\t\t\tupdateBlockSelection(\n\t\t\t\t\tevent,\n\t\t\t\t\tstartRow?.dataset?.block,\n\t\t\t\t\tendRow?.dataset?.block\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ updateBlockSelection ]\n\t);\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tcollapse,\n\t\t\tBlockSettingsMenu,\n\t\t\tlistViewInstanceId: instanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\ttreeGridElementRef: elementRef,\n\t\t} ),\n\t\t[\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tcollapse,\n\t\t\tBlockSettingsMenu,\n\t\t\tinstanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t]\n\t);\n\n\t// List View renders a fixed number of items and relies on each having a fixed item height of 36px.\n\t// If this value changes, we should also change the itemHeight value set in useFixedWindowList.\n\t// See: https://github.com/WordPress/gutenberg/pull/35230 for additional context.\n\tconst [ fixedListWindow ] = useFixedWindowList(\n\t\telementRef,\n\t\tBLOCK_LIST_ITEM_HEIGHT,\n\t\tvisibleBlockCount,\n\t\t{\n\t\t\t// Ensure that the windowing logic is recalculated when the expanded state changes.\n\t\t\t// This is necessary because expanding a collapsed block in a short list view can\n\t\t\t// switch the list view to a tall list view with a scrollbar, and vice versa.\n\t\t\t// When this happens, the windowing logic needs to be recalculated to ensure that\n\t\t\t// the correct number of blocks are rendered, by rechecking for a scroll container.\n\t\t\texpandedState,\n\t\t\tuseWindowing: true,\n\t\t\twindowOverscan: 40,\n\t\t}\n\t);\n\n\t// If there are no blocks to show and we're not showing the appender, do not render the list view.\n\tif ( ! clientIdsTree.length && ! showAppender ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<AsyncModeProvider value={ true }>\n\t\t\t<ListViewDropIndicator\n\t\t\t\tlistViewRef={ elementRef }\n\t\t\t\tblockDropTarget={ blockDropTarget }\n\t\t\t/>\n\t\t\t<TreeGrid\n\t\t\t\tid={ id }\n\t\t\t\tclassName=\"block-editor-list-view-tree\"\n\t\t\t\taria-label={ __( 'Block navigation structure' ) }\n\t\t\t\tref={ treeGridRef }\n\t\t\t\tonCollapseRow={ collapseRow }\n\t\t\t\tonExpandRow={ expandRow }\n\t\t\t\tonFocusRow={ focusRow }\n\t\t\t\tapplicationAriaLabel={ __( 'Block navigation structure' ) }\n\t\t\t\t// eslint-disable-next-line jsx-a11y/aria-props\n\t\t\t\taria-description={ description }\n\t\t\t>\n\t\t\t\t<ListViewContext.Provider value={ contextValue }>\n\t\t\t\t\t<ListViewBranch\n\t\t\t\t\t\tblocks={ clientIdsTree }\n\t\t\t\t\t\tparentId={ rootClientId }\n\t\t\t\t\t\tselectBlock={ selectEditorBlock }\n\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\tfixedListWindow={ fixedListWindow }\n\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\tshouldShowInnerBlocks={ shouldShowInnerBlocks }\n\t\t\t\t\t\tshowAppender={ showAppender }\n\t\t\t\t\t/>\n\t\t\t\t</ListViewContext.Provider>\n\t\t\t</TreeGrid>\n\t\t</AsyncModeProvider>\n\t);\n}\n\n// This is the private API for the ListView component.\n// It allows access to all props, not just the public ones.\nexport const PrivateListView = forwardRef( ListViewComponent );\n\n// This is the public API for the ListView component.\n// We wrap the PrivateListView component to hide some props from the public API.\nexport default forwardRef( ( props, ref ) => {\n\treturn (\n\t\t<PrivateListView\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tshowAppender={ false }\n\t\t\trootClientId={ null }\n\t\t\tonSelect={ null }\n\t\t\tadditionalBlockContent={ null }\n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B;IACjCtC,eAAe,EAAGA,eAAiB;IACnCyD,eAAe,EAAGA,eAAiB;IACnCzC,iBAAiB,EAAGA,iBAAmB;IACvCf,UAAU,EAAGA,UAAY;IACzBkB,qBAAqB,EAAGA,qBAAuB;IAC/CjB,YAAY,EAAGA;EAAc,CAC7B,CACwB,CACjB,CACQ,CAAC;AAEtB;;AAEA;AACA;AACA,OAAO,MAAMqE,eAAe,GAAGnG,UAAU,CAAEyB,iBAAkB,CAAC;;AAE9D;AACA;AACA,eAAezB,UAAU,CAAE,CAAEoG,KAAK,EAAE9D,GAAG,KAAM;EAC5C,OACCkD,aAAA,CAACW,eAAe;IACf7D,GAAG,EAAGA,GAAK;IAAA,GACN8D,KAAK;IACVtE,YAAY,EAAG,KAAO;IACtBG,YAAY,EAAG,IAAM;IACrBE,QAAQ,EAAG,IAAM;IACjBC,sBAAsB,EAAG,IAAM;IAC/BL,iBAAiB,EAAGsE;EAAW,CAC/B,CAAC;AAEJ,CAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
@@ -2,6 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __, sprintf } from '@wordpress/i18n';
5
+ import { focus } from '@wordpress/dom';
5
6
  export const getBlockPositionDescription = (position, siblingCount, level) => sprintf( /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
6
7
  __('Block %1$d of %2$d, Level %3$d'), position, siblingCount, level);
7
8
 
@@ -40,4 +41,37 @@ export function getCommonDepthClientIds(startId, endId, startParents, endParents
40
41
  end
41
42
  };
42
43
  }
44
+
45
+ /**
46
+ * Shift focus to the list view item associated with a particular clientId.
47
+ *
48
+ * @typedef {import('@wordpress/element').RefObject} RefObject
49
+ *
50
+ * @param {string} focusClientId The client ID of the block to focus.
51
+ * @param {RefObject<HTMLElement>} treeGridElementRef The container element to search within.
52
+ */
53
+ export function focusListItem(focusClientId, treeGridElementRef) {
54
+ const getFocusElement = () => {
55
+ const row = treeGridElementRef.current?.querySelector(`[role=row][data-block="${focusClientId}"]`);
56
+ if (!row) return null;
57
+ // Focus the first focusable in the row, which is the ListViewBlockSelectButton.
58
+ return focus.focusable.find(row)[0];
59
+ };
60
+ let focusElement = getFocusElement();
61
+ if (focusElement) {
62
+ focusElement.focus();
63
+ } else {
64
+ // The element hasn't been painted yet. Defer focusing on the next frame.
65
+ // This could happen when all blocks have been deleted and the default block
66
+ // hasn't been added to the editor yet.
67
+ window.requestAnimationFrame(() => {
68
+ focusElement = getFocusElement();
69
+
70
+ // Ignore if the element still doesn't exist.
71
+ if (focusElement) {
72
+ focusElement.focus();
73
+ }
74
+ });
75
+ }
76
+ }
43
77
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","sprintf","getBlockPositionDescription","position","siblingCount","level","isClientIdSelected","clientId","selectedBlockClientIds","Array","isArray","length","indexOf","getCommonDepthClientIds","startId","endId","startParents","endParents","startPath","endPath","depth","Math","min","start","end"],"sources":["@wordpress/block-editor/src/components/list-view/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\nexport const getBlockPositionDescription = ( position, siblingCount, level ) =>\n\tsprintf(\n\t\t/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */\n\t\t__( 'Block %1$d of %2$d, Level %3$d' ),\n\t\tposition,\n\t\tsiblingCount,\n\t\tlevel\n\t);\n\n/**\n * Returns true if the client ID occurs within the block selection or multi-selection,\n * or false otherwise.\n *\n * @param {string} clientId Block client ID.\n * @param {string|string[]} selectedBlockClientIds Selected block client ID, or an array of multi-selected blocks client IDs.\n *\n * @return {boolean} Whether the block is in multi-selection set.\n */\nexport const isClientIdSelected = ( clientId, selectedBlockClientIds ) =>\n\tArray.isArray( selectedBlockClientIds ) && selectedBlockClientIds.length\n\t\t? selectedBlockClientIds.indexOf( clientId ) !== -1\n\t\t: selectedBlockClientIds === clientId;\n\n/**\n * From a start and end clientId of potentially different nesting levels,\n * return the nearest-depth ids that have a common level of depth in the\n * nesting hierarchy. For multiple block selection, this ensure that the\n * selection is always at the same nesting level, and not split across\n * separate levels.\n *\n * @param {string} startId The first id of a selection.\n * @param {string} endId The end id of a selection, usually one that has been clicked on.\n * @param {string[]} startParents An array of ancestor ids for the start id, in descending order.\n * @param {string[]} endParents An array of ancestor ids for the end id, in descending order.\n * @return {Object} An object containing the start and end ids.\n */\nexport function getCommonDepthClientIds(\n\tstartId,\n\tendId,\n\tstartParents,\n\tendParents\n) {\n\tconst startPath = [ ...startParents, startId ];\n\tconst endPath = [ ...endParents, endId ];\n\tconst depth = Math.min( startPath.length, endPath.length ) - 1;\n\tconst start = startPath[ depth ];\n\tconst end = endPath[ depth ];\n\n\treturn {\n\t\tstart,\n\t\tend,\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAE7C,OAAO,MAAMC,2BAA2B,GAAGA,CAAEC,QAAQ,EAAEC,YAAY,EAAEC,KAAK,KACzEJ,OAAO,EACN;AACAD,EAAE,CAAE,gCAAiC,CAAC,EACtCG,QAAQ,EACRC,YAAY,EACZC,KACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAGA,CAAEC,QAAQ,EAAEC,sBAAsB,KACnEC,KAAK,CAACC,OAAO,CAAEF,sBAAuB,CAAC,IAAIA,sBAAsB,CAACG,MAAM,GACrEH,sBAAsB,CAACI,OAAO,CAAEL,QAAS,CAAC,KAAK,CAAC,CAAC,GACjDC,sBAAsB,KAAKD,QAAQ;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASM,uBAAuBA,CACtCC,OAAO,EACPC,KAAK,EACLC,YAAY,EACZC,UAAU,EACT;EACD,MAAMC,SAAS,GAAG,CAAE,GAAGF,YAAY,EAAEF,OAAO,CAAE;EAC9C,MAAMK,OAAO,GAAG,CAAE,GAAGF,UAAU,EAAEF,KAAK,CAAE;EACxC,MAAMK,KAAK,GAAGC,IAAI,CAACC,GAAG,CAAEJ,SAAS,CAACP,MAAM,EAAEQ,OAAO,CAACR,MAAO,CAAC,GAAG,CAAC;EAC9D,MAAMY,KAAK,GAAGL,SAAS,CAAEE,KAAK,CAAE;EAChC,MAAMI,GAAG,GAAGL,OAAO,CAAEC,KAAK,CAAE;EAE5B,OAAO;IACNG,KAAK;IACLC;EACD,CAAC;AACF"}
1
+ {"version":3,"names":["__","sprintf","focus","getBlockPositionDescription","position","siblingCount","level","isClientIdSelected","clientId","selectedBlockClientIds","Array","isArray","length","indexOf","getCommonDepthClientIds","startId","endId","startParents","endParents","startPath","endPath","depth","Math","min","start","end","focusListItem","focusClientId","treeGridElementRef","getFocusElement","row","current","querySelector","focusable","find","focusElement","window","requestAnimationFrame"],"sources":["@wordpress/block-editor/src/components/list-view/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { focus } from '@wordpress/dom';\n\nexport const getBlockPositionDescription = ( position, siblingCount, level ) =>\n\tsprintf(\n\t\t/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */\n\t\t__( 'Block %1$d of %2$d, Level %3$d' ),\n\t\tposition,\n\t\tsiblingCount,\n\t\tlevel\n\t);\n\n/**\n * Returns true if the client ID occurs within the block selection or multi-selection,\n * or false otherwise.\n *\n * @param {string} clientId Block client ID.\n * @param {string|string[]} selectedBlockClientIds Selected block client ID, or an array of multi-selected blocks client IDs.\n *\n * @return {boolean} Whether the block is in multi-selection set.\n */\nexport const isClientIdSelected = ( clientId, selectedBlockClientIds ) =>\n\tArray.isArray( selectedBlockClientIds ) && selectedBlockClientIds.length\n\t\t? selectedBlockClientIds.indexOf( clientId ) !== -1\n\t\t: selectedBlockClientIds === clientId;\n\n/**\n * From a start and end clientId of potentially different nesting levels,\n * return the nearest-depth ids that have a common level of depth in the\n * nesting hierarchy. For multiple block selection, this ensure that the\n * selection is always at the same nesting level, and not split across\n * separate levels.\n *\n * @param {string} startId The first id of a selection.\n * @param {string} endId The end id of a selection, usually one that has been clicked on.\n * @param {string[]} startParents An array of ancestor ids for the start id, in descending order.\n * @param {string[]} endParents An array of ancestor ids for the end id, in descending order.\n * @return {Object} An object containing the start and end ids.\n */\nexport function getCommonDepthClientIds(\n\tstartId,\n\tendId,\n\tstartParents,\n\tendParents\n) {\n\tconst startPath = [ ...startParents, startId ];\n\tconst endPath = [ ...endParents, endId ];\n\tconst depth = Math.min( startPath.length, endPath.length ) - 1;\n\tconst start = startPath[ depth ];\n\tconst end = endPath[ depth ];\n\n\treturn {\n\t\tstart,\n\t\tend,\n\t};\n}\n\n/**\n * Shift focus to the list view item associated with a particular clientId.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {string} focusClientId The client ID of the block to focus.\n * @param {RefObject<HTMLElement>} treeGridElementRef The container element to search within.\n */\nexport function focusListItem( focusClientId, treeGridElementRef ) {\n\tconst getFocusElement = () => {\n\t\tconst row = treeGridElementRef.current?.querySelector(\n\t\t\t`[role=row][data-block=\"${ focusClientId }\"]`\n\t\t);\n\t\tif ( ! row ) return null;\n\t\t// Focus the first focusable in the row, which is the ListViewBlockSelectButton.\n\t\treturn focus.focusable.find( row )[ 0 ];\n\t};\n\n\tlet focusElement = getFocusElement();\n\tif ( focusElement ) {\n\t\tfocusElement.focus();\n\t} else {\n\t\t// The element hasn't been painted yet. Defer focusing on the next frame.\n\t\t// This could happen when all blocks have been deleted and the default block\n\t\t// hasn't been added to the editor yet.\n\t\twindow.requestAnimationFrame( () => {\n\t\t\tfocusElement = getFocusElement();\n\n\t\t\t// Ignore if the element still doesn't exist.\n\t\t\tif ( focusElement ) {\n\t\t\t\tfocusElement.focus();\n\t\t\t}\n\t\t} );\n\t}\n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,KAAM;IAC7B,MAAMC,GAAG,GAAGF,kBAAkB,CAACG,OAAO,EAAEC,aAAa,CACnD,0BAA0BL,aAAe,IAC3C,CAAC;IACD,IAAK,CAAEG,GAAG,EAAG,OAAO,IAAI;IACxB;IACA,OAAO5B,KAAK,CAAC+B,SAAS,CAACC,IAAI,CAAEJ,GAAI,CAAC,CAAE,CAAC,CAAE;EACxC,CAAC;EAED,IAAIK,YAAY,GAAGN,eAAe,CAAC,CAAC;EACpC,IAAKM,YAAY,EAAG;IACnBA,YAAY,CAACjC,KAAK,CAAC,CAAC;EACrB,CAAC,MAAM;IACN;IACA;IACA;IACAkC,MAAM,CAACC,qBAAqB,CAAE,MAAM;MACnCF,YAAY,GAAGN,eAAe,CAAC,CAAC;;MAEhC;MACA,IAAKM,YAAY,EAAG;QACnBA,YAAY,CAACjC,KAAK,CAAC,CAAC;MACrB;IACD,CAAE,CAAC;EACJ;AACD"}
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement, Fragment } from "@wordpress/element";
1
+ import { createElement, Fragment } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
@@ -1,4 +1,4 @@
1
- import { createElement } from "@wordpress/element";
1
+ import { createElement } from "react";
2
2
  /**
3
3
  * External dependencies
4
4
  */
@@ -8,7 +8,6 @@ export const MEDIA_TYPE_AUDIO = 'audio';
8
8
  export const MEDIA_TYPE_ANY = 'any';
9
9
  export const OPTION_TAKE_VIDEO = __('Take a Video');
10
10
  export const OPTION_TAKE_PHOTO = __('Take a Photo');
11
- export const OPTION_TAKE_PHOTO_OR_VIDEO = __('Take a Photo or Video');
12
11
  export const OPTION_INSERT_FROM_URL = __('Insert from URL');
13
12
  export const OPTION_WORDPRESS_MEDIA_LIBRARY = __('WordPress Media Library');
14
- //# sourceMappingURL=constants.js.map
13
+ //# sourceMappingURL=constants.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__","MEDIA_TYPE_IMAGE","MEDIA_TYPE_VIDEO","MEDIA_TYPE_AUDIO","MEDIA_TYPE_ANY","OPTION_TAKE_VIDEO","OPTION_TAKE_PHOTO","OPTION_INSERT_FROM_URL","OPTION_WORDPRESS_MEDIA_LIBRARY"],"sources":["@wordpress/block-editor/src/components/media-upload/constants.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const MEDIA_TYPE_IMAGE = 'image';\nexport const MEDIA_TYPE_VIDEO = 'video';\nexport const MEDIA_TYPE_AUDIO = 'audio';\nexport const MEDIA_TYPE_ANY = 'any';\n\nexport const OPTION_TAKE_VIDEO = __( 'Take a Video' );\nexport const OPTION_TAKE_PHOTO = __( 'Take a Photo' );\nexport const OPTION_INSERT_FROM_URL = __( 'Insert from URL' );\nexport const OPTION_WORDPRESS_MEDIA_LIBRARY = __( 'WordPress Media Library' );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AAEpC,OAAO,MAAMC,gBAAgB,GAAG,OAAO;AACvC,OAAO,MAAMC,gBAAgB,GAAG,OAAO;AACvC,OAAO,MAAMC,gBAAgB,GAAG,OAAO;AACvC,OAAO,MAAMC,cAAc,GAAG,KAAK;AAEnC,OAAO,MAAMC,iBAAiB,GAAGL,EAAE,CAAE,cAAe,CAAC;AACrD,OAAO,MAAMM,iBAAiB,GAAGN,EAAE,CAAE,cAAe,CAAC;AACrD,OAAO,MAAMO,sBAAsB,GAAGP,EAAE,CAAE,iBAAkB,CAAC;AAC7D,OAAO,MAAMQ,8BAA8B,GAAGR,EAAE,CAAE,yBAA0B,CAAC"}
@@ -8,7 +8,7 @@ import { withFilters } from '@wordpress/components';
8
8
  * an integration with the core blocks that handle media files. By default it renders nothing but
9
9
  * it provides a way to have it overridden with the `editor.MediaUpload` filter.
10
10
  *
11
- * @return {WPComponent} The component to be rendered.
11
+ * @return {Component} The component to be rendered.
12
12
  */
13
13
  const MediaUpload = () => null;
14
14