@wordpress/block-editor 12.25.0 → 12.26.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 (674) hide show
  1. package/CHANGELOG.md +9 -3
  2. package/README.md +6 -0
  3. package/build/components/block-actions/index.js +4 -2
  4. package/build/components/block-actions/index.js.map +1 -1
  5. package/build/components/block-alignment-control/ui.js +2 -2
  6. package/build/components/block-alignment-control/ui.js.map +1 -1
  7. package/build/components/block-card/index.js +2 -2
  8. package/build/components/block-card/index.js.map +1 -1
  9. package/build/components/block-compare/index.js +2 -2
  10. package/build/components/block-compare/index.js.map +1 -1
  11. package/build/components/block-edit/edit.js +2 -2
  12. package/build/components/block-edit/edit.js.map +1 -1
  13. package/build/components/block-icon/index.js +2 -2
  14. package/build/components/block-icon/index.js.map +1 -1
  15. package/build/components/block-inspector/index.js +1 -1
  16. package/build/components/block-inspector/index.js.map +1 -1
  17. package/build/components/block-list/block.js +4 -4
  18. package/build/components/block-list/block.js.map +1 -1
  19. package/build/components/block-list/block.native.js +2 -2
  20. package/build/components/block-list/block.native.js.map +1 -1
  21. package/build/components/block-list/index.js +2 -2
  22. package/build/components/block-list/index.js.map +1 -1
  23. package/build/components/block-list/use-block-props/index.js +5 -2
  24. package/build/components/block-list/use-block-props/index.js.map +1 -1
  25. package/build/components/block-list/use-block-props/use-scroll-into-view.js +44 -0
  26. package/build/components/block-list/use-block-props/use-scroll-into-view.js.map +1 -0
  27. package/build/components/block-list-appender/index.js +2 -2
  28. package/build/components/block-list-appender/index.js.map +1 -1
  29. package/build/components/block-mover/button.js +2 -2
  30. package/build/components/block-mover/button.js.map +1 -1
  31. package/build/components/block-mover/index.js +2 -2
  32. package/build/components/block-mover/index.js.map +1 -1
  33. package/build/components/block-patterns-list/index.js +26 -5
  34. package/build/components/block-patterns-list/index.js.map +1 -1
  35. package/build/components/block-popover/cover.js +9 -6
  36. package/build/components/block-popover/cover.js.map +1 -1
  37. package/build/components/block-popover/inbetween.js +2 -2
  38. package/build/components/block-popover/inbetween.js.map +1 -1
  39. package/build/components/block-popover/index.js +22 -4
  40. package/build/components/block-popover/index.js.map +1 -1
  41. package/build/components/block-preview/index.js +2 -2
  42. package/build/components/block-preview/index.js.map +1 -1
  43. package/build/components/block-settings-menu/block-settings-dropdown.js +8 -5
  44. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  45. package/build/components/block-settings-menu-controls/index.js +10 -7
  46. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  47. package/build/components/block-styles/index.js +2 -2
  48. package/build/components/block-styles/index.js.map +1 -1
  49. package/build/components/block-toolbar/index.js +3 -3
  50. package/build/components/block-toolbar/index.js.map +1 -1
  51. package/build/components/block-tools/block-selection-button.js +2 -2
  52. package/build/components/block-tools/block-selection-button.js.map +1 -1
  53. package/build/components/block-tools/block-toolbar-breadcrumb.js +4 -4
  54. package/build/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  55. package/build/components/block-tools/block-toolbar-popover.js +2 -2
  56. package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
  57. package/build/components/block-tools/empty-block-inserter.js +2 -2
  58. package/build/components/block-tools/empty-block-inserter.js.map +1 -1
  59. package/build/components/block-tools/index.js +20 -1
  60. package/build/components/block-tools/index.js.map +1 -1
  61. package/build/components/block-tools/insertion-point.js +4 -4
  62. package/build/components/block-tools/insertion-point.js.map +1 -1
  63. package/build/components/block-tools/zoom-out-mode-inserters.js +66 -22
  64. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  65. package/build/components/block-variation-picker/index.js +2 -2
  66. package/build/components/block-variation-picker/index.js.map +1 -1
  67. package/build/components/button-block-appender/index.js +2 -2
  68. package/build/components/button-block-appender/index.js.map +1 -1
  69. package/build/components/child-layout-control/index.js +2 -2
  70. package/build/components/child-layout-control/index.js.map +1 -1
  71. package/build/components/colors-gradients/control.js +3 -3
  72. package/build/components/colors-gradients/control.js.map +1 -1
  73. package/build/components/colors-gradients/dropdown.js +2 -2
  74. package/build/components/colors-gradients/dropdown.js.map +1 -1
  75. package/build/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  76. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  77. package/build/components/convert-to-group-buttons/index.js +6 -0
  78. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  79. package/build/components/default-block-appender/index.js +2 -2
  80. package/build/components/default-block-appender/index.js.map +1 -1
  81. package/build/components/dimensions-tool/aspect-ratio-tool.js +30 -36
  82. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  83. package/build/components/global-styles/background-panel.js +3 -3
  84. package/build/components/global-styles/background-panel.js.map +1 -1
  85. package/build/components/global-styles/color-panel.js +3 -3
  86. package/build/components/global-styles/color-panel.js.map +1 -1
  87. package/build/components/global-styles/dimensions-panel.js +4 -4
  88. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  89. package/build/components/global-styles/filters-panel.js +2 -2
  90. package/build/components/global-styles/filters-panel.js.map +1 -1
  91. package/build/components/global-styles/shadow-panel-components.js +4 -4
  92. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  93. package/build/components/global-styles/use-global-styles-output.js +1 -1
  94. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  95. package/build/components/grid-visualizer/grid-item-resizer.js +141 -24
  96. package/build/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  97. package/build/components/grid-visualizer/grid-visualizer.js +11 -5
  98. package/build/components/grid-visualizer/grid-visualizer.js.map +1 -1
  99. package/build/components/iframe/index.js +69 -30
  100. package/build/components/iframe/index.js.map +1 -1
  101. package/build/components/image-editor/aspect-ratio-dropdown.js +53 -36
  102. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  103. package/build/components/image-editor/cropper.js +2 -2
  104. package/build/components/image-editor/cropper.js.map +1 -1
  105. package/build/components/image-editor/index.js +1 -1
  106. package/build/components/image-editor/index.js.map +1 -1
  107. package/build/components/index.js +8 -0
  108. package/build/components/index.js.map +1 -1
  109. package/build/components/inner-blocks/button-block-appender.js +2 -2
  110. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  111. package/build/components/inner-blocks/index.js +22 -21
  112. package/build/components/inner-blocks/index.js.map +1 -1
  113. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  114. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  115. package/build/components/inserter/block-patterns-tab/index.js +9 -0
  116. package/build/components/inserter/block-patterns-tab/index.js.map +1 -1
  117. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
  118. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  119. package/build/components/inserter/block-types-tab.js +5 -3
  120. package/build/components/inserter/block-types-tab.js.map +1 -1
  121. package/build/components/inserter/hooks/use-insertion-point.js +11 -2
  122. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  123. package/build/components/inserter/hooks/use-patterns-state.js +12 -5
  124. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  125. package/build/components/inserter/index.js +2 -2
  126. package/build/components/inserter/index.js.map +1 -1
  127. package/build/components/inserter/library.js +8 -2
  128. package/build/components/inserter/library.js.map +1 -1
  129. package/build/components/inserter/media-tab/media-preview.js +2 -2
  130. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  131. package/build/components/inserter/menu.js +72 -56
  132. package/build/components/inserter/menu.js.map +1 -1
  133. package/build/components/inserter/quick-inserter.js +2 -2
  134. package/build/components/inserter/quick-inserter.js.map +1 -1
  135. package/build/components/inserter/tabs.js +17 -5
  136. package/build/components/inserter/tabs.js.map +1 -1
  137. package/build/components/inserter-list-item/index.js +3 -3
  138. package/build/components/inserter-list-item/index.js.map +1 -1
  139. package/build/components/keyboard-shortcuts/index.js +9 -0
  140. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  141. package/build/components/link-control/index.js +2 -2
  142. package/build/components/link-control/index.js.map +1 -1
  143. package/build/components/link-control/link-preview.js +3 -3
  144. package/build/components/link-control/link-preview.js.map +1 -1
  145. package/build/components/link-control/search-results.js +2 -2
  146. package/build/components/link-control/search-results.js.map +1 -1
  147. package/build/components/list-view/block-contents.js +2 -2
  148. package/build/components/list-view/block-contents.js.map +1 -1
  149. package/build/components/list-view/block-select-button.js +11 -3
  150. package/build/components/list-view/block-select-button.js.map +1 -1
  151. package/build/components/list-view/block.js +35 -12
  152. package/build/components/list-view/block.js.map +1 -1
  153. package/build/components/list-view/drop-indicator.js +3 -3
  154. package/build/components/list-view/drop-indicator.js.map +1 -1
  155. package/build/components/list-view/index.js +2 -2
  156. package/build/components/list-view/index.js.map +1 -1
  157. package/build/components/list-view/leaf.js +2 -2
  158. package/build/components/list-view/leaf.js.map +1 -1
  159. package/build/components/media-placeholder/index.js +4 -4
  160. package/build/components/media-placeholder/index.js.map +1 -1
  161. package/build/components/media-replace-flow/index.js +2 -2
  162. package/build/components/media-replace-flow/index.js.map +1 -1
  163. package/build/components/plain-text/index.js +2 -2
  164. package/build/components/plain-text/index.js.map +1 -1
  165. package/build/components/provider/use-block-sync.js +18 -0
  166. package/build/components/provider/use-block-sync.js.map +1 -1
  167. package/build/components/responsive-block-control/index.js +2 -2
  168. package/build/components/responsive-block-control/index.js.map +1 -1
  169. package/build/components/rich-text/event-listeners/enter.js +33 -42
  170. package/build/components/rich-text/event-listeners/enter.js.map +1 -1
  171. package/build/components/rich-text/event-listeners/paste-handler.js +22 -42
  172. package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  173. package/build/components/rich-text/format-toolbar/index.js +2 -2
  174. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  175. package/build/components/rich-text/index.js +9 -2
  176. package/build/components/rich-text/index.js.map +1 -1
  177. package/build/components/rich-text/index.native.js +2 -2
  178. package/build/components/rich-text/index.native.js.map +1 -1
  179. package/build/components/rich-text/multiline.js +30 -2
  180. package/build/components/rich-text/multiline.js.map +1 -1
  181. package/build/components/segmented-text-control/index.js +2 -2
  182. package/build/components/segmented-text-control/index.js.map +1 -1
  183. package/build/components/text-alignment-control/index.js +2 -2
  184. package/build/components/text-alignment-control/index.js.map +1 -1
  185. package/build/components/text-decoration-control/index.js +2 -2
  186. package/build/components/text-decoration-control/index.js.map +1 -1
  187. package/build/components/text-transform-control/index.js +2 -2
  188. package/build/components/text-transform-control/index.js.map +1 -1
  189. package/build/components/url-input/index.js +4 -4
  190. package/build/components/url-input/index.js.map +1 -1
  191. package/build/components/url-popover/link-editor.js +2 -2
  192. package/build/components/url-popover/link-editor.js.map +1 -1
  193. package/build/components/url-popover/link-viewer-url.js +2 -2
  194. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  195. package/build/components/url-popover/link-viewer.js +2 -2
  196. package/build/components/url-popover/link-viewer.js.map +1 -1
  197. package/build/components/warning/index.js +2 -2
  198. package/build/components/warning/index.js.map +1 -1
  199. package/build/components/writing-flow/index.js +2 -2
  200. package/build/components/writing-flow/index.js.map +1 -1
  201. package/build/components/writing-flow/use-clipboard-handler.js +77 -30
  202. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  203. package/build/components/writing-flow/use-input.js +44 -2
  204. package/build/components/writing-flow/use-input.js.map +1 -1
  205. package/build/components/writing-flow/use-tab-nav.js +6 -1
  206. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  207. package/build/components/writing-mode-control/index.js +2 -2
  208. package/build/components/writing-mode-control/index.js.map +1 -1
  209. package/build/hooks/align.js +2 -2
  210. package/build/hooks/align.js.map +1 -1
  211. package/build/hooks/background.js +1 -1
  212. package/build/hooks/background.js.map +1 -1
  213. package/build/hooks/border.js +3 -3
  214. package/build/hooks/border.js.map +1 -1
  215. package/build/hooks/color.js +3 -3
  216. package/build/hooks/color.js.map +1 -1
  217. package/build/hooks/content-lock-ui.js +5 -28
  218. package/build/hooks/content-lock-ui.js.map +1 -1
  219. package/build/hooks/custom-class-name.js +2 -2
  220. package/build/hooks/custom-class-name.js.map +1 -1
  221. package/build/hooks/custom-class-name.native.js +2 -2
  222. package/build/hooks/custom-class-name.native.js.map +1 -1
  223. package/build/hooks/dimensions.js +2 -2
  224. package/build/hooks/dimensions.js.map +1 -1
  225. package/build/hooks/layout-child.js +16 -8
  226. package/build/hooks/layout-child.js.map +1 -1
  227. package/build/hooks/layout.js +2 -2
  228. package/build/hooks/layout.js.map +1 -1
  229. package/build/hooks/position.js +2 -2
  230. package/build/hooks/position.js.map +1 -1
  231. package/build/hooks/text-align.js +3 -3
  232. package/build/hooks/text-align.js.map +1 -1
  233. package/build/hooks/use-bindings-attributes.js +39 -13
  234. package/build/hooks/use-bindings-attributes.js.map +1 -1
  235. package/build/hooks/use-color-props.js +2 -2
  236. package/build/hooks/use-color-props.js.map +1 -1
  237. package/build/hooks/use-typography-props.js +2 -2
  238. package/build/hooks/use-typography-props.js.map +1 -1
  239. package/build/hooks/utils.js +2 -2
  240. package/build/hooks/utils.js.map +1 -1
  241. package/build/layouts/grid.js +7 -6
  242. package/build/layouts/grid.js.map +1 -1
  243. package/build/private-apis.js +4 -1
  244. package/build/private-apis.js.map +1 -1
  245. package/build/store/actions.js +134 -40
  246. package/build/store/actions.js.map +1 -1
  247. package/build/store/private-actions.js +26 -1
  248. package/build/store/private-actions.js.map +1 -1
  249. package/build/store/private-keys.js +2 -1
  250. package/build/store/private-keys.js.map +1 -1
  251. package/build/store/private-selectors.js +6 -0
  252. package/build/store/private-selectors.js.map +1 -1
  253. package/build/store/selectors.js +4 -1
  254. package/build/store/selectors.js.map +1 -1
  255. package/build/utils/selection.js +8 -0
  256. package/build/utils/selection.js.map +1 -1
  257. package/build/utils/transform-styles/index.js +12 -7
  258. package/build/utils/transform-styles/index.js.map +1 -1
  259. package/build-module/components/block-actions/index.js +4 -2
  260. package/build-module/components/block-actions/index.js.map +1 -1
  261. package/build-module/components/block-alignment-control/ui.js +2 -2
  262. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  263. package/build-module/components/block-card/index.js +2 -2
  264. package/build-module/components/block-card/index.js.map +1 -1
  265. package/build-module/components/block-compare/index.js +2 -2
  266. package/build-module/components/block-compare/index.js.map +1 -1
  267. package/build-module/components/block-edit/edit.js +2 -2
  268. package/build-module/components/block-edit/edit.js.map +1 -1
  269. package/build-module/components/block-icon/index.js +2 -2
  270. package/build-module/components/block-icon/index.js.map +1 -1
  271. package/build-module/components/block-inspector/index.js +1 -1
  272. package/build-module/components/block-inspector/index.js.map +1 -1
  273. package/build-module/components/block-list/block.js +4 -4
  274. package/build-module/components/block-list/block.js.map +1 -1
  275. package/build-module/components/block-list/block.native.js +2 -2
  276. package/build-module/components/block-list/block.native.js.map +1 -1
  277. package/build-module/components/block-list/index.js +2 -2
  278. package/build-module/components/block-list/index.js.map +1 -1
  279. package/build-module/components/block-list/use-block-props/index.js +5 -2
  280. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  281. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js +37 -0
  282. package/build-module/components/block-list/use-block-props/use-scroll-into-view.js.map +1 -0
  283. package/build-module/components/block-list-appender/index.js +2 -2
  284. package/build-module/components/block-list-appender/index.js.map +1 -1
  285. package/build-module/components/block-mover/button.js +2 -2
  286. package/build-module/components/block-mover/button.js.map +1 -1
  287. package/build-module/components/block-mover/index.js +2 -2
  288. package/build-module/components/block-mover/index.js.map +1 -1
  289. package/build-module/components/block-patterns-list/index.js +27 -6
  290. package/build-module/components/block-patterns-list/index.js.map +1 -1
  291. package/build-module/components/block-popover/cover.js +9 -5
  292. package/build-module/components/block-popover/cover.js.map +1 -1
  293. package/build-module/components/block-popover/inbetween.js +2 -2
  294. package/build-module/components/block-popover/inbetween.js.map +1 -1
  295. package/build-module/components/block-popover/index.js +21 -3
  296. package/build-module/components/block-popover/index.js.map +1 -1
  297. package/build-module/components/block-preview/index.js +2 -2
  298. package/build-module/components/block-preview/index.js.map +1 -1
  299. package/build-module/components/block-settings-menu/block-settings-dropdown.js +8 -5
  300. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  301. package/build-module/components/block-settings-menu-controls/index.js +10 -7
  302. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  303. package/build-module/components/block-styles/index.js +2 -2
  304. package/build-module/components/block-styles/index.js.map +1 -1
  305. package/build-module/components/block-toolbar/index.js +3 -3
  306. package/build-module/components/block-toolbar/index.js.map +1 -1
  307. package/build-module/components/block-tools/block-selection-button.js +2 -2
  308. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  309. package/build-module/components/block-tools/block-toolbar-breadcrumb.js +4 -4
  310. package/build-module/components/block-tools/block-toolbar-breadcrumb.js.map +1 -1
  311. package/build-module/components/block-tools/block-toolbar-popover.js +2 -2
  312. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
  313. package/build-module/components/block-tools/empty-block-inserter.js +2 -2
  314. package/build-module/components/block-tools/empty-block-inserter.js.map +1 -1
  315. package/build-module/components/block-tools/index.js +20 -1
  316. package/build-module/components/block-tools/index.js.map +1 -1
  317. package/build-module/components/block-tools/insertion-point.js +4 -4
  318. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  319. package/build-module/components/block-tools/zoom-out-mode-inserters.js +67 -23
  320. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  321. package/build-module/components/block-variation-picker/index.js +2 -2
  322. package/build-module/components/block-variation-picker/index.js.map +1 -1
  323. package/build-module/components/button-block-appender/index.js +2 -2
  324. package/build-module/components/button-block-appender/index.js.map +1 -1
  325. package/build-module/components/child-layout-control/index.js +2 -2
  326. package/build-module/components/child-layout-control/index.js.map +1 -1
  327. package/build-module/components/colors-gradients/control.js +3 -3
  328. package/build-module/components/colors-gradients/control.js.map +1 -1
  329. package/build-module/components/colors-gradients/dropdown.js +2 -2
  330. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  331. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  332. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  333. package/build-module/components/convert-to-group-buttons/index.js +7 -1
  334. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  335. package/build-module/components/default-block-appender/index.js +2 -2
  336. package/build-module/components/default-block-appender/index.js.map +1 -1
  337. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +30 -36
  338. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -1
  339. package/build-module/components/global-styles/background-panel.js +3 -3
  340. package/build-module/components/global-styles/background-panel.js.map +1 -1
  341. package/build-module/components/global-styles/color-panel.js +3 -3
  342. package/build-module/components/global-styles/color-panel.js.map +1 -1
  343. package/build-module/components/global-styles/dimensions-panel.js +4 -4
  344. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  345. package/build-module/components/global-styles/filters-panel.js +2 -2
  346. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  347. package/build-module/components/global-styles/shadow-panel-components.js +4 -4
  348. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  349. package/build-module/components/global-styles/use-global-styles-output.js +1 -1
  350. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  351. package/build-module/components/grid-visualizer/grid-item-resizer.js +141 -24
  352. package/build-module/components/grid-visualizer/grid-item-resizer.js.map +1 -1
  353. package/build-module/components/grid-visualizer/grid-visualizer.js +12 -6
  354. package/build-module/components/grid-visualizer/grid-visualizer.js.map +1 -1
  355. package/build-module/components/iframe/index.js +70 -31
  356. package/build-module/components/iframe/index.js.map +1 -1
  357. package/build-module/components/image-editor/aspect-ratio-dropdown.js +52 -36
  358. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  359. package/build-module/components/image-editor/cropper.js +2 -2
  360. package/build-module/components/image-editor/cropper.js.map +1 -1
  361. package/build-module/components/image-editor/index.js +1 -1
  362. package/build-module/components/image-editor/index.js.map +1 -1
  363. package/build-module/components/index.js +1 -0
  364. package/build-module/components/index.js.map +1 -1
  365. package/build-module/components/inner-blocks/button-block-appender.js +2 -2
  366. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  367. package/build-module/components/inner-blocks/index.js +22 -21
  368. package/build-module/components/inner-blocks/index.js.map +1 -1
  369. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  370. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  371. package/build-module/components/inserter/block-patterns-tab/index.js +10 -1
  372. package/build-module/components/inserter/block-patterns-tab/index.js.map +1 -1
  373. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -1
  374. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  375. package/build-module/components/inserter/block-types-tab.js +6 -4
  376. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  377. package/build-module/components/inserter/hooks/use-insertion-point.js +11 -2
  378. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  379. package/build-module/components/inserter/hooks/use-patterns-state.js +12 -5
  380. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  381. package/build-module/components/inserter/index.js +2 -2
  382. package/build-module/components/inserter/index.js.map +1 -1
  383. package/build-module/components/inserter/library.js +8 -2
  384. package/build-module/components/inserter/library.js.map +1 -1
  385. package/build-module/components/inserter/media-tab/media-preview.js +2 -2
  386. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  387. package/build-module/components/inserter/menu.js +72 -56
  388. package/build-module/components/inserter/menu.js.map +1 -1
  389. package/build-module/components/inserter/quick-inserter.js +2 -2
  390. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  391. package/build-module/components/inserter/tabs.js +18 -6
  392. package/build-module/components/inserter/tabs.js.map +1 -1
  393. package/build-module/components/inserter-list-item/index.js +3 -3
  394. package/build-module/components/inserter-list-item/index.js.map +1 -1
  395. package/build-module/components/keyboard-shortcuts/index.js +9 -0
  396. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  397. package/build-module/components/link-control/index.js +2 -2
  398. package/build-module/components/link-control/index.js.map +1 -1
  399. package/build-module/components/link-control/link-preview.js +3 -3
  400. package/build-module/components/link-control/link-preview.js.map +1 -1
  401. package/build-module/components/link-control/search-results.js +2 -2
  402. package/build-module/components/link-control/search-results.js.map +1 -1
  403. package/build-module/components/list-view/block-contents.js +2 -2
  404. package/build-module/components/list-view/block-contents.js.map +1 -1
  405. package/build-module/components/list-view/block-select-button.js +11 -3
  406. package/build-module/components/list-view/block-select-button.js.map +1 -1
  407. package/build-module/components/list-view/block.js +36 -13
  408. package/build-module/components/list-view/block.js.map +1 -1
  409. package/build-module/components/list-view/drop-indicator.js +3 -3
  410. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  411. package/build-module/components/list-view/index.js +2 -2
  412. package/build-module/components/list-view/index.js.map +1 -1
  413. package/build-module/components/list-view/leaf.js +2 -2
  414. package/build-module/components/list-view/leaf.js.map +1 -1
  415. package/build-module/components/media-placeholder/index.js +4 -4
  416. package/build-module/components/media-placeholder/index.js.map +1 -1
  417. package/build-module/components/media-replace-flow/index.js +2 -2
  418. package/build-module/components/media-replace-flow/index.js.map +1 -1
  419. package/build-module/components/plain-text/index.js +2 -2
  420. package/build-module/components/plain-text/index.js.map +1 -1
  421. package/build-module/components/provider/use-block-sync.js +19 -1
  422. package/build-module/components/provider/use-block-sync.js.map +1 -1
  423. package/build-module/components/responsive-block-control/index.js +2 -2
  424. package/build-module/components/responsive-block-control/index.js.map +1 -1
  425. package/build-module/components/rich-text/event-listeners/enter.js +33 -43
  426. package/build-module/components/rich-text/event-listeners/enter.js.map +1 -1
  427. package/build-module/components/rich-text/event-listeners/paste-handler.js +23 -43
  428. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  429. package/build-module/components/rich-text/format-toolbar/index.js +2 -2
  430. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  431. package/build-module/components/rich-text/index.js +9 -2
  432. package/build-module/components/rich-text/index.js.map +1 -1
  433. package/build-module/components/rich-text/index.native.js +2 -2
  434. package/build-module/components/rich-text/index.native.js.map +1 -1
  435. package/build-module/components/rich-text/multiline.js +31 -3
  436. package/build-module/components/rich-text/multiline.js.map +1 -1
  437. package/build-module/components/segmented-text-control/index.js +2 -2
  438. package/build-module/components/segmented-text-control/index.js.map +1 -1
  439. package/build-module/components/text-alignment-control/index.js +2 -2
  440. package/build-module/components/text-alignment-control/index.js.map +1 -1
  441. package/build-module/components/text-decoration-control/index.js +2 -2
  442. package/build-module/components/text-decoration-control/index.js.map +1 -1
  443. package/build-module/components/text-transform-control/index.js +2 -2
  444. package/build-module/components/text-transform-control/index.js.map +1 -1
  445. package/build-module/components/url-input/index.js +4 -4
  446. package/build-module/components/url-input/index.js.map +1 -1
  447. package/build-module/components/url-popover/link-editor.js +2 -2
  448. package/build-module/components/url-popover/link-editor.js.map +1 -1
  449. package/build-module/components/url-popover/link-viewer-url.js +2 -2
  450. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  451. package/build-module/components/url-popover/link-viewer.js +2 -2
  452. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  453. package/build-module/components/warning/index.js +2 -2
  454. package/build-module/components/warning/index.js.map +1 -1
  455. package/build-module/components/writing-flow/index.js +2 -2
  456. package/build-module/components/writing-flow/index.js.map +1 -1
  457. package/build-module/components/writing-flow/use-clipboard-handler.js +78 -31
  458. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  459. package/build-module/components/writing-flow/use-input.js +45 -3
  460. package/build-module/components/writing-flow/use-input.js.map +1 -1
  461. package/build-module/components/writing-flow/use-tab-nav.js +6 -1
  462. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  463. package/build-module/components/writing-mode-control/index.js +2 -2
  464. package/build-module/components/writing-mode-control/index.js.map +1 -1
  465. package/build-module/hooks/align.js +2 -2
  466. package/build-module/hooks/align.js.map +1 -1
  467. package/build-module/hooks/background.js +1 -1
  468. package/build-module/hooks/background.js.map +1 -1
  469. package/build-module/hooks/border.js +3 -3
  470. package/build-module/hooks/border.js.map +1 -1
  471. package/build-module/hooks/color.js +3 -3
  472. package/build-module/hooks/color.js.map +1 -1
  473. package/build-module/hooks/content-lock-ui.js +5 -28
  474. package/build-module/hooks/content-lock-ui.js.map +1 -1
  475. package/build-module/hooks/custom-class-name.js +2 -2
  476. package/build-module/hooks/custom-class-name.js.map +1 -1
  477. package/build-module/hooks/custom-class-name.native.js +2 -2
  478. package/build-module/hooks/custom-class-name.native.js.map +1 -1
  479. package/build-module/hooks/dimensions.js +2 -2
  480. package/build-module/hooks/dimensions.js.map +1 -1
  481. package/build-module/hooks/layout-child.js +16 -8
  482. package/build-module/hooks/layout-child.js.map +1 -1
  483. package/build-module/hooks/layout.js +2 -2
  484. package/build-module/hooks/layout.js.map +1 -1
  485. package/build-module/hooks/position.js +2 -2
  486. package/build-module/hooks/position.js.map +1 -1
  487. package/build-module/hooks/text-align.js +3 -3
  488. package/build-module/hooks/text-align.js.map +1 -1
  489. package/build-module/hooks/use-bindings-attributes.js +39 -13
  490. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  491. package/build-module/hooks/use-color-props.js +2 -2
  492. package/build-module/hooks/use-color-props.js.map +1 -1
  493. package/build-module/hooks/use-typography-props.js +2 -2
  494. package/build-module/hooks/use-typography-props.js.map +1 -1
  495. package/build-module/hooks/utils.js +2 -2
  496. package/build-module/hooks/utils.js.map +1 -1
  497. package/build-module/layouts/grid.js +7 -6
  498. package/build-module/layouts/grid.js.map +1 -1
  499. package/build-module/private-apis.js +5 -2
  500. package/build-module/private-apis.js.map +1 -1
  501. package/build-module/store/actions.js +136 -42
  502. package/build-module/store/actions.js.map +1 -1
  503. package/build-module/store/private-actions.js +24 -0
  504. package/build-module/store/private-actions.js.map +1 -1
  505. package/build-module/store/private-keys.js +1 -0
  506. package/build-module/store/private-keys.js.map +1 -1
  507. package/build-module/store/private-selectors.js +5 -0
  508. package/build-module/store/private-selectors.js.map +1 -1
  509. package/build-module/store/selectors.js +4 -1
  510. package/build-module/store/selectors.js.map +1 -1
  511. package/build-module/utils/selection.js +7 -0
  512. package/build-module/utils/selection.js.map +1 -1
  513. package/build-module/utils/transform-styles/index.js +12 -7
  514. package/build-module/utils/transform-styles/index.js.map +1 -1
  515. package/build-style/content-rtl.css +89 -96
  516. package/build-style/content.css +89 -96
  517. package/build-style/style-rtl.css +14 -4
  518. package/build-style/style.css +14 -4
  519. package/build-types/components/block-context/index.d.ts +1 -1
  520. package/build-types/components/block-context/index.d.ts.map +1 -1
  521. package/package.json +32 -32
  522. package/src/components/block-actions/index.js +5 -1
  523. package/src/components/block-alignment-control/ui.js +2 -2
  524. package/src/components/block-card/index.js +2 -2
  525. package/src/components/block-compare/index.js +2 -2
  526. package/src/components/block-content-overlay/content.scss +4 -37
  527. package/src/components/block-draggable/test/helpers.native.js +8 -8
  528. package/src/components/block-edit/edit.js +2 -2
  529. package/src/components/block-icon/index.js +2 -2
  530. package/src/components/block-inspector/index.js +2 -1
  531. package/src/components/block-list/block.js +4 -4
  532. package/src/components/block-list/block.native.js +2 -2
  533. package/src/components/block-list/content.scss +46 -73
  534. package/src/components/block-list/index.js +2 -2
  535. package/src/components/block-list/use-block-props/index.js +4 -2
  536. package/src/components/block-list/use-block-props/use-scroll-into-view.js +38 -0
  537. package/src/components/block-list-appender/index.js +2 -2
  538. package/src/components/block-mover/button.js +2 -2
  539. package/src/components/block-mover/index.js +2 -2
  540. package/src/components/block-patterns-list/index.js +29 -4
  541. package/src/components/block-popover/README.md +1 -1
  542. package/src/components/block-popover/cover.js +22 -7
  543. package/src/components/block-popover/inbetween.js +2 -2
  544. package/src/components/block-popover/index.js +24 -6
  545. package/src/components/block-preview/index.js +2 -2
  546. package/src/components/block-settings-menu/block-settings-dropdown.js +14 -6
  547. package/src/components/block-settings-menu-controls/index.js +25 -16
  548. package/src/components/block-styles/index.js +2 -2
  549. package/src/components/block-toolbar/index.js +3 -3
  550. package/src/components/block-tools/block-selection-button.js +2 -2
  551. package/src/components/block-tools/block-toolbar-breadcrumb.js +5 -5
  552. package/src/components/block-tools/block-toolbar-popover.js +4 -7
  553. package/src/components/block-tools/empty-block-inserter.js +2 -2
  554. package/src/components/block-tools/index.js +24 -3
  555. package/src/components/block-tools/insertion-point.js +4 -4
  556. package/src/components/block-tools/style.scss +8 -0
  557. package/src/components/block-tools/zoom-out-mode-inserters.js +73 -21
  558. package/src/components/block-variation-picker/index.js +2 -2
  559. package/src/components/button-block-appender/index.js +2 -2
  560. package/src/components/child-layout-control/index.js +14 -2
  561. package/src/components/colors-gradients/control.js +3 -3
  562. package/src/components/colors-gradients/dropdown.js +2 -2
  563. package/src/components/colors-gradients/panel-color-gradient-settings.js +2 -2
  564. package/src/components/colors-gradients/test/control.js +3 -3
  565. package/src/components/convert-to-group-buttons/index.js +10 -1
  566. package/src/components/default-block-appender/index.js +2 -2
  567. package/src/components/dimensions-tool/aspect-ratio-tool.js +40 -67
  568. package/src/components/dimensions-tool/test/index.js +10 -0
  569. package/src/components/editable-text/README.md +0 -4
  570. package/src/components/global-styles/background-panel.js +3 -3
  571. package/src/components/global-styles/color-panel.js +3 -3
  572. package/src/components/global-styles/dimensions-panel.js +4 -4
  573. package/src/components/global-styles/filters-panel.js +2 -2
  574. package/src/components/global-styles/shadow-panel-components.js +6 -9
  575. package/src/components/global-styles/test/get-global-styles-changes.js +0 -2
  576. package/src/components/global-styles/test/use-global-styles-output.js +5 -5
  577. package/src/components/global-styles/use-global-styles-output.js +1 -1
  578. package/src/components/grid-visualizer/grid-item-resizer.js +169 -40
  579. package/src/components/grid-visualizer/grid-visualizer.js +19 -6
  580. package/src/components/iframe/content.scss +63 -0
  581. package/src/components/iframe/index.js +119 -39
  582. package/src/components/image-editor/aspect-ratio-dropdown.js +91 -59
  583. package/src/components/image-editor/cropper.js +2 -2
  584. package/src/components/image-editor/index.js +1 -1
  585. package/src/components/image-editor/test/index.js +22 -0
  586. package/src/components/index.js +1 -0
  587. package/src/components/inner-blocks/button-block-appender.js +2 -2
  588. package/src/components/inner-blocks/index.js +19 -17
  589. package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -1
  590. package/src/components/inserter/block-patterns-tab/index.js +17 -1
  591. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +2 -1
  592. package/src/components/inserter/block-types-tab.js +7 -9
  593. package/src/components/inserter/hooks/use-insertion-point.js +15 -1
  594. package/src/components/inserter/hooks/use-patterns-state.js +18 -5
  595. package/src/components/inserter/index.js +4 -5
  596. package/src/components/inserter/library.js +6 -0
  597. package/src/components/inserter/media-tab/media-preview.js +2 -2
  598. package/src/components/inserter/menu.js +113 -107
  599. package/src/components/inserter/quick-inserter.js +2 -2
  600. package/src/components/inserter/style.scss +6 -8
  601. package/src/components/inserter/tabs.js +29 -15
  602. package/src/components/inserter-list-item/index.js +3 -3
  603. package/src/components/keyboard-shortcuts/index.js +12 -0
  604. package/src/components/line-height-control/test/index.js +16 -14
  605. package/src/components/link-control/index.js +2 -2
  606. package/src/components/link-control/link-preview.js +3 -3
  607. package/src/components/link-control/search-results.js +2 -2
  608. package/src/components/list-view/block-contents.js +2 -2
  609. package/src/components/list-view/block-select-button.js +14 -3
  610. package/src/components/list-view/block.js +54 -30
  611. package/src/components/list-view/drop-indicator.js +3 -3
  612. package/src/components/list-view/index.js +2 -2
  613. package/src/components/list-view/leaf.js +2 -5
  614. package/src/components/media-placeholder/index.js +4 -4
  615. package/src/components/media-replace-flow/index.js +2 -2
  616. package/src/components/plain-text/index.js +2 -2
  617. package/src/components/provider/use-block-sync.js +27 -1
  618. package/src/components/responsive-block-control/index.js +2 -2
  619. package/src/components/rich-text/README.md +0 -8
  620. package/src/components/rich-text/event-listeners/enter.js +28 -48
  621. package/src/components/rich-text/event-listeners/paste-handler.js +21 -58
  622. package/src/components/rich-text/format-toolbar/index.js +2 -2
  623. package/src/components/rich-text/index.js +10 -3
  624. package/src/components/rich-text/index.native.js +2 -2
  625. package/src/components/rich-text/multiline.js +31 -3
  626. package/src/components/segmented-text-control/index.js +2 -2
  627. package/src/components/text-alignment-control/index.js +2 -2
  628. package/src/components/text-decoration-control/index.js +2 -2
  629. package/src/components/text-transform-control/index.js +2 -2
  630. package/src/components/url-input/index.js +4 -4
  631. package/src/components/url-popover/link-editor.js +2 -2
  632. package/src/components/url-popover/link-viewer-url.js +2 -2
  633. package/src/components/url-popover/link-viewer.js +2 -2
  634. package/src/components/warning/index.js +2 -2
  635. package/src/components/writing-flow/index.js +2 -2
  636. package/src/components/writing-flow/use-clipboard-handler.js +107 -47
  637. package/src/components/writing-flow/use-input.js +75 -1
  638. package/src/components/writing-flow/use-tab-nav.js +10 -1
  639. package/src/components/writing-mode-control/index.js +2 -5
  640. package/src/content.scss +1 -0
  641. package/src/hooks/align.js +2 -2
  642. package/src/hooks/background.js +1 -1
  643. package/src/hooks/border.js +3 -3
  644. package/src/hooks/color.js +12 -19
  645. package/src/hooks/color.scss +1 -0
  646. package/src/hooks/content-lock-ui.js +16 -33
  647. package/src/hooks/custom-class-name.js +2 -2
  648. package/src/hooks/custom-class-name.native.js +2 -2
  649. package/src/hooks/dimensions.js +2 -2
  650. package/src/hooks/layout-child.js +34 -20
  651. package/src/hooks/layout.js +2 -2
  652. package/src/hooks/position.js +2 -2
  653. package/src/hooks/text-align.js +3 -3
  654. package/src/hooks/use-bindings-attributes.js +48 -16
  655. package/src/hooks/use-color-props.js +2 -2
  656. package/src/hooks/use-typography-props.js +2 -2
  657. package/src/hooks/utils.js +2 -2
  658. package/src/layouts/grid.js +3 -7
  659. package/src/private-apis.js +4 -0
  660. package/src/store/actions.js +225 -70
  661. package/src/store/private-actions.js +24 -0
  662. package/src/store/private-keys.js +1 -0
  663. package/src/store/private-selectors.js +15 -0
  664. package/src/store/selectors.js +4 -2
  665. package/src/utils/selection.js +8 -0
  666. package/src/utils/test/__snapshots__/transform-styles.js.snap +6 -0
  667. package/src/utils/test/transform-styles.js +14 -0
  668. package/src/utils/transform-styles/index.js +12 -9
  669. package/tsconfig.tsbuildinfo +1 -1
  670. package/build/components/rich-text/split-value.js +0 -81
  671. package/build/components/rich-text/split-value.js.map +0 -1
  672. package/build-module/components/rich-text/split-value.js +0 -75
  673. package/build-module/components/rich-text/split-value.js.map +0 -1
  674. package/src/components/rich-text/split-value.js +0 -64
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = ListViewDropIndicatorPreview;
8
8
  var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _clsx = _interopRequireDefault(require("clsx"));
10
10
  var _components = require("@wordpress/components");
11
11
  var _dom = require("@wordpress/dom");
12
12
  var _element = require("@wordpress/element");
@@ -221,14 +221,14 @@ function ListViewDropIndicatorPreview({
221
221
  resize: true
222
222
  }, (0, _react.createElement)("div", {
223
223
  style: style,
224
- className: (0, _classnames.default)('block-editor-list-view-drop-indicator__line', {
224
+ className: (0, _clsx.default)('block-editor-list-view-drop-indicator__line', {
225
225
  'block-editor-list-view-drop-indicator__line--darker': hasAdjacentSelectedBranch
226
226
  })
227
227
  }, (0, _react.createElement)("div", {
228
228
  className: "block-editor-list-view-leaf",
229
229
  "aria-level": ariaLevel
230
230
  }, (0, _react.createElement)("div", {
231
- className: (0, _classnames.default)('block-editor-list-view-block-select-button', 'block-editor-list-view-block-contents'),
231
+ className: (0, _clsx.default)('block-editor-list-view-block-select-button', 'block-editor-list-view-block-contents'),
232
232
  style: horizontalScrollOffsetStyle
233
233
  }, (0, _react.createElement)(_expander.default, {
234
234
  onClick: () => {}
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_dom","_element","_i18n","_blockIcon","_useBlockDisplayInformation","_useBlockDisplayTitle","_expander","ListViewDropIndicatorPreview","draggedBlockClientId","listViewRef","blockDropTarget","blockInformation","useBlockDisplayInformation","blockTitle","useBlockDisplayTitle","clientId","context","rootClientId","dropPosition","rootBlockElement","blockElement","useMemo","current","_rootBlockElement","querySelector","undefined","_blockElement","targetElement","rtl","isRTL","getDropIndicatorWidth","useCallback","targetElementRect","indent","width","offsetWidth","scrollContainer","getScrollContainer","ownerDocument","windowScroll","body","documentElement","scrollContainerRect","getBoundingClientRect","distanceBetweenContainerAndTarget","right","left","scrollContainerWidth","clientWidth","style","horizontalScrollOffsetStyle","transform","ariaLevel","_ariaLevel","parseInt","getAttribute","hasAdjacentSelectedBranch","classList","contains","popoverAnchor","isValidDropPosition","contextElement","rect","top","doc","scrollbarWidth","height","window","DOMRect","_react","createElement","Popover","animate","anchor","focusOnMount","className","variant","flip","resize","classnames","default","onClick","icon","showColors","__experimentalHStack","alignment","justify","spacing","__experimentalTruncate","ellipsizeMode"],"sources":["@wordpress/block-editor/src/components/list-view/drop-indicator.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tPopover,\n} from '@wordpress/components';\n\nimport { getScrollContainer } from '@wordpress/dom';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport ListViewExpander from './expander';\n\nexport default function ListViewDropIndicatorPreview( {\n\tdraggedBlockClientId,\n\tlistViewRef,\n\tblockDropTarget,\n} ) {\n\tconst blockInformation = useBlockDisplayInformation( draggedBlockClientId );\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId: draggedBlockClientId,\n\t\tcontext: 'list-view',\n\t} );\n\n\tconst { rootClientId, clientId, dropPosition } = blockDropTarget || {};\n\n\tconst [ rootBlockElement, blockElement ] = useMemo( () => {\n\t\tif ( ! listViewRef.current ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// The rootClientId will be defined whenever dropping into inner\n\t\t// block lists, but is undefined when dropping at the root level.\n\t\tconst _rootBlockElement = rootClientId\n\t\t\t? listViewRef.current.querySelector(\n\t\t\t\t\t`[data-block=\"${ rootClientId }\"]`\n\t\t\t )\n\t\t\t: undefined;\n\n\t\t// The clientId represents the sibling block, the dragged block will\n\t\t// usually be inserted adjacent to it. It will be undefined when\n\t\t// dropping a block into an empty block list.\n\t\tconst _blockElement = clientId\n\t\t\t? listViewRef.current.querySelector(\n\t\t\t\t\t`[data-block=\"${ clientId }\"]`\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn [ _rootBlockElement, _blockElement ];\n\t}, [ listViewRef, rootClientId, clientId ] );\n\n\t// The targetElement is the element that the drop indicator will appear\n\t// before or after. When dropping into an empty block list, blockElement\n\t// is undefined, so the indicator will appear after the rootBlockElement.\n\tconst targetElement = blockElement || rootBlockElement;\n\n\tconst rtl = isRTL();\n\n\tconst getDropIndicatorWidth = useCallback(\n\t\t( targetElementRect, indent ) => {\n\t\t\tif ( ! targetElement ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\t// Default to assuming that the width of the drop indicator\n\t\t\t// should be the same as the target element.\n\t\t\tlet width = targetElement.offsetWidth;\n\n\t\t\t// In deeply nested lists, where a scrollbar is present,\n\t\t\t// the width of the drop indicator should be the width of\n\t\t\t// the scroll container, minus the distance from the left\n\t\t\t// edge of the scroll container to the left edge of the\n\t\t\t// target element.\n\t\t\tconst scrollContainer = getScrollContainer(\n\t\t\t\ttargetElement,\n\t\t\t\t'horizontal'\n\t\t\t);\n\n\t\t\tconst ownerDocument = targetElement.ownerDocument;\n\t\t\tconst windowScroll =\n\t\t\t\tscrollContainer === ownerDocument.body ||\n\t\t\t\tscrollContainer === ownerDocument.documentElement;\n\n\t\t\tif ( scrollContainer && ! windowScroll ) {\n\t\t\t\tconst scrollContainerRect =\n\t\t\t\t\tscrollContainer.getBoundingClientRect();\n\n\t\t\t\tconst distanceBetweenContainerAndTarget = isRTL()\n\t\t\t\t\t? scrollContainerRect.right - targetElementRect.right\n\t\t\t\t\t: targetElementRect.left - scrollContainerRect.left;\n\n\t\t\t\tconst scrollContainerWidth = scrollContainer.clientWidth;\n\n\t\t\t\tif (\n\t\t\t\t\tscrollContainerWidth <\n\t\t\t\t\twidth + distanceBetweenContainerAndTarget\n\t\t\t\t) {\n\t\t\t\t\twidth =\n\t\t\t\t\t\tscrollContainerWidth -\n\t\t\t\t\t\tdistanceBetweenContainerAndTarget;\n\t\t\t\t}\n\n\t\t\t\t// LTR logic for ensuring the drop indicator does not extend\n\t\t\t\t// beyond the right edge of the scroll container.\n\t\t\t\tif (\n\t\t\t\t\t! rtl &&\n\t\t\t\t\ttargetElementRect.left + indent < scrollContainerRect.left\n\t\t\t\t) {\n\t\t\t\t\twidth -= scrollContainerRect.left - targetElementRect.left;\n\t\t\t\t\treturn width;\n\t\t\t\t}\n\n\t\t\t\t// RTL logic for ensuring the drop indicator does not extend\n\t\t\t\t// beyond the right edge of the scroll container.\n\t\t\t\tif (\n\t\t\t\t\trtl &&\n\t\t\t\t\ttargetElementRect.right - indent > scrollContainerRect.right\n\t\t\t\t) {\n\t\t\t\t\twidth -=\n\t\t\t\t\t\ttargetElementRect.right - scrollContainerRect.right;\n\t\t\t\t\treturn width;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Subtract the indent from the final width of the indicator.\n\t\t\treturn width - indent;\n\t\t},\n\t\t[ rtl, targetElement ]\n\t);\n\n\tconst style = useMemo( () => {\n\t\tif ( ! targetElement ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst targetElementRect = targetElement.getBoundingClientRect();\n\n\t\treturn {\n\t\t\twidth: getDropIndicatorWidth( targetElementRect, 0 ),\n\t\t};\n\t}, [ getDropIndicatorWidth, targetElement ] );\n\n\tconst horizontalScrollOffsetStyle = useMemo( () => {\n\t\tif ( ! targetElement ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst scrollContainer = getScrollContainer( targetElement );\n\t\tconst ownerDocument = targetElement.ownerDocument;\n\t\tconst windowScroll =\n\t\t\tscrollContainer === ownerDocument.body ||\n\t\t\tscrollContainer === ownerDocument.documentElement;\n\n\t\tif ( scrollContainer && ! windowScroll ) {\n\t\t\tconst scrollContainerRect = scrollContainer.getBoundingClientRect();\n\t\t\tconst targetElementRect = targetElement.getBoundingClientRect();\n\n\t\t\tconst distanceBetweenContainerAndTarget = rtl\n\t\t\t\t? scrollContainerRect.right - targetElementRect.right\n\t\t\t\t: targetElementRect.left - scrollContainerRect.left;\n\n\t\t\tif ( ! rtl && scrollContainerRect.left > targetElementRect.left ) {\n\t\t\t\treturn {\n\t\t\t\t\ttransform: `translateX( ${ distanceBetweenContainerAndTarget }px )`,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( rtl && scrollContainerRect.right < targetElementRect.right ) {\n\t\t\t\treturn {\n\t\t\t\t\ttransform: `translateX( ${\n\t\t\t\t\t\tdistanceBetweenContainerAndTarget * -1\n\t\t\t\t\t}px )`,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {};\n\t}, [ rtl, targetElement ] );\n\n\tconst ariaLevel = useMemo( () => {\n\t\tif ( ! rootBlockElement ) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tconst _ariaLevel = parseInt(\n\t\t\trootBlockElement.getAttribute( 'aria-level' ),\n\t\t\t10\n\t\t);\n\n\t\treturn _ariaLevel ? _ariaLevel + 1 : 1;\n\t}, [ rootBlockElement ] );\n\n\tconst hasAdjacentSelectedBranch = useMemo( () => {\n\t\tif ( ! targetElement ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn targetElement.classList.contains( 'is-branch-selected' );\n\t}, [ targetElement ] );\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tconst isValidDropPosition =\n\t\t\tdropPosition === 'top' ||\n\t\t\tdropPosition === 'bottom' ||\n\t\t\tdropPosition === 'inside';\n\t\tif ( ! targetElement || ! isValidDropPosition ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tcontextElement: targetElement,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst rect = targetElement.getBoundingClientRect();\n\t\t\t\t// In RTL languages, the drop indicator should be positioned\n\t\t\t\t// to the left of the target element, with the width of the\n\t\t\t\t// indicator determining the indent at the right edge of the\n\t\t\t\t// target element. In LTR languages, the drop indicator should\n\t\t\t\t// end at the right edge of the target element, with the indent\n\t\t\t\t// added to the position of the left edge of the target element.\n\t\t\t\t// let left = rtl ? rect.left : rect.left + indent;\n\t\t\t\tlet left = rect.left;\n\t\t\t\tlet top = 0;\n\n\t\t\t\t// In deeply nested lists, where a scrollbar is present,\n\t\t\t\t// the width of the drop indicator should be the width of\n\t\t\t\t// the visible area of the scroll container. Additionally,\n\t\t\t\t// the left edge of the drop indicator line needs to be\n\t\t\t\t// offset by the distance the left edge of the target element\n\t\t\t\t// and the left edge of the scroll container. The ensures\n\t\t\t\t// that the drop indicator position never breaks out of the\n\t\t\t\t// visible area of the scroll container.\n\t\t\t\tconst scrollContainer = getScrollContainer(\n\t\t\t\t\ttargetElement,\n\t\t\t\t\t'horizontal'\n\t\t\t\t);\n\n\t\t\t\tconst doc = targetElement.ownerDocument;\n\t\t\t\tconst windowScroll =\n\t\t\t\t\tscrollContainer === doc.body ||\n\t\t\t\t\tscrollContainer === doc.documentElement;\n\n\t\t\t\t// If the scroll container is not the window, offset the left position, if need be.\n\t\t\t\tif ( scrollContainer && ! windowScroll ) {\n\t\t\t\t\tconst scrollContainerRect =\n\t\t\t\t\t\tscrollContainer.getBoundingClientRect();\n\n\t\t\t\t\t// In RTL languages, a vertical scrollbar is present on the\n\t\t\t\t\t// left edge of the scroll container. The width of the\n\t\t\t\t\t// scrollbar needs to be accounted for when positioning the\n\t\t\t\t\t// drop indicator.\n\t\t\t\t\tconst scrollbarWidth = rtl\n\t\t\t\t\t\t? scrollContainer.offsetWidth -\n\t\t\t\t\t\t scrollContainer.clientWidth\n\t\t\t\t\t\t: 0;\n\n\t\t\t\t\tif ( left < scrollContainerRect.left + scrollbarWidth ) {\n\t\t\t\t\t\tleft = scrollContainerRect.left + scrollbarWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( dropPosition === 'top' ) {\n\t\t\t\t\ttop = rect.top - rect.height * 2;\n\t\t\t\t} else {\n\t\t\t\t\t// `dropPosition` is either `bottom` or `inside`\n\t\t\t\t\ttop = rect.top;\n\t\t\t\t}\n\n\t\t\t\tconst width = getDropIndicatorWidth( rect, 0 );\n\t\t\t\tconst height = rect.height;\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t};\n\t}, [ targetElement, dropPosition, getDropIndicatorWidth, rtl ] );\n\n\tif ( ! targetElement ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tanimate={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\tfocusOnMount={ false }\n\t\t\tclassName=\"block-editor-list-view-drop-indicator--preview\"\n\t\t\tvariant=\"unstyled\"\n\t\t\tflip={ false }\n\t\t\tresize\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={ style }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-list-view-drop-indicator__line',\n\t\t\t\t\t{\n\t\t\t\t\t\t'block-editor-list-view-drop-indicator__line--darker':\n\t\t\t\t\t\t\thasAdjacentSelectedBranch,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"block-editor-list-view-leaf\"\n\t\t\t\t\taria-level={ ariaLevel }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\t\t\t\t'block-editor-list-view-block-contents'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ horizontalScrollOffsetStyle }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ListViewExpander onClick={ () => {} } />\n\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\ticon={ blockInformation?.icon }\n\t\t\t\t\t\t\tshowColors\n\t\t\t\t\t\t\tcontext=\"list-view\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\talignment=\"center\"\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">\n\t\t\t\t\t\t\t\t\t{ blockTitle }\n\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"block-editor-list-view-block__menu-cell\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Popover>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAMA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,2BAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,qBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,SAAA,GAAAT,sBAAA,CAAAC,OAAA;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAMe,SAASS,4BAA4BA,CAAE;EACrDC,oBAAoB;EACpBC,WAAW;EACXC;AACD,CAAC,EAAG;EACH,MAAMC,gBAAgB,GAAG,IAAAC,mCAA0B,EAAEJ,oBAAqB,CAAC;EAC3E,MAAMK,UAAU,GAAG,IAAAC,6BAAoB,EAAE;IACxCC,QAAQ,EAAEP,oBAAoB;IAC9BQ,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,MAAM;IAAEC,YAAY;IAAEF,QAAQ;IAAEG;EAAa,CAAC,GAAGR,eAAe,IAAI,CAAC,CAAC;EAEt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A6B,GAErC,IAAAmB,MAAA,CAAAC,aAAA,EAAChE,SAAA,CAAA0E,OAAgB;IAACC,OAAO,EAAGA,CAAA,KAAM,CAAC;EAAG,CAAE,CAAC,EACzC,IAAAZ,MAAA,CAAAC,aAAA,EAACnE,UAAA,CAAA6E,OAAS;IACTE,IAAI,EAAGvE,gBAAgB,EAAEuE,IAAM;IAC/BC,UAAU;IACVnE,OAAO,EAAC;EAAW,CACnB,CAAC,EACF,IAAAqD,MAAA,CAAAC,aAAA,EAACvE,WAAA,CAAAqF,oBAAM;IACNC,SAAS,EAAC,QAAQ;IAClBV,SAAS,EAAC,2DAA2D;IACrEW,OAAO,EAAC,YAAY;IACpBC,OAAO,EAAG;EAAG,GAEb,IAAAlB,MAAA,CAAAC,aAAA;IAAMK,SAAS,EAAC;EAAmD,GAClE,IAAAN,MAAA,CAAAC,aAAA,EAACvE,WAAA,CAAAyF,sBAAQ;IAACC,aAAa,EAAC;EAAM,GAC3B5E,UACO,CACL,CACC,CACJ,CAAC,EACN,IAAAwD,MAAA,CAAAC,aAAA;IAAKK,SAAS,EAAC;EAAyC,CAAM,CAC1D,CACD,CACG,CAAC;AAEZ","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_dom","_element","_i18n","_blockIcon","_useBlockDisplayInformation","_useBlockDisplayTitle","_expander","ListViewDropIndicatorPreview","draggedBlockClientId","listViewRef","blockDropTarget","blockInformation","useBlockDisplayInformation","blockTitle","useBlockDisplayTitle","clientId","context","rootClientId","dropPosition","rootBlockElement","blockElement","useMemo","current","_rootBlockElement","querySelector","undefined","_blockElement","targetElement","rtl","isRTL","getDropIndicatorWidth","useCallback","targetElementRect","indent","width","offsetWidth","scrollContainer","getScrollContainer","ownerDocument","windowScroll","body","documentElement","scrollContainerRect","getBoundingClientRect","distanceBetweenContainerAndTarget","right","left","scrollContainerWidth","clientWidth","style","horizontalScrollOffsetStyle","transform","ariaLevel","_ariaLevel","parseInt","getAttribute","hasAdjacentSelectedBranch","classList","contains","popoverAnchor","isValidDropPosition","contextElement","rect","top","doc","scrollbarWidth","height","window","DOMRect","_react","createElement","Popover","animate","anchor","focusOnMount","className","variant","flip","resize","clsx","default","onClick","icon","showColors","__experimentalHStack","alignment","justify","spacing","__experimentalTruncate","ellipsizeMode"],"sources":["@wordpress/block-editor/src/components/list-view/drop-indicator.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tPopover,\n} from '@wordpress/components';\n\nimport { getScrollContainer } from '@wordpress/dom';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport ListViewExpander from './expander';\n\nexport default function ListViewDropIndicatorPreview( {\n\tdraggedBlockClientId,\n\tlistViewRef,\n\tblockDropTarget,\n} ) {\n\tconst blockInformation = useBlockDisplayInformation( draggedBlockClientId );\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId: draggedBlockClientId,\n\t\tcontext: 'list-view',\n\t} );\n\n\tconst { rootClientId, clientId, dropPosition } = blockDropTarget || {};\n\n\tconst [ rootBlockElement, blockElement ] = useMemo( () => {\n\t\tif ( ! listViewRef.current ) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// The rootClientId will be defined whenever dropping into inner\n\t\t// block lists, but is undefined when dropping at the root level.\n\t\tconst _rootBlockElement = rootClientId\n\t\t\t? listViewRef.current.querySelector(\n\t\t\t\t\t`[data-block=\"${ rootClientId }\"]`\n\t\t\t )\n\t\t\t: undefined;\n\n\t\t// The clientId represents the sibling block, the dragged block will\n\t\t// usually be inserted adjacent to it. It will be undefined when\n\t\t// dropping a block into an empty block list.\n\t\tconst _blockElement = clientId\n\t\t\t? listViewRef.current.querySelector(\n\t\t\t\t\t`[data-block=\"${ clientId }\"]`\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn [ _rootBlockElement, _blockElement ];\n\t}, [ listViewRef, rootClientId, clientId ] );\n\n\t// The targetElement is the element that the drop indicator will appear\n\t// before or after. When dropping into an empty block list, blockElement\n\t// is undefined, so the indicator will appear after the rootBlockElement.\n\tconst targetElement = blockElement || rootBlockElement;\n\n\tconst rtl = isRTL();\n\n\tconst getDropIndicatorWidth = useCallback(\n\t\t( targetElementRect, indent ) => {\n\t\t\tif ( ! targetElement ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\t// Default to assuming that the width of the drop indicator\n\t\t\t// should be the same as the target element.\n\t\t\tlet width = targetElement.offsetWidth;\n\n\t\t\t// In deeply nested lists, where a scrollbar is present,\n\t\t\t// the width of the drop indicator should be the width of\n\t\t\t// the scroll container, minus the distance from the left\n\t\t\t// edge of the scroll container to the left edge of the\n\t\t\t// target element.\n\t\t\tconst scrollContainer = getScrollContainer(\n\t\t\t\ttargetElement,\n\t\t\t\t'horizontal'\n\t\t\t);\n\n\t\t\tconst ownerDocument = targetElement.ownerDocument;\n\t\t\tconst windowScroll =\n\t\t\t\tscrollContainer === ownerDocument.body ||\n\t\t\t\tscrollContainer === ownerDocument.documentElement;\n\n\t\t\tif ( scrollContainer && ! windowScroll ) {\n\t\t\t\tconst scrollContainerRect =\n\t\t\t\t\tscrollContainer.getBoundingClientRect();\n\n\t\t\t\tconst distanceBetweenContainerAndTarget = isRTL()\n\t\t\t\t\t? scrollContainerRect.right - targetElementRect.right\n\t\t\t\t\t: targetElementRect.left - scrollContainerRect.left;\n\n\t\t\t\tconst scrollContainerWidth = scrollContainer.clientWidth;\n\n\t\t\t\tif (\n\t\t\t\t\tscrollContainerWidth <\n\t\t\t\t\twidth + distanceBetweenContainerAndTarget\n\t\t\t\t) {\n\t\t\t\t\twidth =\n\t\t\t\t\t\tscrollContainerWidth -\n\t\t\t\t\t\tdistanceBetweenContainerAndTarget;\n\t\t\t\t}\n\n\t\t\t\t// LTR logic for ensuring the drop indicator does not extend\n\t\t\t\t// beyond the right edge of the scroll container.\n\t\t\t\tif (\n\t\t\t\t\t! rtl &&\n\t\t\t\t\ttargetElementRect.left + indent < scrollContainerRect.left\n\t\t\t\t) {\n\t\t\t\t\twidth -= scrollContainerRect.left - targetElementRect.left;\n\t\t\t\t\treturn width;\n\t\t\t\t}\n\n\t\t\t\t// RTL logic for ensuring the drop indicator does not extend\n\t\t\t\t// beyond the right edge of the scroll container.\n\t\t\t\tif (\n\t\t\t\t\trtl &&\n\t\t\t\t\ttargetElementRect.right - indent > scrollContainerRect.right\n\t\t\t\t) {\n\t\t\t\t\twidth -=\n\t\t\t\t\t\ttargetElementRect.right - scrollContainerRect.right;\n\t\t\t\t\treturn width;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Subtract the indent from the final width of the indicator.\n\t\t\treturn width - indent;\n\t\t},\n\t\t[ rtl, targetElement ]\n\t);\n\n\tconst style = useMemo( () => {\n\t\tif ( ! targetElement ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst targetElementRect = targetElement.getBoundingClientRect();\n\n\t\treturn {\n\t\t\twidth: getDropIndicatorWidth( targetElementRect, 0 ),\n\t\t};\n\t}, [ getDropIndicatorWidth, targetElement ] );\n\n\tconst horizontalScrollOffsetStyle = useMemo( () => {\n\t\tif ( ! targetElement ) {\n\t\t\treturn {};\n\t\t}\n\n\t\tconst scrollContainer = getScrollContainer( targetElement );\n\t\tconst ownerDocument = targetElement.ownerDocument;\n\t\tconst windowScroll =\n\t\t\tscrollContainer === ownerDocument.body ||\n\t\t\tscrollContainer === ownerDocument.documentElement;\n\n\t\tif ( scrollContainer && ! windowScroll ) {\n\t\t\tconst scrollContainerRect = scrollContainer.getBoundingClientRect();\n\t\t\tconst targetElementRect = targetElement.getBoundingClientRect();\n\n\t\t\tconst distanceBetweenContainerAndTarget = rtl\n\t\t\t\t? scrollContainerRect.right - targetElementRect.right\n\t\t\t\t: targetElementRect.left - scrollContainerRect.left;\n\n\t\t\tif ( ! rtl && scrollContainerRect.left > targetElementRect.left ) {\n\t\t\t\treturn {\n\t\t\t\t\ttransform: `translateX( ${ distanceBetweenContainerAndTarget }px )`,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif ( rtl && scrollContainerRect.right < targetElementRect.right ) {\n\t\t\t\treturn {\n\t\t\t\t\ttransform: `translateX( ${\n\t\t\t\t\t\tdistanceBetweenContainerAndTarget * -1\n\t\t\t\t\t}px )`,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {};\n\t}, [ rtl, targetElement ] );\n\n\tconst ariaLevel = useMemo( () => {\n\t\tif ( ! rootBlockElement ) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tconst _ariaLevel = parseInt(\n\t\t\trootBlockElement.getAttribute( 'aria-level' ),\n\t\t\t10\n\t\t);\n\n\t\treturn _ariaLevel ? _ariaLevel + 1 : 1;\n\t}, [ rootBlockElement ] );\n\n\tconst hasAdjacentSelectedBranch = useMemo( () => {\n\t\tif ( ! targetElement ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn targetElement.classList.contains( 'is-branch-selected' );\n\t}, [ targetElement ] );\n\n\tconst popoverAnchor = useMemo( () => {\n\t\tconst isValidDropPosition =\n\t\t\tdropPosition === 'top' ||\n\t\t\tdropPosition === 'bottom' ||\n\t\t\tdropPosition === 'inside';\n\t\tif ( ! targetElement || ! isValidDropPosition ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tcontextElement: targetElement,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\tconst rect = targetElement.getBoundingClientRect();\n\t\t\t\t// In RTL languages, the drop indicator should be positioned\n\t\t\t\t// to the left of the target element, with the width of the\n\t\t\t\t// indicator determining the indent at the right edge of the\n\t\t\t\t// target element. In LTR languages, the drop indicator should\n\t\t\t\t// end at the right edge of the target element, with the indent\n\t\t\t\t// added to the position of the left edge of the target element.\n\t\t\t\t// let left = rtl ? rect.left : rect.left + indent;\n\t\t\t\tlet left = rect.left;\n\t\t\t\tlet top = 0;\n\n\t\t\t\t// In deeply nested lists, where a scrollbar is present,\n\t\t\t\t// the width of the drop indicator should be the width of\n\t\t\t\t// the visible area of the scroll container. Additionally,\n\t\t\t\t// the left edge of the drop indicator line needs to be\n\t\t\t\t// offset by the distance the left edge of the target element\n\t\t\t\t// and the left edge of the scroll container. The ensures\n\t\t\t\t// that the drop indicator position never breaks out of the\n\t\t\t\t// visible area of the scroll container.\n\t\t\t\tconst scrollContainer = getScrollContainer(\n\t\t\t\t\ttargetElement,\n\t\t\t\t\t'horizontal'\n\t\t\t\t);\n\n\t\t\t\tconst doc = targetElement.ownerDocument;\n\t\t\t\tconst windowScroll =\n\t\t\t\t\tscrollContainer === doc.body ||\n\t\t\t\t\tscrollContainer === doc.documentElement;\n\n\t\t\t\t// If the scroll container is not the window, offset the left position, if need be.\n\t\t\t\tif ( scrollContainer && ! windowScroll ) {\n\t\t\t\t\tconst scrollContainerRect =\n\t\t\t\t\t\tscrollContainer.getBoundingClientRect();\n\n\t\t\t\t\t// In RTL languages, a vertical scrollbar is present on the\n\t\t\t\t\t// left edge of the scroll container. The width of the\n\t\t\t\t\t// scrollbar needs to be accounted for when positioning the\n\t\t\t\t\t// drop indicator.\n\t\t\t\t\tconst scrollbarWidth = rtl\n\t\t\t\t\t\t? scrollContainer.offsetWidth -\n\t\t\t\t\t\t scrollContainer.clientWidth\n\t\t\t\t\t\t: 0;\n\n\t\t\t\t\tif ( left < scrollContainerRect.left + scrollbarWidth ) {\n\t\t\t\t\t\tleft = scrollContainerRect.left + scrollbarWidth;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( dropPosition === 'top' ) {\n\t\t\t\t\ttop = rect.top - rect.height * 2;\n\t\t\t\t} else {\n\t\t\t\t\t// `dropPosition` is either `bottom` or `inside`\n\t\t\t\t\ttop = rect.top;\n\t\t\t\t}\n\n\t\t\t\tconst width = getDropIndicatorWidth( rect, 0 );\n\t\t\t\tconst height = rect.height;\n\n\t\t\t\treturn new window.DOMRect( left, top, width, height );\n\t\t\t},\n\t\t};\n\t}, [ targetElement, dropPosition, getDropIndicatorWidth, rtl ] );\n\n\tif ( ! targetElement ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Popover\n\t\t\tanimate={ false }\n\t\t\tanchor={ popoverAnchor }\n\t\t\tfocusOnMount={ false }\n\t\t\tclassName=\"block-editor-list-view-drop-indicator--preview\"\n\t\t\tvariant=\"unstyled\"\n\t\t\tflip={ false }\n\t\t\tresize\n\t\t>\n\t\t\t<div\n\t\t\t\tstyle={ style }\n\t\t\t\tclassName={ clsx(\n\t\t\t\t\t'block-editor-list-view-drop-indicator__line',\n\t\t\t\t\t{\n\t\t\t\t\t\t'block-editor-list-view-drop-indicator__line--darker':\n\t\t\t\t\t\t\thasAdjacentSelectedBranch,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"block-editor-list-view-leaf\"\n\t\t\t\t\taria-level={ ariaLevel }\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\t\t\t\t'block-editor-list-view-block-contents'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tstyle={ horizontalScrollOffsetStyle }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ListViewExpander onClick={ () => {} } />\n\t\t\t\t\t\t<BlockIcon\n\t\t\t\t\t\t\ticon={ blockInformation?.icon }\n\t\t\t\t\t\t\tshowColors\n\t\t\t\t\t\t\tcontext=\"list-view\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\talignment=\"center\"\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\t\t\tspacing={ 1 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">\n\t\t\t\t\t\t\t\t\t{ blockTitle }\n\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"block-editor-list-view-block__menu-cell\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Popover>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAMA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,UAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,2BAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,qBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,SAAA,GAAAT,sBAAA,CAAAC,OAAA;AAxBA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;;AAMe,SAASS,4BAA4BA,CAAE;EACrDC,oBAAoB;EACpBC,WAAW;EACXC;AACD,CAAC,EAAG;EACH,MAAMC,gBAAgB,GAAG,IAAAC,mCAA0B,EAAEJ,oBAAqB,CAAC;EAC3E,MAAMK,UAAU,GAAG,IAAAC,6BAAoB,EAAE;IACxCC,QAAQ,EAAEP,oBAAoB;IAC9BQ,OAAO,EAAE;EACV,CAAE,CAAC;EAEH,MAAM;IAAEC,YAAY;IAAEF,QAAQ;IAAEG;EAAa,CAAC,GAAGR,eAAe,IAAI,CAAC,CAAC;EAEtE,MAAM,CAAES,gBAAgB,EAAEC,YAAY,CAAE,GAAG,IAAAC,gBAAO,EAAE,MAAM;IACzD,IAA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AA,KAAM,CAAC;EAAG,CAAE,CAAC,EACzC,IAAAZ,MAAA,CAAAC,aAAA,EAACnE,UAAA,CAAA6E,OAAS;IACTE,IAAI,EAAGvE,gBAAgB,EAAEuE,IAAM;IAC/BC,UAAU;IACVnE,OAAO,EAAC;EAAW,CACnB,CAAC,EACF,IAAAqD,MAAA,CAAAC,aAAA,EAACvE,WAAA,CAAAqF,oBAAM;IACNC,SAAS,EAAC,QAAQ;IAClBV,SAAS,EAAC,2DAA2D;IACrEW,OAAO,EAAC,YAAY;IACpBC,OAAO,EAAG;EAAG,GAEb,IAAAlB,MAAA,CAAAC,aAAA;IAAMK,SAAS,EAAC;EAAmD,GAClE,IAAAN,MAAA,CAAAC,aAAA,EAACvE,WAAA,CAAAyF,sBAAQ;IAACC,aAAa,EAAC;EAAM,GAC3B5E,UACO,CACL,CACC,CACJ,CAAC,EACN,IAAAwD,MAAA,CAAAC,aAAA;IAAKK,SAAS,EAAC;EAAyC,CAAM,CAC1D,CACD,CACG,CAAC;AAEZ","ignoreList":[]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = exports.PrivateListView = exports.BLOCK_LIST_ITEM_HEIGHT = void 0;
8
8
  var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _clsx = _interopRequireDefault(require("clsx"));
10
10
  var _compose = require("@wordpress/compose");
11
11
  var _components = require("@wordpress/components");
12
12
  var _data = require("@wordpress/data");
@@ -287,7 +287,7 @@ function ListViewComponent({
287
287
  id: describedById
288
288
  }, description), (0, _react.createElement)(_components.__experimentalTreeGrid, {
289
289
  id: id,
290
- className: (0, _classnames.default)('block-editor-list-view-tree', {
290
+ className: (0, _clsx.default)('block-editor-list-view-tree', {
291
291
  'is-dragging': draggedClientIds?.length > 0 && blockDropTargetIndex !== undefined
292
292
  }),
293
293
  "aria-label": (0, _i18n.__)('Block navigation structure'),
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_components","_data","_deprecated","_element","_i18n","_branch","_context","_dropIndicator","_useBlockSelection","_useListViewBlockIndexes","_useListViewClientIds","_useListViewCollapseItems","_useListViewDropZone","_useListViewExpandSelectedItem","_store","_blockSettingsDropdown","_utils","_useClipboardHandler","expanded","state","action","type","Array","isArray","clientIds","reduce","newState","id","BLOCK_LIST_ITEM_HEIGHT","exports","ListViewComponent","blocks","dropZoneElement","showBlockMovers","isExpanded","showAppender","blockSettingsMenu","BlockSettingsMenu","BlockSettingsDropdown","rootClientId","description","onSelect","additionalBlockContent","AdditionalBlockContent","ref","deprecated","since","alternative","instanceId","useInstanceId","clientIdsTree","draggedClientIds","selectedClientIds","useListViewClientIds","blockIndexes","useListViewBlockIndexes","getBlock","useSelect","blockEditorStore","visibleBlockCount","shouldShowInnerBlocks","select","getGlobalBlockCount","getClientIdsOfDescendants","__unstableGetEditorMode","draggedBlockCount","length","updateBlockSelection","useBlockSelection","expandedState","setExpandedState","useReducer","insertedBlock","setInsertedBlock","useState","setSelectedTreeId","useListViewExpandSelectedItem","firstSelectedBlockClientId","selectEditorBlock","useCallback","event","blockClientId","focusPosition","dropZoneRef","target","blockDropTarget","useListViewDropZone","elementRef","useRef","clipBoardRef","useClipboardHandler","selectBlock","treeGridRef","useMergeRefs","useEffect","focusListItem","current","expand","clientId","collapse","collapseAll","expandRow","row","dataset","block","collapseRow","focusRow","startRow","endRow","shiftKey","useListViewCollapseItems","firstDraggedBlockClientId","blockDropTargetIndex","blockDropPosition","firstDraggedBlockIndex","useMemo","_blockDropTargetIndex","_firstDraggedBlockIndex","foundBlockIndex","undefined","dropPosition","contextValue","listViewInstanceId","treeGridElementRef","fixedListWindow","useFixedWindowList","useWindowing","windowOverscan","describedById","_react","createElement","AsyncModeProvider","value","default","draggedBlockClientId","listViewRef","VisuallyHidden","__experimentalTreeGrid","className","classnames","__","onCollapseRow","onExpandRow","onFocusRow","applicationAriaLabel","style","ListViewContext","Provider","parentId","PrivateListView","forwardRef","_default","props"],"sources":["@wordpress/block-editor/src/components/list-view/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseInstanceId,\n\tuseMergeRefs,\n\t__experimentalUseFixedWindowList as useFixedWindowList,\n} from '@wordpress/compose';\nimport {\n\t__experimentalTreeGrid as TreeGrid,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { AsyncModeProvider, useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseReducer,\n\tforwardRef,\n\tuseState,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ListViewBranch from './branch';\nimport { ListViewContext } from './context';\nimport ListViewDropIndicatorPreview from './drop-indicator';\nimport useBlockSelection from './use-block-selection';\nimport useListViewBlockIndexes from './use-list-view-block-indexes';\nimport useListViewClientIds from './use-list-view-client-ids';\nimport useListViewCollapseItems from './use-list-view-collapse-items';\nimport useListViewDropZone from './use-list-view-drop-zone';\nimport useListViewExpandSelectedItem from './use-list-view-expand-selected-item';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockSettingsDropdown } from '../block-settings-menu/block-settings-dropdown';\nimport { focusListItem } from './utils';\nimport useClipboardHandler from './use-clipboard-handler';\n\nconst expanded = ( state, action ) => {\n\tif ( action.type === 'clear' ) {\n\t\treturn {};\n\t}\n\tif ( Array.isArray( action.clientIds ) ) {\n\t\treturn {\n\t\t\t...state,\n\t\t\t...action.clientIds.reduce(\n\t\t\t\t( newState, id ) => ( {\n\t\t\t\t\t...newState,\n\t\t\t\t\t[ id ]: action.type === 'expand',\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t\t),\n\t\t};\n\t}\n\treturn state;\n};\n\nexport const BLOCK_LIST_ITEM_HEIGHT = 32;\n\n/** @typedef {import('react').ComponentType} ComponentType */\n/** @typedef {import('react').Ref<HTMLElement>} Ref */\n\n/**\n * Show a hierarchical list of blocks.\n *\n * @param {Object} props Components props.\n * @param {string} props.id An HTML element id for the root element of ListView.\n * @param {Array} props.blocks _deprecated_ Custom subset of block client IDs to be used instead of the default hierarchy.\n * @param {?HTMLElement} props.dropZoneElement Optional element to be used as the drop zone.\n * @param {?boolean} props.showBlockMovers Flag to enable block movers. Defaults to `false`.\n * @param {?boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. Defaults to `false`.\n * @param {?boolean} props.showAppender Flag to show or hide the block appender. Defaults to `false`.\n * @param {?ComponentType} props.blockSettingsMenu Optional more menu substitution. Defaults to the standard `BlockSettingsDropdown` component.\n * @param {string} props.rootClientId The client id of the root block from which we determine the blocks to show in the list.\n * @param {string} props.description Optional accessible description for the tree grid component.\n * @param {?Function} props.onSelect Optional callback to be invoked when a block is selected. Receives the block object that was selected.\n * @param {?ComponentType} props.additionalBlockContent Component that renders additional block content UI.\n * @param {Ref} ref Forwarded ref\n */\nfunction ListViewComponent(\n\t{\n\t\tid,\n\t\tblocks,\n\t\tdropZoneElement,\n\t\tshowBlockMovers = false,\n\t\tisExpanded = false,\n\t\tshowAppender = false,\n\t\tblockSettingsMenu: BlockSettingsMenu = BlockSettingsDropdown,\n\t\trootClientId,\n\t\tdescription,\n\t\tonSelect,\n\t\tadditionalBlockContent: AdditionalBlockContent,\n\t},\n\tref\n) {\n\t// This can be removed once we no longer need to support the blocks prop.\n\tif ( blocks ) {\n\t\tdeprecated(\n\t\t\t'`blocks` property in `wp.blockEditor.__experimentalListView`',\n\t\t\t{\n\t\t\t\tsince: '6.3',\n\t\t\t\talternative: '`rootClientId` property',\n\t\t\t}\n\t\t);\n\t}\n\n\tconst instanceId = useInstanceId( ListViewComponent );\n\tconst { clientIdsTree, draggedClientIds, selectedClientIds } =\n\t\tuseListViewClientIds( { blocks, rootClientId } );\n\tconst blockIndexes = useListViewBlockIndexes( clientIdsTree );\n\n\tconst { getBlock } = useSelect( blockEditorStore );\n\tconst { visibleBlockCount, shouldShowInnerBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetGlobalBlockCount,\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst draggedBlockCount =\n\t\t\t\tdraggedClientIds?.length > 0\n\t\t\t\t\t? getClientIdsOfDescendants( draggedClientIds ).length + 1\n\t\t\t\t\t: 0;\n\t\t\treturn {\n\t\t\t\tvisibleBlockCount: getGlobalBlockCount() - draggedBlockCount,\n\t\t\t\tshouldShowInnerBlocks: __unstableGetEditorMode() !== 'zoom-out',\n\t\t\t};\n\t\t},\n\t\t[ draggedClientIds ]\n\t);\n\n\tconst { updateBlockSelection } = useBlockSelection();\n\n\tconst [ expandedState, setExpandedState ] = useReducer( expanded, {} );\n\n\tconst [ insertedBlock, setInsertedBlock ] = useState( null );\n\n\tconst { setSelectedTreeId } = useListViewExpandSelectedItem( {\n\t\tfirstSelectedBlockClientId: selectedClientIds[ 0 ],\n\t\tsetExpandedState,\n\t} );\n\tconst selectEditorBlock = useCallback(\n\t\t/**\n\t\t * @param {MouseEvent | KeyboardEvent | undefined} event\n\t\t * @param {string} blockClientId\n\t\t * @param {null | undefined | -1 | 1} focusPosition\n\t\t */\n\t\t( event, blockClientId, focusPosition ) => {\n\t\t\tupdateBlockSelection( event, blockClientId, null, focusPosition );\n\t\t\tsetSelectedTreeId( blockClientId );\n\t\t\tif ( onSelect ) {\n\t\t\t\tonSelect( getBlock( blockClientId ) );\n\t\t\t}\n\t\t},\n\t\t[ setSelectedTreeId, updateBlockSelection, onSelect, getBlock ]\n\t);\n\n\tconst { ref: dropZoneRef, target: blockDropTarget } = useListViewDropZone( {\n\t\tdropZoneElement,\n\t\texpandedState,\n\t\tsetExpandedState,\n\t} );\n\tconst elementRef = useRef();\n\n\t// Allow handling of copy, cut, and paste events.\n\tconst clipBoardRef = useClipboardHandler( {\n\t\tselectBlock: selectEditorBlock,\n\t} );\n\n\tconst treeGridRef = useMergeRefs( [\n\t\tclipBoardRef,\n\t\telementRef,\n\t\tdropZoneRef,\n\t\tref,\n\t] );\n\n\tuseEffect( () => {\n\t\t// If a blocks are already selected when the list view is initially\n\t\t// mounted, shift focus to the first selected block.\n\t\tif ( selectedClientIds?.length ) {\n\t\t\tfocusListItem( selectedClientIds[ 0 ], elementRef?.current );\n\t\t}\n\t\t// Disable reason: Only focus on the selected item when the list view is mounted.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tconst expand = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst clientIds = Array.isArray( clientId )\n\t\t\t\t? clientId\n\t\t\t\t: [ clientId ];\n\t\t\tsetExpandedState( { type: 'expand', clientIds } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapse = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetExpandedState( { type: 'collapse', clientIds: [ clientId ] } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapseAll = useCallback( () => {\n\t\tsetExpandedState( { type: 'clear' } );\n\t}, [ setExpandedState ] );\n\tconst expandRow = useCallback(\n\t\t( row ) => {\n\t\t\texpand( row?.dataset?.block );\n\t\t},\n\t\t[ expand ]\n\t);\n\tconst collapseRow = useCallback(\n\t\t( row ) => {\n\t\t\tcollapse( row?.dataset?.block );\n\t\t},\n\t\t[ collapse ]\n\t);\n\tconst focusRow = useCallback(\n\t\t( event, startRow, endRow ) => {\n\t\t\tif ( event.shiftKey ) {\n\t\t\t\tupdateBlockSelection(\n\t\t\t\t\tevent,\n\t\t\t\t\tstartRow?.dataset?.block,\n\t\t\t\t\tendRow?.dataset?.block\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ updateBlockSelection ]\n\t);\n\n\tuseListViewCollapseItems( {\n\t\tcollapseAll,\n\t\texpand,\n\t} );\n\n\tconst firstDraggedBlockClientId = draggedClientIds?.[ 0 ];\n\n\t// Convert a blockDropTarget into indexes relative to the blocks in the list view.\n\t// These values are used to determine which blocks should be displaced to make room\n\t// for the drop indicator. See `ListViewBranch` and `getDragDisplacementValues`.\n\tconst { blockDropTargetIndex, blockDropPosition, firstDraggedBlockIndex } =\n\t\tuseMemo( () => {\n\t\t\tlet _blockDropTargetIndex, _firstDraggedBlockIndex;\n\n\t\t\tif ( blockDropTarget?.clientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ blockDropTarget.clientId ];\n\t\t\t\t// If dragging below or inside the block, treat the drop target as the next block.\n\t\t\t\t_blockDropTargetIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t} else if ( blockDropTarget === null ) {\n\t\t\t\t// A `null` value is used to indicate that the user is dragging outside of the list view.\n\t\t\t\t_blockDropTargetIndex = null;\n\t\t\t}\n\n\t\t\tif ( firstDraggedBlockClientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ firstDraggedBlockClientId ];\n\t\t\t\t_firstDraggedBlockIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tblockDropTargetIndex: _blockDropTargetIndex,\n\t\t\t\tblockDropPosition: blockDropTarget?.dropPosition,\n\t\t\t\tfirstDraggedBlockIndex: _firstDraggedBlockIndex,\n\t\t\t};\n\t\t}, [ blockDropTarget, blockIndexes, firstDraggedBlockClientId ] );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\n\t\t\tcollapse,\n\t\t\tcollapseAll,\n\t\t\tBlockSettingsMenu,\n\t\t\tlistViewInstanceId: instanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\ttreeGridElementRef: elementRef,\n\t\t\trootClientId,\n\t\t} ),\n\t\t[\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\n\t\t\tcollapse,\n\t\t\tcollapseAll,\n\t\t\tBlockSettingsMenu,\n\t\t\tinstanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\trootClientId,\n\t\t]\n\t);\n\n\t// List View renders a fixed number of items and relies on each having a fixed item height of 36px.\n\t// If this value changes, we should also change the itemHeight value set in useFixedWindowList.\n\t// See: https://github.com/WordPress/gutenberg/pull/35230 for additional context.\n\tconst [ fixedListWindow ] = useFixedWindowList(\n\t\telementRef,\n\t\tBLOCK_LIST_ITEM_HEIGHT,\n\t\tvisibleBlockCount,\n\t\t{\n\t\t\t// Ensure that the windowing logic is recalculated when the expanded state changes.\n\t\t\t// This is necessary because expanding a collapsed block in a short list view can\n\t\t\t// switch the list view to a tall list view with a scrollbar, and vice versa.\n\t\t\t// When this happens, the windowing logic needs to be recalculated to ensure that\n\t\t\t// the correct number of blocks are rendered, by rechecking for a scroll container.\n\t\t\texpandedState,\n\t\t\tuseWindowing: true,\n\t\t\twindowOverscan: 40,\n\t\t}\n\t);\n\n\t// If there are no blocks to show and we're not showing the appender, do not render the list view.\n\tif ( ! clientIdsTree.length && ! showAppender ) {\n\t\treturn null;\n\t}\n\n\tconst describedById =\n\t\tdescription && `block-editor-list-view-description-${ instanceId }`;\n\n\treturn (\n\t\t<AsyncModeProvider value>\n\t\t\t<ListViewDropIndicatorPreview\n\t\t\t\tdraggedBlockClientId={ firstDraggedBlockClientId }\n\t\t\t\tlistViewRef={ elementRef }\n\t\t\t\tblockDropTarget={ blockDropTarget }\n\t\t\t/>\n\t\t\t{ description && (\n\t\t\t\t<VisuallyHidden id={ describedById }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t\t<TreeGrid\n\t\t\t\tid={ id }\n\t\t\t\tclassName={ classnames( 'block-editor-list-view-tree', {\n\t\t\t\t\t'is-dragging':\n\t\t\t\t\t\tdraggedClientIds?.length > 0 &&\n\t\t\t\t\t\tblockDropTargetIndex !== undefined,\n\t\t\t\t} ) }\n\t\t\t\taria-label={ __( 'Block navigation structure' ) }\n\t\t\t\tref={ treeGridRef }\n\t\t\t\tonCollapseRow={ collapseRow }\n\t\t\t\tonExpandRow={ expandRow }\n\t\t\t\tonFocusRow={ focusRow }\n\t\t\t\tapplicationAriaLabel={ __( 'Block navigation structure' ) }\n\t\t\t\taria-describedby={ describedById }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-admin--list-view-dragged-items-height':\n\t\t\t\t\t\tdraggedClientIds?.length\n\t\t\t\t\t\t\t? `${\n\t\t\t\t\t\t\t\t\tBLOCK_LIST_ITEM_HEIGHT *\n\t\t\t\t\t\t\t\t\t( draggedClientIds.length - 1 )\n\t\t\t\t\t\t\t }px`\n\t\t\t\t\t\t\t: null,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ListViewContext.Provider value={ contextValue }>\n\t\t\t\t\t<ListViewBranch\n\t\t\t\t\t\tblocks={ clientIdsTree }\n\t\t\t\t\t\tparentId={ rootClientId }\n\t\t\t\t\t\tselectBlock={ selectEditorBlock }\n\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\tfixedListWindow={ fixedListWindow }\n\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\tshouldShowInnerBlocks={ shouldShowInnerBlocks }\n\t\t\t\t\t\tshowAppender={ showAppender }\n\t\t\t\t\t/>\n\t\t\t\t</ListViewContext.Provider>\n\t\t\t</TreeGrid>\n\t\t</AsyncModeProvider>\n\t);\n}\n\n// This is the private API for the ListView component.\n// It allows access to all props, not just the public ones.\nexport const PrivateListView = forwardRef( ListViewComponent );\n\n// This is the public API for the ListView component.\n// We wrap the PrivateListView component to hide some props from the public API.\nexport default forwardRef( ( props, ref ) => {\n\treturn (\n\t\t<PrivateListView\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tshowAppender={ false }\n\t\t\trootClientId={ null }\n\t\t\tonSelect={ null }\n\t\t\tadditionalBlockContent={ null }\n\t\t\tblockSettingsMenu={ undefined }\n\t\t/>\n\t);\n} );\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AASA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,OAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,kBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,wBAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,qBAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,yBAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,oBAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAA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ACfzG,GAAG,EAAGA,GAAK;IAAA,GACN4G,KAAK;IACVrH,YAAY,EAAG,KAAO;IACtBI,YAAY,EAAG,IAAM;IACrBE,QAAQ,EAAG,IAAM;IACjBC,sBAAsB,EAAG,IAAM;IAC/BN,iBAAiB,EAAGmF;EAAW,CAC/B,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_components","_data","_deprecated","_element","_i18n","_branch","_context","_dropIndicator","_useBlockSelection","_useListViewBlockIndexes","_useListViewClientIds","_useListViewCollapseItems","_useListViewDropZone","_useListViewExpandSelectedItem","_store","_blockSettingsDropdown","_utils","_useClipboardHandler","expanded","state","action","type","Array","isArray","clientIds","reduce","newState","id","BLOCK_LIST_ITEM_HEIGHT","exports","ListViewComponent","blocks","dropZoneElement","showBlockMovers","isExpanded","showAppender","blockSettingsMenu","BlockSettingsMenu","BlockSettingsDropdown","rootClientId","description","onSelect","additionalBlockContent","AdditionalBlockContent","ref","deprecated","since","alternative","instanceId","useInstanceId","clientIdsTree","draggedClientIds","selectedClientIds","useListViewClientIds","blockIndexes","useListViewBlockIndexes","getBlock","useSelect","blockEditorStore","visibleBlockCount","shouldShowInnerBlocks","select","getGlobalBlockCount","getClientIdsOfDescendants","__unstableGetEditorMode","draggedBlockCount","length","updateBlockSelection","useBlockSelection","expandedState","setExpandedState","useReducer","insertedBlock","setInsertedBlock","useState","setSelectedTreeId","useListViewExpandSelectedItem","firstSelectedBlockClientId","selectEditorBlock","useCallback","event","blockClientId","focusPosition","dropZoneRef","target","blockDropTarget","useListViewDropZone","elementRef","useRef","clipBoardRef","useClipboardHandler","selectBlock","treeGridRef","useMergeRefs","useEffect","focusListItem","current","expand","clientId","collapse","collapseAll","expandRow","row","dataset","block","collapseRow","focusRow","startRow","endRow","shiftKey","useListViewCollapseItems","firstDraggedBlockClientId","blockDropTargetIndex","blockDropPosition","firstDraggedBlockIndex","useMemo","_blockDropTargetIndex","_firstDraggedBlockIndex","foundBlockIndex","undefined","dropPosition","contextValue","listViewInstanceId","treeGridElementRef","fixedListWindow","useFixedWindowList","useWindowing","windowOverscan","describedById","_react","createElement","AsyncModeProvider","value","default","draggedBlockClientId","listViewRef","VisuallyHidden","__experimentalTreeGrid","className","clsx","__","onCollapseRow","onExpandRow","onFocusRow","applicationAriaLabel","style","ListViewContext","Provider","parentId","PrivateListView","forwardRef","_default","props"],"sources":["@wordpress/block-editor/src/components/list-view/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseInstanceId,\n\tuseMergeRefs,\n\t__experimentalUseFixedWindowList as useFixedWindowList,\n} from '@wordpress/compose';\nimport {\n\t__experimentalTreeGrid as TreeGrid,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { AsyncModeProvider, useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseReducer,\n\tforwardRef,\n\tuseState,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ListViewBranch from './branch';\nimport { ListViewContext } from './context';\nimport ListViewDropIndicatorPreview from './drop-indicator';\nimport useBlockSelection from './use-block-selection';\nimport useListViewBlockIndexes from './use-list-view-block-indexes';\nimport useListViewClientIds from './use-list-view-client-ids';\nimport useListViewCollapseItems from './use-list-view-collapse-items';\nimport useListViewDropZone from './use-list-view-drop-zone';\nimport useListViewExpandSelectedItem from './use-list-view-expand-selected-item';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockSettingsDropdown } from '../block-settings-menu/block-settings-dropdown';\nimport { focusListItem } from './utils';\nimport useClipboardHandler from './use-clipboard-handler';\n\nconst expanded = ( state, action ) => {\n\tif ( action.type === 'clear' ) {\n\t\treturn {};\n\t}\n\tif ( Array.isArray( action.clientIds ) ) {\n\t\treturn {\n\t\t\t...state,\n\t\t\t...action.clientIds.reduce(\n\t\t\t\t( newState, id ) => ( {\n\t\t\t\t\t...newState,\n\t\t\t\t\t[ id ]: action.type === 'expand',\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t\t),\n\t\t};\n\t}\n\treturn state;\n};\n\nexport const BLOCK_LIST_ITEM_HEIGHT = 32;\n\n/** @typedef {import('react').ComponentType} ComponentType */\n/** @typedef {import('react').Ref<HTMLElement>} Ref */\n\n/**\n * Show a hierarchical list of blocks.\n *\n * @param {Object} props Components props.\n * @param {string} props.id An HTML element id for the root element of ListView.\n * @param {Array} props.blocks _deprecated_ Custom subset of block client IDs to be used instead of the default hierarchy.\n * @param {?HTMLElement} props.dropZoneElement Optional element to be used as the drop zone.\n * @param {?boolean} props.showBlockMovers Flag to enable block movers. Defaults to `false`.\n * @param {?boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. Defaults to `false`.\n * @param {?boolean} props.showAppender Flag to show or hide the block appender. Defaults to `false`.\n * @param {?ComponentType} props.blockSettingsMenu Optional more menu substitution. Defaults to the standard `BlockSettingsDropdown` component.\n * @param {string} props.rootClientId The client id of the root block from which we determine the blocks to show in the list.\n * @param {string} props.description Optional accessible description for the tree grid component.\n * @param {?Function} props.onSelect Optional callback to be invoked when a block is selected. Receives the block object that was selected.\n * @param {?ComponentType} props.additionalBlockContent Component that renders additional block content UI.\n * @param {Ref} ref Forwarded ref\n */\nfunction ListViewComponent(\n\t{\n\t\tid,\n\t\tblocks,\n\t\tdropZoneElement,\n\t\tshowBlockMovers = false,\n\t\tisExpanded = false,\n\t\tshowAppender = false,\n\t\tblockSettingsMenu: BlockSettingsMenu = BlockSettingsDropdown,\n\t\trootClientId,\n\t\tdescription,\n\t\tonSelect,\n\t\tadditionalBlockContent: AdditionalBlockContent,\n\t},\n\tref\n) {\n\t// This can be removed once we no longer need to support the blocks prop.\n\tif ( blocks ) {\n\t\tdeprecated(\n\t\t\t'`blocks` property in `wp.blockEditor.__experimentalListView`',\n\t\t\t{\n\t\t\t\tsince: '6.3',\n\t\t\t\talternative: '`rootClientId` property',\n\t\t\t}\n\t\t);\n\t}\n\n\tconst instanceId = useInstanceId( ListViewComponent );\n\tconst { clientIdsTree, draggedClientIds, selectedClientIds } =\n\t\tuseListViewClientIds( { blocks, rootClientId } );\n\tconst blockIndexes = useListViewBlockIndexes( clientIdsTree );\n\n\tconst { getBlock } = useSelect( blockEditorStore );\n\tconst { visibleBlockCount, shouldShowInnerBlocks } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetGlobalBlockCount,\n\t\t\t\tgetClientIdsOfDescendants,\n\t\t\t\t__unstableGetEditorMode,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst draggedBlockCount =\n\t\t\t\tdraggedClientIds?.length > 0\n\t\t\t\t\t? getClientIdsOfDescendants( draggedClientIds ).length + 1\n\t\t\t\t\t: 0;\n\t\t\treturn {\n\t\t\t\tvisibleBlockCount: getGlobalBlockCount() - draggedBlockCount,\n\t\t\t\tshouldShowInnerBlocks: __unstableGetEditorMode() !== 'zoom-out',\n\t\t\t};\n\t\t},\n\t\t[ draggedClientIds ]\n\t);\n\n\tconst { updateBlockSelection } = useBlockSelection();\n\n\tconst [ expandedState, setExpandedState ] = useReducer( expanded, {} );\n\n\tconst [ insertedBlock, setInsertedBlock ] = useState( null );\n\n\tconst { setSelectedTreeId } = useListViewExpandSelectedItem( {\n\t\tfirstSelectedBlockClientId: selectedClientIds[ 0 ],\n\t\tsetExpandedState,\n\t} );\n\tconst selectEditorBlock = useCallback(\n\t\t/**\n\t\t * @param {MouseEvent | KeyboardEvent | undefined} event\n\t\t * @param {string} blockClientId\n\t\t * @param {null | undefined | -1 | 1} focusPosition\n\t\t */\n\t\t( event, blockClientId, focusPosition ) => {\n\t\t\tupdateBlockSelection( event, blockClientId, null, focusPosition );\n\t\t\tsetSelectedTreeId( blockClientId );\n\t\t\tif ( onSelect ) {\n\t\t\t\tonSelect( getBlock( blockClientId ) );\n\t\t\t}\n\t\t},\n\t\t[ setSelectedTreeId, updateBlockSelection, onSelect, getBlock ]\n\t);\n\n\tconst { ref: dropZoneRef, target: blockDropTarget } = useListViewDropZone( {\n\t\tdropZoneElement,\n\t\texpandedState,\n\t\tsetExpandedState,\n\t} );\n\tconst elementRef = useRef();\n\n\t// Allow handling of copy, cut, and paste events.\n\tconst clipBoardRef = useClipboardHandler( {\n\t\tselectBlock: selectEditorBlock,\n\t} );\n\n\tconst treeGridRef = useMergeRefs( [\n\t\tclipBoardRef,\n\t\telementRef,\n\t\tdropZoneRef,\n\t\tref,\n\t] );\n\n\tuseEffect( () => {\n\t\t// If a blocks are already selected when the list view is initially\n\t\t// mounted, shift focus to the first selected block.\n\t\tif ( selectedClientIds?.length ) {\n\t\t\tfocusListItem( selectedClientIds[ 0 ], elementRef?.current );\n\t\t}\n\t\t// Disable reason: Only focus on the selected item when the list view is mounted.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [] );\n\n\tconst expand = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst clientIds = Array.isArray( clientId )\n\t\t\t\t? clientId\n\t\t\t\t: [ clientId ];\n\t\t\tsetExpandedState( { type: 'expand', clientIds } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapse = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetExpandedState( { type: 'collapse', clientIds: [ clientId ] } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapseAll = useCallback( () => {\n\t\tsetExpandedState( { type: 'clear' } );\n\t}, [ setExpandedState ] );\n\tconst expandRow = useCallback(\n\t\t( row ) => {\n\t\t\texpand( row?.dataset?.block );\n\t\t},\n\t\t[ expand ]\n\t);\n\tconst collapseRow = useCallback(\n\t\t( row ) => {\n\t\t\tcollapse( row?.dataset?.block );\n\t\t},\n\t\t[ collapse ]\n\t);\n\tconst focusRow = useCallback(\n\t\t( event, startRow, endRow ) => {\n\t\t\tif ( event.shiftKey ) {\n\t\t\t\tupdateBlockSelection(\n\t\t\t\t\tevent,\n\t\t\t\t\tstartRow?.dataset?.block,\n\t\t\t\t\tendRow?.dataset?.block\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ updateBlockSelection ]\n\t);\n\n\tuseListViewCollapseItems( {\n\t\tcollapseAll,\n\t\texpand,\n\t} );\n\n\tconst firstDraggedBlockClientId = draggedClientIds?.[ 0 ];\n\n\t// Convert a blockDropTarget into indexes relative to the blocks in the list view.\n\t// These values are used to determine which blocks should be displaced to make room\n\t// for the drop indicator. See `ListViewBranch` and `getDragDisplacementValues`.\n\tconst { blockDropTargetIndex, blockDropPosition, firstDraggedBlockIndex } =\n\t\tuseMemo( () => {\n\t\t\tlet _blockDropTargetIndex, _firstDraggedBlockIndex;\n\n\t\t\tif ( blockDropTarget?.clientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ blockDropTarget.clientId ];\n\t\t\t\t// If dragging below or inside the block, treat the drop target as the next block.\n\t\t\t\t_blockDropTargetIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t} else if ( blockDropTarget === null ) {\n\t\t\t\t// A `null` value is used to indicate that the user is dragging outside of the list view.\n\t\t\t\t_blockDropTargetIndex = null;\n\t\t\t}\n\n\t\t\tif ( firstDraggedBlockClientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ firstDraggedBlockClientId ];\n\t\t\t\t_firstDraggedBlockIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tblockDropTargetIndex: _blockDropTargetIndex,\n\t\t\t\tblockDropPosition: blockDropTarget?.dropPosition,\n\t\t\t\tfirstDraggedBlockIndex: _firstDraggedBlockIndex,\n\t\t\t};\n\t\t}, [ blockDropTarget, blockIndexes, firstDraggedBlockClientId ] );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\n\t\t\tcollapse,\n\t\t\tcollapseAll,\n\t\t\tBlockSettingsMenu,\n\t\t\tlistViewInstanceId: instanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\ttreeGridElementRef: elementRef,\n\t\t\trootClientId,\n\t\t} ),\n\t\t[\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\n\t\t\tcollapse,\n\t\t\tcollapseAll,\n\t\t\tBlockSettingsMenu,\n\t\t\tinstanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\trootClientId,\n\t\t]\n\t);\n\n\t// List View renders a fixed number of items and relies on each having a fixed item height of 36px.\n\t// If this value changes, we should also change the itemHeight value set in useFixedWindowList.\n\t// See: https://github.com/WordPress/gutenberg/pull/35230 for additional context.\n\tconst [ fixedListWindow ] = useFixedWindowList(\n\t\telementRef,\n\t\tBLOCK_LIST_ITEM_HEIGHT,\n\t\tvisibleBlockCount,\n\t\t{\n\t\t\t// Ensure that the windowing logic is recalculated when the expanded state changes.\n\t\t\t// This is necessary because expanding a collapsed block in a short list view can\n\t\t\t// switch the list view to a tall list view with a scrollbar, and vice versa.\n\t\t\t// When this happens, the windowing logic needs to be recalculated to ensure that\n\t\t\t// the correct number of blocks are rendered, by rechecking for a scroll container.\n\t\t\texpandedState,\n\t\t\tuseWindowing: true,\n\t\t\twindowOverscan: 40,\n\t\t}\n\t);\n\n\t// If there are no blocks to show and we're not showing the appender, do not render the list view.\n\tif ( ! clientIdsTree.length && ! showAppender ) {\n\t\treturn null;\n\t}\n\n\tconst describedById =\n\t\tdescription && `block-editor-list-view-description-${ instanceId }`;\n\n\treturn (\n\t\t<AsyncModeProvider value>\n\t\t\t<ListViewDropIndicatorPreview\n\t\t\t\tdraggedBlockClientId={ firstDraggedBlockClientId }\n\t\t\t\tlistViewRef={ elementRef }\n\t\t\t\tblockDropTarget={ blockDropTarget }\n\t\t\t/>\n\t\t\t{ description && (\n\t\t\t\t<VisuallyHidden id={ describedById }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t\t<TreeGrid\n\t\t\t\tid={ id }\n\t\t\t\tclassName={ clsx( 'block-editor-list-view-tree', {\n\t\t\t\t\t'is-dragging':\n\t\t\t\t\t\tdraggedClientIds?.length > 0 &&\n\t\t\t\t\t\tblockDropTargetIndex !== undefined,\n\t\t\t\t} ) }\n\t\t\t\taria-label={ __( 'Block navigation structure' ) }\n\t\t\t\tref={ treeGridRef }\n\t\t\t\tonCollapseRow={ collapseRow }\n\t\t\t\tonExpandRow={ expandRow }\n\t\t\t\tonFocusRow={ focusRow }\n\t\t\t\tapplicationAriaLabel={ __( 'Block navigation structure' ) }\n\t\t\t\taria-describedby={ describedById }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-admin--list-view-dragged-items-height':\n\t\t\t\t\t\tdraggedClientIds?.length\n\t\t\t\t\t\t\t? `${\n\t\t\t\t\t\t\t\t\tBLOCK_LIST_ITEM_HEIGHT *\n\t\t\t\t\t\t\t\t\t( draggedClientIds.length - 1 )\n\t\t\t\t\t\t\t }px`\n\t\t\t\t\t\t\t: null,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ListViewContext.Provider value={ contextValue }>\n\t\t\t\t\t<ListViewBranch\n\t\t\t\t\t\tblocks={ clientIdsTree }\n\t\t\t\t\t\tparentId={ rootClientId }\n\t\t\t\t\t\tselectBlock={ selectEditorBlock }\n\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\tfixedListWindow={ fixedListWindow }\n\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\tshouldShowInnerBlocks={ shouldShowInnerBlocks }\n\t\t\t\t\t\tshowAppender={ showAppender }\n\t\t\t\t\t/>\n\t\t\t\t</ListViewContext.Provider>\n\t\t\t</TreeGrid>\n\t\t</AsyncModeProvider>\n\t);\n}\n\n// This is the private API for the ListView component.\n// It allows access to all props, not just the public ones.\nexport const PrivateListView = forwardRef( ListViewComponent );\n\n// This is the public API for the ListView component.\n// We wrap the PrivateListView component to hide some props from the public API.\nexport default forwardRef( ( props, ref ) => {\n\treturn (\n\t\t<PrivateListView\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tshowAppender={ false }\n\t\t\trootClientId={ null }\n\t\t\tonSelect={ null }\n\t\t\tadditionalBlockContent={ null }\n\t\t\tblockSettingsMenu={ undefined }\n\t\t/>\n\t);\n} );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AASA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,OAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAV,sBAAA,CAA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eAAe,GAAAxH,OAAA,CAAAwH,eAAA,GAAG,IAAAC,mBAAU,EAAExH,iBAAkB,CAAC;;AAE9D;AACA;AAAA,IAAAyH,QAAA,GAAA1H,OAAA,CAAAwG,OAAA,GACe,IAAAiB,mBAAU,EAAE,CAAEE,KAAK,EAAE5G,GAAG,KAAM;EAC5C,OACC,IAAAqF,MAAA,CAAAC,aAAA,EAACmB,eAAe;IACfzG,GAAG,EAAGA,GAAK;IAAA,GACN4G,KAAK;IACVrH,YAAY,EAAG,KAAO;IACtBI,YAAY,EAAG,IAAM;IACrBE,QAAQ,EAAG,IAAM;IACjBC,sBAAsB,EAAG,IAAM;IAC/BN,iBAAiB,EAAGmF;EAAW,CAC/B,CAAC;AAEJ,CAAE,CAAC","ignoreList":[]}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = require("react");
9
9
  var _web = require("@react-spring/web");
10
- var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _clsx = _interopRequireDefault(require("clsx"));
11
11
  var _components = require("@wordpress/components");
12
12
  var _compose = require("@wordpress/compose");
13
13
  var _element = require("@wordpress/element");
@@ -44,7 +44,7 @@ const ListViewLeaf = (0, _element.forwardRef)(({
44
44
  const mergedRef = (0, _compose.useMergeRefs)([ref, animationRef]);
45
45
  return (0, _react.createElement)(AnimatedTreeGridRow, {
46
46
  ref: mergedRef,
47
- className: (0, _classnames.default)('block-editor-list-view-leaf', className),
47
+ className: (0, _clsx.default)('block-editor-list-view-leaf', className),
48
48
  level: level,
49
49
  positionInSet: position,
50
50
  setSize: rowCount,
@@ -1 +1 @@
1
- {"version":3,"names":["_web","require","_classnames","_interopRequireDefault","_components","_compose","_element","_useMovingAnimation","AnimatedTreeGridRow","animated","TreeGridRow","ListViewLeaf","forwardRef","isDragged","isSelected","position","level","rowCount","children","className","path","props","ref","animationRef","useMovingAnimation","clientId","enableAnimation","triggerAnimationOnChange","mergedRef","useMergeRefs","_react","createElement","classnames","positionInSet","setSize","isExpanded","undefined","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/list-view/leaf.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { animated } from '@react-spring/web';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalTreeGridRow as TreeGridRow } from '@wordpress/components';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../use-moving-animation';\n\nconst AnimatedTreeGridRow = animated( TreeGridRow );\n\nconst ListViewLeaf = forwardRef(\n\t(\n\t\t{\n\t\t\tisDragged,\n\t\t\tisSelected,\n\t\t\tposition,\n\t\t\tlevel,\n\t\t\trowCount,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tpath,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) => {\n\t\tconst animationRef = useMovingAnimation( {\n\t\t\tclientId: props[ 'data-block' ],\n\t\t\tenableAnimation: true,\n\t\t\ttriggerAnimationOnChange: path,\n\t\t} );\n\n\t\tconst mergedRef = useMergeRefs( [ ref, animationRef ] );\n\n\t\treturn (\n\t\t\t<AnimatedTreeGridRow\n\t\t\t\tref={ mergedRef }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-list-view-leaf',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\tlevel={ level }\n\t\t\t\tpositionInSet={ position }\n\t\t\t\tsetSize={ rowCount }\n\t\t\t\tisExpanded={ undefined }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</AnimatedTreeGridRow>\n\t\t);\n\t}\n);\n\nexport default ListViewLeaf;\n"],"mappings":";;;;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,mBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAhBA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,MAAMO,mBAAmB,GAAG,IAAAC,aAAQ,EAAEC,qCAAY,CAAC;AAEnD,MAAMC,YAAY,GAAG,IAAAC,mBAAU,EAC9B,CACC;EACCC,SAAS;EACTC,UAAU;EACVC,QAAQ;EACRC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,SAAS;EACTC,IAAI;EACJ,GAAGC;AACJ,CAAC,EACDC,GAAG,KACC;EACJ,MAAMC,YAAY,GAAG,IAAAC,2BAAkB,EAAE;IACxCC,QAAQ,EAAEJ,KAAK,CAAE,YAAY,CAAE;IAC/BK,eAAe,EAAE,IAAI;IACrBC,wBAAwB,EAAEP;EAC3B,CAAE,CAAC;EAEH,MAAMQ,SAAS,GAAG,IAAAC,qBAAY,EAAE,CAAEP,GAAG,EAAEC,YAAY,CAAG,CAAC;EAEvD,OACC,IAAAO,MAAA,CAAAC,aAAA,EAACvB,mBAAmB;IACnBc,GAAG,EAAGM,SAAW;IACjBT,SAAS,EAAG,IAAAa,mBAAU,EACrB,6BAA6B,EAC7Bb,SACD,CAAG;IACHH,KAAK,EAAGA,KAAO;IACfiB,aAAa,EAAGlB,QAAU;IAC1BmB,OAAO,EAAGjB,QAAU;IACpBkB,UAAU,EAAGC,SAAW;IAAA,GACnBf;EAAK,GAERH,QACkB,CAAC;AAExB,CACD,CAAC;AAAC,IAAAmB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa5B,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["_web","require","_clsx","_interopRequireDefault","_components","_compose","_element","_useMovingAnimation","AnimatedTreeGridRow","animated","TreeGridRow","ListViewLeaf","forwardRef","isDragged","isSelected","position","level","rowCount","children","className","path","props","ref","animationRef","useMovingAnimation","clientId","enableAnimation","triggerAnimationOnChange","mergedRef","useMergeRefs","_react","createElement","clsx","positionInSet","setSize","isExpanded","undefined","_default","exports","default"],"sources":["@wordpress/block-editor/src/components/list-view/leaf.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { animated } from '@react-spring/web';\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalTreeGridRow as TreeGridRow } from '@wordpress/components';\nimport { useMergeRefs } from '@wordpress/compose';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport useMovingAnimation from '../use-moving-animation';\n\nconst AnimatedTreeGridRow = animated( TreeGridRow );\n\nconst ListViewLeaf = forwardRef(\n\t(\n\t\t{\n\t\t\tisDragged,\n\t\t\tisSelected,\n\t\t\tposition,\n\t\t\tlevel,\n\t\t\trowCount,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tpath,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) => {\n\t\tconst animationRef = useMovingAnimation( {\n\t\t\tclientId: props[ 'data-block' ],\n\t\t\tenableAnimation: true,\n\t\t\ttriggerAnimationOnChange: path,\n\t\t} );\n\n\t\tconst mergedRef = useMergeRefs( [ ref, animationRef ] );\n\n\t\treturn (\n\t\t\t<AnimatedTreeGridRow\n\t\t\t\tref={ mergedRef }\n\t\t\t\tclassName={ clsx( 'block-editor-list-view-leaf', className ) }\n\t\t\t\tlevel={ level }\n\t\t\t\tpositionInSet={ position }\n\t\t\t\tsetSize={ rowCount }\n\t\t\t\tisExpanded={ undefined }\n\t\t\t\t{ ...props }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</AnimatedTreeGridRow>\n\t\t);\n\t}\n);\n\nexport default ListViewLeaf;\n"],"mappings":";;;;;;;;AAGA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,mBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAhBA;AACA;AACA;;AAIA;AACA;AACA;;AAKA;AACA;AACA;;AAGA,MAAMO,mBAAmB,GAAG,IAAAC,aAAQ,EAAEC,qCAAY,CAAC;AAEnD,MAAMC,YAAY,GAAG,IAAAC,mBAAU,EAC9B,CACC;EACCC,SAAS;EACTC,UAAU;EACVC,QAAQ;EACRC,KAAK;EACLC,QAAQ;EACRC,QAAQ;EACRC,SAAS;EACTC,IAAI;EACJ,GAAGC;AACJ,CAAC,EACDC,GAAG,KACC;EACJ,MAAMC,YAAY,GAAG,IAAAC,2BAAkB,EAAE;IACxCC,QAAQ,EAAEJ,KAAK,CAAE,YAAY,CAAE;IAC/BK,eAAe,EAAE,IAAI;IACrBC,wBAAwB,EAAEP;EAC3B,CAAE,CAAC;EAEH,MAAMQ,SAAS,GAAG,IAAAC,qBAAY,EAAE,CAAEP,GAAG,EAAEC,YAAY,CAAG,CAAC;EAEvD,OACC,IAAAO,MAAA,CAAAC,aAAA,EAACvB,mBAAmB;IACnBc,GAAG,EAAGM,SAAW;IACjBT,SAAS,EAAG,IAAAa,aAAI,EAAE,6BAA6B,EAAEb,SAAU,CAAG;IAC9DH,KAAK,EAAGA,KAAO;IACfiB,aAAa,EAAGlB,QAAU;IAC1BmB,OAAO,EAAGjB,QAAU;IACpBkB,UAAU,EAAGC,SAAW;IAAA,GACnBf;EAAK,GAERH,QACkB,CAAC;AAExB,CACD,CAAC;AAAC,IAAAmB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa5B,YAAY","ignoreList":[]}
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.MediaPlaceholder = MediaPlaceholder;
8
8
  exports.default = void 0;
9
9
  var _react = require("react");
10
- var _classnames = _interopRequireDefault(require("classnames"));
10
+ var _clsx = _interopRequireDefault(require("clsx"));
11
11
  var _components = require("@wordpress/components");
12
12
  var _i18n = require("@wordpress/i18n");
13
13
  var _element = require("@wordpress/element");
@@ -290,7 +290,7 @@ function MediaPlaceholder({
290
290
  }
291
291
  }
292
292
  }
293
- const placeholderClassName = (0, _classnames.default)('block-editor-media-placeholder', className, {
293
+ const placeholderClassName = (0, _clsx.default)('block-editor-media-placeholder', className, {
294
294
  'is-appender': isAppender
295
295
  });
296
296
  return (0, _react.createElement)(_components.Placeholder, {
@@ -375,7 +375,7 @@ function MediaPlaceholder({
375
375
  }) => {
376
376
  const content = (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.Button, {
377
377
  variant: "primary",
378
- className: (0, _classnames.default)('block-editor-media-placeholder__button', 'block-editor-media-placeholder__upload-button'),
378
+ className: (0, _clsx.default)('block-editor-media-placeholder__button', 'block-editor-media-placeholder__upload-button'),
379
379
  onClick: openFileDialog
380
380
  }, (0, _i18n.__)('Upload')), uploadMediaLibraryButton, renderUrlSelectionUI(), renderFeaturedImageToggle(), renderCancelLink());
381
381
  return renderPlaceholder(content);
@@ -385,7 +385,7 @@ function MediaPlaceholder({
385
385
  if (mediaUpload) {
386
386
  const content = (0, _react.createElement)(_react.Fragment, null, renderDropZone(), (0, _react.createElement)(_components.FormFileUpload, {
387
387
  variant: "primary",
388
- className: (0, _classnames.default)('block-editor-media-placeholder__button', 'block-editor-media-placeholder__upload-button'),
388
+ className: (0, _clsx.default)('block-editor-media-placeholder__button', 'block-editor-media-placeholder__upload-button'),
389
389
  onChange: onUpload,
390
390
  accept: accept,
391
391
  multiple: !!multiple
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_components","_i18n","_element","_data","_icons","_blocks2","_deprecated","_mediaUpload","_check","_urlPopover","_store","noop","InsertFromURLPopover","src","onChange","onSubmit","onClose","popoverAnchor","_react","createElement","default","anchor","className","type","__","placeholder","value","Button","icon","keyboardReturn","label","URLSelectionUI","isURLInputVisible","onChangeSrc","onSubmitSrc","openURLInput","closeURLInput","setPopoverAnchor","useState","ref","onClick","isPressed","variant","MediaPlaceholder","allowedTypes","labels","mediaPreview","notices","isAppender","accept","addToGallery","multiple","handleUpload","disableDropZone","disableMediaButtons","onError","onSelect","onCancel","onSelectURL","onToggleFeaturedImage","onDoubleClick","onFilesPreUpload","onHTMLDrop","deprecatedOnHTMLDrop","children","mediaLibraryButton","style","deprecated","since","version","mediaUpload","useSelect","select","getSettings","blockEditorStore","setSrc","setIsURLInputVisible","useEffect","_value$src","onlyAllowsImages","length","every","allowedType","startsWith","event","target","preventDefault","onFilesUpload","files","setMedia","lastMediaPassed","newMedia","filteredMedia","filter","item","id","some","Number","urlSlug","url","includes","concat","map","media","cutOffIndex","lastIndexOf","slice","filesList","onFileChange","handleBlocksDrop","blocks","Array","isArray","recursivelyFindMediaFromBlocks","_blocks","flatMap","block","name","attributes","innerBlocks","mediaBlocks","uploadedMediaList","Promise","all","resolve","reject","window","fetch","then","response","blob","additionalData","title","alt_text","alt","caption","catch","err","HTML","pasteHandler","onUpload","defaultRenderPlaceholder","content","instructions","undefined","typesAllowed","firstAllowedType","isOneType","isAudio","isImage","isVideo","placeholderClassName","classnames","Placeholder","preview","renderPlaceholder","renderDropZone","DropZone","onFilesDrop","renderCancelLink","renderUrlSelectionUI","renderFeaturedImageToggle","renderMediaUploadChecked","defaultButton","open","libraryButton","uploadMediaLibraryButton","gallery","mode","render","Fragment","FormFileUpload","openFileDialog","fallback","_default","exports","withFilters"],"sources":["@wordpress/block-editor/src/components/media-placeholder/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tFormFileUpload,\n\tPlaceholder,\n\tDropZone,\n\twithFilters,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { keyboardReturn } from '@wordpress/icons';\nimport { pasteHandler } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport MediaUpload from '../media-upload';\nimport MediaUploadCheck from '../media-upload/check';\nimport URLPopover from '../url-popover';\nimport { store as blockEditorStore } from '../../store';\n\nconst noop = () => {};\n\nconst InsertFromURLPopover = ( {\n\tsrc,\n\tonChange,\n\tonSubmit,\n\tonClose,\n\tpopoverAnchor,\n} ) => (\n\t<URLPopover anchor={ popoverAnchor } onClose={ onClose }>\n\t\t<form\n\t\t\tclassName=\"block-editor-media-placeholder__url-input-form\"\n\t\t\tonSubmit={ onSubmit }\n\t\t>\n\t\t\t<input\n\t\t\t\tclassName=\"block-editor-media-placeholder__url-input-field\"\n\t\t\t\ttype=\"text\"\n\t\t\t\taria-label={ __( 'URL' ) }\n\t\t\t\tplaceholder={ __( 'Paste or type URL' ) }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tvalue={ src }\n\t\t\t/>\n\t\t\t<Button\n\t\t\t\tclassName=\"block-editor-media-placeholder__url-input-submit-button\"\n\t\t\t\ticon={ keyboardReturn }\n\t\t\t\tlabel={ __( 'Apply' ) }\n\t\t\t\ttype=\"submit\"\n\t\t\t/>\n\t\t</form>\n\t</URLPopover>\n);\n\nconst URLSelectionUI = ( {\n\tisURLInputVisible,\n\tsrc,\n\tonChangeSrc,\n\tonSubmitSrc,\n\topenURLInput,\n\tcloseURLInput,\n} ) => {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"block-editor-media-placeholder__url-input-container\"\n\t\t\tref={ setPopoverAnchor }\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"block-editor-media-placeholder__button\"\n\t\t\t\tonClick={ openURLInput }\n\t\t\t\tisPressed={ isURLInputVisible }\n\t\t\t\tvariant=\"secondary\"\n\t\t\t>\n\t\t\t\t{ __( 'Insert from URL' ) }\n\t\t\t</Button>\n\t\t\t{ isURLInputVisible && (\n\t\t\t\t<InsertFromURLPopover\n\t\t\t\t\tsrc={ src }\n\t\t\t\t\tonChange={ onChangeSrc }\n\t\t\t\t\tonSubmit={ onSubmitSrc }\n\t\t\t\t\tonClose={ closeURLInput }\n\t\t\t\t\tpopoverAnchor={ popoverAnchor }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\nexport function MediaPlaceholder( {\n\tvalue = {},\n\tallowedTypes,\n\tclassName,\n\ticon,\n\tlabels = {},\n\tmediaPreview,\n\tnotices,\n\tisAppender,\n\taccept,\n\taddToGallery,\n\tmultiple = false,\n\thandleUpload = true,\n\tdisableDropZone,\n\tdisableMediaButtons,\n\tonError,\n\tonSelect,\n\tonCancel,\n\tonSelectURL,\n\tonToggleFeaturedImage,\n\tonDoubleClick,\n\tonFilesPreUpload = noop,\n\tonHTMLDrop: deprecatedOnHTMLDrop,\n\tchildren,\n\tmediaLibraryButton,\n\tplaceholder,\n\tstyle,\n} ) {\n\tif ( deprecatedOnHTMLDrop ) {\n\t\tdeprecated( 'wp.blockEditor.MediaPlaceholder onHTMLDrop prop', {\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t} );\n\t}\n\n\tconst mediaUpload = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().mediaUpload;\n\t}, [] );\n\tconst [ src, setSrc ] = useState( '' );\n\tconst [ isURLInputVisible, setIsURLInputVisible ] = useState( false );\n\n\tuseEffect( () => {\n\t\tsetSrc( value?.src ?? '' );\n\t}, [ value?.src ] );\n\n\tconst onlyAllowsImages = () => {\n\t\tif ( ! allowedTypes || allowedTypes.length === 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn allowedTypes.every(\n\t\t\t( allowedType ) =>\n\t\t\t\tallowedType === 'image' || allowedType.startsWith( 'image/' )\n\t\t);\n\t};\n\n\tconst onChangeSrc = ( event ) => {\n\t\tsetSrc( event.target.value );\n\t};\n\n\tconst openURLInput = () => {\n\t\tsetIsURLInputVisible( true );\n\t};\n\tconst closeURLInput = () => {\n\t\tsetIsURLInputVisible( false );\n\t};\n\n\tconst onSubmitSrc = ( event ) => {\n\t\tevent.preventDefault();\n\t\tif ( src && onSelectURL ) {\n\t\t\tonSelectURL( src );\n\t\t\tcloseURLInput();\n\t\t}\n\t};\n\n\tconst onFilesUpload = ( files ) => {\n\t\tif ( ! handleUpload ) {\n\t\t\treturn onSelect( files );\n\t\t}\n\t\tonFilesPreUpload( files );\n\t\tlet setMedia;\n\t\tif ( multiple ) {\n\t\t\tif ( addToGallery ) {\n\t\t\t\t// Since the setMedia function runs multiple times per upload group\n\t\t\t\t// and is passed newMedia containing every item in its group each time, we must\n\t\t\t\t// filter out whatever this upload group had previously returned to the\n\t\t\t\t// gallery before adding and returning the image array with replacement newMedia\n\t\t\t\t// values.\n\n\t\t\t\t// Define an array to store urls from newMedia between subsequent function calls.\n\t\t\t\tlet lastMediaPassed = [];\n\t\t\t\tsetMedia = ( newMedia ) => {\n\t\t\t\t\t// Remove any images this upload group is responsible for (lastMediaPassed).\n\t\t\t\t\t// Their replacements are contained in newMedia.\n\t\t\t\t\tconst filteredMedia = ( value ?? [] ).filter( ( item ) => {\n\t\t\t\t\t\t// If Item has id, only remove it if lastMediaPassed has an item with that id.\n\t\t\t\t\t\tif ( item.id ) {\n\t\t\t\t\t\t\treturn ! lastMediaPassed.some(\n\t\t\t\t\t\t\t\t// Be sure to convert to number for comparison.\n\t\t\t\t\t\t\t\t( { id } ) => Number( id ) === Number( item.id )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compare transient images via .includes since gallery may append extra info onto the url.\n\t\t\t\t\t\treturn ! lastMediaPassed.some( ( { urlSlug } ) =>\n\t\t\t\t\t\t\titem.url.includes( urlSlug )\n\t\t\t\t\t\t);\n\t\t\t\t\t} );\n\t\t\t\t\t// Return the filtered media array along with newMedia.\n\t\t\t\t\tonSelect( filteredMedia.concat( newMedia ) );\n\t\t\t\t\t// Reset lastMediaPassed and set it with ids and urls from newMedia.\n\t\t\t\t\tlastMediaPassed = newMedia.map( ( media ) => {\n\t\t\t\t\t\t// Add everything up to '.fileType' to compare via .includes.\n\t\t\t\t\t\tconst cutOffIndex = media.url.lastIndexOf( '.' );\n\t\t\t\t\t\tconst urlSlug = media.url.slice( 0, cutOffIndex );\n\t\t\t\t\t\treturn { id: media.id, urlSlug };\n\t\t\t\t\t} );\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tsetMedia = onSelect;\n\t\t\t}\n\t\t} else {\n\t\t\tsetMedia = ( [ media ] ) => onSelect( media );\n\t\t}\n\t\tmediaUpload( {\n\t\t\tallowedTypes,\n\t\t\tfilesList: files,\n\t\t\tonFileChange: setMedia,\n\t\t\tonError,\n\t\t} );\n\t};\n\n\tasync function handleBlocksDrop( blocks ) {\n\t\tif ( ! blocks || ! Array.isArray( blocks ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfunction recursivelyFindMediaFromBlocks( _blocks ) {\n\t\t\treturn _blocks.flatMap( ( block ) =>\n\t\t\t\t( block.name === 'core/image' ||\n\t\t\t\t\tblock.name === 'core/audio' ||\n\t\t\t\t\tblock.name === 'core/video' ) &&\n\t\t\t\tblock.attributes.url\n\t\t\t\t\t? [ block ]\n\t\t\t\t\t: recursivelyFindMediaFromBlocks( block.innerBlocks )\n\t\t\t);\n\t\t}\n\n\t\tconst mediaBlocks = recursivelyFindMediaFromBlocks( blocks );\n\n\t\tif ( ! mediaBlocks.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst uploadedMediaList = await Promise.all(\n\t\t\tmediaBlocks.map( ( block ) =>\n\t\t\t\tblock.attributes.id\n\t\t\t\t\t? block.attributes\n\t\t\t\t\t: new Promise( ( resolve, reject ) => {\n\t\t\t\t\t\t\twindow\n\t\t\t\t\t\t\t\t.fetch( block.attributes.url )\n\t\t\t\t\t\t\t\t.then( ( response ) => response.blob() )\n\t\t\t\t\t\t\t\t.then( ( blob ) =>\n\t\t\t\t\t\t\t\t\tmediaUpload( {\n\t\t\t\t\t\t\t\t\t\tfilesList: [ blob ],\n\t\t\t\t\t\t\t\t\t\tadditionalData: {\n\t\t\t\t\t\t\t\t\t\t\ttitle: block.attributes.title,\n\t\t\t\t\t\t\t\t\t\t\talt_text: block.attributes.alt,\n\t\t\t\t\t\t\t\t\t\t\tcaption: block.attributes.caption,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonFileChange: ( [ media ] ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( media.id ) {\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( media );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tallowedTypes,\n\t\t\t\t\t\t\t\t\t\tonError: reject,\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\t.catch( () => resolve( block.attributes.url ) );\n\t\t\t\t\t } )\n\t\t\t)\n\t\t).catch( ( err ) => onError( err ) );\n\n\t\tif ( multiple ) {\n\t\t\tonSelect( uploadedMediaList );\n\t\t} else {\n\t\t\tonSelect( uploadedMediaList[ 0 ] );\n\t\t}\n\t}\n\n\tasync function onHTMLDrop( HTML ) {\n\t\tconst blocks = pasteHandler( { HTML } );\n\t\treturn await handleBlocksDrop( blocks );\n\t}\n\n\tconst onUpload = ( event ) => {\n\t\tonFilesUpload( event.target.files );\n\t};\n\n\tconst defaultRenderPlaceholder = ( content ) => {\n\t\tlet { instructions, title } = labels;\n\n\t\tif ( ! mediaUpload && ! onSelectURL ) {\n\t\t\tinstructions = __(\n\t\t\t\t'To edit this block, you need permission to upload media.'\n\t\t\t);\n\t\t}\n\n\t\tif ( instructions === undefined || title === undefined ) {\n\t\t\tconst typesAllowed = allowedTypes ?? [];\n\n\t\t\tconst [ firstAllowedType ] = typesAllowed;\n\t\t\tconst isOneType = 1 === typesAllowed.length;\n\t\t\tconst isAudio = isOneType && 'audio' === firstAllowedType;\n\t\t\tconst isImage = isOneType && 'image' === firstAllowedType;\n\t\t\tconst isVideo = isOneType && 'video' === firstAllowedType;\n\n\t\t\tif ( instructions === undefined && mediaUpload ) {\n\t\t\t\tinstructions = __(\n\t\t\t\t\t'Upload a media file or pick one from your media library.'\n\t\t\t\t);\n\n\t\t\t\tif ( isAudio ) {\n\t\t\t\t\tinstructions = __(\n\t\t\t\t\t\t'Upload an audio file, pick one from your media library, or add one with a URL.'\n\t\t\t\t\t);\n\t\t\t\t} else if ( isImage ) {\n\t\t\t\t\tinstructions = __(\n\t\t\t\t\t\t'Upload an image file, pick one from your media library, or add one with a URL.'\n\t\t\t\t\t);\n\t\t\t\t} else if ( isVideo ) {\n\t\t\t\t\tinstructions = __(\n\t\t\t\t\t\t'Upload a video file, pick one from your media library, or add one with a URL.'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( title === undefined ) {\n\t\t\t\ttitle = __( 'Media' );\n\n\t\t\t\tif ( isAudio ) {\n\t\t\t\t\ttitle = __( 'Audio' );\n\t\t\t\t} else if ( isImage ) {\n\t\t\t\t\ttitle = __( 'Image' );\n\t\t\t\t} else if ( isVideo ) {\n\t\t\t\t\ttitle = __( 'Video' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst placeholderClassName = classnames(\n\t\t\t'block-editor-media-placeholder',\n\t\t\tclassName,\n\t\t\t{\n\t\t\t\t'is-appender': isAppender,\n\t\t\t}\n\t\t);\n\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ title }\n\t\t\t\tinstructions={ instructions }\n\t\t\t\tclassName={ placeholderClassName }\n\t\t\t\tnotices={ notices }\n\t\t\t\tonDoubleClick={ onDoubleClick }\n\t\t\t\tpreview={ mediaPreview }\n\t\t\t\tstyle={ style }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t\t{ children }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\tconst renderPlaceholder = placeholder ?? defaultRenderPlaceholder;\n\n\tconst renderDropZone = () => {\n\t\tif ( disableDropZone ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<DropZone onFilesDrop={ onFilesUpload } onHTMLDrop={ onHTMLDrop } />\n\t\t);\n\t};\n\n\tconst renderCancelLink = () => {\n\t\treturn (\n\t\t\tonCancel && (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"block-editor-media-placeholder__cancel-button\"\n\t\t\t\t\ttitle={ __( 'Cancel' ) }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\tonClick={ onCancel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</Button>\n\t\t\t)\n\t\t);\n\t};\n\n\tconst renderUrlSelectionUI = () => {\n\t\treturn (\n\t\t\tonSelectURL && (\n\t\t\t\t<URLSelectionUI\n\t\t\t\t\tisURLInputVisible={ isURLInputVisible }\n\t\t\t\t\tsrc={ src }\n\t\t\t\t\tonChangeSrc={ onChangeSrc }\n\t\t\t\t\tonSubmitSrc={ onSubmitSrc }\n\t\t\t\t\topenURLInput={ openURLInput }\n\t\t\t\t\tcloseURLInput={ closeURLInput }\n\t\t\t\t/>\n\t\t\t)\n\t\t);\n\t};\n\n\tconst renderFeaturedImageToggle = () => {\n\t\treturn (\n\t\t\tonToggleFeaturedImage && (\n\t\t\t\t<div className=\"block-editor-media-placeholder__url-input-container\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"block-editor-media-placeholder__button\"\n\t\t\t\t\t\tonClick={ onToggleFeaturedImage }\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Use featured image' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t)\n\t\t);\n\t};\n\n\tconst renderMediaUploadChecked = () => {\n\t\tconst defaultButton = ( { open } ) => {\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\topen();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Media Library' ) }\n\t\t\t\t</Button>\n\t\t\t);\n\t\t};\n\t\tconst libraryButton = mediaLibraryButton ?? defaultButton;\n\t\tconst uploadMediaLibraryButton = (\n\t\t\t<MediaUpload\n\t\t\t\taddToGallery={ addToGallery }\n\t\t\t\tgallery={ multiple && onlyAllowsImages() }\n\t\t\t\tmultiple={ multiple }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tallowedTypes={ allowedTypes }\n\t\t\t\tmode={ 'browse' }\n\t\t\t\tvalue={\n\t\t\t\t\tArray.isArray( value )\n\t\t\t\t\t\t? value.map( ( { id } ) => id )\n\t\t\t\t\t\t: value.id\n\t\t\t\t}\n\t\t\t\trender={ libraryButton }\n\t\t\t/>\n\t\t);\n\n\t\tif ( mediaUpload && isAppender ) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t{ renderDropZone() }\n\t\t\t\t\t<FormFileUpload\n\t\t\t\t\t\tonChange={ onUpload }\n\t\t\t\t\t\taccept={ accept }\n\t\t\t\t\t\tmultiple={ !! multiple }\n\t\t\t\t\t\trender={ ( { openFileDialog } ) => {\n\t\t\t\t\t\t\tconst content = (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t\t\t'block-editor-media-placeholder__button',\n\t\t\t\t\t\t\t\t\t\t\t'block-editor-media-placeholder__upload-button'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tonClick={ openFileDialog }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Upload' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t{ uploadMediaLibraryButton }\n\t\t\t\t\t\t\t\t\t{ renderUrlSelectionUI() }\n\t\t\t\t\t\t\t\t\t{ renderFeaturedImageToggle() }\n\t\t\t\t\t\t\t\t\t{ renderCancelLink() }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn renderPlaceholder( content );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t);\n\t\t}\n\n\t\tif ( mediaUpload ) {\n\t\t\tconst content = (\n\t\t\t\t<>\n\t\t\t\t\t{ renderDropZone() }\n\t\t\t\t\t<FormFileUpload\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t'block-editor-media-placeholder__button',\n\t\t\t\t\t\t\t'block-editor-media-placeholder__upload-button'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonChange={ onUpload }\n\t\t\t\t\t\taccept={ accept }\n\t\t\t\t\t\tmultiple={ !! multiple }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Upload' ) }\n\t\t\t\t\t</FormFileUpload>\n\t\t\t\t\t{ uploadMediaLibraryButton }\n\t\t\t\t\t{ renderUrlSelectionUI() }\n\t\t\t\t\t{ renderFeaturedImageToggle() }\n\t\t\t\t\t{ renderCancelLink() }\n\t\t\t\t</>\n\t\t\t);\n\t\t\treturn renderPlaceholder( content );\n\t\t}\n\n\t\treturn renderPlaceholder( uploadMediaLibraryButton );\n\t};\n\n\tif ( disableMediaButtons ) {\n\t\treturn <MediaUploadCheck>{ renderDropZone() }</MediaUploadCheck>;\n\t}\n\n\treturn (\n\t\t<MediaUploadCheck\n\t\t\tfallback={ renderPlaceholder( renderUrlSelectionUI() ) }\n\t\t>\n\t\t\t{ renderMediaUploadChecked() }\n\t\t</MediaUploadCheck>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-placeholder/README.md\n */\nexport default withFilters( 'editor.MediaPlaceholder' )( MediaPl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BAAiB,CAAEb,OAAQ,CAAC;QACpC;MAAG,CACH,CACA,CAAC;IAEL;IAEA,IAAKxE,WAAW,EAAG;MAClB,MAAMwE,OAAO,GACZ,IAAA5H,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAwJ,QAAA,QACGd,cAAc,CAAC,CAAC,EAClB,IAAA1I,MAAA,CAAAC,aAAA,EAACnB,WAAA,CAAA2K,cAAc;QACdjI,OAAO,EAAC,SAAS;QACjBpB,SAAS,EAAG,IAAAkI,mBAAU,EACrB,wCAAwC,EACxC,+CACD,CAAG;QACH1I,QAAQ,EAAG8H,QAAU;QACrB3F,MAAM,EAAGA,MAAQ;QACjBE,QAAQ,EAAG,CAAC,CAAEA;MAAU,GAEtB,IAAA3B,QAAE,EAAE,QAAS,CACA,CAAC,EACf8I,wBAAwB,EACxBN,oBAAoB,CAAC,CAAC,EACtBC,yBAAyB,CAAC,CAAC,EAC3BF,gBAAgB,CAAC,CAClB,CACF;MACD,OAAOJ,iBAAiB,CAAEb,OAAQ,CAAC;IACpC;IAEA,OAAOa,iBAAiB,CAAEW,wBAAyB,CAAC;EACrD,CAAC;EAED,IAAKhH,mBAAmB,EAAG;IAC1B,OAAO,IAAApC,MAAA,CAAAC,aAAA,EAACX,MAAA,CAAAY,OAAgB,QAAGwI,cAAc,CAAC,CAAqB,CAAC;EACjE;EAEA,OACC,IAAA1I,MAAA,CAAAC,aAAA,EAACX,MAAA,CAAAY,OAAgB;IAChByJ,QAAQ,EAAGlB,iBAAiB,CAAEK,oBAAoB,CAAC,CAAE;EAAG,GAEtDE,wBAAwB,CAAC,CACV,CAAC;AAErB;;AAEA;AACA;AACA;AAFA,IAAAY,QAAA,GAAAC,OAAA,CAAA3J,OAAA,GAGe,IAAA4J,uBAAW,EAAE,yBAA0B,CAAC,CAAErI,gBAAiB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_components","_i18n","_element","_data","_icons","_blocks2","_deprecated","_mediaUpload","_check","_urlPopover","_store","noop","InsertFromURLPopover","src","onChange","onSubmit","onClose","popoverAnchor","_react","createElement","default","anchor","className","type","__","placeholder","value","Button","icon","keyboardReturn","label","URLSelectionUI","isURLInputVisible","onChangeSrc","onSubmitSrc","openURLInput","closeURLInput","setPopoverAnchor","useState","ref","onClick","isPressed","variant","MediaPlaceholder","allowedTypes","labels","mediaPreview","notices","isAppender","accept","addToGallery","multiple","handleUpload","disableDropZone","disableMediaButtons","onError","onSelect","onCancel","onSelectURL","onToggleFeaturedImage","onDoubleClick","onFilesPreUpload","onHTMLDrop","deprecatedOnHTMLDrop","children","mediaLibraryButton","style","deprecated","since","version","mediaUpload","useSelect","select","getSettings","blockEditorStore","setSrc","setIsURLInputVisible","useEffect","_value$src","onlyAllowsImages","length","every","allowedType","startsWith","event","target","preventDefault","onFilesUpload","files","setMedia","lastMediaPassed","newMedia","filteredMedia","filter","item","id","some","Number","urlSlug","url","includes","concat","map","media","cutOffIndex","lastIndexOf","slice","filesList","onFileChange","handleBlocksDrop","blocks","Array","isArray","recursivelyFindMediaFromBlocks","_blocks","flatMap","block","name","attributes","innerBlocks","mediaBlocks","uploadedMediaList","Promise","all","resolve","reject","window","fetch","then","response","blob","additionalData","title","alt_text","alt","caption","catch","err","HTML","pasteHandler","onUpload","defaultRenderPlaceholder","content","instructions","undefined","typesAllowed","firstAllowedType","isOneType","isAudio","isImage","isVideo","placeholderClassName","clsx","Placeholder","preview","renderPlaceholder","renderDropZone","DropZone","onFilesDrop","renderCancelLink","renderUrlSelectionUI","renderFeaturedImageToggle","renderMediaUploadChecked","defaultButton","open","libraryButton","uploadMediaLibraryButton","gallery","mode","render","Fragment","FormFileUpload","openFileDialog","fallback","_default","exports","withFilters"],"sources":["@wordpress/block-editor/src/components/media-placeholder/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tFormFileUpload,\n\tPlaceholder,\n\tDropZone,\n\twithFilters,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { keyboardReturn } from '@wordpress/icons';\nimport { pasteHandler } from '@wordpress/blocks';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport MediaUpload from '../media-upload';\nimport MediaUploadCheck from '../media-upload/check';\nimport URLPopover from '../url-popover';\nimport { store as blockEditorStore } from '../../store';\n\nconst noop = () => {};\n\nconst InsertFromURLPopover = ( {\n\tsrc,\n\tonChange,\n\tonSubmit,\n\tonClose,\n\tpopoverAnchor,\n} ) => (\n\t<URLPopover anchor={ popoverAnchor } onClose={ onClose }>\n\t\t<form\n\t\t\tclassName=\"block-editor-media-placeholder__url-input-form\"\n\t\t\tonSubmit={ onSubmit }\n\t\t>\n\t\t\t<input\n\t\t\t\tclassName=\"block-editor-media-placeholder__url-input-field\"\n\t\t\t\ttype=\"text\"\n\t\t\t\taria-label={ __( 'URL' ) }\n\t\t\t\tplaceholder={ __( 'Paste or type URL' ) }\n\t\t\t\tonChange={ onChange }\n\t\t\t\tvalue={ src }\n\t\t\t/>\n\t\t\t<Button\n\t\t\t\tclassName=\"block-editor-media-placeholder__url-input-submit-button\"\n\t\t\t\ticon={ keyboardReturn }\n\t\t\t\tlabel={ __( 'Apply' ) }\n\t\t\t\ttype=\"submit\"\n\t\t\t/>\n\t\t</form>\n\t</URLPopover>\n);\n\nconst URLSelectionUI = ( {\n\tisURLInputVisible,\n\tsrc,\n\tonChangeSrc,\n\tonSubmitSrc,\n\topenURLInput,\n\tcloseURLInput,\n} ) => {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"block-editor-media-placeholder__url-input-container\"\n\t\t\tref={ setPopoverAnchor }\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"block-editor-media-placeholder__button\"\n\t\t\t\tonClick={ openURLInput }\n\t\t\t\tisPressed={ isURLInputVisible }\n\t\t\t\tvariant=\"secondary\"\n\t\t\t>\n\t\t\t\t{ __( 'Insert from URL' ) }\n\t\t\t</Button>\n\t\t\t{ isURLInputVisible && (\n\t\t\t\t<InsertFromURLPopover\n\t\t\t\t\tsrc={ src }\n\t\t\t\t\tonChange={ onChangeSrc }\n\t\t\t\t\tonSubmit={ onSubmitSrc }\n\t\t\t\t\tonClose={ closeURLInput }\n\t\t\t\t\tpopoverAnchor={ popoverAnchor }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</div>\n\t);\n};\n\nexport function MediaPlaceholder( {\n\tvalue = {},\n\tallowedTypes,\n\tclassName,\n\ticon,\n\tlabels = {},\n\tmediaPreview,\n\tnotices,\n\tisAppender,\n\taccept,\n\taddToGallery,\n\tmultiple = false,\n\thandleUpload = true,\n\tdisableDropZone,\n\tdisableMediaButtons,\n\tonError,\n\tonSelect,\n\tonCancel,\n\tonSelectURL,\n\tonToggleFeaturedImage,\n\tonDoubleClick,\n\tonFilesPreUpload = noop,\n\tonHTMLDrop: deprecatedOnHTMLDrop,\n\tchildren,\n\tmediaLibraryButton,\n\tplaceholder,\n\tstyle,\n} ) {\n\tif ( deprecatedOnHTMLDrop ) {\n\t\tdeprecated( 'wp.blockEditor.MediaPlaceholder onHTMLDrop prop', {\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t} );\n\t}\n\n\tconst mediaUpload = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().mediaUpload;\n\t}, [] );\n\tconst [ src, setSrc ] = useState( '' );\n\tconst [ isURLInputVisible, setIsURLInputVisible ] = useState( false );\n\n\tuseEffect( () => {\n\t\tsetSrc( value?.src ?? '' );\n\t}, [ value?.src ] );\n\n\tconst onlyAllowsImages = () => {\n\t\tif ( ! allowedTypes || allowedTypes.length === 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn allowedTypes.every(\n\t\t\t( allowedType ) =>\n\t\t\t\tallowedType === 'image' || allowedType.startsWith( 'image/' )\n\t\t);\n\t};\n\n\tconst onChangeSrc = ( event ) => {\n\t\tsetSrc( event.target.value );\n\t};\n\n\tconst openURLInput = () => {\n\t\tsetIsURLInputVisible( true );\n\t};\n\tconst closeURLInput = () => {\n\t\tsetIsURLInputVisible( false );\n\t};\n\n\tconst onSubmitSrc = ( event ) => {\n\t\tevent.preventDefault();\n\t\tif ( src && onSelectURL ) {\n\t\t\tonSelectURL( src );\n\t\t\tcloseURLInput();\n\t\t}\n\t};\n\n\tconst onFilesUpload = ( files ) => {\n\t\tif ( ! handleUpload ) {\n\t\t\treturn onSelect( files );\n\t\t}\n\t\tonFilesPreUpload( files );\n\t\tlet setMedia;\n\t\tif ( multiple ) {\n\t\t\tif ( addToGallery ) {\n\t\t\t\t// Since the setMedia function runs multiple times per upload group\n\t\t\t\t// and is passed newMedia containing every item in its group each time, we must\n\t\t\t\t// filter out whatever this upload group had previously returned to the\n\t\t\t\t// gallery before adding and returning the image array with replacement newMedia\n\t\t\t\t// values.\n\n\t\t\t\t// Define an array to store urls from newMedia between subsequent function calls.\n\t\t\t\tlet lastMediaPassed = [];\n\t\t\t\tsetMedia = ( newMedia ) => {\n\t\t\t\t\t// Remove any images this upload group is responsible for (lastMediaPassed).\n\t\t\t\t\t// Their replacements are contained in newMedia.\n\t\t\t\t\tconst filteredMedia = ( value ?? [] ).filter( ( item ) => {\n\t\t\t\t\t\t// If Item has id, only remove it if lastMediaPassed has an item with that id.\n\t\t\t\t\t\tif ( item.id ) {\n\t\t\t\t\t\t\treturn ! lastMediaPassed.some(\n\t\t\t\t\t\t\t\t// Be sure to convert to number for comparison.\n\t\t\t\t\t\t\t\t( { id } ) => Number( id ) === Number( item.id )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Compare transient images via .includes since gallery may append extra info onto the url.\n\t\t\t\t\t\treturn ! lastMediaPassed.some( ( { urlSlug } ) =>\n\t\t\t\t\t\t\titem.url.includes( urlSlug )\n\t\t\t\t\t\t);\n\t\t\t\t\t} );\n\t\t\t\t\t// Return the filtered media array along with newMedia.\n\t\t\t\t\tonSelect( filteredMedia.concat( newMedia ) );\n\t\t\t\t\t// Reset lastMediaPassed and set it with ids and urls from newMedia.\n\t\t\t\t\tlastMediaPassed = newMedia.map( ( media ) => {\n\t\t\t\t\t\t// Add everything up to '.fileType' to compare via .includes.\n\t\t\t\t\t\tconst cutOffIndex = media.url.lastIndexOf( '.' );\n\t\t\t\t\t\tconst urlSlug = media.url.slice( 0, cutOffIndex );\n\t\t\t\t\t\treturn { id: media.id, urlSlug };\n\t\t\t\t\t} );\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tsetMedia = onSelect;\n\t\t\t}\n\t\t} else {\n\t\t\tsetMedia = ( [ media ] ) => onSelect( media );\n\t\t}\n\t\tmediaUpload( {\n\t\t\tallowedTypes,\n\t\t\tfilesList: files,\n\t\t\tonFileChange: setMedia,\n\t\t\tonError,\n\t\t} );\n\t};\n\n\tasync function handleBlocksDrop( blocks ) {\n\t\tif ( ! blocks || ! Array.isArray( blocks ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfunction recursivelyFindMediaFromBlocks( _blocks ) {\n\t\t\treturn _blocks.flatMap( ( block ) =>\n\t\t\t\t( block.name === 'core/image' ||\n\t\t\t\t\tblock.name === 'core/audio' ||\n\t\t\t\t\tblock.name === 'core/video' ) &&\n\t\t\t\tblock.attributes.url\n\t\t\t\t\t? [ block ]\n\t\t\t\t\t: recursivelyFindMediaFromBlocks( block.innerBlocks )\n\t\t\t);\n\t\t}\n\n\t\tconst mediaBlocks = recursivelyFindMediaFromBlocks( blocks );\n\n\t\tif ( ! mediaBlocks.length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst uploadedMediaList = await Promise.all(\n\t\t\tmediaBlocks.map( ( block ) =>\n\t\t\t\tblock.attributes.id\n\t\t\t\t\t? block.attributes\n\t\t\t\t\t: new Promise( ( resolve, reject ) => {\n\t\t\t\t\t\t\twindow\n\t\t\t\t\t\t\t\t.fetch( block.attributes.url )\n\t\t\t\t\t\t\t\t.then( ( response ) => response.blob() )\n\t\t\t\t\t\t\t\t.then( ( blob ) =>\n\t\t\t\t\t\t\t\t\tmediaUpload( {\n\t\t\t\t\t\t\t\t\t\tfilesList: [ blob ],\n\t\t\t\t\t\t\t\t\t\tadditionalData: {\n\t\t\t\t\t\t\t\t\t\t\ttitle: block.attributes.title,\n\t\t\t\t\t\t\t\t\t\t\talt_text: block.attributes.alt,\n\t\t\t\t\t\t\t\t\t\t\tcaption: block.attributes.caption,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tonFileChange: ( [ media ] ) => {\n\t\t\t\t\t\t\t\t\t\t\tif ( media.id ) {\n\t\t\t\t\t\t\t\t\t\t\t\tresolve( media );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tallowedTypes,\n\t\t\t\t\t\t\t\t\t\tonError: reject,\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\t.catch( () => resolve( block.attributes.url ) );\n\t\t\t\t\t } )\n\t\t\t)\n\t\t).catch( ( err ) => onError( err ) );\n\n\t\tif ( multiple ) {\n\t\t\tonSelect( uploadedMediaList );\n\t\t} else {\n\t\t\tonSelect( uploadedMediaList[ 0 ] );\n\t\t}\n\t}\n\n\tasync function onHTMLDrop( HTML ) {\n\t\tconst blocks = pasteHandler( { HTML } );\n\t\treturn await handleBlocksDrop( blocks );\n\t}\n\n\tconst onUpload = ( event ) => {\n\t\tonFilesUpload( event.target.files );\n\t};\n\n\tconst defaultRenderPlaceholder = ( content ) => {\n\t\tlet { instructions, title } = labels;\n\n\t\tif ( ! mediaUpload && ! onSelectURL ) {\n\t\t\tinstructions = __(\n\t\t\t\t'To edit this block, you need permission to upload media.'\n\t\t\t);\n\t\t}\n\n\t\tif ( instructions === undefined || title === undefined ) {\n\t\t\tconst typesAllowed = allowedTypes ?? [];\n\n\t\t\tconst [ firstAllowedType ] = typesAllowed;\n\t\t\tconst isOneType = 1 === typesAllowed.length;\n\t\t\tconst isAudio = isOneType && 'audio' === firstAllowedType;\n\t\t\tconst isImage = isOneType && 'image' === firstAllowedType;\n\t\t\tconst isVideo = isOneType && 'video' === firstAllowedType;\n\n\t\t\tif ( instructions === undefined && mediaUpload ) {\n\t\t\t\tinstructions = __(\n\t\t\t\t\t'Upload a media file or pick one from your media library.'\n\t\t\t\t);\n\n\t\t\t\tif ( isAudio ) {\n\t\t\t\t\tinstructions = __(\n\t\t\t\t\t\t'Upload an audio file, pick one from your media library, or add one with a URL.'\n\t\t\t\t\t);\n\t\t\t\t} else if ( isImage ) {\n\t\t\t\t\tinstructions = __(\n\t\t\t\t\t\t'Upload an image file, pick one from your media library, or add one with a URL.'\n\t\t\t\t\t);\n\t\t\t\t} else if ( isVideo ) {\n\t\t\t\t\tinstructions = __(\n\t\t\t\t\t\t'Upload a video file, pick one from your media library, or add one with a URL.'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( title === undefined ) {\n\t\t\t\ttitle = __( 'Media' );\n\n\t\t\t\tif ( isAudio ) {\n\t\t\t\t\ttitle = __( 'Audio' );\n\t\t\t\t} else if ( isImage ) {\n\t\t\t\t\ttitle = __( 'Image' );\n\t\t\t\t} else if ( isVideo ) {\n\t\t\t\t\ttitle = __( 'Video' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst placeholderClassName = clsx(\n\t\t\t'block-editor-media-placeholder',\n\t\t\tclassName,\n\t\t\t{\n\t\t\t\t'is-appender': isAppender,\n\t\t\t}\n\t\t);\n\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\ticon={ icon }\n\t\t\t\tlabel={ title }\n\t\t\t\tinstructions={ instructions }\n\t\t\t\tclassName={ placeholderClassName }\n\t\t\t\tnotices={ notices }\n\t\t\t\tonDoubleClick={ onDoubleClick }\n\t\t\t\tpreview={ mediaPreview }\n\t\t\t\tstyle={ style }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t\t{ children }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\tconst renderPlaceholder = placeholder ?? defaultRenderPlaceholder;\n\n\tconst renderDropZone = () => {\n\t\tif ( disableDropZone ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<DropZone onFilesDrop={ onFilesUpload } onHTMLDrop={ onHTMLDrop } />\n\t\t);\n\t};\n\n\tconst renderCancelLink = () => {\n\t\treturn (\n\t\t\tonCancel && (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"block-editor-media-placeholder__cancel-button\"\n\t\t\t\t\ttitle={ __( 'Cancel' ) }\n\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\tonClick={ onCancel }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t</Button>\n\t\t\t)\n\t\t);\n\t};\n\n\tconst renderUrlSelectionUI = () => {\n\t\treturn (\n\t\t\tonSelectURL && (\n\t\t\t\t<URLSelectionUI\n\t\t\t\t\tisURLInputVisible={ isURLInputVisible }\n\t\t\t\t\tsrc={ src }\n\t\t\t\t\tonChangeSrc={ onChangeSrc }\n\t\t\t\t\tonSubmitSrc={ onSubmitSrc }\n\t\t\t\t\topenURLInput={ openURLInput }\n\t\t\t\t\tcloseURLInput={ closeURLInput }\n\t\t\t\t/>\n\t\t\t)\n\t\t);\n\t};\n\n\tconst renderFeaturedImageToggle = () => {\n\t\treturn (\n\t\t\tonToggleFeaturedImage && (\n\t\t\t\t<div className=\"block-editor-media-placeholder__url-input-container\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"block-editor-media-placeholder__button\"\n\t\t\t\t\t\tonClick={ onToggleFeaturedImage }\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Use featured image' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t)\n\t\t);\n\t};\n\n\tconst renderMediaUploadChecked = () => {\n\t\tconst defaultButton = ( { open } ) => {\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\topen();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Media Library' ) }\n\t\t\t\t</Button>\n\t\t\t);\n\t\t};\n\t\tconst libraryButton = mediaLibraryButton ?? defaultButton;\n\t\tconst uploadMediaLibraryButton = (\n\t\t\t<MediaUpload\n\t\t\t\taddToGallery={ addToGallery }\n\t\t\t\tgallery={ multiple && onlyAllowsImages() }\n\t\t\t\tmultiple={ multiple }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tallowedTypes={ allowedTypes }\n\t\t\t\tmode={ 'browse' }\n\t\t\t\tvalue={\n\t\t\t\t\tArray.isArray( value )\n\t\t\t\t\t\t? value.map( ( { id } ) => id )\n\t\t\t\t\t\t: value.id\n\t\t\t\t}\n\t\t\t\trender={ libraryButton }\n\t\t\t/>\n\t\t);\n\n\t\tif ( mediaUpload && isAppender ) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t{ renderDropZone() }\n\t\t\t\t\t<FormFileUpload\n\t\t\t\t\t\tonChange={ onUpload }\n\t\t\t\t\t\taccept={ accept }\n\t\t\t\t\t\tmultiple={ !! multiple }\n\t\t\t\t\t\trender={ ( { openFileDialog } ) => {\n\t\t\t\t\t\t\tconst content = (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t\t\t\t'block-editor-media-placeholder__button',\n\t\t\t\t\t\t\t\t\t\t\t'block-editor-media-placeholder__upload-button'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\tonClick={ openFileDialog }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Upload' ) }\n\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t{ uploadMediaLibraryButton }\n\t\t\t\t\t\t\t\t\t{ renderUrlSelectionUI() }\n\t\t\t\t\t\t\t\t\t{ renderFeaturedImageToggle() }\n\t\t\t\t\t\t\t\t\t{ renderCancelLink() }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn renderPlaceholder( content );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t);\n\t\t}\n\n\t\tif ( mediaUpload ) {\n\t\t\tconst content = (\n\t\t\t\t<>\n\t\t\t\t\t{ renderDropZone() }\n\t\t\t\t\t<FormFileUpload\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'block-editor-media-placeholder__button',\n\t\t\t\t\t\t\t'block-editor-media-placeholder__upload-button'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonChange={ onUpload }\n\t\t\t\t\t\taccept={ accept }\n\t\t\t\t\t\tmultiple={ !! multiple }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Upload' ) }\n\t\t\t\t\t</FormFileUpload>\n\t\t\t\t\t{ uploadMediaLibraryButton }\n\t\t\t\t\t{ renderUrlSelectionUI() }\n\t\t\t\t\t{ renderFeaturedImageToggle() }\n\t\t\t\t\t{ renderCancelLink() }\n\t\t\t\t</>\n\t\t\t);\n\t\t\treturn renderPlaceholder( content );\n\t\t}\n\n\t\treturn renderPlaceholder( uploadMediaLibraryButton );\n\t};\n\n\tif ( disableMediaButtons ) {\n\t\treturn <MediaUploadCheck>{ renderDropZone() }</MediaUploadCheck>;\n\t}\n\n\treturn (\n\t\t<MediaUploadCheck\n\t\t\tfallback={ renderPlaceholder( renderUrlSelectionUI() ) }\n\t\t>\n\t\t\t{ renderMediaUploadChecked() }\n\t\t</MediaUploadCheck>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-placeholder/README.md\n */\nexport default withFilters( 'editor.MediaPlaceholder' )( MediaPlaceholder );\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAOA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAR,sBAAA,CAAAC,OAAA;AAKA,IAAAQ,YAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,MAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,WAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AA5BA;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;;AAMA,MAAMY,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAErB,MAAMC,oBAAoB,GAAGA,CAAE;EAC9BC,GAAG;EACHC,QAAQ;EACRC,QAAQ;EACRC,OAAO;EACPC;AACD,CAAC,KACA,IAAAC,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAW,OAAU;EAACC,MAAM,EAAGJ,aAAe;EAACD,OAAO,EAAGA;AAAS,GACvD,IAAAE,MAAA,CAAAC,aAAA;EACCG,SAAS,EAAC,gDAAgD;EAC1DP,QAAQ,EAAGA;AAAU,GAErB,IAAAG,MAAA,CAAAC,aAAA;EACCG,SAAS,EAAC,iDAAiD;EAC3DC,IAAI,EAAC,MAAM;EACX,cAAa,IAAAC,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AC;AAErB;;AAEA;AACA;AACA;AAFA,IAAAY,QAAA,GAAAC,OAAA,CAAA3J,OAAA,GAGe,IAAA4J,uBAAW,EAAE,yBAA0B,CAAC,CAAErI,gBAAiB,CAAC","ignoreList":[]}
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = require("react");
9
- var _classnames = _interopRequireDefault(require("classnames"));
9
+ var _clsx = _interopRequireDefault(require("clsx"));
10
10
  var _element = require("@wordpress/element");
11
11
  var _i18n = require("@wordpress/i18n");
12
12
  var _a11y = require("@wordpress/a11y");
@@ -174,7 +174,7 @@ const MediaReplaceFlow = ({
174
174
  }, (0, _i18n.__)('Use featured image')), children), onSelectURL &&
175
175
  // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
176
176
  (0, _react.createElement)("form", {
177
- className: (0, _classnames.default)('block-editor-media-flow__url-input', {
177
+ className: (0, _clsx.default)('block-editor-media-flow__url-input', {
178
178
  'has-siblings': canUpload || onToggleFeaturedImage
179
179
  })
180
180
  }, (0, _react.createElement)("span", {