@wordpress/block-editor 12.20.0 → 12.22.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 (558) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/block-actions/index.js +47 -36
  3. package/build/components/block-actions/index.js.map +1 -1
  4. package/build/components/block-bindings-toolbar-indicator/index.js +25 -0
  5. package/build/components/block-bindings-toolbar-indicator/index.js.map +1 -0
  6. package/build/components/block-edit/context.js +2 -1
  7. package/build/components/block-edit/context.js.map +1 -1
  8. package/build/components/block-edit/index.js +8 -3
  9. package/build/components/block-edit/index.js.map +1 -1
  10. package/build/components/block-heading-level-dropdown/index.js +5 -5
  11. package/build/components/block-heading-level-dropdown/index.js.map +1 -1
  12. package/build/components/block-heading-level-dropdown/index.native.js +5 -4
  13. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
  14. package/build/components/block-inspector/index.js +5 -4
  15. package/build/components/block-inspector/index.js.map +1 -1
  16. package/build/components/block-list/block-crash-boundary.native.js +49 -0
  17. package/build/components/block-list/block-crash-boundary.native.js.map +1 -0
  18. package/build/components/block-list/block-crash-warning.native.js +24 -0
  19. package/build/components/block-list/block-crash-warning.native.js.map +1 -0
  20. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  21. package/build/components/block-list/block-list-item.native.js +1 -1
  22. package/build/components/block-list/block-list-item.native.js.map +1 -1
  23. package/build/components/block-list/block-outline.native.js +23 -7
  24. package/build/components/block-list/block-outline.native.js.map +1 -1
  25. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  26. package/build/components/block-list/block.native.js +7 -5
  27. package/build/components/block-list/block.native.js.map +1 -1
  28. package/build/components/block-list/use-block-props/index.js +8 -1
  29. package/build/components/block-list/use-block-props/index.js.map +1 -1
  30. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -3
  31. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  32. package/build/components/block-mover/index.native.js.map +1 -1
  33. package/build/components/block-popover/cover.js +68 -0
  34. package/build/components/block-popover/cover.js.map +1 -0
  35. package/build/components/block-popover/drop-zone.js +2 -3
  36. package/build/components/block-popover/drop-zone.js.map +1 -1
  37. package/build/components/block-popover/index.js +1 -19
  38. package/build/components/block-popover/index.js.map +1 -1
  39. package/build/components/block-preview/index.js +2 -1
  40. package/build/components/block-preview/index.js.map +1 -1
  41. package/build/components/block-removal-warning-modal/index.js +2 -4
  42. package/build/components/block-removal-warning-modal/index.js.map +1 -1
  43. package/build/components/block-rename/modal.js.map +1 -1
  44. package/build/components/block-settings/container.native.js +2 -1
  45. package/build/components/block-settings/container.native.js.map +1 -1
  46. package/build/components/block-settings-menu/block-settings-dropdown.js +41 -39
  47. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  48. package/build/components/block-settings-menu-controls/index.js +1 -3
  49. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  50. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  51. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  52. package/build/components/block-toolbar/index.js +24 -11
  53. package/build/components/block-toolbar/index.js.map +1 -1
  54. package/build/components/block-toolbar/shuffle.js +89 -0
  55. package/build/components/block-toolbar/shuffle.js.map +1 -0
  56. package/build/components/block-toolbar/use-has-block-toolbar.js +43 -0
  57. package/build/components/block-toolbar/use-has-block-toolbar.js.map +1 -0
  58. package/build/components/block-tools/block-selection-button.js +5 -1
  59. package/build/components/block-tools/block-selection-button.js.map +1 -1
  60. package/build/components/block-tools/empty-block-inserter.js +2 -5
  61. package/build/components/block-tools/empty-block-inserter.js.map +1 -1
  62. package/build/components/block-tools/index.js +9 -26
  63. package/build/components/block-tools/index.js.map +1 -1
  64. package/build/components/block-tools/use-show-block-tools.js +60 -0
  65. package/build/components/block-tools/use-show-block-tools.js.map +1 -0
  66. package/build/components/caption/index.native.js.map +1 -1
  67. package/build/components/child-layout-control/index.js +108 -11
  68. package/build/components/child-layout-control/index.js.map +1 -1
  69. package/build/components/color-palette/control.js.map +1 -1
  70. package/build/components/colors-gradients/control.js +1 -1
  71. package/build/components/colors-gradients/control.js.map +1 -1
  72. package/build/components/convert-to-group-buttons/toolbar.js +11 -0
  73. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  74. package/build/components/global-styles/border-panel.js +21 -8
  75. package/build/components/global-styles/border-panel.js.map +1 -1
  76. package/build/components/global-styles/color-panel.js +1 -1
  77. package/build/components/global-styles/color-panel.js.map +1 -1
  78. package/build/components/global-styles/dimensions-panel.js +8 -33
  79. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  80. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  81. package/build/components/global-styles/index.js +6 -0
  82. package/build/components/global-styles/index.js.map +1 -1
  83. package/build/components/global-styles/shadow-panel-components.js +80 -23
  84. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  85. package/build/components/global-styles/typography-utils.js +7 -5
  86. package/build/components/global-styles/typography-utils.js.map +1 -1
  87. package/build/components/global-styles/use-global-styles-output.js +16 -16
  88. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  89. package/build/components/global-styles/utils.js +2 -4
  90. package/build/components/global-styles/utils.js.map +1 -1
  91. package/build/components/grid-visualizer/grid-item-resizer.js +77 -0
  92. package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -0
  93. package/build/components/grid-visualizer/grid-visualizer.js +81 -0
  94. package/build/components/grid-visualizer/grid-visualizer.js.map +1 -0
  95. package/build/components/grid-visualizer/index.js +20 -0
  96. package/build/components/grid-visualizer/index.js.map +1 -0
  97. package/build/components/grid-visualizer/utils.js +10 -0
  98. package/build/components/grid-visualizer/utils.js.map +1 -0
  99. package/build/components/iframe/index.js +66 -17
  100. package/build/components/iframe/index.js.map +1 -1
  101. package/build/components/index.native.js +7 -0
  102. package/build/components/index.native.js.map +1 -1
  103. package/build/components/inner-blocks/use-nested-settings-update.js +8 -2
  104. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  105. package/build/components/inserter/block-patterns-explorer/index.js +3 -6
  106. package/build/components/inserter/block-patterns-explorer/index.js.map +1 -1
  107. package/build/components/inserter/block-patterns-explorer/pattern-list.js +3 -1
  108. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  109. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  110. package/build/components/inserter/menu.native.js.map +1 -1
  111. package/build/components/inserter/mobile-tab-navigation.js +2 -2
  112. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  113. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  114. package/build/components/inspector-controls-tabs/advanced-controls-panel.native.js +36 -0
  115. package/build/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -0
  116. package/build/components/inspector-controls-tabs/index.js +1 -1
  117. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  118. package/build/components/inspector-controls-tabs/styles-tab.js +1 -1
  119. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  120. package/build/components/link-control/link-preview.js +4 -1
  121. package/build/components/link-control/link-preview.js.map +1 -1
  122. package/build/components/link-control/search-input.js.map +1 -1
  123. package/build/components/list-view/block-select-button.js +0 -2
  124. package/build/components/list-view/block-select-button.js.map +1 -1
  125. package/build/components/list-view/block.js +4 -11
  126. package/build/components/list-view/block.js.map +1 -1
  127. package/build/components/list-view/branch.js.map +1 -1
  128. package/build/components/list-view/drop-indicator.js.map +1 -1
  129. package/build/components/list-view/index.js.map +1 -1
  130. package/build/components/list-view/use-clipboard-handler.js +2 -1
  131. package/build/components/list-view/use-clipboard-handler.js.map +1 -1
  132. package/build/components/list-view/utils.js +5 -3
  133. package/build/components/list-view/utils.js.map +1 -1
  134. package/build/components/panel-color-settings/index.js.map +1 -1
  135. package/build/components/provider/index.js.map +1 -1
  136. package/build/components/resizable-box-popover/index.js +3 -5
  137. package/build/components/resizable-box-popover/index.js.map +1 -1
  138. package/build/components/responsive-block-control/index.js +1 -1
  139. package/build/components/responsive-block-control/index.js.map +1 -1
  140. package/build/components/rich-text/index.js +46 -26
  141. package/build/components/rich-text/index.js.map +1 -1
  142. package/build/components/rich-text/use-enter.js +3 -0
  143. package/build/components/rich-text/use-enter.js.map +1 -1
  144. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  145. package/build/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
  146. package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  147. package/build/components/url-popover/index.js +3 -3
  148. package/build/components/url-popover/index.js.map +1 -1
  149. package/build/components/use-moving-animation/index.js +4 -0
  150. package/build/components/use-moving-animation/index.js.map +1 -1
  151. package/build/components/warning/index.native.js +9 -4
  152. package/build/components/warning/index.native.js.map +1 -1
  153. package/build/components/writing-flow/use-clipboard-handler.js +2 -1
  154. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  155. package/build/components/writing-flow/utils.js +23 -6
  156. package/build/components/writing-flow/utils.js.map +1 -1
  157. package/build/hooks/anchor.js +7 -8
  158. package/build/hooks/anchor.js.map +1 -1
  159. package/build/hooks/background.js +39 -2
  160. package/build/hooks/background.js.map +1 -1
  161. package/build/hooks/block-hooks.js +34 -8
  162. package/build/hooks/block-hooks.js.map +1 -1
  163. package/build/hooks/border.js +6 -4
  164. package/build/hooks/border.js.map +1 -1
  165. package/build/hooks/dimensions.js +3 -4
  166. package/build/hooks/dimensions.js.map +1 -1
  167. package/build/hooks/font-size.js +6 -7
  168. package/build/hooks/font-size.js.map +1 -1
  169. package/build/hooks/index.js +3 -2
  170. package/build/hooks/index.js.map +1 -1
  171. package/build/hooks/layout-child.js +67 -6
  172. package/build/hooks/layout-child.js.map +1 -1
  173. package/build/hooks/layout.js +32 -14
  174. package/build/hooks/layout.js.map +1 -1
  175. package/build/hooks/line-height.js.map +1 -1
  176. package/build/hooks/position.js +1 -1
  177. package/build/hooks/position.js.map +1 -1
  178. package/build/hooks/spacing-visualizer.js +115 -0
  179. package/build/hooks/spacing-visualizer.js.map +1 -0
  180. package/build/hooks/use-bindings-attributes.js +171 -48
  181. package/build/hooks/use-bindings-attributes.js.map +1 -1
  182. package/build/hooks/use-typography-props.js +1 -2
  183. package/build/hooks/use-typography-props.js.map +1 -1
  184. package/build/layouts/grid.js +6 -2
  185. package/build/layouts/grid.js.map +1 -1
  186. package/build/private-apis.js +7 -3
  187. package/build/private-apis.js.map +1 -1
  188. package/build/private-apis.native.js +3 -1
  189. package/build/private-apis.native.js.map +1 -1
  190. package/build/store/actions.js +42 -12
  191. package/build/store/actions.js.map +1 -1
  192. package/build/store/private-actions.js +29 -55
  193. package/build/store/private-actions.js.map +1 -1
  194. package/build/store/private-selectors.js +0 -8
  195. package/build/store/private-selectors.js.map +1 -1
  196. package/build/store/reducer.js +34 -46
  197. package/build/store/reducer.js.map +1 -1
  198. package/build/store/selectors.js +27 -15
  199. package/build/store/selectors.js.map +1 -1
  200. package/build-module/components/block-actions/index.js +47 -36
  201. package/build-module/components/block-actions/index.js.map +1 -1
  202. package/build-module/components/block-bindings-toolbar-indicator/index.js +18 -0
  203. package/build-module/components/block-bindings-toolbar-indicator/index.js.map +1 -0
  204. package/build-module/components/block-edit/context.js +1 -0
  205. package/build-module/components/block-edit/context.js.map +1 -1
  206. package/build-module/components/block-edit/index.js +9 -4
  207. package/build-module/components/block-edit/index.js.map +1 -1
  208. package/build-module/components/block-heading-level-dropdown/index.js +5 -5
  209. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
  210. package/build-module/components/block-heading-level-dropdown/index.native.js +5 -4
  211. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
  212. package/build-module/components/block-inspector/index.js +6 -5
  213. package/build-module/components/block-inspector/index.js.map +1 -1
  214. package/build-module/components/block-list/block-crash-boundary.native.js +42 -0
  215. package/build-module/components/block-list/block-crash-boundary.native.js.map +1 -0
  216. package/build-module/components/block-list/block-crash-warning.native.js +15 -0
  217. package/build-module/components/block-list/block-crash-warning.native.js.map +1 -0
  218. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  219. package/build-module/components/block-list/block-list-item.native.js +1 -1
  220. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  221. package/build-module/components/block-list/block-outline.native.js +23 -7
  222. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  223. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  224. package/build-module/components/block-list/block.native.js +7 -5
  225. package/build-module/components/block-list/block.native.js.map +1 -1
  226. package/build-module/components/block-list/use-block-props/index.js +9 -2
  227. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  228. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -3
  229. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +1 -1
  230. package/build-module/components/block-mover/index.native.js.map +1 -1
  231. package/build-module/components/block-popover/cover.js +60 -0
  232. package/build-module/components/block-popover/cover.js.map +1 -0
  233. package/build-module/components/block-popover/drop-zone.js +2 -3
  234. package/build-module/components/block-popover/drop-zone.js.map +1 -1
  235. package/build-module/components/block-popover/index.js +1 -19
  236. package/build-module/components/block-popover/index.js.map +1 -1
  237. package/build-module/components/block-preview/index.js +2 -1
  238. package/build-module/components/block-preview/index.js.map +1 -1
  239. package/build-module/components/block-removal-warning-modal/index.js +3 -5
  240. package/build-module/components/block-removal-warning-modal/index.js.map +1 -1
  241. package/build-module/components/block-rename/modal.js.map +1 -1
  242. package/build-module/components/block-settings/container.native.js +3 -2
  243. package/build-module/components/block-settings/container.native.js.map +1 -1
  244. package/build-module/components/block-settings-menu/block-settings-dropdown.js +42 -40
  245. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  246. package/build-module/components/block-settings-menu-controls/index.js +1 -3
  247. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  248. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  249. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  250. package/build-module/components/block-toolbar/index.js +24 -12
  251. package/build-module/components/block-toolbar/index.js.map +1 -1
  252. package/build-module/components/block-toolbar/shuffle.js +82 -0
  253. package/build-module/components/block-toolbar/shuffle.js.map +1 -0
  254. package/build-module/components/block-toolbar/use-has-block-toolbar.js +36 -0
  255. package/build-module/components/block-toolbar/use-has-block-toolbar.js.map +1 -0
  256. package/build-module/components/block-tools/block-selection-button.js +5 -1
  257. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  258. package/build-module/components/block-tools/empty-block-inserter.js +2 -5
  259. package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
  260. package/build-module/components/block-tools/index.js +9 -26
  261. package/build-module/components/block-tools/index.js.map +1 -1
  262. package/build-module/components/block-tools/use-show-block-tools.js +54 -0
  263. package/build-module/components/block-tools/use-show-block-tools.js.map +1 -0
  264. package/build-module/components/caption/index.native.js.map +1 -1
  265. package/build-module/components/child-layout-control/index.js +109 -12
  266. package/build-module/components/child-layout-control/index.js.map +1 -1
  267. package/build-module/components/color-palette/control.js.map +1 -1
  268. package/build-module/components/colors-gradients/control.js +1 -1
  269. package/build-module/components/colors-gradients/control.js.map +1 -1
  270. package/build-module/components/convert-to-group-buttons/toolbar.js +12 -1
  271. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  272. package/build-module/components/global-styles/border-panel.js +22 -10
  273. package/build-module/components/global-styles/border-panel.js.map +1 -1
  274. package/build-module/components/global-styles/color-panel.js +1 -1
  275. package/build-module/components/global-styles/color-panel.js.map +1 -1
  276. package/build-module/components/global-styles/dimensions-panel.js +9 -34
  277. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  278. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  279. package/build-module/components/global-styles/index.js +1 -1
  280. package/build-module/components/global-styles/index.js.map +1 -1
  281. package/build-module/components/global-styles/shadow-panel-components.js +82 -24
  282. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  283. package/build-module/components/global-styles/typography-utils.js +7 -5
  284. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  285. package/build-module/components/global-styles/use-global-styles-output.js +17 -17
  286. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  287. package/build-module/components/global-styles/utils.js +2 -4
  288. package/build-module/components/global-styles/utils.js.map +1 -1
  289. package/build-module/components/grid-visualizer/grid-item-resizer.js +69 -0
  290. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -0
  291. package/build-module/components/grid-visualizer/grid-visualizer.js +73 -0
  292. package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -0
  293. package/build-module/components/grid-visualizer/index.js +3 -0
  294. package/build-module/components/grid-visualizer/index.js.map +1 -0
  295. package/build-module/components/grid-visualizer/utils.js +4 -0
  296. package/build-module/components/grid-visualizer/utils.js.map +1 -0
  297. package/build-module/components/iframe/index.js +66 -17
  298. package/build-module/components/iframe/index.js.map +1 -1
  299. package/build-module/components/index.native.js +1 -1
  300. package/build-module/components/index.native.js.map +1 -1
  301. package/build-module/components/inner-blocks/use-nested-settings-update.js +8 -2
  302. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  303. package/build-module/components/inserter/block-patterns-explorer/index.js +3 -6
  304. package/build-module/components/inserter/block-patterns-explorer/index.js.map +1 -1
  305. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +3 -1
  306. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  307. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  308. package/build-module/components/inserter/menu.native.js.map +1 -1
  309. package/build-module/components/inserter/mobile-tab-navigation.js +2 -2
  310. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  311. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  312. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.native.js +28 -0
  313. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.native.js.map +1 -0
  314. package/build-module/components/inspector-controls-tabs/index.js +1 -1
  315. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  316. package/build-module/components/inspector-controls-tabs/styles-tab.js +2 -2
  317. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  318. package/build-module/components/link-control/link-preview.js +5 -2
  319. package/build-module/components/link-control/link-preview.js.map +1 -1
  320. package/build-module/components/link-control/search-input.js.map +1 -1
  321. package/build-module/components/list-view/block-select-button.js +0 -2
  322. package/build-module/components/list-view/block-select-button.js.map +1 -1
  323. package/build-module/components/list-view/block.js +6 -13
  324. package/build-module/components/list-view/block.js.map +1 -1
  325. package/build-module/components/list-view/branch.js.map +1 -1
  326. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  327. package/build-module/components/list-view/index.js.map +1 -1
  328. package/build-module/components/list-view/use-clipboard-handler.js +3 -2
  329. package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
  330. package/build-module/components/list-view/utils.js +2 -1
  331. package/build-module/components/list-view/utils.js.map +1 -1
  332. package/build-module/components/panel-color-settings/index.js.map +1 -1
  333. package/build-module/components/provider/index.js.map +1 -1
  334. package/build-module/components/resizable-box-popover/index.js +3 -5
  335. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  336. package/build-module/components/responsive-block-control/index.js +1 -1
  337. package/build-module/components/responsive-block-control/index.js.map +1 -1
  338. package/build-module/components/rich-text/index.js +47 -28
  339. package/build-module/components/rich-text/index.js.map +1 -1
  340. package/build-module/components/rich-text/use-enter.js +3 -0
  341. package/build-module/components/rich-text/use-enter.js.map +1 -1
  342. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  343. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
  344. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -1
  345. package/build-module/components/url-popover/index.js +3 -3
  346. package/build-module/components/url-popover/index.js.map +1 -1
  347. package/build-module/components/use-moving-animation/index.js +4 -0
  348. package/build-module/components/use-moving-animation/index.js.map +1 -1
  349. package/build-module/components/warning/index.native.js +9 -4
  350. package/build-module/components/warning/index.native.js.map +1 -1
  351. package/build-module/components/writing-flow/use-clipboard-handler.js +3 -2
  352. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  353. package/build-module/components/writing-flow/utils.js +22 -7
  354. package/build-module/components/writing-flow/utils.js.map +1 -1
  355. package/build-module/hooks/anchor.js +8 -9
  356. package/build-module/hooks/anchor.js.map +1 -1
  357. package/build-module/hooks/background.js +38 -1
  358. package/build-module/hooks/background.js.map +1 -1
  359. package/build-module/hooks/block-hooks.js +34 -8
  360. package/build-module/hooks/block-hooks.js.map +1 -1
  361. package/build-module/hooks/border.js +7 -5
  362. package/build-module/hooks/border.js.map +1 -1
  363. package/build-module/hooks/dimensions.js +1 -2
  364. package/build-module/hooks/dimensions.js.map +1 -1
  365. package/build-module/hooks/font-size.js +7 -8
  366. package/build-module/hooks/font-size.js.map +1 -1
  367. package/build-module/hooks/index.js +3 -2
  368. package/build-module/hooks/index.js.map +1 -1
  369. package/build-module/hooks/layout-child.js +67 -6
  370. package/build-module/hooks/layout-child.js.map +1 -1
  371. package/build-module/hooks/layout.js +32 -14
  372. package/build-module/hooks/layout.js.map +1 -1
  373. package/build-module/hooks/line-height.js.map +1 -1
  374. package/build-module/hooks/position.js +1 -1
  375. package/build-module/hooks/position.js.map +1 -1
  376. package/build-module/hooks/spacing-visualizer.js +106 -0
  377. package/build-module/hooks/spacing-visualizer.js.map +1 -0
  378. package/build-module/hooks/use-bindings-attributes.js +172 -49
  379. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  380. package/build-module/hooks/use-typography-props.js +2 -3
  381. package/build-module/hooks/use-typography-props.js.map +1 -1
  382. package/build-module/layouts/grid.js +6 -2
  383. package/build-module/layouts/grid.js.map +1 -1
  384. package/build-module/private-apis.js +7 -3
  385. package/build-module/private-apis.js.map +1 -1
  386. package/build-module/private-apis.native.js +3 -1
  387. package/build-module/private-apis.native.js.map +1 -1
  388. package/build-module/store/actions.js +42 -12
  389. package/build-module/store/actions.js.map +1 -1
  390. package/build-module/store/private-actions.js +29 -54
  391. package/build-module/store/private-actions.js.map +1 -1
  392. package/build-module/store/private-selectors.js +0 -6
  393. package/build-module/store/private-selectors.js.map +1 -1
  394. package/build-module/store/reducer.js +34 -46
  395. package/build-module/store/reducer.js.map +1 -1
  396. package/build-module/store/selectors.js +23 -13
  397. package/build-module/store/selectors.js.map +1 -1
  398. package/build-style/content-rtl.css +22 -2
  399. package/build-style/content.css +22 -2
  400. package/build-style/default-editor-styles-rtl.css +1 -0
  401. package/build-style/default-editor-styles.css +1 -0
  402. package/build-style/style-rtl.css +106 -27
  403. package/build-style/style.css +106 -27
  404. package/package.json +31 -31
  405. package/src/components/block-actions/index.js +59 -55
  406. package/src/components/block-bindings-toolbar-indicator/index.js +20 -0
  407. package/src/components/block-bindings-toolbar-indicator/style.scss +16 -0
  408. package/src/components/block-draggable/test/index.native.js +2 -2
  409. package/src/components/block-edit/context.js +1 -0
  410. package/src/components/block-edit/index.js +5 -1
  411. package/src/components/block-heading-level-dropdown/README.md +5 -5
  412. package/src/components/block-heading-level-dropdown/index.js +5 -5
  413. package/src/components/block-heading-level-dropdown/index.native.js +5 -4
  414. package/src/components/block-inspector/index.js +7 -5
  415. package/src/components/block-list/block-crash-boundary.native.js +43 -0
  416. package/src/components/block-list/block-crash-warning.native.js +19 -0
  417. package/src/components/block-list/block-invalid-warning.native.js +1 -1
  418. package/src/components/block-list/block-list-item.native.js +1 -1
  419. package/src/components/block-list/block-outline.native.js +36 -21
  420. package/src/components/block-list/block-selection-button.native.js +1 -3
  421. package/src/components/block-list/block.native.js +14 -10
  422. package/src/components/block-list/content.scss +21 -1
  423. package/src/components/block-list/test/block-outline.native.js +255 -0
  424. package/src/components/block-list/use-block-props/index.js +12 -2
  425. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +3 -7
  426. package/src/components/block-mover/index.native.js +1 -1
  427. package/src/components/block-popover/cover.js +63 -0
  428. package/src/components/block-popover/drop-zone.js +3 -4
  429. package/src/components/block-popover/index.js +1 -28
  430. package/src/components/block-preview/index.js +3 -1
  431. package/src/components/block-removal-warning-modal/index.js +5 -19
  432. package/src/components/block-rename/modal.js +1 -1
  433. package/src/components/block-settings/container.native.js +5 -1
  434. package/src/components/block-settings-menu/block-settings-dropdown.js +53 -65
  435. package/src/components/block-settings-menu-controls/README.md +0 -9
  436. package/src/components/block-settings-menu-controls/index.js +1 -6
  437. package/src/components/block-switcher/block-transformations-menu.native.js +1 -1
  438. package/src/components/block-toolbar/block-toolbar-menu.native.js +2 -2
  439. package/src/components/block-toolbar/index.js +22 -16
  440. package/src/components/block-toolbar/shuffle.js +93 -0
  441. package/src/components/block-toolbar/test/index.native.js +1 -7
  442. package/src/components/block-toolbar/use-has-block-toolbar.js +49 -0
  443. package/src/components/block-tools/block-selection-button.js +4 -0
  444. package/src/components/block-tools/empty-block-inserter.js +3 -6
  445. package/src/components/block-tools/index.js +13 -36
  446. package/src/components/block-tools/use-show-block-tools.js +73 -0
  447. package/src/components/caption/index.native.js +1 -1
  448. package/src/components/child-layout-control/index.js +148 -36
  449. package/src/components/color-palette/control.js +1 -1
  450. package/src/components/colors-gradients/control.js +1 -1
  451. package/src/components/colors-gradients/test/control.js +2 -2
  452. package/src/components/contrast-checker/test/index.js +10 -10
  453. package/src/components/convert-to-group-buttons/toolbar.js +13 -1
  454. package/src/components/default-block-appender/content.scss +5 -2
  455. package/src/components/global-styles/border-panel.js +35 -24
  456. package/src/components/global-styles/color-panel.js +1 -1
  457. package/src/components/global-styles/dimensions-panel.js +9 -34
  458. package/src/components/global-styles/image-settings-panel.js +1 -1
  459. package/src/components/global-styles/index.js +5 -1
  460. package/src/components/global-styles/shadow-panel-components.js +92 -23
  461. package/src/components/global-styles/style.scss +33 -10
  462. package/src/components/global-styles/test/typography-utils.js +231 -81
  463. package/src/components/global-styles/test/use-global-styles-output.js +31 -0
  464. package/src/components/global-styles/typography-utils.js +10 -7
  465. package/src/components/global-styles/use-global-styles-output.js +17 -17
  466. package/src/components/global-styles/utils.js +2 -26
  467. package/src/components/grid-visualizer/grid-item-resizer.js +100 -0
  468. package/src/components/grid-visualizer/grid-visualizer.js +81 -0
  469. package/src/components/grid-visualizer/index.js +2 -0
  470. package/src/components/grid-visualizer/style.scss +33 -0
  471. package/src/components/grid-visualizer/utils.js +5 -0
  472. package/src/components/iframe/index.js +89 -26
  473. package/src/components/index.native.js +1 -0
  474. package/src/components/inner-blocks/use-nested-settings-update.js +12 -2
  475. package/src/components/inserter/block-patterns-explorer/index.js +2 -9
  476. package/src/components/inserter/block-patterns-explorer/pattern-list.js +7 -1
  477. package/src/components/inserter/media-tab/media-preview.js +1 -1
  478. package/src/components/inserter/menu.native.js +3 -3
  479. package/src/components/inserter/mobile-tab-navigation.js +2 -2
  480. package/src/components/inserter/style.scss +10 -0
  481. package/src/components/inspector-controls/block-support-tools-panel.js +2 -2
  482. package/src/components/inspector-controls-tabs/advanced-controls-panel.native.js +31 -0
  483. package/src/components/inspector-controls-tabs/index.js +1 -1
  484. package/src/components/inspector-controls-tabs/styles-tab.js +2 -2
  485. package/src/components/line-height-control/test/index.js +1 -1
  486. package/src/components/link-control/link-preview.js +9 -2
  487. package/src/components/link-control/search-input.js +1 -1
  488. package/src/components/link-control/style.scss +9 -5
  489. package/src/components/list-view/block-select-button.js +0 -2
  490. package/src/components/list-view/block.js +12 -21
  491. package/src/components/list-view/branch.js +1 -1
  492. package/src/components/list-view/drop-indicator.js +1 -1
  493. package/src/components/list-view/index.js +1 -1
  494. package/src/components/list-view/style.scss +34 -16
  495. package/src/components/list-view/use-clipboard-handler.js +3 -2
  496. package/src/components/list-view/utils.js +4 -1
  497. package/src/components/panel-color-settings/index.js +1 -1
  498. package/src/components/panel-color-settings/test/index.js +3 -3
  499. package/src/components/provider/index.js +1 -4
  500. package/src/components/resizable-box-popover/index.js +4 -6
  501. package/src/components/responsive-block-control/README.md +4 -4
  502. package/src/components/responsive-block-control/index.js +1 -1
  503. package/src/components/responsive-block-control/test/index.js +5 -5
  504. package/src/components/rich-text/README.md +6 -0
  505. package/src/components/rich-text/index.js +76 -53
  506. package/src/components/rich-text/use-enter.js +4 -0
  507. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -4
  508. package/src/components/spacing-sizes-control/sides-dropdown/index.js +1 -1
  509. package/src/components/url-popover/index.js +5 -5
  510. package/src/components/url-popover/style.scss +1 -0
  511. package/src/components/use-moving-animation/index.js +1 -0
  512. package/src/components/warning/index.native.js +19 -15
  513. package/src/components/writing-flow/use-clipboard-handler.js +3 -2
  514. package/src/components/writing-flow/utils.js +31 -16
  515. package/src/hooks/anchor.js +41 -61
  516. package/src/hooks/background.js +49 -4
  517. package/src/hooks/block-hooks.js +47 -9
  518. package/src/hooks/block-hooks.scss +6 -0
  519. package/src/hooks/border.js +16 -4
  520. package/src/hooks/dimensions.js +1 -2
  521. package/src/hooks/font-size.js +7 -12
  522. package/src/hooks/index.js +3 -0
  523. package/src/hooks/layout-child.js +82 -8
  524. package/src/hooks/layout.js +34 -19
  525. package/src/hooks/line-height.js +1 -1
  526. package/src/hooks/position.js +1 -1
  527. package/src/hooks/spacing-visualizer.js +126 -0
  528. package/src/hooks/{padding.scss → spacing.scss} +1 -1
  529. package/src/hooks/test/__snapshots__/anchor.native.js.snap +7 -0
  530. package/src/hooks/test/anchor.native.js +32 -0
  531. package/src/hooks/use-bindings-attributes.js +215 -65
  532. package/src/hooks/use-typography-props.js +2 -8
  533. package/src/layouts/grid.js +8 -3
  534. package/src/private-apis.js +6 -2
  535. package/src/private-apis.native.js +2 -0
  536. package/src/store/actions.js +56 -18
  537. package/src/store/private-actions.js +34 -79
  538. package/src/store/private-selectors.js +0 -8
  539. package/src/store/reducer.js +43 -64
  540. package/src/store/selectors.js +41 -46
  541. package/src/store/test/actions.js +0 -4
  542. package/src/style.scss +3 -1
  543. package/tsconfig.json +1 -0
  544. package/build/hooks/margin.js +0 -86
  545. package/build/hooks/margin.js.map +0 -1
  546. package/build/hooks/padding.js +0 -78
  547. package/build/hooks/padding.js.map +0 -1
  548. package/build/utils/use-can-block-toolbar-be-focused.js +0 -46
  549. package/build/utils/use-can-block-toolbar-be-focused.js.map +0 -1
  550. package/build-module/hooks/margin.js +0 -78
  551. package/build-module/hooks/margin.js.map +0 -1
  552. package/build-module/hooks/padding.js +0 -70
  553. package/build-module/hooks/padding.js.map +0 -1
  554. package/build-module/utils/use-can-block-toolbar-be-focused.js +0 -40
  555. package/build-module/utils/use-can-block-toolbar-be-focused.js.map +0 -1
  556. package/src/hooks/margin.js +0 -91
  557. package/src/hooks/padding.js +0 -82
  558. package/src/utils/use-can-block-toolbar-be-focused.js +0 -48
@@ -1 +1 @@
1
- {"version":3,"names":["PanelBody","__","BlockStyles","InspectorControls","getBorderPanelLabel","StylesTab","blockName","clientId","hasBlockStyles","borderPanelLabel","createElement","Fragment","title","Slot","group","label","className"],"sources":["@wordpress/block-editor/src/components/inspector-controls-tabs/styles-tab.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockStyles from '../block-styles';\nimport InspectorControls from '../inspector-controls';\nimport { getBorderPanelLabel } from '../../hooks/border';\n\nconst StylesTab = ( { blockName, clientId, hasBlockStyles } ) => {\n\tconst borderPanelLabel = getBorderPanelLabel( { blockName } );\n\n\treturn (\n\t\t<>\n\t\t\t{ hasBlockStyles && (\n\t\t\t\t<div>\n\t\t\t\t\t<PanelBody title={ __( 'Styles' ) }>\n\t\t\t\t\t\t<BlockStyles clientId={ clientId } />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"color\"\n\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\tclassName=\"color-block-support-panel__inner-wrapper\"\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"background\"\n\t\t\t\tlabel={ __( 'Background' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot group=\"filter\" />\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"typography\"\n\t\t\t\tlabel={ __( 'Typography' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot group=\"border\" label={ borderPanelLabel } />\n\t\t\t<InspectorControls.Slot group=\"styles\" />\n\t\t</>\n\t);\n};\n\nexport default StylesTab;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,uBAAuB;AACjD,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SAASC,mBAAmB,QAAQ,oBAAoB;AAExD,MAAMC,SAAS,GAAGA,CAAE;EAAEC,SAAS;EAAEC,QAAQ;EAAEC;AAAe,CAAC,KAAM;EAChE,MAAMC,gBAAgB,GAAGL,mBAAmB,CAAE;IAAEE;EAAU,CAAE,CAAC;EAE7D,OACCI,aAAA,CAAAC,QAAA,QACGH,cAAc,IACfE,aAAA,cACCA,aAAA,CAACV,SAAS;IAACY,KAAK,EAAGX,EAAE,CAAE,QAAS;EAAG,GAClCS,aAAA,CAACR,WAAW;IAACK,QAAQ,EAAGA;EAAU,CAAE,CAC1B,CACP,CACL,EACDG,aAAA,CAACP,iBAAiB,CAACU,IAAI;IACtBC,KAAK,EAAC,OAAO;IACbC,KAAK,EAAGd,EAAE,CAAE,OAAQ,CAAG;IACvBe,SAAS,EAAC;EAA0C,CACpD,CAAC,EACFN,aAAA,CAACP,iBAAiB,CAACU,IAAI;IACtBC,KAAK,EAAC,YAAY;IAClBC,KAAK,EAAGd,EAAE,CAAE,YAAa;EAAG,CAC5B,CAAC,EACFS,aAAA,CAACP,iBAAiB,CAACU,IAAI;IAACC,KAAK,EAAC;EAAQ,CAAE,CAAC,EACzCJ,aAAA,CAACP,iBAAiB,CAACU,IAAI;IACtBC,KAAK,EAAC,YAAY;IAClBC,KAAK,EAAGd,EAAE,CAAE,YAAa;EAAG,CAC5B,CAAC,EACFS,aAAA,CAACP,iBAAiB,CAACU,IAAI;IACtBC,KAAK,EAAC,YAAY;IAClBC,KAAK,EAAGd,EAAE,CAAE,YAAa;EAAG,CAC5B,CAAC,EACFS,aAAA,CAACP,iBAAiB,CAACU,IAAI;IAACC,KAAK,EAAC,QAAQ;IAACC,KAAK,EAAGN;EAAkB,CAAE,CAAC,EACpEC,aAAA,CAACP,iBAAiB,CAACU,IAAI;IAACC,KAAK,EAAC;EAAQ,CAAE,CACvC,CAAC;AAEL,CAAC;AAED,eAAeT,SAAS"}
1
+ {"version":3,"names":["PanelBody","__","BlockStyles","InspectorControls","useBorderPanelLabel","StylesTab","blockName","clientId","hasBlockStyles","borderPanelLabel","createElement","Fragment","title","Slot","group","label","className"],"sources":["@wordpress/block-editor/src/components/inspector-controls-tabs/styles-tab.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockStyles from '../block-styles';\nimport InspectorControls from '../inspector-controls';\nimport { useBorderPanelLabel } from '../../hooks/border';\n\nconst StylesTab = ( { blockName, clientId, hasBlockStyles } ) => {\n\tconst borderPanelLabel = useBorderPanelLabel( { blockName } );\n\n\treturn (\n\t\t<>\n\t\t\t{ hasBlockStyles && (\n\t\t\t\t<div>\n\t\t\t\t\t<PanelBody title={ __( 'Styles' ) }>\n\t\t\t\t\t\t<BlockStyles clientId={ clientId } />\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"color\"\n\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\tclassName=\"color-block-support-panel__inner-wrapper\"\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"background\"\n\t\t\t\tlabel={ __( 'Background' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot group=\"filter\" />\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"typography\"\n\t\t\t\tlabel={ __( 'Typography' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot\n\t\t\t\tgroup=\"dimensions\"\n\t\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\t/>\n\t\t\t<InspectorControls.Slot group=\"border\" label={ borderPanelLabel } />\n\t\t\t<InspectorControls.Slot group=\"styles\" />\n\t\t</>\n\t);\n};\n\nexport default StylesTab;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,uBAAuB;AACjD,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SAASC,mBAAmB,QAAQ,oBAAoB;AAExD,MAAMC,SAAS,GAAGA,CAAE;EAAEC,SAAS;EAAEC,QAAQ;EAAEC;AAAe,CAAC,KAAM;EAChE,MAAMC,gBAAgB,GAAGL,mBAAmB,CAAE;IAAEE;EAAU,CAAE,CAAC;EAE7D,OACCI,aAAA,CAAAC,QAAA,QACGH,cAAc,IACfE,aAAA,cACCA,aAAA,CAACV,SAAS;IAACY,KAAK,EAAGX,EAAE,CAAE,QAAS;EAAG,GAClCS,aAAA,CAACR,WAAW;IAACK,QAAQ,EAAGA;EAAU,CAAE,CAC1B,CACP,CACL,EACDG,aAAA,CAACP,iBAAiB,CAACU,IAAI;IACtBC,KAAK,EAAC,OAAO;IACbC,KAAK,EAAGd,EAAE,CAAE,OAAQ,CAAG;IACvBe,SAAS,EAAC;EAA0C,CACpD,CAAC,EACFN,aAAA,CAACP,iBAAiB,CAACU,IAAI;IACtBC,KAAK,EAAC,YAAY;IAClBC,KAAK,EAAGd,EAAE,CAAE,YAAa;EAAG,CAC5B,CAAC,EACFS,aAAA,CAACP,iBAAiB,CAACU,IAAI;IAACC,KAAK,EAAC;EAAQ,CAAE,CAAC,EACzCJ,aAAA,CAACP,iBAAiB,CAACU,IAAI;IACtBC,KAAK,EAAC,YAAY;IAClBC,KAAK,EAAGd,EAAE,CAAE,YAAa;EAAG,CAC5B,CAAC,EACFS,aAAA,CAACP,iBAAiB,CAACU,IAAI;IACtBC,KAAK,EAAC,YAAY;IAClBC,KAAK,EAAGd,EAAE,CAAE,YAAa;EAAG,CAC5B,CAAC,EACFS,aAAA,CAACP,iBAAiB,CAACU,IAAI;IAACC,KAAK,EAAC,QAAQ;IAACC,KAAK,EAAGN;EAAkB,CAAE,CAAC,EACpEC,aAAA,CAACP,iBAAiB,CAACU,IAAI;IAACC,KAAK,EAAC;EAAQ,CAAE,CACvC,CAAC;AAEL,CAAC;AAED,eAAeT,SAAS"}
@@ -13,8 +13,9 @@ import { useCopyToClipboard } from '@wordpress/compose';
13
13
  import { filterURLForDisplay, safeDecodeURI } from '@wordpress/url';
14
14
  import { Icon, globe, info, linkOff, edit, copySmall } from '@wordpress/icons';
15
15
  import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
16
- import { useDispatch } from '@wordpress/data';
16
+ import { useDispatch, useSelect } from '@wordpress/data';
17
17
  import { store as noticesStore } from '@wordpress/notices';
18
+ import { store as preferencesStore } from '@wordpress/preferences';
18
19
 
19
20
  /**
20
21
  * Internal dependencies
@@ -28,6 +29,8 @@ export default function LinkPreview({
28
29
  hasUnlinkControl = false,
29
30
  onRemove
30
31
  }) {
32
+ const showIconLabels = useSelect(select => select(preferencesStore).get('core', 'showIconLabels'), []);
33
+
31
34
  // Avoid fetching if rich previews are not desired.
32
35
  const showRichPreviews = hasRichPreviews ? value?.url : null;
33
36
  const {
@@ -114,7 +117,7 @@ export default function LinkPreview({
114
117
  // Translators: %s is a placeholder for the link URL and an optional colon, (if a Link URL is present).
115
118
  __('Copy link%s'),
116
119
  // Ends up looking like "Copy link: https://example.com".
117
- isEmptyURL ? '' : ': ' + value.url),
120
+ isEmptyURL || showIconLabels ? '' : ': ' + value.url),
118
121
  ref: ref,
119
122
  disabled: isEmptyURL,
120
123
  size: "compact"
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","__","sprintf","Button","ExternalLink","__experimentalTruncate","Truncate","useCopyToClipboard","filterURLForDisplay","safeDecodeURI","Icon","globe","info","linkOff","edit","copySmall","__unstableStripHTML","stripHTML","useDispatch","store","noticesStore","ViewerSlot","useRichUrlData","LinkPreview","value","onEditClick","hasRichPreviews","hasUnlinkControl","onRemove","showRichPreviews","url","richData","isFetching","hasRichData","Object","keys","length","displayURL","isEmptyURL","displayTitle","title","icon","createElement","src","alt","size","createNotice","ref","isDismissible","type","className","Fragment","href","numberOfLines","label","onClick","disabled","fillProps"],"sources":["@wordpress/block-editor/src/components/link-control/link-preview.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tExternalLink,\n\t__experimentalTruncate as Truncate,\n} from '@wordpress/components';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { filterURLForDisplay, safeDecodeURI } from '@wordpress/url';\nimport { Icon, globe, info, linkOff, edit, copySmall } from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { ViewerSlot } from './viewer-slot';\n\nimport useRichUrlData from './use-rich-url-data';\n\nexport default function LinkPreview( {\n\tvalue,\n\tonEditClick,\n\thasRichPreviews = false,\n\thasUnlinkControl = false,\n\tonRemove,\n} ) {\n\t// Avoid fetching if rich previews are not desired.\n\tconst showRichPreviews = hasRichPreviews ? value?.url : null;\n\n\tconst { richData, isFetching } = useRichUrlData( showRichPreviews );\n\n\t// Rich data may be an empty object so test for that.\n\tconst hasRichData = richData && Object.keys( richData ).length;\n\n\tconst displayURL =\n\t\t( value && filterURLForDisplay( safeDecodeURI( value.url ), 24 ) ) ||\n\t\t'';\n\n\t// url can be undefined if the href attribute is unset\n\tconst isEmptyURL = ! value?.url?.length;\n\n\tconst displayTitle =\n\t\t! isEmptyURL &&\n\t\tstripHTML( richData?.title || value?.title || displayURL );\n\n\tlet icon;\n\n\tif ( richData?.icon ) {\n\t\ticon = <img src={ richData?.icon } alt=\"\" />;\n\t} else if ( isEmptyURL ) {\n\t\ticon = <Icon icon={ info } size={ 32 } />;\n\t} else {\n\t\ticon = <Icon icon={ globe } />;\n\t}\n\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst ref = useCopyToClipboard( value.url, () => {\n\t\tcreateNotice( 'info', __( 'Link copied to clipboard.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\taria-label={ __( 'Currently selected' ) }\n\t\t\tclassName={ classnames( 'block-editor-link-control__search-item', {\n\t\t\t\t'is-current': true,\n\t\t\t\t'is-rich': hasRichData,\n\t\t\t\t'is-fetching': !! isFetching,\n\t\t\t\t'is-preview': true,\n\t\t\t\t'is-error': isEmptyURL,\n\t\t\t\t'is-url-title': displayTitle === displayURL,\n\t\t\t} ) }\n\t\t>\n\t\t\t<div className=\"block-editor-link-control__search-item-top\">\n\t\t\t\t<span className=\"block-editor-link-control__search-item-header\">\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'block-editor-link-control__search-item-icon',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-image': richData?.icon,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ icon }\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"block-editor-link-control__search-item-details\">\n\t\t\t\t\t\t{ ! isEmptyURL ? (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__search-item-title\"\n\t\t\t\t\t\t\t\t\thref={ value.url }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t{ displayTitle }\n\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t{ value?.url && displayTitle !== displayURL && (\n\t\t\t\t\t\t\t\t\t<span className=\"block-editor-link-control__search-item-info\">\n\t\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t\t{ displayURL }\n\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<span className=\"block-editor-link-control__search-item-error-notice\">\n\t\t\t\t\t\t\t\t{ __( 'Link is empty' ) }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ edit }\n\t\t\t\t\tlabel={ __( 'Edit link' ) }\n\t\t\t\t\tonClick={ onEditClick }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t\t{ hasUnlinkControl && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\tlabel={ __( 'Remove link' ) }\n\t\t\t\t\t\tonClick={ onRemove }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<Button\n\t\t\t\t\ticon={ copySmall }\n\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t// Translators: %s is a placeholder for the link URL and an optional colon, (if a Link URL is present).\n\t\t\t\t\t\t__( 'Copy link%s' ), // Ends up looking like \"Copy link: https://example.com\".\n\t\t\t\t\t\tisEmptyURL ? '' : ': ' + value.url\n\t\t\t\t\t) }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tdisabled={ isEmptyURL }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t\t<ViewerSlot fillProps={ value } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,MAAM,EACNC,YAAY,EACZC,sBAAsB,IAAIC,QAAQ,QAC5B,uBAAuB;AAC9B,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,mBAAmB,EAAEC,aAAa,QAAQ,gBAAgB;AACnE,SAASC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,OAAO,EAAEC,IAAI,EAAEC,SAAS,QAAQ,kBAAkB;AAC9E,SAASC,mBAAmB,IAAIC,SAAS,QAAQ,gBAAgB;AACjE,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;;AAE1D;AACA;AACA;AACA,SAASC,UAAU,QAAQ,eAAe;AAE1C,OAAOC,cAAc,MAAM,qBAAqB;AAEhD,eAAe,SAASC,WAAWA,CAAE;EACpCC,KAAK;EACLC,WAAW;EACXC,eAAe,GAAG,KAAK;EACvBC,gBAAgB,GAAG,KAAK;EACxBC;AACD,CAAC,EAAG;EACH;EACA,MAAMC,gBAAgB,GAAGH,eAAe,GAAGF,KAAK,EAAEM,GAAG,GAAG,IAAI;EAE5D,MAAM;IAAEC,QAAQ;IAAEC;EAAW,CAAC,GAAGV,cAAc,CAAEO,gBAAiB,CAAC;;EAEnE;EACA,MAAMI,WAAW,GAAGF,QAAQ,IAAIG,MAAM,CAACC,IAAI,CAAEJ,QAAS,CA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AAI,EAAG1B,SAAW;IAClBuC,KAAK,EAAGpD,OAAO;IACd;IACAD,EAAE,CAAE,aAAc,CAAC;IAAE;IACrBqC,UAAU,GAAG,EAAE,GAAG,IAAI,GAAGd,KAAK,CAACM,GAChC,CAAG;IACHiB,GAAG,EAAGA,GAAK;IACXS,QAAQ,EAAGlB,UAAY;IACvBO,IAAI,EAAC;EAAS,CACd,CAAC,EACFH,aAAA,CAACrB,UAAU;IAACoC,SAAS,EAAGjC;EAAO,CAAE,CAC7B,CACD,CAAC;AAER"}
1
+ {"version":3,"names":["classnames","__","sprintf","Button","ExternalLink","__experimentalTruncate","Truncate","useCopyToClipboard","filterURLForDisplay","safeDecodeURI","Icon","globe","info","linkOff","edit","copySmall","__unstableStripHTML","stripHTML","useDispatch","useSelect","store","noticesStore","preferencesStore","ViewerSlot","useRichUrlData","LinkPreview","value","onEditClick","hasRichPreviews","hasUnlinkControl","onRemove","showIconLabels","select","get","showRichPreviews","url","richData","isFetching","hasRichData","Object","keys","length","displayURL","isEmptyURL","displayTitle","title","icon","createElement","src","alt","size","createNotice","ref","isDismissible","type","className","Fragment","href","numberOfLines","label","onClick","disabled","fillProps"],"sources":["@wordpress/block-editor/src/components/link-control/link-preview.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tExternalLink,\n\t__experimentalTruncate as Truncate,\n} from '@wordpress/components';\nimport { useCopyToClipboard } from '@wordpress/compose';\nimport { filterURLForDisplay, safeDecodeURI } from '@wordpress/url';\nimport { Icon, globe, info, linkOff, edit, copySmall } from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { ViewerSlot } from './viewer-slot';\n\nimport useRichUrlData from './use-rich-url-data';\n\nexport default function LinkPreview( {\n\tvalue,\n\tonEditClick,\n\thasRichPreviews = false,\n\thasUnlinkControl = false,\n\tonRemove,\n} ) {\n\tconst showIconLabels = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', 'showIconLabels' ),\n\t\t[]\n\t);\n\n\t// Avoid fetching if rich previews are not desired.\n\tconst showRichPreviews = hasRichPreviews ? value?.url : null;\n\n\tconst { richData, isFetching } = useRichUrlData( showRichPreviews );\n\n\t// Rich data may be an empty object so test for that.\n\tconst hasRichData = richData && Object.keys( richData ).length;\n\n\tconst displayURL =\n\t\t( value && filterURLForDisplay( safeDecodeURI( value.url ), 24 ) ) ||\n\t\t'';\n\n\t// url can be undefined if the href attribute is unset\n\tconst isEmptyURL = ! value?.url?.length;\n\n\tconst displayTitle =\n\t\t! isEmptyURL &&\n\t\tstripHTML( richData?.title || value?.title || displayURL );\n\n\tlet icon;\n\n\tif ( richData?.icon ) {\n\t\ticon = <img src={ richData?.icon } alt=\"\" />;\n\t} else if ( isEmptyURL ) {\n\t\ticon = <Icon icon={ info } size={ 32 } />;\n\t} else {\n\t\ticon = <Icon icon={ globe } />;\n\t}\n\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst ref = useCopyToClipboard( value.url, () => {\n\t\tcreateNotice( 'info', __( 'Link copied to clipboard.' ), {\n\t\t\tisDismissible: true,\n\t\t\ttype: 'snackbar',\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<div\n\t\t\taria-label={ __( 'Currently selected' ) }\n\t\t\tclassName={ classnames( 'block-editor-link-control__search-item', {\n\t\t\t\t'is-current': true,\n\t\t\t\t'is-rich': hasRichData,\n\t\t\t\t'is-fetching': !! isFetching,\n\t\t\t\t'is-preview': true,\n\t\t\t\t'is-error': isEmptyURL,\n\t\t\t\t'is-url-title': displayTitle === displayURL,\n\t\t\t} ) }\n\t\t>\n\t\t\t<div className=\"block-editor-link-control__search-item-top\">\n\t\t\t\t<span className=\"block-editor-link-control__search-item-header\">\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'block-editor-link-control__search-item-icon',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'is-image': richData?.icon,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ icon }\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"block-editor-link-control__search-item-details\">\n\t\t\t\t\t\t{ ! isEmptyURL ? (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__search-item-title\"\n\t\t\t\t\t\t\t\t\thref={ value.url }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t{ displayTitle }\n\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t\t{ value?.url && displayTitle !== displayURL && (\n\t\t\t\t\t\t\t\t\t<span className=\"block-editor-link-control__search-item-info\">\n\t\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t\t{ displayURL }\n\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<span className=\"block-editor-link-control__search-item-error-notice\">\n\t\t\t\t\t\t\t\t{ __( 'Link is empty' ) }\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</span>\n\t\t\t\t</span>\n\t\t\t\t<Button\n\t\t\t\t\ticon={ edit }\n\t\t\t\t\tlabel={ __( 'Edit link' ) }\n\t\t\t\t\tonClick={ onEditClick }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t\t{ hasUnlinkControl && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\tlabel={ __( 'Remove link' ) }\n\t\t\t\t\t\tonClick={ onRemove }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<Button\n\t\t\t\t\ticon={ copySmall }\n\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t// Translators: %s is a placeholder for the link URL and an optional colon, (if a Link URL is present).\n\t\t\t\t\t\t__( 'Copy link%s' ), // Ends up looking like \"Copy link: https://example.com\".\n\t\t\t\t\t\tisEmptyURL || showIconLabels ? '' : ': ' + value.url\n\t\t\t\t\t) }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tdisabled={ isEmptyURL }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t/>\n\t\t\t\t<ViewerSlot fillProps={ value } />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SACCC,MAAM,EACNC,YAAY,EACZC,sBAAsB,IAAIC,QAAQ,QAC5B,uBAAuB;AAC9B,SAASC,kBAAkB,QAAQ,oBAAoB;AACvD,SAASC,mBAAmB,EAAEC,aAAa,QAAQ,gBAAgB;AACnE,SAASC,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAEC,OAAO,EAAEC,IAAI,EAAEC,SAAS,QAAQ,kBAAkB;AAC9E,SAASC,mBAAmB,IAAIC,SAAS,QAAQ,gBAAgB;AACjE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASC,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AAC;EAA6C,GAC5DR,aAAA,CAACzC,QAAQ;IAACoD,aAAa,EAAG;EAAG,GAC1BhB,UACO,CACL,CAEN,CAAC,GAEHK,aAAA;IAAMQ,SAAS,EAAC;EAAqD,GAClEtD,EAAE,CAAE,eAAgB,CACjB,CAEF,CACD,CAAC,EACP8C,aAAA,CAAC5C,MAAM;IACN2C,IAAI,EAAGhC,IAAM;IACb6C,KAAK,EAAG1D,EAAE,CAAE,WAAY,CAAG;IAC3B2D,OAAO,EAAGjC,WAAa;IACvBuB,IAAI,EAAC;EAAS,CACd,CAAC,EACArB,gBAAgB,IACjBkB,aAAA,CAAC5C,MAAM;IACN2C,IAAI,EAAGjC,OAAS;IAChB8C,KAAK,EAAG1D,EAAE,CAAE,aAAc,CAAG;IAC7B2D,OAAO,EAAG9B,QAAU;IACpBoB,IAAI,EAAC;EAAS,CACd,CACD,EACDH,aAAA,CAAC5C,MAAM;IACN2C,IAAI,EAAG/B,SAAW;IAClB4C,KAAK,EAAGzD,OAAO;IACd;IACAD,EAAE,CAAE,aAAc,CAAC;IAAE;IACrB0C,UAAU,IAAIZ,cAAc,GAAG,EAAE,GAAG,IAAI,GAAGL,KAAK,CAACS,GAClD,CAAG;IACHiB,GAAG,EAAGA,GAAK;IACXS,QAAQ,EAAGlB,UAAY;IACvBO,IAAI,EAAC;EAAS,CACd,CAAC,EACFH,aAAA,CAACxB,UAAU;IAACuC,SAAS,EAAGpC;EAAO,CAAE,CAC7B,CACD,CAAC;AAER"}
@@ -1 +1 @@
1
- {"version":3,"names":["useInstanceId","forwardRef","useState","__","URLInput","LinkControlSearchResults","CREATE_TYPE","useSearchHandler","noopSearchHandler","Promise","resolve","noop","LinkControlSearchInput","value","children","currentLink","className","placeholder","withCreateSuggestion","onCreateSuggestion","onChange","onSelect","showSuggestions","renderSuggestions","props","createElement","fetchSuggestions","allowDirectEntry","showInitialSuggestions","suggestionsQuery","withURLSuggestion","createSuggestionButtonText","hideLabelFromVision","ref","genericSearchHandler","searchHandler","instanceId","focusedSuggestion","setFocusedSuggestion","onInputChange","selection","suggestion","handleRenderSuggestions","handleSuggestionClick","onSuggestionSelected","selectedSuggestion","type","title","url","e","Object","keys","length","id","restLinkProps","disableSuggestions","__nextHasNoMarginBottom","label","__experimentalRenderSuggestions","__experimentalFetchLinkSuggestions","__experimentalHandleURLSuggestions","__experimentalShowInitialSuggestions","onSubmit","event","hasSuggestion","trim","preventDefault"],"sources":["@wordpress/block-editor/src/components/link-control/search-input.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { URLInput } from '../';\nimport LinkControlSearchResults from './search-results';\nimport { CREATE_TYPE } from './constants';\nimport useSearchHandler from './use-search-handler';\n\n// Must be a function as otherwise URLInput will default\n// to the fetchLinkSuggestions passed in block editor settings\n// which will cause an unintended http request.\nconst noopSearchHandler = () => Promise.resolve( [] );\n\nconst noop = () => {};\n\nconst LinkControlSearchInput = forwardRef(\n\t(\n\t\t{\n\t\t\tvalue,\n\t\t\tchildren,\n\t\t\tcurrentLink = {},\n\t\t\tclassName = null,\n\t\t\tplaceholder = null,\n\t\t\twithCreateSuggestion = false,\n\t\t\tonCreateSuggestion = noop,\n\t\t\tonChange = noop,\n\t\t\tonSelect = noop,\n\t\t\tshowSuggestions = true,\n\t\t\trenderSuggestions = ( props ) => (\n\t\t\t\t<LinkControlSearchResults { ...props } />\n\t\t\t),\n\t\t\tfetchSuggestions = null,\n\t\t\tallowDirectEntry = true,\n\t\t\tshowInitialSuggestions = false,\n\t\t\tsuggestionsQuery = {},\n\t\t\twithURLSuggestion = true,\n\t\t\tcreateSuggestionButtonText,\n\t\t\thideLabelFromVision = false,\n\t\t},\n\t\tref\n\t) => {\n\t\tconst genericSearchHandler = useSearchHandler(\n\t\t\tsuggestionsQuery,\n\t\t\tallowDirectEntry,\n\t\t\twithCreateSuggestion,\n\t\t\twithURLSuggestion\n\t\t);\n\n\t\tconst searchHandler = showSuggestions\n\t\t\t? fetchSuggestions || genericSearchHandler\n\t\t\t: noopSearchHandler;\n\n\t\tconst instanceId = useInstanceId( LinkControlSearchInput );\n\t\tconst [ focusedSuggestion, setFocusedSuggestion ] = useState();\n\n\t\t/**\n\t\t * Handles the user moving between different suggestions. Does not handle\n\t\t * choosing an individual item.\n\t\t *\n\t\t * @param {string} selection the url of the selected suggestion.\n\t\t * @param {Object} suggestion the suggestion object.\n\t\t */\n\t\tconst onInputChange = ( selection, suggestion ) => {\n\t\t\tonChange( selection );\n\t\t\tsetFocusedSuggestion( suggestion );\n\t\t};\n\n\t\tconst handleRenderSuggestions = ( props ) =>\n\t\t\trenderSuggestions( {\n\t\t\t\t...props,\n\t\t\t\tinstanceId,\n\t\t\t\twithCreateSuggestion,\n\t\t\t\tcreateSuggestionButtonText,\n\t\t\t\tsuggestionsQuery,\n\t\t\t\thandleSuggestionClick: ( suggestion ) => {\n\t\t\t\t\tif ( props.handleSuggestionClick ) {\n\t\t\t\t\t\tprops.handleSuggestionClick( suggestion );\n\t\t\t\t\t}\n\t\t\t\t\tonSuggestionSelected( suggestion );\n\t\t\t\t},\n\t\t\t} );\n\n\t\tconst onSuggestionSelected = async ( selectedSuggestion ) => {\n\t\t\tlet suggestion = selectedSuggestion;\n\t\t\tif ( CREATE_TYPE === selectedSuggestion.type ) {\n\t\t\t\t// Create a new page and call onSelect with the output from the onCreateSuggestion callback.\n\t\t\t\ttry {\n\t\t\t\t\tsuggestion = await onCreateSuggestion(\n\t\t\t\t\t\tselectedSuggestion.title\n\t\t\t\t\t);\n\t\t\t\t\tif ( suggestion?.url ) {\n\t\t\t\t\t\tonSelect( suggestion );\n\t\t\t\t\t}\n\t\t\t\t} catch ( e ) {}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tallowDirectEntry ||\n\t\t\t\t( suggestion && Object.keys( suggestion ).length >= 1 )\n\t\t\t) {\n\t\t\t\tconst { id, url, ...restLinkProps } = currentLink ?? {};\n\t\t\t\tonSelect(\n\t\t\t\t\t// Some direct entries don't have types or IDs, and we still need to clear the previous ones.\n\t\t\t\t\t{ ...restLinkProps, ...suggestion },\n\t\t\t\t\tsuggestion\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<div className=\"block-editor-link-control__search-input-container\">\n\t\t\t\t<URLInput\n\t\t\t\t\tdisableSuggestions={ currentLink?.url === value }\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ onInputChange }\n\t\t\t\t\tplaceholder={ placeholder ?? __( 'Search or type url' ) }\n\t\t\t\t\t__experimentalRenderSuggestions={\n\t\t\t\t\t\tshowSuggestions ? handleRenderSuggestions : null\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalFetchLinkSuggestions={ searchHandler }\n\t\t\t\t\t__experimentalHandleURLSuggestions={ true }\n\t\t\t\t\t__experimentalShowInitialSuggestions={\n\t\t\t\t\t\tshowInitialSuggestions\n\t\t\t\t\t}\n\t\t\t\t\tonSubmit={ ( suggestion, event ) => {\n\t\t\t\t\t\tconst hasSuggestion = suggestion || focusedSuggestion;\n\n\t\t\t\t\t\t// If there is no suggestion and the value (ie: any manually entered URL) is empty\n\t\t\t\t\t\t// then don't allow submission otherwise we get empty links.\n\t\t\t\t\t\tif ( ! hasSuggestion && ! value?.trim()?.length ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tonSuggestionSelected(\n\t\t\t\t\t\t\t\thasSuggestion || { url: value }\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tref={ ref }\n\t\t\t\t/>\n\t\t\t\t{ children }\n\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XA,WAAW,cAAXA,WAAW,GAAI,CAAC,CAAC;MACvDM,QAAQ;MACP;MACA;QAAE,GAAGiC,aAAa;QAAE,GAAGb;MAAW,CAAC,EACnCA,UACD,CAAC;IACF;EACD,CAAC;EAED,OACChB,aAAA;IAAKT,SAAS,EAAC;EAAmD,GACjES,aAAA,CAACrB,QAAQ;IACRmD,kBAAkB,EAAGxC,WAAW,EAAEiC,GAAG,KAAKnC,KAAO;IACjD2C,uBAAuB;IACvBC,KAAK,EAAGtD,EAAE,CAAE,MAAO,CAAG;IACtB6B,mBAAmB,EAAGA,mBAAqB;IAC3ChB,SAAS,EAAGA,SAAW;IACvBH,KAAK,EAAGA,KAAO;IACfO,QAAQ,EAAGmB,aAAe;IAC1BtB,WAAW,EAAGA,WAAW,aAAXA,WAAW,cAAXA,WAAW,GAAId,EAAE,CAAE,oBAAqB,CAAG;IACzDuD,+BAA+B,EAC9BpC,eAAe,GAAGoB,uBAAuB,GAAG,IAC5C;IACDiB,kCAAkC,EAAGxB,aAAe;IACpDyB,kCAAkC,EAAG,IAAM;IAC3CC,oCAAoC,EACnCjC,sBACA;IACDkC,QAAQ,EAAGA,CAAErB,UAAU,EAAEsB,KAAK,KAAM;MACnC,MAAMC,aAAa,GAAGvB,UAAU,IAAIJ,iBAAiB;;MAErD;MACA;MACA,IAAK,CAAE2B,aAAa,IAAI,CAAEnD,KAAK,EAAEoD,IAAI,CAAC,CAAC,EAAEb,MAAM,EAAG;QACjDW,KAAK,CAACG,cAAc,CAAC,CAAC;MACvB,CAAC,MAAM;QACNtB,oBAAoB,CACnBoB,aAAa,IAAI;UAAEhB,GAAG,EAAEnC;QAAM,CAC/B,CAAC;MACF;IACD,CAAG;IACHoB,GAAG,EAAGA;EAAK,CACX,CAAC,EACAnB,QACE,CAAC;AAER,CACD,CAAC;AAED,eAAeF,sBAAsB"}
1
+ {"version":3,"names":["useInstanceId","forwardRef","useState","__","URLInput","LinkControlSearchResults","CREATE_TYPE","useSearchHandler","noopSearchHandler","Promise","resolve","noop","LinkControlSearchInput","value","children","currentLink","className","placeholder","withCreateSuggestion","onCreateSuggestion","onChange","onSelect","showSuggestions","renderSuggestions","props","createElement","fetchSuggestions","allowDirectEntry","showInitialSuggestions","suggestionsQuery","withURLSuggestion","createSuggestionButtonText","hideLabelFromVision","ref","genericSearchHandler","searchHandler","instanceId","focusedSuggestion","setFocusedSuggestion","onInputChange","selection","suggestion","handleRenderSuggestions","handleSuggestionClick","onSuggestionSelected","selectedSuggestion","type","title","url","e","Object","keys","length","id","restLinkProps","disableSuggestions","__nextHasNoMarginBottom","label","__experimentalRenderSuggestions","__experimentalFetchLinkSuggestions","__experimentalHandleURLSuggestions","__experimentalShowInitialSuggestions","onSubmit","event","hasSuggestion","trim","preventDefault"],"sources":["@wordpress/block-editor/src/components/link-control/search-input.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { URLInput } from '../';\nimport LinkControlSearchResults from './search-results';\nimport { CREATE_TYPE } from './constants';\nimport useSearchHandler from './use-search-handler';\n\n// Must be a function as otherwise URLInput will default\n// to the fetchLinkSuggestions passed in block editor settings\n// which will cause an unintended http request.\nconst noopSearchHandler = () => Promise.resolve( [] );\n\nconst noop = () => {};\n\nconst LinkControlSearchInput = forwardRef(\n\t(\n\t\t{\n\t\t\tvalue,\n\t\t\tchildren,\n\t\t\tcurrentLink = {},\n\t\t\tclassName = null,\n\t\t\tplaceholder = null,\n\t\t\twithCreateSuggestion = false,\n\t\t\tonCreateSuggestion = noop,\n\t\t\tonChange = noop,\n\t\t\tonSelect = noop,\n\t\t\tshowSuggestions = true,\n\t\t\trenderSuggestions = ( props ) => (\n\t\t\t\t<LinkControlSearchResults { ...props } />\n\t\t\t),\n\t\t\tfetchSuggestions = null,\n\t\t\tallowDirectEntry = true,\n\t\t\tshowInitialSuggestions = false,\n\t\t\tsuggestionsQuery = {},\n\t\t\twithURLSuggestion = true,\n\t\t\tcreateSuggestionButtonText,\n\t\t\thideLabelFromVision = false,\n\t\t},\n\t\tref\n\t) => {\n\t\tconst genericSearchHandler = useSearchHandler(\n\t\t\tsuggestionsQuery,\n\t\t\tallowDirectEntry,\n\t\t\twithCreateSuggestion,\n\t\t\twithURLSuggestion\n\t\t);\n\n\t\tconst searchHandler = showSuggestions\n\t\t\t? fetchSuggestions || genericSearchHandler\n\t\t\t: noopSearchHandler;\n\n\t\tconst instanceId = useInstanceId( LinkControlSearchInput );\n\t\tconst [ focusedSuggestion, setFocusedSuggestion ] = useState();\n\n\t\t/**\n\t\t * Handles the user moving between different suggestions. Does not handle\n\t\t * choosing an individual item.\n\t\t *\n\t\t * @param {string} selection the url of the selected suggestion.\n\t\t * @param {Object} suggestion the suggestion object.\n\t\t */\n\t\tconst onInputChange = ( selection, suggestion ) => {\n\t\t\tonChange( selection );\n\t\t\tsetFocusedSuggestion( suggestion );\n\t\t};\n\n\t\tconst handleRenderSuggestions = ( props ) =>\n\t\t\trenderSuggestions( {\n\t\t\t\t...props,\n\t\t\t\tinstanceId,\n\t\t\t\twithCreateSuggestion,\n\t\t\t\tcreateSuggestionButtonText,\n\t\t\t\tsuggestionsQuery,\n\t\t\t\thandleSuggestionClick: ( suggestion ) => {\n\t\t\t\t\tif ( props.handleSuggestionClick ) {\n\t\t\t\t\t\tprops.handleSuggestionClick( suggestion );\n\t\t\t\t\t}\n\t\t\t\t\tonSuggestionSelected( suggestion );\n\t\t\t\t},\n\t\t\t} );\n\n\t\tconst onSuggestionSelected = async ( selectedSuggestion ) => {\n\t\t\tlet suggestion = selectedSuggestion;\n\t\t\tif ( CREATE_TYPE === selectedSuggestion.type ) {\n\t\t\t\t// Create a new page and call onSelect with the output from the onCreateSuggestion callback.\n\t\t\t\ttry {\n\t\t\t\t\tsuggestion = await onCreateSuggestion(\n\t\t\t\t\t\tselectedSuggestion.title\n\t\t\t\t\t);\n\t\t\t\t\tif ( suggestion?.url ) {\n\t\t\t\t\t\tonSelect( suggestion );\n\t\t\t\t\t}\n\t\t\t\t} catch ( e ) {}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tallowDirectEntry ||\n\t\t\t\t( suggestion && Object.keys( suggestion ).length >= 1 )\n\t\t\t) {\n\t\t\t\tconst { id, url, ...restLinkProps } = currentLink ?? {};\n\t\t\t\tonSelect(\n\t\t\t\t\t// Some direct entries don't have types or IDs, and we still need to clear the previous ones.\n\t\t\t\t\t{ ...restLinkProps, ...suggestion },\n\t\t\t\t\tsuggestion\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<div className=\"block-editor-link-control__search-input-container\">\n\t\t\t\t<URLInput\n\t\t\t\t\tdisableSuggestions={ currentLink?.url === value }\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ onInputChange }\n\t\t\t\t\tplaceholder={ placeholder ?? __( 'Search or type url' ) }\n\t\t\t\t\t__experimentalRenderSuggestions={\n\t\t\t\t\t\tshowSuggestions ? handleRenderSuggestions : null\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalFetchLinkSuggestions={ searchHandler }\n\t\t\t\t\t__experimentalHandleURLSuggestions\n\t\t\t\t\t__experimentalShowInitialSuggestions={\n\t\t\t\t\t\tshowInitialSuggestions\n\t\t\t\t\t}\n\t\t\t\t\tonSubmit={ ( suggestion, event ) => {\n\t\t\t\t\t\tconst hasSuggestion = suggestion || focusedSuggestion;\n\n\t\t\t\t\t\t// If there is no suggestion and the value (ie: any manually entered URL) is empty\n\t\t\t\t\t\t// then don't allow submission otherwise we get empty links.\n\t\t\t\t\t\tif ( ! hasSuggestion && ! value?.trim()?.length ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tonSuggestionSelected(\n\t\t\t\t\t\t\t\thasSuggestion || { url: value }\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tref={ ref }\n\t\t\t\t/>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nexport default LinkControlSearchInput;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,oBAAoB;AAClD,SAASC,UAAU,EAAEC,QAAQ,QAAQ,oBAAoB;AACzD,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,SAASC,QAAQ,QAAQ,KAAK;AAC9B,OAAOC,wBAAwB,MAAM,kBAAkB;AACvD,SAASC,WAAW,QAAQ,aAAa;AACzC,OAAOC,gBAAgB,MAAM,sBAAsB;;AAEnD;AACA;AACA;AACA,MAAMC,iBAAiB,GAAGA,CAAA,KAAMC,OAAO,CAACC,OAAO,CAAE,EAAG,CAAC;AAErD,MAAMC,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,MAAMC,sBAAsB,GAAGX,UAAU,CACxC,CACC;EACCY,KAAK;EACLC,QAAQ;EACRC,WAAW,GAAG,CAAC,CAAC;EAChBC,SAAS,GAAG,IAAI;EAChBC,WAAW,GAAG,IAAI;EAClBC,oBAAoB,GAAG,KAAK;EAC5BC,kBAAkB,GAAGR,IAAI;EACzBS,QAAQ,GAAGT,IAAI;EACfU,QAAQ,GAAGV,IAAI;EACfW,eAAe,GAAG,IAAI;EACtBC,iBAAiB,GAAKC,KAAK,IAC1BC,aAAA,CAACpB,wBAAwB;IAAA,GAAMmB;EAAK,CAAI,CACxC;EACDE,gBAAgB,GAAG,IAAI;EACvBC,gBAAgB,GAAG,IAAI;EACvBC,sBAAsB,GAAG,KAAK;EAC9BC,gBAAgB,GAAG,CAAC,CAAC;EACrBC,iBAAiB,GAAG,IAAI;EACxBC,0BAA0B;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,CAAG;IACHoB,GAAG,EAAGA;EAAK,CACX,CAAC,EACAnB,QACE,CAAC;AAER,CACD,CAAC;AAED,eAAeF,sBAAsB"}
@@ -43,7 +43,6 @@ function ListViewBlockSelectButton({
43
43
  onDragEnd,
44
44
  draggable,
45
45
  isExpanded,
46
- ariaLabel,
47
46
  ariaDescribedBy,
48
47
  updateFocusAndSelection
49
48
  }, ref) {
@@ -208,7 +207,6 @@ function ListViewBlockSelectButton({
208
207
  onDragEnd: onDragEnd,
209
208
  draggable: draggable,
210
209
  href: `#block-${clientId}`,
211
- "aria-label": ariaLabel,
212
210
  "aria-describedby": ariaDescribedBy,
213
211
  "aria-expanded": isExpanded
214
212
  }, createElement(ListViewExpander, {
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","hasBlockSupport","Button","__experimentalHStack","HStack","__experimentalTruncate","Truncate","Tooltip","forwardRef","Icon","lockSmall","lock","pinSmall","SPACE","ENTER","BACKSPACE","DELETE","useSelect","useDispatch","__unstableUseShortcutEventMatch","useShortcutEventMatch","__","sprintf","isShallowEqual","BlockIcon","useBlockDisplayInformation","useBlockDisplayTitle","ListViewExpander","useBlockLock","store","blockEditorStore","useListViewImages","useListViewContext","ListViewBlockSelectButton","className","block","clientId","onClick","onContextMenu","onMouseDown","onToggleExpanded","tabIndex","onFocus","onDragStart","onDragEnd","draggable","isExpanded","ariaLabel","ariaDescribedBy","updateFocusAndSelection","ref","blockInformation","blockTitle","context","isLocked","canInsertBlockType","getSelectedBlockClientIds","getPreviousBlockClientId","getBlockRootClientId","getBlockOrder","getBlocksByClientId","canRemoveBlocks","duplicateBlocks","multiSelect","removeBlocks","isMatch","isSticky","positionType","images","rootClientId","positionLabel","onDragStartHandler","event","dataTransfer","clearData","getBlocksToUpdate","selectedBlockClientIds","isUpdatingSelectedBlocks","includes","firstBlockClientId","firstBlockRootClientId","blocksToUpdate","onKeyDownHandler","keyCode","_getPreviousBlockClie","blocksToDelete","blockToFocus","shouldUpdateSelection","length","defaultPrevented","preventDefault","canDuplicate","every","name","updatedBlocks","blockClientIds","createElement","Fragment","onKeyDown","href","icon","showColors","alignment","justify","spacing","ellipsizeMode","anchor","text","map","image","index","key","style","backgroundImage","url","zIndex"],"sources":["@wordpress/block-editor/src/components/list-view/block-select-button.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tTooltip,\n} from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\nimport { Icon, lockSmall as lock, pinSmall } from '@wordpress/icons';\nimport { SPACE, ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';\nimport { __, sprintf } from '@wordpress/i18n';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\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';\nimport { useBlockLock } from '../block-lock';\nimport { store as blockEditorStore } from '../../store';\nimport useListViewImages from './use-list-view-images';\nimport { useListViewContext } from './context';\n\nfunction ListViewBlockSelectButton(\n\t{\n\t\tclassName,\n\t\tblock: { clientId },\n\t\tonClick,\n\t\tonContextMenu,\n\t\tonMouseDown,\n\t\tonToggleExpanded,\n\t\ttabIndex,\n\t\tonFocus,\n\t\tonDragStart,\n\t\tonDragEnd,\n\t\tdraggable,\n\t\tisExpanded,\n\t\tariaLabel,\n\t\tariaDescribedBy,\n\t\tupdateFocusAndSelection,\n\t},\n\tref\n) {\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId,\n\t\tcontext: 'list-view',\n\t} );\n\tconst { isLocked } = useBlockLock( clientId );\n\tconst {\n\t\tcanInsertBlockType,\n\t\tgetSelectedBlockClientIds,\n\t\tgetPreviousBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlockOrder,\n\t\tgetBlocksByClientId,\n\t\tcanRemoveBlocks,\n\t} = useSelect( blockEditorStore );\n\tconst { duplicateBlocks, multiSelect, removeBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\tconst isMatch = useShortcutEventMatch();\n\tconst isSticky = blockInformation?.positionType === 'sticky';\n\tconst images = useListViewImages( { clientId, isExpanded } );\n\tconst { rootClientId } = useListViewContext();\n\n\tconst positionLabel = blockInformation?.positionLabel\n\t\t? sprintf(\n\t\t\t\t// translators: 1: Position of selected block, e.g. \"Sticky\" or \"Fixed\".\n\t\t\t\t__( 'Position: %1$s' ),\n\t\t\t\tblockInformation.positionLabel\n\t\t )\n\t\t: '';\n\n\t// The `href` attribute triggers the browser's native HTML drag operations.\n\t// When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.\n\t// We need to clear any HTML drag data to prevent `pasteHandler` from firing\n\t// inside the `useOnBlockDrop` hook.\n\tconst onDragStartHandler = ( event ) => {\n\t\tevent.dataTransfer.clearData();\n\t\tonDragStart?.( event );\n\t};\n\n\t// Determine which blocks to update:\n\t// If the current (focused) block is part of the block selection, use the whole selection.\n\t// If the focused block is not part of the block selection, only update the focused block.\n\tfunction getBlocksToUpdate() {\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst isUpdatingSelectedBlocks =\n\t\t\tselectedBlockClientIds.includes( clientId );\n\t\tconst firstBlockClientId = isUpdatingSelectedBlocks\n\t\t\t? selectedBlockClientIds[ 0 ]\n\t\t\t: clientId;\n\t\tconst firstBlockRootClientId =\n\t\t\tgetBlockRootClientId( firstBlockClientId );\n\n\t\tconst blocksToUpdate = isUpdatingSelectedBlocks\n\t\t\t? selectedBlockClientIds\n\t\t\t: [ clientId ];\n\n\t\treturn {\n\t\t\tblocksToUpdate,\n\t\t\tfirstBlockClientId,\n\t\t\tfirstBlockRootClientId,\n\t\t\tselectedBlockClientIds,\n\t\t};\n\t}\n\n\t/**\n\t * @param {KeyboardEvent} event\n\t */\n\tasync function onKeyDownHandler( event ) {\n\t\tif ( event.keyCode === ENTER || event.keyCode === SPACE ) {\n\t\t\tonClick( event );\n\t\t} else if (\n\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\tevent.keyCode === DELETE ||\n\t\t\tisMatch( 'core/block-editor/remove', event )\n\t\t) {\n\t\t\tconst {\n\t\t\t\tblocksToUpdate: blocksToDelete,\n\t\t\t\tfirstBlockClientId,\n\t\t\t\tfirstBlockRootClientId,\n\t\t\t\tselectedBlockClientIds,\n\t\t\t} = getBlocksToUpdate();\n\n\t\t\t// Don't update the selection if the blocks cannot be deleted.\n\t\t\tif ( ! canRemoveBlocks( blocksToDelete, firstBlockRootClientId ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet blockToFocus =\n\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ) ??\n\t\t\t\t// If the previous block is not found (when the first block is deleted),\n\t\t\t\t// fallback to focus the parent block.\n\t\t\t\tfirstBlockRootClientId;\n\n\t\t\tremoveBlocks( blocksToDelete, false );\n\n\t\t\t// Update the selection if the original selection has been removed.\n\t\t\tconst shouldUpdateSelection =\n\t\t\t\tselectedBlockClientIds.length > 0 &&\n\t\t\t\tgetSelectedBlockClientIds().length === 0;\n\n\t\t\t// If there's no previous block nor parent block, focus the first block.\n\t\t\tif ( ! blockToFocus ) {\n\t\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t\t}\n\n\t\t\tupdateFocusAndSelection( blockToFocus, shouldUpdateSelection );\n\t\t} else if ( isMatch( 'core/block-editor/duplicate', event ) ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { blocksToUpdate, firstBlockRootClientId } =\n\t\t\t\tgetBlocksToUpdate();\n\n\t\t\tconst canDuplicate = getBlocksByClientId( blocksToUpdate ).every(\n\t\t\t\t( block ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t!! block &&\n\t\t\t\t\t\thasBlockSupport( block.name, 'multiple', true ) &&\n\t\t\t\t\t\tcanInsertBlockType( block.name, firstBlockRootClientId )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( canDuplicate ) {\n\t\t\t\tconst updatedBlocks = await duplicateBlocks(\n\t\t\t\t\tblocksToUpdate,\n\t\t\t\t\tfalse\n\t\t\t\t);\n\n\t\t\t\tif ( updatedBlocks?.length ) {\n\t\t\t\t\t// If blocks have been duplicated, focus the first duplicated block.\n\t\t\t\t\tupdateFocusAndSelection( updatedBlocks[ 0 ], false );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/select-all', event ) ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { firstBlockRootClientId, selectedBlockClientIds } =\n\t\t\t\tgetBlocksToUpdate();\n\t\t\tconst blockClientIds = getBlockOrder( firstBlockRootClientId );\n\t\t\tif ( ! blockClientIds.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If we have selected all sibling nested blocks, try selecting up a level.\n\t\t\t// This is a similar implementation to that used by `useSelectAll`.\n\t\t\t// `isShallowEqual` is used for the list view instead of a length check,\n\t\t\t// as the array of siblings of the currently focused block may be a different\n\t\t\t// set of blocks from the current block selection if the user is focused\n\t\t\t// on a different part of the list view from the block selection.\n\t\t\tif ( isShallowEqual( selectedBlockClientIds, blockClientIds ) ) {\n\t\t\t\t// Only select up a level if the first block is not the root block.\n\t\t\t\t// This ensures that the block selection can't break out of the root block\n\t\t\t\t// used by the list view, if the list view is only showing a partial hierarchy.\n\t\t\t\tif (\n\t\t\t\t\tfirstBlockRootClientId &&\n\t\t\t\t\tfirstBlockRootClientId !== rootClientId\n\t\t\t\t) {\n\t\t\t\t\tupdateFocusAndSelection( firstBlockRootClientId, true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Select all while passing `null` to skip focusing to the editor canvas,\n\t\t\t// and retain focus within the list view.\n\t\t\tmultiSelect(\n\t\t\t\tblockClientIds[ 0 ],\n\t\t\t\tblockClientIds[ blockClientIds.length - 1 ],\n\t\t\t\tnull\n\t\t\t);\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tonContextMenu={ onContextMenu }\n\t\t\t\tonKeyDown={ onKeyDownHandler }\n\t\t\t\tonMouseDown={ onMouseDown }\n\t\t\t\tref={ ref }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tonDragStart={ onDragStartHandler }\n\t\t\t\tonDragEnd={ onDragEnd }\n\t\t\t\tdraggable={ draggable }\n\t\t\t\thref={ `#block-${ clientId }` }\n\t\t\t\taria-label={ ariaLabel }\n\t\t\t\taria-describedby={ ariaDescribedBy }\n\t\t\t\taria-expanded={ isExpanded }\n\t\t\t>\n\t\t\t\t<ListViewExpander onClick={ onToggleExpanded } />\n\t\t\t\t<BlockIcon\n\t\t\t\t\ticon={ blockInformation?.icon }\n\t\t\t\t\tshowColors\n\t\t\t\t\tcontext=\"list-view\"\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\talignment=\"center\"\n\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">{ blockTitle }</Truncate>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ blockInformation?.anchor && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__anchor-wrapper\">\n\t\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__anchor\"\n\t\t\t\t\t\t\t\tellipsizeMode=\"auto\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ blockInformation.anchor }\n\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ positionLabel && isSticky && (\n\t\t\t\t\t\t<Tooltip text={ positionLabel }>\n\t\t\t\t\t\t\t<Icon icon={ pinSmall } />\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) }\n\t\t\t\t\t{ images.length ? (\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__images\"\n\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ images.map( ( image, index ) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__image\"\n\t\t\t\t\t\t\t\t\tkey={ image.clientId }\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\tbackgroundImage: `url(${ image.url })`,\n\t\t\t\t\t\t\t\t\t\tzIndex: images.length - index, // Ensure the first image is on top, and subsequent images are behind.\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : null }\n\t\t\t\t\t{ isLocked && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__lock\">\n\t\t\t\t\t\t\t<Icon icon={ lock } />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t</Button>\n\t\t</>\n\t);\n}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,IACzBV,aAAA;IAAM9D,SAAS,EAAC;EAA4D,GAC3E8D,aAAA,CAAC1F,QAAQ;IACR4B,SAAS,EAAC,oDAAoD;IAC9DuE,aAAa,EAAC;EAAM,GAElBtD,gBAAgB,CAACuD,MACV,CACL,CACN,EACCpC,aAAa,IAAIJ,QAAQ,IAC1B8B,aAAA,CAACzF,OAAO;IAACoG,IAAI,EAAGrC;EAAe,GAC9B0B,aAAA,CAACvF,IAAI;IAAC2F,IAAI,EAAGxF;EAAU,CAAE,CACjB,CACT,EACCwD,MAAM,CAACoB,MAAM,GACdQ,aAAA;IACC9D,SAAS,EAAC,oDAAoD;IAC9D;EAAW,GAETkC,MAAM,CAACwC,GAAG,CAAE,CAAEC,KAAK,EAAEC,KAAK,KAC3Bd,aAAA;IACC9D,SAAS,EAAC,mDAAmD;IAC7D6E,GAAG,EAAGF,KAAK,CAACzE,QAAU;IACtB4E,KAAK,EAAG;MACPC,eAAe,EAAG,OAAOJ,KAAK,CAACK,GAAK,GAAE;MACtCC,MAAM,EAAE/C,MAAM,CAACoB,MAAM,GAAGsB,KAAK,CAAE;IAChC;EAAG,CACH,CACA,CACG,CAAC,GACJ,IAAI,EACNxD,QAAQ,IACT0C,aAAA;IAAM9D,SAAS,EAAC;EAAkD,GACjE8D,aAAA,CAACvF,IAAI;IAAC2F,IAAI,EAAGzF;EAAM,CAAE,CAChB,CAEA,CACD,CACP,CAAC;AAEL;AAEA,eAAeH,UAAU,CAAEyB,yBAA0B,CAAC"}
1
+ {"version":3,"names":["classnames","hasBlockSupport","Button","__experimentalHStack","HStack","__experimentalTruncate","Truncate","Tooltip","forwardRef","Icon","lockSmall","lock","pinSmall","SPACE","ENTER","BACKSPACE","DELETE","useSelect","useDispatch","__unstableUseShortcutEventMatch","useShortcutEventMatch","__","sprintf","isShallowEqual","BlockIcon","useBlockDisplayInformation","useBlockDisplayTitle","ListViewExpander","useBlockLock","store","blockEditorStore","useListViewImages","useListViewContext","ListViewBlockSelectButton","className","block","clientId","onClick","onContextMenu","onMouseDown","onToggleExpanded","tabIndex","onFocus","onDragStart","onDragEnd","draggable","isExpanded","ariaDescribedBy","updateFocusAndSelection","ref","blockInformation","blockTitle","context","isLocked","canInsertBlockType","getSelectedBlockClientIds","getPreviousBlockClientId","getBlockRootClientId","getBlockOrder","getBlocksByClientId","canRemoveBlocks","duplicateBlocks","multiSelect","removeBlocks","isMatch","isSticky","positionType","images","rootClientId","positionLabel","onDragStartHandler","event","dataTransfer","clearData","getBlocksToUpdate","selectedBlockClientIds","isUpdatingSelectedBlocks","includes","firstBlockClientId","firstBlockRootClientId","blocksToUpdate","onKeyDownHandler","keyCode","_getPreviousBlockClie","blocksToDelete","blockToFocus","shouldUpdateSelection","length","defaultPrevented","preventDefault","canDuplicate","every","name","updatedBlocks","blockClientIds","createElement","Fragment","onKeyDown","href","icon","showColors","alignment","justify","spacing","ellipsizeMode","anchor","text","map","image","index","key","style","backgroundImage","url","zIndex"],"sources":["@wordpress/block-editor/src/components/list-view/block-select-button.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tTooltip,\n} from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\nimport { Icon, lockSmall as lock, pinSmall } from '@wordpress/icons';\nimport { SPACE, ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';\nimport { __, sprintf } from '@wordpress/i18n';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\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';\nimport { useBlockLock } from '../block-lock';\nimport { store as blockEditorStore } from '../../store';\nimport useListViewImages from './use-list-view-images';\nimport { useListViewContext } from './context';\n\nfunction ListViewBlockSelectButton(\n\t{\n\t\tclassName,\n\t\tblock: { clientId },\n\t\tonClick,\n\t\tonContextMenu,\n\t\tonMouseDown,\n\t\tonToggleExpanded,\n\t\ttabIndex,\n\t\tonFocus,\n\t\tonDragStart,\n\t\tonDragEnd,\n\t\tdraggable,\n\t\tisExpanded,\n\t\tariaDescribedBy,\n\t\tupdateFocusAndSelection,\n\t},\n\tref\n) {\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId,\n\t\tcontext: 'list-view',\n\t} );\n\tconst { isLocked } = useBlockLock( clientId );\n\tconst {\n\t\tcanInsertBlockType,\n\t\tgetSelectedBlockClientIds,\n\t\tgetPreviousBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlockOrder,\n\t\tgetBlocksByClientId,\n\t\tcanRemoveBlocks,\n\t} = useSelect( blockEditorStore );\n\tconst { duplicateBlocks, multiSelect, removeBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\tconst isMatch = useShortcutEventMatch();\n\tconst isSticky = blockInformation?.positionType === 'sticky';\n\tconst images = useListViewImages( { clientId, isExpanded } );\n\tconst { rootClientId } = useListViewContext();\n\n\tconst positionLabel = blockInformation?.positionLabel\n\t\t? sprintf(\n\t\t\t\t// translators: 1: Position of selected block, e.g. \"Sticky\" or \"Fixed\".\n\t\t\t\t__( 'Position: %1$s' ),\n\t\t\t\tblockInformation.positionLabel\n\t\t )\n\t\t: '';\n\n\t// The `href` attribute triggers the browser's native HTML drag operations.\n\t// When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.\n\t// We need to clear any HTML drag data to prevent `pasteHandler` from firing\n\t// inside the `useOnBlockDrop` hook.\n\tconst onDragStartHandler = ( event ) => {\n\t\tevent.dataTransfer.clearData();\n\t\tonDragStart?.( event );\n\t};\n\n\t// Determine which blocks to update:\n\t// If the current (focused) block is part of the block selection, use the whole selection.\n\t// If the focused block is not part of the block selection, only update the focused block.\n\tfunction getBlocksToUpdate() {\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst isUpdatingSelectedBlocks =\n\t\t\tselectedBlockClientIds.includes( clientId );\n\t\tconst firstBlockClientId = isUpdatingSelectedBlocks\n\t\t\t? selectedBlockClientIds[ 0 ]\n\t\t\t: clientId;\n\t\tconst firstBlockRootClientId =\n\t\t\tgetBlockRootClientId( firstBlockClientId );\n\n\t\tconst blocksToUpdate = isUpdatingSelectedBlocks\n\t\t\t? selectedBlockClientIds\n\t\t\t: [ clientId ];\n\n\t\treturn {\n\t\t\tblocksToUpdate,\n\t\t\tfirstBlockClientId,\n\t\t\tfirstBlockRootClientId,\n\t\t\tselectedBlockClientIds,\n\t\t};\n\t}\n\n\t/**\n\t * @param {KeyboardEvent} event\n\t */\n\tasync function onKeyDownHandler( event ) {\n\t\tif ( event.keyCode === ENTER || event.keyCode === SPACE ) {\n\t\t\tonClick( event );\n\t\t} else if (\n\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\tevent.keyCode === DELETE ||\n\t\t\tisMatch( 'core/block-editor/remove', event )\n\t\t) {\n\t\t\tconst {\n\t\t\t\tblocksToUpdate: blocksToDelete,\n\t\t\t\tfirstBlockClientId,\n\t\t\t\tfirstBlockRootClientId,\n\t\t\t\tselectedBlockClientIds,\n\t\t\t} = getBlocksToUpdate();\n\n\t\t\t// Don't update the selection if the blocks cannot be deleted.\n\t\t\tif ( ! canRemoveBlocks( blocksToDelete, firstBlockRootClientId ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet blockToFocus =\n\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ) ??\n\t\t\t\t// If the previous block is not found (when the first block is deleted),\n\t\t\t\t// fallback to focus the parent block.\n\t\t\t\tfirstBlockRootClientId;\n\n\t\t\tremoveBlocks( blocksToDelete, false );\n\n\t\t\t// Update the selection if the original selection has been removed.\n\t\t\tconst shouldUpdateSelection =\n\t\t\t\tselectedBlockClientIds.length > 0 &&\n\t\t\t\tgetSelectedBlockClientIds().length === 0;\n\n\t\t\t// If there's no previous block nor parent block, focus the first block.\n\t\t\tif ( ! blockToFocus ) {\n\t\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t\t}\n\n\t\t\tupdateFocusAndSelection( blockToFocus, shouldUpdateSelection );\n\t\t} else if ( isMatch( 'core/block-editor/duplicate', event ) ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { blocksToUpdate, firstBlockRootClientId } =\n\t\t\t\tgetBlocksToUpdate();\n\n\t\t\tconst canDuplicate = getBlocksByClientId( blocksToUpdate ).every(\n\t\t\t\t( block ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t!! block &&\n\t\t\t\t\t\thasBlockSupport( block.name, 'multiple', true ) &&\n\t\t\t\t\t\tcanInsertBlockType( block.name, firstBlockRootClientId )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( canDuplicate ) {\n\t\t\t\tconst updatedBlocks = await duplicateBlocks(\n\t\t\t\t\tblocksToUpdate,\n\t\t\t\t\tfalse\n\t\t\t\t);\n\n\t\t\t\tif ( updatedBlocks?.length ) {\n\t\t\t\t\t// If blocks have been duplicated, focus the first duplicated block.\n\t\t\t\t\tupdateFocusAndSelection( updatedBlocks[ 0 ], false );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/select-all', event ) ) {\n\t\t\tif ( event.defaultPrevented ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { firstBlockRootClientId, selectedBlockClientIds } =\n\t\t\t\tgetBlocksToUpdate();\n\t\t\tconst blockClientIds = getBlockOrder( firstBlockRootClientId );\n\t\t\tif ( ! blockClientIds.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If we have selected all sibling nested blocks, try selecting up a level.\n\t\t\t// This is a similar implementation to that used by `useSelectAll`.\n\t\t\t// `isShallowEqual` is used for the list view instead of a length check,\n\t\t\t// as the array of siblings of the currently focused block may be a different\n\t\t\t// set of blocks from the current block selection if the user is focused\n\t\t\t// on a different part of the list view from the block selection.\n\t\t\tif ( isShallowEqual( selectedBlockClientIds, blockClientIds ) ) {\n\t\t\t\t// Only select up a level if the first block is not the root block.\n\t\t\t\t// This ensures that the block selection can't break out of the root block\n\t\t\t\t// used by the list view, if the list view is only showing a partial hierarchy.\n\t\t\t\tif (\n\t\t\t\t\tfirstBlockRootClientId &&\n\t\t\t\t\tfirstBlockRootClientId !== rootClientId\n\t\t\t\t) {\n\t\t\t\t\tupdateFocusAndSelection( firstBlockRootClientId, true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Select all while passing `null` to skip focusing to the editor canvas,\n\t\t\t// and retain focus within the list view.\n\t\t\tmultiSelect(\n\t\t\t\tblockClientIds[ 0 ],\n\t\t\t\tblockClientIds[ blockClientIds.length - 1 ],\n\t\t\t\tnull\n\t\t\t);\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tonContextMenu={ onContextMenu }\n\t\t\t\tonKeyDown={ onKeyDownHandler }\n\t\t\t\tonMouseDown={ onMouseDown }\n\t\t\t\tref={ ref }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tonDragStart={ onDragStartHandler }\n\t\t\t\tonDragEnd={ onDragEnd }\n\t\t\t\tdraggable={ draggable }\n\t\t\t\thref={ `#block-${ clientId }` }\n\t\t\t\taria-describedby={ ariaDescribedBy }\n\t\t\t\taria-expanded={ isExpanded }\n\t\t\t>\n\t\t\t\t<ListViewExpander onClick={ onToggleExpanded } />\n\t\t\t\t<BlockIcon\n\t\t\t\t\ticon={ blockInformation?.icon }\n\t\t\t\t\tshowColors\n\t\t\t\t\tcontext=\"list-view\"\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\talignment=\"center\"\n\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">{ blockTitle }</Truncate>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ blockInformation?.anchor && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__anchor-wrapper\">\n\t\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__anchor\"\n\t\t\t\t\t\t\t\tellipsizeMode=\"auto\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ blockInformation.anchor }\n\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ positionLabel && isSticky && (\n\t\t\t\t\t\t<Tooltip text={ positionLabel }>\n\t\t\t\t\t\t\t<Icon icon={ pinSmall } />\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) }\n\t\t\t\t\t{ images.length ? (\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__images\"\n\t\t\t\t\t\t\taria-hidden\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ images.map( ( image, index ) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__image\"\n\t\t\t\t\t\t\t\t\tkey={ image.clientId }\n\t\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\t\tbackgroundImage: `url(${ image.url })`,\n\t\t\t\t\t\t\t\t\t\tzIndex: images.length - index, // Ensure the first image is on top, and subsequent images are behind.\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) : null }\n\t\t\t\t\t{ isLocked && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__lock\">\n\t\t\t\t\t\t\t<Icon icon={ lock } />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport default forwardRef( ListViewBlockSelectButton );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SACCC,MAAM,EACNC,oBAAoB,IAAIC,MAAM,EAC9BC,sBAAsB,IAAIC,QAAQ,EAClCC,OAAO,QACD,uBAAuB;AAC9B,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,IAAI,EAAEC,SAAS,IAAIC,IAAI,EAAEC,QAAQ,QAAQ,kBAAkB;AACpE,SAASC,KAAK,EAAEC,KAAK,EAAEC,SAAS,EAAEC,MAAM,QAAQ,qBAAqB;AACrE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,+BAA+B,IAAIC,qBAAqB,QAAQ,+BAA+B;AACxG,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,OAAOC,cAAc,MAAM,6BAA6B;;AAExD;AACA;AACA;AACA,OAAOC,SAAS,MAAM,eAAe;AACrC,OAAOC,0BAA0B,MAAM,kCAAkC;AACzE,OAAOC,oBAAoB,MAAM,wCAAwC;AACzE,OAAOC,gBAAgB,MAAM,YAAY;AACzC,SAASC,YAAY,QAAQ,eAAe;AAC5C,SAASC,KAAK,IAA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B,CAEA,CACD,CACP,CAAC;AAEL;AAEA,eAAeH,UAAU,CAAEyB,yBAA0B,CAAC"}
@@ -13,7 +13,7 @@ import { useInstanceId } from '@wordpress/compose';
13
13
  import { moreVertical } from '@wordpress/icons';
14
14
  import { useCallback, useMemo, useState, useRef, memo } from '@wordpress/element';
15
15
  import { useDispatch, useSelect } from '@wordpress/data';
16
- import { sprintf, __ } from '@wordpress/i18n';
16
+ import { __ } from '@wordpress/i18n';
17
17
  import { ESCAPE } from '@wordpress/keycodes';
18
18
 
19
19
  /**
@@ -24,7 +24,7 @@ import useListViewScrollIntoView from './use-list-view-scroll-into-view';
24
24
  import { BlockMoverUpButton, BlockMoverDownButton } from '../block-mover/button';
25
25
  import ListViewBlockContents from './block-contents';
26
26
  import { useListViewContext } from './context';
27
- import { getBlockPositionDescription, focusListItem } from './utils';
27
+ import { getBlockPositionDescription, getBlockPropertiesDescription, focusListItem } from './utils';
28
28
  import { store as blockEditorStore } from '../../store';
29
29
  import useBlockDisplayInformation from '../use-block-display-information';
30
30
  import { useBlockLock } from '../block-lock';
@@ -66,7 +66,6 @@ function ListViewBlock({
66
66
  toggleBlockHighlight
67
67
  } = useDispatch(blockEditorStore);
68
68
  const blockInformation = useBlockDisplayInformation(clientId);
69
- const blockTitle = blockInformation?.name || blockInformation?.title || __('Untitled');
70
69
  const {
71
70
  block,
72
71
  blockName,
@@ -92,7 +91,7 @@ function ListViewBlock({
92
91
  // Don't show the settings menu if block is disabled or content only.
93
92
  blockEditingMode === 'default';
94
93
  const instanceId = useInstanceId(ListViewBlock);
95
- const descriptionId = `list-view-block-select-button__${instanceId}`;
94
+ const descriptionId = `list-view-block-select-button__description-${instanceId}`;
96
95
  const {
97
96
  expand,
98
97
  collapse,
@@ -198,12 +197,7 @@ function ListViewBlock({
198
197
  return null;
199
198
  }
200
199
  const blockPositionDescription = getBlockPositionDescription(position, siblingBlockCount, level);
201
- const blockAriaLabel = isLocked ? sprintf(
202
- // translators: %s: The title of the block. This string indicates a link to select the locked block.
203
- __('%s (locked)'), blockTitle) : blockTitle;
204
- const settingsAriaLabel = sprintf(
205
- // translators: %s: The title of the block.
206
- __('Options for %s'), blockTitle);
200
+ const blockPropertiesDescription = getBlockPropertiesDescription(isLocked);
207
201
  const hasSiblings = siblingBlockCount > 0;
208
202
  const hasRenderedMovers = showBlockMovers && hasSiblings;
209
203
  const moverCellClassName = classnames('block-editor-list-view-block__mover-cell', {
@@ -285,12 +279,11 @@ function ListViewBlock({
285
279
  onFocus: onFocus,
286
280
  isExpanded: canEdit ? isExpanded : undefined,
287
281
  selectedClientIds: selectedClientIds,
288
- ariaLabel: blockAriaLabel,
289
282
  ariaDescribedBy: descriptionId,
290
283
  updateFocusAndSelection: updateFocusAndSelection
291
284
  }), createElement(AriaReferencedText, {
292
285
  id: descriptionId
293
- }, blockPositionDescription))), hasRenderedMovers && createElement(Fragment, null, createElement(TreeGridCell, {
286
+ }, `${blockPositionDescription} ${blockPropertiesDescription}`))), hasRenderedMovers && createElement(Fragment, null, createElement(TreeGridCell, {
294
287
  className: moverCellClassName,
295
288
  withoutGridItem: true
296
289
  }, createElement(TreeGridItem, null, ({
@@ -325,7 +318,7 @@ function ListViewBlock({
325
318
  clientIds: dropdownClientIds,
326
319
  block: block,
327
320
  icon: moreVertical,
328
- label: settingsAriaLabel,
321
+ label: __('Actions'),
329
322
  popoverProps: {
330
323
  anchor: settingsPopoverAnchor // Used to position the settings at the cursor on right-click.
331
324
  },
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","hasBlockSupport","__experimentalTreeGridCell","TreeGridCell","__experimentalTreeGridItem","TreeGridItem","useInstanceId","moreVertical","useCallback","useMemo","useState","useRef","memo","useDispatch","useSelect","sprintf","__","ESCAPE","ListViewLeaf","useListViewScrollIntoView","BlockMoverUpButton","BlockMoverDownButton","ListViewBlockContents","useListViewContext","getBlockPositionDescription","focusListItem","store","blockEditorStore","useBlockDisplayInformation","useBlockLock","AriaReferencedText","ListViewBlock","block","clientId","displacement","isAfterDraggedBlocks","isDragged","isNesting","isSelected","isBranchSelected","selectBlock","position","level","rowCount","siblingBlockCount","showBlockMovers","path","isExpanded","selectedClientIds","isSyncedBranch","cellRef","rowRef","settingsRef","isHovered","setIsHovered","settingsAnchorRect","setSettingsAnchorRect","isLocked","canEdit","canMove","isFirstSelectedBlock","isLastSelectedBlock","length","toggleBlockHighlight","blockInformation","blockTitle","name","title","blockName","blockEditingMode","select","getBlock","getBlockName","getBlockEditingMode","allowRightClickOverrides","getSettings","showBlockActions","instanceId","descriptionId","expand","collapse","BlockSettingsMenu","listViewInstanceId","expandedState","setInsertedBlock","treeGridElementRef","onKeyDown","event","keyCode","defaultPrevented","stopPropagation","preventDefault","undefined","onMouseEnter","onMouseLeave","selectEditorBlock","updateFocusAndSelection","focusClientId","shouldSelectBlock","current","toggleExpanded","onContextMenu","click","window","DOMRect","clientX","clientY","onMouseDown","button","settingsPopoverAnchor","ownerDocument","getBoundingClientRect","clearSettingsAnchorRect","rowItemRef","blockPositionDescription","blockAriaLabel","settingsAriaLabel","hasSiblings","hasRenderedMovers","moverCellClassName","listViewBlockSettingsClassName","colSpan","classes","isSynced","dropdownClientIds","includes","currentlyEditingBlockInCanvas","createElement","className","onFocus","onBlur","id","ref","tabIndex","onClick","onToggleExpanded","ariaLabel","ariaDescribedBy","Fragment","withoutGridItem","orientation","clientIds","icon","label","popoverProps","anchor","toggleProps","disableOpenOnArrowDown","__experimentalSelectBlock"],"sources":["@wordpress/block-editor/src/components/list-view/block.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport {\n\t__experimentalTreeGridCell as TreeGridCell,\n\t__experimentalTreeGridItem as TreeGridItem,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { moreVertical } from '@wordpress/icons';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseState,\n\tuseRef,\n\tmemo,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport ListViewLeaf from './leaf';\nimport useListViewScrollIntoView from './use-list-view-scroll-into-view';\nimport {\n\tBlockMoverUpButton,\n\tBlockMoverDownButton,\n} from '../block-mover/button';\nimport ListViewBlockContents from './block-contents';\nimport { useListViewContext } from './context';\nimport { getBlockPositionDescription, focusListItem } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { useBlockLock } from '../block-lock';\nimport AriaReferencedText from './aria-referenced-text';\n\nfunction ListViewBlock( {\n\tblock: { clientId },\n\tdisplacement,\n\tisAfterDraggedBlocks,\n\tisDragged,\n\tisNesting,\n\tisSelected,\n\tisBranchSelected,\n\tselectBlock,\n\tposition,\n\tlevel,\n\trowCount,\n\tsiblingBlockCount,\n\tshowBlockMovers,\n\tpath,\n\tisExpanded,\n\tselectedClientIds,\n\tisSyncedBranch,\n} ) {\n\tconst cellRef = useRef( null );\n\tconst rowRef = useRef( null );\n\tconst settingsRef = useRef( null );\n\tconst [ isHovered, setIsHovered ] = useState( false );\n\tconst [ settingsAnchorRect, setSettingsAnchorRect ] = useState();\n\n\tconst { isLocked, canEdit, canMove } = useBlockLock( clientId );\n\n\tconst isFirstSelectedBlock =\n\t\tisSelected && selectedClientIds[ 0 ] === clientId;\n\tconst isLastSelectedBlock =\n\t\tisSelected &&\n\t\tselectedClientIds[ selectedClientIds.length - 1 ] === clientId;\n\n\tconst { toggleBlockHighlight } = useDispatch( blockEditorStore );\n\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst blockTitle =\n\t\tblockInformation?.name || blockInformation?.title || __( 'Untitled' );\n\n\tconst { block, blockName, blockEditingMode } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock, getBlockName, getBlockEditingMode } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\tblock: getBlock( clientId ),\n\t\t\t\tblockName: getBlockName( clientId ),\n\t\t\t\tblockEditingMode: getBlockEditingMode( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst allowRightClickOverrides = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().allowRightClickOverrides,\n\t\t[]\n\t);\n\n\tconst showBlockActions =\n\t\t// When a block hides its toolbar it also hides the block settings menu,\n\t\t// since that menu is part of the toolbar in the editor canvas.\n\t\t// List View respects this by also hiding the block settings menu.\n\t\thasBlockSupport( blockName, '__experimentalToolbar', true ) &&\n\t\t// Don't show the settings menu if block is disabled or content only.\n\t\tblockEditingMode === 'default';\n\tconst instanceId = useInstanceId( ListViewBlock );\n\tconst descriptionId = `list-view-block-select-button__${ instanceId }`;\n\n\tconst {\n\t\texpand,\n\t\tcollapse,\n\t\tBlockSettingsMenu,\n\t\tlistViewInstanceId,\n\t\texpandedState,\n\t\tsetInsertedBlock,\n\t\ttreeGridElementRef,\n\t} = useListViewContext();\n\n\t// If multiple blocks are selected, deselect all blocks when the user\n\t// presses the escape key.\n\tconst onKeyDown = ( event ) => {\n\t\tif (\n\t\t\tevent.keyCode === ESCAPE &&\n\t\t\t! event.defaultPrevented &&\n\t\t\tselectedClientIds.length > 0\n\t\t) {\n\t\t\tevent.stopPropagation();\n\t\t\tevent.preventDefault();\n\t\t\tselectBlock( event, undefined );\n\t\t}\n\t};\n\n\tconst onMouseEnter = useCallback( () => {\n\t\tsetIsHovered( true );\n\t\ttoggleBlockHighlight( clientId, true );\n\t}, [ clientId, setIsHovered, toggleBlockHighlight ] );\n\tconst onMouseLeave = useCallback( () => {\n\t\tsetIsHovered( false );\n\t\ttoggleBlockHighlight( clientId, false );\n\t}, [ clientId, setIsHovered, toggleBlockHighlight ] );\n\n\tconst selectEditorBlock = useCallback(\n\t\t( event ) => {\n\t\t\tselectBlock( event, clientId );\n\t\t\tevent.preventDefault();\n\t\t},\n\t\t[ clientId, selectBlock ]\n\t);\n\n\tconst updateFocusAndSelection = useCallback(\n\t\t( focusClientId, shouldSelectBlock ) => {\n\t\t\tif ( shouldSelectBlock ) {\n\t\t\t\tselectBlock( undefined, focusClientId, null, null );\n\t\t\t}\n\n\t\t\tfocusListItem( focusClientId, treeGridElementRef?.current );\n\t\t},\n\t\t[ selectBlock, treeGridElementRef ]\n\t);\n\n\tconst toggleExpanded = useCallback(\n\t\t( event ) => {\n\t\t\t// Prevent shift+click from opening link in a new window when toggling.\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tif ( isExpanded === true ) {\n\t\t\t\tcollapse( clientId );\n\t\t\t} else if ( isExpanded === false ) {\n\t\t\t\texpand( clientId );\n\t\t\t}\n\t\t},\n\t\t[ clientId, expand, collapse, isExpanded ]\n\t);\n\n\t// Allow right-clicking an item in the List View to open up the block settings dropdown.\n\tconst onContextMenu = useCallback(\n\t\t( event ) => {\n\t\t\tif ( showBlockActions && allowRightClickOverrides ) {\n\t\t\t\tsettingsRef.current?.click();\n\t\t\t\t// Ensure the position of the settings dropdown is at the cursor.\n\t\t\t\tsetSettingsAnchorRect(\n\t\t\t\t\tnew window.DOMRect( event.clientX, event.clientY, 0, 0 )\n\t\t\t\t);\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ allowRightClickOverrides, settingsRef, showBlockActions ]\n\t);\n\n\tconst onMouseDown = useCallback(\n\t\t( event ) => {\n\t\t\t// Prevent right-click from focusing the block,\n\t\t\t// because focus will be handled when opening the block settings dropdown.\n\t\t\tif ( allowRightClickOverrides && event.button === 2 ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ allowRightClickOverrides ]\n\t);\n\n\tconst settingsPopoverAnchor = useMemo( () => {\n\t\tconst { ownerDocument } = rowRef?.current || {};\n\n\t\t// If no custom position is set, the settings dropdown will be anchored to the\n\t\t// DropdownMenu toggle button.\n\t\tif ( ! settingsAnchorRect || ! ownerDocument ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Position the settings dropdown at the cursor when right-clicking a block.\n\t\treturn {\n\t\t\townerDocument,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn settingsAnchorRect;\n\t\t\t},\n\t\t};\n\t}, [ settingsAnchorRect ] );\n\n\tconst clearSettingsAnchorRect = useCallback( () => {\n\t\t// Clear the custom position for the settings dropdown so that it is restored back\n\t\t// to being anchored to the DropdownMenu toggle button.\n\t\tsetSettingsAnchorRect( undefined );\n\t}, [ setSettingsAnchorRect ] );\n\n\t// Pass in a ref to the row, so that it can be scrolled\n\t// into view when selected. For long lists, the placeholder for the\n\t// selected block is also observed, within ListViewLeafPlaceholder.\n\tuseListViewScrollIntoView( {\n\t\tisSelected,\n\t\trowItemRef: rowRef,\n\t\tselectedClientIds,\n\t} );\n\n\t// When switching between rendering modes (such as template preview and content only),\n\t// it is possible for a block to temporarily be unavailable. In this case, we should not\n\t// render the leaf, to avoid errors further down the tree.\n\tif ( ! block ) {\n\t\treturn null;\n\t}\n\n\tconst blockPositionDescription = getBlockPositionDescription(\n\t\tposition,\n\t\tsiblingBlockCount,\n\t\tlevel\n\t);\n\n\tconst blockAriaLabel = isLocked\n\t\t? sprintf(\n\t\t\t\t// translators: %s: The title of the block. This string indicates a link to select the locked block.\n\t\t\t\t__( '%s (locked)' ),\n\t\t\t\tblockTitle\n\t\t )\n\t\t: blockTitle;\n\n\tconst settingsAriaLabel = sprintf(\n\t\t// translators: %s: The title of the block.\n\t\t__( 'Options for %s' ),\n\t\tblockTitle\n\t);\n\n\tconst hasSiblings = siblingBlockCount > 0;\n\tconst hasRenderedMovers = showBlockMovers && hasSiblings;\n\tconst moverCellClassName = classnames(\n\t\t'block-editor-list-view-block__mover-cell',\n\t\t{ 'is-visible': isHovered || isSelected }\n\t);\n\n\tconst listViewBlockSettingsClassName = classnames(\n\t\t'block-editor-list-view-block__menu-cell',\n\t\t{ 'is-visible': isHovered || isFirstSelectedBlock }\n\t);\n\n\tlet colSpan;\n\tif ( hasRenderedMovers ) {\n\t\tcolSpan = 2;\n\t} else if ( ! showBlockActions ) {\n\t\tcolSpan = 3;\n\t}\n\n\tconst classes = classnames( {\n\t\t'is-selected': isSelected,\n\t\t'is-first-selected': isFirstSelectedBlock,\n\t\t'is-last-selected': isLastSelectedBlock,\n\t\t'is-branch-selected': isBranchSelected,\n\t\t'is-synced-branch': isSyncedBranch,\n\t\t'is-dragging': isDragged,\n\t\t'has-single-cell': ! showBlockActions,\n\t\t'is-synced': blockInformation?.isSynced,\n\t\t'is-draggable': canMove,\n\t\t'is-displacement-normal': displacement === 'normal',\n\t\t'is-displacement-up': displacement === 'up',\n\t\t'is-displacement-down': displacement === 'down',\n\t\t'is-after-dragged-blocks': isAfterDraggedBlocks,\n\t\t'is-nesting': isNesting,\n\t} );\n\n\t// Only include all selected blocks if the currently clicked on block\n\t// is one of the selected blocks. This ensures that if a user attempts\n\t// to alter a block that isn't part of the selection, they're still able\n\t// to do so.\n\tconst dropdownClientIds = selectedClientIds.includes( clientId )\n\t\t? selectedClientIds\n\t\t: [ clientId ];\n\n\t// Detect if there is a block in the canvas currently being edited and multi-selection is not happening.\n\tconst currentlyEditingBlockInCanvas =\n\t\tisSelected && selectedClientIds.length === 1;\n\n\treturn (\n\t\t<ListViewLeaf\n\t\t\tclassName={ classes }\n\t\t\tisDragged={ isDragged }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t\tonMouseEnter={ onMouseEnter }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\tonFocus={ onMouseEnter }\n\t\t\tonBlur={ onMouseLeave }\n\t\t\tlevel={ level }\n\t\t\tposition={ position }\n\t\t\trowCount={ rowCount }\n\t\t\tpath={ path }\n\t\t\tid={ `list-view-${ listViewInstanceId }-block-${ clientId }` }\n\t\t\tdata-block={ clientId }\n\t\t\tdata-expanded={ canEdit ? isExpanded : undefined }\n\t\t\tref={ rowRef }\n\t\t>\n\t\t\t<TreeGridCell\n\t\t\t\tclassName=\"block-editor-list-view-block__contents-cell\"\n\t\t\t\tcolSpan={ colSpan }\n\t\t\t\tref={ cellRef }\n\t\t\t\taria-selected={ !! isSelected }\n\t\t\t>\n\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t<div className=\"block-editor-list-view-block__contents-container\">\n\t\t\t\t\t\t<ListViewBlockContents\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\tonClick={ selectEditorBlock }\n\t\t\t\t\t\t\tonContextMenu={ onContextMenu }\n\t\t\t\t\t\t\tonMouseDown={ onMouseDown }\n\t\t\t\t\t\t\tonToggleExpanded={ toggleExpanded }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\tsiblingBlockCount={ siblingBlockCount }\n\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\ttabIndex={\n\t\t\t\t\t\t\t\tcurrentlyEditingBlockInCanvas ? 0 : tabIndex\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tisExpanded={ canEdit ? isExpanded : undefined }\n\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\tariaLabel={ blockAriaLabel }\n\t\t\t\t\t\t\tariaDescribedBy={ descriptionId }\n\t\t\t\t\t\t\tupdateFocusAndSelection={ updateFocusAndSelection }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<AriaReferencedText id={ descriptionId }>\n\t\t\t\t\t\t\t{ blockPositionDescription }\n\t\t\t\t\t\t</AriaReferencedText>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TreeGridCell>\n\t\t\t{ hasRenderedMovers && (\n\t\t\t\t<>\n\t\t\t\t\t<TreeGridCell\n\t\t\t\t\t\tclassName={ moverCellClassName }\n\t\t\t\t\t\twithoutGridItem\n\t\t\t\t\t>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverUpButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverDownButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t</TreeGridCell>\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t{ showBlockActions && BlockSettingsMenu && (\n\t\t\t\t<TreeGridCell\n\t\t\t\t\tclassName={ listViewBlockSettingsClassName }\n\t\t\t\t\taria-selected={ !! isSelected }\n\t\t\t\t\tref={ settingsRef }\n\t\t\t\t>\n\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t<BlockSettingsMenu\n\t\t\t\t\t\t\tclientIds={ dropdownClientIds }\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ settingsAriaLabel }\n\t\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\t\tanchor: settingsPopoverAnchor, // Used to position the settings at the cursor on right-click.\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\tref,\n\t\t\t\t\t\t\t\tclassName: 'block-editor-list-view-block__menu',\n\t\t\t\t\t\t\t\ttabIndex,\n\t\t\t\t\t\t\t\tonClick: clearSettingsAnchorRect,\n\t\t\t\t\t\t\t\tonFocus,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tdisableOpenOnArrowDown\n\t\t\t\t\t\t\texpand={ expand }\n\t\t\t\t\t\t\texpandedState={ expandedState }\n\t\t\t\t\t\t\tsetInsertedBlock={ setInsertedBlock }\n\t\t\t\t\t\t\t__experimentalSelectBlock={\n\t\t\t\t\t\t\t\tupdateFocusAndSelection\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</TreeGridCell>\n\t\t\t) }\n\t\t</ListViewLeaf>\n\t);\n}\n\nexport default memo( ListViewBlock );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SACCC,0BAA0B,IAAIC,YAAY,EAC1CC,0BAA0B,IAAIC,YAAY,QACpC,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACCC,WAAW,EACXC,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,IAAI,QACE,oBAAoB;AAC3B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,OAAO,EAAEC,EAAE,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,QAAQ,qBAAqB;;AAE5C;AACA;AACA;AACA,OAAOC,YAAY,MAAM,QAAQ;AACjC,OAAOC,yBAAyB,MAAM,kCAAkC;AACxE,SACCC,kBAAkB,EAClBC,oBAAoB,QACd,uBAAuB;AAC9B,O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CAAC1H,YAAY,QACV,CAAE;IAAE+H,GAAG;IAAEC,QAAQ;IAAEJ;EAAQ,CAAC,KAC7BF,aAAA,CAAC1G,oBAAoB;IACpBuH,WAAW,EAAC,UAAU;IACtBC,SAAS,EAAG,CAAE5G,QAAQ,CAAI;IAC1BmG,GAAG,EAAGA,GAAK;IACXC,QAAQ,EAAGA,QAAU;IACrBJ,OAAO,EAAGA;EAAS,CACnB,CAEW,CACD,CACb,CACF,EAECrD,gBAAgB,IAAIK,iBAAiB,IACtC8C,aAAA,CAAC5H,YAAY;IACZ6H,SAAS,EAAGR,8BAAgC;IAC5C,iBAAgB,CAAC,CAAElF,UAAY;IAC/B8F,GAAG,EAAGhF;EAAa,GAEjB,CAAE;IAAEgF,GAAG;IAAEC,QAAQ;IAAEJ;EAAQ,CAAC,KAC7BF,aAAA,CAAC9C,iBAAiB;IACjB4D,SAAS,EAAGjB,iBAAmB;IAC/B5F,KAAK,EAAGA,KAAO;IACf8G,IAAI,EAAGvI,YAAc;IACrBwI,KAAK,EAAG3B,iBAAmB;IAC3B4B,YAAY,EAAG;MACdC,MAAM,EAAEpC,qBAAqB,CAAE;IAChC,CAAG;IACHqC,WAAW,EAAG;MACbd,GAAG;MACHJ,SAAS,EAAE,oCAAoC;MAC/CK,QAAQ;MACRC,OAAO,EAAEtB,uBAAuB;MAChCiB;IACD,CAAG;IACHkB,sBAAsB;IACtBpE,MAAM,EAAGA,MAAQ;IACjBI,aAAa,EAAGA,aAAe;IAC/BC,gBAAgB,EAAGA,gBAAkB;IACrCgE,yBAAyB,EACxBpD;EACA,CACD,CAEW,CAEF,CAAC;AAEjB;AAEA,eAAepF,IAAI,CAAEmB,aAAc,CAAC"}
1
+ {"version":3,"names":["classnames","hasBlockSupport","__experimentalTreeGridCell","TreeGridCell","__experimentalTreeGridItem","TreeGridItem","useInstanceId","moreVertical","useCallback","useMemo","useState","useRef","memo","useDispatch","useSelect","__","ESCAPE","ListViewLeaf","useListViewScrollIntoView","BlockMoverUpButton","BlockMoverDownButton","ListViewBlockContents","useListViewContext","getBlockPositionDescription","getBlockPropertiesDescription","focusListItem","store","blockEditorStore","useBlockDisplayInformation","useBlockLock","AriaReferencedText","ListViewBlock","block","clientId","displacement","isAfterDraggedBlocks","isDragged","isNesting","isSelected","isBranchSelected","selectBlock","position","level","rowCount","siblingBlockCount","showBlockMovers","path","isExpanded","selectedClientIds","isSyncedBranch","cellRef","rowRef","settingsRef","isHovered","setIsHovered","settingsAnchorRect","setSettingsAnchorRect","isLocked","canEdit","canMove","isFirstSelectedBlock","isLastSelectedBlock","length","toggleBlockHighlight","blockInformation","blockName","blockEditingMode","select","getBlock","getBlockName","getBlockEditingMode","allowRightClickOverrides","getSettings","showBlockActions","instanceId","descriptionId","expand","collapse","BlockSettingsMenu","listViewInstanceId","expandedState","setInsertedBlock","treeGridElementRef","onKeyDown","event","keyCode","defaultPrevented","stopPropagation","preventDefault","undefined","onMouseEnter","onMouseLeave","selectEditorBlock","updateFocusAndSelection","focusClientId","shouldSelectBlock","current","toggleExpanded","onContextMenu","click","window","DOMRect","clientX","clientY","onMouseDown","button","settingsPopoverAnchor","ownerDocument","getBoundingClientRect","clearSettingsAnchorRect","rowItemRef","blockPositionDescription","blockPropertiesDescription","hasSiblings","hasRenderedMovers","moverCellClassName","listViewBlockSettingsClassName","colSpan","classes","isSynced","dropdownClientIds","includes","currentlyEditingBlockInCanvas","createElement","className","onFocus","onBlur","id","ref","tabIndex","onClick","onToggleExpanded","ariaDescribedBy","Fragment","withoutGridItem","orientation","clientIds","icon","label","popoverProps","anchor","toggleProps","disableOpenOnArrowDown","__experimentalSelectBlock"],"sources":["@wordpress/block-editor/src/components/list-view/block.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { hasBlockSupport } from '@wordpress/blocks';\nimport {\n\t__experimentalTreeGridCell as TreeGridCell,\n\t__experimentalTreeGridItem as TreeGridItem,\n} from '@wordpress/components';\nimport { useInstanceId } from '@wordpress/compose';\nimport { moreVertical } from '@wordpress/icons';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseState,\n\tuseRef,\n\tmemo,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { ESCAPE } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport ListViewLeaf from './leaf';\nimport useListViewScrollIntoView from './use-list-view-scroll-into-view';\nimport {\n\tBlockMoverUpButton,\n\tBlockMoverDownButton,\n} from '../block-mover/button';\nimport ListViewBlockContents from './block-contents';\nimport { useListViewContext } from './context';\nimport {\n\tgetBlockPositionDescription,\n\tgetBlockPropertiesDescription,\n\tfocusListItem,\n} from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { useBlockLock } from '../block-lock';\nimport AriaReferencedText from './aria-referenced-text';\n\nfunction ListViewBlock( {\n\tblock: { clientId },\n\tdisplacement,\n\tisAfterDraggedBlocks,\n\tisDragged,\n\tisNesting,\n\tisSelected,\n\tisBranchSelected,\n\tselectBlock,\n\tposition,\n\tlevel,\n\trowCount,\n\tsiblingBlockCount,\n\tshowBlockMovers,\n\tpath,\n\tisExpanded,\n\tselectedClientIds,\n\tisSyncedBranch,\n} ) {\n\tconst cellRef = useRef( null );\n\tconst rowRef = useRef( null );\n\tconst settingsRef = useRef( null );\n\tconst [ isHovered, setIsHovered ] = useState( false );\n\tconst [ settingsAnchorRect, setSettingsAnchorRect ] = useState();\n\n\tconst { isLocked, canEdit, canMove } = useBlockLock( clientId );\n\n\tconst isFirstSelectedBlock =\n\t\tisSelected && selectedClientIds[ 0 ] === clientId;\n\tconst isLastSelectedBlock =\n\t\tisSelected &&\n\t\tselectedClientIds[ selectedClientIds.length - 1 ] === clientId;\n\n\tconst { toggleBlockHighlight } = useDispatch( blockEditorStore );\n\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\n\tconst { block, blockName, blockEditingMode } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlock, getBlockName, getBlockEditingMode } =\n\t\t\t\tselect( blockEditorStore );\n\n\t\t\treturn {\n\t\t\t\tblock: getBlock( clientId ),\n\t\t\t\tblockName: getBlockName( clientId ),\n\t\t\t\tblockEditingMode: getBlockEditingMode( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst allowRightClickOverrides = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).getSettings().allowRightClickOverrides,\n\t\t[]\n\t);\n\n\tconst showBlockActions =\n\t\t// When a block hides its toolbar it also hides the block settings menu,\n\t\t// since that menu is part of the toolbar in the editor canvas.\n\t\t// List View respects this by also hiding the block settings menu.\n\t\thasBlockSupport( blockName, '__experimentalToolbar', true ) &&\n\t\t// Don't show the settings menu if block is disabled or content only.\n\t\tblockEditingMode === 'default';\n\tconst instanceId = useInstanceId( ListViewBlock );\n\tconst descriptionId = `list-view-block-select-button__description-${ instanceId }`;\n\n\tconst {\n\t\texpand,\n\t\tcollapse,\n\t\tBlockSettingsMenu,\n\t\tlistViewInstanceId,\n\t\texpandedState,\n\t\tsetInsertedBlock,\n\t\ttreeGridElementRef,\n\t} = useListViewContext();\n\n\t// If multiple blocks are selected, deselect all blocks when the user\n\t// presses the escape key.\n\tconst onKeyDown = ( event ) => {\n\t\tif (\n\t\t\tevent.keyCode === ESCAPE &&\n\t\t\t! event.defaultPrevented &&\n\t\t\tselectedClientIds.length > 0\n\t\t) {\n\t\t\tevent.stopPropagation();\n\t\t\tevent.preventDefault();\n\t\t\tselectBlock( event, undefined );\n\t\t}\n\t};\n\n\tconst onMouseEnter = useCallback( () => {\n\t\tsetIsHovered( true );\n\t\ttoggleBlockHighlight( clientId, true );\n\t}, [ clientId, setIsHovered, toggleBlockHighlight ] );\n\tconst onMouseLeave = useCallback( () => {\n\t\tsetIsHovered( false );\n\t\ttoggleBlockHighlight( clientId, false );\n\t}, [ clientId, setIsHovered, toggleBlockHighlight ] );\n\n\tconst selectEditorBlock = useCallback(\n\t\t( event ) => {\n\t\t\tselectBlock( event, clientId );\n\t\t\tevent.preventDefault();\n\t\t},\n\t\t[ clientId, selectBlock ]\n\t);\n\n\tconst updateFocusAndSelection = useCallback(\n\t\t( focusClientId, shouldSelectBlock ) => {\n\t\t\tif ( shouldSelectBlock ) {\n\t\t\t\tselectBlock( undefined, focusClientId, null, null );\n\t\t\t}\n\n\t\t\tfocusListItem( focusClientId, treeGridElementRef?.current );\n\t\t},\n\t\t[ selectBlock, treeGridElementRef ]\n\t);\n\n\tconst toggleExpanded = useCallback(\n\t\t( event ) => {\n\t\t\t// Prevent shift+click from opening link in a new window when toggling.\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tif ( isExpanded === true ) {\n\t\t\t\tcollapse( clientId );\n\t\t\t} else if ( isExpanded === false ) {\n\t\t\t\texpand( clientId );\n\t\t\t}\n\t\t},\n\t\t[ clientId, expand, collapse, isExpanded ]\n\t);\n\n\t// Allow right-clicking an item in the List View to open up the block settings dropdown.\n\tconst onContextMenu = useCallback(\n\t\t( event ) => {\n\t\t\tif ( showBlockActions && allowRightClickOverrides ) {\n\t\t\t\tsettingsRef.current?.click();\n\t\t\t\t// Ensure the position of the settings dropdown is at the cursor.\n\t\t\t\tsetSettingsAnchorRect(\n\t\t\t\t\tnew window.DOMRect( event.clientX, event.clientY, 0, 0 )\n\t\t\t\t);\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ allowRightClickOverrides, settingsRef, showBlockActions ]\n\t);\n\n\tconst onMouseDown = useCallback(\n\t\t( event ) => {\n\t\t\t// Prevent right-click from focusing the block,\n\t\t\t// because focus will be handled when opening the block settings dropdown.\n\t\t\tif ( allowRightClickOverrides && event.button === 2 ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ allowRightClickOverrides ]\n\t);\n\n\tconst settingsPopoverAnchor = useMemo( () => {\n\t\tconst { ownerDocument } = rowRef?.current || {};\n\n\t\t// If no custom position is set, the settings dropdown will be anchored to the\n\t\t// DropdownMenu toggle button.\n\t\tif ( ! settingsAnchorRect || ! ownerDocument ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Position the settings dropdown at the cursor when right-clicking a block.\n\t\treturn {\n\t\t\townerDocument,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn settingsAnchorRect;\n\t\t\t},\n\t\t};\n\t}, [ settingsAnchorRect ] );\n\n\tconst clearSettingsAnchorRect = useCallback( () => {\n\t\t// Clear the custom position for the settings dropdown so that it is restored back\n\t\t// to being anchored to the DropdownMenu toggle button.\n\t\tsetSettingsAnchorRect( undefined );\n\t}, [ setSettingsAnchorRect ] );\n\n\t// Pass in a ref to the row, so that it can be scrolled\n\t// into view when selected. For long lists, the placeholder for the\n\t// selected block is also observed, within ListViewLeafPlaceholder.\n\tuseListViewScrollIntoView( {\n\t\tisSelected,\n\t\trowItemRef: rowRef,\n\t\tselectedClientIds,\n\t} );\n\n\t// When switching between rendering modes (such as template preview and content only),\n\t// it is possible for a block to temporarily be unavailable. In this case, we should not\n\t// render the leaf, to avoid errors further down the tree.\n\tif ( ! block ) {\n\t\treturn null;\n\t}\n\n\tconst blockPositionDescription = getBlockPositionDescription(\n\t\tposition,\n\t\tsiblingBlockCount,\n\t\tlevel\n\t);\n\n\tconst blockPropertiesDescription =\n\t\tgetBlockPropertiesDescription( isLocked );\n\n\tconst hasSiblings = siblingBlockCount > 0;\n\tconst hasRenderedMovers = showBlockMovers && hasSiblings;\n\tconst moverCellClassName = classnames(\n\t\t'block-editor-list-view-block__mover-cell',\n\t\t{ 'is-visible': isHovered || isSelected }\n\t);\n\n\tconst listViewBlockSettingsClassName = classnames(\n\t\t'block-editor-list-view-block__menu-cell',\n\t\t{ 'is-visible': isHovered || isFirstSelectedBlock }\n\t);\n\n\tlet colSpan;\n\tif ( hasRenderedMovers ) {\n\t\tcolSpan = 2;\n\t} else if ( ! showBlockActions ) {\n\t\tcolSpan = 3;\n\t}\n\n\tconst classes = classnames( {\n\t\t'is-selected': isSelected,\n\t\t'is-first-selected': isFirstSelectedBlock,\n\t\t'is-last-selected': isLastSelectedBlock,\n\t\t'is-branch-selected': isBranchSelected,\n\t\t'is-synced-branch': isSyncedBranch,\n\t\t'is-dragging': isDragged,\n\t\t'has-single-cell': ! showBlockActions,\n\t\t'is-synced': blockInformation?.isSynced,\n\t\t'is-draggable': canMove,\n\t\t'is-displacement-normal': displacement === 'normal',\n\t\t'is-displacement-up': displacement === 'up',\n\t\t'is-displacement-down': displacement === 'down',\n\t\t'is-after-dragged-blocks': isAfterDraggedBlocks,\n\t\t'is-nesting': isNesting,\n\t} );\n\n\t// Only include all selected blocks if the currently clicked on block\n\t// is one of the selected blocks. This ensures that if a user attempts\n\t// to alter a block that isn't part of the selection, they're still able\n\t// to do so.\n\tconst dropdownClientIds = selectedClientIds.includes( clientId )\n\t\t? selectedClientIds\n\t\t: [ clientId ];\n\n\t// Detect if there is a block in the canvas currently being edited and multi-selection is not happening.\n\tconst currentlyEditingBlockInCanvas =\n\t\tisSelected && selectedClientIds.length === 1;\n\n\treturn (\n\t\t<ListViewLeaf\n\t\t\tclassName={ classes }\n\t\t\tisDragged={ isDragged }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t\tonMouseEnter={ onMouseEnter }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\tonFocus={ onMouseEnter }\n\t\t\tonBlur={ onMouseLeave }\n\t\t\tlevel={ level }\n\t\t\tposition={ position }\n\t\t\trowCount={ rowCount }\n\t\t\tpath={ path }\n\t\t\tid={ `list-view-${ listViewInstanceId }-block-${ clientId }` }\n\t\t\tdata-block={ clientId }\n\t\t\tdata-expanded={ canEdit ? isExpanded : undefined }\n\t\t\tref={ rowRef }\n\t\t>\n\t\t\t<TreeGridCell\n\t\t\t\tclassName=\"block-editor-list-view-block__contents-cell\"\n\t\t\t\tcolSpan={ colSpan }\n\t\t\t\tref={ cellRef }\n\t\t\t\taria-selected={ !! isSelected }\n\t\t\t>\n\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t<div className=\"block-editor-list-view-block__contents-container\">\n\t\t\t\t\t\t<ListViewBlockContents\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\tonClick={ selectEditorBlock }\n\t\t\t\t\t\t\tonContextMenu={ onContextMenu }\n\t\t\t\t\t\t\tonMouseDown={ onMouseDown }\n\t\t\t\t\t\t\tonToggleExpanded={ toggleExpanded }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\tsiblingBlockCount={ siblingBlockCount }\n\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\ttabIndex={\n\t\t\t\t\t\t\t\tcurrentlyEditingBlockInCanvas ? 0 : tabIndex\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tisExpanded={ canEdit ? isExpanded : undefined }\n\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\tariaDescribedBy={ descriptionId }\n\t\t\t\t\t\t\tupdateFocusAndSelection={ updateFocusAndSelection }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<AriaReferencedText id={ descriptionId }>\n\t\t\t\t\t\t\t{ `${ blockPositionDescription } ${ blockPropertiesDescription }` }\n\t\t\t\t\t\t</AriaReferencedText>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TreeGridCell>\n\t\t\t{ hasRenderedMovers && (\n\t\t\t\t<>\n\t\t\t\t\t<TreeGridCell\n\t\t\t\t\t\tclassName={ moverCellClassName }\n\t\t\t\t\t\twithoutGridItem\n\t\t\t\t\t>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverUpButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverDownButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t</TreeGridCell>\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t{ showBlockActions && BlockSettingsMenu && (\n\t\t\t\t<TreeGridCell\n\t\t\t\t\tclassName={ listViewBlockSettingsClassName }\n\t\t\t\t\taria-selected={ !! isSelected }\n\t\t\t\t\tref={ settingsRef }\n\t\t\t\t>\n\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t<BlockSettingsMenu\n\t\t\t\t\t\t\tclientIds={ dropdownClientIds }\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\t\tanchor: settingsPopoverAnchor, // Used to position the settings at the cursor on right-click.\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\tref,\n\t\t\t\t\t\t\t\tclassName: 'block-editor-list-view-block__menu',\n\t\t\t\t\t\t\t\ttabIndex,\n\t\t\t\t\t\t\t\tonClick: clearSettingsAnchorRect,\n\t\t\t\t\t\t\t\tonFocus,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tdisableOpenOnArrowDown\n\t\t\t\t\t\t\texpand={ expand }\n\t\t\t\t\t\t\texpandedState={ expandedState }\n\t\t\t\t\t\t\tsetInsertedBlock={ setInsertedBlock }\n\t\t\t\t\t\t\t__experimentalSelectBlock={\n\t\t\t\t\t\t\t\tupdateFocusAndSelection\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</TreeGridCell>\n\t\t\t) }\n\t\t</ListViewLeaf>\n\t);\n}\n\nexport default memo( ListViewBlock );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SACCC,0BAA0B,IAAIC,YAAY,EAC1CC,0BAA0B,IAAIC,YAAY,QACpC,uBAAuB;AAC9B,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SACCC,WAAW,EACXC,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,IAAI,QACE,oBAAoB;AAC3B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,qBAAqB;;AAE5C;AACA;AACA;AACA,OAAOC,YAAY,MAAM,QAAQ;AACjC,OAAOC,yBAAyB,MAAM,kCAAkC;AACxE,SACCC,kBAAkB,EAClBC,oBAAoB,QACd,uBAAuB;AAC9B,OAAOC,qBAAqB,MAAM,kBAAkB;AACpD,SAASC,kBAAkB,QAAQ,WAAW;AAC9C,SACCC,2BAA2B,EAC3BC,6BAA6B,EAC7BC,aAAa,QACP,SAAS;A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,CAAE9E,UAAY;IAC/B0F,GAAG,EAAG5E;EAAa,GAEjB,CAAE;IAAE4E,GAAG;IAAEC,QAAQ;IAAEJ;EAAQ,CAAC,KAC7BF,aAAA,CAAC7C,iBAAiB;IACjB0D,SAAS,EAAGhB,iBAAmB;IAC/BxF,KAAK,EAAGA,KAAO;IACfyG,IAAI,EAAGlI,YAAc;IACrBmI,KAAK,EAAG3H,EAAE,CAAE,SAAU,CAAG;IACzB4H,YAAY,EAAG;MACdC,MAAM,EAAElC,qBAAqB,CAAE;IAChC,CAAG;IACHmC,WAAW,EAAG;MACbb,GAAG;MACHJ,SAAS,EAAE,oCAAoC;MAC/CK,QAAQ;MACRC,OAAO,EAAErB,uBAAuB;MAChCgB;IACD,CAAG;IACHiB,sBAAsB;IACtBlE,MAAM,EAAGA,MAAQ;IACjBI,aAAa,EAAGA,aAAe;IAC/BC,gBAAgB,EAAGA,gBAAkB;IACrC8D,yBAAyB,EACxBlD;EACA,CACD,CAEW,CAEF,CAAC;AAEjB;AAEA,eAAejF,IAAI,CAAEmB,aAAc,CAAC"}
@@ -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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ell","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,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,qBAAA;EACD,MAAMC,SAAS,GAAG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