@wordpress/block-editor 14.8.1-next.a9f418477.0 → 14.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (906) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +8 -0
  3. package/build/autocompleters/block.js +1 -0
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/autocompleters/link.js +1 -0
  6. package/build/autocompleters/link.js.map +1 -1
  7. package/build/components/alignment-control/ui.js +1 -0
  8. package/build/components/alignment-control/ui.js.map +1 -1
  9. package/build/components/autocomplete/index.js +1 -0
  10. package/build/components/autocomplete/index.js.map +1 -1
  11. package/build/components/background-image-control/index.js +1 -0
  12. package/build/components/background-image-control/index.js.map +1 -1
  13. package/build/components/block-actions/index.js +1 -0
  14. package/build/components/block-actions/index.js.map +1 -1
  15. package/build/components/block-alignment-control/ui.js +1 -0
  16. package/build/components/block-alignment-control/ui.js.map +1 -1
  17. package/build/components/block-alignment-control/ui.native.js +1 -0
  18. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  19. package/build/components/block-alignment-control/use-available-alignments.js +1 -0
  20. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  21. package/build/components/block-breadcrumb/index.js +1 -0
  22. package/build/components/block-breadcrumb/index.js.map +1 -1
  23. package/build/components/block-compare/index.js +1 -0
  24. package/build/components/block-compare/index.js.map +1 -1
  25. package/build/components/block-controls/fill.js +1 -0
  26. package/build/components/block-controls/fill.js.map +1 -1
  27. package/build/components/block-edit/edit.js +1 -0
  28. package/build/components/block-edit/edit.js.map +1 -1
  29. package/build/components/block-edit/edit.native.js +1 -0
  30. package/build/components/block-edit/edit.native.js.map +1 -1
  31. package/build/components/block-heading-level-dropdown/index.js +1 -0
  32. package/build/components/block-heading-level-dropdown/index.js.map +1 -1
  33. package/build/components/block-heading-level-dropdown/index.native.js +1 -0
  34. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -1
  35. package/build/components/block-inspector/index.js +1 -0
  36. package/build/components/block-inspector/index.js.map +1 -1
  37. package/build/components/block-list/block-invalid-warning.js +1 -0
  38. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  39. package/build/components/block-list/block-list-context.native.js +1 -0
  40. package/build/components/block-list/block-list-context.native.js.map +1 -1
  41. package/build/components/block-list/block.js +1 -0
  42. package/build/components/block-list/block.js.map +1 -1
  43. package/build/components/block-list/block.native.js +1 -0
  44. package/build/components/block-list/block.native.js.map +1 -1
  45. package/build/components/block-list/index.js +1 -0
  46. package/build/components/block-list/index.js.map +1 -1
  47. package/build/components/block-list/index.native.js +1 -0
  48. package/build/components/block-list/index.native.js.map +1 -1
  49. package/build/components/block-list/use-block-props/use-focus-first-element.js +1 -0
  50. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  51. package/build/components/block-list/use-in-between-inserter.js +1 -0
  52. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  53. package/build/components/block-lock/modal.js +1 -0
  54. package/build/components/block-lock/modal.js.map +1 -1
  55. package/build/components/block-manager/category.js +1 -0
  56. package/build/components/block-manager/category.js.map +1 -1
  57. package/build/components/block-manager/checklist.js +1 -0
  58. package/build/components/block-manager/checklist.js.map +1 -1
  59. package/build/components/block-manager/index.js +1 -0
  60. package/build/components/block-manager/index.js.map +1 -1
  61. package/build/components/block-media-update-progress/index.native.js +1 -0
  62. package/build/components/block-media-update-progress/index.native.js.map +1 -1
  63. package/build/components/block-mover/index.native.js +1 -0
  64. package/build/components/block-mover/index.native.js.map +1 -1
  65. package/build/components/block-mover/mover-description.native.js +1 -0
  66. package/build/components/block-mover/mover-description.native.js.map +1 -1
  67. package/build/components/block-pattern-setup/index.js +1 -0
  68. package/build/components/block-pattern-setup/index.js.map +1 -1
  69. package/build/components/block-pattern-setup/use-patterns-setup.js +1 -0
  70. package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  71. package/build/components/block-patterns-list/index.js +1 -0
  72. package/build/components/block-patterns-list/index.js.map +1 -1
  73. package/build/components/block-quick-navigation/index.js +1 -0
  74. package/build/components/block-quick-navigation/index.js.map +1 -1
  75. package/build/components/block-rename/rename-control.js +1 -0
  76. package/build/components/block-rename/rename-control.js.map +1 -1
  77. package/build/components/block-settings-menu/block-settings-dropdown.js +1 -0
  78. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  79. package/build/components/block-styles/index.js +1 -0
  80. package/build/components/block-styles/index.js.map +1 -1
  81. package/build/components/block-styles/index.native.js +1 -0
  82. package/build/components/block-styles/index.native.js.map +1 -1
  83. package/build/components/block-styles/menu-items.js +1 -0
  84. package/build/components/block-styles/menu-items.js.map +1 -1
  85. package/build/components/block-styles/preview.native.js +1 -0
  86. package/build/components/block-styles/preview.native.js.map +1 -1
  87. package/build/components/block-switcher/block-transformations-menu.js +1 -0
  88. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  89. package/build/components/block-switcher/block-transformations-menu.native.js +1 -0
  90. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  91. package/build/components/block-switcher/block-variation-transformations.js +1 -0
  92. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  93. package/build/components/block-switcher/index.js +1 -0
  94. package/build/components/block-switcher/index.js.map +1 -1
  95. package/build/components/block-switcher/pattern-transformations-menu.js +1 -0
  96. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  97. package/build/components/block-switcher/use-transformed-patterns.js +1 -0
  98. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  99. package/build/components/block-switcher/utils.js +1 -0
  100. package/build/components/block-switcher/utils.js.map +1 -1
  101. package/build/components/block-toolbar/block-toolbar-menu.native.js +1 -0
  102. package/build/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  103. package/build/components/block-toolbar/change-design.js +1 -0
  104. package/build/components/block-toolbar/change-design.js.map +1 -1
  105. package/build/components/block-toolbar/index.js +1 -0
  106. package/build/components/block-toolbar/index.js.map +1 -1
  107. package/build/components/block-tools/use-selected-block-tool-props.js +1 -0
  108. package/build/components/block-tools/use-selected-block-tool-props.js.map +1 -1
  109. package/build/components/block-types-list/index.js +1 -0
  110. package/build/components/block-types-list/index.js.map +1 -1
  111. package/build/components/block-variation-picker/index.js +1 -0
  112. package/build/components/block-variation-picker/index.js.map +1 -1
  113. package/build/components/block-variation-picker/index.native.js +1 -0
  114. package/build/components/block-variation-picker/index.native.js.map +1 -1
  115. package/build/components/block-variation-transforms/index.js +1 -0
  116. package/build/components/block-variation-transforms/index.js.map +1 -1
  117. package/build/components/block-vertical-alignment-control/ui.js +1 -0
  118. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  119. package/build/components/border-radius-control/index.js +1 -0
  120. package/build/components/border-radius-control/index.js.map +1 -1
  121. package/build/components/border-radius-control/input-controls.js +1 -0
  122. package/build/components/border-radius-control/input-controls.js.map +1 -1
  123. package/build/components/border-radius-control/utils.js +1 -0
  124. package/build/components/border-radius-control/utils.js.map +1 -1
  125. package/build/components/colors/utils.js +1 -0
  126. package/build/components/colors/utils.js.map +1 -1
  127. package/build/components/colors/with-colors.js +1 -0
  128. package/build/components/colors/with-colors.js.map +1 -1
  129. package/build/components/colors-gradients/dropdown.js +1 -0
  130. package/build/components/colors-gradients/dropdown.js.map +1 -1
  131. package/build/components/colors-gradients/panel-color-gradient-settings.js +1 -0
  132. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  133. package/build/components/colors-gradients/panel-color-gradient-settings.native.js +1 -0
  134. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  135. package/build/components/convert-to-group-buttons/toolbar.js +1 -0
  136. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  137. package/build/components/date-format-picker/index.js +1 -0
  138. package/build/components/date-format-picker/index.js.map +1 -1
  139. package/build/components/dimensions-tool/scale-tool.js +1 -0
  140. package/build/components/dimensions-tool/scale-tool.js.map +1 -1
  141. package/build/components/duotone/utils.js +1 -0
  142. package/build/components/duotone/utils.js.map +1 -1
  143. package/build/components/editor-styles/index.js +1 -0
  144. package/build/components/editor-styles/index.js.map +1 -1
  145. package/build/components/font-appearance-control/index.js +1 -0
  146. package/build/components/font-appearance-control/index.js.map +1 -1
  147. package/build/components/font-family/index.js +1 -0
  148. package/build/components/font-family/index.js.map +1 -1
  149. package/build/components/font-sizes/with-font-sizes.js +1 -0
  150. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  151. package/build/components/global-styles/border-panel.js +1 -0
  152. package/build/components/global-styles/border-panel.js.map +1 -1
  153. package/build/components/global-styles/color-panel.js +25 -8
  154. package/build/components/global-styles/color-panel.js.map +1 -1
  155. package/build/components/global-styles/color-panel.native.js +1 -0
  156. package/build/components/global-styles/color-panel.native.js.map +1 -1
  157. package/build/components/global-styles/dimensions-panel.js +1 -0
  158. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  159. package/build/components/global-styles/filters-panel.js +3 -2
  160. package/build/components/global-styles/filters-panel.js.map +1 -1
  161. package/build/components/global-styles/get-global-styles-changes.js +1 -0
  162. package/build/components/global-styles/get-global-styles-changes.js.map +1 -1
  163. package/build/components/global-styles/shadow-panel-components.js +1 -0
  164. package/build/components/global-styles/shadow-panel-components.js.map +1 -1
  165. package/build/components/global-styles/typography-utils.js +1 -0
  166. package/build/components/global-styles/typography-utils.js.map +1 -1
  167. package/build/components/global-styles/use-global-styles-context.native.js +1 -0
  168. package/build/components/global-styles/use-global-styles-context.native.js.map +1 -1
  169. package/build/components/global-styles/use-global-styles-output.js +2 -1
  170. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  171. package/build/components/global-styles/utils.js +1 -0
  172. package/build/components/global-styles/utils.js.map +1 -1
  173. package/build/components/grid/grid-visualizer.js +1 -0
  174. package/build/components/grid/grid-visualizer.js.map +1 -1
  175. package/build/components/grid/use-grid-layout-sync.js +1 -0
  176. package/build/components/grid/use-grid-layout-sync.js.map +1 -1
  177. package/build/components/grid/utils.js +1 -0
  178. package/build/components/grid/utils.js.map +1 -1
  179. package/build/components/iframe/get-compatibility-styles.js +1 -0
  180. package/build/components/iframe/get-compatibility-styles.js.map +1 -1
  181. package/build/components/image-editor/aspect-ratio-dropdown.js +1 -0
  182. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  183. package/build/components/index.js +15 -8
  184. package/build/components/index.js.map +1 -1
  185. package/build/components/inner-blocks/use-block-context.js +1 -0
  186. package/build/components/inner-blocks/use-block-context.js.map +1 -1
  187. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -0
  188. package/build/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  189. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -0
  190. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  191. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -0
  192. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  193. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -0
  194. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  195. package/build/components/inserter/block-types-tab.js +2 -1
  196. package/build/components/inserter/block-types-tab.js.map +1 -1
  197. package/build/components/inserter/block-types-tab.native.js +1 -0
  198. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  199. package/build/components/inserter/category-tabs/index.js +1 -0
  200. package/build/components/inserter/category-tabs/index.js.map +1 -1
  201. package/build/components/inserter/hooks/use-block-type-impressions.native.js +1 -0
  202. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  203. package/build/components/inserter/hooks/use-patterns-state.js +1 -0
  204. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  205. package/build/components/inserter/index.js +1 -0
  206. package/build/components/inserter/index.js.map +1 -1
  207. package/build/components/inserter/index.native.js +1 -0
  208. package/build/components/inserter/index.native.js.map +1 -1
  209. package/build/components/inserter/media-tab/hooks.js +1 -0
  210. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  211. package/build/components/inserter/media-tab/media-list.js +1 -0
  212. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  213. package/build/components/inserter/media-tab/media-tab.js +1 -0
  214. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  215. package/build/components/inserter/menu.js +1 -0
  216. package/build/components/inserter/menu.js.map +1 -1
  217. package/build/components/inserter/mobile-tab-navigation.js +1 -0
  218. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  219. package/build/components/inserter/search-items.js +1 -0
  220. package/build/components/inserter/search-items.js.map +1 -1
  221. package/build/components/inserter/search-results.js +1 -0
  222. package/build/components/inserter/search-results.js.map +1 -1
  223. package/build/components/inserter/tabs.native.js +1 -0
  224. package/build/components/inserter/tabs.native.js.map +1 -1
  225. package/build/components/inserter/utils.native.js +1 -0
  226. package/build/components/inserter/utils.native.js.map +1 -1
  227. package/build/components/inspector-controls/block-support-tools-panel.js +1 -0
  228. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  229. package/build/components/inspector-controls/fill.js +1 -0
  230. package/build/components/inspector-controls/fill.js.map +1 -1
  231. package/build/components/inspector-controls-tabs/index.js +1 -0
  232. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  233. package/build/components/inspector-controls-tabs/position-controls-panel.js +1 -0
  234. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  235. package/build/components/inspector-popover-header/index.js +1 -0
  236. package/build/components/inspector-popover-header/index.js.map +1 -1
  237. package/build/components/justify-content-control/ui.js +1 -0
  238. package/build/components/justify-content-control/ui.js.map +1 -1
  239. package/build/components/link-control/index.js +13 -1
  240. package/build/components/link-control/index.js.map +1 -1
  241. package/build/components/link-control/search-input.js +11 -1
  242. package/build/components/link-control/search-input.js.map +1 -1
  243. package/build/components/link-control/search-item.js +12 -1
  244. package/build/components/link-control/search-item.js.map +1 -1
  245. package/build/components/link-control/search-results.js +13 -1
  246. package/build/components/link-control/search-results.js.map +1 -1
  247. package/build/components/link-control/settings.js +1 -0
  248. package/build/components/link-control/settings.js.map +1 -1
  249. package/build/components/link-control/use-internal-value.js +1 -0
  250. package/build/components/link-control/use-internal-value.js.map +1 -1
  251. package/build/components/link-control/use-search-handler.js +1 -0
  252. package/build/components/link-control/use-search-handler.js.map +1 -1
  253. package/build/components/list-view/block-select-button.js +1 -0
  254. package/build/components/list-view/block-select-button.js.map +1 -1
  255. package/build/components/list-view/block.js +1 -0
  256. package/build/components/list-view/block.js.map +1 -1
  257. package/build/components/list-view/branch.js +1 -0
  258. package/build/components/list-view/branch.js.map +1 -1
  259. package/build/components/list-view/index.js +1 -0
  260. package/build/components/list-view/index.js.map +1 -1
  261. package/build/components/list-view/use-block-selection.js +1 -0
  262. package/build/components/list-view/use-block-selection.js.map +1 -1
  263. package/build/components/list-view/use-clipboard-handler.js +1 -0
  264. package/build/components/list-view/use-clipboard-handler.js.map +1 -1
  265. package/build/components/list-view/use-list-view-block-indexes.js +1 -0
  266. package/build/components/list-view/use-list-view-block-indexes.js.map +1 -1
  267. package/build/components/list-view/use-list-view-drop-zone.js +1 -0
  268. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  269. package/build/components/list-view/utils.js +1 -0
  270. package/build/components/list-view/utils.js.map +1 -1
  271. package/build/components/media-placeholder/index.js +1 -0
  272. package/build/components/media-placeholder/index.js.map +1 -1
  273. package/build/components/media-placeholder/index.native.js +1 -0
  274. package/build/components/media-placeholder/index.native.js.map +1 -1
  275. package/build/components/media-replace-flow/index.js +1 -0
  276. package/build/components/media-replace-flow/index.js.map +1 -1
  277. package/build/components/media-upload/index.native.js +1 -0
  278. package/build/components/media-upload/index.native.js.map +1 -1
  279. package/build/components/navigable-toolbar/index.js +1 -0
  280. package/build/components/navigable-toolbar/index.js.map +1 -1
  281. package/build/components/panel-color-settings/index.js +1 -0
  282. package/build/components/panel-color-settings/index.js.map +1 -1
  283. package/build/components/provider/use-block-sync.js +1 -0
  284. package/build/components/provider/use-block-sync.js.map +1 -1
  285. package/build/components/responsive-block-control/index.js +1 -0
  286. package/build/components/responsive-block-control/index.js.map +1 -1
  287. package/build/components/rich-text/embed-handler-picker.native.js +1 -0
  288. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  289. package/build/components/rich-text/event-listeners/before-input-rules.js +1 -0
  290. package/build/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
  291. package/build/components/rich-text/event-listeners/index.js +1 -0
  292. package/build/components/rich-text/event-listeners/index.js.map +1 -1
  293. package/build/components/rich-text/event-listeners/input-rules.js +1 -0
  294. package/build/components/rich-text/event-listeners/input-rules.js.map +1 -1
  295. package/build/components/rich-text/event-listeners/paste-handler.js +1 -0
  296. package/build/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  297. package/build/components/rich-text/file-paste-handler.native.js +1 -0
  298. package/build/components/rich-text/file-paste-handler.native.js.map +1 -1
  299. package/build/components/rich-text/format-edit.js +1 -0
  300. package/build/components/rich-text/format-edit.js.map +1 -1
  301. package/build/components/rich-text/format-toolbar/index.js +1 -0
  302. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  303. package/build/components/rich-text/index.js +1 -0
  304. package/build/components/rich-text/index.js.map +1 -1
  305. package/build/components/rich-text/index.native.js +1 -0
  306. package/build/components/rich-text/index.native.js.map +1 -1
  307. package/build/components/rich-text/multiline.js +1 -0
  308. package/build/components/rich-text/multiline.js.map +1 -1
  309. package/build/components/rich-text/native/format-edit.js +1 -0
  310. package/build/components/rich-text/native/format-edit.js.map +1 -1
  311. package/build/components/rich-text/native/get-format-colors.native.js +1 -0
  312. package/build/components/rich-text/native/get-format-colors.native.js.map +1 -1
  313. package/build/components/rich-text/native/index.native.js +1 -0
  314. package/build/components/rich-text/native/index.native.js.map +1 -1
  315. package/build/components/rich-text/native/toolbar-button-with-options.native.js +1 -0
  316. package/build/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  317. package/build/components/rich-text/native/use-format-types.js +1 -0
  318. package/build/components/rich-text/native/use-format-types.js.map +1 -1
  319. package/build/components/rich-text/use-format-types.js +1 -0
  320. package/build/components/rich-text/use-format-types.js.map +1 -1
  321. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -0
  322. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  323. package/build/components/spacing-sizes-control/input-controls/axial.js +1 -0
  324. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  325. package/build/components/spacing-sizes-control/input-controls/separated.js +1 -0
  326. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  327. package/build/components/spacing-sizes-control/input-controls/single.js +1 -0
  328. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  329. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -0
  330. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  331. package/build/components/spacing-sizes-control/utils.js +1 -0
  332. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  333. package/build/components/tabbed-sidebar/index.js +1 -0
  334. package/build/components/tabbed-sidebar/index.js.map +1 -1
  335. package/build/components/text-alignment-control/index.js +1 -0
  336. package/build/components/text-alignment-control/index.js.map +1 -1
  337. package/build/components/text-decoration-control/index.js +1 -0
  338. package/build/components/text-decoration-control/index.js.map +1 -1
  339. package/build/components/text-transform-control/index.js +1 -0
  340. package/build/components/text-transform-control/index.js.map +1 -1
  341. package/build/components/unsupported-block-details/index.native.js +1 -0
  342. package/build/components/unsupported-block-details/index.native.js.map +1 -1
  343. package/build/components/url-input/index.js +1 -0
  344. package/build/components/url-input/index.js.map +1 -1
  345. package/build/components/url-popover/image-url-input-ui.js +1 -0
  346. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  347. package/build/components/use-block-commands/index.js +1 -0
  348. package/build/components/use-block-commands/index.js.map +1 -1
  349. package/build/components/use-block-drop-zone/index.js +1 -0
  350. package/build/components/use-block-drop-zone/index.js.map +1 -1
  351. package/build/components/use-block-drop-zone/index.native.js +1 -0
  352. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  353. package/build/components/use-flash-editable-blocks/index.js +1 -0
  354. package/build/components/use-flash-editable-blocks/index.js.map +1 -1
  355. package/build/components/use-on-block-drop/index.js +1 -0
  356. package/build/components/use-on-block-drop/index.js.map +1 -1
  357. package/build/components/use-on-block-drop/index.native.js +1 -0
  358. package/build/components/use-on-block-drop/index.native.js.map +1 -1
  359. package/build/components/use-paste-styles/index.js +1 -0
  360. package/build/components/use-paste-styles/index.js.map +1 -1
  361. package/build/components/warning/index.js +1 -0
  362. package/build/components/warning/index.js.map +1 -1
  363. package/build/components/writing-flow/use-arrow-nav.js +1 -0
  364. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  365. package/build/components/writing-flow/use-clipboard-handler.js +1 -0
  366. package/build/components/writing-flow/use-clipboard-handler.js.map +1 -1
  367. package/build/components/writing-flow/use-input.js +1 -0
  368. package/build/components/writing-flow/use-input.js.map +1 -1
  369. package/build/components/writing-flow/use-tab-nav.js +1 -0
  370. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  371. package/build/components/writing-flow/utils.js +1 -0
  372. package/build/components/writing-flow/utils.js.map +1 -1
  373. package/build/components/writing-mode-control/index.js +1 -0
  374. package/build/components/writing-mode-control/index.js.map +1 -1
  375. package/build/hooks/align.js +1 -0
  376. package/build/hooks/align.js.map +1 -1
  377. package/build/hooks/align.native.js +1 -0
  378. package/build/hooks/align.native.js.map +1 -1
  379. package/build/hooks/block-bindings.js +1 -0
  380. package/build/hooks/block-bindings.js.map +1 -1
  381. package/build/hooks/block-hooks.js +1 -0
  382. package/build/hooks/block-hooks.js.map +1 -1
  383. package/build/hooks/block-style-variation.js +1 -0
  384. package/build/hooks/block-style-variation.js.map +1 -1
  385. package/build/hooks/border.js +1 -0
  386. package/build/hooks/border.js.map +1 -1
  387. package/build/hooks/duotone.js +1 -0
  388. package/build/hooks/duotone.js.map +1 -1
  389. package/build/hooks/index.js +1 -0
  390. package/build/hooks/index.js.map +1 -1
  391. package/build/hooks/layout.js +1 -0
  392. package/build/hooks/layout.js.map +1 -1
  393. package/build/hooks/position.js +1 -0
  394. package/build/hooks/position.js.map +1 -1
  395. package/build/hooks/style.js +2 -1
  396. package/build/hooks/style.js.map +1 -1
  397. package/build/hooks/supports.js +1 -0
  398. package/build/hooks/supports.js.map +1 -1
  399. package/build/hooks/text-align.js +1 -0
  400. package/build/hooks/text-align.js.map +1 -1
  401. package/build/hooks/typography.js +1 -0
  402. package/build/hooks/typography.js.map +1 -1
  403. package/build/hooks/use-bindings-attributes.js +1 -0
  404. package/build/hooks/use-bindings-attributes.js.map +1 -1
  405. package/build/hooks/utils.js +1 -0
  406. package/build/hooks/utils.js.map +1 -1
  407. package/build/layouts/constrained.js +1 -0
  408. package/build/layouts/constrained.js.map +1 -1
  409. package/build/layouts/flex.js +1 -0
  410. package/build/layouts/flex.js.map +1 -1
  411. package/build/layouts/flow.js +1 -0
  412. package/build/layouts/flow.js.map +1 -1
  413. package/build/layouts/index.js +1 -0
  414. package/build/layouts/index.js.map +1 -1
  415. package/build/layouts/utils.js +1 -0
  416. package/build/layouts/utils.js.map +1 -1
  417. package/build/store/actions.js +1 -0
  418. package/build/store/actions.js.map +1 -1
  419. package/build/store/get-block-settings.js +1 -0
  420. package/build/store/get-block-settings.js.map +1 -1
  421. package/build/store/private-actions.js +1 -0
  422. package/build/store/private-actions.js.map +1 -1
  423. package/build/store/private-selectors.js +1 -0
  424. package/build/store/private-selectors.js.map +1 -1
  425. package/build/store/reducer.js +1 -0
  426. package/build/store/reducer.js.map +1 -1
  427. package/build/store/selectors.js +13 -15
  428. package/build/store/selectors.js.map +1 -1
  429. package/build/store/utils.js +1 -0
  430. package/build/store/utils.js.map +1 -1
  431. package/build/utils/block-bindings.js +1 -0
  432. package/build/utils/block-bindings.js.map +1 -1
  433. package/build/utils/get-editor-region.js +1 -0
  434. package/build/utils/get-editor-region.js.map +1 -1
  435. package/build/utils/get-font-styles-and-weights.js +1 -0
  436. package/build/utils/get-font-styles-and-weights.js.map +1 -1
  437. package/build/utils/math.js +1 -0
  438. package/build/utils/math.js.map +1 -1
  439. package/build/utils/object.js +1 -0
  440. package/build/utils/object.js.map +1 -1
  441. package/build/utils/selection.js +1 -0
  442. package/build/utils/selection.js.map +1 -1
  443. package/build/utils/transform-styles/index.js +1 -0
  444. package/build/utils/transform-styles/index.js.map +1 -1
  445. package/build-module/autocompleters/block.js +1 -0
  446. package/build-module/autocompleters/block.js.map +1 -1
  447. package/build-module/autocompleters/link.js +1 -0
  448. package/build-module/autocompleters/link.js.map +1 -1
  449. package/build-module/components/alignment-control/ui.js +1 -0
  450. package/build-module/components/alignment-control/ui.js.map +1 -1
  451. package/build-module/components/autocomplete/index.js +1 -0
  452. package/build-module/components/autocomplete/index.js.map +1 -1
  453. package/build-module/components/background-image-control/index.js +1 -0
  454. package/build-module/components/background-image-control/index.js.map +1 -1
  455. package/build-module/components/block-actions/index.js +1 -0
  456. package/build-module/components/block-actions/index.js.map +1 -1
  457. package/build-module/components/block-alignment-control/ui.js +1 -0
  458. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  459. package/build-module/components/block-alignment-control/ui.native.js +1 -0
  460. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  461. package/build-module/components/block-alignment-control/use-available-alignments.js +1 -0
  462. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  463. package/build-module/components/block-breadcrumb/index.js +1 -0
  464. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  465. package/build-module/components/block-compare/index.js +1 -0
  466. package/build-module/components/block-compare/index.js.map +1 -1
  467. package/build-module/components/block-controls/fill.js +1 -0
  468. package/build-module/components/block-controls/fill.js.map +1 -1
  469. package/build-module/components/block-edit/edit.js +1 -0
  470. package/build-module/components/block-edit/edit.js.map +1 -1
  471. package/build-module/components/block-edit/edit.native.js +1 -0
  472. package/build-module/components/block-edit/edit.native.js.map +1 -1
  473. package/build-module/components/block-heading-level-dropdown/index.js +1 -0
  474. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -1
  475. package/build-module/components/block-heading-level-dropdown/index.native.js +1 -0
  476. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -1
  477. package/build-module/components/block-inspector/index.js +1 -0
  478. package/build-module/components/block-inspector/index.js.map +1 -1
  479. package/build-module/components/block-list/block-invalid-warning.js +1 -0
  480. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  481. package/build-module/components/block-list/block-list-context.native.js +1 -0
  482. package/build-module/components/block-list/block-list-context.native.js.map +1 -1
  483. package/build-module/components/block-list/block.js +1 -0
  484. package/build-module/components/block-list/block.js.map +1 -1
  485. package/build-module/components/block-list/block.native.js +1 -0
  486. package/build-module/components/block-list/block.native.js.map +1 -1
  487. package/build-module/components/block-list/index.js +1 -0
  488. package/build-module/components/block-list/index.js.map +1 -1
  489. package/build-module/components/block-list/index.native.js +1 -0
  490. package/build-module/components/block-list/index.native.js.map +1 -1
  491. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +1 -0
  492. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  493. package/build-module/components/block-list/use-in-between-inserter.js +1 -0
  494. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  495. package/build-module/components/block-lock/modal.js +1 -0
  496. package/build-module/components/block-lock/modal.js.map +1 -1
  497. package/build-module/components/block-manager/category.js +1 -0
  498. package/build-module/components/block-manager/category.js.map +1 -1
  499. package/build-module/components/block-manager/checklist.js +1 -0
  500. package/build-module/components/block-manager/checklist.js.map +1 -1
  501. package/build-module/components/block-manager/index.js +1 -0
  502. package/build-module/components/block-manager/index.js.map +1 -1
  503. package/build-module/components/block-media-update-progress/index.native.js +1 -0
  504. package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
  505. package/build-module/components/block-mover/index.native.js +1 -0
  506. package/build-module/components/block-mover/index.native.js.map +1 -1
  507. package/build-module/components/block-mover/mover-description.native.js +1 -0
  508. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  509. package/build-module/components/block-pattern-setup/index.js +1 -0
  510. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  511. package/build-module/components/block-pattern-setup/use-patterns-setup.js +1 -0
  512. package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  513. package/build-module/components/block-patterns-list/index.js +1 -0
  514. package/build-module/components/block-patterns-list/index.js.map +1 -1
  515. package/build-module/components/block-quick-navigation/index.js +1 -0
  516. package/build-module/components/block-quick-navigation/index.js.map +1 -1
  517. package/build-module/components/block-rename/rename-control.js +1 -0
  518. package/build-module/components/block-rename/rename-control.js.map +1 -1
  519. package/build-module/components/block-settings-menu/block-settings-dropdown.js +1 -0
  520. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  521. package/build-module/components/block-styles/index.js +1 -0
  522. package/build-module/components/block-styles/index.js.map +1 -1
  523. package/build-module/components/block-styles/index.native.js +1 -0
  524. package/build-module/components/block-styles/index.native.js.map +1 -1
  525. package/build-module/components/block-styles/menu-items.js +1 -0
  526. package/build-module/components/block-styles/menu-items.js.map +1 -1
  527. package/build-module/components/block-styles/preview.native.js +1 -0
  528. package/build-module/components/block-styles/preview.native.js.map +1 -1
  529. package/build-module/components/block-switcher/block-transformations-menu.js +1 -0
  530. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  531. package/build-module/components/block-switcher/block-transformations-menu.native.js +1 -0
  532. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  533. package/build-module/components/block-switcher/block-variation-transformations.js +1 -0
  534. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  535. package/build-module/components/block-switcher/index.js +1 -0
  536. package/build-module/components/block-switcher/index.js.map +1 -1
  537. package/build-module/components/block-switcher/pattern-transformations-menu.js +1 -0
  538. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  539. package/build-module/components/block-switcher/use-transformed-patterns.js +1 -0
  540. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  541. package/build-module/components/block-switcher/utils.js +1 -0
  542. package/build-module/components/block-switcher/utils.js.map +1 -1
  543. package/build-module/components/block-toolbar/block-toolbar-menu.native.js +1 -0
  544. package/build-module/components/block-toolbar/block-toolbar-menu.native.js.map +1 -1
  545. package/build-module/components/block-toolbar/change-design.js +1 -0
  546. package/build-module/components/block-toolbar/change-design.js.map +1 -1
  547. package/build-module/components/block-toolbar/index.js +1 -0
  548. package/build-module/components/block-toolbar/index.js.map +1 -1
  549. package/build-module/components/block-tools/use-selected-block-tool-props.js +1 -0
  550. package/build-module/components/block-tools/use-selected-block-tool-props.js.map +1 -1
  551. package/build-module/components/block-types-list/index.js +1 -0
  552. package/build-module/components/block-types-list/index.js.map +1 -1
  553. package/build-module/components/block-variation-picker/index.js +1 -0
  554. package/build-module/components/block-variation-picker/index.js.map +1 -1
  555. package/build-module/components/block-variation-picker/index.native.js +1 -0
  556. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  557. package/build-module/components/block-variation-transforms/index.js +1 -0
  558. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  559. package/build-module/components/block-vertical-alignment-control/ui.js +1 -0
  560. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  561. package/build-module/components/border-radius-control/index.js +1 -0
  562. package/build-module/components/border-radius-control/index.js.map +1 -1
  563. package/build-module/components/border-radius-control/input-controls.js +1 -0
  564. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  565. package/build-module/components/border-radius-control/utils.js +1 -0
  566. package/build-module/components/border-radius-control/utils.js.map +1 -1
  567. package/build-module/components/colors/utils.js +1 -0
  568. package/build-module/components/colors/utils.js.map +1 -1
  569. package/build-module/components/colors/with-colors.js +1 -0
  570. package/build-module/components/colors/with-colors.js.map +1 -1
  571. package/build-module/components/colors-gradients/dropdown.js +1 -0
  572. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  573. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +1 -0
  574. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  575. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +1 -0
  576. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  577. package/build-module/components/convert-to-group-buttons/toolbar.js +1 -0
  578. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  579. package/build-module/components/date-format-picker/index.js +1 -0
  580. package/build-module/components/date-format-picker/index.js.map +1 -1
  581. package/build-module/components/dimensions-tool/scale-tool.js +1 -0
  582. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
  583. package/build-module/components/duotone/utils.js +1 -0
  584. package/build-module/components/duotone/utils.js.map +1 -1
  585. package/build-module/components/editor-styles/index.js +1 -0
  586. package/build-module/components/editor-styles/index.js.map +1 -1
  587. package/build-module/components/font-appearance-control/index.js +1 -0
  588. package/build-module/components/font-appearance-control/index.js.map +1 -1
  589. package/build-module/components/font-family/index.js +1 -0
  590. package/build-module/components/font-family/index.js.map +1 -1
  591. package/build-module/components/font-sizes/with-font-sizes.js +1 -0
  592. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  593. package/build-module/components/global-styles/border-panel.js +1 -0
  594. package/build-module/components/global-styles/border-panel.js.map +1 -1
  595. package/build-module/components/global-styles/color-panel.js +27 -10
  596. package/build-module/components/global-styles/color-panel.js.map +1 -1
  597. package/build-module/components/global-styles/color-panel.native.js +1 -0
  598. package/build-module/components/global-styles/color-panel.native.js.map +1 -1
  599. package/build-module/components/global-styles/dimensions-panel.js +1 -0
  600. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  601. package/build-module/components/global-styles/filters-panel.js +4 -3
  602. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  603. package/build-module/components/global-styles/get-global-styles-changes.js +1 -0
  604. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -1
  605. package/build-module/components/global-styles/shadow-panel-components.js +1 -0
  606. package/build-module/components/global-styles/shadow-panel-components.js.map +1 -1
  607. package/build-module/components/global-styles/typography-utils.js +1 -0
  608. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  609. package/build-module/components/global-styles/use-global-styles-context.native.js +1 -0
  610. package/build-module/components/global-styles/use-global-styles-context.native.js.map +1 -1
  611. package/build-module/components/global-styles/use-global-styles-output.js +2 -1
  612. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  613. package/build-module/components/global-styles/utils.js +1 -0
  614. package/build-module/components/global-styles/utils.js.map +1 -1
  615. package/build-module/components/grid/grid-visualizer.js +1 -0
  616. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  617. package/build-module/components/grid/use-grid-layout-sync.js +1 -0
  618. package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
  619. package/build-module/components/grid/utils.js +1 -0
  620. package/build-module/components/grid/utils.js.map +1 -1
  621. package/build-module/components/iframe/get-compatibility-styles.js +1 -0
  622. package/build-module/components/iframe/get-compatibility-styles.js.map +1 -1
  623. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -0
  624. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  625. package/build-module/components/index.js +4 -4
  626. package/build-module/components/index.js.map +1 -1
  627. package/build-module/components/inner-blocks/use-block-context.js +1 -0
  628. package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
  629. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js +1 -0
  630. package/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js.map +1 -1
  631. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +1 -0
  632. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  633. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +1 -0
  634. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  635. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +1 -0
  636. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  637. package/build-module/components/inserter/block-types-tab.js +2 -1
  638. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  639. package/build-module/components/inserter/block-types-tab.native.js +1 -0
  640. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  641. package/build-module/components/inserter/category-tabs/index.js +1 -0
  642. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  643. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +1 -0
  644. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  645. package/build-module/components/inserter/hooks/use-patterns-state.js +1 -0
  646. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  647. package/build-module/components/inserter/index.js +1 -0
  648. package/build-module/components/inserter/index.js.map +1 -1
  649. package/build-module/components/inserter/index.native.js +1 -0
  650. package/build-module/components/inserter/index.native.js.map +1 -1
  651. package/build-module/components/inserter/media-tab/hooks.js +1 -0
  652. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  653. package/build-module/components/inserter/media-tab/media-list.js +1 -0
  654. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  655. package/build-module/components/inserter/media-tab/media-tab.js +1 -0
  656. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  657. package/build-module/components/inserter/menu.js +1 -0
  658. package/build-module/components/inserter/menu.js.map +1 -1
  659. package/build-module/components/inserter/mobile-tab-navigation.js +1 -0
  660. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  661. package/build-module/components/inserter/search-items.js +1 -0
  662. package/build-module/components/inserter/search-items.js.map +1 -1
  663. package/build-module/components/inserter/search-results.js +1 -0
  664. package/build-module/components/inserter/search-results.js.map +1 -1
  665. package/build-module/components/inserter/tabs.native.js +1 -0
  666. package/build-module/components/inserter/tabs.native.js.map +1 -1
  667. package/build-module/components/inserter/utils.native.js +1 -0
  668. package/build-module/components/inserter/utils.native.js.map +1 -1
  669. package/build-module/components/inspector-controls/block-support-tools-panel.js +1 -0
  670. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  671. package/build-module/components/inspector-controls/fill.js +1 -0
  672. package/build-module/components/inspector-controls/fill.js.map +1 -1
  673. package/build-module/components/inspector-controls-tabs/index.js +1 -0
  674. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  675. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +1 -0
  676. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  677. package/build-module/components/inspector-popover-header/index.js +1 -0
  678. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  679. package/build-module/components/justify-content-control/ui.js +1 -0
  680. package/build-module/components/justify-content-control/ui.js.map +1 -1
  681. package/build-module/components/link-control/index.js +11 -0
  682. package/build-module/components/link-control/index.js.map +1 -1
  683. package/build-module/components/link-control/search-input.js +9 -0
  684. package/build-module/components/link-control/search-input.js.map +1 -1
  685. package/build-module/components/link-control/search-item.js +9 -0
  686. package/build-module/components/link-control/search-item.js.map +1 -1
  687. package/build-module/components/link-control/search-results.js +12 -1
  688. package/build-module/components/link-control/search-results.js.map +1 -1
  689. package/build-module/components/link-control/settings.js +1 -0
  690. package/build-module/components/link-control/settings.js.map +1 -1
  691. package/build-module/components/link-control/use-internal-value.js +1 -0
  692. package/build-module/components/link-control/use-internal-value.js.map +1 -1
  693. package/build-module/components/link-control/use-search-handler.js +1 -0
  694. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  695. package/build-module/components/list-view/block-select-button.js +1 -0
  696. package/build-module/components/list-view/block-select-button.js.map +1 -1
  697. package/build-module/components/list-view/block.js +1 -0
  698. package/build-module/components/list-view/block.js.map +1 -1
  699. package/build-module/components/list-view/branch.js +1 -0
  700. package/build-module/components/list-view/branch.js.map +1 -1
  701. package/build-module/components/list-view/index.js +1 -0
  702. package/build-module/components/list-view/index.js.map +1 -1
  703. package/build-module/components/list-view/use-block-selection.js +1 -0
  704. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  705. package/build-module/components/list-view/use-clipboard-handler.js +1 -0
  706. package/build-module/components/list-view/use-clipboard-handler.js.map +1 -1
  707. package/build-module/components/list-view/use-list-view-block-indexes.js +1 -0
  708. package/build-module/components/list-view/use-list-view-block-indexes.js.map +1 -1
  709. package/build-module/components/list-view/use-list-view-drop-zone.js +1 -0
  710. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  711. package/build-module/components/list-view/utils.js +1 -0
  712. package/build-module/components/list-view/utils.js.map +1 -1
  713. package/build-module/components/media-placeholder/index.js +1 -0
  714. package/build-module/components/media-placeholder/index.js.map +1 -1
  715. package/build-module/components/media-placeholder/index.native.js +1 -0
  716. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  717. package/build-module/components/media-replace-flow/index.js +1 -0
  718. package/build-module/components/media-replace-flow/index.js.map +1 -1
  719. package/build-module/components/media-upload/index.native.js +1 -0
  720. package/build-module/components/media-upload/index.native.js.map +1 -1
  721. package/build-module/components/navigable-toolbar/index.js +1 -0
  722. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  723. package/build-module/components/panel-color-settings/index.js +1 -0
  724. package/build-module/components/panel-color-settings/index.js.map +1 -1
  725. package/build-module/components/provider/use-block-sync.js +1 -0
  726. package/build-module/components/provider/use-block-sync.js.map +1 -1
  727. package/build-module/components/responsive-block-control/index.js +1 -0
  728. package/build-module/components/responsive-block-control/index.js.map +1 -1
  729. package/build-module/components/rich-text/embed-handler-picker.native.js +1 -0
  730. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  731. package/build-module/components/rich-text/event-listeners/before-input-rules.js +1 -0
  732. package/build-module/components/rich-text/event-listeners/before-input-rules.js.map +1 -1
  733. package/build-module/components/rich-text/event-listeners/index.js +1 -0
  734. package/build-module/components/rich-text/event-listeners/index.js.map +1 -1
  735. package/build-module/components/rich-text/event-listeners/input-rules.js +1 -0
  736. package/build-module/components/rich-text/event-listeners/input-rules.js.map +1 -1
  737. package/build-module/components/rich-text/event-listeners/paste-handler.js +1 -0
  738. package/build-module/components/rich-text/event-listeners/paste-handler.js.map +1 -1
  739. package/build-module/components/rich-text/file-paste-handler.native.js +1 -0
  740. package/build-module/components/rich-text/file-paste-handler.native.js.map +1 -1
  741. package/build-module/components/rich-text/format-edit.js +1 -0
  742. package/build-module/components/rich-text/format-edit.js.map +1 -1
  743. package/build-module/components/rich-text/format-toolbar/index.js +1 -0
  744. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  745. package/build-module/components/rich-text/index.js +1 -0
  746. package/build-module/components/rich-text/index.js.map +1 -1
  747. package/build-module/components/rich-text/index.native.js +1 -0
  748. package/build-module/components/rich-text/index.native.js.map +1 -1
  749. package/build-module/components/rich-text/multiline.js +1 -0
  750. package/build-module/components/rich-text/multiline.js.map +1 -1
  751. package/build-module/components/rich-text/native/format-edit.js +1 -0
  752. package/build-module/components/rich-text/native/format-edit.js.map +1 -1
  753. package/build-module/components/rich-text/native/get-format-colors.native.js +1 -0
  754. package/build-module/components/rich-text/native/get-format-colors.native.js.map +1 -1
  755. package/build-module/components/rich-text/native/index.native.js +1 -0
  756. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  757. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js +1 -0
  758. package/build-module/components/rich-text/native/toolbar-button-with-options.native.js.map +1 -1
  759. package/build-module/components/rich-text/native/use-format-types.js +1 -0
  760. package/build-module/components/rich-text/native/use-format-types.js.map +1 -1
  761. package/build-module/components/rich-text/use-format-types.js +1 -0
  762. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  763. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -0
  764. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -1
  765. package/build-module/components/spacing-sizes-control/input-controls/axial.js +1 -0
  766. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -1
  767. package/build-module/components/spacing-sizes-control/input-controls/separated.js +1 -0
  768. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -1
  769. package/build-module/components/spacing-sizes-control/input-controls/single.js +1 -0
  770. package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -1
  771. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -0
  772. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  773. package/build-module/components/spacing-sizes-control/utils.js +1 -0
  774. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  775. package/build-module/components/tabbed-sidebar/index.js +1 -0
  776. package/build-module/components/tabbed-sidebar/index.js.map +1 -1
  777. package/build-module/components/text-alignment-control/index.js +1 -0
  778. package/build-module/components/text-alignment-control/index.js.map +1 -1
  779. package/build-module/components/text-decoration-control/index.js +1 -0
  780. package/build-module/components/text-decoration-control/index.js.map +1 -1
  781. package/build-module/components/text-transform-control/index.js +1 -0
  782. package/build-module/components/text-transform-control/index.js.map +1 -1
  783. package/build-module/components/unsupported-block-details/index.native.js +1 -0
  784. package/build-module/components/unsupported-block-details/index.native.js.map +1 -1
  785. package/build-module/components/url-input/index.js +1 -0
  786. package/build-module/components/url-input/index.js.map +1 -1
  787. package/build-module/components/url-popover/image-url-input-ui.js +1 -0
  788. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  789. package/build-module/components/use-block-commands/index.js +1 -0
  790. package/build-module/components/use-block-commands/index.js.map +1 -1
  791. package/build-module/components/use-block-drop-zone/index.js +1 -0
  792. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  793. package/build-module/components/use-block-drop-zone/index.native.js +1 -0
  794. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  795. package/build-module/components/use-flash-editable-blocks/index.js +1 -0
  796. package/build-module/components/use-flash-editable-blocks/index.js.map +1 -1
  797. package/build-module/components/use-on-block-drop/index.js +1 -0
  798. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  799. package/build-module/components/use-on-block-drop/index.native.js +1 -0
  800. package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
  801. package/build-module/components/use-paste-styles/index.js +1 -0
  802. package/build-module/components/use-paste-styles/index.js.map +1 -1
  803. package/build-module/components/warning/index.js +1 -0
  804. package/build-module/components/warning/index.js.map +1 -1
  805. package/build-module/components/writing-flow/use-arrow-nav.js +1 -0
  806. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  807. package/build-module/components/writing-flow/use-clipboard-handler.js +1 -0
  808. package/build-module/components/writing-flow/use-clipboard-handler.js.map +1 -1
  809. package/build-module/components/writing-flow/use-input.js +1 -0
  810. package/build-module/components/writing-flow/use-input.js.map +1 -1
  811. package/build-module/components/writing-flow/use-tab-nav.js +1 -0
  812. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  813. package/build-module/components/writing-flow/utils.js +1 -0
  814. package/build-module/components/writing-flow/utils.js.map +1 -1
  815. package/build-module/components/writing-mode-control/index.js +1 -0
  816. package/build-module/components/writing-mode-control/index.js.map +1 -1
  817. package/build-module/hooks/align.js +1 -0
  818. package/build-module/hooks/align.js.map +1 -1
  819. package/build-module/hooks/align.native.js +1 -0
  820. package/build-module/hooks/align.native.js.map +1 -1
  821. package/build-module/hooks/block-bindings.js +1 -0
  822. package/build-module/hooks/block-bindings.js.map +1 -1
  823. package/build-module/hooks/block-hooks.js +1 -0
  824. package/build-module/hooks/block-hooks.js.map +1 -1
  825. package/build-module/hooks/block-style-variation.js +1 -0
  826. package/build-module/hooks/block-style-variation.js.map +1 -1
  827. package/build-module/hooks/border.js +1 -0
  828. package/build-module/hooks/border.js.map +1 -1
  829. package/build-module/hooks/duotone.js +1 -0
  830. package/build-module/hooks/duotone.js.map +1 -1
  831. package/build-module/hooks/index.js +1 -0
  832. package/build-module/hooks/index.js.map +1 -1
  833. package/build-module/hooks/layout.js +1 -0
  834. package/build-module/hooks/layout.js.map +1 -1
  835. package/build-module/hooks/position.js +1 -0
  836. package/build-module/hooks/position.js.map +1 -1
  837. package/build-module/hooks/style.js +2 -1
  838. package/build-module/hooks/style.js.map +1 -1
  839. package/build-module/hooks/supports.js +1 -0
  840. package/build-module/hooks/supports.js.map +1 -1
  841. package/build-module/hooks/text-align.js +1 -0
  842. package/build-module/hooks/text-align.js.map +1 -1
  843. package/build-module/hooks/typography.js +1 -0
  844. package/build-module/hooks/typography.js.map +1 -1
  845. package/build-module/hooks/use-bindings-attributes.js +1 -0
  846. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  847. package/build-module/hooks/utils.js +1 -0
  848. package/build-module/hooks/utils.js.map +1 -1
  849. package/build-module/layouts/constrained.js +1 -0
  850. package/build-module/layouts/constrained.js.map +1 -1
  851. package/build-module/layouts/flex.js +1 -0
  852. package/build-module/layouts/flex.js.map +1 -1
  853. package/build-module/layouts/flow.js +1 -0
  854. package/build-module/layouts/flow.js.map +1 -1
  855. package/build-module/layouts/index.js +1 -0
  856. package/build-module/layouts/index.js.map +1 -1
  857. package/build-module/layouts/utils.js +1 -0
  858. package/build-module/layouts/utils.js.map +1 -1
  859. package/build-module/store/actions.js +1 -0
  860. package/build-module/store/actions.js.map +1 -1
  861. package/build-module/store/get-block-settings.js +1 -0
  862. package/build-module/store/get-block-settings.js.map +1 -1
  863. package/build-module/store/private-actions.js +1 -0
  864. package/build-module/store/private-actions.js.map +1 -1
  865. package/build-module/store/private-selectors.js +1 -0
  866. package/build-module/store/private-selectors.js.map +1 -1
  867. package/build-module/store/reducer.js +1 -0
  868. package/build-module/store/reducer.js.map +1 -1
  869. package/build-module/store/selectors.js +13 -15
  870. package/build-module/store/selectors.js.map +1 -1
  871. package/build-module/store/utils.js +1 -0
  872. package/build-module/store/utils.js.map +1 -1
  873. package/build-module/utils/block-bindings.js +1 -0
  874. package/build-module/utils/block-bindings.js.map +1 -1
  875. package/build-module/utils/get-editor-region.js +1 -0
  876. package/build-module/utils/get-editor-region.js.map +1 -1
  877. package/build-module/utils/get-font-styles-and-weights.js +1 -0
  878. package/build-module/utils/get-font-styles-and-weights.js.map +1 -1
  879. package/build-module/utils/math.js +1 -0
  880. package/build-module/utils/math.js.map +1 -1
  881. package/build-module/utils/object.js +1 -0
  882. package/build-module/utils/object.js.map +1 -1
  883. package/build-module/utils/selection.js +1 -0
  884. package/build-module/utils/selection.js.map +1 -1
  885. package/build-module/utils/transform-styles/index.js +1 -0
  886. package/build-module/utils/transform-styles/index.js.map +1 -1
  887. package/build-style/style-rtl.css +22 -0
  888. package/build-style/style.css +22 -0
  889. package/package.json +32 -32
  890. package/src/components/block-heading-level-dropdown/stories/index.story.js +61 -0
  891. package/src/components/colors-gradients/style.scss +21 -0
  892. package/src/components/global-styles/color-panel.js +26 -7
  893. package/src/components/global-styles/filters-panel.js +3 -6
  894. package/src/components/global-styles/use-global-styles-output.js +1 -1
  895. package/src/components/index.js +7 -4
  896. package/src/components/inserter/block-types-tab.js +1 -1
  897. package/src/components/inserter/menu.js +2 -0
  898. package/src/components/link-control/index.js +10 -0
  899. package/src/components/link-control/search-input.js +9 -0
  900. package/src/components/link-control/search-item.js +9 -0
  901. package/src/components/link-control/search-results.js +12 -1
  902. package/src/components/writing-mode-control/stories/index.story.js +56 -0
  903. package/src/hooks/style.js +1 -1
  904. package/src/hooks/test/font-size.js +15 -12
  905. package/src/store/selectors.js +26 -24
  906. package/src/store/test/selectors.js +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_keycodes","_components","_compose","_data","_url","_store","_jsxRuntime","_react","isFunction","maybeFunc","URLInput","Component","constructor","props","onChange","bind","onFocus","onKeyDown","selectLink","handleOnClick","bindSuggestionNode","autocompleteRef","createRef","inputRef","updateSuggestions","debounce","suggestionNodes","suggestionsRequest","state","suggestions","showSuggestions","suggestionsValue","selectedSuggestion","suggestionsListboxId","suggestionOptionIdPrefix","componentDidUpdate","prevProps","value","__experimentalShowInitialSuggestions","scrollIntoView","behavior","block","inline","disableSuggestions","length","componentDidMount","shouldShowInitialSuggestions","componentWillUnmount","cancel","index","ref","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalHandleURLSuggestions","handleURLSuggestions","isInitialSuggestions","trim","isURL","setState","loading","request","then","debouncedSpeak","sprintf","_n","__","catch","finally","newValue","event","keyCode","UP","target","selectionStart","preventDefault","setSelectionRange","DOWN","ENTER","onSubmit","suggestion","previousIndex","nextIndex","TAB","speak","url","current","focus","getDerivedStateFromProps","instanceId","shouldShowSuggestions","hasValue","render","jsxs","Fragment","children","renderControl","renderSuggestions","label","className","isFullWidth","placeholder","__experimentalRenderControl","hideLabelFromVision","inputId","controlProps","id","clsx","inputProps","required","type","role","undefined","suffix","BaseControl","__nextHasNoMarginBottom","jsx","__experimentalInputControl","__next40pxDefaultSize","Spinner","__experimentalRenderSuggestions","suggestionsListProps","buildSuggestionItemProps","tabIndex","isLoading","handleSuggestionClick","currentInputValue","Popover","placement","focusOnMount","map","createElement","Button","key","onClick","title","_default","exports","default","compose","withSafeTimeout","withSpokenMessages","withInstanceId","withSelect","select","getSettings","blockEditorStore"],"sources":["@wordpress/block-editor/src/components/url-input/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { UP, DOWN, ENTER, TAB } from '@wordpress/keycodes';\nimport {\n\tBaseControl,\n\tButton,\n\t__experimentalInputControl as InputControl,\n\tSpinner,\n\twithSpokenMessages,\n\tPopover,\n} from '@wordpress/components';\nimport {\n\tcompose,\n\tdebounce,\n\twithInstanceId,\n\twithSafeTimeout,\n} from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\nimport { isURL } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Whether the argument is a function.\n *\n * @param {*} maybeFunc The argument to check.\n * @return {boolean} True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc ) {\n\treturn typeof maybeFunc === 'function';\n}\n\nclass URLInput extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.onChange = this.onChange.bind( this );\n\t\tthis.onFocus = this.onFocus.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.selectLink = this.selectLink.bind( this );\n\t\tthis.handleOnClick = this.handleOnClick.bind( this );\n\t\tthis.bindSuggestionNode = this.bindSuggestionNode.bind( this );\n\t\tthis.autocompleteRef = props.autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.updateSuggestions = debounce(\n\t\t\tthis.updateSuggestions.bind( this ),\n\t\t\t200\n\t\t);\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.suggestionsRequest = null;\n\n\t\tthis.state = {\n\t\t\tsuggestions: [],\n\t\t\tshowSuggestions: false,\n\t\t\tsuggestionsValue: null,\n\t\t\tselectedSuggestion: null,\n\t\t\tsuggestionsListboxId: '',\n\t\t\tsuggestionOptionIdPrefix: '',\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\tconst { value, __experimentalShowInitialSuggestions = false } =\n\t\t\tthis.props;\n\n\t\t// Only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded.\n\t\tif (\n\t\t\tshowSuggestions &&\n\t\t\tselectedSuggestion !== null &&\n\t\t\tthis.suggestionNodes[ selectedSuggestion ]\n\t\t) {\n\t\t\tthis.suggestionNodes[ selectedSuggestion ].scrollIntoView( {\n\t\t\t\tbehavior: 'instant',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tinline: 'nearest',\n\t\t\t} );\n\t\t}\n\n\t\t// Update suggestions when the value changes.\n\t\tif ( prevProps.value !== value && ! this.props.disableSuggestions ) {\n\t\t\tif ( value?.length ) {\n\t\t\t\t// If the new value is not empty we need to update with suggestions for it.\n\t\t\t\tthis.updateSuggestions( value );\n\t\t\t} else if ( __experimentalShowInitialSuggestions ) {\n\t\t\t\t// If the new value is empty and we can show initial suggestions, then show initial suggestions.\n\t\t\t\tthis.updateSuggestions();\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.shouldShowInitialSuggestions() ) {\n\t\t\tthis.updateSuggestions();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.suggestionsRequest?.cancel?.();\n\t\tthis.suggestionsRequest = null;\n\t}\n\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\n\tshouldShowInitialSuggestions() {\n\t\tconst { __experimentalShowInitialSuggestions = false, value } =\n\t\t\tthis.props;\n\t\treturn (\n\t\t\t__experimentalShowInitialSuggestions && ! ( value && value.length )\n\t\t);\n\t}\n\n\tupdateSuggestions( value = '' ) {\n\t\tconst {\n\t\t\t__experimentalFetchLinkSuggestions: fetchLinkSuggestions,\n\t\t\t__experimentalHandleURLSuggestions: handleURLSuggestions,\n\t\t} = this.props;\n\n\t\tif ( ! fetchLinkSuggestions ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Initial suggestions may only show if there is no value\n\t\t// (note: this includes whitespace).\n\t\tconst isInitialSuggestions = ! value?.length;\n\n\t\t// Trim only now we've determined whether or not it originally had a \"length\"\n\t\t// (even if that value was all whitespace).\n\t\tvalue = value.trim();\n\n\t\t// Allow a suggestions request if:\n\t\t// - there are at least 2 characters in the search input (except manual searches where\n\t\t// search input length is not required to trigger a fetch)\n\t\t// - this is a direct entry (eg: a URL)\n\t\tif (\n\t\t\t! isInitialSuggestions &&\n\t\t\t( value.length < 2 || ( ! handleURLSuggestions && isURL( value ) ) )\n\t\t) {\n\t\t\tthis.suggestionsRequest?.cancel?.();\n\t\t\tthis.suggestionsRequest = null;\n\n\t\t\tthis.setState( {\n\t\t\t\tsuggestions: [],\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tsuggestionsValue: value,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: true,\n\t\t} );\n\n\t\tconst request = fetchLinkSuggestions( value, {\n\t\t\tisInitialSuggestions,\n\t\t} );\n\n\t\trequest\n\t\t\t.then( ( suggestions ) => {\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.setState( {\n\t\t\t\t\tsuggestions,\n\t\t\t\t\tsuggestionsValue: value,\n\t\t\t\t\tloading: false,\n\t\t\t\t\tshowSuggestions: !! suggestions.length,\n\t\t\t\t} );\n\n\t\t\t\tif ( !! suggestions.length ) {\n\t\t\t\t\tthis.props.debouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\tsuggestions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tsuggestions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.props.debouncedSpeak(\n\t\t\t\t\t\t__( 'No results.' ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( () => {\n\t\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t} )\n\t\t\t.finally( () => {\n\t\t\t\t// If this is the current promise then reset the reference\n\t\t\t\t// to allow for checking if a new request is made.\n\t\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\t\tthis.suggestionsRequest = null;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t// Note that this assignment is handled *before* the async search request\n\t\t// as a Promise always resolves on the next tick of the event loop.\n\t\tthis.suggestionsRequest = request;\n\t}\n\n\tonChange( newValue ) {\n\t\tthis.props.onChange( newValue );\n\t}\n\n\tonFocus() {\n\t\tconst { suggestions } = this.state;\n\t\tconst { disableSuggestions, value } = this.props;\n\n\t\t// When opening the link editor, if there's a value present, we want to load the suggestions pane with the results for this input search value\n\t\t// Don't re-run the suggestions on focus if there are already suggestions present (prevents searching again when tabbing between the input and buttons)\n\t\t// or there is already a request in progress.\n\t\tif (\n\t\t\tvalue &&\n\t\t\t! disableSuggestions &&\n\t\t\t! ( suggestions && suggestions.length ) &&\n\t\t\tthis.suggestionsRequest === null\n\t\t) {\n\t\t\t// Ensure the suggestions are updated with the current input value.\n\t\t\tthis.updateSuggestions( value );\n\t\t}\n\t}\n\n\tonKeyDown( event ) {\n\t\tthis.props.onKeyDown?.( event );\n\t\tconst { showSuggestions, selectedSuggestion, suggestions, loading } =\n\t\t\tthis.state;\n\n\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t// We shouldn't preventDefault to allow block arrow keys navigation.\n\t\tif ( ! showSuggestions || ! suggestions.length || loading ) {\n\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\tswitch ( event.keyCode ) {\n\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t// position.\n\t\t\t\tcase UP: {\n\t\t\t\t\tif ( 0 !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to position 0.\n\t\t\t\t\t\tevent.target.setSelectionRange( 0, 0 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t// last position.\n\t\t\t\tcase DOWN: {\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.props.value.length !== event.target.selectionStart\n\t\t\t\t\t) {\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to the last position.\n\t\t\t\t\t\tevent.target.setSelectionRange(\n\t\t\t\t\t\t\tthis.props.value.length,\n\t\t\t\t\t\t\tthis.props.value.length\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Submitting while loading should trigger onSubmit.\n\t\t\t\tcase ENTER: {\n\t\t\t\t\tif ( this.props.onSubmit ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tthis.props.onSubmit( null, event );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst suggestion =\n\t\t\tthis.state.suggestions[ this.state.selectedSuggestion ];\n\n\t\tswitch ( event.keyCode ) {\n\t\t\tcase UP: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst previousIndex = ! selectedSuggestion\n\t\t\t\t\t? suggestions.length - 1\n\t\t\t\t\t: selectedSuggestion - 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: previousIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase DOWN: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex =\n\t\t\t\t\tselectedSuggestion === null ||\n\t\t\t\t\tselectedSuggestion === suggestions.length - 1\n\t\t\t\t\t\t? 0\n\t\t\t\t\t\t: selectedSuggestion + 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: nextIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase TAB: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( suggestion );\n\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\tthis.props.speak( __( 'Link selected.' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ENTER: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( suggestion );\n\n\t\t\t\t\tif ( this.props.onSubmit ) {\n\t\t\t\t\t\tthis.props.onSubmit( suggestion, event );\n\t\t\t\t\t}\n\t\t\t\t} else if ( this.props.onSubmit ) {\n\t\t\t\t\tthis.props.onSubmit( null, event );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tselectLink( suggestion ) {\n\t\tthis.props.onChange( suggestion.url, suggestion );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\t}\n\n\thandleOnClick( suggestion ) {\n\t\tthis.selectLink( suggestion );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\tthis.inputRef.current.focus();\n\t}\n\n\tstatic getDerivedStateFromProps(\n\t\t{\n\t\t\tvalue,\n\t\t\tinstanceId,\n\t\t\tdisableSuggestions,\n\t\t\t__experimentalShowInitialSuggestions = false,\n\t\t},\n\t\t{ showSuggestions }\n\t) {\n\t\tlet shouldShowSuggestions = showSuggestions;\n\n\t\tconst hasValue = value && value.length;\n\n\t\tif ( ! __experimentalShowInitialSuggestions && ! hasValue ) {\n\t\t\tshouldShowSuggestions = false;\n\t\t}\n\n\t\tif ( disableSuggestions === true ) {\n\t\t\tshouldShowSuggestions = false;\n\t\t}\n\n\t\treturn {\n\t\t\tshowSuggestions: shouldShowSuggestions,\n\t\t\tsuggestionsListboxId: `block-editor-url-input-suggestions-${ instanceId }`,\n\t\t\tsuggestionOptionIdPrefix: `block-editor-url-input-suggestion-${ instanceId }`,\n\t\t};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ this.renderControl() }\n\t\t\t\t{ this.renderSuggestions() }\n\t\t\t</>\n\t\t);\n\t}\n\n\trenderControl() {\n\t\tconst {\n\t\t\tlabel = null,\n\t\t\tclassName,\n\t\t\tisFullWidth,\n\t\t\tinstanceId,\n\t\t\tplaceholder = __( 'Paste URL or type to search' ),\n\t\t\t__experimentalRenderControl: renderControl,\n\t\t\tvalue = '',\n\t\t\thideLabelFromVision = false,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tloading,\n\t\t\tshowSuggestions,\n\t\t\tselectedSuggestion,\n\t\t\tsuggestionsListboxId,\n\t\t\tsuggestionOptionIdPrefix,\n\t\t} = this.state;\n\n\t\tconst inputId = `url-input-control-${ instanceId }`;\n\n\t\tconst controlProps = {\n\t\t\tid: inputId, // Passes attribute to label for the for attribute\n\t\t\tlabel,\n\t\t\tclassName: clsx( 'block-editor-url-input', className, {\n\t\t\t\t'is-full-width': isFullWidth,\n\t\t\t} ),\n\t\t\thideLabelFromVision,\n\t\t};\n\n\t\tconst inputProps = {\n\t\t\tid: inputId,\n\t\t\tvalue,\n\t\t\trequired: true,\n\t\t\ttype: 'text',\n\t\t\tonChange: this.onChange,\n\t\t\tonFocus: this.onFocus,\n\t\t\tplaceholder,\n\t\t\tonKeyDown: this.onKeyDown,\n\t\t\trole: 'combobox',\n\t\t\t'aria-label': label ? undefined : __( 'URL' ), // Ensure input always has an accessible label\n\t\t\t'aria-expanded': showSuggestions,\n\t\t\t'aria-autocomplete': 'list',\n\t\t\t'aria-owns': suggestionsListboxId,\n\t\t\t'aria-activedescendant':\n\t\t\t\tselectedSuggestion !== null\n\t\t\t\t\t? `${ suggestionOptionIdPrefix }-${ selectedSuggestion }`\n\t\t\t\t\t: undefined,\n\t\t\tref: this.inputRef,\n\t\t\tsuffix: this.props.suffix,\n\t\t};\n\n\t\tif ( renderControl ) {\n\t\t\treturn renderControl( controlProps, inputProps, loading );\n\t\t}\n\n\t\treturn (\n\t\t\t<BaseControl __nextHasNoMarginBottom { ...controlProps }>\n\t\t\t\t<InputControl { ...inputProps } __next40pxDefaultSize />\n\t\t\t\t{ loading && <Spinner /> }\n\t\t\t</BaseControl>\n\t\t);\n\t}\n\n\trenderSuggestions() {\n\t\tconst {\n\t\t\tclassName,\n\t\t\t__experimentalRenderSuggestions: renderSuggestions,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tshowSuggestions,\n\t\t\tsuggestions,\n\t\t\tsuggestionsValue,\n\t\t\tselectedSuggestion,\n\t\t\tsuggestionsListboxId,\n\t\t\tsuggestionOptionIdPrefix,\n\t\t\tloading,\n\t\t} = this.state;\n\n\t\tif ( ! showSuggestions || suggestions.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst suggestionsListProps = {\n\t\t\tid: suggestionsListboxId,\n\t\t\tref: this.autocompleteRef,\n\t\t\trole: 'listbox',\n\t\t};\n\n\t\tconst buildSuggestionItemProps = ( suggestion, index ) => {\n\t\t\treturn {\n\t\t\t\trole: 'option',\n\t\t\t\ttabIndex: '-1',\n\t\t\t\tid: `${ suggestionOptionIdPrefix }-${ index }`,\n\t\t\t\tref: this.bindSuggestionNode( index ),\n\t\t\t\t'aria-selected':\n\t\t\t\t\tindex === selectedSuggestion ? true : undefined,\n\t\t\t};\n\t\t};\n\n\t\tif ( isFunction( renderSuggestions ) ) {\n\t\t\treturn renderSuggestions( {\n\t\t\t\tsuggestions,\n\t\t\t\tselectedSuggestion,\n\t\t\t\tsuggestionsListProps,\n\t\t\t\tbuildSuggestionItemProps,\n\t\t\t\tisLoading: loading,\n\t\t\t\thandleSuggestionClick: this.handleOnClick,\n\t\t\t\tisInitialSuggestions: ! suggestionsValue?.length,\n\t\t\t\tcurrentInputValue: suggestionsValue,\n\t\t\t} );\n\t\t}\n\n\t\treturn (\n\t\t\t<Popover placement=\"bottom\" focusOnMount={ false }>\n\t\t\t\t<div\n\t\t\t\t\t{ ...suggestionsListProps }\n\t\t\t\t\tclassName={ clsx( 'block-editor-url-input__suggestions', {\n\t\t\t\t\t\t[ `${ className }__suggestions` ]: className,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ suggestions.map( ( suggestion, index ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t{ ...buildSuggestionItemProps( suggestion, index ) }\n\t\t\t\t\t\t\tkey={ suggestion.id }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-url-input__suggestion',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( suggestion ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ suggestion.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) ) }\n\t\t\t\t</div>\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md\n */\nexport default compose(\n\twithSafeTimeout,\n\twithSpokenMessages,\n\twithInstanceId,\n\twithSelect( ( select, props ) => {\n\t\t// If a link suggestions handler is already provided then\n\t\t// bail.\n\t\tif ( isFunction( props.__experimentalFetchLinkSuggestions ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\t__experimentalFetchLinkSuggestions:\n\t\t\t\tgetSettings().__experimentalFetchLinkSuggestions,\n\t\t};\n\t} )\n)( URLInput );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAQA,IAAAK,QAAA,GAAAL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CAAoC,EACpC;YACC,aAAa,EAAEzD,KAAK,KAAKjB;UAC1B,CACD,CAAG;UACHqG,OAAO,EAAGA,CAAA,KAAM,IAAI,CAAClH,aAAa,CAAE4D,UAAW;QAAG,GAEhDA,UAAU,CAACuD,KACN,CACP;MAAC,CACC;IAAC,CACE,CAAC;EAEZ;AACD;;AAEA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGe,IAAAC,gBAAO,EACrBC,wBAAe,EACfC,8BAAkB,EAClBC,uBAAc,EACd,IAAAC,gBAAU,EAAE,CAAEC,MAAM,EAAElI,KAAK,KAAM;EAChC;EACA;EACA,IAAKL,UAAU,CAAEK,KAAK,CAACsC,kCAAmC,CAAC,EAAG;IAC7D;EACD;EACA,MAAM;IAAE6F;EAAY,CAAC,GAAGD,MAAM,CAAEE,YAAiB,CAAC;EAClD,OAAO;IACN9F,kCAAkC,EACjC6F,WAAW,CAAC,CAAC,CAAC7F;EAChB,CAAC;AACF,CAAE,CACH,CAAC,CAAEzC,QAAS,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_element","_keycodes","_components","_compose","_data","_url","_store","_jsxRuntime","_react","isFunction","maybeFunc","URLInput","Component","constructor","props","onChange","bind","onFocus","onKeyDown","selectLink","handleOnClick","bindSuggestionNode","autocompleteRef","createRef","inputRef","updateSuggestions","debounce","suggestionNodes","suggestionsRequest","state","suggestions","showSuggestions","suggestionsValue","selectedSuggestion","suggestionsListboxId","suggestionOptionIdPrefix","componentDidUpdate","prevProps","value","__experimentalShowInitialSuggestions","scrollIntoView","behavior","block","inline","disableSuggestions","length","componentDidMount","shouldShowInitialSuggestions","componentWillUnmount","cancel","index","ref","__experimentalFetchLinkSuggestions","fetchLinkSuggestions","__experimentalHandleURLSuggestions","handleURLSuggestions","isInitialSuggestions","trim","isURL","setState","loading","request","then","debouncedSpeak","sprintf","_n","__","catch","finally","newValue","event","keyCode","UP","target","selectionStart","preventDefault","setSelectionRange","DOWN","ENTER","onSubmit","suggestion","previousIndex","nextIndex","TAB","speak","url","current","focus","getDerivedStateFromProps","instanceId","shouldShowSuggestions","hasValue","render","jsxs","Fragment","children","renderControl","renderSuggestions","label","className","isFullWidth","placeholder","__experimentalRenderControl","hideLabelFromVision","inputId","controlProps","id","clsx","inputProps","required","type","role","undefined","suffix","BaseControl","__nextHasNoMarginBottom","jsx","__experimentalInputControl","__next40pxDefaultSize","Spinner","__experimentalRenderSuggestions","suggestionsListProps","buildSuggestionItemProps","tabIndex","isLoading","handleSuggestionClick","currentInputValue","Popover","placement","focusOnMount","map","createElement","Button","key","onClick","title","_default","exports","default","compose","withSafeTimeout","withSpokenMessages","withInstanceId","withSelect","select","getSettings","blockEditorStore"],"sources":["@wordpress/block-editor/src/components/url-input/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf, _n } from '@wordpress/i18n';\nimport { Component, createRef } from '@wordpress/element';\nimport { UP, DOWN, ENTER, TAB } from '@wordpress/keycodes';\nimport {\n\tBaseControl,\n\tButton,\n\t__experimentalInputControl as InputControl,\n\tSpinner,\n\twithSpokenMessages,\n\tPopover,\n} from '@wordpress/components';\nimport {\n\tcompose,\n\tdebounce,\n\twithInstanceId,\n\twithSafeTimeout,\n} from '@wordpress/compose';\nimport { withSelect } from '@wordpress/data';\nimport { isURL } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * Whether the argument is a function.\n *\n * @param {*} maybeFunc The argument to check.\n * @return {boolean} True if the argument is a function, false otherwise.\n */\nfunction isFunction( maybeFunc ) {\n\treturn typeof maybeFunc === 'function';\n}\n\nclass URLInput extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.onChange = this.onChange.bind( this );\n\t\tthis.onFocus = this.onFocus.bind( this );\n\t\tthis.onKeyDown = this.onKeyDown.bind( this );\n\t\tthis.selectLink = this.selectLink.bind( this );\n\t\tthis.handleOnClick = this.handleOnClick.bind( this );\n\t\tthis.bindSuggestionNode = this.bindSuggestionNode.bind( this );\n\t\tthis.autocompleteRef = props.autocompleteRef || createRef();\n\t\tthis.inputRef = createRef();\n\t\tthis.updateSuggestions = debounce(\n\t\t\tthis.updateSuggestions.bind( this ),\n\t\t\t200\n\t\t);\n\n\t\tthis.suggestionNodes = [];\n\n\t\tthis.suggestionsRequest = null;\n\n\t\tthis.state = {\n\t\t\tsuggestions: [],\n\t\t\tshowSuggestions: false,\n\t\t\tsuggestionsValue: null,\n\t\t\tselectedSuggestion: null,\n\t\t\tsuggestionsListboxId: '',\n\t\t\tsuggestionOptionIdPrefix: '',\n\t\t};\n\t}\n\n\tcomponentDidUpdate( prevProps ) {\n\t\tconst { showSuggestions, selectedSuggestion } = this.state;\n\t\tconst { value, __experimentalShowInitialSuggestions = false } =\n\t\t\tthis.props;\n\n\t\t// Only have to worry about scrolling selected suggestion into view\n\t\t// when already expanded.\n\t\tif (\n\t\t\tshowSuggestions &&\n\t\t\tselectedSuggestion !== null &&\n\t\t\tthis.suggestionNodes[ selectedSuggestion ]\n\t\t) {\n\t\t\tthis.suggestionNodes[ selectedSuggestion ].scrollIntoView( {\n\t\t\t\tbehavior: 'instant',\n\t\t\t\tblock: 'nearest',\n\t\t\t\tinline: 'nearest',\n\t\t\t} );\n\t\t}\n\n\t\t// Update suggestions when the value changes.\n\t\tif ( prevProps.value !== value && ! this.props.disableSuggestions ) {\n\t\t\tif ( value?.length ) {\n\t\t\t\t// If the new value is not empty we need to update with suggestions for it.\n\t\t\t\tthis.updateSuggestions( value );\n\t\t\t} else if ( __experimentalShowInitialSuggestions ) {\n\t\t\t\t// If the new value is empty and we can show initial suggestions, then show initial suggestions.\n\t\t\t\tthis.updateSuggestions();\n\t\t\t}\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.shouldShowInitialSuggestions() ) {\n\t\t\tthis.updateSuggestions();\n\t\t}\n\t}\n\n\tcomponentWillUnmount() {\n\t\tthis.suggestionsRequest?.cancel?.();\n\t\tthis.suggestionsRequest = null;\n\t}\n\n\tbindSuggestionNode( index ) {\n\t\treturn ( ref ) => {\n\t\t\tthis.suggestionNodes[ index ] = ref;\n\t\t};\n\t}\n\n\tshouldShowInitialSuggestions() {\n\t\tconst { __experimentalShowInitialSuggestions = false, value } =\n\t\t\tthis.props;\n\t\treturn (\n\t\t\t__experimentalShowInitialSuggestions && ! ( value && value.length )\n\t\t);\n\t}\n\n\tupdateSuggestions( value = '' ) {\n\t\tconst {\n\t\t\t__experimentalFetchLinkSuggestions: fetchLinkSuggestions,\n\t\t\t__experimentalHandleURLSuggestions: handleURLSuggestions,\n\t\t} = this.props;\n\n\t\tif ( ! fetchLinkSuggestions ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Initial suggestions may only show if there is no value\n\t\t// (note: this includes whitespace).\n\t\tconst isInitialSuggestions = ! value?.length;\n\n\t\t// Trim only now we've determined whether or not it originally had a \"length\"\n\t\t// (even if that value was all whitespace).\n\t\tvalue = value.trim();\n\n\t\t// Allow a suggestions request if:\n\t\t// - there are at least 2 characters in the search input (except manual searches where\n\t\t// search input length is not required to trigger a fetch)\n\t\t// - this is a direct entry (eg: a URL)\n\t\tif (\n\t\t\t! isInitialSuggestions &&\n\t\t\t( value.length < 2 || ( ! handleURLSuggestions && isURL( value ) ) )\n\t\t) {\n\t\t\tthis.suggestionsRequest?.cancel?.();\n\t\t\tthis.suggestionsRequest = null;\n\n\t\t\tthis.setState( {\n\t\t\t\tsuggestions: [],\n\t\t\t\tshowSuggestions: false,\n\t\t\t\tsuggestionsValue: value,\n\t\t\t\tselectedSuggestion: null,\n\t\t\t\tloading: false,\n\t\t\t} );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tloading: true,\n\t\t} );\n\n\t\tconst request = fetchLinkSuggestions( value, {\n\t\t\tisInitialSuggestions,\n\t\t} );\n\n\t\trequest\n\t\t\t.then( ( suggestions ) => {\n\t\t\t\t// A fetch Promise doesn't have an abort option. It's mimicked by\n\t\t\t\t// comparing the request reference in on the instance, which is\n\t\t\t\t// reset or deleted on subsequent requests or unmounting.\n\t\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.setState( {\n\t\t\t\t\tsuggestions,\n\t\t\t\t\tsuggestionsValue: value,\n\t\t\t\t\tloading: false,\n\t\t\t\t\tshowSuggestions: !! suggestions.length,\n\t\t\t\t} );\n\n\t\t\t\tif ( !! suggestions.length ) {\n\t\t\t\t\tthis.props.debouncedSpeak(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %d: number of results. */\n\t\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t\t'%d result found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\t'%d results found, use up and down arrow keys to navigate.',\n\t\t\t\t\t\t\t\tsuggestions.length\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tsuggestions.length\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tthis.props.debouncedSpeak(\n\t\t\t\t\t\t__( 'No results.' ),\n\t\t\t\t\t\t'assertive'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( () => {\n\t\t\t\tif ( this.suggestionsRequest !== request ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.setState( {\n\t\t\t\t\tloading: false,\n\t\t\t\t} );\n\t\t\t} )\n\t\t\t.finally( () => {\n\t\t\t\t// If this is the current promise then reset the reference\n\t\t\t\t// to allow for checking if a new request is made.\n\t\t\t\tif ( this.suggestionsRequest === request ) {\n\t\t\t\t\tthis.suggestionsRequest = null;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t// Note that this assignment is handled *before* the async search request\n\t\t// as a Promise always resolves on the next tick of the event loop.\n\t\tthis.suggestionsRequest = request;\n\t}\n\n\tonChange( newValue ) {\n\t\tthis.props.onChange( newValue );\n\t}\n\n\tonFocus() {\n\t\tconst { suggestions } = this.state;\n\t\tconst { disableSuggestions, value } = this.props;\n\n\t\t// When opening the link editor, if there's a value present, we want to load the suggestions pane with the results for this input search value\n\t\t// Don't re-run the suggestions on focus if there are already suggestions present (prevents searching again when tabbing between the input and buttons)\n\t\t// or there is already a request in progress.\n\t\tif (\n\t\t\tvalue &&\n\t\t\t! disableSuggestions &&\n\t\t\t! ( suggestions && suggestions.length ) &&\n\t\t\tthis.suggestionsRequest === null\n\t\t) {\n\t\t\t// Ensure the suggestions are updated with the current input value.\n\t\t\tthis.updateSuggestions( value );\n\t\t}\n\t}\n\n\tonKeyDown( event ) {\n\t\tthis.props.onKeyDown?.( event );\n\t\tconst { showSuggestions, selectedSuggestion, suggestions, loading } =\n\t\t\tthis.state;\n\n\t\t// If the suggestions are not shown or loading, we shouldn't handle the arrow keys\n\t\t// We shouldn't preventDefault to allow block arrow keys navigation.\n\t\tif ( ! showSuggestions || ! suggestions.length || loading ) {\n\t\t\t// In the Windows version of Firefox the up and down arrows don't move the caret\n\t\t\t// within an input field like they do for Mac Firefox/Chrome/Safari. This causes\n\t\t\t// a form of focus trapping that is disruptive to the user experience. This disruption\n\t\t\t// only happens if the caret is not in the first or last position in the text input.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747\n\t\t\tswitch ( event.keyCode ) {\n\t\t\t\t// When UP is pressed, if the caret is at the start of the text, move it to the 0\n\t\t\t\t// position.\n\t\t\t\tcase UP: {\n\t\t\t\t\tif ( 0 !== event.target.selectionStart ) {\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to position 0.\n\t\t\t\t\t\tevent.target.setSelectionRange( 0, 0 );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t// When DOWN is pressed, if the caret is not at the end of the text, move it to the\n\t\t\t\t// last position.\n\t\t\t\tcase DOWN: {\n\t\t\t\t\tif (\n\t\t\t\t\t\tthis.props.value.length !== event.target.selectionStart\n\t\t\t\t\t) {\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\t// Set the input caret to the last position.\n\t\t\t\t\t\tevent.target.setSelectionRange(\n\t\t\t\t\t\t\tthis.props.value.length,\n\t\t\t\t\t\t\tthis.props.value.length\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Submitting while loading should trigger onSubmit.\n\t\t\t\tcase ENTER: {\n\t\t\t\t\tif ( this.props.onSubmit ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tthis.props.onSubmit( null, event );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst suggestion =\n\t\t\tthis.state.suggestions[ this.state.selectedSuggestion ];\n\n\t\tswitch ( event.keyCode ) {\n\t\t\tcase UP: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst previousIndex = ! selectedSuggestion\n\t\t\t\t\t? suggestions.length - 1\n\t\t\t\t\t: selectedSuggestion - 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: previousIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase DOWN: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst nextIndex =\n\t\t\t\t\tselectedSuggestion === null ||\n\t\t\t\t\tselectedSuggestion === suggestions.length - 1\n\t\t\t\t\t\t? 0\n\t\t\t\t\t\t: selectedSuggestion + 1;\n\t\t\t\tthis.setState( {\n\t\t\t\t\tselectedSuggestion: nextIndex,\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase TAB: {\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( suggestion );\n\t\t\t\t\t// Announce a link has been selected when tabbing away from the input field.\n\t\t\t\t\tthis.props.speak( __( 'Link selected.' ) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase ENTER: {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif ( this.state.selectedSuggestion !== null ) {\n\t\t\t\t\tthis.selectLink( suggestion );\n\n\t\t\t\t\tif ( this.props.onSubmit ) {\n\t\t\t\t\t\tthis.props.onSubmit( suggestion, event );\n\t\t\t\t\t}\n\t\t\t\t} else if ( this.props.onSubmit ) {\n\t\t\t\t\tthis.props.onSubmit( null, event );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tselectLink( suggestion ) {\n\t\tthis.props.onChange( suggestion.url, suggestion );\n\t\tthis.setState( {\n\t\t\tselectedSuggestion: null,\n\t\t\tshowSuggestions: false,\n\t\t} );\n\t}\n\n\thandleOnClick( suggestion ) {\n\t\tthis.selectLink( suggestion );\n\t\t// Move focus to the input field when a link suggestion is clicked.\n\t\tthis.inputRef.current.focus();\n\t}\n\n\tstatic getDerivedStateFromProps(\n\t\t{\n\t\t\tvalue,\n\t\t\tinstanceId,\n\t\t\tdisableSuggestions,\n\t\t\t__experimentalShowInitialSuggestions = false,\n\t\t},\n\t\t{ showSuggestions }\n\t) {\n\t\tlet shouldShowSuggestions = showSuggestions;\n\n\t\tconst hasValue = value && value.length;\n\n\t\tif ( ! __experimentalShowInitialSuggestions && ! hasValue ) {\n\t\t\tshouldShowSuggestions = false;\n\t\t}\n\n\t\tif ( disableSuggestions === true ) {\n\t\t\tshouldShowSuggestions = false;\n\t\t}\n\n\t\treturn {\n\t\t\tshowSuggestions: shouldShowSuggestions,\n\t\t\tsuggestionsListboxId: `block-editor-url-input-suggestions-${ instanceId }`,\n\t\t\tsuggestionOptionIdPrefix: `block-editor-url-input-suggestion-${ instanceId }`,\n\t\t};\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ this.renderControl() }\n\t\t\t\t{ this.renderSuggestions() }\n\t\t\t</>\n\t\t);\n\t}\n\n\trenderControl() {\n\t\tconst {\n\t\t\tlabel = null,\n\t\t\tclassName,\n\t\t\tisFullWidth,\n\t\t\tinstanceId,\n\t\t\tplaceholder = __( 'Paste URL or type to search' ),\n\t\t\t__experimentalRenderControl: renderControl,\n\t\t\tvalue = '',\n\t\t\thideLabelFromVision = false,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tloading,\n\t\t\tshowSuggestions,\n\t\t\tselectedSuggestion,\n\t\t\tsuggestionsListboxId,\n\t\t\tsuggestionOptionIdPrefix,\n\t\t} = this.state;\n\n\t\tconst inputId = `url-input-control-${ instanceId }`;\n\n\t\tconst controlProps = {\n\t\t\tid: inputId, // Passes attribute to label for the for attribute\n\t\t\tlabel,\n\t\t\tclassName: clsx( 'block-editor-url-input', className, {\n\t\t\t\t'is-full-width': isFullWidth,\n\t\t\t} ),\n\t\t\thideLabelFromVision,\n\t\t};\n\n\t\tconst inputProps = {\n\t\t\tid: inputId,\n\t\t\tvalue,\n\t\t\trequired: true,\n\t\t\ttype: 'text',\n\t\t\tonChange: this.onChange,\n\t\t\tonFocus: this.onFocus,\n\t\t\tplaceholder,\n\t\t\tonKeyDown: this.onKeyDown,\n\t\t\trole: 'combobox',\n\t\t\t'aria-label': label ? undefined : __( 'URL' ), // Ensure input always has an accessible label\n\t\t\t'aria-expanded': showSuggestions,\n\t\t\t'aria-autocomplete': 'list',\n\t\t\t'aria-owns': suggestionsListboxId,\n\t\t\t'aria-activedescendant':\n\t\t\t\tselectedSuggestion !== null\n\t\t\t\t\t? `${ suggestionOptionIdPrefix }-${ selectedSuggestion }`\n\t\t\t\t\t: undefined,\n\t\t\tref: this.inputRef,\n\t\t\tsuffix: this.props.suffix,\n\t\t};\n\n\t\tif ( renderControl ) {\n\t\t\treturn renderControl( controlProps, inputProps, loading );\n\t\t}\n\n\t\treturn (\n\t\t\t<BaseControl __nextHasNoMarginBottom { ...controlProps }>\n\t\t\t\t<InputControl { ...inputProps } __next40pxDefaultSize />\n\t\t\t\t{ loading && <Spinner /> }\n\t\t\t</BaseControl>\n\t\t);\n\t}\n\n\trenderSuggestions() {\n\t\tconst {\n\t\t\tclassName,\n\t\t\t__experimentalRenderSuggestions: renderSuggestions,\n\t\t} = this.props;\n\n\t\tconst {\n\t\t\tshowSuggestions,\n\t\t\tsuggestions,\n\t\t\tsuggestionsValue,\n\t\t\tselectedSuggestion,\n\t\t\tsuggestionsListboxId,\n\t\t\tsuggestionOptionIdPrefix,\n\t\t\tloading,\n\t\t} = this.state;\n\n\t\tif ( ! showSuggestions || suggestions.length === 0 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst suggestionsListProps = {\n\t\t\tid: suggestionsListboxId,\n\t\t\tref: this.autocompleteRef,\n\t\t\trole: 'listbox',\n\t\t};\n\n\t\tconst buildSuggestionItemProps = ( suggestion, index ) => {\n\t\t\treturn {\n\t\t\t\trole: 'option',\n\t\t\t\ttabIndex: '-1',\n\t\t\t\tid: `${ suggestionOptionIdPrefix }-${ index }`,\n\t\t\t\tref: this.bindSuggestionNode( index ),\n\t\t\t\t'aria-selected':\n\t\t\t\t\tindex === selectedSuggestion ? true : undefined,\n\t\t\t};\n\t\t};\n\n\t\tif ( isFunction( renderSuggestions ) ) {\n\t\t\treturn renderSuggestions( {\n\t\t\t\tsuggestions,\n\t\t\t\tselectedSuggestion,\n\t\t\t\tsuggestionsListProps,\n\t\t\t\tbuildSuggestionItemProps,\n\t\t\t\tisLoading: loading,\n\t\t\t\thandleSuggestionClick: this.handleOnClick,\n\t\t\t\tisInitialSuggestions: ! suggestionsValue?.length,\n\t\t\t\tcurrentInputValue: suggestionsValue,\n\t\t\t} );\n\t\t}\n\n\t\treturn (\n\t\t\t<Popover placement=\"bottom\" focusOnMount={ false }>\n\t\t\t\t<div\n\t\t\t\t\t{ ...suggestionsListProps }\n\t\t\t\t\tclassName={ clsx( 'block-editor-url-input__suggestions', {\n\t\t\t\t\t\t[ `${ className }__suggestions` ]: className,\n\t\t\t\t\t} ) }\n\t\t\t\t>\n\t\t\t\t\t{ suggestions.map( ( suggestion, index ) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t{ ...buildSuggestionItemProps( suggestion, index ) }\n\t\t\t\t\t\t\tkey={ suggestion.id }\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'block-editor-url-input__suggestion',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'is-selected': index === selectedSuggestion,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => this.handleOnClick( suggestion ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ suggestion.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) ) }\n\t\t\t\t</div>\n\t\t\t</Popover>\n\t\t);\n\t}\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md\n */\nexport default compose(\n\twithSafeTimeout,\n\twithSpokenMessages,\n\twithInstanceId,\n\twithSelect( ( select, props ) => {\n\t\t// If a link suggestions handler is already provided then\n\t\t// bail.\n\t\tif ( isFunction( props.__experimentalFetchLinkSuggestions ) ) {\n\t\t\treturn;\n\t\t}\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\t__experimentalFetchLinkSuggestions:\n\t\t\t\tgetSettings().__experimentalFetchLinkSuggestions,\n\t\t};\n\t} )\n)( URLInput );\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GA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rBP,SAAS,EAAG,IAAAQ,aAAI,EACf,oCAAoC,EACpC;YACC,aAAa,EAAEzD,KAAK,KAAKjB;UAC1B,CACD,CAAG;UACHqG,OAAO,EAAGA,CAAA,KAAM,IAAI,CAAClH,aAAa,CAAE4D,UAAW;QAAG,GAEhDA,UAAU,CAACuD,KACN,CACP;MAAC,CACC;IAAC,CACE,CAAC;EAEZ;AACD;;AAEA;AACA;AACA;AAFA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAGe,IAAAC,gBAAO,EACrBC,wBAAe,EACfC,8BAAkB,EAClBC,uBAAc,EACd,IAAAC,gBAAU,EAAE,CAAEC,MAAM,EAAElI,KAAK,KAAM;EAChC;EACA;EACA,IAAKL,UAAU,CAAEK,KAAK,CAACsC,kCAAmC,CAAC,EAAG;IAC7D;EACD;EACA,MAAM;IAAE6F;EAAY,CAAC,GAAGD,MAAM,CAAEE,YAAiB,CAAC;EAClD,OAAO;IACN9F,kCAAkC,EACjC6F,WAAW,CAAC,CAAC,CAAC7F;EAChB,CAAC;AACF,CAAE,CACH,CAAC,CAAEzC,QAAS,CAAC","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_element","_dom","_components","_icons","_index","_interopRequireDefault","_jsxRuntime","LINK_DESTINATION_NONE","LINK_DESTINATION_CUSTOM","LINK_DESTINATION_MEDIA","LINK_DESTINATION_ATTACHMENT","NEW_TAB_REL","ImageURLInputUI","linkDestination","onChangeUrl","url","mediaType","mediaUrl","mediaLink","linkTarget","linkClass","rel","showLightboxSetting","lightboxEnabled","onSetLightbox","resetLightbox","isOpen","setIsOpen","useState","popoverAnchor","setPopoverAnchor","openLinkUI","isEditingLink","setIsEditingLink","urlInput","setUrlInput","autocompleteRef","useRef","wrapperRef","useEffect","current","nextFocusTarget","focus","focusable","find","startEditLink","stopEditLink","closeLinkUI","getUpdatedLinkTargetSettings","value","newLinkTarget","undefined","updatedRel","rels","split","forEach","relVal","includes","push","join","filter","length","onFocusOutside","event","autocompleteElement","contains","target","onSubmitLinkChange","selectedDestination","getLinkDestinations","destination","href","lightbox","enabled","preventDefault","onLinkRemove","linkDestinations","title","__","icon","image","page","onSetHref","linkDestinationInput","onSetNewTab","updatedLinkTarget","onSetLinkRel","onSetLinkClass","advancedOptions","jsxs","__experimentalVStack","spacing","children","jsx","ToggleControl","__nextHasNoMarginBottom","label","onChange","checked","TextControl","__next40pxDefaultSize","linkEditorValue","hideLightboxPanel","showLinkEditor","urlLabel","PopoverChildren","className","Icon","fullscreen","Button","linkOff","onClick","size","default","LinkEditor","onChangeInputValue","onSubmit","Fragment","LinkViewer","onEditLinkClick","ToolbarButton","linkIcon","ref","isActive","anchor","onClose","renderSettings","additionalControls","NavigableMenu","map","link","MenuItem","iconPosition","info","offset","exports","__experimentalImageURLInputUI"],"sources":["@wordpress/block-editor/src/components/url-popover/image-url-input-ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useRef, useEffect, useState } 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} from '@wordpress/components';\nimport {\n\tIcon,\n\tlink as linkIcon,\n\timage,\n\tpage,\n\tfullscreen,\n\tlinkOff,\n} from '@wordpress/icons';\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: 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\t__nextHasNoMarginBottom\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\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\tvalue={ rel ?? '' }\n\t\t\t\tonChange={ onSetLinkRel }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\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>{ __( 'Expand 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 expand 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{ __( 'Expand 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"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AASA,IAAAI,MAAA,GAAAJ,OAAA;AAYA,IAAAK,MAAA,GAAAC,sBAAA,CAAAN,OAAA;AAAiC,IAAAO,WAAA,GAAAP,OAAA;AA3BjC;AACA;AACA;;AAsBA;AACA;AACA;;AAGA,MAAMQ,qBAAqB,GAAG,MAAM;AACpC,MAAMC,uBAAuB,GAAG,QAAQ;AACxC,MAAMC,sBAAsB,GAAG,OAAO;AACtC,MAAMC,2BAA2B,GAAG,YAAY;AAChD,MAAMC,WAAW,GAAG,CAAE,YAAY,EAAE,UAAU,CAAE;AAEhD,MAAMC,eAAe,GAAGA,CAAE;EACzBC,eAAe;EACfC,WAAW;EACXC,GAAG;EACHC,SAAS,GAAG,OAAO;EACnBC,QAAQ;EACRC,SAAS;EACTC,UAAU;EACVC,SAAS;EACTC,GAAG;EACHC,mBAAmB;EACnBC,eAAe;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,CAAAiI,QAAQ;UAERpD,IAAI,EAAGmD,IAAI,CAACnD,IAAM;UAClBqD,YAAY,EAAC,MAAM;UACnBrB,OAAO,EAAGA,CAAA,KAAM;YACf5E,WAAW,CAAE,IAAK,CAAC;YACnB+C,SAAS,CAAEgD,IAAI,CAACnH,GAAI,CAAC;YACrB+B,YAAY,CAAC,CAAC;UACf,CAAG;UAAA8C,QAAA,EAEDsC,IAAI,CAACrD;QAAK,GATNqD,IAAI,CAACrH,eAUF,CACT,CAAC,EACDS,mBAAmB,iBACpB,IAAAhB,WAAA,CAAAuF,GAAA,EAAC3F,WAAA,CAAAiI,QAAQ;UAERzB,SAAS,EAAC,2CAA2C;UACrD3B,IAAI,EAAG6B,iBAAY;UACnByB,IAAI,EAAG,IAAAvD,QAAE,EACR,yCACD,CAAG;UACHsD,YAAY,EAAC,MAAM;UACnBrB,OAAO,EAAGA,CAAA,KAAM;YACf5E,WAAW,CAAE,IAAK,CAAC;YACnBrB,WAAW,CAAE;cACZD,eAAe,EACdN,qBAAqB;cACtBgE,IAAI,EAAE;YACP,CAAE,CAAC;YACH/C,aAAa,GAAI,IAAK,CAAC;YACvBsB,YAAY,CAAC,CAAC;UACf,CAAG;UAAA8C,QAAA,EAED,IAAAd,QAAE,EAAE,iBAAkB;QAAC,GAlBrB,iBAmBK,CACV;MAAA,CACa,CAEhB;MACDwD,MAAM,EAAG,EAAI;MAAA1C,QAAA,EAEXa,eAAe,CAAC;IAAC,CACR,CACZ;EAAA,CACA,CAAC;AAEL,CAAC;AAAC8B,OAAA,CAAAC,6BAAA,GAAA5H,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_element","_dom","_components","_icons","_index","_interopRequireDefault","_jsxRuntime","LINK_DESTINATION_NONE","LINK_DESTINATION_CUSTOM","LINK_DESTINATION_MEDIA","LINK_DESTINATION_ATTACHMENT","NEW_TAB_REL","ImageURLInputUI","linkDestination","onChangeUrl","url","mediaType","mediaUrl","mediaLink","linkTarget","linkClass","rel","showLightboxSetting","lightboxEnabled","onSetLightbox","resetLightbox","isOpen","setIsOpen","useState","popoverAnchor","setPopoverAnchor","openLinkUI","isEditingLink","setIsEditingLink","urlInput","setUrlInput","autocompleteRef","useRef","wrapperRef","useEffect","current","nextFocusTarget","focus","focusable","find","startEditLink","stopEditLink","closeLinkUI","getUpdatedLinkTargetSettings","value","newLinkTarget","undefined","updatedRel","rels","split","forEach","relVal","includes","push","join","filter","length","onFocusOutside","event","autocompleteElement","contains","target","onSubmitLinkChange","selectedDestination","getLinkDestinations","destination","href","lightbox","enabled","preventDefault","onLinkRemove","linkDestinations","title","__","icon","image","page","onSetHref","linkDestinationInput","onSetNewTab","updatedLinkTarget","onSetLinkRel","onSetLinkClass","advancedOptions","jsxs","__experimentalVStack","spacing","children","jsx","ToggleControl","__nextHasNoMarginBottom","label","onChange","checked","TextControl","__next40pxDefaultSize","linkEditorValue","hideLightboxPanel","showLinkEditor","urlLabel","PopoverChildren","className","Icon","fullscreen","Button","linkOff","onClick","size","default","LinkEditor","onChangeInputValue","onSubmit","Fragment","LinkViewer","onEditLinkClick","ToolbarButton","linkIcon","ref","isActive","anchor","onClose","renderSettings","additionalControls","NavigableMenu","map","link","MenuItem","iconPosition","info","offset","exports","__experimentalImageURLInputUI"],"sources":["@wordpress/block-editor/src/components/url-popover/image-url-input-ui.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useRef, useEffect, useState } 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} from '@wordpress/components';\nimport {\n\tIcon,\n\tlink as linkIcon,\n\timage,\n\tpage,\n\tfullscreen,\n\tlinkOff,\n} from '@wordpress/icons';\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: 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\t__nextHasNoMarginBottom\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\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\tvalue={ rel ?? '' }\n\t\t\t\tonChange={ onSetLinkRel }\n\t\t\t/>\n\t\t\t<TextControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\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>{ __( 'Expand 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 expand 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{ __( 'Expand 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"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AASA,IAAAI,MAAA,GAAAJ,OAAA;AAYA,IAAAK,MAAA,GAAAC,sBAAA,CAAAN,OAAA;AAAiC,IAAAO,WAAA,GAAAP,OAAA;AA3BjC;AACA;AACA;;AAsBA;AACA;AACA;;AAGA,MAAMQ,qBAAqB,GAAG,MAAM;AACpC,MAAMC,uBAAuB,GAAG,QAAQ;AACxC,MAAMC,sBAAsB,GAAG,OAAO;AACtC,MAAMC,2BAA2B,GAAG,YAAY;AAChD,MAAMC,WAAW,GAAG,CAAE,YAAY,EAAE,UAAU,CAAE;AAEhD,MA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3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_blocks","_data","_commands","_icons","_blockIcon","_interopRequireDefault","_store","_jsxRuntime","getTransformCommands","useTransformCommands","replaceBlocks","multiSelect","useDispatch","blockEditorStore","blocks","clientIds","canRemove","possibleBlockTransformations","invalidSelection","useSelect","select","getBlockRootClientId","getBlockTransformItems","getSelectedBlockClientIds","getBlocksByClientId","canRemoveBlocks","selectedBlockClientIds","selectedBlocks","filter","block","length","rootClientId","isLoading","commands","isTemplate","isTemplatePart","selectForMultipleBlocks","insertedBlocks","clientId","onBlockTransform","name","newBlocks","switchToBlockType","hasPossibleBlockTransformations","map","transformation","title","icon","replace","label","sprintf","__","jsx","default","callback","close","getQuickActionsCommands","useQuickActionsCommands","isUngroupable","isGroupable","_isUngroupable","_isGroupable","canInsertBlockType","getDefaultBlockName","getGroupingBlockName","blocksStore","removeBlocks","duplicateBlocks","insertAfterBlock","insertBeforeBlock","onGroup","groupingBlockName","onUngroup","innerBlocks","canInsertDefaultBlock","canDuplicate","every","hasBlockSupport","push","copy","Array","isArray","add","group","ungroup","remove","command","useBlockCommands","useCommandLoader","hook","context","exports"],"sources":["@wordpress/block-editor/src/components/use-block-commands/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\thasBlockSupport,\n\tstore as blocksStore,\n\tswitchToBlockType,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCommandLoader } from '@wordpress/commands';\nimport {\n\tcopy,\n\ttrash as remove,\n\tplus as add,\n\tgroup,\n\tungroup,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { store as blockEditorStore } from '../../store';\n\nconst getTransformCommands = () =>\n\tfunction useTransformCommands() {\n\t\tconst { replaceBlocks, multiSelect } = useDispatch( blockEditorStore );\n\t\tconst {\n\t\t\tblocks,\n\t\t\tclientIds,\n\t\t\tcanRemove,\n\t\t\tpossibleBlockTransformations,\n\t\t\tinvalidSelection,\n\t\t} = useSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockTransformItems,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tgetBlocksByClientId,\n\t\t\t\tcanRemoveBlocks,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\t\tconst selectedBlocks = getBlocksByClientId(\n\t\t\t\tselectedBlockClientIds\n\t\t\t);\n\n\t\t\t// selectedBlocks can have `null`s when something tries to call `selectBlock` with an inexistent clientId.\n\t\t\t// These nulls will cause fatal errors down the line.\n\t\t\t// In order to prevent discrepancies between selectedBlockClientIds and selectedBlocks, we effectively treat the entire selection as invalid.\n\t\t\t// @see https://github.com/WordPress/gutenberg/pull/59410#issuecomment-2006304536\n\t\t\tif ( selectedBlocks.filter( ( block ) => ! block ).length > 0 ) {\n\t\t\t\treturn {\n\t\t\t\t\tinvalidSelection: true,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst rootClientId = getBlockRootClientId(\n\t\t\t\tselectedBlockClientIds[ 0 ]\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tblocks: selectedBlocks,\n\t\t\t\tclientIds: selectedBlockClientIds,\n\t\t\t\tpossibleBlockTransformations: getBlockTransformItems(\n\t\t\t\t\tselectedBlocks,\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tcanRemove: canRemoveBlocks( selectedBlockClientIds ),\n\t\t\t\tinvalidSelection: false,\n\t\t\t};\n\t\t}, [] );\n\n\t\tif ( invalidSelection ) {\n\t\t\treturn {\n\t\t\t\tisLoading: false,\n\t\t\t\tcommands: [],\n\t\t\t};\n\t\t}\n\t\tconst isTemplate = blocks.length === 1 && isTemplatePart( blocks[ 0 ] );\n\n\t\tfunction selectForMultipleBlocks( insertedBlocks ) {\n\t\t\tif ( insertedBlocks.length > 1 ) {\n\t\t\t\tmultiSelect(\n\t\t\t\t\tinsertedBlocks[ 0 ].clientId,\n\t\t\t\t\tinsertedBlocks[ insertedBlocks.length - 1 ].clientId\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Simple block tranformation based on the `Block Transforms` API.\n\t\tfunction onBlockTransform( name ) {\n\t\t\tconst newBlocks = switchToBlockType( blocks, name );\n\t\t\treplaceBlocks( clientIds, newBlocks );\n\t\t\tselectForMultipleBlocks( newBlocks );\n\t\t}\n\n\t\t/**\n\t\t * The `isTemplate` check is a stopgap solution here.\n\t\t * Ideally, the Transforms API should handle this\n\t\t * by allowing to exclude blocks from wildcard transformations.\n\t\t */\n\t\tconst hasPossibleBlockTransformations =\n\t\t\t!! possibleBlockTransformations.length && canRemove && ! isTemplate;\n\n\t\tif (\n\t\t\t! clientIds ||\n\t\t\tclientIds.length < 1 ||\n\t\t\t! hasPossibleBlockTransformations\n\t\t) {\n\t\t\treturn { isLoading: false, commands: [] };\n\t\t}\n\n\t\tconst commands = possibleBlockTransformations.map(\n\t\t\t( transformation ) => {\n\t\t\t\tconst { name, title, icon } = transformation;\n\t\t\t\treturn {\n\t\t\t\t\tname:\n\t\t\t\t\t\t'core/block-editor/transform-to-' +\n\t\t\t\t\t\tname.replace( '/', '-' ),\n\t\t\t\t\t/* translators: %s: Block or block variation name. */\n\t\t\t\t\tlabel: sprintf( __( 'Transform to %s' ), title ),\n\t\t\t\t\ticon: <BlockIcon icon={ icon } />,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tonBlockTransform( name );\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t);\n\n\t\treturn { isLoading: false, commands };\n\t};\n\nconst getQuickActionsCommands = () =>\n\tfunction useQuickActionsCommands() {\n\t\tconst { clientIds, isUngroupable, isGroupable } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\t\tisUngroupable: _isUngroupable,\n\t\t\t\t\tisGroupable: _isGroupable,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\n\t\t\t\treturn {\n\t\t\t\t\tclientIds: selectedBlockClientIds,\n\t\t\t\t\tisUngroupable: _isUngroupable(),\n\t\t\t\t\tisGroupable: _isGroupable(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst {\n\t\t\tcanInsertBlockType,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlocksByClientId,\n\t\t\tcanRemoveBlocks,\n\t\t} = useSelect( blockEditorStore );\n\t\tconst { getDefaultBlockName, getGroupingBlockName } =\n\t\t\tuseSelect( blocksStore );\n\n\t\tconst blocks = getBlocksByClientId( clientIds );\n\n\t\tconst {\n\t\t\tremoveBlocks,\n\t\t\treplaceBlocks,\n\t\t\tduplicateBlocks,\n\t\t\tinsertAfterBlock,\n\t\t\tinsertBeforeBlock,\n\t\t} = useDispatch( blockEditorStore );\n\n\t\tconst onGroup = () => {\n\t\t\tif ( ! blocks.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst groupingBlockName = getGroupingBlockName();\n\n\t\t\t// Activate the `transform` on `core/group` which does the conversion.\n\t\t\tconst newBlocks = switchToBlockType( blocks, groupingBlockName );\n\n\t\t\tif ( ! newBlocks ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceBlocks( clientIds, newBlocks );\n\t\t};\n\t\tconst onUngroup = () => {\n\t\t\tif ( ! blocks.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst innerBlocks = blocks[ 0 ].innerBlocks;\n\n\t\t\tif ( ! innerBlocks.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treplaceBlocks( clientIds, innerBlocks );\n\t\t};\n\n\t\tif ( ! clientIds || clientIds.length < 1 ) {\n\t\t\treturn { isLoading: false, commands: [] };\n\t\t}\n\n\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\tconst canInsertDefaultBlock = canInsertBlockType(\n\t\t\tgetDefaultBlockName(),\n\t\t\trootClientId\n\t\t);\n\t\tconst canDuplicate = blocks.every( ( block ) => {\n\t\t\treturn (\n\t\t\t\t!! block &&\n\t\t\t\thasBlockSupport( block.name, 'multiple', true ) &&\n\t\t\t\tcanInsertBlockType( block.name, rootClientId )\n\t\t\t);\n\t\t} );\n\t\tconst canRemove = canRemoveBlocks( clientIds );\n\n\t\tconst commands = [];\n\n\t\tif ( canDuplicate ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'duplicate',\n\t\t\t\tlabel: __( 'Duplicate' ),\n\t\t\t\tcallback: () => duplicateBlocks( clientIds, true ),\n\t\t\t\ticon: copy,\n\t\t\t} );\n\t\t}\n\n\t\tif ( canInsertDefaultBlock ) {\n\t\t\tcommands.push(\n\t\t\t\t{\n\t\t\t\t\tname: 'add-before',\n\t\t\t\t\tlabel: __( 'Add before' ),\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tconst clientId = Array.isArray( clientIds )\n\t\t\t\t\t\t\t? clientIds[ 0 ]\n\t\t\t\t\t\t\t: clientId;\n\t\t\t\t\t\tinsertBeforeBlock( clientId );\n\t\t\t\t\t},\n\t\t\t\t\ticon: add,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'add-after',\n\t\t\t\t\tlabel: __( 'Add after' ),\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tconst clientId = Array.isArray( clientIds )\n\t\t\t\t\t\t\t? clientIds[ clientIds.length - 1 ]\n\t\t\t\t\t\t\t: clientId;\n\t\t\t\t\t\tinsertAfterBlock( clientId );\n\t\t\t\t\t},\n\t\t\t\t\ticon: add,\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif ( isGroupable ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'Group',\n\t\t\t\tlabel: __( 'Group' ),\n\t\t\t\tcallback: onGroup,\n\t\t\t\ticon: group,\n\t\t\t} );\n\t\t}\n\n\t\tif ( isUngroupable ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'ungroup',\n\t\t\t\tlabel: __( 'Ungroup' ),\n\t\t\t\tcallback: onUngroup,\n\t\t\t\ticon: ungroup,\n\t\t\t} );\n\t\t}\n\n\t\tif ( canRemove ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'remove',\n\t\t\t\tlabel: __( 'Delete' ),\n\t\t\t\tcallback: () => removeBlocks( clientIds, true ),\n\t\t\t\ticon: remove,\n\t\t\t} );\n\t\t}\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands: commands.map( ( command ) => ( {\n\t\t\t\t...command,\n\t\t\t\tname: 'core/block-editor/action-' + command.name,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tcommand.callback();\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} ) ),\n\t\t};\n\t};\n\nexport const useBlockCommands = () => {\n\tuseCommandLoader( {\n\t\tname: 'core/block-editor/blockTransforms',\n\t\thook: getTransformCommands(),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/block-editor/blockQuickActions',\n\t\thook: getQuickActionsCommands(),\n\t\tcontext: 'block-selection-edit',\n\t} );\n};\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAWA,IAAAK,UAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAAwD,IAAAQ,WAAA,GAAAR,OAAA;AAxBxD;AACA;AACA;;AAkBA;AACA;AACA;;AAIA,MAAMS,oBAAoB,GAAGA,CAAA,KAC5B,SAASC,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,CAAE;MACdtC,IAAI,EAAE,QAAQ;MACdS,KAAK,EAAE,IAAAE,QAAE,EAAE,QAAS,CAAC;MACrBG,QAAQ,EAAEA,CAAA,KAAMY,YAAY,CAAEnD,SAAS,EAAE,IAAK,CAAC;MAC/CgC,IAAI,EAAEsC;IACP,CAAE,CAAC;EACJ;EAEA,OAAO;IACNrD,SAAS,EAAE,KAAK;IAChBC,QAAQ,EAAEA,QAAQ,CAACW,GAAG,CAAI0C,OAAO,KAAQ;MACxC,GAAGA,OAAO;MACV9C,IAAI,EAAE,2BAA2B,GAAG8C,OAAO,CAAC9C,IAAI;MAChDc,QAAQ,EAAEA,CAAE;QAAEC;MAAM,CAAC,KAAM;QAC1B+B,OAAO,CAAChC,QAAQ,CAAC,CAAC;QAClBC,KAAK,CAAC,CAAC;MACR;IACD,CAAC,CAAG;EACL,CAAC;AACF,CAAC;AAEK,MAAMgC,gBAAgB,GAAGA,CAAA,KAAM;EACrC,IAAAC,0BAAgB,EAAE;IACjBhD,IAAI,EAAE,mCAAmC;IACzCiD,IAAI,EAAEjF,oBAAoB,CAAC;EAC5B,CAAE,CAAC;EACH,IAAAgF,0BAAgB,EAAE;IACjBhD,IAAI,EAAE,qCAAqC;IAC3CiD,IAAI,EAAEjC,uBAAuB,CAAC,CAAC;IAC/BkC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_blocks","_data","_commands","_icons","_blockIcon","_interopRequireDefault","_store","_jsxRuntime","getTransformCommands","useTransformCommands","replaceBlocks","multiSelect","useDispatch","blockEditorStore","blocks","clientIds","canRemove","possibleBlockTransformations","invalidSelection","useSelect","select","getBlockRootClientId","getBlockTransformItems","getSelectedBlockClientIds","getBlocksByClientId","canRemoveBlocks","selectedBlockClientIds","selectedBlocks","filter","block","length","rootClientId","isLoading","commands","isTemplate","isTemplatePart","selectForMultipleBlocks","insertedBlocks","clientId","onBlockTransform","name","newBlocks","switchToBlockType","hasPossibleBlockTransformations","map","transformation","title","icon","replace","label","sprintf","__","jsx","default","callback","close","getQuickActionsCommands","useQuickActionsCommands","isUngroupable","isGroupable","_isUngroupable","_isGroupable","canInsertBlockType","getDefaultBlockName","getGroupingBlockName","blocksStore","removeBlocks","duplicateBlocks","insertAfterBlock","insertBeforeBlock","onGroup","groupingBlockName","onUngroup","innerBlocks","canInsertDefaultBlock","canDuplicate","every","hasBlockSupport","push","copy","Array","isArray","add","group","ungroup","remove","command","useBlockCommands","useCommandLoader","hook","context","exports"],"sources":["@wordpress/block-editor/src/components/use-block-commands/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\thasBlockSupport,\n\tstore as blocksStore,\n\tswitchToBlockType,\n\tisTemplatePart,\n} from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCommandLoader } from '@wordpress/commands';\nimport {\n\tcopy,\n\ttrash as remove,\n\tplus as add,\n\tgroup,\n\tungroup,\n} from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport BlockIcon from '../block-icon';\nimport { store as blockEditorStore } from '../../store';\n\nconst getTransformCommands = () =>\n\tfunction useTransformCommands() {\n\t\tconst { replaceBlocks, multiSelect } = useDispatch( blockEditorStore );\n\t\tconst {\n\t\t\tblocks,\n\t\t\tclientIds,\n\t\t\tcanRemove,\n\t\t\tpossibleBlockTransformations,\n\t\t\tinvalidSelection,\n\t\t} = useSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockRootClientId,\n\t\t\t\tgetBlockTransformItems,\n\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\tgetBlocksByClientId,\n\t\t\t\tcanRemoveBlocks,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\t\t\tconst selectedBlocks = getBlocksByClientId(\n\t\t\t\tselectedBlockClientIds\n\t\t\t);\n\n\t\t\t// selectedBlocks can have `null`s when something tries to call `selectBlock` with an inexistent clientId.\n\t\t\t// These nulls will cause fatal errors down the line.\n\t\t\t// In order to prevent discrepancies between selectedBlockClientIds and selectedBlocks, we effectively treat the entire selection as invalid.\n\t\t\t// @see https://github.com/WordPress/gutenberg/pull/59410#issuecomment-2006304536\n\t\t\tif ( selectedBlocks.filter( ( block ) => ! block ).length > 0 ) {\n\t\t\t\treturn {\n\t\t\t\t\tinvalidSelection: true,\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst rootClientId = getBlockRootClientId(\n\t\t\t\tselectedBlockClientIds[ 0 ]\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tblocks: selectedBlocks,\n\t\t\t\tclientIds: selectedBlockClientIds,\n\t\t\t\tpossibleBlockTransformations: getBlockTransformItems(\n\t\t\t\t\tselectedBlocks,\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tcanRemove: canRemoveBlocks( selectedBlockClientIds ),\n\t\t\t\tinvalidSelection: false,\n\t\t\t};\n\t\t}, [] );\n\n\t\tif ( invalidSelection ) {\n\t\t\treturn {\n\t\t\t\tisLoading: false,\n\t\t\t\tcommands: [],\n\t\t\t};\n\t\t}\n\t\tconst isTemplate = blocks.length === 1 && isTemplatePart( blocks[ 0 ] );\n\n\t\tfunction selectForMultipleBlocks( insertedBlocks ) {\n\t\t\tif ( insertedBlocks.length > 1 ) {\n\t\t\t\tmultiSelect(\n\t\t\t\t\tinsertedBlocks[ 0 ].clientId,\n\t\t\t\t\tinsertedBlocks[ insertedBlocks.length - 1 ].clientId\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Simple block tranformation based on the `Block Transforms` API.\n\t\tfunction onBlockTransform( name ) {\n\t\t\tconst newBlocks = switchToBlockType( blocks, name );\n\t\t\treplaceBlocks( clientIds, newBlocks );\n\t\t\tselectForMultipleBlocks( newBlocks );\n\t\t}\n\n\t\t/**\n\t\t * The `isTemplate` check is a stopgap solution here.\n\t\t * Ideally, the Transforms API should handle this\n\t\t * by allowing to exclude blocks from wildcard transformations.\n\t\t */\n\t\tconst hasPossibleBlockTransformations =\n\t\t\t!! possibleBlockTransformations.length && canRemove && ! isTemplate;\n\n\t\tif (\n\t\t\t! clientIds ||\n\t\t\tclientIds.length < 1 ||\n\t\t\t! hasPossibleBlockTransformations\n\t\t) {\n\t\t\treturn { isLoading: false, commands: [] };\n\t\t}\n\n\t\tconst commands = possibleBlockTransformations.map(\n\t\t\t( transformation ) => {\n\t\t\t\tconst { name, title, icon } = transformation;\n\t\t\t\treturn {\n\t\t\t\t\tname:\n\t\t\t\t\t\t'core/block-editor/transform-to-' +\n\t\t\t\t\t\tname.replace( '/', '-' ),\n\t\t\t\t\t/* translators: %s: Block or block variation name. */\n\t\t\t\t\tlabel: sprintf( __( 'Transform to %s' ), title ),\n\t\t\t\t\ticon: <BlockIcon icon={ icon } />,\n\t\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\t\tonBlockTransform( name );\n\t\t\t\t\t\tclose();\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t);\n\n\t\treturn { isLoading: false, commands };\n\t};\n\nconst getQuickActionsCommands = () =>\n\tfunction useQuickActionsCommands() {\n\t\tconst { clientIds, isUngroupable, isGroupable } = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetSelectedBlockClientIds,\n\t\t\t\t\tisUngroupable: _isUngroupable,\n\t\t\t\t\tisGroupable: _isGroupable,\n\t\t\t\t} = select( blockEditorStore );\n\t\t\t\tconst selectedBlockClientIds = getSelectedBlockClientIds();\n\n\t\t\t\treturn {\n\t\t\t\t\tclientIds: selectedBlockClientIds,\n\t\t\t\t\tisUngroupable: _isUngroupable(),\n\t\t\t\t\tisGroupable: _isGroupable(),\n\t\t\t\t};\n\t\t\t},\n\t\t\t[]\n\t\t);\n\t\tconst {\n\t\t\tcanInsertBlockType,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetBlocksByClientId,\n\t\t\tcanRemoveBlocks,\n\t\t} = useSelect( blockEditorStore );\n\t\tconst { getDefaultBlockName, getGroupingBlockName } =\n\t\t\tuseSelect( blocksStore );\n\n\t\tconst blocks = getBlocksByClientId( clientIds );\n\n\t\tconst {\n\t\t\tremoveBlocks,\n\t\t\treplaceBlocks,\n\t\t\tduplicateBlocks,\n\t\t\tinsertAfterBlock,\n\t\t\tinsertBeforeBlock,\n\t\t} = useDispatch( blockEditorStore );\n\n\t\tconst onGroup = () => {\n\t\t\tif ( ! blocks.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst groupingBlockName = getGroupingBlockName();\n\n\t\t\t// Activate the `transform` on `core/group` which does the conversion.\n\t\t\tconst newBlocks = switchToBlockType( blocks, groupingBlockName );\n\n\t\t\tif ( ! newBlocks ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\treplaceBlocks( clientIds, newBlocks );\n\t\t};\n\t\tconst onUngroup = () => {\n\t\t\tif ( ! blocks.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst innerBlocks = blocks[ 0 ].innerBlocks;\n\n\t\t\tif ( ! innerBlocks.length ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treplaceBlocks( clientIds, innerBlocks );\n\t\t};\n\n\t\tif ( ! clientIds || clientIds.length < 1 ) {\n\t\t\treturn { isLoading: false, commands: [] };\n\t\t}\n\n\t\tconst rootClientId = getBlockRootClientId( clientIds[ 0 ] );\n\t\tconst canInsertDefaultBlock = canInsertBlockType(\n\t\t\tgetDefaultBlockName(),\n\t\t\trootClientId\n\t\t);\n\t\tconst canDuplicate = blocks.every( ( block ) => {\n\t\t\treturn (\n\t\t\t\t!! block &&\n\t\t\t\thasBlockSupport( block.name, 'multiple', true ) &&\n\t\t\t\tcanInsertBlockType( block.name, rootClientId )\n\t\t\t);\n\t\t} );\n\t\tconst canRemove = canRemoveBlocks( clientIds );\n\n\t\tconst commands = [];\n\n\t\tif ( canDuplicate ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'duplicate',\n\t\t\t\tlabel: __( 'Duplicate' ),\n\t\t\t\tcallback: () => duplicateBlocks( clientIds, true ),\n\t\t\t\ticon: copy,\n\t\t\t} );\n\t\t}\n\n\t\tif ( canInsertDefaultBlock ) {\n\t\t\tcommands.push(\n\t\t\t\t{\n\t\t\t\t\tname: 'add-before',\n\t\t\t\t\tlabel: __( 'Add before' ),\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tconst clientId = Array.isArray( clientIds )\n\t\t\t\t\t\t\t? clientIds[ 0 ]\n\t\t\t\t\t\t\t: clientId;\n\t\t\t\t\t\tinsertBeforeBlock( clientId );\n\t\t\t\t\t},\n\t\t\t\t\ticon: add,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'add-after',\n\t\t\t\t\tlabel: __( 'Add after' ),\n\t\t\t\t\tcallback: () => {\n\t\t\t\t\t\tconst clientId = Array.isArray( clientIds )\n\t\t\t\t\t\t\t? clientIds[ clientIds.length - 1 ]\n\t\t\t\t\t\t\t: clientId;\n\t\t\t\t\t\tinsertAfterBlock( clientId );\n\t\t\t\t\t},\n\t\t\t\t\ticon: add,\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tif ( isGroupable ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'Group',\n\t\t\t\tlabel: __( 'Group' ),\n\t\t\t\tcallback: onGroup,\n\t\t\t\ticon: group,\n\t\t\t} );\n\t\t}\n\n\t\tif ( isUngroupable ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'ungroup',\n\t\t\t\tlabel: __( 'Ungroup' ),\n\t\t\t\tcallback: onUngroup,\n\t\t\t\ticon: ungroup,\n\t\t\t} );\n\t\t}\n\n\t\tif ( canRemove ) {\n\t\t\tcommands.push( {\n\t\t\t\tname: 'remove',\n\t\t\t\tlabel: __( 'Delete' ),\n\t\t\t\tcallback: () => removeBlocks( clientIds, true ),\n\t\t\t\ticon: remove,\n\t\t\t} );\n\t\t}\n\n\t\treturn {\n\t\t\tisLoading: false,\n\t\t\tcommands: commands.map( ( command ) => ( {\n\t\t\t\t...command,\n\t\t\t\tname: 'core/block-editor/action-' + command.name,\n\t\t\t\tcallback: ( { close } ) => {\n\t\t\t\t\tcommand.callback();\n\t\t\t\t\tclose();\n\t\t\t\t},\n\t\t\t} ) ),\n\t\t};\n\t};\n\nexport const useBlockCommands = () => {\n\tuseCommandLoader( {\n\t\tname: 'core/block-editor/blockTransforms',\n\t\thook: getTransformCommands(),\n\t} );\n\tuseCommandLoader( {\n\t\tname: 'core/block-editor/blockQuickActions',\n\t\thook: getQuickActionsCommands(),\n\t\tcontext: 'block-selection-edit',\n\t} );\n};\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAWA,IAAAK,UAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AAAwD,IAAAQ,WAAA,GAAAR,OAAA;AAxBxD;AACA;AACA;;AAkBA;AACA;AACA;;AAIA,MAAMS,oBAAoB,GAAGA,CAAA,KAC5B,SAASC,oBAAoBA,CAAA,EAAG;EAC/B,MAAM;IAAEC,aAAa;IAAEC;EAAY,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAiB,CAAC;EACtE,MAAM;IACLC,MAAM;IACNC,SAAS;IACTC,SAAS;IACTC,4BAA4B;IAC5BC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5B,MAAM;MACLC,oBAAoB;MACpBC,sBAAsB;MACtBC,yBAAyB;MACzBC,mBAAmB;MACnBC;IACD,CAAC,GAAGL,MAAM,CAAEP,YAAiB,CAAC;IAE9B,MAAMa,sBAAsB,GAAGH,yBA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AQ,EAAEA,CAAE;QAAEC;MAAM,CAAC,KAAM;QAC1B+B,OAAO,CAAChC,QAAQ,CAAC,CAAC;QAClBC,KAAK,CAAC,CAAC;MACR;IACD,CAAC,CAAG;EACL,CAAC;AACF,CAAC;AAEK,MAAMgC,gBAAgB,GAAGA,CAAA,KAAM;EACrC,IAAAC,0BAAgB,EAAE;IACjBhD,IAAI,EAAE,mCAAmC;IACzCiD,IAAI,EAAEjF,oBAAoB,CAAC;EAC5B,CAAE,CAAC;EACH,IAAAgF,0BAAgB,EAAE;IACjBhD,IAAI,EAAE,qCAAqC;IAC3CiD,IAAI,EAAEjC,uBAAuB,CAAC,CAAC;IAC/BkC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_element","_compose","_i18n","_blocks","_useOnBlockDrop","_interopRequireDefault","_math","_store","_lockUnlock","THRESHOLD_DISTANCE","MINIMUM_HEIGHT_FOR_THRESHOLD","MINIMUM_WIDTH_FOR_THRESHOLD","getDropTargetPosition","blocksData","position","orientation","options","allowedEdges","nearestIndex","insertPosition","minDistance","Infinity","targetBlockIndex","nearestSide","dropZoneElement","parentBlockOrientation","rootBlockIndex","rect","getBoundingClientRect","distance","edge","getDistanceToNearestEdge","height","isRightToLeft","isRTL","width","forEach","isUnmodifiedDefaultBlock","blockIndex","blockOrientation","sideDistance","sideEdge","isPointInsideRect","isPointContainedByRect","isPointWithinTopAndBottomBoundariesOfRect","adjacentIndex","isNearestBlockUnmodifiedDefaultBlock","isAdjacentBlockUnmodifiedDefaultBlock","insertionIndex","isDropTargetValid","getBlockType","allowedBlocks","draggedBlockNames","targetBlockName","areBlocksAllowed","allowedBlockNames","map","name","every","includes","draggedBlockTypes","targetMatchesDraggedBlockParents","block","allowedParentName","parent","isInsertionPoint","targetToCheck","ownerDocument","defaultView","HTMLElement","closest","useBlockDropZone","rootClientId","targetRootClientId","parentClientId","parentBlockClientId","isDisabled","registry","useRegistry","dropTarget","setDropTarget","useState","index","operation","getBlockVariations","getGroupingBlockName","useSelect","blocksStore","canInsertBlockType","getBlockListSettings","getBlocks","getBlockIndex","getDraggedBlockClientIds","getBlockNamesByClientId","getAllowedBlocks","isDragging","isGroupable","isZoomOut","getSectionRootClientId","getBlockParents","unlock","blockEditorStore","showInsertionPoint","hideInsertionPoint","startDragging","stopDragging","useDispatch","onBlockDrop","useOnBlockDrop","throttled","useThrottle","useCallback","event","draggedBlockClientIds","targetParents","isTargetWithinDraggedBlocks","some","clientId","isBlockDroppingAllowed","sectionRootClientId","blocks","length","batch","getIsUnmodifiedDefaultBlock","getElementById","dropTargetPosition","x","clientX","y","clientY","undefined","targetIndex","targetBlock","areAllImages","canInsertGalleryBlock","areGroupableBlocks","groupBlockVariations","canInsertRow","find","insertionPointClientId","useDropZone","onDrop","onDragOver","currentTarget","onDragLeave","relatedTarget","target","cancel","onDragEnd"],"sources":["@wordpress/block-editor/src/components/use-block-drop-zone/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { useCallback, useState } from '@wordpress/element';\nimport {\n\tuseThrottle,\n\t__experimentalUseDropZone as useDropZone,\n} from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\nimport {\n\tisUnmodifiedDefaultBlock as getIsUnmodifiedDefaultBlock,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport useOnBlockDrop from '../use-on-block-drop';\nimport {\n\tgetDistanceToNearestEdge,\n\tisPointContainedByRect,\n\tisPointWithinTopAndBottomBoundariesOfRect,\n} from '../../utils/math';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst THRESHOLD_DISTANCE = 30;\nconst MINIMUM_HEIGHT_FOR_THRESHOLD = 120;\nconst MINIMUM_WIDTH_FOR_THRESHOLD = 120;\n\n/** @typedef {import('../../utils/math').WPPoint} WPPoint */\n/** @typedef {import('../use-on-block-drop/types').WPDropOperation} WPDropOperation */\n\n/**\n * The orientation of a block list.\n *\n * @typedef {'horizontal'|'vertical'|undefined} WPBlockListOrientation\n */\n\n/**\n * The insert position when dropping a block.\n *\n * @typedef {'before'|'after'} WPInsertPosition\n */\n\n/**\n * @typedef {Object} WPBlockData\n * @property {boolean} isUnmodifiedDefaultBlock Is the block unmodified default block.\n * @property {() => DOMRect} getBoundingClientRect Get the bounding client rect of the block.\n * @property {number} blockIndex The index of the block.\n */\n\n/**\n * Get the drop target position from a given drop point and the orientation.\n *\n * @param {WPBlockData[]} blocksData The block data list.\n * @param {WPPoint} position The position of the item being dragged.\n * @param {WPBlockListOrientation} orientation The orientation of the block list.\n * @param {Object} options Additional options.\n * @return {[number, WPDropOperation]} The drop target position.\n */\nexport function getDropTargetPosition(\n\tblocksData,\n\tposition,\n\torientation = 'vertical',\n\toptions = {}\n) {\n\tconst allowedEdges =\n\t\torientation === 'horizontal'\n\t\t\t? [ 'left', 'right' ]\n\t\t\t: [ 'top', 'bottom' ];\n\n\tlet nearestIndex = 0;\n\tlet insertPosition = 'before';\n\tlet minDistance = Infinity;\n\tlet targetBlockIndex = null;\n\tlet nearestSide = 'right';\n\n\tconst {\n\t\tdropZoneElement,\n\t\tparentBlockOrientation,\n\t\trootBlockIndex = 0,\n\t} = options;\n\n\t// Allow before/after when dragging over the top/bottom edges of the drop zone.\n\tif ( dropZoneElement && parentBlockOrientation !== 'horizontal' ) {\n\t\tconst rect = dropZoneElement.getBoundingClientRect();\n\t\tconst [ distance, edge ] = getDistanceToNearestEdge( position, rect, [\n\t\t\t'top',\n\t\t\t'bottom',\n\t\t] );\n\n\t\t// If dragging over the top or bottom of the drop zone, insert the block\n\t\t// before or after the parent block. This only applies to blocks that use\n\t\t// a drop zone element, typically container blocks such as Group or Cover.\n\t\tif (\n\t\t\trect.height > MINIMUM_HEIGHT_FOR_THRESHOLD &&\n\t\t\tdistance < THRESHOLD_DISTANCE\n\t\t) {\n\t\t\tif ( edge === 'top' ) {\n\t\t\t\treturn [ rootBlockIndex, 'before' ];\n\t\t\t}\n\t\t\tif ( edge === 'bottom' ) {\n\t\t\t\treturn [ rootBlockIndex + 1, 'after' ];\n\t\t\t}\n\t\t}\n\t}\n\n\tconst isRightToLeft = isRTL();\n\n\t// Allow before/after when dragging over the left/right edges of the drop zone.\n\tif ( dropZoneElement && parentBlockOrientation === 'horizontal' ) {\n\t\tconst rect = dropZoneElement.getBoundingClientRect();\n\t\tconst [ distance, edge ] = getDistanceToNearestEdge( position, rect, [\n\t\t\t'left',\n\t\t\t'right',\n\t\t] );\n\n\t\t// If dragging over the left or right of the drop zone, insert the block\n\t\t// before or after the parent block. This only applies to blocks that use\n\t\t// a drop zone element, typically container blocks such as Group.\n\t\tif (\n\t\t\trect.width > MINIMUM_WIDTH_FOR_THRESHOLD &&\n\t\t\tdistance < THRESHOLD_DISTANCE\n\t\t) {\n\t\t\tif (\n\t\t\t\t( isRightToLeft && edge === 'right' ) ||\n\t\t\t\t( ! isRightToLeft && edge === 'left' )\n\t\t\t) {\n\t\t\t\treturn [ rootBlockIndex, 'before' ];\n\t\t\t}\n\t\t\tif (\n\t\t\t\t( isRightToLeft && edge === 'left' ) ||\n\t\t\t\t( ! isRightToLeft && edge === 'right' )\n\t\t\t) {\n\t\t\t\treturn [ rootBlockIndex + 1, 'after' ];\n\t\t\t}\n\t\t}\n\t}\n\n\tblocksData.forEach(\n\t\t( {\n\t\t\tisUnmodifiedDefaultBlock,\n\t\t\tgetBoundingClientRect,\n\t\t\tblockIndex,\n\t\t\tblockOrientation,\n\t\t} ) => {\n\t\t\tconst rect = getBoundingClientRect();\n\n\t\t\tlet [ distance, edge ] = getDistanceToNearestEdge(\n\t\t\t\tposition,\n\t\t\t\trect,\n\t\t\t\tallowedEdges\n\t\t\t);\n\t\t\t// If the the point is close to a side, prioritize that side.\n\t\t\tconst [ sideDistance, sideEdge ] = getDistanceToNearestEdge(\n\t\t\t\tposition,\n\t\t\t\trect,\n\t\t\t\t[ 'left', 'right' ]\n\t\t\t);\n\n\t\t\tconst isPointInsideRect = isPointContainedByRect( position, rect );\n\n\t\t\t// Prioritize the element if the point is inside of an unmodified default block.\n\t\t\tif ( isUnmodifiedDefaultBlock && isPointInsideRect ) {\n\t\t\t\tdistance = 0;\n\t\t\t} else if (\n\t\t\t\torientation === 'vertical' &&\n\t\t\t\tblockOrientation !== 'horizontal' &&\n\t\t\t\t( ( isPointInsideRect && sideDistance < THRESHOLD_DISTANCE ) ||\n\t\t\t\t\t( ! isPointInsideRect &&\n\t\t\t\t\t\tisPointWithinTopAndBottomBoundariesOfRect(\n\t\t\t\t\t\t\tposition,\n\t\t\t\t\t\t\trect\n\t\t\t\t\t\t) ) )\n\t\t\t) {\n\t\t\t\t/**\n\t\t\t\t * This condition should only apply when the layout is vertical (otherwise there's\n\t\t\t\t * no need to create a Row) and dropzones should only activate when the block is\n\t\t\t\t * either within and close to the sides of the target block or on its outer sides.\n\t\t\t\t */\n\t\t\t\ttargetBlockIndex = blockIndex;\n\t\t\t\tnearestSide = sideEdge;\n\t\t\t}\n\n\t\t\tif ( distance < minDistance ) {\n\t\t\t\t// Where the dropped block will be inserted on the nearest block.\n\t\t\t\tinsertPosition =\n\t\t\t\t\tedge === 'bottom' ||\n\t\t\t\t\t( ! isRightToLeft && edge === 'right' ) ||\n\t\t\t\t\t( isRightToLeft && edge === 'left' )\n\t\t\t\t\t\t? 'after'\n\t\t\t\t\t\t: 'before';\n\n\t\t\t\t// Update the currently known best candidate.\n\t\t\t\tminDistance = distance;\n\t\t\t\tnearestIndex = blockIndex;\n\t\t\t}\n\t\t}\n\t);\n\n\tconst adjacentIndex =\n\t\tnearestIndex + ( insertPosition === 'after' ? 1 : -1 );\n\tconst isNearestBlockUnmodifiedDefaultBlock =\n\t\t!! blocksData[ nearestIndex ]?.isUnmodifiedDefaultBlock;\n\tconst isAdjacentBlockUnmodifiedDefaultBlock =\n\t\t!! blocksData[ adjacentIndex ]?.isUnmodifiedDefaultBlock;\n\n\t// If the target index is set then group with the block at that index.\n\tif ( targetBlockIndex !== null ) {\n\t\treturn [ targetBlockIndex, 'group', nearestSide ];\n\t}\n\t// If both blocks are not unmodified default blocks then just insert between them.\n\tif (\n\t\t! isNearestBlockUnmodifiedDefaultBlock &&\n\t\t! isAdjacentBlockUnmodifiedDefaultBlock\n\t) {\n\t\t// If the user is dropping to the trailing edge of the block\n\t\t// add 1 to the index to represent dragging after.\n\t\tconst insertionIndex =\n\t\t\tinsertPosition === 'after' ? nearestIndex + 1 : nearestIndex;\n\t\treturn [ insertionIndex, 'insert' ];\n\t}\n\n\t// Otherwise, replace the nearest unmodified default block.\n\treturn [\n\t\tisNearestBlockUnmodifiedDefaultBlock ? nearestIndex : adjacentIndex,\n\t\t'replace',\n\t];\n}\n\n/**\n * Check if the dragged blocks can be dropped on the target.\n * @param {Function} getBlockType\n * @param {Object[]} allowedBlocks\n * @param {string[]} draggedBlockNames\n * @param {string} targetBlockName\n * @return {boolean} Whether the dragged blocks can be dropped on the target.\n */\nexport function isDropTargetValid(\n\tgetBlockType,\n\tallowedBlocks,\n\tdraggedBlockNames,\n\ttargetBlockName\n) {\n\t// At root level allowedBlocks is undefined and all blocks are allowed.\n\t// Otherwise, check if all dragged blocks are allowed.\n\tlet areBlocksAllowed = true;\n\tif ( allowedBlocks ) {\n\t\tconst allowedBlockNames = allowedBlocks?.map( ( { name } ) => name );\n\n\t\tareBlocksAllowed = draggedBlockNames.every( ( name ) =>\n\t\t\tallowedBlockNames?.includes( name )\n\t\t);\n\t}\n\n\t// Work out if dragged blocks have an allowed parent and if so\n\t// check target block matches the allowed parent.\n\tconst draggedBlockTypes = draggedBlockNames.map( ( name ) =>\n\t\tgetBlockType( name )\n\t);\n\tconst targetMatchesDraggedBlockParents = draggedBlockTypes.every(\n\t\t( block ) => {\n\t\t\tconst [ allowedParentName ] = block?.parent || [];\n\t\t\tif ( ! allowedParentName ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn allowedParentName === targetBlockName;\n\t\t}\n\t);\n\n\treturn areBlocksAllowed && targetMatchesDraggedBlockParents;\n}\n\n/**\n * Checks if the given element is an insertion point.\n *\n * @param {EventTarget|null} targetToCheck - The element to check.\n * @param {Document} ownerDocument - The owner document of the element.\n * @return {boolean} True if the element is a insertion point, false otherwise.\n */\nfunction isInsertionPoint( targetToCheck, ownerDocument ) {\n\tconst { defaultView } = ownerDocument;\n\n\treturn !! (\n\t\tdefaultView &&\n\t\ttargetToCheck instanceof defaultView.HTMLElement &&\n\t\ttargetToCheck.closest( '[data-is-insertion-point]' )\n\t);\n}\n\n/**\n * @typedef {Object} WPBlockDropZoneConfig\n * @property {?HTMLElement} dropZoneElement Optional element to be used as the drop zone.\n * @property {string} rootClientId The root client id for the block list.\n */\n\n/**\n * A React hook that can be used to make a block list handle drag and drop.\n *\n * @param {WPBlockDropZoneConfig} dropZoneConfig configuration data for the drop zone.\n */\nexport default function useBlockDropZone( {\n\tdropZoneElement,\n\t// An undefined value represents a top-level block. Default to an empty\n\t// string for this so that `targetRootClientId` can be easily compared to\n\t// values returned by the `getRootBlockClientId` selector, which also uses\n\t// an empty string to represent top-level blocks.\n\trootClientId: targetRootClientId = '',\n\tparentClientId: parentBlockClientId = '',\n\tisDisabled = false,\n} = {} ) {\n\tconst registry = useRegistry();\n\tconst [ dropTarget, setDropTarget ] = useState( {\n\t\tindex: null,\n\t\toperation: 'insert',\n\t} );\n\n\tconst { getBlockType, getBlockVariations, getGroupingBlockName } =\n\t\tuseSelect( blocksStore );\n\tconst {\n\t\tcanInsertBlockType,\n\t\tgetBlockListSettings,\n\t\tgetBlocks,\n\t\tgetBlockIndex,\n\t\tgetDraggedBlockClientIds,\n\t\tgetBlockNamesByClientId,\n\t\tgetAllowedBlocks,\n\t\tisDragging,\n\t\tisGroupable,\n\t\tisZoomOut,\n\t\tgetSectionRootClientId,\n\t\tgetBlockParents,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst {\n\t\tshowInsertionPoint,\n\t\thideInsertionPoint,\n\t\tstartDragging,\n\t\tstopDragging,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\n\tconst onBlockDrop = useOnBlockDrop(\n\t\tdropTarget.operation === 'before' || dropTarget.operation === 'after'\n\t\t\t? parentBlockClientId\n\t\t\t: targetRootClientId,\n\t\tdropTarget.index,\n\t\t{\n\t\t\toperation: dropTarget.operation,\n\t\t\tnearestSide: dropTarget.nearestSide,\n\t\t}\n\t);\n\tconst throttled = useThrottle(\n\t\tuseCallback(\n\t\t\t( event, ownerDocument ) => {\n\t\t\t\tif ( ! isDragging() ) {\n\t\t\t\t\t// When dragging from the desktop, no drag start event is fired.\n\t\t\t\t\t// So, ensure that the drag state is set when the user drags over a drop zone.\n\t\t\t\t\tstartDragging();\n\t\t\t\t}\n\n\t\t\t\tconst draggedBlockClientIds = getDraggedBlockClientIds();\n\t\t\t\tconst targetParents = [\n\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t...getBlockParents( targetRootClientId, true ),\n\t\t\t\t];\n\n\t\t\t\t// Check if the target is within any of the dragged blocks.\n\t\t\t\tconst isTargetWithinDraggedBlocks = draggedBlockClientIds.some(\n\t\t\t\t\t( clientId ) => targetParents.includes( clientId )\n\t\t\t\t);\n\n\t\t\t\tif ( isTargetWithinDraggedBlocks ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst allowedBlocks = getAllowedBlocks( targetRootClientId );\n\t\t\t\tconst targetBlockName = getBlockNamesByClientId( [\n\t\t\t\t\ttargetRootClientId,\n\t\t\t\t] )[ 0 ];\n\n\t\t\t\tconst draggedBlockNames = getBlockNamesByClientId(\n\t\t\t\t\tdraggedBlockClientIds\n\t\t\t\t);\n\t\t\t\tconst isBlockDroppingAllowed = isDropTargetValid(\n\t\t\t\t\tgetBlockType,\n\t\t\t\t\tallowedBlocks,\n\t\t\t\t\tdraggedBlockNames,\n\t\t\t\t\ttargetBlockName\n\t\t\t\t);\n\n\t\t\t\tif ( ! isBlockDroppingAllowed ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\n\t\t\t\t// In Zoom Out mode, if the target is not the section root provided by settings then\n\t\t\t\t// do not allow dropping as the drop target is not within the root (that which is\n\t\t\t\t// treated as \"the content\" by Zoom Out Mode).\n\t\t\t\tif (\n\t\t\t\t\tisZoomOut() &&\n\t\t\t\t\tsectionRootClientId !== targetRootClientId\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst blocks = getBlocks( targetRootClientId );\n\n\t\t\t\t// The block list is empty, don't show the insertion point but still allow dropping.\n\t\t\t\tif ( blocks.length === 0 ) {\n\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\tsetDropTarget( {\n\t\t\t\t\t\t\tindex: 0,\n\t\t\t\t\t\t\toperation: 'insert',\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tshowInsertionPoint( targetRootClientId, 0, {\n\t\t\t\t\t\t\toperation: 'insert',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst blocksData = blocks.map( ( block ) => {\n\t\t\t\t\tconst clientId = block.clientId;\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tisUnmodifiedDefaultBlock:\n\t\t\t\t\t\t\tgetIsUnmodifiedDefaultBlock( block ),\n\t\t\t\t\t\tgetBoundingClientRect: () =>\n\t\t\t\t\t\t\townerDocument\n\t\t\t\t\t\t\t\t.getElementById( `block-${ clientId }` )\n\t\t\t\t\t\t\t\t.getBoundingClientRect(),\n\t\t\t\t\t\tblockIndex: getBlockIndex( clientId ),\n\t\t\t\t\t\tblockOrientation:\n\t\t\t\t\t\t\tgetBlockListSettings( clientId )?.orientation,\n\t\t\t\t\t};\n\t\t\t\t} );\n\n\t\t\t\tconst dropTargetPosition = getDropTargetPosition(\n\t\t\t\t\tblocksData,\n\t\t\t\t\t{ x: event.clientX, y: event.clientY },\n\t\t\t\t\tgetBlockListSettings( targetRootClientId )?.orientation,\n\t\t\t\t\t{\n\t\t\t\t\t\tdropZoneElement,\n\t\t\t\t\t\tparentBlockClientId,\n\t\t\t\t\t\tparentBlockOrientation: parentBlockClientId\n\t\t\t\t\t\t\t? getBlockListSettings( parentBlockClientId )\n\t\t\t\t\t\t\t\t\t?.orientation\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\trootBlockIndex: getBlockIndex( targetRootClientId ),\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tconst [ targetIndex, operation, nearestSide ] =\n\t\t\t\t\tdropTargetPosition;\n\n\t\t\t\tif ( isZoomOut() && operation !== 'insert' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( operation === 'group' ) {\n\t\t\t\t\tconst targetBlock = blocks[ targetIndex ];\n\t\t\t\t\tconst areAllImages = [\n\t\t\t\t\t\ttargetBlock.name,\n\t\t\t\t\t\t...draggedBlockNames,\n\t\t\t\t\t].every( ( name ) => name === 'core/image' );\n\t\t\t\t\tconst canInsertGalleryBlock = canInsertBlockType(\n\t\t\t\t\t\t'core/gallery',\n\t\t\t\t\t\ttargetRootClientId\n\t\t\t\t\t);\n\t\t\t\t\tconst areGroupableBlocks = isGroupable( [\n\t\t\t\t\t\ttargetBlock.clientId,\n\t\t\t\t\t\tgetDraggedBlockClientIds(),\n\t\t\t\t\t] );\n\t\t\t\t\tconst groupBlockVariations = getBlockVariations(\n\t\t\t\t\t\tgetGroupingBlockName(),\n\t\t\t\t\t\t'block'\n\t\t\t\t\t);\n\t\t\t\t\tconst canInsertRow =\n\t\t\t\t\t\tgroupBlockVariations &&\n\t\t\t\t\t\tgroupBlockVariations.find(\n\t\t\t\t\t\t\t( { name } ) => name === 'group-row'\n\t\t\t\t\t\t);\n\n\t\t\t\t\t// If the dragged blocks and the target block are all images,\n\t\t\t\t\t// check if it is creatable either a Row variation or a Gallery block.\n\t\t\t\t\tif (\n\t\t\t\t\t\tareAllImages &&\n\t\t\t\t\t\t! canInsertGalleryBlock &&\n\t\t\t\t\t\t( ! areGroupableBlocks || ! canInsertRow )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// If the dragged blocks and the target block are not all images,\n\t\t\t\t\t// check if it is creatable a Row variation.\n\t\t\t\t\tif (\n\t\t\t\t\t\t! areAllImages &&\n\t\t\t\t\t\t( ! areGroupableBlocks || ! canInsertRow )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tsetDropTarget( {\n\t\t\t\t\t\tindex: targetIndex,\n\t\t\t\t\t\toperation,\n\t\t\t\t\t\tnearestSide,\n\t\t\t\t\t} );\n\n\t\t\t\t\tconst insertionPointClientId = [\n\t\t\t\t\t\t'before',\n\t\t\t\t\t\t'after',\n\t\t\t\t\t].includes( operation )\n\t\t\t\t\t\t? parentBlockClientId\n\t\t\t\t\t\t: targetRootClientId;\n\n\t\t\t\t\tshowInsertionPoint( insertionPointClientId, targetIndex, {\n\t\t\t\t\t\toperation,\n\t\t\t\t\t\tnearestSide,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[\n\t\t\t\tisDragging,\n\t\t\t\tgetAllowedBlocks,\n\t\t\t\ttargetRootClientId,\n\t\t\t\tgetBlockNamesByClientId,\n\t\t\t\tgetDraggedBlockClientIds,\n\t\t\t\tgetBlockType,\n\t\t\t\tgetSectionRootClientId,\n\t\t\t\tisZoomOut,\n\t\t\t\tgetBlocks,\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tdropZoneElement,\n\t\t\t\tparentBlockClientId,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tregistry,\n\t\t\t\tstartDragging,\n\t\t\t\tshowInsertionPoint,\n\t\t\t\tcanInsertBlockType,\n\t\t\t\tisGroupable,\n\t\t\t\tgetBlockVariations,\n\t\t\t\tgetGroupingBlockName,\n\t\t\t]\n\t\t),\n\t\t200\n\t);\n\n\treturn useDropZone( {\n\t\tdropZoneElement,\n\t\tisDisabled,\n\t\tonDrop: onBlockDrop,\n\t\tonDragOver( event ) {\n\t\t\t// `currentTarget` is only available while the event is being\n\t\t\t// handled, so get it now and pass it to the thottled function.\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget\n\t\t\tthrottled( event, event.currentTarget.ownerDocument );\n\t\t},\n\t\tonDragLeave( event ) {\n\t\t\tconst { ownerDocument } = event.currentTarget;\n\n\t\t\t// If the drag event is leaving the drop zone and entering an insertion point,\n\t\t\t// do not hide the insertion point as it is conceptually within the dropzone.\n\t\t\tif (\n\t\t\t\tisInsertionPoint( event.relatedTarget, ownerDocument ) ||\n\t\t\t\tisInsertionPoint( event.target, ownerDocument )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthrottled.cancel();\n\t\t\thideInsertionPoint();\n\t\t},\n\t\tonDragEnd() {\n\t\t\tthrottled.cancel();\n\t\t\tstopDragging();\n\t\t\thideInsertionPoint();\n\t\t},\n\t} );\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAQA,IAAAK,eAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,KAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AAzBA;AACA;AACA;;AAaA;AACA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Aa,EACbF,kBAAkB,EAClBd,kBAAkB,EAClBQ,WAAW,EACXZ,kBAAkB,EAClBC,oBAAoB,CAEtB,CAAC,EACD,GACD,CAAC;EAED,OAAO,IAAAuD,kCAAW,EAAE;IACnBpH,eAAe;IACfoD,UAAU;IACViE,MAAM,EAAElC,WAAW;IACnBmC,UAAUA,CAAE9B,KAAK,EAAG;MACnB;MACA;MACA;MACAH,SAAS,CAAEG,KAAK,EAAEA,KAAK,CAAC+B,aAAa,CAAC5E,aAAc,CAAC;IACtD,CAAC;IACD6E,WAAWA,CAAEhC,KAAK,EAAG;MACpB,MAAM;QAAE7C;MAAc,CAAC,GAAG6C,KAAK,CAAC+B,aAAa;;MAE7C;MACA;MACA,IACC9E,gBAAgB,CAAE+C,KAAK,CAACiC,aAAa,EAAE9E,aAAc,CAAC,IACtDF,gBAAgB,CAAE+C,KAAK,CAACkC,MAAM,EAAE/E,aAAc,CAAC,EAC9C;QACD;MACD;MAEA0C,SAAS,CAACsC,MAAM,CAAC,CAAC;MAClB5C,kBAAkB,CAAC,CAAC;IACrB,CAAC;IACD6C,SAASA,CAAA,EAAG;MACXvC,SAAS,CAACsC,MAAM,CAAC,CAAC;MAClB1C,YAAY,CAAC,CAAC;MACdF,kBAAkB,CAAC,CAAC;IACrB;EACD,CAAE,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_element","_compose","_i18n","_blocks","_useOnBlockDrop","_interopRequireDefault","_math","_store","_lockUnlock","THRESHOLD_DISTANCE","MINIMUM_HEIGHT_FOR_THRESHOLD","MINIMUM_WIDTH_FOR_THRESHOLD","getDropTargetPosition","blocksData","position","orientation","options","allowedEdges","nearestIndex","insertPosition","minDistance","Infinity","targetBlockIndex","nearestSide","dropZoneElement","parentBlockOrientation","rootBlockIndex","rect","getBoundingClientRect","distance","edge","getDistanceToNearestEdge","height","isRightToLeft","isRTL","width","forEach","isUnmodifiedDefaultBlock","blockIndex","blockOrientation","sideDistance","sideEdge","isPointInsideRect","isPointContainedByRect","isPointWithinTopAndBottomBoundariesOfRect","adjacentIndex","isNearestBlockUnmodifiedDefaultBlock","isAdjacentBlockUnmodifiedDefaultBlock","insertionIndex","isDropTargetValid","getBlockType","allowedBlocks","draggedBlockNames","targetBlockName","areBlocksAllowed","allowedBlockNames","map","name","every","includes","draggedBlockTypes","targetMatchesDraggedBlockParents","block","allowedParentName","parent","isInsertionPoint","targetToCheck","ownerDocument","defaultView","HTMLElement","closest","useBlockDropZone","rootClientId","targetRootClientId","parentClientId","parentBlockClientId","isDisabled","registry","useRegistry","dropTarget","setDropTarget","useState","index","operation","getBlockVariations","getGroupingBlockName","useSelect","blocksStore","canInsertBlockType","getBlockListSettings","getBlocks","getBlockIndex","getDraggedBlockClientIds","getBlockNamesByClientId","getAllowedBlocks","isDragging","isGroupable","isZoomOut","getSectionRootClientId","getBlockParents","unlock","blockEditorStore","showInsertionPoint","hideInsertionPoint","startDragging","stopDragging","useDispatch","onBlockDrop","useOnBlockDrop","throttled","useThrottle","useCallback","event","draggedBlockClientIds","targetParents","isTargetWithinDraggedBlocks","some","clientId","isBlockDroppingAllowed","sectionRootClientId","blocks","length","batch","getIsUnmodifiedDefaultBlock","getElementById","dropTargetPosition","x","clientX","y","clientY","undefined","targetIndex","targetBlock","areAllImages","canInsertGalleryBlock","areGroupableBlocks","groupBlockVariations","canInsertRow","find","insertionPointClientId","useDropZone","onDrop","onDragOver","currentTarget","onDragLeave","relatedTarget","target","cancel","onDragEnd"],"sources":["@wordpress/block-editor/src/components/use-block-drop-zone/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { useCallback, useState } from '@wordpress/element';\nimport {\n\tuseThrottle,\n\t__experimentalUseDropZone as useDropZone,\n} from '@wordpress/compose';\nimport { isRTL } from '@wordpress/i18n';\nimport {\n\tisUnmodifiedDefaultBlock as getIsUnmodifiedDefaultBlock,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport useOnBlockDrop from '../use-on-block-drop';\nimport {\n\tgetDistanceToNearestEdge,\n\tisPointContainedByRect,\n\tisPointWithinTopAndBottomBoundariesOfRect,\n} from '../../utils/math';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst THRESHOLD_DISTANCE = 30;\nconst MINIMUM_HEIGHT_FOR_THRESHOLD = 120;\nconst MINIMUM_WIDTH_FOR_THRESHOLD = 120;\n\n/** @typedef {import('../../utils/math').WPPoint} WPPoint */\n/** @typedef {import('../use-on-block-drop/types').WPDropOperation} WPDropOperation */\n\n/**\n * The orientation of a block list.\n *\n * @typedef {'horizontal'|'vertical'|undefined} WPBlockListOrientation\n */\n\n/**\n * The insert position when dropping a block.\n *\n * @typedef {'before'|'after'} WPInsertPosition\n */\n\n/**\n * @typedef {Object} WPBlockData\n * @property {boolean} isUnmodifiedDefaultBlock Is the block unmodified default block.\n * @property {() => DOMRect} getBoundingClientRect Get the bounding client rect of the block.\n * @property {number} blockIndex The index of the block.\n */\n\n/**\n * Get the drop target position from a given drop point and the orientation.\n *\n * @param {WPBlockData[]} blocksData The block data list.\n * @param {WPPoint} position The position of the item being dragged.\n * @param {WPBlockListOrientation} orientation The orientation of the block list.\n * @param {Object} options Additional options.\n * @return {[number, WPDropOperation]} The drop target position.\n */\nexport function getDropTargetPosition(\n\tblocksData,\n\tposition,\n\torientation = 'vertical',\n\toptions = {}\n) {\n\tconst allowedEdges =\n\t\torientation === 'horizontal'\n\t\t\t? [ 'left', 'right' ]\n\t\t\t: [ 'top', 'bottom' ];\n\n\tlet nearestIndex = 0;\n\tlet insertPosition = 'before';\n\tlet minDistance = Infinity;\n\tlet targetBlockIndex = null;\n\tlet nearestSide = 'right';\n\n\tconst {\n\t\tdropZoneElement,\n\t\tparentBlockOrientation,\n\t\trootBlockIndex = 0,\n\t} = options;\n\n\t// Allow before/after when dragging over the top/bottom edges of the drop zone.\n\tif ( dropZoneElement && parentBlockOrientation !== 'horizontal' ) {\n\t\tconst rect = dropZoneElement.getBoundingClientRect();\n\t\tconst [ distance, edge ] = getDistanceToNearestEdge( position, rect, [\n\t\t\t'top',\n\t\t\t'bottom',\n\t\t] );\n\n\t\t// If dragging over the top or bottom of the drop zone, insert the block\n\t\t// before or after the parent block. This only applies to blocks that use\n\t\t// a drop zone element, typically container blocks such as Group or Cover.\n\t\tif (\n\t\t\trect.height > MINIMUM_HEIGHT_FOR_THRESHOLD &&\n\t\t\tdistance < THRESHOLD_DISTANCE\n\t\t) {\n\t\t\tif ( edge === 'top' ) {\n\t\t\t\treturn [ rootBlockIndex, 'before' ];\n\t\t\t}\n\t\t\tif ( edge === 'bottom' ) {\n\t\t\t\treturn [ rootBlockIndex + 1, 'after' ];\n\t\t\t}\n\t\t}\n\t}\n\n\tconst isRightToLeft = isRTL();\n\n\t// Allow before/after when dragging over the left/right edges of the drop zone.\n\tif ( dropZoneElement && parentBlockOrientation === 'horizontal' ) {\n\t\tconst rect = dropZoneElement.getBoundingClientRect();\n\t\tconst [ distance, edge ] = getDistanceToNearestEdge( position, rect, [\n\t\t\t'left',\n\t\t\t'right',\n\t\t] );\n\n\t\t// If dragging over the left or right of the drop zone, insert the block\n\t\t// before or after the parent block. This only applies to blocks that use\n\t\t// a drop zone element, typically container blocks such as Group.\n\t\tif (\n\t\t\trect.width > MINIMUM_WIDTH_FOR_THRESHOLD &&\n\t\t\tdistance < THRESHOLD_DISTANCE\n\t\t) {\n\t\t\tif (\n\t\t\t\t( isRightToLeft && edge === 'right' ) ||\n\t\t\t\t( ! isRightToLeft && edge === 'left' )\n\t\t\t) {\n\t\t\t\treturn [ rootBlockIndex, 'before' ];\n\t\t\t}\n\t\t\tif (\n\t\t\t\t( isRightToLeft && edge === 'left' ) ||\n\t\t\t\t( ! isRightToLeft && edge === 'right' )\n\t\t\t) {\n\t\t\t\treturn [ rootBlockIndex + 1, 'after' ];\n\t\t\t}\n\t\t}\n\t}\n\n\tblocksData.forEach(\n\t\t( {\n\t\t\tisUnmodifiedDefaultBlock,\n\t\t\tgetBoundingClientRect,\n\t\t\tblockIndex,\n\t\t\tblockOrientation,\n\t\t} ) => {\n\t\t\tconst rect = getBoundingClientRect();\n\n\t\t\tlet [ distance, edge ] = getDistanceToNearestEdge(\n\t\t\t\tposition,\n\t\t\t\trect,\n\t\t\t\tallowedEdges\n\t\t\t);\n\t\t\t// If the the point is close to a side, prioritize that side.\n\t\t\tconst [ sideDistance, sideEdge ] = getDistanceToNearestEdge(\n\t\t\t\tposition,\n\t\t\t\trect,\n\t\t\t\t[ 'left', 'right' ]\n\t\t\t);\n\n\t\t\tconst isPointInsideRect = isPointContainedByRect( position, rect );\n\n\t\t\t// Prioritize the element if the point is inside of an unmodified default block.\n\t\t\tif ( isUnmodifiedDefaultBlock && isPointInsideRect ) {\n\t\t\t\tdistance = 0;\n\t\t\t} else if (\n\t\t\t\torientation === 'vertical' &&\n\t\t\t\tblockOrientation !== 'horizontal' &&\n\t\t\t\t( ( isPointInsideRect && sideDistance < THRESHOLD_DISTANCE ) ||\n\t\t\t\t\t( ! isPointInsideRect &&\n\t\t\t\t\t\tisPointWithinTopAndBottomBoundariesOfRect(\n\t\t\t\t\t\t\tposition,\n\t\t\t\t\t\t\trect\n\t\t\t\t\t\t) ) )\n\t\t\t) {\n\t\t\t\t/**\n\t\t\t\t * This condition should only apply when the layout is vertical (otherwise there's\n\t\t\t\t * no need to create a Row) and dropzones should only activate when the block is\n\t\t\t\t * either within and close to the sides of the target block or on its outer sides.\n\t\t\t\t */\n\t\t\t\ttargetBlockIndex = blockIndex;\n\t\t\t\tnearestSide = sideEdge;\n\t\t\t}\n\n\t\t\tif ( distance < minDistance ) {\n\t\t\t\t// Where the dropped block will be inserted on the nearest block.\n\t\t\t\tinsertPosition =\n\t\t\t\t\tedge === 'bottom' ||\n\t\t\t\t\t( ! isRightToLeft && edge === 'right' ) ||\n\t\t\t\t\t( isRightToLeft && edge === 'left' )\n\t\t\t\t\t\t? 'after'\n\t\t\t\t\t\t: 'before';\n\n\t\t\t\t// Update the currently known best candidate.\n\t\t\t\tminDistance = distance;\n\t\t\t\tnearestIndex = blockIndex;\n\t\t\t}\n\t\t}\n\t);\n\n\tconst adjacentIndex =\n\t\tnearestIndex + ( insertPosition === 'after' ? 1 : -1 );\n\tconst isNearestBlockUnmodifiedDefaultBlock =\n\t\t!! blocksData[ nearestIndex ]?.isUnmodifiedDefaultBlock;\n\tconst isAdjacentBlockUnmodifiedDefaultBlock =\n\t\t!! blocksData[ adjacentIndex ]?.isUnmodifiedDefaultBlock;\n\n\t// If the target index is set then group with the block at that index.\n\tif ( targetBlockIndex !== null ) {\n\t\treturn [ targetBlockIndex, 'group', nearestSide ];\n\t}\n\t// If both blocks are not unmodified default blocks then just insert between them.\n\tif (\n\t\t! isNearestBlockUnmodifiedDefaultBlock &&\n\t\t! isAdjacentBlockUnmodifiedDefaultBlock\n\t) {\n\t\t// If the user is dropping to the trailing edge of the block\n\t\t// add 1 to the index to represent dragging after.\n\t\tconst insertionIndex =\n\t\t\tinsertPosition === 'after' ? nearestIndex + 1 : nearestIndex;\n\t\treturn [ insertionIndex, 'insert' ];\n\t}\n\n\t// Otherwise, replace the nearest unmodified default block.\n\treturn [\n\t\tisNearestBlockUnmodifiedDefaultBlock ? nearestIndex : adjacentIndex,\n\t\t'replace',\n\t];\n}\n\n/**\n * Check if the dragged blocks can be dropped on the target.\n * @param {Function} getBlockType\n * @param {Object[]} allowedBlocks\n * @param {string[]} draggedBlockNames\n * @param {string} targetBlockName\n * @return {boolean} Whether the dragged blocks can be dropped on the target.\n */\nexport function isDropTargetValid(\n\tgetBlockType,\n\tallowedBlocks,\n\tdraggedBlockNames,\n\ttargetBlockName\n) {\n\t// At root level allowedBlocks is undefined and all blocks are allowed.\n\t// Otherwise, check if all dragged blocks are allowed.\n\tlet areBlocksAllowed = true;\n\tif ( allowedBlocks ) {\n\t\tconst allowedBlockNames = allowedBlocks?.map( ( { name } ) => name );\n\n\t\tareBlocksAllowed = draggedBlockNames.every( ( name ) =>\n\t\t\tallowedBlockNames?.includes( name )\n\t\t);\n\t}\n\n\t// Work out if dragged blocks have an allowed parent and if so\n\t// check target block matches the allowed parent.\n\tconst draggedBlockTypes = draggedBlockNames.map( ( name ) =>\n\t\tgetBlockType( name )\n\t);\n\tconst targetMatchesDraggedBlockParents = draggedBlockTypes.every(\n\t\t( block ) => {\n\t\t\tconst [ allowedParentName ] = block?.parent || [];\n\t\t\tif ( ! allowedParentName ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn allowedParentName === targetBlockName;\n\t\t}\n\t);\n\n\treturn areBlocksAllowed && targetMatchesDraggedBlockParents;\n}\n\n/**\n * Checks if the given element is an insertion point.\n *\n * @param {EventTarget|null} targetToCheck - The element to check.\n * @param {Document} ownerDocument - The owner document of the element.\n * @return {boolean} True if the element is a insertion point, false otherwise.\n */\nfunction isInsertionPoint( targetToCheck, ownerDocument ) {\n\tconst { defaultView } = ownerDocument;\n\n\treturn !! (\n\t\tdefaultView &&\n\t\ttargetToCheck instanceof defaultView.HTMLElement &&\n\t\ttargetToCheck.closest( '[data-is-insertion-point]' )\n\t);\n}\n\n/**\n * @typedef {Object} WPBlockDropZoneConfig\n * @property {?HTMLElement} dropZoneElement Optional element to be used as the drop zone.\n * @property {string} rootClientId The root client id for the block list.\n */\n\n/**\n * A React hook that can be used to make a block list handle drag and drop.\n *\n * @param {WPBlockDropZoneConfig} dropZoneConfig configuration data for the drop zone.\n */\nexport default function useBlockDropZone( {\n\tdropZoneElement,\n\t// An undefined value represents a top-level block. Default to an empty\n\t// string for this so that `targetRootClientId` can be easily compared to\n\t// values returned by the `getRootBlockClientId` selector, which also uses\n\t// an empty string to represent top-level blocks.\n\trootClientId: targetRootClientId = '',\n\tparentClientId: parentBlockClientId = '',\n\tisDisabled = false,\n} = {} ) {\n\tconst registry = useRegistry();\n\tconst [ dropTarget, setDropTarget ] = useState( {\n\t\tindex: null,\n\t\toperation: 'insert',\n\t} );\n\n\tconst { getBlockType, getBlockVariations, getGroupingBlockName } =\n\t\tuseSelect( blocksStore );\n\tconst {\n\t\tcanInsertBlockType,\n\t\tgetBlockListSettings,\n\t\tgetBlocks,\n\t\tgetBlockIndex,\n\t\tgetDraggedBlockClientIds,\n\t\tgetBlockNamesByClientId,\n\t\tgetAllowedBlocks,\n\t\tisDragging,\n\t\tisGroupable,\n\t\tisZoomOut,\n\t\tgetSectionRootClientId,\n\t\tgetBlockParents,\n\t} = unlock( useSelect( blockEditorStore ) );\n\tconst {\n\t\tshowInsertionPoint,\n\t\thideInsertionPoint,\n\t\tstartDragging,\n\t\tstopDragging,\n\t} = unlock( useDispatch( blockEditorStore ) );\n\n\tconst onBlockDrop = useOnBlockDrop(\n\t\tdropTarget.operation === 'before' || dropTarget.operation === 'after'\n\t\t\t? parentBlockClientId\n\t\t\t: targetRootClientId,\n\t\tdropTarget.index,\n\t\t{\n\t\t\toperation: dropTarget.operation,\n\t\t\tnearestSide: dropTarget.nearestSide,\n\t\t}\n\t);\n\tconst throttled = useThrottle(\n\t\tuseCallback(\n\t\t\t( event, ownerDocument ) => {\n\t\t\t\tif ( ! isDragging() ) {\n\t\t\t\t\t// When dragging from the desktop, no drag start event is fired.\n\t\t\t\t\t// So, ensure that the drag state is set when the user drags over a drop zone.\n\t\t\t\t\tstartDragging();\n\t\t\t\t}\n\n\t\t\t\tconst draggedBlockClientIds = getDraggedBlockClientIds();\n\t\t\t\tconst targetParents = [\n\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\t...getBlockParents( targetRootClientId, true ),\n\t\t\t\t];\n\n\t\t\t\t// Check if the target is within any of the dragged blocks.\n\t\t\t\tconst isTargetWithinDraggedBlocks = draggedBlockClientIds.some(\n\t\t\t\t\t( clientId ) => targetParents.includes( clientId )\n\t\t\t\t);\n\n\t\t\t\tif ( isTargetWithinDraggedBlocks ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst allowedBlocks = getAllowedBlocks( targetRootClientId );\n\t\t\t\tconst targetBlockName = getBlockNamesByClientId( [\n\t\t\t\t\ttargetRootClientId,\n\t\t\t\t] )[ 0 ];\n\n\t\t\t\tconst draggedBlockNames = getBlockNamesByClientId(\n\t\t\t\t\tdraggedBlockClientIds\n\t\t\t\t);\n\t\t\t\tconst isBlockDroppingAllowed = isDropTargetValid(\n\t\t\t\t\tgetBlockType,\n\t\t\t\t\tallowedBlocks,\n\t\t\t\t\tdraggedBlockNames,\n\t\t\t\t\ttargetBlockName\n\t\t\t\t);\n\n\t\t\t\tif ( ! isBlockDroppingAllowed ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst sectionRootClientId = getSectionRootClientId();\n\n\t\t\t\t// In Zoom Out mode, if the target is not the section root provided by settings then\n\t\t\t\t// do not allow dropping as the drop target is not within the root (that which is\n\t\t\t\t// treated as \"the content\" by Zoom Out Mode).\n\t\t\t\tif (\n\t\t\t\t\tisZoomOut() &&\n\t\t\t\t\tsectionRootClientId !== targetRootClientId\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst blocks = getBlocks( targetRootClientId );\n\n\t\t\t\t// The block list is empty, don't show the insertion point but still allow dropping.\n\t\t\t\tif ( blocks.length === 0 ) {\n\t\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t\tsetDropTarget( {\n\t\t\t\t\t\t\tindex: 0,\n\t\t\t\t\t\t\toperation: 'insert',\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tshowInsertionPoint( targetRootClientId, 0, {\n\t\t\t\t\t\t\toperation: 'insert',\n\t\t\t\t\t\t} );\n\t\t\t\t\t} );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst blocksData = blocks.map( ( block ) => {\n\t\t\t\t\tconst clientId = block.clientId;\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\tisUnmodifiedDefaultBlock:\n\t\t\t\t\t\t\tgetIsUnmodifiedDefaultBlock( block ),\n\t\t\t\t\t\tgetBoundingClientRect: () =>\n\t\t\t\t\t\t\townerDocument\n\t\t\t\t\t\t\t\t.getElementById( `block-${ clientId }` )\n\t\t\t\t\t\t\t\t.getBoundingClientRect(),\n\t\t\t\t\t\tblockIndex: getBlockIndex( clientId ),\n\t\t\t\t\t\tblockOrientation:\n\t\t\t\t\t\t\tgetBlockListSettings( clientId )?.orientation,\n\t\t\t\t\t};\n\t\t\t\t} );\n\n\t\t\t\tconst dropTargetPosition = getDropTargetPosition(\n\t\t\t\t\tblocksData,\n\t\t\t\t\t{ x: event.clientX, y: event.clientY },\n\t\t\t\t\tgetBlockListSettings( targetRootClientId )?.orientation,\n\t\t\t\t\t{\n\t\t\t\t\t\tdropZoneElement,\n\t\t\t\t\t\tparentBlockClientId,\n\t\t\t\t\t\tparentBlockOrientation: parentBlockClientId\n\t\t\t\t\t\t\t? getBlockListSettings( parentBlockClientId )\n\t\t\t\t\t\t\t\t\t?.orientation\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\trootBlockIndex: getBlockIndex( targetRootClientId ),\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\tconst [ targetIndex, operation, nearestSide ] =\n\t\t\t\t\tdropTargetPosition;\n\n\t\t\t\tif ( isZoomOut() && operation !== 'insert' ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( operation === 'group' ) {\n\t\t\t\t\tconst targetBlock = blocks[ targetIndex ];\n\t\t\t\t\tconst areAllImages = [\n\t\t\t\t\t\ttargetBlock.name,\n\t\t\t\t\t\t...draggedBlockNames,\n\t\t\t\t\t].every( ( name ) => name === 'core/image' );\n\t\t\t\t\tconst canInsertGalleryBlock = canInsertBlockType(\n\t\t\t\t\t\t'core/gallery',\n\t\t\t\t\t\ttargetRootClientId\n\t\t\t\t\t);\n\t\t\t\t\tconst areGroupableBlocks = isGroupable( [\n\t\t\t\t\t\ttargetBlock.clientId,\n\t\t\t\t\t\tgetDraggedBlockClientIds(),\n\t\t\t\t\t] );\n\t\t\t\t\tconst groupBlockVariations = getBlockVariations(\n\t\t\t\t\t\tgetGroupingBlockName(),\n\t\t\t\t\t\t'block'\n\t\t\t\t\t);\n\t\t\t\t\tconst canInsertRow =\n\t\t\t\t\t\tgroupBlockVariations &&\n\t\t\t\t\t\tgroupBlockVariations.find(\n\t\t\t\t\t\t\t( { name } ) => name === 'group-row'\n\t\t\t\t\t\t);\n\n\t\t\t\t\t// If the dragged blocks and the target block are all images,\n\t\t\t\t\t// check if it is creatable either a Row variation or a Gallery block.\n\t\t\t\t\tif (\n\t\t\t\t\t\tareAllImages &&\n\t\t\t\t\t\t! canInsertGalleryBlock &&\n\t\t\t\t\t\t( ! areGroupableBlocks || ! canInsertRow )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// If the dragged blocks and the target block are not all images,\n\t\t\t\t\t// check if it is creatable a Row variation.\n\t\t\t\t\tif (\n\t\t\t\t\t\t! areAllImages &&\n\t\t\t\t\t\t( ! areGroupableBlocks || ! canInsertRow )\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\tsetDropTarget( {\n\t\t\t\t\t\tindex: targetIndex,\n\t\t\t\t\t\toperation,\n\t\t\t\t\t\tnearestSide,\n\t\t\t\t\t} );\n\n\t\t\t\t\tconst insertionPointClientId = [\n\t\t\t\t\t\t'before',\n\t\t\t\t\t\t'after',\n\t\t\t\t\t].includes( operation )\n\t\t\t\t\t\t? parentBlockClientId\n\t\t\t\t\t\t: targetRootClientId;\n\n\t\t\t\t\tshowInsertionPoint( insertionPointClientId, targetIndex, {\n\t\t\t\t\t\toperation,\n\t\t\t\t\t\tnearestSide,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[\n\t\t\t\tisDragging,\n\t\t\t\tgetAllowedBlocks,\n\t\t\t\ttargetRootClientId,\n\t\t\t\tgetBlockNamesByClientId,\n\t\t\t\tgetDraggedBlockClientIds,\n\t\t\t\tgetBlockType,\n\t\t\t\tgetSectionRootClientId,\n\t\t\t\tisZoomOut,\n\t\t\t\tgetBlocks,\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tdropZoneElement,\n\t\t\t\tparentBlockClientId,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tregistry,\n\t\t\t\tstartDragging,\n\t\t\t\tshowInsertionPoint,\n\t\t\t\tcanInsertBlockType,\n\t\t\t\tisGroupable,\n\t\t\t\tgetBlockVariations,\n\t\t\t\tgetGroupingBlockName,\n\t\t\t]\n\t\t),\n\t\t200\n\t);\n\n\treturn useDropZone( {\n\t\tdropZoneElement,\n\t\tisDisabled,\n\t\tonDrop: onBlockDrop,\n\t\tonDragOver( event ) {\n\t\t\t// `currentTarget` is only available while the event is being\n\t\t\t// handled, so get it now and pass it to the thottled function.\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget\n\t\t\tthrottled( event, event.currentTarget.ownerDocument );\n\t\t},\n\t\tonDragLeave( event ) {\n\t\t\tconst { ownerDocument } = event.currentTarget;\n\n\t\t\t// If the drag event is leaving the drop zone and entering an insertion point,\n\t\t\t// do not hide the insertion point as it is conceptually within the dropzone.\n\t\t\tif (\n\t\t\t\tisInsertionPoint( event.relatedTarget, ownerDocument ) ||\n\t\t\t\tisInsertionPoint( event.target, ownerDocument )\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthrottled.cancel();\n\t\t\thideInsertionPoint();\n\t\t},\n\t\tonDragEnd() {\n\t\t\tthrottled.cancel();\n\t\t\tstopDragging();\n\t\t\thideInsertionPoint();\n\t\t},\n\t} );\n}\n"],"mappings":";;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAIA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAA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gBAAgB,EAChBrB,kBAAkB,EAClBoB,uBAAuB,EACvBD,wBAAwB,EACxB1C,YAAY,EACZgD,sBAAsB,EACtBD,SAAS,EACTP,SAAS,EACTD,oBAAoB,EACpBjE,eAAe,EACfmD,mBAAmB,EACnBgB,aAAa,EACbd,QAAQ,EACR2B,aAAa,EACbF,kBAAkB,EAClBd,kBAAkB,EAClBQ,WAAW,EACXZ,kBAAkB,EAClBC,oBAAoB,CAEtB,CAAC,EACD,GACD,CAAC;EAED,OAAO,IAAAuD,kCAAW,EAAE;IACnBpH,eAAe;IACfoD,UAAU;IACViE,MAAM,EAAElC,WAAW;IACnBmC,UAAUA,CAAE9B,KAAK,EAAG;MACnB;MACA;MACA;MACAH,SAAS,CAAEG,KAAK,EAAEA,KAAK,CAAC+B,aAAa,CAAC5E,aAAc,CAAC;IACtD,CAAC;IACD6E,WAAWA,CAAEhC,KAAK,EAAG;MACpB,MAAM;QAAE7C;MAAc,CAAC,GAAG6C,KAAK,CAAC+B,aAAa;;MAE7C;MACA;MACA,IACC9E,gBAAgB,CAAE+C,KAAK,CAACiC,aAAa,EAAE9E,aAAc,CAAC,IACtDF,gBAAgB,CAAE+C,KAAK,CAACkC,MAAM,EAAE/E,aAAc,CAAC,EAC9C;QACD;MACD;MAEA0C,SAAS,CAACsC,MAAM,CAAC,CAAC;MAClB5C,kBAAkB,CAAC,CAAC;IACrB,CAAC;IACD6C,SAASA,CAAA,EAAG;MACXvC,SAAS,CAACsC,MAAM,CAAC,CAAC;MAClB1C,YAAY,CAAC,CAAC;MACdF,kBAAkB,CAAC,CAAC;IACrB;EACD,CAAE,CAAC;AACJ","ignoreList":[]}
@@ -1,3 +1,4 @@
1
+ /* wp:polyfill */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");