@wordpress/block-editor 12.3.0 → 12.3.1

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 (897) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +12 -0
  3. package/build/autocompleters/block.js +5 -3
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/alignment-control/index.js +4 -6
  6. package/build/components/alignment-control/index.js.map +1 -1
  7. package/build/components/alignment-control/ui.js +5 -9
  8. package/build/components/alignment-control/ui.js.map +1 -1
  9. package/build/components/autocomplete/index.js +2 -4
  10. package/build/components/autocomplete/index.js.map +1 -1
  11. package/build/components/block-actions/index.js +4 -0
  12. package/build/components/block-actions/index.js.map +1 -1
  13. package/build/components/block-alignment-control/constants.js +1 -5
  14. package/build/components/block-alignment-control/constants.js.map +1 -1
  15. package/build/components/block-alignment-control/index.js +4 -6
  16. package/build/components/block-alignment-control/index.js.map +1 -1
  17. package/build/components/block-alignment-control/ui.js +3 -4
  18. package/build/components/block-alignment-control/ui.js.map +1 -1
  19. package/build/components/block-alignment-control/ui.native.js +3 -3
  20. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  21. package/build/components/block-alignment-matrix-control/index.js +0 -1
  22. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  23. package/build/components/block-breadcrumb/index.js +2 -3
  24. package/build/components/block-breadcrumb/index.js.map +1 -1
  25. package/build/components/block-controls/fill.js +2 -1
  26. package/build/components/block-controls/fill.js.map +1 -1
  27. package/build/components/block-controls/index.js +8 -8
  28. package/build/components/block-controls/index.js.map +1 -1
  29. package/build/components/block-controls/slot.js +2 -4
  30. package/build/components/block-controls/slot.js.map +1 -1
  31. package/build/components/block-controls/slot.native.js +4 -2
  32. package/build/components/block-controls/slot.native.js.map +1 -1
  33. package/build/components/block-edit/edit.js +4 -6
  34. package/build/components/block-edit/edit.js.map +1 -1
  35. package/build/components/block-edit/edit.native.js +2 -4
  36. package/build/components/block-edit/edit.native.js.map +1 -1
  37. package/build/components/block-edit/index.js +3 -2
  38. package/build/components/block-edit/index.js.map +1 -1
  39. package/build/components/block-heading-level-dropdown/heading-level-icon.js +47 -0
  40. package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -0
  41. package/build/components/block-heading-level-dropdown/index.js +83 -0
  42. package/build/components/block-heading-level-dropdown/index.js.map +1 -0
  43. package/build/components/block-heading-level-dropdown/index.native.js +72 -0
  44. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -0
  45. package/build/components/block-icon/index.native.js +6 -7
  46. package/build/components/block-icon/index.native.js.map +1 -1
  47. package/build/components/block-info-slot-fill/index.js +4 -2
  48. package/build/components/block-info-slot-fill/index.js.map +1 -1
  49. package/build/components/block-inspector/index.js +20 -87
  50. package/build/components/block-inspector/index.js.map +1 -1
  51. package/build/components/block-list/block-list-item.native.js +4 -2
  52. package/build/components/block-list/block-list-item.native.js.map +1 -1
  53. package/build/components/block-list/block.js +6 -4
  54. package/build/components/block-list/block.js.map +1 -1
  55. package/build/components/block-list/block.native.js +1 -0
  56. package/build/components/block-list/block.native.js.map +1 -1
  57. package/build/components/block-list/index.js +7 -4
  58. package/build/components/block-list/index.js.map +1 -1
  59. package/build/components/block-list/index.native.js +8 -9
  60. package/build/components/block-list/index.native.js.map +1 -1
  61. package/build/components/block-list/subdirectory-icon.js +4 -7
  62. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  63. package/build/components/block-list/use-in-between-inserter.js +1 -3
  64. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  65. package/build/components/block-list-appender/index.js +21 -19
  66. package/build/components/block-list-appender/index.js.map +1 -1
  67. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  68. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  69. package/build/components/block-mover/button.js +12 -12
  70. package/build/components/block-mover/button.js.map +1 -1
  71. package/build/components/block-mover/index.js +11 -10
  72. package/build/components/block-mover/index.js.map +1 -1
  73. package/build/components/block-navigation/dropdown.js +4 -6
  74. package/build/components/block-navigation/dropdown.js.map +1 -1
  75. package/build/components/block-parent-selector/index.js +4 -5
  76. package/build/components/block-parent-selector/index.js.map +1 -1
  77. package/build/components/block-pattern-setup/index.js +6 -8
  78. package/build/components/block-pattern-setup/index.js.map +1 -1
  79. package/build/components/block-patterns-list/index.js +6 -8
  80. package/build/components/block-patterns-list/index.js.map +1 -1
  81. package/build/components/block-popover/inbetween.js +4 -6
  82. package/build/components/block-popover/inbetween.js.map +1 -1
  83. package/build/components/block-popover/index.js +4 -6
  84. package/build/components/block-popover/index.js.map +1 -1
  85. package/build/components/block-preview/auto.js +2 -4
  86. package/build/components/block-preview/auto.js.map +1 -1
  87. package/build/components/block-preview/index.js +7 -7
  88. package/build/components/block-preview/index.js.map +1 -1
  89. package/build/components/block-quick-navigation/index.js +83 -0
  90. package/build/components/block-quick-navigation/index.js.map +1 -0
  91. package/build/components/block-removal-warning-modal/index.js +90 -0
  92. package/build/components/block-removal-warning-modal/index.js.map +1 -0
  93. package/build/components/block-selection-clearer/index.js +4 -7
  94. package/build/components/block-selection-clearer/index.js.map +1 -1
  95. package/build/components/block-settings/button.native.js +2 -1
  96. package/build/components/block-settings/button.native.js.map +1 -1
  97. package/build/components/block-settings/container.native.js +6 -6
  98. package/build/components/block-settings/container.native.js.map +1 -1
  99. package/build/components/block-settings-menu/block-settings-dropdown.js +10 -11
  100. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  101. package/build/components/block-settings-menu/index.js +4 -5
  102. package/build/components/block-settings-menu/index.js.map +1 -1
  103. package/build/components/block-settings-menu-controls/index.js +4 -5
  104. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  105. package/build/components/block-switcher/index.js +1 -2
  106. package/build/components/block-switcher/index.js.map +1 -1
  107. package/build/components/block-switcher/pattern-transformations-menu.js +6 -8
  108. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  109. package/build/components/block-toolbar/index.js +4 -5
  110. package/build/components/block-toolbar/index.js.map +1 -1
  111. package/build/components/block-tools/block-contextual-toolbar.js +4 -5
  112. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  113. package/build/components/block-tools/block-selection-button.js +4 -5
  114. package/build/components/block-tools/block-selection-button.js.map +1 -1
  115. package/build/components/block-tools/index.js +13 -6
  116. package/build/components/block-tools/index.js.map +1 -1
  117. package/build/components/block-tools/insertion-point.js +5 -5
  118. package/build/components/block-tools/insertion-point.js.map +1 -1
  119. package/build/components/block-tools/selected-block-popover.js +8 -8
  120. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  121. package/build/components/block-types-list/index.native.js +4 -6
  122. package/build/components/block-types-list/index.native.js.map +1 -1
  123. package/build/components/block-vertical-alignment-control/index.js +4 -6
  124. package/build/components/block-vertical-alignment-control/index.js.map +1 -1
  125. package/build/components/block-vertical-alignment-control/ui.js +5 -12
  126. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  127. package/build/components/border-radius-control/all-input-control.js +2 -6
  128. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  129. package/build/components/border-radius-control/input-controls.js +2 -6
  130. package/build/components/border-radius-control/input-controls.js.map +1 -1
  131. package/build/components/border-radius-control/linked-button.js +2 -6
  132. package/build/components/border-radius-control/linked-button.js.map +1 -1
  133. package/build/components/color-palette/control.js +2 -4
  134. package/build/components/color-palette/control.js.map +1 -1
  135. package/build/components/color-palette/with-color-context.js +2 -4
  136. package/build/components/color-palette/with-color-context.js.map +1 -1
  137. package/build/components/colors/utils.js +7 -3
  138. package/build/components/colors/utils.js.map +1 -1
  139. package/build/components/colors/with-colors.js +11 -16
  140. package/build/components/colors/with-colors.js.map +1 -1
  141. package/build/components/colors-gradients/control.js +7 -5
  142. package/build/components/colors-gradients/control.js.map +1 -1
  143. package/build/components/colors-gradients/dropdown.js +12 -11
  144. package/build/components/colors-gradients/dropdown.js.map +1 -1
  145. package/build/components/colors-gradients/panel-color-gradient-settings.js +7 -5
  146. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  147. package/build/components/copy-handler/index.js +5 -6
  148. package/build/components/copy-handler/index.js.map +1 -1
  149. package/build/components/duotone-control/index.js +1 -2
  150. package/build/components/duotone-control/index.js.map +1 -1
  151. package/build/components/editable-text/index.js +6 -7
  152. package/build/components/editable-text/index.js.map +1 -1
  153. package/build/components/font-appearance-control/index.js +2 -6
  154. package/build/components/font-appearance-control/index.js.map +1 -1
  155. package/build/components/font-family/index.js +4 -5
  156. package/build/components/font-family/index.js.map +1 -1
  157. package/build/components/font-sizes/font-size-picker.js +2 -4
  158. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  159. package/build/components/font-sizes/utils.js +3 -3
  160. package/build/components/font-sizes/utils.js.map +1 -1
  161. package/build/components/font-sizes/with-font-sizes.js +7 -7
  162. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  163. package/build/components/global-styles/color-panel.js +15 -16
  164. package/build/components/global-styles/color-panel.js.map +1 -1
  165. package/build/components/global-styles/effects-panel.js +2 -1
  166. package/build/components/global-styles/effects-panel.js.map +1 -1
  167. package/build/components/global-styles/filters-panel.js +2 -1
  168. package/build/components/global-styles/filters-panel.js.map +1 -1
  169. package/build/components/global-styles/index.js +6 -0
  170. package/build/components/global-styles/index.js.map +1 -1
  171. package/build/components/global-styles/typography-panel.js +7 -7
  172. package/build/components/global-styles/typography-panel.js.map +1 -1
  173. package/build/components/global-styles/use-global-styles-output.js +19 -16
  174. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  175. package/build/components/gradients/with-gradient.js +2 -6
  176. package/build/components/gradients/with-gradient.js.map +1 -1
  177. package/build/components/iframe/index.js +5 -7
  178. package/build/components/iframe/index.js.map +1 -1
  179. package/build/components/image-editor/constants.js +1 -2
  180. package/build/components/image-editor/constants.js.map +1 -1
  181. package/build/components/index.js +9 -9
  182. package/build/components/index.js.map +1 -1
  183. package/build/components/index.native.js +9 -0
  184. package/build/components/index.native.js.map +1 -1
  185. package/build/components/inner-blocks/index.js +9 -8
  186. package/build/components/inner-blocks/index.js.map +1 -1
  187. package/build/components/inner-blocks/index.native.js +8 -7
  188. package/build/components/inner-blocks/index.native.js.map +1 -1
  189. package/build/components/inner-blocks/use-nested-settings-update.js +24 -30
  190. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  191. package/build/components/inner-blocks/with-client-id.js +2 -6
  192. package/build/components/inner-blocks/with-client-id.js.map +1 -1
  193. package/build/components/inserter/block-patterns-explorer/explorer.js +2 -1
  194. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  195. package/build/components/inserter/block-patterns-tab.js +33 -5
  196. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  197. package/build/components/inserter/hooks/use-block-types-state.js +4 -3
  198. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  199. package/build/components/inserter/hooks/use-insertion-point.js +1 -1
  200. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  201. package/build/components/inserter/index.js +8 -8
  202. package/build/components/inserter/index.js.map +1 -1
  203. package/build/components/inserter/index.native.js +4 -5
  204. package/build/components/inserter/index.native.js.map +1 -1
  205. package/build/components/inserter/library.js +1 -1
  206. package/build/components/inserter/library.js.map +1 -1
  207. package/build/components/inserter/media-tab/media-list.js +2 -6
  208. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  209. package/build/components/inserter/media-tab/media-preview.js +4 -6
  210. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  211. package/build/components/inserter/media-tab/media-tab.js +1 -1
  212. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  213. package/build/components/inserter/reusable-blocks-tab.js +3 -3
  214. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  215. package/build/components/inserter/tabs.js +3 -3
  216. package/build/components/inserter/tabs.js.map +1 -1
  217. package/build/components/inserter-list-item/index.js +4 -5
  218. package/build/components/inserter-list-item/index.js.map +1 -1
  219. package/build/components/inserter-listbox/group.js +4 -7
  220. package/build/components/inserter-listbox/group.js.map +1 -1
  221. package/build/components/inserter-listbox/item.js +8 -7
  222. package/build/components/inserter-listbox/item.js.map +1 -1
  223. package/build/components/inserter-listbox/row.js +4 -5
  224. package/build/components/inserter-listbox/row.js.map +1 -1
  225. package/build/components/inspector-controls/block-support-slot-container.js +2 -6
  226. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  227. package/build/components/inspector-controls/fill.native.js +2 -1
  228. package/build/components/inspector-controls/fill.native.js.map +1 -1
  229. package/build/components/inspector-controls/index.js +4 -6
  230. package/build/components/inspector-controls/index.js.map +1 -1
  231. package/build/components/inspector-controls/slot.js +4 -6
  232. package/build/components/inspector-controls/slot.js.map +1 -1
  233. package/build/components/inspector-controls/slot.native.js +2 -1
  234. package/build/components/inspector-controls/slot.native.js.map +1 -1
  235. package/build/components/justify-content-control/index.js +4 -6
  236. package/build/components/justify-content-control/index.js.map +1 -1
  237. package/build/components/justify-content-control/ui.js +4 -7
  238. package/build/components/justify-content-control/ui.js.map +1 -1
  239. package/build/components/letter-spacing-control/index.js +2 -4
  240. package/build/components/letter-spacing-control/index.js.map +1 -1
  241. package/build/components/line-height-control/index.js +2 -4
  242. package/build/components/line-height-control/index.js.map +1 -1
  243. package/build/components/link-control/index.js +3 -9
  244. package/build/components/link-control/index.js.map +1 -1
  245. package/build/components/link-control/search-create-button.js +2 -4
  246. package/build/components/link-control/search-create-button.js.map +1 -1
  247. package/build/components/link-control/search-input.js +3 -1
  248. package/build/components/link-control/search-input.js.map +1 -1
  249. package/build/components/link-control/search-item.js +2 -4
  250. package/build/components/link-control/search-item.js.map +1 -1
  251. package/build/components/link-control/search-results.js +2 -4
  252. package/build/components/link-control/search-results.js.map +1 -1
  253. package/build/components/list-view/appender.js +4 -6
  254. package/build/components/list-view/appender.js.map +1 -1
  255. package/build/components/list-view/aria-referenced-text.js +4 -8
  256. package/build/components/list-view/aria-referenced-text.js.map +1 -1
  257. package/build/components/list-view/block-contents.js +4 -5
  258. package/build/components/list-view/block-contents.js.map +1 -1
  259. package/build/components/list-view/block-select-button.js +13 -2
  260. package/build/components/list-view/block-select-button.js.map +1 -1
  261. package/build/components/list-view/branch.js +9 -8
  262. package/build/components/list-view/branch.js.map +1 -1
  263. package/build/components/list-view/drop-indicator.js +62 -11
  264. package/build/components/list-view/drop-indicator.js.map +1 -1
  265. package/build/components/list-view/index.js +4 -6
  266. package/build/components/list-view/index.js.map +1 -1
  267. package/build/components/list-view/leaf.js +4 -5
  268. package/build/components/list-view/leaf.js.map +1 -1
  269. package/build/components/list-view/use-list-view-client-ids.js +2 -22
  270. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  271. package/build/components/list-view/use-list-view-drop-zone.js +46 -34
  272. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  273. package/build/components/media-placeholder/index.js +38 -13
  274. package/build/components/media-placeholder/index.js.map +1 -1
  275. package/build/components/media-replace-flow/index.js +1 -3
  276. package/build/components/media-replace-flow/index.js.map +1 -1
  277. package/build/components/navigable-toolbar/index.js +8 -8
  278. package/build/components/navigable-toolbar/index.js.map +1 -1
  279. package/build/components/panel-color-settings/index.js +4 -5
  280. package/build/components/panel-color-settings/index.js.map +1 -1
  281. package/build/components/plain-text/index.js +8 -8
  282. package/build/components/plain-text/index.js.map +1 -1
  283. package/build/components/plain-text/index.native.js +7 -6
  284. package/build/components/plain-text/index.native.js.map +1 -1
  285. package/build/components/preview-options/index.js +5 -4
  286. package/build/components/preview-options/index.js.map +1 -1
  287. package/build/components/provider/index.js +2 -4
  288. package/build/components/provider/index.js.map +1 -1
  289. package/build/components/provider/with-registry-provider.js +8 -10
  290. package/build/components/provider/with-registry-provider.js.map +1 -1
  291. package/build/components/publish-date-time-picker/index.js +4 -5
  292. package/build/components/publish-date-time-picker/index.js.map +1 -1
  293. package/build/components/resizable-box-popover/index.js +5 -5
  294. package/build/components/resizable-box-popover/index.js.map +1 -1
  295. package/build/components/rich-text/content.js +99 -0
  296. package/build/components/rich-text/content.js.map +1 -0
  297. package/build/components/rich-text/format-toolbar/index.js +1 -2
  298. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  299. package/build/components/rich-text/index.js +8 -42
  300. package/build/components/rich-text/index.js.map +1 -1
  301. package/build/components/rich-text/index.native.js +6 -34
  302. package/build/components/rich-text/index.native.js.map +1 -1
  303. package/build/components/rich-text/toolbar-button.js +2 -6
  304. package/build/components/rich-text/toolbar-button.js.map +1 -1
  305. package/build/components/spacing-sizes-control/index.js +8 -8
  306. package/build/components/spacing-sizes-control/index.js.map +1 -1
  307. package/build/components/tool-selector/index.js +2 -6
  308. package/build/components/tool-selector/index.js.map +1 -1
  309. package/build/components/unit-control/index.js +4 -5
  310. package/build/components/unit-control/index.js.map +1 -1
  311. package/build/components/url-input/index.js +8 -8
  312. package/build/components/url-input/index.js.map +1 -1
  313. package/build/components/url-input/index.native.js +4 -7
  314. package/build/components/url-input/index.native.js.map +1 -1
  315. package/build/components/url-popover/image-url-input-ui.js +21 -14
  316. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  317. package/build/components/url-popover/index.js +4 -5
  318. package/build/components/url-popover/index.js.map +1 -1
  319. package/build/components/url-popover/link-editor.js +4 -5
  320. package/build/components/url-popover/link-editor.js.map +1 -1
  321. package/build/components/url-popover/link-viewer.js +4 -5
  322. package/build/components/url-popover/link-viewer.js.map +1 -1
  323. package/build/components/use-block-display-information/index.js +30 -2
  324. package/build/components/use-block-display-information/index.js.map +1 -1
  325. package/build/components/video-player/index.native.js +2 -4
  326. package/build/components/video-player/index.native.js.map +1 -1
  327. package/build/components/warning/index.native.js +4 -5
  328. package/build/components/warning/index.native.js.map +1 -1
  329. package/build/components/writing-flow/index.js +2 -4
  330. package/build/components/writing-flow/index.js.map +1 -1
  331. package/build/components/writing-flow/use-drag-selection.js +1 -1
  332. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  333. package/build/components/writing-flow/use-tab-nav.js +32 -4
  334. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  335. package/build/hooks/align.js +8 -8
  336. package/build/hooks/align.js.map +1 -1
  337. package/build/hooks/anchor.js +4 -2
  338. package/build/hooks/anchor.js.map +1 -1
  339. package/build/hooks/behaviors.js +75 -37
  340. package/build/hooks/behaviors.js.map +1 -1
  341. package/build/hooks/border.js +4 -5
  342. package/build/hooks/border.js.map +1 -1
  343. package/build/hooks/color.js +4 -5
  344. package/build/hooks/color.js.map +1 -1
  345. package/build/hooks/content-lock-ui.js +8 -10
  346. package/build/hooks/content-lock-ui.js.map +1 -1
  347. package/build/hooks/custom-class-name.js +4 -2
  348. package/build/hooks/custom-class-name.js.map +1 -1
  349. package/build/hooks/dimensions.js +7 -7
  350. package/build/hooks/dimensions.js.map +1 -1
  351. package/build/hooks/duotone.js +5 -5
  352. package/build/hooks/duotone.js.map +1 -1
  353. package/build/hooks/font-family.js +2 -6
  354. package/build/hooks/font-family.js.map +1 -1
  355. package/build/hooks/font-size.js +10 -8
  356. package/build/hooks/font-size.js.map +1 -1
  357. package/build/hooks/layout.js +30 -28
  358. package/build/hooks/layout.js.map +1 -1
  359. package/build/hooks/position.js +24 -16
  360. package/build/hooks/position.js.map +1 -1
  361. package/build/hooks/style.js +8 -5
  362. package/build/hooks/style.js.map +1 -1
  363. package/build/hooks/supports.js +1 -1
  364. package/build/hooks/supports.js.map +1 -1
  365. package/build/hooks/typography.native.js +3 -1
  366. package/build/hooks/typography.native.js.map +1 -1
  367. package/build/hooks/use-typography-props.js +10 -17
  368. package/build/hooks/use-typography-props.js.map +1 -1
  369. package/build/index.js +0 -14
  370. package/build/index.js.map +1 -1
  371. package/build/layouts/constrained.js +3 -1
  372. package/build/layouts/constrained.js.map +1 -1
  373. package/build/layouts/definitions.js +154 -0
  374. package/build/layouts/definitions.js.map +1 -0
  375. package/build/layouts/flex.js +8 -5
  376. package/build/layouts/flex.js.map +1 -1
  377. package/build/layouts/flow.js +3 -1
  378. package/build/layouts/flow.js.map +1 -1
  379. package/build/layouts/grid.js +3 -1
  380. package/build/layouts/grid.js.map +1 -1
  381. package/build/layouts/utils.js +8 -2
  382. package/build/layouts/utils.js.map +1 -1
  383. package/build/private-apis.js +17 -1
  384. package/build/private-apis.js.map +1 -1
  385. package/build/store/actions.js +2 -62
  386. package/build/store/actions.js.map +1 -1
  387. package/build/store/private-actions.js +200 -0
  388. package/build/store/private-actions.js.map +1 -1
  389. package/build/store/private-selectors.js +72 -4
  390. package/build/store/private-selectors.js.map +1 -1
  391. package/build/store/reducer.js +52 -1
  392. package/build/store/reducer.js.map +1 -1
  393. package/build/store/selectors.js +42 -42
  394. package/build/store/selectors.js.map +1 -1
  395. package/build/utils/object.js +39 -0
  396. package/build/utils/object.js.map +1 -1
  397. package/build-module/autocompleters/block.js +5 -3
  398. package/build-module/autocompleters/block.js.map +1 -1
  399. package/build-module/components/alignment-control/index.js +4 -5
  400. package/build-module/components/alignment-control/index.js.map +1 -1
  401. package/build-module/components/alignment-control/ui.js +5 -6
  402. package/build-module/components/alignment-control/ui.js.map +1 -1
  403. package/build-module/components/autocomplete/index.js +2 -3
  404. package/build-module/components/autocomplete/index.js.map +1 -1
  405. package/build-module/components/block-actions/index.js +4 -0
  406. package/build-module/components/block-actions/index.js.map +1 -1
  407. package/build-module/components/block-alignment-control/constants.js +0 -3
  408. package/build-module/components/block-alignment-control/constants.js.map +1 -1
  409. package/build-module/components/block-alignment-control/index.js +4 -5
  410. package/build-module/components/block-alignment-control/index.js.map +1 -1
  411. package/build-module/components/block-alignment-control/ui.js +4 -4
  412. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  413. package/build-module/components/block-alignment-control/ui.native.js +3 -2
  414. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  415. package/build-module/components/block-alignment-matrix-control/index.js +0 -1
  416. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  417. package/build-module/components/block-breadcrumb/index.js +2 -3
  418. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  419. package/build-module/components/block-controls/fill.js +2 -1
  420. package/build-module/components/block-controls/fill.js.map +1 -1
  421. package/build-module/components/block-controls/index.js +8 -7
  422. package/build-module/components/block-controls/index.js.map +1 -1
  423. package/build-module/components/block-controls/slot.js +2 -3
  424. package/build-module/components/block-controls/slot.js.map +1 -1
  425. package/build-module/components/block-controls/slot.native.js +4 -2
  426. package/build-module/components/block-controls/slot.native.js.map +1 -1
  427. package/build-module/components/block-edit/edit.js +4 -5
  428. package/build-module/components/block-edit/edit.js.map +1 -1
  429. package/build-module/components/block-edit/edit.native.js +2 -3
  430. package/build-module/components/block-edit/edit.native.js.map +1 -1
  431. package/build-module/components/block-edit/index.js +3 -2
  432. package/build-module/components/block-edit/index.js.map +1 -1
  433. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js +39 -0
  434. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -0
  435. package/build-module/components/block-heading-level-dropdown/index.js +71 -0
  436. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -0
  437. package/build-module/components/block-heading-level-dropdown/index.native.js +60 -0
  438. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -0
  439. package/build-module/components/block-icon/index.native.js +6 -6
  440. package/build-module/components/block-icon/index.native.js.map +1 -1
  441. package/build-module/components/block-info-slot-fill/index.js +4 -2
  442. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  443. package/build-module/components/block-inspector/index.js +20 -88
  444. package/build-module/components/block-inspector/index.js.map +1 -1
  445. package/build-module/components/block-list/block-list-item.native.js +4 -2
  446. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  447. package/build-module/components/block-list/block.js +6 -4
  448. package/build-module/components/block-list/block.js.map +1 -1
  449. package/build-module/components/block-list/block.native.js +1 -0
  450. package/build-module/components/block-list/block.native.js.map +1 -1
  451. package/build-module/components/block-list/index.js +7 -4
  452. package/build-module/components/block-list/index.js.map +1 -1
  453. package/build-module/components/block-list/index.native.js +8 -8
  454. package/build-module/components/block-list/index.native.js.map +1 -1
  455. package/build-module/components/block-list/subdirectory-icon.js +4 -4
  456. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  457. package/build-module/components/block-list/use-in-between-inserter.js +1 -3
  458. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  459. package/build-module/components/block-list-appender/index.js +21 -19
  460. package/build-module/components/block-list-appender/index.js.map +1 -1
  461. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  462. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  463. package/build-module/components/block-mover/button.js +12 -11
  464. package/build-module/components/block-mover/button.js.map +1 -1
  465. package/build-module/components/block-mover/index.js +11 -9
  466. package/build-module/components/block-mover/index.js.map +1 -1
  467. package/build-module/components/block-navigation/dropdown.js +4 -5
  468. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  469. package/build-module/components/block-parent-selector/index.js +4 -4
  470. package/build-module/components/block-parent-selector/index.js.map +1 -1
  471. package/build-module/components/block-pattern-setup/index.js +6 -7
  472. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  473. package/build-module/components/block-patterns-list/index.js +6 -7
  474. package/build-module/components/block-patterns-list/index.js.map +1 -1
  475. package/build-module/components/block-popover/inbetween.js +4 -5
  476. package/build-module/components/block-popover/inbetween.js.map +1 -1
  477. package/build-module/components/block-popover/index.js +4 -5
  478. package/build-module/components/block-popover/index.js.map +1 -1
  479. package/build-module/components/block-preview/auto.js +2 -3
  480. package/build-module/components/block-preview/auto.js.map +1 -1
  481. package/build-module/components/block-preview/index.js +7 -7
  482. package/build-module/components/block-preview/index.js.map +1 -1
  483. package/build-module/components/block-quick-navigation/index.js +69 -0
  484. package/build-module/components/block-quick-navigation/index.js.map +1 -0
  485. package/build-module/components/block-removal-warning-modal/index.js +76 -0
  486. package/build-module/components/block-removal-warning-modal/index.js.map +1 -0
  487. package/build-module/components/block-selection-clearer/index.js +4 -4
  488. package/build-module/components/block-selection-clearer/index.js.map +1 -1
  489. package/build-module/components/block-settings/button.native.js +2 -1
  490. package/build-module/components/block-settings/button.native.js.map +1 -1
  491. package/build-module/components/block-settings/container.native.js +6 -5
  492. package/build-module/components/block-settings/container.native.js.map +1 -1
  493. package/build-module/components/block-settings-menu/block-settings-dropdown.js +10 -10
  494. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  495. package/build-module/components/block-settings-menu/index.js +4 -4
  496. package/build-module/components/block-settings-menu/index.js.map +1 -1
  497. package/build-module/components/block-settings-menu-controls/index.js +4 -4
  498. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  499. package/build-module/components/block-switcher/index.js +1 -2
  500. package/build-module/components/block-switcher/index.js.map +1 -1
  501. package/build-module/components/block-switcher/pattern-transformations-menu.js +6 -7
  502. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  503. package/build-module/components/block-toolbar/index.js +4 -4
  504. package/build-module/components/block-toolbar/index.js.map +1 -1
  505. package/build-module/components/block-tools/block-contextual-toolbar.js +4 -4
  506. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  507. package/build-module/components/block-tools/block-selection-button.js +4 -4
  508. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  509. package/build-module/components/block-tools/index.js +13 -5
  510. package/build-module/components/block-tools/index.js.map +1 -1
  511. package/build-module/components/block-tools/insertion-point.js +5 -4
  512. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  513. package/build-module/components/block-tools/selected-block-popover.js +8 -7
  514. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  515. package/build-module/components/block-types-list/index.native.js +4 -5
  516. package/build-module/components/block-types-list/index.native.js.map +1 -1
  517. package/build-module/components/block-vertical-alignment-control/index.js +4 -5
  518. package/build-module/components/block-vertical-alignment-control/index.js.map +1 -1
  519. package/build-module/components/block-vertical-alignment-control/ui.js +5 -9
  520. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  521. package/build-module/components/border-radius-control/all-input-control.js +2 -3
  522. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  523. package/build-module/components/border-radius-control/input-controls.js +2 -3
  524. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  525. package/build-module/components/border-radius-control/linked-button.js +2 -3
  526. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  527. package/build-module/components/color-palette/control.js +2 -3
  528. package/build-module/components/color-palette/control.js.map +1 -1
  529. package/build-module/components/color-palette/with-color-context.js +2 -3
  530. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  531. package/build-module/components/colors/utils.js +5 -1
  532. package/build-module/components/colors/utils.js.map +1 -1
  533. package/build-module/components/colors/with-colors.js +10 -14
  534. package/build-module/components/colors/with-colors.js.map +1 -1
  535. package/build-module/components/colors-gradients/control.js +7 -4
  536. package/build-module/components/colors-gradients/control.js.map +1 -1
  537. package/build-module/components/colors-gradients/dropdown.js +12 -10
  538. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  539. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +7 -4
  540. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  541. package/build-module/components/copy-handler/index.js +5 -6
  542. package/build-module/components/copy-handler/index.js.map +1 -1
  543. package/build-module/components/duotone-control/index.js +1 -2
  544. package/build-module/components/duotone-control/index.js.map +1 -1
  545. package/build-module/components/editable-text/index.js +6 -6
  546. package/build-module/components/editable-text/index.js.map +1 -1
  547. package/build-module/components/font-appearance-control/index.js +2 -3
  548. package/build-module/components/font-appearance-control/index.js.map +1 -1
  549. package/build-module/components/font-family/index.js +4 -4
  550. package/build-module/components/font-family/index.js.map +1 -1
  551. package/build-module/components/font-sizes/font-size-picker.js +2 -3
  552. package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
  553. package/build-module/components/font-sizes/utils.js +2 -2
  554. package/build-module/components/font-sizes/utils.js.map +1 -1
  555. package/build-module/components/font-sizes/with-font-sizes.js +7 -6
  556. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  557. package/build-module/components/global-styles/color-panel.js +15 -15
  558. package/build-module/components/global-styles/color-panel.js.map +1 -1
  559. package/build-module/components/global-styles/effects-panel.js +2 -1
  560. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  561. package/build-module/components/global-styles/filters-panel.js +2 -1
  562. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  563. package/build-module/components/global-styles/index.js +1 -1
  564. package/build-module/components/global-styles/index.js.map +1 -1
  565. package/build-module/components/global-styles/typography-panel.js +7 -7
  566. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  567. package/build-module/components/global-styles/use-global-styles-output.js +11 -10
  568. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  569. package/build-module/components/gradients/with-gradient.js +2 -3
  570. package/build-module/components/gradients/with-gradient.js.map +1 -1
  571. package/build-module/components/iframe/index.js +5 -6
  572. package/build-module/components/iframe/index.js.map +1 -1
  573. package/build-module/components/image-editor/constants.js +1 -2
  574. package/build-module/components/image-editor/constants.js.map +1 -1
  575. package/build-module/components/index.js +1 -1
  576. package/build-module/components/index.js.map +1 -1
  577. package/build-module/components/index.native.js +1 -0
  578. package/build-module/components/index.native.js.map +1 -1
  579. package/build-module/components/inner-blocks/index.js +9 -7
  580. package/build-module/components/inner-blocks/index.js.map +1 -1
  581. package/build-module/components/inner-blocks/index.native.js +8 -6
  582. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  583. package/build-module/components/inner-blocks/use-nested-settings-update.js +24 -27
  584. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  585. package/build-module/components/inner-blocks/with-client-id.js +2 -3
  586. package/build-module/components/inner-blocks/with-client-id.js.map +1 -1
  587. package/build-module/components/inserter/block-patterns-explorer/explorer.js +2 -1
  588. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  589. package/build-module/components/inserter/block-patterns-tab.js +33 -7
  590. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  591. package/build-module/components/inserter/hooks/use-block-types-state.js +4 -3
  592. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  593. package/build-module/components/inserter/hooks/use-insertion-point.js +1 -1
  594. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  595. package/build-module/components/inserter/index.js +8 -7
  596. package/build-module/components/inserter/index.js.map +1 -1
  597. package/build-module/components/inserter/index.native.js +4 -4
  598. package/build-module/components/inserter/index.native.js.map +1 -1
  599. package/build-module/components/inserter/library.js +1 -1
  600. package/build-module/components/inserter/library.js.map +1 -1
  601. package/build-module/components/inserter/media-tab/media-list.js +2 -3
  602. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  603. package/build-module/components/inserter/media-tab/media-preview.js +4 -5
  604. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  605. package/build-module/components/inserter/media-tab/media-tab.js +3 -3
  606. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  607. package/build-module/components/inserter/reusable-blocks-tab.js +3 -3
  608. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  609. package/build-module/components/inserter/tabs.js +3 -3
  610. package/build-module/components/inserter/tabs.js.map +1 -1
  611. package/build-module/components/inserter-list-item/index.js +4 -4
  612. package/build-module/components/inserter-list-item/index.js.map +1 -1
  613. package/build-module/components/inserter-listbox/group.js +4 -4
  614. package/build-module/components/inserter-listbox/group.js.map +1 -1
  615. package/build-module/components/inserter-listbox/item.js +8 -6
  616. package/build-module/components/inserter-listbox/item.js.map +1 -1
  617. package/build-module/components/inserter-listbox/row.js +4 -4
  618. package/build-module/components/inserter-listbox/row.js.map +1 -1
  619. package/build-module/components/inspector-controls/block-support-slot-container.js +2 -3
  620. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  621. package/build-module/components/inspector-controls/fill.native.js +2 -1
  622. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  623. package/build-module/components/inspector-controls/index.js +4 -5
  624. package/build-module/components/inspector-controls/index.js.map +1 -1
  625. package/build-module/components/inspector-controls/slot.js +4 -5
  626. package/build-module/components/inspector-controls/slot.js.map +1 -1
  627. package/build-module/components/inspector-controls/slot.native.js +2 -1
  628. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  629. package/build-module/components/justify-content-control/index.js +4 -5
  630. package/build-module/components/justify-content-control/index.js.map +1 -1
  631. package/build-module/components/justify-content-control/ui.js +4 -4
  632. package/build-module/components/justify-content-control/ui.js.map +1 -1
  633. package/build-module/components/letter-spacing-control/index.js +2 -3
  634. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  635. package/build-module/components/line-height-control/index.js +2 -3
  636. package/build-module/components/line-height-control/index.js.map +1 -1
  637. package/build-module/components/link-control/index.js +3 -9
  638. package/build-module/components/link-control/index.js.map +1 -1
  639. package/build-module/components/link-control/search-create-button.js +2 -3
  640. package/build-module/components/link-control/search-create-button.js.map +1 -1
  641. package/build-module/components/link-control/search-input.js +3 -1
  642. package/build-module/components/link-control/search-input.js.map +1 -1
  643. package/build-module/components/link-control/search-item.js +2 -3
  644. package/build-module/components/link-control/search-item.js.map +1 -1
  645. package/build-module/components/link-control/search-results.js +2 -3
  646. package/build-module/components/link-control/search-results.js.map +1 -1
  647. package/build-module/components/list-view/appender.js +4 -5
  648. package/build-module/components/list-view/appender.js.map +1 -1
  649. package/build-module/components/list-view/aria-referenced-text.js +4 -5
  650. package/build-module/components/list-view/aria-referenced-text.js.map +1 -1
  651. package/build-module/components/list-view/block-contents.js +4 -4
  652. package/build-module/components/list-view/block-contents.js.map +1 -1
  653. package/build-module/components/list-view/block-select-button.js +14 -4
  654. package/build-module/components/list-view/block-select-button.js.map +1 -1
  655. package/build-module/components/list-view/branch.js +9 -7
  656. package/build-module/components/list-view/branch.js.map +1 -1
  657. package/build-module/components/list-view/drop-indicator.js +61 -11
  658. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  659. package/build-module/components/list-view/index.js +4 -5
  660. package/build-module/components/list-view/index.js.map +1 -1
  661. package/build-module/components/list-view/leaf.js +4 -4
  662. package/build-module/components/list-view/leaf.js.map +1 -1
  663. package/build-module/components/list-view/use-list-view-client-ids.js +2 -22
  664. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  665. package/build-module/components/list-view/use-list-view-drop-zone.js +45 -34
  666. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  667. package/build-module/components/media-placeholder/index.js +38 -13
  668. package/build-module/components/media-placeholder/index.js.map +1 -1
  669. package/build-module/components/media-replace-flow/index.js +1 -3
  670. package/build-module/components/media-replace-flow/index.js.map +1 -1
  671. package/build-module/components/navigable-toolbar/index.js +8 -7
  672. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  673. package/build-module/components/panel-color-settings/index.js +4 -4
  674. package/build-module/components/panel-color-settings/index.js.map +1 -1
  675. package/build-module/components/plain-text/index.js +8 -7
  676. package/build-module/components/plain-text/index.js.map +1 -1
  677. package/build-module/components/plain-text/index.native.js +7 -5
  678. package/build-module/components/plain-text/index.native.js.map +1 -1
  679. package/build-module/components/preview-options/index.js +5 -4
  680. package/build-module/components/preview-options/index.js.map +1 -1
  681. package/build-module/components/provider/index.js +2 -3
  682. package/build-module/components/provider/index.js.map +1 -1
  683. package/build-module/components/provider/with-registry-provider.js +8 -7
  684. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  685. package/build-module/components/publish-date-time-picker/index.js +4 -4
  686. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  687. package/build-module/components/resizable-box-popover/index.js +5 -4
  688. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  689. package/build-module/components/rich-text/content.js +85 -0
  690. package/build-module/components/rich-text/content.js.map +1 -0
  691. package/build-module/components/rich-text/format-toolbar/index.js +1 -2
  692. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  693. package/build-module/components/rich-text/index.js +8 -42
  694. package/build-module/components/rich-text/index.js.map +1 -1
  695. package/build-module/components/rich-text/index.native.js +6 -34
  696. package/build-module/components/rich-text/index.native.js.map +1 -1
  697. package/build-module/components/rich-text/toolbar-button.js +2 -3
  698. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  699. package/build-module/components/spacing-sizes-control/index.js +8 -7
  700. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  701. package/build-module/components/tool-selector/index.js +2 -3
  702. package/build-module/components/tool-selector/index.js.map +1 -1
  703. package/build-module/components/unit-control/index.js +4 -4
  704. package/build-module/components/unit-control/index.js.map +1 -1
  705. package/build-module/components/url-input/index.js +8 -7
  706. package/build-module/components/url-input/index.js.map +1 -1
  707. package/build-module/components/url-input/index.native.js +4 -4
  708. package/build-module/components/url-input/index.native.js.map +1 -1
  709. package/build-module/components/url-popover/image-url-input-ui.js +22 -15
  710. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  711. package/build-module/components/url-popover/index.js +4 -4
  712. package/build-module/components/url-popover/index.js.map +1 -1
  713. package/build-module/components/url-popover/link-editor.js +4 -4
  714. package/build-module/components/url-popover/link-editor.js.map +1 -1
  715. package/build-module/components/url-popover/link-viewer.js +4 -4
  716. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  717. package/build-module/components/use-block-display-information/index.js +29 -2
  718. package/build-module/components/use-block-display-information/index.js.map +1 -1
  719. package/build-module/components/video-player/index.native.js +2 -3
  720. package/build-module/components/video-player/index.native.js.map +1 -1
  721. package/build-module/components/warning/index.native.js +4 -4
  722. package/build-module/components/warning/index.native.js.map +1 -1
  723. package/build-module/components/writing-flow/index.js +2 -3
  724. package/build-module/components/writing-flow/index.js.map +1 -1
  725. package/build-module/components/writing-flow/use-drag-selection.js +1 -1
  726. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  727. package/build-module/components/writing-flow/use-tab-nav.js +32 -5
  728. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  729. package/build-module/hooks/align.js +8 -7
  730. package/build-module/hooks/align.js.map +1 -1
  731. package/build-module/hooks/anchor.js +4 -2
  732. package/build-module/hooks/anchor.js.map +1 -1
  733. package/build-module/hooks/behaviors.js +76 -34
  734. package/build-module/hooks/behaviors.js.map +1 -1
  735. package/build-module/hooks/border.js +4 -4
  736. package/build-module/hooks/border.js.map +1 -1
  737. package/build-module/hooks/color.js +4 -4
  738. package/build-module/hooks/color.js.map +1 -1
  739. package/build-module/hooks/content-lock-ui.js +8 -7
  740. package/build-module/hooks/content-lock-ui.js.map +1 -1
  741. package/build-module/hooks/custom-class-name.js +4 -2
  742. package/build-module/hooks/custom-class-name.js.map +1 -1
  743. package/build-module/hooks/dimensions.js +7 -6
  744. package/build-module/hooks/dimensions.js.map +1 -1
  745. package/build-module/hooks/duotone.js +5 -4
  746. package/build-module/hooks/duotone.js.map +1 -1
  747. package/build-module/hooks/font-family.js +1 -5
  748. package/build-module/hooks/font-family.js.map +1 -1
  749. package/build-module/hooks/font-size.js +10 -9
  750. package/build-module/hooks/font-size.js.map +1 -1
  751. package/build-module/hooks/layout.js +26 -24
  752. package/build-module/hooks/layout.js.map +1 -1
  753. package/build-module/hooks/position.js +23 -15
  754. package/build-module/hooks/position.js.map +1 -1
  755. package/build-module/hooks/style.js +8 -4
  756. package/build-module/hooks/style.js.map +1 -1
  757. package/build-module/hooks/supports.js +1 -1
  758. package/build-module/hooks/supports.js.map +1 -1
  759. package/build-module/hooks/typography.native.js +3 -1
  760. package/build-module/hooks/typography.native.js.map +1 -1
  761. package/build-module/hooks/use-typography-props.js +8 -15
  762. package/build-module/hooks/use-typography-props.js.map +1 -1
  763. package/build-module/index.js +1 -1
  764. package/build-module/index.js.map +1 -1
  765. package/build-module/layouts/constrained.js +2 -1
  766. package/build-module/layouts/constrained.js.map +1 -1
  767. package/build-module/layouts/definitions.js +147 -0
  768. package/build-module/layouts/definitions.js.map +1 -0
  769. package/build-module/layouts/flex.js +8 -6
  770. package/build-module/layouts/flex.js.map +1 -1
  771. package/build-module/layouts/flow.js +2 -1
  772. package/build-module/layouts/flow.js.map +1 -1
  773. package/build-module/layouts/grid.js +2 -1
  774. package/build-module/layouts/grid.js.map +1 -1
  775. package/build-module/layouts/utils.js +7 -2
  776. package/build-module/layouts/utils.js.map +1 -1
  777. package/build-module/private-apis.js +12 -1
  778. package/build-module/private-apis.js.map +1 -1
  779. package/build-module/store/actions.js +2 -62
  780. package/build-module/store/actions.js.map +1 -1
  781. package/build-module/store/private-actions.js +186 -0
  782. package/build-module/store/private-actions.js.map +1 -1
  783. package/build-module/store/private-selectors.js +63 -3
  784. package/build-module/store/private-selectors.js.map +1 -1
  785. package/build-module/store/reducer.js +52 -1
  786. package/build-module/store/reducer.js.map +1 -1
  787. package/build-module/store/selectors.js +42 -42
  788. package/build-module/store/selectors.js.map +1 -1
  789. package/build-module/utils/object.js +37 -1
  790. package/build-module/utils/object.js.map +1 -1
  791. package/build-style/style-rtl.css +16 -21
  792. package/build-style/style.css +16 -21
  793. package/package.json +31 -31
  794. package/src/autocompleters/block.js +4 -2
  795. package/src/components/alignment-control/ui.js +1 -2
  796. package/src/components/block-actions/index.js +10 -0
  797. package/src/components/block-alignment-control/constants.js +0 -4
  798. package/src/components/block-alignment-control/ui.js +1 -6
  799. package/src/components/block-alignment-matrix-control/index.js +1 -1
  800. package/src/components/block-breadcrumb/index.js +2 -6
  801. package/src/components/block-edit/index.js +3 -5
  802. package/src/components/block-heading-level-dropdown/README.md +52 -0
  803. package/src/components/block-heading-level-dropdown/heading-level-icon.js +43 -0
  804. package/src/components/block-heading-level-dropdown/index.js +77 -0
  805. package/src/components/block-heading-level-dropdown/index.native.js +63 -0
  806. package/src/components/block-inspector/index.js +18 -92
  807. package/src/components/block-inspector/style.scss +0 -5
  808. package/src/components/block-list/block.native.js +1 -0
  809. package/src/components/block-list/index.js +1 -1
  810. package/src/components/block-list/use-in-between-inserter.js +0 -4
  811. package/src/components/block-list-appender/index.js +29 -22
  812. package/src/components/block-lock/style.scss +11 -4
  813. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  814. package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +2 -2
  815. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +3 -3
  816. package/src/components/block-mover/test/index.native.js +1 -20
  817. package/src/components/block-preview/index.js +7 -14
  818. package/src/components/block-quick-navigation/index.js +81 -0
  819. package/src/components/block-removal-warning-modal/index.js +94 -0
  820. package/src/components/block-settings-menu/block-settings-dropdown.js +15 -13
  821. package/src/components/block-switcher/index.js +1 -2
  822. package/src/components/block-toolbar/style.scss +0 -4
  823. package/src/components/block-tools/index.js +10 -1
  824. package/src/components/block-vertical-alignment-control/ui.js +1 -3
  825. package/src/components/colors/utils.js +5 -1
  826. package/src/components/colors/with-colors.js +1 -5
  827. package/src/components/copy-handler/index.js +5 -5
  828. package/src/components/duotone-control/index.js +0 -1
  829. package/src/components/font-sizes/test/fluid-utils.js +97 -76
  830. package/src/components/font-sizes/utils.js +2 -2
  831. package/src/components/global-styles/color-panel.js +3 -3
  832. package/src/components/global-styles/index.js +1 -0
  833. package/src/components/global-styles/test/use-global-styles-output.js +14 -9
  834. package/src/components/global-styles/typography-panel.js +19 -16
  835. package/src/components/global-styles/use-global-styles-output.js +12 -12
  836. package/src/components/iframe/index.js +1 -1
  837. package/src/components/image-editor/constants.js +0 -1
  838. package/src/components/index.js +1 -1
  839. package/src/components/index.native.js +1 -0
  840. package/src/components/inner-blocks/index.js +4 -2
  841. package/src/components/inner-blocks/index.native.js +1 -1
  842. package/src/components/inner-blocks/use-nested-settings-update.js +31 -36
  843. package/src/components/inserter/block-patterns-tab.js +63 -8
  844. package/src/components/inserter/hooks/use-block-types-state.js +4 -3
  845. package/src/components/inserter/hooks/use-insertion-point.js +1 -0
  846. package/src/components/inserter/library.js +2 -1
  847. package/src/components/inserter/media-tab/media-tab.js +9 -3
  848. package/src/components/inserter/reusable-blocks-tab.js +3 -3
  849. package/src/components/inserter/tabs.js +3 -3
  850. package/src/components/link-control/index.js +2 -9
  851. package/src/components/link-control/search-input.js +1 -0
  852. package/src/components/link-control/test/index.js +40 -51
  853. package/src/components/list-view/block-select-button.js +19 -1
  854. package/src/components/list-view/branch.js +6 -3
  855. package/src/components/list-view/drop-indicator.js +94 -9
  856. package/src/components/list-view/style.scss +13 -12
  857. package/src/components/list-view/test/use-list-view-drop-zone.js +188 -93
  858. package/src/components/list-view/use-list-view-client-ids.js +3 -20
  859. package/src/components/list-view/use-list-view-drop-zone.js +97 -54
  860. package/src/components/media-placeholder/index.js +54 -20
  861. package/src/components/media-replace-flow/index.js +1 -3
  862. package/src/components/preview-options/index.js +3 -2
  863. package/src/components/provider/test/experimental-provider.js +9 -6
  864. package/src/components/rich-text/content.js +85 -0
  865. package/src/components/rich-text/format-toolbar/index.js +1 -2
  866. package/src/components/rich-text/index.js +2 -35
  867. package/src/components/rich-text/index.native.js +3 -33
  868. package/src/components/url-popover/image-url-input-ui.js +15 -15
  869. package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -3
  870. package/src/components/use-block-display-information/index.js +26 -0
  871. package/src/components/writing-flow/use-drag-selection.js +1 -1
  872. package/src/components/writing-flow/use-tab-nav.js +42 -6
  873. package/src/hooks/behaviors.js +82 -39
  874. package/src/hooks/font-family.js +1 -5
  875. package/src/hooks/font-size.js +12 -17
  876. package/src/hooks/layout.js +17 -25
  877. package/src/hooks/position.js +24 -12
  878. package/src/hooks/supports.js +1 -1
  879. package/src/hooks/use-typography-props.js +14 -19
  880. package/src/index.js +0 -2
  881. package/src/layouts/constrained.js +2 -1
  882. package/src/layouts/definitions.js +174 -0
  883. package/src/layouts/flex.js +7 -5
  884. package/src/layouts/flow.js +2 -1
  885. package/src/layouts/grid.js +2 -1
  886. package/src/layouts/test/utils.js +2 -7
  887. package/src/layouts/utils.js +7 -2
  888. package/src/private-apis.js +11 -0
  889. package/src/store/actions.js +7 -56
  890. package/src/store/private-actions.js +193 -0
  891. package/src/store/private-selectors.js +108 -35
  892. package/src/store/reducer.js +44 -0
  893. package/src/store/selectors.js +61 -39
  894. package/src/store/test/private-selectors.js +269 -1
  895. package/src/store/test/selectors.js +18 -17
  896. package/src/utils/object.js +35 -0
  897. package/src/utils/test/object.js +96 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/link-control/search-create-button.js"],"names":["LinkControlSearchCreate","searchTerm","onClick","itemProps","isSelected","buttonText","text","mark","plus"],"mappings":";;;;;;;;;AAUA;;;;AAPA;;AAKA;;AACA;;AAEA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMO,MAAMA,uBAAuB,GAAG,CAAE;AACxCC,EAAAA,UADwC;AAExCC,EAAAA,OAFwC;AAGxCC,EAAAA,SAHwC;AAIxCC,EAAAA,UAJwC;AAKxCC,EAAAA;AALwC,CAAF,KAMhC;AACN,MAAK,CAAEJ,UAAP,EAAoB;AACnB,WAAO,IAAP;AACA;;AAED,MAAIK,IAAJ;;AACA,MAAKD,UAAL,EAAkB;AACjBC,IAAAA,IAAI,GACH,OAAOD,UAAP,KAAsB,UAAtB,GACGA,UAAU,CAAEJ,UAAF,CADb,GAEGI,UAHJ;AAIA,GALD,MAKO;AACNC,IAAAA,IAAI,GAAG,uCACN;AACC;AACA,kBAAI,yBAAJ,CAFD,EAGCL,UAHD,CADM,EAMN;AAAEM,MAAAA,IAAI,EAAE;AAAR,KANM,CAAP;AAQA;;AAED,SACC,4BAAC,kBAAD,6BACMJ,SADN;AAEC,IAAA,SAAS,EAAG,yBACX,iFADW,EAEX;AACC,qBAAeC;AADhB,KAFW,CAFb;AAQC,IAAA,OAAO,EAAGF;AARX,MAUC,4BAAC,WAAD;AACC,IAAA,SAAS,EAAC,6CADX;AAEC,IAAA,IAAI,EAAGM;AAFR,IAVD,EAeC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGF,IADH,CADD,CAfD,CADD;AAuBA,CAnDM;;;eAqDQN,uB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { Icon, plus } from '@wordpress/icons';\n\nexport const LinkControlSearchCreate = ( {\n\tsearchTerm,\n\tonClick,\n\titemProps,\n\tisSelected,\n\tbuttonText,\n} ) => {\n\tif ( ! searchTerm ) {\n\t\treturn null;\n\t}\n\n\tlet text;\n\tif ( buttonText ) {\n\t\ttext =\n\t\t\ttypeof buttonText === 'function'\n\t\t\t\t? buttonText( searchTerm )\n\t\t\t\t: buttonText;\n\t} else {\n\t\ttext = createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t__( 'Create: <mark>%s</mark>' ),\n\t\t\t\tsearchTerm\n\t\t\t),\n\t\t\t{ mark: <mark /> }\n\t\t);\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\t{ ...itemProps }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-link-control__search-create block-editor-link-control__search-item',\n\t\t\t\t{\n\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t}\n\t\t\t) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t<Icon\n\t\t\t\tclassName=\"block-editor-link-control__search-item-icon\"\n\t\t\t\ticon={ plus }\n\t\t\t/>\n\n\t\t\t<span className=\"block-editor-link-control__search-item-header\">\n\t\t\t\t<span className=\"block-editor-link-control__search-item-title\">\n\t\t\t\t\t{ text }\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</Button>\n\t);\n};\n\nexport default LinkControlSearchCreate;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/link-control/search-create-button.js"],"names":["LinkControlSearchCreate","searchTerm","onClick","itemProps","isSelected","buttonText","text","mark","plus"],"mappings":";;;;;;;;;AAUA;;AAPA;;AAKA;;AACA;;AAEA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMO,MAAMA,uBAAuB,GAAG,CAAE;AACxCC,EAAAA,UADwC;AAExCC,EAAAA,OAFwC;AAGxCC,EAAAA,SAHwC;AAIxCC,EAAAA,UAJwC;AAKxCC,EAAAA;AALwC,CAAF,KAMhC;AACN,MAAK,CAAEJ,UAAP,EAAoB;AACnB,WAAO,IAAP;AACA;;AAED,MAAIK,IAAJ;;AACA,MAAKD,UAAL,EAAkB;AACjBC,IAAAA,IAAI,GACH,OAAOD,UAAP,KAAsB,UAAtB,GACGA,UAAU,CAAEJ,UAAF,CADb,GAEGI,UAHJ;AAIA,GALD,MAKO;AACNC,IAAAA,IAAI,GAAG,uCACN;AACC;AACA,kBAAI,yBAAJ,CAFD,EAGCL,UAHD,CADM,EAMN;AAAEM,MAAAA,IAAI,EAAE;AAAR,KANM,CAAP;AAQA;;AAED,SACC,4BAAC,kBAAD,OACMJ,SADN;AAEC,IAAA,SAAS,EAAG,yBACX,iFADW,EAEX;AACC,qBAAeC;AADhB,KAFW,CAFb;AAQC,IAAA,OAAO,EAAGF;AARX,KAUC,4BAAC,WAAD;AACC,IAAA,SAAS,EAAC,6CADX;AAEC,IAAA,IAAI,EAAGM;AAFR,IAVD,EAeC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGF,IADH,CADD,CAfD,CADD;AAuBA,CAnDM;;;eAqDQN,uB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { Icon, plus } from '@wordpress/icons';\n\nexport const LinkControlSearchCreate = ( {\n\tsearchTerm,\n\tonClick,\n\titemProps,\n\tisSelected,\n\tbuttonText,\n} ) => {\n\tif ( ! searchTerm ) {\n\t\treturn null;\n\t}\n\n\tlet text;\n\tif ( buttonText ) {\n\t\ttext =\n\t\t\ttypeof buttonText === 'function'\n\t\t\t\t? buttonText( searchTerm )\n\t\t\t\t: buttonText;\n\t} else {\n\t\ttext = createInterpolateElement(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t__( 'Create: <mark>%s</mark>' ),\n\t\t\t\tsearchTerm\n\t\t\t),\n\t\t\t{ mark: <mark /> }\n\t\t);\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\t{ ...itemProps }\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-link-control__search-create block-editor-link-control__search-item',\n\t\t\t\t{\n\t\t\t\t\t'is-selected': isSelected,\n\t\t\t\t}\n\t\t\t) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t<Icon\n\t\t\t\tclassName=\"block-editor-link-control__search-item-icon\"\n\t\t\t\ticon={ plus }\n\t\t\t/>\n\n\t\t\t<span className=\"block-editor-link-control__search-item-header\">\n\t\t\t\t<span className=\"block-editor-link-control__search-item-title\">\n\t\t\t\t\t{ text }\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</Button>\n\t);\n};\n\nexport default LinkControlSearchCreate;\n"]}
@@ -52,7 +52,8 @@ const LinkControlSearchInput = (0, _element.forwardRef)(({
52
52
  onChange = noop,
53
53
  onSelect = noop,
54
54
  showSuggestions = true,
55
- renderSuggestions = props => (0, _element.createElement)(_searchResults.default, props),
55
+ renderSuggestions = props => (0, _element.createElement)(_searchResults.default, { ...props
56
+ }),
56
57
  fetchSuggestions = null,
57
58
  allowDirectEntry = true,
58
59
  showInitialSuggestions = false,
@@ -127,6 +128,7 @@ const LinkControlSearchInput = (0, _element.forwardRef)(({
127
128
  return (0, _element.createElement)("div", {
128
129
  className: "block-editor-link-control__search-input-container"
129
130
  }, (0, _element.createElement)(_.URLInput, {
131
+ disableSuggestions: currentLink?.url === value,
130
132
  __nextHasNoMarginBottom: true,
131
133
  label: useLabel ? 'URL' : undefined,
132
134
  className: inputClasses,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/link-control/search-input.js"],"names":["noopSearchHandler","Promise","resolve","noop","LinkControlSearchInput","value","children","currentLink","className","placeholder","withCreateSuggestion","onCreateSuggestion","onChange","onSelect","showSuggestions","renderSuggestions","props","fetchSuggestions","allowDirectEntry","showInitialSuggestions","suggestionsQuery","withURLSuggestion","createSuggestionButtonText","useLabel","ref","genericSearchHandler","searchHandler","instanceId","focusedSuggestion","setFocusedSuggestion","onInputChange","selection","suggestion","handleRenderSuggestions","handleSuggestionClick","onSuggestionSelected","selectedSuggestion","CREATE_TYPE","type","title","url","e","Object","keys","length","id","restLinkProps","inputClasses","undefined","event","hasSuggestion","trim","preventDefault"],"mappings":";;;;;;;;;AAQA;;AALA;;AAIA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAEA;AACA;AACA;;AAKA;AACA;AACA;AAMA;AACA;AACA;AACA,MAAMA,iBAAiB,GAAG,MAAMC,OAAO,CAACC,OAAR,CAAiB,EAAjB,CAAhC;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,MAAMC,sBAAsB,GAAG,yBAC9B,CACC;AACCC,EAAAA,KADD;AAECC,EAAAA,QAFD;AAGCC,EAAAA,WAAW,GAAG,EAHf;AAICC,EAAAA,SAAS,GAAG,IAJb;AAKCC,EAAAA,WAAW,GAAG,IALf;AAMCC,EAAAA,oBAAoB,GAAG,KANxB;AAOCC,EAAAA,kBAAkB,GAAGR,IAPtB;AAQCS,EAAAA,QAAQ,GAAGT,IARZ;AASCU,EAAAA,QAAQ,GAAGV,IATZ;AAUCW,EAAAA,eAAe,GAAG,IAVnB;AAWCC,EAAAA,iBAAiB,GAAKC,KAAF,IACnB,4BAAC,sBAAD,EAA+BA,KAA/B,CAZF;AAcCC,EAAAA,gBAAgB,GAAG,IAdpB;AAeCC,EAAAA,gBAAgB,GAAG,IAfpB;AAgBCC,EAAAA,sBAAsB,GAAG,KAhB1B;AAiBCC,EAAAA,gBAAgB,GAAG,EAjBpB;AAkBCC,EAAAA,iBAAiB,GAAG,IAlBrB;AAmBCC,EAAAA,0BAnBD;AAoBCC,EAAAA,QAAQ,GAAG;AApBZ,CADD,EAuBCC,GAvBD,KAwBK;AACJ,QAAMC,oBAAoB,GAAG,+BAC5BL,gBAD4B,EAE5BF,gBAF4B,EAG5BR,oBAH4B,EA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A3BF;AA4BC,IAAA,GAAG,EAAGmB;AA5BP,IADD,EA+BGlB,QA/BH,CADD;AAmCA,CAtI6B,CAA/B;eAyIeF,sB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { URLInput } from '../';\nimport LinkControlSearchResults from './search-results';\nimport { CREATE_TYPE } from './constants';\nimport useSearchHandler from './use-search-handler';\n\n// Must be a function as otherwise URLInput will default\n// to the fetchLinkSuggestions passed in block editor settings\n// which will cause an unintended http request.\nconst noopSearchHandler = () => Promise.resolve( [] );\n\nconst noop = () => {};\n\nconst LinkControlSearchInput = forwardRef(\n\t(\n\t\t{\n\t\t\tvalue,\n\t\t\tchildren,\n\t\t\tcurrentLink = {},\n\t\t\tclassName = null,\n\t\t\tplaceholder = null,\n\t\t\twithCreateSuggestion = false,\n\t\t\tonCreateSuggestion = noop,\n\t\t\tonChange = noop,\n\t\t\tonSelect = noop,\n\t\t\tshowSuggestions = true,\n\t\t\trenderSuggestions = ( props ) => (\n\t\t\t\t<LinkControlSearchResults { ...props } />\n\t\t\t),\n\t\t\tfetchSuggestions = null,\n\t\t\tallowDirectEntry = true,\n\t\t\tshowInitialSuggestions = false,\n\t\t\tsuggestionsQuery = {},\n\t\t\twithURLSuggestion = true,\n\t\t\tcreateSuggestionButtonText,\n\t\t\tuseLabel = false,\n\t\t},\n\t\tref\n\t) => {\n\t\tconst genericSearchHandler = useSearchHandler(\n\t\t\tsuggestionsQuery,\n\t\t\tallowDirectEntry,\n\t\t\twithCreateSuggestion,\n\t\t\twithURLSuggestion\n\t\t);\n\n\t\tconst searchHandler = showSuggestions\n\t\t\t? fetchSuggestions || genericSearchHandler\n\t\t\t: noopSearchHandler;\n\n\t\tconst instanceId = useInstanceId( LinkControlSearchInput );\n\t\tconst [ focusedSuggestion, setFocusedSuggestion ] = useState();\n\n\t\t/**\n\t\t * Handles the user moving between different suggestions. Does not handle\n\t\t * choosing an individual item.\n\t\t *\n\t\t * @param {string} selection the url of the selected suggestion.\n\t\t * @param {Object} suggestion the suggestion object.\n\t\t */\n\t\tconst onInputChange = ( selection, suggestion ) => {\n\t\t\tonChange( selection );\n\t\t\tsetFocusedSuggestion( suggestion );\n\t\t};\n\n\t\tconst handleRenderSuggestions = ( props ) =>\n\t\t\trenderSuggestions( {\n\t\t\t\t...props,\n\t\t\t\tinstanceId,\n\t\t\t\twithCreateSuggestion,\n\t\t\t\tcreateSuggestionButtonText,\n\t\t\t\tsuggestionsQuery,\n\t\t\t\thandleSuggestionClick: ( suggestion ) => {\n\t\t\t\t\tif ( props.handleSuggestionClick ) {\n\t\t\t\t\t\tprops.handleSuggestionClick( suggestion );\n\t\t\t\t\t}\n\t\t\t\t\tonSuggestionSelected( suggestion );\n\t\t\t\t},\n\t\t\t} );\n\n\t\tconst onSuggestionSelected = async ( selectedSuggestion ) => {\n\t\t\tlet suggestion = selectedSuggestion;\n\t\t\tif ( CREATE_TYPE === selectedSuggestion.type ) {\n\t\t\t\t// Create a new page and call onSelect with the output from the onCreateSuggestion callback.\n\t\t\t\ttry {\n\t\t\t\t\tsuggestion = await onCreateSuggestion(\n\t\t\t\t\t\tselectedSuggestion.title\n\t\t\t\t\t);\n\t\t\t\t\tif ( suggestion?.url ) {\n\t\t\t\t\t\tonSelect( suggestion );\n\t\t\t\t\t}\n\t\t\t\t} catch ( e ) {}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tallowDirectEntry ||\n\t\t\t\t( suggestion && Object.keys( suggestion ).length >= 1 )\n\t\t\t) {\n\t\t\t\tconst { id, url, ...restLinkProps } = currentLink ?? {};\n\t\t\t\tonSelect(\n\t\t\t\t\t// Some direct entries don't have types or IDs, and we still need to clear the previous ones.\n\t\t\t\t\t{ ...restLinkProps, ...suggestion },\n\t\t\t\t\tsuggestion\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\tconst inputClasses = classnames( className, {\n\t\t\t'has-no-label': ! useLabel,\n\t\t} );\n\n\t\treturn (\n\t\t\t<div className=\"block-editor-link-control__search-input-container\">\n\t\t\t\t<URLInput\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ useLabel ? 'URL' : undefined }\n\t\t\t\t\tclassName={ inputClasses }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ onInputChange }\n\t\t\t\t\tplaceholder={ placeholder ?? __( 'Search or type url' ) }\n\t\t\t\t\t__experimentalRenderSuggestions={\n\t\t\t\t\t\tshowSuggestions ? handleRenderSuggestions : null\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalFetchLinkSuggestions={ searchHandler }\n\t\t\t\t\t__experimentalHandleURLSuggestions={ true }\n\t\t\t\t\t__experimentalShowInitialSuggestions={\n\t\t\t\t\t\tshowInitialSuggestions\n\t\t\t\t\t}\n\t\t\t\t\tonSubmit={ ( suggestion, event ) => {\n\t\t\t\t\t\tconst hasSuggestion = suggestion || focusedSuggestion;\n\n\t\t\t\t\t\t// If there is no suggestion and the value (ie: any manually entered URL) is empty\n\t\t\t\t\t\t// then don't allow submission otherwise we get empty links.\n\t\t\t\t\t\tif ( ! hasSuggestion && ! value?.trim()?.length ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tonSuggestionSelected(\n\t\t\t\t\t\t\t\thasSuggestion || { url: value }\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tref={ ref }\n\t\t\t\t/>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nexport default LinkControlSearchInput;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/link-control/search-input.js"],"names":["noopSearchHandler","Promise","resolve","noop","LinkControlSearchInput","value","children","currentLink","className","placeholder","withCreateSuggestion","onCreateSuggestion","onChange","onSelect","showSuggestions","renderSuggestions","props","fetchSuggestions","allowDirectEntry","showInitialSuggestions","suggestionsQuery","withURLSuggestion","createSuggestionButtonText","useLabel","ref","genericSearchHandler","searchHandler","instanceId","focusedSuggestion","setFocusedSuggestion","onInputChange","selection","suggestion","handleRenderSuggestions","handleSuggestionClick","onSuggestionSelected","selectedSuggestion","CREATE_TYPE","type","title","url","e","Object","keys","length","id","restLinkProps","inputClasses","undefined","event","hasSuggestion","trim","preventDefault"],"mappings":";;;;;;;;;AAQA;;AALA;;AAIA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAEA;AACA;AACA;;AAKA;AACA;AACA;AAMA;AACA;AACA;AACA,MAAMA,iBAAiB,GAAG,MAAMC,OAAO,CAACC,OAAR,CAAiB,EAAjB,CAAhC;;AAEA,MAAMC,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEA,MAAMC,sBAAsB,GAAG,yBAC9B,CACC;AACCC,EAAAA,KADD;AAECC,EAAAA,QAFD;AAGCC,EAAAA,WAAW,GAAG,EAHf;AAICC,EAAAA,SAAS,GAAG,IAJb;AAKCC,EAAAA,WAAW,GAAG,IALf;AAMCC,EAAAA,oBAAoB,GAAG,KANxB;AAOCC,EAAAA,kBAAkB,GAAGR,IAPtB;AAQCS,EAAAA,QAAQ,GAAGT,IARZ;AASCU,EAAAA,QAAQ,GAAGV,IATZ;AAUCW,EAAAA,eAAe,GAAG,IAVnB;AAWCC,EAAAA,iBAAiB,GAAKC,KAAF,IACnB,4BAAC,sBAAD,OAA+BA;AAA/B,IAZF;AAcCC,EAAAA,gBAAgB,GAAG,IAdpB;AAeCC,EAAAA,gBAAgB,GAAG,IAfpB;AAgBCC,EAAAA,sBAAsB,GAAG,KAhB1B;AAiBCC,EAAAA,gBAAgB,GAAG,EAjBpB;AAkBCC,EAAAA,iBAAiB,GAAG,IAlBrB;AAmBCC,EAAAA,0BAnBD;AAoBCC,EAAAA,QA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E7C,KAAK,EAAE8C,IAAP,IAAeP,MAAzC,EAAkD;AACjDK,QAAAA,KAAK,CAACG,cAAN;AACA,OAFD,MAEO;AACNjB,QAAAA,oBAAoB,CACnBe,aAAa,IAAI;AAAEV,UAAAA,GAAG,EAAEnC;AAAP,SADE,CAApB;AAGA;AACD,KA5BF;AA6BC,IAAA,GAAG,EAAGmB;AA7BP,IADD,EAgCGlB,QAhCH,CADD;AAoCA,CAvI6B,CAA/B;eA0IeF,sB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { forwardRef, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { URLInput } from '../';\nimport LinkControlSearchResults from './search-results';\nimport { CREATE_TYPE } from './constants';\nimport useSearchHandler from './use-search-handler';\n\n// Must be a function as otherwise URLInput will default\n// to the fetchLinkSuggestions passed in block editor settings\n// which will cause an unintended http request.\nconst noopSearchHandler = () => Promise.resolve( [] );\n\nconst noop = () => {};\n\nconst LinkControlSearchInput = forwardRef(\n\t(\n\t\t{\n\t\t\tvalue,\n\t\t\tchildren,\n\t\t\tcurrentLink = {},\n\t\t\tclassName = null,\n\t\t\tplaceholder = null,\n\t\t\twithCreateSuggestion = false,\n\t\t\tonCreateSuggestion = noop,\n\t\t\tonChange = noop,\n\t\t\tonSelect = noop,\n\t\t\tshowSuggestions = true,\n\t\t\trenderSuggestions = ( props ) => (\n\t\t\t\t<LinkControlSearchResults { ...props } />\n\t\t\t),\n\t\t\tfetchSuggestions = null,\n\t\t\tallowDirectEntry = true,\n\t\t\tshowInitialSuggestions = false,\n\t\t\tsuggestionsQuery = {},\n\t\t\twithURLSuggestion = true,\n\t\t\tcreateSuggestionButtonText,\n\t\t\tuseLabel = false,\n\t\t},\n\t\tref\n\t) => {\n\t\tconst genericSearchHandler = useSearchHandler(\n\t\t\tsuggestionsQuery,\n\t\t\tallowDirectEntry,\n\t\t\twithCreateSuggestion,\n\t\t\twithURLSuggestion\n\t\t);\n\n\t\tconst searchHandler = showSuggestions\n\t\t\t? fetchSuggestions || genericSearchHandler\n\t\t\t: noopSearchHandler;\n\n\t\tconst instanceId = useInstanceId( LinkControlSearchInput );\n\t\tconst [ focusedSuggestion, setFocusedSuggestion ] = useState();\n\n\t\t/**\n\t\t * Handles the user moving between different suggestions. Does not handle\n\t\t * choosing an individual item.\n\t\t *\n\t\t * @param {string} selection the url of the selected suggestion.\n\t\t * @param {Object} suggestion the suggestion object.\n\t\t */\n\t\tconst onInputChange = ( selection, suggestion ) => {\n\t\t\tonChange( selection );\n\t\t\tsetFocusedSuggestion( suggestion );\n\t\t};\n\n\t\tconst handleRenderSuggestions = ( props ) =>\n\t\t\trenderSuggestions( {\n\t\t\t\t...props,\n\t\t\t\tinstanceId,\n\t\t\t\twithCreateSuggestion,\n\t\t\t\tcreateSuggestionButtonText,\n\t\t\t\tsuggestionsQuery,\n\t\t\t\thandleSuggestionClick: ( suggestion ) => {\n\t\t\t\t\tif ( props.handleSuggestionClick ) {\n\t\t\t\t\t\tprops.handleSuggestionClick( suggestion );\n\t\t\t\t\t}\n\t\t\t\t\tonSuggestionSelected( suggestion );\n\t\t\t\t},\n\t\t\t} );\n\n\t\tconst onSuggestionSelected = async ( selectedSuggestion ) => {\n\t\t\tlet suggestion = selectedSuggestion;\n\t\t\tif ( CREATE_TYPE === selectedSuggestion.type ) {\n\t\t\t\t// Create a new page and call onSelect with the output from the onCreateSuggestion callback.\n\t\t\t\ttry {\n\t\t\t\t\tsuggestion = await onCreateSuggestion(\n\t\t\t\t\t\tselectedSuggestion.title\n\t\t\t\t\t);\n\t\t\t\t\tif ( suggestion?.url ) {\n\t\t\t\t\t\tonSelect( suggestion );\n\t\t\t\t\t}\n\t\t\t\t} catch ( e ) {}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tallowDirectEntry ||\n\t\t\t\t( suggestion && Object.keys( suggestion ).length >= 1 )\n\t\t\t) {\n\t\t\t\tconst { id, url, ...restLinkProps } = currentLink ?? {};\n\t\t\t\tonSelect(\n\t\t\t\t\t// Some direct entries don't have types or IDs, and we still need to clear the previous ones.\n\t\t\t\t\t{ ...restLinkProps, ...suggestion },\n\t\t\t\t\tsuggestion\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\tconst inputClasses = classnames( className, {\n\t\t\t'has-no-label': ! useLabel,\n\t\t} );\n\n\t\treturn (\n\t\t\t<div className=\"block-editor-link-control__search-input-container\">\n\t\t\t\t<URLInput\n\t\t\t\t\tdisableSuggestions={ currentLink?.url === value }\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ useLabel ? 'URL' : undefined }\n\t\t\t\t\tclassName={ inputClasses }\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonChange={ onInputChange }\n\t\t\t\t\tplaceholder={ placeholder ?? __( 'Search or type url' ) }\n\t\t\t\t\t__experimentalRenderSuggestions={\n\t\t\t\t\t\tshowSuggestions ? handleRenderSuggestions : null\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalFetchLinkSuggestions={ searchHandler }\n\t\t\t\t\t__experimentalHandleURLSuggestions={ true }\n\t\t\t\t\t__experimentalShowInitialSuggestions={\n\t\t\t\t\t\tshowInitialSuggestions\n\t\t\t\t\t}\n\t\t\t\t\tonSubmit={ ( suggestion, event ) => {\n\t\t\t\t\t\tconst hasSuggestion = suggestion || focusedSuggestion;\n\n\t\t\t\t\t\t// If there is no suggestion and the value (ie: any manually entered URL) is empty\n\t\t\t\t\t\t// then don't allow submission otherwise we get empty links.\n\t\t\t\t\t\tif ( ! hasSuggestion && ! value?.trim()?.length ) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tonSuggestionSelected(\n\t\t\t\t\t\t\t\thasSuggestion || { url: value }\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t\tref={ ref }\n\t\t\t\t/>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nexport default LinkControlSearchInput;\n"]}
@@ -9,8 +9,6 @@ exports.default = exports.LinkControlSearchItem = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _classnames = _interopRequireDefault(require("classnames"));
15
13
 
16
14
  var _url = require("@wordpress/url");
@@ -69,14 +67,14 @@ const LinkControlSearchItem = ({
69
67
  searchTerm = '',
70
68
  shouldShowType = false
71
69
  }) => {
72
- return (0, _element.createElement)(_components.Button, (0, _extends2.default)({}, itemProps, {
70
+ return (0, _element.createElement)(_components.Button, { ...itemProps,
73
71
  onClick: onClick,
74
72
  className: (0, _classnames.default)('block-editor-link-control__search-item', {
75
73
  'is-selected': isSelected,
76
74
  'is-url': isURL,
77
75
  'is-entity': !isURL
78
76
  })
79
- }), (0, _element.createElement)(SearchItemIcon, {
77
+ }, (0, _element.createElement)(SearchItemIcon, {
80
78
  suggestion: suggestion,
81
79
  isURL: isURL
82
80
  }), (0, _element.createElement)("span", {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/link-control/search-item.js"],"names":["ICONS_MAP","post","postList","page","post_tag","tag","category","attachment","file","SearchItemIcon","isURL","suggestion","icon","globe","type","LinkControlSearchItem","itemProps","isSelected","onClick","searchTerm","shouldShowType","title","url","getVisualTypeName","isFrontPage"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AASA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;AAeA,MAAMA,SAAS,GAAG;AACjBC,EAAAA,IAAI,EAAEC,eADW;AAEjBC,EAAAA,IAAI,EAAJA,WAFiB;AAGjBC,EAAAA,QAAQ,EAAEC,UAHO;AAIjBC,EAAAA,QAAQ,EAARA,eAJiB;AAKjBC,EAAAA,UAAU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c,CAAET,KADjB;AAEC,IAAA,SAAS,EAAC;AAFX,KAIG,CAAEA,KAAF,KACC,8BACD,wBAAeC,UAAU,CAACW,GAA1B,CADC,KAGD,EAJA,CAJH,EASGZ,KAAK,IAAI,cAAI,8BAAJ,CATZ,CARD,CAXD,EA+BGU,cAAc,IAAIT,UAAU,CAACG,IAA7B,IACD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGS,iBAAiB,CAAEZ,UAAF,CADpB,CAhCF,CADD;AAuCA,CAhDM;;;;AAkDP,SAASY,iBAAT,CAA4BZ,UAA5B,EAAyC;AACxC,MAAKA,UAAU,CAACa,WAAhB,EAA8B;AAC7B,WAAO,YAAP;AACA,GAHuC,CAKxC;;;AACA,SAAOb,UAAU,CAACG,IAAX,KAAoB,UAApB,GAAiC,KAAjC,GAAyCH,UAAU,CAACG,IAA3D;AACA;;eAEcC,qB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { safeDecodeURI, filterURLForDisplay } from '@wordpress/url';\nimport { __ } from '@wordpress/i18n';\nimport { Button, TextHighlight } from '@wordpress/components';\nimport {\n\tIcon,\n\tglobe,\n\tpage,\n\ttag,\n\tpostList,\n\tcategory,\n\tfile,\n} from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\nconst ICONS_MAP = {\n\tpost: postList,\n\tpage,\n\tpost_tag: tag,\n\tcategory,\n\tattachment: file,\n};\n\nfunction SearchItemIcon( { isURL, suggestion } ) {\n\tlet icon = null;\n\n\tif ( isURL ) {\n\t\ticon = globe;\n\t} else if ( suggestion.type in ICONS_MAP ) {\n\t\ticon = ICONS_MAP[ suggestion.type ];\n\t}\n\n\tif ( icon ) {\n\t\treturn (\n\t\t\t<Icon\n\t\t\t\tclassName=\"block-editor-link-control__search-item-icon\"\n\t\t\t\ticon={ icon }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn null;\n}\n\nexport const LinkControlSearchItem = ( {\n\titemProps,\n\tsuggestion,\n\tisSelected = false,\n\tonClick,\n\tisURL = false,\n\tsearchTerm = '',\n\tshouldShowType = false,\n} ) => {\n\treturn (\n\t\t<Button\n\t\t\t{ ...itemProps }\n\t\t\tonClick={ onClick }\n\t\t\tclassName={ classnames( 'block-editor-link-control__search-item', {\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-url': isURL,\n\t\t\t\t'is-entity': ! isURL,\n\t\t\t} ) }\n\t\t>\n\t\t\t<SearchItemIcon suggestion={ suggestion } isURL={ isURL } />\n\n\t\t\t<span className=\"block-editor-link-control__search-item-header\">\n\t\t\t\t<span className=\"block-editor-link-control__search-item-title\">\n\t\t\t\t\t<TextHighlight\n\t\t\t\t\t\t// The component expects a plain text string.\n\t\t\t\t\t\ttext={ stripHTML( suggestion.title ) }\n\t\t\t\t\t\thighlight={ searchTerm }\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t\t<span\n\t\t\t\t\taria-hidden={ ! isURL }\n\t\t\t\t\tclassName=\"block-editor-link-control__search-item-info\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isURL &&\n\t\t\t\t\t\t( filterURLForDisplay(\n\t\t\t\t\t\t\tsafeDecodeURI( suggestion.url )\n\t\t\t\t\t\t) ||\n\t\t\t\t\t\t\t'' ) }\n\t\t\t\t\t{ isURL && __( 'Press ENTER to add this link' ) }\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t\t{ shouldShowType && suggestion.type && (\n\t\t\t\t<span className=\"block-editor-link-control__search-item-type\">\n\t\t\t\t\t{ getVisualTypeName( suggestion ) }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t</Button>\n\t);\n};\n\nfunction getVisualTypeName( suggestion ) {\n\tif ( suggestion.isFrontPage ) {\n\t\treturn 'front page';\n\t}\n\n\t// Rename 'post_tag' to 'tag'. Ideally, the API would return the localised CPT or taxonomy label.\n\treturn suggestion.type === 'post_tag' ? 'tag' : suggestion.type;\n}\n\nexport default LinkControlSearchItem;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/link-control/search-item.js"],"names":["ICONS_MAP","post","postList","page","post_tag","tag","category","attachment","file","SearchItemIcon","isURL","suggestion","icon","globe","type","LinkControlSearchItem","itemProps","isSelected","onClick","searchTerm","shouldShowType","title","url","getVisualTypeName","isFrontPage"],"mappings":";;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AASA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;AAeA,MAAMA,SAAS,GAAG;AACjBC,EAAAA,IAAI,EAAEC,eADW;AAEjBC,EAAAA,IAAI,EAAJA,WAFiB;AAGjBC,EAAAA,QAAQ,EAAEC,UAHO;AAIjBC,EAAAA,QAAQ,EAARA,eAJiB;AAKjBC,EAAAA,UAAU,EAAEC;AALK,CAAlB;;AAQA,SAASC,cAAT,CAAyB;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAzB,EAAiD;AAChD,MAAIC,IAAI,GAAG,IAAX;;AAEA,MAAKF,KAAL,EAAa;AACZE,IAAAA,IAAI,GAAGC,YAAP;AACA,GAFD,MAEO,IAAKF,UAAU,CAACG,IAAX,IAAmBd,SAAxB,EAAoC;AAC1CY,IAAAA,IAAI,GAAGZ,SAAS,CAAEW,UAAU,CAACG,IAAb,CAAhB;AACA;;AAED,MAAKF,IAAL,EAAY;AACX,WACC,4BAAC,WAAD;AACC,MAAA,SAAS,EAAC,6CADX;AAEC,MAAA,IAAI,EAAGA;AAFR,MADD;AAMA;;AAED,SAAO,IAAP;AACA;;AAEM,MAAMG,qBAAqB,GAAG,CAAE;AACtCC,EAAAA,SADsC;AAEtCL,EAAAA,UAFsC;AAGtCM,EAAAA,UAAU,GAAG,KAHyB;AAItCC,EAAAA,OAJsC;AAKtCR,EAAAA,KAAK,GAAG,KAL8B;AAMtCS,EAAAA,UAAU,GAAG,EANyB;AAOtCC,EAAAA,cAAc,GAAG;AAPqB,CAAF,KAQ9B;AACN,SACC,4BAAC,kBAAD,OACMJ,SADN;AAEC,IAAA,OAAO,EAAGE,OAFX;AAGC,IAAA,SAAS,EAAG,yBAAY,wCAAZ,EAAsD;AACjE,qBAAeD,UADkD;AAEjE,gBAAUP,KAFuD;AAGjE,mBAAa,CAAEA;AAHkD,KAAtD;AAHb,KASC,4BAAC,cAAD;AAAgB,IAAA,UAAU,EAAGC,UAA7B;AAA0C,IAAA,KAAK,EAAGD;AAAlD,IATD,EAWC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,4BAAC,yBAAD,CACC;AADD;AAEC,IAAA,IAAI,EAAG,8BAAWC,UAAU,CAACU,KAAtB,CAFR;AAGC,IAAA,SAAS,EAAGF;AAHb,IADD,CADD,EAQC;AACC,mBAAc,CAAET,KADjB;AAEC,IAAA,SAAS,EAAC;AAFX,KAIG,CAAEA,KAAF,KACC,8BACD,wBAAeC,UAAU,CAACW,GAA1B,CADC,KAGD,EAJA,CAJH,EASGZ,KAAK,IAAI,cAAI,8BAAJ,CATZ,CARD,CAXD,EA+BGU,cAAc,IAAIT,UAAU,CAACG,IAA7B,IACD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGS,iBAAiB,CAAEZ,UAAF,CADpB,CAhCF,CADD;AAuCA,CAhDM;;;;AAkDP,SAASY,iBAAT,CAA4BZ,UAA5B,EAAyC;AACxC,MAAKA,UAAU,CAACa,WAAhB,EAA8B;AAC7B,WAAO,YAAP;AACA,GAHuC,CAKxC;;;AACA,SAAOb,UAAU,CAACG,IAAX,KAAoB,UAApB,GAAiC,KAAjC,GAAyCH,UAAU,CAACG,IAA3D;AACA;;eAEcC,qB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { safeDecodeURI, filterURLForDisplay } from '@wordpress/url';\nimport { __ } from '@wordpress/i18n';\nimport { Button, TextHighlight } from '@wordpress/components';\nimport {\n\tIcon,\n\tglobe,\n\tpage,\n\ttag,\n\tpostList,\n\tcategory,\n\tfile,\n} from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\n\nconst ICONS_MAP = {\n\tpost: postList,\n\tpage,\n\tpost_tag: tag,\n\tcategory,\n\tattachment: file,\n};\n\nfunction SearchItemIcon( { isURL, suggestion } ) {\n\tlet icon = null;\n\n\tif ( isURL ) {\n\t\ticon = globe;\n\t} else if ( suggestion.type in ICONS_MAP ) {\n\t\ticon = ICONS_MAP[ suggestion.type ];\n\t}\n\n\tif ( icon ) {\n\t\treturn (\n\t\t\t<Icon\n\t\t\t\tclassName=\"block-editor-link-control__search-item-icon\"\n\t\t\t\ticon={ icon }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn null;\n}\n\nexport const LinkControlSearchItem = ( {\n\titemProps,\n\tsuggestion,\n\tisSelected = false,\n\tonClick,\n\tisURL = false,\n\tsearchTerm = '',\n\tshouldShowType = false,\n} ) => {\n\treturn (\n\t\t<Button\n\t\t\t{ ...itemProps }\n\t\t\tonClick={ onClick }\n\t\t\tclassName={ classnames( 'block-editor-link-control__search-item', {\n\t\t\t\t'is-selected': isSelected,\n\t\t\t\t'is-url': isURL,\n\t\t\t\t'is-entity': ! isURL,\n\t\t\t} ) }\n\t\t>\n\t\t\t<SearchItemIcon suggestion={ suggestion } isURL={ isURL } />\n\n\t\t\t<span className=\"block-editor-link-control__search-item-header\">\n\t\t\t\t<span className=\"block-editor-link-control__search-item-title\">\n\t\t\t\t\t<TextHighlight\n\t\t\t\t\t\t// The component expects a plain text string.\n\t\t\t\t\t\ttext={ stripHTML( suggestion.title ) }\n\t\t\t\t\t\thighlight={ searchTerm }\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t\t<span\n\t\t\t\t\taria-hidden={ ! isURL }\n\t\t\t\t\tclassName=\"block-editor-link-control__search-item-info\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isURL &&\n\t\t\t\t\t\t( filterURLForDisplay(\n\t\t\t\t\t\t\tsafeDecodeURI( suggestion.url )\n\t\t\t\t\t\t) ||\n\t\t\t\t\t\t\t'' ) }\n\t\t\t\t\t{ isURL && __( 'Press ENTER to add this link' ) }\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t\t{ shouldShowType && suggestion.type && (\n\t\t\t\t<span className=\"block-editor-link-control__search-item-type\">\n\t\t\t\t\t{ getVisualTypeName( suggestion ) }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t</Button>\n\t);\n};\n\nfunction getVisualTypeName( suggestion ) {\n\tif ( suggestion.isFrontPage ) {\n\t\treturn 'front page';\n\t}\n\n\t// Rename 'post_tag' to 'tag'. Ideally, the API would return the localised CPT or taxonomy label.\n\treturn suggestion.type === 'post_tag' ? 'tag' : suggestion.type;\n}\n\nexport default LinkControlSearchItem;\n"]}
@@ -9,8 +9,6 @@ exports.default = LinkControlSearchResults;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _i18n = require("@wordpress/i18n");
15
13
 
16
14
  var _components = require("@wordpress/components");
@@ -69,10 +67,10 @@ function LinkControlSearchResults({
69
67
  }, labelText);
70
68
  return (0, _element.createElement)("div", {
71
69
  className: "block-editor-link-control__search-results-wrapper"
72
- }, searchResultsLabel, (0, _element.createElement)("div", (0, _extends2.default)({}, suggestionsListProps, {
70
+ }, searchResultsLabel, (0, _element.createElement)("div", { ...suggestionsListProps,
73
71
  className: resultsListClasses,
74
72
  "aria-labelledby": searchResultsLabelId
75
- }), suggestions.map((suggestion, index) => {
73
+ }, suggestions.map((suggestion, index) => {
76
74
  if (shouldShowCreateSuggestion && _constants.CREATE_TYPE === suggestion.type) {
77
75
  return (0, _element.createElement)(_searchCreateButton.default, {
78
76
  searchTerm: currentInputValue,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/link-control/search-results.js"],"names":["LinkControlSearchResults","instanceId","withCreateSuggestion","currentInputValue","handleSuggestionClick","suggestionsListProps","buildSuggestionItemProps","suggestions","selectedSuggestion","isLoading","isInitialSuggestions","createSuggestionButtonText","suggestionsQuery","resultsListClasses","isSingleDirectEntryResult","length","LINK_ENTRY_TYPES","includes","type","shouldShowCreateSuggestion","shouldShowSuggestionsTypes","searchResultsLabelId","labelText","searchResultsLabel","map","suggestion","index","CREATE_TYPE","id","isFrontPage"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AAKe,SAASA,wBAAT,CAAmC;AACjDC,EAAAA,UADiD;AAEjDC,EAAAA,oBAFiD;AAGjDC,EAAAA,iBAHiD;AAIjDC,EAAAA,qBAJiD;AAKjDC,EAAAA,oBALiD;AAMjDC,EAAAA,wBANiD;AAOjDC,EAAAA,WAPiD;AAQjDC,EAAAA,kBARiD;AASjDC,EAAAA,SATiD;AAUjDC,EAAAA,oBAViD;AAWjDC,EAAAA,0BAXiD;AAYjDC,EAAAA;AAZiD,CAAnC,EAaX;AACH,QAAMC,kBAAkB,GAAG,yBAC1B,2CAD0B,EAE1B;AACC,kBAAcJ;AADf,GAF0B,CAA3B;;AAOA,QAAMK,yBAAyB,GAC9BP,WAAW,CAACQ,MAAZ,KAAuB,CAAvB,IACAC,4BAAiBC,QAAjB,CAA2BV,WAAW,CAAE,CAAF,CAAX,CAAiBW,IAA5C,CAFD;;AAGA,QAAMC,0BAA0B,GAC/BjB,oBAAoB,IACpB,CAAEY,yBADF,IAEA,CAAEJ,oBAHH,CAXG,CAeH;;AACA,QAAMU,0BAA0B,GAAG,CAAER,gBAAgB,EAAEM,IAAvD,CAhBG,CAkBH;AACA;AACA;;AACA,QAAMG,oBAAoB,GAAI,kDAAkDpB,UAAY,EAA5F;AACA,QAAMqB,SAAS,GAAGZ,oBAAoB,GACnC,cAAI,aAAJ,CADmC,GAEnC;AACA;AACA,gBAAI,yBAAJ,CAFA,EAGAP,iBAHA,C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,IADJ,CAZT;AAeC,MAAA,UAAU,EAAGf,iBAfd;AAgBC,MAAA,cAAc,EAAGiB,0BAhBlB;AAiBC,MAAA,WAAW,EAAGK,UAAU,EAAEI;AAjB3B,MADD;AAqBA,GApDC,CALH,CAFD,CADD;AAgEA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { VisuallyHidden } from '@wordpress/components';\n\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport LinkControlSearchCreate from './search-create-button';\nimport LinkControlSearchItem from './search-item';\nimport { CREATE_TYPE, LINK_ENTRY_TYPES } from './constants';\n\nexport default function LinkControlSearchResults( {\n\tinstanceId,\n\twithCreateSuggestion,\n\tcurrentInputValue,\n\thandleSuggestionClick,\n\tsuggestionsListProps,\n\tbuildSuggestionItemProps,\n\tsuggestions,\n\tselectedSuggestion,\n\tisLoading,\n\tisInitialSuggestions,\n\tcreateSuggestionButtonText,\n\tsuggestionsQuery,\n} ) {\n\tconst resultsListClasses = classnames(\n\t\t'block-editor-link-control__search-results',\n\t\t{\n\t\t\t'is-loading': isLoading,\n\t\t}\n\t);\n\n\tconst isSingleDirectEntryResult =\n\t\tsuggestions.length === 1 &&\n\t\tLINK_ENTRY_TYPES.includes( suggestions[ 0 ].type );\n\tconst shouldShowCreateSuggestion =\n\t\twithCreateSuggestion &&\n\t\t! isSingleDirectEntryResult &&\n\t\t! isInitialSuggestions;\n\t// If the query has a specified type, then we can skip showing them in the result. See #24839.\n\tconst shouldShowSuggestionsTypes = ! suggestionsQuery?.type;\n\n\t// According to guidelines aria-label should be added if the label\n\t// itself is not visible.\n\t// See: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role\n\tconst searchResultsLabelId = `block-editor-link-control-search-results-label-${ instanceId }`;\n\tconst labelText = isInitialSuggestions\n\t\t? __( 'Suggestions' )\n\t\t: sprintf(\n\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t__( 'Search results for \"%s\"' ),\n\t\t\t\tcurrentInputValue\n\t\t );\n\tconst searchResultsLabel = (\n\t\t<VisuallyHidden id={ searchResultsLabelId }>\n\t\t\t{ labelText }\n\t\t</VisuallyHidden>\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-link-control__search-results-wrapper\">\n\t\t\t{ searchResultsLabel }\n\t\t\t<div\n\t\t\t\t{ ...suggestionsListProps }\n\t\t\t\tclassName={ resultsListClasses }\n\t\t\t\taria-labelledby={ searchResultsLabelId }\n\t\t\t>\n\t\t\t\t{ suggestions.map( ( suggestion, index ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tshouldShowCreateSuggestion &&\n\t\t\t\t\t\tCREATE_TYPE === suggestion.type\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<LinkControlSearchCreate\n\t\t\t\t\t\t\t\tsearchTerm={ currentInputValue }\n\t\t\t\t\t\t\t\tbuttonText={ createSuggestionButtonText }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\thandleSuggestionClick( suggestion )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Intentionally only using `type` here as\n\t\t\t\t\t\t\t\t// the constant is enough to uniquely\n\t\t\t\t\t\t\t\t// identify the single \"CREATE\" suggestion.\n\t\t\t\t\t\t\t\tkey={ suggestion.type }\n\t\t\t\t\t\t\t\titemProps={ buildSuggestionItemProps(\n\t\t\t\t\t\t\t\t\tsuggestion,\n\t\t\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tisSelected={ index === selectedSuggestion }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If we're not handling \"Create\" suggestions above then\n\t\t\t\t\t// we don't want them in the main results so exit early.\n\t\t\t\t\tif ( CREATE_TYPE === suggestion.type ) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<LinkControlSearchItem\n\t\t\t\t\t\t\tkey={ `${ suggestion.id }-${ suggestion.type }` }\n\t\t\t\t\t\t\titemProps={ buildSuggestionItemProps(\n\t\t\t\t\t\t\t\tsuggestion,\n\t\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tsuggestion={ suggestion }\n\t\t\t\t\t\t\tindex={ index }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thandleSuggestionClick( suggestion );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisSelected={ index === selectedSuggestion }\n\t\t\t\t\t\t\tisURL={ LINK_ENTRY_TYPES.includes(\n\t\t\t\t\t\t\t\tsuggestion.type\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tsearchTerm={ currentInputValue }\n\t\t\t\t\t\t\tshouldShowType={ shouldShowSuggestionsTypes }\n\t\t\t\t\t\t\tisFrontPage={ suggestion?.isFrontPage }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/link-control/search-results.js"],"names":["LinkControlSearchResults","instanceId","withCreateSuggestion","currentInputValue","handleSuggestionClick","suggestionsListProps","buildSuggestionItemProps","suggestions","selectedSuggestion","isLoading","isInitialSuggestions","createSuggestionButtonText","suggestionsQuery","resultsListClasses","isSingleDirectEntryResult","length","LINK_ENTRY_TYPES","includes","type","shouldShowCreateSuggestion","shouldShowSuggestionsTypes","searchResultsLabelId","labelText","searchResultsLabel","map","suggestion","index","CREATE_TYPE","id","isFrontPage"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAKA;;AAKA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AAKe,SAASA,wBAAT,CAAmC;AACjDC,EAAAA,UADiD;AAEjDC,E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AGf,iBADd;AAEC,QAAA,UAAU,EAAGQ,0BAFd;AAGC,QAAA,OAAO,EAAG,MACTP,qBAAqB,CAAEqB,UAAF,CAJvB,CAMC;AACA;AACA;AARD;AASC,QAAA,GAAG,EAAGA,UAAU,CAACP,IATlB;AAUC,QAAA,SAAS,EAAGZ,wBAAwB,CACnCmB,UADmC,EAEnCC,KAFmC,CAVrC;AAcC,QAAA,UAAU,EAAGA,KAAK,KAAKlB;AAdxB,QADD;AAkBA,KAvB0C,CAyB3C;AACA;;;AACA,QAAKmB,2BAAgBF,UAAU,CAACP,IAAhC,EAAuC;AACtC,aAAO,IAAP;AACA;;AAED,WACC,4BAAC,mBAAD;AACC,MAAA,GAAG,EAAI,GAAGO,UAAU,CAACG,EAAI,IAAIH,UAAU,CAACP,IAAM,EAD/C;AAEC,MAAA,SAAS,EAAGZ,wBAAwB,CACnCmB,UADmC,EAEnCC,KAFmC,CAFrC;AAMC,MAAA,UAAU,EAAGD,UANd;AAOC,MAAA,KAAK,EAAGC,KAPT;AAQC,MAAA,OAAO,EAAG,MAAM;AACftB,QAAAA,qBAAqB,CAAEqB,UAAF,CAArB;AACA,OAVF;AAWC,MAAA,UAAU,EAAGC,KAAK,KAAKlB,kBAXxB;AAYC,MAAA,KAAK,EAAGQ,4BAAiBC,QAAjB,CACPQ,UAAU,CAACP,IADJ,CAZT;AAeC,MAAA,UAAU,EAAGf,iBAfd;AAgBC,MAAA,cAAc,EAAGiB,0BAhBlB;AAiBC,MAAA,WAAW,EAAGK,UAAU,EAAEI;AAjB3B,MADD;AAqBA,GApDC,CALH,CAFD,CADD;AAgEA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { VisuallyHidden } from '@wordpress/components';\n\n/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * Internal dependencies\n */\nimport LinkControlSearchCreate from './search-create-button';\nimport LinkControlSearchItem from './search-item';\nimport { CREATE_TYPE, LINK_ENTRY_TYPES } from './constants';\n\nexport default function LinkControlSearchResults( {\n\tinstanceId,\n\twithCreateSuggestion,\n\tcurrentInputValue,\n\thandleSuggestionClick,\n\tsuggestionsListProps,\n\tbuildSuggestionItemProps,\n\tsuggestions,\n\tselectedSuggestion,\n\tisLoading,\n\tisInitialSuggestions,\n\tcreateSuggestionButtonText,\n\tsuggestionsQuery,\n} ) {\n\tconst resultsListClasses = classnames(\n\t\t'block-editor-link-control__search-results',\n\t\t{\n\t\t\t'is-loading': isLoading,\n\t\t}\n\t);\n\n\tconst isSingleDirectEntryResult =\n\t\tsuggestions.length === 1 &&\n\t\tLINK_ENTRY_TYPES.includes( suggestions[ 0 ].type );\n\tconst shouldShowCreateSuggestion =\n\t\twithCreateSuggestion &&\n\t\t! isSingleDirectEntryResult &&\n\t\t! isInitialSuggestions;\n\t// If the query has a specified type, then we can skip showing them in the result. See #24839.\n\tconst shouldShowSuggestionsTypes = ! suggestionsQuery?.type;\n\n\t// According to guidelines aria-label should be added if the label\n\t// itself is not visible.\n\t// See: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role\n\tconst searchResultsLabelId = `block-editor-link-control-search-results-label-${ instanceId }`;\n\tconst labelText = isInitialSuggestions\n\t\t? __( 'Suggestions' )\n\t\t: sprintf(\n\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t__( 'Search results for \"%s\"' ),\n\t\t\t\tcurrentInputValue\n\t\t );\n\tconst searchResultsLabel = (\n\t\t<VisuallyHidden id={ searchResultsLabelId }>\n\t\t\t{ labelText }\n\t\t</VisuallyHidden>\n\t);\n\n\treturn (\n\t\t<div className=\"block-editor-link-control__search-results-wrapper\">\n\t\t\t{ searchResultsLabel }\n\t\t\t<div\n\t\t\t\t{ ...suggestionsListProps }\n\t\t\t\tclassName={ resultsListClasses }\n\t\t\t\taria-labelledby={ searchResultsLabelId }\n\t\t\t>\n\t\t\t\t{ suggestions.map( ( suggestion, index ) => {\n\t\t\t\t\tif (\n\t\t\t\t\t\tshouldShowCreateSuggestion &&\n\t\t\t\t\t\tCREATE_TYPE === suggestion.type\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<LinkControlSearchCreate\n\t\t\t\t\t\t\t\tsearchTerm={ currentInputValue }\n\t\t\t\t\t\t\t\tbuttonText={ createSuggestionButtonText }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\thandleSuggestionClick( suggestion )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Intentionally only using `type` here as\n\t\t\t\t\t\t\t\t// the constant is enough to uniquely\n\t\t\t\t\t\t\t\t// identify the single \"CREATE\" suggestion.\n\t\t\t\t\t\t\t\tkey={ suggestion.type }\n\t\t\t\t\t\t\t\titemProps={ buildSuggestionItemProps(\n\t\t\t\t\t\t\t\t\tsuggestion,\n\t\t\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tisSelected={ index === selectedSuggestion }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\t// If we're not handling \"Create\" suggestions above then\n\t\t\t\t\t// we don't want them in the main results so exit early.\n\t\t\t\t\tif ( CREATE_TYPE === suggestion.type ) {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<LinkControlSearchItem\n\t\t\t\t\t\t\tkey={ `${ suggestion.id }-${ suggestion.type }` }\n\t\t\t\t\t\t\titemProps={ buildSuggestionItemProps(\n\t\t\t\t\t\t\t\tsuggestion,\n\t\t\t\t\t\t\t\tindex\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tsuggestion={ suggestion }\n\t\t\t\t\t\t\tindex={ index }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thandleSuggestionClick( suggestion );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tisSelected={ index === selectedSuggestion }\n\t\t\t\t\t\t\tisURL={ LINK_ENTRY_TYPES.includes(\n\t\t\t\t\t\t\t\tsuggestion.type\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tsearchTerm={ currentInputValue }\n\t\t\t\t\t\t\tshouldShowType={ shouldShowSuggestionsTypes }\n\t\t\t\t\t\t\tisFrontPage={ suggestion?.isFrontPage }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"]}
@@ -9,8 +9,6 @@ exports.Appender = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _compose = require("@wordpress/compose");
15
13
 
16
14
  var _a11y = require("@wordpress/a11y");
@@ -85,15 +83,15 @@ const Appender = (0, _element.forwardRef)(({
85
83
  (0, _i18n.__)('Append to %1$s block at position %2$d, Level %3$d'), blockTitle, blockCount + 1, nestingLevel);
86
84
  return (0, _element.createElement)("div", {
87
85
  className: "list-view-appender"
88
- }, (0, _element.createElement)(_inserter.default, (0, _extends2.default)({
86
+ }, (0, _element.createElement)(_inserter.default, {
89
87
  ref: ref,
90
88
  rootClientId: clientId,
91
89
  position: "bottom right",
92
90
  isAppender: true,
93
91
  selectBlockOnInsert: false,
94
92
  shouldDirectInsert: false,
95
- __experimentalIsQuick: true
96
- }, props, {
93
+ __experimentalIsQuick: true,
94
+ ...props,
97
95
  toggleProps: {
98
96
  'aria-describedby': descriptionId
99
97
  },
@@ -102,7 +100,7 @@ const Appender = (0, _element.forwardRef)(({
102
100
  setInsertedBlock(maybeInsertedBlock);
103
101
  }
104
102
  }
105
- })), (0, _element.createElement)(_ariaReferencedText.default, {
103
+ }), (0, _element.createElement)(_ariaReferencedText.default, {
106
104
  id: descriptionId
107
105
  }, description));
108
106
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/list-view/appender.js"],"names":["Appender","nestingLevel","blockCount","clientId","props","ref","insertedBlock","setInsertedBlock","instanceId","hideInserter","select","getTemplateLock","__unstableGetEditorMode","blockEditorStore","blockTitle","context","insertedBlockTitle","length","descriptionId","description","maybeInsertedBlock"],"mappings":";;;;;;;;;AAMA;;;;AAHA;;AACA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAOA;AACA;AACA;AAOO,MAAMA,QAAQ,GAAG,yBACvB,CAAE;AAAEC,EAAAA,YAAF;AAAgBC,EAAAA,UAAhB;AAA4BC,EAAAA,QAA5B;AAAsC,KAAGC;AAAzC,CAAF,EAAoDC,GAApD,KAA6D;AAC5D,QAAM;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MAAsC,kCAA5C;AAEA,QAAMC,UAAU,GAAG,4BAAeR,QAAf,CAAnB;AACA,QAAM;AAAES,IAAAA;AAAF,MAAmB,qBACtBC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QACLF,MAAM,CAAEG,YAAF,CADP;AAGA,WAAO;AACNJ,MAAAA,YAAY,EACX,CAAC,CAAEE,eAAe,CAAER,QAAF,CAAlB,IACAS,uBAAuB,OAAO;AAHzB,KAAP;AAKA,GAVuB,EAWxB,CAAET,QAAF,CAXwB,CAAzB;AAcA,QAAMW,UAAU,GAAG,mCAAsB;AACxCX,IAAAA,QADwC;AAExCY,IAAAA,OAAO,EAAE;AAF+B,GAAtB,CAAnB;AAKA,QAAMC,kBAAkB,GAAG,mCAAsB;AAChDb,IAAAA,QAAQ,EAAEG,aAAa,EAAEH,QADuB;AAEhDY,IAAAA,OAAO,EAAE;AAFuC,GAAtB,CAA3B;AAKA,0BAAW,MAAM;AAChB,QAAK,CAAEC,kBAAkB,EAAEC,MAA3B,EAAoC;AACnC;AACA;;AAED,qBACC,oBACC;AACA,kBAAI,mBAAJ,CAFD,EAGCD,kBAHD,CADD,EAMC,WAND;AAQA,GAbD,EAaG,CAAEA,kBAAF,CAbH;;AAeA,MAAKP,YAAL,EAAoB;AACnB,WAAO,IAAP;AACA;;AAED,QAAMS,aAAa,GAAI,uBAAuBV,UAAY,EAA1D;AACA,QAAMW,WAAW,GAAG;AACnB;AACA,gBAAI,mDAAJ,CAFmB,EAGnBL,UAHmB,EAInBZ,UAAU,GAAG,CAJM,EAKnBD,YALmB,CAApB;AAQA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,4BAAC,iBAAD;AACC,IAAA,GAAG,EAAGI,GADP;AAEC,IAAA,YAAY,EAAGF,QAFhB;AAGC,IAAA,QAAQ,EAAC,cAHV;AAIC,IAAA,UAAU,MAJX;AAKC,IAAA,mBAAmB,EAAG,KALvB;AAMC,IAAA,kBAAkB,EAAG,KANtB;AAOC,IAAA,qBAAqB;AAPtB,KAQMC,KARN;AASC,IAAA,WAAW,EAAG;AAAE,0BAAoBc;AAAtB,KATf;AAUC,IAAA,eAAe,EAAKE,kBAAF,IAA0B;AAC3C,UAAKA,kBAAkB,EAAEjB,QAAzB,EAAoC;AACnCI,QAAAA,gBAAgB,CAAEa,kBAAF,CAAhB;AACA;AACD;AAdF,KADD,EAiBC,4BAAC,2BAAD;AAAoB,IAAA,EAAE,EAAGF;AAAzB,KACGC,WADH,CAjBD,CADD;AAuBA,CAhFsB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport { useListViewContext } from './context';\nimport Inserter from '../inserter';\nimport AriaReferencedText from './aria-referenced-text';\n\nexport const Appender = forwardRef(\n\t( { nestingLevel, blockCount, clientId, ...props }, ref ) => {\n\t\tconst { insertedBlock, setInsertedBlock } = useListViewContext();\n\n\t\tconst instanceId = useInstanceId( Appender );\n\t\tconst { hideInserter } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getTemplateLock, __unstableGetEditorMode } =\n\t\t\t\t\tselect( blockEditorStore );\n\n\t\t\t\treturn {\n\t\t\t\t\thideInserter:\n\t\t\t\t\t\t!! getTemplateLock( clientId ) ||\n\t\t\t\t\t\t__unstableGetEditorMode() === 'zoom-out',\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientId ]\n\t\t);\n\n\t\tconst blockTitle = useBlockDisplayTitle( {\n\t\t\tclientId,\n\t\t\tcontext: 'list-view',\n\t\t} );\n\n\t\tconst insertedBlockTitle = useBlockDisplayTitle( {\n\t\t\tclientId: insertedBlock?.clientId,\n\t\t\tcontext: 'list-view',\n\t\t} );\n\n\t\tuseEffect( () => {\n\t\t\tif ( ! insertedBlockTitle?.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tspeak(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: name of block being inserted (i.e. Paragraph, Image, Group etc)\n\t\t\t\t\t__( '%s block inserted' ),\n\t\t\t\t\tinsertedBlockTitle\n\t\t\t\t),\n\t\t\t\t'assertive'\n\t\t\t);\n\t\t}, [ insertedBlockTitle ] );\n\n\t\tif ( hideInserter ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst descriptionId = `list-view-appender__${ instanceId }`;\n\t\tconst description = sprintf(\n\t\t\t/* translators: 1: The name of the block. 2: The numerical position of the block. 3: The level of nesting for the block. */\n\t\t\t__( 'Append to %1$s block at position %2$d, Level %3$d' ),\n\t\t\tblockTitle,\n\t\t\tblockCount + 1,\n\t\t\tnestingLevel\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"list-view-appender\">\n\t\t\t\t<Inserter\n\t\t\t\t\tref={ ref }\n\t\t\t\t\trootClientId={ clientId }\n\t\t\t\t\tposition=\"bottom right\"\n\t\t\t\t\tisAppender\n\t\t\t\t\tselectBlockOnInsert={ false }\n\t\t\t\t\tshouldDirectInsert={ false }\n\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t{ ...props }\n\t\t\t\t\ttoggleProps={ { 'aria-describedby': descriptionId } }\n\t\t\t\t\tonSelectOrClose={ ( maybeInsertedBlock ) => {\n\t\t\t\t\t\tif ( maybeInsertedBlock?.clientId ) {\n\t\t\t\t\t\t\tsetInsertedBlock( maybeInsertedBlock );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t<AriaReferencedText id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</AriaReferencedText>\n\t\t\t</div>\n\t\t);\n\t}\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/list-view/appender.js"],"names":["Appender","nestingLevel","blockCount","clientId","props","ref","insertedBlock","setInsertedBlock","instanceId","hideInserter","select","getTemplateLock","__unstableGetEditorMode","blockEditorStore","blockTitle","context","insertedBlockTitle","length","descriptionId","description","maybeInsertedBlock"],"mappings":";;;;;;;;;AAMA;;AAHA;;AACA;;AACA;;AAEA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAhBA;AACA;AACA;;AAOA;AACA;AACA;AAOO,MAAMA,QAAQ,GAAG,yBACvB,CAAE;AAAEC,EAAAA,YAAF;AAAgBC,EAAAA,UAAhB;AAA4BC,EAAAA,QAA5B;AAAsC,KAAGC;AAAzC,CAAF,EAAoDC,GAApD,KAA6D;AAC5D,QAAM;AAAEC,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MAAsC,kCAA5C;AAEA,QAAMC,UAAU,GAAG,4BAAeR,QAAf,CAAnB;AACA,QAAM;AAAES,IAAAA;AAAF,MAAmB,qBACtBC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QACLF,MAAM,CAAEG,YAAF,CADP;AAGA,WAAO;AACNJ,MAAAA,YAAY,EACX,CAAC,CAAEE,eAAe,CAAER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AiBC,4BAAC,2BAAD;AAAoB,IAAA,EAAE,EAAGF;AAAzB,KACGC,WADH,CAjBD,CADD;AAuBA,CAhFsB,CAAjB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef, useEffect } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport { useListViewContext } from './context';\nimport Inserter from '../inserter';\nimport AriaReferencedText from './aria-referenced-text';\n\nexport const Appender = forwardRef(\n\t( { nestingLevel, blockCount, clientId, ...props }, ref ) => {\n\t\tconst { insertedBlock, setInsertedBlock } = useListViewContext();\n\n\t\tconst instanceId = useInstanceId( Appender );\n\t\tconst { hideInserter } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getTemplateLock, __unstableGetEditorMode } =\n\t\t\t\t\tselect( blockEditorStore );\n\n\t\t\t\treturn {\n\t\t\t\t\thideInserter:\n\t\t\t\t\t\t!! getTemplateLock( clientId ) ||\n\t\t\t\t\t\t__unstableGetEditorMode() === 'zoom-out',\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientId ]\n\t\t);\n\n\t\tconst blockTitle = useBlockDisplayTitle( {\n\t\t\tclientId,\n\t\t\tcontext: 'list-view',\n\t\t} );\n\n\t\tconst insertedBlockTitle = useBlockDisplayTitle( {\n\t\t\tclientId: insertedBlock?.clientId,\n\t\t\tcontext: 'list-view',\n\t\t} );\n\n\t\tuseEffect( () => {\n\t\t\tif ( ! insertedBlockTitle?.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tspeak(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s: name of block being inserted (i.e. Paragraph, Image, Group etc)\n\t\t\t\t\t__( '%s block inserted' ),\n\t\t\t\t\tinsertedBlockTitle\n\t\t\t\t),\n\t\t\t\t'assertive'\n\t\t\t);\n\t\t}, [ insertedBlockTitle ] );\n\n\t\tif ( hideInserter ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst descriptionId = `list-view-appender__${ instanceId }`;\n\t\tconst description = sprintf(\n\t\t\t/* translators: 1: The name of the block. 2: The numerical position of the block. 3: The level of nesting for the block. */\n\t\t\t__( 'Append to %1$s block at position %2$d, Level %3$d' ),\n\t\t\tblockTitle,\n\t\t\tblockCount + 1,\n\t\t\tnestingLevel\n\t\t);\n\n\t\treturn (\n\t\t\t<div className=\"list-view-appender\">\n\t\t\t\t<Inserter\n\t\t\t\t\tref={ ref }\n\t\t\t\t\trootClientId={ clientId }\n\t\t\t\t\tposition=\"bottom right\"\n\t\t\t\t\tisAppender\n\t\t\t\t\tselectBlockOnInsert={ false }\n\t\t\t\t\tshouldDirectInsert={ false }\n\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t{ ...props }\n\t\t\t\t\ttoggleProps={ { 'aria-describedby': descriptionId } }\n\t\t\t\t\tonSelectOrClose={ ( maybeInsertedBlock ) => {\n\t\t\t\t\t\tif ( maybeInsertedBlock?.clientId ) {\n\t\t\t\t\t\t\tsetInsertedBlock( maybeInsertedBlock );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t<AriaReferencedText id={ descriptionId }>\n\t\t\t\t\t{ description }\n\t\t\t\t</AriaReferencedText>\n\t\t\t</div>\n\t\t);\n\t}\n);\n"]}
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -9,8 +7,6 @@ exports.default = AriaReferencedText;
9
7
 
10
8
  var _element = require("@wordpress/element");
11
9
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
10
  /**
15
11
  * WordPress dependencies
16
12
  */
@@ -35,10 +31,10 @@ function AriaReferencedText({
35
31
  ref.current.textContent = ref.current.textContent;
36
32
  }
37
33
  }, [children]);
38
- return (0, _element.createElement)("div", (0, _extends2.default)({
39
- hidden: true
40
- }, props, {
34
+ return (0, _element.createElement)("div", {
35
+ hidden: true,
36
+ ...props,
41
37
  ref: ref
42
- }), children);
38
+ }, children);
43
39
  }
44
40
  //# sourceMappingURL=aria-referenced-text.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/list-view/aria-referenced-text.js"],"names":["AriaReferencedText","children","props","ref","current","textContent"],"mappings":";;;;;;;;;AAGA;;;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,kBAAT,CAA6B;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAA7B,EAAsD;AACpE,QAAMC,GAAG,GAAG,sBAAZ;AAEA,0BAAW,MAAM;AAChB,QAAKA,GAAG,CAACC,OAAT,EAAmB;AAClB;AACA;AACA;AACAD,MAAAA,GAAG,CAACC,OAAJ,CAAYC,WAAZ,GAA0BF,GAAG,CAACC,OAAJ,CAAYC,WAAtC;AACA;AACD,GAPD,EAOG,CAAEJ,QAAF,CAPH;AASA,SACC;AAAK,IAAA,MAAM;AAAX,KAAiBC,KAAjB;AAAyB,IAAA,GAAG,EAAGC;AAA/B,MACGF,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\n\n/**\n * A component specifically designed to be used as an element referenced\n * by ARIA attributes such as `aria-labelledby` or `aria-describedby`.\n *\n * @param {Object} props Props.\n * @param {import('react').ReactNode} props.children\n */\nexport default function AriaReferencedText( { children, ...props } ) {\n\tconst ref = useRef();\n\n\tuseEffect( () => {\n\t\tif ( ref.current ) {\n\t\t\t// This seems like a no-op, but it fixes a bug in Firefox where\n\t\t\t// it fails to recompute the text when only the text node changes.\n\t\t\t// @see https://github.com/WordPress/gutenberg/pull/51035\n\t\t\tref.current.textContent = ref.current.textContent;\n\t\t}\n\t}, [ children ] );\n\n\treturn (\n\t\t<div hidden { ...props } ref={ ref }>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/list-view/aria-referenced-text.js"],"names":["AriaReferencedText","children","props","ref","current","textContent"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,kBAAT,CAA6B;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAA7B,EAAsD;AACpE,QAAMC,GAAG,GAAG,sBAAZ;AAEA,0BAAW,MAAM;AAChB,QAAKA,GAAG,CAACC,OAAT,EAAmB;AAClB;AACA;AACA;AACAD,MAAAA,GAAG,CAACC,OAAJ,CAAYC,WAAZ,GAA0BF,GAAG,CAACC,OAAJ,CAAYC,WAAtC;AACA;AACD,GAPD,EAOG,CAAEJ,QAAF,CAPH;AASA,SACC;AAAK,IAAA,MAAM,MAAX;AAAA,OAAiBC,KAAjB;AAAyB,IAAA,GAAG,EAAGC;AAA/B,KACGF,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\n\n/**\n * A component specifically designed to be used as an element referenced\n * by ARIA attributes such as `aria-labelledby` or `aria-describedby`.\n *\n * @param {Object} props Props.\n * @param {import('react').ReactNode} props.children\n */\nexport default function AriaReferencedText( { children, ...props } ) {\n\tconst ref = useRef();\n\n\tuseEffect( () => {\n\t\tif ( ref.current ) {\n\t\t\t// This seems like a no-op, but it fixes a bug in Firefox where\n\t\t\t// it fails to recompute the text when only the text node changes.\n\t\t\t// @see https://github.com/WordPress/gutenberg/pull/51035\n\t\t\tref.current.textContent = ref.current.textContent;\n\t\t}\n\t}, [ children ] );\n\n\treturn (\n\t\t<div hidden { ...props } ref={ ref }>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n"]}
@@ -9,8 +9,6 @@ exports.default = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _classnames = _interopRequireDefault(require("classnames"));
15
13
 
16
14
  var _data = require("@wordpress/data");
@@ -86,7 +84,7 @@ const ListViewBlockContents = (0, _element.forwardRef)(({
86
84
  draggable,
87
85
  onDragStart,
88
86
  onDragEnd
89
- }) => (0, _element.createElement)(_blockSelectButton.default, (0, _extends2.default)({
87
+ }) => (0, _element.createElement)(_blockSelectButton.default, {
90
88
  ref: ref,
91
89
  className: className,
92
90
  block: block,
@@ -99,8 +97,9 @@ const ListViewBlockContents = (0, _element.forwardRef)(({
99
97
  draggable: draggable,
100
98
  onDragStart: onDragStart,
101
99
  onDragEnd: onDragEnd,
102
- isExpanded: isExpanded
103
- }, props))));
100
+ isExpanded: isExpanded,
101
+ ...props
102
+ })));
104
103
  });
105
104
  var _default = ListViewBlockContents;
106
105
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/list-view/block-contents.js"],"names":["ListViewBlockContents","onClick","onToggleExpanded","block","isSelected","position","siblingBlockCount","level","isExpanded","selectedClientIds","props","ref","clientId","blockMovingClientId","selectedBlockInBlockEditor","select","hasBlockMovingClientId","getSelectedBlockClientId","blockEditorStore","AdditionalBlockContent","insertedBlock","setInsertedBlock","isBlockMoveTarget","className","draggableClientIds","includes","draggable","onDragStart","onDragEnd"],"mappings":";;;;;;;;;AASA;;;;AANA;;AAKA;;AAMA;;AACA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAMA,MAAMA,qBAAqB,GAAG,yBAC7B,CACC;AACCC,EAAAA,OADD;AAECC,EAAAA,gBAFD;AAGCC,EAAAA,KAHD;AAICC,EAAAA,UAJD;AAKCC,EAAAA,QALD;AAMCC,EAAAA,iBAND;AAOCC,EAAAA,KAPD;AAQCC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,OAJX;AAKC,IAAA,gBAAgB,EAAGC,gBALpB;AAMC,IAAA,UAAU,EAAGE,UANd;AAOC,IAAA,QAAQ,EAAGC,QAPZ;AAQC,IAAA,iBAAiB,EAAGC,iBARrB;AASC,IAAA,KAAK,EAAGC,KATT;AAUC,IAAA,SAAS,EAAGmB,SAVb;AAWC,IAAA,WAAW,EAAGC,WAXf;AAYC,IAAA,SAAS,EAAGC,SAZb;AAaC,IAAA,UAAU,EAAGpB;AAbd,KAcME,KAdN,EAFF,CARD,CADD;AA+BA,CA/E4B,CAA9B;eAkFeV,qB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ListViewBlockSelectButton from './block-select-button';\nimport BlockDraggable from '../block-draggable';\nimport { store as blockEditorStore } from '../../store';\nimport { useListViewContext } from './context';\n\nconst ListViewBlockContents = forwardRef(\n\t(\n\t\t{\n\t\t\tonClick,\n\t\t\tonToggleExpanded,\n\t\t\tblock,\n\t\t\tisSelected,\n\t\t\tposition,\n\t\t\tsiblingBlockCount,\n\t\t\tlevel,\n\t\t\tisExpanded,\n\t\t\tselectedClientIds,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) => {\n\t\tconst { clientId } = block;\n\n\t\tconst { blockMovingClientId, selectedBlockInBlockEditor } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { hasBlockMovingClientId, getSelectedBlockClientId } =\n\t\t\t\t\tselect( blockEditorStore );\n\t\t\t\treturn {\n\t\t\t\t\tblockMovingClientId: hasBlockMovingClientId(),\n\t\t\t\t\tselectedBlockInBlockEditor: getSelectedBlockClientId(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\n\t\tconst { AdditionalBlockContent, insertedBlock, setInsertedBlock } =\n\t\t\tuseListViewContext();\n\n\t\tconst isBlockMoveTarget =\n\t\t\tblockMovingClientId && selectedBlockInBlockEditor === clientId;\n\n\t\tconst className = classnames( 'block-editor-list-view-block-contents', {\n\t\t\t'is-dropping-before': isBlockMoveTarget,\n\t\t} );\n\n\t\t// Only include all selected blocks if the currently clicked on block\n\t\t// is one of the selected blocks. This ensures that if a user attempts\n\t\t// to drag a block that isn't part of the selection, they're still able\n\t\t// to drag it and rearrange its position.\n\t\tconst draggableClientIds = selectedClientIds.includes( clientId )\n\t\t\t? selectedClientIds\n\t\t\t: [ clientId ];\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ AdditionalBlockContent && (\n\t\t\t\t\t<AdditionalBlockContent\n\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\tinsertedBlock={ insertedBlock }\n\t\t\t\t\t\tsetInsertedBlock={ setInsertedBlock }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<BlockDraggable clientIds={ draggableClientIds }>\n\t\t\t\t\t{ ( { draggable, onDragStart, onDragEnd } ) => (\n\t\t\t\t\t\t<ListViewBlockSelectButton\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t\t\tonToggleExpanded={ onToggleExpanded }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\tsiblingBlockCount={ siblingBlockCount }\n\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\tdraggable={ draggable }\n\t\t\t\t\t\t\tonDragStart={ onDragStart }\n\t\t\t\t\t\t\tonDragEnd={ onDragEnd }\n\t\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockDraggable>\n\t\t\t</>\n\t\t);\n\t}\n);\n\nexport default ListViewBlockContents;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/list-view/block-contents.js"],"names":["ListViewBlockContents","onClick","onToggleExpanded","block","isSelected","position","siblingBlockCount","level","isExpanded","selectedClientIds","props","ref","clientId","blockMovingClientId","selectedBlockInBlockEditor","select","hasBlockMovingClientId","getSelectedBlockClientId","blockEditorStore","AdditionalBlockContent","insertedBlock","setInsertedBlock","isBlockMoveTarget","className","draggableClientIds","includes","draggable","onDragStart","onDragEnd"],"mappings":";;;;;;;;;AASA;;AANA;;AAKA;;AAMA;;AACA;;AACA;;AACA;;AAjBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AAMA,MAAMA,qBAAqB,GAAG,yBAC7B,CACC;AACCC,EAAAA,OADD;AAECC,EAAAA,gBAFD;AAGCC,EAAAA,KAHD;AAICC,EAAAA,UAJD;AAKCC,EAAAA,QALD;AAMCC,EAAAA,iBAND;AAOCC,EAAAA,KAPD;AAQCC,EAAAA,UARD;AASCC,EAAAA,iBATD;AAUC,KAAGC;AAVJ,CADD,EAaCC,GAbD,KAcK;AACJ,QAAM;AAAEC,IAAAA;AAAF,MAAeT,KAArB;AAEA,QAAM;AAAEU,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,MAAsD,qBACzDC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,sBAAF;AAA0BC,MAAAA;AAA1B,QACLF,MAAM,CAAEG,YAAF,CADP;AAEA,WAAO;AACNL,MAAAA,mBAAmB,EAAEG,sBAAsB,EADrC;AAENF,MAAAA,0BAA0B,EAAEG,wBAAwB;AAF9C,KAAP;AAIA,GAR0D,EAS3D,EAT2D,CAA5D;AAYA,QAAM;AAAEE,IAAAA,sBAAF;AAA0BC,IAAAA,aAA1B;AAAyCC,IAAAA;AAAzC,MACL,kCADD;AAGA,QAAMC,iBAAiB,GACtBT,mBAAmB,IAAIC,0BAA0B,KAAKF,QADvD;AAGA,QAAMW,SAAS,GAAG,yBAAY,uCAAZ,EAAqD;AACtE,0BAAsBD;AADgD,GAArD,CAAlB,CArBI,CAyBJ;AACA;AACA;AACA;;AACA,QAAME,kBAAkB,GAAGf,iBAAiB,CAACgB,QAAlB,CAA4Bb,QAA5B,IACxBH,iBADwB,GAExB,CAAEG,QAAF,CAFH;AAIA,SACC,qDACGO,sBAAsB,IACvB,4BAAC,sBAAD;AACC,IAAA,KAAK,EAAGhB,KADT;AAEC,IAAA,aAAa,EAAGiB,aAFjB;AAGC,IAAA,gBAAgB,EAAGC;AAHpB,IAFF,EAQC,4BAAC,uBAAD;AAAgB,IAAA,SAAS,EAAGG;AAA5B,KACG,CAAE;AAAEE,IAAAA,SAAF;AAAaC,IAAAA,WAAb;AAA0BC,IAAAA;AAA1B,GAAF,KACD,4BAAC,0BAAD;AACC,IAAA,GAAG,EAAGjB,GADP;AAEC,IAAA,SAAS,EAAGY,SAFb;AAGC,IAAA,KAAK,EAAGpB,KAHT;AAIC,IAAA,OAAO,EAAGF,OAJX;AAKC,IAAA,gBAAgB,EAAGC,gBALpB;AAMC,IAAA,UAAU,EAAGE,UANd;AAOC,IAAA,QAAQ,EAAGC,QAPZ;AAQC,IAAA,iBAAiB,EAAGC,iBARrB;AASC,IAAA,KAAK,EAAGC,KATT;AAUC,IAAA,SAAS,EAAGmB,SAVb;AAWC,IAAA,WAAW,EAAGC,WAXf;AAYC,IAAA,SAAS,EAAGC,SAZb;AAaC,IAAA,UAAU,EAAGpB,UAbd;AAAA,OAcME;AAdN,IAFF,CARD,CADD;AA+BA,CA/E4B,CAA9B;eAkFeV,qB","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ListViewBlockSelectButton from './block-select-button';\nimport BlockDraggable from '../block-draggable';\nimport { store as blockEditorStore } from '../../store';\nimport { useListViewContext } from './context';\n\nconst ListViewBlockContents = forwardRef(\n\t(\n\t\t{\n\t\t\tonClick,\n\t\t\tonToggleExpanded,\n\t\t\tblock,\n\t\t\tisSelected,\n\t\t\tposition,\n\t\t\tsiblingBlockCount,\n\t\t\tlevel,\n\t\t\tisExpanded,\n\t\t\tselectedClientIds,\n\t\t\t...props\n\t\t},\n\t\tref\n\t) => {\n\t\tconst { clientId } = block;\n\n\t\tconst { blockMovingClientId, selectedBlockInBlockEditor } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { hasBlockMovingClientId, getSelectedBlockClientId } =\n\t\t\t\t\tselect( blockEditorStore );\n\t\t\t\treturn {\n\t\t\t\t\tblockMovingClientId: hasBlockMovingClientId(),\n\t\t\t\t\tselectedBlockInBlockEditor: getSelectedBlockClientId(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\n\t\tconst { AdditionalBlockContent, insertedBlock, setInsertedBlock } =\n\t\t\tuseListViewContext();\n\n\t\tconst isBlockMoveTarget =\n\t\t\tblockMovingClientId && selectedBlockInBlockEditor === clientId;\n\n\t\tconst className = classnames( 'block-editor-list-view-block-contents', {\n\t\t\t'is-dropping-before': isBlockMoveTarget,\n\t\t} );\n\n\t\t// Only include all selected blocks if the currently clicked on block\n\t\t// is one of the selected blocks. This ensures that if a user attempts\n\t\t// to drag a block that isn't part of the selection, they're still able\n\t\t// to drag it and rearrange its position.\n\t\tconst draggableClientIds = selectedClientIds.includes( clientId )\n\t\t\t? selectedClientIds\n\t\t\t: [ clientId ];\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ AdditionalBlockContent && (\n\t\t\t\t\t<AdditionalBlockContent\n\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\tinsertedBlock={ insertedBlock }\n\t\t\t\t\t\tsetInsertedBlock={ setInsertedBlock }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<BlockDraggable clientIds={ draggableClientIds }>\n\t\t\t\t\t{ ( { draggable, onDragStart, onDragEnd } ) => (\n\t\t\t\t\t\t<ListViewBlockSelectButton\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tclassName={ className }\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\tonClick={ onClick }\n\t\t\t\t\t\t\tonToggleExpanded={ onToggleExpanded }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\tsiblingBlockCount={ siblingBlockCount }\n\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\tdraggable={ draggable }\n\t\t\t\t\t\t\tonDragStart={ onDragStart }\n\t\t\t\t\t\t\tonDragEnd={ onDragEnd }\n\t\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockDraggable>\n\t\t\t</>\n\t\t);\n\t}\n);\n\nexport default ListViewBlockContents;\n"]}
@@ -21,6 +21,8 @@ var _data = require("@wordpress/data");
21
21
 
22
22
  var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
23
23
 
24
+ var _i18n = require("@wordpress/i18n");
25
+
24
26
  var _blockIcon = _interopRequireDefault(require("../block-icon"));
25
27
 
26
28
  var _useBlockDisplayInformation = _interopRequireDefault(require("../use-block-display-information"));
@@ -79,7 +81,10 @@ function ListViewBlockSelectButton({
79
81
  const {
80
82
  removeBlocks
81
83
  } = (0, _data.useDispatch)(_store.store);
82
- const isMatch = (0, _keyboardShortcuts.__unstableUseShortcutEventMatch)(); // The `href` attribute triggers the browser's native HTML drag operations.
84
+ const isMatch = (0, _keyboardShortcuts.__unstableUseShortcutEventMatch)();
85
+ const isSticky = blockInformation?.positionType === 'sticky';
86
+ const positionLabel = blockInformation?.positionLabel ? (0, _i18n.sprintf)( // translators: 1: Position of selected block, e.g. "Sticky" or "Fixed".
87
+ (0, _i18n.__)('Position: %1$s'), blockInformation.positionLabel) : ''; // The `href` attribute triggers the browser's native HTML drag operations.
83
88
  // When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.
84
89
  // We need to clear any HTML drag data to prevent `pasteHandler` from firing
85
90
  // inside the `useOnBlockDrop` hook.
@@ -158,7 +163,13 @@ function ListViewBlockSelectButton({
158
163
  }, (0, _element.createElement)(_components.__experimentalTruncate, {
159
164
  className: "block-editor-list-view-block-select-button__anchor",
160
165
  ellipsizeMode: "auto"
161
- }, blockInformation.anchor)), isLocked && (0, _element.createElement)("span", {
166
+ }, blockInformation.anchor)), positionLabel && isSticky && (0, _element.createElement)(_components.Tooltip, {
167
+ text: positionLabel
168
+ }, (0, _element.createElement)("span", {
169
+ className: "block-editor-list-view-block-select-button__sticky"
170
+ }, (0, _element.createElement)(_icons.Icon, {
171
+ icon: _icons.pinSmall
172
+ }))), isLocked && (0, _element.createElement)("span", {
162
173
  className: "block-editor-list-view-block-select-button__lock"
163
174
  }, (0, _element.createElement)(_icons.Icon, {
164
175
  icon: _icons.lockSmall
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/list-view/block-select-button.js"],"names":["ListViewBlockSelectButton","className","block","clientId","onClick","onToggleExpanded","tabIndex","onFocus","onDragStart","onDragEnd","draggable","isExpanded","ariaLabel","ariaDescribedBy","updateFocusAndSelection","ref","blockInformation","blockTitle","context","isLocked","getSelectedBlockClientIds","getPreviousBlockClientId","getBlockRootClientId","getBlockOrder","canRemoveBlocks","blockEditorStore","removeBlocks","isMatch","onDragStartHandler","event","dataTransfer","clearData","onKeyDownHandler","keyCode","ENTER","SPACE","BACKSPACE","DELETE","selectedBlockClientIds","isDeletingSelectedBlocks","includes","firstBlockClientId","firstBlockRootClientId","blocksToDelete","blockToFocus","shouldUpdateSelection","length","icon","anchor","lock"],"mappings":";;;;;;;;;AAaA;;AAVA;;AAKA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA3BA;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;AAQA,SAASA,yBAAT,CACC;AACCC,EAAAA,SADD;AAECC,EAAAA,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IAAA,SAAS,EAAGC,SAZb;AAaC,IAAA,IAAI,EAAI,UAAUP,QAAU,EAb7B;AAcC,kBAAaS,SAdd;AAeC,wBAAmBC,eAfpB;AAgBC,qBAAgBF;AAhBjB,KAkBC,4BAAC,iBAAD;AAAkB,IAAA,OAAO,EAAGN;AAA5B,IAlBD,EAmBC,4BAAC,kBAAD;AACC,IAAA,IAAI,EAAGW,gBAAgB,EAAE+B,IAD1B;AAEC,IAAA,UAAU,MAFX;AAGC,IAAA,OAAO,EAAC;AAHT,IAnBD,EAwBC,4BAAC,gCAAD;AACC,IAAA,SAAS,EAAC,QADX;AAEC,IAAA,SAAS,EAAC,2DAFX;AAGC,IAAA,OAAO,EAAC,YAHT;AAIC,IAAA,OAAO,EAAG;AAJX,KAMC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,4BAAC,kCAAD;AAAU,IAAA,aAAa,EAAC;AAAxB,KAAiC9B,UAAjC,CADD,CAND,EASGD,gBAAgB,EAAEgC,MAAlB,IACD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,4BAAC,kCAAD;AACC,IAAA,SAAS,EAAC,oDADX;AAEC,IAAA,aAAa,EAAC;AAFf,KAIGhC,gBAAgB,CAACgC,MAJpB,CADD,CAVF,EAmBG7B,QAAQ,IACT;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAG8B;AAAb,IADD,CApBF,CAxBD,CADD,CADD;AAsDA;;eAEc,yBAAYjD,yBAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n} from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\nimport { Icon, lockSmall as lock } from '@wordpress/icons';\nimport { SPACE, ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport ListViewExpander from './expander';\nimport { useBlockLock } from '../block-lock';\nimport { store as blockEditorStore } from '../../store';\n\nfunction ListViewBlockSelectButton(\n\t{\n\t\tclassName,\n\t\tblock: { clientId },\n\t\tonClick,\n\t\tonToggleExpanded,\n\t\ttabIndex,\n\t\tonFocus,\n\t\tonDragStart,\n\t\tonDragEnd,\n\t\tdraggable,\n\t\tisExpanded,\n\t\tariaLabel,\n\t\tariaDescribedBy,\n\t\tupdateFocusAndSelection,\n\t},\n\tref\n) {\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId,\n\t\tcontext: 'list-view',\n\t} );\n\tconst { isLocked } = useBlockLock( clientId );\n\tconst {\n\t\tgetSelectedBlockClientIds,\n\t\tgetPreviousBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlockOrder,\n\t\tcanRemoveBlocks,\n\t} = useSelect( blockEditorStore );\n\tconst { removeBlocks } = useDispatch( blockEditorStore );\n\tconst isMatch = useShortcutEventMatch();\n\n\t// The `href` attribute triggers the browser's native HTML drag operations.\n\t// When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.\n\t// We need to clear any HTML drag data to prevent `pasteHandler` from firing\n\t// inside the `useOnBlockDrop` hook.\n\tconst onDragStartHandler = ( event ) => {\n\t\tevent.dataTransfer.clearData();\n\t\tonDragStart?.( event );\n\t};\n\n\t/**\n\t * @param {KeyboardEvent} event\n\t */\n\tfunction onKeyDownHandler( event ) {\n\t\tif ( event.keyCode === ENTER || event.keyCode === SPACE ) {\n\t\t\tonClick( event );\n\t\t} else if (\n\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\tevent.keyCode === DELETE ||\n\t\t\tisMatch( 'core/block-editor/remove', event )\n\t\t) {\n\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\t\tconst isDeletingSelectedBlocks =\n\t\t\t\tselectedBlockClientIds.includes( clientId );\n\t\t\tconst firstBlockClientId = isDeletingSelectedBlocks\n\t\t\t\t? selectedBlockClientIds[ 0 ]\n\t\t\t\t: clientId;\n\t\t\tconst firstBlockRootClientId =\n\t\t\t\tgetBlockRootClientId( firstBlockClientId );\n\n\t\t\tconst blocksToDelete = isDeletingSelectedBlocks\n\t\t\t\t? selectedBlockClientIds\n\t\t\t\t: [ clientId ];\n\n\t\t\t// Don't update the selection if the blocks cannot be deleted.\n\t\t\tif ( ! canRemoveBlocks( blocksToDelete, firstBlockRootClientId ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet blockToFocus =\n\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ) ??\n\t\t\t\t// If the previous block is not found (when the first block is deleted),\n\t\t\t\t// fallback to focus the parent block.\n\t\t\t\tfirstBlockRootClientId;\n\n\t\t\tremoveBlocks( blocksToDelete, false );\n\n\t\t\t// Update the selection if the original selection has been removed.\n\t\t\tconst shouldUpdateSelection =\n\t\t\t\tselectedBlockClientIds.length > 0 &&\n\t\t\t\tgetSelectedBlockClientIds().length === 0;\n\n\t\t\t// If there's no previous block nor parent block, focus the first block.\n\t\t\tif ( ! blockToFocus ) {\n\t\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t\t}\n\n\t\t\tupdateFocusAndSelection( blockToFocus, shouldUpdateSelection );\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tonKeyDown={ onKeyDownHandler }\n\t\t\t\tref={ ref }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tonDragStart={ onDragStartHandler }\n\t\t\t\tonDragEnd={ onDragEnd }\n\t\t\t\tdraggable={ draggable }\n\t\t\t\thref={ `#block-${ clientId }` }\n\t\t\t\taria-label={ ariaLabel }\n\t\t\t\taria-describedby={ ariaDescribedBy }\n\t\t\t\taria-expanded={ isExpanded }\n\t\t\t>\n\t\t\t\t<ListViewExpander onClick={ onToggleExpanded } />\n\t\t\t\t<BlockIcon\n\t\t\t\t\ticon={ blockInformation?.icon }\n\t\t\t\t\tshowColors\n\t\t\t\t\tcontext=\"list-view\"\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\talignment=\"center\"\n\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">{ blockTitle }</Truncate>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ blockInformation?.anchor && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__anchor-wrapper\">\n\t\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__anchor\"\n\t\t\t\t\t\t\t\tellipsizeMode=\"auto\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ blockInformation.anchor }\n\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isLocked && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__lock\">\n\t\t\t\t\t\t\t<Icon icon={ lock } />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport default forwardRef( ListViewBlockSelectButton );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/list-view/block-select-button.js"],"names":["ListViewBlockSelectButton","className","block","clientId","onClick","onToggleExpanded","tabIndex","onFocus","onDragStart","onDragEnd","draggable","isExpanded","ariaLabel","ariaDescribedBy","updateFocusAndSelection","ref","blockInformation","blockTitle","context","isLocked","getSelectedBlockClientIds","getPreviousBlockClientId","getBlockRootClientId","getBlockOrder","canRemoveBlocks","blockEditorStore","removeBlocks","isMatch","isSticky","positionType","positionLabel","onDragStartHandler","event","dataTransfer","clearData","onKeyDownHandler","keyCode","ENTER","SPACE","BACKSPACE","DELETE","selectedBlockClientIds","isDeletingSelectedBlocks","includes","firstBlockClientId","firstBlockRootClientId","blocksToDelete","blockToFocus","shouldUpdateSelection","length","icon","anchor","pinSmall","lock"],"mappings":";;;;;;;;;AAcA;;AAXA;;AAKA;;AAOA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA7BA;AACA;AACA;;AAGA;AACA;AACA;;AAcA;AACA;AACA;AAQA,SAASA,yBAAT,CACC;AACCC,EAAAA,SADD;AAECC,EAAAA,KAAK,EAAE;AAAEC,IAAAA;AAAF,GAFR;AAGCC,EAAAA,OAHD;AAICC,EAAAA,gBAJD;AAKCC,EAAAA,QALD;AAMCC,EAAAA,OAND;AAOCC,EAAAA,WAPD;AAQCC,EAAAA,SARD;AASCC,EAAAA,SATD;AAUCC,EAAAA,UAVD;AAWCC,EAAAA,SAXD;AAYCC,EAAAA,eAZD;AAaCC,EAAAA;AAbD,CADD,EAgBCC,GAhBD,EAiBE;AACD,QAAMC,gBAAgB,GAAG,yCAA4Bb,QAA5B,CAAzB;AACA,QAAMc,UAAU,GAAG,mCAAsB;AACxCd,IAAAA,QADwC;AAExCe,IAAAA,OAAO,EAAE;AAF+B,GAAtB,CAAnB;AAIA,QAAM;AAAEC,IAAAA;AAAF,MAAe,6BAAchB,QAAd,CAArB;AACA,QAAM;AACLiB,IAAAA,yBADK;AAELC,IAAAA,wBAFK;AAGLC,IAAAA,oBAHK;AAIL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C,QADX;AAEC,IAAA,SAAS,EAAC,2DAFX;AAGC,IAAA,OAAO,EAAC,YAHT;AAIC,IAAA,OAAO,EAAG;AAJX,KAMC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,4BAAC,kCAAD;AAAU,IAAA,aAAa,EAAC;AAAxB,KAAiCjC,UAAjC,CADD,CAND,EASGD,gBAAgB,EAAEmC,MAAlB,IACD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,4BAAC,kCAAD;AACC,IAAA,SAAS,EAAC,oDADX;AAEC,IAAA,aAAa,EAAC;AAFf,KAIGnC,gBAAgB,CAACmC,MAJpB,CADD,CAVF,EAmBGrB,aAAa,IAAIF,QAAjB,IACD,4BAAC,mBAAD;AAAS,IAAA,IAAI,EAAGE;AAAhB,KACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGsB;AAAb,IADD,CADD,CApBF,EA0BGjC,QAAQ,IACT;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGkC;AAAb,IADD,CA3BF,CAxBD,CADD,CADD;AA6DA;;eAEc,yBAAYrD,yBAAZ,C","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tTooltip,\n} from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\nimport { Icon, lockSmall as lock, pinSmall } from '@wordpress/icons';\nimport { SPACE, ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport useBlockDisplayTitle from '../block-title/use-block-display-title';\nimport ListViewExpander from './expander';\nimport { useBlockLock } from '../block-lock';\nimport { store as blockEditorStore } from '../../store';\n\nfunction ListViewBlockSelectButton(\n\t{\n\t\tclassName,\n\t\tblock: { clientId },\n\t\tonClick,\n\t\tonToggleExpanded,\n\t\ttabIndex,\n\t\tonFocus,\n\t\tonDragStart,\n\t\tonDragEnd,\n\t\tdraggable,\n\t\tisExpanded,\n\t\tariaLabel,\n\t\tariaDescribedBy,\n\t\tupdateFocusAndSelection,\n\t},\n\tref\n) {\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\tconst blockTitle = useBlockDisplayTitle( {\n\t\tclientId,\n\t\tcontext: 'list-view',\n\t} );\n\tconst { isLocked } = useBlockLock( clientId );\n\tconst {\n\t\tgetSelectedBlockClientIds,\n\t\tgetPreviousBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlockOrder,\n\t\tcanRemoveBlocks,\n\t} = useSelect( blockEditorStore );\n\tconst { removeBlocks } = useDispatch( blockEditorStore );\n\tconst isMatch = useShortcutEventMatch();\n\tconst isSticky = blockInformation?.positionType === 'sticky';\n\n\tconst positionLabel = blockInformation?.positionLabel\n\t\t? sprintf(\n\t\t\t\t// translators: 1: Position of selected block, e.g. \"Sticky\" or \"Fixed\".\n\t\t\t\t__( 'Position: %1$s' ),\n\t\t\t\tblockInformation.positionLabel\n\t\t )\n\t\t: '';\n\n\t// The `href` attribute triggers the browser's native HTML drag operations.\n\t// When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html.\n\t// We need to clear any HTML drag data to prevent `pasteHandler` from firing\n\t// inside the `useOnBlockDrop` hook.\n\tconst onDragStartHandler = ( event ) => {\n\t\tevent.dataTransfer.clearData();\n\t\tonDragStart?.( event );\n\t};\n\n\t/**\n\t * @param {KeyboardEvent} event\n\t */\n\tfunction onKeyDownHandler( event ) {\n\t\tif ( event.keyCode === ENTER || event.keyCode === SPACE ) {\n\t\t\tonClick( event );\n\t\t} else if (\n\t\t\tevent.keyCode === BACKSPACE ||\n\t\t\tevent.keyCode === DELETE ||\n\t\t\tisMatch( 'core/block-editor/remove', event )\n\t\t) {\n\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\t\tconst isDeletingSelectedBlocks =\n\t\t\t\tselectedBlockClientIds.includes( clientId );\n\t\t\tconst firstBlockClientId = isDeletingSelectedBlocks\n\t\t\t\t? selectedBlockClientIds[ 0 ]\n\t\t\t\t: clientId;\n\t\t\tconst firstBlockRootClientId =\n\t\t\t\tgetBlockRootClientId( firstBlockClientId );\n\n\t\t\tconst blocksToDelete = isDeletingSelectedBlocks\n\t\t\t\t? selectedBlockClientIds\n\t\t\t\t: [ clientId ];\n\n\t\t\t// Don't update the selection if the blocks cannot be deleted.\n\t\t\tif ( ! canRemoveBlocks( blocksToDelete, firstBlockRootClientId ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet blockToFocus =\n\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ) ??\n\t\t\t\t// If the previous block is not found (when the first block is deleted),\n\t\t\t\t// fallback to focus the parent block.\n\t\t\t\tfirstBlockRootClientId;\n\n\t\t\tremoveBlocks( blocksToDelete, false );\n\n\t\t\t// Update the selection if the original selection has been removed.\n\t\t\tconst shouldUpdateSelection =\n\t\t\t\tselectedBlockClientIds.length > 0 &&\n\t\t\t\tgetSelectedBlockClientIds().length === 0;\n\n\t\t\t// If there's no previous block nor parent block, focus the first block.\n\t\t\tif ( ! blockToFocus ) {\n\t\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t\t}\n\n\t\t\tupdateFocusAndSelection( blockToFocus, shouldUpdateSelection );\n\t\t}\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\t\tclassName\n\t\t\t\t) }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tonKeyDown={ onKeyDownHandler }\n\t\t\t\tref={ ref }\n\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\tonFocus={ onFocus }\n\t\t\t\tonDragStart={ onDragStartHandler }\n\t\t\t\tonDragEnd={ onDragEnd }\n\t\t\t\tdraggable={ draggable }\n\t\t\t\thref={ `#block-${ clientId }` }\n\t\t\t\taria-label={ ariaLabel }\n\t\t\t\taria-describedby={ ariaDescribedBy }\n\t\t\t\taria-expanded={ isExpanded }\n\t\t\t>\n\t\t\t\t<ListViewExpander onClick={ onToggleExpanded } />\n\t\t\t\t<BlockIcon\n\t\t\t\t\ticon={ blockInformation?.icon }\n\t\t\t\t\tshowColors\n\t\t\t\t\tcontext=\"list-view\"\n\t\t\t\t/>\n\t\t\t\t<HStack\n\t\t\t\t\talignment=\"center\"\n\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\t\tjustify=\"flex-start\"\n\t\t\t\t\tspacing={ 1 }\n\t\t\t\t>\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">{ blockTitle }</Truncate>\n\t\t\t\t\t</span>\n\t\t\t\t\t{ blockInformation?.anchor && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__anchor-wrapper\">\n\t\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__anchor\"\n\t\t\t\t\t\t\t\tellipsizeMode=\"auto\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ blockInformation.anchor }\n\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ positionLabel && isSticky && (\n\t\t\t\t\t\t<Tooltip text={ positionLabel }>\n\t\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__sticky\">\n\t\t\t\t\t\t\t\t<Icon icon={ pinSmall } />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isLocked && (\n\t\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__lock\">\n\t\t\t\t\t\t\t<Icon icon={ lock } />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n\nexport default forwardRef( ListViewBlockSelectButton );\n"]}
@@ -9,8 +9,6 @@ exports.default = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _components = require("@wordpress/components");
15
13
 
16
14
  var _data = require("@wordpress/data");
@@ -94,6 +92,7 @@ function ListViewBranch(props) {
94
92
  selectedClientIds,
95
93
  level = 1,
96
94
  path = '',
95
+ isBranchDragged = false,
97
96
  isBranchSelected = false,
98
97
  listPosition = 0,
99
98
  fixedListWindow,
@@ -153,7 +152,7 @@ function ListViewBranch(props) {
153
152
 
154
153
  const isSelected = (0, _utils.isClientIdSelected)(clientId, selectedClientIds);
155
154
  const isSelectedBranch = isBranchSelected || isSelected && hasNestedBlocks;
156
- const showBlock = isDragged || blockInView || isSelected;
155
+ const showBlock = isDragged || blockInView || isSelected || isBranchDragged;
157
156
  return (0, _element.createElement)(_data.AsyncModeProvider, {
158
157
  key: clientId,
159
158
  value: !isSelected
@@ -162,7 +161,7 @@ function ListViewBranch(props) {
162
161
  selectBlock: selectBlock,
163
162
  isSelected: isSelected,
164
163
  isBranchSelected: isSelectedBranch,
165
- isDragged: isDragged,
164
+ isDragged: isDragged || isBranchDragged,
166
165
  level: level,
167
166
  position: position,
168
167
  rowCount: rowCount,
@@ -175,7 +174,7 @@ function ListViewBranch(props) {
175
174
  isSyncedBranch: syncedBranch
176
175
  }), !showBlock && (0, _element.createElement)("tr", null, (0, _element.createElement)("td", {
177
176
  className: "block-editor-list-view-placeholder"
178
- })), hasNestedBlocks && shouldExpand && !isDragged && (0, _element.createElement)(ListViewBranch, {
177
+ })), hasNestedBlocks && shouldExpand && (0, _element.createElement)(ListViewBranch, {
179
178
  parentId: clientId,
180
179
  blocks: innerBlocks,
181
180
  selectBlock: selectBlock,
@@ -185,6 +184,7 @@ function ListViewBranch(props) {
185
184
  listPosition: nextPosition + 1,
186
185
  fixedListWindow: fixedListWindow,
187
186
  isBranchSelected: isSelectedBranch,
187
+ isBranchDragged: isDragged || isBranchDragged,
188
188
  selectedClientIds: selectedClientIds,
189
189
  isExpanded: isExpanded,
190
190
  isSyncedBranch: syncedBranch
@@ -194,11 +194,12 @@ function ListViewBranch(props) {
194
194
  setSize: rowCount,
195
195
  positionInSet: rowCount,
196
196
  isExpanded: true
197
- }, (0, _element.createElement)(_components.__experimentalTreeGridCell, null, treeGridCellProps => (0, _element.createElement)(_appender.Appender, (0, _extends2.default)({
197
+ }, (0, _element.createElement)(_components.__experimentalTreeGridCell, null, treeGridCellProps => (0, _element.createElement)(_appender.Appender, {
198
198
  clientId: parentId,
199
199
  nestingLevel: level,
200
- blockCount: blockCount
201
- }, treeGridCellProps)))));
200
+ blockCount: blockCount,
201
+ ...treeGridCellProps
202
+ }))));
202
203
  }
203
204
 
204
205
  var _default = (0, _element.memo)(ListViewBranch);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/list-view/branch.js"],"names":["countBlocks","block","expandedState","draggedClientIds","isExpandedByDefault","isDragged","includes","clientId","isExpanded","innerBlocks","reduce","countReducer","count","length","noop","ListViewBranch","props","blocks","selectBlock","showBlockMovers","selectedClientIds","level","path","isBranchSelected","listPosition","fixedListWindow","parentId","shouldShowInnerBlocks","isSyncedBranch","showAppender","showAppenderProp","parentBlockInformation","syncedBranch","isSynced","canParentExpand","select","blockEditorStore","canEditBlock","filteredBlocks","filter","Boolean","blockCount","rowCount","nextPosition","map","index","itemInView","blockInView","position","updatedPath","hasNestedBlocks","shouldExpand","undefined","isSelected","isSelectedBranch","showBlock","treeGridCellProps"],"mappings":";;;;;;;;;AAOA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;AAIC,IAAA,UAAU,EAAG;AAJd,KAMC,4BAAC,sCAAD,QACKc,iBAAF,IACD,4BAAC,kBAAD;AACC,IAAA,QAAQ,EAAG9B,QADZ;AAEC,IAAA,YAAY,EAAGL,KAFhB;AAGC,IAAA,UAAU,EAAGoB;AAHd,KAIMe,iBAJN,EAFF,CAND,CArFF,CADD;AA0GA;;eAEc,mBAAMzC,cAAN,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalTreeGridRow as TreeGridRow,\n\t__experimentalTreeGridCell as TreeGridCell,\n} from '@wordpress/components';\nimport { memo } from '@wordpress/element';\nimport { AsyncModeProvider, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { Appender } from './appender';\nimport ListViewBlock from './block';\nimport { useListViewContext } from './context';\nimport { isClientIdSelected } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayInformation from '../use-block-display-information';\n\n/**\n * Given a block, returns the total number of blocks in that subtree. This is used to help determine\n * the list position of a block.\n *\n * When a block is collapsed, we do not count their children as part of that total. In the current drag\n * implementation dragged blocks and their children are not counted.\n *\n * @param {Object} block block tree\n * @param {Object} expandedState state that notes which branches are collapsed\n * @param {Array} draggedClientIds a list of dragged client ids\n * @param {boolean} isExpandedByDefault flag to determine the default fallback expanded state.\n * @return {number} block count\n */\nfunction countBlocks(\n\tblock,\n\texpandedState,\n\tdraggedClientIds,\n\tisExpandedByDefault\n) {\n\tconst isDragged = draggedClientIds?.includes( block.clientId );\n\tif ( isDragged ) {\n\t\treturn 0;\n\t}\n\tconst isExpanded = expandedState[ block.clientId ] ?? isExpandedByDefault;\n\n\tif ( isExpanded ) {\n\t\treturn (\n\t\t\t1 +\n\t\t\tblock.innerBlocks.reduce(\n\t\t\t\tcountReducer(\n\t\t\t\t\texpandedState,\n\t\t\t\t\tdraggedClientIds,\n\t\t\t\t\tisExpandedByDefault\n\t\t\t\t),\n\t\t\t\t0\n\t\t\t)\n\t\t);\n\t}\n\treturn 1;\n}\nconst countReducer =\n\t( expandedState, draggedClientIds, isExpandedByDefault ) =>\n\t( count, block ) => {\n\t\tconst isDragged = draggedClientIds?.includes( block.clientId );\n\t\tif ( isDragged ) {\n\t\t\treturn count;\n\t\t}\n\t\tconst isExpanded =\n\t\t\texpandedState[ block.clientId ] ?? isExpandedByDefault;\n\t\tif ( isExpanded && block.innerBlocks.length > 0 ) {\n\t\t\treturn (\n\t\t\t\tcount +\n\t\t\t\tcountBlocks(\n\t\t\t\t\tblock,\n\t\t\t\t\texpandedState,\n\t\t\t\t\tdraggedClientIds,\n\t\t\t\t\tisExpandedByDefault\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn count + 1;\n\t};\n\nconst noop = () => {};\n\nfunction ListViewBranch( props ) {\n\tconst {\n\t\tblocks,\n\t\tselectBlock = noop,\n\t\tshowBlockMovers,\n\t\tselectedClientIds,\n\t\tlevel = 1,\n\t\tpath = '',\n\t\tisBranchSelected = false,\n\t\tlistPosition = 0,\n\t\tfixedListWindow,\n\t\tisExpanded,\n\t\tparentId,\n\t\tshouldShowInnerBlocks = true,\n\t\tisSyncedBranch = false,\n\t\tshowAppender: showAppenderProp = true,\n\t} = props;\n\n\tconst parentBlockInformation = useBlockDisplayInformation( parentId );\n\tconst syncedBranch = isSyncedBranch || !! parentBlockInformation?.isSynced;\n\n\tconst canParentExpand = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! parentId ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn select( blockEditorStore ).canEditBlock( parentId );\n\t\t},\n\t\t[ parentId ]\n\t);\n\n\tconst { expandedState, draggedClientIds } = useListViewContext();\n\n\tif ( ! canParentExpand ) {\n\t\treturn null;\n\t}\n\n\t// Only show the appender at the first level.\n\tconst showAppender = showAppenderProp && level === 1;\n\tconst filteredBlocks = blocks.filter( Boolean );\n\tconst blockCount = filteredBlocks.length;\n\t// The appender means an extra row in List View, so add 1 to the row count.\n\tconst rowCount = showAppender ? blockCount + 1 : blockCount;\n\tlet nextPosition = listPosition;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredBlocks.map( ( block, index ) => {\n\t\t\t\tconst { clientId, innerBlocks } = block;\n\n\t\t\t\tif ( index > 0 ) {\n\t\t\t\t\tnextPosition += countBlocks(\n\t\t\t\t\t\tfilteredBlocks[ index - 1 ],\n\t\t\t\t\t\texpandedState,\n\t\t\t\t\t\tdraggedClientIds,\n\t\t\t\t\t\tisExpanded\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst { itemInView } = fixedListWindow;\n\t\t\t\tconst blockInView = itemInView( nextPosition );\n\n\t\t\t\tconst position = index + 1;\n\t\t\t\tconst updatedPath =\n\t\t\t\t\tpath.length > 0\n\t\t\t\t\t\t? `${ path }_${ position }`\n\t\t\t\t\t\t: `${ position }`;\n\t\t\t\tconst hasNestedBlocks = !! innerBlocks?.length;\n\n\t\t\t\tconst shouldExpand =\n\t\t\t\t\thasNestedBlocks && shouldShowInnerBlocks\n\t\t\t\t\t\t? expandedState[ clientId ] ?? isExpanded\n\t\t\t\t\t\t: undefined;\n\n\t\t\t\tconst isDragged = !! draggedClientIds?.includes( clientId );\n\n\t\t\t\t// Make updates to the selected or dragged blocks synchronous,\n\t\t\t\t// but asynchronous for any other block.\n\t\t\t\tconst isSelected = isClientIdSelected(\n\t\t\t\t\tclientId,\n\t\t\t\t\tselectedClientIds\n\t\t\t\t);\n\t\t\t\tconst isSelectedBranch =\n\t\t\t\t\tisBranchSelected || ( isSelected && hasNestedBlocks );\n\t\t\t\tconst showBlock = isDragged || blockInView || isSelected;\n\t\t\t\treturn (\n\t\t\t\t\t<AsyncModeProvider key={ clientId } value={ ! isSelected }>\n\t\t\t\t\t\t{ showBlock && (\n\t\t\t\t\t\t\t<ListViewBlock\n\t\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\t\tselectBlock={ selectBlock }\n\t\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\t\tisBranchSelected={ isSelectedBranch }\n\t\t\t\t\t\t\t\tisDragged={ isDragged }\n\t\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\t\trowCount={ rowCount }\n\t\t\t\t\t\t\t\tsiblingBlockCount={ blockCount }\n\t\t\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\t\t\tpath={ updatedPath }\n\t\t\t\t\t\t\t\tisExpanded={ shouldExpand }\n\t\t\t\t\t\t\t\tlistPosition={ nextPosition }\n\t\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\t\tisSyncedBranch={ syncedBranch }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! showBlock && (\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td className=\"block-editor-list-view-placeholder\" />\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ hasNestedBlocks && shouldExpand && ! isDragged && (\n\t\t\t\t\t\t\t<ListViewBranch\n\t\t\t\t\t\t\t\tparentId={ clientId }\n\t\t\t\t\t\t\t\tblocks={ innerBlocks }\n\t\t\t\t\t\t\t\tselectBlock={ selectBlock }\n\t\t\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\t\t\tlevel={ level + 1 }\n\t\t\t\t\t\t\t\tpath={ updatedPath }\n\t\t\t\t\t\t\t\tlistPosition={ nextPosition + 1 }\n\t\t\t\t\t\t\t\tfixedListWindow={ fixedListWindow }\n\t\t\t\t\t\t\t\tisBranchSelected={ isSelectedBranch }\n\t\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\t\t\tisSyncedBranch={ syncedBranch }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AsyncModeProvider>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t\t{ showAppender && (\n\t\t\t\t<TreeGridRow\n\t\t\t\t\tlevel={ level }\n\t\t\t\t\tsetSize={ rowCount }\n\t\t\t\t\tpositionInSet={ rowCount }\n\t\t\t\t\tisExpanded={ true }\n\t\t\t\t>\n\t\t\t\t\t<TreeGridCell>\n\t\t\t\t\t\t{ ( treeGridCellProps ) => (\n\t\t\t\t\t\t\t<Appender\n\t\t\t\t\t\t\t\tclientId={ parentId }\n\t\t\t\t\t\t\t\tnestingLevel={ level }\n\t\t\t\t\t\t\t\tblockCount={ blockCount }\n\t\t\t\t\t\t\t\t{ ...treeGridCellProps }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</TreeGridCell>\n\t\t\t\t</TreeGridRow>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default memo( ListViewBranch );\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/list-view/branch.js"],"names":["countBlocks","block","expandedState","draggedClientIds","isExpandedByDefault","isDragged","includes","clientId","isExpanded","innerBlocks","reduce","countReducer","count","length","noop","ListViewBranch","props","blocks","selectBlock","showBlockMovers","selectedClientIds","level","path","isBranchDragged","isBranchSelected","listPosition","fixedListWindow","parentId","shouldShowInnerBlocks","isSyncedBranch","showAppender","showAppenderProp","parentBlockInformation","syncedBranch","isSynced","canParentExpand","select","blockEditorStore","canEditBlock","filteredBlocks","filter","Boolean","blockCount","rowCount","nextPosition","map","index","itemInView","blockInView","position","updatedPath","hasNestedBlocks","shouldExpand","undefined","isSelected","isSelectedBranch","showBlock","treeGridCellProps"],"mappings":";;;;;;;;;AAOA;;AAJA;;AAKA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAQA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAT,CACCC,KADD,EAECC,aAFD,EAGCC,gBAHD,EAIC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AEC,IAAA,YAAY,EAAGN,KAFhB;AAGC,IAAA,UAAU,EAAGqB,UAHd;AAAA,OAIMe;AAJN,IAFF,CAND,CAvFF,CADD;AA4GA;;eAEc,mBAAM1C,cAAN,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalTreeGridRow as TreeGridRow,\n\t__experimentalTreeGridCell as TreeGridCell,\n} from '@wordpress/components';\nimport { memo } from '@wordpress/element';\nimport { AsyncModeProvider, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { Appender } from './appender';\nimport ListViewBlock from './block';\nimport { useListViewContext } from './context';\nimport { isClientIdSelected } from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayInformation from '../use-block-display-information';\n\n/**\n * Given a block, returns the total number of blocks in that subtree. This is used to help determine\n * the list position of a block.\n *\n * When a block is collapsed, we do not count their children as part of that total. In the current drag\n * implementation dragged blocks and their children are not counted.\n *\n * @param {Object} block block tree\n * @param {Object} expandedState state that notes which branches are collapsed\n * @param {Array} draggedClientIds a list of dragged client ids\n * @param {boolean} isExpandedByDefault flag to determine the default fallback expanded state.\n * @return {number} block count\n */\nfunction countBlocks(\n\tblock,\n\texpandedState,\n\tdraggedClientIds,\n\tisExpandedByDefault\n) {\n\tconst isDragged = draggedClientIds?.includes( block.clientId );\n\tif ( isDragged ) {\n\t\treturn 0;\n\t}\n\tconst isExpanded = expandedState[ block.clientId ] ?? isExpandedByDefault;\n\n\tif ( isExpanded ) {\n\t\treturn (\n\t\t\t1 +\n\t\t\tblock.innerBlocks.reduce(\n\t\t\t\tcountReducer(\n\t\t\t\t\texpandedState,\n\t\t\t\t\tdraggedClientIds,\n\t\t\t\t\tisExpandedByDefault\n\t\t\t\t),\n\t\t\t\t0\n\t\t\t)\n\t\t);\n\t}\n\treturn 1;\n}\nconst countReducer =\n\t( expandedState, draggedClientIds, isExpandedByDefault ) =>\n\t( count, block ) => {\n\t\tconst isDragged = draggedClientIds?.includes( block.clientId );\n\t\tif ( isDragged ) {\n\t\t\treturn count;\n\t\t}\n\t\tconst isExpanded =\n\t\t\texpandedState[ block.clientId ] ?? isExpandedByDefault;\n\t\tif ( isExpanded && block.innerBlocks.length > 0 ) {\n\t\t\treturn (\n\t\t\t\tcount +\n\t\t\t\tcountBlocks(\n\t\t\t\t\tblock,\n\t\t\t\t\texpandedState,\n\t\t\t\t\tdraggedClientIds,\n\t\t\t\t\tisExpandedByDefault\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\treturn count + 1;\n\t};\n\nconst noop = () => {};\n\nfunction ListViewBranch( props ) {\n\tconst {\n\t\tblocks,\n\t\tselectBlock = noop,\n\t\tshowBlockMovers,\n\t\tselectedClientIds,\n\t\tlevel = 1,\n\t\tpath = '',\n\t\tisBranchDragged = false,\n\t\tisBranchSelected = false,\n\t\tlistPosition = 0,\n\t\tfixedListWindow,\n\t\tisExpanded,\n\t\tparentId,\n\t\tshouldShowInnerBlocks = true,\n\t\tisSyncedBranch = false,\n\t\tshowAppender: showAppenderProp = true,\n\t} = props;\n\n\tconst parentBlockInformation = useBlockDisplayInformation( parentId );\n\tconst syncedBranch = isSyncedBranch || !! parentBlockInformation?.isSynced;\n\n\tconst canParentExpand = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! parentId ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn select( blockEditorStore ).canEditBlock( parentId );\n\t\t},\n\t\t[ parentId ]\n\t);\n\n\tconst { expandedState, draggedClientIds } = useListViewContext();\n\n\tif ( ! canParentExpand ) {\n\t\treturn null;\n\t}\n\n\t// Only show the appender at the first level.\n\tconst showAppender = showAppenderProp && level === 1;\n\tconst filteredBlocks = blocks.filter( Boolean );\n\tconst blockCount = filteredBlocks.length;\n\t// The appender means an extra row in List View, so add 1 to the row count.\n\tconst rowCount = showAppender ? blockCount + 1 : blockCount;\n\tlet nextPosition = listPosition;\n\n\treturn (\n\t\t<>\n\t\t\t{ filteredBlocks.map( ( block, index ) => {\n\t\t\t\tconst { clientId, innerBlocks } = block;\n\n\t\t\t\tif ( index > 0 ) {\n\t\t\t\t\tnextPosition += countBlocks(\n\t\t\t\t\t\tfilteredBlocks[ index - 1 ],\n\t\t\t\t\t\texpandedState,\n\t\t\t\t\t\tdraggedClientIds,\n\t\t\t\t\t\tisExpanded\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tconst { itemInView } = fixedListWindow;\n\t\t\t\tconst blockInView = itemInView( nextPosition );\n\n\t\t\t\tconst position = index + 1;\n\t\t\t\tconst updatedPath =\n\t\t\t\t\tpath.length > 0\n\t\t\t\t\t\t? `${ path }_${ position }`\n\t\t\t\t\t\t: `${ position }`;\n\t\t\t\tconst hasNestedBlocks = !! innerBlocks?.length;\n\n\t\t\t\tconst shouldExpand =\n\t\t\t\t\thasNestedBlocks && shouldShowInnerBlocks\n\t\t\t\t\t\t? expandedState[ clientId ] ?? isExpanded\n\t\t\t\t\t\t: undefined;\n\n\t\t\t\tconst isDragged = !! draggedClientIds?.includes( clientId );\n\n\t\t\t\t// Make updates to the selected or dragged blocks synchronous,\n\t\t\t\t// but asynchronous for any other block.\n\t\t\t\tconst isSelected = isClientIdSelected(\n\t\t\t\t\tclientId,\n\t\t\t\t\tselectedClientIds\n\t\t\t\t);\n\t\t\t\tconst isSelectedBranch =\n\t\t\t\t\tisBranchSelected || ( isSelected && hasNestedBlocks );\n\t\t\t\tconst showBlock =\n\t\t\t\t\tisDragged || blockInView || isSelected || isBranchDragged;\n\t\t\t\treturn (\n\t\t\t\t\t<AsyncModeProvider key={ clientId } value={ ! isSelected }>\n\t\t\t\t\t\t{ showBlock && (\n\t\t\t\t\t\t\t<ListViewBlock\n\t\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\t\tselectBlock={ selectBlock }\n\t\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\t\tisBranchSelected={ isSelectedBranch }\n\t\t\t\t\t\t\t\tisDragged={ isDragged || isBranchDragged }\n\t\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\t\trowCount={ rowCount }\n\t\t\t\t\t\t\t\tsiblingBlockCount={ blockCount }\n\t\t\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\t\t\tpath={ updatedPath }\n\t\t\t\t\t\t\t\tisExpanded={ shouldExpand }\n\t\t\t\t\t\t\t\tlistPosition={ nextPosition }\n\t\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\t\tisSyncedBranch={ syncedBranch }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! showBlock && (\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td className=\"block-editor-list-view-placeholder\" />\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ hasNestedBlocks && shouldExpand && (\n\t\t\t\t\t\t\t<ListViewBranch\n\t\t\t\t\t\t\t\tparentId={ clientId }\n\t\t\t\t\t\t\t\tblocks={ innerBlocks }\n\t\t\t\t\t\t\t\tselectBlock={ selectBlock }\n\t\t\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\t\t\tlevel={ level + 1 }\n\t\t\t\t\t\t\t\tpath={ updatedPath }\n\t\t\t\t\t\t\t\tlistPosition={ nextPosition + 1 }\n\t\t\t\t\t\t\t\tfixedListWindow={ fixedListWindow }\n\t\t\t\t\t\t\t\tisBranchSelected={ isSelectedBranch }\n\t\t\t\t\t\t\t\tisBranchDragged={ isDragged || isBranchDragged }\n\t\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\t\t\tisSyncedBranch={ syncedBranch }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</AsyncModeProvider>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t\t{ showAppender && (\n\t\t\t\t<TreeGridRow\n\t\t\t\t\tlevel={ level }\n\t\t\t\t\tsetSize={ rowCount }\n\t\t\t\t\tpositionInSet={ rowCount }\n\t\t\t\t\tisExpanded={ true }\n\t\t\t\t>\n\t\t\t\t\t<TreeGridCell>\n\t\t\t\t\t\t{ ( treeGridCellProps ) => (\n\t\t\t\t\t\t\t<Appender\n\t\t\t\t\t\t\t\tclientId={ parentId }\n\t\t\t\t\t\t\t\tnestingLevel={ level }\n\t\t\t\t\t\t\t\tblockCount={ blockCount }\n\t\t\t\t\t\t\t\t{ ...treeGridCellProps }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</TreeGridCell>\n\t\t\t\t</TreeGridRow>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default memo( ListViewBranch );\n"]}