@wordpress/block-editor 15.8.1-next.16d95556a.0 → 15.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-inspector/edit-contents.js +19 -23
  3. package/build/components/block-inspector/edit-contents.js.map +3 -3
  4. package/build/components/block-inspector/index.js +7 -1
  5. package/build/components/block-inspector/index.js.map +2 -2
  6. package/build/components/block-list/block.js +4 -0
  7. package/build/components/block-list/block.js.map +2 -2
  8. package/build/components/block-list/index.js +2 -1
  9. package/build/components/block-list/index.js.map +2 -2
  10. package/build/components/block-list/use-block-props/index.js +3 -1
  11. package/build/components/block-list/use-block-props/index.js.map +2 -2
  12. package/build/components/block-list/use-block-props/use-is-hovered.js +16 -10
  13. package/build/components/block-list/use-block-props/use-is-hovered.js.map +2 -2
  14. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js +27 -5
  15. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +2 -2
  16. package/build/components/block-lock/modal.js +5 -5
  17. package/build/components/block-lock/modal.js.map +2 -2
  18. package/build/components/block-lock/use-block-lock.js +10 -13
  19. package/build/components/block-lock/use-block-lock.js.map +2 -2
  20. package/build/components/block-settings-menu-controls/edit-section-menu-item.js +64 -0
  21. package/build/components/block-settings-menu-controls/edit-section-menu-item.js.map +7 -0
  22. package/build/components/block-settings-menu-controls/index.js +9 -1
  23. package/build/components/block-settings-menu-controls/index.js.map +2 -2
  24. package/build/components/block-toolbar/block-toolbar-icon.js +9 -9
  25. package/build/components/block-toolbar/block-toolbar-icon.js.map +2 -2
  26. package/build/components/block-tools/index.js +56 -45
  27. package/build/components/block-tools/index.js.map +3 -3
  28. package/build/components/block-variation-transforms/index.js +32 -5
  29. package/build/components/block-variation-transforms/index.js.map +2 -2
  30. package/build/components/block-visibility/toolbar.js +1 -1
  31. package/build/components/block-visibility/toolbar.js.map +1 -1
  32. package/build/components/border-radius-control/single-input-control.js +1 -0
  33. package/build/components/border-radius-control/single-input-control.js.map +2 -2
  34. package/build/components/content-only-controls/fields-dropdown-menu.js +66 -0
  35. package/build/components/content-only-controls/fields-dropdown-menu.js.map +7 -0
  36. package/build/components/content-only-controls/index.js +444 -0
  37. package/build/components/content-only-controls/index.js.map +7 -0
  38. package/build/components/content-only-controls/link/index.js +193 -0
  39. package/build/components/content-only-controls/link/index.js.map +7 -0
  40. package/build/components/content-only-controls/media/index.js +264 -0
  41. package/build/components/content-only-controls/media/index.js.map +7 -0
  42. package/build/components/content-only-controls/rich-text/index.js +188 -0
  43. package/build/components/content-only-controls/rich-text/index.js.map +7 -0
  44. package/build/components/content-only-controls/use-inspector-popover-placement.js +41 -0
  45. package/build/components/content-only-controls/use-inspector-popover-placement.js.map +7 -0
  46. package/build/components/font-family/index.js +1 -15
  47. package/build/components/font-family/index.js.map +2 -2
  48. package/build/components/global-styles/dimensions-panel.js +35 -2
  49. package/build/components/global-styles/dimensions-panel.js.map +2 -2
  50. package/build/components/global-styles/hooks.js +1 -1
  51. package/build/components/global-styles/hooks.js.map +2 -2
  52. package/build/components/global-styles/typography-panel.js +1 -2
  53. package/build/components/global-styles/typography-panel.js.map +2 -2
  54. package/build/components/inserter/media-tab/media-tab.js +1 -33
  55. package/build/components/inserter/media-tab/media-tab.js.map +3 -3
  56. package/build/components/inspector-controls-tabs/content-tab.js +6 -2
  57. package/build/components/inspector-controls-tabs/content-tab.js.map +3 -3
  58. package/build/components/inspector-controls-tabs/index.js +7 -1
  59. package/build/components/inspector-controls-tabs/index.js.map +2 -2
  60. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
  61. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
  62. package/build/components/link-control/index.js +15 -7
  63. package/build/components/link-control/index.js.map +2 -2
  64. package/build/components/list-view/block-select-button.js +7 -8
  65. package/build/components/list-view/block-select-button.js.map +2 -2
  66. package/build/components/list-view/block.js +9 -7
  67. package/build/components/list-view/block.js.map +2 -2
  68. package/build/components/media-placeholder/index.js +18 -35
  69. package/build/components/media-placeholder/index.js.map +3 -3
  70. package/build/components/media-placeholder/utils.js +60 -0
  71. package/build/components/media-placeholder/utils.js.map +7 -0
  72. package/build/components/media-replace-flow/index.js +24 -33
  73. package/build/components/media-replace-flow/index.js.map +3 -3
  74. package/build/components/use-block-commands/index.js +1 -1
  75. package/build/components/use-block-commands/index.js.map +2 -2
  76. package/build/components/use-block-display-information/index.js +21 -1
  77. package/build/components/use-block-display-information/index.js.map +3 -3
  78. package/build/components/use-block-drop-zone/index.js +1 -5
  79. package/build/components/use-block-drop-zone/index.js.map +2 -2
  80. package/build/hooks/block-bindings.js +52 -61
  81. package/build/hooks/block-bindings.js.map +3 -3
  82. package/build/hooks/dimensions.js +3 -3
  83. package/build/hooks/dimensions.js.map +2 -2
  84. package/build/hooks/metadata.js +1 -1
  85. package/build/hooks/metadata.js.map +2 -2
  86. package/build/hooks/use-content-only-section-edit.js +67 -0
  87. package/build/hooks/use-content-only-section-edit.js.map +7 -0
  88. package/build/hooks/utils.js +5 -1
  89. package/build/hooks/utils.js.map +2 -2
  90. package/build/layouts/constrained.js +2 -2
  91. package/build/layouts/constrained.js.map +2 -2
  92. package/build/private-apis.js +2 -3
  93. package/build/private-apis.js.map +3 -3
  94. package/build/store/private-keys.js +3 -0
  95. package/build/store/private-keys.js.map +2 -2
  96. package/build/store/private-selectors.js +41 -2
  97. package/build/store/private-selectors.js.map +2 -2
  98. package/build/store/selectors.js +6 -4
  99. package/build/store/selectors.js.map +2 -2
  100. package/build/utils/fit-text-utils.js +9 -1
  101. package/build/utils/fit-text-utils.js.map +2 -2
  102. package/build-module/components/block-inspector/edit-contents.js +9 -23
  103. package/build-module/components/block-inspector/edit-contents.js.map +2 -2
  104. package/build-module/components/block-inspector/index.js +7 -1
  105. package/build-module/components/block-inspector/index.js.map +2 -2
  106. package/build-module/components/block-list/block.js +4 -0
  107. package/build-module/components/block-list/block.js.map +2 -2
  108. package/build-module/components/block-list/index.js +2 -1
  109. package/build-module/components/block-list/index.js.map +2 -2
  110. package/build-module/components/block-list/use-block-props/index.js +3 -1
  111. package/build-module/components/block-list/use-block-props/index.js.map +2 -2
  112. package/build-module/components/block-list/use-block-props/use-is-hovered.js +16 -10
  113. package/build-module/components/block-list/use-block-props/use-is-hovered.js.map +2 -2
  114. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js +27 -5
  115. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js.map +2 -2
  116. package/build-module/components/block-lock/modal.js +5 -5
  117. package/build-module/components/block-lock/modal.js.map +2 -2
  118. package/build-module/components/block-lock/use-block-lock.js +10 -13
  119. package/build-module/components/block-lock/use-block-lock.js.map +2 -2
  120. package/build-module/components/block-settings-menu-controls/edit-section-menu-item.js +29 -0
  121. package/build-module/components/block-settings-menu-controls/edit-section-menu-item.js.map +7 -0
  122. package/build-module/components/block-settings-menu-controls/index.js +9 -1
  123. package/build-module/components/block-settings-menu-controls/index.js.map +2 -2
  124. package/build-module/components/block-toolbar/block-toolbar-icon.js +10 -10
  125. package/build-module/components/block-toolbar/block-toolbar-icon.js.map +2 -2
  126. package/build-module/components/block-tools/index.js +56 -45
  127. package/build-module/components/block-tools/index.js.map +2 -2
  128. package/build-module/components/block-variation-transforms/index.js +32 -5
  129. package/build-module/components/block-variation-transforms/index.js.map +2 -2
  130. package/build-module/components/block-visibility/toolbar.js +1 -1
  131. package/build-module/components/block-visibility/toolbar.js.map +1 -1
  132. package/build-module/components/border-radius-control/single-input-control.js +1 -0
  133. package/build-module/components/border-radius-control/single-input-control.js.map +2 -2
  134. package/build-module/components/content-only-controls/fields-dropdown-menu.js +45 -0
  135. package/build-module/components/content-only-controls/fields-dropdown-menu.js.map +7 -0
  136. package/build-module/components/content-only-controls/index.js +420 -0
  137. package/build-module/components/content-only-controls/index.js.map +7 -0
  138. package/build-module/components/content-only-controls/link/index.js +160 -0
  139. package/build-module/components/content-only-controls/link/index.js.map +7 -0
  140. package/build-module/components/content-only-controls/media/index.js +242 -0
  141. package/build-module/components/content-only-controls/media/index.js.map +7 -0
  142. package/build-module/components/content-only-controls/rich-text/index.js +160 -0
  143. package/build-module/components/content-only-controls/rich-text/index.js.map +7 -0
  144. package/build-module/components/content-only-controls/use-inspector-popover-placement.js +16 -0
  145. package/build-module/components/content-only-controls/use-inspector-popover-placement.js.map +7 -0
  146. package/build-module/components/font-family/index.js +1 -15
  147. package/build-module/components/font-family/index.js.map +2 -2
  148. package/build-module/components/global-styles/dimensions-panel.js +35 -2
  149. package/build-module/components/global-styles/dimensions-panel.js.map +2 -2
  150. package/build-module/components/global-styles/hooks.js +1 -1
  151. package/build-module/components/global-styles/hooks.js.map +2 -2
  152. package/build-module/components/global-styles/typography-panel.js +1 -2
  153. package/build-module/components/global-styles/typography-panel.js.map +2 -2
  154. package/build-module/components/inserter/media-tab/media-tab.js +2 -34
  155. package/build-module/components/inserter/media-tab/media-tab.js.map +2 -2
  156. package/build-module/components/inspector-controls-tabs/content-tab.js +7 -3
  157. package/build-module/components/inspector-controls-tabs/content-tab.js.map +2 -2
  158. package/build-module/components/inspector-controls-tabs/index.js +7 -1
  159. package/build-module/components/inspector-controls-tabs/index.js.map +2 -2
  160. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -1
  161. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +2 -2
  162. package/build-module/components/link-control/index.js +16 -8
  163. package/build-module/components/link-control/index.js.map +2 -2
  164. package/build-module/components/list-view/block-select-button.js +14 -9
  165. package/build-module/components/list-view/block-select-button.js.map +2 -2
  166. package/build-module/components/list-view/block.js +9 -7
  167. package/build-module/components/list-view/block.js.map +2 -2
  168. package/build-module/components/media-placeholder/index.js +19 -36
  169. package/build-module/components/media-placeholder/index.js.map +2 -2
  170. package/build-module/components/media-placeholder/utils.js +35 -0
  171. package/build-module/components/media-placeholder/utils.js.map +7 -0
  172. package/build-module/components/media-replace-flow/index.js +24 -33
  173. package/build-module/components/media-replace-flow/index.js.map +2 -2
  174. package/build-module/components/use-block-commands/index.js +1 -1
  175. package/build-module/components/use-block-commands/index.js.map +2 -2
  176. package/build-module/components/use-block-display-information/index.js +21 -1
  177. package/build-module/components/use-block-display-information/index.js.map +3 -3
  178. package/build-module/components/use-block-drop-zone/index.js +1 -5
  179. package/build-module/components/use-block-drop-zone/index.js.map +2 -2
  180. package/build-module/hooks/block-bindings.js +57 -62
  181. package/build-module/hooks/block-bindings.js.map +2 -2
  182. package/build-module/hooks/dimensions.js +3 -3
  183. package/build-module/hooks/dimensions.js.map +2 -2
  184. package/build-module/hooks/metadata.js +1 -1
  185. package/build-module/hooks/metadata.js.map +2 -2
  186. package/build-module/hooks/use-content-only-section-edit.js +46 -0
  187. package/build-module/hooks/use-content-only-section-edit.js.map +7 -0
  188. package/build-module/hooks/utils.js +5 -1
  189. package/build-module/hooks/utils.js.map +2 -2
  190. package/build-module/layouts/constrained.js +2 -2
  191. package/build-module/layouts/constrained.js.map +2 -2
  192. package/build-module/private-apis.js +3 -3
  193. package/build-module/private-apis.js.map +2 -2
  194. package/build-module/store/private-keys.js +2 -0
  195. package/build-module/store/private-keys.js.map +2 -2
  196. package/build-module/store/private-selectors.js +37 -2
  197. package/build-module/store/private-selectors.js.map +2 -2
  198. package/build-module/store/selectors.js +6 -4
  199. package/build-module/store/selectors.js.map +2 -2
  200. package/build-module/utils/fit-text-utils.js +9 -1
  201. package/build-module/utils/fit-text-utils.js.map +2 -2
  202. package/build-style/content-rtl.css +3 -0
  203. package/build-style/content.css +3 -0
  204. package/build-style/style-rtl.css +145 -4
  205. package/build-style/style.css +145 -4
  206. package/package.json +38 -37
  207. package/src/components/block-inspector/edit-contents.js +10 -29
  208. package/src/components/block-inspector/index.js +4 -2
  209. package/src/components/block-list/block.js +6 -0
  210. package/src/components/block-list/content.scss +5 -0
  211. package/src/components/block-list/index.js +3 -1
  212. package/src/components/block-list/use-block-props/index.js +3 -1
  213. package/src/components/block-list/use-block-props/use-is-hovered.js +24 -12
  214. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +34 -3
  215. package/src/components/block-lock/modal.js +6 -5
  216. package/src/components/block-lock/use-block-lock.js +10 -14
  217. package/src/components/block-patterns-list/stories/{index.story.js → index.story.jsx} +3 -1
  218. package/src/components/block-settings-menu-controls/edit-section-menu-item.js +39 -0
  219. package/src/components/block-settings-menu-controls/index.js +8 -1
  220. package/src/components/block-toolbar/block-toolbar-icon.js +14 -10
  221. package/src/components/block-tools/index.js +15 -2
  222. package/src/components/block-tools/style.scss +4 -0
  223. package/src/components/block-variation-transforms/index.js +96 -35
  224. package/src/components/block-visibility/toolbar.js +1 -1
  225. package/src/components/border-radius-control/single-input-control.js +1 -0
  226. package/src/components/content-only-controls/fields-dropdown-menu.js +53 -0
  227. package/src/components/content-only-controls/index.js +560 -0
  228. package/src/components/content-only-controls/link/index.js +200 -0
  229. package/src/components/content-only-controls/link/styles.scss +23 -0
  230. package/src/components/content-only-controls/media/index.js +306 -0
  231. package/src/components/content-only-controls/media/styles.scss +47 -0
  232. package/src/components/content-only-controls/rich-text/index.js +179 -0
  233. package/src/components/content-only-controls/rich-text/styles.scss +24 -0
  234. package/src/components/content-only-controls/styles.scss +44 -0
  235. package/src/components/content-only-controls/use-inspector-popover-placement.js +19 -0
  236. package/src/components/font-family/README.md +0 -9
  237. package/src/components/font-family/index.js +1 -16
  238. package/src/components/font-family/stories/{index.story.js → index.story.jsx} +0 -1
  239. package/src/components/global-styles/dimensions-panel.js +36 -0
  240. package/src/components/global-styles/hooks.js +1 -1
  241. package/src/components/global-styles/typography-panel.js +0 -1
  242. package/src/components/inserter/media-tab/media-tab.js +2 -44
  243. package/src/components/inspector-controls-tabs/content-tab.js +12 -4
  244. package/src/components/inspector-controls-tabs/index.js +4 -1
  245. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -5
  246. package/src/components/link-control/index.js +36 -12
  247. package/src/components/list-view/block-select-button.js +15 -10
  248. package/src/components/list-view/block.js +9 -7
  249. package/src/components/media-placeholder/index.js +21 -46
  250. package/src/components/media-placeholder/test/get-computed-accept-attribute.js +164 -0
  251. package/src/components/media-placeholder/utils.js +65 -0
  252. package/src/components/media-replace-flow/index.js +25 -42
  253. package/src/components/use-block-commands/index.js +1 -1
  254. package/src/components/use-block-display-information/index.js +30 -2
  255. package/src/components/use-block-drop-zone/index.js +1 -5
  256. package/src/hooks/block-bindings.js +71 -82
  257. package/src/hooks/dimensions.js +8 -3
  258. package/src/hooks/metadata.js +1 -1
  259. package/src/hooks/test/metadata.js +1 -1
  260. package/src/hooks/use-content-only-section-edit.js +63 -0
  261. package/src/hooks/utils.js +4 -0
  262. package/src/layouts/constrained.js +8 -2
  263. package/src/private-apis.js +2 -2
  264. package/src/store/private-keys.js +1 -0
  265. package/src/store/private-selectors.js +121 -5
  266. package/src/store/selectors.js +6 -4
  267. package/src/store/test/private-selectors.js +242 -0
  268. package/src/style.scss +1 -1
  269. package/src/utils/fit-text-utils.js +19 -1
  270. package/tsconfig.json +1 -0
  271. package/build/components/media-upload-modal/index.js +0 -29
  272. package/build/components/media-upload-modal/index.js.map +0 -7
  273. package/build-module/components/media-upload-modal/index.js +0 -8
  274. package/build-module/components/media-upload-modal/index.js.map +0 -7
  275. package/src/components/font-family/style.scss +0 -7
  276. package/src/components/media-upload-modal/index.js +0 -18
  277. /package/src/components/alignment-control/stories/{aliginment-toolbar.story.js → aliginment-toolbar.story.jsx} +0 -0
  278. /package/src/components/alignment-control/stories/{index.story.js → index.story.jsx} +0 -0
  279. /package/src/components/block-alignment-matrix-control/stories/{index.story.js → index.story.jsx} +0 -0
  280. /package/src/components/block-draggable/stories/{index.story.js → index.story.jsx} +0 -0
  281. /package/src/components/block-heading-level-dropdown/stories/{index.story.js → index.story.jsx} +0 -0
  282. /package/src/components/block-mover/stories/{index.story.js → index.story.jsx} +0 -0
  283. /package/src/components/block-title/stories/{index.story.js → index.story.jsx} +0 -0
  284. /package/src/components/border-radius-control/stories/{index.story.js → index.story.jsx} +0 -0
  285. /package/src/components/date-format-picker/stories/{index.story.js → index.story.jsx} +0 -0
  286. /package/src/components/dimensions-tool/stories/{aspect-ratio-tool.story.js → aspect-ratio-tool.story.jsx} +0 -0
  287. /package/src/components/dimensions-tool/stories/{index.story.js → index.story.jsx} +0 -0
  288. /package/src/components/dimensions-tool/stories/{scale-tool.story.js → scale-tool.story.jsx} +0 -0
  289. /package/src/components/dimensions-tool/stories/{width-height-tool.story.js → width-height-tool.story.jsx} +0 -0
  290. /package/src/components/height-control/stories/{index.story.js → index.story.jsx} +0 -0
  291. /package/src/components/inserter/stories/{index.story.js → index.story.jsx} +0 -0
  292. /package/src/components/line-height-control/stories/{index.story.js → index.story.jsx} +0 -0
  293. /package/src/components/plain-text/stories/{index.story.js → index.story.jsx} +0 -0
  294. /package/src/components/resolution-tool/stories/{index.story.js → index.story.jsx} +0 -0
  295. /package/src/components/tabbed-sidebar/stories/{index.story.js → index.story.jsx} +0 -0
  296. /package/src/components/text-alignment-control/stories/{index.story.js → index.story.jsx} +0 -0
  297. /package/src/components/text-decoration-control/stories/{index.story.js → index.story.jsx} +0 -0
  298. /package/src/components/text-transform-control/stories/{index.story.js → index.story.jsx} +0 -0
  299. /package/src/components/unit-control/stories/{index.story.js → index.story.jsx} +0 -0
  300. /package/src/components/url-popover/stories/{index.story.js → index.story.jsx} +0 -0
  301. /package/src/components/warning/stories/{index.story.js → index.story.jsx} +0 -0
  302. /package/src/components/writing-mode-control/stories/{index.story.js → index.story.jsx} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/link-control/index.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tSpinner,\n\tNotice,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalInputControlSuffixWrapper as InputControlSuffixWrapper,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useRef, useState, useEffect } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { focus } from '@wordpress/dom';\nimport { ENTER } from '@wordpress/keycodes';\nimport { isShallowEqualObjects } from '@wordpress/is-shallow-equal';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { keyboardReturn, linkOff } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport LinkControlSettingsDrawer from './settings-drawer';\nimport LinkControlSearchInput from './search-input';\nimport LinkPreview from './link-preview';\nimport LinkSettings from './settings';\nimport useCreatePage from './use-create-page';\nimport useInternalValue from './use-internal-value';\nimport { ViewerFill } from './viewer-slot';\nimport { DEFAULT_LINK_SETTINGS } from './constants';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Default properties associated with a link control value.\n *\n * @typedef WPLinkControlDefaultValue\n *\n * @property {string} url Link URL.\n * @property {string=} title Link title.\n * @property {boolean=} opensInNewTab Whether link should open in a new browser\n * tab. This value is only assigned if not\n * providing a custom `settings` prop.\n */\n\n/**\n * Custom settings values associated with a link.\n *\n * @typedef {{[setting:string]:any}} WPLinkControlSettingsValue\n */\n\n/**\n * Custom settings values associated with a link.\n *\n * @typedef WPLinkControlSetting\n *\n * @property {string} id Identifier to use as property for setting value.\n * @property {string} title Human-readable label to show in user interface.\n */\n\n/**\n * Properties associated with a link control value, composed as a union of the\n * default properties and any custom settings values.\n *\n * @typedef {WPLinkControlDefaultValue&WPLinkControlSettingsValue} WPLinkControlValue\n */\n\n/** @typedef {(nextValue:WPLinkControlValue)=>void} WPLinkControlOnChangeProp */\n\n/**\n * Properties associated with a search suggestion used within the LinkControl.\n *\n * @typedef WPLinkControlSuggestion\n *\n * @property {string} id Identifier to use to uniquely identify the suggestion.\n * @property {string} type Identifies the type of the suggestion (eg: `post`,\n * `page`, `url`...etc)\n * @property {string} title Human-readable label to show in user interface.\n * @property {string} url A URL for the suggestion.\n */\n\n/** @typedef {(title:string)=>WPLinkControlSuggestion} WPLinkControlCreateSuggestionProp */\n\n/**\n * @typedef WPLinkControlProps\n *\n * @property {(WPLinkControlSetting[])=} settings An array of settings objects. Each object will used to\n * render a `ToggleControl` for that setting.\n * @property {boolean=} forceIsEditingLink If passed as either `true` or `false`, controls the\n * internal editing state of the component to respective\n * show or not show the URL input field.\n * @property {WPLinkControlValue=} value Current link value.\n * @property {WPLinkControlOnChangeProp=} onChange Value change handler, called with the updated value if\n * the user selects a new link or updates settings.\n * @property {boolean=} noDirectEntry Whether to allow turning a URL-like search query directly into a link.\n * @property {boolean=} showSuggestions Whether to present suggestions when typing the URL.\n * @property {boolean=} showInitialSuggestions Whether to present initial suggestions immediately.\n * @property {boolean=} withCreateSuggestion Whether to allow creation of link value from suggestion.\n * @property {Object=} suggestionsQuery Query parameters to pass along to wp.blockEditor.__experimentalFetchLinkSuggestions.\n * @property {boolean=} noURLSuggestion Whether to add a fallback suggestion which treats the search query as a URL.\n * @property {boolean=} hasTextControl Whether to add a text field to the UI to update the value.title.\n * @property {string|Function|undefined} createSuggestionButtonText The text to use in the button that calls createSuggestion.\n * @property {Function} renderControlBottom Optional controls to be rendered at the bottom of the component.\n * @property {boolean=} handleEntities Whether to handle entity links (links with ID). When true and a link has an ID, the input will be disabled and show an unlink button.\n */\n\nconst noop = () => {};\n\nconst PREFERENCE_SCOPE = 'core/block-editor';\nconst PREFERENCE_KEY = 'linkControlSettingsDrawer';\n\n/**\n * Renders a link control. A link control is a controlled input which maintains\n * a value associated with a link (HTML anchor element) and relevant settings\n * for how that link is expected to behave.\n *\n * @param {WPLinkControlProps} props Component props.\n */\nfunction LinkControl( {\n\tsearchInputPlaceholder,\n\tvalue,\n\tsettings = DEFAULT_LINK_SETTINGS,\n\tonChange = noop,\n\tonRemove,\n\tonCancel,\n\tnoDirectEntry = false,\n\tshowSuggestions = true,\n\tshowInitialSuggestions,\n\tforceIsEditingLink,\n\tcreateSuggestion,\n\twithCreateSuggestion,\n\tinputValue: propInputValue = '',\n\tsuggestionsQuery = {},\n\tnoURLSuggestion = false,\n\tcreateSuggestionButtonText,\n\thasRichPreviews = false,\n\thasTextControl = false,\n\trenderControlBottom = null,\n\thandleEntities = false,\n} ) {\n\tif ( withCreateSuggestion === undefined && createSuggestion ) {\n\t\twithCreateSuggestion = true;\n\t}\n\n\tconst [ settingsOpen, setSettingsOpen ] = useState( false );\n\n\tconst { advancedSettingsPreference } = useSelect( ( select ) => {\n\t\tconst prefsStore = select( preferencesStore );\n\n\t\treturn {\n\t\t\tadvancedSettingsPreference:\n\t\t\t\tprefsStore.get( PREFERENCE_SCOPE, PREFERENCE_KEY ) ?? false,\n\t\t};\n\t}, [] );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\t/**\n\t * Sets the open/closed state of the Advanced Settings Drawer,\n\t * optionlly persisting the state to the user's preferences.\n\t *\n\t * Note that Block Editor components can be consumed by non-WordPress\n\t * environments which may not have preferences setup.\n\t * Therefore a local state is also used as a fallback.\n\t *\n\t * @param {boolean} prefVal the open/closed state of the Advanced Settings Drawer.\n\t */\n\tconst setSettingsOpenWithPreference = ( prefVal ) => {\n\t\tif ( setPreference ) {\n\t\t\tsetPreference( PREFERENCE_SCOPE, PREFERENCE_KEY, prefVal );\n\t\t}\n\t\tsetSettingsOpen( prefVal );\n\t};\n\n\t// Block Editor components can be consumed by non-WordPress environments\n\t// which may not have these preferences setup.\n\t// Therefore a local state is used as a fallback.\n\tconst isSettingsOpen = advancedSettingsPreference || settingsOpen;\n\n\tconst isMountingRef = useRef( true );\n\tconst wrapperNode = useRef();\n\tconst textInputRef = useRef();\n\tconst searchInputRef = useRef();\n\tconst isEndingEditWithFocusRef = useRef( false );\n\n\tconst settingsKeys = settings.map( ( { id } ) => id );\n\n\tconst [\n\t\tinternalControlValue,\n\t\tsetInternalControlValue,\n\t\tsetInternalURLInputValue,\n\t\tsetInternalTextInputValue,\n\t\tcreateSetInternalSettingValueHandler,\n\t] = useInternalValue( value );\n\n\t// Compute isEntity internally based on handleEntities prop and presence of ID\n\tconst isEntity = handleEntities && !! internalControlValue?.id;\n\n\t// Generate help text ID for accessibility association\n\tconst baseId = useInstanceId( LinkControl, 'link-control' );\n\tconst helpTextId = isEntity ? `${ baseId }__help` : null;\n\n\tconst valueHasChanges =\n\t\tvalue && ! isShallowEqualObjects( internalControlValue, value );\n\n\tconst [ isEditingLink, setIsEditingLink ] = useState(\n\t\tforceIsEditingLink !== undefined\n\t\t\t? forceIsEditingLink\n\t\t\t: ! value || ! value.url\n\t);\n\n\tconst { createPage, isCreatingPage, errorMessage } =\n\t\tuseCreatePage( createSuggestion );\n\n\tuseEffect( () => {\n\t\tif ( forceIsEditingLink === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsEditingLink( forceIsEditingLink );\n\t}, [ forceIsEditingLink ] );\n\n\tuseEffect( () => {\n\t\t// We don't auto focus into the Link UI on mount\n\t\t// because otherwise using the keyboard to select text\n\t\t// *within* the link format is not possible.\n\t\tif ( isMountingRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Scenario - when:\n\t\t// - switching between editable and non editable LinkControl\n\t\t// - clicking on a link\n\t\t// ...then move focus to the *first* element to avoid focus loss\n\t\t// and to ensure focus is *within* the Link UI.\n\t\tconst nextFocusTarget =\n\t\t\tfocus.focusable.find( wrapperNode.current )[ 0 ] ||\n\t\t\twrapperNode.current;\n\n\t\tnextFocusTarget.focus();\n\n\t\tisEndingEditWithFocusRef.current = false;\n\t}, [ isEditingLink, isCreatingPage ] );\n\n\t// The component mounting reference is maintained separately\n\t// to correctly reset values in `StrictMode`.\n\tuseEffect( () => {\n\t\tisMountingRef.current = false;\n\n\t\treturn () => {\n\t\t\tisMountingRef.current = true;\n\t\t};\n\t}, [] );\n\n\tconst hasLinkValue = value?.url?.trim()?.length > 0;\n\n\t/**\n\t * Cancels editing state and marks that focus may need to be restored after\n\t * the next render, if focus was within the wrapper when editing finished.\n\t */\n\tconst stopEditing = () => {\n\t\tisEndingEditWithFocusRef.current = !! wrapperNode.current?.contains(\n\t\t\twrapperNode.current.ownerDocument.activeElement\n\t\t);\n\n\t\tsetIsEditingLink( false );\n\t};\n\n\tconst handleSelectSuggestion = ( updatedValue ) => {\n\t\t// Suggestions may contains \"settings\" values (e.g. `opensInNewTab`)\n\t\t// which should not override any existing settings values set by the\n\t\t// user. This filters out any settings values from the suggestion.\n\t\tconst nonSettingsChanges = Object.keys( updatedValue ).reduce(\n\t\t\t( acc, key ) => {\n\t\t\t\tif ( ! settingsKeys.includes( key ) ) {\n\t\t\t\t\tacc[ key ] = updatedValue[ key ];\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\n\t\tonChange( {\n\t\t\t...internalControlValue,\n\t\t\t...nonSettingsChanges,\n\t\t\t// As title is not a setting, it must be manually applied\n\t\t\t// in such a way as to preserve the users changes over\n\t\t\t// any \"title\" value provided by the \"suggestion\".\n\t\t\ttitle: internalControlValue?.title || updatedValue?.title,\n\t\t} );\n\n\t\tstopEditing();\n\t};\n\n\tconst handleSubmit = () => {\n\t\tif ( valueHasChanges ) {\n\t\t\t// Submit the original value with new stored values applied\n\t\t\t// on top. URL is a special case as it may also be a prop.\n\t\t\tonChange( {\n\t\t\t\t...value,\n\t\t\t\t...internalControlValue,\n\t\t\t\turl: currentUrlInputValue,\n\t\t\t} );\n\t\t}\n\t\tstopEditing();\n\t};\n\n\tconst handleSubmitWithEnter = ( event ) => {\n\t\tconst { keyCode } = event;\n\n\t\tif (\n\t\t\tkeyCode === ENTER &&\n\t\t\t! currentInputIsEmpty // Disallow submitting empty values.\n\t\t) {\n\t\t\tevent.preventDefault();\n\t\t\thandleSubmit();\n\t\t}\n\t};\n\n\tconst resetInternalValues = () => {\n\t\tsetInternalControlValue( value );\n\t};\n\n\tconst handleCancel = ( event ) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\t// Ensure that any unsubmitted input changes are reset.\n\t\tresetInternalValues();\n\n\t\tif ( hasLinkValue ) {\n\t\t\t// If there is a link then exist editing mode and show preview.\n\t\t\tstopEditing();\n\t\t} else {\n\t\t\t// If there is no link value, then remove the link entirely.\n\t\t\tonRemove?.();\n\t\t}\n\n\t\tonCancel?.();\n\t};\n\n\tconst [ shouldFocusSearchInput, setShouldFocusSearchInput ] =\n\t\tuseState( false );\n\n\tconst handleUnlink = () => {\n\t\t// Clear the internal state to remove the ID and re-enable the field\n\t\t// Explicitly set id, kind, and type to undefined so they override\n\t\t// the original values when spread in handleSubmit. This ensures that\n\t\t// when the user types a custom URL and submits, the entity link is\n\t\t// properly severed (not just when selecting a different entity from suggestions).\n\t\tconst { id, kind, type, ...restValue } = internalControlValue;\n\t\tsetInternalControlValue( {\n\t\t\t...restValue,\n\t\t\tid: undefined,\n\t\t\tkind: undefined,\n\t\t\ttype: undefined,\n\t\t\turl: undefined,\n\t\t} );\n\n\t\t// Request focus after the component re-renders with the cleared state\n\t\t// We can't focus immediately because the input might still be disabled\n\t\tsetShouldFocusSearchInput( true );\n\t};\n\n\t// Focus the search input when requested, once the component has re-rendered\n\t// This ensures the input is enabled and ready to receive focus\n\tuseEffect( () => {\n\t\tif ( shouldFocusSearchInput ) {\n\t\t\tsearchInputRef.current?.focus();\n\t\t\tsetShouldFocusSearchInput( false );\n\t\t}\n\t}, [ shouldFocusSearchInput ] );\n\n\tconst currentUrlInputValue =\n\t\tpropInputValue || internalControlValue?.url || '';\n\n\tconst currentInputIsEmpty = ! currentUrlInputValue?.trim()?.length;\n\n\tconst shownUnlinkControl =\n\t\tonRemove && value && ! isEditingLink && ! isCreatingPage;\n\n\tconst showActions = isEditingLink && hasLinkValue;\n\n\t// Only show text control once a URL value has been committed\n\t// and it isn't just empty whitespace.\n\t// See https://github.com/WordPress/gutenberg/pull/33849/#issuecomment-932194927.\n\tconst showTextControl = hasLinkValue && hasTextControl;\n\n\tconst isEditing = ( isEditingLink || ! value ) && ! isCreatingPage;\n\tconst isDisabled = ! valueHasChanges || currentInputIsEmpty;\n\tconst showSettings = !! settings?.length && isEditingLink && hasLinkValue;\n\n\treturn (\n\t\t<div\n\t\t\ttabIndex={ -1 }\n\t\t\tref={ wrapperNode }\n\t\t\tclassName=\"block-editor-link-control\"\n\t\t>\n\t\t\t{ isCreatingPage && (\n\t\t\t\t<div className=\"block-editor-link-control__loading\">\n\t\t\t\t\t<Spinner /> { __( 'Creating' ) }\u2026\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ isEditing && (\n\t\t\t\t<>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx( {\n\t\t\t\t\t\t\t'block-editor-link-control__search-input-wrapper': true,\n\t\t\t\t\t\t\t'has-text-control': showTextControl,\n\t\t\t\t\t\t\t'has-actions': showActions,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showTextControl && (\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tref={ textInputRef }\n\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__field block-editor-link-control__text-content\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\t\tvalue={ internalControlValue?.title }\n\t\t\t\t\t\t\t\tonChange={ setInternalTextInputValue }\n\t\t\t\t\t\t\t\tonKeyDown={ handleSubmitWithEnter }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<LinkControlSearchInput\n\t\t\t\t\t\t\tref={ searchInputRef }\n\t\t\t\t\t\t\tcurrentLink={ value }\n\t\t\t\t\t\t\tclassName=\"block-editor-link-control__field block-editor-link-control__search-input\"\n\t\t\t\t\t\t\tplaceholder={ searchInputPlaceholder }\n\t\t\t\t\t\t\tvalue={ currentUrlInputValue }\n\t\t\t\t\t\t\twithCreateSuggestion={ withCreateSuggestion }\n\t\t\t\t\t\t\tonCreateSuggestion={ createPage }\n\t\t\t\t\t\t\tonChange={ setInternalURLInputValue }\n\t\t\t\t\t\t\tonSelect={ handleSelectSuggestion }\n\t\t\t\t\t\t\tshowInitialSuggestions={ showInitialSuggestions }\n\t\t\t\t\t\t\tallowDirectEntry={ ! noDirectEntry }\n\t\t\t\t\t\t\tshowSuggestions={ showSuggestions }\n\t\t\t\t\t\t\tsuggestionsQuery={ suggestionsQuery }\n\t\t\t\t\t\t\twithURLSuggestion={ ! noURLSuggestion }\n\t\t\t\t\t\t\tcreateSuggestionButtonText={\n\t\t\t\t\t\t\t\tcreateSuggestionButtonText\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thideLabelFromVision={ ! showTextControl }\n\t\t\t\t\t\t\tisEntity={ isEntity }\n\t\t\t\t\t\t\tsuffix={\n\t\t\t\t\t\t\t\t<SearchSuffixControl\n\t\t\t\t\t\t\t\t\tisEntity={ isEntity }\n\t\t\t\t\t\t\t\t\tshowActions={ showActions }\n\t\t\t\t\t\t\t\t\tisDisabled={ isDisabled }\n\t\t\t\t\t\t\t\t\tonUnlink={ handleUnlink }\n\t\t\t\t\t\t\t\t\tonSubmit={ handleSubmit }\n\t\t\t\t\t\t\t\t\thelpTextId={ helpTextId }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ isEntity && helpTextId && (\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tid={ helpTextId }\n\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__help\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: entity type (e.g., page, post) */\n\t\t\t\t\t\t\t\t\t__( 'Synced with the selected %s.' ),\n\t\t\t\t\t\t\t\t\tinternalControlValue?.type || 'item'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t\t{ errorMessage && (\n\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\tclassName=\"block-editor-link-control__search-error\"\n\t\t\t\t\t\t\tstatus=\"error\"\n\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ errorMessage }\n\t\t\t\t\t\t</Notice>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t{ value && ! isEditingLink && ! isCreatingPage && (\n\t\t\t\t<LinkPreview\n\t\t\t\t\tkey={ value?.url } // force remount when URL changes to avoid race conditions for rich previews\n\t\t\t\t\tvalue={ value }\n\t\t\t\t\tonEditClick={ () => setIsEditingLink( true ) }\n\t\t\t\t\thasRichPreviews={ hasRichPreviews }\n\t\t\t\t\thasUnlinkControl={ shownUnlinkControl }\n\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\tonRemove();\n\t\t\t\t\t\tsetIsEditingLink( true );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ showSettings && (\n\t\t\t\t<div className=\"block-editor-link-control__tools\">\n\t\t\t\t\t{ ! currentInputIsEmpty && (\n\t\t\t\t\t\t<LinkControlSettingsDrawer\n\t\t\t\t\t\t\tsettingsOpen={ isSettingsOpen }\n\t\t\t\t\t\t\tsetSettingsOpen={ setSettingsOpenWithPreference }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LinkSettings\n\t\t\t\t\t\t\t\tvalue={ internalControlValue }\n\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\tonChange={ createSetInternalSettingValueHandler(\n\t\t\t\t\t\t\t\t\tsettingsKeys\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</LinkControlSettingsDrawer>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ showActions && (\n\t\t\t\t<HStack\n\t\t\t\t\tjustify=\"right\"\n\t\t\t\t\tclassName=\"block-editor-link-control__search-actions\"\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ handleCancel }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ isDisabled ? noop : handleSubmit }\n\t\t\t\t\t\tclassName=\"block-editor-link-control__search-submit\"\n\t\t\t\t\t\taria-disabled={ isDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t) }\n\n\t\t\t{ ! isCreatingPage && renderControlBottom && renderControlBottom() }\n\t\t</div>\n\t);\n}\n\n/**\n * Suffix control component for LinkControl search input.\n * Handles the display of unlink button for entities and submit button for regular links.\n *\n * @param {Object} props - Component props\n * @param {boolean} props.isEntity - Whether the link is bound to an entity\n * @param {boolean} props.showActions - Whether to show action buttons\n * @param {boolean} props.isDisabled - Whether the submit button should be disabled\n * @param {Function} props.onUnlink - Callback when unlink button is clicked\n * @param {Function} props.onSubmit - Callback when submit button is clicked\n * @param {string} props.helpTextId - ID of the help text element for accessibility\n */\nfunction SearchSuffixControl( {\n\tisEntity,\n\tshowActions,\n\tisDisabled,\n\tonUnlink,\n\tonSubmit,\n\thelpTextId,\n} ) {\n\tif ( isEntity ) {\n\t\treturn (\n\t\t\t<Button\n\t\t\t\ticon={ linkOff }\n\t\t\t\tonClick={ onUnlink }\n\t\t\t\taria-describedby={ helpTextId }\n\t\t\t\tshowTooltip\n\t\t\t\tlabel={ __( 'Unsync and edit' ) }\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( showActions ) {\n\t\treturn undefined;\n\t}\n\n\treturn (\n\t\t<InputControlSuffixWrapper variant=\"control\">\n\t\t\t<Button\n\t\t\t\tonClick={ isDisabled ? noop : onSubmit }\n\t\t\t\tlabel={ __( 'Submit' ) }\n\t\t\t\ticon={ keyboardReturn }\n\t\t\t\tclassName=\"block-editor-link-control__search-submit\"\n\t\t\t\taria-disabled={ isDisabled }\n\t\t\t\tsize=\"small\"\n\t\t\t/>\n\t\t</InputControlSuffixWrapper>\n\t);\n}\n\nLinkControl.ViewerFill = ViewerFill;\nLinkControl.DEFAULT_LINK_SETTINGS = DEFAULT_LINK_SETTINGS;\n\nconst DeprecatedExperimentalLinkControl = ( props ) => {\n\tdeprecated( 'wp.blockEditor.__experimentalLinkControl', {\n\t\tsince: '6.8',\n\t\talternative: 'wp.blockEditor.LinkControl',\n\t} );\n\n\treturn <LinkControl { ...props } />;\n};\n\nDeprecatedExperimentalLinkControl.ViewerFill = LinkControl.ViewerFill;\nDeprecatedExperimentalLinkControl.DEFAULT_LINK_SETTINGS =\n\tLinkControl.DEFAULT_LINK_SETTINGS;\n\nexport { DeprecatedExperimentalLinkControl };\nexport default LinkControl;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,wBAOO;AACP,kBAA4B;AAC5B,qBAA4C;AAC5C,qBAA8B;AAC9B,iBAAsB;AACtB,sBAAsB;AACtB,8BAAsC;AACtC,kBAAuC;AACvC,yBAA0C;AAC1C,mBAAwC;AAKxC,6BAAsC;AACtC,0BAAmC;AACnC,0BAAwB;AACxB,sBAAyB;AACzB,6BAA0B;AAC1B,gCAA6B;AAC7B,yBAA2B;AAC3B,uBAAsC;AACtC,wBAAuB;AAgXnB;AArSJ,IAAM,OAAO,MAAM;AAAC;AAEpB,IAAM,mBAAmB;AACzB,IAAM,iBAAiB;AASvB,SAAS,YAAa;AAAA,EACrB;AAAA,EACA;AAAA,EACA,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AqB;AAAA,kBACrB,SAAQ;AAAA,kBACR,SAAU,aAAa,OAAO;AAAA,kBAC9B,WAAU;AAAA,kBACV,iBAAgB;AAAA,kBAEd,8BAAI,OAAQ;AAAA;AAAA,cACf;AAAA;AAAA;AAAA,QACD;AAAA,QAGC,CAAE,kBAAkB,uBAAuB,oBAAoB;AAAA;AAAA;AAAA,EAClE;AAEF;AAcA,SAAS,oBAAqB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,MAAK,UAAW;AACf,WACC;AAAA,MAAC;AAAA;AAAA,QACA,MAAO;AAAA,QACP,SAAU;AAAA,QACV,oBAAmB;AAAA,QACnB,aAAW;AAAA,QACX,WAAQ,gBAAI,iBAAkB;AAAA,QAC9B,uBAAqB;AAAA;AAAA,IACtB;AAAA,EAEF;AAEA,MAAK,aAAc;AAClB,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,kBAAAC,yCAAA,EAA0B,SAAQ,WAClC;AAAA,IAAC;AAAA;AAAA,MACA,SAAU,aAAa,OAAO;AAAA,MAC9B,WAAQ,gBAAI,QAAS;AAAA,MACrB,MAAO;AAAA,MACP,WAAU;AAAA,MACV,iBAAgB;AAAA,MAChB,MAAK;AAAA;AAAA,EACN,GACD;AAEF;AAEA,YAAY,aAAa;AACzB,YAAY,wBAAwB;AAEpC,IAAM,oCAAoC,CAAE,UAAW;AACtD,wBAAAC,SAAY,4CAA4C;AAAA,IACvD,OAAO;AAAA,IACP,aAAa;AAAA,EACd,CAAE;AAEF,SAAO,4CAAC,eAAc,GAAG,OAAQ;AAClC;AAEA,kCAAkC,aAAa,YAAY;AAC3D,kCAAkC,wBACjC,YAAY;AAGb,IAAO,uBAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tSpinner,\n\tNotice,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalInputControlSuffixWrapper as InputControlSuffixWrapper,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useRef, useState, useEffect, useMemo } from '@wordpress/element';\nimport { useInstanceId } from '@wordpress/compose';\nimport { focus } from '@wordpress/dom';\nimport { ENTER } from '@wordpress/keycodes';\nimport { isShallowEqualObjects } from '@wordpress/is-shallow-equal';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { keyboardReturn, linkOff } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport LinkControlSettingsDrawer from './settings-drawer';\nimport LinkControlSearchInput from './search-input';\nimport LinkPreview from './link-preview';\nimport LinkSettings from './settings';\nimport useCreatePage from './use-create-page';\nimport useInternalValue from './use-internal-value';\nimport { ViewerFill } from './viewer-slot';\nimport { DEFAULT_LINK_SETTINGS } from './constants';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Default properties associated with a link control value.\n *\n * @typedef WPLinkControlDefaultValue\n *\n * @property {string} url Link URL.\n * @property {string=} title Link title.\n * @property {boolean=} opensInNewTab Whether link should open in a new browser\n * tab. This value is only assigned if not\n * providing a custom `settings` prop.\n */\n\n/**\n * Custom settings values associated with a link.\n *\n * @typedef {{[setting:string]:any}} WPLinkControlSettingsValue\n */\n\n/**\n * Custom settings values associated with a link.\n *\n * @typedef WPLinkControlSetting\n *\n * @property {string} id Identifier to use as property for setting value.\n * @property {string} title Human-readable label to show in user interface.\n */\n\n/**\n * Properties associated with a link control value, composed as a union of the\n * default properties and any custom settings values.\n *\n * @typedef {WPLinkControlDefaultValue&WPLinkControlSettingsValue} WPLinkControlValue\n */\n\n/** @typedef {(nextValue:WPLinkControlValue)=>void} WPLinkControlOnChangeProp */\n\n/**\n * Properties associated with a search suggestion used within the LinkControl.\n *\n * @typedef WPLinkControlSuggestion\n *\n * @property {string} id Identifier to use to uniquely identify the suggestion.\n * @property {string} type Identifies the type of the suggestion (eg: `post`,\n * `page`, `url`...etc)\n * @property {string} title Human-readable label to show in user interface.\n * @property {string} url A URL for the suggestion.\n */\n\n/** @typedef {(title:string)=>WPLinkControlSuggestion} WPLinkControlCreateSuggestionProp */\n\n/**\n * @typedef WPLinkControlProps\n *\n * @property {(WPLinkControlSetting[])=} settings An array of settings objects. Each object will used to\n * render a `ToggleControl` for that setting.\n * @property {boolean=} forceIsEditingLink If passed as either `true` or `false`, controls the\n * internal editing state of the component to respective\n * show or not show the URL input field.\n * @property {WPLinkControlValue=} value Current link value.\n * @property {WPLinkControlOnChangeProp=} onChange Value change handler, called with the updated value if\n * the user selects a new link or updates settings.\n * @property {boolean=} noDirectEntry Whether to allow turning a URL-like search query directly into a link.\n * @property {boolean=} showSuggestions Whether to present suggestions when typing the URL.\n * @property {boolean=} showInitialSuggestions Whether to present initial suggestions immediately.\n * @property {boolean=} withCreateSuggestion Whether to allow creation of link value from suggestion.\n * @property {Object=} suggestionsQuery Query parameters to pass along to wp.blockEditor.__experimentalFetchLinkSuggestions.\n * @property {boolean=} noURLSuggestion Whether to add a fallback suggestion which treats the search query as a URL.\n * @property {boolean=} hasTextControl Whether to add a text field to the UI to update the value.title.\n * @property {string|Function|undefined} createSuggestionButtonText The text to use in the button that calls createSuggestion.\n * @property {Function} renderControlBottom Optional controls to be rendered at the bottom of the component.\n * @property {boolean=} handleEntities Whether to handle entity links (links with ID). When true and a link has an ID, the input will be disabled and show an unlink button.\n */\n\nconst noop = () => {};\n\nconst PREFERENCE_SCOPE = 'core/block-editor';\nconst PREFERENCE_KEY = 'linkControlSettingsDrawer';\n\n/**\n * Renders a link control. A link control is a controlled input which maintains\n * a value associated with a link (HTML anchor element) and relevant settings\n * for how that link is expected to behave.\n *\n * @param {WPLinkControlProps} props Component props.\n */\nfunction LinkControl( {\n\tsearchInputPlaceholder,\n\tvalue,\n\tsettings = DEFAULT_LINK_SETTINGS,\n\tonChange = noop,\n\tonRemove,\n\tonCancel,\n\tnoDirectEntry = false,\n\tshowSuggestions = true,\n\tshowInitialSuggestions,\n\tforceIsEditingLink,\n\tcreateSuggestion,\n\twithCreateSuggestion,\n\tinputValue: propInputValue = '',\n\tsuggestionsQuery = {},\n\tnoURLSuggestion = false,\n\tcreateSuggestionButtonText,\n\thasRichPreviews = false,\n\thasTextControl = false,\n\trenderControlBottom = null,\n\thandleEntities = false,\n} ) {\n\tif ( withCreateSuggestion === undefined && createSuggestion ) {\n\t\twithCreateSuggestion = true;\n\t}\n\n\tconst [ settingsOpen, setSettingsOpen ] = useState( false );\n\n\tconst { advancedSettingsPreference } = useSelect( ( select ) => {\n\t\tconst prefsStore = select( preferencesStore );\n\n\t\treturn {\n\t\t\tadvancedSettingsPreference:\n\t\t\t\tprefsStore.get( PREFERENCE_SCOPE, PREFERENCE_KEY ) ?? false,\n\t\t};\n\t}, [] );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\t/**\n\t * Sets the open/closed state of the Advanced Settings Drawer,\n\t * optionlly persisting the state to the user's preferences.\n\t *\n\t * Note that Block Editor components can be consumed by non-WordPress\n\t * environments which may not have preferences setup.\n\t * Therefore a local state is also used as a fallback.\n\t *\n\t * @param {boolean} prefVal the open/closed state of the Advanced Settings Drawer.\n\t */\n\tconst setSettingsOpenWithPreference = ( prefVal ) => {\n\t\tif ( setPreference ) {\n\t\t\tsetPreference( PREFERENCE_SCOPE, PREFERENCE_KEY, prefVal );\n\t\t}\n\t\tsetSettingsOpen( prefVal );\n\t};\n\n\t// Block Editor components can be consumed by non-WordPress environments\n\t// which may not have these preferences setup.\n\t// Therefore a local state is used as a fallback.\n\tconst isSettingsOpen = advancedSettingsPreference || settingsOpen;\n\n\tconst isMountingRef = useRef( true );\n\tconst wrapperNode = useRef();\n\tconst textInputRef = useRef();\n\tconst searchInputRef = useRef();\n\t// TODO: Remove entityUrlFallbackRef and previewValue in favor of value prop after taxonomy entity binding\n\t// is stable and returns the correct URL instead of null while resolving when creating the entity.\n\t//\n\t// Preserve the URL from entity suggestions before binding overrides it\n\t// This is due to entity binding not being available immediately after the suggestion is selected.\n\t// The URL can return null, especially for taxonomy entities, while entity binding is being resolved.\n\t// To avoid unnecessary rerenders and focus loss, we preserve the URL from the suggestion and use it\n\t// as a fallback until the entity binding is available.\n\tconst entityUrlFallbackRef = useRef();\n\n\tconst settingsKeys = settings.map( ( { id } ) => id );\n\n\tconst [\n\t\tinternalControlValue,\n\t\tsetInternalControlValue,\n\t\tsetInternalURLInputValue,\n\t\tsetInternalTextInputValue,\n\t\tcreateSetInternalSettingValueHandler,\n\t] = useInternalValue( value );\n\n\t// Compute isEntity internally based on handleEntities prop and presence of ID\n\tconst isEntity = handleEntities && !! internalControlValue?.id;\n\n\t// Generate help text ID for accessibility association\n\tconst baseId = useInstanceId( LinkControl, 'link-control' );\n\tconst helpTextId = isEntity ? `${ baseId }__help` : null;\n\n\tconst valueHasChanges =\n\t\tvalue && ! isShallowEqualObjects( internalControlValue, value );\n\n\tconst [ isEditingLink, setIsEditingLink ] = useState(\n\t\tforceIsEditingLink !== undefined\n\t\t\t? forceIsEditingLink\n\t\t\t: ! value || ! value.url\n\t);\n\n\tconst { createPage, isCreatingPage, errorMessage } =\n\t\tuseCreatePage( createSuggestion );\n\n\tuseEffect( () => {\n\t\tif ( forceIsEditingLink === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsEditingLink( forceIsEditingLink );\n\t}, [ forceIsEditingLink ] );\n\n\tuseEffect( () => {\n\t\t// We don't auto focus into the Link UI on mount\n\t\t// because otherwise using the keyboard to select text\n\t\t// *within* the link format is not possible.\n\t\tif ( isMountingRef.current ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Scenario - when:\n\t\t// - switching between editable and non editable LinkControl\n\t\t// - clicking on a link\n\t\t// ...then move focus to the *first* element to avoid focus loss\n\t\t// and to ensure focus is *within* the Link UI.\n\t\tconst nextFocusTarget =\n\t\t\tfocus.focusable.find( wrapperNode.current )[ 0 ] ||\n\t\t\twrapperNode.current;\n\n\t\tnextFocusTarget.focus();\n\t}, [ isEditingLink, isCreatingPage ] );\n\n\t// The component mounting reference is maintained separately\n\t// to correctly reset values in `StrictMode`.\n\tuseEffect( () => {\n\t\tisMountingRef.current = false;\n\n\t\treturn () => {\n\t\t\tisMountingRef.current = true;\n\t\t};\n\t}, [] );\n\n\tconst hasLinkValue = value?.url?.trim()?.length > 0;\n\n\t/**\n\t * Cancels editing state.\n\t */\n\tconst stopEditing = () => {\n\t\tsetIsEditingLink( false );\n\t};\n\n\tconst handleSelectSuggestion = ( updatedValue ) => {\n\t\t// Preserve the URL for taxonomy entities before binding overrides it\n\t\tif ( updatedValue?.kind === 'taxonomy' && updatedValue?.url ) {\n\t\t\tentityUrlFallbackRef.current = updatedValue.url;\n\t\t}\n\n\t\t// Suggestions may contains \"settings\" values (e.g. `opensInNewTab`)\n\t\t// which should not override any existing settings values set by the\n\t\t// user. This filters out any settings values from the suggestion.\n\t\tconst nonSettingsChanges = Object.keys( updatedValue ).reduce(\n\t\t\t( acc, key ) => {\n\t\t\t\tif ( ! settingsKeys.includes( key ) ) {\n\t\t\t\t\tacc[ key ] = updatedValue[ key ];\n\t\t\t\t}\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\n\t\tonChange( {\n\t\t\t...internalControlValue,\n\t\t\t...nonSettingsChanges,\n\t\t\t// As title is not a setting, it must be manually applied\n\t\t\t// in such a way as to preserve the users changes over\n\t\t\t// any \"title\" value provided by the \"suggestion\".\n\t\t\ttitle: internalControlValue?.title || updatedValue?.title,\n\t\t} );\n\n\t\tstopEditing();\n\t};\n\n\tconst handleSubmit = () => {\n\t\tif ( valueHasChanges ) {\n\t\t\t// Submit the original value with new stored values applied\n\t\t\t// on top. URL is a special case as it may also be a prop.\n\t\t\tonChange( {\n\t\t\t\t...value,\n\t\t\t\t...internalControlValue,\n\t\t\t\turl: currentUrlInputValue,\n\t\t\t} );\n\t\t}\n\t\tstopEditing();\n\t};\n\n\tconst handleSubmitWithEnter = ( event ) => {\n\t\tconst { keyCode } = event;\n\n\t\tif (\n\t\t\tkeyCode === ENTER &&\n\t\t\t! currentInputIsEmpty // Disallow submitting empty values.\n\t\t) {\n\t\t\tevent.preventDefault();\n\t\t\thandleSubmit();\n\t\t}\n\t};\n\n\tconst resetInternalValues = () => {\n\t\tsetInternalControlValue( value );\n\t};\n\n\tconst handleCancel = ( event ) => {\n\t\tevent.preventDefault();\n\t\tevent.stopPropagation();\n\n\t\t// Ensure that any unsubmitted input changes are reset.\n\t\tresetInternalValues();\n\n\t\tif ( hasLinkValue ) {\n\t\t\t// If there is a link then exist editing mode and show preview.\n\t\t\tstopEditing();\n\t\t} else {\n\t\t\t// If there is no link value, then remove the link entirely.\n\t\t\tonRemove?.();\n\t\t}\n\n\t\tonCancel?.();\n\t};\n\n\tconst [ shouldFocusSearchInput, setShouldFocusSearchInput ] =\n\t\tuseState( false );\n\n\tconst handleUnlink = () => {\n\t\t// Clear the internal state to remove the ID and re-enable the field\n\t\t// Explicitly set id, kind, and type to undefined so they override\n\t\t// the original values when spread in handleSubmit. This ensures that\n\t\t// when the user types a custom URL and submits, the entity link is\n\t\t// properly severed (not just when selecting a different entity from suggestions).\n\t\tconst { id, kind, type, ...restValue } = internalControlValue;\n\t\tsetInternalControlValue( {\n\t\t\t...restValue,\n\t\t\tid: undefined,\n\t\t\tkind: undefined,\n\t\t\ttype: undefined,\n\t\t\turl: undefined,\n\t\t} );\n\n\t\t// Request focus after the component re-renders with the cleared state\n\t\t// We can't focus immediately because the input might still be disabled\n\t\tsetShouldFocusSearchInput( true );\n\t};\n\n\t// Focus the search input when requested, once the component has re-rendered\n\t// This ensures the input is enabled and ready to receive focus\n\tuseEffect( () => {\n\t\tif ( shouldFocusSearchInput ) {\n\t\t\tsearchInputRef.current?.focus();\n\t\t\tsetShouldFocusSearchInput( false );\n\t\t}\n\t}, [ shouldFocusSearchInput ] );\n\n\tconst currentUrlInputValue =\n\t\tpropInputValue || internalControlValue?.url || '';\n\n\tconst currentInputIsEmpty = ! currentUrlInputValue?.trim()?.length;\n\n\tconst shownUnlinkControl =\n\t\tonRemove && value && ! isEditingLink && ! isCreatingPage;\n\n\tconst showActions = isEditingLink && hasLinkValue;\n\n\t// Only show text control once a URL value has been committed\n\t// and it isn't just empty whitespace.\n\t// See https://github.com/WordPress/gutenberg/pull/33849/#issuecomment-932194927.\n\tconst showTextControl = hasLinkValue && hasTextControl;\n\n\tconst isEditing = ( isEditingLink || ! value ) && ! isCreatingPage;\n\tconst isDisabled = ! valueHasChanges || currentInputIsEmpty;\n\tconst showSettings = !! settings?.length && isEditingLink && hasLinkValue;\n\n\tconst previewValue = useMemo( () => {\n\t\t// There is a chance that the value is not yet set from the entity binding, so we use the preserved URL.\n\t\tif (\n\t\t\tvalue?.kind === 'taxonomy' &&\n\t\t\t! value?.url &&\n\t\t\tentityUrlFallbackRef.current\n\t\t) {\n\t\t\t// combine the value prop with the preserved URL from the suggestion\n\t\t\treturn {\n\t\t\t\t...value,\n\t\t\t\turl: entityUrlFallbackRef.current,\n\t\t\t};\n\t\t}\n\n\t\t// If we don't have a fallback URL, use the value prop.\n\t\treturn value;\n\t}, [ value ] );\n\n\treturn (\n\t\t<div\n\t\t\ttabIndex={ -1 }\n\t\t\tref={ wrapperNode }\n\t\t\tclassName=\"block-editor-link-control\"\n\t\t>\n\t\t\t{ isCreatingPage && (\n\t\t\t\t<div className=\"block-editor-link-control__loading\">\n\t\t\t\t\t<Spinner /> { __( 'Creating' ) }\u2026\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ isEditing && (\n\t\t\t\t<>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx( {\n\t\t\t\t\t\t\t'block-editor-link-control__search-input-wrapper': true,\n\t\t\t\t\t\t\t'has-text-control': showTextControl,\n\t\t\t\t\t\t\t'has-actions': showActions,\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ showTextControl && (\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tref={ textInputRef }\n\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__field block-editor-link-control__text-content\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Text' ) }\n\t\t\t\t\t\t\t\tvalue={ internalControlValue?.title }\n\t\t\t\t\t\t\t\tonChange={ setInternalTextInputValue }\n\t\t\t\t\t\t\t\tonKeyDown={ handleSubmitWithEnter }\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<LinkControlSearchInput\n\t\t\t\t\t\t\tref={ searchInputRef }\n\t\t\t\t\t\t\tcurrentLink={ value }\n\t\t\t\t\t\t\tclassName=\"block-editor-link-control__field block-editor-link-control__search-input\"\n\t\t\t\t\t\t\tplaceholder={ searchInputPlaceholder }\n\t\t\t\t\t\t\tvalue={ currentUrlInputValue }\n\t\t\t\t\t\t\twithCreateSuggestion={ withCreateSuggestion }\n\t\t\t\t\t\t\tonCreateSuggestion={ createPage }\n\t\t\t\t\t\t\tonChange={ setInternalURLInputValue }\n\t\t\t\t\t\t\tonSelect={ handleSelectSuggestion }\n\t\t\t\t\t\t\tshowInitialSuggestions={ showInitialSuggestions }\n\t\t\t\t\t\t\tallowDirectEntry={ ! noDirectEntry }\n\t\t\t\t\t\t\tshowSuggestions={ showSuggestions }\n\t\t\t\t\t\t\tsuggestionsQuery={ suggestionsQuery }\n\t\t\t\t\t\t\twithURLSuggestion={ ! noURLSuggestion }\n\t\t\t\t\t\t\tcreateSuggestionButtonText={\n\t\t\t\t\t\t\t\tcreateSuggestionButtonText\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thideLabelFromVision={ ! showTextControl }\n\t\t\t\t\t\t\tisEntity={ isEntity }\n\t\t\t\t\t\t\tsuffix={\n\t\t\t\t\t\t\t\t<SearchSuffixControl\n\t\t\t\t\t\t\t\t\tisEntity={ isEntity }\n\t\t\t\t\t\t\t\t\tshowActions={ showActions }\n\t\t\t\t\t\t\t\t\tisDisabled={ isDisabled }\n\t\t\t\t\t\t\t\t\tonUnlink={ handleUnlink }\n\t\t\t\t\t\t\t\t\tonSubmit={ handleSubmit }\n\t\t\t\t\t\t\t\t\thelpTextId={ helpTextId }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ isEntity && helpTextId && (\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tid={ helpTextId }\n\t\t\t\t\t\t\t\tclassName=\"block-editor-link-control__help\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: %s: entity type (e.g., page, post) */\n\t\t\t\t\t\t\t\t\t__( 'Synced with the selected %s.' ),\n\t\t\t\t\t\t\t\t\tinternalControlValue?.type || 'item'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t\t{ errorMessage && (\n\t\t\t\t\t\t<Notice\n\t\t\t\t\t\t\tclassName=\"block-editor-link-control__search-error\"\n\t\t\t\t\t\t\tstatus=\"error\"\n\t\t\t\t\t\t\tisDismissible={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ errorMessage }\n\t\t\t\t\t\t</Notice>\n\t\t\t\t\t) }\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t{ value && ! isEditingLink && ! isCreatingPage && (\n\t\t\t\t<LinkPreview\n\t\t\t\t\tkey={ previewValue?.url } // force remount when URL changes to avoid race conditions for rich previews\n\t\t\t\t\tvalue={ previewValue }\n\t\t\t\t\tonEditClick={ () => setIsEditingLink( true ) }\n\t\t\t\t\thasRichPreviews={ hasRichPreviews }\n\t\t\t\t\thasUnlinkControl={ shownUnlinkControl }\n\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\tonRemove();\n\t\t\t\t\t\tsetIsEditingLink( true );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) }\n\n\t\t\t{ showSettings && (\n\t\t\t\t<div className=\"block-editor-link-control__tools\">\n\t\t\t\t\t{ ! currentInputIsEmpty && (\n\t\t\t\t\t\t<LinkControlSettingsDrawer\n\t\t\t\t\t\t\tsettingsOpen={ isSettingsOpen }\n\t\t\t\t\t\t\tsetSettingsOpen={ setSettingsOpenWithPreference }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LinkSettings\n\t\t\t\t\t\t\t\tvalue={ internalControlValue }\n\t\t\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t\t\t\tonChange={ createSetInternalSettingValueHandler(\n\t\t\t\t\t\t\t\t\tsettingsKeys\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</LinkControlSettingsDrawer>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t{ showActions && (\n\t\t\t\t<HStack\n\t\t\t\t\tjustify=\"right\"\n\t\t\t\t\tclassName=\"block-editor-link-control__search-actions\"\n\t\t\t\t>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ handleCancel }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ isDisabled ? noop : handleSubmit }\n\t\t\t\t\t\tclassName=\"block-editor-link-control__search-submit\"\n\t\t\t\t\t\taria-disabled={ isDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Apply' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t) }\n\n\t\t\t{ ! isCreatingPage && renderControlBottom && renderControlBottom() }\n\t\t</div>\n\t);\n}\n\n/**\n * Suffix control component for LinkControl search input.\n * Handles the display of unlink button for entities and submit button for regular links.\n *\n * @param {Object} props - Component props\n * @param {boolean} props.isEntity - Whether the link is bound to an entity\n * @param {boolean} props.showActions - Whether to show action buttons\n * @param {boolean} props.isDisabled - Whether the submit button should be disabled\n * @param {Function} props.onUnlink - Callback when unlink button is clicked\n * @param {Function} props.onSubmit - Callback when submit button is clicked\n * @param {string} props.helpTextId - ID of the help text element for accessibility\n */\nfunction SearchSuffixControl( {\n\tisEntity,\n\tshowActions,\n\tisDisabled,\n\tonUnlink,\n\tonSubmit,\n\thelpTextId,\n} ) {\n\tif ( isEntity ) {\n\t\treturn (\n\t\t\t<Button\n\t\t\t\ticon={ linkOff }\n\t\t\t\tonClick={ onUnlink }\n\t\t\t\taria-describedby={ helpTextId }\n\t\t\t\tshowTooltip\n\t\t\t\tlabel={ __( 'Unsync and edit' ) }\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( showActions ) {\n\t\treturn undefined;\n\t}\n\n\treturn (\n\t\t<InputControlSuffixWrapper variant=\"control\">\n\t\t\t<Button\n\t\t\t\tonClick={ isDisabled ? noop : onSubmit }\n\t\t\t\tlabel={ __( 'Submit' ) }\n\t\t\t\ticon={ keyboardReturn }\n\t\t\t\tclassName=\"block-editor-link-control__search-submit\"\n\t\t\t\taria-disabled={ isDisabled }\n\t\t\t\tsize=\"small\"\n\t\t\t/>\n\t\t</InputControlSuffixWrapper>\n\t);\n}\n\nLinkControl.ViewerFill = ViewerFill;\nLinkControl.DEFAULT_LINK_SETTINGS = DEFAULT_LINK_SETTINGS;\n\nconst DeprecatedExperimentalLinkControl = ( props ) => {\n\tdeprecated( 'wp.blockEditor.__experimentalLinkControl', {\n\t\tsince: '6.8',\n\t\talternative: 'wp.blockEditor.LinkControl',\n\t} );\n\n\treturn <LinkControl { ...props } />;\n};\n\nDeprecatedExperimentalLinkControl.ViewerFill = LinkControl.ViewerFill;\nDeprecatedExperimentalLinkControl.DEFAULT_LINK_SETTINGS =\n\tLinkControl.DEFAULT_LINK_SETTINGS;\n\nexport { DeprecatedExperimentalLinkControl };\nexport default LinkControl;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,wBAOO;AACP,kBAA4B;AAC5B,qBAAqD;AACrD,qBAA8B;AAC9B,iBAAsB;AACtB,sBAAsB;AACtB,8BAAsC;AACtC,kBAAuC;AACvC,yBAA0C;AAC1C,mBAAwC;AAKxC,6BAAsC;AACtC,0BAAmC;AACnC,0BAAwB;AACxB,sBAAyB;AACzB,6BAA0B;AAC1B,gCAA6B;AAC7B,yBAA2B;AAC3B,uBAAsC;AACtC,wBAAuB;AAwYnB;AA7TJ,IAAM,OAAO,MAAM;AAAC;AAEpB,IAAM,mBAAmB;AACzB,IAAM,iBAAiB;AASvB,SAAS,YAAa;AAAA,EACrB;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY,iBAAiB;AAAA,EAC7B,mBAAmB,CAAC;AAAA,EACpB,kBAAkB;AAAA,EAClB;AAAA,EACA,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,iBAAiB;AAClB,GAAI;AACH,MAAK,yBAAyB,UAAa,kBAAmB;AAC7D,2BAAuB;AAAA,EACxB;AAEA,QAAM,CAAE,cAAc,eAAgB,QAAI,yBAAU,KAAM;AAE1D,QAAM,EAAE,2BAA2B,QAAI,uBAAW,CAAE,WAAY;AAC/D,UAAM,aAAa,OAAQ,mBAAAA,KAAiB;AAE5C,WAAO;AAAA,MACN,4BACC,WAAW,IAAK,kBAAkB,cAAe,KAAK;AAAA,IACxD;A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AA,QACP,SAAU;AAAA,QACV,oBAAmB;AAAA,QACnB,aAAW;AAAA,QACX,WAAQ,gBAAI,iBAAkB;AAAA,QAC9B,uBAAqB;AAAA;AAAA,IACtB;AAAA,EAEF;AAEA,MAAK,aAAc;AAClB,WAAO;AAAA,EACR;AAEA,SACC,4CAAC,kBAAAC,yCAAA,EAA0B,SAAQ,WAClC;AAAA,IAAC;AAAA;AAAA,MACA,SAAU,aAAa,OAAO;AAAA,MAC9B,WAAQ,gBAAI,QAAS;AAAA,MACrB,MAAO;AAAA,MACP,WAAU;AAAA,MACV,iBAAgB;AAAA,MAChB,MAAK;AAAA;AAAA,EACN,GACD;AAEF;AAEA,YAAY,aAAa;AACzB,YAAY,wBAAwB;AAEpC,IAAM,oCAAoC,CAAE,UAAW;AACtD,wBAAAC,SAAY,4CAA4C;AAAA,IACvD,OAAO;AAAA,IACP,aAAa;AAAA,EACd,CAAE;AAEF,SAAO,4CAAC,eAAc,GAAG,OAAQ;AAClC;AAEA,kCAAkC,aAAa,YAAY;AAC3D,kCAAkC,wBACjC,YAAY;AAGb,IAAO,uBAAQ;",
6
6
  "names": ["preferencesStore", "useInternalValue", "useCreatePage", "clsx", "LinkControlSearchInput", "LinkPreview", "LinkControlSettingsDrawer", "LinkSettings", "HStack", "InputControlSuffixWrapper", "deprecated"]
7
7
  }
@@ -71,27 +71,26 @@ function ListViewBlockSelectButton({
71
71
  context: "list-view"
72
72
  });
73
73
  const { isLocked } = (0, import_block_lock.useBlockLock)(clientId);
74
- const { canToggleBlockVisibility, isBlockHidden, isContentOnly } = (0, import_data.useSelect)(
74
+ const { canToggleBlockVisibility, isBlockHidden, hasPatternName } = (0, import_data.useSelect)(
75
75
  (select) => {
76
- const { getBlockName } = select(import_store.store);
76
+ const { getBlockName, getBlockAttributes } = select(import_store.store);
77
77
  const { isBlockHidden: _isBlockHidden } = (0, import_lock_unlock.unlock)(
78
78
  select(import_store.store)
79
79
  );
80
+ const blockAttributes = getBlockAttributes(clientId);
80
81
  return {
81
82
  canToggleBlockVisibility: (0, import_blocks.hasBlockSupport)(
82
83
  getBlockName(clientId),
83
- "blockVisibility",
84
+ "visibility",
84
85
  true
85
86
  ),
86
87
  isBlockHidden: _isBlockHidden(clientId),
87
- isContentOnly: select(import_store.store).getBlockEditingMode(
88
- clientId
89
- ) === "contentOnly"
88
+ hasPatternName: !!blockAttributes?.metadata?.patternName
90
89
  };
91
90
  },
92
91
  [clientId]
93
92
  );
94
- const shouldShowLockIcon = isLocked && !isContentOnly;
93
+ const shouldShowLockIcon = isLocked;
95
94
  const shouldShowBlockVisibilityIcon = canToggleBlockVisibility && isBlockHidden;
96
95
  const isSticky = blockInformation?.positionType === "sticky";
97
96
  const images = (0, import_use_list_view_images.default)({ clientId, isExpanded });
@@ -129,7 +128,7 @@ function ListViewBlockSelectButton({
129
128
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
130
129
  import_block_icon.default,
131
130
  {
132
- icon: blockInformation?.icon,
131
+ icon: hasPatternName ? import_icons.symbol : blockInformation?.icon,
133
132
  showColors: true,
134
133
  context: "list-view"
135
134
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/list-view/block-select-button.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\nimport { Icon, lockSmall as lock, pinSmall, unseen } from '@wordpress/icons';\nimport { SPACE, ENTER } from '@wordpress/keycodes';\nimport { useSelect } from '@wordpress/data';\nimport { hasBlockSupport } from '@wordpress/blocks';\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 useListViewImages from './use-list-view-images';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { Badge } = unlock( componentsPrivateApis );\n\nfunction ListViewBlockSelectButton(\n\t{\n\t\tclassName,\n\t\tblock: { clientId },\n\t\tonClick,\n\t\tonContextMenu,\n\t\tonMouseDown,\n\t\tonToggleExpanded,\n\t\ttabIndex,\n\t\tonFocus,\n\t\tonDragStart,\n\t\tonDragEnd,\n\t\tdraggable,\n\t\tisExpanded,\n\t\tariaDescribedBy,\n\t},\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 { canToggleBlockVisibility, isBlockHidden, isContentOnly } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getBlockName } = select( blockEditorStore );\n\t\t\t\tconst { isBlockHidden: _isBlockHidden } = unlock(\n\t\t\t\t\tselect( blockEditorStore )\n\t\t\t\t);\n\t\t\t\treturn {\n\t\t\t\t\tcanToggleBlockVisibility: hasBlockSupport(\n\t\t\t\t\t\tgetBlockName( clientId ),\n\t\t\t\t\t\t'blockVisibility',\n\t\t\t\t\t\ttrue\n\t\t\t\t\t),\n\t\t\t\t\tisBlockHidden: _isBlockHidden( clientId ),\n\t\t\t\t\tisContentOnly:\n\t\t\t\t\t\tselect( blockEditorStore ).getBlockEditingMode(\n\t\t\t\t\t\t\tclientId\n\t\t\t\t\t\t) === 'contentOnly',\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientId ]\n\t\t);\n\tconst shouldShowLockIcon = isLocked && ! isContentOnly;\n\tconst shouldShowBlockVisibilityIcon =\n\t\tcanToggleBlockVisibility && isBlockHidden;\n\tconst isSticky = blockInformation?.positionType === 'sticky';\n\tconst images = useListViewImages( { clientId, isExpanded } );\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 onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER || event.keyCode === SPACE ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\treturn (\n\t\t<a\n\t\t\tclassName={ clsx(\n\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tonClick={ onClick }\n\t\t\tonContextMenu={ onContextMenu }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t\tonMouseDown={ onMouseDown }\n\t\t\tref={ ref }\n\t\t\ttabIndex={ tabIndex }\n\t\t\tonFocus={ onFocus }\n\t\t\tonDragStart={ onDragStartHandler }\n\t\t\tonDragEnd={ onDragEnd }\n\t\t\tdraggable={ draggable }\n\t\t\thref={ `#block-${ clientId }` }\n\t\t\taria-describedby={ ariaDescribedBy }\n\t\t\taria-expanded={ isExpanded }\n\t\t>\n\t\t\t<ListViewExpander onClick={ onToggleExpanded } />\n\t\t\t<BlockIcon\n\t\t\t\ticon={ blockInformation?.icon }\n\t\t\t\tshowColors\n\t\t\t\tcontext=\"list-view\"\n\t\t\t/>\n\t\t\t<HStack\n\t\t\t\talignment=\"center\"\n\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tspacing={ 1 }\n\t\t\t>\n\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">{ blockTitle }</Truncate>\n\t\t\t\t</span>\n\t\t\t\t{ blockInformation?.anchor && (\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__anchor-wrapper\">\n\t\t\t\t\t\t<Badge className=\"block-editor-list-view-block-select-button__anchor\">\n\t\t\t\t\t\t\t{ blockInformation.anchor }\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t{ isSticky && (\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__sticky\">\n\t\t\t\t\t\t<Icon icon={ pinSmall } />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t{ images.length ? (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__images\"\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t{ images.map( ( image, index ) => (\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__image\"\n\t\t\t\t\t\t\t\tkey={ image.clientId }\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tbackgroundImage: `url(${ image.url })`,\n\t\t\t\t\t\t\t\t\tzIndex: images.length - index, // Ensure the first image is on top, and subsequent images are behind.\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</span>\n\t\t\t\t) : null }\n\t\t\t\t{ shouldShowBlockVisibilityIcon && (\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__block-visibility\">\n\t\t\t\t\t\t<Icon icon={ unseen } />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t{ shouldShowLockIcon && (\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__lock\">\n\t\t\t\t\t\t<Icon icon={ lock } />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</a>\n\t);\n}\n\nexport default forwardRef( ListViewBlockSelectButton );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;A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AAAA,wBACP,iBAAiB,OAAQ,MAAM,GAAI;AAAA,wBACnC,QAAQ,OAAO,SAAS;AAAA;AAAA,sBACzB;AAAA;AAAA,oBAJM,MAAM;AAAA,kBAKb,CACC;AAAA;AAAA,cACH,IACG;AAAA,cACF,iCACD,4CAAC,UAAK,WAAU,gEACf,sDAAC,qBAAK,MAAO,qBAAS,GACvB;AAAA,cAEC,sBACD,4CAAC,UAAK,WAAU,oDACf,sDAAC,qBAAK,MAAO,aAAAC,WAAO,GACrB;AAAA;AAAA;AAAA,QAEF;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,kCAAQ,2BAAY,yBAA0B;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalTruncate as Truncate,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { forwardRef } from '@wordpress/element';\nimport {\n\tIcon,\n\tlockSmall as lock,\n\tpinSmall,\n\tunseen,\n\tsymbol,\n} from '@wordpress/icons';\nimport { SPACE, ENTER } from '@wordpress/keycodes';\nimport { useSelect } from '@wordpress/data';\nimport { hasBlockSupport } from '@wordpress/blocks';\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 useListViewImages from './use-list-view-images';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { Badge } = unlock( componentsPrivateApis );\n\nfunction ListViewBlockSelectButton(\n\t{\n\t\tclassName,\n\t\tblock: { clientId },\n\t\tonClick,\n\t\tonContextMenu,\n\t\tonMouseDown,\n\t\tonToggleExpanded,\n\t\ttabIndex,\n\t\tonFocus,\n\t\tonDragStart,\n\t\tonDragEnd,\n\t\tdraggable,\n\t\tisExpanded,\n\t\tariaDescribedBy,\n\t},\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 { canToggleBlockVisibility, isBlockHidden, hasPatternName } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getBlockName, getBlockAttributes } =\n\t\t\t\t\tselect( blockEditorStore );\n\t\t\t\tconst { isBlockHidden: _isBlockHidden } = unlock(\n\t\t\t\t\tselect( blockEditorStore )\n\t\t\t\t);\n\t\t\t\tconst blockAttributes = getBlockAttributes( clientId );\n\t\t\t\treturn {\n\t\t\t\t\tcanToggleBlockVisibility: hasBlockSupport(\n\t\t\t\t\t\tgetBlockName( clientId ),\n\t\t\t\t\t\t'visibility',\n\t\t\t\t\t\ttrue\n\t\t\t\t\t),\n\t\t\t\t\tisBlockHidden: _isBlockHidden( clientId ),\n\t\t\t\t\thasPatternName: !! blockAttributes?.metadata?.patternName,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientId ]\n\t\t);\n\tconst shouldShowLockIcon = isLocked;\n\tconst shouldShowBlockVisibilityIcon =\n\t\tcanToggleBlockVisibility && isBlockHidden;\n\tconst isSticky = blockInformation?.positionType === 'sticky';\n\tconst images = useListViewImages( { clientId, isExpanded } );\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 onKeyDown( event ) {\n\t\tif ( event.keyCode === ENTER || event.keyCode === SPACE ) {\n\t\t\tonClick( event );\n\t\t}\n\t}\n\n\treturn (\n\t\t<a\n\t\t\tclassName={ clsx(\n\t\t\t\t'block-editor-list-view-block-select-button',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\tonClick={ onClick }\n\t\t\tonContextMenu={ onContextMenu }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t\tonMouseDown={ onMouseDown }\n\t\t\tref={ ref }\n\t\t\ttabIndex={ tabIndex }\n\t\t\tonFocus={ onFocus }\n\t\t\tonDragStart={ onDragStartHandler }\n\t\t\tonDragEnd={ onDragEnd }\n\t\t\tdraggable={ draggable }\n\t\t\thref={ `#block-${ clientId }` }\n\t\t\taria-describedby={ ariaDescribedBy }\n\t\t\taria-expanded={ isExpanded }\n\t\t>\n\t\t\t<ListViewExpander onClick={ onToggleExpanded } />\n\t\t\t<BlockIcon\n\t\t\t\ticon={ hasPatternName ? symbol : blockInformation?.icon }\n\t\t\t\tshowColors\n\t\t\t\tcontext=\"list-view\"\n\t\t\t/>\n\t\t\t<HStack\n\t\t\t\talignment=\"center\"\n\t\t\t\tclassName=\"block-editor-list-view-block-select-button__label-wrapper\"\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t\tspacing={ 1 }\n\t\t\t>\n\t\t\t\t<span className=\"block-editor-list-view-block-select-button__title\">\n\t\t\t\t\t<Truncate ellipsizeMode=\"auto\">{ blockTitle }</Truncate>\n\t\t\t\t</span>\n\t\t\t\t{ blockInformation?.anchor && (\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__anchor-wrapper\">\n\t\t\t\t\t\t<Badge className=\"block-editor-list-view-block-select-button__anchor\">\n\t\t\t\t\t\t\t{ blockInformation.anchor }\n\t\t\t\t\t\t</Badge>\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t{ isSticky && (\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__sticky\">\n\t\t\t\t\t\t<Icon icon={ pinSmall } />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t{ images.length ? (\n\t\t\t\t\t<span\n\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__images\"\n\t\t\t\t\t\taria-hidden\n\t\t\t\t\t>\n\t\t\t\t\t\t{ images.map( ( image, index ) => (\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__image\"\n\t\t\t\t\t\t\t\tkey={ image.clientId }\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tbackgroundImage: `url(${ image.url })`,\n\t\t\t\t\t\t\t\t\tzIndex: images.length - index, // Ensure the first image is on top, and subsequent images are behind.\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t</span>\n\t\t\t\t) : null }\n\t\t\t\t{ shouldShowBlockVisibilityIcon && (\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__block-visibility\">\n\t\t\t\t\t\t<Icon icon={ unseen } />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t{ shouldShowLockIcon && (\n\t\t\t\t\t<span className=\"block-editor-list-view-block-select-button__lock\">\n\t\t\t\t\t\t<Icon icon={ lock } />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</a>\n\t);\n}\n\nexport default forwardRef( ListViewBlockSelectButton );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,wBAIO;AACP,qBAA2B;AAC3B,mBAMO;AACP,sBAA6B;AAC7B,kBAA0B;AAC1B,oBAAgC;AAKhC,wBAAsB;AACtB,2CAAuC;AACvC,qCAAiC;AACjC,sBAA6B;AAC7B,wBAA6B;AAC7B,kCAA8B;AAC9B,mBAA0C;AAC1C,yBAAuB;AA6FpB;AA3FH,IAAM,EAAE,MAAM,QAAI,2BAAQ,kBAAAA,WAAsB;AAEhD,SAAS,0BACR;AAAA,EACC;AAAA,EACA,OAAO,EAAE,SAA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O,GACrB;AAAA;AAAA;AAAA,QAEF;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,kCAAQ,2BAAY,yBAA0B;",
6
6
  "names": ["componentsPrivateApis", "useBlockDisplayInformation", "useBlockDisplayTitle", "blockEditorStore", "useListViewImages", "clsx", "ListViewExpander", "BlockIcon", "HStack", "Truncate", "lock"]
7
7
  }
@@ -83,7 +83,7 @@ function ListViewBlock({
83
83
  const settingsRef = (0, import_element.useRef)(null);
84
84
  const [isHovered, setIsHovered] = (0, import_element.useState)(false);
85
85
  const [settingsAnchorRect, setSettingsAnchorRect] = (0, import_element.useState)();
86
- const { isLocked, canEdit, canMove } = (0, import_block_lock.useBlockLock)(clientId);
86
+ const { isLocked } = (0, import_block_lock.useBlockLock)(clientId);
87
87
  const isFirstSelectedBlock = isSelected && selectedClientIds[0] === clientId;
88
88
  const isLastSelectedBlock = isSelected && selectedClientIds[selectedClientIds.length - 1] === clientId;
89
89
  const {
@@ -109,6 +109,8 @@ function ListViewBlock({
109
109
  getBlockOrder,
110
110
  getBlockParents,
111
111
  getBlocksByClientId,
112
+ canEditBlock,
113
+ canMoveBlock,
112
114
  canRemoveBlocks,
113
115
  isGroupable
114
116
  } = (0, import_data.useSelect)(import_store.store);
@@ -281,10 +283,10 @@ function ListViewBlock({
281
283
  event.preventDefault();
282
284
  const { blocksToUpdate } = getBlocksToUpdate();
283
285
  const blocks = getBlocksByClientId(blocksToUpdate);
284
- const canToggleBlockVisibility = blocks.every(
285
- (blockToUpdate) => (0, import_blocks.hasBlockSupport)(blockToUpdate.name, "blockVisibility", true)
286
+ const canToggleVisibility = blocks.every(
287
+ (blockToUpdate) => (0, import_blocks.hasBlockSupport)(blockToUpdate.name, "visibility", true)
286
288
  );
287
- if (!canToggleBlockVisibility) {
289
+ if (!canToggleVisibility) {
288
290
  return;
289
291
  }
290
292
  const hasHiddenBlock = blocks.some(
@@ -420,7 +422,7 @@ function ListViewBlock({
420
422
  "is-dragging": isDragged,
421
423
  "has-single-cell": !showBlockActions,
422
424
  "is-synced": blockInformation?.isSynced,
423
- "is-draggable": canMove,
425
+ "is-draggable": canMoveBlock,
424
426
  "is-displacement-normal": displacement === "normal",
425
427
  "is-displacement-up": displacement === "up",
426
428
  "is-displacement-down": displacement === "down",
@@ -445,7 +447,7 @@ function ListViewBlock({
445
447
  path,
446
448
  id: `list-view-${listViewInstanceId}-block-${clientId}`,
447
449
  "data-block": clientId,
448
- "data-expanded": canEdit ? isExpanded : void 0,
450
+ "data-expanded": canEditBlock ? isExpanded : void 0,
449
451
  ref: rowRef,
450
452
  children: [
451
453
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -471,7 +473,7 @@ function ListViewBlock({
471
473
  ref,
472
474
  tabIndex: currentlyEditingBlockInCanvas ? 0 : tabIndex,
473
475
  onFocus,
474
- isExpanded: canEdit ? isExpanded : void 0,
476
+ isExpanded: canEditBlock ? isExpanded : void 0,
475
477
  selectedClientIds,
476
478
  ariaDescribedBy: descriptionId
477
479
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/list-view/block.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\thasBlockSupport,\n\tswitchToBlockType,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport {\n\t__experimentalTreeGridCell as TreeGridCell,\n\t__experimentalTreeGridItem as TreeGridItem,\n} from '@wordpress/components';\nimport { useInstanceId, useDebounce } from '@wordpress/compose';\nimport { moreVertical } from '@wordpress/icons';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseState,\n\tuseRef,\n\tmemo,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\nimport { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport ListViewLeaf from './leaf';\nimport useListViewScrollIntoView from './use-list-view-scroll-into-view';\nimport {\n\tBlockMoverUpButton,\n\tBlockMoverDownButton,\n} from '../block-mover/button';\nimport ListViewBlockContents from './block-contents';\nimport { useListViewContext } from './context';\nimport {\n\tgetBlockPositionDescription,\n\tgetBlockPropertiesDescription,\n\tfocusListItem,\n} from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { useBlockLock } from '../block-lock';\nimport AriaReferencedText from './aria-referenced-text';\nimport { unlock } from '../../lock-unlock';\nimport usePasteStyles from '../use-paste-styles';\nimport { cleanEmptyObject } from '../../hooks/utils';\n\nfunction ListViewBlock( {\n\tblock: { clientId },\n\tdisplacement,\n\tisAfterDraggedBlocks,\n\tisDragged,\n\tisNesting,\n\tisSelected,\n\tisBranchSelected,\n\tselectBlock,\n\tposition,\n\tlevel,\n\trowCount,\n\tsiblingBlockCount,\n\tshowBlockMovers,\n\tpath,\n\tisExpanded,\n\tselectedClientIds,\n\tisSyncedBranch,\n} ) {\n\tconst cellRef = useRef( null );\n\tconst rowRef = useRef( null );\n\tconst settingsRef = useRef( null );\n\tconst [ isHovered, setIsHovered ] = useState( false );\n\tconst [ settingsAnchorRect, setSettingsAnchorRect ] = useState();\n\n\tconst { isLocked, canEdit, canMove } = useBlockLock( clientId );\n\n\tconst isFirstSelectedBlock =\n\t\tisSelected && selectedClientIds[ 0 ] === clientId;\n\tconst isLastSelectedBlock =\n\t\tisSelected &&\n\t\tselectedClientIds[ selectedClientIds.length - 1 ] === clientId;\n\n\tconst {\n\t\ttoggleBlockHighlight,\n\t\tduplicateBlocks,\n\t\tmultiSelect,\n\t\treplaceBlocks,\n\t\tremoveBlocks,\n\t\tinsertAfterBlock,\n\t\tinsertBeforeBlock,\n\t\tsetOpenedBlockSettingsMenu,\n\t\tupdateBlockAttributes,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\tconst debouncedToggleBlockHighlight = useDebounce(\n\t\ttoggleBlockHighlight,\n\t\t50\n\t);\n\n\tconst {\n\t\tcanInsertBlockType,\n\t\tgetSelectedBlockClientIds,\n\t\tgetPreviousBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlockOrder,\n\t\tgetBlockParents,\n\t\tgetBlocksByClientId,\n\t\tcanRemoveBlocks,\n\t\tisGroupable,\n\t} = useSelect( blockEditorStore );\n\tconst { getGroupingBlockName } = useSelect( blocksStore );\n\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\n\tconst pasteStyles = usePasteStyles();\n\n\tconst { block, blockName, allowRightClickOverrides, isBlockHidden } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getBlock, getBlockName, getSettings } =\n\t\t\t\t\tselect( blockEditorStore );\n\t\t\t\tconst { isBlockHidden: _isBlockHidden } = unlock(\n\t\t\t\t\tselect( blockEditorStore )\n\t\t\t\t);\n\n\t\t\t\treturn {\n\t\t\t\t\tblock: getBlock( clientId ),\n\t\t\t\t\tblockName: getBlockName( clientId ),\n\t\t\t\t\tallowRightClickOverrides:\n\t\t\t\t\t\tgetSettings().allowRightClickOverrides,\n\t\t\t\t\tisBlockHidden: _isBlockHidden( clientId ),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientId ]\n\t\t);\n\n\tconst showBlockActions =\n\t\t// When a block hides its toolbar it also hides the block settings menu,\n\t\t// since that menu is part of the toolbar in the editor canvas.\n\t\t// List View respects this by also hiding the block settings menu.\n\t\thasBlockSupport( blockName, '__experimentalToolbar', true );\n\tconst instanceId = useInstanceId( ListViewBlock );\n\tconst descriptionId = `list-view-block-select-button__description-${ instanceId }`;\n\n\tconst {\n\t\texpand,\n\t\tcollapse,\n\t\tcollapseAll,\n\t\tBlockSettingsMenu,\n\t\tlistViewInstanceId,\n\t\texpandedState,\n\t\tsetInsertedBlock,\n\t\ttreeGridElementRef,\n\t\trootClientId,\n\t} = useListViewContext();\n\tconst isMatch = useShortcutEventMatch();\n\n\t// Determine which blocks to update:\n\t// If the current (focused) block is part of the block selection, use the whole selection.\n\t// If the focused block is not part of the block selection, only update the focused block.\n\tfunction getBlocksToUpdate() {\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst isUpdatingSelectedBlocks =\n\t\t\tselectedBlockClientIds.includes( clientId );\n\t\tconst firstBlockClientId = isUpdatingSelectedBlocks\n\t\t\t? selectedBlockClientIds[ 0 ]\n\t\t\t: clientId;\n\t\tconst firstBlockRootClientId =\n\t\t\tgetBlockRootClientId( firstBlockClientId );\n\n\t\tconst blocksToUpdate = isUpdatingSelectedBlocks\n\t\t\t? selectedBlockClientIds\n\t\t\t: [ clientId ];\n\n\t\treturn {\n\t\t\tblocksToUpdate,\n\t\t\tfirstBlockClientId,\n\t\t\tfirstBlockRootClientId,\n\t\t\tselectedBlockClientIds,\n\t\t};\n\t}\n\n\t/**\n\t * @param {KeyboardEvent} event\n\t */\n\tasync function onKeyDown( event ) {\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Do not handle events if it comes from modals;\n\t\t// retain the default behavior for these keys.\n\t\tif ( event.target.closest( '[role=dialog]' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isDeleteKey = [ BACKSPACE, DELETE ].includes( event.keyCode );\n\n\t\t// If multiple blocks are selected, deselect all blocks when the user\n\t\t// presses the escape key.\n\t\tif (\n\t\t\tisMatch( 'core/block-editor/unselect', event ) &&\n\t\t\tselectedClientIds.length > 0\n\t\t) {\n\t\t\tevent.stopPropagation();\n\t\t\tevent.preventDefault();\n\t\t\tselectBlock( event, undefined );\n\t\t} else if (\n\t\t\tisDeleteKey ||\n\t\t\tisMatch( 'core/block-editor/remove', event )\n\t\t) {\n\t\t\tconst {\n\t\t\t\tblocksToUpdate: blocksToDelete,\n\t\t\t\tfirstBlockClientId,\n\t\t\t\tfirstBlockRootClientId,\n\t\t\t\tselectedBlockClientIds,\n\t\t\t} = getBlocksToUpdate();\n\n\t\t\t// Don't update the selection if the blocks cannot be deleted.\n\t\t\tif ( ! canRemoveBlocks( blocksToDelete ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet blockToFocus =\n\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ) ??\n\t\t\t\t// If the previous block is not found (when the first block is deleted),\n\t\t\t\t// fallback to focus the parent block.\n\t\t\t\tfirstBlockRootClientId;\n\n\t\t\tremoveBlocks( blocksToDelete, false );\n\n\t\t\t// Update the selection if the original selection has been removed.\n\t\t\tconst shouldUpdateSelection =\n\t\t\t\tselectedBlockClientIds.length > 0 &&\n\t\t\t\tgetSelectedBlockClientIds().length === 0;\n\n\t\t\t// If there's no previous block nor parent block, focus the first block.\n\t\t\tif ( ! blockToFocus ) {\n\t\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t\t}\n\n\t\t\tupdateFocusAndSelection( blockToFocus, shouldUpdateSelection );\n\t\t} else if ( isMatch( 'core/block-editor/paste-styles', event ) ) {\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { blocksToUpdate } = getBlocksToUpdate();\n\t\t\tconst blocks = getBlocksByClientId( blocksToUpdate );\n\n\t\t\tpasteStyles( blocks );\n\t\t} else if ( isMatch( 'core/block-editor/duplicate', event ) ) {\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { blocksToUpdate, firstBlockRootClientId } =\n\t\t\t\tgetBlocksToUpdate();\n\n\t\t\tconst canDuplicate = getBlocksByClientId( blocksToUpdate ).every(\n\t\t\t\t( blockToUpdate ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t!! blockToUpdate &&\n\t\t\t\t\t\thasBlockSupport(\n\t\t\t\t\t\t\tblockToUpdate.name,\n\t\t\t\t\t\t\t'multiple',\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t) &&\n\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\tblockToUpdate.name,\n\t\t\t\t\t\t\tfirstBlockRootClientId\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( canDuplicate ) {\n\t\t\t\tconst updatedBlocks = await duplicateBlocks(\n\t\t\t\t\tblocksToUpdate,\n\t\t\t\t\tfalse\n\t\t\t\t);\n\n\t\t\t\tif ( updatedBlocks?.length ) {\n\t\t\t\t\t// If blocks have been duplicated, focus the first duplicated block.\n\t\t\t\t\tupdateFocusAndSelection( updatedBlocks[ 0 ], false );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/insert-before', event ) ) {\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { blocksToUpdate } = getBlocksToUpdate();\n\t\t\tawait insertBeforeBlock( blocksToUpdate[ 0 ] );\n\t\t\tconst newlySelectedBlocks = getSelectedBlockClientIds();\n\n\t\t\t// Focus the first block of the newly inserted blocks, to keep focus within the list view.\n\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t\tupdateFocusAndSelection( newlySelectedBlocks[ 0 ], false );\n\t\t} else if ( isMatch( 'core/block-editor/insert-after', event ) ) {\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { blocksToUpdate } = getBlocksToUpdate();\n\t\t\tawait insertAfterBlock( blocksToUpdate.at( -1 ) );\n\t\t\tconst newlySelectedBlocks = getSelectedBlockClientIds();\n\n\t\t\t// Focus the first block of the newly inserted blocks, to keep focus within the list view.\n\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t\tupdateFocusAndSelection( newlySelectedBlocks[ 0 ], false );\n\t\t} else if ( isMatch( 'core/block-editor/select-all', event ) ) {\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { firstBlockRootClientId, selectedBlockClientIds } =\n\t\t\t\tgetBlocksToUpdate();\n\t\t\tconst blockClientIds = getBlockOrder( firstBlockRootClientId );\n\t\t\tif ( ! blockClientIds.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If we have selected all sibling nested blocks, try selecting up a level.\n\t\t\t// This is a similar implementation to that used by `useSelectAll`.\n\t\t\t// `isShallowEqual` is used for the list view instead of a length check,\n\t\t\t// as the array of siblings of the currently focused block may be a different\n\t\t\t// set of blocks from the current block selection if the user is focused\n\t\t\t// on a different part of the list view from the block selection.\n\t\t\tif ( isShallowEqual( selectedBlockClientIds, blockClientIds ) ) {\n\t\t\t\t// Only select up a level if the first block is not the root block.\n\t\t\t\t// This ensures that the block selection can't break out of the root block\n\t\t\t\t// used by the list view, if the list view is only showing a partial hierarchy.\n\t\t\t\tif (\n\t\t\t\t\tfirstBlockRootClientId &&\n\t\t\t\t\tfirstBlockRootClientId !== rootClientId\n\t\t\t\t) {\n\t\t\t\t\tupdateFocusAndSelection( firstBlockRootClientId, true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Select all while passing `null` to skip focusing to the editor canvas,\n\t\t\t// and retain focus within the list view.\n\t\t\tmultiSelect(\n\t\t\t\tblockClientIds[ 0 ],\n\t\t\t\tblockClientIds[ blockClientIds.length - 1 ],\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if ( isMatch( 'core/block-editor/collapse-list-view', event ) ) {\n\t\t\tevent.preventDefault();\n\t\t\tconst { firstBlockClientId } = getBlocksToUpdate();\n\t\t\tconst blockParents = getBlockParents( firstBlockClientId, false );\n\t\t\t// Collapse all blocks.\n\t\t\tcollapseAll();\n\t\t\t// Expand all parents of the current block.\n\t\t\texpand( blockParents );\n\t\t} else if ( isMatch( 'core/block-editor/group', event ) ) {\n\t\t\tconst { blocksToUpdate } = getBlocksToUpdate();\n\t\t\tif ( blocksToUpdate.length > 1 && isGroupable( blocksToUpdate ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst blocks = getBlocksByClientId( blocksToUpdate );\n\t\t\t\tconst groupingBlockName = getGroupingBlockName();\n\t\t\t\tconst newBlocks = switchToBlockType(\n\t\t\t\t\tblocks,\n\t\t\t\t\tgroupingBlockName\n\t\t\t\t);\n\t\t\t\treplaceBlocks( blocksToUpdate, newBlocks );\n\t\t\t\tspeak( __( 'Selected blocks are grouped.' ) );\n\t\t\t\tconst newlySelectedBlocks = getSelectedBlockClientIds();\n\t\t\t\t// Focus the first block of the newly inserted blocks, to keep focus within the list view.\n\t\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t\t\tupdateFocusAndSelection( newlySelectedBlocks[ 0 ], false );\n\t\t\t}\n\t\t} else if (\n\t\t\tisMatch( 'core/block-editor/toggle-block-visibility', event )\n\t\t) {\n\t\t\tevent.preventDefault();\n\t\t\tconst { blocksToUpdate } = getBlocksToUpdate();\n\t\t\tconst blocks = getBlocksByClientId( blocksToUpdate );\n\t\t\tconst canToggleBlockVisibility = blocks.every( ( blockToUpdate ) =>\n\t\t\t\thasBlockSupport( blockToUpdate.name, 'blockVisibility', true )\n\t\t\t);\n\t\t\tif ( ! canToggleBlockVisibility ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst hasHiddenBlock = blocks.some(\n\t\t\t\t( blockToUpdate ) =>\n\t\t\t\t\tblockToUpdate.attributes.metadata?.blockVisibility === false\n\t\t\t);\n\t\t\tconst attributesByClientId = Object.fromEntries(\n\t\t\t\tblocks.map( ( { clientId: mapClientId, attributes } ) => [\n\t\t\t\t\tmapClientId,\n\t\t\t\t\t{\n\t\t\t\t\t\tmetadata: cleanEmptyObject( {\n\t\t\t\t\t\t\t...attributes?.metadata,\n\t\t\t\t\t\t\tblockVisibility: hasHiddenBlock ? undefined : false,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t] )\n\t\t\t);\n\t\t\tupdateBlockAttributes( blocksToUpdate, attributesByClientId, {\n\t\t\t\tuniqueByBlock: true,\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst onMouseEnter = useCallback( () => {\n\t\tsetIsHovered( true );\n\t\tdebouncedToggleBlockHighlight( clientId, true );\n\t}, [ clientId, setIsHovered, debouncedToggleBlockHighlight ] );\n\tconst onMouseLeave = useCallback( () => {\n\t\tsetIsHovered( false );\n\t\tdebouncedToggleBlockHighlight( clientId, false );\n\t}, [ clientId, setIsHovered, debouncedToggleBlockHighlight ] );\n\n\tconst selectEditorBlock = useCallback(\n\t\t( event ) => {\n\t\t\tselectBlock( event, clientId );\n\t\t\tevent.preventDefault();\n\t\t},\n\t\t[ clientId, selectBlock ]\n\t);\n\n\tconst updateFocusAndSelection = useCallback(\n\t\t( focusClientId, shouldSelectBlock ) => {\n\t\t\tif ( shouldSelectBlock ) {\n\t\t\t\tselectBlock( undefined, focusClientId, null, null );\n\t\t\t}\n\n\t\t\tfocusListItem( focusClientId, treeGridElementRef?.current );\n\t\t},\n\t\t[ selectBlock, treeGridElementRef ]\n\t);\n\n\tconst toggleExpanded = useCallback(\n\t\t( event ) => {\n\t\t\t// Prevent shift+click from opening link in a new window when toggling.\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tif ( isExpanded === true ) {\n\t\t\t\tcollapse( clientId );\n\t\t\t} else if ( isExpanded === false ) {\n\t\t\t\texpand( clientId );\n\t\t\t}\n\t\t},\n\t\t[ clientId, expand, collapse, isExpanded ]\n\t);\n\n\t// Allow right-clicking an item in the List View to open up the block settings dropdown.\n\tconst onContextMenu = useCallback(\n\t\t( event ) => {\n\t\t\tif ( showBlockActions && allowRightClickOverrides ) {\n\t\t\t\tsettingsRef.current?.click();\n\t\t\t\t// Ensure the position of the settings dropdown is at the cursor.\n\t\t\t\tsetSettingsAnchorRect(\n\t\t\t\t\tnew window.DOMRect( event.clientX, event.clientY, 0, 0 )\n\t\t\t\t);\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ allowRightClickOverrides, settingsRef, showBlockActions ]\n\t);\n\n\tconst onMouseDown = useCallback(\n\t\t( event ) => {\n\t\t\t// Prevent right-click from focusing the block,\n\t\t\t// because focus will be handled when opening the block settings dropdown.\n\t\t\tif ( allowRightClickOverrides && event.button === 2 ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ allowRightClickOverrides ]\n\t);\n\n\tconst settingsPopoverAnchor = useMemo( () => {\n\t\tconst { ownerDocument } = rowRef?.current || {};\n\n\t\t// If no custom position is set, the settings dropdown will be anchored to the\n\t\t// DropdownMenu toggle button.\n\t\tif ( ! settingsAnchorRect || ! ownerDocument ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Position the settings dropdown at the cursor when right-clicking a block.\n\t\treturn {\n\t\t\townerDocument,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn settingsAnchorRect;\n\t\t\t},\n\t\t};\n\t}, [ settingsAnchorRect ] );\n\n\tconst clearSettingsAnchorRect = useCallback( () => {\n\t\t// Clear the custom position for the settings dropdown so that it is restored back\n\t\t// to being anchored to the DropdownMenu toggle button.\n\t\tsetSettingsAnchorRect( undefined );\n\t}, [ setSettingsAnchorRect ] );\n\n\t// Pass in a ref to the row, so that it can be scrolled\n\t// into view when selected. For long lists, the placeholder for the\n\t// selected block is also observed, within ListViewLeafPlaceholder.\n\tuseListViewScrollIntoView( {\n\t\tisSelected,\n\t\trowItemRef: rowRef,\n\t\tselectedClientIds,\n\t} );\n\n\t// When switching between rendering modes (such as template preview and content only),\n\t// it is possible for a block to temporarily be unavailable. In this case, we should not\n\t// render the leaf, to avoid errors further down the tree.\n\tif ( ! block ) {\n\t\treturn null;\n\t}\n\n\tconst blockPositionDescription = getBlockPositionDescription(\n\t\tposition,\n\t\tsiblingBlockCount,\n\t\tlevel\n\t);\n\n\tconst blockPropertiesDescription = getBlockPropertiesDescription(\n\t\tblockInformation,\n\t\tisLocked\n\t);\n\n\tconst blockVisibilityDescription = isBlockHidden\n\t\t? __( 'Block is hidden.' )\n\t\t: null;\n\n\tconst hasSiblings = siblingBlockCount > 0;\n\tconst hasRenderedMovers = showBlockMovers && hasSiblings;\n\tconst moverCellClassName = clsx(\n\t\t'block-editor-list-view-block__mover-cell',\n\t\t{ 'is-visible': isHovered || isSelected }\n\t);\n\n\tconst listViewBlockSettingsClassName = clsx(\n\t\t'block-editor-list-view-block__menu-cell',\n\t\t{ 'is-visible': isHovered || isFirstSelectedBlock }\n\t);\n\n\tlet colSpan;\n\tif ( hasRenderedMovers ) {\n\t\tcolSpan = 2;\n\t} else if ( ! showBlockActions ) {\n\t\tcolSpan = 3;\n\t}\n\n\tconst classes = clsx( {\n\t\t'is-selected': isSelected,\n\t\t'is-first-selected': isFirstSelectedBlock,\n\t\t'is-last-selected': isLastSelectedBlock,\n\t\t'is-branch-selected': isBranchSelected,\n\t\t'is-synced-branch': isSyncedBranch,\n\t\t'is-dragging': isDragged,\n\t\t'has-single-cell': ! showBlockActions,\n\t\t'is-synced': blockInformation?.isSynced,\n\t\t'is-draggable': canMove,\n\t\t'is-displacement-normal': displacement === 'normal',\n\t\t'is-displacement-up': displacement === 'up',\n\t\t'is-displacement-down': displacement === 'down',\n\t\t'is-after-dragged-blocks': isAfterDraggedBlocks,\n\t\t'is-nesting': isNesting,\n\t} );\n\n\t// Only include all selected blocks if the currently clicked on block\n\t// is one of the selected blocks. This ensures that if a user attempts\n\t// to alter a block that isn't part of the selection, they're still able\n\t// to do so.\n\tconst dropdownClientIds = selectedClientIds.includes( clientId )\n\t\t? selectedClientIds\n\t\t: [ clientId ];\n\n\t// Detect if there is a block in the canvas currently being edited and multi-selection is not happening.\n\tconst currentlyEditingBlockInCanvas =\n\t\tisSelected && selectedClientIds.length === 1;\n\n\treturn (\n\t\t<ListViewLeaf\n\t\t\tclassName={ classes }\n\t\t\tisDragged={ isDragged }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t\tonMouseEnter={ onMouseEnter }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\tonFocus={ onMouseEnter }\n\t\t\tonBlur={ onMouseLeave }\n\t\t\tlevel={ level }\n\t\t\tposition={ position }\n\t\t\trowCount={ rowCount }\n\t\t\tpath={ path }\n\t\t\tid={ `list-view-${ listViewInstanceId }-block-${ clientId }` }\n\t\t\tdata-block={ clientId }\n\t\t\tdata-expanded={ canEdit ? isExpanded : undefined }\n\t\t\tref={ rowRef }\n\t\t>\n\t\t\t<TreeGridCell\n\t\t\t\tclassName=\"block-editor-list-view-block__contents-cell\"\n\t\t\t\tcolSpan={ colSpan }\n\t\t\t\tref={ cellRef }\n\t\t\t\taria-selected={ !! isSelected }\n\t\t\t>\n\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t<div className=\"block-editor-list-view-block__contents-container\">\n\t\t\t\t\t\t<ListViewBlockContents\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\tonClick={ selectEditorBlock }\n\t\t\t\t\t\t\tonContextMenu={ onContextMenu }\n\t\t\t\t\t\t\tonMouseDown={ onMouseDown }\n\t\t\t\t\t\t\tonToggleExpanded={ toggleExpanded }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\tsiblingBlockCount={ siblingBlockCount }\n\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\ttabIndex={\n\t\t\t\t\t\t\t\tcurrentlyEditingBlockInCanvas ? 0 : tabIndex\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tisExpanded={ canEdit ? isExpanded : undefined }\n\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\tariaDescribedBy={ descriptionId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<AriaReferencedText id={ descriptionId }>\n\t\t\t\t\t\t\t{ [\n\t\t\t\t\t\t\t\tblockPositionDescription,\n\t\t\t\t\t\t\t\tblockPropertiesDescription,\n\t\t\t\t\t\t\t\tblockVisibilityDescription,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t\t\t\t.join( ' ' ) }\n\t\t\t\t\t\t</AriaReferencedText>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TreeGridCell>\n\t\t\t{ hasRenderedMovers && (\n\t\t\t\t<>\n\t\t\t\t\t<TreeGridCell\n\t\t\t\t\t\tclassName={ moverCellClassName }\n\t\t\t\t\t\twithoutGridItem\n\t\t\t\t\t>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverUpButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverDownButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t</TreeGridCell>\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t{ showBlockActions && BlockSettingsMenu && (\n\t\t\t\t<TreeGridCell\n\t\t\t\t\tclassName={ listViewBlockSettingsClassName }\n\t\t\t\t\taria-selected={ !! isSelected }\n\t\t\t\t\tref={ settingsRef }\n\t\t\t\t>\n\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t<BlockSettingsMenu\n\t\t\t\t\t\t\tclientIds={ dropdownClientIds }\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\t\tanchor: settingsPopoverAnchor, // Used to position the settings at the cursor on right-click.\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\tref,\n\t\t\t\t\t\t\t\tclassName: 'block-editor-list-view-block__menu',\n\t\t\t\t\t\t\t\ttabIndex,\n\t\t\t\t\t\t\t\tonClick: clearSettingsAnchorRect,\n\t\t\t\t\t\t\t\tonFocus,\n\t\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tdisableOpenOnArrowDown\n\t\t\t\t\t\t\texpand={ expand }\n\t\t\t\t\t\t\texpandedState={ expandedState }\n\t\t\t\t\t\t\tsetInsertedBlock={ setInsertedBlock }\n\t\t\t\t\t\t\t__experimentalSelectBlock={\n\t\t\t\t\t\t\t\tupdateFocusAndSelection\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</TreeGridCell>\n\t\t\t) }\n\t\t</ListViewLeaf>\n\t);\n}\n\nexport default memo( ListViewBlock );\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,oBAIO;AACP,wBAGO;AACP,qBAA2C;AAC3C,mBAA6B;AAC7B,qBAMO;AACP,kBAAuC;AACvC,kBAAmB;AACnB,sBAAkC;AAClC,8BAA2B;AAC3B,gCAAyE;AACzE,kBAAsB;AAKtB,kBAAyB;AACzB,4CAAsC;AACtC,oBAGO;AACP,4BAAkC;AAClC,qBAAmC;AACnC,mBAIO;AACP,mBAA0C;AAC1C,2CAAuC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A;AAAA,cACD,GAEF;AAAA,cACA,4CAAC,kBAAAA,4BAAA,EACE,WAAE,EAAE,KAAK,UAAU,QAAQ,MAC5B;AAAA,gBAAC;AAAA;AAAA,kBACA,aAAY;AAAA,kBACZ,WAAY,CAAE,QAAS;AAAA,kBACvB;AAAA,kBACA;AAAA,kBACA;AAAA;AAAA,cACD,GAEF;AAAA;AAAA;AAAA,QACD,GACD;AAAA,QAGC,oBAAoB,qBACrB;AAAA,UAAC,kBAAAH;AAAA,UAAA;AAAA,YACA,WAAY;AAAA,YACZ,iBAAgB,CAAC,CAAE;AAAA,YACnB,KAAM;AAAA,YAEJ,WAAE,EAAE,KAAK,UAAU,QAAQ,MAC5B;AAAA,cAAC;AAAA;AAAA,gBACA,WAAY;AAAA,gBACZ;AAAA,gBACA,MAAO;AAAA,gBACP,WAAQ,gBAAI,SAAU;AAAA,gBACtB,cAAe;AAAA,kBACd,QAAQ;AAAA;AAAA,gBACT;AAAA,gBACA,aAAc;AAAA,kBACb;AAAA,kBACA,WAAW;AAAA,kBACX;AAAA,kBACA,SAAS;AAAA,kBACT;AAAA,kBACA,MAAM;AAAA,gBACP;AAAA,gBACA,wBAAsB;AAAA,gBACtB;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,2BACC;AAAA;AAAA,YAEF;AAAA;AAAA,QAEF;AAAA;AAAA;AAAA,EAEF;AAEF;AAEA,IAAO,oBAAQ,qBAAM,aAAc;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\thasBlockSupport,\n\tswitchToBlockType,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport {\n\t__experimentalTreeGridCell as TreeGridCell,\n\t__experimentalTreeGridItem as TreeGridItem,\n} from '@wordpress/components';\nimport { useInstanceId, useDebounce } from '@wordpress/compose';\nimport { moreVertical } from '@wordpress/icons';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseState,\n\tuseRef,\n\tmemo,\n} from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { BACKSPACE, DELETE } from '@wordpress/keycodes';\nimport isShallowEqual from '@wordpress/is-shallow-equal';\nimport { __unstableUseShortcutEventMatch as useShortcutEventMatch } from '@wordpress/keyboard-shortcuts';\nimport { speak } from '@wordpress/a11y';\n\n/**\n * Internal dependencies\n */\nimport ListViewLeaf from './leaf';\nimport useListViewScrollIntoView from './use-list-view-scroll-into-view';\nimport {\n\tBlockMoverUpButton,\n\tBlockMoverDownButton,\n} from '../block-mover/button';\nimport ListViewBlockContents from './block-contents';\nimport { useListViewContext } from './context';\nimport {\n\tgetBlockPositionDescription,\n\tgetBlockPropertiesDescription,\n\tfocusListItem,\n} from './utils';\nimport { store as blockEditorStore } from '../../store';\nimport useBlockDisplayInformation from '../use-block-display-information';\nimport { useBlockLock } from '../block-lock';\nimport AriaReferencedText from './aria-referenced-text';\nimport { unlock } from '../../lock-unlock';\nimport usePasteStyles from '../use-paste-styles';\nimport { cleanEmptyObject } from '../../hooks/utils';\n\nfunction ListViewBlock( {\n\tblock: { clientId },\n\tdisplacement,\n\tisAfterDraggedBlocks,\n\tisDragged,\n\tisNesting,\n\tisSelected,\n\tisBranchSelected,\n\tselectBlock,\n\tposition,\n\tlevel,\n\trowCount,\n\tsiblingBlockCount,\n\tshowBlockMovers,\n\tpath,\n\tisExpanded,\n\tselectedClientIds,\n\tisSyncedBranch,\n} ) {\n\tconst cellRef = useRef( null );\n\tconst rowRef = useRef( null );\n\tconst settingsRef = useRef( null );\n\tconst [ isHovered, setIsHovered ] = useState( false );\n\tconst [ settingsAnchorRect, setSettingsAnchorRect ] = useState();\n\n\tconst { isLocked } = useBlockLock( clientId );\n\n\tconst isFirstSelectedBlock =\n\t\tisSelected && selectedClientIds[ 0 ] === clientId;\n\tconst isLastSelectedBlock =\n\t\tisSelected &&\n\t\tselectedClientIds[ selectedClientIds.length - 1 ] === clientId;\n\n\tconst {\n\t\ttoggleBlockHighlight,\n\t\tduplicateBlocks,\n\t\tmultiSelect,\n\t\treplaceBlocks,\n\t\tremoveBlocks,\n\t\tinsertAfterBlock,\n\t\tinsertBeforeBlock,\n\t\tsetOpenedBlockSettingsMenu,\n\t\tupdateBlockAttributes,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\tconst debouncedToggleBlockHighlight = useDebounce(\n\t\ttoggleBlockHighlight,\n\t\t50\n\t);\n\n\tconst {\n\t\tcanInsertBlockType,\n\t\tgetSelectedBlockClientIds,\n\t\tgetPreviousBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlockOrder,\n\t\tgetBlockParents,\n\t\tgetBlocksByClientId,\n\t\tcanEditBlock,\n\t\tcanMoveBlock,\n\t\tcanRemoveBlocks,\n\t\tisGroupable,\n\t} = useSelect( blockEditorStore );\n\tconst { getGroupingBlockName } = useSelect( blocksStore );\n\n\tconst blockInformation = useBlockDisplayInformation( clientId );\n\n\tconst pasteStyles = usePasteStyles();\n\n\tconst { block, blockName, allowRightClickOverrides, isBlockHidden } =\n\t\tuseSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst { getBlock, getBlockName, getSettings } =\n\t\t\t\t\tselect( blockEditorStore );\n\t\t\t\tconst { isBlockHidden: _isBlockHidden } = unlock(\n\t\t\t\t\tselect( blockEditorStore )\n\t\t\t\t);\n\n\t\t\t\treturn {\n\t\t\t\t\tblock: getBlock( clientId ),\n\t\t\t\t\tblockName: getBlockName( clientId ),\n\t\t\t\t\tallowRightClickOverrides:\n\t\t\t\t\t\tgetSettings().allowRightClickOverrides,\n\t\t\t\t\tisBlockHidden: _isBlockHidden( clientId ),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ clientId ]\n\t\t);\n\n\tconst showBlockActions =\n\t\t// When a block hides its toolbar it also hides the block settings menu,\n\t\t// since that menu is part of the toolbar in the editor canvas.\n\t\t// List View respects this by also hiding the block settings menu.\n\t\thasBlockSupport( blockName, '__experimentalToolbar', true );\n\tconst instanceId = useInstanceId( ListViewBlock );\n\tconst descriptionId = `list-view-block-select-button__description-${ instanceId }`;\n\n\tconst {\n\t\texpand,\n\t\tcollapse,\n\t\tcollapseAll,\n\t\tBlockSettingsMenu,\n\t\tlistViewInstanceId,\n\t\texpandedState,\n\t\tsetInsertedBlock,\n\t\ttreeGridElementRef,\n\t\trootClientId,\n\t} = useListViewContext();\n\tconst isMatch = useShortcutEventMatch();\n\n\t// Determine which blocks to update:\n\t// If the current (focused) block is part of the block selection, use the whole selection.\n\t// If the focused block is not part of the block selection, only update the focused block.\n\tfunction getBlocksToUpdate() {\n\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\tconst isUpdatingSelectedBlocks =\n\t\t\tselectedBlockClientIds.includes( clientId );\n\t\tconst firstBlockClientId = isUpdatingSelectedBlocks\n\t\t\t? selectedBlockClientIds[ 0 ]\n\t\t\t: clientId;\n\t\tconst firstBlockRootClientId =\n\t\t\tgetBlockRootClientId( firstBlockClientId );\n\n\t\tconst blocksToUpdate = isUpdatingSelectedBlocks\n\t\t\t? selectedBlockClientIds\n\t\t\t: [ clientId ];\n\n\t\treturn {\n\t\t\tblocksToUpdate,\n\t\t\tfirstBlockClientId,\n\t\t\tfirstBlockRootClientId,\n\t\t\tselectedBlockClientIds,\n\t\t};\n\t}\n\n\t/**\n\t * @param {KeyboardEvent} event\n\t */\n\tasync function onKeyDown( event ) {\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Do not handle events if it comes from modals;\n\t\t// retain the default behavior for these keys.\n\t\tif ( event.target.closest( '[role=dialog]' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isDeleteKey = [ BACKSPACE, DELETE ].includes( event.keyCode );\n\n\t\t// If multiple blocks are selected, deselect all blocks when the user\n\t\t// presses the escape key.\n\t\tif (\n\t\t\tisMatch( 'core/block-editor/unselect', event ) &&\n\t\t\tselectedClientIds.length > 0\n\t\t) {\n\t\t\tevent.stopPropagation();\n\t\t\tevent.preventDefault();\n\t\t\tselectBlock( event, undefined );\n\t\t} else if (\n\t\t\tisDeleteKey ||\n\t\t\tisMatch( 'core/block-editor/remove', event )\n\t\t) {\n\t\t\tconst {\n\t\t\t\tblocksToUpdate: blocksToDelete,\n\t\t\t\tfirstBlockClientId,\n\t\t\t\tfirstBlockRootClientId,\n\t\t\t\tselectedBlockClientIds,\n\t\t\t} = getBlocksToUpdate();\n\n\t\t\t// Don't update the selection if the blocks cannot be deleted.\n\t\t\tif ( ! canRemoveBlocks( blocksToDelete ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet blockToFocus =\n\t\t\t\tgetPreviousBlockClientId( firstBlockClientId ) ??\n\t\t\t\t// If the previous block is not found (when the first block is deleted),\n\t\t\t\t// fallback to focus the parent block.\n\t\t\t\tfirstBlockRootClientId;\n\n\t\t\tremoveBlocks( blocksToDelete, false );\n\n\t\t\t// Update the selection if the original selection has been removed.\n\t\t\tconst shouldUpdateSelection =\n\t\t\t\tselectedBlockClientIds.length > 0 &&\n\t\t\t\tgetSelectedBlockClientIds().length === 0;\n\n\t\t\t// If there's no previous block nor parent block, focus the first block.\n\t\t\tif ( ! blockToFocus ) {\n\t\t\t\tblockToFocus = getBlockOrder()[ 0 ];\n\t\t\t}\n\n\t\t\tupdateFocusAndSelection( blockToFocus, shouldUpdateSelection );\n\t\t} else if ( isMatch( 'core/block-editor/paste-styles', event ) ) {\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { blocksToUpdate } = getBlocksToUpdate();\n\t\t\tconst blocks = getBlocksByClientId( blocksToUpdate );\n\n\t\t\tpasteStyles( blocks );\n\t\t} else if ( isMatch( 'core/block-editor/duplicate', event ) ) {\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { blocksToUpdate, firstBlockRootClientId } =\n\t\t\t\tgetBlocksToUpdate();\n\n\t\t\tconst canDuplicate = getBlocksByClientId( blocksToUpdate ).every(\n\t\t\t\t( blockToUpdate ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t!! blockToUpdate &&\n\t\t\t\t\t\thasBlockSupport(\n\t\t\t\t\t\t\tblockToUpdate.name,\n\t\t\t\t\t\t\t'multiple',\n\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t) &&\n\t\t\t\t\t\tcanInsertBlockType(\n\t\t\t\t\t\t\tblockToUpdate.name,\n\t\t\t\t\t\t\tfirstBlockRootClientId\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( canDuplicate ) {\n\t\t\t\tconst updatedBlocks = await duplicateBlocks(\n\t\t\t\t\tblocksToUpdate,\n\t\t\t\t\tfalse\n\t\t\t\t);\n\n\t\t\t\tif ( updatedBlocks?.length ) {\n\t\t\t\t\t// If blocks have been duplicated, focus the first duplicated block.\n\t\t\t\t\tupdateFocusAndSelection( updatedBlocks[ 0 ], false );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( isMatch( 'core/block-editor/insert-before', event ) ) {\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { blocksToUpdate } = getBlocksToUpdate();\n\t\t\tawait insertBeforeBlock( blocksToUpdate[ 0 ] );\n\t\t\tconst newlySelectedBlocks = getSelectedBlockClientIds();\n\n\t\t\t// Focus the first block of the newly inserted blocks, to keep focus within the list view.\n\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t\tupdateFocusAndSelection( newlySelectedBlocks[ 0 ], false );\n\t\t} else if ( isMatch( 'core/block-editor/insert-after', event ) ) {\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { blocksToUpdate } = getBlocksToUpdate();\n\t\t\tawait insertAfterBlock( blocksToUpdate.at( -1 ) );\n\t\t\tconst newlySelectedBlocks = getSelectedBlockClientIds();\n\n\t\t\t// Focus the first block of the newly inserted blocks, to keep focus within the list view.\n\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t\tupdateFocusAndSelection( newlySelectedBlocks[ 0 ], false );\n\t\t} else if ( isMatch( 'core/block-editor/select-all', event ) ) {\n\t\t\tevent.preventDefault();\n\n\t\t\tconst { firstBlockRootClientId, selectedBlockClientIds } =\n\t\t\t\tgetBlocksToUpdate();\n\t\t\tconst blockClientIds = getBlockOrder( firstBlockRootClientId );\n\t\t\tif ( ! blockClientIds.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If we have selected all sibling nested blocks, try selecting up a level.\n\t\t\t// This is a similar implementation to that used by `useSelectAll`.\n\t\t\t// `isShallowEqual` is used for the list view instead of a length check,\n\t\t\t// as the array of siblings of the currently focused block may be a different\n\t\t\t// set of blocks from the current block selection if the user is focused\n\t\t\t// on a different part of the list view from the block selection.\n\t\t\tif ( isShallowEqual( selectedBlockClientIds, blockClientIds ) ) {\n\t\t\t\t// Only select up a level if the first block is not the root block.\n\t\t\t\t// This ensures that the block selection can't break out of the root block\n\t\t\t\t// used by the list view, if the list view is only showing a partial hierarchy.\n\t\t\t\tif (\n\t\t\t\t\tfirstBlockRootClientId &&\n\t\t\t\t\tfirstBlockRootClientId !== rootClientId\n\t\t\t\t) {\n\t\t\t\t\tupdateFocusAndSelection( firstBlockRootClientId, true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Select all while passing `null` to skip focusing to the editor canvas,\n\t\t\t// and retain focus within the list view.\n\t\t\tmultiSelect(\n\t\t\t\tblockClientIds[ 0 ],\n\t\t\t\tblockClientIds[ blockClientIds.length - 1 ],\n\t\t\t\tnull\n\t\t\t);\n\t\t} else if ( isMatch( 'core/block-editor/collapse-list-view', event ) ) {\n\t\t\tevent.preventDefault();\n\t\t\tconst { firstBlockClientId } = getBlocksToUpdate();\n\t\t\tconst blockParents = getBlockParents( firstBlockClientId, false );\n\t\t\t// Collapse all blocks.\n\t\t\tcollapseAll();\n\t\t\t// Expand all parents of the current block.\n\t\t\texpand( blockParents );\n\t\t} else if ( isMatch( 'core/block-editor/group', event ) ) {\n\t\t\tconst { blocksToUpdate } = getBlocksToUpdate();\n\t\t\tif ( blocksToUpdate.length > 1 && isGroupable( blocksToUpdate ) ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst blocks = getBlocksByClientId( blocksToUpdate );\n\t\t\t\tconst groupingBlockName = getGroupingBlockName();\n\t\t\t\tconst newBlocks = switchToBlockType(\n\t\t\t\t\tblocks,\n\t\t\t\t\tgroupingBlockName\n\t\t\t\t);\n\t\t\t\treplaceBlocks( blocksToUpdate, newBlocks );\n\t\t\t\tspeak( __( 'Selected blocks are grouped.' ) );\n\t\t\t\tconst newlySelectedBlocks = getSelectedBlockClientIds();\n\t\t\t\t// Focus the first block of the newly inserted blocks, to keep focus within the list view.\n\t\t\t\tsetOpenedBlockSettingsMenu( undefined );\n\t\t\t\tupdateFocusAndSelection( newlySelectedBlocks[ 0 ], false );\n\t\t\t}\n\t\t} else if (\n\t\t\tisMatch( 'core/block-editor/toggle-block-visibility', event )\n\t\t) {\n\t\t\tevent.preventDefault();\n\t\t\tconst { blocksToUpdate } = getBlocksToUpdate();\n\t\t\tconst blocks = getBlocksByClientId( blocksToUpdate );\n\t\t\tconst canToggleVisibility = blocks.every( ( blockToUpdate ) =>\n\t\t\t\thasBlockSupport( blockToUpdate.name, 'visibility', true )\n\t\t\t);\n\t\t\tif ( ! canToggleVisibility ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst hasHiddenBlock = blocks.some(\n\t\t\t\t( blockToUpdate ) =>\n\t\t\t\t\tblockToUpdate.attributes.metadata?.blockVisibility === false\n\t\t\t);\n\t\t\tconst attributesByClientId = Object.fromEntries(\n\t\t\t\tblocks.map( ( { clientId: mapClientId, attributes } ) => [\n\t\t\t\t\tmapClientId,\n\t\t\t\t\t{\n\t\t\t\t\t\tmetadata: cleanEmptyObject( {\n\t\t\t\t\t\t\t...attributes?.metadata,\n\t\t\t\t\t\t\tblockVisibility: hasHiddenBlock ? undefined : false,\n\t\t\t\t\t\t} ),\n\t\t\t\t\t},\n\t\t\t\t] )\n\t\t\t);\n\t\t\tupdateBlockAttributes( blocksToUpdate, attributesByClientId, {\n\t\t\t\tuniqueByBlock: true,\n\t\t\t} );\n\t\t}\n\t}\n\n\tconst onMouseEnter = useCallback( () => {\n\t\tsetIsHovered( true );\n\t\tdebouncedToggleBlockHighlight( clientId, true );\n\t}, [ clientId, setIsHovered, debouncedToggleBlockHighlight ] );\n\tconst onMouseLeave = useCallback( () => {\n\t\tsetIsHovered( false );\n\t\tdebouncedToggleBlockHighlight( clientId, false );\n\t}, [ clientId, setIsHovered, debouncedToggleBlockHighlight ] );\n\n\tconst selectEditorBlock = useCallback(\n\t\t( event ) => {\n\t\t\tselectBlock( event, clientId );\n\t\t\tevent.preventDefault();\n\t\t},\n\t\t[ clientId, selectBlock ]\n\t);\n\n\tconst updateFocusAndSelection = useCallback(\n\t\t( focusClientId, shouldSelectBlock ) => {\n\t\t\tif ( shouldSelectBlock ) {\n\t\t\t\tselectBlock( undefined, focusClientId, null, null );\n\t\t\t}\n\n\t\t\tfocusListItem( focusClientId, treeGridElementRef?.current );\n\t\t},\n\t\t[ selectBlock, treeGridElementRef ]\n\t);\n\n\tconst toggleExpanded = useCallback(\n\t\t( event ) => {\n\t\t\t// Prevent shift+click from opening link in a new window when toggling.\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopPropagation();\n\t\t\tif ( isExpanded === true ) {\n\t\t\t\tcollapse( clientId );\n\t\t\t} else if ( isExpanded === false ) {\n\t\t\t\texpand( clientId );\n\t\t\t}\n\t\t},\n\t\t[ clientId, expand, collapse, isExpanded ]\n\t);\n\n\t// Allow right-clicking an item in the List View to open up the block settings dropdown.\n\tconst onContextMenu = useCallback(\n\t\t( event ) => {\n\t\t\tif ( showBlockActions && allowRightClickOverrides ) {\n\t\t\t\tsettingsRef.current?.click();\n\t\t\t\t// Ensure the position of the settings dropdown is at the cursor.\n\t\t\t\tsetSettingsAnchorRect(\n\t\t\t\t\tnew window.DOMRect( event.clientX, event.clientY, 0, 0 )\n\t\t\t\t);\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ allowRightClickOverrides, settingsRef, showBlockActions ]\n\t);\n\n\tconst onMouseDown = useCallback(\n\t\t( event ) => {\n\t\t\t// Prevent right-click from focusing the block,\n\t\t\t// because focus will be handled when opening the block settings dropdown.\n\t\t\tif ( allowRightClickOverrides && event.button === 2 ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t}\n\t\t},\n\t\t[ allowRightClickOverrides ]\n\t);\n\n\tconst settingsPopoverAnchor = useMemo( () => {\n\t\tconst { ownerDocument } = rowRef?.current || {};\n\n\t\t// If no custom position is set, the settings dropdown will be anchored to the\n\t\t// DropdownMenu toggle button.\n\t\tif ( ! settingsAnchorRect || ! ownerDocument ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Position the settings dropdown at the cursor when right-clicking a block.\n\t\treturn {\n\t\t\townerDocument,\n\t\t\tgetBoundingClientRect() {\n\t\t\t\treturn settingsAnchorRect;\n\t\t\t},\n\t\t};\n\t}, [ settingsAnchorRect ] );\n\n\tconst clearSettingsAnchorRect = useCallback( () => {\n\t\t// Clear the custom position for the settings dropdown so that it is restored back\n\t\t// to being anchored to the DropdownMenu toggle button.\n\t\tsetSettingsAnchorRect( undefined );\n\t}, [ setSettingsAnchorRect ] );\n\n\t// Pass in a ref to the row, so that it can be scrolled\n\t// into view when selected. For long lists, the placeholder for the\n\t// selected block is also observed, within ListViewLeafPlaceholder.\n\tuseListViewScrollIntoView( {\n\t\tisSelected,\n\t\trowItemRef: rowRef,\n\t\tselectedClientIds,\n\t} );\n\n\t// When switching between rendering modes (such as template preview and content only),\n\t// it is possible for a block to temporarily be unavailable. In this case, we should not\n\t// render the leaf, to avoid errors further down the tree.\n\tif ( ! block ) {\n\t\treturn null;\n\t}\n\n\tconst blockPositionDescription = getBlockPositionDescription(\n\t\tposition,\n\t\tsiblingBlockCount,\n\t\tlevel\n\t);\n\n\tconst blockPropertiesDescription = getBlockPropertiesDescription(\n\t\tblockInformation,\n\t\tisLocked\n\t);\n\n\tconst blockVisibilityDescription = isBlockHidden\n\t\t? __( 'Block is hidden.' )\n\t\t: null;\n\n\tconst hasSiblings = siblingBlockCount > 0;\n\tconst hasRenderedMovers = showBlockMovers && hasSiblings;\n\tconst moverCellClassName = clsx(\n\t\t'block-editor-list-view-block__mover-cell',\n\t\t{ 'is-visible': isHovered || isSelected }\n\t);\n\n\tconst listViewBlockSettingsClassName = clsx(\n\t\t'block-editor-list-view-block__menu-cell',\n\t\t{ 'is-visible': isHovered || isFirstSelectedBlock }\n\t);\n\n\tlet colSpan;\n\tif ( hasRenderedMovers ) {\n\t\tcolSpan = 2;\n\t} else if ( ! showBlockActions ) {\n\t\tcolSpan = 3;\n\t}\n\n\tconst classes = clsx( {\n\t\t'is-selected': isSelected,\n\t\t'is-first-selected': isFirstSelectedBlock,\n\t\t'is-last-selected': isLastSelectedBlock,\n\t\t'is-branch-selected': isBranchSelected,\n\t\t'is-synced-branch': isSyncedBranch,\n\t\t'is-dragging': isDragged,\n\t\t'has-single-cell': ! showBlockActions,\n\t\t'is-synced': blockInformation?.isSynced,\n\t\t'is-draggable': canMoveBlock,\n\t\t'is-displacement-normal': displacement === 'normal',\n\t\t'is-displacement-up': displacement === 'up',\n\t\t'is-displacement-down': displacement === 'down',\n\t\t'is-after-dragged-blocks': isAfterDraggedBlocks,\n\t\t'is-nesting': isNesting,\n\t} );\n\n\t// Only include all selected blocks if the currently clicked on block\n\t// is one of the selected blocks. This ensures that if a user attempts\n\t// to alter a block that isn't part of the selection, they're still able\n\t// to do so.\n\tconst dropdownClientIds = selectedClientIds.includes( clientId )\n\t\t? selectedClientIds\n\t\t: [ clientId ];\n\n\t// Detect if there is a block in the canvas currently being edited and multi-selection is not happening.\n\tconst currentlyEditingBlockInCanvas =\n\t\tisSelected && selectedClientIds.length === 1;\n\n\treturn (\n\t\t<ListViewLeaf\n\t\t\tclassName={ classes }\n\t\t\tisDragged={ isDragged }\n\t\t\tonKeyDown={ onKeyDown }\n\t\t\tonMouseEnter={ onMouseEnter }\n\t\t\tonMouseLeave={ onMouseLeave }\n\t\t\tonFocus={ onMouseEnter }\n\t\t\tonBlur={ onMouseLeave }\n\t\t\tlevel={ level }\n\t\t\tposition={ position }\n\t\t\trowCount={ rowCount }\n\t\t\tpath={ path }\n\t\t\tid={ `list-view-${ listViewInstanceId }-block-${ clientId }` }\n\t\t\tdata-block={ clientId }\n\t\t\tdata-expanded={ canEditBlock ? isExpanded : undefined }\n\t\t\tref={ rowRef }\n\t\t>\n\t\t\t<TreeGridCell\n\t\t\t\tclassName=\"block-editor-list-view-block__contents-cell\"\n\t\t\t\tcolSpan={ colSpan }\n\t\t\t\tref={ cellRef }\n\t\t\t\taria-selected={ !! isSelected }\n\t\t\t>\n\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t<div className=\"block-editor-list-view-block__contents-container\">\n\t\t\t\t\t\t<ListViewBlockContents\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\tonClick={ selectEditorBlock }\n\t\t\t\t\t\t\tonContextMenu={ onContextMenu }\n\t\t\t\t\t\t\tonMouseDown={ onMouseDown }\n\t\t\t\t\t\t\tonToggleExpanded={ toggleExpanded }\n\t\t\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\t\t\tposition={ position }\n\t\t\t\t\t\t\tsiblingBlockCount={ siblingBlockCount }\n\t\t\t\t\t\t\tlevel={ level }\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\ttabIndex={\n\t\t\t\t\t\t\t\tcurrentlyEditingBlockInCanvas ? 0 : tabIndex\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\tisExpanded={ canEditBlock ? isExpanded : undefined }\n\t\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\t\tariaDescribedBy={ descriptionId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<AriaReferencedText id={ descriptionId }>\n\t\t\t\t\t\t\t{ [\n\t\t\t\t\t\t\t\tblockPositionDescription,\n\t\t\t\t\t\t\t\tblockPropertiesDescription,\n\t\t\t\t\t\t\t\tblockVisibilityDescription,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t\t.filter( Boolean )\n\t\t\t\t\t\t\t\t.join( ' ' ) }\n\t\t\t\t\t\t</AriaReferencedText>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</TreeGridCell>\n\t\t\t{ hasRenderedMovers && (\n\t\t\t\t<>\n\t\t\t\t\t<TreeGridCell\n\t\t\t\t\t\tclassName={ moverCellClassName }\n\t\t\t\t\t\twithoutGridItem\n\t\t\t\t\t>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverUpButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t\t<TreeGridItem>\n\t\t\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t\t\t<BlockMoverDownButton\n\t\t\t\t\t\t\t\t\torientation=\"vertical\"\n\t\t\t\t\t\t\t\t\tclientIds={ [ clientId ] }\n\t\t\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\t\t\ttabIndex={ tabIndex }\n\t\t\t\t\t\t\t\t\tonFocus={ onFocus }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</TreeGridItem>\n\t\t\t\t\t</TreeGridCell>\n\t\t\t\t</>\n\t\t\t) }\n\n\t\t\t{ showBlockActions && BlockSettingsMenu && (\n\t\t\t\t<TreeGridCell\n\t\t\t\t\tclassName={ listViewBlockSettingsClassName }\n\t\t\t\t\taria-selected={ !! isSelected }\n\t\t\t\t\tref={ settingsRef }\n\t\t\t\t>\n\t\t\t\t\t{ ( { ref, tabIndex, onFocus } ) => (\n\t\t\t\t\t\t<BlockSettingsMenu\n\t\t\t\t\t\t\tclientIds={ dropdownClientIds }\n\t\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\t\ticon={ moreVertical }\n\t\t\t\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\t\tanchor: settingsPopoverAnchor, // Used to position the settings at the cursor on right-click.\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ttoggleProps={ {\n\t\t\t\t\t\t\t\tref,\n\t\t\t\t\t\t\t\tclassName: 'block-editor-list-view-block__menu',\n\t\t\t\t\t\t\t\ttabIndex,\n\t\t\t\t\t\t\t\tonClick: clearSettingsAnchorRect,\n\t\t\t\t\t\t\t\tonFocus,\n\t\t\t\t\t\t\t\tsize: 'small',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tdisableOpenOnArrowDown\n\t\t\t\t\t\t\texpand={ expand }\n\t\t\t\t\t\t\texpandedState={ expandedState }\n\t\t\t\t\t\t\tsetInsertedBlock={ setInsertedBlock }\n\t\t\t\t\t\t\t__experimentalSelectBlock={\n\t\t\t\t\t\t\t\tupdateFocusAndSelection\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</TreeGridCell>\n\t\t\t) }\n\t\t</ListViewLeaf>\n\t);\n}\n\nexport default memo( ListViewBlock );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAiB;AAKjB,oBAIO;AACP,wBAGO;AACP,qBAA2C;AAC3C,mBAA6B;AAC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AAY;AAAA,YACZ,iBAAe;AAAA,YAEf;AAAA,0DAAC,kBAAAG,4BAAA,EACE,WAAE,EAAE,KAAK,UAAU,QAAQ,MAC5B;AAAA,gBAAC;AAAA;AAAA,kBACA,aAAY;AAAA,kBACZ,WAAY,CAAE,QAAS;AAAA,kBACvB;AAAA,kBACA;AAAA,kBACA;AAAA;AAAA,cACD,GAEF;AAAA,cACA,4CAAC,kBAAAA,4BAAA,EACE,WAAE,EAAE,KAAK,UAAU,QAAQ,MAC5B;AAAA,gBAAC;AAAA;AAAA,kBACA,aAAY;AAAA,kBACZ,WAAY,CAAE,QAAS;AAAA,kBACvB;AAAA,kBACA;AAAA,kBACA;AAAA;AAAA,cACD,GAEF;AAAA;AAAA;AAAA,QACD,GACD;AAAA,QAGC,oBAAoB,qBACrB;AAAA,UAAC,kBAAAH;AAAA,UAAA;AAAA,YACA,WAAY;AAAA,YACZ,iBAAgB,CAAC,CAAE;AAAA,YACnB,KAAM;AAAA,YAEJ,WAAE,EAAE,KAAK,UAAU,QAAQ,MAC5B;AAAA,cAAC;AAAA;AAAA,gBACA,WAAY;AAAA,gBACZ;AAAA,gBACA,MAAO;AAAA,gBACP,WAAQ,gBAAI,SAAU;AAAA,gBACtB,cAAe;AAAA,kBACd,QAAQ;AAAA;AAAA,gBACT;AAAA,gBACA,aAAc;AAAA,kBACb;AAAA,kBACA,WAAW;AAAA,kBACX;AAAA,kBACA,SAAS;AAAA,kBACT;AAAA,kBACA,MAAM;AAAA,gBACP;AAAA,gBACA,wBAAsB;AAAA,gBACtB;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,2BACC;AAAA;AAAA,YAEF;AAAA;AAAA,QAEF;AAAA;AAAA;AAAA,EAEF;AAEF;AAEA,IAAO,oBAAQ,qBAAM,aAAc;",
6
6
  "names": ["import_utils", "blockEditorStore", "blocksStore", "useBlockDisplayInformation", "usePasteStyles", "useShortcutEventMatch", "isShallowEqual", "useListViewScrollIntoView", "clsx", "ListViewLeaf", "TreeGridCell", "ListViewBlockContents", "AriaReferencedText", "TreeGridItem"]
7
7
  }
@@ -42,43 +42,14 @@ var import_data = require("@wordpress/data");
42
42
  var import_icons = require("@wordpress/icons");
43
43
  var import_deprecated = __toESM(require("@wordpress/deprecated"));
44
44
  var import_media_upload = __toESM(require("../media-upload"));
45
- var import_media_upload_modal = __toESM(require("../media-upload-modal"));
46
45
  var import_check = __toESM(require("../media-upload/check"));
47
46
  var import_url_popover = __toESM(require("../url-popover"));
48
47
  var import_store = require("../../store");
49
48
  var import_use_on_block_drop = require("../use-on-block-drop");
49
+ var import_utils = require("./utils");
50
50
  var import_jsx_runtime = require("react/jsx-runtime");
51
51
  var noop = () => {
52
52
  };
53
- function ConditionalMediaUpload({ render, ...props }) {
54
- const [isModalOpen, setIsModalOpen] = (0, import_element.useState)(false);
55
- const mediaUpload = (0, import_data.useSelect)((select) => {
56
- const { getSettings } = select(import_store.store);
57
- return getSettings().mediaUpload;
58
- }, []);
59
- if (window.__experimentalDataViewsMediaModal) {
60
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
61
- render && render({ open: () => setIsModalOpen(true) }),
62
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
- import_media_upload_modal.default,
64
- {
65
- ...props,
66
- isOpen: isModalOpen,
67
- onClose: () => {
68
- setIsModalOpen(false);
69
- props.onClose?.();
70
- },
71
- onSelect: (media) => {
72
- setIsModalOpen(false);
73
- props.onSelect?.(media);
74
- },
75
- onUpload: mediaUpload
76
- }
77
- )
78
- ] });
79
- }
80
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_media_upload.default, { ...props, render });
81
- }
82
53
  var InsertFromURLPopover = ({
83
54
  src,
84
55
  onChange,
@@ -190,14 +161,26 @@ function MediaPlaceholder({
190
161
  version: "6.4"
191
162
  });
192
163
  }
193
- const mediaUpload = (0, import_data.useSelect)((select) => {
164
+ const { mediaUpload, allowedMimeTypes } = (0, import_data.useSelect)((select) => {
194
165
  const { getSettings } = select(import_store.store);
195
- return getSettings().mediaUpload;
166
+ const settings = getSettings();
167
+ return {
168
+ mediaUpload: settings.mediaUpload,
169
+ allowedMimeTypes: settings.allowedMimeTypes
170
+ };
196
171
  }, []);
197
172
  const [src, setSrc] = (0, import_element.useState)("");
198
173
  (0, import_element.useEffect)(() => {
199
174
  setSrc(value?.src ?? "");
200
175
  }, [value?.src]);
176
+ const computedAccept = (0, import_element.useMemo)(
177
+ () => (0, import_utils.getComputedAcceptAttribute)(
178
+ allowedTypes,
179
+ allowedMimeTypes,
180
+ accept
181
+ ),
182
+ [allowedTypes, allowedMimeTypes, accept]
183
+ );
201
184
  const onlyAllowsImages = () => {
202
185
  if (!allowedTypes || allowedTypes.length === 0) {
203
186
  return false;
@@ -434,7 +417,7 @@ function MediaPlaceholder({
434
417
  };
435
418
  const libraryButton = mediaLibraryButton ?? defaultButton;
436
419
  const uploadMediaLibraryButton = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
437
- ConditionalMediaUpload,
420
+ import_media_upload.default,
438
421
  {
439
422
  addToGallery,
440
423
  gallery: multiple && onlyAllowsImages(),
@@ -453,7 +436,7 @@ function MediaPlaceholder({
453
436
  import_components.FormFileUpload,
454
437
  {
455
438
  onChange: onUpload,
456
- accept,
439
+ accept: computedAccept,
457
440
  multiple: !!multiple,
458
441
  render: ({ openFileDialog }) => {
459
442
  const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
@@ -501,7 +484,7 @@ function MediaPlaceholder({
501
484
  }
502
485
  ),
503
486
  onChange: onUpload,
504
- accept,
487
+ accept: computedAccept,
505
488
  multiple: !!multiple
506
489
  }
507
490
  ),