@wordpress/block-editor 15.17.0 → 15.18.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 (276) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/autocomplete/index.cjs.map +3 -3
  3. package/build/components/background-image-control/index.cjs +2 -1
  4. package/build/components/background-image-control/index.cjs.map +2 -2
  5. package/build/components/block-allowed-blocks/modal.cjs.map +2 -2
  6. package/build/components/block-bindings/attribute-control.cjs.map +3 -3
  7. package/build/components/block-card/index.cjs +2 -2
  8. package/build/components/block-card/index.cjs.map +3 -3
  9. package/build/components/block-mover/button.cjs +9 -3
  10. package/build/components/block-mover/button.cjs.map +2 -2
  11. package/build/components/block-pattern-setup/index.cjs +3 -2
  12. package/build/components/block-pattern-setup/index.cjs.map +2 -2
  13. package/build/components/block-patterns-list/index.cjs +2 -1
  14. package/build/components/block-patterns-list/index.cjs.map +2 -2
  15. package/build/components/block-patterns-paging/index.cjs.map +3 -3
  16. package/build/components/block-settings-menu/block-settings-dropdown.cjs +2 -2
  17. package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +3 -3
  18. package/build/components/block-settings-menu/index.cjs +2 -2
  19. package/build/components/block-settings-menu/index.cjs.map +3 -3
  20. package/build/components/block-styles/menu-items.cjs.map +3 -3
  21. package/build/components/block-switcher/index.cjs.map +3 -3
  22. package/build/components/block-switcher/pattern-transformations-menu.cjs +2 -1
  23. package/build/components/block-switcher/pattern-transformations-menu.cjs.map +2 -2
  24. package/build/components/block-toolbar/pattern-overrides-dropdown.cjs.map +3 -3
  25. package/build/components/block-variation-transforms/index.cjs +2 -1
  26. package/build/components/block-variation-transforms/index.cjs.map +2 -2
  27. package/build/components/block-visibility/viewport-visibility-info.cjs +4 -4
  28. package/build/components/block-visibility/viewport-visibility-info.cjs.map +3 -3
  29. package/build/components/collab/{block-comment-icon-slot.cjs → note-icon-slot.cjs} +8 -8
  30. package/build/components/collab/note-icon-slot.cjs.map +7 -0
  31. package/build/components/collab/{block-comment-icon-toolbar-slot.cjs → note-icon-toolbar-slot.cjs} +9 -9
  32. package/build/components/collab/note-icon-toolbar-slot.cjs.map +7 -0
  33. package/build/components/date-format-picker/index.cjs +2 -1
  34. package/build/components/date-format-picker/index.cjs.map +2 -2
  35. package/build/components/global-styles/color-panel.cjs.map +2 -2
  36. package/build/components/global-styles/dimensions-panel.cjs +87 -62
  37. package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
  38. package/build/components/global-styles/filters-panel.cjs.map +2 -2
  39. package/build/components/global-styles/hooks.cjs +9 -7
  40. package/build/components/global-styles/hooks.cjs.map +2 -2
  41. package/build/components/grid/grid-item-movers.cjs +2 -1
  42. package/build/components/grid/grid-item-movers.cjs.map +2 -2
  43. package/build/components/inserter/block-patterns-tab/pattern-category-previews.cjs.map +2 -2
  44. package/build/components/inserter/menu.cjs +2 -1
  45. package/build/components/inserter/menu.cjs.map +2 -2
  46. package/build/components/inserter/search-results.cjs +3 -3
  47. package/build/components/inserter/search-results.cjs.map +2 -2
  48. package/build/components/inspector-popover-header/index.cjs.map +3 -3
  49. package/build/components/link-control/link-preview.cjs +2 -2
  50. package/build/components/link-control/link-preview.cjs.map +2 -2
  51. package/build/components/link-control/settings.cjs +2 -1
  52. package/build/components/link-control/settings.cjs.map +2 -2
  53. package/build/components/link-picker/link-picker.cjs +3 -2
  54. package/build/components/link-picker/link-picker.cjs.map +2 -2
  55. package/build/components/link-picker/link-preview.cjs +2 -2
  56. package/build/components/link-picker/link-preview.cjs.map +2 -2
  57. package/build/components/list-view/block-select-button.cjs +2 -2
  58. package/build/components/list-view/block-select-button.cjs.map +2 -2
  59. package/build/components/list-view/index.cjs +2 -1
  60. package/build/components/list-view/index.cjs.map +2 -2
  61. package/build/components/provider/index.cjs +80 -7
  62. package/build/components/provider/index.cjs.map +2 -2
  63. package/build/components/responsive-block-control/label.cjs +9 -2
  64. package/build/components/responsive-block-control/label.cjs.map +2 -2
  65. package/build/components/rich-text/event-listeners/paste-handler.cjs +12 -5
  66. package/build/components/rich-text/event-listeners/paste-handler.cjs.map +3 -3
  67. package/build/components/url-popover/image-url-input-ui.cjs +1 -1
  68. package/build/components/url-popover/image-url-input-ui.cjs.map +2 -2
  69. package/build/components/writing-flow/use-arrow-nav.cjs +1 -1
  70. package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
  71. package/build/hooks/block-bindings.cjs.map +3 -3
  72. package/build/hooks/block-fields/link/index.cjs +1 -1
  73. package/build/hooks/block-fields/link/index.cjs.map +1 -1
  74. package/build/hooks/custom-css.cjs +21 -0
  75. package/build/hooks/custom-css.cjs.map +3 -3
  76. package/build/hooks/dimensions.cjs +5 -1
  77. package/build/hooks/dimensions.cjs.map +2 -2
  78. package/build/hooks/grid-visualizer.cjs +1 -1
  79. package/build/hooks/grid-visualizer.cjs.map +1 -1
  80. package/build/hooks/layout-child.cjs +1 -1
  81. package/build/hooks/layout-child.cjs.map +1 -1
  82. package/build/hooks/utils.cjs +4 -0
  83. package/build/hooks/utils.cjs.map +2 -2
  84. package/build/layouts/flex.cjs +5 -8
  85. package/build/layouts/flex.cjs.map +3 -3
  86. package/build/layouts/grid.cjs +5 -5
  87. package/build/layouts/grid.cjs.map +2 -2
  88. package/build/private-apis.cjs +5 -4
  89. package/build/private-apis.cjs.map +3 -3
  90. package/build/store/private-keys.cjs +3 -0
  91. package/build/store/private-keys.cjs.map +2 -2
  92. package/build/utils/dom.cjs +3 -1
  93. package/build/utils/dom.cjs.map +2 -2
  94. package/build-module/components/autocomplete/index.mjs +2 -2
  95. package/build-module/components/autocomplete/index.mjs.map +2 -2
  96. package/build-module/components/background-image-control/index.mjs +2 -2
  97. package/build-module/components/background-image-control/index.mjs.map +2 -2
  98. package/build-module/components/block-allowed-blocks/modal.mjs +2 -2
  99. package/build-module/components/block-allowed-blocks/modal.mjs.map +2 -2
  100. package/build-module/components/block-bindings/attribute-control.mjs +3 -3
  101. package/build-module/components/block-bindings/attribute-control.mjs.map +2 -2
  102. package/build-module/components/block-card/index.mjs +4 -4
  103. package/build-module/components/block-card/index.mjs.map +2 -2
  104. package/build-module/components/block-mover/button.mjs +11 -5
  105. package/build-module/components/block-mover/button.mjs.map +2 -2
  106. package/build-module/components/block-pattern-setup/index.mjs +2 -1
  107. package/build-module/components/block-pattern-setup/index.mjs.map +2 -2
  108. package/build-module/components/block-patterns-list/index.mjs +1 -1
  109. package/build-module/components/block-patterns-list/index.mjs.map +2 -2
  110. package/build-module/components/block-patterns-paging/index.mjs +3 -3
  111. package/build-module/components/block-patterns-paging/index.mjs.map +2 -2
  112. package/build-module/components/block-settings-menu/block-settings-dropdown.mjs +2 -2
  113. package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +2 -2
  114. package/build-module/components/block-settings-menu/index.mjs +2 -2
  115. package/build-module/components/block-settings-menu/index.mjs.map +2 -2
  116. package/build-module/components/block-styles/menu-items.mjs +2 -2
  117. package/build-module/components/block-styles/menu-items.mjs.map +2 -2
  118. package/build-module/components/block-switcher/index.mjs +2 -2
  119. package/build-module/components/block-switcher/index.mjs.map +2 -2
  120. package/build-module/components/block-switcher/pattern-transformations-menu.mjs +2 -7
  121. package/build-module/components/block-switcher/pattern-transformations-menu.mjs.map +2 -2
  122. package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs +2 -2
  123. package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs.map +2 -2
  124. package/build-module/components/block-variation-transforms/index.mjs +2 -2
  125. package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
  126. package/build-module/components/block-visibility/viewport-visibility-info.mjs +6 -6
  127. package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
  128. package/build-module/components/collab/note-icon-slot.mjs +8 -0
  129. package/build-module/components/collab/note-icon-slot.mjs.map +7 -0
  130. package/build-module/components/collab/note-icon-toolbar-slot.mjs +10 -0
  131. package/build-module/components/collab/note-icon-toolbar-slot.mjs.map +7 -0
  132. package/build-module/components/date-format-picker/index.mjs +2 -2
  133. package/build-module/components/date-format-picker/index.mjs.map +2 -2
  134. package/build-module/components/global-styles/color-panel.mjs.map +2 -2
  135. package/build-module/components/global-styles/dimensions-panel.mjs +87 -62
  136. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  137. package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
  138. package/build-module/components/global-styles/hooks.mjs +9 -7
  139. package/build-module/components/global-styles/hooks.mjs.map +2 -2
  140. package/build-module/components/grid/grid-item-movers.mjs +2 -5
  141. package/build-module/components/grid/grid-item-movers.mjs.map +2 -2
  142. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.mjs +3 -3
  143. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.mjs.map +1 -1
  144. package/build-module/components/inserter/menu.mjs +3 -2
  145. package/build-module/components/inserter/menu.mjs.map +2 -2
  146. package/build-module/components/inserter/search-results.mjs +1 -1
  147. package/build-module/components/inserter/search-results.mjs.map +1 -1
  148. package/build-module/components/inspector-popover-header/index.mjs +2 -2
  149. package/build-module/components/inspector-popover-header/index.mjs.map +2 -2
  150. package/build-module/components/link-control/link-preview.mjs +2 -2
  151. package/build-module/components/link-control/link-preview.mjs.map +2 -2
  152. package/build-module/components/link-control/settings.mjs +3 -2
  153. package/build-module/components/link-control/settings.mjs.map +2 -2
  154. package/build-module/components/link-picker/link-picker.mjs +1 -1
  155. package/build-module/components/link-picker/link-picker.mjs.map +2 -2
  156. package/build-module/components/link-picker/link-preview.mjs +2 -2
  157. package/build-module/components/link-picker/link-preview.mjs.map +2 -2
  158. package/build-module/components/list-view/block-select-button.mjs +2 -2
  159. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  160. package/build-module/components/list-view/index.mjs +2 -4
  161. package/build-module/components/list-view/index.mjs.map +2 -2
  162. package/build-module/components/provider/index.mjs +82 -8
  163. package/build-module/components/provider/index.mjs.map +2 -2
  164. package/build-module/components/responsive-block-control/label.mjs +9 -2
  165. package/build-module/components/responsive-block-control/label.mjs.map +2 -2
  166. package/build-module/components/rich-text/event-listeners/paste-handler.mjs +12 -5
  167. package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
  168. package/build-module/components/url-popover/image-url-input-ui.mjs +1 -1
  169. package/build-module/components/url-popover/image-url-input-ui.mjs.map +2 -2
  170. package/build-module/components/writing-flow/use-arrow-nav.mjs +1 -1
  171. package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
  172. package/build-module/hooks/block-bindings.mjs +2 -2
  173. package/build-module/hooks/block-bindings.mjs.map +2 -2
  174. package/build-module/hooks/block-fields/link/index.mjs +1 -1
  175. package/build-module/hooks/block-fields/link/index.mjs.map +1 -1
  176. package/build-module/hooks/custom-css.mjs +23 -2
  177. package/build-module/hooks/custom-css.mjs.map +2 -2
  178. package/build-module/hooks/dimensions.mjs +5 -1
  179. package/build-module/hooks/dimensions.mjs.map +2 -2
  180. package/build-module/hooks/grid-visualizer.mjs +1 -1
  181. package/build-module/hooks/grid-visualizer.mjs.map +1 -1
  182. package/build-module/hooks/layout-child.mjs +1 -1
  183. package/build-module/hooks/layout-child.mjs.map +1 -1
  184. package/build-module/hooks/utils.mjs +4 -0
  185. package/build-module/hooks/utils.mjs.map +2 -2
  186. package/build-module/layouts/flex.mjs +4 -7
  187. package/build-module/layouts/flex.mjs.map +2 -2
  188. package/build-module/layouts/grid.mjs +4 -4
  189. package/build-module/layouts/grid.mjs.map +2 -2
  190. package/build-module/private-apis.mjs +7 -5
  191. package/build-module/private-apis.mjs.map +2 -2
  192. package/build-module/store/private-keys.mjs +2 -0
  193. package/build-module/store/private-keys.mjs.map +2 -2
  194. package/build-module/utils/dom.mjs +2 -1
  195. package/build-module/utils/dom.mjs.map +2 -2
  196. package/build-style/content-rtl.css +1 -4
  197. package/build-style/content.css +1 -4
  198. package/build-style/style-rtl.css +12 -12
  199. package/build-style/style.css +12 -12
  200. package/build-types/utils/dom.d.ts +7 -0
  201. package/build-types/utils/dom.d.ts.map +1 -1
  202. package/package.json +39 -38
  203. package/src/components/autocomplete/index.js +4 -2
  204. package/src/components/background-image-control/index.js +2 -2
  205. package/src/components/background-image-control/style.scss +1 -1
  206. package/src/components/block-allowed-blocks/modal.js +3 -3
  207. package/src/components/block-bindings/attribute-control.js +4 -4
  208. package/src/components/block-card/index.js +5 -5
  209. package/src/components/block-list/content.scss +0 -4
  210. package/src/components/block-mover/button.js +17 -7
  211. package/src/components/block-pattern-setup/index.js +2 -1
  212. package/src/components/block-pattern-setup/style.scss +2 -2
  213. package/src/components/block-patterns-list/index.js +1 -1
  214. package/src/components/block-patterns-list/style.scss +1 -1
  215. package/src/components/block-patterns-paging/index.js +5 -6
  216. package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
  217. package/src/components/block-settings-menu/index.js +2 -2
  218. package/src/components/block-styles/menu-items.js +3 -3
  219. package/src/components/block-switcher/index.js +3 -3
  220. package/src/components/block-switcher/pattern-transformations-menu.js +2 -7
  221. package/src/components/block-switcher/style.scss +2 -2
  222. package/src/components/block-toolbar/pattern-overrides-dropdown.js +2 -2
  223. package/src/components/block-variation-transforms/index.js +2 -2
  224. package/src/components/block-visibility/viewport-visibility-info.js +7 -7
  225. package/src/components/collab/note-icon-slot.js +8 -0
  226. package/src/components/collab/note-icon-toolbar-slot.js +10 -0
  227. package/src/components/date-format-picker/index.js +4 -2
  228. package/src/components/global-styles/color-panel.js +0 -2
  229. package/src/components/global-styles/dimensions-panel.js +100 -73
  230. package/src/components/global-styles/filters-panel.js +0 -2
  231. package/src/components/global-styles/hooks.js +9 -7
  232. package/src/components/global-styles/style.scss +1 -1
  233. package/src/components/grid/grid-item-movers.js +2 -5
  234. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -5
  235. package/src/components/inserter/menu.js +3 -2
  236. package/src/components/inserter/search-results.js +1 -1
  237. package/src/components/inserter/style.scss +2 -2
  238. package/src/components/inserter-list-item/style.scss +1 -1
  239. package/src/components/inspector-popover-header/index.js +2 -2
  240. package/src/components/link-control/link-preview.js +3 -3
  241. package/src/components/link-control/settings.js +3 -2
  242. package/src/components/link-picker/link-picker.js +1 -1
  243. package/src/components/link-picker/link-preview.js +3 -3
  244. package/src/components/list-view/block-select-button.js +3 -3
  245. package/src/components/list-view/index.js +2 -4
  246. package/src/components/list-view/style.scss +1 -1
  247. package/src/components/media-placeholder/content.scss +1 -1
  248. package/src/components/provider/index.js +149 -8
  249. package/src/components/responsive-block-control/label.js +5 -2
  250. package/src/components/rich-text/event-listeners/paste-handler.js +18 -4
  251. package/src/components/url-input/style.scss +1 -1
  252. package/src/components/url-popover/image-url-input-ui.js +1 -1
  253. package/src/components/writing-flow/use-arrow-nav.js +9 -2
  254. package/src/hooks/block-bindings.js +3 -3
  255. package/src/hooks/block-fields/link/index.js +1 -1
  256. package/src/hooks/custom-css.js +30 -9
  257. package/src/hooks/dimensions.js +6 -1
  258. package/src/hooks/grid-visualizer.js +1 -1
  259. package/src/hooks/layout-child.js +1 -1
  260. package/src/hooks/test/dimensions.js +16 -0
  261. package/src/hooks/test/style.js +2 -0
  262. package/src/hooks/utils.js +4 -0
  263. package/src/layouts/flex.js +7 -9
  264. package/src/layouts/grid.js +7 -4
  265. package/src/private-apis.js +6 -4
  266. package/src/store/private-keys.js +1 -0
  267. package/src/utils/dom.js +3 -3
  268. package/src/utils/test/dom.js +47 -4
  269. package/build/components/collab/block-comment-icon-slot.cjs.map +0 -7
  270. package/build/components/collab/block-comment-icon-toolbar-slot.cjs.map +0 -7
  271. package/build-module/components/collab/block-comment-icon-slot.mjs +0 -8
  272. package/build-module/components/collab/block-comment-icon-slot.mjs.map +0 -7
  273. package/build-module/components/collab/block-comment-icon-toolbar-slot.mjs +0 -10
  274. package/build-module/components/collab/block-comment-icon-toolbar-slot.mjs.map +0 -7
  275. package/src/components/collab/block-comment-icon-slot.js +0 -8
  276. package/src/components/collab/block-comment-icon-toolbar-slot.js +0 -10
@@ -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\tTooltip,\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';\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';\nimport { getBlockVisibilityLabel } from '../block-visibility';\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 { hasPatternName, blockVisibility } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockAttributes } = unlock( select( blockEditorStore ) );\n\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\treturn {\n\t\t\t\thasPatternName: !! attributes?.metadata?.patternName,\n\t\t\t\tblockVisibility: attributes?.metadata?.blockVisibility,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst shouldShowLockIcon = isLocked;\n\tconst isSticky = blockInformation?.positionType === 'sticky';\n\tconst images = useListViewImages( { clientId, isExpanded } );\n\n\t// Determine visibility label from blockVisibility metadata\n\tconst visibilityLabel = getBlockVisibilityLabel( blockVisibility );\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{ !! visibilityLabel && (\n\t\t\t\t\t<Tooltip text={ visibilityLabel }>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__block-visibility\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon icon={ unseen } />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Tooltip>\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": ";AAGA,OAAO,UAAU;AAKjB;AAAA,EACC,wBAAwB;AAAA,EACxB,0BAA0B;AAAA,EAC1B;AAAA,EACA,eAAe;AAAA,OACT;AACP,SAAS,kBAAkB;AAC3B;AAAA,EACC;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,OAAO,aAAa;AAC7B,SAAS,iBAAiB;AAK1B,OAAO,eAAe;AACtB,OAAO,gCAAgC;AACvC,OAAO,0BAA0B;AACjC,OAAO,sBAAsB;AAC7B,SAAS,oBAAoB;AAC7B,OAAO,uBAAuB;AAC9B,SAAS,SAAS,wBAAwB;AAC1C,SAAS,cAAc;AACvB,SAAS,+BAA+B;AAqFrC,cAMA,YANA;AAnFH,IAAM,EAAE,MAAM,IAAI,OAAQ,qBAAsB;AAEhD,SAAS,0BACR;AAAA,EACC;AAAA,EACA,OAAO,EAAE,SAAS;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,GACA,KACC;AACD,QAAM,mBAAmB,2BAA4B,QAAS;AAC9D,QAAM,aAAa,qBAAsB;AAAA,IACxC;AAAA,IACA,SAAS;AAAA,EACV,CAAE;AACF,QAAM,EAAE,SAAS,IAAI,aAAc,QAAS;AAC5C,QAAM,EAAE,gBAAgB,gBAAgB,IAAI;AAAA,IAC3C,CAAE,WAAY;AACb,YAAM,EAAE,mBAAm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f,8BAAC,SAAM,WAAU,sDACd,2BAAiB,QACpB,GACD;AAAA,cAEC,YACD,oBAAC,UAAK,WAAU,sDACf,8BAAC,QAAK,MAAO,UAAW,GACzB;AAAA,cAEC,OAAO,SACR;AAAA,gBAAC;AAAA;AAAA,kBACA,WAAU;AAAA,kBACV,eAAW;AAAA,kBAET,iBAAO,IAAK,CAAE,OAAO,UACtB;AAAA,oBAAC;AAAA;AAAA,sBACA,WAAU;AAAA,sBAEV,OAAQ;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,CAAC,CAAE,mBACJ,oBAAC,WAAQ,MAAO,iBACf;AAAA,gBAAC;AAAA;AAAA,kBACA,WAAU;AAAA,kBACV,eAAY;AAAA,kBAEZ,8BAAC,QAAK,MAAO,QAAS;AAAA;AAAA,cACvB,GACD;AAAA,cAEC,sBACD,oBAAC,UAAK,WAAU,oDACf,8BAAC,QAAK,MAAO,MAAO,GACrB;AAAA;AAAA;AAAA,QAEF;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,8BAAQ,WAAY,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\tTooltip,\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';\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';\nimport { getBlockVisibilityLabel } from '../block-visibility';\n\nconst { Badge: WCBadge } = 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 { hasPatternName, blockVisibility } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockAttributes } = unlock( select( blockEditorStore ) );\n\t\t\tconst attributes = getBlockAttributes( clientId );\n\t\t\treturn {\n\t\t\t\thasPatternName: !! attributes?.metadata?.patternName,\n\t\t\t\tblockVisibility: attributes?.metadata?.blockVisibility,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst shouldShowLockIcon = isLocked;\n\tconst isSticky = blockInformation?.positionType === 'sticky';\n\tconst images = useListViewImages( { clientId, isExpanded } );\n\n\t// Determine visibility label from blockVisibility metadata\n\tconst visibilityLabel = getBlockVisibilityLabel( blockVisibility );\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<WCBadge 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</WCBadge>\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{ !! visibilityLabel && (\n\t\t\t\t\t<Tooltip text={ visibilityLabel }>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tclassName=\"block-editor-list-view-block-select-button__block-visibility\"\n\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon icon={ unseen } />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Tooltip>\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": ";AAGA,OAAO,UAAU;AAKjB;AAAA,EACC,wBAAwB;AAAA,EACxB,0BAA0B;AAAA,EAC1B;AAAA,EACA,eAAe;AAAA,OACT;AACP,SAAS,kBAAkB;AAC3B;AAA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,kBAKb,CACC;AAAA;AAAA,cACH,IACG;AAAA,cACF,CAAC,CAAE,mBACJ,oBAAC,WAAQ,MAAO,iBACf;AAAA,gBAAC;AAAA;AAAA,kBACA,WAAU;AAAA,kBACV,eAAY;AAAA,kBAEZ,8BAAC,QAAK,MAAO,QAAS;AAAA;AAAA,cACvB,GACD;AAAA,cAEC,sBACD,oBAAC,UAAK,WAAU,oDACf,8BAAC,QAAK,MAAO,MAAO,GACrB;AAAA;AAAA;AAAA,QAEF;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,8BAAQ,WAAY,yBAA0B;",
6
6
  "names": []
7
7
  }
@@ -5,10 +5,8 @@ import {
5
5
  useMergeRefs,
6
6
  __experimentalUseFixedWindowList as useFixedWindowList
7
7
  } from "@wordpress/compose";
8
- import {
9
- __experimentalTreeGrid as TreeGrid,
10
- VisuallyHidden
11
- } from "@wordpress/components";
8
+ import { __experimentalTreeGrid as TreeGrid } from "@wordpress/components";
9
+ import { VisuallyHidden } from "@wordpress/ui";
12
10
  import { AsyncModeProvider, useSelect } from "@wordpress/data";
13
11
  import deprecated from "@wordpress/deprecated";
14
12
  import {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/list-view/index.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseInstanceId,\n\tuseMergeRefs,\n\t__experimentalUseFixedWindowList as useFixedWindowList,\n} from '@wordpress/compose';\nimport {\n\t__experimentalTreeGrid as TreeGrid,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { AsyncModeProvider, useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseRef,\n\tuseReducer,\n\tforwardRef,\n\tuseState,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ListViewBranch from './branch';\nimport { ListViewContext } from './context';\nimport ListViewDropIndicatorPreview from './drop-indicator';\nimport useBlockSelection from './use-block-selection';\nimport useListViewBlockIndexes from './use-list-view-block-indexes';\nimport useListViewClientIds from './use-list-view-client-ids';\nimport useListViewCollapseItems from './use-list-view-collapse-items';\nimport useListViewDropZone from './use-list-view-drop-zone';\nimport useListViewExpandSelectedItem from './use-list-view-expand-selected-item';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockSettingsDropdown } from '../block-settings-menu/block-settings-dropdown';\nimport { focusListItem } from './utils';\nimport useClipboardHandler from './use-clipboard-handler';\n\nconst expanded = ( state, action ) => {\n\tif ( action.type === 'clear' ) {\n\t\treturn {};\n\t}\n\tif ( Array.isArray( action.clientIds ) ) {\n\t\treturn {\n\t\t\t...state,\n\t\t\t...action.clientIds.reduce(\n\t\t\t\t( newState, id ) => ( {\n\t\t\t\t\t...newState,\n\t\t\t\t\t[ id ]: action.type === 'expand',\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t\t),\n\t\t};\n\t}\n\treturn state;\n};\n\nexport const BLOCK_LIST_ITEM_HEIGHT = 32;\n\n/** @typedef {React.ComponentType} ComponentType */\n/** @typedef {React.Ref<HTMLElement>} Ref */\n\n/**\n * Show a hierarchical list of blocks.\n *\n * @param {Object} props Components props.\n * @param {string} props.id An HTML element id for the root element of ListView.\n * @param {Array} props.blocks _deprecated_ Custom subset of block client IDs to be used instead of the default hierarchy.\n * @param {?HTMLElement} props.dropZoneElement Optional element to be used as the drop zone.\n * @param {?boolean} props.showBlockMovers Flag to enable block movers. Defaults to `false`.\n * @param {?boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. Defaults to `false`.\n * @param {?boolean} props.showAppender Flag to show or hide the block appender. Defaults to `false`.\n * @param {?ComponentType} props.blockSettingsMenu Optional more menu substitution. Defaults to the standard `BlockSettingsDropdown` component.\n * @param {string} props.rootClientId The client id of the root block from which we determine the blocks to show in the list.\n * @param {string} props.description Optional accessible description for the tree grid component.\n * @param {?Function} props.onSelect Optional callback to be invoked when a block is selected. Receives the block object that was selected.\n * @param {?ComponentType} props.additionalBlockContent Component that renders additional block content UI.\n * @param {Ref} ref Forwarded ref\n */\nfunction ListViewComponent(\n\t{\n\t\tid,\n\t\tblocks,\n\t\tdropZoneElement,\n\t\tshowBlockMovers = false,\n\t\tisExpanded = false,\n\t\tshowAppender = false,\n\t\tblockSettingsMenu: BlockSettingsMenu = BlockSettingsDropdown,\n\t\trootClientId,\n\t\tdescription,\n\t\tonSelect,\n\t\tadditionalBlockContent: AdditionalBlockContent,\n\t},\n\tref\n) {\n\t// This can be removed once we no longer need to support the blocks prop.\n\tif ( blocks ) {\n\t\tdeprecated(\n\t\t\t'`blocks` property in `wp.blockEditor.__experimentalListView`',\n\t\t\t{\n\t\t\t\tsince: '6.3',\n\t\t\t\talternative: '`rootClientId` property',\n\t\t\t}\n\t\t);\n\t}\n\n\tconst instanceId = useInstanceId( ListViewComponent );\n\tconst { clientIdsTree, draggedClientIds, selectedClientIds } =\n\t\tuseListViewClientIds( { blocks, rootClientId } );\n\tconst blockIndexes = useListViewBlockIndexes( clientIdsTree );\n\n\tconst { getBlock, getSelectedBlockClientIds } =\n\t\tuseSelect( blockEditorStore );\n\tconst { visibleBlockCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getGlobalBlockCount, getClientIdsOfDescendants } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst draggedBlockCount =\n\t\t\t\tdraggedClientIds?.length > 0\n\t\t\t\t\t? getClientIdsOfDescendants( draggedClientIds ).length + 1\n\t\t\t\t\t: 0;\n\t\t\treturn {\n\t\t\t\tvisibleBlockCount: getGlobalBlockCount() - draggedBlockCount,\n\t\t\t};\n\t\t},\n\t\t[ draggedClientIds ]\n\t);\n\n\tconst { updateBlockSelection } = useBlockSelection();\n\n\tconst [ expandedState, setExpandedState ] = useReducer( expanded, {} );\n\n\tconst [ insertedBlock, setInsertedBlock ] = useState( null );\n\n\tconst { setSelectedTreeId } = useListViewExpandSelectedItem( {\n\t\tfirstSelectedBlockClientId: selectedClientIds[ 0 ],\n\t\tsetExpandedState,\n\t} );\n\tconst selectEditorBlock = useCallback(\n\t\t/**\n\t\t * @param {MouseEvent | KeyboardEvent | undefined} event\n\t\t * @param {string} blockClientId\n\t\t * @param {null | undefined | -1 | 1} focusPosition\n\t\t */\n\t\t( event, blockClientId, focusPosition ) => {\n\t\t\tupdateBlockSelection( event, blockClientId, null, focusPosition );\n\t\t\tsetSelectedTreeId( blockClientId );\n\t\t\tif ( onSelect ) {\n\t\t\t\tonSelect( getBlock( blockClientId ) );\n\t\t\t}\n\t\t},\n\t\t[ setSelectedTreeId, updateBlockSelection, onSelect, getBlock ]\n\t);\n\n\tconst { ref: dropZoneRef, target: blockDropTarget } = useListViewDropZone( {\n\t\tdropZoneElement,\n\t\texpandedState,\n\t\tsetExpandedState,\n\t} );\n\tconst elementRef = useRef();\n\n\t// Allow handling of copy, cut, and paste events.\n\tconst clipBoardRef = useClipboardHandler( {\n\t\tselectBlock: selectEditorBlock,\n\t} );\n\n\tconst focusSelectedBlock = useCallback(\n\t\t( node ) => {\n\t\t\tconst [ firstSelectedClientId ] = getSelectedBlockClientIds();\n\t\t\t// If a blocks are already selected when the list view is initially\n\t\t\t// mounted, shift focus to the first selected block.\n\t\t\tif ( firstSelectedClientId && node ) {\n\t\t\t\tfocusListItem( firstSelectedClientId, node );\n\t\t\t}\n\t\t},\n\t\t[ getSelectedBlockClientIds ]\n\t);\n\n\tconst treeGridRef = useMergeRefs( [\n\t\tclipBoardRef,\n\t\tfocusSelectedBlock,\n\t\telementRef,\n\t\tdropZoneRef,\n\t\tref,\n\t] );\n\n\tconst expand = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst clientIds = Array.isArray( clientId )\n\t\t\t\t? clientId\n\t\t\t\t: [ clientId ];\n\t\t\tsetExpandedState( { type: 'expand', clientIds } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapse = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetExpandedState( { type: 'collapse', clientIds: [ clientId ] } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapseAll = useCallback( () => {\n\t\tsetExpandedState( { type: 'clear' } );\n\t}, [ setExpandedState ] );\n\tconst expandRow = useCallback(\n\t\t( row ) => {\n\t\t\texpand( row?.dataset?.block );\n\t\t},\n\t\t[ expand ]\n\t);\n\tconst collapseRow = useCallback(\n\t\t( row ) => {\n\t\t\tcollapse( row?.dataset?.block );\n\t\t},\n\t\t[ collapse ]\n\t);\n\tconst focusRow = useCallback(\n\t\t( event, startRow, endRow ) => {\n\t\t\tif ( event.shiftKey ) {\n\t\t\t\tupdateBlockSelection(\n\t\t\t\t\tevent,\n\t\t\t\t\tstartRow?.dataset?.block,\n\t\t\t\t\tendRow?.dataset?.block\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ updateBlockSelection ]\n\t);\n\n\tuseListViewCollapseItems( {\n\t\tcollapseAll,\n\t\texpand,\n\t} );\n\n\tconst firstDraggedBlockClientId = draggedClientIds?.[ 0 ];\n\n\t// Convert a blockDropTarget into indexes relative to the blocks in the list view.\n\t// These values are used to determine which blocks should be displaced to make room\n\t// for the drop indicator. See `ListViewBranch` and `getDragDisplacementValues`.\n\tconst { blockDropTargetIndex, blockDropPosition, firstDraggedBlockIndex } =\n\t\tuseMemo( () => {\n\t\t\tlet _blockDropTargetIndex, _firstDraggedBlockIndex;\n\n\t\t\tif ( blockDropTarget?.clientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ blockDropTarget.clientId ];\n\t\t\t\t// If dragging below or inside the block, treat the drop target as the next block.\n\t\t\t\t_blockDropTargetIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t} else if ( blockDropTarget === null ) {\n\t\t\t\t// A `null` value is used to indicate that the user is dragging outside of the list view.\n\t\t\t\t_blockDropTargetIndex = null;\n\t\t\t}\n\n\t\t\tif ( firstDraggedBlockClientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ firstDraggedBlockClientId ];\n\t\t\t\t_firstDraggedBlockIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tblockDropTargetIndex: _blockDropTargetIndex,\n\t\t\t\tblockDropPosition: blockDropTarget?.dropPosition,\n\t\t\t\tfirstDraggedBlockIndex: _firstDraggedBlockIndex,\n\t\t\t};\n\t\t}, [ blockDropTarget, blockIndexes, firstDraggedBlockClientId ] );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\n\t\t\tcollapse,\n\t\t\tcollapseAll,\n\t\t\tBlockSettingsMenu,\n\t\t\tlistViewInstanceId: instanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\ttreeGridElementRef: elementRef,\n\t\t\trootClientId,\n\t\t} ),\n\t\t[\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\n\t\t\tcollapse,\n\t\t\tcollapseAll,\n\t\t\tBlockSettingsMenu,\n\t\t\tinstanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\trootClientId,\n\t\t]\n\t);\n\n\t// List View renders a fixed number of items and relies on each having a fixed item height of 36px.\n\t// If this value changes, we should also change the itemHeight value set in useFixedWindowList.\n\t// See: https://github.com/WordPress/gutenberg/pull/35230 for additional context.\n\tconst [ fixedListWindow ] = useFixedWindowList(\n\t\telementRef,\n\t\tBLOCK_LIST_ITEM_HEIGHT,\n\t\tvisibleBlockCount,\n\t\t{\n\t\t\t// Ensure that the windowing logic is recalculated when the expanded state changes.\n\t\t\t// This is necessary because expanding a collapsed block in a short list view can\n\t\t\t// switch the list view to a tall list view with a scrollbar, and vice versa.\n\t\t\t// When this happens, the windowing logic needs to be recalculated to ensure that\n\t\t\t// the correct number of blocks are rendered, by rechecking for a scroll container.\n\t\t\texpandedState,\n\t\t\tuseWindowing: true,\n\t\t\twindowOverscan: 40,\n\t\t}\n\t);\n\n\t// If there are no blocks to show and we're not showing the appender, do not render the list view.\n\tif ( ! clientIdsTree.length && ! showAppender ) {\n\t\treturn null;\n\t}\n\n\tconst describedById =\n\t\tdescription && `block-editor-list-view-description-${ instanceId }`;\n\n\treturn (\n\t\t<AsyncModeProvider value>\n\t\t\t<ListViewDropIndicatorPreview\n\t\t\t\tdraggedBlockClientId={ firstDraggedBlockClientId }\n\t\t\t\tlistViewRef={ elementRef }\n\t\t\t\tblockDropTarget={ blockDropTarget }\n\t\t\t/>\n\t\t\t{ description && (\n\t\t\t\t<VisuallyHidden id={ describedById }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t\t<TreeGrid\n\t\t\t\tid={ id }\n\t\t\t\tclassName={ clsx( 'block-editor-list-view-tree', {\n\t\t\t\t\t'is-dragging':\n\t\t\t\t\t\tdraggedClientIds?.length > 0 &&\n\t\t\t\t\t\tblockDropTargetIndex !== undefined,\n\t\t\t\t} ) }\n\t\t\t\taria-label={ __( 'Block navigation structure' ) }\n\t\t\t\tref={ treeGridRef }\n\t\t\t\tonCollapseRow={ collapseRow }\n\t\t\t\tonExpandRow={ expandRow }\n\t\t\t\tonFocusRow={ focusRow }\n\t\t\t\tapplicationAriaLabel={ __( 'Block navigation structure' ) }\n\t\t\t\taria-describedby={ describedById }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-admin--list-view-dragged-items-height':\n\t\t\t\t\t\tdraggedClientIds?.length\n\t\t\t\t\t\t\t? `${\n\t\t\t\t\t\t\t\t\tBLOCK_LIST_ITEM_HEIGHT *\n\t\t\t\t\t\t\t\t\t( draggedClientIds.length - 1 )\n\t\t\t\t\t\t\t }px`\n\t\t\t\t\t\t\t: null,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ListViewContext.Provider value={ contextValue }>\n\t\t\t\t\t<ListViewBranch\n\t\t\t\t\t\tblocks={ clientIdsTree }\n\t\t\t\t\t\tparentId={ rootClientId }\n\t\t\t\t\t\tselectBlock={ selectEditorBlock }\n\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\tfixedListWindow={ fixedListWindow }\n\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\tshowAppender={ showAppender }\n\t\t\t\t\t/>\n\t\t\t\t</ListViewContext.Provider>\n\t\t\t</TreeGrid>\n\t\t</AsyncModeProvider>\n\t);\n}\n\n// This is the private API for the ListView component.\n// It allows access to all props, not just the public ones.\nexport const PrivateListView = forwardRef( ListViewComponent );\n\n// This is the public API for the ListView component.\n// We wrap the PrivateListView component to hide some props from the public API.\nexport default forwardRef( ( props, ref ) => {\n\treturn (\n\t\t<PrivateListView\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tshowAppender={ false }\n\t\t\trootClientId={ null }\n\t\t\tonSelect={ null }\n\t\t\tadditionalBlockContent={ null }\n\t\t\tblockSettingsMenu={ undefined }\n\t\t/>\n\t);\n} );\n"],
5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AAAA,MACzB,mBAAoB;AAAA;AAAA,EACrB;AAEF,CAAE;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseInstanceId,\n\tuseMergeRefs,\n\t__experimentalUseFixedWindowList as useFixedWindowList,\n} from '@wordpress/compose';\nimport { __experimentalTreeGrid as TreeGrid } from '@wordpress/components';\nimport { VisuallyHidden } from '@wordpress/ui';\nimport { AsyncModeProvider, useSelect } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport {\n\tuseCallback,\n\tuseMemo,\n\tuseRef,\n\tuseReducer,\n\tforwardRef,\n\tuseState,\n} from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ListViewBranch from './branch';\nimport { ListViewContext } from './context';\nimport ListViewDropIndicatorPreview from './drop-indicator';\nimport useBlockSelection from './use-block-selection';\nimport useListViewBlockIndexes from './use-list-view-block-indexes';\nimport useListViewClientIds from './use-list-view-client-ids';\nimport useListViewCollapseItems from './use-list-view-collapse-items';\nimport useListViewDropZone from './use-list-view-drop-zone';\nimport useListViewExpandSelectedItem from './use-list-view-expand-selected-item';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockSettingsDropdown } from '../block-settings-menu/block-settings-dropdown';\nimport { focusListItem } from './utils';\nimport useClipboardHandler from './use-clipboard-handler';\n\nconst expanded = ( state, action ) => {\n\tif ( action.type === 'clear' ) {\n\t\treturn {};\n\t}\n\tif ( Array.isArray( action.clientIds ) ) {\n\t\treturn {\n\t\t\t...state,\n\t\t\t...action.clientIds.reduce(\n\t\t\t\t( newState, id ) => ( {\n\t\t\t\t\t...newState,\n\t\t\t\t\t[ id ]: action.type === 'expand',\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t\t),\n\t\t};\n\t}\n\treturn state;\n};\n\nexport const BLOCK_LIST_ITEM_HEIGHT = 32;\n\n/** @typedef {React.ComponentType} ComponentType */\n/** @typedef {React.Ref<HTMLElement>} Ref */\n\n/**\n * Show a hierarchical list of blocks.\n *\n * @param {Object} props Components props.\n * @param {string} props.id An HTML element id for the root element of ListView.\n * @param {Array} props.blocks _deprecated_ Custom subset of block client IDs to be used instead of the default hierarchy.\n * @param {?HTMLElement} props.dropZoneElement Optional element to be used as the drop zone.\n * @param {?boolean} props.showBlockMovers Flag to enable block movers. Defaults to `false`.\n * @param {?boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. Defaults to `false`.\n * @param {?boolean} props.showAppender Flag to show or hide the block appender. Defaults to `false`.\n * @param {?ComponentType} props.blockSettingsMenu Optional more menu substitution. Defaults to the standard `BlockSettingsDropdown` component.\n * @param {string} props.rootClientId The client id of the root block from which we determine the blocks to show in the list.\n * @param {string} props.description Optional accessible description for the tree grid component.\n * @param {?Function} props.onSelect Optional callback to be invoked when a block is selected. Receives the block object that was selected.\n * @param {?ComponentType} props.additionalBlockContent Component that renders additional block content UI.\n * @param {Ref} ref Forwarded ref\n */\nfunction ListViewComponent(\n\t{\n\t\tid,\n\t\tblocks,\n\t\tdropZoneElement,\n\t\tshowBlockMovers = false,\n\t\tisExpanded = false,\n\t\tshowAppender = false,\n\t\tblockSettingsMenu: BlockSettingsMenu = BlockSettingsDropdown,\n\t\trootClientId,\n\t\tdescription,\n\t\tonSelect,\n\t\tadditionalBlockContent: AdditionalBlockContent,\n\t},\n\tref\n) {\n\t// This can be removed once we no longer need to support the blocks prop.\n\tif ( blocks ) {\n\t\tdeprecated(\n\t\t\t'`blocks` property in `wp.blockEditor.__experimentalListView`',\n\t\t\t{\n\t\t\t\tsince: '6.3',\n\t\t\t\talternative: '`rootClientId` property',\n\t\t\t}\n\t\t);\n\t}\n\n\tconst instanceId = useInstanceId( ListViewComponent );\n\tconst { clientIdsTree, draggedClientIds, selectedClientIds } =\n\t\tuseListViewClientIds( { blocks, rootClientId } );\n\tconst blockIndexes = useListViewBlockIndexes( clientIdsTree );\n\n\tconst { getBlock, getSelectedBlockClientIds } =\n\t\tuseSelect( blockEditorStore );\n\tconst { visibleBlockCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getGlobalBlockCount, getClientIdsOfDescendants } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst draggedBlockCount =\n\t\t\t\tdraggedClientIds?.length > 0\n\t\t\t\t\t? getClientIdsOfDescendants( draggedClientIds ).length + 1\n\t\t\t\t\t: 0;\n\t\t\treturn {\n\t\t\t\tvisibleBlockCount: getGlobalBlockCount() - draggedBlockCount,\n\t\t\t};\n\t\t},\n\t\t[ draggedClientIds ]\n\t);\n\n\tconst { updateBlockSelection } = useBlockSelection();\n\n\tconst [ expandedState, setExpandedState ] = useReducer( expanded, {} );\n\n\tconst [ insertedBlock, setInsertedBlock ] = useState( null );\n\n\tconst { setSelectedTreeId } = useListViewExpandSelectedItem( {\n\t\tfirstSelectedBlockClientId: selectedClientIds[ 0 ],\n\t\tsetExpandedState,\n\t} );\n\tconst selectEditorBlock = useCallback(\n\t\t/**\n\t\t * @param {MouseEvent | KeyboardEvent | undefined} event\n\t\t * @param {string} blockClientId\n\t\t * @param {null | undefined | -1 | 1} focusPosition\n\t\t */\n\t\t( event, blockClientId, focusPosition ) => {\n\t\t\tupdateBlockSelection( event, blockClientId, null, focusPosition );\n\t\t\tsetSelectedTreeId( blockClientId );\n\t\t\tif ( onSelect ) {\n\t\t\t\tonSelect( getBlock( blockClientId ) );\n\t\t\t}\n\t\t},\n\t\t[ setSelectedTreeId, updateBlockSelection, onSelect, getBlock ]\n\t);\n\n\tconst { ref: dropZoneRef, target: blockDropTarget } = useListViewDropZone( {\n\t\tdropZoneElement,\n\t\texpandedState,\n\t\tsetExpandedState,\n\t} );\n\tconst elementRef = useRef();\n\n\t// Allow handling of copy, cut, and paste events.\n\tconst clipBoardRef = useClipboardHandler( {\n\t\tselectBlock: selectEditorBlock,\n\t} );\n\n\tconst focusSelectedBlock = useCallback(\n\t\t( node ) => {\n\t\t\tconst [ firstSelectedClientId ] = getSelectedBlockClientIds();\n\t\t\t// If a blocks are already selected when the list view is initially\n\t\t\t// mounted, shift focus to the first selected block.\n\t\t\tif ( firstSelectedClientId && node ) {\n\t\t\t\tfocusListItem( firstSelectedClientId, node );\n\t\t\t}\n\t\t},\n\t\t[ getSelectedBlockClientIds ]\n\t);\n\n\tconst treeGridRef = useMergeRefs( [\n\t\tclipBoardRef,\n\t\tfocusSelectedBlock,\n\t\telementRef,\n\t\tdropZoneRef,\n\t\tref,\n\t] );\n\n\tconst expand = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst clientIds = Array.isArray( clientId )\n\t\t\t\t? clientId\n\t\t\t\t: [ clientId ];\n\t\t\tsetExpandedState( { type: 'expand', clientIds } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapse = useCallback(\n\t\t( clientId ) => {\n\t\t\tif ( ! clientId ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetExpandedState( { type: 'collapse', clientIds: [ clientId ] } );\n\t\t},\n\t\t[ setExpandedState ]\n\t);\n\tconst collapseAll = useCallback( () => {\n\t\tsetExpandedState( { type: 'clear' } );\n\t}, [ setExpandedState ] );\n\tconst expandRow = useCallback(\n\t\t( row ) => {\n\t\t\texpand( row?.dataset?.block );\n\t\t},\n\t\t[ expand ]\n\t);\n\tconst collapseRow = useCallback(\n\t\t( row ) => {\n\t\t\tcollapse( row?.dataset?.block );\n\t\t},\n\t\t[ collapse ]\n\t);\n\tconst focusRow = useCallback(\n\t\t( event, startRow, endRow ) => {\n\t\t\tif ( event.shiftKey ) {\n\t\t\t\tupdateBlockSelection(\n\t\t\t\t\tevent,\n\t\t\t\t\tstartRow?.dataset?.block,\n\t\t\t\t\tendRow?.dataset?.block\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[ updateBlockSelection ]\n\t);\n\n\tuseListViewCollapseItems( {\n\t\tcollapseAll,\n\t\texpand,\n\t} );\n\n\tconst firstDraggedBlockClientId = draggedClientIds?.[ 0 ];\n\n\t// Convert a blockDropTarget into indexes relative to the blocks in the list view.\n\t// These values are used to determine which blocks should be displaced to make room\n\t// for the drop indicator. See `ListViewBranch` and `getDragDisplacementValues`.\n\tconst { blockDropTargetIndex, blockDropPosition, firstDraggedBlockIndex } =\n\t\tuseMemo( () => {\n\t\t\tlet _blockDropTargetIndex, _firstDraggedBlockIndex;\n\n\t\t\tif ( blockDropTarget?.clientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ blockDropTarget.clientId ];\n\t\t\t\t// If dragging below or inside the block, treat the drop target as the next block.\n\t\t\t\t_blockDropTargetIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t} else if ( blockDropTarget === null ) {\n\t\t\t\t// A `null` value is used to indicate that the user is dragging outside of the list view.\n\t\t\t\t_blockDropTargetIndex = null;\n\t\t\t}\n\n\t\t\tif ( firstDraggedBlockClientId ) {\n\t\t\t\tconst foundBlockIndex =\n\t\t\t\t\tblockIndexes[ firstDraggedBlockClientId ];\n\t\t\t\t_firstDraggedBlockIndex =\n\t\t\t\t\tfoundBlockIndex === undefined ||\n\t\t\t\t\tblockDropTarget?.dropPosition === 'top'\n\t\t\t\t\t\t? foundBlockIndex\n\t\t\t\t\t\t: foundBlockIndex + 1;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tblockDropTargetIndex: _blockDropTargetIndex,\n\t\t\t\tblockDropPosition: blockDropTarget?.dropPosition,\n\t\t\t\tfirstDraggedBlockIndex: _firstDraggedBlockIndex,\n\t\t\t};\n\t\t}, [ blockDropTarget, blockIndexes, firstDraggedBlockClientId ] );\n\n\tconst contextValue = useMemo(\n\t\t() => ( {\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\n\t\t\tcollapse,\n\t\t\tcollapseAll,\n\t\t\tBlockSettingsMenu,\n\t\t\tlistViewInstanceId: instanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\ttreeGridElementRef: elementRef,\n\t\t\trootClientId,\n\t\t} ),\n\t\t[\n\t\t\tblockDropPosition,\n\t\t\tblockDropTargetIndex,\n\t\t\tblockIndexes,\n\t\t\tdraggedClientIds,\n\t\t\texpandedState,\n\t\t\texpand,\n\t\t\tfirstDraggedBlockIndex,\n\t\t\tcollapse,\n\t\t\tcollapseAll,\n\t\t\tBlockSettingsMenu,\n\t\t\tinstanceId,\n\t\t\tAdditionalBlockContent,\n\t\t\tinsertedBlock,\n\t\t\tsetInsertedBlock,\n\t\t\trootClientId,\n\t\t]\n\t);\n\n\t// List View renders a fixed number of items and relies on each having a fixed item height of 36px.\n\t// If this value changes, we should also change the itemHeight value set in useFixedWindowList.\n\t// See: https://github.com/WordPress/gutenberg/pull/35230 for additional context.\n\tconst [ fixedListWindow ] = useFixedWindowList(\n\t\telementRef,\n\t\tBLOCK_LIST_ITEM_HEIGHT,\n\t\tvisibleBlockCount,\n\t\t{\n\t\t\t// Ensure that the windowing logic is recalculated when the expanded state changes.\n\t\t\t// This is necessary because expanding a collapsed block in a short list view can\n\t\t\t// switch the list view to a tall list view with a scrollbar, and vice versa.\n\t\t\t// When this happens, the windowing logic needs to be recalculated to ensure that\n\t\t\t// the correct number of blocks are rendered, by rechecking for a scroll container.\n\t\t\texpandedState,\n\t\t\tuseWindowing: true,\n\t\t\twindowOverscan: 40,\n\t\t}\n\t);\n\n\t// If there are no blocks to show and we're not showing the appender, do not render the list view.\n\tif ( ! clientIdsTree.length && ! showAppender ) {\n\t\treturn null;\n\t}\n\n\tconst describedById =\n\t\tdescription && `block-editor-list-view-description-${ instanceId }`;\n\n\treturn (\n\t\t<AsyncModeProvider value>\n\t\t\t<ListViewDropIndicatorPreview\n\t\t\t\tdraggedBlockClientId={ firstDraggedBlockClientId }\n\t\t\t\tlistViewRef={ elementRef }\n\t\t\t\tblockDropTarget={ blockDropTarget }\n\t\t\t/>\n\t\t\t{ description && (\n\t\t\t\t<VisuallyHidden id={ describedById }>\n\t\t\t\t\t{ description }\n\t\t\t\t</VisuallyHidden>\n\t\t\t) }\n\t\t\t<TreeGrid\n\t\t\t\tid={ id }\n\t\t\t\tclassName={ clsx( 'block-editor-list-view-tree', {\n\t\t\t\t\t'is-dragging':\n\t\t\t\t\t\tdraggedClientIds?.length > 0 &&\n\t\t\t\t\t\tblockDropTargetIndex !== undefined,\n\t\t\t\t} ) }\n\t\t\t\taria-label={ __( 'Block navigation structure' ) }\n\t\t\t\tref={ treeGridRef }\n\t\t\t\tonCollapseRow={ collapseRow }\n\t\t\t\tonExpandRow={ expandRow }\n\t\t\t\tonFocusRow={ focusRow }\n\t\t\t\tapplicationAriaLabel={ __( 'Block navigation structure' ) }\n\t\t\t\taria-describedby={ describedById }\n\t\t\t\tstyle={ {\n\t\t\t\t\t'--wp-admin--list-view-dragged-items-height':\n\t\t\t\t\t\tdraggedClientIds?.length\n\t\t\t\t\t\t\t? `${\n\t\t\t\t\t\t\t\t\tBLOCK_LIST_ITEM_HEIGHT *\n\t\t\t\t\t\t\t\t\t( draggedClientIds.length - 1 )\n\t\t\t\t\t\t\t }px`\n\t\t\t\t\t\t\t: null,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t<ListViewContext.Provider value={ contextValue }>\n\t\t\t\t\t<ListViewBranch\n\t\t\t\t\t\tblocks={ clientIdsTree }\n\t\t\t\t\t\tparentId={ rootClientId }\n\t\t\t\t\t\tselectBlock={ selectEditorBlock }\n\t\t\t\t\t\tshowBlockMovers={ showBlockMovers }\n\t\t\t\t\t\tfixedListWindow={ fixedListWindow }\n\t\t\t\t\t\tselectedClientIds={ selectedClientIds }\n\t\t\t\t\t\tisExpanded={ isExpanded }\n\t\t\t\t\t\tshowAppender={ showAppender }\n\t\t\t\t\t/>\n\t\t\t\t</ListViewContext.Provider>\n\t\t\t</TreeGrid>\n\t\t</AsyncModeProvider>\n\t);\n}\n\n// This is the private API for the ListView component.\n// It allows access to all props, not just the public ones.\nexport const PrivateListView = forwardRef( ListViewComponent );\n\n// This is the public API for the ListView component.\n// We wrap the PrivateListView component to hide some props from the public API.\nexport default forwardRef( ( props, ref ) => {\n\treturn (\n\t\t<PrivateListView\n\t\t\tref={ ref }\n\t\t\t{ ...props }\n\t\t\tshowAppender={ false }\n\t\t\trootClientId={ null }\n\t\t\tonSelect={ null }\n\t\t\tadditionalBlockContent={ null }\n\t\t\tblockSettingsMenu={ undefined }\n\t\t/>\n\t);\n} );\n"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB;AAAA,EACC;AAAA,EACA;AAAA,EACA,oCAAoC;AAAA,OAC9B;AACP,SAAS,0BAA0B,gBAAgB;AACnD,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB,iBAAiB;AAC7C,OAAO,gBAAgB;AACvB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,UAAU;AAKnB,OAAO,oBAAoB;AAC3B,SAAS,uBAAuB;AAChC,OAAO,kCAAkC;AACzC,OAAO,uBAAuB;AAC9B,OAAO,6BAA6B;AACpC,OAAO,0BAA0B;AACjC,OAAO,8BAA8B;AACrC,OAAO,yBAAyB;AAChC,OAAO,mCAAmC;AAC1C,SAAS,SAAS,wBAAwB;AAC1C,SAAS,6BAA6B;AACtC,SAAS,qBAAqB;AAC9B,OAAO,yBAAyB;AAsT9B,SACC,KADD;AApTF,IAAM,WAAW,CAAE,OAAO,WAAY;AACrC,MAAK,OAAO,SAAS,SAAU;AAC9B,WAAO,CAAC;AAAA,EACT;AACA,MAAK,MAAM,QAAS,OAAO,SAAU,GAAI;AACx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CACC,kBAAkB,SACf,GACA,0BACE,iBAAiB,SAAS,EAC5B,OACA;AAAA,QACL;AAAA,QAEA,8BAAC,gBAAgB,UAAhB,EAAyB,OAAQ,cACjC;AAAA,UAAC;AAAA;AAAA,YACA,QAAS;AAAA,YACT,UAAW;AAAA,YACX,aAAc;AAAA,YACd;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACD,GACD;AAAA;AAAA,IACD;AAAA,KACD;AAEF;AAIO,IAAM,kBAAkB,WAAY,iBAAkB;AAI7D,IAAO,oBAAQ,WAAY,CAAE,OAAO,QAAS;AAC5C,SACC;AAAA,IAAC;AAAA;AAAA,MACA;AAAA,MACE,GAAG;AAAA,MACL,cAAe;AAAA,MACf,cAAe;AAAA,MACf,UAAW;AAAA,MACX,wBAAyB;AAAA,MACzB,mBAAoB;AAAA;AAAA,EACrB;AAEF,CAAE;",
6
6
  "names": []
7
7
  }
@@ -5,7 +5,8 @@ import { SlotFillProvider } from "@wordpress/components";
5
5
  import {
6
6
  MediaUploadProvider,
7
7
  store as uploadStore,
8
- detectClientSideMediaSupport
8
+ detectClientSideMediaSupport,
9
+ isHeicCanvasSupported
9
10
  } from "@wordpress/upload-media";
10
11
  import withRegistryProvider from "./with-registry-provider.mjs";
11
12
  import useBlockSync from "./use-block-sync.mjs";
@@ -21,6 +22,8 @@ var noop = () => {
21
22
  };
22
23
  var hasLoggedFallback = false;
23
24
  var isClientSideMediaEnabledCache = null;
25
+ var isHeicCanvasEnabledCache = null;
26
+ var HEIC_MIME_TYPES = ["image/heic", "image/heif"];
24
27
  function shouldEnableClientSideMediaProcessing() {
25
28
  if (isClientSideMediaEnabledCache !== null) {
26
29
  return isClientSideMediaEnabledCache;
@@ -47,6 +50,25 @@ function shouldEnableClientSideMediaProcessing() {
47
50
  isClientSideMediaEnabledCache = true;
48
51
  return true;
49
52
  }
53
+ function shouldEnableHeicCanvasProcessing() {
54
+ if (isHeicCanvasEnabledCache !== null) {
55
+ return isHeicCanvasEnabledCache;
56
+ }
57
+ if (shouldEnableClientSideMediaProcessing()) {
58
+ isHeicCanvasEnabledCache = false;
59
+ return false;
60
+ }
61
+ if (!window.__heicUploadSupport) {
62
+ isHeicCanvasEnabledCache = false;
63
+ return false;
64
+ }
65
+ if (typeof isHeicCanvasSupported !== "function" || !isHeicCanvasSupported()) {
66
+ isHeicCanvasEnabledCache = false;
67
+ return false;
68
+ }
69
+ isHeicCanvasEnabledCache = true;
70
+ return true;
71
+ }
50
72
  function mediaUpload(registry, settings, {
51
73
  allowedTypes,
52
74
  additionalData = {},
@@ -69,6 +91,58 @@ function mediaUpload(registry, settings, {
69
91
  allowedTypes
70
92
  });
71
93
  }
94
+ function heicMediaUpload(registry, settings, {
95
+ allowedTypes,
96
+ additionalData = {},
97
+ filesList,
98
+ onError = noop,
99
+ onFileChange,
100
+ onSuccess,
101
+ onBatchSuccess
102
+ }) {
103
+ const files = Array.from(filesList);
104
+ const heicFiles = files.filter(
105
+ (file) => HEIC_MIME_TYPES.includes(file.type)
106
+ );
107
+ const otherFiles = files.filter(
108
+ (file) => !HEIC_MIME_TYPES.includes(file.type)
109
+ );
110
+ const hasBothPaths = heicFiles.length > 0 && otherFiles.length > 0 && settings?.mediaUpload;
111
+ let pathsRemaining = hasBothPaths ? 2 : 1;
112
+ const coordinatedBatchSuccess = hasBothPaths ? () => {
113
+ pathsRemaining--;
114
+ if (pathsRemaining <= 0) {
115
+ onBatchSuccess?.();
116
+ }
117
+ } : onBatchSuccess;
118
+ if (heicFiles.length > 0) {
119
+ void registry.dispatch(uploadStore).addItems({
120
+ files: heicFiles,
121
+ onChange: onFileChange,
122
+ onSuccess: (attachments) => {
123
+ settings?.[mediaUploadOnSuccessKey]?.(attachments);
124
+ onSuccess?.(attachments);
125
+ },
126
+ onBatchSuccess: coordinatedBatchSuccess,
127
+ onError: (error) => onError(
128
+ typeof error === "string" ? error : error?.message ?? ""
129
+ ),
130
+ additionalData,
131
+ allowedTypes
132
+ });
133
+ }
134
+ if (otherFiles.length > 0 && settings?.mediaUpload) {
135
+ settings.mediaUpload({
136
+ allowedTypes,
137
+ additionalData,
138
+ filesList: otherFiles,
139
+ onError,
140
+ onFileChange,
141
+ onSuccess,
142
+ onBatchSuccess: coordinatedBatchSuccess
143
+ });
144
+ }
145
+ }
72
146
  function BlockSyncEffect(props) {
73
147
  useBlockSync(props);
74
148
  return null;
@@ -82,14 +156,13 @@ var ExperimentalBlockEditorProvider = withRegistryProvider(
82
156
  } = props;
83
157
  const mediaUploadSettings = useMediaUploadSettings(_settings);
84
158
  const isClientSideMediaEnabled = shouldEnableClientSideMediaProcessing();
159
+ const isHeicCanvasEnabled = shouldEnableHeicCanvasProcessing();
160
+ const useUploadMediaPipeline = isClientSideMediaEnabled || isHeicCanvasEnabled;
85
161
  const isMediaUploadIntercepted = !!_settings?.mediaUpload?.__isMediaUploadInterceptor;
86
162
  const settings = useMemo(() => {
87
- if (isClientSideMediaEnabled && _settings?.mediaUpload && !isMediaUploadIntercepted) {
88
- const interceptor = mediaUpload.bind(
89
- null,
90
- registry,
91
- _settings
92
- );
163
+ if (useUploadMediaPipeline && _settings?.mediaUpload && !isMediaUploadIntercepted) {
164
+ const uploadFn = isClientSideMediaEnabled ? mediaUpload : heicMediaUpload;
165
+ const interceptor = uploadFn.bind(null, registry, _settings);
93
166
  interceptor.__isMediaUploadInterceptor = true;
94
167
  return {
95
168
  ..._settings,
@@ -100,6 +173,7 @@ var ExperimentalBlockEditorProvider = withRegistryProvider(
100
173
  }, [
101
174
  _settings,
102
175
  registry,
176
+ useUploadMediaPipeline,
103
177
  isClientSideMediaEnabled,
104
178
  isMediaUploadIntercepted
105
179
  ]);
@@ -149,7 +223,7 @@ var ExperimentalBlockEditorProvider = withRegistryProvider(
149
223
  ),
150
224
  children
151
225
  ] });
152
- if (isClientSideMediaEnabled && !isMediaUploadIntercepted) {
226
+ if (useUploadMediaPipeline && !isMediaUploadIntercepted) {
153
227
  return /* @__PURE__ */ jsx(
154
228
  MediaUploadProvider,
155
229
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/provider/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect, useMemo, useRef } from '@wordpress/element';\nimport { SlotFillProvider } from '@wordpress/components';\nimport {\n\tMediaUploadProvider,\n\tstore as uploadStore,\n\tdetectClientSideMediaSupport,\n} from '@wordpress/upload-media';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport useBlockSync from './use-block-sync';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockRefsProvider } from './block-refs-provider';\nimport { unlock } from '../../lock-unlock';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport useMediaUploadSettings from './use-media-upload-settings';\nimport { mediaUploadOnSuccessKey } from '../../store/private-keys';\nimport { SelectionContext } from './selection-context';\n\n/** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */\n\nconst noop = () => {};\n\n/**\n * Flag to track if we've already logged the fallback message.\n */\nlet hasLoggedFallback = false;\n\n/**\n * Cached result of whether client-side media processing should be enabled.\n * This is computed once per session for efficiency and stability.\n */\nlet isClientSideMediaEnabledCache = null;\n\n/**\n * Checks if client-side media processing should be enabled.\n *\n * Returns true only if:\n * 1. The client-side media processing flag is enabled\n * 2. The browser supports WebAssembly, SharedArrayBuffer, cross-origin isolation, and CSP allows blob workers\n *\n * The result is cached for the session to ensure stability during React renders.\n *\n * @return {boolean} Whether client-side media processing should be enabled.\n */\nfunction shouldEnableClientSideMediaProcessing() {\n\t// Return cached result if available.\n\tif ( isClientSideMediaEnabledCache !== null ) {\n\t\treturn isClientSideMediaEnabledCache;\n\t}\n\n\t// Check if the client-side media processing flag is enabled first.\n\tif ( ! window.__clientSideMediaProcessing ) {\n\t\tisClientSideMediaEnabledCache = false;\n\t\treturn false;\n\t}\n\n\t// Safety check in case the import is unavailable.\n\tif ( typeof detectClientSideMediaSupport !== 'function' ) {\n\t\tisClientSideMediaEnabledCache = false;\n\t\treturn false;\n\t}\n\n\tconst detection = detectClientSideMediaSupport();\n\tif ( ! detection || ! detection.supported ) {\n\t\t// Only log once per session to avoid console spam.\n\t\tif ( ! hasLoggedFallback ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.info(\n\t\t\t\t`Client-side media processing unavailable: ${ detection.reason }. Using server-side processing.`\n\t\t\t);\n\t\t\thasLoggedFallback = true;\n\t\t}\n\t\tisClientSideMediaEnabledCache = false;\n\t\treturn false;\n\t}\n\n\tisClientSideMediaEnabledCache = true;\n\treturn true;\n}\n\n/**\n * Upload a media file when the file upload button is activated\n * or when adding a file to the editor via drag & drop.\n *\n * @param {WPDataRegistry} registry\n * @param {Object} settings Block editor settings.\n * @param {Object} $3 Parameters object passed to the function.\n * @param {Array} $3.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param {Object} $3.additionalData Additional data to include in the request.\n * @param {Array<File>} $3.filesList List of files.\n * @param {Function} $3.onError Function called when an error happens.\n * @param {Function} $3.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param {Function} $3.onSuccess Function called once a file has completely finished uploading, including thumbnails.\n * @param {Function} $3.onBatchSuccess Function called once all files in a group have completely finished uploading, including thumbnails.\n */\nfunction mediaUpload(\n\tregistry,\n\tsettings,\n\t{\n\t\tallowedTypes,\n\t\tadditionalData = {},\n\t\tfilesList,\n\t\tonError = noop,\n\t\tonFileChange,\n\t\tonSuccess,\n\t\tonBatchSuccess,\n\t}\n) {\n\tvoid registry.dispatch( uploadStore ).addItems( {\n\t\tfiles: Array.from( filesList ),\n\t\tonChange: onFileChange,\n\t\tonSuccess: ( attachments ) => {\n\t\t\tsettings?.[ mediaUploadOnSuccessKey ]?.( attachments );\n\t\t\tonSuccess?.( attachments );\n\t\t},\n\t\tonBatchSuccess,\n\t\tonError: ( error ) =>\n\t\t\tonError( typeof error === 'string' ? error : error?.message ?? '' ),\n\t\tadditionalData,\n\t\tallowedTypes,\n\t} );\n}\n\n/**\n * Calls useBlockSync as a child of SelectionContext.Provider so that the\n * hook can read selection state from the context provided by this tree\n * rather than from a parent provider (which may not exist for the root).\n *\n * @param {Object} props Props forwarded to useBlockSync.\n */\nfunction BlockSyncEffect( props ) {\n\tuseBlockSync( props );\n\treturn null;\n}\n\nexport const ExperimentalBlockEditorProvider = withRegistryProvider(\n\t( props ) => {\n\t\tconst {\n\t\t\tsettings: _settings,\n\t\t\tregistry,\n\t\t\tstripExperimentalSettings = false,\n\t\t} = props;\n\n\t\tconst mediaUploadSettings = useMediaUploadSettings( _settings );\n\n\t\tconst isClientSideMediaEnabled =\n\t\t\tshouldEnableClientSideMediaProcessing();\n\n\t\t// Nested providers (e.g. from useBlockPreview) inherit settings\n\t\t// where mediaUpload has already been replaced with the\n\t\t// interceptor. Detect this so we skip the replacement and\n\t\t// MediaUploadProvider for them \u2014 see the longer comment below.\n\t\tconst isMediaUploadIntercepted =\n\t\t\t!! _settings?.mediaUpload?.__isMediaUploadInterceptor;\n\n\t\tconst settings = useMemo( () => {\n\t\t\tif (\n\t\t\t\tisClientSideMediaEnabled &&\n\t\t\t\t_settings?.mediaUpload &&\n\t\t\t\t! isMediaUploadIntercepted\n\t\t\t) {\n\t\t\t\t// Create a new object so that the original props.settings.mediaUpload is not modified.\n\t\t\t\tconst interceptor = mediaUpload.bind(\n\t\t\t\t\tnull,\n\t\t\t\t\tregistry,\n\t\t\t\t\t_settings\n\t\t\t\t);\n\t\t\t\tinterceptor.__isMediaUploadInterceptor = true;\n\t\t\t\treturn {\n\t\t\t\t\t..._settings,\n\t\t\t\t\tmediaUpload: interceptor,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn _settings;\n\t\t}, [\n\t\t\t_settings,\n\t\t\tregistry,\n\t\t\tisClientSideMediaEnabled,\n\t\t\tisMediaUploadIntercepted,\n\t\t] );\n\n\t\tconst { __experimentalUpdateSettings } = unlock(\n\t\t\tuseDispatch( blockEditorStore )\n\t\t);\n\t\tuseEffect( () => {\n\t\t\t__experimentalUpdateSettings(\n\t\t\t\t{\n\t\t\t\t\t...settings,\n\t\t\t\t\t__internalIsInitialized: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tstripExperimentalSettings,\n\t\t\t\t\treset: true,\n\t\t\t\t}\n\t\t\t);\n\t\t}, [\n\t\t\tsettings,\n\t\t\tstripExperimentalSettings,\n\t\t\t__experimentalUpdateSettings,\n\t\t] );\n\n\t\t// Store selection and onChangeSelection in refs and expose\n\t\t// stable getters/callers so that the context value is a\n\t\t// complete constant. This prevents re-rendering the entire\n\t\t// block tree (including async-rendered off-screen blocks)\n\t\t// when either value changes.\n\t\tconst selectionRef = useRef( props.selection );\n\t\tselectionRef.current = props.selection;\n\t\tconst onChangeSelectionRef = useRef( props.onChangeSelection ?? noop );\n\t\tonChangeSelectionRef.current = props.onChangeSelection ?? noop;\n\n\t\tconst selectionContextValue = useMemo(\n\t\t\t() => ( {\n\t\t\t\tgetSelection: () => selectionRef.current,\n\t\t\t\tonChangeSelection: ( ...args ) =>\n\t\t\t\t\tonChangeSelectionRef.current( ...args ),\n\t\t\t} ),\n\t\t\t[]\n\t\t);\n\n\t\tconst children = (\n\t\t\t<SlotFillProvider passthrough>\n\t\t\t\t{ ! settings?.isPreviewMode && <KeyboardShortcuts.Register /> }\n\t\t\t\t<BlockRefsProvider>{ props.children }</BlockRefsProvider>\n\t\t\t</SlotFillProvider>\n\t\t);\n\n\t\tconst content = (\n\t\t\t<SelectionContext.Provider value={ selectionContextValue }>\n\t\t\t\t<BlockSyncEffect\n\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\tvalue={ props.value }\n\t\t\t\t\tonChange={ props.onChange }\n\t\t\t\t\tonInput={ props.onInput }\n\t\t\t\t/>\n\t\t\t\t{ children }\n\t\t\t</SelectionContext.Provider>\n\t\t);\n\n\t\t// MediaUploadProvider writes the mediaUpload function from\n\t\t// _settings into the shared upload-media store so the store can\n\t\t// hand files off to the server. useMediaUploadSettings extracts\n\t\t// mediaUpload from the original _settings prop \u2014 *before* the\n\t\t// interceptor replacement above \u2014 so the store receives the\n\t\t// real server-side upload function.\n\t\t//\n\t\t// Only the first (outermost) provider should do this.\n\t\t// Nested providers (e.g. from useBlockPreview in\n\t\t// core/post-template) inherit settings that already contain\n\t\t// the interceptor, so their MediaUploadProvider would\n\t\t// overwrite the store's server-side function with the\n\t\t// interceptor, causing uploads to loop instead of reaching\n\t\t// the server.\n\t\tif ( isClientSideMediaEnabled && ! isMediaUploadIntercepted ) {\n\t\t\treturn (\n\t\t\t\t<MediaUploadProvider\n\t\t\t\t\tsettings={ mediaUploadSettings }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t{ content }\n\t\t\t\t</MediaUploadProvider>\n\t\t\t);\n\t\t}\n\n\t\treturn content;\n\t}\n);\n\nexport const BlockEditorProvider = ( props ) => {\n\treturn (\n\t\t<ExperimentalBlockEditorProvider { ...props } stripExperimentalSettings>\n\t\t\t{ props.children }\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n};\n\nexport default BlockEditorProvider;\n"],
5
- "mappings": ";AAGA,SAAS,mBAAmB;AAC5B,SAAS,WAAW,SAAS,cAAc;AAC3C,SAAS,wBAAwB;AACjC;AAAA,EACC;AAAA,EACA,SAAS;AAAA,EACT;AAAA,OACM;AAKP,OAAO,0BAA0B;AACjC,OAAO,kBAAkB;AACzB,SAAS,SAAS,wBAAwB;AAC1C,SAAS,yBAAyB;AAClC,SAAS,cAAc;AACvB,OAAO,uBAAuB;AAC9B,OAAO,4BAA4B;AACnC,SAAS,+BAA+B;AACxC,SAAS,wBAAwB;AA6M9B,SACgC,KADhC;AAzMH,IAAM,OAAO,MAAM;AAAC;AAKpB,IAAI,oBAAoB;AAMxB,IAAI,gCAAgC;AAapC,SAAS,wCAAwC;AAEhD,MAAK,kCAAkC,MAAO;AAC7C,WAAO;AAAA,EACR;AAGA,MAAK,CAAE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ACC;AAAA,QAAC;AAAA;AAAA,UACA,UAAW;AAAA,UACX,gBAAiB;AAAA,UAEf;AAAA;AAAA,MACH;AAAA,IAEF;AAEA,WAAO;AAAA,EACR;AACD;AAEO,IAAM,sBAAsB,CAAE,UAAW;AAC/C,SACC,oBAAC,mCAAkC,GAAG,OAAQ,2BAAyB,MACpE,gBAAM,UACT;AAEF;AAEA,IAAO,mBAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect, useMemo, useRef } from '@wordpress/element';\nimport { SlotFillProvider } from '@wordpress/components';\nimport {\n\tMediaUploadProvider,\n\tstore as uploadStore,\n\tdetectClientSideMediaSupport,\n\tisHeicCanvasSupported,\n} from '@wordpress/upload-media';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport useBlockSync from './use-block-sync';\nimport { store as blockEditorStore } from '../../store';\nimport { BlockRefsProvider } from './block-refs-provider';\nimport { unlock } from '../../lock-unlock';\nimport KeyboardShortcuts from '../keyboard-shortcuts';\nimport useMediaUploadSettings from './use-media-upload-settings';\nimport { mediaUploadOnSuccessKey } from '../../store/private-keys';\nimport { SelectionContext } from './selection-context';\n\n/** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */\n\nconst noop = () => {};\n\n/**\n * Flag to track if we've already logged the fallback message.\n */\nlet hasLoggedFallback = false;\n\n/**\n * Cached result of whether client-side media processing should be enabled.\n * This is computed once per session for efficiency and stability.\n */\nlet isClientSideMediaEnabledCache = null;\n\n/**\n * Cached result of whether HEIC-only canvas processing should be enabled.\n */\nlet isHeicCanvasEnabledCache = null;\n\n/**\n * HEIC MIME types that should be routed through the upload-media pipeline\n * when in HEIC-only mode.\n */\nconst HEIC_MIME_TYPES = [ 'image/heic', 'image/heif' ];\n\n/**\n * Checks if client-side media processing should be enabled.\n *\n * Returns true only if:\n * 1. The client-side media processing flag is enabled\n * 2. The browser supports WebAssembly, SharedArrayBuffer, cross-origin isolation, and CSP allows blob workers\n *\n * The result is cached for the session to ensure stability during React renders.\n *\n * @return {boolean} Whether client-side media processing should be enabled.\n */\nfunction shouldEnableClientSideMediaProcessing() {\n\t// Return cached result if available.\n\tif ( isClientSideMediaEnabledCache !== null ) {\n\t\treturn isClientSideMediaEnabledCache;\n\t}\n\n\t// Check if the client-side media processing flag is enabled first.\n\tif ( ! window.__clientSideMediaProcessing ) {\n\t\tisClientSideMediaEnabledCache = false;\n\t\treturn false;\n\t}\n\n\t// Safety check in case the import is unavailable.\n\tif ( typeof detectClientSideMediaSupport !== 'function' ) {\n\t\tisClientSideMediaEnabledCache = false;\n\t\treturn false;\n\t}\n\n\tconst detection = detectClientSideMediaSupport();\n\tif ( ! detection || ! detection.supported ) {\n\t\t// Only log once per session to avoid console spam.\n\t\tif ( ! hasLoggedFallback ) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.info(\n\t\t\t\t`Client-side media processing unavailable: ${ detection.reason }. Using server-side processing.`\n\t\t\t);\n\t\t\thasLoggedFallback = true;\n\t\t}\n\t\tisClientSideMediaEnabledCache = false;\n\t\treturn false;\n\t}\n\n\tisClientSideMediaEnabledCache = true;\n\treturn true;\n}\n\n/**\n * Checks if HEIC-only canvas processing should be enabled.\n *\n * Returns true when:\n * 1. Full client-side processing is NOT available (otherwise it handles HEIC already)\n * 2. The server has set the __heicUploadSupport flag\n * 3. The browser supports createImageBitmap + OffscreenCanvas (e.g. Safari)\n *\n * @return {boolean} Whether HEIC-only canvas processing should be enabled.\n */\nfunction shouldEnableHeicCanvasProcessing() {\n\tif ( isHeicCanvasEnabledCache !== null ) {\n\t\treturn isHeicCanvasEnabledCache;\n\t}\n\n\t// If full client-side processing is enabled, it already handles HEIC.\n\tif ( shouldEnableClientSideMediaProcessing() ) {\n\t\tisHeicCanvasEnabledCache = false;\n\t\treturn false;\n\t}\n\n\tif ( ! window.__heicUploadSupport ) {\n\t\tisHeicCanvasEnabledCache = false;\n\t\treturn false;\n\t}\n\n\tif (\n\t\ttypeof isHeicCanvasSupported !== 'function' ||\n\t\t! isHeicCanvasSupported()\n\t) {\n\t\tisHeicCanvasEnabledCache = false;\n\t\treturn false;\n\t}\n\n\tisHeicCanvasEnabledCache = true;\n\treturn true;\n}\n\n/**\n * Upload a media file when the file upload button is activated\n * or when adding a file to the editor via drag & drop.\n *\n * @param {WPDataRegistry} registry\n * @param {Object} settings Block editor settings.\n * @param {Object} $3 Parameters object passed to the function.\n * @param {Array} $3.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param {Object} $3.additionalData Additional data to include in the request.\n * @param {Array<File>} $3.filesList List of files.\n * @param {Function} $3.onError Function called when an error happens.\n * @param {Function} $3.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param {Function} $3.onSuccess Function called once a file has completely finished uploading, including thumbnails.\n * @param {Function} $3.onBatchSuccess Function called once all files in a group have completely finished uploading, including thumbnails.\n */\nfunction mediaUpload(\n\tregistry,\n\tsettings,\n\t{\n\t\tallowedTypes,\n\t\tadditionalData = {},\n\t\tfilesList,\n\t\tonError = noop,\n\t\tonFileChange,\n\t\tonSuccess,\n\t\tonBatchSuccess,\n\t}\n) {\n\tvoid registry.dispatch( uploadStore ).addItems( {\n\t\tfiles: Array.from( filesList ),\n\t\tonChange: onFileChange,\n\t\tonSuccess: ( attachments ) => {\n\t\t\tsettings?.[ mediaUploadOnSuccessKey ]?.( attachments );\n\t\t\tonSuccess?.( attachments );\n\t\t},\n\t\tonBatchSuccess,\n\t\tonError: ( error ) =>\n\t\t\tonError( typeof error === 'string' ? error : error?.message ?? '' ),\n\t\tadditionalData,\n\t\tallowedTypes,\n\t} );\n}\n\n/**\n * Upload interceptor for HEIC-only mode.\n *\n * Routes HEIC files through the upload-media pipeline for canvas-based\n * conversion, while passing non-HEIC files to the original mediaUpload\n * function for standard server-side processing.\n *\n * @param {WPDataRegistry} registry\n * @param {Object} settings Block editor settings.\n * @param {Object} $3 Parameters object passed to the function.\n * @param {Array} $3.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed.\n * @param {Object} $3.additionalData Additional data to include in the request.\n * @param {Array<File>} $3.filesList List of files.\n * @param {Function} $3.onError Function called when an error happens.\n * @param {Function} $3.onFileChange Function called each time a file or a temporary representation of the file is available.\n * @param {Function} $3.onSuccess Function called once a file has completely finished uploading, including thumbnails.\n * @param {Function} $3.onBatchSuccess Function called once all files in a group have completely finished uploading, including thumbnails.\n */\nfunction heicMediaUpload(\n\tregistry,\n\tsettings,\n\t{\n\t\tallowedTypes,\n\t\tadditionalData = {},\n\t\tfilesList,\n\t\tonError = noop,\n\t\tonFileChange,\n\t\tonSuccess,\n\t\tonBatchSuccess,\n\t}\n) {\n\tconst files = Array.from( filesList );\n\tconst heicFiles = files.filter( ( file ) =>\n\t\tHEIC_MIME_TYPES.includes( file.type )\n\t);\n\tconst otherFiles = files.filter(\n\t\t( file ) => ! HEIC_MIME_TYPES.includes( file.type )\n\t);\n\n\t// When the batch contains both HEIC and non-HEIC files, coordinate\n\t// onBatchSuccess so it fires only after *both* paths have completed.\n\tconst hasBothPaths =\n\t\theicFiles.length > 0 && otherFiles.length > 0 && settings?.mediaUpload;\n\tlet pathsRemaining = hasBothPaths ? 2 : 1;\n\tconst coordinatedBatchSuccess = hasBothPaths\n\t\t? () => {\n\t\t\t\tpathsRemaining--;\n\t\t\t\tif ( pathsRemaining <= 0 ) {\n\t\t\t\t\tonBatchSuccess?.();\n\t\t\t\t}\n\t\t }\n\t\t: onBatchSuccess;\n\n\t// Route HEIC files through the upload-media pipeline.\n\tif ( heicFiles.length > 0 ) {\n\t\tvoid registry.dispatch( uploadStore ).addItems( {\n\t\t\tfiles: heicFiles,\n\t\t\tonChange: onFileChange,\n\t\t\tonSuccess: ( attachments ) => {\n\t\t\t\tsettings?.[ mediaUploadOnSuccessKey ]?.( attachments );\n\t\t\t\tonSuccess?.( attachments );\n\t\t\t},\n\t\t\tonBatchSuccess: coordinatedBatchSuccess,\n\t\t\tonError: ( error ) =>\n\t\t\t\tonError(\n\t\t\t\t\ttypeof error === 'string' ? error : error?.message ?? ''\n\t\t\t\t),\n\t\t\tadditionalData,\n\t\t\tallowedTypes,\n\t\t} );\n\t}\n\n\t// Pass non-HEIC files to the original server-side upload function.\n\tif ( otherFiles.length > 0 && settings?.mediaUpload ) {\n\t\tsettings.mediaUpload( {\n\t\t\tallowedTypes,\n\t\t\tadditionalData,\n\t\t\tfilesList: otherFiles,\n\t\t\tonError,\n\t\t\tonFileChange,\n\t\t\tonSuccess,\n\t\t\tonBatchSuccess: coordinatedBatchSuccess,\n\t\t} );\n\t}\n}\n\n/**\n * Calls useBlockSync as a child of SelectionContext.Provider so that the\n * hook can read selection state from the context provided by this tree\n * rather than from a parent provider (which may not exist for the root).\n *\n * @param {Object} props Props forwarded to useBlockSync.\n */\nfunction BlockSyncEffect( props ) {\n\tuseBlockSync( props );\n\treturn null;\n}\n\nexport const ExperimentalBlockEditorProvider = withRegistryProvider(\n\t( props ) => {\n\t\tconst {\n\t\t\tsettings: _settings,\n\t\t\tregistry,\n\t\t\tstripExperimentalSettings = false,\n\t\t} = props;\n\n\t\tconst mediaUploadSettings = useMediaUploadSettings( _settings );\n\n\t\tconst isClientSideMediaEnabled =\n\t\t\tshouldEnableClientSideMediaProcessing();\n\t\tconst isHeicCanvasEnabled = shouldEnableHeicCanvasProcessing();\n\t\tconst useUploadMediaPipeline =\n\t\t\tisClientSideMediaEnabled || isHeicCanvasEnabled;\n\n\t\t// Nested providers (e.g. from useBlockPreview) inherit settings\n\t\t// where mediaUpload has already been replaced with the\n\t\t// interceptor. Detect this so we skip the replacement and\n\t\t// MediaUploadProvider for them \u2014 see the longer comment below.\n\t\tconst isMediaUploadIntercepted =\n\t\t\t!! _settings?.mediaUpload?.__isMediaUploadInterceptor;\n\n\t\tconst settings = useMemo( () => {\n\t\t\tif (\n\t\t\t\tuseUploadMediaPipeline &&\n\t\t\t\t_settings?.mediaUpload &&\n\t\t\t\t! isMediaUploadIntercepted\n\t\t\t) {\n\t\t\t\t// Choose the right interceptor:\n\t\t\t\t// - Full mode: all uploads go through upload-media pipeline.\n\t\t\t\t// - HEIC-only mode: only HEIC files go through, rest use legacy path.\n\t\t\t\tconst uploadFn = isClientSideMediaEnabled\n\t\t\t\t\t? mediaUpload\n\t\t\t\t\t: heicMediaUpload;\n\t\t\t\tconst interceptor = uploadFn.bind( null, registry, _settings );\n\t\t\t\tinterceptor.__isMediaUploadInterceptor = true;\n\t\t\t\treturn {\n\t\t\t\t\t..._settings,\n\t\t\t\t\tmediaUpload: interceptor,\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn _settings;\n\t\t}, [\n\t\t\t_settings,\n\t\t\tregistry,\n\t\t\tuseUploadMediaPipeline,\n\t\t\tisClientSideMediaEnabled,\n\t\t\tisMediaUploadIntercepted,\n\t\t] );\n\n\t\tconst { __experimentalUpdateSettings } = unlock(\n\t\t\tuseDispatch( blockEditorStore )\n\t\t);\n\t\tuseEffect( () => {\n\t\t\t__experimentalUpdateSettings(\n\t\t\t\t{\n\t\t\t\t\t...settings,\n\t\t\t\t\t__internalIsInitialized: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tstripExperimentalSettings,\n\t\t\t\t\treset: true,\n\t\t\t\t}\n\t\t\t);\n\t\t}, [\n\t\t\tsettings,\n\t\t\tstripExperimentalSettings,\n\t\t\t__experimentalUpdateSettings,\n\t\t] );\n\n\t\t// Store selection and onChangeSelection in refs and expose\n\t\t// stable getters/callers so that the context value is a\n\t\t// complete constant. This prevents re-rendering the entire\n\t\t// block tree (including async-rendered off-screen blocks)\n\t\t// when either value changes.\n\t\tconst selectionRef = useRef( props.selection );\n\t\tselectionRef.current = props.selection;\n\t\tconst onChangeSelectionRef = useRef( props.onChangeSelection ?? noop );\n\t\tonChangeSelectionRef.current = props.onChangeSelection ?? noop;\n\n\t\tconst selectionContextValue = useMemo(\n\t\t\t() => ( {\n\t\t\t\tgetSelection: () => selectionRef.current,\n\t\t\t\tonChangeSelection: ( ...args ) =>\n\t\t\t\t\tonChangeSelectionRef.current( ...args ),\n\t\t\t} ),\n\t\t\t[]\n\t\t);\n\n\t\tconst children = (\n\t\t\t<SlotFillProvider passthrough>\n\t\t\t\t{ ! settings?.isPreviewMode && <KeyboardShortcuts.Register /> }\n\t\t\t\t<BlockRefsProvider>{ props.children }</BlockRefsProvider>\n\t\t\t</SlotFillProvider>\n\t\t);\n\n\t\tconst content = (\n\t\t\t<SelectionContext.Provider value={ selectionContextValue }>\n\t\t\t\t<BlockSyncEffect\n\t\t\t\t\tclientId={ props.clientId }\n\t\t\t\t\tvalue={ props.value }\n\t\t\t\t\tonChange={ props.onChange }\n\t\t\t\t\tonInput={ props.onInput }\n\t\t\t\t/>\n\t\t\t\t{ children }\n\t\t\t</SelectionContext.Provider>\n\t\t);\n\n\t\t// MediaUploadProvider writes the mediaUpload function from\n\t\t// _settings into the shared upload-media store so the store can\n\t\t// hand files off to the server. useMediaUploadSettings extracts\n\t\t// mediaUpload from the original _settings prop \u2014 *before* the\n\t\t// interceptor replacement above \u2014 so the store receives the\n\t\t// real server-side upload function.\n\t\t//\n\t\t// Only the first (outermost) provider should do this.\n\t\t// Nested providers (e.g. from useBlockPreview in\n\t\t// core/post-template) inherit settings that already contain\n\t\t// the interceptor, so their MediaUploadProvider would\n\t\t// overwrite the store's server-side function with the\n\t\t// interceptor, causing uploads to loop instead of reaching\n\t\t// the server.\n\t\tif ( useUploadMediaPipeline && ! isMediaUploadIntercepted ) {\n\t\t\treturn (\n\t\t\t\t<MediaUploadProvider\n\t\t\t\t\tsettings={ mediaUploadSettings }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t{ content }\n\t\t\t\t</MediaUploadProvider>\n\t\t\t);\n\t\t}\n\n\t\treturn content;\n\t}\n);\n\nexport const BlockEditorProvider = ( props ) => {\n\treturn (\n\t\t<ExperimentalBlockEditorProvider { ...props } stripExperimentalSettings>\n\t\t\t{ props.children }\n\t\t</Ex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responsive-block-control/label.js
2
2
  import { useInstanceId } from "@wordpress/compose";
3
- import { VisuallyHidden } from "@wordpress/components";
3
+ import { VisuallyHidden } from "@wordpress/ui";
4
4
  import { _x, sprintf } from "@wordpress/i18n";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  function ResponsiveBlockControlLabel({
@@ -20,7 +20,14 @@ function ResponsiveBlockControlLabel({
20
20
  );
21
21
  return /* @__PURE__ */ jsxs(Fragment, { children: [
22
22
  /* @__PURE__ */ jsx("span", { "aria-describedby": `rbc-desc-${instanceId}`, children: viewport.label }),
23
- /* @__PURE__ */ jsx(VisuallyHidden, { as: "span", id: `rbc-desc-${instanceId}`, children: accessibleLabel })
23
+ /* @__PURE__ */ jsx(
24
+ VisuallyHidden,
25
+ {
26
+ id: `rbc-desc-${instanceId}`,
27
+ render: /* @__PURE__ */ jsx("span", {}),
28
+ children: accessibleLabel
29
+ }
30
+ )
24
31
  ] });
25
32
  }
26
33
  export {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/responsive-block-control/label.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/components';\nimport { _x, sprintf } from '@wordpress/i18n';\n\nexport default function ResponsiveBlockControlLabel( {\n\tproperty,\n\tviewport,\n\tdesc,\n} ) {\n\tconst instanceId = useInstanceId( ResponsiveBlockControlLabel );\n\tconst accessibleLabel =\n\t\tdesc ||\n\t\tsprintf(\n\t\t\t/* translators: 1: property name. 2: viewport name. */\n\t\t\t_x(\n\t\t\t\t'Controls the %1$s property for %2$s viewports.',\n\t\t\t\t'Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size.'\n\t\t\t),\n\t\t\tproperty,\n\t\t\tviewport.label\n\t\t);\n\treturn (\n\t\t<>\n\t\t\t<span aria-describedby={ `rbc-desc-${ instanceId }` }>\n\t\t\t\t{ viewport.label }\n\t\t\t</span>\n\t\t\t<VisuallyHidden as=\"span\" id={ `rbc-desc-${ instanceId }` }>\n\t\t\t\t{ accessibleLabel }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n"],
5
- "mappings": ";AAGA,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,IAAI,eAAe;AAoB1B,mBACC,KADD;AAlBa,SAAR,4BAA8C;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,aAAa,cAAe,2BAA4B;AAC9D,QAAM,kBACL,QACA;AAAA;AAAA,IAEC;AAAA,MACC;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACV;AACD,SACC,iCACC;AAAA,wBAAC,UAAK,oBAAmB,YAAa,UAAW,IAC9C,mBAAS,OACZ;AAAA,IACA,oBAAC,kBAAe,IAAG,QAAO,IAAK,YAAa,UAAW,IACpD,2BACH;AAAA,KACD;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useInstanceId } from '@wordpress/compose';\nimport { VisuallyHidden } from '@wordpress/ui';\nimport { _x, sprintf } from '@wordpress/i18n';\n\nexport default function ResponsiveBlockControlLabel( {\n\tproperty,\n\tviewport,\n\tdesc,\n} ) {\n\tconst instanceId = useInstanceId( ResponsiveBlockControlLabel );\n\tconst accessibleLabel =\n\t\tdesc ||\n\t\tsprintf(\n\t\t\t/* translators: 1: property name. 2: viewport name. */\n\t\t\t_x(\n\t\t\t\t'Controls the %1$s property for %2$s viewports.',\n\t\t\t\t'Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size.'\n\t\t\t),\n\t\t\tproperty,\n\t\t\tviewport.label\n\t\t);\n\treturn (\n\t\t<>\n\t\t\t<span aria-describedby={ `rbc-desc-${ instanceId }` }>\n\t\t\t\t{ viewport.label }\n\t\t\t</span>\n\t\t\t<VisuallyHidden\n\t\t\t\tid={ `rbc-desc-${ instanceId }` }\n\t\t\t\trender={ <span /> }\n\t\t\t>\n\t\t\t\t{ accessibleLabel }\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n"],
5
+ "mappings": ";AAGA,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,IAAI,eAAe;AAoB1B,mBACC,KADD;AAlBa,SAAR,4BAA8C;AAAA,EACpD;AAAA,EACA;AAAA,EACA;AACD,GAAI;AACH,QAAM,aAAa,cAAe,2BAA4B;AAC9D,QAAM,kBACL,QACA;AAAA;AAAA,IAEC;AAAA,MACC;AAAA,MACA;AAAA,IACD;AAAA,IACA;AAAA,IACA,SAAS;AAAA,EACV;AACD,SACC,iCACC;AAAA,wBAAC,UAAK,oBAAmB,YAAa,UAAW,IAC9C,mBAAS,OACZ;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,IAAK,YAAa,UAAW;AAAA,QAC7B,QAAS,oBAAC,UAAK;AAAA,QAEb;AAAA;AAAA,IACH;AAAA,KACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,7 @@
2
2
  import { pasteHandler } from "@wordpress/blocks";
3
3
  import { isEmpty, insert, create } from "@wordpress/rich-text";
4
4
  import { isURL } from "@wordpress/url";
5
+ import { store as blockEditorStore } from "../../../store/index.mjs";
5
6
  import { addActiveFormats } from "../utils.mjs";
6
7
  import { getPasteEventData } from "../../../utils/pasting.mjs";
7
8
  var paste_handler_default = (props) => (element) => {
@@ -15,7 +16,8 @@ var paste_handler_default = (props) => (element) => {
15
16
  onReplace,
16
17
  __unstableEmbedURLOnPaste,
17
18
  preserveWhiteSpace,
18
- pastePlainText
19
+ pastePlainText,
20
+ registry
19
21
  } = props.current;
20
22
  if (!element.contains(event.target)) {
21
23
  return;
@@ -76,11 +78,16 @@ var paste_handler_default = (props) => (element) => {
76
78
  });
77
79
  if (typeof content === "string") {
78
80
  pasteInline(content);
79
- } else if (content.length > 0) {
80
- if (onReplace && isEmpty(value)) {
81
- onReplace(content, content.length - 1, -1);
82
- }
81
+ return;
82
+ }
83
+ if (!content.length || !onReplace || !isEmpty(value)) {
84
+ return;
85
+ }
86
+ if (mode === "BLOCKS") {
87
+ pasteInline(html);
88
+ registry.dispatch(blockEditorStore).__unstableMarkLastChangeAsPersistent();
83
89
  }
90
+ onReplace(content, content.length - 1, -1);
84
91
  }
85
92
  const { defaultView } = element.ownerDocument;
86
93
  defaultView.addEventListener("paste", _onPaste);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/rich-text/event-listeners/paste-handler.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { pasteHandler } from '@wordpress/blocks';\nimport { isEmpty, insert, create } from '@wordpress/rich-text';\nimport { isURL } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { addActiveFormats } from '../utils';\nimport { getPasteEventData } from '../../../utils/pasting';\n\n/** @typedef {import('@wordpress/rich-text').RichTextValue} RichTextValue */\n\nexport default ( props ) => ( element ) => {\n\tfunction _onPaste( event ) {\n\t\tconst {\n\t\t\tdisableFormats,\n\t\t\tonChange,\n\t\t\tvalue,\n\t\t\tformatTypes,\n\t\t\ttagName,\n\t\t\tonReplace,\n\t\t\t__unstableEmbedURLOnPaste,\n\t\t\tpreserveWhiteSpace,\n\t\t\tpastePlainText,\n\t\t} = props.current;\n\n\t\t// The event listener is attached to the window, so we need to check if\n\t\t// the target is the element or inside the element.\n\t\tif ( ! element.contains( event.target ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { plainText, html } = getPasteEventData( event );\n\n\t\tevent.preventDefault();\n\n\t\t// Allows us to ask for this information when we get a report.\n\t\t// `pasteHandler` also logs this, but we're not using `pasteHandler` in\n\t\t// every case.\n\t\twindow.console.log( 'Received HTML (RichText):\\n\\n', html );\n\t\twindow.console.log( 'Received plain text (RichText):\\n\\n', plainText );\n\n\t\tif ( disableFormats ) {\n\t\t\tonChange( insert( value, plainText ) );\n\t\t\treturn;\n\t\t}\n\n\t\tconst isInternal =\n\t\t\tevent.clipboardData.getData( 'rich-text' ) === 'true';\n\n\t\tfunction pasteInline( content ) {\n\t\t\tconst transformed = formatTypes.reduce(\n\t\t\t\t( accumulator, { __unstablePasteRule } ) => {\n\t\t\t\t\t// Only allow one transform.\n\t\t\t\t\tif ( __unstablePasteRule && accumulator === value ) {\n\t\t\t\t\t\taccumulator = __unstablePasteRule( value, {\n\t\t\t\t\t\t\thtml,\n\t\t\t\t\t\t\tplainText,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn accumulator;\n\t\t\t\t},\n\t\t\t\tvalue\n\t\t\t);\n\t\t\tif ( transformed !== value ) {\n\t\t\t\tonChange( transformed );\n\t\t\t} else {\n\t\t\t\tconst valueToInsert = create( { html: content } );\n\t\t\t\taddActiveFormats( valueToInsert, value.activeFormats );\n\t\t\t\tonChange( insert( value, valueToInsert ) );\n\t\t\t}\n\t\t}\n\n\t\t// If the data comes from a rich text instance, we can directly use it\n\t\t// without filtering the data. The filters are only meant for externally\n\t\t// pasted content and remove inline styles.\n\t\tif ( isInternal ) {\n\t\t\tpasteInline( html );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( pastePlainText ) {\n\t\t\tonChange( insert( value, create( { text: plainText } ) ) );\n\t\t\treturn;\n\t\t}\n\n\t\tlet mode = 'INLINE';\n\n\t\tconst trimmedPlainText = plainText.trim();\n\n\t\tif (\n\t\t\t__unstableEmbedURLOnPaste &&\n\t\t\tisEmpty( value ) &&\n\t\t\tisURL( trimmedPlainText ) &&\n\t\t\t// For the link pasting feature, allow only http(s) protocols.\n\t\t\t/^https?:/.test( trimmedPlainText )\n\t\t) {\n\t\t\tmode = 'BLOCKS';\n\t\t}\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t\tmode,\n\t\t\ttagName,\n\t\t\tpreserveWhiteSpace,\n\t\t} );\n\n\t\tif ( typeof content === 'string' ) {\n\t\t\tpasteInline( content );\n\t\t} else if ( content.length > 0 ) {\n\t\t\tif ( onReplace && isEmpty( value ) ) {\n\t\t\t\tonReplace( content, content.length - 1, -1 );\n\t\t\t}\n\t\t}\n\t}\n\n\tconst { defaultView } = element.ownerDocument;\n\n\t// Attach the listener to the window so parent elements have the chance to\n\t// prevent the default behavior.\n\tdefaultView.addEventListener( 'paste', _onPaste );\n\treturn () => {\n\t\tdefaultView.removeEventListener( 'paste', _onPaste );\n\t};\n};\n"],
5
- "mappings": ";AAGA,SAAS,oBAAoB;AAC7B,SAAS,SAAS,QAAQ,cAAc;AACxC,SAAS,aAAa;AAKtB,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAIlC,IAAO,wBAAQ,CAAE,UAAW,CAAE,YAAa;AAC1C,WAAS,SAAU,OAAQ;AAC1B,UAAM;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,IAAI,MAAM;AAIV,QAAK,CAAE,QAAQ,SAAU,MAAM,MAAO,GAAI;AACzC;AAAA,IACD;AAEA,QAAK,MAAM,kBAAmB;AAC7B;AAAA,IACD;AAEA,UAAM,EAAE,WAAW,KAAK,IAAI,kBAAmB,KAAM;AAErD,UAAM,eAAe;AAKrB,WAAO,QAAQ,IAAK,iCAAiC,IAAK;AAC1D,WAAO,QAAQ,IAAK,uCAAuC,SAAU;AAErE,QAAK,gBAAiB;AACrB,eAAU,OAAQ,OAAO,SAAU,CAAE;AACrC;AAAA,IACD;AAEA,UAAM,aACL,MAAM,cAAc,QAAS,WAAY,MAAM;AAEhD,aAAS,YAAaA,UAAU;AAC/B,YAAM,cAAc,YAAY;AAAA,QAC/B,CAAE,aAAa,EAAE,oBAAoB,MAAO;AAE3C,cAAK,uBAAuB,gBAAgB,OAAQ;AACnD,0BAAc,oBAAqB,OAAO;AAAA,cACzC;AAAA,cACA;AAAA,YACD,CAAE;AAAA,UACH;AAEA,iBAAO;AAAA,QACR;AAAA,QACA;AAAA,MACD;AACA,UAAK,gBAAgB,OAAQ;AAC5B,iBAAU,WAAY;AAAA,MACvB,OAAO;AACN,cAAM,gBAAgB,OAAQ,EAAE,MAAMA,SAAQ,CAAE;AAChD,yBAAkB,eAAe,MAAM,aAAc;AACrD,iBAAU,OAAQ,OAAO,aAAc,CAAE;AAAA,MAC1C;AAAA,IACD;AAKA,QAAK,YAAa;AACjB,kBAAa,IAAK;AAClB;AAAA,IACD;AAEA,QAAK,gBAAiB;AACrB,eAAU,OAAQ,OAAO,OAAQ,EAAE,MAAM,UAAU,CAAE,CAAE,CAAE;AACzD;AAAA,IACD;AAEA,QAAI,OAAO;AAEX,UAAM,mBAAmB,UAAU,KAAK;AAExC,QACC,6BACA,QAAS,KAAM,KACf,MAAO,gBAAiB;AAAA,IAExB,WAAW,KAAM,gBAAiB,GACjC;AACD,aAAO;AAAA,IACR;AAEA,UAAM,UAAU,aAAc;AAAA,MAC7B,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,CAAE;AAEF,QAAK,OAAO,YAAY,UAAW;AAClC,kBAAa,OAAQ;AAAA,IACtB,WAAY,QAAQ,SAAS,GAAI;AAChC,UAAK,aAAa,QAAS,KAAM,GAAI;AACpC,kBAAW,SAAS,QAAQ,SAAS,GAAG,EAAG;AAAA,MAC5C;AAAA,IACD;AAAA,EACD;AAEA,QAAM,EAAE,YAAY,IAAI,QAAQ;AAIhC,cAAY,iBAAkB,SAAS,QAAS;AAChD,SAAO,MAAM;AACZ,gBAAY,oBAAqB,SAAS,QAAS;AAAA,EACpD;AACD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { pasteHandler } from '@wordpress/blocks';\nimport { isEmpty, insert, create } from '@wordpress/rich-text';\nimport { isURL } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\nimport { addActiveFormats } from '../utils';\nimport { getPasteEventData } from '../../../utils/pasting';\n\n/** @typedef {import('@wordpress/rich-text').RichTextValue} RichTextValue */\n\nexport default ( props ) => ( element ) => {\n\tfunction _onPaste( event ) {\n\t\tconst {\n\t\t\tdisableFormats,\n\t\t\tonChange,\n\t\t\tvalue,\n\t\t\tformatTypes,\n\t\t\ttagName,\n\t\t\tonReplace,\n\t\t\t__unstableEmbedURLOnPaste,\n\t\t\tpreserveWhiteSpace,\n\t\t\tpastePlainText,\n\t\t\tregistry,\n\t\t} = props.current;\n\n\t\t// The event listener is attached to the window, so we need to check if\n\t\t// the target is the element or inside the element.\n\t\tif ( ! element.contains( event.target ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.defaultPrevented ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { plainText, html } = getPasteEventData( event );\n\n\t\tevent.preventDefault();\n\n\t\t// Allows us to ask for this information when we get a report.\n\t\t// `pasteHandler` also logs this, but we're not using `pasteHandler` in\n\t\t// every case.\n\t\twindow.console.log( 'Received HTML (RichText):\\n\\n', html );\n\t\twindow.console.log( 'Received plain text (RichText):\\n\\n', plainText );\n\n\t\tif ( disableFormats ) {\n\t\t\tonChange( insert( value, plainText ) );\n\t\t\treturn;\n\t\t}\n\n\t\tconst isInternal =\n\t\t\tevent.clipboardData.getData( 'rich-text' ) === 'true';\n\n\t\tfunction pasteInline( content ) {\n\t\t\tconst transformed = formatTypes.reduce(\n\t\t\t\t( accumulator, { __unstablePasteRule } ) => {\n\t\t\t\t\t// Only allow one transform.\n\t\t\t\t\tif ( __unstablePasteRule && accumulator === value ) {\n\t\t\t\t\t\taccumulator = __unstablePasteRule( value, {\n\t\t\t\t\t\t\thtml,\n\t\t\t\t\t\t\tplainText,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\n\t\t\t\t\treturn accumulator;\n\t\t\t\t},\n\t\t\t\tvalue\n\t\t\t);\n\t\t\tif ( transformed !== value ) {\n\t\t\t\tonChange( transformed );\n\t\t\t} else {\n\t\t\t\tconst valueToInsert = create( { html: content } );\n\t\t\t\taddActiveFormats( valueToInsert, value.activeFormats );\n\t\t\t\tonChange( insert( value, valueToInsert ) );\n\t\t\t}\n\t\t}\n\n\t\t// If the data comes from a rich text instance, we can directly use it\n\t\t// without filtering the data. The filters are only meant for externally\n\t\t// pasted content and remove inline styles.\n\t\tif ( isInternal ) {\n\t\t\tpasteInline( html );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( pastePlainText ) {\n\t\t\tonChange( insert( value, create( { text: plainText } ) ) );\n\t\t\treturn;\n\t\t}\n\n\t\tlet mode = 'INLINE';\n\n\t\tconst trimmedPlainText = plainText.trim();\n\n\t\tif (\n\t\t\t__unstableEmbedURLOnPaste &&\n\t\t\tisEmpty( value ) &&\n\t\t\tisURL( trimmedPlainText ) &&\n\t\t\t// For the link pasting feature, allow only http(s) protocols.\n\t\t\t/^https?:/.test( trimmedPlainText )\n\t\t) {\n\t\t\tmode = 'BLOCKS';\n\t\t}\n\n\t\tconst content = pasteHandler( {\n\t\t\tHTML: html,\n\t\t\tplainText,\n\t\t\tmode,\n\t\t\ttagName,\n\t\t\tpreserveWhiteSpace,\n\t\t} );\n\n\t\tif ( typeof content === 'string' ) {\n\t\t\tpasteInline( content );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! content.length || ! onReplace || ! isEmpty( value ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Record an intermediate paragraph-with-URL state so a single undo\n\t\t// after the URL \u2192 block transformation restores the pasted link.\n\t\tif ( mode === 'BLOCKS' ) {\n\t\t\tpasteInline( html );\n\t\t\tregistry\n\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\t}\n\n\t\tonReplace( content, content.length - 1, -1 );\n\t}\n\n\tconst { defaultView } = element.ownerDocument;\n\n\t// Attach the listener to the window so parent elements have the chance to\n\t// prevent the default behavior.\n\tdefaultView.addEventListener( 'paste', _onPaste );\n\tre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,OAAQ,OAAO,aAAc,CAAE;AAAA,MAC1C;AAAA,IACD;AAKA,QAAK,YAAa;AACjB,kBAAa,IAAK;AAClB;AAAA,IACD;AAEA,QAAK,gBAAiB;AACrB,eAAU,OAAQ,OAAO,OAAQ,EAAE,MAAM,UAAU,CAAE,CAAE,CAAE;AACzD;AAAA,IACD;AAEA,QAAI,OAAO;AAEX,UAAM,mBAAmB,UAAU,KAAK;AAExC,QACC,6BACA,QAAS,KAAM,KACf,MAAO,gBAAiB;AAAA,IAExB,WAAW,KAAM,gBAAiB,GACjC;AACD,aAAO;AAAA,IACR;AAEA,UAAM,UAAU,aAAc;AAAA,MAC7B,MAAM;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACD,CAAE;AAEF,QAAK,OAAO,YAAY,UAAW;AAClC,kBAAa,OAAQ;AACrB;AAAA,IACD;AAEA,QAAK,CAAE,QAAQ,UAAU,CAAE,aAAa,CAAE,QAAS,KAAM,GAAI;AAC5D;AAAA,IACD;AAIA,QAAK,SAAS,UAAW;AACxB,kBAAa,IAAK;AAClB,eACE,SAAU,gBAAiB,EAC3B,qCAAqC;AAAA,IACxC;AAEA,cAAW,SAAS,QAAQ,SAAS,GAAG,EAAG;AAAA,EAC5C;AAEA,QAAM,EAAE,YAAY,IAAI,QAAQ;AAIhC,cAAY,iBAAkB,SAAS,QAAS;AAChD,SAAO,MAAM;AACZ,gBAAY,oBAAqB,SAAS,QAAS;AAAA,EACpD;AACD;",
6
6
  "names": ["content"]
7
7
  }
@@ -32,7 +32,7 @@ var LINK_DESTINATION_NONE = "none";
32
32
  var LINK_DESTINATION_CUSTOM = "custom";
33
33
  var LINK_DESTINATION_MEDIA = "media";
34
34
  var LINK_DESTINATION_ATTACHMENT = "attachment";
35
- var NEW_TAB_REL = ["noreferrer", "noopener"];
35
+ var NEW_TAB_REL = ["noopener"];
36
36
  var ImageURLInputUI = ({
37
37
  linkDestination,
38
38
  onChangeUrl,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/url-popover/image-url-input-ui.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseRef,\n\tuseEffect,\n\tuseState,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\nimport {\n\tToolbarButton,\n\tNavigableMenu,\n\tButton,\n\tMenuItem,\n\tToggleControl,\n\tTextControl,\n\t__experimentalVStack as VStack,\n\tExternalLink,\n} from '@wordpress/components';\nimport {\n\tIcon,\n\tlink as linkIcon,\n\timage,\n\tpage,\n\tfullscreen,\n\tlinkOff,\n} from '@wordpress/icons';\nimport { prependHTTPS } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport URLPopover from './index';\n\nconst LINK_DESTINATION_NONE = 'none';\nconst LINK_DESTINATION_CUSTOM = 'custom';\nconst LINK_DESTINATION_MEDIA = 'media';\nconst LINK_DESTINATION_ATTACHMENT = 'attachment';\nconst NEW_TAB_REL = [ 'noreferrer', 'noopener' ];\n\nconst ImageURLInputUI = ( {\n\tlinkDestination,\n\tonChangeUrl,\n\turl,\n\tmediaType = 'image',\n\tmediaUrl,\n\tmediaLink,\n\tlinkTarget,\n\tlinkClass,\n\trel,\n\tshowLightboxSetting,\n\tlightboxEnabled,\n\tonSetLightbox,\n\tresetLightbox,\n} ) => {\n\tconst [ isOpen, setIsOpen ] = useState( false );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst openLinkUI = () => {\n\t\tsetIsOpen( true );\n\t};\n\n\tconst [ isEditingLink, setIsEditingLink ] = useState( false );\n\tconst [ urlInput, setUrlInput ] = useState( null );\n\n\tconst autocompleteRef = useRef( null );\n\tconst wrapperRef = useRef();\n\n\tuseEffect( () => {\n\t\tif ( ! wrapperRef.current ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextFocusTarget =\n\t\t\tfocus.focusable.find( wrapperRef.current )[ 0 ] ||\n\t\t\twrapperRef.current;\n\t\tnextFocusTarget.focus();\n\t}, [ isEditingLink, url, lightboxEnabled ] );\n\n\tconst startEditLink = () => {\n\t\tif (\n\t\t\tlinkDestination === LINK_DESTINATION_MEDIA ||\n\t\t\tlinkDestination === LINK_DESTINATION_ATTACHMENT\n\t\t) {\n\t\t\tsetUrlInput( '' );\n\t\t}\n\t\tsetIsEditingLink( true );\n\t};\n\n\tconst stopEditLink = () => {\n\t\tsetIsEditingLink( false );\n\t};\n\n\tconst closeLinkUI = () => {\n\t\tsetUrlInput( null );\n\t\tstopEditLink();\n\t\tsetIsOpen( false );\n\t};\n\n\tconst getUpdatedLinkTargetSettings = ( value ) => {\n\t\tconst newLinkTarget = value ? '_blank' : undefined;\n\n\t\tlet updatedRel;\n\t\tif ( newLinkTarget ) {\n\t\t\tconst rels = ( rel ?? '' ).split( ' ' );\n\t\t\tNEW_TAB_REL.forEach( ( relVal ) => {\n\t\t\t\tif ( ! rels.includes( relVal ) ) {\n\t\t\t\t\trels.push( relVal );\n\t\t\t\t}\n\t\t\t} );\n\t\t\tupdatedRel = rels.join( ' ' );\n\t\t} else {\n\t\t\tconst rels = ( rel ?? '' )\n\t\t\t\t.split( ' ' )\n\t\t\t\t.filter(\n\t\t\t\t\t( relVal ) => NEW_TAB_REL.includes( relVal ) === false\n\t\t\t\t);\n\t\t\tupdatedRel = rels.length ? rels.join( ' ' ) : undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tlinkTarget: newLinkTarget,\n\t\t\trel: updatedRel,\n\t\t};\n\t};\n\n\tconst onFocusOutside = () => {\n\t\treturn ( event ) => {\n\t\t\t// The autocomplete suggestions list renders in a separate popover (in a portal),\n\t\t\t// so onFocusOutside fails to detect that a click on a suggestion occurred in the\n\t\t\t// LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n\t\t\t// return to avoid the popover being closed.\n\t\t\tconst autocompleteElement = autocompleteRef.current;\n\t\t\tif (\n\t\t\t\tautocompleteElement &&\n\t\t\t\tautocompleteElement.contains( event.target )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetIsOpen( false );\n\t\t\tsetUrlInput( null );\n\t\t\tstopEditLink();\n\t\t};\n\t};\n\n\tconst onSubmitLinkChange = () => {\n\t\treturn ( event ) => {\n\t\t\tif ( urlInput ) {\n\t\t\t\t// It is possible the entered URL actually matches a named link destination.\n\t\t\t\t// This check will ensure our link destination is correct.\n\t\t\t\tconst selectedDestination =\n\t\t\t\t\tgetLinkDestinations().find(\n\t\t\t\t\t\t( destination ) => destination.url === urlInput\n\t\t\t\t\t)?.linkDestination || LINK_DESTINATION_CUSTOM;\n\n\t\t\t\tonChangeUrl( {\n\t\t\t\t\thref: prependHTTPS( urlInput ),\n\t\t\t\t\tlinkDestination: selectedDestination,\n\t\t\t\t\tlightbox: { enabled: false },\n\t\t\t\t} );\n\t\t\t}\n\t\t\tstopEditLink();\n\t\t\tsetUrlInput( null );\n\t\t\tevent.preventDefault();\n\t\t};\n\t};\n\n\tconst onLinkRemove = () => {\n\t\tonChangeUrl( {\n\t\t\tlinkDestination: LINK_DESTINATION_NONE,\n\t\t\thref: '',\n\t\t} );\n\t};\n\n\tconst getLinkDestinations = () => {\n\t\tconst linkDestinations = [\n\t\t\t{\n\t\t\t\tlinkDestination: LINK_DESTINATION_MEDIA,\n\t\t\t\ttitle: __( 'Link to image file' ),\n\t\t\t\turl: mediaType === 'image' ? mediaUrl : undefined,\n\t\t\t\ticon: image,\n\t\t\t},\n\t\t];\n\t\tif ( mediaType === 'image' && mediaLink ) {\n\t\t\tlinkDestinations.push( {\n\t\t\t\tlinkDestination: LINK_DESTINATION_ATTACHMENT,\n\t\t\t\ttitle: __( 'Link to attachment page' ),\n\t\t\t\turl: mediaType === 'image' ? mediaLink : undefined,\n\t\t\t\ticon: page,\n\t\t\t} );\n\t\t}\n\t\treturn linkDestinations;\n\t};\n\n\tconst onSetHref = ( value ) => {\n\t\tconst linkDestinations = getLinkDestinations();\n\t\tlet linkDestinationInput;\n\t\tif ( ! value ) {\n\t\t\tlinkDestinationInput = LINK_DESTINATION_NONE;\n\t\t} else {\n\t\t\tlinkDestinationInput = (\n\t\t\t\tlinkDestinations.find( ( destination ) => {\n\t\t\t\t\treturn destination.url === value;\n\t\t\t\t} ) || { linkDestination: LINK_DESTINATION_CUSTOM }\n\t\t\t).linkDestination;\n\t\t}\n\t\tonChangeUrl( {\n\t\t\tlinkDestination: linkDestinationInput,\n\t\t\thref: value,\n\t\t} );\n\t};\n\n\tconst onSetNewTab = ( value ) => {\n\t\tconst updatedLinkTarget = getUpdatedLinkTargetSettings( value );\n\t\tonChangeUrl( updatedLinkTarget );\n\t};\n\n\tconst onSetLinkRel = ( value ) => {\n\t\tonChangeUrl( { rel: value } );\n\t};\n\n\tconst onSetLinkClass = ( value ) => {\n\t\tonChangeUrl( { linkClass: value } );\n\t};\n\n\tconst advancedOptions = (\n\t\t<VStack spacing=\"3\">\n\t\t\t<ToggleControl\n\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\tonChange={ onSetNewTab }\n\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'Link relation' ) }\n\t\t\t\tvalue={ rel ?? '' }\n\t\t\t\tonChange={ onSetLinkRel }\n\t\t\t\thelp={ createInterpolateElement(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t<ExternalLink href=\"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel\" />\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\t<TextControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'Link CSS class' ) }\n\t\t\t\tvalue={ linkClass || '' }\n\t\t\t\tonChange={ onSetLinkClass }\n\t\t\t/>\n\t\t</VStack>\n\t);\n\n\tconst linkEditorValue = urlInput !== null ? urlInput : url;\n\tconst hideLightboxPanel =\n\t\t! lightboxEnabled || ( lightboxEnabled && ! showLightboxSetting );\n\tconst showLinkEditor = ! linkEditorValue && hideLightboxPanel;\n\n\tconst urlLabel = (\n\t\tgetLinkDestinations().find(\n\t\t\t( destination ) => destination.linkDestination === linkDestination\n\t\t) || {}\n\t).title;\n\n\tconst PopoverChildren = () => {\n\t\tif (\n\t\t\tlightboxEnabled &&\n\t\t\tshowLightboxSetting &&\n\t\t\t! url &&\n\t\t\t! isEditingLink\n\t\t) {\n\t\t\treturn (\n\t\t\t\t<div className=\"block-editor-url-popover__expand-on-click\">\n\t\t\t\t\t<Icon icon={ fullscreen } />\n\t\t\t\t\t<div className=\"text\">\n\t\t\t\t\t\t<p>{ __( 'Enlarge on click' ) }</p>\n\t\t\t\t\t\t<p className=\"description\">\n\t\t\t\t\t\t\t{ __( 'Scales the image with a lightbox effect' ) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\tlabel={ __( 'Disable enlarge on click' ) }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonSetLightbox?.( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t} else if ( ! url || isEditingLink ) {\n\t\t\treturn (\n\t\t\t\t<URLPopover.LinkEditor\n\t\t\t\t\tclassName=\"block-editor-format-toolbar__link-container-content\"\n\t\t\t\t\tvalue={ linkEditorValue }\n\t\t\t\t\tonChangeInputValue={ setUrlInput }\n\t\t\t\t\tonSubmit={ onSubmitLinkChange() }\n\t\t\t\t\tautocompleteRef={ autocompleteRef }\n\t\t\t\t/>\n\t\t\t);\n\t\t} else if ( url && ! isEditingLink ) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<URLPopover.LinkViewer\n\t\t\t\t\t\tclassName=\"block-editor-format-toolbar__link-container-content\"\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tonEditLinkClick={ startEditLink }\n\t\t\t\t\t\turlLabel={ urlLabel }\n\t\t\t\t\t/>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\tlabel={ __( 'Remove link' ) }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonLinkRemove();\n\t\t\t\t\t\t\tresetLightbox?.();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t);\n\t\t}\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ linkIcon }\n\t\t\t\tclassName=\"components-toolbar__control\"\n\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\taria-expanded={ isOpen }\n\t\t\t\tonClick={ openLinkUI }\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\tisActive={\n\t\t\t\t\t!! url || ( lightboxEnabled && showLightboxSetting )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isOpen && (\n\t\t\t\t<URLPopover\n\t\t\t\t\tref={ wrapperRef }\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tonFocusOutside={ onFocusOutside() }\n\t\t\t\t\tonClose={ closeLinkUI }\n\t\t\t\t\trenderSettings={\n\t\t\t\t\t\thideLightboxPanel ? () => advancedOptions : null\n\t\t\t\t\t}\n\t\t\t\t\tadditionalControls={\n\t\t\t\t\t\tshowLinkEditor && (\n\t\t\t\t\t\t\t<NavigableMenu>\n\t\t\t\t\t\t\t\t{ getLinkDestinations().map( ( link ) => (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tkey={ link.linkDestination }\n\t\t\t\t\t\t\t\t\t\ticon={ link.icon }\n\t\t\t\t\t\t\t\t\t\ticonPosition=\"left\"\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetUrlInput( null );\n\t\t\t\t\t\t\t\t\t\t\tonSetHref( link.url );\n\t\t\t\t\t\t\t\t\t\t\tstopEditLink();\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ link.title }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t{ showLightboxSetting && (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tkey=\"expand-on-click\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-url-popover__expand-on-click\"\n\t\t\t\t\t\t\t\t\t\ticon={ fullscreen }\n\t\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Scale the image with a lightbox effect.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\ticonPosition=\"left\"\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetUrlInput( null );\n\t\t\t\t\t\t\t\t\t\t\tonChangeUrl( {\n\t\t\t\t\t\t\t\t\t\t\t\tlinkDestination:\n\t\t\t\t\t\t\t\t\t\t\t\t\tLINK_DESTINATION_NONE,\n\t\t\t\t\t\t\t\t\t\t\t\thref: '',\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t\tonSetLightbox?.( true );\n\t\t\t\t\t\t\t\t\t\t\tstopEditLink();\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Enlarge on click' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</NavigableMenu>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\toffset={ 13 }\n\t\t\t\t>\n\t\t\t\t\t{ PopoverChildren() }\n\t\t\t\t</URLPopover>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport { ImageURLInputUI as __experimentalImageURLInputUI };\n"],
5
- "mappings": ";AAGA,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,aAAa;AACtB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,oBAAoB;AAK7B,OAAO,gBAAgB;AAkMrB,SAgFE,UA/ED,KADD;AAhMF,IAAM,wBAAwB;AAC9B,IAAM,0BAA0B;AAChC,IAAM,yBAAyB;AAC/B,IAAM,8BAA8B;AACpC,IAAM,cAAc,CAAE,cAAc,UAAW;AAE/C,IAAM,kBAAkB,CAAE;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAO;AACN,QAAM,CAAE,QAAQ,SAAU,IAAI,SAAU,KAAM;AAG9C,QAAM,CAAE,eAAe,gBAAiB,IAAI,SAAU,IAAK;AAC3D,QAAM,aAAa,MAAM;AACxB,cAAW,IAAK;AAAA,EACjB;AAEA,QAAM,CAAE,eAAe,gBAAiB,IAAI,SAAU,KAAM;AAC5D,QAAM,CAAE,UAAU,WAAY,IAAI,SAAU,IAAK;AAEjD,QAAM,kBAAkB,O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AA,QACV,gBACC,oBAAoB,MAAM,kBAAkB;AAAA,QAE7C,oBACC,kBACC,qBAAC,iBACE;AAAA,8BAAoB,EAAE,IAAK,CAAE,SAC9B;AAAA,YAAC;AAAA;AAAA,cAEA,MAAO,KAAK;AAAA,cACZ,cAAa;AAAA,cACb,SAAU,MAAM;AACf,4BAAa,IAAK;AAClB,0BAAW,KAAK,GAAI;AACpB,6BAAa;AAAA,cACd;AAAA,cAEE,eAAK;AAAA;AAAA,YATD,KAAK;AAAA,UAUZ,CACC;AAAA,UACA,uBACD;AAAA,YAAC;AAAA;AAAA,cAEA,WAAU;AAAA,cACV,MAAO;AAAA,cACP,MAAO;AAAA,gBACN;AAAA,cACD;AAAA,cACA,cAAa;AAAA,cACb,SAAU,MAAM;AACf,4BAAa,IAAK;AAClB,4BAAa;AAAA,kBACZ,iBACC;AAAA,kBACD,MAAM;AAAA,gBACP,CAAE;AACF,gCAAiB,IAAK;AACtB,6BAAa;AAAA,cACd;AAAA,cAEE,aAAI,kBAAmB;AAAA;AAAA,YAlBrB;AAAA,UAmBL;AAAA,WAEF;AAAA,QAGF,QAAS;AAAA,QAEP,0BAAgB;AAAA;AAAA,IACnB;AAAA,KAEF;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\tuseRef,\n\tuseEffect,\n\tuseState,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport { focus } from '@wordpress/dom';\nimport {\n\tToolbarButton,\n\tNavigableMenu,\n\tButton,\n\tMenuItem,\n\tToggleControl,\n\tTextControl,\n\t__experimentalVStack as VStack,\n\tExternalLink,\n} from '@wordpress/components';\nimport {\n\tIcon,\n\tlink as linkIcon,\n\timage,\n\tpage,\n\tfullscreen,\n\tlinkOff,\n} from '@wordpress/icons';\nimport { prependHTTPS } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport URLPopover from './index';\n\nconst LINK_DESTINATION_NONE = 'none';\nconst LINK_DESTINATION_CUSTOM = 'custom';\nconst LINK_DESTINATION_MEDIA = 'media';\nconst LINK_DESTINATION_ATTACHMENT = 'attachment';\nconst NEW_TAB_REL = [ 'noopener' ];\n\nconst ImageURLInputUI = ( {\n\tlinkDestination,\n\tonChangeUrl,\n\turl,\n\tmediaType = 'image',\n\tmediaUrl,\n\tmediaLink,\n\tlinkTarget,\n\tlinkClass,\n\trel,\n\tshowLightboxSetting,\n\tlightboxEnabled,\n\tonSetLightbox,\n\tresetLightbox,\n} ) => {\n\tconst [ isOpen, setIsOpen ] = useState( false );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst openLinkUI = () => {\n\t\tsetIsOpen( true );\n\t};\n\n\tconst [ isEditingLink, setIsEditingLink ] = useState( false );\n\tconst [ urlInput, setUrlInput ] = useState( null );\n\n\tconst autocompleteRef = useRef( null );\n\tconst wrapperRef = useRef();\n\n\tuseEffect( () => {\n\t\tif ( ! wrapperRef.current ) {\n\t\t\treturn;\n\t\t}\n\t\tconst nextFocusTarget =\n\t\t\tfocus.focusable.find( wrapperRef.current )[ 0 ] ||\n\t\t\twrapperRef.current;\n\t\tnextFocusTarget.focus();\n\t}, [ isEditingLink, url, lightboxEnabled ] );\n\n\tconst startEditLink = () => {\n\t\tif (\n\t\t\tlinkDestination === LINK_DESTINATION_MEDIA ||\n\t\t\tlinkDestination === LINK_DESTINATION_ATTACHMENT\n\t\t) {\n\t\t\tsetUrlInput( '' );\n\t\t}\n\t\tsetIsEditingLink( true );\n\t};\n\n\tconst stopEditLink = () => {\n\t\tsetIsEditingLink( false );\n\t};\n\n\tconst closeLinkUI = () => {\n\t\tsetUrlInput( null );\n\t\tstopEditLink();\n\t\tsetIsOpen( false );\n\t};\n\n\tconst getUpdatedLinkTargetSettings = ( value ) => {\n\t\tconst newLinkTarget = value ? '_blank' : undefined;\n\n\t\tlet updatedRel;\n\t\tif ( newLinkTarget ) {\n\t\t\tconst rels = ( rel ?? '' ).split( ' ' );\n\t\t\tNEW_TAB_REL.forEach( ( relVal ) => {\n\t\t\t\tif ( ! rels.includes( relVal ) ) {\n\t\t\t\t\trels.push( relVal );\n\t\t\t\t}\n\t\t\t} );\n\t\t\tupdatedRel = rels.join( ' ' );\n\t\t} else {\n\t\t\tconst rels = ( rel ?? '' )\n\t\t\t\t.split( ' ' )\n\t\t\t\t.filter(\n\t\t\t\t\t( relVal ) => NEW_TAB_REL.includes( relVal ) === false\n\t\t\t\t);\n\t\t\tupdatedRel = rels.length ? rels.join( ' ' ) : undefined;\n\t\t}\n\n\t\treturn {\n\t\t\tlinkTarget: newLinkTarget,\n\t\t\trel: updatedRel,\n\t\t};\n\t};\n\n\tconst onFocusOutside = () => {\n\t\treturn ( event ) => {\n\t\t\t// The autocomplete suggestions list renders in a separate popover (in a portal),\n\t\t\t// so onFocusOutside fails to detect that a click on a suggestion occurred in the\n\t\t\t// LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and\n\t\t\t// return to avoid the popover being closed.\n\t\t\tconst autocompleteElement = autocompleteRef.current;\n\t\t\tif (\n\t\t\t\tautocompleteElement &&\n\t\t\t\tautocompleteElement.contains( event.target )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetIsOpen( false );\n\t\t\tsetUrlInput( null );\n\t\t\tstopEditLink();\n\t\t};\n\t};\n\n\tconst onSubmitLinkChange = () => {\n\t\treturn ( event ) => {\n\t\t\tif ( urlInput ) {\n\t\t\t\t// It is possible the entered URL actually matches a named link destination.\n\t\t\t\t// This check will ensure our link destination is correct.\n\t\t\t\tconst selectedDestination =\n\t\t\t\t\tgetLinkDestinations().find(\n\t\t\t\t\t\t( destination ) => destination.url === urlInput\n\t\t\t\t\t)?.linkDestination || LINK_DESTINATION_CUSTOM;\n\n\t\t\t\tonChangeUrl( {\n\t\t\t\t\thref: prependHTTPS( urlInput ),\n\t\t\t\t\tlinkDestination: selectedDestination,\n\t\t\t\t\tlightbox: { enabled: false },\n\t\t\t\t} );\n\t\t\t}\n\t\t\tstopEditLink();\n\t\t\tsetUrlInput( null );\n\t\t\tevent.preventDefault();\n\t\t};\n\t};\n\n\tconst onLinkRemove = () => {\n\t\tonChangeUrl( {\n\t\t\tlinkDestination: LINK_DESTINATION_NONE,\n\t\t\thref: '',\n\t\t} );\n\t};\n\n\tconst getLinkDestinations = () => {\n\t\tconst linkDestinations = [\n\t\t\t{\n\t\t\t\tlinkDestination: LINK_DESTINATION_MEDIA,\n\t\t\t\ttitle: __( 'Link to image file' ),\n\t\t\t\turl: mediaType === 'image' ? mediaUrl : undefined,\n\t\t\t\ticon: image,\n\t\t\t},\n\t\t];\n\t\tif ( mediaType === 'image' && mediaLink ) {\n\t\t\tlinkDestinations.push( {\n\t\t\t\tlinkDestination: LINK_DESTINATION_ATTACHMENT,\n\t\t\t\ttitle: __( 'Link to attachment page' ),\n\t\t\t\turl: mediaType === 'image' ? mediaLink : undefined,\n\t\t\t\ticon: page,\n\t\t\t} );\n\t\t}\n\t\treturn linkDestinations;\n\t};\n\n\tconst onSetHref = ( value ) => {\n\t\tconst linkDestinations = getLinkDestinations();\n\t\tlet linkDestinationInput;\n\t\tif ( ! value ) {\n\t\t\tlinkDestinationInput = LINK_DESTINATION_NONE;\n\t\t} else {\n\t\t\tlinkDestinationInput = (\n\t\t\t\tlinkDestinations.find( ( destination ) => {\n\t\t\t\t\treturn destination.url === value;\n\t\t\t\t} ) || { linkDestination: LINK_DESTINATION_CUSTOM }\n\t\t\t).linkDestination;\n\t\t}\n\t\tonChangeUrl( {\n\t\t\tlinkDestination: linkDestinationInput,\n\t\t\thref: value,\n\t\t} );\n\t};\n\n\tconst onSetNewTab = ( value ) => {\n\t\tconst updatedLinkTarget = getUpdatedLinkTargetSettings( value );\n\t\tonChangeUrl( updatedLinkTarget );\n\t};\n\n\tconst onSetLinkRel = ( value ) => {\n\t\tonChangeUrl( { rel: value } );\n\t};\n\n\tconst onSetLinkClass = ( value ) => {\n\t\tonChangeUrl( { linkClass: value } );\n\t};\n\n\tconst advancedOptions = (\n\t\t<VStack spacing=\"3\">\n\t\t\t<ToggleControl\n\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\tonChange={ onSetNewTab }\n\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'Link relation' ) }\n\t\t\t\tvalue={ rel ?? '' }\n\t\t\t\tonChange={ onSetLinkRel }\n\t\t\t\thelp={ createInterpolateElement(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\ta: (\n\t\t\t\t\t\t\t<ExternalLink href=\"https://developer.mozilla.org/docs/Web/HTML/Attributes/rel\" />\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\t<TextControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\tlabel={ __( 'Link CSS class' ) }\n\t\t\t\tvalue={ linkClass || '' }\n\t\t\t\tonChange={ onSetLinkClass }\n\t\t\t/>\n\t\t</VStack>\n\t);\n\n\tconst linkEditorValue = urlInput !== null ? urlInput : url;\n\tconst hideLightboxPanel =\n\t\t! lightboxEnabled || ( lightboxEnabled && ! showLightboxSetting );\n\tconst showLinkEditor = ! linkEditorValue && hideLightboxPanel;\n\n\tconst urlLabel = (\n\t\tgetLinkDestinations().find(\n\t\t\t( destination ) => destination.linkDestination === linkDestination\n\t\t) || {}\n\t).title;\n\n\tconst PopoverChildren = () => {\n\t\tif (\n\t\t\tlightboxEnabled &&\n\t\t\tshowLightboxSetting &&\n\t\t\t! url &&\n\t\t\t! isEditingLink\n\t\t) {\n\t\t\treturn (\n\t\t\t\t<div className=\"block-editor-url-popover__expand-on-click\">\n\t\t\t\t\t<Icon icon={ fullscreen } />\n\t\t\t\t\t<div className=\"text\">\n\t\t\t\t\t\t<p>{ __( 'Enlarge on click' ) }</p>\n\t\t\t\t\t\t<p className=\"description\">\n\t\t\t\t\t\t\t{ __( 'Scales the image with a lightbox effect' ) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\tlabel={ __( 'Disable enlarge on click' ) }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonSetLightbox?.( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t} else if ( ! url || isEditingLink ) {\n\t\t\treturn (\n\t\t\t\t<URLPopover.LinkEditor\n\t\t\t\t\tclassName=\"block-editor-format-toolbar__link-container-content\"\n\t\t\t\t\tvalue={ linkEditorValue }\n\t\t\t\t\tonChangeInputValue={ setUrlInput }\n\t\t\t\t\tonSubmit={ onSubmitLinkChange() }\n\t\t\t\t\tautocompleteRef={ autocompleteRef }\n\t\t\t\t/>\n\t\t\t);\n\t\t} else if ( url && ! isEditingLink ) {\n\t\t\treturn (\n\t\t\t\t<>\n\t\t\t\t\t<URLPopover.LinkViewer\n\t\t\t\t\t\tclassName=\"block-editor-format-toolbar__link-container-content\"\n\t\t\t\t\t\turl={ url }\n\t\t\t\t\t\tonEditLinkClick={ startEditLink }\n\t\t\t\t\t\turlLabel={ urlLabel }\n\t\t\t\t\t/>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ticon={ linkOff }\n\t\t\t\t\t\tlabel={ __( 'Remove link' ) }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tonLinkRemove();\n\t\t\t\t\t\t\tresetLightbox?.();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t);\n\t\t}\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<ToolbarButton\n\t\t\t\ticon={ linkIcon }\n\t\t\t\tclassName=\"components-toolbar__control\"\n\t\t\t\tlabel={ __( 'Link' ) }\n\t\t\t\taria-expanded={ isOpen }\n\t\t\t\tonClick={ openLinkUI }\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\tisActive={\n\t\t\t\t\t!! url || ( lightboxEnabled && showLightboxSetting )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isOpen && (\n\t\t\t\t<URLPopover\n\t\t\t\t\tref={ wrapperRef }\n\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\tonFocusOutside={ onFocusOutside() }\n\t\t\t\t\tonClose={ closeLinkUI }\n\t\t\t\t\trenderSettings={\n\t\t\t\t\t\thideLightboxPanel ? () => advancedOptions : null\n\t\t\t\t\t}\n\t\t\t\t\tadditionalControls={\n\t\t\t\t\t\tshowLinkEditor && (\n\t\t\t\t\t\t\t<NavigableMenu>\n\t\t\t\t\t\t\t\t{ getLinkDestinations().map( ( link ) => (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tkey={ link.linkDestination }\n\t\t\t\t\t\t\t\t\t\ticon={ link.icon }\n\t\t\t\t\t\t\t\t\t\ticonPosition=\"left\"\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetUrlInput( null );\n\t\t\t\t\t\t\t\t\t\t\tonSetHref( link.url );\n\t\t\t\t\t\t\t\t\t\t\tstopEditLink();\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ link.title }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t{ showLightboxSetting && (\n\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\tkey=\"expand-on-click\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-url-popover__expand-on-click\"\n\t\t\t\t\t\t\t\t\t\ticon={ fullscreen }\n\t\t\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t\t\t'Scale the image with a lightbox effect.'\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\ticonPosition=\"left\"\n\t\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\t\tsetUrlInput( null );\n\t\t\t\t\t\t\t\t\t\t\tonChangeUrl( {\n\t\t\t\t\t\t\t\t\t\t\t\tlinkDestination:\n\t\t\t\t\t\t\t\t\t\t\t\t\tLINK_DESTINATION_NONE,\n\t\t\t\t\t\t\t\t\t\t\t\thref: '',\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t\tonSetLightbox?.( true );\n\t\t\t\t\t\t\t\t\t\t\tstopEditLink();\n\t\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ __( 'Enlarge on click' ) }\n\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</NavigableMenu>\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\toffset={ 13 }\n\t\t\t\t>\n\t\t\t\t\t{ PopoverChildren() }\n\t\t\t\t</URLPopover>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport { ImageURLInputUI as __experimentalImageURLInputUI };\n"],
5
+ "mappings": ";AAGA,SAAS,UAAU;AACnB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,aAAa;AACtB;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,wBAAwB;AAAA,EACxB;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA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