@wordpress/block-editor 12.19.5 → 12.21.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 (443) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/block-canvas/index.js +2 -0
  3. package/build/components/block-canvas/index.js.map +1 -1
  4. package/build/components/block-heading-level-dropdown/index.js +14 -17
  5. package/build/components/block-heading-level-dropdown/index.js.map +1 -1
  6. package/build/components/block-inspector/index.js +0 -3
  7. package/build/components/block-inspector/index.js.map +1 -1
  8. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  9. package/build/components/block-list/block-list-item.native.js +1 -1
  10. package/build/components/block-list/block-list-item.native.js.map +1 -1
  11. package/build/components/block-list/block-outline.native.js +23 -7
  12. package/build/components/block-list/block-outline.native.js.map +1 -1
  13. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  14. package/build/components/block-list/block.native.js +0 -3
  15. package/build/components/block-list/block.native.js.map +1 -1
  16. package/build/components/block-list/index.js +9 -9
  17. package/build/components/block-list/index.js.map +1 -1
  18. package/build/components/block-mover/index.native.js.map +1 -1
  19. package/build/components/block-popover/cover.js +68 -0
  20. package/build/components/block-popover/cover.js.map +1 -0
  21. package/build/components/block-popover/drop-zone.js +2 -3
  22. package/build/components/block-popover/drop-zone.js.map +1 -1
  23. package/build/components/block-popover/index.js +1 -19
  24. package/build/components/block-popover/index.js.map +1 -1
  25. package/build/components/block-preview/index.js +2 -1
  26. package/build/components/block-preview/index.js.map +1 -1
  27. package/build/components/block-removal-warning-modal/index.js +2 -4
  28. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  29. package/build/components/block-rename/modal.js.map +1 -1
  30. package/build/components/block-settings-menu/block-parent-selector-menu-item.js +54 -0
  31. package/build/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -0
  32. package/build/components/block-settings-menu/block-settings-dropdown.js +9 -37
  33. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  34. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  35. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  36. package/build/components/block-toolbar/index.js +7 -5
  37. package/build/components/block-toolbar/index.js.map +1 -1
  38. package/build/components/block-toolbar/shuffle.js +89 -0
  39. package/build/components/block-toolbar/shuffle.js.map +1 -0
  40. package/build/components/block-toolbar/use-has-block-toolbar.js +43 -0
  41. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -0
  42. package/build/components/block-tools/block-selection-button.js +5 -1
  43. package/build/components/block-tools/block-selection-button.js.map +1 -1
  44. package/build/components/block-tools/empty-block-inserter.js +2 -5
  45. package/build/components/block-tools/empty-block-inserter.js.map +1 -1
  46. package/build/components/block-tools/index.js +9 -26
  47. package/build/components/block-tools/index.js.map +1 -1
  48. package/build/components/block-tools/use-show-block-tools.js +60 -0
  49. package/build/components/block-tools/use-show-block-tools.js.map +1 -0
  50. package/build/components/caption/index.native.js.map +1 -1
  51. package/build/components/child-layout-control/index.js +37 -5
  52. package/build/components/child-layout-control/index.js.map +1 -1
  53. package/build/components/color-palette/control.js.map +1 -1
  54. package/build/components/colors-gradients/control.js +1 -1
  55. package/build/components/colors-gradients/control.js.map +1 -1
  56. package/build/components/date-format-picker/index.js +0 -1
  57. package/build/components/date-format-picker/index.js.map +1 -1
  58. package/build/components/font-appearance-control/index.js +1 -2
  59. package/build/components/font-appearance-control/index.js.map +1 -1
  60. package/build/components/global-styles/border-panel.js.map +1 -1
  61. package/build/components/global-styles/color-panel.js +1 -1
  62. package/build/components/global-styles/color-panel.js.map +1 -1
  63. package/build/components/global-styles/dimensions-panel.js +30 -19
  64. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  65. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  66. package/build/components/global-styles/typography-utils.js +7 -5
  67. package/build/components/global-styles/typography-utils.js.map +1 -1
  68. package/build/components/global-styles/use-global-styles-output.js +15 -15
  69. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  70. package/build/components/global-styles/utils.js +1 -1
  71. package/build/components/global-styles/utils.js.map +1 -1
  72. package/build/components/grid-visualizer/grid-item-resizer.js +77 -0
  73. package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -0
  74. package/build/components/grid-visualizer/grid-visualizer.js +81 -0
  75. package/build/components/grid-visualizer/grid-visualizer.js.map +1 -0
  76. package/build/components/grid-visualizer/index.js +20 -0
  77. package/build/components/grid-visualizer/index.js.map +1 -0
  78. package/build/components/grid-visualizer/utils.js +10 -0
  79. package/build/components/grid-visualizer/utils.js.map +1 -0
  80. package/build/components/iframe/index.js +61 -16
  81. package/build/components/iframe/index.js.map +1 -1
  82. package/build/components/index.native.js +7 -0
  83. package/build/components/index.native.js.map +1 -1
  84. package/build/components/inner-blocks/use-nested-settings-update.js +8 -2
  85. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  86. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  87. package/build/components/inserter/menu.js +9 -3
  88. package/build/components/inserter/menu.js.map +1 -1
  89. package/build/components/inserter/menu.native.js.map +1 -1
  90. package/build/components/inserter/mobile-tab-navigation.js +1 -1
  91. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  92. package/build/components/inserter/search-results.js +3 -2
  93. package/build/components/inserter/search-results.js.map +1 -1
  94. package/build/components/inserter/tabs.js +2 -1
  95. package/build/components/inserter/tabs.js.map +1 -1
  96. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  97. package/build/components/inspector-controls-tabs/index.js +1 -1
  98. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  99. package/build/components/inspector-controls-tabs/styles-tab.js +0 -4
  100. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  101. package/build/components/link-control/search-input.js.map +1 -1
  102. package/build/components/list-view/branch.js.map +1 -1
  103. package/build/components/list-view/drop-indicator.js.map +1 -1
  104. package/build/components/list-view/index.js.map +1 -1
  105. package/build/components/observe-typing/index.js +5 -10
  106. package/build/components/observe-typing/index.js.map +1 -1
  107. package/build/components/panel-color-settings/index.js.map +1 -1
  108. package/build/components/provider/index.js.map +1 -1
  109. package/build/components/resizable-box-popover/index.js +3 -5
  110. package/build/components/resizable-box-popover/index.js.map +1 -1
  111. package/build/components/responsive-block-control/index.js +1 -1
  112. package/build/components/responsive-block-control/index.js.map +1 -1
  113. package/build/components/rich-text/format-toolbar-container.js +1 -31
  114. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  115. package/build/components/rich-text/index.js +1 -2
  116. package/build/components/rich-text/index.js.map +1 -1
  117. package/build/components/skip-to-selected-block/index.js +7 -14
  118. package/build/components/skip-to-selected-block/index.js.map +1 -1
  119. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
  120. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  121. package/build/components/url-input/index.js +5 -8
  122. package/build/components/url-input/index.js.map +1 -1
  123. package/build/hooks/background.js.map +1 -1
  124. package/build/hooks/block-hooks.js.map +1 -1
  125. package/build/hooks/dimensions.js +3 -4
  126. package/build/hooks/dimensions.js.map +1 -1
  127. package/build/hooks/font-size.js +6 -7
  128. package/build/hooks/font-size.js.map +1 -1
  129. package/build/hooks/index.js +1 -1
  130. package/build/hooks/index.js.map +1 -1
  131. package/build/hooks/layout-child.js +89 -1
  132. package/build/hooks/layout-child.js.map +1 -1
  133. package/build/hooks/layout.js +11 -4
  134. package/build/hooks/layout.js.map +1 -1
  135. package/build/hooks/line-height.js.map +1 -1
  136. package/build/hooks/position.js +0 -1
  137. package/build/hooks/position.js.map +1 -1
  138. package/build/hooks/spacing-visualizer.js +115 -0
  139. package/build/hooks/spacing-visualizer.js.map +1 -0
  140. package/build/hooks/use-typography-props.js +1 -2
  141. package/build/hooks/use-typography-props.js.map +1 -1
  142. package/build/layouts/grid.js +111 -14
  143. package/build/layouts/grid.js.map +1 -1
  144. package/build/private-apis.js +2 -2
  145. package/build/private-apis.js.map +1 -1
  146. package/build/store/actions.js +4 -36
  147. package/build/store/actions.js.map +1 -1
  148. package/build/store/private-actions.js +29 -45
  149. package/build/store/private-actions.js.map +1 -1
  150. package/build/store/reducer.js +2 -4
  151. package/build/store/reducer.js.map +1 -1
  152. package/build/store/selectors.js +27 -15
  153. package/build/store/selectors.js.map +1 -1
  154. package/build/utils/calculate-scale.js +17 -0
  155. package/build/utils/calculate-scale.js.map +1 -0
  156. package/build-module/components/block-canvas/index.js +2 -0
  157. package/build-module/components/block-canvas/index.js.map +1 -1
  158. package/build-module/components/block-heading-level-dropdown/index.js +14 -17
  159. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
  160. package/build-module/components/block-inspector/index.js +1 -4
  161. package/build-module/components/block-inspector/index.js.map +1 -1
  162. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  163. package/build-module/components/block-list/block-list-item.native.js +1 -1
  164. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  165. package/build-module/components/block-list/block-outline.native.js +23 -7
  166. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  167. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  168. package/build-module/components/block-list/block.native.js +0 -3
  169. package/build-module/components/block-list/block.native.js.map +1 -1
  170. package/build-module/components/block-list/index.js +9 -9
  171. package/build-module/components/block-list/index.js.map +1 -1
  172. package/build-module/components/block-mover/index.native.js.map +1 -1
  173. package/build-module/components/block-popover/cover.js +60 -0
  174. package/build-module/components/block-popover/cover.js.map +1 -0
  175. package/build-module/components/block-popover/drop-zone.js +2 -3
  176. package/build-module/components/block-popover/drop-zone.js.map +1 -1
  177. package/build-module/components/block-popover/index.js +1 -19
  178. package/build-module/components/block-popover/index.js.map +1 -1
  179. package/build-module/components/block-preview/index.js +2 -1
  180. package/build-module/components/block-preview/index.js.map +1 -1
  181. package/build-module/components/block-removal-warning-modal/index.js +3 -5
  182. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  183. package/build-module/components/block-rename/modal.js.map +1 -1
  184. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js +46 -0
  185. package/build-module/components/block-settings-menu/block-parent-selector-menu-item.js.map +1 -0
  186. package/build-module/components/block-settings-menu/block-settings-dropdown.js +12 -40
  187. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  188. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  189. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  190. package/build-module/components/block-toolbar/index.js +7 -6
  191. package/build-module/components/block-toolbar/index.js.map +1 -1
  192. package/build-module/components/block-toolbar/shuffle.js +82 -0
  193. package/build-module/components/block-toolbar/shuffle.js.map +1 -0
  194. package/build-module/components/block-toolbar/use-has-block-toolbar.js +36 -0
  195. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -0
  196. package/build-module/components/block-tools/block-selection-button.js +5 -1
  197. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  198. package/build-module/components/block-tools/empty-block-inserter.js +2 -5
  199. package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
  200. package/build-module/components/block-tools/index.js +9 -26
  201. package/build-module/components/block-tools/index.js.map +1 -1
  202. package/build-module/components/block-tools/use-show-block-tools.js +54 -0
  203. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -0
  204. package/build-module/components/caption/index.native.js.map +1 -1
  205. package/build-module/components/child-layout-control/index.js +38 -6
  206. package/build-module/components/child-layout-control/index.js.map +1 -1
  207. package/build-module/components/color-palette/control.js.map +1 -1
  208. package/build-module/components/colors-gradients/control.js +1 -1
  209. package/build-module/components/colors-gradients/control.js.map +1 -1
  210. package/build-module/components/date-format-picker/index.js +0 -1
  211. package/build-module/components/date-format-picker/index.js.map +1 -1
  212. package/build-module/components/font-appearance-control/index.js +1 -2
  213. package/build-module/components/font-appearance-control/index.js.map +1 -1
  214. package/build-module/components/global-styles/border-panel.js.map +1 -1
  215. package/build-module/components/global-styles/color-panel.js +1 -1
  216. package/build-module/components/global-styles/color-panel.js.map +1 -1
  217. package/build-module/components/global-styles/dimensions-panel.js +30 -19
  218. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  219. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  220. package/build-module/components/global-styles/typography-utils.js +7 -5
  221. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  222. package/build-module/components/global-styles/use-global-styles-output.js +16 -16
  223. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  224. package/build-module/components/global-styles/utils.js +2 -2
  225. package/build-module/components/global-styles/utils.js.map +1 -1
  226. package/build-module/components/grid-visualizer/grid-item-resizer.js +69 -0
  227. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -0
  228. package/build-module/components/grid-visualizer/grid-visualizer.js +73 -0
  229. package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -0
  230. package/build-module/components/grid-visualizer/index.js +3 -0
  231. package/build-module/components/grid-visualizer/index.js.map +1 -0
  232. package/build-module/components/grid-visualizer/utils.js +4 -0
  233. package/build-module/components/grid-visualizer/utils.js.map +1 -0
  234. package/build-module/components/iframe/index.js +61 -16
  235. package/build-module/components/iframe/index.js.map +1 -1
  236. package/build-module/components/index.native.js +1 -1
  237. package/build-module/components/index.native.js.map +1 -1
  238. package/build-module/components/inner-blocks/use-nested-settings-update.js +8 -2
  239. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  240. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  241. package/build-module/components/inserter/menu.js +9 -3
  242. package/build-module/components/inserter/menu.js.map +1 -1
  243. package/build-module/components/inserter/menu.native.js.map +1 -1
  244. package/build-module/components/inserter/mobile-tab-navigation.js +1 -1
  245. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  246. package/build-module/components/inserter/search-results.js +3 -2
  247. package/build-module/components/inserter/search-results.js.map +1 -1
  248. package/build-module/components/inserter/tabs.js +2 -1
  249. package/build-module/components/inserter/tabs.js.map +1 -1
  250. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  251. package/build-module/components/inspector-controls-tabs/index.js +1 -1
  252. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  253. package/build-module/components/inspector-controls-tabs/styles-tab.js +0 -4
  254. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  255. package/build-module/components/link-control/search-input.js.map +1 -1
  256. package/build-module/components/list-view/branch.js.map +1 -1
  257. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  258. package/build-module/components/list-view/index.js.map +1 -1
  259. package/build-module/components/observe-typing/index.js +5 -10
  260. package/build-module/components/observe-typing/index.js.map +1 -1
  261. package/build-module/components/panel-color-settings/index.js.map +1 -1
  262. package/build-module/components/provider/index.js.map +1 -1
  263. package/build-module/components/resizable-box-popover/index.js +3 -5
  264. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  265. package/build-module/components/responsive-block-control/index.js +1 -1
  266. package/build-module/components/responsive-block-control/index.js.map +1 -1
  267. package/build-module/components/rich-text/format-toolbar-container.js +1 -31
  268. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  269. package/build-module/components/rich-text/index.js +1 -2
  270. package/build-module/components/rich-text/index.js.map +1 -1
  271. package/build-module/components/skip-to-selected-block/index.js +8 -14
  272. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  273. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +0 -1
  274. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  275. package/build-module/components/url-input/index.js +5 -8
  276. package/build-module/components/url-input/index.js.map +1 -1
  277. package/build-module/hooks/background.js.map +1 -1
  278. package/build-module/hooks/block-hooks.js.map +1 -1
  279. package/build-module/hooks/dimensions.js +1 -2
  280. package/build-module/hooks/dimensions.js.map +1 -1
  281. package/build-module/hooks/font-size.js +7 -8
  282. package/build-module/hooks/font-size.js.map +1 -1
  283. package/build-module/hooks/index.js +1 -1
  284. package/build-module/hooks/index.js.map +1 -1
  285. package/build-module/hooks/layout-child.js +89 -1
  286. package/build-module/hooks/layout-child.js.map +1 -1
  287. package/build-module/hooks/layout.js +11 -4
  288. package/build-module/hooks/layout.js.map +1 -1
  289. package/build-module/hooks/line-height.js.map +1 -1
  290. package/build-module/hooks/position.js +0 -1
  291. package/build-module/hooks/position.js.map +1 -1
  292. package/build-module/hooks/spacing-visualizer.js +106 -0
  293. package/build-module/hooks/spacing-visualizer.js.map +1 -0
  294. package/build-module/hooks/use-typography-props.js +2 -3
  295. package/build-module/hooks/use-typography-props.js.map +1 -1
  296. package/build-module/layouts/grid.js +113 -16
  297. package/build-module/layouts/grid.js.map +1 -1
  298. package/build-module/private-apis.js +2 -2
  299. package/build-module/private-apis.js.map +1 -1
  300. package/build-module/store/actions.js +4 -36
  301. package/build-module/store/actions.js.map +1 -1
  302. package/build-module/store/private-actions.js +29 -45
  303. package/build-module/store/private-actions.js.map +1 -1
  304. package/build-module/store/reducer.js +2 -4
  305. package/build-module/store/reducer.js.map +1 -1
  306. package/build-module/store/selectors.js +23 -13
  307. package/build-module/store/selectors.js.map +1 -1
  308. package/build-module/utils/calculate-scale.js +11 -0
  309. package/build-module/utils/calculate-scale.js.map +1 -0
  310. package/build-style/content-rtl.css +7 -2
  311. package/build-style/content.css +7 -2
  312. package/build-style/style-rtl.css +55 -25
  313. package/build-style/style.css +55 -25
  314. package/package.json +31 -32
  315. package/src/components/block-canvas/index.js +2 -0
  316. package/src/components/block-draggable/test/index.native.js +2 -2
  317. package/src/components/block-heading-level-dropdown/index.js +17 -25
  318. package/src/components/block-inspector/index.js +0 -11
  319. package/src/components/block-list/block-invalid-warning.native.js +1 -1
  320. package/src/components/block-list/block-list-item.native.js +1 -1
  321. package/src/components/block-list/block-outline.native.js +36 -21
  322. package/src/components/block-list/block-selection-button.native.js +1 -3
  323. package/src/components/block-list/block.native.js +0 -3
  324. package/src/components/block-list/content.scss +5 -1
  325. package/src/components/block-list/index.js +55 -55
  326. package/src/components/block-list/test/block-outline.native.js +255 -0
  327. package/src/components/block-mover/index.native.js +1 -1
  328. package/src/components/block-popover/cover.js +63 -0
  329. package/src/components/block-popover/drop-zone.js +3 -4
  330. package/src/components/block-popover/index.js +1 -28
  331. package/src/components/block-preview/index.js +3 -1
  332. package/src/components/block-removal-warning-modal/index.js +5 -19
  333. package/src/components/block-rename/modal.js +1 -1
  334. package/src/components/block-settings-menu/block-parent-selector-menu-item.js +50 -0
  335. package/src/components/block-settings-menu/block-settings-dropdown.js +9 -50
  336. package/src/components/block-styles/style.scss +0 -4
  337. package/src/components/block-switcher/block-transformations-menu.native.js +1 -1
  338. package/src/components/block-toolbar/block-toolbar-menu.native.js +2 -2
  339. package/src/components/block-toolbar/index.js +5 -11
  340. package/src/components/block-toolbar/shuffle.js +93 -0
  341. package/src/components/block-toolbar/use-has-block-toolbar.js +49 -0
  342. package/src/components/block-tools/block-selection-button.js +4 -0
  343. package/src/components/block-tools/empty-block-inserter.js +3 -6
  344. package/src/components/block-tools/index.js +13 -36
  345. package/src/components/block-tools/use-show-block-tools.js +73 -0
  346. package/src/components/caption/index.native.js +1 -1
  347. package/src/components/child-layout-control/index.js +85 -44
  348. package/src/components/color-palette/control.js +1 -1
  349. package/src/components/colors-gradients/control.js +1 -1
  350. package/src/components/colors-gradients/test/control.js +2 -2
  351. package/src/components/contrast-checker/test/index.js +10 -10
  352. package/src/components/date-format-picker/index.js +0 -1
  353. package/src/components/default-block-appender/content.scss +5 -2
  354. package/src/components/font-appearance-control/index.js +0 -1
  355. package/src/components/global-styles/border-panel.js +2 -2
  356. package/src/components/global-styles/color-panel.js +1 -1
  357. package/src/components/global-styles/dimensions-panel.js +36 -24
  358. package/src/components/global-styles/image-settings-panel.js +1 -1
  359. package/src/components/global-styles/test/typography-utils.js +231 -81
  360. package/src/components/global-styles/test/use-global-styles-output.js +3 -2
  361. package/src/components/global-styles/typography-utils.js +10 -7
  362. package/src/components/global-styles/use-global-styles-output.js +14 -16
  363. package/src/components/global-styles/utils.js +2 -8
  364. package/src/components/grid-visualizer/grid-item-resizer.js +100 -0
  365. package/src/components/grid-visualizer/grid-visualizer.js +81 -0
  366. package/src/components/grid-visualizer/index.js +2 -0
  367. package/src/components/grid-visualizer/style.scss +33 -0
  368. package/src/components/grid-visualizer/utils.js +5 -0
  369. package/src/components/iframe/index.js +78 -31
  370. package/src/components/index.native.js +1 -0
  371. package/src/components/inner-blocks/use-nested-settings-update.js +12 -2
  372. package/src/components/inserter/media-tab/media-preview.js +1 -1
  373. package/src/components/inserter/menu.js +10 -4
  374. package/src/components/inserter/menu.native.js +3 -3
  375. package/src/components/inserter/mobile-tab-navigation.js +1 -1
  376. package/src/components/inserter/search-results.js +2 -1
  377. package/src/components/inserter/style.scss +10 -0
  378. package/src/components/inserter/tabs.js +2 -1
  379. package/src/components/inspector-controls/block-support-tools-panel.js +2 -2
  380. package/src/components/inspector-controls-tabs/index.js +1 -1
  381. package/src/components/inspector-controls-tabs/styles-tab.js +0 -7
  382. package/src/components/line-height-control/test/index.js +1 -1
  383. package/src/components/link-control/search-input.js +1 -1
  384. package/src/components/list-view/branch.js +1 -1
  385. package/src/components/list-view/drop-indicator.js +1 -1
  386. package/src/components/list-view/index.js +1 -1
  387. package/src/components/observe-typing/index.js +7 -10
  388. package/src/components/panel-color-settings/index.js +1 -1
  389. package/src/components/panel-color-settings/test/index.js +3 -3
  390. package/src/components/provider/index.js +1 -4
  391. package/src/components/resizable-box-popover/index.js +4 -6
  392. package/src/components/responsive-block-control/README.md +4 -4
  393. package/src/components/responsive-block-control/index.js +1 -1
  394. package/src/components/responsive-block-control/test/index.js +5 -5
  395. package/src/components/rich-text/format-toolbar-container.js +1 -48
  396. package/src/components/rich-text/index.js +1 -2
  397. package/src/components/skip-to-selected-block/index.js +10 -13
  398. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -5
  399. package/src/components/url-input/index.js +6 -15
  400. package/src/hooks/anchor.scss +1 -1
  401. package/src/hooks/background.js +1 -1
  402. package/src/hooks/block-hooks.js +1 -1
  403. package/src/hooks/dimensions.js +1 -2
  404. package/src/hooks/font-size.js +7 -12
  405. package/src/hooks/index.js +1 -0
  406. package/src/hooks/layout-child.js +91 -1
  407. package/src/hooks/layout.js +12 -1
  408. package/src/hooks/line-height.js +1 -1
  409. package/src/hooks/position.js +0 -1
  410. package/src/hooks/spacing-visualizer.js +126 -0
  411. package/src/hooks/{padding.scss → spacing.scss} +1 -1
  412. package/src/hooks/use-typography-props.js +2 -8
  413. package/src/layouts/grid.js +137 -53
  414. package/src/layouts/test/grid.js +16 -2
  415. package/src/private-apis.js +2 -2
  416. package/src/store/actions.js +4 -42
  417. package/src/store/private-actions.js +34 -69
  418. package/src/store/reducer.js +2 -8
  419. package/src/store/selectors.js +41 -46
  420. package/src/store/test/actions.js +0 -105
  421. package/src/style.scss +2 -2
  422. package/src/utils/calculate-scale.js +20 -0
  423. package/build/components/default-style-picker/index.js +0 -70
  424. package/build/components/default-style-picker/index.js.map +0 -1
  425. package/build/hooks/margin.js +0 -86
  426. package/build/hooks/margin.js.map +0 -1
  427. package/build/hooks/padding.js +0 -78
  428. package/build/hooks/padding.js.map +0 -1
  429. package/build/utils/use-can-block-toolbar-be-focused.js +0 -46
  430. package/build/utils/use-can-block-toolbar-be-focused.js.map +0 -1
  431. package/build-module/components/default-style-picker/index.js +0 -63
  432. package/build-module/components/default-style-picker/index.js.map +0 -1
  433. package/build-module/hooks/margin.js +0 -78
  434. package/build-module/hooks/margin.js.map +0 -1
  435. package/build-module/hooks/padding.js +0 -70
  436. package/build-module/hooks/padding.js.map +0 -1
  437. package/build-module/utils/use-can-block-toolbar-be-focused.js +0 -40
  438. package/build-module/utils/use-can-block-toolbar-be-focused.js.map +0 -1
  439. package/src/components/block-settings-menu/style.scss +0 -3
  440. package/src/components/default-style-picker/index.js +0 -70
  441. package/src/hooks/margin.js +0 -91
  442. package/src/hooks/padding.js +0 -82
  443. package/src/utils/use-can-block-toolbar-be-focused.js +0 -48
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalTreeGridRow","TreeGridRow","__experimentalTreeGridCell","TreeGridCell","memo","AsyncModeProvider","useSelect","Appender","ListViewBlock","useListViewContext","getDragDisplacementValues","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","isBranchSelected","listPosition","fixedListWindow","parentId","shouldShowInnerBlocks","isSyncedBranch","showAppender","showAppenderProp","parentBlockInformation","syncedBranch","isSynced","canParentExpand","select","canEditBlock","blockDropPosition","blockDropTargetIndex","firstDraggedBlockIndex","blockIndexes","filteredBlocks","filter","Boolean","blockCount","rowCount","nextPosition","createElement","Fragment","map","index","_expandedState$client","displacement","isAfterDraggedBlocks","isNesting","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 { getDragDisplacementValues, 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\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 {\n\t\tblockDropPosition,\n\t\tblockDropTargetIndex,\n\t\tfirstDraggedBlockIndex,\n\t\tblockIndexes,\n\t\texpandedState,\n\t\tdraggedClientIds,\n\t} = 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 isDragged = !! draggedClientIds?.includes( clientId );\n\n\t\t\t\t// Determine the displacement of the block while dragging. This\n\t\t\t\t// works out whether the current block should be displaced up or\n\t\t\t\t// down, relative to the dragged blocks and the drop target.\n\t\t\t\tconst { displacement, isAfterDraggedBlocks, isNesting } =\n\t\t\t\t\tgetDragDisplacementValues( {\n\t\t\t\t\t\tblockIndexes,\n\t\t\t\t\t\tblockDropTargetIndex,\n\t\t\t\t\t\tblockDropPosition,\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\tfirstDraggedBlockIndex,\n\t\t\t\t\t\tisDragged,\n\t\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\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\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 }\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={ isDragged ? false : 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\tdisplacement={ displacement }\n\t\t\t\t\t\t\t\tisAfterDraggedBlocks={ isAfterDraggedBlocks }\n\t\t\t\t\t\t\t\tisNesting={ isNesting }\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 && ! isDragged && (\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\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,yBAAyB,EAAEC,kBAAkB,QAAQ,SAAS;AACvE,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,qBA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,CAEgB,CAAC;EAEtB,CAAE,CAAC,EACDH,YAAY,IACbkB,aAAA,CAAC/D,WAAW;IACXqC,KAAK,EAAGA,KAAO;IACfgD,OAAO,EAAGxB,QAAU;IACpByB,aAAa,EAAGzB,QAAU;IAC1BtC,UAAU,EAAG;EAAM,GAEnBwC,aAAA,CAAC7D,YAAY,QACRqF,iBAAiB,IACpBxB,aAAA,CAACzD,QAAQ;IACRgB,QAAQ,EAAGoB,QAAU;IACrB8C,YAAY,EAAGnD,KAAO;IACtBuB,UAAU,EAAGA,UAAY;IAAA,GACpB2B;EAAiB,CACtB,CAEW,CACF,CAEb,CAAC;AAEL;AAEA,eAAepF,IAAI,CAAE4B,cAAe,CAAC"}
1
+ {"version":3,"names":["__experimentalTreeGridRow","TreeGridRow","__experimentalTreeGridCell","TreeGridCell","memo","AsyncModeProvider","useSelect","Appender","ListViewBlock","useListViewContext","getDragDisplacementValues","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","isBranchSelected","listPosition","fixedListWindow","parentId","shouldShowInnerBlocks","isSyncedBranch","showAppender","showAppenderProp","parentBlockInformation","syncedBranch","isSynced","canParentExpand","select","canEditBlock","blockDropPosition","blockDropTargetIndex","firstDraggedBlockIndex","blockIndexes","filteredBlocks","filter","Boolean","blockCount","rowCount","nextPosition","createElement","Fragment","map","index","_expandedState$client","displacement","isAfterDraggedBlocks","isNesting","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 { getDragDisplacementValues, 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\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 {\n\t\tblockDropPosition,\n\t\tblockDropTargetIndex,\n\t\tfirstDraggedBlockIndex,\n\t\tblockIndexes,\n\t\texpandedState,\n\t\tdraggedClientIds,\n\t} = 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 isDragged = !! draggedClientIds?.includes( clientId );\n\n\t\t\t\t// Determine the displacement of the block while dragging. This\n\t\t\t\t// works out whether the current block should be displaced up or\n\t\t\t\t// down, relative to the dragged blocks and the drop target.\n\t\t\t\tconst { displacement, isAfterDraggedBlocks, isNesting } =\n\t\t\t\t\tgetDragDisplacementValues( {\n\t\t\t\t\t\tblockIndexes,\n\t\t\t\t\t\tblockDropTargetIndex,\n\t\t\t\t\t\tblockDropPosition,\n\t\t\t\t\t\tclientId,\n\t\t\t\t\t\tfirstDraggedBlockIndex,\n\t\t\t\t\t\tisDragged,\n\t\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\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\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 }\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={ isDragged ? false : 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\tdisplacement={ displacement }\n\t\t\t\t\t\t\t\tisAfterDraggedBlocks={ isAfterDraggedBlocks }\n\t\t\t\t\t\t\t\tisNesting={ isNesting }\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 && ! isDragged && (\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\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\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,I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AAS,EAAC;IAAoC,CAAE,CACjD,CACJ,EACCT,eAAe,IAAIC,YAAY,IAAI,CAAExD,SAAS,IAC/C2C,aAAA,CAAChC,cAAc;MACdW,QAAQ,EAAGpB,QAAU;MACrBW,MAAM,EAAGT,WAAa;MACtBU,WAAW,EAAGA,WAAa;MAC3BC,eAAe,EAAGA,eAAiB;MACnCE,KAAK,EAAGA,KAAK,GAAG,CAAG;MACnBC,IAAI,EAAGoC,WAAa;MACpBlC,YAAY,EAAGsB,YAAY,GAAG,CAAG;MACjCrB,eAAe,EAAGA,eAAiB;MACnCF,gBAAgB,EAAGwC,gBAAkB;MACrC3C,iBAAiB,EAAGA,iBAAmB;MACvCb,UAAU,EAAGA,UAAY;MACzBqB,cAAc,EAAGI;IAAc,CAC/B,CAEgB,CAAC;EAEtB,CAAE,CAAC,EACDH,YAAY,IACbkB,aAAA,CAAC/D,WAAW;IACXqC,KAAK,EAAGA,KAAO;IACfgD,OAAO,EAAGxB,QAAU;IACpByB,aAAa,EAAGzB,QAAU;IAC1BtC,UAAU;EAAA,GAEVwC,aAAA,CAAC7D,YAAY,QACRqF,iBAAiB,IACpBxB,aAAA,CAACzD,QAAQ;IACRgB,QAAQ,EAAGoB,QAAU;IACrB8C,YAAY,EAAGnD,KAAO;IACtBuB,UAAU,EAAGA,UAAY;IAAA,GACpB2B;EAAiB,CACtB,CAEW,CACF,CAEb,CAAC;AAEL;AAEA,eAAepF,IAAI,CAAE4B,cAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","__experimentalHStack","HStack","__experimentalTruncate","Truncate","Popover","getScrollContainer","useCallback","useMemo","isRTL","BlockIcon","useBlockDisplayInformation","useBlockDisplayTitle","ListViewExpander","ListViewDropIndicatorPreview","draggedBlockClientId","listViewRef","blockDropTarget","blockInformation","blockTitle","clientId","context","rootClientId","dropPosition","rootBlockElement","blockElement","current","_rootBlockElement","querySelector","undefined","_blockElement","targetElement","rtl","getDropIndicatorWidth","targetElementRect","indent","width","offsetWidth","scrollContainer","ownerDocument","windowScroll","body","documentElement","scrollContainerRect","getBoundingClientRect","distanceBetweenContainerAndTarget","right","left","scrollContainerWidth","clientWidth","style","horizontalScrollOffsetStyle","transform","ariaLevel","_ariaLevel","parseInt","getAttribute","hasAdjacentSelectedBranch","classList","contains","popoverAnchor","isValidDropPosition","contextElement","rect","top","doc","scrollbarWidth","height","window","DOMRect","createElement","animate","anchor","focusOnMount","className","variant","flip","resize","onClick","icon","showColors","alignment","justify","spacing","ellipsizeMode"],"sources":["@wordpress/block-editor/src/components/list-view/drop-indicator.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tPopover,\n} from '@wordpress/components';\n\nimport { getScrollContainer } from '@wordpress/dom';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport ListViewExpander from './expander';\n\nexport default function ListViewDropIndicatorPreview( {\n\tdraggedBlockClientId,\n\tlistViewRef,\n\tblockDropTarget,\n} ) {\n\tconst blockInformation = useBlockDisplayInformation( draggedBlockClientId );\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId: draggedBlockClientId,\n\t\tcontext: 'list-view',\n\t} );\n\n\tconst { rootClientId, clientId, dropPosition } = blockDropTarget || {};\n\n\tconst [ rootBlockElement, blockElement ] = useMemo( () => {\n\t\tif ( ! listViewRef.current ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// The rootClientId will be defined whenever dropping into inner\n\t\t// block lists, but is undefined when dropping at the root level.\n\t\tconst _rootBlockElement = rootClientId\n\t\t\t? listViewRef.current.querySelector(\n\t\t\t\t\t`[data-block=\"${ rootClientId }\"]`\n\t\t\t )\n\t\t\t: undefined;\n\n\t\t// The clientId represents the sibling block, the dragged block will\n\t\t// usually be inserted adjacent to it. It will be undefined when\n\t\t// dropping a block into an empty block list.\n\t\tconst _blockElement = clientId\n\t\t\t? listViewRef.current.querySelector(\n\t\t\t\t\t`[data-block=\"${ clientId }\"]`\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn [ _rootBlockElement, _blockElement ];\n\t}, [ listViewRef, rootClientId, clientId ] );\n\n\t// The targetElement is the element that the drop indicator will appear\n\t// before or after. When dropping into an empty block list, blockElement\n\t// is undefined, so the indicator will appear after the rootBlockElement.\n\tconst targetElement = blockElement || rootBlockElement;\n\n\tconst rtl = isRTL();\n\n\tconst getDropIndicatorWidth = useCallback(\n\t\t( targetElementRect, indent ) => {\n\t\t\tif ( ! targetElement ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\t// Default to assuming that the width of the drop indicator\n\t\t\t// should be the same as the target element.\n\t\t\tlet width = targetElement.offsetWidth;\n\n\t\t\t// In deeply nested lists, where a scrollbar is present,\n\t\t\t// the width of the drop indicator should be the width of\n\t\t\t// the scroll container, minus the distance from the left\n\t\t\t// edge of the scroll container to the left edge of the\n\t\t\t// target element.\n\t\t\tconst scrollContainer = getScrollContainer(\n\t\t\t\ttargetElement,\n\t\t\t\t'horizontal'\n\t\t\t);\n\n\t\t\tconst ownerDocument = targetElement.ownerDocument;\n\t\t\tconst windowScroll =\n\t\t\t\tscrollContainer === ownerDocument.body ||\n\t\t\t\tscrollContainer === ownerDocument.documentElement;\n\n\t\t\tif ( scrollContainer && ! windowScroll ) {\n\t\t\t\tconst scrollContainerRect =\n\t\t\t\t\tscrollContainer.getBoundingClientRect();\n\n\t\t\t\tconst distanceBetweenContainerAndTarget = isRTL()\n\t\t\t\t\t? scrollContainerRect.right - targetElementRect.right\n\t\t\t\t\t: targetElementRect.left - scrollContainerRect.left;\n\n\t\t\t\tconst scrollContainerWidth = scrollContainer.clientWidth;\n\n\t\t\t\tif (\n\t\t\t\t\tscrollContainerWidth <\n\t\t\t\t\twidth + distanceBetweenContainerAndTarget\n\t\t\t\t) {\n\t\t\t\t\twidth =\n\t\t\t\t\t\tscrollContainerWidth -\n\t\t\t\t\t\tdistanceBetweenContainerAndTarget;\n\t\t\t\t}\n\n\t\t\t\t// LTR logic for ensuring the drop indicator does not extend\n\t\t\t\t// beyond the right edge of the scroll container.\n\t\t\t\tif (\n\t\t\t\t\t! rtl &&\n\t\t\t\t\ttargetElementRect.left + indent < scrollContainerRect.left\n\t\t\t\t) {\n\t\t\t\t\twidth -= scrollContainerRect.left - targetElementRect.left;\n\t\t\t\t\treturn width;\n\t\t\t\t}\n\n\t\t\t\t// RTL logic for ensuring the drop indicator does not extend\n\t\t\t\t// beyond the right edge of the scroll container.\n\t\t\t\tif (\n\t\t\t\t\trtl &&\n\t\t\t\t\ttargetElementRect.right - indent > scrollContainerRect.right\n\t\t\t\t) {\n\t\t\t\t\twidth -=\n\t\t\t\t\t\ttargetElementRect.right - scrollContainerRect.right;\n\t\t\t\t\treturn width;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Subtract the indent from the final width of the indicator.\n\t\t\treturn width - indent;\n\t\t},\n\t\t[ rtl, targetElement ]\n\t);\n\n\tconst style = useMemo( () => {\n\t\tif ( ! targetElement ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst targetElementRect = targetElement.getBoundingClientRect();\n\n\t\treturn {\n\t\t\twidth: getDropIndicatorWidth( targetElementRect, 0 ),\n\t\t};\n\t}, [ getDropIndicatorWidth, targetElement ] );\n\n\tconst horizontalScrollOffsetStyle = useMemo( () => {\n\t\tif ( ! targetElement ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst scrollContainer = getScrollContainer( targetElement );\n\t\tconst ownerDocument = targetElement.ownerDocument;\n\t\tconst windowScroll =\n\t\t\tscrollContainer === ownerDocument.body ||\n\t\t\tscrollContainer === ownerDocument.documentElement;\n\n\t\tif ( scrollContainer && ! windowScroll ) {\n\t\t\tconst scrollContainerRect = scrollContainer.getBoundingClientRect();\n\t\t\tconst targetElementRect = targetElement.getBoundingClientRect();\n\n\t\t\tconst distanceBetweenContainerAndTarget = rtl\n\t\t\t\t? scrollContainerRect.right - targetElementRect.right\n\t\t\t\t: targetElementRect.left - scrollContainerRect.left;\n\n\t\t\tif ( ! rtl && scrollContainerRect.left > targetElementRect.left ) {\n\t\t\t\treturn {\n\t\t\t\t\ttransform: `translateX( ${ distanceBetweenContainerAndTarget }px )`,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( rtl && scrollContainerRect.right < targetElementRect.right ) {\n\t\t\t\treturn {\n\t\t\t\t\ttransform: `translateX( ${\n\t\t\t\t\t\tdistanceBetweenContainerAndTarget * -1\n\t\t\t\t\t}px )`,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {};\n\t}, [ rtl, targetElement ] );\n\n\tconst ariaLevel = useMemo( () => {\n\t\tif ( ! rootBlockElement ) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tconst _ariaLevel = parseInt(\n\t\t\trootBlockElement.getAttribute( 'aria-level' ),\n\t\t\t10\n\t\t);\n\n\t\treturn _ariaLevel ? _ariaLevel + 1 : 1;\n\t}, [ rootBlockElement ] );\n\n\tconst hasAdjacentSelectedBranch = useMemo( () => {\n\t\tif ( ! targetElement ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn targetElement.classList.contains( 'is-branch-selected' );\n\t}, [ targetElement ] );\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tconst isValidDropPosition =\n\t\t\tdropPosition === 'top' ||\n\t\t\tdropPosition === 'bottom' ||\n\t\t\tdropPosition === 'inside';\n\t\tif ( ! targetElement || ! isValidDropPosition ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tcontextElement: targetElement,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst rect = targetElement.getBoundingClientRect();\n\t\t\t\t// In RTL languages, the drop indicator should be positioned\n\t\t\t\t// to the left of the target element, with the width of the\n\t\t\t\t// indicator determining the indent at the right edge of the\n\t\t\t\t// target element. In LTR languages, the drop indicator should\n\t\t\t\t// end at the right edge of the target element, with the indent\n\t\t\t\t// added to the position of the left edge of the target element.\n\t\t\t\t// let left = rtl ? rect.left : rect.left + indent;\n\t\t\t\tlet left = rect.left;\n\t\t\t\tlet top = 0;\n\n\t\t\t\t// In deeply nested lists, where a scrollbar is present,\n\t\t\t\t// the width of the drop indicator should be the width of\n\t\t\t\t// the visible area of the scroll container. Additionally,\n\t\t\t\t// the left edge of the drop indicator line needs to be\n\t\t\t\t// offset by the distance the left edge of the target element\n\t\t\t\t// and the left edge of the scroll container. The ensures\n\t\t\t\t// that the drop indicator position never breaks out of the\n\t\t\t\t// visible area of the scroll container.\n\t\t\t\tconst scrollContainer = getScrollContainer(\n\t\t\t\t\ttargetElement,\n\t\t\t\t\t'horizontal'\n\t\t\t\t);\n\n\t\t\t\tconst doc = targetElement.ownerDocument;\n\t\t\t\tconst windowScroll =\n\t\t\t\t\tscrollContainer === doc.body ||\n\t\t\t\t\tscrollContainer === doc.documentElement;\n\n\t\t\t\t// If the scroll container is not the window, offset the left position, if need be.\n\t\t\t\tif ( scrollContainer && ! windowScroll ) {\n\t\t\t\t\tconst scrollContainerRect =\n\t\t\t\t\t\tscrollContainer.getBoundingClientRect();\n\n\t\t\t\t\t// In RTL languages, a vertical scrollbar is present on the\n\t\t\t\t\t// left edge of the scroll container. The width of the\n\t\t\t\t\t// scrollbar needs to be accounted for when positioning the\n\t\t\t\t\t// drop indicator.\n\t\t\t\t\tconst scrollbarWidth = rtl\n\t\t\t\t\t\t? scrollContainer.offsetWidth -\n\t\t\t\t\t\t scrollContainer.clientWidth\n\t\t\t\t\t\t: 0;\n\n\t\t\t\t\tif ( left < scrollContainerRect.left + scrollbarWidth ) {\n\t\t\t\t\t\tleft = scrollContainerRect.left + scrollbarWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( dropPosition === 'top' ) {\n\t\t\t\t\ttop = rect.top - rect.height * 2;\n\t\t\t\t} else {\n\t\t\t\t\t// `dropPosition` is either `bottom` or `inside`\n\t\t\t\t\ttop = rect.top;\n\t\t\t\t}\n\n\t\t\t\tconst width = getDropIndicatorWidth( rect, 0 );\n\t\t\t\tconst height = rect.height;\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t};\n\t}, [ targetElement, dropPosition, getDropIndicatorWidth, rtl ] );\n\n\tif ( ! targetElement ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tanimate={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\tfocusOnMount={ false }\n\t\t\tclassName=\"block-editor-list-view-drop-indicator--preview\"\n\t\t\tvariant=\"unstyled\"\n\t\t\tflip={ false }\n\t\t\tresize={ true }\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={ style }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-list-view-drop-indicator__line',\n\t\t\t\t\t{\n\t\t\t\t\t\t'block-editor-list-view-drop-indicator__line--darker':\n\t\t\t\t\t\t\thasAdjacentSelectedBranch,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"block-editor-list-view-leaf\"\n\t\t\t\t\taria-level={ ariaLevel }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\t\t\t\t'block-editor-list-view-block-contents'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ horizontalScrollOffsetStyle }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ListViewExpander onClick={ () => {} } />\n\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\ticon={ blockInformation?.icon }\n\t\t\t\t\t\t\tshowColors\n\t\t\t\t\t\t\tcontext=\"list-view\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\talignment=\"center\"\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">\n\t\t\t\t\t\t\t\t\t{ blockTitle }\n\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"block-editor-list-view-block__menu-cell\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Popover>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,sBAAsB,IAAIC,QAAQ,EAClCC,OAAO,QACD,uBAAuB;AAE9B,SAASC,kBAAkB,QAAQ,gBAAgB;AACnD,SAASC,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AACzD,SAASC,KAAK,QAAQ,iBAAiB;;AAEvC;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,0BAA0B,MAAM,kCAAkC;AACzE,OAAOC,oBAAoB,MAAM,wCAAwC;AACzE,OAAOC,gBAAgB,MAAM,YAAY;AAEzC,eAAe,SAASC,4BAA4BA,CAAE;EACrDC,oBAAoB;EACpBC,WAAW;EACXC;AACD,CAAC,EAAG;EACH,MAAMC,gBAAgB,GAAGP,0BAA0B,CAAEI,oBAAqB,CAAC;EAC3E,MAAMI,UAAU,GAAGP,oBAAoB,CAAE;IACxCQ,QAAQ,EAAEL,oBAAoB;IAC9BM,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,MAAM;IAAEC,YAAY;IAAEF,QAAQ;IAAE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,CAAC5D,SAAS;IACTqE,IAAI,EAAG7D,gBAAgB,EAAE6D,IAAM;IAC/BC,UAAU;IACV3D,OAAO,EAAC;EAAW,CACnB,CAAC,EACFiD,aAAA,CAACpE,MAAM;IACN+E,SAAS,EAAC,QAAQ;IAClBP,SAAS,EAAC,2DAA2D;IACrEQ,OAAO,EAAC,YAAY;IACpBC,OAAO,EAAG;EAAG,GAEbb,aAAA;IAAMI,SAAS,EAAC;EAAmD,GAClEJ,aAAA,CAAClE,QAAQ;IAACgF,aAAa,EAAC;EAAM,GAC3BjE,UACO,CACL,CACC,CACJ,CAAC,EACNmD,aAAA;IAAKI,SAAS,EAAC;EAAyC,CAAM,CAC1D,CACD,CACG,CAAC;AAEZ"}
1
+ {"version":3,"names":["classnames","__experimentalHStack","HStack","__experimentalTruncate","Truncate","Popover","getScrollContainer","useCallback","useMemo","isRTL","BlockIcon","useBlockDisplayInformation","useBlockDisplayTitle","ListViewExpander","ListViewDropIndicatorPreview","draggedBlockClientId","listViewRef","blockDropTarget","blockInformation","blockTitle","clientId","context","rootClientId","dropPosition","rootBlockElement","blockElement","current","_rootBlockElement","querySelector","undefined","_blockElement","targetElement","rtl","getDropIndicatorWidth","targetElementRect","indent","width","offsetWidth","scrollContainer","ownerDocument","windowScroll","body","documentElement","scrollContainerRect","getBoundingClientRect","distanceBetweenContainerAndTarget","right","left","scrollContainerWidth","clientWidth","style","horizontalScrollOffsetStyle","transform","ariaLevel","_ariaLevel","parseInt","getAttribute","hasAdjacentSelectedBranch","classList","contains","popoverAnchor","isValidDropPosition","contextElement","rect","top","doc","scrollbarWidth","height","window","DOMRect","createElement","animate","anchor","focusOnMount","className","variant","flip","resize","onClick","icon","showColors","alignment","justify","spacing","ellipsizeMode"],"sources":["@wordpress/block-editor/src/components/list-view/drop-indicator.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tPopover,\n} from '@wordpress/components';\n\nimport { getScrollContainer } from '@wordpress/dom';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport ListViewExpander from './expander';\n\nexport default function ListViewDropIndicatorPreview( {\n\tdraggedBlockClientId,\n\tlistViewRef,\n\tblockDropTarget,\n} ) {\n\tconst blockInformation = useBlockDisplayInformation( draggedBlockClientId );\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId: draggedBlockClientId,\n\t\tcontext: 'list-view',\n\t} );\n\n\tconst { rootClientId, clientId, dropPosition } = blockDropTarget || {};\n\n\tconst [ rootBlockElement, blockElement ] = useMemo( () => {\n\t\tif ( ! listViewRef.current ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// The rootClientId will be defined whenever dropping into inner\n\t\t// block lists, but is undefined when dropping at the root level.\n\t\tconst _rootBlockElement = rootClientId\n\t\t\t? listViewRef.current.querySelector(\n\t\t\t\t\t`[data-block=\"${ rootClientId }\"]`\n\t\t\t )\n\t\t\t: undefined;\n\n\t\t// The clientId represents the sibling block, the dragged block will\n\t\t// usually be inserted adjacent to it. It will be undefined when\n\t\t// dropping a block into an empty block list.\n\t\tconst _blockElement = clientId\n\t\t\t? listViewRef.current.querySelector(\n\t\t\t\t\t`[data-block=\"${ clientId }\"]`\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn [ _rootBlockElement, _blockElement ];\n\t}, [ listViewRef, rootClientId, clientId ] );\n\n\t// The targetElement is the element that the drop indicator will appear\n\t// before or after. When dropping into an empty block list, blockElement\n\t// is undefined, so the indicator will appear after the rootBlockElement.\n\tconst targetElement = blockElement || rootBlockElement;\n\n\tconst rtl = isRTL();\n\n\tconst getDropIndicatorWidth = useCallback(\n\t\t( targetElementRect, indent ) => {\n\t\t\tif ( ! targetElement ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\t// Default to assuming that the width of the drop indicator\n\t\t\t// should be the same as the target element.\n\t\t\tlet width = targetElement.offsetWidth;\n\n\t\t\t// In deeply nested lists, where a scrollbar is present,\n\t\t\t// the width of the drop indicator should be the width of\n\t\t\t// the scroll container, minus the distance from the left\n\t\t\t// edge of the scroll container to the left edge of the\n\t\t\t// target element.\n\t\t\tconst scrollContainer = getScrollContainer(\n\t\t\t\ttargetElement,\n\t\t\t\t'horizontal'\n\t\t\t);\n\n\t\t\tconst ownerDocument = targetElement.ownerDocument;\n\t\t\tconst windowScroll =\n\t\t\t\tscrollContainer === ownerDocument.body ||\n\t\t\t\tscrollContainer === ownerDocument.documentElement;\n\n\t\t\tif ( scrollContainer && ! windowScroll ) {\n\t\t\t\tconst scrollContainerRect =\n\t\t\t\t\tscrollContainer.getBoundingClientRect();\n\n\t\t\t\tconst distanceBetweenContainerAndTarget = isRTL()\n\t\t\t\t\t? scrollContainerRect.right - targetElementRect.right\n\t\t\t\t\t: targetElementRect.left - scrollContainerRect.left;\n\n\t\t\t\tconst scrollContainerWidth = scrollContainer.clientWidth;\n\n\t\t\t\tif (\n\t\t\t\t\tscrollContainerWidth <\n\t\t\t\t\twidth + distanceBetweenContainerAndTarget\n\t\t\t\t) {\n\t\t\t\t\twidth =\n\t\t\t\t\t\tscrollContainerWidth -\n\t\t\t\t\t\tdistanceBetweenContainerAndTarget;\n\t\t\t\t}\n\n\t\t\t\t// LTR logic for ensuring the drop indicator does not extend\n\t\t\t\t// beyond the right edge of the scroll container.\n\t\t\t\tif (\n\t\t\t\t\t! rtl &&\n\t\t\t\t\ttargetElementRect.left + indent < scrollContainerRect.left\n\t\t\t\t) {\n\t\t\t\t\twidth -= scrollContainerRect.left - targetElementRect.left;\n\t\t\t\t\treturn width;\n\t\t\t\t}\n\n\t\t\t\t// RTL logic for ensuring the drop indicator does not extend\n\t\t\t\t// beyond the right edge of the scroll container.\n\t\t\t\tif (\n\t\t\t\t\trtl &&\n\t\t\t\t\ttargetElementRect.right - indent > scrollContainerRect.right\n\t\t\t\t) {\n\t\t\t\t\twidth -=\n\t\t\t\t\t\ttargetElementRect.right - scrollContainerRect.right;\n\t\t\t\t\treturn width;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Subtract the indent from the final width of the indicator.\n\t\t\treturn width - indent;\n\t\t},\n\t\t[ rtl, targetElement ]\n\t);\n\n\tconst style = useMemo( () => {\n\t\tif ( ! targetElement ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst targetElementRect = targetElement.getBoundingClientRect();\n\n\t\treturn {\n\t\t\twidth: getDropIndicatorWidth( targetElementRect, 0 ),\n\t\t};\n\t}, [ getDropIndicatorWidth, targetElement ] );\n\n\tconst horizontalScrollOffsetStyle = useMemo( () => {\n\t\tif ( ! targetElement ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst scrollContainer = getScrollContainer( targetElement );\n\t\tconst ownerDocument = targetElement.ownerDocument;\n\t\tconst windowScroll =\n\t\t\tscrollContainer === ownerDocument.body ||\n\t\t\tscrollContainer === ownerDocument.documentElement;\n\n\t\tif ( scrollContainer && ! windowScroll ) {\n\t\t\tconst scrollContainerRect = scrollContainer.getBoundingClientRect();\n\t\t\tconst targetElementRect = targetElement.getBoundingClientRect();\n\n\t\t\tconst distanceBetweenContainerAndTarget = rtl\n\t\t\t\t? scrollContainerRect.right - targetElementRect.right\n\t\t\t\t: targetElementRect.left - scrollContainerRect.left;\n\n\t\t\tif ( ! rtl && scrollContainerRect.left > targetElementRect.left ) {\n\t\t\t\treturn {\n\t\t\t\t\ttransform: `translateX( ${ distanceBetweenContainerAndTarget }px )`,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( rtl && scrollContainerRect.right < targetElementRect.right ) {\n\t\t\t\treturn {\n\t\t\t\t\ttransform: `translateX( ${\n\t\t\t\t\t\tdistanceBetweenContainerAndTarget * -1\n\t\t\t\t\t}px )`,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {};\n\t}, [ rtl, targetElement ] );\n\n\tconst ariaLevel = useMemo( () => {\n\t\tif ( ! rootBlockElement ) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tconst _ariaLevel = parseInt(\n\t\t\trootBlockElement.getAttribute( 'aria-level' ),\n\t\t\t10\n\t\t);\n\n\t\treturn _ariaLevel ? _ariaLevel + 1 : 1;\n\t}, [ rootBlockElement ] );\n\n\tconst hasAdjacentSelectedBranch = useMemo( () => {\n\t\tif ( ! targetElement ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn targetElement.classList.contains( 'is-branch-selected' );\n\t}, [ targetElement ] );\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tconst isValidDropPosition =\n\t\t\tdropPosition === 'top' ||\n\t\t\tdropPosition === 'bottom' ||\n\t\t\tdropPosition === 'inside';\n\t\tif ( ! targetElement || ! isValidDropPosition ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tcontextElement: targetElement,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst rect = targetElement.getBoundingClientRect();\n\t\t\t\t// In RTL languages, the drop indicator should be positioned\n\t\t\t\t// to the left of the target element, with the width of the\n\t\t\t\t// indicator determining the indent at the right edge of the\n\t\t\t\t// target element. In LTR languages, the drop indicator should\n\t\t\t\t// end at the right edge of the target element, with the indent\n\t\t\t\t// added to the position of the left edge of the target element.\n\t\t\t\t// let left = rtl ? rect.left : rect.left + indent;\n\t\t\t\tlet left = rect.left;\n\t\t\t\tlet top = 0;\n\n\t\t\t\t// In deeply nested lists, where a scrollbar is present,\n\t\t\t\t// the width of the drop indicator should be the width of\n\t\t\t\t// the visible area of the scroll container. Additionally,\n\t\t\t\t// the left edge of the drop indicator line needs to be\n\t\t\t\t// offset by the distance the left edge of the target element\n\t\t\t\t// and the left edge of the scroll container. The ensures\n\t\t\t\t// that the drop indicator position never breaks out of the\n\t\t\t\t// visible area of the scroll container.\n\t\t\t\tconst scrollContainer = getScrollContainer(\n\t\t\t\t\ttargetElement,\n\t\t\t\t\t'horizontal'\n\t\t\t\t);\n\n\t\t\t\tconst doc = targetElement.ownerDocument;\n\t\t\t\tconst windowScroll =\n\t\t\t\t\tscrollContainer === doc.body ||\n\t\t\t\t\tscrollContainer === doc.documentElement;\n\n\t\t\t\t// If the scroll container is not the window, offset the left position, if need be.\n\t\t\t\tif ( scrollContainer && ! windowScroll ) {\n\t\t\t\t\tconst scrollContainerRect =\n\t\t\t\t\t\tscrollContainer.getBoundingClientRect();\n\n\t\t\t\t\t// In RTL languages, a vertical scrollbar is present on the\n\t\t\t\t\t// left edge of the scroll container. The width of the\n\t\t\t\t\t// scrollbar needs to be accounted for when positioning the\n\t\t\t\t\t// drop indicator.\n\t\t\t\t\tconst scrollbarWidth = rtl\n\t\t\t\t\t\t? scrollContainer.offsetWidth -\n\t\t\t\t\t\t scrollContainer.clientWidth\n\t\t\t\t\t\t: 0;\n\n\t\t\t\t\tif ( left < scrollContainerRect.left + scrollbarWidth ) {\n\t\t\t\t\t\tleft = scrollContainerRect.left + scrollbarWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( dropPosition === 'top' ) {\n\t\t\t\t\ttop = rect.top - rect.height * 2;\n\t\t\t\t} else {\n\t\t\t\t\t// `dropPosition` is either `bottom` or `inside`\n\t\t\t\t\ttop = rect.top;\n\t\t\t\t}\n\n\t\t\t\tconst width = getDropIndicatorWidth( rect, 0 );\n\t\t\t\tconst height = rect.height;\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t};\n\t}, [ targetElement, dropPosition, getDropIndicatorWidth, rtl ] );\n\n\tif ( ! targetElement ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tanimate={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\tfocusOnMount={ false }\n\t\t\tclassName=\"block-editor-list-view-drop-indicator--preview\"\n\t\t\tvariant=\"unstyled\"\n\t\t\tflip={ false }\n\t\t\tresize\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={ style }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-list-view-drop-indicator__line',\n\t\t\t\t\t{\n\t\t\t\t\t\t'block-editor-list-view-drop-indicator__line--darker':\n\t\t\t\t\t\t\thasAdjacentSelectedBranch,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"block-editor-list-view-leaf\"\n\t\t\t\t\taria-level={ ariaLevel }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\t\t\t\t'block-editor-list-view-block-contents'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ horizontalScrollOffsetStyle }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ListViewExpander onClick={ () => {} } />\n\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\ticon={ blockInformation?.icon }\n\t\t\t\t\t\t\tshowColors\n\t\t\t\t\t\t\tcontext=\"list-view\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\talignment=\"center\"\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">\n\t\t\t\t\t\t\t\t\t{ blockTitle }\n\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"block-editor-list-view-block__menu-cell\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</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useInstanceId","useMergeRefs","__experimentalUseFixedWindowList","useFixedWindowList","__experimentalTreeGrid","TreeGrid","VisuallyHidden","AsyncModeProvider","useSelect","deprecated","useCallback","useEffect","useMemo","useRef","useReducer","forwardRef","useState","__","ListViewBranch","ListViewContext","ListViewDropIndicatorPreview","useBlockSelection","useListViewBlockIndexes","useListViewClientIds","useListViewDropZone","useListViewExpandSelectedItem","store","blockEditorStore","BlockSettingsDropdown","focusListItem","useClipboardHandler","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","blockIndexes","getBlock","visibleBlockCount","shouldShowInnerBlocks","select","getGlobalBlockCount","getClientIdsOfDescendants","__unstableGetEditorMode","draggedBlockCount","length","updateBlockSelection","expandedState","setExpandedState","insertedBlock","setInsertedBlock","setSelectedTreeId","firstSelectedBlockClientId","selectEditorBlock","event","blockClientId","focusPosition","dropZoneRef","target","blockDropTarget","elementRef","clipBoardRef","selectBlock","treeGridRef","current","expand","clientId","collapse","expandRow","row","dataset","block","collapseRow","focusRow","startRow","endRow","shiftKey","firstDraggedBlockClientId","blockDropTargetIndex","blockDropPosition","firstDraggedBlockIndex","_blockDropTargetIndex","_firstDraggedBlockIndex","foundBlockIndex","undefined","dropPosition","contextValue","listViewInstanceId","treeGridElementRef","fixedListWindow","useWindowing","windowOverscan","describedById","createElement","value","draggedBlockClientId","listViewRef","className","onCollapseRow","onExpandRow","onFocusRow","applicationAriaLabel","style","Provider","parentId","PrivateListView","props"],"sources":["@wordpress/block-editor/src/components/list-view/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseInstanceId,\n\tuseMergeRefs,\n\t__experimentalUseFixedWindowList as useFixedWindowList,\n} from '@wordpress/compose';\nimport {\n\t__experimentalTreeGrid as TreeGrid,\n\tVisuallyHidden,\n} 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 ListViewDropIndicatorPreview from './drop-indicator';\nimport useBlockSelection from './use-block-selection';\nimport useListViewBlockIndexes from './use-list-view-block-indexes';\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';\nimport useClipboardHandler from './use-clipboard-handler';\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\tconst blockIndexes = useListViewBlockIndexes( clientIdsTree );\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 [ 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\n\tconst { ref: dropZoneRef, target: blockDropTarget } = useListViewDropZone( {\n\t\tdropZoneElement,\n\t\texpandedState,\n\t\tsetExpandedState,\n\t} );\n\tconst elementRef = useRef();\n\n\t// Allow handling of copy, cut, and paste events.\n\tconst clipBoardRef = useClipboardHandler( {\n\t\tselectBlock: selectEditorBlock,\n\t} );\n\n\tconst treeGridRef = useMergeRefs( [\n\t\tclipBoardRef,\n\t\telementRef,\n\t\tdropZoneRef,\n\t\tref,\n\t] );\n\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?.current );\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 firstDraggedBlockClientId = draggedClientIds?.[ 0 ];\n\n\t// Convert a blockDropTarget into indexes relative to the blocks in the list view.\n\t// These values are used to determine which blocks should be displaced to make room\n\t// for the drop indicator. See `ListViewBranch` and `getDragDisplacementValues`.\n\tconst { blockDropTargetIndex, blockDropPosition, firstDraggedBlockIndex } =\n\t\tuseMemo( () => {\n\t\t\tlet _blockDropTargetIndex, _firstDraggedBlockIndex;\n\n\t\t\tif ( blockDropTarget?.clientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ blockDropTarget.clientId ];\n\t\t\t\t// If dragging below or inside the block, treat the drop target as the next block.\n\t\t\t\t_blockDropTargetIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t} else if ( blockDropTarget === null ) {\n\t\t\t\t// A `null` value is used to indicate that the user is dragging outside of the list view.\n\t\t\t\t_blockDropTargetIndex = null;\n\t\t\t}\n\n\t\t\tif ( firstDraggedBlockClientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ firstDraggedBlockClientId ];\n\t\t\t\t_firstDraggedBlockIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tblockDropTargetIndex: _blockDropTargetIndex,\n\t\t\t\tblockDropPosition: blockDropTarget?.dropPosition,\n\t\t\t\tfirstDraggedBlockIndex: _firstDraggedBlockIndex,\n\t\t\t};\n\t\t}, [ blockDropTarget, blockIndexes, firstDraggedBlockClientId ] );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\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\trootClientId,\n\t\t} ),\n\t\t[\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\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\trootClientId,\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\tconst describedById =\n\t\tdescription && `block-editor-list-view-description-${ instanceId }`;\n\n\treturn (\n\t\t<AsyncModeProvider value={ true }>\n\t\t\t<ListViewDropIndicatorPreview\n\t\t\t\tdraggedBlockClientId={ firstDraggedBlockClientId }\n\t\t\t\tlistViewRef={ elementRef }\n\t\t\t\tblockDropTarget={ blockDropTarget }\n\t\t\t/>\n\t\t\t{ description && (\n\t\t\t\t<VisuallyHidden id={ describedById }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t\t<TreeGrid\n\t\t\t\tid={ id }\n\t\t\t\tclassName={ classnames( 'block-editor-list-view-tree', {\n\t\t\t\t\t'is-dragging':\n\t\t\t\t\t\tdraggedClientIds?.length > 0 &&\n\t\t\t\t\t\tblockDropTargetIndex !== undefined,\n\t\t\t\t} ) }\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\taria-describedby={ describedById }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-admin--list-view-dragged-items-height':\n\t\t\t\t\t\tdraggedClientIds?.length\n\t\t\t\t\t\t\t? `${\n\t\t\t\t\t\t\t\t\tBLOCK_LIST_ITEM_HEIGHT *\n\t\t\t\t\t\t\t\t\t( draggedClientIds.length - 1 )\n\t\t\t\t\t\t\t }px`\n\t\t\t\t\t\t\t: null,\n\t\t\t\t} }\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,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,aAAa,EACbC,YAAY,EACZC,gCAAgC,IAAIC,kBAAkB,QAChD,oBAAoB;AAC3B,SACCC,sBAAsB,IAAIC,QAAQ,EAClCC,cAAc,QACR,uBAAuB;AAC9B,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,4BAA4B,MAAM,kBAAkB;AAC3D,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,OAAOC,uBAAuB,MAAM,+BAA+B;AACnE,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,OAAOC,mBAAmB,MAAM,2BAA2B;AAC3D,OAAOC,6BAA6B,MAAM,sCAAsC;AAChF,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,qBAAqB,QAAQ,gDAAgD;AACtF,SAASC,aAAa,QAAQ,SAAS;AACvC,OAAOC,mBAAmB,MAAM,yBAAyB;AAEzD,MAAMC,QAAQ,GAAGA,CAAEC,KAAK,EAAEC,MAAM,KAAM;EACrC,IAAKC,KAAK,CAACC,OAAO,CAAEF,MAAM,CAACG,SAAU,CAAC,EAAG;IACxC,OAAO;MACN,GAAGJ,KAAK;MACR,GAAGC,MAAM,CAACG,SAAS,CAACC,MAAM,C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;IACrBE,QAAQ,EAAG,IAAM;IACjBC,sBAAsB,EAAG,IAAM;IAC/BL,iBAAiB,EAAG8D;EAAW,CAC/B,CAAC;AAEJ,CAAE,CAAC"}
1
+ {"version":3,"names":["classnames","useInstanceId","useMergeRefs","__experimentalUseFixedWindowList","useFixedWindowList","__experimentalTreeGrid","TreeGrid","VisuallyHidden","AsyncModeProvider","useSelect","deprecated","useCallback","useEffect","useMemo","useRef","useReducer","forwardRef","useState","__","ListViewBranch","ListViewContext","ListViewDropIndicatorPreview","useBlockSelection","useListViewBlockIndexes","useListViewClientIds","useListViewDropZone","useListViewExpandSelectedItem","store","blockEditorStore","BlockSettingsDropdown","focusListItem","useClipboardHandler","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","blockIndexes","getBlock","visibleBlockCount","shouldShowInnerBlocks","select","getGlobalBlockCount","getClientIdsOfDescendants","__unstableGetEditorMode","draggedBlockCount","length","updateBlockSelection","expandedState","setExpandedState","insertedBlock","setInsertedBlock","setSelectedTreeId","firstSelectedBlockClientId","selectEditorBlock","event","blockClientId","focusPosition","dropZoneRef","target","blockDropTarget","elementRef","clipBoardRef","selectBlock","treeGridRef","current","expand","clientId","collapse","expandRow","row","dataset","block","collapseRow","focusRow","startRow","endRow","shiftKey","firstDraggedBlockClientId","blockDropTargetIndex","blockDropPosition","firstDraggedBlockIndex","_blockDropTargetIndex","_firstDraggedBlockIndex","foundBlockIndex","undefined","dropPosition","contextValue","listViewInstanceId","treeGridElementRef","fixedListWindow","useWindowing","windowOverscan","describedById","createElement","value","draggedBlockClientId","listViewRef","className","onCollapseRow","onExpandRow","onFocusRow","applicationAriaLabel","style","Provider","parentId","PrivateListView","props"],"sources":["@wordpress/block-editor/src/components/list-view/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseInstanceId,\n\tuseMergeRefs,\n\t__experimentalUseFixedWindowList as useFixedWindowList,\n} from '@wordpress/compose';\nimport {\n\t__experimentalTreeGrid as TreeGrid,\n\tVisuallyHidden,\n} 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 ListViewDropIndicatorPreview from './drop-indicator';\nimport useBlockSelection from './use-block-selection';\nimport useListViewBlockIndexes from './use-list-view-block-indexes';\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';\nimport useClipboardHandler from './use-clipboard-handler';\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\tconst blockIndexes = useListViewBlockIndexes( clientIdsTree );\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 [ 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\n\tconst { ref: dropZoneRef, target: blockDropTarget } = useListViewDropZone( {\n\t\tdropZoneElement,\n\t\texpandedState,\n\t\tsetExpandedState,\n\t} );\n\tconst elementRef = useRef();\n\n\t// Allow handling of copy, cut, and paste events.\n\tconst clipBoardRef = useClipboardHandler( {\n\t\tselectBlock: selectEditorBlock,\n\t} );\n\n\tconst treeGridRef = useMergeRefs( [\n\t\tclipBoardRef,\n\t\telementRef,\n\t\tdropZoneRef,\n\t\tref,\n\t] );\n\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?.current );\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 firstDraggedBlockClientId = draggedClientIds?.[ 0 ];\n\n\t// Convert a blockDropTarget into indexes relative to the blocks in the list view.\n\t// These values are used to determine which blocks should be displaced to make room\n\t// for the drop indicator. See `ListViewBranch` and `getDragDisplacementValues`.\n\tconst { blockDropTargetIndex, blockDropPosition, firstDraggedBlockIndex } =\n\t\tuseMemo( () => {\n\t\t\tlet _blockDropTargetIndex, _firstDraggedBlockIndex;\n\n\t\t\tif ( blockDropTarget?.clientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ blockDropTarget.clientId ];\n\t\t\t\t// If dragging below or inside the block, treat the drop target as the next block.\n\t\t\t\t_blockDropTargetIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t} else if ( blockDropTarget === null ) {\n\t\t\t\t// A `null` value is used to indicate that the user is dragging outside of the list view.\n\t\t\t\t_blockDropTargetIndex = null;\n\t\t\t}\n\n\t\t\tif ( firstDraggedBlockClientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ firstDraggedBlockClientId ];\n\t\t\t\t_firstDraggedBlockIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tblockDropTargetIndex: _blockDropTargetIndex,\n\t\t\t\tblockDropPosition: blockDropTarget?.dropPosition,\n\t\t\t\tfirstDraggedBlockIndex: _firstDraggedBlockIndex,\n\t\t\t};\n\t\t}, [ blockDropTarget, blockIndexes, firstDraggedBlockClientId ] );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\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\trootClientId,\n\t\t} ),\n\t\t[\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\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\trootClientId,\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\tconst describedById =\n\t\tdescription && `block-editor-list-view-description-${ instanceId }`;\n\n\treturn (\n\t\t<AsyncModeProvider value>\n\t\t\t<ListViewDropIndicatorPreview\n\t\t\t\tdraggedBlockClientId={ firstDraggedBlockClientId }\n\t\t\t\tlistViewRef={ elementRef }\n\t\t\t\tblockDropTarget={ blockDropTarget }\n\t\t\t/>\n\t\t\t{ description && (\n\t\t\t\t<VisuallyHidden id={ describedById }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t\t<TreeGrid\n\t\t\t\tid={ id }\n\t\t\t\tclassName={ classnames( 'block-editor-list-view-tree', {\n\t\t\t\t\t'is-dragging':\n\t\t\t\t\t\tdraggedClientIds?.length > 0 &&\n\t\t\t\t\t\tblockDropTargetIndex !== undefined,\n\t\t\t\t} ) }\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\taria-describedby={ describedById }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-admin--list-view-dragged-items-height':\n\t\t\t\t\t\tdraggedClientIds?.length\n\t\t\t\t\t\t\t? `${\n\t\t\t\t\t\t\t\t\tBLOCK_LIST_ITEM_HEIGHT *\n\t\t\t\t\t\t\t\t\t( draggedClientIds.length - 1 )\n\t\t\t\t\t\t\t }px`\n\t\t\t\t\t\t\t: null,\n\t\t\t\t} }\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,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,aAAa,EACbC,YAAY,EACZC,gCAAgC,IAAIC,kBAAkB,QAChD,oBAAoB;AAC3B,SACCC,sBAAsB,IAAIC,QAAQ,EAClCC,cAAc,QACR,uBAAuB;AAC9B,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,4BAA4B,MAAM,kBAAkB;AAC3D,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,OAAOC,uBAAuB,MAAM,+BAA+B;AACnE,OAAOC,oBAAoB,MAAM,4BAA4B;AAC7D,OAAOC,mBAAmB,MAAM,2BAA2B;AAC3D,OAAOC,6BAA6B,MAAM,sCAAsC;AAChF,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,qBAAqB,QAAQ,gDAAgD;AACtF,SAASC,aAAa,QAAQ,SAAS;AACvC,OAAOC,mBAAmB,MAAM,yBAAyB;AAEzD,MAAMC,QAAQ,GAAGA,CAAEC,KAAK,EAAEC,MAAM,KAAM;EACrC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AAM;EAC5C,OACCgE,aAAA,CAACY,eAAe;IACf5E,GAAG,EAAGA,GAAK;IAAA,GACN6E,KAAK;IACVrF,YAAY,EAAG,KAAO;IACtBG,YAAY,EAAG,IAAM;IACrBE,QAAQ,EAAG,IAAM;IACjBC,sBAAsB,EAAG,IAAM;IAC/BL,iBAAiB,EAAG8D;EAAW,CAC/B,CAAC;AAEJ,CAAE,CAAC"}
@@ -90,16 +90,13 @@ export function useMouseMoveTypingReset() {
90
90
  */
91
91
  export function useTypingObserver() {
92
92
  const {
93
- isTyping,
94
- hasInlineToolbar
93
+ isTyping
95
94
  } = useSelect(select => {
96
95
  const {
97
- isTyping: _isTyping,
98
- getSettings
96
+ isTyping: _isTyping
99
97
  } = select(blockEditorStore);
100
98
  return {
101
- isTyping: _isTyping(),
102
- hasInlineToolbar: getSettings().hasInlineToolbar
99
+ isTyping: _isTyping()
103
100
  };
104
101
  }, []);
105
102
  const {
@@ -169,9 +166,7 @@ export function useTypingObserver() {
169
166
  }
170
167
  node.addEventListener('focus', stopTypingOnNonTextField);
171
168
  node.addEventListener('keydown', stopTypingOnEscapeKey);
172
- if (!hasInlineToolbar) {
173
- ownerDocument.addEventListener('selectionchange', stopTypingOnSelectionUncollapse);
174
- }
169
+ ownerDocument.addEventListener('selectionchange', stopTypingOnSelectionUncollapse);
175
170
  return () => {
176
171
  defaultView.clearTimeout(timerId);
177
172
  node.removeEventListener('focus', stopTypingOnNonTextField);
@@ -214,7 +209,7 @@ export function useTypingObserver() {
214
209
  node.removeEventListener('keypress', startTypingInTextField);
215
210
  node.removeEventListener('keydown', startTypingInTextField);
216
211
  };
217
- }, [isTyping, hasInlineToolbar, startTyping, stopTyping]);
212
+ }, [isTyping, startTyping, stopTyping]);
218
213
  return useMergeRefs([ref1, ref2]);
219
214
  }
220
215
  function ObserveTyping({
@@ -1 +1 @@
1
- {"version":3,"names":["useRefEffect","useMergeRefs","useSelect","useDispatch","isTextField","UP","RIGHT","DOWN","LEFT","ENTER","BACKSPACE","ESCAPE","TAB","store","blockEditorStore","KEY_DOWN_ELIGIBLE_KEY_CODES","Set","isKeyDownEligibleForStartTyping","event","keyCode","shiftKey","has","useMouseMoveTypingReset","isTyping","select","stopTyping","node","ownerDocument","lastClientX","lastClientY","stopTypingOnMouseMove","clientX","clientY","addEventListener","removeEventListener","useTypingObserver","hasInlineToolbar","_isTyping","getSettings","startTyping","ref1","ref2","defaultView","selection","getSelection","timerId","stopTypingOnNonTextField","target","setTimeout","stopTypingOnEscapeKey","stopTypingOnSelectionUncollapse","isCollapsed","clearTimeout","startTypingInTextField","type","contains","ObserveTyping","children","createElement","ref"],"sources":["@wordpress/block-editor/src/components/observe-typing/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect, useMergeRefs } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isTextField } from '@wordpress/dom';\nimport {\n\tUP,\n\tRIGHT,\n\tDOWN,\n\tLEFT,\n\tENTER,\n\tBACKSPACE,\n\tESCAPE,\n\tTAB,\n} from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Set of key codes upon which typing is to be initiated on a keydown event.\n *\n * @type {Set<number>}\n */\nconst KEY_DOWN_ELIGIBLE_KEY_CODES = new Set( [\n\tUP,\n\tRIGHT,\n\tDOWN,\n\tLEFT,\n\tENTER,\n\tBACKSPACE,\n] );\n\n/**\n * Returns true if a given keydown event can be inferred as intent to start\n * typing, or false otherwise. A keydown is considered eligible if it is a\n * text navigation without shift active.\n *\n * @param {KeyboardEvent} event Keydown event to test.\n *\n * @return {boolean} Whether event is eligible to start typing.\n */\nfunction isKeyDownEligibleForStartTyping( event ) {\n\tconst { keyCode, shiftKey } = event;\n\treturn ! shiftKey && KEY_DOWN_ELIGIBLE_KEY_CODES.has( keyCode );\n}\n\n/**\n * Removes the `isTyping` flag when the mouse moves in the document of the given\n * element.\n */\nexport function useMouseMoveTypingReset() {\n\tconst isTyping = useSelect(\n\t\t( select ) => select( blockEditorStore ).isTyping(),\n\t\t[]\n\t);\n\tconst { stopTyping } = useDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( ! isTyping ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { ownerDocument } = node;\n\t\t\tlet lastClientX;\n\t\t\tlet lastClientY;\n\n\t\t\t/**\n\t\t\t * On mouse move, unset typing flag if user has moved cursor.\n\t\t\t *\n\t\t\t * @param {MouseEvent} event Mousemove event.\n\t\t\t */\n\t\t\tfunction stopTypingOnMouseMove( event ) {\n\t\t\t\tconst { clientX, clientY } = event;\n\n\t\t\t\t// We need to check that the mouse really moved because Safari\n\t\t\t\t// triggers mousemove events when shift or ctrl are pressed.\n\t\t\t\tif (\n\t\t\t\t\tlastClientX &&\n\t\t\t\t\tlastClientY &&\n\t\t\t\t\t( lastClientX !== clientX || lastClientY !== clientY )\n\t\t\t\t) {\n\t\t\t\t\tstopTyping();\n\t\t\t\t}\n\n\t\t\t\tlastClientX = clientX;\n\t\t\t\tlastClientY = clientY;\n\t\t\t}\n\n\t\t\townerDocument.addEventListener(\n\t\t\t\t'mousemove',\n\t\t\t\tstopTypingOnMouseMove\n\t\t\t);\n\n\t\t\treturn () => {\n\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t'mousemove',\n\t\t\t\t\tstopTypingOnMouseMove\n\t\t\t\t);\n\t\t\t};\n\t\t},\n\t\t[ isTyping, stopTyping ]\n\t);\n}\n\n/**\n * Sets and removes the `isTyping` flag based on user actions:\n *\n * - Sets the flag if the user types within the given element.\n * - Removes the flag when the user selects some text, focusses a non-text\n * field, presses ESC or TAB, or moves the mouse in the document.\n */\nexport function useTypingObserver() {\n\tconst { isTyping, hasInlineToolbar } = useSelect( ( select ) => {\n\t\tconst { isTyping: _isTyping, getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tisTyping: _isTyping(),\n\t\t\thasInlineToolbar: getSettings().hasInlineToolbar,\n\t\t};\n\t}, [] );\n\tconst { startTyping, stopTyping } = useDispatch( blockEditorStore );\n\n\tconst ref1 = useMouseMoveTypingReset();\n\tconst ref2 = useRefEffect(\n\t\t( node ) => {\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\t\t\tconst selection = defaultView.getSelection();\n\n\t\t\t// Listeners to stop typing should only be added when typing.\n\t\t\t// Listeners to start typing should only be added when not typing.\n\t\t\tif ( isTyping ) {\n\t\t\t\tlet timerId;\n\n\t\t\t\t/**\n\t\t\t\t * Stops typing when focus transitions to a non-text field element.\n\t\t\t\t *\n\t\t\t\t * @param {FocusEvent} event Focus event.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnNonTextField( event ) {\n\t\t\t\t\tconst { target } = event;\n\n\t\t\t\t\t// Since focus to a non-text field via arrow key will trigger\n\t\t\t\t\t// before the keydown event, wait until after current stack\n\t\t\t\t\t// before evaluating whether typing is to be stopped. Otherwise,\n\t\t\t\t\t// typing will re-start.\n\t\t\t\t\ttimerId = defaultView.setTimeout( () => {\n\t\t\t\t\t\tif ( ! isTextField( target ) ) {\n\t\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Unsets typing flag if user presses Escape while typing flag is\n\t\t\t\t * active.\n\t\t\t\t *\n\t\t\t\t * @param {KeyboardEvent} event Keypress or keydown event to\n\t\t\t\t * interpret.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnEscapeKey( event ) {\n\t\t\t\t\tconst { keyCode } = event;\n\n\t\t\t\t\tif ( keyCode === ESCAPE || keyCode === TAB ) {\n\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * On selection change, unset typing flag if user has made an\n\t\t\t\t * uncollapsed (shift) selection.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnSelectionUncollapse() {\n\t\t\t\t\tif ( ! selection.isCollapsed ) {\n\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnode.addEventListener( 'focus', stopTypingOnNonTextField );\n\t\t\t\tnode.addEventListener( 'keydown', stopTypingOnEscapeKey );\n\n\t\t\t\tif ( ! hasInlineToolbar ) {\n\t\t\t\t\townerDocument.addEventListener(\n\t\t\t\t\t\t'selectionchange',\n\t\t\t\t\t\tstopTypingOnSelectionUncollapse\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn () => {\n\t\t\t\t\tdefaultView.clearTimeout( timerId );\n\t\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t\t'focus',\n\t\t\t\t\t\tstopTypingOnNonTextField\n\t\t\t\t\t);\n\t\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t\t'keydown',\n\t\t\t\t\t\tstopTypingOnEscapeKey\n\t\t\t\t\t);\n\t\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t\t'selectionchange',\n\t\t\t\t\t\tstopTypingOnSelectionUncollapse\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles a keypress or keydown event to infer intention to start\n\t\t\t * typing.\n\t\t\t *\n\t\t\t * @param {KeyboardEvent} event Keypress or keydown event to interpret.\n\t\t\t */\n\t\t\tfunction startTypingInTextField( event ) {\n\t\t\t\tconst { type, target } = event;\n\n\t\t\t\t// Abort early if already typing, or key press is incurred outside a\n\t\t\t\t// text field (e.g. arrow-ing through toolbar buttons).\n\t\t\t\t// Ignore typing if outside the current DOM container\n\t\t\t\tif ( ! isTextField( target ) || ! node.contains( target ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Special-case keydown because certain keys do not emit a keypress\n\t\t\t\t// event. Conversely avoid keydown as the canonical event since\n\t\t\t\t// there are many keydown which are explicitly not targeted for\n\t\t\t\t// typing.\n\t\t\t\tif (\n\t\t\t\t\ttype === 'keydown' &&\n\t\t\t\t\t! isKeyDownEligibleForStartTyping( event )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tstartTyping();\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'keypress', startTypingInTextField );\n\t\t\tnode.addEventListener( 'keydown', startTypingInTextField );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'keypress', startTypingInTextField );\n\t\t\t\tnode.removeEventListener( 'keydown', startTypingInTextField );\n\t\t\t};\n\t\t},\n\t\t[ isTyping, hasInlineToolbar, startTyping, stopTyping ]\n\t);\n\n\treturn useMergeRefs( [ ref1, ref2 ] );\n}\n\nfunction ObserveTyping( { children } ) {\n\treturn <div ref={ useTypingObserver() }>{ children }</div>;\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/observe-typing/README.md\n */\nexport default ObserveTyping;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC/D,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SACCC,EAAE,EACFC,KAAK,EACLC,IAAI,EACJC,IAAI,EACJC,KAAK,EACLC,SAAS,EACTC,MAAM,EACNC,GAAG,QACG,qBAAqB;;AAE5B;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA;AACA;AACA,MAAMC,2BAA2B,GAAG,IAAIC,GAAG,CAAE,CAC5CX,EAAE,EACFC,KAAK,EACLC,IAAI,EACJC,IAAI,EACJC,KAAK,EACLC,SAAS,CACR,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASO,+BAA+BA,CAAEC,KAAK,EAAG;EACjD,MAAM;IAAEC,OAAO;IAAEC;EAAS,CAAC,GAAGF,KAAK;EACnC,OAAO,CAA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AAW,EAAEd,UAAU,CACtD,CAAC;EAED,OAAOxB,YAAY,CAAE,CAAEuC,IAAI,EAAEC,IAAI,CAAG,CAAC;AACtC;AAEA,SAASe,aAAaA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtC,OAAOC,aAAA;IAAKC,GAAG,EAAGxB,iBAAiB,CAAC;EAAG,GAAGsB,QAAe,CAAC;AAC3D;;AAEA;AACA;AACA;AACA,eAAeD,aAAa"}
1
+ {"version":3,"names":["useRefEffect","useMergeRefs","useSelect","useDispatch","isTextField","UP","RIGHT","DOWN","LEFT","ENTER","BACKSPACE","ESCAPE","TAB","store","blockEditorStore","KEY_DOWN_ELIGIBLE_KEY_CODES","Set","isKeyDownEligibleForStartTyping","event","keyCode","shiftKey","has","useMouseMoveTypingReset","isTyping","select","stopTyping","node","ownerDocument","lastClientX","lastClientY","stopTypingOnMouseMove","clientX","clientY","addEventListener","removeEventListener","useTypingObserver","_isTyping","startTyping","ref1","ref2","defaultView","selection","getSelection","timerId","stopTypingOnNonTextField","target","setTimeout","stopTypingOnEscapeKey","stopTypingOnSelectionUncollapse","isCollapsed","clearTimeout","startTypingInTextField","type","contains","ObserveTyping","children","createElement","ref"],"sources":["@wordpress/block-editor/src/components/observe-typing/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect, useMergeRefs } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { isTextField } from '@wordpress/dom';\nimport {\n\tUP,\n\tRIGHT,\n\tDOWN,\n\tLEFT,\n\tENTER,\n\tBACKSPACE,\n\tESCAPE,\n\tTAB,\n} from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Set of key codes upon which typing is to be initiated on a keydown event.\n *\n * @type {Set<number>}\n */\nconst KEY_DOWN_ELIGIBLE_KEY_CODES = new Set( [\n\tUP,\n\tRIGHT,\n\tDOWN,\n\tLEFT,\n\tENTER,\n\tBACKSPACE,\n] );\n\n/**\n * Returns true if a given keydown event can be inferred as intent to start\n * typing, or false otherwise. A keydown is considered eligible if it is a\n * text navigation without shift active.\n *\n * @param {KeyboardEvent} event Keydown event to test.\n *\n * @return {boolean} Whether event is eligible to start typing.\n */\nfunction isKeyDownEligibleForStartTyping( event ) {\n\tconst { keyCode, shiftKey } = event;\n\treturn ! shiftKey && KEY_DOWN_ELIGIBLE_KEY_CODES.has( keyCode );\n}\n\n/**\n * Removes the `isTyping` flag when the mouse moves in the document of the given\n * element.\n */\nexport function useMouseMoveTypingReset() {\n\tconst isTyping = useSelect(\n\t\t( select ) => select( blockEditorStore ).isTyping(),\n\t\t[]\n\t);\n\tconst { stopTyping } = useDispatch( blockEditorStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tif ( ! isTyping ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { ownerDocument } = node;\n\t\t\tlet lastClientX;\n\t\t\tlet lastClientY;\n\n\t\t\t/**\n\t\t\t * On mouse move, unset typing flag if user has moved cursor.\n\t\t\t *\n\t\t\t * @param {MouseEvent} event Mousemove event.\n\t\t\t */\n\t\t\tfunction stopTypingOnMouseMove( event ) {\n\t\t\t\tconst { clientX, clientY } = event;\n\n\t\t\t\t// We need to check that the mouse really moved because Safari\n\t\t\t\t// triggers mousemove events when shift or ctrl are pressed.\n\t\t\t\tif (\n\t\t\t\t\tlastClientX &&\n\t\t\t\t\tlastClientY &&\n\t\t\t\t\t( lastClientX !== clientX || lastClientY !== clientY )\n\t\t\t\t) {\n\t\t\t\t\tstopTyping();\n\t\t\t\t}\n\n\t\t\t\tlastClientX = clientX;\n\t\t\t\tlastClientY = clientY;\n\t\t\t}\n\n\t\t\townerDocument.addEventListener(\n\t\t\t\t'mousemove',\n\t\t\t\tstopTypingOnMouseMove\n\t\t\t);\n\n\t\t\treturn () => {\n\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t'mousemove',\n\t\t\t\t\tstopTypingOnMouseMove\n\t\t\t\t);\n\t\t\t};\n\t\t},\n\t\t[ isTyping, stopTyping ]\n\t);\n}\n\n/**\n * Sets and removes the `isTyping` flag based on user actions:\n *\n * - Sets the flag if the user types within the given element.\n * - Removes the flag when the user selects some text, focusses a non-text\n * field, presses ESC or TAB, or moves the mouse in the document.\n */\nexport function useTypingObserver() {\n\tconst { isTyping } = useSelect( ( select ) => {\n\t\tconst { isTyping: _isTyping } = select( blockEditorStore );\n\t\treturn {\n\t\t\tisTyping: _isTyping(),\n\t\t};\n\t}, [] );\n\tconst { startTyping, stopTyping } = useDispatch( blockEditorStore );\n\n\tconst ref1 = useMouseMoveTypingReset();\n\tconst ref2 = useRefEffect(\n\t\t( node ) => {\n\t\t\tconst { ownerDocument } = node;\n\t\t\tconst { defaultView } = ownerDocument;\n\t\t\tconst selection = defaultView.getSelection();\n\n\t\t\t// Listeners to stop typing should only be added when typing.\n\t\t\t// Listeners to start typing should only be added when not typing.\n\t\t\tif ( isTyping ) {\n\t\t\t\tlet timerId;\n\n\t\t\t\t/**\n\t\t\t\t * Stops typing when focus transitions to a non-text field element.\n\t\t\t\t *\n\t\t\t\t * @param {FocusEvent} event Focus event.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnNonTextField( event ) {\n\t\t\t\t\tconst { target } = event;\n\n\t\t\t\t\t// Since focus to a non-text field via arrow key will trigger\n\t\t\t\t\t// before the keydown event, wait until after current stack\n\t\t\t\t\t// before evaluating whether typing is to be stopped. Otherwise,\n\t\t\t\t\t// typing will re-start.\n\t\t\t\t\ttimerId = defaultView.setTimeout( () => {\n\t\t\t\t\t\tif ( ! isTextField( target ) ) {\n\t\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Unsets typing flag if user presses Escape while typing flag is\n\t\t\t\t * active.\n\t\t\t\t *\n\t\t\t\t * @param {KeyboardEvent} event Keypress or keydown event to\n\t\t\t\t * interpret.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnEscapeKey( event ) {\n\t\t\t\t\tconst { keyCode } = event;\n\n\t\t\t\t\tif ( keyCode === ESCAPE || keyCode === TAB ) {\n\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * On selection change, unset typing flag if user has made an\n\t\t\t\t * uncollapsed (shift) selection.\n\t\t\t\t */\n\t\t\t\tfunction stopTypingOnSelectionUncollapse() {\n\t\t\t\t\tif ( ! selection.isCollapsed ) {\n\t\t\t\t\t\tstopTyping();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tnode.addEventListener( 'focus', stopTypingOnNonTextField );\n\t\t\t\tnode.addEventListener( 'keydown', stopTypingOnEscapeKey );\n\n\t\t\t\townerDocument.addEventListener(\n\t\t\t\t\t'selectionchange',\n\t\t\t\t\tstopTypingOnSelectionUncollapse\n\t\t\t\t);\n\n\t\t\t\treturn () => {\n\t\t\t\t\tdefaultView.clearTimeout( timerId );\n\t\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t\t'focus',\n\t\t\t\t\t\tstopTypingOnNonTextField\n\t\t\t\t\t);\n\t\t\t\t\tnode.removeEventListener(\n\t\t\t\t\t\t'keydown',\n\t\t\t\t\t\tstopTypingOnEscapeKey\n\t\t\t\t\t);\n\t\t\t\t\townerDocument.removeEventListener(\n\t\t\t\t\t\t'selectionchange',\n\t\t\t\t\t\tstopTypingOnSelectionUncollapse\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Handles a keypress or keydown event to infer intention to start\n\t\t\t * typing.\n\t\t\t *\n\t\t\t * @param {KeyboardEvent} event Keypress or keydown event to interpret.\n\t\t\t */\n\t\t\tfunction startTypingInTextField( event ) {\n\t\t\t\tconst { type, target } = event;\n\n\t\t\t\t// Abort early if already typing, or key press is incurred outside a\n\t\t\t\t// text field (e.g. arrow-ing through toolbar buttons).\n\t\t\t\t// Ignore typing if outside the current DOM container\n\t\t\t\tif ( ! isTextField( target ) || ! node.contains( target ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Special-case keydown because certain keys do not emit a keypress\n\t\t\t\t// event. Conversely avoid keydown as the canonical event since\n\t\t\t\t// there are many keydown which are explicitly not targeted for\n\t\t\t\t// typing.\n\t\t\t\tif (\n\t\t\t\t\ttype === 'keydown' &&\n\t\t\t\t\t! isKeyDownEligibleForStartTyping( event )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tstartTyping();\n\t\t\t}\n\n\t\t\tnode.addEventListener( 'keypress', startTypingInTextField );\n\t\t\tnode.addEventListener( 'keydown', startTypingInTextField );\n\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'keypress', startTypingInTextField );\n\t\t\t\tnode.removeEventListener( 'keydown', startTypingInTextField );\n\t\t\t};\n\t\t},\n\t\t[ isTyping, startTyping, stopTyping ]\n\t);\n\n\treturn useMergeRefs( [ ref1, ref2 ] );\n}\n\nfunction ObserveTyping( { children } ) {\n\treturn <div ref={ useTypingObserver() }>{ children }</div>;\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/observe-typing/README.md\n */\nexport default ObserveTyping;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,YAAY,QAAQ,oBAAoB;AAC/D,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SACCC,EAAE,EACFC,KAAK,EACLC,IAAI,EACJC,IAAI,EACJC,KAAK,EACLC,SAAS,EACTC,MAAM,EACNC,GAAG,QACG,qBAAqB;;AAE5B;AACA;AACA;AACA,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;;AAEvD;AACA;AACA;AACA;AACA;AACA,MAAMC,2BAA2B,GAAG,IAAIC,GAAG,CAAE,CAC5CX,EAAE,EACFC,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AAE,SAAS,EAAEiB,sBAAuB,CAAC;IAC9D,CAAC;EACF,CAAC,EACD,CAAE5B,QAAQ,EAAEc,WAAW,EAAEZ,UAAU,CACpC,CAAC;EAED,OAAOxB,YAAY,CAAE,CAAEqC,IAAI,EAAEC,IAAI,CAAG,CAAC;AACtC;AAEA,SAASe,aAAaA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACtC,OAAOC,aAAA;IAAKC,GAAG,EAAGtB,iBAAiB,CAAC;EAAG,GAAGoB,QAAe,CAAC;AAC3D;;AAEA;AACA;AACA;AACA,eAAeD,aAAa"}
@@ -1 +1 @@
1
- {"version":3,"names":["PanelColorGradientSettings","PanelColorSettings","colorSettings","props","settings","map","setting","value","onChange","otherSettings","colorValue","onColorChange","createElement","gradients","disableCustomGradients"],"sources":["@wordpress/block-editor/src/components/panel-color-settings/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport PanelColorGradientSettings from '../colors-gradients/panel-color-gradient-settings';\n\nconst PanelColorSettings = ( { colorSettings, ...props } ) => {\n\tconst settings = colorSettings.map( ( setting ) => {\n\t\tif ( ! setting ) {\n\t\t\treturn setting;\n\t\t}\n\t\tconst { value, onChange, ...otherSettings } = setting;\n\t\treturn {\n\t\t\t...otherSettings,\n\t\t\tcolorValue: value,\n\t\t\tonColorChange: onChange,\n\t\t};\n\t} );\n\treturn (\n\t\t<PanelColorGradientSettings\n\t\t\tsettings={ settings }\n\t\t\tgradients={ [] }\n\t\t\tdisableCustomGradients={ true }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n};\nexport default PanelColorSettings;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,0BAA0B,MAAM,mDAAmD;AAE1F,MAAMC,kBAAkB,GAAGA,CAAE;EAAEC,aAAa;EAAE,GAAGC;AAAM,CAAC,KAAM;EAC7D,MAAMC,QAAQ,GAAGF,aAAa,CAACG,GAAG,CAAIC,OAAO,IAAM;IAClD,IAAK,CAAEA,OAAO,EAAG;MAChB,OAAOA,OAAO;IACf;IACA,MAAM;MAAEC,KAAK;MAAEC,QAAQ;MAAE,GAAGC;IAAc,CAAC,GAAGH,OAAO;IACrD,OAAO;MACN,GAAGG,aAAa;MAChBC,UAAU,EAAEH,KAAK;MACjBI,aAAa,EAAEH;IAChB,CAAC;EACF,CAAE,CAAC;EACH,OACCI,aAAA,CAACZ,0BAA0B;IAC1BI,QAAQ,EAAGA,QAAU;IACrBS,SAAS,EAAG,EAAI;IAChBC,sBAAsB,EAAG,IAAM;IAAA,GAC1BX;EAAK,CACV,CAAC;AAEJ,CAAC;AACD,eAAeF,kBAAkB"}
1
+ {"version":3,"names":["PanelColorGradientSettings","PanelColorSettings","colorSettings","props","settings","map","setting","value","onChange","otherSettings","colorValue","onColorChange","createElement","gradients","disableCustomGradients"],"sources":["@wordpress/block-editor/src/components/panel-color-settings/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport PanelColorGradientSettings from '../colors-gradients/panel-color-gradient-settings';\n\nconst PanelColorSettings = ( { colorSettings, ...props } ) => {\n\tconst settings = colorSettings.map( ( setting ) => {\n\t\tif ( ! setting ) {\n\t\t\treturn setting;\n\t\t}\n\t\tconst { value, onChange, ...otherSettings } = setting;\n\t\treturn {\n\t\t\t...otherSettings,\n\t\t\tcolorValue: value,\n\t\t\tonColorChange: onChange,\n\t\t};\n\t} );\n\treturn (\n\t\t<PanelColorGradientSettings\n\t\t\tsettings={ settings }\n\t\t\tgradients={ [] }\n\t\t\tdisableCustomGradients\n\t\t\t{ ...props }\n\t\t/>\n\t);\n};\nexport default PanelColorSettings;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,0BAA0B,MAAM,mDAAmD;AAE1F,MAAMC,kBAAkB,GAAGA,CAAE;EAAEC,aAAa;EAAE,GAAGC;AAAM,CAAC,KAAM;EAC7D,MAAMC,QAAQ,GAAGF,aAAa,CAACG,GAAG,CAAIC,OAAO,IAAM;IAClD,IAAK,CAAEA,OAAO,EAAG;MAChB,OAAOA,OAAO;IACf;IACA,MAAM;MAAEC,KAAK;MAAEC,QAAQ;MAAE,GAAGC;IAAc,CAAC,GAAGH,OAAO;IACrD,OAAO;MACN,GAAGG,aAAa;MAChBC,UAAU,EAAEH,KAAK;MACjBI,aAAa,EAAEH;IAChB,CAAC;EACF,CAAE,CAAC;EACH,OACCI,aAAA,CAACZ,0BAA0B;IAC1BI,QAAQ,EAAGA,QAAU;IACrBS,SAAS,EAAG,EAAI;IAChBC,sBAAsB;IAAA,GACjBX;EAAK,CACV,CAAC;AAEJ,CAAC;AACD,eAAeF,kBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"names":["useDispatch","useEffect","SlotFillProvider","withRegistryProvider","useBlockSync","store","blockEditorStore","BlockRefsProvider","unlock","KeyboardShortcuts","ExperimentalBlockEditorProvider","props","children","settings","stripExperimentalSettings","__experimentalUpdateSettings","__internalIsInitialized","reset","createElement","passthrough","__unstableIsPreviewMode","Register","BlockEditorProvider"],"sources":["@wordpress/block-editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { SlotFillProvider } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport useBlockSync from './use-block-sync';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockRefsProvider } from './block-refs-provider';\nimport { unlock } from '../../lock-unlock';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\n/** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */\n\nexport const ExperimentalBlockEditorProvider = withRegistryProvider(\n\t( props ) => {\n\t\tconst { children, settings, stripExperimentalSettings = false } = props;\n\n\t\tconst { __experimentalUpdateSettings } = unlock(\n\t\t\tuseDispatch( blockEditorStore )\n\t\t);\n\t\tuseEffect( () => {\n\t\t\t__experimentalUpdateSettings(\n\t\t\t\t{\n\t\t\t\t\t...settings,\n\t\t\t\t\t__internalIsInitialized: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tstripExperimentalSettings,\n\t\t\t\t\treset: true,\n\t\t\t\t}\n\t\t\t);\n\t\t}, [\n\t\t\tsettings,\n\t\t\tstripExperimentalSettings,\n\t\t\t__experimentalUpdateSettings,\n\t\t] );\n\n\t\t// Syncs the entity provider with changes in the block-editor store.\n\t\tuseBlockSync( props );\n\n\t\treturn (\n\t\t\t<SlotFillProvider passthrough>\n\t\t\t\t{ ! settings?.__unstableIsPreviewMode && (\n\t\t\t\t\t<KeyboardShortcuts.Register />\n\t\t\t\t) }\n\t\t\t\t<BlockRefsProvider>{ children }</BlockRefsProvider>\n\t\t\t</SlotFillProvider>\n\t\t);\n\t}\n);\n\nexport const BlockEditorProvider = ( props ) => {\n\treturn (\n\t\t<ExperimentalBlockEditorProvider\n\t\t\t{ ...props }\n\t\t\tstripExperimentalSettings={ true }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n};\n\nexport default BlockEditorProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,gBAAgB,QAAQ,uBAAuB;;AAExD;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,iBAAiB,MAAM,uBAAuB;;AAErD;;AAEA,OAAO,MAAMC,+BAA+B,GAAGP,oBAAoB,CAChEQ,KAAK,IAAM;EACZ,MAAM;IAAEC,QAAQ;IAAEC,QAAQ;IAAEC,yBAAyB,GAAG;EAAM,CAAC,GAAGH,KAAK;EAEvE,MAAM;IAAEI;EAA6B,CAAC,GAAGP,MAAM,CAC9CR,WAAW,CAAEM,gBAAiB,CAC/B,CAAC;EACDL,SAAS,CAAE,MAAM;IAChBc,4BAA4B,CAC3B;MACC,GAAGF,QAAQ;MACXG,uBAAuB,EAAE;IAC1B,CAAC,EACD;MACCF,yBAAyB;MACzBG,KAAK,EAAE;IACR,CACD,CAAC;EACF,CAAC,EAAE,CACFJ,QAAQ,EACRC,yBAAyB,EACzBC,4BAA4B,CAC3B,CAAC;;EAEH;EACAX,YAAY,CAAEO,KAAM,CAAC;EAErB,OACCO,aAAA,CAAChB,gBAAgB;IAACiB,WAAW;EAAA,GAC1B,CAAEN,QAAQ,EAAEO,uBAAuB,IACpCF,aAAA,CAACT,iBAAiB,CAACY,QAAQ,MAAE,CAC7B,EACDH,aAAA,CAACX,iBAAiB,QAAGK,QAA6B,CACjC,CAAC;AAErB,CACD,CAAC;AAED,OAAO,MAAMU,mBAAmB,GAAKX,KAAK,IAAM;EAC/C,OACCO,aAAA,CAACR,+BAA+B;IAAA,GAC1BC,KAAK;IACVG,yBAAyB,EAAG;EAAM,GAEhCH,KAAK,CAACC,QACwB,CAAC;AAEpC,CAAC;AAED,eAAeU,mBAAmB"}
1
+ {"version":3,"names":["useDispatch","useEffect","SlotFillProvider","withRegistryProvider","useBlockSync","store","blockEditorStore","BlockRefsProvider","unlock","KeyboardShortcuts","ExperimentalBlockEditorProvider","props","children","settings","stripExperimentalSettings","__experimentalUpdateSettings","__internalIsInitialized","reset","createElement","passthrough","__unstableIsPreviewMode","Register","BlockEditorProvider"],"sources":["@wordpress/block-editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { SlotFillProvider } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport useBlockSync from './use-block-sync';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockRefsProvider } from './block-refs-provider';\nimport { unlock } from '../../lock-unlock';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\n\n/** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */\n\nexport const ExperimentalBlockEditorProvider = withRegistryProvider(\n\t( props ) => {\n\t\tconst { children, settings, stripExperimentalSettings = false } = props;\n\n\t\tconst { __experimentalUpdateSettings } = unlock(\n\t\t\tuseDispatch( blockEditorStore )\n\t\t);\n\t\tuseEffect( () => {\n\t\t\t__experimentalUpdateSettings(\n\t\t\t\t{\n\t\t\t\t\t...settings,\n\t\t\t\t\t__internalIsInitialized: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tstripExperimentalSettings,\n\t\t\t\t\treset: true,\n\t\t\t\t}\n\t\t\t);\n\t\t}, [\n\t\t\tsettings,\n\t\t\tstripExperimentalSettings,\n\t\t\t__experimentalUpdateSettings,\n\t\t] );\n\n\t\t// Syncs the entity provider with changes in the block-editor store.\n\t\tuseBlockSync( props );\n\n\t\treturn (\n\t\t\t<SlotFillProvider passthrough>\n\t\t\t\t{ ! settings?.__unstableIsPreviewMode && (\n\t\t\t\t\t<KeyboardShortcuts.Register />\n\t\t\t\t) }\n\t\t\t\t<BlockRefsProvider>{ children }</BlockRefsProvider>\n\t\t\t</SlotFillProvider>\n\t\t);\n\t}\n);\n\nexport const BlockEditorProvider = ( props ) => {\n\treturn (\n\t\t<ExperimentalBlockEditorProvider { ...props } stripExperimentalSettings>\n\t\t\t{ props.children }\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n};\n\nexport default BlockEditorProvider;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,gBAAgB,QAAQ,uBAAuB;;AAExD;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,aAAa;AACvD,SAASC,iBAAiB,QAAQ,uBAAuB;AACzD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,iBAAiB,MAAM,uBAAuB;;AAErD;;AAEA,OAAO,MAAMC,+BAA+B,GAAGP,oBAAoB,CAChEQ,KAAK,IAAM;EACZ,MAAM;IAAEC,QAAQ;IAAEC,QAAQ;IAAEC,yBAAyB,GAAG;EAAM,CAAC,GAAGH,KAAK;EAEvE,MAAM;IAAEI;EAA6B,CAAC,GAAGP,MAAM,CAC9CR,WAAW,CAAEM,gBAAiB,CAC/B,CAAC;EACDL,SAAS,CAAE,MAAM;IAChBc,4BAA4B,CAC3B;MACC,GAAGF,QAAQ;MACXG,uBAAuB,EAAE;IAC1B,CAAC,EACD;MACCF,yBAAyB;MACzBG,KAAK,EAAE;IACR,CACD,CAAC;EACF,CAAC,EAAE,CACFJ,QAAQ,EACRC,yBAAyB,EACzBC,4BAA4B,CAC3B,CAAC;;EAEH;EACAX,YAAY,CAAEO,KAAM,CAAC;EAErB,OACCO,aAAA,CAAChB,gBAAgB;IAACiB,WAAW;EAAA,GAC1B,CAAEN,QAAQ,EAAEO,uBAAuB,IACpCF,aAAA,CAACT,iBAAiB,CAACY,QAAQ,MAAE,CAC7B,EACDH,aAAA,CAACX,iBAAiB,QAAGK,QAA6B,CACjC,CAAC;AAErB,CACD,CAAC;AAED,OAAO,MAAMU,mBAAmB,GAAKX,KAAK,IAAM;EAC/C,OACCO,aAAA,CAACR,+BAA+B;IAAA,GAAMC,KAAK;IAAGG,yBAAyB;EAAA,GACpEH,KAAK,CAACC,QACwB,CAAC;AAEpC,CAAC;AAED,eAAeU,mBAAmB"}
@@ -7,17 +7,15 @@ import { ResizableBox } from '@wordpress/components';
7
7
  /**
8
8
  * Internal dependencies
9
9
  */
10
- import BlockPopover from '../block-popover';
10
+ import BlockPopoverCover from '../block-popover/cover';
11
11
  export default function ResizableBoxPopover({
12
12
  clientId,
13
13
  resizableBoxProps,
14
14
  ...props
15
15
  }) {
16
- return createElement(BlockPopover, {
16
+ return createElement(BlockPopoverCover, {
17
17
  clientId: clientId,
18
- __unstableCoverTarget: true,
19
- __unstablePopoverSlot: "__unstable-block-tools-after",
20
- shift: false,
18
+ __unstablePopoverSlot: "block-toolbar",
21
19
  ...props
22
20
  }, createElement(ResizableBox, {
23
21
  ...resizableBoxProps
@@ -1 +1 @@
1
- {"version":3,"names":["ResizableBox","BlockPopover","ResizableBoxPopover","clientId","resizableBoxProps","props","createElement","__unstableCoverTarget","__unstablePopoverSlot","shift"],"sources":["@wordpress/block-editor/src/components/resizable-box-popover/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ResizableBox } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockPopover from '../block-popover';\n\nexport default function ResizableBoxPopover( {\n\tclientId,\n\tresizableBoxProps,\n\t...props\n} ) {\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ clientId }\n\t\t\t__unstableCoverTarget\n\t\t\t__unstablePopoverSlot=\"__unstable-block-tools-after\"\n\t\t\tshift={ false }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<ResizableBox { ...resizableBoxProps } />\n\t\t</BlockPopover>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,uBAAuB;;AAEpD;AACA;AACA;AACA,OAAOC,YAAY,MAAM,kBAAkB;AAE3C,eAAe,SAASC,mBAAmBA,CAAE;EAC5CC,QAAQ;EACRC,iBAAiB;EACjB,GAAGC;AACJ,CAAC,EAAG;EACH,OACCC,aAAA,CAACL,YAAY;IACZE,QAAQ,EAAGA,QAAU;IACrBI,qBAAqB;IACrBC,qBAAqB,EAAC,8BAA8B;IACpDC,KAAK,EAAG,KAAO;IAAA,GACVJ;EAAK,GAEVC,aAAA,CAACN,YAAY;IAAA,GAAMI;EAAiB,CAAI,CAC3B,CAAC;AAEjB"}
1
+ {"version":3,"names":["ResizableBox","BlockPopoverCover","ResizableBoxPopover","clientId","resizableBoxProps","props","createElement","__unstablePopoverSlot"],"sources":["@wordpress/block-editor/src/components/resizable-box-popover/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ResizableBox } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport BlockPopoverCover from '../block-popover/cover';\n\nexport default function ResizableBoxPopover( {\n\tclientId,\n\tresizableBoxProps,\n\t...props\n} ) {\n\treturn (\n\t\t<BlockPopoverCover\n\t\t\tclientId={ clientId }\n\t\t\t__unstablePopoverSlot=\"block-toolbar\"\n\t\t\t{ ...props }\n\t\t>\n\t\t\t<ResizableBox { ...resizableBoxProps } />\n\t\t</BlockPopoverCover>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,uBAAuB;;AAEpD;AACA;AACA;AACA,OAAOC,iBAAiB,MAAM,wBAAwB;AAEtD,eAAe,SAASC,mBAAmBA,CAAE;EAC5CC,QAAQ;EACRC,iBAAiB;EACjB,GAAGC;AACJ,CAAC,EAAG;EACH,OACCC,aAAA,CAACL,iBAAiB;IACjBE,QAAQ,EAAGA,QAAU;IACrBI,qBAAqB,EAAC,eAAe;IAAA,GAChCF;EAAK,GAEVC,aAAA,CAACN,YAAY;IAAA,GAAMI;EAAiB,CAAI,CACtB,CAAC;AAEtB"}
@@ -43,7 +43,7 @@ function ResponsiveBlockControl(props) {
43
43
  return null;
44
44
  }
45
45
  const toggleControlLabel = toggleLabel || sprintf( /* translators: %s: Property value for the control (eg: margin, padding, etc.). */
46
- __('Use the same %s on all screensizes.'), property);
46
+ __('Use the same %s on all screen sizes.'), property);
47
47
  const toggleHelpText = __('Toggle between using the same value for all screen sizes or using a unique value per screen size.');
48
48
  const defaultControl = renderDefaultControl(createElement(ResponsiveBlockControlLabel, {
49
49
  property: property,
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","__","_x","sprintf","Fragment","ToggleControl","ResponsiveBlockControlLabel","ResponsiveBlockControl","props","title","property","toggleLabel","onIsResponsiveChange","renderDefaultControl","renderResponsiveControls","isResponsive","defaultLabel","id","label","viewports","toggleControlLabel","toggleHelpText","defaultControl","createElement","viewport","defaultResponsiveControls","map","key","className","__nextHasNoMarginBottom","checked","onChange","help"],"sources":["@wordpress/block-editor/src/components/responsive-block-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { Fragment } from '@wordpress/element';\nimport { ToggleControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ResponsiveBlockControlLabel from './label';\n\nfunction ResponsiveBlockControl( props ) {\n\tconst {\n\t\ttitle,\n\t\tproperty,\n\t\ttoggleLabel,\n\t\tonIsResponsiveChange,\n\t\trenderDefaultControl,\n\t\trenderResponsiveControls,\n\t\tisResponsive = false,\n\t\tdefaultLabel = {\n\t\t\tid: 'all',\n\t\t\tlabel: _x( 'All', 'screen sizes' ),\n\t\t},\n\t\tviewports = [\n\t\t\t{\n\t\t\t\tid: 'small',\n\t\t\t\tlabel: __( 'Small screens' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'medium',\n\t\t\t\tlabel: __( 'Medium screens' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'large',\n\t\t\t\tlabel: __( 'Large screens' ),\n\t\t\t},\n\t\t],\n\t} = props;\n\n\tif ( ! title || ! property || ! renderDefaultControl ) {\n\t\treturn null;\n\t}\n\n\tconst toggleControlLabel =\n\t\ttoggleLabel ||\n\t\tsprintf(\n\t\t\t/* translators: %s: Property value for the control (eg: margin, padding, etc.). */\n\t\t\t__( 'Use the same %s on all screensizes.' ),\n\t\t\tproperty\n\t\t);\n\n\tconst toggleHelpText = __(\n\t\t'Toggle between using the same value for all screen sizes or using a unique value per screen size.'\n\t);\n\n\tconst defaultControl = renderDefaultControl(\n\t\t<ResponsiveBlockControlLabel\n\t\t\tproperty={ property }\n\t\t\tviewport={ defaultLabel }\n\t\t/>,\n\t\tdefaultLabel\n\t);\n\n\tconst defaultResponsiveControls = () => {\n\t\treturn viewports.map( ( viewport ) => (\n\t\t\t<Fragment key={ viewport.id }>\n\t\t\t\t{ renderDefaultControl(\n\t\t\t\t\t<ResponsiveBlockControlLabel\n\t\t\t\t\t\tproperty={ property }\n\t\t\t\t\t\tviewport={ viewport }\n\t\t\t\t\t/>,\n\t\t\t\t\tviewport\n\t\t\t\t) }\n\t\t\t</Fragment>\n\t\t) );\n\t};\n\n\treturn (\n\t\t<fieldset className=\"block-editor-responsive-block-control\">\n\t\t\t<legend className=\"block-editor-responsive-block-control__title\">\n\t\t\t\t{ title }\n\t\t\t</legend>\n\n\t\t\t<div className=\"block-editor-responsive-block-control__inner\">\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tclassName=\"block-editor-responsive-block-control__toggle\"\n\t\t\t\t\tlabel={ toggleControlLabel }\n\t\t\t\t\tchecked={ ! isResponsive }\n\t\t\t\t\tonChange={ onIsResponsiveChange }\n\t\t\t\t\thelp={ toggleHelpText }\n\t\t\t\t/>\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-responsive-block-control__group',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-responsive': isResponsive,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ ! isResponsive && defaultControl }\n\t\t\t\t\t{ isResponsive &&\n\t\t\t\t\t\t( renderResponsiveControls\n\t\t\t\t\t\t\t? renderResponsiveControls( viewports )\n\t\t\t\t\t\t\t: defaultResponsiveControls() ) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n\nexport default ResponsiveBlockControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,a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B;MAC3BI,QAAQ,EAAGA,QAAU;MACrBc,QAAQ,EAAGA;IAAU,CACrB,CAAC,EACFA,QACD,CACS,CACT,CAAC;EACJ,CAAC;EAED,OACCD,aAAA;IAAUK,SAAS,EAAC;EAAuC,GAC1DL,aAAA;IAAQK,SAAS,EAAC;EAA8C,GAC7DnB,KACK,CAAC,EAETc,aAAA;IAAKK,SAAS,EAAC;EAA8C,GAC5DL,aAAA,CAAClB,aAAa;IACbwB,uBAAuB;IACvBD,SAAS,EAAC,+CAA+C;IACzDV,KAAK,EAAGE,kBAAoB;IAC5BU,OAAO,EAAG,CAAEf,YAAc;IAC1BgB,QAAQ,EAAGnB,oBAAsB;IACjCoB,IAAI,EAAGX;EAAgB,CACvB,CAAC,EACFE,aAAA;IACCK,SAAS,EAAG5B,UAAU,CACrB,8CAA8C,EAC9C;MACC,eAAe,EAAEe;IAClB,CACD;EAAG,GAED,CAAEA,YAAY,IAAIO,cAAc,EAChCP,YAAY,KACXD,wBAAwB,GACvBA,wBAAwB,CAAEK,SAAU,CAAC,GACrCM,yBAAyB,CAAC,CAAC,CAC3B,CACD,CACI,CAAC;AAEb;AAEA,eAAelB,sBAAsB"}
1
+ {"version":3,"names":["classnames","__","_x","sprintf","Fragment","ToggleControl","ResponsiveBlockControlLabel","ResponsiveBlockControl","props","title","property","toggleLabel","onIsResponsiveChange","renderDefaultControl","renderResponsiveControls","isResponsive","defaultLabel","id","label","viewports","toggleControlLabel","toggleHelpText","defaultControl","createElement","viewport","defaultResponsiveControls","map","key","className","__nextHasNoMarginBottom","checked","onChange","help"],"sources":["@wordpress/block-editor/src/components/responsive-block-control/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { Fragment } from '@wordpress/element';\nimport { ToggleControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ResponsiveBlockControlLabel from './label';\n\nfunction ResponsiveBlockControl( props ) {\n\tconst {\n\t\ttitle,\n\t\tproperty,\n\t\ttoggleLabel,\n\t\tonIsResponsiveChange,\n\t\trenderDefaultControl,\n\t\trenderResponsiveControls,\n\t\tisResponsive = false,\n\t\tdefaultLabel = {\n\t\t\tid: 'all',\n\t\t\tlabel: _x( 'All', 'screen sizes' ),\n\t\t},\n\t\tviewports = [\n\t\t\t{\n\t\t\t\tid: 'small',\n\t\t\t\tlabel: __( 'Small screens' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'medium',\n\t\t\t\tlabel: __( 'Medium screens' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: 'large',\n\t\t\t\tlabel: __( 'Large screens' ),\n\t\t\t},\n\t\t],\n\t} = props;\n\n\tif ( ! title || ! property || ! renderDefaultControl ) {\n\t\treturn null;\n\t}\n\n\tconst toggleControlLabel =\n\t\ttoggleLabel ||\n\t\tsprintf(\n\t\t\t/* translators: %s: Property value for the control (eg: margin, padding, etc.). */\n\t\t\t__( 'Use the same %s on all screen sizes.' ),\n\t\t\tproperty\n\t\t);\n\n\tconst toggleHelpText = __(\n\t\t'Toggle between using the same value for all screen sizes or using a unique value per screen size.'\n\t);\n\n\tconst defaultControl = renderDefaultControl(\n\t\t<ResponsiveBlockControlLabel\n\t\t\tproperty={ property }\n\t\t\tviewport={ defaultLabel }\n\t\t/>,\n\t\tdefaultLabel\n\t);\n\n\tconst defaultResponsiveControls = () => {\n\t\treturn viewports.map( ( viewport ) => (\n\t\t\t<Fragment key={ viewport.id }>\n\t\t\t\t{ renderDefaultControl(\n\t\t\t\t\t<ResponsiveBlockControlLabel\n\t\t\t\t\t\tproperty={ property }\n\t\t\t\t\t\tviewport={ viewport }\n\t\t\t\t\t/>,\n\t\t\t\t\tviewport\n\t\t\t\t) }\n\t\t\t</Fragment>\n\t\t) );\n\t};\n\n\treturn (\n\t\t<fieldset className=\"block-editor-responsive-block-control\">\n\t\t\t<legend className=\"block-editor-responsive-block-control__title\">\n\t\t\t\t{ title }\n\t\t\t</legend>\n\n\t\t\t<div className=\"block-editor-responsive-block-control__inner\">\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tclassName=\"block-editor-responsive-block-control__toggle\"\n\t\t\t\t\tlabel={ toggleControlLabel }\n\t\t\t\t\tchecked={ ! isResponsive }\n\t\t\t\t\tonChange={ onIsResponsiveChange }\n\t\t\t\t\thelp={ toggleHelpText }\n\t\t\t\t/>\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-responsive-block-control__group',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-responsive': isResponsive,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ ! isResponsive && defaultControl }\n\t\t\t\t\t{ isResponsive &&\n\t\t\t\t\t\t( renderResponsiveControls\n\t\t\t\t\t\t\t? renderResponsiveControls( viewports )\n\t\t\t\t\t\t\t: defaultResponsiveControls() ) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n\nexport default ResponsiveBlockControl;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,aAAa,QAAQ,uBAAuB;;AAErD;AACA;AACA;AACA,OAAOC,2BAA2B,MAAM,SAAS;AAEjD,SAASC,sBAAsBA,CAAEC,KAAK,EAAG;EACxC,MAAM;IACLC,KAAK;IACLC,QAAQ;IACRC,WAAW;IACXC,oBAAoB;IACpBC,oBAAoB;IACpBC,wBAAwB;IACxBC,YAAY,GAAG,KAAK;IACpBC,YAAY,GAAG;MACdC,EAAE,EAAE,KAAK;MACTC,KAAK,EAAEhB,EAAE,CAAE,KAAK,EAAE,cAAe;IAClC,CAAC;IAC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GE,kBAAoB;IAC5BU,OAAO,EAAG,CAAEf,YAAc;IAC1BgB,QAAQ,EAAGnB,oBAAsB;IACjCoB,IAAI,EAAGX;EAAgB,CACvB,CAAC,EACFE,aAAA;IACCK,SAAS,EAAG5B,UAAU,CACrB,8CAA8C,EAC9C;MACC,eAAe,EAAEe;IAClB,CACD;EAAG,GAED,CAAEA,YAAY,IAAIO,cAAc,EAChCP,YAAY,KACXD,wBAAwB,GACvBA,wBAAwB,CAAEK,SAAU,CAAC,GACrCM,yBAAyB,CAAC,CAAC,CAC3B,CACD,CACI,CAAC;AAEb;AAEA,eAAelB,sBAAsB"}
@@ -4,8 +4,6 @@ import { createElement } from "react";
4
4
  */
5
5
  import { __ } from '@wordpress/i18n';
6
6
  import { Popover, ToolbarGroup } from '@wordpress/components';
7
- import { useSelect } from '@wordpress/data';
8
- import { isCollapsed, getActiveFormats, useAnchor, store as richTextStore } from '@wordpress/rich-text';
9
7
 
10
8
  /**
11
9
  * Internal dependencies
@@ -13,22 +11,6 @@ import { isCollapsed, getActiveFormats, useAnchor, store as richTextStore } from
13
11
  import BlockControls from '../block-controls';
14
12
  import FormatToolbar from './format-toolbar';
15
13
  import NavigableToolbar from '../navigable-toolbar';
16
- import { store as blockEditorStore } from '../../store';
17
- function InlineSelectionToolbar({
18
- editableContentElement,
19
- activeFormats
20
- }) {
21
- const lastFormat = activeFormats[activeFormats.length - 1];
22
- const lastFormatType = lastFormat?.type;
23
- const settings = useSelect(select => select(richTextStore).getFormatType(lastFormatType), [lastFormatType]);
24
- const popoverAnchor = useAnchor({
25
- editableContentElement,
26
- settings
27
- });
28
- return createElement(InlineToolbar, {
29
- popoverAnchor: popoverAnchor
30
- });
31
- }
32
14
  function InlineToolbar({
33
15
  popoverAnchor
34
16
  }) {
@@ -46,25 +28,13 @@ function InlineToolbar({
46
28
  }
47
29
  const FormatToolbarContainer = ({
48
30
  inline,
49
- editableContentElement,
50
- value
31
+ editableContentElement
51
32
  }) => {
52
- const hasInlineToolbar = useSelect(select => select(blockEditorStore).getSettings().hasInlineToolbar, []);
53
33
  if (inline) {
54
34
  return createElement(InlineToolbar, {
55
35
  popoverAnchor: editableContentElement
56
36
  });
57
37
  }
58
- if (hasInlineToolbar) {
59
- const activeFormats = getActiveFormats(value);
60
- if (isCollapsed(value) && !activeFormats.length) {
61
- return null;
62
- }
63
- return createElement(InlineSelectionToolbar, {
64
- editableContentElement: editableContentElement,
65
- activeFormats: activeFormats
66
- });
67
- }
68
38
 
69
39
  // Render regular toolbar.
70
40
  return createElement(BlockControls, {