@wordpress/block-editor 12.2.0 → 12.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1881) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +12 -0
  3. package/build/autocompleters/block.js +6 -6
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/alignment-control/index.js +4 -6
  6. package/build/components/alignment-control/index.js.map +1 -1
  7. package/build/components/alignment-control/ui.js +14 -20
  8. package/build/components/alignment-control/ui.js.map +1 -1
  9. package/build/components/autocomplete/index.js +5 -8
  10. package/build/components/autocomplete/index.js.map +1 -1
  11. package/build/components/block-actions/index.js +12 -12
  12. package/build/components/block-actions/index.js.map +1 -1
  13. package/build/components/block-alignment-control/constants.js +1 -5
  14. package/build/components/block-alignment-control/constants.js.map +1 -1
  15. package/build/components/block-alignment-control/index.js +4 -6
  16. package/build/components/block-alignment-control/index.js.map +1 -1
  17. package/build/components/block-alignment-control/ui.js +20 -25
  18. package/build/components/block-alignment-control/ui.js.map +1 -1
  19. package/build/components/block-alignment-control/ui.native.js +17 -20
  20. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  21. package/build/components/block-alignment-control/use-available-alignments.js +5 -10
  22. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  23. package/build/components/block-alignment-matrix-control/index.js +4 -7
  24. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  25. package/build/components/block-breadcrumb/index.js +5 -7
  26. package/build/components/block-breadcrumb/index.js.map +1 -1
  27. package/build/components/block-caption/index.native.js +30 -35
  28. package/build/components/block-caption/index.native.js.map +1 -1
  29. package/build/components/block-card/index.js +7 -9
  30. package/build/components/block-card/index.js.map +1 -1
  31. package/build/components/block-compare/block-view.js +8 -9
  32. package/build/components/block-compare/block-view.js.map +1 -1
  33. package/build/components/block-compare/index.js +7 -9
  34. package/build/components/block-compare/index.js.map +1 -1
  35. package/build/components/block-context/index.js +4 -5
  36. package/build/components/block-context/index.js.map +1 -1
  37. package/build/components/block-controls/fill.js +16 -22
  38. package/build/components/block-controls/fill.js.map +1 -1
  39. package/build/components/block-controls/hook.js +1 -3
  40. package/build/components/block-controls/hook.js.map +1 -1
  41. package/build/components/block-controls/index.js +8 -8
  42. package/build/components/block-controls/index.js.map +1 -1
  43. package/build/components/block-controls/slot.js +28 -20
  44. package/build/components/block-controls/slot.js.map +1 -1
  45. package/build/components/block-controls/slot.native.js +9 -17
  46. package/build/components/block-controls/slot.native.js.map +1 -1
  47. package/build/components/block-draggable/draggable-chip.js +5 -6
  48. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  49. package/build/components/block-draggable/draggable-chip.native.js +3 -4
  50. package/build/components/block-draggable/draggable-chip.native.js.map +1 -1
  51. package/build/components/block-draggable/dropping-insertion-point.native.js +6 -7
  52. package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  53. package/build/components/block-draggable/index.js +15 -16
  54. package/build/components/block-draggable/index.js.map +1 -1
  55. package/build/components/block-draggable/index.native.js +43 -58
  56. package/build/components/block-draggable/index.native.js.map +1 -1
  57. package/build/components/block-edit/edit.js +5 -10
  58. package/build/components/block-edit/edit.js.map +1 -1
  59. package/build/components/block-edit/edit.native.js +3 -8
  60. package/build/components/block-edit/edit.native.js.map +1 -1
  61. package/build/components/block-edit/index.js +3 -2
  62. package/build/components/block-edit/index.js.map +1 -1
  63. package/build/components/block-edit-visually-button/index.js +3 -4
  64. package/build/components/block-edit-visually-button/index.js.map +1 -1
  65. package/build/components/block-full-height-alignment-control/index.js +6 -7
  66. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  67. package/build/components/block-heading-level-dropdown/heading-level-icon.js +47 -0
  68. package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -0
  69. package/build/components/block-heading-level-dropdown/index.js +83 -0
  70. package/build/components/block-heading-level-dropdown/index.js.map +1 -0
  71. package/build/components/block-heading-level-dropdown/index.native.js +72 -0
  72. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -0
  73. package/build/components/block-icon/index.js +7 -11
  74. package/build/components/block-icon/index.js.map +1 -1
  75. package/build/components/block-icon/index.native.js +15 -20
  76. package/build/components/block-icon/index.native.js.map +1 -1
  77. package/build/components/block-info-slot-fill/index.js +4 -2
  78. package/build/components/block-info-slot-fill/index.js.map +1 -1
  79. package/build/components/block-inspector/index.js +45 -122
  80. package/build/components/block-inspector/index.js.map +1 -1
  81. package/build/components/block-inspector/useBlockInspectorAnimationSettings.js +2 -2
  82. package/build/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
  83. package/build/components/block-list/block-html.js +3 -4
  84. package/build/components/block-list/block-html.js.map +1 -1
  85. package/build/components/block-list/block-invalid-warning.js +3 -4
  86. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  87. package/build/components/block-list/block-invalid-warning.native.js +10 -15
  88. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  89. package/build/components/block-list/block-list-context.native.js +5 -11
  90. package/build/components/block-list/block-list-context.native.js.map +1 -1
  91. package/build/components/block-list/block-list-item-cell.native.js +5 -6
  92. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  93. package/build/components/block-list/block-list-item.native.js +21 -20
  94. package/build/components/block-list/block-list-item.native.js.map +1 -1
  95. package/build/components/block-list/block-outline.native.js +8 -9
  96. package/build/components/block-list/block-outline.native.js.map +1 -1
  97. package/build/components/block-list/block-selection-button.native.js +10 -12
  98. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  99. package/build/components/block-list/block.js +45 -50
  100. package/build/components/block-list/block.js.map +1 -1
  101. package/build/components/block-list/block.native.js +56 -68
  102. package/build/components/block-list/block.native.js.map +1 -1
  103. package/build/components/block-list/index.js +18 -18
  104. package/build/components/block-list/index.js.map +1 -1
  105. package/build/components/block-list/index.native.js +80 -90
  106. package/build/components/block-list/index.native.js.map +1 -1
  107. package/build/components/block-list/insertion-point.native.js +4 -5
  108. package/build/components/block-list/insertion-point.native.js.map +1 -1
  109. package/build/components/block-list/layout.js +6 -9
  110. package/build/components/block-list/layout.js.map +1 -1
  111. package/build/components/block-list/subdirectory-icon.js +11 -17
  112. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  113. package/build/components/block-list/use-block-props/index.js +15 -11
  114. package/build/components/block-list/use-block-props/index.js.map +1 -1
  115. package/build/components/block-list/use-block-props/index.native.js +1 -2
  116. package/build/components/block-list/use-block-props/index.native.js.map +1 -1
  117. package/build/components/block-list/use-block-props/use-block-custom-class-name.js +2 -2
  118. package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
  119. package/build/components/block-list/use-block-props/use-block-default-class-name.js +1 -1
  120. package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
  121. package/build/components/block-list/use-in-between-inserter.js +2 -6
  122. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  123. package/build/components/block-list-appender/index.js +36 -33
  124. package/build/components/block-list-appender/index.js.map +1 -1
  125. package/build/components/block-list-appender/index.native.js +9 -11
  126. package/build/components/block-list-appender/index.native.js.map +1 -1
  127. package/build/components/block-lock/menu-item.js +3 -4
  128. package/build/components/block-lock/menu-item.js.map +1 -1
  129. package/build/components/block-lock/modal.js +6 -9
  130. package/build/components/block-lock/modal.js.map +1 -1
  131. package/build/components/block-lock/toolbar.js +4 -10
  132. package/build/components/block-lock/toolbar.js.map +1 -1
  133. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +50 -68
  134. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  135. package/build/components/block-mobile-toolbar/index.native.js +26 -34
  136. package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
  137. package/build/components/block-mover/button.js +18 -19
  138. package/build/components/block-mover/button.js.map +1 -1
  139. package/build/components/block-mover/index.js +16 -18
  140. package/build/components/block-mover/index.js.map +1 -1
  141. package/build/components/block-mover/index.native.js +23 -46
  142. package/build/components/block-mover/index.native.js.map +1 -1
  143. package/build/components/block-mover/mover-description.native.js +7 -10
  144. package/build/components/block-mover/mover-description.native.js.map +1 -1
  145. package/build/components/block-navigation/dropdown.js +22 -29
  146. package/build/components/block-navigation/dropdown.js.map +1 -1
  147. package/build/components/block-parent-selector/index.js +6 -7
  148. package/build/components/block-parent-selector/index.js.map +1 -1
  149. package/build/components/block-pattern-setup/index.js +33 -39
  150. package/build/components/block-pattern-setup/index.js.map +1 -1
  151. package/build/components/block-pattern-setup/setup-toolbar.js +35 -42
  152. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  153. package/build/components/block-patterns-list/index.js +76 -85
  154. package/build/components/block-patterns-list/index.js.map +1 -1
  155. package/build/components/block-popover/drop-zone.js +4 -5
  156. package/build/components/block-popover/drop-zone.js.map +1 -1
  157. package/build/components/block-popover/inbetween.js +14 -21
  158. package/build/components/block-popover/inbetween.js.map +1 -1
  159. package/build/components/block-popover/index.js +18 -21
  160. package/build/components/block-popover/index.js.map +1 -1
  161. package/build/components/block-preview/auto.js +8 -12
  162. package/build/components/block-preview/auto.js.map +1 -1
  163. package/build/components/block-preview/index.js +21 -24
  164. package/build/components/block-preview/index.js.map +1 -1
  165. package/build/components/block-quick-navigation/index.js +83 -0
  166. package/build/components/block-quick-navigation/index.js.map +1 -0
  167. package/build/components/block-removal-warning-modal/index.js +90 -0
  168. package/build/components/block-removal-warning-modal/index.js.map +1 -0
  169. package/build/components/block-selection-clearer/index.js +4 -7
  170. package/build/components/block-selection-clearer/index.js.map +1 -1
  171. package/build/components/block-settings/button.native.js +10 -12
  172. package/build/components/block-settings/button.native.js.map +1 -1
  173. package/build/components/block-settings/container.native.js +6 -6
  174. package/build/components/block-settings/container.native.js.map +1 -1
  175. package/build/components/block-settings-menu/block-convert-button.js +5 -7
  176. package/build/components/block-settings-menu/block-convert-button.js.map +1 -1
  177. package/build/components/block-settings-menu/block-html-convert-button.js +10 -14
  178. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  179. package/build/components/block-settings-menu/block-mode-toggle.js +19 -25
  180. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  181. package/build/components/block-settings-menu/block-settings-dropdown.js +136 -116
  182. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  183. package/build/components/block-settings-menu/index.js +8 -10
  184. package/build/components/block-settings-menu/index.js.map +1 -1
  185. package/build/components/block-settings-menu-controls/index.js +18 -21
  186. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  187. package/build/components/block-styles/index.js +6 -7
  188. package/build/components/block-styles/index.js.map +1 -1
  189. package/build/components/block-styles/index.native.js +5 -7
  190. package/build/components/block-styles/index.native.js.map +1 -1
  191. package/build/components/block-styles/menu-items.js +4 -5
  192. package/build/components/block-styles/menu-items.js.map +1 -1
  193. package/build/components/block-styles/preview-panel.js +7 -10
  194. package/build/components/block-styles/preview-panel.js.map +1 -1
  195. package/build/components/block-styles/preview.native.js +6 -7
  196. package/build/components/block-styles/preview.native.js.map +1 -1
  197. package/build/components/block-styles/use-styles-for-block.js +7 -9
  198. package/build/components/block-styles/use-styles-for-block.js.map +1 -1
  199. package/build/components/block-styles/utils.js +4 -7
  200. package/build/components/block-styles/utils.js.map +1 -1
  201. package/build/components/block-switcher/block-styles-menu.js +4 -5
  202. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  203. package/build/components/block-switcher/block-transformations-menu.js +24 -29
  204. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  205. package/build/components/block-switcher/block-transformations-menu.native.js +9 -10
  206. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  207. package/build/components/block-switcher/block-variation-transformations.js +21 -30
  208. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  209. package/build/components/block-switcher/index.js +48 -62
  210. package/build/components/block-switcher/index.js.map +1 -1
  211. package/build/components/block-switcher/pattern-transformations-menu.js +24 -30
  212. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  213. package/build/components/block-switcher/preview-block-popover.js +3 -4
  214. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  215. package/build/components/block-switcher/utils.js +2 -3
  216. package/build/components/block-switcher/utils.js.map +1 -1
  217. package/build/components/block-title/index.js +5 -6
  218. package/build/components/block-title/index.js.map +1 -1
  219. package/build/components/block-title/use-block-display-title.js +5 -6
  220. package/build/components/block-title/use-block-display-title.js.map +1 -1
  221. package/build/components/block-toolbar/index.js +8 -10
  222. package/build/components/block-toolbar/index.js.map +1 -1
  223. package/build/components/block-toolbar/utils.js +14 -16
  224. package/build/components/block-toolbar/utils.js.map +1 -1
  225. package/build/components/block-tools/back-compat.js +3 -4
  226. package/build/components/block-tools/back-compat.js.map +1 -1
  227. package/build/components/block-tools/block-contextual-toolbar.js +9 -11
  228. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  229. package/build/components/block-tools/block-selection-button.js +10 -14
  230. package/build/components/block-tools/block-selection-button.js.map +1 -1
  231. package/build/components/block-tools/index.js +19 -13
  232. package/build/components/block-tools/index.js.map +1 -1
  233. package/build/components/block-tools/insertion-point.js +12 -15
  234. package/build/components/block-tools/insertion-point.js.map +1 -1
  235. package/build/components/block-tools/selected-block-popover.js +27 -28
  236. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  237. package/build/components/block-tools/use-block-toolbar-popover-props.js +9 -14
  238. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  239. package/build/components/block-tools/zoom-out-mode-inserters.js +3 -4
  240. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  241. package/build/components/block-types-list/index.js +8 -9
  242. package/build/components/block-types-list/index.js.map +1 -1
  243. package/build/components/block-types-list/index.native.js +26 -33
  244. package/build/components/block-types-list/index.native.js.map +1 -1
  245. package/build/components/block-variation-picker/index.js +8 -9
  246. package/build/components/block-variation-picker/index.js.map +1 -1
  247. package/build/components/block-variation-picker/index.native.js +7 -9
  248. package/build/components/block-variation-picker/index.native.js.map +1 -1
  249. package/build/components/block-variation-transforms/index.js +30 -41
  250. package/build/components/block-variation-transforms/index.js.map +1 -1
  251. package/build/components/block-vertical-alignment-control/index.js +4 -6
  252. package/build/components/block-vertical-alignment-control/index.js.map +1 -1
  253. package/build/components/block-vertical-alignment-control/ui.js +12 -21
  254. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  255. package/build/components/border-radius-control/all-input-control.js +9 -14
  256. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  257. package/build/components/border-radius-control/index.js +9 -10
  258. package/build/components/border-radius-control/index.js.map +1 -1
  259. package/build/components/border-radius-control/input-controls.js +10 -17
  260. package/build/components/border-radius-control/input-controls.js.map +1 -1
  261. package/build/components/border-radius-control/linked-button.js +6 -11
  262. package/build/components/border-radius-control/linked-button.js.map +1 -1
  263. package/build/components/border-radius-control/utils.js +3 -7
  264. package/build/components/border-radius-control/utils.js.map +1 -1
  265. package/build/components/button-block-appender/index.js +13 -15
  266. package/build/components/button-block-appender/index.js.map +1 -1
  267. package/build/components/button-block-appender/index.native.js +25 -29
  268. package/build/components/button-block-appender/index.native.js.map +1 -1
  269. package/build/components/caption/index.native.js +40 -43
  270. package/build/components/caption/index.native.js.map +1 -1
  271. package/build/components/child-layout-control/index.js +5 -6
  272. package/build/components/child-layout-control/index.js.map +1 -1
  273. package/build/components/color-palette/control.js +7 -10
  274. package/build/components/color-palette/control.js.map +1 -1
  275. package/build/components/color-palette/with-color-context.js +3 -11
  276. package/build/components/color-palette/with-color-context.js.map +1 -1
  277. package/build/components/color-style-selector/index.js +28 -35
  278. package/build/components/color-style-selector/index.js.map +1 -1
  279. package/build/components/colors/utils.js +12 -11
  280. package/build/components/colors/utils.js.map +1 -1
  281. package/build/components/colors/with-colors.js +20 -40
  282. package/build/components/colors/with-colors.js.map +1 -1
  283. package/build/components/colors-gradients/control.js +26 -27
  284. package/build/components/colors-gradients/control.js.map +1 -1
  285. package/build/components/colors-gradients/dropdown.js +44 -50
  286. package/build/components/colors-gradients/dropdown.js.map +1 -1
  287. package/build/components/colors-gradients/panel-color-gradient-settings.js +27 -30
  288. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  289. package/build/components/colors-gradients/panel-color-gradient-settings.native.js +27 -31
  290. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  291. package/build/components/contrast-checker/index.js +12 -13
  292. package/build/components/contrast-checker/index.js.map +1 -1
  293. package/build/components/contrast-checker/index.native.js +16 -18
  294. package/build/components/contrast-checker/index.native.js.map +1 -1
  295. package/build/components/convert-to-group-buttons/index.js +9 -10
  296. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  297. package/build/components/convert-to-group-buttons/index.native.js +6 -7
  298. package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
  299. package/build/components/convert-to-group-buttons/toolbar.js +6 -12
  300. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  301. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +4 -6
  302. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  303. package/build/components/copy-handler/index.js +9 -13
  304. package/build/components/copy-handler/index.js.map +1 -1
  305. package/build/components/date-format-picker/index.js +12 -16
  306. package/build/components/date-format-picker/index.js.map +1 -1
  307. package/build/components/default-block-appender/index.js +7 -9
  308. package/build/components/default-block-appender/index.js.map +1 -1
  309. package/build/components/default-block-appender/index.native.js +8 -10
  310. package/build/components/default-block-appender/index.native.js.map +1 -1
  311. package/build/components/default-style-picker/index.js +14 -22
  312. package/build/components/default-style-picker/index.js.map +1 -1
  313. package/build/components/duotone/components.js +14 -18
  314. package/build/components/duotone/components.js.map +1 -1
  315. package/build/components/duotone/utils.js +1 -2
  316. package/build/components/duotone/utils.js.map +1 -1
  317. package/build/components/duotone-control/index.js +13 -17
  318. package/build/components/duotone-control/index.js.map +1 -1
  319. package/build/components/editable-text/index.js +11 -13
  320. package/build/components/editable-text/index.js.map +1 -1
  321. package/build/components/editor-styles/index.js +4 -5
  322. package/build/components/editor-styles/index.js.map +1 -1
  323. package/build/components/floating-toolbar/index.native.js +7 -8
  324. package/build/components/floating-toolbar/index.native.js.map +1 -1
  325. package/build/components/font-appearance-control/index.js +21 -32
  326. package/build/components/font-appearance-control/index.js.map +1 -1
  327. package/build/components/font-family/index.js +14 -17
  328. package/build/components/font-family/index.js.map +1 -1
  329. package/build/components/font-sizes/fluid-utils.js +17 -21
  330. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  331. package/build/components/font-sizes/font-size-picker.js +2 -4
  332. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  333. package/build/components/font-sizes/utils.js +9 -15
  334. package/build/components/font-sizes/utils.js.map +1 -1
  335. package/build/components/font-sizes/with-font-sizes.js +18 -37
  336. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  337. package/build/components/global-styles/advanced-panel.js +7 -10
  338. package/build/components/global-styles/advanced-panel.js.map +1 -1
  339. package/build/components/global-styles/border-panel.js +45 -78
  340. package/build/components/global-styles/border-panel.js.map +1 -1
  341. package/build/components/global-styles/color-panel.js +119 -163
  342. package/build/components/global-styles/color-panel.js.map +1 -1
  343. package/build/components/global-styles/color-panel.native.js +25 -42
  344. package/build/components/global-styles/color-panel.native.js.map +1 -1
  345. package/build/components/global-styles/dimensions-panel.js +78 -109
  346. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  347. package/build/components/global-styles/effects-panel.js +60 -73
  348. package/build/components/global-styles/effects-panel.js.map +1 -1
  349. package/build/components/global-styles/filters-panel.js +55 -72
  350. package/build/components/global-styles/filters-panel.js.map +1 -1
  351. package/build/components/global-styles/get-block-css-selector.js +4 -7
  352. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  353. package/build/components/global-styles/hooks.js +22 -37
  354. package/build/components/global-styles/hooks.js.map +1 -1
  355. package/build/components/global-styles/index.js +6 -0
  356. package/build/components/global-styles/index.js.map +1 -1
  357. package/build/components/global-styles/typography-panel.js +69 -125
  358. package/build/components/global-styles/typography-panel.js.map +1 -1
  359. package/build/components/global-styles/typography-utils.js +49 -26
  360. package/build/components/global-styles/typography-utils.js.map +1 -1
  361. package/build/components/global-styles/use-global-styles-output.js +153 -245
  362. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  363. package/build/components/global-styles/utils.js +11 -27
  364. package/build/components/global-styles/utils.js.map +1 -1
  365. package/build/components/gradients/use-gradient.js +6 -7
  366. package/build/components/gradients/use-gradient.js.map +1 -1
  367. package/build/components/gradients/with-gradient.js +2 -6
  368. package/build/components/gradients/with-gradient.js.map +1 -1
  369. package/build/components/height-control/index.js +9 -10
  370. package/build/components/height-control/index.js.map +1 -1
  371. package/build/components/iframe/index.js +53 -90
  372. package/build/components/iframe/index.js.map +1 -1
  373. package/build/components/iframe/use-compatibility-styles.js +29 -20
  374. package/build/components/iframe/use-compatibility-styles.js.map +1 -1
  375. package/build/components/image-editor/aspect-ratio-dropdown.js +83 -91
  376. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  377. package/build/components/image-editor/constants.js +1 -2
  378. package/build/components/image-editor/constants.js.map +1 -1
  379. package/build/components/image-editor/context.js +9 -10
  380. package/build/components/image-editor/context.js.map +1 -1
  381. package/build/components/image-editor/cropper.js +11 -12
  382. package/build/components/image-editor/cropper.js.map +1 -1
  383. package/build/components/image-editor/index.js +12 -13
  384. package/build/components/image-editor/index.js.map +1 -1
  385. package/build/components/image-editor/use-save-image.js +11 -12
  386. package/build/components/image-editor/use-save-image.js.map +1 -1
  387. package/build/components/image-editor/use-transform-image.js +5 -6
  388. package/build/components/image-editor/use-transform-image.js.map +1 -1
  389. package/build/components/image-editor/zoom-dropdown.js +10 -13
  390. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  391. package/build/components/image-size-control/index.js +12 -13
  392. package/build/components/image-size-control/index.js.map +1 -1
  393. package/build/components/index.js +9 -9
  394. package/build/components/index.js.map +1 -1
  395. package/build/components/index.native.js +9 -0
  396. package/build/components/index.native.js.map +1 -1
  397. package/build/components/inner-blocks/button-block-appender.js +7 -8
  398. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  399. package/build/components/inner-blocks/default-block-appender.js +6 -8
  400. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  401. package/build/components/inner-blocks/index.js +11 -14
  402. package/build/components/inner-blocks/index.js.map +1 -1
  403. package/build/components/inner-blocks/index.native.js +9 -10
  404. package/build/components/inner-blocks/index.native.js.map +1 -1
  405. package/build/components/inner-blocks/use-block-context.js +1 -4
  406. package/build/components/inner-blocks/use-block-context.js.map +1 -1
  407. package/build/components/inner-blocks/use-nested-settings-update.js +24 -32
  408. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  409. package/build/components/inner-blocks/with-client-id.js +2 -6
  410. package/build/components/inner-blocks/with-client-id.js.map +1 -1
  411. package/build/components/inserter/block-patterns-explorer/explorer.js +11 -12
  412. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  413. package/build/components/inserter/block-patterns-explorer/patterns-list.js +11 -18
  414. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  415. package/build/components/inserter/block-patterns-explorer/sidebar.js +20 -24
  416. package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  417. package/build/components/inserter/block-patterns-tab.js +62 -45
  418. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  419. package/build/components/inserter/block-types-tab.js +7 -9
  420. package/build/components/inserter/block-types-tab.js.map +1 -1
  421. package/build/components/inserter/block-types-tab.native.js +8 -9
  422. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  423. package/build/components/inserter/hooks/use-block-type-impressions.native.js +3 -5
  424. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  425. package/build/components/inserter/hooks/use-block-types-state.js +9 -9
  426. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  427. package/build/components/inserter/hooks/use-clipboard-block.native.js +2 -2
  428. package/build/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  429. package/build/components/inserter/hooks/use-debounced-input.js +1 -2
  430. package/build/components/inserter/hooks/use-debounced-input.js.map +1 -1
  431. package/build/components/inserter/hooks/use-insertion-point.js +11 -13
  432. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  433. package/build/components/inserter/index.js +45 -59
  434. package/build/components/inserter/index.js.map +1 -1
  435. package/build/components/inserter/index.native.js +28 -36
  436. package/build/components/inserter/index.native.js.map +1 -1
  437. package/build/components/inserter/library.js +12 -13
  438. package/build/components/inserter/library.js.map +1 -1
  439. package/build/components/inserter/media-tab/hooks.js +2 -5
  440. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  441. package/build/components/inserter/media-tab/media-list.js +8 -13
  442. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  443. package/build/components/inserter/media-tab/media-panel.js +12 -14
  444. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  445. package/build/components/inserter/media-tab/media-preview.js +47 -60
  446. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  447. package/build/components/inserter/media-tab/media-tab.js +25 -29
  448. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  449. package/build/components/inserter/media-tab/utils.js +3 -5
  450. package/build/components/inserter/media-tab/utils.js.map +1 -1
  451. package/build/components/inserter/menu.js +15 -19
  452. package/build/components/inserter/menu.js.map +1 -1
  453. package/build/components/inserter/menu.native.js +27 -31
  454. package/build/components/inserter/menu.native.js.map +1 -1
  455. package/build/components/inserter/mobile-tab-navigation.js +7 -9
  456. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  457. package/build/components/inserter/panel.js +5 -6
  458. package/build/components/inserter/panel.js.map +1 -1
  459. package/build/components/inserter/preview-panel.js +4 -5
  460. package/build/components/inserter/preview-panel.js.map +1 -1
  461. package/build/components/inserter/quick-inserter.js +8 -9
  462. package/build/components/inserter/quick-inserter.js.map +1 -1
  463. package/build/components/inserter/reusable-blocks-tab.js +16 -21
  464. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  465. package/build/components/inserter/reusable-blocks-tab.native.js +5 -6
  466. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  467. package/build/components/inserter/search-items.js +12 -40
  468. package/build/components/inserter/search-items.js.map +1 -1
  469. package/build/components/inserter/search-results.js +17 -18
  470. package/build/components/inserter/search-results.js.map +1 -1
  471. package/build/components/inserter/search-results.native.js +11 -12
  472. package/build/components/inserter/search-results.native.js.map +1 -1
  473. package/build/components/inserter/tabs.js +11 -12
  474. package/build/components/inserter/tabs.js.map +1 -1
  475. package/build/components/inserter/tabs.native.js +37 -55
  476. package/build/components/inserter/tabs.native.js.map +1 -1
  477. package/build/components/inserter/utils.native.js +13 -17
  478. package/build/components/inserter/utils.native.js.map +1 -1
  479. package/build/components/inserter-draggable-blocks/index.js +11 -13
  480. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  481. package/build/components/inserter-list-item/index.js +69 -74
  482. package/build/components/inserter-list-item/index.js.map +1 -1
  483. package/build/components/inserter-listbox/group.js +4 -7
  484. package/build/components/inserter-listbox/group.js.map +1 -1
  485. package/build/components/inserter-listbox/index.js +3 -4
  486. package/build/components/inserter-listbox/index.js.map +1 -1
  487. package/build/components/inserter-listbox/item.js +14 -14
  488. package/build/components/inserter-listbox/item.js.map +1 -1
  489. package/build/components/inserter-listbox/row.js +4 -5
  490. package/build/components/inserter-listbox/row.js.map +1 -1
  491. package/build/components/inspector-controls/block-support-slot-container.js +6 -11
  492. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  493. package/build/components/inspector-controls/block-support-tools-panel.js +6 -8
  494. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  495. package/build/components/inspector-controls/fill.js +13 -24
  496. package/build/components/inspector-controls/fill.js.map +1 -1
  497. package/build/components/inspector-controls/fill.native.js +9 -12
  498. package/build/components/inspector-controls/fill.native.js.map +1 -1
  499. package/build/components/inspector-controls/index.js +4 -6
  500. package/build/components/inspector-controls/index.js.map +1 -1
  501. package/build/components/inspector-controls/slot.js +13 -19
  502. package/build/components/inspector-controls/slot.js.map +1 -1
  503. package/build/components/inspector-controls/slot.native.js +8 -11
  504. package/build/components/inspector-controls/slot.native.js.map +1 -1
  505. package/build/components/inspector-controls-tabs/index.js +6 -7
  506. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  507. package/build/components/inspector-controls-tabs/position-controls-panel.js +3 -8
  508. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  509. package/build/components/inspector-controls-tabs/settings-tab-hint.js +1 -1
  510. package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  511. package/build/components/inspector-controls-tabs/settings-tab.js +3 -6
  512. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  513. package/build/components/inspector-controls-tabs/styles-tab.js +5 -6
  514. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  515. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -3
  516. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  517. package/build/components/inspector-popover-header/index.js +18 -22
  518. package/build/components/inspector-popover-header/index.js.map +1 -1
  519. package/build/components/justify-content-control/index.js +4 -6
  520. package/build/components/justify-content-control/index.js.map +1 -1
  521. package/build/components/justify-content-control/ui.js +12 -17
  522. package/build/components/justify-content-control/ui.js.map +1 -1
  523. package/build/components/letter-spacing-control/index.js +8 -11
  524. package/build/components/letter-spacing-control/index.js.map +1 -1
  525. package/build/components/line-height-control/index.js +15 -22
  526. package/build/components/line-height-control/index.js.map +1 -1
  527. package/build/components/line-height-control/index.native.js +4 -5
  528. package/build/components/line-height-control/index.native.js.map +1 -1
  529. package/build/components/link-control/index.js +86 -71
  530. package/build/components/link-control/index.js.map +1 -1
  531. package/build/components/link-control/is-url-like.js +32 -2
  532. package/build/components/link-control/is-url-like.js.map +1 -1
  533. package/build/components/link-control/link-preview.js +24 -27
  534. package/build/components/link-control/link-preview.js.map +1 -1
  535. package/build/components/link-control/search-create-button.js +9 -13
  536. package/build/components/link-control/search-create-button.js.map +1 -1
  537. package/build/components/link-control/search-input.js +24 -27
  538. package/build/components/link-control/search-input.js.map +1 -1
  539. package/build/components/link-control/search-item.js +15 -19
  540. package/build/components/link-control/search-item.js.map +1 -1
  541. package/build/components/link-control/search-results.js +23 -31
  542. package/build/components/link-control/search-results.js.map +1 -1
  543. package/build/components/link-control/settings-drawer.js +6 -35
  544. package/build/components/link-control/settings-drawer.js.map +1 -1
  545. package/build/components/link-control/settings.js +6 -8
  546. package/build/components/link-control/settings.js.map +1 -1
  547. package/build/components/link-control/use-internal-value.js +54 -0
  548. package/build/components/link-control/use-internal-value.js.map +1 -0
  549. package/build/components/link-control/use-rich-url-data.js +1 -1
  550. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  551. package/build/components/link-control/use-search-handler.js +10 -23
  552. package/build/components/link-control/use-search-handler.js.map +1 -1
  553. package/build/components/list-view/appender.js +15 -17
  554. package/build/components/list-view/appender.js.map +1 -1
  555. package/build/components/list-view/aria-referenced-text.js +40 -0
  556. package/build/components/list-view/aria-referenced-text.js.map +1 -0
  557. package/build/components/list-view/block-contents.js +39 -40
  558. package/build/components/list-view/block-contents.js.map +1 -1
  559. package/build/components/list-view/block-select-button.js +79 -22
  560. package/build/components/list-view/block-select-button.js.map +1 -1
  561. package/build/components/list-view/block.js +119 -101
  562. package/build/components/list-view/block.js.map +1 -1
  563. package/build/components/list-view/branch.js +14 -13
  564. package/build/components/list-view/branch.js.map +1 -1
  565. package/build/components/list-view/drop-indicator.js +66 -16
  566. package/build/components/list-view/drop-indicator.js.map +1 -1
  567. package/build/components/list-view/expander.js +3 -4
  568. package/build/components/list-view/expander.js.map +1 -1
  569. package/build/components/list-view/index.js +50 -49
  570. package/build/components/list-view/index.js.map +1 -1
  571. package/build/components/list-view/leaf.js +14 -16
  572. package/build/components/list-view/leaf.js.map +1 -1
  573. package/build/components/list-view/use-block-selection.js +4 -6
  574. package/build/components/list-view/use-block-selection.js.map +1 -1
  575. package/build/components/list-view/use-list-view-client-ids.js +6 -29
  576. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  577. package/build/components/list-view/use-list-view-drop-zone.js +63 -39
  578. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  579. package/build/components/list-view/use-list-view-expand-selected-item.js +4 -5
  580. package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  581. package/build/components/list-view/use-list-view-scroll-into-view.js +5 -6
  582. package/build/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  583. package/build/components/media-placeholder/index.js +106 -102
  584. package/build/components/media-placeholder/index.js.map +1 -1
  585. package/build/components/media-placeholder/index.native.js +5 -6
  586. package/build/components/media-placeholder/index.native.js.map +1 -1
  587. package/build/components/media-replace-flow/index.js +92 -107
  588. package/build/components/media-replace-flow/index.js.map +1 -1
  589. package/build/components/media-upload/check.js +4 -5
  590. package/build/components/media-upload/check.js.map +1 -1
  591. package/build/components/media-upload/index.native.js +1 -1
  592. package/build/components/media-upload/index.native.js.map +1 -1
  593. package/build/components/multi-selection-inspector/index.js +3 -4
  594. package/build/components/multi-selection-inspector/index.js.map +1 -1
  595. package/build/components/navigable-toolbar/index.js +24 -23
  596. package/build/components/navigable-toolbar/index.js.map +1 -1
  597. package/build/components/observe-typing/index.js +3 -4
  598. package/build/components/observe-typing/index.js.map +1 -1
  599. package/build/components/panel-color-settings/index.js +8 -10
  600. package/build/components/panel-color-settings/index.js.map +1 -1
  601. package/build/components/plain-text/index.js +12 -14
  602. package/build/components/plain-text/index.js.map +1 -1
  603. package/build/components/plain-text/index.native.js +15 -20
  604. package/build/components/plain-text/index.native.js.map +1 -1
  605. package/build/components/preview-options/index.js +12 -12
  606. package/build/components/preview-options/index.js.map +1 -1
  607. package/build/components/provider/block-refs-provider.js +3 -4
  608. package/build/components/provider/block-refs-provider.js.map +1 -1
  609. package/build/components/provider/index.js +2 -4
  610. package/build/components/provider/index.js.map +1 -1
  611. package/build/components/provider/use-block-sync.js +7 -8
  612. package/build/components/provider/use-block-sync.js.map +1 -1
  613. package/build/components/provider/with-registry-provider.js +13 -17
  614. package/build/components/provider/with-registry-provider.js.map +1 -1
  615. package/build/components/publish-date-time-picker/index.js +10 -12
  616. package/build/components/publish-date-time-picker/index.js.map +1 -1
  617. package/build/components/recursion-provider/index.js +7 -11
  618. package/build/components/recursion-provider/index.js.map +1 -1
  619. package/build/components/resizable-box-popover/index.js +10 -11
  620. package/build/components/resizable-box-popover/index.js.map +1 -1
  621. package/build/components/responsive-block-control/label.js +5 -6
  622. package/build/components/responsive-block-control/label.js.map +1 -1
  623. package/build/components/rich-text/content.js +99 -0
  624. package/build/components/rich-text/content.js.map +1 -0
  625. package/build/components/rich-text/embed-handler-picker.native.js +6 -10
  626. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  627. package/build/components/rich-text/format-edit.js +7 -8
  628. package/build/components/rich-text/format-edit.js.map +1 -1
  629. package/build/components/rich-text/format-toolbar/index.js +10 -20
  630. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  631. package/build/components/rich-text/format-toolbar-container.js +13 -16
  632. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  633. package/build/components/rich-text/index.js +45 -83
  634. package/build/components/rich-text/index.js.map +1 -1
  635. package/build/components/rich-text/index.native.js +128 -183
  636. package/build/components/rich-text/index.native.js.map +1 -1
  637. package/build/components/rich-text/input-event.js +4 -5
  638. package/build/components/rich-text/input-event.js.map +1 -1
  639. package/build/components/rich-text/shortcut.js +5 -6
  640. package/build/components/rich-text/shortcut.js.map +1 -1
  641. package/build/components/rich-text/split-value.js +8 -10
  642. package/build/components/rich-text/split-value.js.map +1 -1
  643. package/build/components/rich-text/toolbar-button.js +8 -13
  644. package/build/components/rich-text/toolbar-button.js.map +1 -1
  645. package/build/components/rich-text/use-before-input-rules.js +1 -4
  646. package/build/components/rich-text/use-before-input-rules.js.map +1 -1
  647. package/build/components/rich-text/use-enter.js +3 -6
  648. package/build/components/rich-text/use-enter.js.map +1 -1
  649. package/build/components/rich-text/use-firefox-compat.js +32 -1
  650. package/build/components/rich-text/use-firefox-compat.js.map +1 -1
  651. package/build/components/rich-text/use-format-types.js +11 -17
  652. package/build/components/rich-text/use-format-types.js.map +1 -1
  653. package/build/components/rich-text/use-input-rules.js +9 -15
  654. package/build/components/rich-text/use-input-rules.js.map +1 -1
  655. package/build/components/rich-text/use-mark-persistent.js +4 -5
  656. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  657. package/build/components/rich-text/use-paste-handler.js +5 -7
  658. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  659. package/build/components/rich-text/utils.js +5 -7
  660. package/build/components/rich-text/utils.js.map +1 -1
  661. package/build/components/skip-to-selected-block/index.js +3 -4
  662. package/build/components/skip-to-selected-block/index.js.map +1 -1
  663. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +38 -0
  664. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -0
  665. package/build/components/spacing-sizes-control/index.js +62 -64
  666. package/build/components/spacing-sizes-control/index.js.map +1 -1
  667. package/build/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +21 -22
  668. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -0
  669. package/build/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +22 -22
  670. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -0
  671. package/build/components/spacing-sizes-control/input-controls/single.js +51 -0
  672. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -0
  673. package/build/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +51 -69
  674. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -0
  675. package/build/components/spacing-sizes-control/sides-dropdown/index.js +84 -0
  676. package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -0
  677. package/build/components/spacing-sizes-control/utils.js +213 -31
  678. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  679. package/build/components/text-decoration-control/index.js +5 -6
  680. package/build/components/text-decoration-control/index.js.map +1 -1
  681. package/build/components/text-transform-control/index.js +5 -6
  682. package/build/components/text-transform-control/index.js.map +1 -1
  683. package/build/components/tool-selector/index.js +13 -20
  684. package/build/components/tool-selector/index.js.map +1 -1
  685. package/build/components/typewriter/index.js +6 -9
  686. package/build/components/typewriter/index.js.map +1 -1
  687. package/build/components/ungroup-button/index.native.js +11 -16
  688. package/build/components/ungroup-button/index.native.js.map +1 -1
  689. package/build/components/unit-control/index.js +8 -10
  690. package/build/components/unit-control/index.js.map +1 -1
  691. package/build/components/url-input/index.js +23 -34
  692. package/build/components/url-input/index.js.map +1 -1
  693. package/build/components/url-input/index.native.js +10 -15
  694. package/build/components/url-input/index.native.js.map +1 -1
  695. package/build/components/url-popover/image-url-input-ui.js +33 -29
  696. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  697. package/build/components/url-popover/index.js +16 -19
  698. package/build/components/url-popover/index.js.map +1 -1
  699. package/build/components/url-popover/link-editor.js +10 -12
  700. package/build/components/url-popover/link-editor.js.map +1 -1
  701. package/build/components/url-popover/link-viewer-url.js +5 -6
  702. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  703. package/build/components/url-popover/link-viewer.js +11 -13
  704. package/build/components/url-popover/link-viewer.js.map +1 -1
  705. package/build/components/use-block-display-information/index.js +30 -2
  706. package/build/components/use-block-display-information/index.js.map +1 -1
  707. package/build/components/use-block-drop-zone/index.js +16 -23
  708. package/build/components/use-block-drop-zone/index.js.map +1 -1
  709. package/build/components/use-block-drop-zone/index.native.js +8 -11
  710. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  711. package/build/components/use-moving-animation/index.js +9 -12
  712. package/build/components/use-moving-animation/index.js.map +1 -1
  713. package/build/components/use-on-block-drop/index.js +2 -6
  714. package/build/components/use-on-block-drop/index.js.map +1 -1
  715. package/build/components/use-on-block-drop/index.native.js +8 -10
  716. package/build/components/use-on-block-drop/index.native.js.map +1 -1
  717. package/build/components/use-paste-styles/index.js +2 -6
  718. package/build/components/use-paste-styles/index.js.map +1 -1
  719. package/build/components/video-player/index.native.js +2 -4
  720. package/build/components/video-player/index.native.js.map +1 -1
  721. package/build/components/warning/index.js +6 -7
  722. package/build/components/warning/index.js.map +1 -1
  723. package/build/components/warning/index.native.js +13 -15
  724. package/build/components/warning/index.native.js.map +1 -1
  725. package/build/components/writing-flow/index.js +6 -9
  726. package/build/components/writing-flow/index.js.map +1 -1
  727. package/build/components/writing-flow/use-drag-selection.js +5 -7
  728. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  729. package/build/components/writing-flow/use-tab-nav.js +41 -10
  730. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  731. package/build/hooks/align.js +15 -22
  732. package/build/hooks/align.js.map +1 -1
  733. package/build/hooks/anchor.js +9 -4
  734. package/build/hooks/anchor.js.map +1 -1
  735. package/build/hooks/aria-label.js +1 -3
  736. package/build/hooks/aria-label.js.map +1 -1
  737. package/build/hooks/behaviors.js +131 -60
  738. package/build/hooks/behaviors.js.map +1 -1
  739. package/build/hooks/border.js +29 -43
  740. package/build/hooks/border.js.map +1 -1
  741. package/build/hooks/color.js +26 -42
  742. package/build/hooks/color.js.map +1 -1
  743. package/build/hooks/content-lock-ui.js +33 -39
  744. package/build/hooks/content-lock-ui.js.map +1 -1
  745. package/build/hooks/contrast-checker.js +4 -7
  746. package/build/hooks/contrast-checker.js.map +1 -1
  747. package/build/hooks/custom-class-name.js +8 -5
  748. package/build/hooks/custom-class-name.js.map +1 -1
  749. package/build/hooks/dimensions.js +11 -14
  750. package/build/hooks/dimensions.js.map +1 -1
  751. package/build/hooks/duotone.js +37 -49
  752. package/build/hooks/duotone.js.map +1 -1
  753. package/build/hooks/font-family.js +6 -11
  754. package/build/hooks/font-family.js.map +1 -1
  755. package/build/hooks/font-size.js +22 -27
  756. package/build/hooks/font-size.js.map +1 -1
  757. package/build/hooks/gap.js +5 -6
  758. package/build/hooks/gap.js.map +1 -1
  759. package/build/hooks/layout.js +66 -81
  760. package/build/hooks/layout.js.map +1 -1
  761. package/build/hooks/line-height.js +5 -8
  762. package/build/hooks/line-height.js.map +1 -1
  763. package/build/hooks/lock.js +2 -2
  764. package/build/hooks/lock.js.map +1 -1
  765. package/build/hooks/margin.js +6 -9
  766. package/build/hooks/margin.js.map +1 -1
  767. package/build/hooks/metadata-name.js +4 -5
  768. package/build/hooks/metadata-name.js.map +1 -1
  769. package/build/hooks/metadata.js +3 -7
  770. package/build/hooks/metadata.js.map +1 -1
  771. package/build/hooks/padding.js +6 -9
  772. package/build/hooks/padding.js.map +1 -1
  773. package/build/hooks/position.js +50 -56
  774. package/build/hooks/position.js.map +1 -1
  775. package/build/hooks/settings.js +1 -3
  776. package/build/hooks/settings.js.map +1 -1
  777. package/build/hooks/style.js +19 -23
  778. package/build/hooks/style.js.map +1 -1
  779. package/build/hooks/supports.js +4 -6
  780. package/build/hooks/supports.js.map +1 -1
  781. package/build/hooks/typography.js +18 -27
  782. package/build/hooks/typography.js.map +1 -1
  783. package/build/hooks/typography.native.js +4 -3
  784. package/build/hooks/typography.native.js.map +1 -1
  785. package/build/hooks/use-border-props.js +1 -3
  786. package/build/hooks/use-border-props.js.map +1 -1
  787. package/build/hooks/use-color-props.js +6 -8
  788. package/build/hooks/use-color-props.js.map +1 -1
  789. package/build/hooks/use-editor-wrapper-styles.native.js +34 -39
  790. package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  791. package/build/hooks/use-spacing-props.js +1 -1
  792. package/build/hooks/use-spacing-props.js.map +1 -1
  793. package/build/hooks/use-typography-props.js +12 -23
  794. package/build/hooks/use-typography-props.js.map +1 -1
  795. package/build/hooks/utils.js +6 -18
  796. package/build/hooks/utils.js.map +1 -1
  797. package/build/index.js +0 -14
  798. package/build/index.js.map +1 -1
  799. package/build/layouts/constrained.js +24 -27
  800. package/build/layouts/constrained.js.map +1 -1
  801. package/build/layouts/definitions.js +154 -0
  802. package/build/layouts/definitions.js.map +1 -0
  803. package/build/layouts/flex.js +50 -58
  804. package/build/layouts/flex.js.map +1 -1
  805. package/build/layouts/flow.js +12 -13
  806. package/build/layouts/flow.js.map +1 -1
  807. package/build/layouts/grid.js +47 -25
  808. package/build/layouts/grid.js.map +1 -1
  809. package/build/layouts/index.js +1 -2
  810. package/build/layouts/index.js.map +1 -1
  811. package/build/layouts/utils.js +11 -11
  812. package/build/layouts/utils.js.map +1 -1
  813. package/build/private-apis.js +17 -1
  814. package/build/private-apis.js.map +1 -1
  815. package/build/store/actions.js +226 -369
  816. package/build/store/actions.js.map +1 -1
  817. package/build/store/array.js +1 -2
  818. package/build/store/array.js.map +1 -1
  819. package/build/store/private-actions.js +203 -7
  820. package/build/store/private-actions.js.map +1 -1
  821. package/build/store/private-selectors.js +109 -24
  822. package/build/store/private-selectors.js.map +1 -1
  823. package/build/store/reducer.js +119 -170
  824. package/build/store/reducer.js.map +1 -1
  825. package/build/store/selectors.js +161 -231
  826. package/build/store/selectors.js.map +1 -1
  827. package/build/utils/block-variation-transforms.js +4 -7
  828. package/build/utils/block-variation-transforms.js.map +1 -1
  829. package/build/utils/math.js +1 -2
  830. package/build/utils/math.js.map +1 -1
  831. package/build/utils/object.js +40 -4
  832. package/build/utils/object.js.map +1 -1
  833. package/build/utils/order-inserter-block-items.js +5 -7
  834. package/build/utils/order-inserter-block-items.js.map +1 -1
  835. package/build/utils/parse-css-unit-to-px.js +3 -6
  836. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  837. package/build/utils/pasting.js +5 -8
  838. package/build/utils/pasting.js.map +1 -1
  839. package/build/utils/pre-parse-patterns.js +1 -1
  840. package/build/utils/pre-parse-patterns.js.map +1 -1
  841. package/build/utils/sorting.js +1 -2
  842. package/build/utils/sorting.js.map +1 -1
  843. package/build/utils/transform-styles/index.js +5 -7
  844. package/build/utils/transform-styles/index.js.map +1 -1
  845. package/build/utils/transform-styles/transforms/wrap.js +28 -31
  846. package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
  847. package/build-module/autocompleters/block.js +6 -6
  848. package/build-module/autocompleters/block.js.map +1 -1
  849. package/build-module/components/alignment-control/index.js +4 -5
  850. package/build-module/components/alignment-control/index.js.map +1 -1
  851. package/build-module/components/alignment-control/ui.js +14 -17
  852. package/build-module/components/alignment-control/ui.js.map +1 -1
  853. package/build-module/components/autocomplete/index.js +5 -7
  854. package/build-module/components/autocomplete/index.js.map +1 -1
  855. package/build-module/components/block-actions/index.js +12 -12
  856. package/build-module/components/block-actions/index.js.map +1 -1
  857. package/build-module/components/block-alignment-control/constants.js +0 -3
  858. package/build-module/components/block-alignment-control/constants.js.map +1 -1
  859. package/build-module/components/block-alignment-control/index.js +4 -5
  860. package/build-module/components/block-alignment-control/index.js.map +1 -1
  861. package/build-module/components/block-alignment-control/ui.js +21 -25
  862. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  863. package/build-module/components/block-alignment-control/ui.native.js +17 -19
  864. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  865. package/build-module/components/block-alignment-control/use-available-alignments.js +5 -10
  866. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  867. package/build-module/components/block-alignment-matrix-control/index.js +4 -7
  868. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  869. package/build-module/components/block-breadcrumb/index.js +5 -7
  870. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  871. package/build-module/components/block-caption/index.native.js +29 -34
  872. package/build-module/components/block-caption/index.native.js.map +1 -1
  873. package/build-module/components/block-card/index.js +7 -9
  874. package/build-module/components/block-card/index.js.map +1 -1
  875. package/build-module/components/block-compare/block-view.js +8 -9
  876. package/build-module/components/block-compare/block-view.js.map +1 -1
  877. package/build-module/components/block-compare/index.js +7 -9
  878. package/build-module/components/block-compare/index.js.map +1 -1
  879. package/build-module/components/block-context/index.js +4 -5
  880. package/build-module/components/block-context/index.js.map +1 -1
  881. package/build-module/components/block-controls/fill.js +18 -23
  882. package/build-module/components/block-controls/fill.js.map +1 -1
  883. package/build-module/components/block-controls/hook.js +1 -3
  884. package/build-module/components/block-controls/hook.js.map +1 -1
  885. package/build-module/components/block-controls/index.js +8 -7
  886. package/build-module/components/block-controls/index.js.map +1 -1
  887. package/build-module/components/block-controls/slot.js +29 -22
  888. package/build-module/components/block-controls/slot.js.map +1 -1
  889. package/build-module/components/block-controls/slot.native.js +10 -18
  890. package/build-module/components/block-controls/slot.native.js.map +1 -1
  891. package/build-module/components/block-draggable/draggable-chip.js +5 -7
  892. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  893. package/build-module/components/block-draggable/draggable-chip.native.js +3 -4
  894. package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
  895. package/build-module/components/block-draggable/dropping-insertion-point.native.js +6 -7
  896. package/build-module/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  897. package/build-module/components/block-draggable/index.js +16 -17
  898. package/build-module/components/block-draggable/index.js.map +1 -1
  899. package/build-module/components/block-draggable/index.native.js +43 -58
  900. package/build-module/components/block-draggable/index.native.js.map +1 -1
  901. package/build-module/components/block-edit/edit.js +5 -9
  902. package/build-module/components/block-edit/edit.js.map +1 -1
  903. package/build-module/components/block-edit/edit.native.js +3 -7
  904. package/build-module/components/block-edit/edit.native.js.map +1 -1
  905. package/build-module/components/block-edit/index.js +3 -2
  906. package/build-module/components/block-edit/index.js.map +1 -1
  907. package/build-module/components/block-edit-visually-button/index.js +3 -4
  908. package/build-module/components/block-edit-visually-button/index.js.map +1 -1
  909. package/build-module/components/block-full-height-alignment-control/index.js +6 -7
  910. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  911. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js +39 -0
  912. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -0
  913. package/build-module/components/block-heading-level-dropdown/index.js +71 -0
  914. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -0
  915. package/build-module/components/block-heading-level-dropdown/index.native.js +60 -0
  916. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -0
  917. package/build-module/components/block-icon/index.js +7 -11
  918. package/build-module/components/block-icon/index.js.map +1 -1
  919. package/build-module/components/block-icon/index.native.js +15 -19
  920. package/build-module/components/block-icon/index.native.js.map +1 -1
  921. package/build-module/components/block-info-slot-fill/index.js +4 -2
  922. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  923. package/build-module/components/block-inspector/index.js +45 -123
  924. package/build-module/components/block-inspector/index.js.map +1 -1
  925. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js +2 -2
  926. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
  927. package/build-module/components/block-list/block-html.js +3 -4
  928. package/build-module/components/block-list/block-html.js.map +1 -1
  929. package/build-module/components/block-list/block-invalid-warning.js +3 -4
  930. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  931. package/build-module/components/block-list/block-invalid-warning.native.js +10 -15
  932. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  933. package/build-module/components/block-list/block-list-context.native.js +5 -11
  934. package/build-module/components/block-list/block-list-context.native.js.map +1 -1
  935. package/build-module/components/block-list/block-list-item-cell.native.js +5 -6
  936. package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
  937. package/build-module/components/block-list/block-list-item.native.js +21 -20
  938. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  939. package/build-module/components/block-list/block-outline.native.js +8 -9
  940. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  941. package/build-module/components/block-list/block-selection-button.native.js +10 -12
  942. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  943. package/build-module/components/block-list/block.js +45 -50
  944. package/build-module/components/block-list/block.js.map +1 -1
  945. package/build-module/components/block-list/block.native.js +56 -68
  946. package/build-module/components/block-list/block.native.js.map +1 -1
  947. package/build-module/components/block-list/index.js +18 -18
  948. package/build-module/components/block-list/index.js.map +1 -1
  949. package/build-module/components/block-list/index.native.js +80 -89
  950. package/build-module/components/block-list/index.native.js.map +1 -1
  951. package/build-module/components/block-list/insertion-point.native.js +4 -5
  952. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  953. package/build-module/components/block-list/layout.js +6 -9
  954. package/build-module/components/block-list/layout.js.map +1 -1
  955. package/build-module/components/block-list/subdirectory-icon.js +11 -14
  956. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  957. package/build-module/components/block-list/use-block-props/index.js +14 -11
  958. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  959. package/build-module/components/block-list/use-block-props/index.native.js +1 -2
  960. package/build-module/components/block-list/use-block-props/index.native.js.map +1 -1
  961. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +2 -2
  962. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
  963. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +1 -1
  964. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
  965. package/build-module/components/block-list/use-in-between-inserter.js +2 -6
  966. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  967. package/build-module/components/block-list-appender/index.js +35 -33
  968. package/build-module/components/block-list-appender/index.js.map +1 -1
  969. package/build-module/components/block-list-appender/index.native.js +9 -11
  970. package/build-module/components/block-list-appender/index.native.js.map +1 -1
  971. package/build-module/components/block-lock/menu-item.js +3 -4
  972. package/build-module/components/block-lock/menu-item.js.map +1 -1
  973. package/build-module/components/block-lock/modal.js +6 -9
  974. package/build-module/components/block-lock/modal.js.map +1 -1
  975. package/build-module/components/block-lock/toolbar.js +5 -10
  976. package/build-module/components/block-lock/toolbar.js.map +1 -1
  977. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +50 -68
  978. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  979. package/build-module/components/block-mobile-toolbar/index.native.js +26 -34
  980. package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
  981. package/build-module/components/block-mover/button.js +18 -18
  982. package/build-module/components/block-mover/button.js.map +1 -1
  983. package/build-module/components/block-mover/index.js +16 -17
  984. package/build-module/components/block-mover/index.js.map +1 -1
  985. package/build-module/components/block-mover/index.native.js +23 -46
  986. package/build-module/components/block-mover/index.native.js.map +1 -1
  987. package/build-module/components/block-mover/mover-description.native.js +7 -10
  988. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  989. package/build-module/components/block-navigation/dropdown.js +22 -28
  990. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  991. package/build-module/components/block-parent-selector/index.js +6 -6
  992. package/build-module/components/block-parent-selector/index.js.map +1 -1
  993. package/build-module/components/block-pattern-setup/index.js +33 -38
  994. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  995. package/build-module/components/block-pattern-setup/setup-toolbar.js +35 -42
  996. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  997. package/build-module/components/block-patterns-list/index.js +73 -81
  998. package/build-module/components/block-patterns-list/index.js.map +1 -1
  999. package/build-module/components/block-popover/drop-zone.js +4 -5
  1000. package/build-module/components/block-popover/drop-zone.js.map +1 -1
  1001. package/build-module/components/block-popover/inbetween.js +14 -20
  1002. package/build-module/components/block-popover/inbetween.js.map +1 -1
  1003. package/build-module/components/block-popover/index.js +18 -20
  1004. package/build-module/components/block-popover/index.js.map +1 -1
  1005. package/build-module/components/block-preview/auto.js +8 -11
  1006. package/build-module/components/block-preview/auto.js.map +1 -1
  1007. package/build-module/components/block-preview/index.js +21 -24
  1008. package/build-module/components/block-preview/index.js.map +1 -1
  1009. package/build-module/components/block-quick-navigation/index.js +69 -0
  1010. package/build-module/components/block-quick-navigation/index.js.map +1 -0
  1011. package/build-module/components/block-removal-warning-modal/index.js +76 -0
  1012. package/build-module/components/block-removal-warning-modal/index.js.map +1 -0
  1013. package/build-module/components/block-selection-clearer/index.js +4 -4
  1014. package/build-module/components/block-selection-clearer/index.js.map +1 -1
  1015. package/build-module/components/block-settings/button.native.js +9 -11
  1016. package/build-module/components/block-settings/button.native.js.map +1 -1
  1017. package/build-module/components/block-settings/container.native.js +6 -5
  1018. package/build-module/components/block-settings/container.native.js.map +1 -1
  1019. package/build-module/components/block-settings-menu/block-convert-button.js +5 -7
  1020. package/build-module/components/block-settings-menu/block-convert-button.js.map +1 -1
  1021. package/build-module/components/block-settings-menu/block-html-convert-button.js +10 -14
  1022. package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  1023. package/build-module/components/block-settings-menu/block-mode-toggle.js +19 -25
  1024. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  1025. package/build-module/components/block-settings-menu/block-settings-dropdown.js +139 -117
  1026. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  1027. package/build-module/components/block-settings-menu/index.js +8 -9
  1028. package/build-module/components/block-settings-menu/index.js.map +1 -1
  1029. package/build-module/components/block-settings-menu-controls/index.js +18 -20
  1030. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  1031. package/build-module/components/block-styles/index.js +6 -7
  1032. package/build-module/components/block-styles/index.js.map +1 -1
  1033. package/build-module/components/block-styles/index.native.js +5 -7
  1034. package/build-module/components/block-styles/index.native.js.map +1 -1
  1035. package/build-module/components/block-styles/menu-items.js +4 -5
  1036. package/build-module/components/block-styles/menu-items.js.map +1 -1
  1037. package/build-module/components/block-styles/preview-panel.js +7 -10
  1038. package/build-module/components/block-styles/preview-panel.js.map +1 -1
  1039. package/build-module/components/block-styles/preview.native.js +6 -7
  1040. package/build-module/components/block-styles/preview.native.js.map +1 -1
  1041. package/build-module/components/block-styles/use-styles-for-block.js +7 -9
  1042. package/build-module/components/block-styles/use-styles-for-block.js.map +1 -1
  1043. package/build-module/components/block-styles/utils.js +4 -7
  1044. package/build-module/components/block-styles/utils.js.map +1 -1
  1045. package/build-module/components/block-switcher/block-styles-menu.js +4 -5
  1046. package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
  1047. package/build-module/components/block-switcher/block-transformations-menu.js +24 -29
  1048. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  1049. package/build-module/components/block-switcher/block-transformations-menu.native.js +9 -10
  1050. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  1051. package/build-module/components/block-switcher/block-variation-transformations.js +21 -30
  1052. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  1053. package/build-module/components/block-switcher/index.js +48 -62
  1054. package/build-module/components/block-switcher/index.js.map +1 -1
  1055. package/build-module/components/block-switcher/pattern-transformations-menu.js +24 -29
  1056. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  1057. package/build-module/components/block-switcher/preview-block-popover.js +3 -4
  1058. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  1059. package/build-module/components/block-switcher/utils.js +2 -3
  1060. package/build-module/components/block-switcher/utils.js.map +1 -1
  1061. package/build-module/components/block-title/index.js +5 -6
  1062. package/build-module/components/block-title/index.js.map +1 -1
  1063. package/build-module/components/block-title/use-block-display-title.js +5 -6
  1064. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  1065. package/build-module/components/block-toolbar/index.js +8 -9
  1066. package/build-module/components/block-toolbar/index.js.map +1 -1
  1067. package/build-module/components/block-toolbar/utils.js +14 -16
  1068. package/build-module/components/block-toolbar/utils.js.map +1 -1
  1069. package/build-module/components/block-tools/back-compat.js +3 -4
  1070. package/build-module/components/block-tools/back-compat.js.map +1 -1
  1071. package/build-module/components/block-tools/block-contextual-toolbar.js +9 -10
  1072. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  1073. package/build-module/components/block-tools/block-selection-button.js +10 -13
  1074. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  1075. package/build-module/components/block-tools/index.js +19 -12
  1076. package/build-module/components/block-tools/index.js.map +1 -1
  1077. package/build-module/components/block-tools/insertion-point.js +12 -14
  1078. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  1079. package/build-module/components/block-tools/selected-block-popover.js +27 -27
  1080. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  1081. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +9 -14
  1082. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  1083. package/build-module/components/block-tools/zoom-out-mode-inserters.js +3 -4
  1084. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  1085. package/build-module/components/block-types-list/index.js +8 -9
  1086. package/build-module/components/block-types-list/index.js.map +1 -1
  1087. package/build-module/components/block-types-list/index.native.js +26 -32
  1088. package/build-module/components/block-types-list/index.native.js.map +1 -1
  1089. package/build-module/components/block-variation-picker/index.js +8 -9
  1090. package/build-module/components/block-variation-picker/index.js.map +1 -1
  1091. package/build-module/components/block-variation-picker/index.native.js +7 -9
  1092. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  1093. package/build-module/components/block-variation-transforms/index.js +30 -41
  1094. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  1095. package/build-module/components/block-vertical-alignment-control/index.js +4 -5
  1096. package/build-module/components/block-vertical-alignment-control/index.js.map +1 -1
  1097. package/build-module/components/block-vertical-alignment-control/ui.js +12 -18
  1098. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  1099. package/build-module/components/border-radius-control/all-input-control.js +9 -11
  1100. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  1101. package/build-module/components/border-radius-control/index.js +9 -10
  1102. package/build-module/components/border-radius-control/index.js.map +1 -1
  1103. package/build-module/components/border-radius-control/input-controls.js +10 -14
  1104. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  1105. package/build-module/components/border-radius-control/linked-button.js +6 -8
  1106. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  1107. package/build-module/components/border-radius-control/utils.js +3 -7
  1108. package/build-module/components/border-radius-control/utils.js.map +1 -1
  1109. package/build-module/components/button-block-appender/index.js +13 -15
  1110. package/build-module/components/button-block-appender/index.js.map +1 -1
  1111. package/build-module/components/button-block-appender/index.native.js +25 -29
  1112. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  1113. package/build-module/components/caption/index.native.js +40 -43
  1114. package/build-module/components/caption/index.native.js.map +1 -1
  1115. package/build-module/components/child-layout-control/index.js +5 -6
  1116. package/build-module/components/child-layout-control/index.js.map +1 -1
  1117. package/build-module/components/color-palette/control.js +7 -9
  1118. package/build-module/components/color-palette/control.js.map +1 -1
  1119. package/build-module/components/color-palette/with-color-context.js +3 -9
  1120. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  1121. package/build-module/components/color-style-selector/index.js +28 -35
  1122. package/build-module/components/color-style-selector/index.js.map +1 -1
  1123. package/build-module/components/colors/utils.js +10 -9
  1124. package/build-module/components/colors/utils.js.map +1 -1
  1125. package/build-module/components/colors/with-colors.js +19 -38
  1126. package/build-module/components/colors/with-colors.js.map +1 -1
  1127. package/build-module/components/colors-gradients/control.js +26 -25
  1128. package/build-module/components/colors-gradients/control.js.map +1 -1
  1129. package/build-module/components/colors-gradients/dropdown.js +44 -49
  1130. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  1131. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +27 -28
  1132. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  1133. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +27 -31
  1134. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  1135. package/build-module/components/contrast-checker/index.js +12 -13
  1136. package/build-module/components/contrast-checker/index.js.map +1 -1
  1137. package/build-module/components/contrast-checker/index.native.js +16 -18
  1138. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  1139. package/build-module/components/convert-to-group-buttons/index.js +9 -10
  1140. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  1141. package/build-module/components/convert-to-group-buttons/index.native.js +6 -7
  1142. package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
  1143. package/build-module/components/convert-to-group-buttons/toolbar.js +6 -12
  1144. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  1145. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +4 -6
  1146. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  1147. package/build-module/components/copy-handler/index.js +9 -13
  1148. package/build-module/components/copy-handler/index.js.map +1 -1
  1149. package/build-module/components/date-format-picker/index.js +12 -16
  1150. package/build-module/components/date-format-picker/index.js.map +1 -1
  1151. package/build-module/components/default-block-appender/index.js +7 -9
  1152. package/build-module/components/default-block-appender/index.js.map +1 -1
  1153. package/build-module/components/default-block-appender/index.native.js +8 -10
  1154. package/build-module/components/default-block-appender/index.native.js.map +1 -1
  1155. package/build-module/components/default-style-picker/index.js +14 -22
  1156. package/build-module/components/default-style-picker/index.js.map +1 -1
  1157. package/build-module/components/duotone/components.js +14 -18
  1158. package/build-module/components/duotone/components.js.map +1 -1
  1159. package/build-module/components/duotone/utils.js +1 -2
  1160. package/build-module/components/duotone/utils.js.map +1 -1
  1161. package/build-module/components/duotone-control/index.js +13 -17
  1162. package/build-module/components/duotone-control/index.js.map +1 -1
  1163. package/build-module/components/editable-text/index.js +11 -12
  1164. package/build-module/components/editable-text/index.js.map +1 -1
  1165. package/build-module/components/editor-styles/index.js +4 -5
  1166. package/build-module/components/editor-styles/index.js.map +1 -1
  1167. package/build-module/components/floating-toolbar/index.native.js +7 -8
  1168. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  1169. package/build-module/components/font-appearance-control/index.js +21 -29
  1170. package/build-module/components/font-appearance-control/index.js.map +1 -1
  1171. package/build-module/components/font-family/index.js +14 -16
  1172. package/build-module/components/font-family/index.js.map +1 -1
  1173. package/build-module/components/font-sizes/fluid-utils.js +17 -21
  1174. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  1175. package/build-module/components/font-sizes/font-size-picker.js +2 -3
  1176. package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
  1177. package/build-module/components/font-sizes/utils.js +8 -14
  1178. package/build-module/components/font-sizes/utils.js.map +1 -1
  1179. package/build-module/components/font-sizes/with-font-sizes.js +18 -36
  1180. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  1181. package/build-module/components/global-styles/advanced-panel.js +7 -10
  1182. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  1183. package/build-module/components/global-styles/border-panel.js +45 -78
  1184. package/build-module/components/global-styles/border-panel.js.map +1 -1
  1185. package/build-module/components/global-styles/color-panel.js +119 -162
  1186. package/build-module/components/global-styles/color-panel.js.map +1 -1
  1187. package/build-module/components/global-styles/color-panel.native.js +25 -42
  1188. package/build-module/components/global-styles/color-panel.native.js.map +1 -1
  1189. package/build-module/components/global-styles/dimensions-panel.js +78 -109
  1190. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  1191. package/build-module/components/global-styles/effects-panel.js +60 -73
  1192. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  1193. package/build-module/components/global-styles/filters-panel.js +55 -72
  1194. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  1195. package/build-module/components/global-styles/get-block-css-selector.js +5 -8
  1196. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  1197. package/build-module/components/global-styles/hooks.js +22 -37
  1198. package/build-module/components/global-styles/hooks.js.map +1 -1
  1199. package/build-module/components/global-styles/index.js +1 -1
  1200. package/build-module/components/global-styles/index.js.map +1 -1
  1201. package/build-module/components/global-styles/typography-panel.js +69 -125
  1202. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  1203. package/build-module/components/global-styles/typography-utils.js +48 -26
  1204. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  1205. package/build-module/components/global-styles/use-global-styles-output.js +146 -240
  1206. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  1207. package/build-module/components/global-styles/utils.js +12 -28
  1208. package/build-module/components/global-styles/utils.js.map +1 -1
  1209. package/build-module/components/gradients/use-gradient.js +6 -7
  1210. package/build-module/components/gradients/use-gradient.js.map +1 -1
  1211. package/build-module/components/gradients/with-gradient.js +2 -3
  1212. package/build-module/components/gradients/with-gradient.js.map +1 -1
  1213. package/build-module/components/height-control/index.js +9 -10
  1214. package/build-module/components/height-control/index.js.map +1 -1
  1215. package/build-module/components/iframe/index.js +54 -90
  1216. package/build-module/components/iframe/index.js.map +1 -1
  1217. package/build-module/components/iframe/use-compatibility-styles.js +29 -20
  1218. package/build-module/components/iframe/use-compatibility-styles.js.map +1 -1
  1219. package/build-module/components/image-editor/aspect-ratio-dropdown.js +83 -91
  1220. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  1221. package/build-module/components/image-editor/constants.js +1 -2
  1222. package/build-module/components/image-editor/constants.js.map +1 -1
  1223. package/build-module/components/image-editor/context.js +9 -10
  1224. package/build-module/components/image-editor/context.js.map +1 -1
  1225. package/build-module/components/image-editor/cropper.js +11 -12
  1226. package/build-module/components/image-editor/cropper.js.map +1 -1
  1227. package/build-module/components/image-editor/index.js +12 -13
  1228. package/build-module/components/image-editor/index.js.map +1 -1
  1229. package/build-module/components/image-editor/use-save-image.js +11 -12
  1230. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  1231. package/build-module/components/image-editor/use-transform-image.js +5 -6
  1232. package/build-module/components/image-editor/use-transform-image.js.map +1 -1
  1233. package/build-module/components/image-editor/zoom-dropdown.js +10 -13
  1234. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
  1235. package/build-module/components/image-size-control/index.js +12 -13
  1236. package/build-module/components/image-size-control/index.js.map +1 -1
  1237. package/build-module/components/index.js +1 -1
  1238. package/build-module/components/index.js.map +1 -1
  1239. package/build-module/components/index.native.js +1 -0
  1240. package/build-module/components/index.native.js.map +1 -1
  1241. package/build-module/components/inner-blocks/button-block-appender.js +7 -8
  1242. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  1243. package/build-module/components/inner-blocks/default-block-appender.js +6 -8
  1244. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  1245. package/build-module/components/inner-blocks/index.js +11 -13
  1246. package/build-module/components/inner-blocks/index.js.map +1 -1
  1247. package/build-module/components/inner-blocks/index.native.js +9 -9
  1248. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  1249. package/build-module/components/inner-blocks/use-block-context.js +1 -4
  1250. package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
  1251. package/build-module/components/inner-blocks/use-nested-settings-update.js +24 -29
  1252. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  1253. package/build-module/components/inner-blocks/with-client-id.js +2 -3
  1254. package/build-module/components/inner-blocks/with-client-id.js.map +1 -1
  1255. package/build-module/components/inserter/block-patterns-explorer/explorer.js +11 -12
  1256. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  1257. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +11 -18
  1258. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  1259. package/build-module/components/inserter/block-patterns-explorer/sidebar.js +20 -24
  1260. package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  1261. package/build-module/components/inserter/block-patterns-tab.js +62 -47
  1262. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  1263. package/build-module/components/inserter/block-types-tab.js +7 -9
  1264. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  1265. package/build-module/components/inserter/block-types-tab.native.js +8 -9
  1266. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  1267. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +3 -5
  1268. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  1269. package/build-module/components/inserter/hooks/use-block-types-state.js +9 -9
  1270. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  1271. package/build-module/components/inserter/hooks/use-clipboard-block.native.js +2 -2
  1272. package/build-module/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  1273. package/build-module/components/inserter/hooks/use-debounced-input.js +1 -2
  1274. package/build-module/components/inserter/hooks/use-debounced-input.js.map +1 -1
  1275. package/build-module/components/inserter/hooks/use-insertion-point.js +11 -13
  1276. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  1277. package/build-module/components/inserter/index.js +45 -58
  1278. package/build-module/components/inserter/index.js.map +1 -1
  1279. package/build-module/components/inserter/index.native.js +28 -35
  1280. package/build-module/components/inserter/index.native.js.map +1 -1
  1281. package/build-module/components/inserter/library.js +12 -13
  1282. package/build-module/components/inserter/library.js.map +1 -1
  1283. package/build-module/components/inserter/media-tab/hooks.js +2 -5
  1284. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  1285. package/build-module/components/inserter/media-tab/media-list.js +8 -10
  1286. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  1287. package/build-module/components/inserter/media-tab/media-panel.js +12 -14
  1288. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  1289. package/build-module/components/inserter/media-tab/media-preview.js +47 -59
  1290. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  1291. package/build-module/components/inserter/media-tab/media-tab.js +27 -31
  1292. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  1293. package/build-module/components/inserter/media-tab/utils.js +3 -5
  1294. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  1295. package/build-module/components/inserter/menu.js +15 -19
  1296. package/build-module/components/inserter/menu.js.map +1 -1
  1297. package/build-module/components/inserter/menu.native.js +27 -31
  1298. package/build-module/components/inserter/menu.native.js.map +1 -1
  1299. package/build-module/components/inserter/mobile-tab-navigation.js +7 -9
  1300. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  1301. package/build-module/components/inserter/panel.js +5 -6
  1302. package/build-module/components/inserter/panel.js.map +1 -1
  1303. package/build-module/components/inserter/preview-panel.js +4 -5
  1304. package/build-module/components/inserter/preview-panel.js.map +1 -1
  1305. package/build-module/components/inserter/quick-inserter.js +8 -9
  1306. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  1307. package/build-module/components/inserter/reusable-blocks-tab.js +16 -21
  1308. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  1309. package/build-module/components/inserter/reusable-blocks-tab.native.js +5 -6
  1310. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  1311. package/build-module/components/inserter/search-items.js +12 -40
  1312. package/build-module/components/inserter/search-items.js.map +1 -1
  1313. package/build-module/components/inserter/search-results.js +17 -18
  1314. package/build-module/components/inserter/search-results.js.map +1 -1
  1315. package/build-module/components/inserter/search-results.native.js +11 -12
  1316. package/build-module/components/inserter/search-results.native.js.map +1 -1
  1317. package/build-module/components/inserter/tabs.js +11 -12
  1318. package/build-module/components/inserter/tabs.js.map +1 -1
  1319. package/build-module/components/inserter/tabs.native.js +37 -55
  1320. package/build-module/components/inserter/tabs.native.js.map +1 -1
  1321. package/build-module/components/inserter/utils.native.js +13 -17
  1322. package/build-module/components/inserter/utils.native.js.map +1 -1
  1323. package/build-module/components/inserter-draggable-blocks/index.js +11 -13
  1324. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  1325. package/build-module/components/inserter-list-item/index.js +66 -70
  1326. package/build-module/components/inserter-list-item/index.js.map +1 -1
  1327. package/build-module/components/inserter-listbox/group.js +4 -4
  1328. package/build-module/components/inserter-listbox/group.js.map +1 -1
  1329. package/build-module/components/inserter-listbox/index.js +3 -4
  1330. package/build-module/components/inserter-listbox/index.js.map +1 -1
  1331. package/build-module/components/inserter-listbox/item.js +14 -13
  1332. package/build-module/components/inserter-listbox/item.js.map +1 -1
  1333. package/build-module/components/inserter-listbox/row.js +4 -4
  1334. package/build-module/components/inserter-listbox/row.js.map +1 -1
  1335. package/build-module/components/inspector-controls/block-support-slot-container.js +6 -8
  1336. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  1337. package/build-module/components/inspector-controls/block-support-tools-panel.js +6 -8
  1338. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  1339. package/build-module/components/inspector-controls/fill.js +13 -23
  1340. package/build-module/components/inspector-controls/fill.js.map +1 -1
  1341. package/build-module/components/inspector-controls/fill.native.js +9 -12
  1342. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  1343. package/build-module/components/inspector-controls/index.js +4 -5
  1344. package/build-module/components/inspector-controls/index.js.map +1 -1
  1345. package/build-module/components/inspector-controls/slot.js +13 -18
  1346. package/build-module/components/inspector-controls/slot.js.map +1 -1
  1347. package/build-module/components/inspector-controls/slot.native.js +8 -11
  1348. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  1349. package/build-module/components/inspector-controls-tabs/index.js +6 -7
  1350. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  1351. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +3 -8
  1352. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  1353. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +1 -1
  1354. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  1355. package/build-module/components/inspector-controls-tabs/settings-tab.js +3 -6
  1356. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  1357. package/build-module/components/inspector-controls-tabs/styles-tab.js +5 -6
  1358. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  1359. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -3
  1360. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  1361. package/build-module/components/inspector-popover-header/index.js +18 -22
  1362. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  1363. package/build-module/components/justify-content-control/index.js +4 -5
  1364. package/build-module/components/justify-content-control/index.js.map +1 -1
  1365. package/build-module/components/justify-content-control/ui.js +12 -14
  1366. package/build-module/components/justify-content-control/ui.js.map +1 -1
  1367. package/build-module/components/letter-spacing-control/index.js +8 -10
  1368. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  1369. package/build-module/components/line-height-control/index.js +14 -20
  1370. package/build-module/components/line-height-control/index.js.map +1 -1
  1371. package/build-module/components/line-height-control/index.native.js +4 -5
  1372. package/build-module/components/line-height-control/index.native.js.map +1 -1
  1373. package/build-module/components/link-control/index.js +85 -72
  1374. package/build-module/components/link-control/index.js.map +1 -1
  1375. package/build-module/components/link-control/is-url-like.js +32 -3
  1376. package/build-module/components/link-control/is-url-like.js.map +1 -1
  1377. package/build-module/components/link-control/link-preview.js +24 -27
  1378. package/build-module/components/link-control/link-preview.js.map +1 -1
  1379. package/build-module/components/link-control/search-create-button.js +9 -12
  1380. package/build-module/components/link-control/search-create-button.js.map +1 -1
  1381. package/build-module/components/link-control/search-input.js +24 -27
  1382. package/build-module/components/link-control/search-input.js.map +1 -1
  1383. package/build-module/components/link-control/search-item.js +15 -18
  1384. package/build-module/components/link-control/search-item.js.map +1 -1
  1385. package/build-module/components/link-control/search-results.js +23 -30
  1386. package/build-module/components/link-control/search-results.js.map +1 -1
  1387. package/build-module/components/link-control/settings-drawer.js +7 -33
  1388. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  1389. package/build-module/components/link-control/settings.js +7 -9
  1390. package/build-module/components/link-control/settings.js.map +1 -1
  1391. package/build-module/components/link-control/use-internal-value.js +46 -0
  1392. package/build-module/components/link-control/use-internal-value.js.map +1 -0
  1393. package/build-module/components/link-control/use-rich-url-data.js +1 -1
  1394. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  1395. package/build-module/components/link-control/use-search-handler.js +10 -23
  1396. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  1397. package/build-module/components/list-view/appender.js +14 -16
  1398. package/build-module/components/list-view/appender.js.map +1 -1
  1399. package/build-module/components/list-view/aria-referenced-text.js +34 -0
  1400. package/build-module/components/list-view/aria-referenced-text.js.map +1 -0
  1401. package/build-module/components/list-view/block-contents.js +39 -39
  1402. package/build-module/components/list-view/block-contents.js.map +1 -1
  1403. package/build-module/components/list-view/block-select-button.js +78 -25
  1404. package/build-module/components/list-view/block-select-button.js.map +1 -1
  1405. package/build-module/components/list-view/block.js +117 -101
  1406. package/build-module/components/list-view/block.js.map +1 -1
  1407. package/build-module/components/list-view/branch.js +14 -12
  1408. package/build-module/components/list-view/branch.js.map +1 -1
  1409. package/build-module/components/list-view/drop-indicator.js +65 -16
  1410. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  1411. package/build-module/components/list-view/expander.js +3 -4
  1412. package/build-module/components/list-view/expander.js.map +1 -1
  1413. package/build-module/components/list-view/index.js +50 -48
  1414. package/build-module/components/list-view/index.js.map +1 -1
  1415. package/build-module/components/list-view/leaf.js +14 -15
  1416. package/build-module/components/list-view/leaf.js.map +1 -1
  1417. package/build-module/components/list-view/use-block-selection.js +4 -6
  1418. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  1419. package/build-module/components/list-view/use-list-view-client-ids.js +6 -29
  1420. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  1421. package/build-module/components/list-view/use-list-view-drop-zone.js +62 -39
  1422. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  1423. package/build-module/components/list-view/use-list-view-expand-selected-item.js +4 -5
  1424. package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  1425. package/build-module/components/list-view/use-list-view-scroll-into-view.js +5 -6
  1426. package/build-module/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  1427. package/build-module/components/media-placeholder/index.js +106 -102
  1428. package/build-module/components/media-placeholder/index.js.map +1 -1
  1429. package/build-module/components/media-placeholder/index.native.js +5 -6
  1430. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  1431. package/build-module/components/media-replace-flow/index.js +92 -107
  1432. package/build-module/components/media-replace-flow/index.js.map +1 -1
  1433. package/build-module/components/media-upload/check.js +4 -5
  1434. package/build-module/components/media-upload/check.js.map +1 -1
  1435. package/build-module/components/media-upload/index.native.js +1 -1
  1436. package/build-module/components/media-upload/index.native.js.map +1 -1
  1437. package/build-module/components/multi-selection-inspector/index.js +3 -4
  1438. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  1439. package/build-module/components/navigable-toolbar/index.js +24 -22
  1440. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  1441. package/build-module/components/observe-typing/index.js +3 -4
  1442. package/build-module/components/observe-typing/index.js.map +1 -1
  1443. package/build-module/components/panel-color-settings/index.js +8 -9
  1444. package/build-module/components/panel-color-settings/index.js.map +1 -1
  1445. package/build-module/components/plain-text/index.js +12 -13
  1446. package/build-module/components/plain-text/index.js.map +1 -1
  1447. package/build-module/components/plain-text/index.native.js +15 -19
  1448. package/build-module/components/plain-text/index.native.js.map +1 -1
  1449. package/build-module/components/preview-options/index.js +12 -12
  1450. package/build-module/components/preview-options/index.js.map +1 -1
  1451. package/build-module/components/provider/block-refs-provider.js +3 -4
  1452. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  1453. package/build-module/components/provider/index.js +2 -3
  1454. package/build-module/components/provider/index.js.map +1 -1
  1455. package/build-module/components/provider/use-block-sync.js +7 -8
  1456. package/build-module/components/provider/use-block-sync.js.map +1 -1
  1457. package/build-module/components/provider/with-registry-provider.js +13 -14
  1458. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  1459. package/build-module/components/publish-date-time-picker/index.js +10 -11
  1460. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  1461. package/build-module/components/recursion-provider/index.js +7 -11
  1462. package/build-module/components/recursion-provider/index.js.map +1 -1
  1463. package/build-module/components/resizable-box-popover/index.js +10 -10
  1464. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  1465. package/build-module/components/responsive-block-control/label.js +5 -6
  1466. package/build-module/components/responsive-block-control/label.js.map +1 -1
  1467. package/build-module/components/rich-text/content.js +85 -0
  1468. package/build-module/components/rich-text/content.js.map +1 -0
  1469. package/build-module/components/rich-text/embed-handler-picker.native.js +6 -10
  1470. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  1471. package/build-module/components/rich-text/format-edit.js +7 -8
  1472. package/build-module/components/rich-text/format-edit.js.map +1 -1
  1473. package/build-module/components/rich-text/format-toolbar/index.js +10 -20
  1474. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  1475. package/build-module/components/rich-text/format-toolbar-container.js +13 -16
  1476. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  1477. package/build-module/components/rich-text/index.js +45 -83
  1478. package/build-module/components/rich-text/index.js.map +1 -1
  1479. package/build-module/components/rich-text/index.native.js +128 -183
  1480. package/build-module/components/rich-text/index.native.js.map +1 -1
  1481. package/build-module/components/rich-text/input-event.js +4 -5
  1482. package/build-module/components/rich-text/input-event.js.map +1 -1
  1483. package/build-module/components/rich-text/shortcut.js +5 -6
  1484. package/build-module/components/rich-text/shortcut.js.map +1 -1
  1485. package/build-module/components/rich-text/split-value.js +8 -10
  1486. package/build-module/components/rich-text/split-value.js.map +1 -1
  1487. package/build-module/components/rich-text/toolbar-button.js +8 -10
  1488. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  1489. package/build-module/components/rich-text/use-before-input-rules.js +1 -4
  1490. package/build-module/components/rich-text/use-before-input-rules.js.map +1 -1
  1491. package/build-module/components/rich-text/use-enter.js +3 -6
  1492. package/build-module/components/rich-text/use-enter.js.map +1 -1
  1493. package/build-module/components/rich-text/use-firefox-compat.js +29 -1
  1494. package/build-module/components/rich-text/use-firefox-compat.js.map +1 -1
  1495. package/build-module/components/rich-text/use-format-types.js +11 -17
  1496. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  1497. package/build-module/components/rich-text/use-input-rules.js +9 -15
  1498. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  1499. package/build-module/components/rich-text/use-mark-persistent.js +4 -5
  1500. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  1501. package/build-module/components/rich-text/use-paste-handler.js +5 -7
  1502. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  1503. package/build-module/components/rich-text/utils.js +5 -7
  1504. package/build-module/components/rich-text/utils.js.map +1 -1
  1505. package/build-module/components/skip-to-selected-block/index.js +3 -4
  1506. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  1507. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +27 -0
  1508. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -0
  1509. package/build-module/components/spacing-sizes-control/index.js +64 -64
  1510. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  1511. package/build-module/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +21 -22
  1512. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -0
  1513. package/build-module/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +21 -21
  1514. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -0
  1515. package/build-module/components/spacing-sizes-control/input-controls/single.js +40 -0
  1516. package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -0
  1517. package/build-module/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +53 -70
  1518. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -0
  1519. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +73 -0
  1520. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -0
  1521. package/build-module/components/spacing-sizes-control/utils.js +196 -25
  1522. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  1523. package/build-module/components/text-decoration-control/index.js +5 -6
  1524. package/build-module/components/text-decoration-control/index.js.map +1 -1
  1525. package/build-module/components/text-transform-control/index.js +5 -6
  1526. package/build-module/components/text-transform-control/index.js.map +1 -1
  1527. package/build-module/components/tool-selector/index.js +13 -17
  1528. package/build-module/components/tool-selector/index.js.map +1 -1
  1529. package/build-module/components/typewriter/index.js +6 -9
  1530. package/build-module/components/typewriter/index.js.map +1 -1
  1531. package/build-module/components/ungroup-button/index.native.js +11 -14
  1532. package/build-module/components/ungroup-button/index.native.js.map +1 -1
  1533. package/build-module/components/unit-control/index.js +8 -9
  1534. package/build-module/components/unit-control/index.js.map +1 -1
  1535. package/build-module/components/url-input/index.js +23 -33
  1536. package/build-module/components/url-input/index.js.map +1 -1
  1537. package/build-module/components/url-input/index.native.js +10 -12
  1538. package/build-module/components/url-input/index.native.js.map +1 -1
  1539. package/build-module/components/url-popover/image-url-input-ui.js +34 -30
  1540. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  1541. package/build-module/components/url-popover/index.js +16 -18
  1542. package/build-module/components/url-popover/index.js.map +1 -1
  1543. package/build-module/components/url-popover/link-editor.js +10 -11
  1544. package/build-module/components/url-popover/link-editor.js.map +1 -1
  1545. package/build-module/components/url-popover/link-viewer-url.js +5 -6
  1546. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  1547. package/build-module/components/url-popover/link-viewer.js +11 -12
  1548. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  1549. package/build-module/components/use-block-display-information/index.js +29 -2
  1550. package/build-module/components/use-block-display-information/index.js.map +1 -1
  1551. package/build-module/components/use-block-drop-zone/index.js +16 -23
  1552. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  1553. package/build-module/components/use-block-drop-zone/index.native.js +8 -11
  1554. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  1555. package/build-module/components/use-moving-animation/index.js +9 -12
  1556. package/build-module/components/use-moving-animation/index.js.map +1 -1
  1557. package/build-module/components/use-on-block-drop/index.js +2 -6
  1558. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  1559. package/build-module/components/use-on-block-drop/index.native.js +8 -10
  1560. package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
  1561. package/build-module/components/use-paste-styles/index.js +2 -6
  1562. package/build-module/components/use-paste-styles/index.js.map +1 -1
  1563. package/build-module/components/video-player/index.native.js +2 -3
  1564. package/build-module/components/video-player/index.native.js.map +1 -1
  1565. package/build-module/components/warning/index.js +6 -7
  1566. package/build-module/components/warning/index.js.map +1 -1
  1567. package/build-module/components/warning/index.native.js +13 -14
  1568. package/build-module/components/warning/index.native.js.map +1 -1
  1569. package/build-module/components/writing-flow/index.js +6 -8
  1570. package/build-module/components/writing-flow/index.js.map +1 -1
  1571. package/build-module/components/writing-flow/use-drag-selection.js +5 -7
  1572. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  1573. package/build-module/components/writing-flow/use-tab-nav.js +41 -11
  1574. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  1575. package/build-module/hooks/align.js +15 -21
  1576. package/build-module/hooks/align.js.map +1 -1
  1577. package/build-module/hooks/anchor.js +8 -4
  1578. package/build-module/hooks/anchor.js.map +1 -1
  1579. package/build-module/hooks/aria-label.js +1 -3
  1580. package/build-module/hooks/aria-label.js.map +1 -1
  1581. package/build-module/hooks/behaviors.js +132 -58
  1582. package/build-module/hooks/behaviors.js.map +1 -1
  1583. package/build-module/hooks/border.js +29 -42
  1584. package/build-module/hooks/border.js.map +1 -1
  1585. package/build-module/hooks/color.js +26 -41
  1586. package/build-module/hooks/color.js.map +1 -1
  1587. package/build-module/hooks/content-lock-ui.js +30 -33
  1588. package/build-module/hooks/content-lock-ui.js.map +1 -1
  1589. package/build-module/hooks/contrast-checker.js +4 -7
  1590. package/build-module/hooks/contrast-checker.js.map +1 -1
  1591. package/build-module/hooks/custom-class-name.js +7 -5
  1592. package/build-module/hooks/custom-class-name.js.map +1 -1
  1593. package/build-module/hooks/dimensions.js +11 -13
  1594. package/build-module/hooks/dimensions.js.map +1 -1
  1595. package/build-module/hooks/duotone.js +37 -48
  1596. package/build-module/hooks/duotone.js.map +1 -1
  1597. package/build-module/hooks/font-family.js +6 -11
  1598. package/build-module/hooks/font-family.js.map +1 -1
  1599. package/build-module/hooks/font-size.js +22 -28
  1600. package/build-module/hooks/font-size.js.map +1 -1
  1601. package/build-module/hooks/gap.js +5 -6
  1602. package/build-module/hooks/gap.js.map +1 -1
  1603. package/build-module/hooks/layout.js +62 -77
  1604. package/build-module/hooks/layout.js.map +1 -1
  1605. package/build-module/hooks/line-height.js +5 -8
  1606. package/build-module/hooks/line-height.js.map +1 -1
  1607. package/build-module/hooks/lock.js +2 -2
  1608. package/build-module/hooks/lock.js.map +1 -1
  1609. package/build-module/hooks/margin.js +6 -9
  1610. package/build-module/hooks/margin.js.map +1 -1
  1611. package/build-module/hooks/metadata-name.js +4 -5
  1612. package/build-module/hooks/metadata-name.js.map +1 -1
  1613. package/build-module/hooks/metadata.js +3 -7
  1614. package/build-module/hooks/metadata.js.map +1 -1
  1615. package/build-module/hooks/padding.js +6 -9
  1616. package/build-module/hooks/padding.js.map +1 -1
  1617. package/build-module/hooks/position.js +49 -55
  1618. package/build-module/hooks/position.js.map +1 -1
  1619. package/build-module/hooks/settings.js +1 -3
  1620. package/build-module/hooks/settings.js.map +1 -1
  1621. package/build-module/hooks/style.js +18 -22
  1622. package/build-module/hooks/style.js.map +1 -1
  1623. package/build-module/hooks/supports.js +4 -6
  1624. package/build-module/hooks/supports.js.map +1 -1
  1625. package/build-module/hooks/typography.js +18 -27
  1626. package/build-module/hooks/typography.js.map +1 -1
  1627. package/build-module/hooks/typography.native.js +4 -3
  1628. package/build-module/hooks/typography.native.js.map +1 -1
  1629. package/build-module/hooks/use-border-props.js +1 -3
  1630. package/build-module/hooks/use-border-props.js.map +1 -1
  1631. package/build-module/hooks/use-color-props.js +6 -8
  1632. package/build-module/hooks/use-color-props.js.map +1 -1
  1633. package/build-module/hooks/use-editor-wrapper-styles.native.js +34 -39
  1634. package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  1635. package/build-module/hooks/use-spacing-props.js +1 -1
  1636. package/build-module/hooks/use-spacing-props.js.map +1 -1
  1637. package/build-module/hooks/use-typography-props.js +11 -22
  1638. package/build-module/hooks/use-typography-props.js.map +1 -1
  1639. package/build-module/hooks/utils.js +7 -19
  1640. package/build-module/hooks/utils.js.map +1 -1
  1641. package/build-module/index.js +1 -1
  1642. package/build-module/index.js.map +1 -1
  1643. package/build-module/layouts/constrained.js +23 -27
  1644. package/build-module/layouts/constrained.js.map +1 -1
  1645. package/build-module/layouts/definitions.js +147 -0
  1646. package/build-module/layouts/definitions.js.map +1 -0
  1647. package/build-module/layouts/flex.js +50 -59
  1648. package/build-module/layouts/flex.js.map +1 -1
  1649. package/build-module/layouts/flow.js +11 -13
  1650. package/build-module/layouts/flow.js.map +1 -1
  1651. package/build-module/layouts/grid.js +46 -25
  1652. package/build-module/layouts/grid.js.map +1 -1
  1653. package/build-module/layouts/index.js +1 -2
  1654. package/build-module/layouts/index.js.map +1 -1
  1655. package/build-module/layouts/utils.js +10 -11
  1656. package/build-module/layouts/utils.js.map +1 -1
  1657. package/build-module/private-apis.js +12 -1
  1658. package/build-module/private-apis.js.map +1 -1
  1659. package/build-module/store/actions.js +229 -372
  1660. package/build-module/store/actions.js.map +1 -1
  1661. package/build-module/store/array.js +1 -2
  1662. package/build-module/store/array.js.map +1 -1
  1663. package/build-module/store/private-actions.js +189 -7
  1664. package/build-module/store/private-actions.js.map +1 -1
  1665. package/build-module/store/private-selectors.js +100 -25
  1666. package/build-module/store/private-selectors.js.map +1 -1
  1667. package/build-module/store/reducer.js +118 -169
  1668. package/build-module/store/reducer.js.map +1 -1
  1669. package/build-module/store/selectors.js +160 -231
  1670. package/build-module/store/selectors.js.map +1 -1
  1671. package/build-module/utils/block-variation-transforms.js +4 -7
  1672. package/build-module/utils/block-variation-transforms.js.map +1 -1
  1673. package/build-module/utils/math.js +1 -2
  1674. package/build-module/utils/math.js.map +1 -1
  1675. package/build-module/utils/object.js +38 -5
  1676. package/build-module/utils/object.js.map +1 -1
  1677. package/build-module/utils/order-inserter-block-items.js +5 -7
  1678. package/build-module/utils/order-inserter-block-items.js.map +1 -1
  1679. package/build-module/utils/parse-css-unit-to-px.js +3 -6
  1680. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  1681. package/build-module/utils/pasting.js +5 -8
  1682. package/build-module/utils/pasting.js.map +1 -1
  1683. package/build-module/utils/pre-parse-patterns.js +1 -1
  1684. package/build-module/utils/pre-parse-patterns.js.map +1 -1
  1685. package/build-module/utils/sorting.js +1 -2
  1686. package/build-module/utils/sorting.js.map +1 -1
  1687. package/build-module/utils/transform-styles/index.js +5 -7
  1688. package/build-module/utils/transform-styles/index.js.map +1 -1
  1689. package/build-module/utils/transform-styles/transforms/wrap.js +25 -28
  1690. package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
  1691. package/build-style/content-rtl.css +7 -10
  1692. package/build-style/content.css +7 -10
  1693. package/build-style/style-rtl.css +51 -122
  1694. package/build-style/style.css +51 -122
  1695. package/package.json +31 -31
  1696. package/src/autocompleters/block.js +4 -2
  1697. package/src/components/alignment-control/ui.js +1 -2
  1698. package/src/components/block-actions/index.js +10 -0
  1699. package/src/components/block-alignment-control/constants.js +0 -4
  1700. package/src/components/block-alignment-control/ui.js +1 -6
  1701. package/src/components/block-alignment-matrix-control/index.js +1 -1
  1702. package/src/components/block-breadcrumb/index.js +2 -6
  1703. package/src/components/block-controls/fill.js +15 -17
  1704. package/src/components/block-controls/slot.js +21 -18
  1705. package/src/components/block-controls/slot.native.js +3 -8
  1706. package/src/components/block-draggable/index.js +2 -1
  1707. package/src/components/block-edit/index.js +3 -5
  1708. package/src/components/block-edit/test/edit.js +1 -1
  1709. package/src/components/block-heading-level-dropdown/README.md +52 -0
  1710. package/src/components/block-heading-level-dropdown/heading-level-icon.js +43 -0
  1711. package/src/components/block-heading-level-dropdown/index.js +77 -0
  1712. package/src/components/block-heading-level-dropdown/index.native.js +63 -0
  1713. package/src/components/block-inspector/index.js +19 -92
  1714. package/src/components/block-inspector/style.scss +0 -5
  1715. package/src/components/block-list/block.native.js +1 -0
  1716. package/src/components/block-list/content.scss +8 -12
  1717. package/src/components/block-list/index.js +1 -1
  1718. package/src/components/block-list/use-block-props/index.js +6 -1
  1719. package/src/components/block-list/use-in-between-inserter.js +0 -4
  1720. package/src/components/block-list-appender/index.js +32 -22
  1721. package/src/components/block-lock/style.scss +11 -4
  1722. package/src/components/block-lock/toolbar.js +2 -8
  1723. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  1724. package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +2 -2
  1725. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +3 -3
  1726. package/src/components/block-mover/test/index.native.js +1 -20
  1727. package/src/components/block-preview/index.js +7 -14
  1728. package/src/components/block-quick-navigation/index.js +81 -0
  1729. package/src/components/block-removal-warning-modal/index.js +94 -0
  1730. package/src/components/block-settings-menu/block-settings-dropdown.js +96 -54
  1731. package/src/components/block-switcher/index.js +1 -2
  1732. package/src/components/block-toolbar/style.scss +0 -4
  1733. package/src/components/block-tools/index.js +10 -1
  1734. package/src/components/block-tools/selected-block-popover.js +6 -0
  1735. package/src/components/block-vertical-alignment-control/ui.js +1 -3
  1736. package/src/components/color-palette/test/__snapshots__/control.js.snap +66 -50
  1737. package/src/components/color-palette/with-color-context.js +2 -6
  1738. package/src/components/colors/utils.js +5 -1
  1739. package/src/components/colors/with-colors.js +1 -5
  1740. package/src/components/colors-gradients/control.js +3 -3
  1741. package/src/components/colors-gradients/panel-color-gradient-settings.js +4 -5
  1742. package/src/components/copy-handler/index.js +5 -5
  1743. package/src/components/duotone-control/index.js +0 -1
  1744. package/src/components/font-sizes/test/fluid-utils.js +97 -76
  1745. package/src/components/font-sizes/utils.js +2 -2
  1746. package/src/components/global-styles/color-panel.js +3 -3
  1747. package/src/components/global-styles/dimensions-panel.js +14 -5
  1748. package/src/components/global-styles/get-block-css-selector.js +2 -2
  1749. package/src/components/global-styles/index.js +1 -0
  1750. package/src/components/global-styles/test/typography-utils.js +139 -1
  1751. package/src/components/global-styles/test/use-global-styles-output.js +14 -9
  1752. package/src/components/global-styles/typography-panel.js +19 -16
  1753. package/src/components/global-styles/typography-utils.js +53 -28
  1754. package/src/components/global-styles/use-global-styles-output.js +29 -19
  1755. package/src/components/global-styles/utils.js +9 -3
  1756. package/src/components/iframe/index.js +46 -68
  1757. package/src/components/iframe/use-compatibility-styles.js +34 -18
  1758. package/src/components/image-editor/constants.js +0 -1
  1759. package/src/components/index.js +1 -1
  1760. package/src/components/index.native.js +1 -0
  1761. package/src/components/inner-blocks/index.js +4 -2
  1762. package/src/components/inner-blocks/index.native.js +1 -1
  1763. package/src/components/inner-blocks/use-nested-settings-update.js +31 -36
  1764. package/src/components/inserter/block-patterns-tab.js +63 -8
  1765. package/src/components/inserter/hooks/use-block-types-state.js +4 -3
  1766. package/src/components/inserter/hooks/use-insertion-point.js +1 -0
  1767. package/src/components/inserter/library.js +2 -1
  1768. package/src/components/inserter/media-tab/media-tab.js +9 -3
  1769. package/src/components/inserter/reusable-blocks-tab.js +3 -3
  1770. package/src/components/inserter/tabs.js +3 -3
  1771. package/src/components/inspector-controls/README.md +1 -1
  1772. package/src/components/inspector-controls/fill.js +2 -6
  1773. package/src/components/inspector-controls-tabs/index.js +0 -1
  1774. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +0 -1
  1775. package/src/components/link-control/index.js +73 -42
  1776. package/src/components/link-control/is-url-like.js +40 -3
  1777. package/src/components/link-control/search-input.js +1 -0
  1778. package/src/components/link-control/search-results.js +4 -14
  1779. package/src/components/link-control/settings-drawer.js +2 -37
  1780. package/src/components/link-control/settings.js +2 -2
  1781. package/src/components/link-control/style.scss +5 -6
  1782. package/src/components/link-control/test/index.js +202 -105
  1783. package/src/components/link-control/test/is-url-like.js +66 -0
  1784. package/src/components/link-control/use-internal-value.js +60 -0
  1785. package/src/components/link-control/use-search-handler.js +10 -27
  1786. package/src/components/list-view/appender.js +3 -5
  1787. package/src/components/list-view/aria-referenced-text.js +30 -0
  1788. package/src/components/list-view/block-contents.js +9 -8
  1789. package/src/components/list-view/block-select-button.js +78 -2
  1790. package/src/components/list-view/block.js +40 -10
  1791. package/src/components/list-view/branch.js +6 -3
  1792. package/src/components/list-view/drop-indicator.js +94 -9
  1793. package/src/components/list-view/index.js +29 -19
  1794. package/src/components/list-view/style.scss +13 -17
  1795. package/src/components/list-view/test/use-list-view-drop-zone.js +208 -76
  1796. package/src/components/list-view/use-block-selection.js +2 -2
  1797. package/src/components/list-view/use-list-view-client-ids.js +3 -20
  1798. package/src/components/list-view/use-list-view-drop-zone.js +108 -47
  1799. package/src/components/media-placeholder/index.js +54 -20
  1800. package/src/components/media-replace-flow/index.js +1 -3
  1801. package/src/components/media-replace-flow/test/index.js +1 -1
  1802. package/src/components/navigable-toolbar/index.js +7 -5
  1803. package/src/components/preview-options/index.js +3 -2
  1804. package/src/components/provider/test/experimental-provider.js +9 -6
  1805. package/src/components/rich-text/content.js +85 -0
  1806. package/src/components/rich-text/format-toolbar/index.js +1 -2
  1807. package/src/components/rich-text/index.js +3 -36
  1808. package/src/components/rich-text/index.native.js +3 -33
  1809. package/src/components/rich-text/use-firefox-compat.js +27 -1
  1810. package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +26 -0
  1811. package/src/components/spacing-sizes-control/index.js +85 -71
  1812. package/src/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +14 -13
  1813. package/src/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +15 -14
  1814. package/src/components/spacing-sizes-control/input-controls/single.js +40 -0
  1815. package/src/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +55 -80
  1816. package/src/components/spacing-sizes-control/sides-dropdown/index.js +91 -0
  1817. package/src/components/spacing-sizes-control/style.scss +28 -100
  1818. package/src/components/spacing-sizes-control/test/utils.js +233 -4
  1819. package/src/components/spacing-sizes-control/utils.js +203 -20
  1820. package/src/components/ungroup-button/index.native.js +2 -2
  1821. package/src/components/url-popover/image-url-input-ui.js +15 -15
  1822. package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -3
  1823. package/src/components/use-block-display-information/index.js +26 -0
  1824. package/src/components/writing-flow/use-drag-selection.js +1 -1
  1825. package/src/components/writing-flow/use-tab-nav.js +56 -9
  1826. package/src/hooks/anchor.js +3 -1
  1827. package/src/hooks/behaviors.js +163 -64
  1828. package/src/hooks/custom-class-name.js +23 -19
  1829. package/src/hooks/font-family.js +1 -5
  1830. package/src/hooks/font-size.js +12 -17
  1831. package/src/hooks/layout.js +21 -26
  1832. package/src/hooks/position.js +24 -12
  1833. package/src/hooks/style.js +3 -1
  1834. package/src/hooks/supports.js +1 -1
  1835. package/src/hooks/use-typography-props.js +14 -19
  1836. package/src/hooks/utils.js +8 -7
  1837. package/src/index.js +0 -2
  1838. package/src/layouts/constrained.js +2 -1
  1839. package/src/layouts/definitions.js +174 -0
  1840. package/src/layouts/flex.js +7 -5
  1841. package/src/layouts/flow.js +2 -1
  1842. package/src/layouts/grid.js +31 -4
  1843. package/src/layouts/test/utils.js +2 -7
  1844. package/src/layouts/utils.js +7 -2
  1845. package/src/private-apis.js +11 -0
  1846. package/src/store/actions.js +7 -56
  1847. package/src/store/private-actions.js +193 -0
  1848. package/src/store/private-selectors.js +132 -37
  1849. package/src/store/reducer.js +50 -8
  1850. package/src/store/selectors.js +74 -41
  1851. package/src/store/test/private-selectors.js +491 -48
  1852. package/src/store/test/reducer.js +0 -7
  1853. package/src/store/test/selectors.js +117 -17
  1854. package/src/utils/object.js +35 -0
  1855. package/src/utils/test/object.js +96 -1
  1856. package/build/components/link-control/use-internal-input-value.js +0 -27
  1857. package/build/components/link-control/use-internal-input-value.js.map +0 -1
  1858. package/build/components/spacing-sizes-control/all-input-control.js +0 -57
  1859. package/build/components/spacing-sizes-control/all-input-control.js.map +0 -1
  1860. package/build/components/spacing-sizes-control/axial-input-controls.js.map +0 -1
  1861. package/build/components/spacing-sizes-control/input-controls.js.map +0 -1
  1862. package/build/components/spacing-sizes-control/linked-button.js +0 -37
  1863. package/build/components/spacing-sizes-control/linked-button.js.map +0 -1
  1864. package/build/components/spacing-sizes-control/spacing-input-control.js.map +0 -1
  1865. package/build/components/ungroup-button/icon.js +0 -31
  1866. package/build/components/ungroup-button/icon.js.map +0 -1
  1867. package/build-module/components/link-control/use-internal-input-value.js +0 -19
  1868. package/build-module/components/link-control/use-internal-input-value.js.map +0 -1
  1869. package/build-module/components/spacing-sizes-control/all-input-control.js +0 -45
  1870. package/build-module/components/spacing-sizes-control/all-input-control.js.map +0 -1
  1871. package/build-module/components/spacing-sizes-control/axial-input-controls.js.map +0 -1
  1872. package/build-module/components/spacing-sizes-control/input-controls.js.map +0 -1
  1873. package/build-module/components/spacing-sizes-control/linked-button.js +0 -27
  1874. package/build-module/components/spacing-sizes-control/linked-button.js.map +0 -1
  1875. package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +0 -1
  1876. package/build-module/components/ungroup-button/icon.js +0 -22
  1877. package/build-module/components/ungroup-button/icon.js.map +0 -1
  1878. package/src/components/link-control/use-internal-input-value.js +0 -23
  1879. package/src/components/spacing-sizes-control/all-input-control.js +0 -44
  1880. package/src/components/spacing-sizes-control/linked-button.js +0 -24
  1881. package/src/components/ungroup-button/icon.js +0 -26
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-block-drop-zone/index.js"],"names":["getDropTargetPosition","blocksData","position","orientation","allowedEdges","isRightToLeft","nearestIndex","insertPosition","minDistance","Infinity","forEach","isUnmodifiedDefaultBlock","getBoundingClientRect","blockIndex","rect","distance","edge","adjacentIndex","isNearestBlockUnmodifiedDefaultBlock","isAdjacentBlockUnmodifiedDefaultBlock","insertionIndex","useBlockDropZone","rootClientId","targetRootClientId","registry","dropTarget","setDropTarget","index","operation","isDisabled","select","__unstableIsWithinBlockOverlay","__unstableHasActiveBlockOverlayActive","getBlockEditingMode","blockEditorStore","blockEditingMode","getBlockListSettings","getBlocks","getBlockIndex","showInsertionPoint","hideInsertionPoint","onBlockDrop","throttled","event","ownerDocument","blocks","length","batch","map","block","clientId","getElementById","targetIndex","x","clientX","y","clientY","onDrop","onDragOver","currentTarget","onDragLeave","cancel","onDragEnd"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AAIA;;AACA;;AAKA;;AACA;;AAIA;;AACA;;AArBA;AACA;AACA;;AAUA;AACA;AACA;;AASA;;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,qBAAT,CACNC,UADM,EAENC,QAFM,EAIL;AAAA;;AAAA,MADDC,WACC,uEADa,UACb;AACD,QAAMC,YAAY,GACjBD,WAAW,KAAK,YAAhB,GACG,CAAE,MAAF,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AACdC,QAAAA,KAAK,EAAEyB,WADO;AAEdxB,QAAAA;AAFc,OAAF,CAAb;AAIAW,MAAAA,kBAAkB,CAAEhB,kBAAF,EAAsB6B,WAAtB,EAAmC;AACpDxB,QAAAA;AADoD,OAAnC,CAAlB;AAGA,KARD;AASA,GA/CF,EAgDC,CACCS,SADD,EAECd,kBAFD,EAGCa,oBAHD,EAICZ,QAJD,EAKCe,kBALD,EAMCD,aAND,CAhDD,CADiB,EA0DjB,GA1DiB,CAAlB;AA6DA,SAAO,wCAAa;AACnBT,IAAAA,UADmB;AAEnB4B,IAAAA,MAAM,EAAEhB,WAFW;;AAGnBiB,IAAAA,UAAU,CAAEf,KAAF,EAAU;AACnB;AACA;AACA;AACAD,MAAAA,SAAS,CAAEC,KAAF,EAASA,KAAK,CAACgB,aAAN,CAAoBf,aAA7B,CAAT;AACA,KARkB;;AASnBgB,IAAAA,WAAW,GAAG;AACblB,MAAAA,SAAS,CAACmB,MAAV;AACArB,MAAAA,kBAAkB;AAClB,KAZkB;;AAanBsB,IAAAA,SAAS,GAAG;AACXpB,MAAAA,SAAS,CAACmB,MAAV;AACArB,MAAAA,kBAAkB;AAClB;;AAhBkB,GAAb,CAAP;AAkBA","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 { isUnmodifiedDefaultBlock as getIsUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport useOnBlockDrop from '../use-on-block-drop';\nimport {\n\tgetDistanceToNearestEdge,\n\tisPointContainedByRect,\n} from '../../utils/math';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\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 * @return {[number, WPDropOperation]} The drop target position.\n */\nexport function getDropTargetPosition(\n\tblocksData,\n\tposition,\n\torientation = 'vertical'\n) {\n\tconst allowedEdges =\n\t\torientation === 'horizontal'\n\t\t\t? [ 'left', 'right' ]\n\t\t\t: [ 'top', 'bottom' ];\n\n\tconst isRightToLeft = isRTL();\n\n\tlet nearestIndex = 0;\n\tlet insertPosition = 'before';\n\tlet minDistance = Infinity;\n\n\tblocksData.forEach(\n\t\t( { isUnmodifiedDefaultBlock, getBoundingClientRect, blockIndex } ) => {\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// Prioritize the element if the point is inside of an unmodified default block.\n\t\t\tif (\n\t\t\t\tisUnmodifiedDefaultBlock &&\n\t\t\t\tisPointContainedByRect( position, rect )\n\t\t\t) {\n\t\t\t\tdistance = 0;\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 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 * @typedef {Object} WPBlockDropZoneConfig\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\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} = {} ) {\n\tconst registry = useRegistry();\n\tconst [ dropTarget, setDropTarget ] = useState( {\n\t\tindex: null,\n\t\toperation: 'insert',\n\t} );\n\n\tconst isDisabled = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__unstableIsWithinBlockOverlay,\n\t\t\t\t__unstableHasActiveBlockOverlayActive,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tconst blockEditingMode = getBlockEditingMode( targetRootClientId );\n\t\t\treturn (\n\t\t\t\tblockEditingMode !== 'default' ||\n\t\t\t\t__unstableHasActiveBlockOverlayActive( targetRootClientId ) ||\n\t\t\t\t__unstableIsWithinBlockOverlay( targetRootClientId )\n\t\t\t);\n\t\t},\n\t\t[ targetRootClientId ]\n\t);\n\n\tconst { getBlockListSettings, getBlocks, getBlockIndex } =\n\t\tuseSelect( blockEditorStore );\n\tconst { showInsertionPoint, hideInsertionPoint } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst onBlockDrop = useOnBlockDrop( targetRootClientId, dropTarget.index, {\n\t\toperation: dropTarget.operation,\n\t} );\n\tconst throttled = useThrottle(\n\t\tuseCallback(\n\t\t\t( event, ownerDocument ) => {\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};\n\t\t\t\t} );\n\n\t\t\t\tconst [ targetIndex, operation ] = 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);\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} );\n\t\t\t\t\tshowInsertionPoint( targetRootClientId, targetIndex, {\n\t\t\t\t\t\toperation,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[\n\t\t\t\tgetBlocks,\n\t\t\t\ttargetRootClientId,\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tregistry,\n\t\t\t\tshowInsertionPoint,\n\t\t\t\tgetBlockIndex,\n\t\t\t]\n\t\t),\n\t\t200\n\t);\n\n\treturn useDropZone( {\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() {\n\t\t\tthrottled.cancel();\n\t\t\thideInsertionPoint();\n\t\t},\n\t\tonDragEnd() {\n\t\t\tthrottled.cancel();\n\t\t\thideInsertionPoint();\n\t\t},\n\t} );\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/use-block-drop-zone/index.js"],"names":["getDropTargetPosition","blocksData","position","orientation","allowedEdges","isRightToLeft","nearestIndex","insertPosition","minDistance","Infinity","forEach","isUnmodifiedDefaultBlock","getBoundingClientRect","blockIndex","rect","distance","edge","adjacentIndex","isNearestBlockUnmodifiedDefaultBlock","isAdjacentBlockUnmodifiedDefaultBlock","insertionIndex","useBlockDropZone","rootClientId","targetRootClientId","registry","dropTarget","setDropTarget","index","operation","isDisabled","select","__unstableIsWithinBlockOverlay","__unstableHasActiveBlockOverlayActive","getBlockEditingMode","blockEditorStore","blockEditingMode","getBlockListSettings","getBlocks","getBlockIndex","showInsertionPoint","hideInsertionPoint","onBlockDrop","throttled","event","ownerDocument","blocks","length","batch","map","block","clientId","getElementById","targetIndex","x","clientX","y","clientY","onDrop","onDragOver","currentTarget","onDragLeave","cancel","onDragEnd"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AAIA;;AACA;;AAKA;;AACA;;AAIA;;AACA;;AArBA;AACA;AACA;;AAUA;AACA;AACA;;AASA;;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,qBAAT,CACNC,UADM,EAENC,QAFM,EAGNC,WAAW,GAAG,UAHR,EAIL;AACD,QAAMC,YAAY,GACjBD,WAAW,KAAK,YAAhB,GACG,CAAE,MAAF,EAAU,OAAV,CADH,GAEG,CAAE,KAAF,EAAS,QAAT,CAHJ;AAKA,QAAME,aAAa,GAAG,kBAAtB;AAEA,MAAIC,YAAY,GAAG,CAAnB;AACA,MAAIC,cAAc,GAAG,QAArB;AACA,MAAIC,WAAW,GAAGC,QAAlB;AAEAR,EAAAA,UAAU,CAACS,OAAX,CACC,CAAE;AAAEC,IAAAA,wBAAF;AAA4BC,IAAAA,qBAA5B;AAAmDC,IAAAA;AAAnD,GAAF,KAAuE;AACtE,UAAMC,IAAI,GAAGF,qBAAqB,EAAlC;AAEA,QAAI,CAAEG,QAAF,EAAYC,IAAZ,IAAqB,oCACxBd,QADwB,EAExBY,IAFwB,EAGxBV,YAHwB,CAAzB,CAHsE,CAQtE;;AACA,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BgB,IAAAA,WAAW,GAAG;AACblB,MAAAA,SAAS,CAACmB,MAAV;AACArB,MAAAA,kBAAkB;AAClB,KAZkB;;AAanBsB,IAAAA,SAAS,GAAG;AACXpB,MAAAA,SAAS,CAACmB,MAAV;AACArB,MAAAA,kBAAkB;AAClB;;AAhBkB,GAAb,CAAP;AAkBA","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 { isUnmodifiedDefaultBlock as getIsUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport useOnBlockDrop from '../use-on-block-drop';\nimport {\n\tgetDistanceToNearestEdge,\n\tisPointContainedByRect,\n} from '../../utils/math';\nimport { store as blockEditorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\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 * @return {[number, WPDropOperation]} The drop target position.\n */\nexport function getDropTargetPosition(\n\tblocksData,\n\tposition,\n\torientation = 'vertical'\n) {\n\tconst allowedEdges =\n\t\torientation === 'horizontal'\n\t\t\t? [ 'left', 'right' ]\n\t\t\t: [ 'top', 'bottom' ];\n\n\tconst isRightToLeft = isRTL();\n\n\tlet nearestIndex = 0;\n\tlet insertPosition = 'before';\n\tlet minDistance = Infinity;\n\n\tblocksData.forEach(\n\t\t( { isUnmodifiedDefaultBlock, getBoundingClientRect, blockIndex } ) => {\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// Prioritize the element if the point is inside of an unmodified default block.\n\t\t\tif (\n\t\t\t\tisUnmodifiedDefaultBlock &&\n\t\t\t\tisPointContainedByRect( position, rect )\n\t\t\t) {\n\t\t\t\tdistance = 0;\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 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 * @typedef {Object} WPBlockDropZoneConfig\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\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} = {} ) {\n\tconst registry = useRegistry();\n\tconst [ dropTarget, setDropTarget ] = useState( {\n\t\tindex: null,\n\t\toperation: 'insert',\n\t} );\n\n\tconst isDisabled = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__unstableIsWithinBlockOverlay,\n\t\t\t\t__unstableHasActiveBlockOverlayActive,\n\t\t\t\tgetBlockEditingMode,\n\t\t\t} = unlock( select( blockEditorStore ) );\n\t\t\tconst blockEditingMode = getBlockEditingMode( targetRootClientId );\n\t\t\treturn (\n\t\t\t\tblockEditingMode !== 'default' ||\n\t\t\t\t__unstableHasActiveBlockOverlayActive( targetRootClientId ) ||\n\t\t\t\t__unstableIsWithinBlockOverlay( targetRootClientId )\n\t\t\t);\n\t\t},\n\t\t[ targetRootClientId ]\n\t);\n\n\tconst { getBlockListSettings, getBlocks, getBlockIndex } =\n\t\tuseSelect( blockEditorStore );\n\tconst { showInsertionPoint, hideInsertionPoint } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst onBlockDrop = useOnBlockDrop( targetRootClientId, dropTarget.index, {\n\t\toperation: dropTarget.operation,\n\t} );\n\tconst throttled = useThrottle(\n\t\tuseCallback(\n\t\t\t( event, ownerDocument ) => {\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};\n\t\t\t\t} );\n\n\t\t\t\tconst [ targetIndex, operation ] = 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);\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} );\n\t\t\t\t\tshowInsertionPoint( targetRootClientId, targetIndex, {\n\t\t\t\t\t\toperation,\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t},\n\t\t\t[\n\t\t\t\tgetBlocks,\n\t\t\t\ttargetRootClientId,\n\t\t\t\tgetBlockListSettings,\n\t\t\t\tregistry,\n\t\t\t\tshowInsertionPoint,\n\t\t\t\tgetBlockIndex,\n\t\t\t]\n\t\t),\n\t\t200\n\t);\n\n\treturn useDropZone( {\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() {\n\t\t\tthrottled.cancel();\n\t\t\thideInsertionPoint();\n\t\t},\n\t\tonDragEnd() {\n\t\t\tthrottled.cancel();\n\t\t\thideInsertionPoint();\n\t\t},\n\t} );\n}\n"]}
@@ -108,14 +108,13 @@ function getNearestBlockIndex(blocksLayouts, position, orientation, isRTL) {
108
108
  */
109
109
 
110
110
 
111
- function useBlockDropZone() {
112
- let {
113
- // An undefined value represents a top-level block. Default to an empty
114
- // string for this so that `targetRootClientId` can be easily compared to
115
- // values returned by the `getRootBlockClientId` selector, which also uses
116
- // an empty string to represent top-level blocks.
117
- rootClientId: targetRootClientId = ''
118
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
111
+ function useBlockDropZone({
112
+ // An undefined value represents a top-level block. Default to an empty
113
+ // string for this so that `targetRootClientId` can be easily compared to
114
+ // values returned by the `getRootBlockClientId` selector, which also uses
115
+ // an empty string to represent top-level blocks.
116
+ rootClientId: targetRootClientId = ''
117
+ } = {}) {
119
118
  const targetBlockIndex = (0, _reactNativeReanimated.useSharedValue)(null);
120
119
  const {
121
120
  getBlockListSettings,
@@ -131,13 +130,11 @@ function useBlockDropZone() {
131
130
  const isRTL = getSettings().isRTL;
132
131
  const onBlockDrop = (0, _useOnBlockDrop.default)();
133
132
  const throttled = (0, _compose.useThrottle)((0, _element.useCallback)(event => {
134
- var _getBlockListSettings;
135
-
136
133
  const sortedBlockLayouts = getSortedBlocksLayouts();
137
134
  const targetIndex = getNearestBlockIndex(sortedBlockLayouts, {
138
135
  x: event.x,
139
136
  y: event.y
140
- }, (_getBlockListSettings = getBlockListSettings(targetRootClientId)) === null || _getBlockListSettings === void 0 ? void 0 : _getBlockListSettings.orientation, isRTL);
137
+ }, getBlockListSettings(targetRootClientId)?.orientation, isRTL);
141
138
 
142
139
  if (targetIndex !== null) {
143
140
  targetBlockIndex.value = targetIndex !== null && targetIndex !== void 0 ? targetIndex : 0;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-block-drop-zone/index.native.js"],"names":["getNearestBlockIndex","blocksLayouts","position","orientation","isRTL","allowedEdges","isRightToLeft","candidateIndex","candidateDistance","forEach","element","index","x","y","width","height","rect","top","right","bottom","left","distance","edge","undefined","isTrailingEdge","offset","useBlockDropZone","rootClientId","targetRootClientId","targetBlockIndex","getBlockListSettings","getSettings","blockEditorStore","getBlockLayoutsOrderedByYCoord","getSortedBlocksLayouts","current","onBlockDrop","throttled","event","sortedBlockLayouts","targetIndex","value","onBlockDragOver","onBlockDragEnd","cancel"],"mappings":";;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAMA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,oBAAT,CACNC,aADM,EAENC,QAFM,EAGNC,WAHM,EAINC,KAJM,EAKL;AACD,QAAMC,YAAY,GACjBF,WAAW,KAAK,YAAhB,GACG,CAAE,MAAF,EAAU,OAAV,CADH,GAEG,CAAE,KAAF,EAAS,QAAT,CAHJ;AAKA,QAAMG,aAAa,GAAGF,KAAtB;AAEA,MAAIG,cAAJ;AACA,MAAIC,iBAAJ,CATC,CAWD;;AACAP,EAAAA,aAAa,CAACQ,OAAd,CAAuB,CAAE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,IAAAA,WAAW,EAAIE,KAAF,IAAa;AACzB,UAAKT,gBAAgB,CAACY,KAAjB,KAA2B,IAAhC,EAAuC;AACtCL,QAAAA,WAAW,CAAE,EACZ,GAAGE,KADS;AAEZV,UAAAA,kBAFY;AAGZC,UAAAA,gBAAgB,EAAEA,gBAAgB,CAACY;AAHvB,SAAF,CAAX;AAKA;AACD,KAhBK;AAiBNZ,IAAAA;AAjBM,GAAP;AAmBA","sourcesContent":["/**\n * External dependencies\n */\nimport { useSharedValue } from 'react-native-reanimated';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { useThrottle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { useBlockListContext } from '../block-list/block-list-context';\nimport { getDistanceToNearestEdge } from '../../utils/math';\nimport useOnBlockDrop from '../use-on-block-drop';\n\n/** @typedef {import('../../utils/math').WPPoint} WPPoint */\n\n/**\n * The orientation of a block list.\n *\n * @typedef {'horizontal'|'vertical'|undefined} WPBlockListOrientation\n */\n\n/**\n * Given a list of blocks layouts finds the index that a block should be dropped at.\n *\n * @param {Object} blocksLayouts Blocks layouts object.\n * @param {WPPoint} position The position of the item being dragged.\n * @param {WPBlockListOrientation} orientation The orientation of a block list.\n * @param {boolean} isRTL Check if current locale is RTL.\n *\n * @return {number|undefined} The block index that's closest to the drag position.\n */\nexport function getNearestBlockIndex(\n\tblocksLayouts,\n\tposition,\n\torientation,\n\tisRTL\n) {\n\tconst allowedEdges =\n\t\torientation === 'horizontal'\n\t\t\t? [ 'left', 'right' ]\n\t\t\t: [ 'top', 'bottom' ];\n\n\tconst isRightToLeft = isRTL;\n\n\tlet candidateIndex;\n\tlet candidateDistance;\n\n\t// Only enabled for root level blocks.\n\tblocksLayouts.forEach( ( element, index ) => {\n\t\tconst { x, y, width, height } = element;\n\t\tconst rect = {\n\t\t\tx: element.x,\n\t\t\ty: element.y,\n\t\t\ttop: y,\n\t\t\tright: x + width,\n\t\t\tbottom: y + height,\n\t\t\tleft: x,\n\t\t\twidth,\n\t\t\theight,\n\t\t};\n\t\tconst [ distance, edge ] = getDistanceToNearestEdge(\n\t\t\tposition,\n\t\t\trect,\n\t\t\tallowedEdges\n\t\t);\n\n\t\tif ( candidateDistance === undefined || distance < candidateDistance ) {\n\t\t\t// If the user is dropping to the trailing edge of the block\n\t\t\t// add 1 to the index to represent dragging after.\n\t\t\t// Take RTL languages into account where the left edge is\n\t\t\t// the trailing edge.\n\t\t\tconst isTrailingEdge =\n\t\t\t\tedge === 'bottom' ||\n\t\t\t\t( ! isRightToLeft && edge === 'right' ) ||\n\t\t\t\t( isRightToLeft && edge === 'left' );\n\t\t\tconst offset = isTrailingEdge ? 1 : 0;\n\n\t\t\t// Update the currently known best candidate.\n\t\t\tcandidateDistance = distance;\n\t\t\tcandidateIndex = index + offset;\n\t\t}\n\t} );\n\treturn candidateIndex;\n}\n\n/**\n * @typedef {Object} WPBlockDropZoneConfig\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 *\n * @return {Object} An object that contains `targetBlockIndex` and the event\n * handlers `onBlockDragOver`, `onBlockDragEnd` and `onBlockDrop`.\n */\nexport default function useBlockDropZone( {\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} = {} ) {\n\tconst targetBlockIndex = useSharedValue( null );\n\n\tconst { getBlockListSettings, getSettings } = useSelect( blockEditorStore );\n\tconst { blocksLayouts, getBlockLayoutsOrderedByYCoord } =\n\t\tuseBlockListContext();\n\n\tconst getSortedBlocksLayouts = useCallback( () => {\n\t\treturn getBlockLayoutsOrderedByYCoord( blocksLayouts.current );\n\t}, [ blocksLayouts.current ] );\n\n\tconst isRTL = getSettings().isRTL;\n\n\tconst onBlockDrop = useOnBlockDrop();\n\n\tconst throttled = useThrottle(\n\t\tuseCallback(\n\t\t\t( event ) => {\n\t\t\t\tconst sortedBlockLayouts = getSortedBlocksLayouts();\n\n\t\t\t\tconst targetIndex = getNearestBlockIndex(\n\t\t\t\t\tsortedBlockLayouts,\n\t\t\t\t\t{ x: event.x, y: event.y },\n\t\t\t\t\tgetBlockListSettings( targetRootClientId )?.orientation,\n\t\t\t\t\tisRTL\n\t\t\t\t);\n\t\t\t\tif ( targetIndex !== null ) {\n\t\t\t\t\ttargetBlockIndex.value = targetIndex ?? 0;\n\t\t\t\t}\n\t\t\t},\n\t\t\t[\n\t\t\t\tgetSortedBlocksLayouts,\n\t\t\t\tgetNearestBlockIndex,\n\t\t\t\tgetBlockListSettings,\n\t\t\t\ttargetBlockIndex,\n\t\t\t]\n\t\t),\n\t\t200\n\t);\n\n\treturn {\n\t\tonBlockDragOver( event ) {\n\t\t\tthrottled( event );\n\t\t},\n\t\tonBlockDragEnd() {\n\t\t\tthrottled.cancel();\n\t\t\ttargetBlockIndex.value = null;\n\t\t},\n\t\tonBlockDrop: ( event ) => {\n\t\t\tif ( targetBlockIndex.value !== null ) {\n\t\t\t\tonBlockDrop( {\n\t\t\t\t\t...event,\n\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\ttargetBlockIndex: targetBlockIndex.value,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\ttargetBlockIndex,\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/use-block-drop-zone/index.native.js"],"names":["getNearestBlockIndex","blocksLayouts","position","orientation","isRTL","allowedEdges","isRightToLeft","candidateIndex","candidateDistance","forEach","element","index","x","y","width","height","rect","top","right","bottom","left","distance","edge","undefined","isTrailingEdge","offset","useBlockDropZone","rootClientId","targetRootClientId","targetBlockIndex","getBlockListSettings","getSettings","blockEditorStore","getBlockLayoutsOrderedByYCoord","getSortedBlocksLayouts","current","onBlockDrop","throttled","event","sortedBlockLayouts","targetIndex","value","onBlockDragOver","onBlockDragEnd","cancel"],"mappings":";;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;;AAMA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,oBAAT,CACNC,aADM,EAENC,QAFM,EAGNC,WAHM,EAINC,KAJM,EAKL;AACD,QAAMC,YAAY,GACjBF,WAAW,KAAK,YAAhB,GACG,CAAE,MAAF,EAAU,OAAV,CADH,GAEG,CAAE,KAAF,EAAS,QAAT,CAHJ;AAKA,QAAMG,aAAa,GAAGF,KAAtB;AAEA,MAAIG,cAAJ;AACA,MAAIC,iBAAJ,CATC,CAWD;;AACAP,EAAAA,aAAa,CAACQ,OAAd,CAAuB,CAAEC,OAAF,EAAWC,KAAX,KAAsB;AAC5C,UAAM;AAAEC,MAAAA,CAAF;AAAKC,MAAAA,CAAL;AAAQC,MAAAA,KAAR;AAAeC,MAAAA;AAAf,QAA0BL,OAAhC;AACA,UAAMM,IAAI,GAAG;AACZJ,MAAAA,CAAC,EAAEF,OAAO,CAACE,CADC;AAEZC,MAAAA,CAAC,EAAEH,OAAO,CAACG,CAFC;AAGZI,MAAAA,GAAG,EAAEJ,CAHO;AAIZK,MAAAA,KAAK,EAAEN,CAAC,GAAGE,KAJC;AAKZK,MAAAA,MAAM,EAAEN,CAAC,GAAGE,MALA;AAMZK,MAAAA,IAAI,EAAER,CANM;AAOZE,MAAAA,KAPY;AAQZC,MAAAA;AARY,KAAb;AAUA,UAAM,CAAEM,QAAF,EAAYC,IAAZ,IAAqB,oCAC1BpB,QAD0B,EAE1Bc,IAF0B,EAG1BX,YAH0B,CAA3B;;AAMA,QAAKG,iBAAiB,KAAKe,SAAtB,IAAmCF,QAAQ,GAAGb,iBA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AAvB,KAFuC,EAGvCiB,oBAAoB,CAAEF,kBAAF,CAApB,EAA4CzB,WAHL,EAIvCC,KAJuC,CAAxC;;AAMA,QAAKoC,WAAW,KAAK,IAArB,EAA4B;AAC3BX,MAAAA,gBAAgB,CAACY,KAAjB,GAAyBD,WAAzB,aAAyBA,WAAzB,cAAyBA,WAAzB,GAAwC,CAAxC;AACA;AACD,GAbF,EAcC,CACCN,sBADD,EAEClC,oBAFD,EAGC8B,oBAHD,EAICD,gBAJD,CAdD,CADiB,EAsBjB,GAtBiB,CAAlB;AAyBA,SAAO;AACNa,IAAAA,eAAe,CAAEJ,KAAF,EAAU;AACxBD,MAAAA,SAAS,CAAEC,KAAF,CAAT;AACA,KAHK;;AAINK,IAAAA,cAAc,GAAG;AAChBN,MAAAA,SAAS,CAACO,MAAV;AACAf,MAAAA,gBAAgB,CAACY,KAAjB,GAAyB,IAAzB;AACA,KAPK;;AAQNL,IAAAA,WAAW,EAAIE,KAAF,IAAa;AACzB,UAAKT,gBAAgB,CAACY,KAAjB,KAA2B,IAAhC,EAAuC;AACtCL,QAAAA,WAAW,CAAE,EACZ,GAAGE,KADS;AAEZV,UAAAA,kBAFY;AAGZC,UAAAA,gBAAgB,EAAEA,gBAAgB,CAACY;AAHvB,SAAF,CAAX;AAKA;AACD,KAhBK;AAiBNZ,IAAAA;AAjBM,GAAP;AAmBA","sourcesContent":["/**\n * External dependencies\n */\nimport { useSharedValue } from 'react-native-reanimated';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { useCallback } from '@wordpress/element';\nimport { useThrottle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { useBlockListContext } from '../block-list/block-list-context';\nimport { getDistanceToNearestEdge } from '../../utils/math';\nimport useOnBlockDrop from '../use-on-block-drop';\n\n/** @typedef {import('../../utils/math').WPPoint} WPPoint */\n\n/**\n * The orientation of a block list.\n *\n * @typedef {'horizontal'|'vertical'|undefined} WPBlockListOrientation\n */\n\n/**\n * Given a list of blocks layouts finds the index that a block should be dropped at.\n *\n * @param {Object} blocksLayouts Blocks layouts object.\n * @param {WPPoint} position The position of the item being dragged.\n * @param {WPBlockListOrientation} orientation The orientation of a block list.\n * @param {boolean} isRTL Check if current locale is RTL.\n *\n * @return {number|undefined} The block index that's closest to the drag position.\n */\nexport function getNearestBlockIndex(\n\tblocksLayouts,\n\tposition,\n\torientation,\n\tisRTL\n) {\n\tconst allowedEdges =\n\t\torientation === 'horizontal'\n\t\t\t? [ 'left', 'right' ]\n\t\t\t: [ 'top', 'bottom' ];\n\n\tconst isRightToLeft = isRTL;\n\n\tlet candidateIndex;\n\tlet candidateDistance;\n\n\t// Only enabled for root level blocks.\n\tblocksLayouts.forEach( ( element, index ) => {\n\t\tconst { x, y, width, height } = element;\n\t\tconst rect = {\n\t\t\tx: element.x,\n\t\t\ty: element.y,\n\t\t\ttop: y,\n\t\t\tright: x + width,\n\t\t\tbottom: y + height,\n\t\t\tleft: x,\n\t\t\twidth,\n\t\t\theight,\n\t\t};\n\t\tconst [ distance, edge ] = getDistanceToNearestEdge(\n\t\t\tposition,\n\t\t\trect,\n\t\t\tallowedEdges\n\t\t);\n\n\t\tif ( candidateDistance === undefined || distance < candidateDistance ) {\n\t\t\t// If the user is dropping to the trailing edge of the block\n\t\t\t// add 1 to the index to represent dragging after.\n\t\t\t// Take RTL languages into account where the left edge is\n\t\t\t// the trailing edge.\n\t\t\tconst isTrailingEdge =\n\t\t\t\tedge === 'bottom' ||\n\t\t\t\t( ! isRightToLeft && edge === 'right' ) ||\n\t\t\t\t( isRightToLeft && edge === 'left' );\n\t\t\tconst offset = isTrailingEdge ? 1 : 0;\n\n\t\t\t// Update the currently known best candidate.\n\t\t\tcandidateDistance = distance;\n\t\t\tcandidateIndex = index + offset;\n\t\t}\n\t} );\n\treturn candidateIndex;\n}\n\n/**\n * @typedef {Object} WPBlockDropZoneConfig\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 *\n * @return {Object} An object that contains `targetBlockIndex` and the event\n * handlers `onBlockDragOver`, `onBlockDragEnd` and `onBlockDrop`.\n */\nexport default function useBlockDropZone( {\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} = {} ) {\n\tconst targetBlockIndex = useSharedValue( null );\n\n\tconst { getBlockListSettings, getSettings } = useSelect( blockEditorStore );\n\tconst { blocksLayouts, getBlockLayoutsOrderedByYCoord } =\n\t\tuseBlockListContext();\n\n\tconst getSortedBlocksLayouts = useCallback( () => {\n\t\treturn getBlockLayoutsOrderedByYCoord( blocksLayouts.current );\n\t}, [ blocksLayouts.current ] );\n\n\tconst isRTL = getSettings().isRTL;\n\n\tconst onBlockDrop = useOnBlockDrop();\n\n\tconst throttled = useThrottle(\n\t\tuseCallback(\n\t\t\t( event ) => {\n\t\t\t\tconst sortedBlockLayouts = getSortedBlocksLayouts();\n\n\t\t\t\tconst targetIndex = getNearestBlockIndex(\n\t\t\t\t\tsortedBlockLayouts,\n\t\t\t\t\t{ x: event.x, y: event.y },\n\t\t\t\t\tgetBlockListSettings( targetRootClientId )?.orientation,\n\t\t\t\t\tisRTL\n\t\t\t\t);\n\t\t\t\tif ( targetIndex !== null ) {\n\t\t\t\t\ttargetBlockIndex.value = targetIndex ?? 0;\n\t\t\t\t}\n\t\t\t},\n\t\t\t[\n\t\t\t\tgetSortedBlocksLayouts,\n\t\t\t\tgetNearestBlockIndex,\n\t\t\t\tgetBlockListSettings,\n\t\t\t\ttargetBlockIndex,\n\t\t\t]\n\t\t),\n\t\t200\n\t);\n\n\treturn {\n\t\tonBlockDragOver( event ) {\n\t\t\tthrottled( event );\n\t\t},\n\t\tonBlockDragEnd() {\n\t\t\tthrottled.cancel();\n\t\t\ttargetBlockIndex.value = null;\n\t\t},\n\t\tonBlockDrop: ( event ) => {\n\t\t\tif ( targetBlockIndex.value !== null ) {\n\t\t\t\tonBlockDrop( {\n\t\t\t\t\t...event,\n\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\ttargetBlockIndex: targetBlockIndex.value,\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\ttargetBlockIndex,\n\t};\n}\n"]}
@@ -54,13 +54,12 @@ const getAbsolutePosition = element => {
54
54
  */
55
55
 
56
56
 
57
- function useMovingAnimation(_ref) {
58
- let {
59
- isSelected,
60
- adjustScrolling,
61
- enableAnimation,
62
- triggerAnimationOnChange
63
- } = _ref;
57
+ function useMovingAnimation({
58
+ isSelected,
59
+ adjustScrolling,
60
+ enableAnimation,
61
+ triggerAnimationOnChange
62
+ }) {
64
63
  const ref = (0, _element.useRef)();
65
64
  const prefersReducedMotion = (0, _compose.useReducedMotion)() || !enableAnimation;
66
65
  const [triggeredAnimation, triggerAnimation] = (0, _element.useReducer)(counterReducer, 0);
@@ -119,11 +118,9 @@ function useMovingAnimation(_ref) {
119
118
  });
120
119
  }, [triggerAnimationOnChange]);
121
120
 
122
- function onChange(_ref2) {
123
- let {
124
- value
125
- } = _ref2;
126
-
121
+ function onChange({
122
+ value
123
+ }) {
127
124
  if (!ref.current) {
128
125
  return;
129
126
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-moving-animation/index.js"],"names":["counterReducer","state","getAbsolutePosition","element","top","offsetTop","left","offsetLeft","useMovingAnimation","isSelected","adjustScrolling","enableAnimation","triggerAnimationOnChange","ref","prefersReducedMotion","triggeredAnimation","triggerAnimation","finishedAnimation","endAnimation","transform","setTransform","x","y","previous","current","preserveScrollPosition","scrollContainer","prevRect","getBoundingClientRect","blockRect","diff","scrollTop","style","undefined","destination","Math","round","onChange","value","finishedMoving","transformOrigin","zIndex","from","to","reset","config","mass","tension","friction","immediate"],"mapp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AAAA;AAZU,GAAX;AAeA,SAAOxB,GAAP;AACA;;eAEcL,kB","sourcesContent":["/**\n * External dependencies\n */\nimport { useSpring } from '@react-spring/web';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseLayoutEffect,\n\tuseReducer,\n\tuseMemo,\n\tuseRef,\n} from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\n/**\n * Simple reducer used to increment a counter.\n *\n * @param {number} state Previous counter value.\n * @return {number} New state value.\n */\nconst counterReducer = ( state ) => state + 1;\n\nconst getAbsolutePosition = ( element ) => {\n\treturn {\n\t\ttop: element.offsetTop,\n\t\tleft: element.offsetLeft,\n\t};\n};\n\n/**\n * Hook used to compute the styles required to move a div into a new position.\n *\n * The way this animation works is the following:\n * - It first renders the element as if there was no animation.\n * - It takes a snapshot of the position of the block to use it\n * as a destination point for the animation.\n * - It restores the element to the previous position using a CSS transform\n * - It uses the \"resetAnimation\" flag to reset the animation\n * from the beginning in order to animate to the new destination point.\n *\n * @param {Object} $1 Options\n * @param {boolean} $1.isSelected Whether it's the current block or not.\n * @param {boolean} $1.adjustScrolling Adjust the scroll position to the current block.\n * @param {boolean} $1.enableAnimation Enable/Disable animation.\n * @param {*} $1.triggerAnimationOnChange Variable used to trigger the animation if it changes.\n */\nfunction useMovingAnimation( {\n\tisSelected,\n\tadjustScrolling,\n\tenableAnimation,\n\ttriggerAnimationOnChange,\n} ) {\n\tconst ref = useRef();\n\tconst prefersReducedMotion = useReducedMotion() || ! enableAnimation;\n\tconst [ triggeredAnimation, triggerAnimation ] = useReducer(\n\t\tcounterReducer,\n\t\t0\n\t);\n\tconst [ finishedAnimation, endAnimation ] = useReducer( counterReducer, 0 );\n\tconst [ transform, setTransform ] = useState( { x: 0, y: 0 } );\n\tconst previous = useMemo(\n\t\t() => ( ref.current ? getAbsolutePosition( ref.current ) : null ),\n\t\t[ triggerAnimationOnChange ]\n\t);\n\n\t// Calculate the previous position of the block relative to the viewport and\n\t// return a function to maintain that position by scrolling.\n\tconst preserveScrollPosition = useMemo( () => {\n\t\tif ( ! adjustScrolling || ! ref.current ) {\n\t\t\treturn () => {};\n\t\t}\n\n\t\tconst scrollContainer = getScrollContainer( ref.current );\n\n\t\tif ( ! scrollContainer ) {\n\t\t\treturn () => {};\n\t\t}\n\n\t\tconst prevRect = ref.current.getBoundingClientRect();\n\t\treturn () => {\n\t\t\tconst blockRect = ref.current.getBoundingClientRect();\n\t\t\tconst diff = blockRect.top - prevRect.top;\n\n\t\t\tif ( diff ) {\n\t\t\t\tscrollContainer.scrollTop += diff;\n\t\t\t}\n\t\t};\n\t}, [ triggerAnimationOnChange, adjustScrolling ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( triggeredAnimation ) {\n\t\t\tendAnimation();\n\t\t}\n\t}, [ triggeredAnimation ] );\n\tuseLayoutEffect( () => {\n\t\tif ( ! previous ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( prefersReducedMotion ) {\n\t\t\t// If the animation is disabled and the scroll needs to be adjusted,\n\t\t\t// just move directly to the final scroll position.\n\t\t\tpreserveScrollPosition();\n\n\t\t\treturn;\n\t\t}\n\n\t\tref.current.style.transform = undefined;\n\t\tconst destination = getAbsolutePosition( ref.current );\n\n\t\ttriggerAnimation();\n\t\tsetTransform( {\n\t\t\tx: Math.round( previous.left - destination.left ),\n\t\t\ty: Math.round( previous.top - destination.top ),\n\t\t} );\n\t}, [ triggerAnimationOnChange ] );\n\n\tfunction onChange( { value } ) {\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\t\tlet { x, y } = value;\n\t\tx = Math.round( x );\n\t\ty = Math.round( y );\n\t\tconst finishedMoving = x === 0 && y === 0;\n\t\tref.current.style.transformOrigin = 'center center';\n\t\tref.current.style.transform = finishedMoving\n\t\t\t? undefined\n\t\t\t: `translate3d(${ x }px,${ y }px,0)`;\n\t\tref.current.style.zIndex = isSelected ? '1' : '';\n\n\t\tpreserveScrollPosition();\n\t}\n\n\tuseSpring( {\n\t\tfrom: {\n\t\t\tx: transform.x,\n\t\t\ty: transform.y,\n\t\t},\n\t\tto: {\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t},\n\t\treset: triggeredAnimation !== finishedAnimation,\n\t\tconfig: { mass: 5, tension: 2000, friction: 200 },\n\t\timmediate: prefersReducedMotion,\n\t\tonChange,\n\t} );\n\n\treturn ref;\n}\n\nexport default useMovingAnimation;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/use-moving-animation/index.js"],"names":["counterReducer","state","getAbsolutePosition","element","top","offsetTop","left","offsetLeft","useMovingAnimation","isSelected","adjustScrolling","enableAnimation","triggerAnimationOnChange","ref","prefersReducedMotion","triggeredAnimation","triggerAnimation","finishedAnimation","endAnimation","transform","setTransform","x","y","previous","current","preserveScrollPosition","scrollContainer","prevRect","getBoundingClientRect","blockRect","diff","scrollTop","style","undefined","destination","Math","round","onChange","value","finishedMoving","transformOrigin","zIndex","from","to","reset","config","mass","tension","friction","immediate"],"mappings":";;;;;;;AAGA;;AAKA;;AAOA;;AACA;;AAhBA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,GAAKC,KAAF,IAAaA,KAAK,GAAG,CAA5C;;AAEA,MAAMC,mBAAmB,GAAKC,OAAF,IAAe;AAC1C,SAAO;AACNC,IAAAA,GAAG,EAAED,OAAO,CAACE,SADP;AAENC,IAAAA,IAAI,EAAEH,OAAO,CAACI;AAFR,GAAP;AAIA,CALD;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,kBAAT,CAA6B;AAC5BC,EAAAA,UAD4B;AAE5BC,EAAAA,eAF4B;AAG5BC,EAAAA,eAH4B;AAI5BC,EAAAA;AAJ4B,CAA7B,EAKI;AACH,QAAMC,GAAG,GAAG,sBAAZ;AACA,QAAM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SADyC,GAExC,eAAeZ,CAAG,MAAMC,CAAG,OAF/B;AAGAT,IAAAA,GAAG,CAACW,OAAJ,CAAYQ,KAAZ,CAAkBS,MAAlB,GAA2BhC,UAAU,GAAG,GAAH,GAAS,EAA9C;AAEAgB,IAAAA,sBAAsB;AACtB;;AAED,sBAAW;AACViB,IAAAA,IAAI,EAAE;AACLrB,MAAAA,CAAC,EAAEF,SAAS,CAACE,CADR;AAELC,MAAAA,CAAC,EAAEH,SAAS,CAACG;AAFR,KADI;AAKVqB,IAAAA,EAAE,EAAE;AACHtB,MAAAA,CAAC,EAAE,CADA;AAEHC,MAAAA,CAAC,EAAE;AAFA,KALM;AASVsB,IAAAA,KAAK,EAAE7B,kBAAkB,KAAKE,iBATpB;AAUV4B,IAAAA,MAAM,EAAE;AAAEC,MAAAA,IAAI,EAAE,CAAR;AAAWC,MAAAA,OAAO,EAAE,IAApB;AAA0BC,MAAAA,QAAQ,EAAE;AAApC,KAVE;AAWVC,IAAAA,SAAS,EAAEnC,oBAXD;AAYVuB,IAAAA;AAZU,GAAX;AAeA,SAAOxB,GAAP;AACA;;eAEcL,kB","sourcesContent":["/**\n * External dependencies\n */\nimport { useSpring } from '@react-spring/web';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tuseState,\n\tuseLayoutEffect,\n\tuseReducer,\n\tuseMemo,\n\tuseRef,\n} from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { getScrollContainer } from '@wordpress/dom';\n\n/**\n * Simple reducer used to increment a counter.\n *\n * @param {number} state Previous counter value.\n * @return {number} New state value.\n */\nconst counterReducer = ( state ) => state + 1;\n\nconst getAbsolutePosition = ( element ) => {\n\treturn {\n\t\ttop: element.offsetTop,\n\t\tleft: element.offsetLeft,\n\t};\n};\n\n/**\n * Hook used to compute the styles required to move a div into a new position.\n *\n * The way this animation works is the following:\n * - It first renders the element as if there was no animation.\n * - It takes a snapshot of the position of the block to use it\n * as a destination point for the animation.\n * - It restores the element to the previous position using a CSS transform\n * - It uses the \"resetAnimation\" flag to reset the animation\n * from the beginning in order to animate to the new destination point.\n *\n * @param {Object} $1 Options\n * @param {boolean} $1.isSelected Whether it's the current block or not.\n * @param {boolean} $1.adjustScrolling Adjust the scroll position to the current block.\n * @param {boolean} $1.enableAnimation Enable/Disable animation.\n * @param {*} $1.triggerAnimationOnChange Variable used to trigger the animation if it changes.\n */\nfunction useMovingAnimation( {\n\tisSelected,\n\tadjustScrolling,\n\tenableAnimation,\n\ttriggerAnimationOnChange,\n} ) {\n\tconst ref = useRef();\n\tconst prefersReducedMotion = useReducedMotion() || ! enableAnimation;\n\tconst [ triggeredAnimation, triggerAnimation ] = useReducer(\n\t\tcounterReducer,\n\t\t0\n\t);\n\tconst [ finishedAnimation, endAnimation ] = useReducer( counterReducer, 0 );\n\tconst [ transform, setTransform ] = useState( { x: 0, y: 0 } );\n\tconst previous = useMemo(\n\t\t() => ( ref.current ? getAbsolutePosition( ref.current ) : null ),\n\t\t[ triggerAnimationOnChange ]\n\t);\n\n\t// Calculate the previous position of the block relative to the viewport and\n\t// return a function to maintain that position by scrolling.\n\tconst preserveScrollPosition = useMemo( () => {\n\t\tif ( ! adjustScrolling || ! ref.current ) {\n\t\t\treturn () => {};\n\t\t}\n\n\t\tconst scrollContainer = getScrollContainer( ref.current );\n\n\t\tif ( ! scrollContainer ) {\n\t\t\treturn () => {};\n\t\t}\n\n\t\tconst prevRect = ref.current.getBoundingClientRect();\n\t\treturn () => {\n\t\t\tconst blockRect = ref.current.getBoundingClientRect();\n\t\t\tconst diff = blockRect.top - prevRect.top;\n\n\t\t\tif ( diff ) {\n\t\t\t\tscrollContainer.scrollTop += diff;\n\t\t\t}\n\t\t};\n\t}, [ triggerAnimationOnChange, adjustScrolling ] );\n\n\tuseLayoutEffect( () => {\n\t\tif ( triggeredAnimation ) {\n\t\t\tendAnimation();\n\t\t}\n\t}, [ triggeredAnimation ] );\n\tuseLayoutEffect( () => {\n\t\tif ( ! previous ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( prefersReducedMotion ) {\n\t\t\t// If the animation is disabled and the scroll needs to be adjusted,\n\t\t\t// just move directly to the final scroll position.\n\t\t\tpreserveScrollPosition();\n\n\t\t\treturn;\n\t\t}\n\n\t\tref.current.style.transform = undefined;\n\t\tconst destination = getAbsolutePosition( ref.current );\n\n\t\ttriggerAnimation();\n\t\tsetTransform( {\n\t\t\tx: Math.round( previous.left - destination.left ),\n\t\t\ty: Math.round( previous.top - destination.top ),\n\t\t} );\n\t}, [ triggerAnimationOnChange ] );\n\n\tfunction onChange( { value } ) {\n\t\tif ( ! ref.current ) {\n\t\t\treturn;\n\t\t}\n\t\tlet { x, y } = value;\n\t\tx = Math.round( x );\n\t\ty = Math.round( y );\n\t\tconst finishedMoving = x === 0 && y === 0;\n\t\tref.current.style.transformOrigin = 'center center';\n\t\tref.current.style.transform = finishedMoving\n\t\t\t? undefined\n\t\t\t: `translate3d(${ x }px,${ y }px,0)`;\n\t\tref.current.style.zIndex = isSelected ? '1' : '';\n\n\t\tpreserveScrollPosition();\n\t}\n\n\tuseSpring( {\n\t\tfrom: {\n\t\t\tx: transform.x,\n\t\t\ty: transform.y,\n\t\t},\n\t\tto: {\n\t\t\tx: 0,\n\t\t\ty: 0,\n\t\t},\n\t\treset: triggeredAnimation !== finishedAnimation,\n\t\tconfig: { mass: 5, tension: 2000, friction: 200 },\n\t\timmediate: prefersReducedMotion,\n\t\tonChange,\n\t} );\n\n\treturn ref;\n}\n\nexport default useMovingAnimation;\n"]}
@@ -176,8 +176,7 @@ function onHTMLDrop(targetRootClientId, targetBlockIndex, insertOrReplaceBlocks)
176
176
  */
177
177
 
178
178
 
179
- function useOnBlockDrop(targetRootClientId, targetBlockIndex) {
180
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
179
+ function useOnBlockDrop(targetRootClientId, targetBlockIndex, options = {}) {
181
180
  const {
182
181
  operation = 'insert'
183
182
  } = options;
@@ -198,10 +197,7 @@ function useOnBlockDrop(targetRootClientId, targetBlockIndex) {
198
197
  removeBlocks
199
198
  } = (0, _data.useDispatch)(_store.store);
200
199
  const registry = (0, _data.useRegistry)();
201
- const insertOrReplaceBlocks = (0, _element.useCallback)(function (blocks) {
202
- let updateSelection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
203
- let initialPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
204
-
200
+ const insertOrReplaceBlocks = (0, _element.useCallback)((blocks, updateSelection = true, initialPosition = 0) => {
205
201
  if (operation === 'replace') {
206
202
  const clientIds = getBlockOrder(targetRootClientId);
207
203
  const clientId = clientIds[targetBlockIndex];
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-on-block-drop/index.js"],"names":["parseDropEvent","event","result","srcRootClientId","srcClientIds","srcIndex","type","blocks","dataTransfer","Object","assign","JSON","parse","getData","err","onBlockDrop","targetRootClientId","targetBlockIndex","getBlockIndex","getClientIdsOfDescendants","moveBlocks","insertOrReplaceBlocks","clearSelectedBlock","sourceRootClientId","sourceClientIds","dropType","blocksToInsert","map","block","sourceBlockIndex","includes","some","id","isAtSameLevel","draggedBlockCount","length","insertIndex","onFilesDrop","hasUploadPermissions","updateBlockAttributes","canInsertBlockType","files","transformation","transform","blockName","isMatch","onHTMLDrop","HTML","mode","useOnBlockDrop","options","operation","select","blockEditorStore","getSettings","mediaUpload","getBlockOrder","getBlocksByClientId","insertBlocks","moveBlocksToPosition","replaceBlocks","removeBlocks","registry","updateSelection","initialPosition","clientIds","clientId","undefined","sourceBlocks","targetBlockClientIds","targetBlockClientId","batch","_onDrop","_onFilesDrop","_onHTMLDrop","html"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAMA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAWA;AACA;AACA;;AAGA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAAyBC,KAAzB,EAAiC;AACvC,MAAIC,MAAM,GAAG;AACZ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1BC,gBAF0B,EAG1BC,aAH0B,EAI1BC,yBAJ0B,EAK1BC,UAL0B,EAM1BC,qBAN0B,EAO1BC,kBAP0B,CAA3B;;AASA,QAAMmD,YAAY,GAAGpC,WAAW,CAC/BrB,kBAD+B,EAE/BC,gBAF+B,EAG/BqB,oBAH+B,EAI/BC,qBAJ+B,EAK/BC,kBAL+B,EAM/BnB,qBAN+B,CAAhC;;AAQA,QAAMqD,WAAW,GAAG5B,UAAU,CAC7B9B,kBAD6B,EAE7BC,gBAF6B,EAG7BI,qBAH6B,CAA9B;;AAMA,SAASpB,KAAF,IAAa;AACnB,UAAMwC,KAAK,GAAG,mCAA0BxC,KAAK,CAACO,YAAhC,CAAd;AACA,UAAMmE,IAAI,GAAG1E,KAAK,CAACO,YAAN,CAAmBK,OAAnB,CAA4B,WAA5B,CAAb;AAEA;AACF;AACA;AACA;;AACE,QAAK8D,IAAL,EAAY;AACXD,MAAAA,WAAW,CAAEC,IAAF,CAAX;AACA,KAFD,MAEO,IAAKlC,KAAK,CAACN,MAAX,EAAoB;AAC1BsC,MAAAA,YAAY,CAAEhC,KAAF,CAAZ;AACA,KAFM,MAEA;AACN+B,MAAAA,OAAO,CAAEvE,KAAF,CAAP;AACA;AACD,GAfD;AAgBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport {\n\tcloneBlock,\n\tfindTransform,\n\tgetBlockTransforms,\n\tpasteHandler,\n} from '@wordpress/blocks';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { getFilesFromDataTransfer } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */\n/** @typedef {import('./types').WPDropOperation} WPDropOperation */\n\n/**\n * Retrieve the data for a block drop event.\n *\n * @param {WPSyntheticEvent} event The drop event.\n *\n * @return {Object} An object with block drag and drop data.\n */\nexport function parseDropEvent( event ) {\n\tlet result = {\n\t\tsrcRootClientId: null,\n\t\tsrcClientIds: null,\n\t\tsrcIndex: null,\n\t\ttype: null,\n\t\tblocks: null,\n\t};\n\n\tif ( ! event.dataTransfer ) {\n\t\treturn result;\n\t}\n\n\ttry {\n\t\tresult = Object.assign(\n\t\t\tresult,\n\t\t\tJSON.parse( event.dataTransfer.getData( 'wp-blocks' ) )\n\t\t);\n\t} catch ( err ) {\n\t\treturn result;\n\t}\n\n\treturn result;\n}\n\n/**\n * A function that returns an event handler function for block drop events.\n *\n * @param {string} targetRootClientId The root client id where the block(s) will be inserted.\n * @param {number} targetBlockIndex The index where the block(s) will be inserted.\n * @param {Function} getBlockIndex A function that gets the index of a block.\n * @param {Function} getClientIdsOfDescendants A function that gets the client ids of descendant blocks.\n * @param {Function} moveBlocks A function that moves blocks.\n * @param {Function} insertOrReplaceBlocks A function that inserts or replaces blocks.\n * @param {Function} clearSelectedBlock A function that clears block selection.\n * @return {Function} The event handler for a block drop event.\n */\nexport function onBlockDrop(\n\ttargetRootClientId,\n\ttargetBlockIndex,\n\tgetBlockIndex,\n\tgetClientIdsOfDescendants,\n\tmoveBlocks,\n\tinsertOrReplaceBlocks,\n\tclearSelectedBlock\n) {\n\treturn ( event ) => {\n\t\tconst {\n\t\t\tsrcRootClientId: sourceRootClientId,\n\t\t\tsrcClientIds: sourceClientIds,\n\t\t\ttype: dropType,\n\t\t\tblocks,\n\t\t} = parseDropEvent( event );\n\n\t\t// If the user is inserting a block.\n\t\tif ( dropType === 'inserter' ) {\n\t\t\tclearSelectedBlock();\n\t\t\tconst blocksToInsert = blocks.map( ( block ) =>\n\t\t\t\tcloneBlock( block )\n\t\t\t);\n\t\t\tinsertOrReplaceBlocks( blocksToInsert, true, null );\n\t\t}\n\n\t\t// If the user is moving a block.\n\t\tif ( dropType === 'block' ) {\n\t\t\tconst sourceBlockIndex = getBlockIndex( sourceClientIds[ 0 ] );\n\n\t\t\t// If the user is dropping to the same position, return early.\n\t\t\tif (\n\t\t\t\tsourceRootClientId === targetRootClientId &&\n\t\t\t\tsourceBlockIndex === targetBlockIndex\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the user is attempting to drop a block within its own\n\t\t\t// nested blocks, return early as this would create infinite\n\t\t\t// recursion.\n\t\t\tif (\n\t\t\t\tsourceClientIds.includes( targetRootClientId ) ||\n\t\t\t\tgetClientIdsOfDescendants( sourceClientIds ).some(\n\t\t\t\t\t( id ) => id === targetRootClientId\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isAtSameLevel = sourceRootClientId === targetRootClientId;\n\t\t\tconst draggedBlockCount = sourceClientIds.length;\n\n\t\t\t// If the block is kept at the same level and moved downwards,\n\t\t\t// subtract to take into account that the blocks being dragged\n\t\t\t// were removed from the block list above the insertion point.\n\t\t\tconst insertIndex =\n\t\t\t\tisAtSameLevel && sourceBlockIndex < targetBlockIndex\n\t\t\t\t\t? targetBlockIndex - draggedBlockCount\n\t\t\t\t\t: targetBlockIndex;\n\n\t\t\tmoveBlocks( sourceClientIds, sourceRootClientId, insertIndex );\n\t\t}\n\t};\n}\n\n/**\n * A function that returns an event handler function for block-related file drop events.\n *\n * @param {string} targetRootClientId The root client id where the block(s) will be inserted.\n * @param {number} targetBlockIndex The index where the block(s) will be inserted.\n * @param {boolean} hasUploadPermissions Whether the user has upload permissions.\n * @param {Function} updateBlockAttributes A function that updates a block's attributes.\n * @param {Function} canInsertBlockType A function that returns checks whether a block type can be inserted.\n * @param {Function} insertOrReplaceBlocks A function that inserts or replaces blocks.\n *\n * @return {Function} The event handler for a block-related file drop event.\n */\nexport function onFilesDrop(\n\ttargetRootClientId,\n\ttargetBlockIndex,\n\thasUploadPermissions,\n\tupdateBlockAttributes,\n\tcanInsertBlockType,\n\tinsertOrReplaceBlocks\n) {\n\treturn ( files ) => {\n\t\tif ( ! hasUploadPermissions ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst transformation = findTransform(\n\t\t\tgetBlockTransforms( 'from' ),\n\t\t\t( transform ) =>\n\t\t\t\ttransform.type === 'files' &&\n\t\t\t\tcanInsertBlockType( transform.blockName, targetRootClientId ) &&\n\t\t\t\ttransform.isMatch( files )\n\t\t);\n\n\t\tif ( transformation ) {\n\t\t\tconst blocks = transformation.transform(\n\t\t\t\tfiles,\n\t\t\t\tupdateBlockAttributes\n\t\t\t);\n\t\t\tinsertOrReplaceBlocks( blocks );\n\t\t}\n\t};\n}\n\n/**\n * A function that returns an event handler function for block-related HTML drop events.\n *\n * @param {string} targetRootClientId The root client id where the block(s) will be inserted.\n * @param {number} targetBlockIndex The index where the block(s) will be inserted.\n * @param {Function} insertOrReplaceBlocks A function that inserts or replaces blocks.\n *\n * @return {Function} The event handler for a block-related HTML drop event.\n */\nexport function onHTMLDrop(\n\ttargetRootClientId,\n\ttargetBlockIndex,\n\tinsertOrReplaceBlocks\n) {\n\treturn ( HTML ) => {\n\t\tconst blocks = pasteHandler( { HTML, mode: 'BLOCKS' } );\n\n\t\tif ( blocks.length ) {\n\t\t\tinsertOrReplaceBlocks( blocks );\n\t\t}\n\t};\n}\n\n/**\n * A React hook for handling block drop events.\n *\n * @param {string} targetRootClientId The root client id where the block(s) will be inserted.\n * @param {number} targetBlockIndex The index where the block(s) will be inserted.\n * @param {Object} options The optional options.\n * @param {WPDropOperation} [options.operation] The type of operation to perform on drop. Could be `insert` or `replace` for now.\n *\n * @return {Function} A function to be passed to the onDrop handler.\n */\nexport default function useOnBlockDrop(\n\ttargetRootClientId,\n\ttargetBlockIndex,\n\toptions = {}\n) {\n\tconst { operation = 'insert' } = options;\n\tconst hasUploadPermissions = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings().mediaUpload,\n\t\t[]\n\t);\n\tconst {\n\t\tcanInsertBlockType,\n\t\tgetBlockIndex,\n\t\tgetClientIdsOfDescendants,\n\t\tgetBlockOrder,\n\t\tgetBlocksByClientId,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\tinsertBlocks,\n\t\tmoveBlocksToPosition,\n\t\tupdateBlockAttributes,\n\t\tclearSelectedBlock,\n\t\treplaceBlocks,\n\t\tremoveBlocks,\n\t} = useDispatch( blockEditorStore );\n\tconst registry = useRegistry();\n\n\tconst insertOrReplaceBlocks = useCallback(\n\t\t( blocks, updateSelection = true, initialPosition = 0 ) => {\n\t\t\tif ( operation === 'replace' ) {\n\t\t\t\tconst clientIds = getBlockOrder( targetRootClientId );\n\t\t\t\tconst clientId = clientIds[ targetBlockIndex ];\n\n\t\t\t\treplaceBlocks( clientId, blocks, undefined, initialPosition );\n\t\t\t} else {\n\t\t\t\tinsertBlocks(\n\t\t\t\t\tblocks,\n\t\t\t\t\ttargetBlockIndex,\n\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\tupdateSelection,\n\t\t\t\t\tinitialPosition\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\toperation,\n\t\t\tgetBlockOrder,\n\t\t\tinsertBlocks,\n\t\t\treplaceBlocks,\n\t\t\ttargetBlockIndex,\n\t\t\ttargetRootClientId,\n\t\t]\n\t);\n\n\tconst moveBlocks = useCallback(\n\t\t( sourceClientIds, sourceRootClientId, insertIndex ) => {\n\t\t\tif ( operation === 'replace' ) {\n\t\t\t\tconst sourceBlocks = getBlocksByClientId( sourceClientIds );\n\t\t\t\tconst targetBlockClientIds =\n\t\t\t\t\tgetBlockOrder( targetRootClientId );\n\t\t\t\tconst targetBlockClientId =\n\t\t\t\t\ttargetBlockClientIds[ targetBlockIndex ];\n\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t// Remove the source blocks.\n\t\t\t\t\tremoveBlocks( sourceClientIds, false );\n\t\t\t\t\t// Replace the target block with the source blocks.\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\ttargetBlockClientId,\n\t\t\t\t\t\tsourceBlocks,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t0\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\tsourceClientIds,\n\t\t\t\t\tsourceRootClientId,\n\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\tinsertIndex\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\toperation,\n\t\t\tgetBlockOrder,\n\t\t\tgetBlocksByClientId,\n\t\t\tinsertBlocks,\n\t\t\tmoveBlocksToPosition,\n\t\t\tremoveBlocks,\n\t\t\ttargetBlockIndex,\n\t\t\ttargetRootClientId,\n\t\t]\n\t);\n\n\tconst _onDrop = onBlockDrop(\n\t\ttargetRootClientId,\n\t\ttargetBlockIndex,\n\t\tgetBlockIndex,\n\t\tgetClientIdsOfDescendants,\n\t\tmoveBlocks,\n\t\tinsertOrReplaceBlocks,\n\t\tclearSelectedBlock\n\t);\n\tconst _onFilesDrop = onFilesDrop(\n\t\ttargetRootClientId,\n\t\ttargetBlockIndex,\n\t\thasUploadPermissions,\n\t\tupdateBlockAttributes,\n\t\tcanInsertBlockType,\n\t\tinsertOrReplaceBlocks\n\t);\n\tconst _onHTMLDrop = onHTMLDrop(\n\t\ttargetRootClientId,\n\t\ttargetBlockIndex,\n\t\tinsertOrReplaceBlocks\n\t);\n\n\treturn ( event ) => {\n\t\tconst files = getFilesFromDataTransfer( event.dataTransfer );\n\t\tconst html = event.dataTransfer.getData( 'text/html' );\n\n\t\t/**\n\t\t * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.\n\t\t * The order of the checks is important to recognise the HTML drop.\n\t\t */\n\t\tif ( html ) {\n\t\t\t_onHTMLDrop( html );\n\t\t} else if ( files.length ) {\n\t\t\t_onFilesDrop( files );\n\t\t} else {\n\t\t\t_onDrop( event );\n\t\t}\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/use-on-block-drop/index.js"],"names":["parseDropEvent","event","result","srcRootClientId","srcClientIds","srcIndex","type","blocks","dataTransfer","Object","assign","JSON","parse","getData","err","onBlockDrop","targetRootClientId","targetBlockIndex","getBlockIndex","getClientIdsOfDescendants","moveBlocks","insertOrReplaceBlocks","clearSelectedBlock","sourceRootClientId","sourceClientIds","dropType","blocksToInsert","map","block","sourceBlockIndex","includes","some","id","isAtSameLevel","draggedBlockCount","length","insertIndex","onFilesDrop","hasUploadPermissions","updateBlockAttributes","canInsertBlockType","files","transformation","transform","blockName","isMatch","onHTMLDrop","HTML","mode","useOnBlockDrop","options","operation","select","blockEditorStore","getSettings","mediaUpload","getBlockOrder","getBlocksByClientId","insertBlocks","moveBlocksToPosition","replaceBlocks","removeBlocks","registry","updateSelection","initialPosition","clientIds","clientId","undefined","sourceBlocks","targetBlockClientIds","targetBlockClientId","batch","_onDrop","_onFilesDrop","_onHTMLDrop","html"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAMA;;AACA;;AAKA;;AAhBA;AACA;AACA;;AAWA;AACA;AACA;;AAGA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAAyBC,KAAzB,EAAiC;AACvC,MAAIC,MAAM,GAAG;AACZC,IAAAA,eAAe,EAAE,IADL;AAEZC,IAAAA,YAAY,EAAE,IAFF;AAGZC,IAAAA,QAAQ,EAAE,IAHE;AAIZC,IAAAA,IAAI,EAAE,IAJM;AAKZC,IAAAA,MAAM,EAAE;AALI,GAAb;;AAQA,MAAK,CAAEN,KAAK,CAACO,YAAb,EAA4B;AAC3B,WAAON,MAAP;AACA;;AAED,MAAI;AACHA,IAAAA,MAAM,GAAGO,MAAM,CAACC,MAAP,CACRR,MADQ,EAERS,IAAI,CAACC,KAAL,CAAYX,KAAK,CAACO,YAAN,CAAmBK,OAAnB,CAA4B,WAA5B,CAAZ,CAFQ,CAAT;AAIA,GALD,CAKE,OAAQC,GAAR,EAAc;AACf,WAAOZ,MAAP;AACA;;AAED,SAAOA,MAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASa,WAA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,CAAEC,IAAF,CAAX;AACA,KAFD,MAEO,IAAKlC,KAAK,CAACN,MAAX,EAAoB;AAC1BsC,MAAAA,YAAY,CAAEhC,KAAF,CAAZ;AACA,KAFM,MAEA;AACN+B,MAAAA,OAAO,CAAEvE,KAAF,CAAP;AACA;AACD,GAfD;AAgBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport {\n\tcloneBlock,\n\tfindTransform,\n\tgetBlockTransforms,\n\tpasteHandler,\n} from '@wordpress/blocks';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { getFilesFromDataTransfer } from '@wordpress/dom';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/** @typedef {import('@wordpress/element').WPSyntheticEvent} WPSyntheticEvent */\n/** @typedef {import('./types').WPDropOperation} WPDropOperation */\n\n/**\n * Retrieve the data for a block drop event.\n *\n * @param {WPSyntheticEvent} event The drop event.\n *\n * @return {Object} An object with block drag and drop data.\n */\nexport function parseDropEvent( event ) {\n\tlet result = {\n\t\tsrcRootClientId: null,\n\t\tsrcClientIds: null,\n\t\tsrcIndex: null,\n\t\ttype: null,\n\t\tblocks: null,\n\t};\n\n\tif ( ! event.dataTransfer ) {\n\t\treturn result;\n\t}\n\n\ttry {\n\t\tresult = Object.assign(\n\t\t\tresult,\n\t\t\tJSON.parse( event.dataTransfer.getData( 'wp-blocks' ) )\n\t\t);\n\t} catch ( err ) {\n\t\treturn result;\n\t}\n\n\treturn result;\n}\n\n/**\n * A function that returns an event handler function for block drop events.\n *\n * @param {string} targetRootClientId The root client id where the block(s) will be inserted.\n * @param {number} targetBlockIndex The index where the block(s) will be inserted.\n * @param {Function} getBlockIndex A function that gets the index of a block.\n * @param {Function} getClientIdsOfDescendants A function that gets the client ids of descendant blocks.\n * @param {Function} moveBlocks A function that moves blocks.\n * @param {Function} insertOrReplaceBlocks A function that inserts or replaces blocks.\n * @param {Function} clearSelectedBlock A function that clears block selection.\n * @return {Function} The event handler for a block drop event.\n */\nexport function onBlockDrop(\n\ttargetRootClientId,\n\ttargetBlockIndex,\n\tgetBlockIndex,\n\tgetClientIdsOfDescendants,\n\tmoveBlocks,\n\tinsertOrReplaceBlocks,\n\tclearSelectedBlock\n) {\n\treturn ( event ) => {\n\t\tconst {\n\t\t\tsrcRootClientId: sourceRootClientId,\n\t\t\tsrcClientIds: sourceClientIds,\n\t\t\ttype: dropType,\n\t\t\tblocks,\n\t\t} = parseDropEvent( event );\n\n\t\t// If the user is inserting a block.\n\t\tif ( dropType === 'inserter' ) {\n\t\t\tclearSelectedBlock();\n\t\t\tconst blocksToInsert = blocks.map( ( block ) =>\n\t\t\t\tcloneBlock( block )\n\t\t\t);\n\t\t\tinsertOrReplaceBlocks( blocksToInsert, true, null );\n\t\t}\n\n\t\t// If the user is moving a block.\n\t\tif ( dropType === 'block' ) {\n\t\t\tconst sourceBlockIndex = getBlockIndex( sourceClientIds[ 0 ] );\n\n\t\t\t// If the user is dropping to the same position, return early.\n\t\t\tif (\n\t\t\t\tsourceRootClientId === targetRootClientId &&\n\t\t\t\tsourceBlockIndex === targetBlockIndex\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the user is attempting to drop a block within its own\n\t\t\t// nested blocks, return early as this would create infinite\n\t\t\t// recursion.\n\t\t\tif (\n\t\t\t\tsourceClientIds.includes( targetRootClientId ) ||\n\t\t\t\tgetClientIdsOfDescendants( sourceClientIds ).some(\n\t\t\t\t\t( id ) => id === targetRootClientId\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isAtSameLevel = sourceRootClientId === targetRootClientId;\n\t\t\tconst draggedBlockCount = sourceClientIds.length;\n\n\t\t\t// If the block is kept at the same level and moved downwards,\n\t\t\t// subtract to take into account that the blocks being dragged\n\t\t\t// were removed from the block list above the insertion point.\n\t\t\tconst insertIndex =\n\t\t\t\tisAtSameLevel && sourceBlockIndex < targetBlockIndex\n\t\t\t\t\t? targetBlockIndex - draggedBlockCount\n\t\t\t\t\t: targetBlockIndex;\n\n\t\t\tmoveBlocks( sourceClientIds, sourceRootClientId, insertIndex );\n\t\t}\n\t};\n}\n\n/**\n * A function that returns an event handler function for block-related file drop events.\n *\n * @param {string} targetRootClientId The root client id where the block(s) will be inserted.\n * @param {number} targetBlockIndex The index where the block(s) will be inserted.\n * @param {boolean} hasUploadPermissions Whether the user has upload permissions.\n * @param {Function} updateBlockAttributes A function that updates a block's attributes.\n * @param {Function} canInsertBlockType A function that returns checks whether a block type can be inserted.\n * @param {Function} insertOrReplaceBlocks A function that inserts or replaces blocks.\n *\n * @return {Function} The event handler for a block-related file drop event.\n */\nexport function onFilesDrop(\n\ttargetRootClientId,\n\ttargetBlockIndex,\n\thasUploadPermissions,\n\tupdateBlockAttributes,\n\tcanInsertBlockType,\n\tinsertOrReplaceBlocks\n) {\n\treturn ( files ) => {\n\t\tif ( ! hasUploadPermissions ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst transformation = findTransform(\n\t\t\tgetBlockTransforms( 'from' ),\n\t\t\t( transform ) =>\n\t\t\t\ttransform.type === 'files' &&\n\t\t\t\tcanInsertBlockType( transform.blockName, targetRootClientId ) &&\n\t\t\t\ttransform.isMatch( files )\n\t\t);\n\n\t\tif ( transformation ) {\n\t\t\tconst blocks = transformation.transform(\n\t\t\t\tfiles,\n\t\t\t\tupdateBlockAttributes\n\t\t\t);\n\t\t\tinsertOrReplaceBlocks( blocks );\n\t\t}\n\t};\n}\n\n/**\n * A function that returns an event handler function for block-related HTML drop events.\n *\n * @param {string} targetRootClientId The root client id where the block(s) will be inserted.\n * @param {number} targetBlockIndex The index where the block(s) will be inserted.\n * @param {Function} insertOrReplaceBlocks A function that inserts or replaces blocks.\n *\n * @return {Function} The event handler for a block-related HTML drop event.\n */\nexport function onHTMLDrop(\n\ttargetRootClientId,\n\ttargetBlockIndex,\n\tinsertOrReplaceBlocks\n) {\n\treturn ( HTML ) => {\n\t\tconst blocks = pasteHandler( { HTML, mode: 'BLOCKS' } );\n\n\t\tif ( blocks.length ) {\n\t\t\tinsertOrReplaceBlocks( blocks );\n\t\t}\n\t};\n}\n\n/**\n * A React hook for handling block drop events.\n *\n * @param {string} targetRootClientId The root client id where the block(s) will be inserted.\n * @param {number} targetBlockIndex The index where the block(s) will be inserted.\n * @param {Object} options The optional options.\n * @param {WPDropOperation} [options.operation] The type of operation to perform on drop. Could be `insert` or `replace` for now.\n *\n * @return {Function} A function to be passed to the onDrop handler.\n */\nexport default function useOnBlockDrop(\n\ttargetRootClientId,\n\ttargetBlockIndex,\n\toptions = {}\n) {\n\tconst { operation = 'insert' } = options;\n\tconst hasUploadPermissions = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings().mediaUpload,\n\t\t[]\n\t);\n\tconst {\n\t\tcanInsertBlockType,\n\t\tgetBlockIndex,\n\t\tgetClientIdsOfDescendants,\n\t\tgetBlockOrder,\n\t\tgetBlocksByClientId,\n\t} = useSelect( blockEditorStore );\n\tconst {\n\t\tinsertBlocks,\n\t\tmoveBlocksToPosition,\n\t\tupdateBlockAttributes,\n\t\tclearSelectedBlock,\n\t\treplaceBlocks,\n\t\tremoveBlocks,\n\t} = useDispatch( blockEditorStore );\n\tconst registry = useRegistry();\n\n\tconst insertOrReplaceBlocks = useCallback(\n\t\t( blocks, updateSelection = true, initialPosition = 0 ) => {\n\t\t\tif ( operation === 'replace' ) {\n\t\t\t\tconst clientIds = getBlockOrder( targetRootClientId );\n\t\t\t\tconst clientId = clientIds[ targetBlockIndex ];\n\n\t\t\t\treplaceBlocks( clientId, blocks, undefined, initialPosition );\n\t\t\t} else {\n\t\t\t\tinsertBlocks(\n\t\t\t\t\tblocks,\n\t\t\t\t\ttargetBlockIndex,\n\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\tupdateSelection,\n\t\t\t\t\tinitialPosition\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\toperation,\n\t\t\tgetBlockOrder,\n\t\t\tinsertBlocks,\n\t\t\treplaceBlocks,\n\t\t\ttargetBlockIndex,\n\t\t\ttargetRootClientId,\n\t\t]\n\t);\n\n\tconst moveBlocks = useCallback(\n\t\t( sourceClientIds, sourceRootClientId, insertIndex ) => {\n\t\t\tif ( operation === 'replace' ) {\n\t\t\t\tconst sourceBlocks = getBlocksByClientId( sourceClientIds );\n\t\t\t\tconst targetBlockClientIds =\n\t\t\t\t\tgetBlockOrder( targetRootClientId );\n\t\t\t\tconst targetBlockClientId =\n\t\t\t\t\ttargetBlockClientIds[ targetBlockIndex ];\n\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\t// Remove the source blocks.\n\t\t\t\t\tremoveBlocks( sourceClientIds, false );\n\t\t\t\t\t// Replace the target block with the source blocks.\n\t\t\t\t\treplaceBlocks(\n\t\t\t\t\t\ttargetBlockClientId,\n\t\t\t\t\t\tsourceBlocks,\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\t0\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tmoveBlocksToPosition(\n\t\t\t\t\tsourceClientIds,\n\t\t\t\t\tsourceRootClientId,\n\t\t\t\t\ttargetRootClientId,\n\t\t\t\t\tinsertIndex\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\toperation,\n\t\t\tgetBlockOrder,\n\t\t\tgetBlocksByClientId,\n\t\t\tinsertBlocks,\n\t\t\tmoveBlocksToPosition,\n\t\t\tremoveBlocks,\n\t\t\ttargetBlockIndex,\n\t\t\ttargetRootClientId,\n\t\t]\n\t);\n\n\tconst _onDrop = onBlockDrop(\n\t\ttargetRootClientId,\n\t\ttargetBlockIndex,\n\t\tgetBlockIndex,\n\t\tgetClientIdsOfDescendants,\n\t\tmoveBlocks,\n\t\tinsertOrReplaceBlocks,\n\t\tclearSelectedBlock\n\t);\n\tconst _onFilesDrop = onFilesDrop(\n\t\ttargetRootClientId,\n\t\ttargetBlockIndex,\n\t\thasUploadPermissions,\n\t\tupdateBlockAttributes,\n\t\tcanInsertBlockType,\n\t\tinsertOrReplaceBlocks\n\t);\n\tconst _onHTMLDrop = onHTMLDrop(\n\t\ttargetRootClientId,\n\t\ttargetBlockIndex,\n\t\tinsertOrReplaceBlocks\n\t);\n\n\treturn ( event ) => {\n\t\tconst files = getFilesFromDataTransfer( event.dataTransfer );\n\t\tconst html = event.dataTransfer.getData( 'text/html' );\n\n\t\t/**\n\t\t * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML.\n\t\t * The order of the checks is important to recognise the HTML drop.\n\t\t */\n\t\tif ( html ) {\n\t\t\t_onHTMLDrop( html );\n\t\t} else if ( files.length ) {\n\t\t\t_onFilesDrop( files );\n\t\t} else {\n\t\t\t_onDrop( event );\n\t\t}\n\t};\n}\n"]}
@@ -31,16 +31,14 @@ var _store = require("../../store");
31
31
  * @return {Function} The event handler for a block drop event.
32
32
  */
33
33
  function onBlockDrop(getBlockIndex, getClientIdsOfDescendants, moveBlocksToPosition, insertBlocks, clearSelectedBlock) {
34
- return _ref => {
35
- let {
36
- blocks,
37
- srcClientIds: sourceClientIds,
38
- srcRootClientId: sourceRootClientId,
39
- targetBlockIndex,
40
- targetRootClientId,
41
- type: dropType
42
- } = _ref;
43
-
34
+ return ({
35
+ blocks,
36
+ srcClientIds: sourceClientIds,
37
+ srcRootClientId: sourceRootClientId,
38
+ targetBlockIndex,
39
+ targetRootClientId,
40
+ type: dropType
41
+ }) => {
44
42
  // If the user is inserting a block.
45
43
  if (dropType === 'inserter') {
46
44
  clearSelectedBlock();
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-on-block-drop/index.native.js"],"names":["onBlockDrop","getBlockIndex","getClientIdsOfDescendants","moveBlocksToPosition","insertBlocks","clearSelectedBlock","blocks","srcClientIds","sourceClientIds","srcRootClientId","sourceRootClientId","targetBlockIndex","targetRootClientId","type","dropType","blocksToInsert","map","block","sourceBlockIndex","includes","some","id","isAtSameL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A0B3B;AACA;AACA;;AACA,YAAMC,WAAW,GAChBH,aAAa,IAAIJ,gBAAgB,GAAGP,gBAApC,GACGA,gBAAgB,GAAGY,iBADtB,GAEGZ,gBAHJ;AAKAR,MAAAA,oBAAoB,CACnBK,eADmB,EAEnBE,kBAFmB,EAGnBE,kBAHmB,EAInBa,WAJmB,CAApB;AAMA;AACD,GAjED;AAkEA;AAED;AACA;AACA;AACA;AACA;;;AACe,SAASC,cAAT,GAA0B;AACxC,QAAM;AAAEzB,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MACL,qBAAWyB,YAAX,CADD;AAEA,QAAM;AAAEvB,IAAAA,YAAF;AAAgBD,IAAAA,oBAAhB;AAAsCE,IAAAA;AAAtC,MACL,uBAAasB,YAAb,CADD;AAGA,SAAO3B,WAAW,CACjBC,aADiB,EAEjBC,yBAFiB,EAGjBC,oBAHiB,EAIjBC,YAJiB,EAKjBC,kBALiB,CAAlB;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { cloneBlock } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * A function that returns an event handler function for block drop events.\n *\n * @param {Function} getBlockIndex A function that gets the index of a block.\n * @param {Function} getClientIdsOfDescendants A function that gets the client ids of descendant blocks.\n * @param {Function} moveBlocksToPosition A function that moves blocks.\n * @param {Function} insertBlocks A function that inserts blocks.\n * @param {Function} clearSelectedBlock A function that clears block selection.\n * @return {Function} The event handler for a block drop event.\n */\nexport function onBlockDrop(\n\tgetBlockIndex,\n\tgetClientIdsOfDescendants,\n\tmoveBlocksToPosition,\n\tinsertBlocks,\n\tclearSelectedBlock\n) {\n\treturn ( {\n\t\tblocks,\n\t\tsrcClientIds: sourceClientIds,\n\t\tsrcRootClientId: sourceRootClientId,\n\t\ttargetBlockIndex,\n\t\ttargetRootClientId,\n\t\ttype: dropType,\n\t} ) => {\n\t\t// If the user is inserting a block.\n\t\tif ( dropType === 'inserter' ) {\n\t\t\tclearSelectedBlock();\n\t\t\tconst blocksToInsert = blocks.map( ( block ) =>\n\t\t\t\tcloneBlock( block )\n\t\t\t);\n\t\t\tinsertBlocks(\n\t\t\t\tblocksToInsert,\n\t\t\t\ttargetBlockIndex,\n\t\t\t\ttargetRootClientId,\n\t\t\t\ttrue,\n\t\t\t\tnull\n\t\t\t);\n\t\t}\n\n\t\t// If the user is moving a block.\n\t\tif ( dropType === 'block' ) {\n\t\t\tconst sourceBlockIndex = getBlockIndex( sourceClientIds[ 0 ] );\n\n\t\t\t// If the user is dropping to the same position, return early.\n\t\t\tif (\n\t\t\t\tsourceRootClientId === targetRootClientId &&\n\t\t\t\tsourceBlockIndex === targetBlockIndex\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the user is attempting to drop a block within its own\n\t\t\t// nested blocks, return early as this would create infinite\n\t\t\t// recursion.\n\t\t\tif (\n\t\t\t\tsourceClientIds.includes( targetRootClientId ) ||\n\t\t\t\tgetClientIdsOfDescendants( sourceClientIds ).some(\n\t\t\t\t\t( id ) => id === targetRootClientId\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isAtSameLevel = sourceRootClientId === targetRootClientId;\n\t\t\tconst draggedBlockCount = sourceClientIds.length;\n\n\t\t\t// If the block is kept at the same level and moved downwards,\n\t\t\t// subtract to take into account that the blocks being dragged\n\t\t\t// were removed from the block list above the insertion point.\n\t\t\tconst insertIndex =\n\t\t\t\tisAtSameLevel && sourceBlockIndex < targetBlockIndex\n\t\t\t\t\t? targetBlockIndex - draggedBlockCount\n\t\t\t\t\t: targetBlockIndex;\n\n\t\t\tmoveBlocksToPosition(\n\t\t\t\tsourceClientIds,\n\t\t\t\tsourceRootClientId,\n\t\t\t\ttargetRootClientId,\n\t\t\t\tinsertIndex\n\t\t\t);\n\t\t}\n\t};\n}\n\n/**\n * A React hook for handling block drop events.\n *\n * @return {Function} The event handler for a block drop event.\n */\nexport default function useOnBlockDrop() {\n\tconst { getBlockIndex, getClientIdsOfDescendants } =\n\t\tuseSelect( blockEditorStore );\n\tconst { insertBlocks, moveBlocksToPosition, clearSelectedBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\treturn onBlockDrop(\n\t\tgetBlockIndex,\n\t\tgetClientIdsOfDescendants,\n\t\tmoveBlocksToPosition,\n\t\tinsertBlocks,\n\t\tclearSelectedBlock\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/use-on-block-drop/index.native.js"],"names":["onBlockDrop","getBlockIndex","getClientIdsOfDescendants","moveBlocksToPosition","insertBlocks","clearSelectedBlock","blocks","srcClientIds","sourceClientIds","srcRootClientId","sourceRootClientId","targetBlockIndex","targetRootClientId","type","dropType","blocksToInsert","map","block","sourceBlockIndex","includes","some","id","isAtSameLevel","draggedBlockCount","length","insertIndex","useOnBlockDrop","blockEditorStore"],"mappings":";;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,WAAT,CACNC,aADM,EAENC,yBAFM,EAGNC,oBAHM,EAINC,YAJM,EAKNC,kBALM,EAML;AACD,SAAO,CAAE;AACRC,IAAAA,MADQ;AAERC,IAAAA,YAAY,EAAEC,eAFN;AAGRC,IAAAA,eAAe,EAAEC,kBAHT;AAIRC,IAAAA,gBAJQ;AAKRC,IAAAA,kBALQ;AAMRC,IAAAA,IAAI,EAAEC;AANE,GAAF,KAOA;AACN;AACA,QAAKA,QAAQ,KAAK,UAAlB,EAA+B;AAC9BT,MAAAA,kBAAkB;AAClB,YAAMU,cAAc,GAAGT,MAAM,CAACU,GAAP,CAAcC,KAAF,IAClC,wBAAYA,KAAZ,CADsB,CAAvB;AAGAb,MAAAA,YAAY,CACXW,cADW,EAEXJ,gBAFW,EAGXC,kBAHW,EAIX,IAJW,EAKX,IALW,CAAZ;AAOA,KAdK,CAgBN;;;AACA,QAAKE,QAAQ,KAAK,OAAlB,EAA4B;AAC3B,YAAMI,gBAAgB,GAAGjB,aAAa,CAAEO,eAAe,CAAE,CAAF,CAAjB,CAAtC,CAD2B,CAG3B;;AACA,UACCE,kBAAkB,KAAKE,kBAAvB,IACAM,gBAAgB,KAAKP,gBAFtB,EAGE;AACD;AACA,OAT0B,CAW3B;AACA;AACA;;;AACA,UACCH,eAAe,CAACW,QAAhB,CAA0BP,kBAA1B,KACAV,yBAAyB,CAAEM,eAAF,CAAzB,CAA6CY,IAA7C,CACGC,EAAF,IAAUA,EAAE,KAAKT,kBADlB,CAFD,EAKE;AACD;AACA;;AAED,YAAMU,aAAa,GAAGZ,kBAAkB,KAAKE,kBAA7C;AACA,YAAMW,iBAAiB,GAAGf,eAAe,CAACgB,MAA1C,CAxB2B,CA0B3B;AACA;AACA;;AACA,YAAMC,WAAW,GAChBH,aAAa,IAAIJ,gBAAgB,GAAGP,gBAApC,GACGA,gBAAgB,GAAGY,iBADtB,GAEGZ,gBAHJ;AAKAR,MAAAA,oBAAoB,CACnBK,eADmB,EAEnBE,kBAFmB,EAGnBE,kBAHmB,EAInBa,WAJmB,CAApB;AAMA;AACD,GAjED;AAkEA;AAED;AACA;AACA;AACA;AACA;;;AACe,SAASC,cAAT,GAA0B;AACxC,QAAM;AAAEzB,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MACL,qBAAWyB,YAAX,CADD;AAEA,QAAM;AAAEvB,IAAAA,YAAF;AAAgBD,IAAAA,oBAAhB;AAAsCE,IAAAA;AAAtC,MACL,uBAAasB,YAAb,CADD;AAGA,SAAO3B,WAAW,CACjBC,aADiB,EAEjBC,yBAFiB,EAGjBC,oBAHiB,EAIjBC,YAJiB,EAKjBC,kBALiB,CAAlB;AAOA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { cloneBlock } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\n\n/**\n * A function that returns an event handler function for block drop events.\n *\n * @param {Function} getBlockIndex A function that gets the index of a block.\n * @param {Function} getClientIdsOfDescendants A function that gets the client ids of descendant blocks.\n * @param {Function} moveBlocksToPosition A function that moves blocks.\n * @param {Function} insertBlocks A function that inserts blocks.\n * @param {Function} clearSelectedBlock A function that clears block selection.\n * @return {Function} The event handler for a block drop event.\n */\nexport function onBlockDrop(\n\tgetBlockIndex,\n\tgetClientIdsOfDescendants,\n\tmoveBlocksToPosition,\n\tinsertBlocks,\n\tclearSelectedBlock\n) {\n\treturn ( {\n\t\tblocks,\n\t\tsrcClientIds: sourceClientIds,\n\t\tsrcRootClientId: sourceRootClientId,\n\t\ttargetBlockIndex,\n\t\ttargetRootClientId,\n\t\ttype: dropType,\n\t} ) => {\n\t\t// If the user is inserting a block.\n\t\tif ( dropType === 'inserter' ) {\n\t\t\tclearSelectedBlock();\n\t\t\tconst blocksToInsert = blocks.map( ( block ) =>\n\t\t\t\tcloneBlock( block )\n\t\t\t);\n\t\t\tinsertBlocks(\n\t\t\t\tblocksToInsert,\n\t\t\t\ttargetBlockIndex,\n\t\t\t\ttargetRootClientId,\n\t\t\t\ttrue,\n\t\t\t\tnull\n\t\t\t);\n\t\t}\n\n\t\t// If the user is moving a block.\n\t\tif ( dropType === 'block' ) {\n\t\t\tconst sourceBlockIndex = getBlockIndex( sourceClientIds[ 0 ] );\n\n\t\t\t// If the user is dropping to the same position, return early.\n\t\t\tif (\n\t\t\t\tsourceRootClientId === targetRootClientId &&\n\t\t\t\tsourceBlockIndex === targetBlockIndex\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// If the user is attempting to drop a block within its own\n\t\t\t// nested blocks, return early as this would create infinite\n\t\t\t// recursion.\n\t\t\tif (\n\t\t\t\tsourceClientIds.includes( targetRootClientId ) ||\n\t\t\t\tgetClientIdsOfDescendants( sourceClientIds ).some(\n\t\t\t\t\t( id ) => id === targetRootClientId\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isAtSameLevel = sourceRootClientId === targetRootClientId;\n\t\t\tconst draggedBlockCount = sourceClientIds.length;\n\n\t\t\t// If the block is kept at the same level and moved downwards,\n\t\t\t// subtract to take into account that the blocks being dragged\n\t\t\t// were removed from the block list above the insertion point.\n\t\t\tconst insertIndex =\n\t\t\t\tisAtSameLevel && sourceBlockIndex < targetBlockIndex\n\t\t\t\t\t? targetBlockIndex - draggedBlockCount\n\t\t\t\t\t: targetBlockIndex;\n\n\t\t\tmoveBlocksToPosition(\n\t\t\t\tsourceClientIds,\n\t\t\t\tsourceRootClientId,\n\t\t\t\ttargetRootClientId,\n\t\t\t\tinsertIndex\n\t\t\t);\n\t\t}\n\t};\n}\n\n/**\n * A React hook for handling block drop events.\n *\n * @return {Function} The event handler for a block drop event.\n */\nexport default function useOnBlockDrop() {\n\tconst { getBlockIndex, getClientIdsOfDescendants } =\n\t\tuseSelect( blockEditorStore );\n\tconst { insertBlocks, moveBlocksToPosition, clearSelectedBlock } =\n\t\tuseDispatch( blockEditorStore );\n\n\treturn onBlockDrop(\n\t\tgetBlockIndex,\n\t\tgetClientIdsOfDescendants,\n\t\tmoveBlocksToPosition,\n\t\tinsertBlocks,\n\t\tclearSelectedBlock\n\t);\n}\n"]}
@@ -82,9 +82,7 @@ const STYLE_ATTRIBUTES = {
82
82
  */
83
83
 
84
84
  function getStyleAttributes(sourceBlock, targetBlock) {
85
- return Object.entries(STYLE_ATTRIBUTES).reduce((attributes, _ref) => {
86
- let [attributeKey, hasSupport] = _ref;
87
-
85
+ return Object.entries(STYLE_ATTRIBUTES).reduce((attributes, [attributeKey, hasSupport]) => {
88
86
  // Only apply the attribute if both blocks support it.
89
87
  if (hasSupport(sourceBlock.name) && hasSupport(targetBlock.name)) {
90
88
  // Override attributes that are not present in the block to their defaults.
@@ -170,9 +168,7 @@ function usePasteStyles() {
170
168
  }
171
169
 
172
170
  if (targetBlocks.length === 1) {
173
- var _getBlockType;
174
-
175
- const title = (_getBlockType = (0, _blocks.getBlockType)(targetBlocks[0].name)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.title;
171
+ const title = (0, _blocks.getBlockType)(targetBlocks[0].name)?.title;
176
172
  createSuccessNotice((0, _i18n.sprintf)( // Translators: Name of the block being pasted, e.g. "Paragraph".
177
173
  (0, _i18n.__)('Pasted styles to %s.'), title), {
178
174
  type: 'snackbar'
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/use-paste-styles/index.js"],"names":["hasSerializedBlocks","text","blocks","__unstableSkipMigrationLogs","__unstableSkipAutop","length","name","err","STYLE_ATTRIBUTES","align","hasAlignSupport","borderColor","nameOrType","backgroundColor","hasBackgroundColorSupport","textColor","hasTextColorSupport","gradient","hasGradientSupport","className","hasCustomClassNameSupport","fontFamily","hasFontFamilySupport","fontSize","hasFontSizeSupport","layout","hasLayoutSupport","style","hasStyleSupport","getStyleAttributes","sourceBlock","targetBlock","Object","entries","reduce","attributes","attributeKey","hasSupport","recursivelyUpdateBlockAttributes","targetBlocks","sourceBlocks","updateBlockAttributes","index","Math","min","clientId","innerBlocks","usePasteStyles","registry","blockEditorStore","createSuccessNotice","createWarningNotice","createErrorNotice","noticesStore","html","window","navigator","clipboard","type","readText","error","copiedBlocks","batch","map","title"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAbA;AACA;AACA;;AAOA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,mBAAT,CAA8BC,IAA9B,EAAqC;AACpC,MAAI;AACH,UAAMC,MAAM,GAAG,mBAAOD,IAAP,EAAa;AAC3BE,MAAAA,2BAA2B,EAAE,IADF;AAE3BC,MAAAA,mBAAmB,EAAE;AAFM,KAAb,CAAf;;AAIA,QAAKF,MAAM,CAACG,MAAP,KAAkB,CAAlB,IAAuBH,MAAM,CAAE,CAAF,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CAAP;AA6FA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { getBlockType, parse } from '@wordpress/blocks';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport {\n\thasAlignSupport,\n\thasBorderSupport,\n\thasBackgroundColorSupport,\n\thasTextColorSupport,\n\thasGradientSupport,\n\thasCustomClassNameSupport,\n\thasFontFamilySupport,\n\thasFontSizeSupport,\n\thasLayoutSupport,\n\thasStyleSupport,\n} from '../../hooks/supports';\n\n/**\n * Determine if the copied text looks like serialized blocks or not.\n * Since plain text will always get parsed into a freeform block,\n * we check that if the parsed blocks is anything other than that.\n *\n * @param {string} text The copied text.\n * @return {boolean} True if the text looks like serialized blocks, false otherwise.\n */\nfunction hasSerializedBlocks( text ) {\n\ttry {\n\t\tconst blocks = parse( text, {\n\t\t\t__unstableSkipMigrationLogs: true,\n\t\t\t__unstableSkipAutop: true,\n\t\t} );\n\t\tif ( blocks.length === 1 && blocks[ 0 ].name === 'core/freeform' ) {\n\t\t\t// It's likely that the text is just plain text and not serialized blocks.\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} catch ( err ) {\n\t\t// Parsing error, the text is not serialized blocks.\n\t\t// (Even though that it technically won't happen)\n\t\treturn false;\n\t}\n}\n\n/**\n * Style attributes are attributes being added in `block-editor/src/hooks/*`.\n * (Except for some unrelated to style like `anchor` or `settings`.)\n * They generally represent the default block supports.\n */\nconst STYLE_ATTRIBUTES = {\n\talign: hasAlignSupport,\n\tborderColor: ( nameOrType ) => hasBorderSupport( nameOrType, 'color' ),\n\tbackgroundColor: hasBackgroundColorSupport,\n\ttextColor: hasTextColorSupport,\n\tgradient: hasGradientSupport,\n\tclassName: hasCustomClassNameSupport,\n\tfontFamily: hasFontFamilySupport,\n\tfontSize: hasFontSizeSupport,\n\tlayout: hasLayoutSupport,\n\tstyle: hasStyleSupport,\n};\n\n/**\n * Get the \"style attributes\" from a given block to a target block.\n *\n * @param {WPBlock} sourceBlock The source block.\n * @param {WPBlock} targetBlock The target block.\n * @return {Object} the filtered attributes object.\n */\nfunction getStyleAttributes( sourceBlock, targetBlock ) {\n\treturn Object.entries( STYLE_ATTRIBUTES ).reduce(\n\t\t( attributes, [ attributeKey, hasSupport ] ) => {\n\t\t\t// Only apply the attribute if both blocks support it.\n\t\t\tif (\n\t\t\t\thasSupport( sourceBlock.name ) &&\n\t\t\t\thasSupport( targetBlock.name )\n\t\t\t) {\n\t\t\t\t// Override attributes that are not present in the block to their defaults.\n\t\t\t\tattributes[ attributeKey ] =\n\t\t\t\t\tsourceBlock.attributes[ attributeKey ];\n\t\t\t}\n\t\t\treturn attributes;\n\t\t},\n\t\t{}\n\t);\n}\n\n/**\n * Update the target blocks with style attributes recursively.\n *\n * @param {WPBlock[]} targetBlocks The target blocks to be updated.\n * @param {WPBlock[]} sourceBlocks The source blocks to get th style attributes from.\n * @param {Function} updateBlockAttributes The function to update the attributes.\n */\nfunction recursivelyUpdateBlockAttributes(\n\ttargetBlocks,\n\tsourceBlocks,\n\tupdateBlockAttributes\n) {\n\tfor (\n\t\tlet index = 0;\n\t\tindex < Math.min( sourceBlocks.length, targetBlocks.length );\n\t\tindex += 1\n\t) {\n\t\tupdateBlockAttributes(\n\t\t\ttargetBlocks[ index ].clientId,\n\t\t\tgetStyleAttributes( sourceBlocks[ index ], targetBlocks[ index ] )\n\t\t);\n\n\t\trecursivelyUpdateBlockAttributes(\n\t\t\ttargetBlocks[ index ].innerBlocks,\n\t\t\tsourceBlocks[ index ].innerBlocks,\n\t\t\tupdateBlockAttributes\n\t\t);\n\t}\n}\n\n/**\n * A hook to return a pasteStyles event function for handling pasting styles to blocks.\n *\n * @return {Function} A function to update the styles to the blocks.\n */\nexport default function usePasteStyles() {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice, createWarningNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\treturn useCallback(\n\t\tasync ( targetBlocks ) => {\n\t\t\tlet html = '';\n\t\t\ttry {\n\t\t\t\t// `http:` sites won't have the clipboard property on navigator.\n\t\t\t\t// (with the exception of localhost.)\n\t\t\t\tif ( ! window.navigator.clipboard ) {\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\thtml = await window.navigator.clipboard.readText();\n\t\t\t} catch ( error ) {\n\t\t\t\t// Possibly the permission is denied.\n\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Unable to paste styles. Please allow browser clipboard permissions before continuing.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Abort if the copied text is empty or doesn't look like serialized blocks.\n\t\t\tif ( ! html || ! hasSerializedBlocks( html ) ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t\"Unable to paste styles. Block styles couldn't be found within the copied content.\"\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst copiedBlocks = parse( html );\n\n\t\t\tif ( copiedBlocks.length === 1 ) {\n\t\t\t\t// Apply styles of the block to all the target blocks.\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\trecursivelyUpdateBlockAttributes(\n\t\t\t\t\t\ttargetBlocks,\n\t\t\t\t\t\ttargetBlocks.map( () => copiedBlocks[ 0 ] ),\n\t\t\t\t\t\tupdateBlockAttributes\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\trecursivelyUpdateBlockAttributes(\n\t\t\t\t\t\ttargetBlocks,\n\t\t\t\t\t\tcopiedBlocks,\n\t\t\t\t\t\tupdateBlockAttributes\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( targetBlocks.length === 1 ) {\n\t\t\t\tconst title = getBlockType( targetBlocks[ 0 ].name )?.title;\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// Translators: Name of the block being pasted, e.g. \"Paragraph\".\n\t\t\t\t\t\t__( 'Pasted styles to %s.' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t),\n\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// Translators: The number of the blocks.\n\t\t\t\t\t\t__( 'Pasted styles to %d blocks.' ),\n\t\t\t\t\t\ttargetBlocks.length\n\t\t\t\t\t),\n\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tregistry.batch,\n\t\t\tupdateBlockAttributes,\n\t\t\tcreateSuccessNotice,\n\t\t\tcreateWarningNotice,\n\t\t\tcreateErrorNotice,\n\t\t]\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/use-paste-styles/index.js"],"names":["hasSerializedBlocks","text","blocks","__unstableSkipMigrationLogs","__unstableSkipAutop","length","name","err","STYLE_ATTRIBUTES","align","hasAlignSupport","borderColor","nameOrType","backgroundColor","hasBackgroundColorSupport","textColor","hasTextColorSupport","gradient","hasGradientSupport","className","hasCustomClassNameSupport","fontFamily","hasFontFamilySupport","fontSize","hasFontSizeSupport","layout","hasLayoutSupport","style","hasStyleSupport","getStyleAttributes","sourceBlock","targetBlock","Object","entries","reduce","attributes","attributeKey","hasSupport","recursivelyUpdateBlockAttributes","targetBlocks","sourceBlocks","updateBlockAttributes","index","Math","min","clientId","innerBlocks","usePasteStyles","registry","blockEditorStore","createSuccessNotice","createWarningNotice","createErrorNotice","noticesStore","html","window","navigator","clipboard","type","readText","error","copiedBlocks","batch","map","title"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAbA;AACA;AACA;;AAOA;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,mBAAT,CAA8BC,IAA9B,EAAqC;AACpC,MAAI;AACH,UAAMC,MAAM,GAAG,mBAAOD,IAAP,EAAa;AAC3BE,MAAAA,2BAA2B,EAAE,IADF;AAE3BC,MAAAA,mBAAmB,EAAE;AAFM,KAAb,CAAf;;AAIA,QAAKF,MAAM,CAACG,MAAP,KAAkB,CAAlB,IAAuBH,MAAM,CAAE,CAAF,CAAN,CAAYI,IAAZ,KAAqB,eAAjD,EAAmE;AAClE;AACA,aAAO,KAAP;AACA;;AACD,WAAO,IAAP;AACA,GAVD,CAUE,OAAQC,GAAR,EAAc;AACf;AACA;AACA,WAAO,KAAP;AACA;AACD;AAED;AACA;AACA;AACA;AACA;;;AACA,MAAMC,gBAAgB,GAAG;AACxBC,EAAAA,KAAK,EAAEC,yBADiB;AAExBC,EAAAA,WAAW,EAAIC,UAAF,IAAkB,gCAAkBA,UAAlB,EAA8B,OAA9B,CAFP;AAGxBC,EAAAA,eAAe,EAAEC,mCAHO;AAIxBC,EAAAA,SAAS,EAAEC,6BAJa;AAKxBC,EAAAA,QAAQ,EAAEC,4BALc;AAMxBC,EAAAA,SAAS,EAAEC,mCANa;AAOxBC,EAAAA,UAAU,EAAEC,8BAPY;AAQxBC,EAAAA,QAAQ,EAAEC,4BARc;AASxBC,EAAAA,MAAM,EAAEC,0BATgB;AAUxBC,EAAA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E/BsB,YAF+B,EAG/BpB,qBAH+B,CAAhC;AAKA,OAND;AAOA;;AAED,QAAKF,YAAY,CAAClC,MAAb,KAAwB,CAA7B,EAAiC;AAChC,YAAM2D,KAAK,GAAG,0BAAczB,YAAY,CAAE,CAAF,CAAZ,CAAkBjC,IAAhC,GAAwC0D,KAAtD;AACAd,MAAAA,mBAAmB,CAClB,oBACC;AACA,oBAAI,sBAAJ,CAFD,EAGCc,KAHD,CADkB,EAMlB;AAAEN,QAAAA,IAAI,EAAE;AAAR,OANkB,CAAnB;AAQA,KAVD,MAUO;AACNR,MAAAA,mBAAmB,CAClB,oBACC;AACA,oBAAI,6BAAJ,CAFD,EAGCX,YAAY,CAAClC,MAHd,CADkB,EAMlB;AAAEqD,QAAAA,IAAI,EAAE;AAAR,OANkB,CAAnB;AAQA;AACD,GApFK,EAqFN,CACCV,QAAQ,CAACc,KADV,EAECrB,qBAFD,EAGCS,mBAHD,EAICC,mBAJD,EAKCC,iBALD,CArFM,CAAP;AA6FA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useCallback } from '@wordpress/element';\nimport { getBlockType, parse } from '@wordpress/blocks';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport {\n\thasAlignSupport,\n\thasBorderSupport,\n\thasBackgroundColorSupport,\n\thasTextColorSupport,\n\thasGradientSupport,\n\thasCustomClassNameSupport,\n\thasFontFamilySupport,\n\thasFontSizeSupport,\n\thasLayoutSupport,\n\thasStyleSupport,\n} from '../../hooks/supports';\n\n/**\n * Determine if the copied text looks like serialized blocks or not.\n * Since plain text will always get parsed into a freeform block,\n * we check that if the parsed blocks is anything other than that.\n *\n * @param {string} text The copied text.\n * @return {boolean} True if the text looks like serialized blocks, false otherwise.\n */\nfunction hasSerializedBlocks( text ) {\n\ttry {\n\t\tconst blocks = parse( text, {\n\t\t\t__unstableSkipMigrationLogs: true,\n\t\t\t__unstableSkipAutop: true,\n\t\t} );\n\t\tif ( blocks.length === 1 && blocks[ 0 ].name === 'core/freeform' ) {\n\t\t\t// It's likely that the text is just plain text and not serialized blocks.\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t} catch ( err ) {\n\t\t// Parsing error, the text is not serialized blocks.\n\t\t// (Even though that it technically won't happen)\n\t\treturn false;\n\t}\n}\n\n/**\n * Style attributes are attributes being added in `block-editor/src/hooks/*`.\n * (Except for some unrelated to style like `anchor` or `settings`.)\n * They generally represent the default block supports.\n */\nconst STYLE_ATTRIBUTES = {\n\talign: hasAlignSupport,\n\tborderColor: ( nameOrType ) => hasBorderSupport( nameOrType, 'color' ),\n\tbackgroundColor: hasBackgroundColorSupport,\n\ttextColor: hasTextColorSupport,\n\tgradient: hasGradientSupport,\n\tclassName: hasCustomClassNameSupport,\n\tfontFamily: hasFontFamilySupport,\n\tfontSize: hasFontSizeSupport,\n\tlayout: hasLayoutSupport,\n\tstyle: hasStyleSupport,\n};\n\n/**\n * Get the \"style attributes\" from a given block to a target block.\n *\n * @param {WPBlock} sourceBlock The source block.\n * @param {WPBlock} targetBlock The target block.\n * @return {Object} the filtered attributes object.\n */\nfunction getStyleAttributes( sourceBlock, targetBlock ) {\n\treturn Object.entries( STYLE_ATTRIBUTES ).reduce(\n\t\t( attributes, [ attributeKey, hasSupport ] ) => {\n\t\t\t// Only apply the attribute if both blocks support it.\n\t\t\tif (\n\t\t\t\thasSupport( sourceBlock.name ) &&\n\t\t\t\thasSupport( targetBlock.name )\n\t\t\t) {\n\t\t\t\t// Override attributes that are not present in the block to their defaults.\n\t\t\t\tattributes[ attributeKey ] =\n\t\t\t\t\tsourceBlock.attributes[ attributeKey ];\n\t\t\t}\n\t\t\treturn attributes;\n\t\t},\n\t\t{}\n\t);\n}\n\n/**\n * Update the target blocks with style attributes recursively.\n *\n * @param {WPBlock[]} targetBlocks The target blocks to be updated.\n * @param {WPBlock[]} sourceBlocks The source blocks to get th style attributes from.\n * @param {Function} updateBlockAttributes The function to update the attributes.\n */\nfunction recursivelyUpdateBlockAttributes(\n\ttargetBlocks,\n\tsourceBlocks,\n\tupdateBlockAttributes\n) {\n\tfor (\n\t\tlet index = 0;\n\t\tindex < Math.min( sourceBlocks.length, targetBlocks.length );\n\t\tindex += 1\n\t) {\n\t\tupdateBlockAttributes(\n\t\t\ttargetBlocks[ index ].clientId,\n\t\t\tgetStyleAttributes( sourceBlocks[ index ], targetBlocks[ index ] )\n\t\t);\n\n\t\trecursivelyUpdateBlockAttributes(\n\t\t\ttargetBlocks[ index ].innerBlocks,\n\t\t\tsourceBlocks[ index ].innerBlocks,\n\t\t\tupdateBlockAttributes\n\t\t);\n\t}\n}\n\n/**\n * A hook to return a pasteStyles event function for handling pasting styles to blocks.\n *\n * @return {Function} A function to update the styles to the blocks.\n */\nexport default function usePasteStyles() {\n\tconst registry = useRegistry();\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { createSuccessNotice, createWarningNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\treturn useCallback(\n\t\tasync ( targetBlocks ) => {\n\t\t\tlet html = '';\n\t\t\ttry {\n\t\t\t\t// `http:` sites won't have the clipboard property on navigator.\n\t\t\t\t// (with the exception of localhost.)\n\t\t\t\tif ( ! window.navigator.clipboard ) {\n\t\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\thtml = await window.navigator.clipboard.readText();\n\t\t\t} catch ( error ) {\n\t\t\t\t// Possibly the permission is denied.\n\t\t\t\tcreateErrorNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'Unable to paste styles. Please allow browser clipboard permissions before continuing.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Abort if the copied text is empty or doesn't look like serialized blocks.\n\t\t\tif ( ! html || ! hasSerializedBlocks( html ) ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t\"Unable to paste styles. Block styles couldn't be found within the copied content.\"\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst copiedBlocks = parse( html );\n\n\t\t\tif ( copiedBlocks.length === 1 ) {\n\t\t\t\t// Apply styles of the block to all the target blocks.\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\trecursivelyUpdateBlockAttributes(\n\t\t\t\t\t\ttargetBlocks,\n\t\t\t\t\t\ttargetBlocks.map( () => copiedBlocks[ 0 ] ),\n\t\t\t\t\t\tupdateBlockAttributes\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tregistry.batch( () => {\n\t\t\t\t\trecursivelyUpdateBlockAttributes(\n\t\t\t\t\t\ttargetBlocks,\n\t\t\t\t\t\tcopiedBlocks,\n\t\t\t\t\t\tupdateBlockAttributes\n\t\t\t\t\t);\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tif ( targetBlocks.length === 1 ) {\n\t\t\t\tconst title = getBlockType( targetBlocks[ 0 ].name )?.title;\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// Translators: Name of the block being pasted, e.g. \"Paragraph\".\n\t\t\t\t\t\t__( 'Pasted styles to %s.' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t\t),\n\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// Translators: The number of the blocks.\n\t\t\t\t\t\t__( 'Pasted styles to %d blocks.' ),\n\t\t\t\t\t\ttargetBlocks.length\n\t\t\t\t\t),\n\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t);\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tregistry.batch,\n\t\t\tupdateBlockAttributes,\n\t\t\tcreateSuccessNotice,\n\t\t\tcreateWarningNotice,\n\t\t\tcreateErrorNotice,\n\t\t]\n\t);\n}\n"]}
@@ -9,8 +9,6 @@ exports.default = exports.VIDEO_ASPECT_RATIO = void 0;
9
9
 
10
10
  var _element = require("@wordpress/element");
11
11
 
12
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
13
-
14
12
  var _components = require("@wordpress/components");
15
13
 
16
14
  var _i18n = require("@wordpress/i18n");
@@ -107,7 +105,7 @@ class Video extends _element.Component {
107
105
  const showPlayButton = videoContainerHeight > 0;
108
106
  return (0, _element.createElement)(_reactNative.View, {
109
107
  style: _styles.default.videoContainer
110
- }, (0, _element.createElement)(_reactNativeVideo.default, (0, _extends2.default)({}, this.props, {
108
+ }, (0, _element.createElement)(_reactNativeVideo.default, { ...this.props,
111
109
  ref: ref => {
112
110
  this.player = ref;
113
111
  } // Using built-in player controls is messing up the layout on iOS.
@@ -128,7 +126,7 @@ class Video extends _element.Component {
128
126
  isFullScreen: false
129
127
  });
130
128
  }
131
- })), showPlayButton && // If we add the play icon as a subview to VideoPlayer then react-native-video decides to show control buttons
129
+ }), showPlayButton && // If we add the play icon as a subview to VideoPlayer then react-native-video decides to show control buttons
132
130
  // even if we set controls={ false }, so we are adding our play button as a sibling overlay view.
133
131
  (0, _element.createElement)(_reactNative.TouchableOpacity, {
134
132
  disabled: !isSelected,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/video-player/index.native.js"],"names":["VIDEO_ASPECT_RATIO","Video","Component","constructor","arguments","isIOS","Platform","OS","state","isFullScreen","videoContainerHeight","onPressPlay","bind","onVideoLayout","event","height","nativeEvent","layout","setState","player","presentFullscreenPlayer","source","props","uri","openURL","url","Linking","canOpenURL","then","supported","Alert","alert","window","console","warn","catch","err","error","render","isSelected","style","showPlayButton","styles","videoContainer","ref","overlayContainer","blackOverlay","PlayIcon","playIcon","size"],"mappings":";;;;;;;;;AAGA;;;;AACA;;AACA;;AAKA;;AACA;;AAKA;;AACA;;AAjBA;AACA;AACA;;AAKA;AACA;AACA;;AAIA;AACA;AACA;AAIA;AACO,MAAMA,kBAAkB,GAAG,KAAK,CAAhC;;;AAEP,MAAMC,KAAN,SAAoBC,kBAApB,CAA8B;AAC7BC,EAAAA,WAAW,GAAG;AACb,UAAO,GAAGC,SAAV;AACA,SAAKC,KAAL,GAAaC,sBAASC,EAAT,KAAgB,KAA7B;AACA,SAAKC,KAAL,GAAa;AACZC,MAAAA,YAAY,EAAE,KADF;AAEZC,MAAAA,oBAAoB,EAAE;AAFV,KAAb;AAIA,SAAKC,WAAL,GAAmB,KAAKA,WAAL,CAAiBC,IAAjB,CAAuB,IAAvB,CAAnB;AACA,SAAKC,aAAL,GAAqB,KAAKA,aAAL,CAAmBD,IAAnB,CAAyB,IAAzB,CAArB;AACA;;AAEDC,EAAAA,aAAa,CAAEC,KAAF,EAAU;AACtB,UAAM;AAAEC,MAAAA;AAAF,QAAaD,KAAK,CAACE,WAAN,CAAkBC,MAArC;;AACA,QAAKF,MAAM,KAAK,KAAKP,KAAL,CAAWE,oBAA3B,EAAkD;AACjD,WAAKQ,QAAL,CAAe;AAAER,QAAAA,oBAAoB,EAAEK;AAAxB,OAAf;AACA;AACD;;AAEDJ,EAAAA,WAAW,GAAG;AACb,QAAK,KAAKN,KAAV,EAAkB;AACjB,UAAK,KAAKc,MAAV,EAAmB;AAClB,aAAKA,MAAL,CAAYC,uBAAZ;AACA;AACD,KAJD,MAIO;AACN,YAAM;AAAEC,QAAAA;AAAF,UAAa,KAAKC,KAAxB;;AACA,UAAKD,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,QAAQ,EAAG,KAAKI,aAXjB;AAYC,MAAA,6BAA6B,EAAG,MAAM;AACrC,aAAKK,QAAL,CAAe;AAAET,UAAAA,YAAY,EAAE;AAAhB,SAAf;AACA,OAdF;AAeC,MAAA,4BAA4B,EAAG,MAAM;AACpC,aAAKS,QAAL,CAAe;AAAET,UAAAA,YAAY,EAAE;AAAhB,SAAf;AACA;AAjBF,OADD,EAoBGgC,cAAc,IACf;AACA;AACA,gCAAC,6BAAD;AACC,MAAA,QAAQ,EAAG,CAAEF,UADd;AAEC,MAAA,OAAO,EAAG,KAAK5B,WAFhB;AAGC,MAAA,KAAK,EAAG,CAAE6B,KAAF,EAASE,gBAAOG,gBAAhB;AAHT,OAKC,4BAAC,iBAAD;AAAM,MAAA,KAAK,EAAGH,gBAAOI;AAArB,MALD,EAMC,4BAAC,gBAAD;AACC,MAAA,IAAI,EAAGC,qBADR;AAEC,MAAA,KAAK,EAAGL,gBAAOM,QAFhB;AAGC,MAAA,IAAI,EAAGN,gBAAOM,QAAP,CAAgBC;AAHxB,MAND,CAvBF,CADD;AAuCA;;AA3G4B;;eA8GfhD,K","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { Icon } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * External dependencies\n */\nimport { View, TouchableOpacity, Platform, Linking, Alert } from 'react-native';\nimport { default as VideoPlayer } from 'react-native-video';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport PlayIcon from './gridicon-play';\n\n// Default Video ratio 16:9\nexport const VIDEO_ASPECT_RATIO = 16 / 9;\n\nclass Video extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.isIOS = Platform.OS === 'ios';\n\t\tthis.state = {\n\t\t\tisFullScreen: false,\n\t\t\tvideoContainerHeight: 0,\n\t\t};\n\t\tthis.onPressPlay = this.onPressPlay.bind( this );\n\t\tthis.onVideoLayout = this.onVideoLayout.bind( this );\n\t}\n\n\tonVideoLayout( event ) {\n\t\tconst { height } = event.nativeEvent.layout;\n\t\tif ( height !== this.state.videoContainerHeight ) {\n\t\t\tthis.setState( { videoContainerHeight: height } );\n\t\t}\n\t}\n\n\tonPressPlay() {\n\t\tif ( this.isIOS ) {\n\t\t\tif ( this.player ) {\n\t\t\t\tthis.player.presentFullscreenPlayer();\n\t\t\t}\n\t\t} else {\n\t\t\tconst { source } = this.props;\n\t\t\tif ( source && source.uri ) {\n\t\t\t\tthis.openURL( source.uri );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Tries opening the URL outside of the app\n\topenURL( url ) {\n\t\tLinking.canOpenURL( url )\n\t\t\t.then( ( supported ) => {\n\t\t\t\tif ( ! supported ) {\n\t\t\t\t\tAlert.alert(\n\t\t\t\t\t\t__( 'Problem opening the video' ),\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'No application can handle this request. Please install a Web browser.'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\twindow.console.warn(\n\t\t\t\t\t\t'No application found that can open the video with URL: ' +\n\t\t\t\t\t\t\turl\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\treturn Linking.openURL( url );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( err ) => {\n\t\t\t\tAlert.alert(\n\t\t\t\t\t__( 'Problem opening the video' ),\n\t\t\t\t\t__( 'An unknown error occurred. Please try again.' )\n\t\t\t\t);\n\t\t\t\twindow.console.error(\n\t\t\t\t\t'An error occurred while opening the video URL: ' + url,\n\t\t\t\t\terr\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\trender() {\n\t\tconst { isSelected, style } = this.props;\n\t\tconst { isFullScreen, videoContainerHeight } = this.state;\n\t\tconst showPlayButton = videoContainerHeight > 0;\n\n\t\treturn (\n\t\t\t<View style={ styles.videoContainer }>\n\t\t\t\t<VideoPlayer\n\t\t\t\t\t{ ...this.props }\n\t\t\t\t\tref={ ( ref ) => {\n\t\t\t\t\t\tthis.player = ref;\n\t\t\t\t\t} }\n\t\t\t\t\t// Using built-in player controls is messing up the layout on iOS.\n\t\t\t\t\t// So we are setting controls=false and adding a play button that\n\t\t\t\t\t// will trigger presentFullscreenPlayer()\n\t\t\t\t\tcontrols={ false }\n\t\t\t\t\tignoreSilentSwitch={ 'ignore' }\n\t\t\t\t\tpaused={ ! isFullScreen }\n\t\t\t\t\tonLayout={ this.onVideoLayout }\n\t\t\t\t\tonFullscreenPlayerWillPresent={ () => {\n\t\t\t\t\t\tthis.setState( { isFullScreen: true } );\n\t\t\t\t\t} }\n\t\t\t\t\tonFullscreenPlayerDidDismiss={ () => {\n\t\t\t\t\t\tthis.setState( { isFullScreen: false } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ showPlayButton && (\n\t\t\t\t\t// If we add the play icon as a subview to VideoPlayer then react-native-video decides to show control buttons\n\t\t\t\t\t// even if we set controls={ false }, so we are adding our play button as a sibling overlay view.\n\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\t\t\tonPress={ this.onPressPlay }\n\t\t\t\t\t\tstyle={ [ style, styles.overlayContainer ] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ styles.blackOverlay } />\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ PlayIcon }\n\t\t\t\t\t\t\tstyle={ styles.playIcon }\n\t\t\t\t\t\t\tsize={ styles.playIcon.size }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t) }\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default Video;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/video-player/index.native.js"],"names":["VIDEO_ASPECT_RATIO","Video","Component","constructor","arguments","isIOS","Platform","OS","state","isFullScreen","videoContainerHeight","onPressPlay","bind","onVideoLayout","event","height","nativeEvent","layout","setState","player","presentFullscreenPlayer","source","props","uri","openURL","url","Linking","canOpenURL","then","supported","Alert","alert","window","console","warn","catch","err","error","render","isSelected","style","showPlayButton","styles","videoContainer","ref","overlayContainer","blackOverlay","PlayIcon","playIcon","size"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAKA;;AACA;;AAjBA;AACA;AACA;;AAKA;AACA;AACA;;AAIA;AACA;AACA;AAIA;AACO,MAAMA,kBAAkB,GAAG,KAAK,CAAhC;;;AAEP,MAAMC,KAAN,SAAoBC,kBAApB,CAA8B;AAC7BC,EAAAA,WAAW,GAAG;AACb,UAAO,GAAGC,SAAV;AACA,SAAKC,KAAL,GAAaC,sBAASC,EAAT,KAAgB,KAA7B;AACA,SAAKC,KAAL,GAAa;AACZC,MAAAA,YAAY,EAAE,KADF;AAEZC,MAAAA,oBAAoB,EAAE;AAFV,KAAb;AAIA,SAAKC,WAAL,GAAmB,KAAKA,WAAL,CAAiBC,IAAjB,CAAuB,IAAvB,CAAnB;AACA,SAAKC,aAAL,GAAqB,KAAKA,aAAL,CAAmBD,IAAnB,CAAyB,IAAzB,CAArB;AACA;;AAEDC,EAAAA,aAAa,CAAEC,KAAF,EAAU;AACtB,UAAM;AAAEC,MAAAA;AAAF,QAAaD,KAAK,CAACE,WAAN,CAAkBC,MAArC;;AACA,QAAKF,MAAM,KAAK,KAAKP,KAAL,CAAWE,oBAA3B,EAAkD;AACjD,WAAKQ,QAAL,CAAe;AAAER,QAAAA,oBAAoB,EAAEK;AAAxB,OAAf;AACA;AACD;;AAEDJ,EAAAA,WAAW,GAAG;AACb,QAAK,KAAKN,KAAV,EAAkB;AACjB,UAAK,KAAKc,MAAV,EAAmB;AAClB,aAAKA,MAAL,CAAYC,uBAAZ;AACA;AACD,KAJD,MAIO;AACN,YAAM;AAAEC,QAAAA;AAAF,UAAa,KAAKC,KAAxB;;AACA,UAAKD,MAAM,IAAIA,MAAM,CAACE,GAAtB,EAA4B;AAC3B,aAAKC,OAAL,CAAcH,MAAM,CAACE,GAArB;AACA;AACD;AACD,GA9B4B,CA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AAAhB,SAAf;AACA,OAdF;AAeC,MAAA,4BAA4B,EAAG,MAAM;AACpC,aAAKS,QAAL,CAAe;AAAET,UAAAA,YAAY,EAAE;AAAhB,SAAf;AACA;AAjBF,MADD,EAoBGgC,cAAc,IACf;AACA;AACA,gCAAC,6BAAD;AACC,MAAA,QAAQ,EAAG,CAAEF,UADd;AAEC,MAAA,OAAO,EAAG,KAAK5B,WAFhB;AAGC,MAAA,KAAK,EAAG,CAAE6B,KAAF,EAASE,gBAAOG,gBAAhB;AAHT,OAKC,4BAAC,iBAAD;AAAM,MAAA,KAAK,EAAGH,gBAAOI;AAArB,MALD,EAMC,4BAAC,gBAAD;AACC,MAAA,IAAI,EAAGC,qBADR;AAEC,MAAA,KAAK,EAAGL,gBAAOM,QAFhB;AAGC,MAAA,IAAI,EAAGN,gBAAOM,QAAP,CAAgBC;AAHxB,MAND,CAvBF,CADD;AAuCA;;AA3G4B;;eA8GfhD,K","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { Icon } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * External dependencies\n */\nimport { View, TouchableOpacity, Platform, Linking, Alert } from 'react-native';\nimport { default as VideoPlayer } from 'react-native-video';\n\n/**\n * Internal dependencies\n */\nimport styles from './styles.scss';\nimport PlayIcon from './gridicon-play';\n\n// Default Video ratio 16:9\nexport const VIDEO_ASPECT_RATIO = 16 / 9;\n\nclass Video extends Component {\n\tconstructor() {\n\t\tsuper( ...arguments );\n\t\tthis.isIOS = Platform.OS === 'ios';\n\t\tthis.state = {\n\t\t\tisFullScreen: false,\n\t\t\tvideoContainerHeight: 0,\n\t\t};\n\t\tthis.onPressPlay = this.onPressPlay.bind( this );\n\t\tthis.onVideoLayout = this.onVideoLayout.bind( this );\n\t}\n\n\tonVideoLayout( event ) {\n\t\tconst { height } = event.nativeEvent.layout;\n\t\tif ( height !== this.state.videoContainerHeight ) {\n\t\t\tthis.setState( { videoContainerHeight: height } );\n\t\t}\n\t}\n\n\tonPressPlay() {\n\t\tif ( this.isIOS ) {\n\t\t\tif ( this.player ) {\n\t\t\t\tthis.player.presentFullscreenPlayer();\n\t\t\t}\n\t\t} else {\n\t\t\tconst { source } = this.props;\n\t\t\tif ( source && source.uri ) {\n\t\t\t\tthis.openURL( source.uri );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Tries opening the URL outside of the app\n\topenURL( url ) {\n\t\tLinking.canOpenURL( url )\n\t\t\t.then( ( supported ) => {\n\t\t\t\tif ( ! supported ) {\n\t\t\t\t\tAlert.alert(\n\t\t\t\t\t\t__( 'Problem opening the video' ),\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'No application can handle this request. Please install a Web browser.'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t\twindow.console.warn(\n\t\t\t\t\t\t'No application found that can open the video with URL: ' +\n\t\t\t\t\t\t\turl\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\treturn Linking.openURL( url );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( err ) => {\n\t\t\t\tAlert.alert(\n\t\t\t\t\t__( 'Problem opening the video' ),\n\t\t\t\t\t__( 'An unknown error occurred. Please try again.' )\n\t\t\t\t);\n\t\t\t\twindow.console.error(\n\t\t\t\t\t'An error occurred while opening the video URL: ' + url,\n\t\t\t\t\terr\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\trender() {\n\t\tconst { isSelected, style } = this.props;\n\t\tconst { isFullScreen, videoContainerHeight } = this.state;\n\t\tconst showPlayButton = videoContainerHeight > 0;\n\n\t\treturn (\n\t\t\t<View style={ styles.videoContainer }>\n\t\t\t\t<VideoPlayer\n\t\t\t\t\t{ ...this.props }\n\t\t\t\t\tref={ ( ref ) => {\n\t\t\t\t\t\tthis.player = ref;\n\t\t\t\t\t} }\n\t\t\t\t\t// Using built-in player controls is messing up the layout on iOS.\n\t\t\t\t\t// So we are setting controls=false and adding a play button that\n\t\t\t\t\t// will trigger presentFullscreenPlayer()\n\t\t\t\t\tcontrols={ false }\n\t\t\t\t\tignoreSilentSwitch={ 'ignore' }\n\t\t\t\t\tpaused={ ! isFullScreen }\n\t\t\t\t\tonLayout={ this.onVideoLayout }\n\t\t\t\t\tonFullscreenPlayerWillPresent={ () => {\n\t\t\t\t\t\tthis.setState( { isFullScreen: true } );\n\t\t\t\t\t} }\n\t\t\t\t\tonFullscreenPlayerDidDismiss={ () => {\n\t\t\t\t\t\tthis.setState( { isFullScreen: false } );\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t\t{ showPlayButton && (\n\t\t\t\t\t// If we add the play icon as a subview to VideoPlayer then react-native-video decides to show control buttons\n\t\t\t\t\t// even if we set controls={ false }, so we are adding our play button as a sibling overlay view.\n\t\t\t\t\t<TouchableOpacity\n\t\t\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\t\t\tonPress={ this.onPressPlay }\n\t\t\t\t\t\tstyle={ [ style, styles.overlayContainer ] }\n\t\t\t\t\t>\n\t\t\t\t\t\t<View style={ styles.blackOverlay } />\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\ticon={ PlayIcon }\n\t\t\t\t\t\t\tstyle={ styles.playIcon }\n\t\t\t\t\t\t\tsize={ styles.playIcon.size }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TouchableOpacity>\n\t\t\t\t) }\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default Video;\n"]}
@@ -24,13 +24,12 @@ var _icons = require("@wordpress/icons");
24
24
  /**
25
25
  * WordPress dependencies
26
26
  */
27
- function Warning(_ref) {
28
- let {
29
- className,
30
- actions,
31
- children,
32
- secondaryActions
33
- } = _ref;
27
+ function Warning({
28
+ className,
29
+ actions,
30
+ children,
31
+ secondaryActions
32
+ }) {
34
33
  return (0, _element.createElement)("div", {
35
34
  style: {
36
35
  display: 'contents',
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/warning/index.js"],"names":["Warning","className","actions","children","secondaryActions","display","all","Children","count","map","action","i","moreHorizontal","position","item","pos","onClick","title"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMA,SAASA,OAAT,OAAuE;AAAA,MAArD;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,OAAb;AAAsBC,IAAAA,QAAtB;AAAgCC,IAAAA;AAAhC,GAAqD;AACtE,SACC;AAAK,IAAA,KAAK,EAAG;AAAEC,MAAAA,OAAO,EAAE,UAAX;AAAuBC,MAAAA,GAAG,EAAE;AAA5B;AAAb,KACC;AAAK,IAAA,SAAS,EAAG,yBAAYL,SAAZ,EAAuB,sBAAvB;AAAjB,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAG,IAAA,SAAS,EAAC;AAAb,KACGE,QADH,CADD,EAKG,CAAEI,kBAASC,KAAT,CAAgBN,OAAhB,IAA4B,CAA5B,IAAiCE,gBAAnC,KACD;AAAK,IAAA,SAAS,EAAC;AAAf,KACGG,kBAASC,KAAT,CAAgBN,OAAhB,IAA4B,CAA5B,IACDK,kBAASE,GAAT,CAAcP,OAAd,EAAuB,CAAEQ,MAAF,EAAUC,CAAV,KACtB;AACC,IAAA,GAAG,EAAGA,CADP;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGD,MAJH,CADD,CAFF,EAUGN,gBAAgB,IACjB,4BAAC,wBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,IAAI,EAAGQ,qBAFR;AAGC,IAAA,KAAK,EAAG,cAAI,cAAJ,CAHT;AAIC,IAAA,YAAY,EAAG;AACdC,MAAAA,QAAQ,EAAE,aADI;AAEdZ,MAAAA,SAAS,EACR;AAHa,KAJhB;AASC,IAAA,OAAO;AATR,KAWG,MACD,4BAAC,qBAAD,QACGG,gBAAgB,CAACK,GAAjB,CACD,CAAEK,IAAF,EAAQC,GAAR,KACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAGD,IAAI,CAACE,OADhB;AAEC,IAAA,GAAG,EAAGD;AAFP,KAIGD,IAAI,CAACG,KAJR,CAFA,CADH,CAZF,CAXF,CANF,CADD,CADD,CADD;AAqDA;AAED;AACA;AACA;;;eACejB,O","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Children } from '@wordpress/element';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { moreHorizontal } from '@wordpress/icons';\n\nfunction Warning( { className, actions, children, secondaryActions } ) {\n\treturn (\n\t\t<div style={ { display: 'contents', all: 'initial' } }>\n\t\t\t<div className={ classnames( className, 'block-editor-warning' ) }>\n\t\t\t\t<div className=\"block-editor-warning__contents\">\n\t\t\t\t\t<p className=\"block-editor-warning__message\">\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</p>\n\n\t\t\t\t\t{ ( Children.count( actions ) > 0 || secondaryActions ) && (\n\t\t\t\t\t\t<div className=\"block-editor-warning__actions\">\n\t\t\t\t\t\t\t{ Children.count( actions ) > 0 &&\n\t\t\t\t\t\t\t\tChildren.map( actions, ( action, i ) => (\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-warning__action\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ action }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t{ secondaryActions && (\n\t\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-warning__secondary\"\n\t\t\t\t\t\t\t\t\ticon={ moreHorizontal }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'More options' ) }\n\t\t\t\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\t\t\t\tposition: 'bottom left',\n\t\t\t\t\t\t\t\t\t\tclassName:\n\t\t\t\t\t\t\t\t\t\t\t'block-editor-warning__dropdown',\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tnoIcons\n\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<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t\t{ secondaryActions.map(\n\t\t\t\t\t\t\t\t\t\t\t\t( item, pos ) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ item.onClick }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={ pos }\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ item.title }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/warning/README.md\n */\nexport default Warning;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/warning/index.js"],"names":["Warning","className","actions","children","secondaryActions","display","all","Children","count","map","action","i","moreHorizontal","position","item","pos","onClick","title"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AAXA;AACA;AACA;;AAGA;AACA;AACA;AAMA,SAASA,OAAT,CAAkB;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,OAAb;AAAsBC,EAAAA,QAAtB;AAAgCC,EAAAA;AAAhC,CAAlB,EAAuE;AACtE,SACC;AAAK,IAAA,KAAK,EAAG;AAAEC,MAAAA,OAAO,EAAE,UAAX;AAAuBC,MAAAA,GAAG,EAAE;AAA5B;AAAb,KACC;AAAK,IAAA,SAAS,EAAG,yBAAYL,SAAZ,EAAuB,sBAAvB;AAAjB,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAG,IAAA,SAAS,EAAC;AAAb,KACGE,QADH,CADD,EAKG,CAAEI,kBAASC,KAAT,CAAgBN,OAAhB,IAA4B,CAA5B,IAAiCE,gBAAnC,KACD;AAAK,IAAA,SAAS,EAAC;AAAf,KACGG,kBAASC,KAAT,CAAgBN,OAAhB,IAA4B,CAA5B,IACDK,kBAASE,GAAT,CAAcP,OAAd,EAAuB,CAAEQ,MAAF,EAAUC,CAAV,KACtB;AACC,IAAA,GAAG,EAAGA,CADP;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGD,MAJH,CADD,CAFF,EAUGN,gBAAgB,IACjB,4BAAC,wBAAD;AACC,IAAA,SAAS,EAAC,iCADX;AAEC,IAAA,IAAI,EAAGQ,qBAFR;AAGC,IAAA,KAAK,EAAG,cAAI,cAAJ,CAHT;AAIC,IAAA,YAAY,EAAG;AACdC,MAAAA,QAAQ,EAAE,aADI;AAEdZ,MAAAA,SAAS,EACR;AAHa,KAJhB;AASC,IAAA,OAAO;AATR,KAWG,MACD,4BAAC,qBAAD,QACGG,gBAAgB,CAACK,GAAjB,CACD,CAAEK,IAAF,EAAQC,GAAR,KACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAGD,IAAI,CAACE,OADhB;AAEC,IAAA,GAAG,EAAGD;AAFP,KAIGD,IAAI,CAACG,KAJR,CAFA,CADH,CAZF,CAXF,CANF,CADD,CADD,CADD;AAqDA;AAED;AACA;AACA;;;eACejB,O","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Children } from '@wordpress/element';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { moreHorizontal } from '@wordpress/icons';\n\nfunction Warning( { className, actions, children, secondaryActions } ) {\n\treturn (\n\t\t<div style={ { display: 'contents', all: 'initial' } }>\n\t\t\t<div className={ classnames( className, 'block-editor-warning' ) }>\n\t\t\t\t<div className=\"block-editor-warning__contents\">\n\t\t\t\t\t<p className=\"block-editor-warning__message\">\n\t\t\t\t\t\t{ children }\n\t\t\t\t\t</p>\n\n\t\t\t\t\t{ ( Children.count( actions ) > 0 || secondaryActions ) && (\n\t\t\t\t\t\t<div className=\"block-editor-warning__actions\">\n\t\t\t\t\t\t\t{ Children.count( actions ) > 0 &&\n\t\t\t\t\t\t\t\tChildren.map( actions, ( action, i ) => (\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tkey={ i }\n\t\t\t\t\t\t\t\t\t\tclassName=\"block-editor-warning__action\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{ action }\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t{ secondaryActions && (\n\t\t\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\t\t\tclassName=\"block-editor-warning__secondary\"\n\t\t\t\t\t\t\t\t\ticon={ moreHorizontal }\n\t\t\t\t\t\t\t\t\tlabel={ __( 'More options' ) }\n\t\t\t\t\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t\t\t\t\tposition: 'bottom left',\n\t\t\t\t\t\t\t\t\t\tclassName:\n\t\t\t\t\t\t\t\t\t\t\t'block-editor-warning__dropdown',\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tnoIcons\n\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<MenuGroup>\n\t\t\t\t\t\t\t\t\t\t\t{ secondaryActions.map(\n\t\t\t\t\t\t\t\t\t\t\t\t( item, pos ) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={ item.onClick }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={ pos }\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ item.title }\n\t\t\t\t\t\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/warning/README.md\n */\nexport default Warning;\n"]}